PumpTandem implemented for the case of two FM pumps with equal distribution of power

This commit is contained in:
Milan Hanajik
2015-01-16 05:24:34 +01:00
parent 6e75926d0b
commit e07cf3c5d3
@@ -14,6 +14,9 @@ namespace TBF.BenchControl.Elde.PumpTandem
readonly GenericDevices.IPump pump1;
readonly GenericDevices.IPump pump2;
readonly GenericDevices.IPumpFM pumpFm1;
readonly GenericDevices.IPumpFM pumpFm2;
public bool State { get { return pump1.State || pump2.State; } }
public int Delay { get { return Math.Max(pump1.Delay, pump2.Delay); } }
public float Power { get { return pumpCfg.TestParams.Power; } }
@@ -29,23 +32,52 @@ namespace TBF.BenchControl.Elde.PumpTandem
pump2 = (GenericDevices.IPump)TbfComponents.FindComponent(cfg.Pump2, components);
if (pump2 == null) throw new Exception("Cannot find component Pump 2");
log.Debug(this.ToString());
pumpFm1 = pump1 as GenericDevices.IPumpFM;
pumpFm2 = pump2 as GenericDevices.IPumpFM;
log.Debug(this.ToString());
}
public void TurnOnDfltPower()
{
// TODO
TurnOn(Power);
}
public void TurnOn(float powerArg)
{
// TODO
if ((pumpFm1 != null) && (pumpFm2 != null))
{
pumpFm1.TurnOn(powerArg);
pumpFm2.TurnOn(powerArg);
}
else if ((pumpFm1 != null) && (pumpFm2 == null))
{
if (powerArg >= 50)
{
pumpFm1.TurnOn(2 * (powerArg - 50.0f));
//pump2.
}
else
{
pumpFm1.TurnOn(2 * powerArg);
//pump2.
}
// TODO
}
}
public void TurnOff()
{
// TODO
if ((pumpFm1 != null) && (pumpFm2 != null))
{
pumpFm1.TurnOff();
pumpFm2.TurnOff();
}
else
{
// TODO
}
}