Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/ied-simulator-qt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,18 @@ jobs:
./tests/fixtures/scl/minimal-station-brcb.scd
./goose-publication-evidence.pcap

- name: GOOSE monitor + publisher workspace gates
- name: GOOSE Sniffer decode and supervision gates
run: >-
./build-ied-simulator-qt/ied_goose_workspace_qa
./goose-publication-evidence.pcap

- name: Sniffer versus Simulator ownership policy
run: >-
python3 apps/ied_simulator/test_sniffer_ownership.py
apps/ied_simulator/qml/SnifferWorkspace.qml
apps/ied_simulator/qml/GooseWorkspace.qml
apps/ied_simulator/qml/CommissioningWorkspace.qml

- name: Upload GOOSE wire evidence
uses: actions/upload-artifact@v4
with:
Expand Down
229 changes: 57 additions & 172 deletions apps/ied_simulator/qml/GooseWorkspace.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@ import ARStack.IedSimulator 1.0
Item {
id: root
required property var theme
required property IedFleetController simulator
required property GooseMonitorController monitor
signal openSimulatorRequested()

IedCommissioningModel {
id: publisherModel
backend: root.simulator
kindFilter: "GOOSE"
}

FileDialog {
id: savePcapDialog
Expand All @@ -40,13 +32,13 @@ Item {
Layout.fillWidth: true
spacing: 2
Label {
text: "GOOSE Monitor + Publisher"
text: "GOOSE Sniffer"
color: root.theme.text
font.pixelSize: root.theme.titleSize
font.weight: Font.DemiBold
}
Label {
text: "One explicit NIC · EtherType 0x88B8 · canonical publisher state · bounded live supervision"
text: "Passive Layer-2 capture · EtherType 0x88B8 · decode · supervision · bounded PCAP retention"
color: root.theme.muted
font.pixelSize: root.theme.captionSize
}
Expand All @@ -61,7 +53,7 @@ Item {
border.color: root.monitor.capturing ? root.theme.green : root.theme.line
Label {
anchors.centerIn: parent
text: root.monitor.capturing ? "MONITOR LIVE" : "MONITOR STOPPED"
text: root.monitor.capturing ? "CAPTURE LIVE" : "STOPPED"
color: root.monitor.capturing ? root.theme.green : root.theme.textSoft
font.pixelSize: 9
font.weight: Font.DemiBold
Expand Down Expand Up @@ -91,26 +83,20 @@ Item {

ComboBox {
id: interfaceSelector
Layout.preferredWidth: 220
Layout.preferredWidth: 240
model: root.monitor.interfaces
enabled: !root.monitor.capturing
currentIndex: Math.max(0, root.monitor.interfaces.indexOf(root.monitor.interfaceName))
onActivated: {
const selected = currentText
root.monitor.interfaceName = selected
publisherModel.gooseInterfaceName = selected
}
onActivated: root.monitor.interfaceName = currentText
Component.onCompleted: {
if (root.monitor.interfaceName.length === 0 && count > 0) {
if (root.monitor.interfaceName.length === 0 && count > 0)
root.monitor.interfaceName = currentText
publisherModel.gooseInterfaceName = currentText
}
}
}

ActionButton {
theme: root.theme
text: root.monitor.capturing ? "Stop Monitor" : "Start Monitor"
text: root.monitor.capturing ? "Stop Capture" : "Start Capture"
primary: !root.monitor.capturing
danger: root.monitor.capturing
onClicked: root.monitor.capturing ? root.monitor.stopCapture() : root.monitor.startCapture()
Expand Down Expand Up @@ -147,7 +133,7 @@ Item {

Rectangle {
SplitView.fillWidth: true
SplitView.minimumWidth: 560
SplitView.minimumWidth: 620
color: root.theme.surface
border.width: 1
border.color: root.theme.lineSoft
Expand All @@ -161,7 +147,7 @@ Item {
RowLayout {
Layout.fillWidth: true
Label {
text: "Live Monitor"
text: "Captured streams"
color: root.theme.text
font.pixelSize: root.theme.subtitleSize
font.weight: Font.DemiBold
Expand All @@ -172,7 +158,7 @@ Item {
color: root.monitor.capturing ? root.theme.green : root.theme.muted
font.pixelSize: root.theme.captionSize
elide: Text.ElideRight
Layout.maximumWidth: 320
Layout.maximumWidth: 360
}
}

Expand Down Expand Up @@ -287,7 +273,7 @@ Item {
spacing: 10

ColumnLayout {
Layout.preferredWidth: 250
Layout.preferredWidth: 270
Layout.fillHeight: true
spacing: 3
Label { text: "Selected stream"; color: root.theme.text; font.pixelSize: 11; font.weight: Font.DemiBold }
Expand Down Expand Up @@ -329,8 +315,8 @@ Item {
}

Rectangle {
SplitView.preferredWidth: 430
SplitView.minimumWidth: 360
SplitView.preferredWidth: 360
SplitView.minimumWidth: 320
color: root.theme.surface
border.width: 1
border.color: root.theme.lineSoft
Expand All @@ -341,174 +327,73 @@ Item {
anchors.margins: 8
spacing: 8

RowLayout {
Layout.fillWidth: true
Label {
text: "Publisher"
color: root.theme.text
font.pixelSize: root.theme.subtitleSize
font.weight: Font.DemiBold
}
Item { Layout.fillWidth: true }
Label {
text: publisherModel.goosePublisherCount + " active"
color: publisherModel.goosePublishing ? root.theme.green : root.theme.muted
font.pixelSize: root.theme.captionSize
}
}

Label {
Layout.fillWidth: true
visible: !root.simulator.imported
text: "Load an SCL/CID/SCD in Simulator to expose configured GSEControl publishers. Monitoring remains independent and can run without a simulator model."
wrapMode: Text.WordWrap
color: root.theme.muted
font.pixelSize: root.theme.captionSize
text: "Capture diagnostics"
color: root.theme.text
font.pixelSize: root.theme.subtitleSize
font.weight: Font.DemiBold
}

ListView {
id: publisherList
GridLayout {
Layout.fillWidth: true
Layout.preferredHeight: Math.min(190, contentHeight)
Layout.minimumHeight: root.simulator.imported ? 72 : 0
clip: true
reuseItems: true
cacheBuffer: 0
model: publisherModel.itemCount
delegate: Rectangle {
required property int index
property var itemData: {
publisherModel.revision
return publisherModel.item(index)
}
width: publisherList.width
height: 54
radius: 5
color: itemData.selected ? root.theme.accentSoft : root.theme.chrome
border.width: itemData.selected ? 1 : 0
border.color: root.theme.accent
ColumnLayout {
anchors.fill: parent
anchors.margins: 7
spacing: 1
Label { Layout.fillWidth: true; text: itemData.reference || itemData.name || "GOOSE"; color: root.theme.text; font.pixelSize: 10; font.weight: Font.DemiBold; elide: Text.ElideMiddle }
Label { Layout.fillWidth: true; text: (itemData.appId || "APPID —") + " · " + (itemData.mac || "MAC —") + " · " + (itemData.memberCount || 0) + " members"; color: root.theme.muted; font.pixelSize: 9; elide: Text.ElideRight }
}
MouseArea { anchors.fill: parent; onClicked: publisherModel.select(index) }
}
columns: 2
columnSpacing: 10
rowSpacing: 4
Label { text: "Decode errors"; color: root.theme.muted; font.pixelSize: 9 }
Label { text: String(root.monitor.decodeErrorCount); color: root.theme.textSoft; font.pixelSize: 9; Layout.alignment: Qt.AlignRight }
Label { text: "Rejected frames"; color: root.theme.muted; font.pixelSize: 9 }
Label { text: String(root.monitor.rejectedFrameCount); color: root.theme.textSoft; font.pixelSize: 9; Layout.alignment: Qt.AlignRight }
Label { text: "Dropped streams"; color: root.theme.muted; font.pixelSize: 9 }
Label { text: String(root.monitor.droppedStreamCount); color: root.theme.textSoft; font.pixelSize: 9; Layout.alignment: Qt.AlignRight }
Label { text: "Duplicates"; color: root.theme.muted; font.pixelSize: 9 }
Label { text: String(root.monitor.duplicateCount); color: root.theme.textSoft; font.pixelSize: 9; Layout.alignment: Qt.AlignRight }
Label { text: "Retained PCAP"; color: root.theme.muted; font.pixelSize: 9 }
Label { text: root.monitor.retainedPacketCount + "/" + root.monitor.retainedPacketCapacity; color: root.theme.textSoft; font.pixelSize: 9; Layout.alignment: Qt.AlignRight }
}

Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 112
radius: 6
color: root.theme.chrome
border.width: 1
border.color: root.theme.lineSoft
ColumnLayout {
anchors.fill: parent
anchors.margins: 8
spacing: 3
Label { text: publisherModel.selectedItem.goId || "No GOOSE publisher selected"; color: root.theme.text; font.pixelSize: 11; font.weight: Font.DemiBold; elide: Text.ElideMiddle; Layout.fillWidth: true }
Label { text: publisherModel.selectedItem.dataSetReference || "—"; color: root.theme.textSoft; font.pixelSize: 9; elide: Text.ElideMiddle; Layout.fillWidth: true }
Label { text: "ConfRev " + (publisherModel.selectedItem.confRev || "—") + " · Min/Max " + (publisherModel.selectedItem.minTimeMs || "—") + "/" + (publisherModel.selectedItem.maxTimeMs || "—") + " ms"; color: root.theme.muted; font.pixelSize: 9 }
Label { text: publisherModel.goosePublicationStatus; color: publisherModel.goosePublishing ? root.theme.green : root.theme.muted; font.pixelSize: 9; elide: Text.ElideRight; Layout.fillWidth: true }
Label { text: "TX " + publisherModel.gooseTransmitCount + " · state changes " + publisherModel.gooseStateChangeCount + " · stNum " + (publisherModel.selectedGooseRuntime.stNum || "—"); color: root.theme.muted; font.pixelSize: 9 }
}
}

RowLayout {
Layout.fillWidth: true
spacing: 6
ActionButton {
theme: root.theme
text: publisherModel.selectedGooseRuntime.active ? "Stop Publisher" : "Start Publisher"
primary: !publisherModel.selectedGooseRuntime.active
danger: publisherModel.selectedGooseRuntime.active
enabled: root.simulator.imported && publisherModel.itemCount > 0
onClicked: publisherModel.selectedGooseRuntime.active
? publisherModel.stopSelectedGoosePublication()
: publisherModel.startSelectedGoosePublication()
}
ActionButton {
theme: root.theme
text: "Edit Source Value"
enabled: publisherModel.firstDrivableMember() >= 0
onClicked: {
const row = publisherModel.firstDrivableMember()
if (row >= 0 && publisherModel.focusMemberValue(row)) root.openSimulatorRequested()
}
}
}
Rectangle { Layout.fillWidth: true; height: 1; color: root.theme.lineSoft }

Label {
Layout.fillWidth: true
text: "Publisher stimulus always edits the canonical Simulator point store. This workspace does not maintain a GOOSE-only value copy."
wrapMode: Text.WordWrap
color: root.theme.muted
font.pixelSize: 9
}

Rectangle {
Layout.fillWidth: true
height: 1
color: root.theme.lineSoft
text: "Recent events"
color: root.theme.text
font.pixelSize: 11
font.weight: Font.DemiBold
}

Label { text: "Configured DataSet members"; color: root.theme.text; font.pixelSize: 11; font.weight: Font.DemiBold }
ListView {
id: eventList
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
reuseItems: true
cacheBuffer: 0
model: publisherModel.memberCount
delegate: Rectangle {
required property int index
property var memberData: {
publisherModel.revision
return publisherModel.member(index)
}
width: ListView.view.width
height: 40
color: "transparent"
ColumnLayout {
anchors.fill: parent
spacing: 0
Label { Layout.fillWidth: true; text: memberData.reference || memberData.mmsItem || "—"; color: root.theme.textSoft; font.pixelSize: 9; elide: Text.ElideMiddle }
Label { Layout.fillWidth: true; text: (memberData.fc || "—") + " · " + (memberData.type || memberData.cdc || "—"); color: root.theme.muted; font.pixelSize: 8; elide: Text.ElideRight }
}
MouseArea {
anchors.fill: parent
onDoubleClicked: {
if (publisherModel.focusMemberValue(index)) root.openSimulatorRequested()
}
}
}
}
model: root.monitor.recentEvents

Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 78
radius: 5
color: root.theme.navigationDark
ColumnLayout {
anchors.fill: parent
anchors.margins: 7
spacing: 2
Label { text: "Monitor events (bounded " + root.monitor.eventCapacity + ")"; color: root.theme.navigationText; font.pixelSize: 9; font.weight: Font.DemiBold }
delegate: Rectangle {
width: eventList.width
height: eventText.implicitHeight + 12
color: index % 2 ? root.theme.chrome : "transparent"
Label {
Layout.fillWidth: true
Layout.fillHeight: true
text: root.monitor.recentEvents.length ? root.monitor.recentEvents[root.monitor.recentEvents.length - 1] : "No events"
color: root.theme.navigationMuted
id: eventText
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 6
text: modelData
color: root.theme.textSoft
font.pixelSize: 8
wrapMode: Text.Wrap
maximumLineCount: 3
elide: Text.ElideRight
}
}
}

Label {
Layout.fillWidth: true
text: "Sniffer is passive. GOOSE publication and stimulation belong to IED Simulator commissioning."
color: root.theme.muted
font.pixelSize: 8
wrapMode: Text.WordWrap
}
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions apps/ied_simulator/qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,7 @@ ApplicationWindow {

SnifferWorkspace {
theme: appTheme
simulator: simulator
monitor: gooseMonitor
onOpenSimulatorRequested: root.workspaceIndex = 2
}
}
}
Expand Down
5 changes: 0 additions & 5 deletions apps/ied_simulator/qml/SnifferWorkspace.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ import ARStack.IedSimulator 1.0
Item {
id: root
required property var theme
required property IedFleetController simulator
required property GooseMonitorController monitor

signal openSimulatorRequested()

GooseWorkspace {
anchors.fill: parent
theme: root.theme
simulator: root.simulator
monitor: root.monitor
onOpenSimulatorRequested: root.openSimulatorRequested()
}
}
Loading
Loading