Repository navigation
fix(opctreemanager): resolve an empty OPC group (#137) - #145
Merged
Merged
Conversation
FindGroup picked the target by OpcUaScadaItem.IsGroup, a derived property (Items != null && Items.Count > 0). A folder whose children are all disabled in the OPC server GUI holds nothing, so the group was reported as not found and the rebuild refused to run. The predicate is now !IsNode || IsGroup: a folder is a container whether or not it currently holds children, and only an empty leaf pin is rejected. Around it: - a failed lookup dumps the ScadaRootNode shape into the failure message, bounded to 3 levels, 20 children per node and 200 lines - TreeSnapshotWriter refuses to write a snapshot that holds zero nodes - PlanBuilder refuses a plan that would restore nothing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FindGrouppicked the target group byOpcUaScadaItem.IsGroup, which is derived (Items != null && Items.Count > 0). A folder whose children are all disabled in the OPC server GUI holds nothing, so the group was reported as not found and the rebuild refused to run. The predicate is now!IsNode || IsGroup: a folder is a container whether or not it currently holds children, and only an empty leaf pin is rejected.Type of change
Linked issues
Closes #137
Changes touching FB code
const int *PinIdconstants in the FB class[NonSerialized][ComVisible(true)]+[Guid]untouched on existing FBsDocs/architecture/masterscada-fb-primer.mdandDocs/architecture/architecture.mdDocs/known_issues/— the root cause is written up as15-derived-properties-as-identity.mdTree-modifying FBs only
UpdateDataand executed from aSystem.Windows.Forms.TimerpollingIProjectHlp.InRuntimeBeginInvokeself-repostingTesting
dotnet build NtoLib.sln— 0 errors, 0 warningsdotnet test NtoLib.sln— 373 passeddotnet format NtoLib.sln --verify-no-changes— exit 0ServerInterfaces.MBE, 23 nodes constructedAlso in this PR
ScadaRootNodeshape into the failure message, bounded to 3 levels, 20 children per node and 200 lines, so the message reaches the deferred pass where theFailedpin cannotTreeSnapshotWriterrefuses to write a snapshot that holds zero nodesPlanBuilderrefuses a plan that would restore nothing