Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DYN-7117 Node Cluster Placement and Performance SPIKE #15384

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Single Node Placement and Performance report
  • Loading branch information
QilongTang committed Jul 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 7a7bbf3f1398bda495374fac23669848e9e68314
4 changes: 2 additions & 2 deletions src/DynamoCoreWpf/Commands/PortCommands.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Dynamo.UI.Commands;
using Dynamo.UI.Commands;

namespace Dynamo.ViewModels
{
@@ -32,7 +32,7 @@ public DelegateCommand NodeAutoCompleteCommand
get
{
if (autoCompleteCommand == null)
autoCompleteCommand = new DelegateCommand(AutoComplete, CanAutoComplete);
autoCompleteCommand = new DelegateCommand(AutoCompleteCluster, CanAutoComplete);

return autoCompleteCommand;
}
27 changes: 26 additions & 1 deletion src/DynamoCoreWpf/ViewModels/Core/PortViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using Dynamo.Graph.Nodes;
using Dynamo.Models;
using Dynamo.UI.Commands;
using Dynamo.Utilities;

@@ -416,6 +417,30 @@ private void AutoComplete(object parameter)
wsViewModel.OnRequestNodeAutoCompleteSearch(ShowHideFlags.Show);
}

// Handler to invoke Node AutoComplete cluster placement as a test
private void AutoCompleteCluster(object parameter)
{
// Put a C# timer here to test the cluster placement
Stopwatch stopwatch = Stopwatch.StartNew();

var wsViewModel = node.WorkspaceViewModel;
wsViewModel.NodeAutoCompleteSearchViewModel.PortViewModel = this;

// If the input port is disconnected by the 'Connect' command while triggering Node AutoComplete, undo the port disconnection.
if (this.inputPortDisconnectedByConnectCommand)
{
wsViewModel.DynamoViewModel.Model.CurrentWorkspace.Undo();
}

// Bail out from connect state
wsViewModel.CancelActiveState();
wsViewModel.NodeAutoCompleteSearchViewModel.DefaultResults.LastOrDefault().CreateAndConnectCommand.Execute(wsViewModel.NodeAutoCompleteSearchViewModel.PortViewModel.PortModel);
wsViewModel.Nodes.LastOrDefault().IsFrozen = true;

stopwatch.Stop(); // Stop the stopwatch
wsViewModel.DynamoViewModel.Model.Logger.Log($"Execution Time: {stopwatch.ElapsedMilliseconds} ms");
}

private void NodePortContextMenu(object obj)
{
// If this port does not display a Chevron button to open the context menu and it doesn't
Loading