BenchControl.Uni.Diverter/FlowMeter/RegReader added, etc. (many changes and refactorization).

This commit is contained in:
Milan Hanajik
2021-02-24 14:15:10 +01:00
parent 5325d7f6ee
commit 4cf4192ebb
163 changed files with 6766 additions and 1041 deletions
+6 -6
View File
@@ -35,7 +35,7 @@ namespace TBF.BenchControl.Elde.Diverter
readonly DiverterCfg diverterCfg;
public SchematicDrawing.IDrawingItem DrawingItem { get { return diverterCfg as SchematicDrawing.IDrawingItem; } }
readonly ControlBoardDev controlBoard;
readonly CBoard controlBoard;
readonly UInt128 mask; /// derived from bitPosition in the constructor
public int AdcNr { get { return diverterCfg.AdcNr; } }
@@ -72,7 +72,7 @@ namespace TBF.BenchControl.Elde.Diverter
{
diverterCfg = cfg as DiverterCfg;
controlBoard = TbfComponents.FindComponent(cfg.ParentName, components) as ControlBoardDev;
controlBoard = TbfComponents.FindComponent(cfg.ParentName, components) as CBoard;
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
if (cfg.DebugLevel != Config.Entities.DebugMode.Off)
@@ -195,8 +195,8 @@ namespace TBF.BenchControl.Elde.Diverter
public void Initialize() { }
public void RunDeviceBefore()
{
int adcValue = (int)controlBoard.AnalogInputRaw(diverterCfg.AdcNr, 0);
Handlers.OnAdcChanged(this, new CmdResponseArgs(CfgChangeCmd.GetAdc, diverterCfg.BitNr, adcValue));
short adcValue = (short)controlBoard.AnalogInputRaw(diverterCfg.AdcNr, 0);
Handlers.OnAdcChanged(this, new CmdResponseArgs(CfgChangeCmd.GetAdc, diverterCfg.BitNr, adcValue));
}
public void RunDeviceAfter() { }
public void StopDevice() { }
@@ -245,8 +245,8 @@ namespace TBF.BenchControl.Elde.Diverter
}
else if (args.Command == CfgChangeCmd.GetAdc1 || args.Command == CfgChangeCmd.GetAdc2)
{
int adcValue = (int)controlBoard.AnalogInputRaw(diverterCfg.AdcNr, 0);
DiverterCfgCtrl.OnCmdResponse(this, new CmdResponseArgs(args.Command, diverterCfg.BitNr, adcValue));
short adcValue = (short)controlBoard.AnalogInputRaw(diverterCfg.AdcNr, 0);
DiverterCfgCtrl.OnCmdResponse(this, new CmdResponseArgs(args.Command, diverterCfg.BitNr, adcValue));
}
else if (args.Command == CfgChangeCmd.DivToTank)
{
@@ -8,11 +8,11 @@ namespace TBF.BenchControl.Elde.Diverter
{
public class SwitchDiverterOp : IOperation
{
ControlBoardDev controlBoard;
CBoard controlBoard;
bool toTank;
int flowMtrNr;
public SwitchDiverterOp(ControlBoardDev controlBoard, bool toTank, int flowMtrNr)
public SwitchDiverterOp(CBoard controlBoard, bool toTank, int flowMtrNr)
{
this.controlBoard = controlBoard;
this.toTank = toTank;