52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
///
|
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
|
///
|
|
using System;
|
|
using log4net;
|
|
using TBF.Boxes;
|
|
|
|
namespace TBF.BenchControl.Modbus.QuidoRS
|
|
{
|
|
public class ShowBenchWaitingOp : IOperation
|
|
{
|
|
private static readonly ILog log = LogManager.GetLogger(typeof(ShowBenchWaitingOp));
|
|
public override string ToString() { return string.Format("ShowBenchWaitingOp(.)"); }
|
|
|
|
const ushort BenchReadyValue = 0x01;
|
|
const ushort BenchWaitingValue = 0x06;
|
|
|
|
/// Set by the constructor
|
|
readonly QuidoRS quidoRS;
|
|
|
|
/// <summary>
|
|
/// Events: Event.None
|
|
/// </summary>
|
|
/// <param name="quidoRS">Pressure meter reference</param>
|
|
public ShowBenchWaitingOp(QuidoRS quidoRS)
|
|
{
|
|
if (quidoRS == null) throw new ArgumentNullException("quidoRS");
|
|
this.quidoRS = quidoRS;
|
|
|
|
log.Debug(this.ToString());
|
|
}
|
|
|
|
/// <summary>Start this operation</summary>
|
|
public void Start()
|
|
{
|
|
quidoRS.SetOutputs(BenchWaitingValue);
|
|
}
|
|
|
|
/// <summary>Run this operation</summary>
|
|
public Event Run()
|
|
{
|
|
return Event.None;
|
|
}
|
|
|
|
/// <summary>Stop this operation</summary>
|
|
public void Stop()
|
|
{
|
|
quidoRS.SetOutputs(BenchReadyValue);
|
|
}
|
|
}
|
|
}
|