-
Notifications
You must be signed in to change notification settings - Fork 675
DYN-9032 - add debug for dumping node icons #16293
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
Changes from all commits
016d383
3ae9063
d359738
aa2508a
666e1a2
f4b03bd
789ec72
8599b4b
c876133
f3b5010
f68883d
2cfa65e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4302,6 +4302,45 @@ internal void DumpNodeHelpData(object parameter) | |
| File.WriteAllText(fullFileName, stat.ToString()); | ||
| } | ||
|
|
||
| internal void DumpNodeIconData(object parameter) | ||
| { | ||
| //set to manual run mode to prevent execution of the nodes as wel place them | ||
| this.HomeSpace.RunSettings.RunType = RunType.Manual; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For manual run mode? Because I’m placing real nodes to get their view model which reports the icon source. Node model and node search element don’t report icon source. And placing real nodes causes hangups if on run automatic because of default values.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did I understand this correctly - you're placing nodes in the canvas that don't have icons to identify them so icons can be added for them?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To my knowledge, one of the easiest ways to find if a node has an icon is to get its view model and get ‘IconSource’, so I’m placing the nodes on the canvas to get that and it also serves as a way for the end user to see the nodes themselves. This is all for a tool to help identify nodes with missing icons. |
||
|
|
||
| string nodesWithoutIconsFileName = String.Format("NodesWithoutIcons_{0}.csv", DateTime.Now.ToString("yyyyMMddHmmss")); | ||
| string nodesWithoutIconsFullFileName = Path.Combine(Model.PathManager.LogDirectory, nodesWithoutIconsFileName); | ||
|
|
||
| //creating a copy to avoid collection changed exceptions | ||
| var entriesCopy = Model.SearchModel.Entries.Where(n => n.IsVisibleInSearch).ToList(); | ||
|
|
||
| StreamWriter sw = File.CreateText(nodesWithoutIconsFullFileName); | ||
|
|
||
| sw.WriteLine("NODE ASSEMBLY,NODE NAME"); | ||
|
|
||
| foreach (var nse in entriesCopy) | ||
| { | ||
| var newNode = nse.CreateNode(); | ||
| this.CurrentSpace.AddAndRegisterNode(newNode); | ||
| var placedNode = this.CurrentSpaceViewModel.Nodes.Last(); | ||
| var imageSource = placedNode.ImageSource; | ||
|
|
||
| //if image source is null, then no icon is found | ||
| if (imageSource is null) | ||
|
johnpierson marked this conversation as resolved.
|
||
| { | ||
| sw.WriteLine($"{nse.Assembly},{nse.Name}"); | ||
| } | ||
| else | ||
| { | ||
| this.Model.ExecuteCommand(new DynamoModel.DeleteModelCommand(placedNode.Id)); | ||
| } | ||
| } | ||
|
|
||
| sw.Close(); | ||
|
|
||
| //alert user to new file location | ||
| MainGuideManager.CreateRealTimeInfoWindow(string.Format(Resources.NodeIconDataIsDumped, nodesWithoutIconsFullFileName), true); | ||
| } | ||
|
|
||
| private FileInfo GetMatchingDocFromDirectory(string nodeName, string hash, List<string> suffix, DirectoryInfo dir) | ||
| { | ||
| FileInfo matchingFile = null; | ||
|
|
@@ -4325,6 +4364,10 @@ internal bool CanDumpNodeHelpData(object obj) | |
| { | ||
| return true; | ||
| } | ||
| internal bool CanDumpNodeIconData(object obj) | ||
| { | ||
| return true; | ||
| } | ||
|
|
||
| #region Shutdown related methods | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.