From 6659c7155bb0290cda1fb50d11b50d6320dd1d9c Mon Sep 17 00:00:00 2001 From: jesusalvino Date: Mon, 21 Nov 2022 11:27:42 -0500 Subject: [PATCH 01/11] Hide Nodes --- .../Configuration/PreferenceSettings.cs | 12 ++++ .../Properties/Resources.Designer.cs | 18 ++++++ .../Properties/Resources.en-US.resx | 6 ++ src/DynamoCoreWpf/Properties/Resources.resx | 8 ++- .../ViewModels/Menu/PreferencesViewModel.cs | 33 +++++++++++ .../Views/Menu/PreferencesView.xaml | 59 ++++++++++++++++++- 6 files changed, 134 insertions(+), 2 deletions(-) diff --git a/src/DynamoCore/Configuration/PreferenceSettings.cs b/src/DynamoCore/Configuration/PreferenceSettings.cs index d643381379f..b650669f8f4 100644 --- a/src/DynamoCore/Configuration/PreferenceSettings.cs +++ b/src/DynamoCore/Configuration/PreferenceSettings.cs @@ -497,6 +497,16 @@ public string PythonTemplateFilePath /// public bool EnableNodeAutoComplete { get; set; } + /// + /// This defines if user wants to hide the nodes below a specific confidenc level. + /// + public bool HideNodesBelowSpecificConfidenceLevel { get; set; } + + /// + /// This defines the level of confidence related to the ML recommendation. + /// + public int MLRecommendationConfidenceLevel { get; set; } + /// /// This defines if user wants to see the enabled Dynamo Notification Center. /// @@ -736,6 +746,8 @@ public PreferenceSettings() IsIronPythonDialogDisabled = false; ShowTabsAndSpacesInScriptEditor = false; EnableNodeAutoComplete = true; + HideNodesBelowSpecificConfidenceLevel = false; + MLRecommendationConfidenceLevel = 10; EnableNotificationCenter = true; isStaticSplashScreenEnabled = true; DefaultPythonEngine = string.Empty; diff --git a/src/DynamoCoreWpf/Properties/Resources.Designer.cs b/src/DynamoCoreWpf/Properties/Resources.Designer.cs index 5c4dcc88e7e..d79fd2cd117 100644 --- a/src/DynamoCoreWpf/Properties/Resources.Designer.cs +++ b/src/DynamoCoreWpf/Properties/Resources.Designer.cs @@ -3371,6 +3371,24 @@ public static string HideClassicNodeLibrary { } } + /// + /// Looks up a localized string similar to Hide nodes below a specified confidence level. + /// + public static string HideNodesBelowSpecificConfidenceLevel { + get { + return ResourceManager.GetString("HideNodesBelowSpecificConfidenceLevel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confidence level appears next to each recommended node and represents estimated probability that the node is a good choice. When toggled on, this setting hides recommended nodes that don’t meet the specified confidence level. You can click the Low Confidence header to show the nodes.. + /// + public static string HideNodesBelowSpecificConfidenceLevelInfo { + get { + return ResourceManager.GetString("HideNodesBelowSpecificConfidenceLevelInfo", resourceCulture); + } + } + /// /// Looks up a localized string similar to Hide Wires. /// diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index c7d2b00c7d0..2a5233c7c42 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -3316,6 +3316,12 @@ You can manage this in Preferences -> Security. Your custom settings can be imported here. Settings not exposed via Preferences panel will be applied once Dynamo and any host program restarts. Import Preferences Info. + + Hide nodes below a specified confidence level + + + Confidence level appears next to each recommended node and represents estimated probability that the node is a good choice. When toggled on, this setting hides recommended nodes that don’t meet the specified confidence level. You can click the Low Confidence header to show the nodes. + Import Import Preferences Text. diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index cdcec1cb57b..ca4a5ecccd9 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -3303,7 +3303,13 @@ You can manage this in Preferences -> Security. Your custom settings can be imported here. Settings not exposed via Preferences panel will be applied once Dynamo and any host program restarts. Import Preferences Info. - + + Hide nodes below a specified confidence level + + + Confidence level appears next to each recommended node and represents estimated probability that the node is a good choice. When toggled on, this setting hides recommended nodes that don’t meet the specified confidence level. You can click the Low Confidence header to show the nodes. + + Import Import Preferences Text. diff --git a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs index da253a12371..435527cebe1 100644 --- a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs @@ -280,6 +280,7 @@ public bool NodeAutocompleteMachineLearningIsChecked } dynamoViewModel.HomeSpaceViewModel.NodeAutoCompleteSearchViewModel.ResetAutoCompleteSearchViewState(); RaisePropertyChanged(nameof(nodeAutocompleteSuggestion)); + RaisePropertyChanged(nameof(NodeAutocompleteMachineLearningIsChecked)); } } @@ -853,6 +854,38 @@ public bool NodeAutocompleteIsChecked } } + /// + /// Controls the IsChecked property in the "Hide nodes below a specific confidence level" toogle button + /// + public bool HideNodesBelowSpecificConfidenceLevelIsChecked + { + get + { + return preferenceSettings.HideNodesBelowSpecificConfidenceLevel; + } + set + { + preferenceSettings.HideNodesBelowSpecificConfidenceLevel = value; + RaisePropertyChanged(nameof(HideNodesBelowSpecificConfidenceLevelIsChecked)); + } + } + + /// + /// Contais the confidence level of a ML recommendation + /// + public int MLRecommendationConfidenceLevel + { + get + { + return preferenceSettings.MLRecommendationConfidenceLevel; + } + set + { + preferenceSettings.MLRecommendationConfidenceLevel = value; + RaisePropertyChanged(nameof(MLRecommendationConfidenceLevel)); + } + } + /// /// Controls the IsChecked property in the "Notification Center" toogle button /// diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index ab08878172e..db2fa9bcab4 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -748,9 +748,10 @@ + + + Node Autocomplete + Preferences | Features | Node Autocomplete + Hide nodes below a specified confidence level Confidence level appears next to each recommended node and represents estimated probability that the node is a good choice. When toggled on, this setting hides recommended nodes that don’t meet the specified confidence level. You can click the Low Confidence header to show the nodes. - + + + Numbers of results + Import Import Preferences Text. diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index ca4a5ecccd9..02a458eef4b 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -3303,13 +3303,20 @@ You can manage this in Preferences -> Security. Your custom settings can be imported here. Settings not exposed via Preferences panel will be applied once Dynamo and any host program restarts. Import Preferences Info. + + Node Autocomplete + Preferences | Features | Node Autocomplete + Hide nodes below a specified confidence level Confidence level appears next to each recommended node and represents estimated probability that the node is a good choice. When toggled on, this setting hides recommended nodes that don’t meet the specified confidence level. You can click the Low Confidence header to show the nodes. - + + Numbers of results + + Import Import Preferences Text. diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index db2fa9bcab4..0b440f61c8f 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -546,6 +546,7 @@ + @@ -701,18 +702,17 @@ - - - + + Header="{x:Static p:Resources.PreferencesViewNodeAutocomplete}"> - @@ -726,22 +726,20 @@ Margin="10,0,0,0" VerticalAlignment="Center" Foreground="{StaticResource PreferencesWindowFontColor}"/> - + + - + @@ -780,7 +778,25 @@ - + + + - + + Value="{Binding Path=MLRecommendationConfidenceLevel, Mode=TwoWay}" AutoToolTipPlacement="TopLeft" AutoToolTipPrecision="0" + IsEnabled="{Binding Path=NodeAutocompleteMachineLearningIsChecked}"> - - + + + + + + + + + - + Date: Tue, 22 Nov 2022 16:06:46 -0500 Subject: [PATCH 03/11] Node Autocomplete Section Done --- .../Configuration/PreferenceSettings.cs | 6 + .../ViewModels/Menu/PreferencesViewModel.cs | 124 ++++++++++++------ .../Views/Menu/PreferencesView.xaml | 32 ++++- .../Views/Menu/PreferencesView.xaml.cs | 39 ++++++ 4 files changed, 157 insertions(+), 44 deletions(-) diff --git a/src/DynamoCore/Configuration/PreferenceSettings.cs b/src/DynamoCore/Configuration/PreferenceSettings.cs index b650669f8f4..5bf1b70e40a 100644 --- a/src/DynamoCore/Configuration/PreferenceSettings.cs +++ b/src/DynamoCore/Configuration/PreferenceSettings.cs @@ -507,6 +507,11 @@ public string PythonTemplateFilePath /// public int MLRecommendationConfidenceLevel { get; set; } + /// + /// This defines the number of results of the ML recommendation + /// + public int MLRecommendationNumberOfResults { get; set; } + /// /// This defines if user wants to see the enabled Dynamo Notification Center. /// @@ -748,6 +753,7 @@ public PreferenceSettings() EnableNodeAutoComplete = true; HideNodesBelowSpecificConfidenceLevel = false; MLRecommendationConfidenceLevel = 10; + MLRecommendationNumberOfResults = 5; EnableNotificationCenter = true; isStaticSplashScreenEnabled = true; DefaultPythonEngine = string.Empty; diff --git a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs index 435527cebe1..679ed98bdac 100644 --- a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs @@ -255,34 +255,7 @@ public bool RunSettingsIsChecked } RaisePropertyChanged(nameof(RunSettingsIsChecked)); } - } - - /// - /// Controls if the the Node autocomplete Machine Learning option is checked for the radio buttons - /// - public bool NodeAutocompleteMachineLearningIsChecked - { - get - { - return preferenceSettings.DefaultNodeAutocompleteSuggestion == NodeAutocompleteSuggestion.MLRecommendation; - } - set - { - if (value) - { - preferenceSettings.DefaultNodeAutocompleteSuggestion = NodeAutocompleteSuggestion.MLRecommendation; - nodeAutocompleteSuggestion = NodeAutocompleteSuggestion.MLRecommendation; - } - else - { - preferenceSettings.DefaultNodeAutocompleteSuggestion = NodeAutocompleteSuggestion.ObjectType; - nodeAutocompleteSuggestion = NodeAutocompleteSuggestion.ObjectType; - } - dynamoViewModel.HomeSpaceViewModel.NodeAutoCompleteSearchViewModel.ResetAutoCompleteSearchViewState(); - RaisePropertyChanged(nameof(nodeAutocompleteSuggestion)); - RaisePropertyChanged(nameof(NodeAutocompleteMachineLearningIsChecked)); - } - } + } /// /// Controls the IsChecked property in the Show Run Preview toogle button @@ -531,9 +504,7 @@ public void AddStyle(StyleItem style) }); RaisePropertyChanged(nameof(StyleItemsList)); } - - - + /// /// This flag will be in true when the Style that user is trying to add already exists (otherwise will be false - Default) /// @@ -838,6 +809,24 @@ public bool ShowWhitespaceIsChecked } } + /// + /// Controls the IsChecked property in the "Notification Center" toogle button + /// + public bool NotificationCenterIsChecked + { + get + { + return preferenceSettings.EnableNotificationCenter; + } + set + { + preferenceSettings.EnableNotificationCenter = value; + RaisePropertyChanged(nameof(NotificationCenterIsChecked)); + } + } + + #region [ Node Autocomplete ] + /// /// Controls the IsChecked property in the "Node autocomplete" toogle button /// @@ -851,6 +840,54 @@ public bool NodeAutocompleteIsChecked { preferenceSettings.EnableNodeAutoComplete = value; RaisePropertyChanged(nameof(NodeAutocompleteIsChecked)); + RaisePropertyChanged(nameof(EnableHideNodesToggle)); + RaisePropertyChanged(nameof(EnableConfidenceLevelSlider)); + } + } + + /// + /// Controls if the the Node autocomplete Machine Learning option is checked for the radio buttons + /// + public bool NodeAutocompleteMachineLearningIsChecked + { + get + { + return preferenceSettings.DefaultNodeAutocompleteSuggestion == NodeAutocompleteSuggestion.MLRecommendation; + } + set + { + if (value) + { + preferenceSettings.DefaultNodeAutocompleteSuggestion = NodeAutocompleteSuggestion.MLRecommendation; + nodeAutocompleteSuggestion = NodeAutocompleteSuggestion.MLRecommendation; + } + else + { + preferenceSettings.DefaultNodeAutocompleteSuggestion = NodeAutocompleteSuggestion.ObjectType; + nodeAutocompleteSuggestion = NodeAutocompleteSuggestion.ObjectType; + } + + dynamoViewModel.HomeSpaceViewModel.NodeAutoCompleteSearchViewModel.ResetAutoCompleteSearchViewState(); + RaisePropertyChanged(nameof(nodeAutocompleteSuggestion)); + RaisePropertyChanged(nameof(NodeAutocompleteMachineLearningIsChecked)); + RaisePropertyChanged(nameof(EnableHideNodesToggle)); + RaisePropertyChanged(nameof(EnableConfidenceLevelSlider)); + } + } + + /// + /// Contains the numbers of result of the ML recommendation + /// + public int MLRecommendationNumberOfResults + { + get + { + return preferenceSettings.MLRecommendationNumberOfResults; + } + set + { + preferenceSettings.MLRecommendationNumberOfResults = value; + RaisePropertyChanged(nameof(MLRecommendationNumberOfResults)); } } @@ -867,11 +904,12 @@ public bool HideNodesBelowSpecificConfidenceLevelIsChecked { preferenceSettings.HideNodesBelowSpecificConfidenceLevel = value; RaisePropertyChanged(nameof(HideNodesBelowSpecificConfidenceLevelIsChecked)); + RaisePropertyChanged(nameof(EnableConfidenceLevelSlider)); } - } + } /// - /// Contais the confidence level of a ML recommendation + /// Contains the confidence level of a ML recommendation /// public int MLRecommendationConfidenceLevel { @@ -887,21 +925,29 @@ public int MLRecommendationConfidenceLevel } /// - /// Controls the IsChecked property in the "Notification Center" toogle button + /// If the user can click on the Hide Nodes toggle /// - public bool NotificationCenterIsChecked + public bool EnableHideNodesToggle { get { - return preferenceSettings.EnableNotificationCenter; + return NodeAutocompleteIsChecked && NodeAutocompleteMachineLearningIsChecked; } - set + } + + /// + /// If the user can click on the confidence level Slider + /// + public bool EnableConfidenceLevelSlider + { + get { - preferenceSettings.EnableNotificationCenter = value; - RaisePropertyChanged(nameof(NotificationCenterIsChecked)); + return NodeAutocompleteIsChecked && NodeAutocompleteMachineLearningIsChecked && HideNodesBelowSpecificConfidenceLevelIsChecked; } } + #endregion + /// /// Controls the IsChecked property in the "Enable T-spline nodes" toogle button /// diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index 0b440f61c8f..1b72ead29dc 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -777,6 +777,7 @@ + + + + diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs index 3c9cabe8a07..a06abfce74d 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs @@ -79,6 +79,7 @@ public PreferencesView(DynamoView dynamoView) scaleValue = dynViewModel.ScaleFactorLog; ResetGroupStyleForm(); StoreOriginalCustomGroupStyles(); + displayConfidenceLevel(); viewModel.RequestShowFileDialog += OnRequestShowFileDialog; } @@ -549,5 +550,43 @@ internal void Dispose() { viewModel.RequestShowFileDialog -= OnRequestShowFileDialog; } + + int getExtraLeftSpace(int confidenceLevel) + { + int value = 16; + + for (int i = 1; i <= 9; i++) + { + if (confidenceLevel <= 9) + { + break; + } + else + { + value--; + if ((confidenceLevel == 10) || confidenceLevel >= (i * 10) + 1 && confidenceLevel <= (i + 1) * 10) + { + break; + } + } + } + return value; + } + + private void sliderConfidenceLevel_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) + { + displayConfidenceLevel(); + } + + private void displayConfidenceLevel() + { + if (this.lblConfidenceLevel != null && this.lblConfidenceLevelLabelStart != null) + { + int confidenceLevel = (int)lblConfidenceLevel.Content; + + int left = ((int)lblConfidenceLevel.Content * 3) + getExtraLeftSpace(confidenceLevel); + this.lblConfidenceLevel.Margin = new Thickness(left, -15, 0, 0); + } + } } } From 482aa902503498da5e2d637c376e55a496a28ce5 Mon Sep 17 00:00:00 2001 From: jesusalvino Date: Wed, 23 Nov 2022 09:02:29 -0500 Subject: [PATCH 04/11] Set default number of results as 10 --- src/DynamoCore/Configuration/PreferenceSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DynamoCore/Configuration/PreferenceSettings.cs b/src/DynamoCore/Configuration/PreferenceSettings.cs index 5bf1b70e40a..0db5ad20c50 100644 --- a/src/DynamoCore/Configuration/PreferenceSettings.cs +++ b/src/DynamoCore/Configuration/PreferenceSettings.cs @@ -753,7 +753,7 @@ public PreferenceSettings() EnableNodeAutoComplete = true; HideNodesBelowSpecificConfidenceLevel = false; MLRecommendationConfidenceLevel = 10; - MLRecommendationNumberOfResults = 5; + MLRecommendationNumberOfResults = 10; EnableNotificationCenter = true; isStaticSplashScreenEnabled = true; DefaultPythonEngine = string.Empty; From 8cb1302a912a75ef461d3109309df997e5d10148 Mon Sep 17 00:00:00 2001 From: jesusalvino Date: Wed, 23 Nov 2022 10:09:41 -0500 Subject: [PATCH 05/11] restoring version --- src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs b/src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs index b385e26a6a4..d2fb7ef6cd3 100644 --- a/src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs +++ b/src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Reflection; using System.Resources; using System.Runtime.InteropServices; @@ -45,7 +45,7 @@ // to distinguish one build from another. AssemblyFileVersion is specified // in AssemblyVersionInfo.cs so that it can be easily incremented by the // automated build process. -[assembly: AssemblyVersion("2.17.0.2986")] +[assembly: AssemblyVersion("2.18.0.2986")] // By default, the "Product version" shown in the file properties window is @@ -64,4 +64,4 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyFileVersion("2.17.0.2986")] +[assembly: AssemblyFileVersion("2.18.0.2986")] From de2368bf26f61519b6b1a99d58e3287e190f2059 Mon Sep 17 00:00:00 2001 From: jesusalvino Date: Wed, 23 Nov 2022 10:43:57 -0500 Subject: [PATCH 06/11] restoring entire file --- src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs b/src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs index d2fb7ef6cd3..8c3a4380346 100644 --- a/src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs +++ b/src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Reflection; using System.Resources; using System.Runtime.InteropServices; From f1c22eacc09440dc644c7eb37a3d81ab0909f8b8 Mon Sep 17 00:00:00 2001 From: jesusalvino Date: Wed, 23 Nov 2022 11:34:25 -0500 Subject: [PATCH 07/11] Connect the confidence level and nuber of result settings --- .../ViewModels/Search/NodeAutoCompleteSearchViewModel.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs b/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs index 2ed8d4acbcf..c4877b19274 100644 --- a/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs @@ -35,9 +35,6 @@ public class NodeAutoCompleteSearchViewModel : SearchViewModel private bool displayAutocompleteMLStaticPage; private bool displayLowConfidence; private const string nodeAutocompleteMLEndpoint = "MLNodeAutocomplete"; - private double confidenceThresholdPercentage = 10; - private int numberOfResults = 10; - /// /// Cache of default node suggestions, use it in case where @@ -53,7 +50,7 @@ public bool IsDisplayingMLRecommendation { get { - return dynamoViewModel.PreferenceSettings.DefaultNodeAutocompleteSuggestion == Models.NodeAutocompleteSuggestion.MLRecommendation; + return dynamoViewModel.MLRecommendationConfidenceLevel.DefaultNodeAutocompleteSuggestion == Models.NodeAutocompleteSuggestion.MLRecommendation; } } @@ -153,7 +150,7 @@ private void InitializeDefaultAutoCompleteCandidates() internal MLNodeAutoCompletionRequest GenerateRequestForMLAutocomplete() { // Intialize request for the the ML API - MLNodeAutoCompletionRequest request = new MLNodeAutoCompletionRequest(AssemblyHelper.GetDynamoVersion().ToString(), numberOfResults); + MLNodeAutoCompletionRequest request = new MLNodeAutoCompletionRequest(AssemblyHelper.GetDynamoVersion().ToString(), dynamoViewModel.PreferenceSettings.MLRecommendationNumberOfResults); var nodeInfo = PortViewModel.PortModel.Owner; var portInfo = PortViewModel.PortModel; @@ -355,7 +352,7 @@ internal void DisplayMachineLearningResults() foreach (var result in results) { - if (result.AutoCompletionNodeMachineLearningInfo.ConfidenceScore >= confidenceThresholdPercentage) + if (result.AutoCompletionNodeMachineLearningInfo.ConfidenceScore >= dynamoViewModel.PreferenceSettings.MLRecommendationConfidenceLevel) { FilteredHighConfidenceResults = FilteredHighConfidenceResults.Append(result); } From efd537051862f5bb09e5b689da8ec58c662bbfb6 Mon Sep 17 00:00:00 2001 From: jesusalvino Date: Wed, 23 Nov 2022 11:41:27 -0500 Subject: [PATCH 08/11] Fix --- .../ViewModels/Search/NodeAutoCompleteSearchViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs b/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs index c4877b19274..724c84cd725 100644 --- a/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Search/NodeAutoCompleteSearchViewModel.cs @@ -50,7 +50,7 @@ public bool IsDisplayingMLRecommendation { get { - return dynamoViewModel.MLRecommendationConfidenceLevel.DefaultNodeAutocompleteSuggestion == Models.NodeAutocompleteSuggestion.MLRecommendation; + return dynamoViewModel.PreferenceSettings.DefaultNodeAutocompleteSuggestion == Models.NodeAutocompleteSuggestion.MLRecommendation; } } From 17cdba83fd8d841f0afa4b96d12b290c867a03d4 Mon Sep 17 00:00:00 2001 From: jesusalvino Date: Wed, 23 Nov 2022 12:12:43 -0500 Subject: [PATCH 09/11] Labels --- src/DynamoCoreWpf/Properties/Resources.Designer.cs | 10 +++++----- src/DynamoCoreWpf/Properties/Resources.en-US.resx | 10 +++++----- src/DynamoCoreWpf/Properties/Resources.resx | 10 +++++----- src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/DynamoCoreWpf/Properties/Resources.Designer.cs b/src/DynamoCoreWpf/Properties/Resources.Designer.cs index 394298ed000..b3236557c91 100644 --- a/src/DynamoCoreWpf/Properties/Resources.Designer.cs +++ b/src/DynamoCoreWpf/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -3903,7 +3903,7 @@ public static string LogoutMenuItemText { } /// - /// Looks up a localized string similar to ML Recommendation. + /// Looks up a localized string similar to Recommended Nodes. /// public static string MachineLearning { get { @@ -4865,7 +4865,7 @@ public static string NullString { } /// - /// Looks up a localized string similar to Object type. + /// Looks up a localized string similar to Node Type Match. /// public static string ObjectType { get { @@ -6428,7 +6428,7 @@ public static string PortViewContextMenuUserDefaultValue { } /// - /// Looks up a localized string similar to Default method. + /// Looks up a localized string similar to Default Ranking Method. /// public static string PreferencesNodeAutocompleteMethod { get { @@ -6558,7 +6558,7 @@ public static string PreferencesViewEmptyStyleWarning { } /// - /// Looks up a localized string similar to Node Autocomplete. + /// Looks up a localized string similar to Enable Node Autocomplete. /// public static string PreferencesViewEnableNodeAutoComplete { get { diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index 83532d02661..8e69ccf019b 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -2262,7 +2262,7 @@ Uninstall the following packages: {0}? Preferences | Features | Python | Default Python Engine - Node Autocomplete + Enable Node Autocomplete Preferences | Features | Experimental | Enable Node Auto Complete @@ -2321,15 +2321,15 @@ Uninstall the following packages: {0}? Label used in the general tab - Default method + Default Ranking Method Label used in the features tab - Object type + Node Type Match Label used in the features tab - ML Recommendation + Recommended Nodes Label used in the features tab @@ -3485,4 +3485,4 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in When toggled on, a preview of the node’s output will be displayed when hovering over the bottom of a node. - \ No newline at end of file + diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index b81c56d20f2..38f64443048 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -2482,7 +2482,7 @@ Uninstall the following packages: {0}? Preferences | Features | Python | Default Python Engine - Node Autocomplete + Enable Node Autocomplete Preferences | Features | Experimental | Enable Node Auto Complete @@ -2537,15 +2537,15 @@ Uninstall the following packages: {0}? Label used in the general tab - Default method + Default Ranking Method Label used in the features tab - Object type + Node Type Match Label used in the features tab - ML Recommendation + Recommended Nodes Label used in the features tab @@ -3472,4 +3472,4 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in When toggled on, a preview of the node’s output will be displayed when hovering over the bottom of a node. - \ No newline at end of file + diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index 81524b0d524..46e61ea65c3 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -722,7 +722,8 @@ VerticalAlignment="Center" IsChecked="{Binding Path=NodeAutocompleteIsChecked}" Style="{StaticResource EllipseToggleButton1}"/> - - public static string MachineLearning { - get { - return ResourceManager.GetString("MachineLearning", resourceCulture); - } - } - /// /// Looks up a localized string similar to You must provide a Major version as a non-negative integer.. /// @@ -7605,6 +7596,15 @@ public static string RecentFileNumberInfo { } } + /// + /// Looks up a localized string similar to Recommended Nodes. + /// + public static string RecommendedNodes { + get { + return ResourceManager.GetString("RecommendedNodes", resourceCulture); + } + } + /// /// Looks up a localized string similar to Please check if you intended to render this amount of geometry, and consider turning off the preview of other nodes within your graph, lowering the amount of Geometry you wish to render, or turning down the render precision.. /// diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index 8e69ccf019b..8c9835aeca5 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -2328,7 +2328,7 @@ Uninstall the following packages: {0}? Node Type Match Label used in the features tab - + Recommended Nodes Label used in the features tab diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index 38f64443048..996dedc4dcf 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -2544,7 +2544,7 @@ Uninstall the following packages: {0}? Node Type Match Label used in the features tab - + Recommended Nodes Label used in the features tab diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index 46e61ea65c3..b1c90119cf6 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -769,7 +769,7 @@ MinWidth="90" Style="{StaticResource RunSettingsRadioButtons}" IsChecked="{Binding Path=NodeAutocompleteMachineLearningIsChecked, Converter={StaticResource BinaryRadioButtonCheckedConverter},ConverterParameter=True}" - Content="{x:Static p:Resources.MachineLearning}" + Content="{x:Static p:Resources.RecommendedNodes}" IsEnabled="{Binding Path=NodeAutocompleteIsChecked}"/> From e3f39192d814ef04a336133ea57ab53417df1500 Mon Sep 17 00:00:00 2001 From: jesusalvino Date: Wed, 23 Nov 2022 16:06:39 -0500 Subject: [PATCH 11/11] Updating the Settings properties for copy test --- test/settings/DynamoSettings-NewSettings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/settings/DynamoSettings-NewSettings.xml b/test/settings/DynamoSettings-NewSettings.xml index 40b7d904e5a..77f3a929b0e 100644 --- a/test/settings/DynamoSettings-NewSettings.xml +++ b/test/settings/DynamoSettings-NewSettings.xml @@ -62,6 +62,9 @@ true true false + true + 99 + 5 false false