Bug fix in Danfoss.VLT2800.Pump, ver. 3.5.2012

This commit is contained in:
Milan Hanajik 2023-01-25 09:57:47 +01:00
parent 90b62779fd
commit e2048ed64c
2 changed files with 8 additions and 13 deletions

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.5.1997.0")]
[assembly: AssemblyFileVersion("3.5.1997.0")]
[assembly: AssemblyVersion("3.5.2012.0")]
[assembly: AssemblyFileVersion("3.5.2012.0")]

View File

@ -102,14 +102,14 @@ namespace TBF.Rig.Danfoss.VLT2800
///
public void IncreaseSetpoint()
{
power += 0.05;
power += 2.0;
if (power > 100.0) power = 100.0;
TurnOn(power);
}
///
public void DecreaseSetpoint()
{
power -= 0.05;
power -= 2.0;
if (power <= 0)
{
power = 0;
@ -122,12 +122,10 @@ namespace TBF.Rig.Danfoss.VLT2800
}
readonly IControlBoard controlBoard;
int bitNr; /// 0 .. 127
public UInt128 Mask; /// derived from bitPosition in the constructor
public bool State { get { return (controlBoard.Route & Mask) != 0; } }
public bool State { get { return (TBF.Rig.StateMachine.ControlBoard.Route & Mask) != 0; } }
/// Private fields
SerialPort serialPort;
@ -146,15 +144,12 @@ namespace TBF.Rig.Danfoss.VLT2800
: base(cfg)
{
pumpCfg = cfg as PumpCfg;
controlBoard = TbfComponents.FindComponent("CB", components) as IControlBoard; /// TODO: replace "CB"
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
log.Warn(this.ToString());
}
public override void Initialize()
{
if (TBF.Rig.StateMachine.ControlBoard == null) throw new Exception("Control board is missing");
bitNr = pumpCfg.BitNr;
Mask = (((UInt128)1) << bitNr);
@ -174,7 +169,7 @@ namespace TBF.Rig.Danfoss.VLT2800
serialPort.Handshake = Handshake.None;
serialPort.Open();
responseBuilder = new StringBuilder(40);
log.FatalFormat("{0} - Device successfully initialized", Name);
log.FatalFormat("{0} initialized: {1}", Name, this);
}
else
{