(1) Diverter start/stop transition graph plotted, (2) Diverter ToTank / ToSink buttons, ver. 3.1.1616
This commit is contained in:
@@ -11,22 +11,21 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
public enum ActionID
|
||||
{
|
||||
/// Basic
|
||||
RequestDataOnly = 0,
|
||||
ChangeRoute = 1, /// Change digital outputs (route)
|
||||
MeasureFlow = 2, /// Activate a flow meter to measure the flow
|
||||
SetFlow = 4, /// Set flow
|
||||
StartTest = 8, /// Start a test
|
||||
Stop = 0x10, /// Stop a test or a flow regulation
|
||||
RegVlvIncrMove = 0x20,
|
||||
RegVlvMoveToPos = 0x40,
|
||||
RegVlvStop = 0x80,
|
||||
SwitchDiverter = 0x100, /// Switch diverter to tank/sink
|
||||
|
||||
/// Advanced
|
||||
GetDiverterTransitionData,
|
||||
GetScopeAnalyzerData,
|
||||
ResetScopeAnalyzer,
|
||||
GetSwitchCounterData,
|
||||
RequestDataOnly = 0,
|
||||
ChangeRoute = 1, /// Change digital outputs (route)
|
||||
MeasureFlow = 2, /// Activate a flow meter to measure the flow
|
||||
SetFlow = 4, /// Set flow
|
||||
StartTest = 8, /// Start a test
|
||||
Stop = 0x10, /// Stop a test or a flow regulation
|
||||
RegVlvIncrMove = 0x20,
|
||||
RegVlvMoveToPos = 0x40,
|
||||
RegVlvStop = 0x80,
|
||||
SwitchDiverter = 0x100, /// Switch diverter to tank/sink
|
||||
DelayStartOrStop = 0x200,
|
||||
GetDiverterTransitionData = 0x400,
|
||||
GetScopeAnalyzerData = 0x800,
|
||||
ResetScopeAnalyzer = 0x1000,
|
||||
GetSwitchCounterData = 0x2000,
|
||||
}
|
||||
|
||||
public class Action
|
||||
@@ -387,6 +386,111 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
(StartStop == Command.None || StartStop == Command.Start);
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
public static Action DelayStartOrStop(bool isFromUI)
|
||||
{
|
||||
return new Action
|
||||
{
|
||||
ActionId = ActionID.DelayStartOrStop,
|
||||
IsFromUI = isFromUI,
|
||||
///
|
||||
StartStop = Command.DelayStartOrStop,
|
||||
};
|
||||
}
|
||||
void SetDelayStartOrStopArgs(Action action)
|
||||
{
|
||||
StartStop = Command.DelayStartOrStop;
|
||||
}
|
||||
/// Check whether new action arguments are compatible with alredy collected arguments (true = yes)
|
||||
bool CheckDelayStartOrStopArgs(Action action)
|
||||
{
|
||||
return (StartStop == Command.None || StartStop == Command.DelayStartOrStop);
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
public static Action GetDiverterTransitionData(bool isFromUI)
|
||||
{
|
||||
return new Action
|
||||
{
|
||||
ActionId = ActionID.GetDiverterTransitionData,
|
||||
IsFromUI = isFromUI,
|
||||
///
|
||||
StartStop = Command.GetDiverterTransitionData,
|
||||
};
|
||||
}
|
||||
void SetGetDiverterTransitionDataArgs(Action action)
|
||||
{
|
||||
StartStop = Command.GetDiverterTransitionData;
|
||||
}
|
||||
/// Check whether new action arguments are compatible with alredy collected arguments (true = yes)
|
||||
bool CheckGetDiverterTransitionDataArgs(Action action)
|
||||
{
|
||||
return (StartStop == Command.None || StartStop == Command.GetDiverterTransitionData);
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
public static Action GetScopeAnalyzerData(bool isFromUI)
|
||||
{
|
||||
return new Action
|
||||
{
|
||||
ActionId = ActionID.GetScopeAnalyzerData,
|
||||
IsFromUI = isFromUI,
|
||||
///
|
||||
StartStop = Command.GetScopeAnalyzerData,
|
||||
};
|
||||
}
|
||||
void SetGetScopeAnalyzerDataArgs(Action action)
|
||||
{
|
||||
StartStop = Command.GetScopeAnalyzerData;
|
||||
}
|
||||
/// Check whether new action arguments are compatible with alredy collected arguments (true = yes)
|
||||
bool CheckGetScopeAnalyzerDataArgs(Action action)
|
||||
{
|
||||
return (StartStop == Command.None || StartStop == Command.GetScopeAnalyzerData);
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
public static Action ResetScopeAnalyzer(bool isFromUI)
|
||||
{
|
||||
return new Action
|
||||
{
|
||||
ActionId = ActionID.ResetScopeAnalyzer,
|
||||
IsFromUI = isFromUI,
|
||||
///
|
||||
StartStop = Command.ResetScopeAnalyzer,
|
||||
};
|
||||
}
|
||||
void SetResetScopeAnalyzerArgs(Action action)
|
||||
{
|
||||
StartStop = Command.GetScopeAnalyzerData;
|
||||
}
|
||||
/// Check whether new action arguments are compatible with alredy collected arguments (true = yes)
|
||||
bool CheckResetScopeAnalyzerArgs(Action action)
|
||||
{
|
||||
return (StartStop == Command.None || StartStop == Command.ResetScopeAnalyzer);
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
public static Action GetSwitchCounterData(bool isFromUI)
|
||||
{
|
||||
return new Action
|
||||
{
|
||||
ActionId = ActionID.GetSwitchCounterData,
|
||||
IsFromUI = isFromUI,
|
||||
///
|
||||
StartStop = Command.GetSwitchCounterData,
|
||||
};
|
||||
}
|
||||
void SetGetSwitchCounterDataArgs(Action action)
|
||||
{
|
||||
StartStop = Command.GetSwitchCounterData;
|
||||
}
|
||||
/// Check whether new action arguments are compatible with alredy collected arguments (true = yes)
|
||||
bool CheckGetSwitchCounterDataArgs(Action action)
|
||||
{
|
||||
return (StartStop == Command.None || StartStop == Command.GetSwitchCounterData);
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
void SetArgs(Action action)
|
||||
{
|
||||
@@ -394,15 +498,20 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
|
||||
switch (action.ActionId)
|
||||
{
|
||||
case ActionID.ChangeRoute: SetChangeRouteArgs(action); return;
|
||||
case ActionID.MeasureFlow: SetMeasureFlowArgs(action); return;
|
||||
case ActionID.SetFlow: SetSetFlowArgs(action); return;
|
||||
case ActionID.StartTest: SetStartTestArgs(action); return;
|
||||
case ActionID.Stop: SetStopArgs(action); return;
|
||||
case ActionID.RegVlvIncrMove: SetRegVlvIncrMoveArgs(action); return;
|
||||
case ActionID.RegVlvMoveToPos: SetRegVlvMoveToPosArgs(action); return;
|
||||
case ActionID.RegVlvStop: SetRegVlvStopArgs(action); return;
|
||||
case ActionID.SwitchDiverter: SetSwitchDiverterArgs(action); return;
|
||||
case ActionID.ChangeRoute: SetChangeRouteArgs(action); return;
|
||||
case ActionID.MeasureFlow: SetMeasureFlowArgs(action); return;
|
||||
case ActionID.SetFlow: SetSetFlowArgs(action); return;
|
||||
case ActionID.StartTest: SetStartTestArgs(action); return;
|
||||
case ActionID.Stop: SetStopArgs(action); return;
|
||||
case ActionID.RegVlvIncrMove: SetRegVlvIncrMoveArgs(action); return;
|
||||
case ActionID.RegVlvMoveToPos: SetRegVlvMoveToPosArgs(action); return;
|
||||
case ActionID.RegVlvStop: SetRegVlvStopArgs(action); return;
|
||||
case ActionID.SwitchDiverter: SetSwitchDiverterArgs(action); return;
|
||||
case ActionID.DelayStartOrStop: SetDelayStartOrStopArgs(action); return;
|
||||
case ActionID.GetDiverterTransitionData: SetGetDiverterTransitionDataArgs(action); return;
|
||||
case ActionID.GetScopeAnalyzerData: SetGetScopeAnalyzerDataArgs(action); return;
|
||||
case ActionID.ResetScopeAnalyzer: SetResetScopeAnalyzerArgs(action); return;
|
||||
case ActionID.GetSwitchCounterData: SetGetSwitchCounterDataArgs(action); return;
|
||||
default: return;
|
||||
}
|
||||
}
|
||||
@@ -416,16 +525,21 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
{
|
||||
switch (action.ActionId)
|
||||
{
|
||||
case ActionID.RequestDataOnly: return true;
|
||||
case ActionID.ChangeRoute: return CheckSharedChangeRouteArgs(action);
|
||||
case ActionID.MeasureFlow: return CheckSharedMeasureFlowArgs(action);
|
||||
case ActionID.SetFlow: return CheckSharedSetFlowArgs(action);
|
||||
case ActionID.StartTest: return CheckSharedStartTestArgs(action);
|
||||
case ActionID.Stop: return CheckSharedStopArgs(action);
|
||||
case ActionID.RegVlvIncrMove: return CheckSharedRegVlvIncrMoveArgs(action);
|
||||
case ActionID.RegVlvMoveToPos: return CheckSharedRegVlvMoveToPosArgs(action);
|
||||
case ActionID.RegVlvStop: return CheckSharedRegVlvStopArgs(action);
|
||||
case ActionID.SwitchDiverter: return CheckSharedSwitchDiverterArgs(action);
|
||||
case ActionID.RequestDataOnly: return true;
|
||||
case ActionID.ChangeRoute: return CheckSharedChangeRouteArgs(action);
|
||||
case ActionID.MeasureFlow: return CheckSharedMeasureFlowArgs(action);
|
||||
case ActionID.SetFlow: return CheckSharedSetFlowArgs(action);
|
||||
case ActionID.StartTest: return CheckSharedStartTestArgs(action);
|
||||
case ActionID.Stop: return CheckSharedStopArgs(action);
|
||||
case ActionID.RegVlvIncrMove: return CheckSharedRegVlvIncrMoveArgs(action);
|
||||
case ActionID.RegVlvMoveToPos: return CheckSharedRegVlvMoveToPosArgs(action);
|
||||
case ActionID.RegVlvStop: return CheckSharedRegVlvStopArgs(action);
|
||||
case ActionID.SwitchDiverter: return CheckSharedSwitchDiverterArgs(action);
|
||||
case ActionID.DelayStartOrStop: return CheckDelayStartOrStopArgs(action);
|
||||
case ActionID.GetDiverterTransitionData: return CheckGetDiverterTransitionDataArgs(action);
|
||||
case ActionID.GetScopeAnalyzerData: return CheckGetScopeAnalyzerDataArgs(action);
|
||||
case ActionID.ResetScopeAnalyzer: return CheckResetScopeAnalyzerArgs(action);
|
||||
case ActionID.GetSwitchCounterData: return CheckGetSwitchCounterDataArgs(action);
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user