diff --git a/.github/workflows/golang.yaml b/.github/workflows/golang.yaml index 29519b5..3b01f5b 100644 --- a/.github/workflows/golang.yaml +++ b/.github/workflows/golang.yaml @@ -42,9 +42,8 @@ jobs: - name: Clone and build proto-gen-md-diagrams run: | cd .. - git clone https://github.com/zaphiro-technologies/proto-gen-md-diagrams.git + git clone https://github.com/GoogleCloudPlatform/proto-gen-md-diagrams.git cd proto-gen-md-diagrams - git checkout 1-feature-better-support-for-markdown-generation go build cd .. cd protobuf diff --git a/Makefile b/Makefile index 9e232e1..25c6f13 100644 --- a/Makefile +++ b/Makefile @@ -24,10 +24,8 @@ generate: .PHONY: docs docs: - ../proto-gen-md-diagrams/proto-gen-md-diagrams -d zaphiro -md true mkdir -p docs - # mv -f zaphiro/**/*.md docs #why it works on my mac but not in the action? - mv -f zaphiro/*/v1/*.md docs + ../proto-gen-md-diagrams/proto-gen-md-diagrams -d zaphiro -o docs -md true .PHONY: proto-lint proto-lint: diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index c05971e..ef7136d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,12 +1,16 @@ # ProtoBuf Release Notes -## 0.0.6-dev - 2024-04-16 +## 0.0.6-dev - 2024-05-20 ### Features - Support `NormalizedResidual` and `ObjectiveFunction` data types (PR #49 by @chicco785) +### Continuous Integration + +- Replace custom proto-gen-md-diagrams with official one (PR #50 by @chicco785) + ## 0.0.5 - 2024-03-22 ### Features diff --git a/docs/conf2.proto.md b/docs/conf2.proto.md index 0ec8f2d..9641083 100644 --- a/docs/conf2.proto.md +++ b/docs/conf2.proto.md @@ -38,12 +38,12 @@ direction LR %% class Conf2Frame { - + uint32 DATA_RATE - + List~Config~ configs + Conf2Header header + + List~Config~ configs + + uint32 DATA_RATE } -Conf2Frame --> `Config` Conf2Frame --> `Conf2Header` +Conf2Frame --> `Config` ``` ### Conf2Header Diagram @@ -55,13 +55,13 @@ direction LR %% Configuration frame 2 header class Conf2Header { - + uint32 FRACSEC + + uint32 SYNC + uint32 FRAMESIZE + uint32 IDCODE - + uint32 NUM_PMU + uint32 SOC - + uint32 SYNC + + uint32 FRACSEC + uint32 TIME_BASE + + uint32 NUM_PMU } ``` @@ -74,18 +74,18 @@ direction LR %% Single PMU configuration according to Configuration frame 2 class Config { + + string STN + + uint32 IDCODE + + uint32 FORMAT + + uint32 PHNMR + uint32 ANNMR - + List~uint32~ ANUNIT - + uint32 CFGCNT - + string CHNAM + uint32 DGNMR + + string CHNAM + + List~uint32~ PHUNIT + + List~uint32~ ANUNIT + List~uint32~ DIGUNIT + uint32 FNOM - + uint32 FORMAT - + uint32 IDCODE - + uint32 PHNMR - + List~uint32~ PHUNIT - + string STN + + uint32 CFGCNT } ``` @@ -105,9 +105,9 @@ Headers used in rabbitMQ: | Field | Ordinal | Type | Label | Description | |-------------|---------|---------------|----------|-------------------------------| -| `DATA_RATE` | 3 | `uint32` | | Rate of data transmission | -| `configs` | 2 | `Config` | Repeated | Set of PMU configurations | | `header` | 1 | `Conf2Header` | | Configuration frame 2 header | +| `configs` | 2 | `Config` | Repeated | Set of PMU configurations | +| `DATA_RATE` | 3 | `uint32` | | Rate of data transmission | @@ -121,13 +121,13 @@ Configuration frame 2 header | Field | Ordinal | Type | Label | Description | |-------------|---------|----------|-------|------------------------------------------------------| -| `FRACSEC` | 5 | `uint32` | | Fraction of Second and Message Time Quality | +| `SYNC` | 1 | `uint32` | | Sync byte followed by frame type and version number | | `FRAMESIZE` | 2 | `uint32` | | Number of bytes in the frame | | `IDCODE` | 3 | `uint32` | | Stream source ID number | -| `NUM_PMU` | 7 | `uint32` | | The number of PMUs included in the data frame | | `SOC` | 4 | `uint32` | | SOC time stamp | -| `SYNC` | 1 | `uint32` | | Sync byte followed by frame type and version number | +| `FRACSEC` | 5 | `uint32` | | Fraction of Second and Message Time Quality | | `TIME_BASE` | 6 | `uint32` | | Resolution of FRACSEC time stamp | +| `NUM_PMU` | 7 | `uint32` | | The number of PMUs included in the data frame | @@ -141,18 +141,18 @@ Single PMU configuration according to Configuration frame 2 | Field | Ordinal | Type | Label | Description | |-----------|---------|----------|----------|----------------------------------------| +| `STN` | 1 | `string` | | Station name | +| `IDCODE` | 2 | `uint32` | | Data source ID number | +| `FORMAT` | 3 | `uint32` | | Data format within data frame | +| `PHNMR` | 4 | `uint32` | | Number of phasors | | `ANNMR` | 5 | `uint32` | | Number of analog values | -| `ANUNIT` | 9 | `uint32` | Repeated | Conversion factor for analog channels | -| `CFGCNT` | 12 | `uint32` | | Configuration change count | -| `CHNAM` | 7 | `string` | | Phasor and channel names | | `DGNMR` | 6 | `uint32` | | Number of digital status words | +| `CHNAM` | 7 | `string` | | Phasor and channel names | +| `PHUNIT` | 8 | `uint32` | Repeated | Conversion factor for phasor channels | +| `ANUNIT` | 9 | `uint32` | Repeated | Conversion factor for analog channels | | `DIGUNIT` | 10 | `uint32` | Repeated | Mask words for digital status words | | `FNOM` | 11 | `uint32` | | Nominal line frequency code and flags | -| `FORMAT` | 3 | `uint32` | | Data format within data frame | -| `IDCODE` | 2 | `uint32` | | Data source ID number | -| `PHNMR` | 4 | `uint32` | | Number of phasors | -| `PHUNIT` | 8 | `uint32` | Repeated | Conversion factor for phasor channels | -| `STN` | 1 | `string` | | Station name | +| `CFGCNT` | 12 | `uint32` | | Configuration change count | diff --git a/docs/data.proto.md b/docs/data.proto.md index 24fd0b0..f5c1c80 100644 --- a/docs/data.proto.md +++ b/docs/data.proto.md @@ -182,8 +182,8 @@ direction LR %% class DataSet { - + Map~string, Data~ data + string producerId + + Map~string, Data~ data } DataSet .. ` Data` @@ -228,8 +228,8 @@ Headers used in rabbitMQ: | Field | Ordinal | Type | Label | Description | |--------------|---------|----------------|-------|-------------------------------------------------------------| -| `data` | 2 | `string, Data` | Map | The map of data included in the dataset. | | `producerId` | 1 | `string` | | The id of the device / service that produced the data set. | +| `data` | 2 | `string, Data` | Map | The map of data included in the dataset. | diff --git a/docs/device_event.proto.md b/docs/device_event.proto.md index f84d5f6..d68ccb7 100644 --- a/docs/device_event.proto.md +++ b/docs/device_event.proto.md @@ -39,12 +39,12 @@ direction LR %% class DeviceEvent { - + Optional~string~ code - + string deviceID + Event event - + Optional~double~ referenceLimit + + string deviceID + string substationID + Optional~double~ value + + Optional~double~ referenceLimit + + Optional~string~ code } DeviceEvent --> `Event` @@ -165,12 +165,12 @@ Headers used in rabbitMQ: | Field | Ordinal | Type | Label | Description | |------------------|---------|----------|----------|-----------------------------------------------------------| -| `code` | 6 | `string` | Optional | The device event code (or the mapped string) | -| `deviceID` | 2 | `string` | | The ID of the device where the event occurred. | | `event` | 1 | `Event` | | The base event message | -| `referenceLimit` | 5 | `double` | Optional | The reference limit or expected value. | +| `deviceID` | 2 | `string` | | The ID of the device where the event occurred. | | `substationID` | 3 | `string` | | The ID of the substation where the event occurred. | | `value` | 4 | `double` | Optional | The measured / estimated value in relation to the event. | +| `referenceLimit` | 5 | `double` | Optional | The reference limit or expected value. | +| `code` | 6 | `string` | Optional | The device event code (or the mapped string) | diff --git a/docs/event.proto.md b/docs/event.proto.md index ebaf307..a8f2119 100644 --- a/docs/event.proto.md +++ b/docs/event.proto.md @@ -102,11 +102,11 @@ direction LR class Event { + string Id - + Optional~int64~ detectedAt - + string message - + int64 occurredAt + string sourceId + EventSourceType sourceType + + int64 occurredAt + + Optional~int64~ detectedAt + + string message + Optional~EventStatus~ status } Event --> `EventSourceType` @@ -132,11 +132,11 @@ Headers used in rabbitMQ (only if not sent as part of `DataSet`): | Field | Ordinal | Type | Label | Description | |--------------|---------|-------------------|----------|-----------------------------------------------------------------------------------------------------| | `Id` | 1 | `string` | | The uuid of the event. | -| `detectedAt` | 5 | `int64` | Optional | The time of detection of the event (Unix msec timestamp). | -| `message` | 6 | `string` | | Event message. | -| `occurredAt` | 4 | `int64` | | The time of occurency of the event (Unix msec timestamp) usually is the same value as timestampId. | | `sourceId` | 2 | `string` | | The id of the source (e.g. a PMU) that generated the event. | | `sourceType` | 3 | `EventSourceType` | | The type of data see `DataType` enum. | +| `occurredAt` | 4 | `int64` | | The time of occurency of the event (Unix msec timestamp) usually is the same value as timestampId. | +| `detectedAt` | 5 | `int64` | Optional | The time of detection of the event (Unix msec timestamp). | +| `message` | 6 | `string` | | Event message. | | `status` | 7 | `EventStatus` | Optional | The status of the event. | diff --git a/docs/fault.proto.md b/docs/fault.proto.md index 660ba35..2c8a839 100644 --- a/docs/fault.proto.md +++ b/docs/fault.proto.md @@ -49,7 +49,7 @@ An unordered enumeration of phase identifiers. Allows designation of phases for Residential and small commercial loads are often served from single-phase, or split-phase, secondary circuits. For the example of s12N, phases 1 and 2 refer to hot wires that are 180 degrees out of phase, while N refers to the neutral wire. Through single-phase transformer connections, these secondary circuits may be served from one or two of the primary phases A, B, and C. For three-phase loads, use the A, B, C phase codes instead of s12N. The integer values are from IEC 61968-9 to support revenue metering applications. -This message is modeled after [CIM PhaseCode](https://zepben.github.io/evolve/docs/cim/evolve/IEC61970/Base/Core/PhaseCode/). +This message is modeled after [CIM PhaseCode](https://zepben.github.io/evolve/docs/cim/cim100/TC57CIM/IEC61970/Base/Core/PhaseCode/). @@ -114,7 +114,7 @@ direction LR %% Residential and small commercial loads are often served from single-phase, or split-phase, secondary circuits. For the example of s12N, phases 1 and 2 refer to hot wires that are 180 degrees out of phase, while N refers to the neutral wire. Through single-phase transformer connections, these secondary circuits may be served from one or two of the primary phases A, B, and C. For three-phase loads, use the A, B, C phase codes instead of s12N. %% The integer values are from IEC 61968-9 to support revenue metering applications. %% -%% This message is modeled after [CIM PhaseCode](https://zepben.github.io/evolve/docs/cim/evolve/IEC61970/Base/Core/PhaseCode/). +%% This message is modeled after [CIM PhaseCode](https://zepben.github.io/evolve/docs/cim/cim100/TC57CIM/IEC61970/Base/Core/PhaseCode/). %% class PhaseCode{ @@ -166,14 +166,14 @@ direction LR class Fault { + string Id + Optional~string~ description - + Optional~float~ faultCurrent - + Optional~string~ faultyEquipmentId - + List~string~ impactedEquipmentIds + PhaseConnectedFaultKind kind - + Optional~bool~ located - + Optional~int64~ locatedAt - + int64 occurredAt + PhaseCode phases + + int64 occurredAt + + Optional~string~ faultyEquipmentId + + Optional~int64~ locatedAt + + Optional~float~ faultCurrent + + Optional~bool~ located + + List~string~ impactedEquipmentIds } Fault --> `PhaseConnectedFaultKind` Fault --> `PhaseCode` @@ -196,9 +196,9 @@ direction LR %% class LineFault { - + Optional~string~ acLineSegmentID + Fault fault + Optional~float~ lengthFromTerminal1 + + Optional~string~ acLineSegmentID } LineFault --> `Fault` @@ -247,14 +247,14 @@ Headers used in rabbitMQ: |------------------------|---------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------| | `Id` | 1 | `string` | | The textual id of the fault. | | `description` | 2 | `string` | Optional | The textual description of the fault. | -| `faultCurrent` | 8 | `float` | Optional | The current associated to the fault. | -| `faultyEquipmentId` | 6 | `string` | Optional | The equipment with the fault. | -| `impactedEquipmentIds` | 10 | `string` | Repeated | The set of IDs of equipments impacted by the fault. | | `kind` | 3 | `PhaseConnectedFaultKind` | | The kind of phase fault. | -| `located` | 9 | `bool` | Optional | Was the fault located. | -| `locatedAt` | 7 | `int64` | Optional | The time when the fault was located. | -| `occurredAt` | 5 | `int64` | | The date and time at which the fault occurred (Unix msec timestamp). | | `phases` | 4 | `PhaseCode` | | The phases participating in the fault. The fault connections into these phases are further specified by the type of fault. | +| `occurredAt` | 5 | `int64` | | The date and time at which the fault occurred (Unix msec timestamp). | +| `faultyEquipmentId` | 6 | `string` | Optional | The equipment with the fault. | +| `locatedAt` | 7 | `int64` | Optional | The time when the fault was located. | +| `faultCurrent` | 8 | `float` | Optional | The current associated to the fault. | +| `located` | 9 | `bool` | Optional | Was the fault located. | +| `impactedEquipmentIds` | 10 | `string` | Repeated | The set of IDs of equipments impacted by the fault. | @@ -276,9 +276,9 @@ Headers used in rabbitMQ: | Field | Ordinal | Type | Label | Description | |-----------------------|---------|----------|----------|--------------------------------------------------------------------------------------------------------------------------------| -| `acLineSegmentID` | 3 | `string` | Optional | The line segment of this line fault. | | `fault` | 1 | `Fault` | | The base fault message. | | `lengthFromTerminal1` | 2 | `float` | Optional | The length to the place where the fault is located starting from terminal with sequence number 1 of the faulted line segment. | +| `acLineSegmentID` | 3 | `string` | Optional | The line segment of this line fault. | diff --git a/docs/grid_event.proto.md b/docs/grid_event.proto.md index 2e7e1c4..f38355b 100644 --- a/docs/grid_event.proto.md +++ b/docs/grid_event.proto.md @@ -40,12 +40,12 @@ direction LR %% class GridEvent { - + string componentID + Event event - + Optional~double~ probability - + double referenceLimit + + string componentID + Optional~string~ substationID + double value + + double referenceLimit + + Optional~double~ probability } GridEvent --> `Event` @@ -294,12 +294,12 @@ Headers used in rabbitMQ (only if not sent as part of `DataSet`): | Field | Ordinal | Type | Label | Description | |------------------|---------|----------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `componentID` | 2 | `string` | | The ID of the component where the event occurred. | | `event` | 1 | `Event` | | The base event message | -| `probability` | 6 | `double` | Optional | The probability that the event actually occurred. | -| `referenceLimit` | 5 | `double` | | The reference limit or expected value. | +| `componentID` | 2 | `string` | | The ID of the component where the event occurred. | | `substationID` | 3 | `string` | Optional | The ID of the substation where the event occurred. | | `value` | 4 | `double` | | The measured / estimated value in relation to the event (e.g. in the case of a `VoltageEvent` is the voltage, in the case of a `CurrentEvent` is the current event). | +| `referenceLimit` | 5 | `double` | | The reference limit or expected value. | +| `probability` | 6 | `double` | Optional | The probability that the event actually occurred. | diff --git a/docs/stat.proto.md b/docs/stat.proto.md index b435f76..3b46e90 100644 --- a/docs/stat.proto.md +++ b/docs/stat.proto.md @@ -35,16 +35,16 @@ direction LR %% class Stat { - + bool configChange - + bool dataModified - + uint32 error + int64 measuredAt - + bool sorting + + uint32 error + bool sync - + uint32 timeQuality + + bool sorting + bool trigger - + uint32 triggerReason + + bool configChange + + bool dataModified + + uint32 timeQuality + uint32 unlockedTime + + uint32 triggerReason } ``` @@ -63,16 +63,16 @@ Headers used in rabbitMQ: | Field | Ordinal | Type | Label | Description | |-----------------|---------|----------|-------|---------------------------------------------------------------| -| `configChange` | 6 | `bool` | | Configuration change status | -| `dataModified` | 7 | `bool` | | Data modification status | -| `error` | 2 | `uint32` | | Error code uint8 | | `measuredAt` | 1 | `int64` | | The time of creation of the stat data (Unix msec timestamp). | -| `sorting` | 4 | `bool` | | Sorting status | +| `error` | 2 | `uint32` | | Error code uint8 | | `sync` | 3 | `bool` | | Synchronization status | -| `timeQuality` | 8 | `uint32` | | Time quality uint8 | +| `sorting` | 4 | `bool` | | Sorting status | | `trigger` | 5 | `bool` | | Trigger status | -| `triggerReason` | 10 | `uint32` | | Trigger reason uint8 | +| `configChange` | 6 | `bool` | | Configuration change status | +| `dataModified` | 7 | `bool` | | Data modification status | +| `timeQuality` | 8 | `uint32` | | Time quality uint8 | | `unlockedTime` | 9 | `uint32` | | Unlocked time uint8 | +| `triggerReason` | 10 | `uint32` | | Trigger reason uint8 | diff --git a/docs/task.proto.md b/docs/task.proto.md index 838bf05..a882ee9 100644 --- a/docs/task.proto.md +++ b/docs/task.proto.md @@ -121,12 +121,12 @@ direction LR %% class Task { + + TaskType taskType + int64 createdAt + List~Parameter~ parameters - + TaskType taskType } -Task --> `Parameter` Task --> `TaskType` +Task --> `Parameter` ``` ### Notification Diagram @@ -145,9 +145,9 @@ direction LR %% class Notification { + + NotificationType notificationType + int64 createdAt + string message - + NotificationType notificationType + List~Parameter~ parameters } Notification --> `NotificationType` @@ -186,9 +186,9 @@ Headers used in rabbitMQ: | Field | Ordinal | Type | Label | Description | |--------------|---------|-------------|----------|-------------------------------------------| +| `taskType` | 1 | `TaskType` | | Type of the task | | `createdAt` | 2 | `int64` | | Task creation time (Unix msec timestamp) | | `parameters` | 3 | `Parameter` | Repeated | | -| `taskType` | 1 | `TaskType` | | Type of the task | @@ -209,9 +209,9 @@ Headers used in rabbitMQ: | Field | Ordinal | Type | Label | Description | |--------------------|---------|--------------------|----------|--------------------------------------------------------------------------------------| +| `notificationType` | 1 | `NotificationType` | | Notification type | | `createdAt` | 2 | `int64` | | Notification creation time (Unix msec timestamp) | | `message` | 3 | `string` | | Notification message, it can be a string or a integer (which maps to a enum value). | -| `notificationType` | 1 | `NotificationType` | | Notification type | | `parameters` | 4 | `Parameter` | Repeated | | diff --git a/docs/topology.proto.md b/docs/topology.proto.md index defd003..8d100f1 100644 --- a/docs/topology.proto.md +++ b/docs/topology.proto.md @@ -53,12 +53,12 @@ direction LR %% class TopologicalNode { - + double BaseVoltage - + string BaseVoltageId - + string ConnectivityNodeContainerId + + List~string~ TerminalIds + List~string~ ConnectivityNodeIds + List~string~ PowerTransferEndIds - + List~string~ TerminalIds + + string ConnectivityNodeContainerId + + string BaseVoltageId + + double BaseVoltage } ``` @@ -94,11 +94,11 @@ direction LR class ComputedTopology { + string eqId - + Map~string, TopologicalIsland~ topologicalIslands + Map~string, TopologicalNode~ topologicalNodes + + Map~string, TopologicalIsland~ topologicalIslands } -ComputedTopology .. ` TopologicalIsland` ComputedTopology .. ` TopologicalNode` +ComputedTopology .. ` TopologicalIsland` ``` @@ -135,12 +135,12 @@ A topology Node information. | Field | Ordinal | Type | Label | Description | |-------------------------------|---------|----------|----------|------------------------------------------------------------------| -| `BaseVoltage` | 6 | `double` | | The BaseVoltage in the TopologicalNode. | -| `BaseVoltageId` | 5 | `string` | | The id of the BaseVoltage in the TopologicalNode. | -| `ConnectivityNodeContainerId` | 4 | `string` | | The id of the ConnectivityNodeContainer in the TopologicalNode. | +| `TerminalIds` | 1 | `string` | Repeated | The list of Terminal ids in the TopologicalNode. | | `ConnectivityNodeIds` | 2 | `string` | Repeated | The list of ConnectivityNode ids in the TopologicalNode. | | `PowerTransferEndIds` | 3 | `string` | Repeated | The list of PowerTransferEnd ids in the TopologicalNode. | -| `TerminalIds` | 1 | `string` | Repeated | The list of Terminal ids in the TopologicalNode. | +| `ConnectivityNodeContainerId` | 4 | `string` | | The id of the ConnectivityNodeContainer in the TopologicalNode. | +| `BaseVoltageId` | 5 | `string` | | The id of the BaseVoltage in the TopologicalNode. | +| `BaseVoltage` | 6 | `double` | | The BaseVoltage in the TopologicalNode. | @@ -178,8 +178,8 @@ Headers used in rabbitMQ: | Field | Ordinal | Type | Label | Description | |----------------------|---------|-----------------------------|-------|-------------------------------------------------| | `eqId` | 1 | `string` | | The id of the EQ file used. | -| `topologicalIslands` | 3 | `string, TopologicalIsland` | Map | The map of TopologicalIslands in the Topology. | | `topologicalNodes` | 2 | `string, TopologicalNode` | Map | The map of TopologicalNodes in the Topology. | +| `topologicalIslands` | 3 | `string, TopologicalIsland` | Map | The map of TopologicalIslands in the Topology. | diff --git a/zaphiro/grid/v1/fault.proto b/zaphiro/grid/v1/fault.proto index fc5f66d..5909064 100644 --- a/zaphiro/grid/v1/fault.proto +++ b/zaphiro/grid/v1/fault.proto @@ -30,7 +30,7 @@ An unordered enumeration of phase identifiers. Allows designation of phases for Residential and small commercial loads are often served from single-phase, or split-phase, secondary circuits. For the example of s12N, phases 1 and 2 refer to hot wires that are 180 degrees out of phase, while N refers to the neutral wire. Through single-phase transformer connections, these secondary circuits may be served from one or two of the primary phases A, B, and C. For three-phase loads, use the A, B, C phase codes instead of s12N. The integer values are from IEC 61968-9 to support revenue metering applications. -This message is modeled after [CIM PhaseCode](https://zepben.github.io/evolve/docs/cim/evolve/IEC61970/Base/Core/PhaseCode/). +This message is modeled after [CIM PhaseCode](https://zepben.github.io/evolve/docs/cim/cim100/TC57CIM/IEC61970/Base/Core/PhaseCode/). */ enum PhaseCode {