-
Notifications
You must be signed in to change notification settings - Fork 4
fix: make FAT signal names IEC context aware #271
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b3ac364
fix: make IEC signal display names context aware
masarray 9e39fe6
fix: apply canonical display names to FAT dataset rows
masarray 69cc970
test: cover IEC context-aware signal display names
masarray dc430a6
fix: use .NET 8 compatible IndexOfAny overload
masarray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| using ArIED61850Tester.Models.IoTesting; | ||
|
|
||
| namespace ARSAS.Tests; | ||
|
|
||
| public sealed class IoSignalDisplayNameTests | ||
| { | ||
| [Theory] | ||
| [InlineData("IED1MEAS/MMXU1.A.phsA.cVal.mag.f", "A PhsA")] | ||
| [InlineData("IED1MEAS/MMXU1.A.phsB.cVal.mag.f", "A PhsB")] | ||
| [InlineData("IED1MEAS/MMXU1.A.phsC.cVal.mag.f", "A PhsC")] | ||
| public void Format_AppendsPhaseContextWithoutAddingMeasurementOwner(string reference, string expected) | ||
| { | ||
| Assert.Equal(expected, IoSignalDisplayName.Format("A", reference)); | ||
| } | ||
|
|
||
| [Theory] | ||
| [InlineData("IED1CTRL/XCBR1.Pos.stVal", "XCBR Pos")] | ||
| [InlineData("IED1CTRL/CSWI1.Pos.stVal", "CSWI Pos")] | ||
| [InlineData("IED1CTRL/XCBR1$ST$Pos$stVal", "XCBR Pos")] | ||
| public void Format_QualifiesAmbiguousDataObjectWithLogicalNodeOwner(string reference, string expected) | ||
| { | ||
| Assert.Equal(expected, IoSignalDisplayName.Format("Pos", reference)); | ||
| } | ||
|
|
||
| [Theory] | ||
| [InlineData("Mod", "IED1CTRL/XCBR1.Mod.stVal", "XCBR Mod")] | ||
| [InlineData("Beh", "IED1CTRL/CSWI1.Beh.stVal", "CSWI Beh")] | ||
| [InlineData("Health", "IED1CTRL/LPHD1.Health.stVal", "LPHD Health")] | ||
| [InlineData("Loc", "IED1CTRL/CSWI1.Loc.stVal", "CSWI Loc")] | ||
| [InlineData("OpCnt", "IED1CTRL/XCBR1.OpCnt.stVal", "XCBR OpCnt")] | ||
| public void Format_UsesSameOwnerRuleForOtherGenericIecDataObjects( | ||
| string signalName, | ||
| string reference, | ||
| string expected) | ||
| { | ||
| Assert.Equal(expected, IoSignalDisplayName.Format(signalName, reference)); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Format_DoesNotDuplicateExistingOwnerContext() | ||
| { | ||
| Assert.Equal( | ||
| "XCBR Pos", | ||
| IoSignalDisplayName.Format("XCBR Pos", "IED1CTRL/XCBR1.Pos.stVal")); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Format_LeavesSpecificDataObjectNameConcise() | ||
| { | ||
| Assert.Equal( | ||
| "Dig01", | ||
| IoSignalDisplayName.Format("Dig01", "IED1ADD/GGIO1.Dig01.stVal")); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Format_LeavesCustomLabelUntouched() | ||
| { | ||
| Assert.Equal( | ||
| "Breaker position", | ||
| IoSignalDisplayName.Format("Breaker position", "IED1CTRL/XCBR1.Pos.stVal")); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Format_FallsBackGracefullyWithoutReference() | ||
| { | ||
| Assert.Equal("Pos", IoSignalDisplayName.Format("Pos", null)); | ||
| } | ||
| } |
Oops, something went wrong.
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.
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.
When an MMS reference flattens a scope prefix into the logical-node token, such as the repository's
SystemLLN0$ST$...form inIoTestSmartReferenceMatcherTests, this exact equality check misses LLN0; the subsequent digit stripping removes the significant0and derives an owner such asMLLN. Consequently, a reference likeSystemLLN0$ST$Mod$stValis displayed asMLLN Modrather thanLLN0 Mod. Detect a terminalLLN0before applying the generic instance-number logic.Useful? React with 👍 / 👎.