tbf/TestBenchFramework/BenchControl/Events.cs
Milan Hanajik 0cea24246c Error message due to incorrect configuration is cleared after selecting another procedure/test.
Return value from WaitBeginFormClosed(..) changed from bool to enum UIFlowControl.
2015-06-25 04:48:28 +02:00

152 lines
3.7 KiB
C#

///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.BenchControl
{
/// <summary>
/// Lower level measurement event provided by devices and polled by operations
/// </summary>
public enum MsrmntState
{
Valid,
Overload,
Failed,
Busy,
}
/// <summary>
/// Flags returned by each device configuration control Verify(...) function.
/// </summary>
public enum CfgUpdateFlags
{
None = 0,
Error = 0x1, /// Some settings in the user control are invalid and cannot be set
Warning = 0x02, /// Some settings in the user control are suspicious, can be set after user confirmation
RestartRqrd = 0x04, /// TBF program restart is required to apply all changed parameters
AnyChange = 0x08, /// At least one parameter have changed
}
public enum CfgChangeCmd
{
None,
CfgChange, /// COnfiguation change
ValveOpen, /// Open a valve
ValveClose, /// Close a valve
RVOpenStep, /// Open a regulation valve (RV only)
RVCloseStep, /// Close a regulation valve *RV only)
DivToTank, /// Diverter to tank (Div only)
DivToSink, /// Diverter to sink (Div only)
ReadDivTransition, /// Read diverter ADC value transition
GetAdc, /// Get regul.valve or diverter ADC
GetAdc1, /// Get regul.valve or diverter ADC feedback value #1
GetAdc2, /// Get regul.valve or diverter ADC feedback value #2
}
public enum ValveCategory
{
All = 0, /// Valve will be shown in all paths
Feeding, /// Valve will be shown in Feeding paths
Bench, /// Valve will be shown in Bench paths
Output, /// Valve will be shown in Output paths
None, /// Valve will not be shown in the paths
}
public enum PumpProtocol
{
Modbus, /// Modbus protocol, default serial settings are 9600Bd, 8bits, NoP, 1stop
FC, /// FC protocol with Siemens address (1..31), default serial settings are 9600Bd, 8bits, PE, 1stop
}
public enum UIFlowControl
{
Continue,
Stop,
}
/// <summary>
/// StateMachine events (issued by operations, IOperation derived classes)
/// </summary>
public enum Event
{
None = 0,
Busy, /// Useful when waiting in state until at least one is busy (all are done)
Done, /// Useful when waiting in state until the first is done, the rest miht still be busy
///
ModelessFormIsOpen,
ModelessFormClosed,
ValvesBusy,
ValvesSet,
AmbientDone,
BalanceDone,
BalanceOverload,
PressureDone,
PressureInDone,
PressureOutDone,
TempDone,
TempInDone,
TempOutDone,
TempDivDone,
FlowMeasurementDone,
FlowReached,
PositionReached,
RegulValveTimeOut, /// Maximum allowed flow setting time has elapsed
ReadRegisterDone,
ReadReferenceDone,
AllPositionsReached, /// Used in SetAllRegulValvesOp
TurnPumpOnOffDone,
/// CheckUi events
UiCmdStartTest,
UiCmdStartQ1,
UiCmdStartQ2,
UiCmdStartQ3,
UiCmdStartCycle,
UiCmdStop,
UiCmdPurgeBegin,
UiCmdPurgeEnd,
UiCmdEmptyTank1,
UiCmdEmptyTank2,
UiCmdEmptyTank3,
UiCmdBreak,
UiCmdResetResults,
UiCmdAcceptResults,
UiCmdCalibration,
UiCmdCameraTest,
UiCmdSensitivityTest,
UiCmdB1,
UiCmdB2,
UiCmdB3,
/// Process/Test oriented
PreviousStopped,
Wait,
ProcedureLoaded,
MeasurementStarted,
ReadAllRegistersDone,
MeasurementCompleted,
ResultsPrinted,
ResultsWritten,
/// Timer events
TimerExpired,
/// IDC camera events
CameraBusy,
CameraOpCompleted,
CameraOpFailed,
DetectionFailed,
/// Generic
Error, /// Many ops.: Fatal error occurred
OpArgumentError,
ConfigurationError,
Yes,
No,
Next, /// To move to the next state when debugging
OK,
TimerBusy,
}
}