Initialization of 30 components changed, done in Initialize( ).
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user