Skip to content

Commit

Permalink
OPC AE Transformer Component (#615)
Browse files Browse the repository at this point in the history
* OPC AE schema and script

Signed-off-by: Amber-Rigg <[email protected]>

* Update documentation

Signed-off-by: Amber-Rigg <[email protected]>

* Test and Black Fromatting

Signed-off-by: Amber-Rigg <[email protected]>

* Test completed

Signed-off-by: Amber-Rigg <[email protected]>

* Rever to develop settings

Signed-off-by: Amber-Rigg <[email protected]>

* Alter http to https

Signed-off-by: Amber-Rigg <[email protected]>

* Removal of Specfic Info

Signed-off-by: Amber-Rigg <[email protected]>

* Update UA to AE

Signed-off-by: Amber-Rigg <[email protected]>

---------

Signed-off-by: Amber-Rigg <[email protected]>
  • Loading branch information
Amber-Rigg authored Dec 18, 2023
1 parent 63bbf08 commit 411fdab
Show file tree
Hide file tree
Showing 6 changed files with 598 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Convert OPC Publisher Json for A&E(Alarm & Events) Data to Process Control Data Model
::: src.sdk.python.rtdip_sdk.pipelines.transformers.spark.opc_publisher_opcae_json_to_pcdm
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ nav:
- Spark:
- Binary To String: sdk/code-reference/pipelines/transformers/spark/binary_to_string.md
- OPC Publisher Json To Process Control Data Model: sdk/code-reference/pipelines/transformers/spark/opc_publisher_opcua_json_to_pcdm.md
- OPC Publisher Json for A&E(Alarm & Events) Data to Process Control Data Model: sdk/code-reference/pipelines/transformers/spark/opc_publisher_opcae_json_to_pcdm.md
- Fledge Json To Process Control Data Model: sdk/code-reference/pipelines/transformers/spark/fledge_opcua_json_to_pcdm.md
- EdgeX JSON data To Process Control Data Model: sdk/code-reference/pipelines/transformers/spark/edgex_opcua_json_to_pcdm.md
- SEM data To Process Control Data Model: sdk/code-reference/pipelines/transformers/spark/sem_json_to_pcdm.md
Expand Down
298 changes: 298 additions & 0 deletions src/sdk/python/rtdip_sdk/pipelines/_pipeline_utils/spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
TimestampType,
StringType,
BinaryType,
BooleanType,
LongType,
MapType,
IntegerType,
Expand Down Expand Up @@ -160,6 +161,303 @@ def get_dbutils(
]
)

OPC_PUBLISHER_AE_SCHEMA = StructType(
[
StructField("NodeId", StringType(), True),
StructField("EndpointUrl", StringType(), True),
StructField("DisplayName", StringType(), True),
StructField(
"Value",
StructType(
[
StructField(
"ConditionId",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"AckedState",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"AckedState/FalseState",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"AckedState/Id",
StructType(
[
StructField("Value", BooleanType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"AckedState/TrueState",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"ActiveState",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"ActiveState/FalseState",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"ActiveState/Id",
StructType(
[
StructField("Value", BooleanType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"ActiveState/TrueState",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"EnabledState",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"EnabledState/FalseState",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"EnabledState/Id",
StructType(
[
StructField("Value", BooleanType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"EnabledState/TrueState",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"EventId",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"EventType",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"HighHighLimit",
StructType(
[
StructField("Value", DoubleType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"HighLimit",
StructType(
[
StructField("Value", DoubleType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"InputNode",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"LowLimit",
StructType(
[
StructField("Value", DoubleType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"LowLowLimit",
StructType(
[
StructField("Value", DoubleType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"Message",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"Quality",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"ReceiveTime",
StructType(
[
StructField("Value", TimestampType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"Retain",
StructType(
[
StructField("Value", BooleanType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"Severity",
StructType(
[
StructField("Value", DoubleType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"SourceName",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"SourceNode",
StructType(
[
StructField("Value", StringType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
StructField(
"Time",
StructType(
[
StructField("Value", TimestampType(), True),
StructField("SourceTimestamp", TimestampType(), True),
]
),
True,
),
]
),
True,
),
]
)


PROCESS_DATA_MODEL_SCHEMA = StructType(
[
StructField("TagName", StringType(), True),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from .spark.binary_to_string import *
from .spark.opc_publisher_opcua_json_to_pcdm import *
from .spark.opc_publisher_opcae_json_to_pcdm import *
from .spark.fledge_opcua_json_to_pcdm import *
from .spark.ssip_pi_binary_file_to_pcdm import *
from .spark.ssip_pi_binary_json_to_pcdm import *
Expand Down
Loading

0 comments on commit 411fdab

Please sign in to comment.