new switching line functionality - in progress
This commit is contained in:
parent
31fe341ef1
commit
d289a99d07
3 changed files with 1485 additions and 1194 deletions
2660
flow/cmd_manager.js
2660
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
|
||||
//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_maintenance_mode = false;
|
||||
|
||||
|
|
@ -507,15 +507,18 @@ exports.install = function(instance) {
|
|||
|
||||
|
||||
ws.on('error', (err) => {
|
||||
monitor.info('websocket error, reconnect')
|
||||
instance.send(instanceSendTo.debug, err.message);
|
||||
clearInterval(startRequests);
|
||||
startRequests = null;
|
||||
ws = null;
|
||||
setTimeout(handleWebSocket, 1000);
|
||||
})
|
||||
|
||||
|
||||
ws.onclose = function(){
|
||||
// connection closed, discard old websocket and create a new one in 5s
|
||||
// stopRequests();
|
||||
monitor.info('websocket onclose, reconnect')
|
||||
clearInterval(startRequests);
|
||||
ws = null;
|
||||
console.log("ws is null now, reconnecting...");
|
||||
|
|
@ -705,7 +708,7 @@ exports.install = function(instance) {
|
|||
// if(!rsPort.isOpen && !ws)
|
||||
if(!rsPort && !ws)
|
||||
{
|
||||
errLogger.error("di do controller - port or websocket is not opened");
|
||||
errLogger.error("dido controller - port or websocket is not opened");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -139,16 +139,16 @@ exports.install = function(instance) {
|
|||
|
||||
obj.transformResponse(resp, register, obj.deviceAddress);
|
||||
|
||||
obj.error = 0;
|
||||
obj.errors = 0;
|
||||
obj.index++;
|
||||
obj.readAnotherRegister();
|
||||
|
||||
}).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++;
|
||||
if(obj.error == obj.lengthOfActualDeviceStream)
|
||||
obj.errors++;
|
||||
if(obj.errors == obj.lengthOfActualDeviceStream)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
obj.error = 0;
|
||||
obj.errors = 0;
|
||||
numberOfNotResponding[obj.device] += 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue