new switching line functionality - in progress
This commit is contained in:
parent
31fe341ef1
commit
d289a99d07
3 changed files with 1485 additions and 1194 deletions
1318
flow/cmd_manager.js
1318
flow/cmd_manager.js
File diff suppressed because it is too large
Load diff
|
|
@ -60,7 +60,7 @@ state_of_contactor - podľa indexu stykača sa reportuje jeho stav, teda
|
||||||
|
|
||||||
//globals
|
//globals
|
||||||
//FIRMWARE version
|
//FIRMWARE version
|
||||||
FLOW.OMS_edge_fw_version = "2023-10-18";//rok-mesiac-den
|
FLOW.OMS_edge_fw_version = "2024-05-10";//rok-mesiac-den
|
||||||
FLOW.OMS_edgeName = "";
|
FLOW.OMS_edgeName = "";
|
||||||
FLOW.OMS_maintenance_mode = false;
|
FLOW.OMS_maintenance_mode = false;
|
||||||
|
|
||||||
|
|
@ -507,15 +507,18 @@ exports.install = function(instance) {
|
||||||
|
|
||||||
|
|
||||||
ws.on('error', (err) => {
|
ws.on('error', (err) => {
|
||||||
|
monitor.info('websocket error, reconnect')
|
||||||
instance.send(instanceSendTo.debug, err.message);
|
instance.send(instanceSendTo.debug, err.message);
|
||||||
clearInterval(startRequests);
|
clearInterval(startRequests);
|
||||||
startRequests = null;
|
ws = null;
|
||||||
|
setTimeout(handleWebSocket, 1000);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
ws.onclose = function(){
|
ws.onclose = function(){
|
||||||
// connection closed, discard old websocket and create a new one in 5s
|
// connection closed, discard old websocket and create a new one in 5s
|
||||||
// stopRequests();
|
// stopRequests();
|
||||||
|
monitor.info('websocket onclose, reconnect')
|
||||||
clearInterval(startRequests);
|
clearInterval(startRequests);
|
||||||
ws = null;
|
ws = null;
|
||||||
console.log("ws is null now, reconnecting...");
|
console.log("ws is null now, reconnecting...");
|
||||||
|
|
|
||||||
|
|
@ -139,16 +139,16 @@ exports.install = function(instance) {
|
||||||
|
|
||||||
obj.transformResponse(resp, register, obj.deviceAddress);
|
obj.transformResponse(resp, register, obj.deviceAddress);
|
||||||
|
|
||||||
obj.error = 0;
|
obj.errors = 0;
|
||||||
obj.index++;
|
obj.index++;
|
||||||
obj.readAnotherRegister();
|
obj.readAnotherRegister();
|
||||||
|
|
||||||
}).catch (function () {
|
}).catch (function () {
|
||||||
|
|
||||||
console.log("error pri citani modbus registra", register, obj.indexInDeviceConfig, tbName, tbAttribute);
|
console.log("errors pri citani modbus registra", register, obj.indexInDeviceConfig, tbName, tbAttribute);
|
||||||
|
|
||||||
obj.error++;
|
obj.errors++;
|
||||||
if(obj.error == obj.lengthOfActualDeviceStream)
|
if(obj.errors == obj.lengthOfActualDeviceStream)
|
||||||
{
|
{
|
||||||
instance.send(instanceSendTo.dido_controller, {status: "NOK-" + obj.device}); // NOK-em340, NOK-em111, NOK-twilight_sensor, NOK-thermometer
|
instance.send(instanceSendTo.dido_controller, {status: "NOK-" + obj.device}); // NOK-em340, NOK-em111, NOK-twilight_sensor, NOK-thermometer
|
||||||
|
|
||||||
|
|
@ -168,7 +168,7 @@ exports.install = function(instance) {
|
||||||
numberOfNotResponding[obj.device] = 1;
|
numberOfNotResponding[obj.device] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
obj.error = 0;
|
obj.errors = 0;
|
||||||
numberOfNotResponding[obj.device] += 1;
|
numberOfNotResponding[obj.device] += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue