Diverter ADC value updated in DiverterCfgCtrl (More button).

This commit is contained in:
Milan Hanajik
2017-07-20 14:49:16 +03:00
parent 5552a28925
commit 229bec30cc
2 changed files with 20 additions and 1 deletions
@@ -5,10 +5,11 @@ using System;
using System.Collections.Generic;
using log4net;
using Dirichlet.Numerics;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.Diverter
{
public class Diverter : ComponentBase, GenericDevices.IDiverter
public class Diverter : ComponentBase, IDevice, GenericDevices.IDiverter
{
private static readonly ILog log = LogManager.GetLogger(typeof(Diverter));
public override string ToString() { return string.Format("Diverter({0})", Cfg.ToString(1)); }
@@ -91,6 +92,19 @@ namespace TBF.BenchControl.Elde.Diverter
}
///
/// IDevice interface implementation
///
public void Initialize() { }
public void RunDeviceBefore()
{
int adc = (int)StateMachine.ControlBoard.AnalogInputRaw(diverterCfg.AdcNr, 0);
Handlers.OnAdcChanged(this, new CmdResponseArgs(CfgChangeCmd.GetAdc, diverterCfg.BitPosition, adc));
}
public void RunDeviceAfter() { }
public void StopDevice() { }
#region Configuration Change Handling
public static void OnCfgChange(object sender, CfgChangeArgs args)
@@ -107,6 +107,10 @@ namespace TBF.BenchControl.Elde.RegulValve
log.Debug(this.ToString());
}
///
/// IDevice interface implementation
///
public void Initialize() { }
public void RunDeviceBefore()
{
@@ -116,6 +120,7 @@ namespace TBF.BenchControl.Elde.RegulValve
public void RunDeviceAfter() { }
public void StopDevice() { }
/// <summary>
/// Operation to set the water flow within tolerances
/// Events: Event.None, Event.FlowReached, Event.FlowTimeOut