From b434711de1f4eff0d69afdabe4cb0f694c693349 Mon Sep 17 00:00:00 2001 From: Ricardo Olsen Date: Sat, 12 Aug 2023 11:35:51 -0300 Subject: [PATCH] Fixed type of protocolSourceCommonAddress, protocolDestinationCommonAddress and protocolDestinationGroup on config_server_for_excel. --- docs/schema.md | 10 ++++++++++ src/config_server_for_excel/app-defs.js | 2 +- src/config_server_for_excel/index.js | 6 +++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/schema.md b/docs/schema.md index 8736d63c..ef5fba38 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -158,6 +158,16 @@ Example document. * _**_protocolSourceCommandDuration_**_ [Double] - Additional command specification. Only meaningful when _origin=command_. See protocol documentation. **Mandatory parameter**. * _**_protocolSourceCommandUseSBO_**_ [Boolean] - Use or not Select Before Operate for commands. Only meaningful when _origin=command_. See protocol documentation. **Mandatory parameter**. * _**_protocolDestinations_**_ [Array of Objects] - List of protocol destinations for server protocol connections. Can be null or empty array when not point is not to be distributed. See protocol documentation. **Mandatory parameter**. +* _**_protocolDestinationConnectionNumber_**_ [Double] - Indicates the protocol connection that will monitor updates to the point. Should contain only integer values. **Mandatory parameter**. +* _**_protocolDestinationCommonAddress_**_ [Double or String] - Protocol common address (device address). See protocol documentation. **Mandatory parameter**. +* _**_protocolDestinationObjectAddress_**_ [Double or String] - Protocol object address. See protocol documentation. **Mandatory parameter**. +* _**_protocolDestinationASDU_**_ [Double or String] - Protocol information ASDU TI type. See protocol documentation. **Mandatory parameter**. +* _**_protocolDestinationCommandDuration_**_ [Double] - Additional command specification. See protocol documentation. **Mandatory parameter**. +* _**_protocolDestinationCommandUseSBO_**_ [Boolean] - Use or not Select Before Operate for commands. See protocol documentation. **Mandatory parameter**. +* _**_protocolDestinationKConv1_**_ [Double] - Conversion factor 1 (multiplier). **Mandatory parameter**. +* _**_protocolDestinationKConv2_**_ [Double] - Conversion factor 2 (adder). **Mandatory parameter**. +* _**_protocolDestinationGroup_**_ [Double or String] - Group number or dataset id of points. See protocol documentation. **Mandatory parameter**. +* _**_protocolDestinationHoursShift_**_ [Double] - Number of hours to add to timestamps. **Mandatory parameter**. ### Fields that can be configured and altered by the operators. diff --git a/src/config_server_for_excel/app-defs.js b/src/config_server_for_excel/app-defs.js index 23b0e449..b9b432a2 100644 --- a/src/config_server_for_excel/app-defs.js +++ b/src/config_server_for_excel/app-defs.js @@ -23,5 +23,5 @@ module.exports = { HTTP_PORT: 10001, IP_BIND: '127.0.0.1', MSG: '{json:scada} - Config Server for Excel', - VERSION: '0.1.0', + VERSION: '0.1.1', } diff --git a/src/config_server_for_excel/index.js b/src/config_server_for_excel/index.js index d637819b..385bbde3 100644 --- a/src/config_server_for_excel/index.js +++ b/src/config_server_for_excel/index.js @@ -314,7 +314,7 @@ MongoClient.connect( elem.protocolSourceConnectionNumber = toMongoDouble( elem.protocolSourceConnectionNumber ) - elem.protocolSourceCommonAddress = toMongoDouble( + elem.protocolSourceCommonAddress = toMongoDoubleOrString( elem.protocolSourceCommonAddress ) elem.protocolSourceObjectAddress = toMongoDoubleOrString( @@ -333,7 +333,7 @@ MongoClient.connect( pd.protocolDestinationConnectionNumber = toMongoDouble( pd.protocolDestinationConnectionNumber ) - pd.protocolDestinationCommonAddress = toMongoDouble( + pd.protocolDestinationCommonAddress = toMongoDoubleOrString( pd.protocolDestinationCommonAddress ) pd.protocolDestinationObjectAddress = toMongoDoubleOrString( @@ -357,7 +357,7 @@ MongoClient.connect( pd.protocolDestinationKConv2, 0 ) - pd.protocolDestinationGroup = toMongoDouble( + pd.protocolDestinationGroup = toMongoDoubleOrString( pd.protocolDestinationGroup, 0 )