Thanks to visit codestin.com
Credit goes to github.com

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
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