ReadMassesOp eliminated.
This commit is contained in:
@@ -76,9 +76,8 @@ namespace TBF.Rig.MettlerToledo.Multi
|
|||||||
|
|
||||||
public string Format { get { return balanceCfg.Format; } }
|
public string Format { get { return balanceCfg.Format; } }
|
||||||
|
|
||||||
public BalanceDev()
|
|
||||||
{
|
public BalanceDev() { }
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor
|
/// Constructor
|
||||||
@@ -281,9 +280,7 @@ namespace TBF.Rig.MettlerToledo.Multi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Run this device</summary>
|
/// <summary>Run this device</summary>
|
||||||
public void RunDeviceAfter()
|
public void RunDeviceAfter() { }
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Stop this device</summary>
|
/// <summary>Stop this device</summary>
|
||||||
public void StopDevice()
|
public void StopDevice()
|
||||||
|
|||||||
@@ -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()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -144,21 +144,6 @@ namespace TBF.Rig.Sequences
|
|||||||
}
|
}
|
||||||
while (e.Contains(Event.Busy));
|
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:
|
select_procedure:
|
||||||
|
|
||||||
CloseBeginForm(); /// Make sure the CycleBeginForm is closed (after an abnormal end, etc.)
|
CloseBeginForm(); /// Make sure the CycleBeginForm is closed (after an abnormal end, etc.)
|
||||||
|
|||||||
@@ -633,7 +633,6 @@
|
|||||||
<Compile Include="Rig\MettlerToledo\Multi\ReadStableMassOp.cs" />
|
<Compile Include="Rig\MettlerToledo\Multi\ReadStableMassOp.cs" />
|
||||||
<Compile Include="Rig\MettlerToledo\Multi\TaringOp.cs" />
|
<Compile Include="Rig\MettlerToledo\Multi\TaringOp.cs" />
|
||||||
<Compile Include="Rig\MettlerToledo\Multi\ZeroOp.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\BalanceCfg.cs" />
|
||||||
<Compile Include="Rig\MettlerToledo\Standard\BalanceCfgCtrl.cs">
|
<Compile Include="Rig\MettlerToledo\Standard\BalanceCfgCtrl.cs">
|
||||||
<SubType>UserControl</SubType>
|
<SubType>UserControl</SubType>
|
||||||
|
|||||||
Reference in New Issue
Block a user