Initial version with config UI, w/o functionality, added to the project

This commit is contained in:
Milan Hanajik
2015-02-03 08:06:20 +01:00
parent 0c9408ff64
commit ab8aa61a29
13 changed files with 1206 additions and 25 deletions
@@ -16,7 +16,7 @@ namespace TBF.BenchControl.Elde.RegulValve
IDictionary<float, float> dict;
public IDictionary<float, float> Dict { get { return dict; } }
readonly ControlBoardDev controlBoard;
public readonly ControlBoardDev ControlBoard;
public int Idx1 { get { return RegulValveCfg.Idx1; } } /// 1..7
public int DacValueClosed { get { return RegulValveCfg.DacValueClosed; } } /// 0..1023
@@ -26,7 +26,7 @@ namespace TBF.BenchControl.Elde.RegulValve
///
public float Position
{
get { return controlBoard.RValvePosition(Idx1); }
get { return ControlBoard.RValvePosition(Idx1); }
}
@@ -55,19 +55,19 @@ namespace TBF.BenchControl.Elde.RegulValve
}
else if (args.Command == CfgChangeCmd.RVOpenStep)
{
controlBoard.ValveMove(Idx1, RegulValveMode.PulseWidth, new float[2] { 0.05f, 0.05f }, StableTime);
ControlBoard.ValveMove(Idx1, RegulValveMode.PulseWidth, new float[2] { 0.05f, 0.05f }, StableTime);
// TODO: avoid conflicts
// TOTEST
}
else if (args.Command == CfgChangeCmd.RVCloseStep)
{
controlBoard.ValveMove(Idx1, RegulValveMode.PulseWidth, new float[2] { -0.05f, -0.05f }, StableTime);
ControlBoard.ValveMove(Idx1, RegulValveMode.PulseWidth, new float[2] { -0.05f, -0.05f }, StableTime);
// TODO: avoid conflicts
// TOTEST
}
else if (args.Command == CfgChangeCmd.GetRVAdc1 || args.Command == CfgChangeCmd.GetRVAdc2)
{
int adc = (int)controlBoard.AnalogInputRaw(Idx1, 0);
int adc = (int)ControlBoard.AnalogInputRaw(Idx1, 0);
// TOTEST
RegulValveCfgCtrl.OnCmdResponse(this, new CmdResponseArgs(args.Command, adc));
}
@@ -83,13 +83,13 @@ namespace TBF.BenchControl.Elde.RegulValve
{
RegulValveCfg = cfg;
controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent");
this.dict = new Dictionary<float, float>();
this.controlBoard.RegValveCalib[Idx1 - 1, 0] = (uint)DacValueClosed;
this.controlBoard.RegValveCalib[Idx1 - 1, 1] = (uint)DacValueOpen;
this.ControlBoard.RegValveCalib[Idx1 - 1, 0] = (uint)DacValueClosed;
this.ControlBoard.RegValveCalib[Idx1 - 1, 1] = (uint)DacValueOpen;
log.Debug(this.ToString());
}
@@ -107,7 +107,7 @@ namespace TBF.BenchControl.Elde.RegulValve
/// <returns>SetFlowOp instance</returns>
public IOperation SetFlowOp(GenericDevices.IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi, float pidCoef, FloatBox measuredFlow, int timeout)
{
return new SetFlowOp(controlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, timeout);
return new SetFlowOp(ControlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, timeout);
}
/// <summary>
@@ -122,7 +122,7 @@ namespace TBF.BenchControl.Elde.RegulValve
/// <returns>SetFlowOp instance</returns>
public IOperation SetFlowAndMeasureOp(GenericDevices.IFlowMeter flowMeter, float requiredFlowLo, float requiredFlowHi, float pidCoef, FloatBox measuredFlow, int timeout, float filterConstant)
{
return new SetFlowOp(controlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, timeout, true);
return new SetFlowOp(ControlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, timeout, true);
}
/// <summary>
@@ -134,12 +134,12 @@ namespace TBF.BenchControl.Elde.RegulValve
/// <returns>SetPositionOp instance</returns>
public IOperation SetRegulValvePositionOp(float pctLo, float pctHi, int timeoutMs)
{
return new SetRegulValvePositionOp(controlBoard, this, pctLo, pctHi, timeoutMs);
return new SetRegulValvePositionOp(ControlBoard, this, pctLo, pctHi, timeoutMs);
}
public IOperation ChangeRegulValvePositionOp(float timePulseSec)
{
return new ChangeRegulValvePositionOp(controlBoard, this, timePulseSec);
return new ChangeRegulValvePositionOp(ControlBoard, this, timePulseSec);
}
}
}