-
Notifications
You must be signed in to change notification settings - Fork 636
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-6052 Add node info event and API under DynamoServices package for ProtoCore #14234
Conversation
public Guid GraphNodeGuid; | ||
public int AstID; | ||
public string Filename; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish we didn’t have to expose more APIs from the engine level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did look at it but unfortunately because the current public interface ILiveRunner
setup, the function involved needs to be public and also the return object as well. VS does throw errors if trying to make this internal. I have made as much as I can internal or private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really a good candidate for a struct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjkkirschner I am not sure but maybe we could break these changes in 3.0. Right now I am just following the previous design for all these engine related code
continue; | ||
using (node.PropertyChangeManager.SetPropsToSuppress(nameof(NodeModel.ToolTipText), nameof(NodeModel.Infos), nameof(NodeModel.State))) | ||
{ | ||
node.Info(string.Join(Environment.NewLine, info.Value.Select(w => w.Message))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the place where we would display node info returned from libG
@@ -99,6 +139,7 @@ public void ClearWarningForExpression(int expressionID) | |||
using (rwl.CreateWriteLock()) | |||
{ | |||
warnings.RemoveAll(w => w.ExpressionID == expressionID); | |||
infos.RemoveAll(w => w.ExpressionID == expressionID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aparajit-pratap I am not 100% sure about the usage of these function or if infos need to be reset. But I guess we want to clear the runtime infos every time graph runs. Please correct me if I was wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be tricky. In the case of geometry scale info messages, we would want it to be associated with node execution, while in other contexts, it may just be a static info message that has nothing to do with the node execution, in which case this may not be applicable.
public static class LogInfoMessageEvents | ||
{ | ||
public static event LogInfoMessageEventHandler LogInfoMessage; | ||
public static void OnLogInfoMessage(string message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new API ProtoGeometry will call to raise info instead of warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@QilongTang I tried an alternative approach using VMDataBridge in the referenced PR, please check it out. It avoids having to make these many changes at the VM level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@QilongTang I'm okay with going ahead with this PR instead of mine as I wasn't able to figure out how to clear Info messages using the VM Databridge approach. If you could address review comments made so far, that would be great.
Addressed the comments, the unit test with an example of a large number node triggering info cant be tested without the change to libG side. So I may merge this first and have a follow-up PR to add unit test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more comments.
Since we do not have 3.0 build working yet, I will have to merge to master -> cherry-pick to 2.19 branch and then use a 2.19 beta nuget to test. Merging. |
… ProtoCore (#14234) * Add node info event and API * Update * Update * clean up * remove line and column from InfoEntry * comments * clean up * clean up
Please Note:
DynamoRevit
repo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after aLGTM
label is added to the PR.Purpose
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
(FILL ME IN) Brief description of the fix / enhancement. Mandatory section
Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of