Skip to content

Commit

Permalink
Update Excel config server and worksheet to add new tag parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
riclolsen committed Jan 8, 2025
1 parent 3d986e0 commit d8a5990
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 92 deletions.
Binary file modified conf-templates/json-scada-config.xlsm
Binary file not shown.
2 changes: 1 addition & 1 deletion src/config_server_for_excel/app-defs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.1',
VERSION: '0.2.0',
}
43 changes: 33 additions & 10 deletions src/config_server_for_excel/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* {json:scada} - Copyright (c) 2020-2024 - Ricardo L. Olsen
* {json:scada} - Copyright (c) 2020-2025 - 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 @@ -241,6 +241,10 @@ MongoClient.connect(
'alarmDisabled',
'commandBlocked',
'commissioningRemarks',
'protocolSourceDiscardOldest',
'protocolSourcePublishingInterval',
'protocolSourceQueueSize',
'protocolSourceSamplingInterval',
]
let projection = {}
fields.forEach((value) => {
Expand Down Expand Up @@ -309,6 +313,7 @@ MongoClient.connect(
elem.commandOfSupervised = toMongoDouble(elem.commandOfSupervised)
elem.supervisedOfCommand = toMongoDouble(elem.supervisedOfCommand)
elem.alarmState = toMongoDouble(elem.alarmState)
elem.alertedState = toMongoDouble(elem.alertedState)
elem.formula = toMongoDouble(elem.formula)
elem.kconv1 = toMongoDouble(elem.kconv1, 1)
elem.kconv2 = toMongoDouble(elem.kconv2, 0)
Expand All @@ -333,6 +338,19 @@ MongoClient.connect(
elem.protocolSourceCommandUseSBO,
false
)
elem.protocolSourceDiscardOldest = toMongoBoolean(
elem.protocolSourceDiscardOldest,
false
)
elem.protocolSourcePublishingInterval = toMongoDouble(
elem.protocolSourcePublishingInterval
)
elem.protocolSourceQueueSize = toMongoDouble(
elem.protocolSourceQueueSize
)
elem.protocolSourceSamplingInterval = toMongoDouble(
elem.protocolSourceSamplingInterval
)
elem.protocolDestinations = toMongoObj(elem.protocolDestinations, [])
elem.protocolDestinations.forEach((pd) => {
pd.protocolDestinationConnectionNumber = toMongoDouble(
Expand Down Expand Up @@ -384,23 +402,28 @@ MongoClient.connect(
delete elem._id

let onInsert = {
value: new Double(0),
valueString: '',
valueJson: {},
sourceDataUpdate: null,
invalid: true,
substituted: false,
alarmed: false,
overflow: false,
transient: false,
frozen: false,
alarmRange: new Double(0),
alerted: false,
alertState: '',
annotation: '',
frozen: false,
historianLastValue: null,
invalid: true,
notes: '',
overflow: false,
sourceDataUpdate: null,
substituted: false,
timeTag: null,
timeTagAlarm: null,
timeTagAlertState: null,
timeTagAtSource: null,
timeTagAtSourceOk: false,
transient: false,
updatesCnt: new Double(0),
value: new Double(0),
valueJson: '',
valueString: '',
}

if (elem.tag.trim() === '') {
Expand Down
Binary file modified src/config_server_for_excel/json-scada-config.xlsm
Binary file not shown.
111 changes: 30 additions & 81 deletions src/config_server_for_excel/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d8a5990

Please sign in to comment.