Initialization of 30 components changed, done in Initialize( ).

This commit is contained in:
Milan Hanajik
2021-04-03 00:54:27 +02:00
parent cb1a66381f
commit a58fe1f997
30 changed files with 347 additions and 445 deletions
+23 -27
View File
@@ -118,17 +118,12 @@ namespace TBF.Rig.Modbus.PumpFM.DanfossVLT
}
}
readonly GenericDevices.IModbus modbus;
readonly IControlBoard controlBoard;
readonly int bitNr; /// 0 .. 63
public readonly UInt128 Mask; /// derived from bitPosition in the constructor
int bitNr; /// 0 .. 63
public UInt128 Mask; /// derived from bitPosition in the constructor
public bool State
{
get { return (controlBoard.Route & Mask) != 0; }
}
public bool State { get { return (controlBoard.Route & Mask) != 0; } }
public Pump() { }
@@ -153,31 +148,32 @@ namespace TBF.Rig.Modbus.PumpFM.DanfossVLT
}
if (controlBoard == null) throw new Exception("Cannot find a control board");
bitNr = pumpCfg.BitNr;
Mask = (((UInt128)1) << bitNr);
TBF.UiBridge.Bridge.SetpointChangeHandler += delegate(object sndr, TBF.UiBridge.SetpointChangeArgs args)
{
if (args.Name == Name)
{
if (args.Increase)
{
IncreaseSetpoint();
}
else
{
DecreaseSetpoint();
}
}
};
log.Warn(this.ToString());
}
///
/// IDevice interface
///
public void Initialize() { }
public override void Initialize()
{
bitNr = pumpCfg.BitNr;
Mask = (((UInt128)1) << bitNr);
TBF.UiBridge.Bridge.SetpointChangeHandler += delegate(object sndr, TBF.UiBridge.SetpointChangeArgs args)
{
if (args.Name == Name)
{
if (args.Increase)
{
IncreaseSetpoint();
}
else
{
DecreaseSetpoint();
}
}
};
}
public void RunDeviceBefore()
{