- Fixed bugs in (simultaneous) tank emptying
This commit is contained in:
@@ -46,19 +46,21 @@ namespace TBF.BenchControl.MettlerToledo
|
||||
/// </returns>
|
||||
public Event Run()
|
||||
{
|
||||
if (done) return Event.BalanceDone; /// Mass has already been read
|
||||
|
||||
if (balanceDev.MsrmntState == MsrmntState.Busy) return Event.None;
|
||||
|
||||
if (balanceDev.MsrmntState == MsrmntState.Valid)
|
||||
{
|
||||
result.Val = balanceDev.Mass;
|
||||
done = true;
|
||||
return Event.BalanceDone; /// Mass read OK
|
||||
}
|
||||
|
||||
balanceDev.GetImmediateMassMeasurement(); /// Failed -> repeat the measurement
|
||||
return Event.None;
|
||||
if (balanceDev.MsrmntState == MsrmntState.Valid)
|
||||
{
|
||||
result.Val = balanceDev.Mass;
|
||||
done = true;
|
||||
balanceDev.GetImmediateMassMeasurement(); /// Start another measurement
|
||||
return Event.BalanceDone; /// Mass read OK
|
||||
}
|
||||
else if (done)
|
||||
{
|
||||
return Event.BalanceDone; /// Mass has already been read (at least once)
|
||||
}
|
||||
else
|
||||
{
|
||||
return Event.None;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
|
||||
Reference in New Issue
Block a user