public RuntimeStateMachine() { _runtimeState = (int)RuntimeState.NotAvailable; _stateActions = new Dictionary <RuntimeState, Action>(10) { { RuntimeState.Idle, () => { StateIdle?.Invoke(); } }, { RuntimeState.Running, () => { StateRunning?.Invoke(); } }, { RuntimeState.Error, () => { StateError?.Invoke(); } }, { RuntimeState.Over, () => { StateOver?.Invoke(); } }, { RuntimeState.AbortRequested, () => { StateAbortRequested?.Invoke(); } }, { RuntimeState.Abort, () => { StateAbort?.Invoke(); } }, { RuntimeState.Collapsed, () => { StateCollapsed?.Invoke(); } }, { RuntimeState.Timeout, () => { TimeOut?.Invoke(); } } }; }
private static string GetStateError(StateError stateError) { switch (stateError) { case StateError.ServiceNotAllowed: return("Service not allowed"); case StateError.ServiceUnknown: return("Service unknown"); } return(string.Empty); }
/// <summary> /// Constructor for AARE error. /// </summary> internal GXDLMSException(StateError stateError, ServiceError serviceError) : base("Meter returns " + GetStateError(stateError) + " exception. " + GetServiceError(serviceError)) { StateError = stateError; ServiceError = serviceError; }