ReadMassesOp eliminated.

This commit is contained in:
Milan Hanajik
2021-04-02 15:12:29 +02:00
parent 51aa0f4e43
commit 8a846a774f
4 changed files with 3 additions and 93 deletions
+3 -6
View File
@@ -76,9 +76,8 @@ namespace TBF.Rig.MettlerToledo.Multi
public string Format { get { return balanceCfg.Format; } }
public BalanceDev()
{
}
public BalanceDev() { }
/// <summary>
/// Constructor
@@ -281,9 +280,7 @@ namespace TBF.Rig.MettlerToledo.Multi
}
/// <summary>Run this device</summary>
public void RunDeviceAfter()
{
}
public void RunDeviceAfter() { }
/// <summary>Stop this device</summary>
public void StopDevice()
-71
View File
@@ -1,71 +0,0 @@
///
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
///
using System;
using log4net;
namespace TBF.Rig.MettlerToledo
{
public class ReadMassesOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ReadMassesOp));
public override string ToString() { return string.Format("ReadMassesOp()"); }
bool done;
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <param name="balanceDev">Balance device instance</param>
/// <param name="requiredReadingsCount">Required mass readings count (>= 3)</param>
/// <param name="result">Reference to the measured mass in kg</param>
public ReadMassesOp()
{
log.Debug(this.ToString());
}
/// <summary>Start this operation</summary>
public void Start()
{
done = false;
for (int i = 0; i < Standard.BalanceDev.BalancesCount; i++)
{
Standard.BalanceDev.Balances[i].SendImmediateMeasurementCmd();
}
}
/// <summary>Run this operation</summary>
/// <returns>
/// Event.None
/// Event.BalanceDone
/// Event.Error . . . . . Current.Tick == null
/// </returns>
public Event Run()
{
if (done) return Event.ScaleDone; /// Mass has already been read
for (int i = 0; i < Standard.BalanceDev.BalancesCount; i++)
{
if (Standard.BalanceDev.Balances[i].MsrmntState == MsrmntState.Busy)
{
return Event.None;
}
}
for (int i = 0; i < Multi.BalanceDev.BalancesCount; i++)
{
if (Multi.BalanceDev.Balances[i].MsrmntState == MsrmntState.Busy)
{
return Event.None;
}
}
done = true;
return Event.ScaleDone;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}
-15
View File
@@ -144,21 +144,6 @@ namespace TBF.Rig.Sequences
}
while (e.Contains(Event.Busy));
//--------------------------------------------------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight);
State.Create("MainSeq : Mesuring the weight for the 1st time")
.AddOperation(checkUiOp)
.AddOperation(new MettlerToledo.ReadMassesOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) goto error;
if (e.Contains(Event.UiCmdStop)) goto stop;
}
while (!e.Contains(Event.ScaleDone));
select_procedure:
CloseBeginForm(); /// Make sure the CycleBeginForm is closed (after an abnormal end, etc.)
-1
View File
@@ -633,7 +633,6 @@
<Compile Include="Rig\MettlerToledo\Multi\ReadStableMassOp.cs" />
<Compile Include="Rig\MettlerToledo\Multi\TaringOp.cs" />
<Compile Include="Rig\MettlerToledo\Multi\ZeroOp.cs" />
<Compile Include="Rig\MettlerToledo\ReadMassesOp.cs" />
<Compile Include="Rig\MettlerToledo\Standard\BalanceCfg.cs" />
<Compile Include="Rig\MettlerToledo\Standard\BalanceCfgCtrl.cs">
<SubType>UserControl</SubType>