MettlerToledo.Multi cleanup
This commit is contained in:
@@ -1,61 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
|
||||
namespace TBF.BenchControl.MettlerToledo.Multi
|
||||
{
|
||||
public class SetUnitsOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(SetUnitsOp));
|
||||
public override string ToString() { return string.Format("SetUnitsOp({0})", units); }
|
||||
|
||||
/// Set by the constructor
|
||||
BalanceDev balanceDev;
|
||||
BalanceDev.Units units;
|
||||
|
||||
/// <summary>
|
||||
/// Events: BalanceDone, Error
|
||||
/// </summary>
|
||||
/// <param name="balanceDev">Balance device instance</param>
|
||||
/// <param name="result">Reference to the serialNumber</param>
|
||||
public SetUnitsOp(BalanceDev balanceDev, BalanceDev.Units units)
|
||||
{
|
||||
if (balanceDev == null) throw new ArgumentNullException("balanceDev");
|
||||
this.balanceDev = balanceDev;
|
||||
|
||||
this.units = units;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
log.Debug("Start()");
|
||||
balanceDev.SetUnits(units);
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>
|
||||
/// Event.None
|
||||
/// Event.BalanceDone
|
||||
/// </returns>
|
||||
public Event Run()
|
||||
{
|
||||
if (balanceDev.MsrmntState == MsrmntState.Valid) return Event.BalanceDone; /// Units set
|
||||
if (balanceDev.MsrmntState == MsrmntState.Failed) return Event.Error; /// Failed
|
||||
return Event.None; /// No result yet
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
log.Debug("Stop()");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,6 @@
|
||||
<Compile Include="BenchControl\MettlerToledo\Multi\BalanceFactory.cs" />
|
||||
<Compile Include="BenchControl\MettlerToledo\Multi\ReadMassOp.cs" />
|
||||
<Compile Include="BenchControl\MettlerToledo\Multi\ReadStableMassOp.cs" />
|
||||
<Compile Include="BenchControl\MettlerToledo\Multi\SetUnitsOp.cs" />
|
||||
<Compile Include="BenchControl\MettlerToledo\Multi\TaringOp.cs" />
|
||||
<Compile Include="BenchControl\MettlerToledo\ReadMassesOp.cs" />
|
||||
<Compile Include="BenchControl\MettlerToledo\Standard\BalanceCfg.cs" />
|
||||
|
||||
Reference in New Issue
Block a user