Modbus.PumpFM.DanfossVLT.Pump.Initialize( ) modification : modbus.ComponentNames[pumpCfg.ModbusAddress] = Name;

This commit is contained in:
Milan Hanajik
2021-05-04 15:15:35 +02:00
parent 3a2ab6c286
commit 4f1e7507f9
+3 -2
View File
@@ -118,7 +118,7 @@ namespace TBF.Rig.Modbus.PumpFM.DanfossVLT
}
}
readonly GenericDevices.IModbus modbus;
readonly Common.Modbus modbus;
readonly IControlBoard controlBoard;
int bitNr; /// 0 .. 63
public UInt128 Mask; /// derived from bitPosition in the constructor
@@ -137,7 +137,7 @@ namespace TBF.Rig.Modbus.PumpFM.DanfossVLT
{
pumpCfg = cfg as PumpCfg;
modbus = (GenericDevices.IModbus)TbfComponents.FindComponent(cfg.ParentName, components);
modbus = TbfComponents.FindComponent(cfg.ParentName, components) as Common.Modbus;
if (modbus == null) throw new Exception("Cannot find " + Name + " parent");
controlBoard = null;
@@ -158,6 +158,7 @@ namespace TBF.Rig.Modbus.PumpFM.DanfossVLT
{
bitNr = pumpCfg.BitNr;
Mask = (((UInt128)1) << bitNr);
modbus.ComponentNames[pumpCfg.ModbusAddress] = Name;
TBF.UiBridge.Bridge.SetpointChangeHandler += delegate(object sndr, TBF.UiBridge.SetpointChangeArgs args)
{