FixedStartMassCollelction in progress.

This commit is contained in:
Milan Hanajik
2021-04-16 13:05:50 +02:00
parent b36a76f413
commit 95d5d16c83
8 changed files with 7 additions and 78 deletions
@@ -527,16 +527,6 @@ namespace TBF.Rig.MettlerToledo.Standard
return new TaringOp(this, ref tara);
}
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <param name="result">Reference to a variable for the measured mass in kg</param>
/// <returns>ReadMassOp instance reference casted to IOperaton</returns>
public IOperation ReadMassOp(ref DoubleBox mass)
{
return new ReadMassOp(this, ref mass);
}
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
@@ -1,53 +0,0 @@
///
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
///
using System;
using log4net;
using TBF.Boxes;
namespace TBF.Rig.MettlerToledo.Standard
{
public class ReadMassOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ReadMassOp));
public override string ToString() { return string.Format("ReadMassOp(.,.)"); }
/// Set by the constructor
BalanceDev scale;
DoubleBox result;
/// <summary>
/// Events: BalanceDone (always)
/// </summary>
/// <param name="scale">Balance device instance</param>
/// <param name="result">Reference to the measured mass in kg</param>
public ReadMassOp(BalanceDev scale, ref DoubleBox result)
{
if (scale == null) throw new ArgumentNullException("balanceDev");
this.scale = scale;
this.result = result;
log.Debug(this.ToString());
}
/// <summary>Start this operation</summary>
public void Start()
{
result.Val = scale.Mass;
}
/// <summary>Run this operation</summary>
/// <returns>
/// Event.BalanceDone
/// </returns>
public Event Run()
{
result.Val = scale.Mass;
return Event.ScaleDone;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}