From 706e0d0a1b5cb1caf41e93501365fef15db336bf Mon Sep 17 00:00:00 2001 From: Robert Strouse Date: Fri, 20 Nov 2020 15:32:42 -0800 Subject: [PATCH] Default chem tank capacity for IntelliChem to 6 no units. --- controller/boards/IntelliCenterBoard.ts | 4 ++++ controller/comms/messages/config/ExternalMessage.ts | 2 ++ controller/comms/messages/config/HeaterMessage.ts | 3 +++ controller/comms/messages/config/IntellichemMessage.ts | 2 ++ controller/comms/messages/status/IntelliChemStateMessage.ts | 6 +++++- 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/controller/boards/IntelliCenterBoard.ts b/controller/boards/IntelliCenterBoard.ts index da14271a..99f23ab1 100644 --- a/controller/boards/IntelliCenterBoard.ts +++ b/controller/boards/IntelliCenterBoard.ts @@ -3381,6 +3381,8 @@ export class IntelliCenterChemControllerCommands extends ChemControllerCommands if (err) { reject(err); } else { chem.isActive = false; + chem.acidTankCapacity = chem.orpTankCapacity = 6; + chem.acidTankUnits = chem.orpTankUnits = ''; let schem = state.chemControllers.getItemById(id); schem.isActive = false; sys.chemControllers.removeItemById(id); @@ -3465,6 +3467,8 @@ export class IntelliCenterChemControllerCommands extends ChemControllerCommands chem.alkalinity = alkalinity; chem.type = 2; chem.name = name; + chem.acidTankCapacity = chem.orpTankCapacity = 6; + chem.acidTankUnits = chem.orpTankUnits = ''; let cstate = state.chemControllers.getItemById(id, true); cstate.body = chem.body; cstate.address = chem.address; diff --git a/controller/comms/messages/config/ExternalMessage.ts b/controller/comms/messages/config/ExternalMessage.ts index ae504d5b..f5bd8a48 100755 --- a/controller/comms/messages/config/ExternalMessage.ts +++ b/controller/comms/messages/config/ExternalMessage.ts @@ -85,6 +85,8 @@ export class ExternalMessage { controller.isActive = scontroller.isActive = isActive; if (isActive) { controller.isVirtual = false; + controller.acidTankCapacity = controller.orpTankCapacity = 6; + controller.acidTankUnits = controller.orpTankUnits = ''; scontroller.type = controller.type = 2; scontroller.name = controller.name = (controller.name || 'IntelliChem' + id); scontroller.body = controller.body = msg.extractPayloadByte(3); diff --git a/controller/comms/messages/config/HeaterMessage.ts b/controller/comms/messages/config/HeaterMessage.ts index 5211a1eb..a8989f82 100755 --- a/controller/comms/messages/config/HeaterMessage.ts +++ b/controller/comms/messages/config/HeaterMessage.ts @@ -169,6 +169,9 @@ export class HeaterMessage { // only support for 1 ic with EasyTouch let chem = sys.chemControllers.getItemByAddress(144, true); state.chemControllers.getItemById(chem.id, true); + chem.acidTankCapacity = chem.orpTankCapacity = 6; + chem.acidTankUnits = chem.orpTankUnits = ''; + } else { let chem = sys.chemControllers.getItemByAddress(144); diff --git a/controller/comms/messages/config/IntellichemMessage.ts b/controller/comms/messages/config/IntellichemMessage.ts index 9182cfee..1c304337 100755 --- a/controller/comms/messages/config/IntellichemMessage.ts +++ b/controller/comms/messages/config/IntellichemMessage.ts @@ -53,6 +53,8 @@ export class IntellichemMessage { if (typeof scontroller.name === 'undefined') controller.name = 'IntelliChem ' + (i + 1); scontroller.name = controller.name; controller.cyanuricAcid = msg.extractPayloadInt((i * 2) + 26); + controller.acidTankCapacity = controller.orpTankCapacity = 6; + controller.acidTankUnits = controller.orpTankUnits = ''; if (typeof scontroller.acidTankLevel === 'undefined') scontroller.acidTankLevel = 0; if (typeof scontroller.orpTankLevel === 'undefined') scontroller.orpTankLevel = 0; diff --git a/controller/comms/messages/status/IntelliChemStateMessage.ts b/controller/comms/messages/status/IntelliChemStateMessage.ts index c3e7801d..62d69fb9 100644 --- a/controller/comms/messages/status/IntelliChemStateMessage.ts +++ b/controller/comms/messages/status/IntelliChemStateMessage.ts @@ -63,6 +63,8 @@ export class IntelliChemStateMessage { // We have not talked to the chem controller in 30 seconds so we have lost communication. scontroller.status = scontroller.alarms.comms = 1; } + controller.acidTankCapacity = controller.orpTankCapacity = 6; + controller.acidTankUnits = controller.orpTankUnits = ''; msg.isProcessed = true; break; // ---------- OCP set get ----------- // @@ -136,7 +138,9 @@ export class IntelliChemStateMessage { controller.name = controller.name || `Chem Controller ${controller.address - 143}`; // default to true id if no name is set scontroller.lastComm = new Date().getTime(); scontroller.status = scontroller.alarms.comms = 0; - + controller.acidTankCapacity = controller.orpTankCapacity = 6; + controller.acidTankUnits = controller.orpTankUnits = ''; + scontroller.address = controller.address; scontroller.pHLevel = msg.extractPayloadIntBE(0) / 100; scontroller.orpLevel = msg.extractPayloadIntBE(2);