rsmp-nordic / sxl-tools

Exports signal exchange lists (SXL) used by RSMP from Excel-format to CSV, RST and YAML format
MIT License
0 stars 0 forks source link

sxl-tools

Exports signal exchange lists (SXL) used by RSMP from Excel-format (xlsx) to various formats.

Notes about create_template.py

Notes about merge_yaml.rb

Merge object and site yaml files for use with the RSMP simulator

Notes about xlsx2csv

Notes about xlsx2yaml

Notes about yaml2xlsx

Notes about yaml2rst

Creating yaml file for the RSMP simulator

The rsmp_schema repo contains the SXLs in YAML format. For instance the SXL 1.1 for TLCs. The SXLs of rsmp_schema contains alarm, statuses and commands, but doesn't contain individual components of the local installations, which the RSMP simulator need in order to function.

In order to construct a YAML file for the RSMP simulator, one must first combine the SXL of rsmp_schema with a YAML containing a set of components. There is an example here. Use the merge_yaml.rb tool to do the merge.

Site information

Site fields contains all the individual components of a specific site. This is needed by the RSMP simulator to tie a specific component (object) to an alarm, status or command, but is not needed to construct a JSon schema.

Mapping between XLSX and YAML format of the SXL

Version sheet

Cell Name in Excel YAML
B2 Plant id id
B6 Plant name description
B10 Constructor constructor
B12 Reviewed reviewed
B15 Approved approved
B18 Created date created-date
B21 Revision number version
C21 Revision date date
B26 RSMP version rsmp-version

Object types

Cell Name in Excel YAML
A7.. ObjectType [ObjectType]
B7.. Description/comment description

Objects (site information)

Cell Name in Excel YAML
A7.. ObjectType [ObjectType]
B7.. Object [Object]
C7.. componentId [Object]: [componentId]
D7.. NTSObjectId ntsObjectid
E7.. externalNtsId externalNtsId
F7.. Description description

Aggregated status

Cell Name in Excel YAML
C7.. functionalPosition functional_position
D7.. functionalState functional_state
A17.. Comment aggregated_status_description

Alarms

Cell Name in Excel YAML
A7.. ObjectType [ObjectType]
B7.. Object (optional) [Object]
C7.. alarmCodeId [alarmCodeId]
D7.. Description description
E7.. externalAlarmCodeId externalAlarmCodeId
F7.. externalNtsAlarmCodeId externalNtsAlarmCodeId
G7.. Priority priority
H7.. Category category
I7.. Name [Name]
J7.. Type type
K7.. Value values (list)
K7.. Value max,min (integer, long, real)
L7.. Comment description

Status

Cell Name in Excel YAML
A7.. ObjectType [ObjectType]
B7.. Object (optional) [Object]
C7.. statusCodeId [statusCodeId]
D7.. Description description
E7.. Name [Name]
F7.. Type type
G7.. Value values (list)
G7.. Value max,min (integer, long, real)
H7.. Comment description

Commands

Cell Name in Excel YAML
A7.. ObjectType [ObjectType]
B7.. Object (optional) [Object]
C7.. commandCodeId [commandCodeId]
D7.. Description description
E7.. Name [Name]
F7.. Command command
G7.. Type type
H7.. Value values (list)
h7.. Value max,min (integer, long, real)
I7.. Comment description

Example usages

Example 1: Convert the SXL from Excel to YAML.

xlsx2yaml.rb SXL_Traffic_Controller.xlsx

Example 2: Convert the SXL from Excel format to RST.

xlsx2yaml.rb SXL_Traffic_Controller.xlsx | yaml2rst.py > sxl_traffic_light_controller.rst

Example 3: Convert the SXL from Excel format to YAML, and then back again to Excel using a template. Includes site information

xlsx2yaml.rb -s SXL_Traffic_Controller.xlsx | yaml2xlsx.rb --template "RSMP_Template_SignalExchangeList-20120117.xlsx"