-
Notifications
You must be signed in to change notification settings - Fork 5
Make GOOSE values readable and keep the workspace lightweight #41
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
aacd84b
chore: add one-shot GOOSE lightweight correction
masarray f87a9f3
ci: apply lightweight GOOSE correction on branch
masarray 4a90283
ci: trigger lightweight GOOSE correction
masarray bff78a7
fix: add friendly adapters and transient GOOSE value highlights
masarray c8a3c50
fix: expire GOOSE event highlights after five seconds
masarray 380e474
fix: resolve real Windows network adapter names
masarray d2e6d97
feat: add beginner-readable GOOSE value formatter
masarray 01e501e
feat: expose semantic GOOSE values to WPF
masarray fbc6bdd
feat: add lightweight GOOSE workspace events
masarray d7cd530
feat: add lightweight beginner GOOSE workspace
masarray 2502008
fix: expire highlights and throttle GOOSE timeline UI
masarray 22af6ab
chore: remove one-shot GOOSE patch helper
masarray 61bcf33
chore: remove one-shot GOOSE patch workflow
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| using System.Globalization; | ||
| using System.Text.RegularExpressions; | ||
|
|
||
| namespace ArIED61850Tester.Models; | ||
|
|
||
| public static class GooseEngineeringValueFormatter | ||
| { | ||
| private static readonly Regex CompactBitString = new( | ||
| @"^bits\((?<hex>[0-9A-Fa-f]{2}),\s*unused=(?<unused>[67])\)$", | ||
| RegexOptions.Compiled | RegexOptions.CultureInvariant); | ||
|
|
||
| public static string Format(string? rawValue) | ||
| { | ||
| var text = rawValue?.Trim() ?? string.Empty; | ||
| if (string.IsNullOrWhiteSpace(text) || text == "<missing in frame>") | ||
| return text; | ||
|
|
||
| var match = CompactBitString.Match(text); | ||
| if (!match.Success || | ||
| !byte.TryParse(match.Groups["hex"].Value, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out var value)) | ||
| { | ||
| return text; | ||
| } | ||
|
|
||
| if (match.Groups["unused"].Value == "7") | ||
| return (value & 0x80) == 0 ? "false" : "true"; | ||
|
|
||
| return ((value >> 6) & 0x03) switch | ||
| { | ||
| 0 => "Intermediate [00]", | ||
| 1 => "Open [01]", | ||
| 2 => "Closed [10]", | ||
| _ => "Invalid [11]" | ||
| }; | ||
| } | ||
| } |
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
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,14 @@ | ||
| using System.Globalization; | ||
| using System.Windows.Data; | ||
| using ArIED61850Tester.Models; | ||
|
|
||
| namespace ArIED61850Tester.Views; | ||
|
|
||
| public sealed class GooseEngineeringValueConverter : IValueConverter | ||
| { | ||
| public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
| => GooseEngineeringValueFormatter.Format(value?.ToString()); | ||
|
|
||
| public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
| => Binding.DoNothing; | ||
| } |
Oops, something went wrong.
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 a GOOSE state change is followed by a fast retransmission before the 100 ms UI flush,
_pendingGooseFrameskeeps only the last snapshot for that stream; that retransmission normally hasIsChanged == false, so this branch never starts the new 5-second highlight even though the current value changed. This makes the inspector miss highlights for normal GOOSE change/retransmit traffic; preserve the recent-change flag separately or drive the highlight from the non-coalesced timeline snapshots.Useful? React with 👍 / 👎.