Skip to content

Commit

Permalink
Fixed missing 'substituted' field when autocreating tags in some prot…
Browse files Browse the repository at this point in the history
…ocol drivers.
  • Loading branch information
riclolsen committed May 22, 2024
1 parent 2f46c55 commit 2b82ade
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/OPC-UA-Client/TagsCreation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ public class rtData
public BsonString stateTextFalse { get; set; }
[BsonDefaultValue("")]
public BsonString stateTextTrue { get; set; }
[BsonDefaultValue(false)]
public BsonBoolean substituted { get; set; }
[BsonSerializer(typeof(BsonDoubleSerializer)), BsonDefaultValue(0.0)]
public BsonDouble supervisedOfCommand;
[BsonDefaultValue("")]
Expand Down Expand Up @@ -312,6 +314,7 @@ public static rtData newRealtimeDoc(OPC_Value iv, double _id)
protocolDestinations = BsonNull.Value,
sourceDataUpdate = BsonNull.Value,
supervisedOfCommand = 0.0,
substituted = false,
timeTag = BsonNull.Value,
timeTagAlarm = BsonNull.Value,
timeTagAtSource = BsonNull.Value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ public class rtData
public BsonString stateTextFalse { get; set; }
[BsonDefaultValue("")]
public BsonString stateTextTrue { get; set; }
[BsonDefaultValue(false)]
public BsonBoolean substituted { get; set; }

[BsonSerializer(typeof(BsonDoubleSerializer)), BsonDefaultValue(0.0)]
public BsonDouble supervisedOfCommand;
[BsonDefaultValue("")]
Expand Down Expand Up @@ -364,6 +367,7 @@ public static rtData newRealtimeDoc(IECValue iv, double _id)
priority = 0.0,
protocolDestinations = BsonNull.Value,
sourceDataUpdate = BsonNull.Value,
substituted = false,
supervisedOfCommand = 0.0,
timeTag = BsonNull.Value,
timeTagAlarm = BsonNull.Value,
Expand Down
5 changes: 4 additions & 1 deletion src/telegraf-listener/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* Telegraf listener driver.
*
* {json:scada} - Copyright (c) 2020-2021 - Ricardo L. Olsen
* {json:scada} - Copyright (c) 2020-2024 - Ricardo L. Olsen
* This file is part of the JSON-SCADA distribution (https://github.com/riclolsen/json-scada).
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -244,6 +244,8 @@ const rtData = function (measurement) {
protocolSourceCommonAddress: '',
protocolSourceConnectionNumber: new Double(ConnectionNumber),
protocolSourceObjectAddress: measurement?.tag,
protocolSourceCommandDuration: new Double(0),
protocolSourceCommandUseSBO: false,
alarmState: new Double(-1.0),
alarmRange: new Double(0.0),
description: measurement?.description,
Expand Down Expand Up @@ -296,6 +298,7 @@ const rtData = function (measurement) {
priority: new Double(0.0),
protocolDestinations: null,
sourceDataUpdate: null,
substituted: false,
supervisedOfCommand: new Double(0.0),
timeTag: null,
timeTagAlarm: null,
Expand Down

0 comments on commit 2b82ade

Please sign in to comment.