MettlerToledo.Multi RunDeviceBefore() fixed, ver. 1.3.32.
This commit is contained in:
@@ -69,7 +69,6 @@ namespace TBF.BenchControl.MettlerToledo.Multi
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="cfg">Balance properties</param>
|
||||
/// <param components="cfg">A list of components loaded so far</param>
|
||||
public BalanceDev(BalanceCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
@@ -112,23 +111,6 @@ namespace TBF.BenchControl.MettlerToledo.Multi
|
||||
return (mass <= balanceCfg.Empty);
|
||||
}
|
||||
|
||||
public void ZeroWhenStable()
|
||||
{
|
||||
if (balanceCfg.DebugLevel == Entities.DebugMode.Simulate) return;
|
||||
|
||||
if (msrmntState == MsrmntState.Busy)
|
||||
{
|
||||
log.Warn("ZeroWhenStable() returns without starting zeroing the scale because measurementState == MeasurementState.Busy");
|
||||
return;
|
||||
}
|
||||
|
||||
log.Info("ZeroWhenStable()");
|
||||
|
||||
msrmntState = MsrmntState.Busy;
|
||||
stringBuilder.Clear();
|
||||
serialPort.Write("Z\r\n");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse characters received from the serial port
|
||||
/// </summary>
|
||||
@@ -193,17 +175,17 @@ namespace TBF.BenchControl.MettlerToledo.Multi
|
||||
out tmpMass))
|
||||
{
|
||||
Masses[balanceIdNr - 1] = tmpMass * Balances[balanceIdNr - 1].Resolution;
|
||||
msrmntState = MsrmntState.Valid;
|
||||
Balances[balanceIdNr - 1].msrmntState = MsrmntState.Valid;
|
||||
log.InfoFormat("Balance({2}) response = \"{0}<cr>\", Mass = {1}kg", received, Masses[balanceIdNr - 1], balanceIdNr);
|
||||
}
|
||||
else
|
||||
{
|
||||
msrmntState = MsrmntState.Busy;
|
||||
Balances[balanceIdNr - 1].msrmntState = MsrmntState.Busy;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msrmntState = MsrmntState.Failed;
|
||||
Balances[balanceIdNr - 1].msrmntState = MsrmntState.Failed;
|
||||
log.WarnFormat("Balance({2}) response = \"{0}<cr>\", Unexpected error !!!", received, balanceIdNr);
|
||||
}
|
||||
|
||||
@@ -232,17 +214,17 @@ namespace TBF.BenchControl.MettlerToledo.Multi
|
||||
out tmpMass))
|
||||
{
|
||||
Masses[balanceIdNr - 1] = tmpMass * Balances[balanceIdNr - 1].Resolution;
|
||||
msrmntState = MsrmntState.Valid;
|
||||
Balances[balanceIdNr - 1].msrmntState = MsrmntState.Valid;
|
||||
log.InfoFormat("Balance({2}) response = \"{0}<cr>\", Mass = {1}kg", received, Masses[balanceIdNr - 1], balanceIdNr);
|
||||
}
|
||||
else
|
||||
{
|
||||
msrmntState = MsrmntState.Busy;
|
||||
Balances[balanceIdNr - 1].msrmntState = MsrmntState.Busy;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msrmntState = MsrmntState.Failed;
|
||||
Balances[balanceIdNr - 1].msrmntState = MsrmntState.Failed;
|
||||
log.WarnFormat("Balance({2}) response = \"{0}<cr>\", Unexpected error !!!", received, balanceIdNr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user