protected void RaiseStateChange(EventHandler handler, ILQHsm hsm, LogStateEventArgs logEvent) { if (handler != null) { handler(hsm, logEvent); } }
protected void DoStateChange(LogStateEventArgs logEvent) { if (OnStateChange(logEvent)) { RaiseStateChange(StateChange, this, logEvent); } }
public void LogStateEvent(StateLogType logType, QState state) { LogStateEventArgs logEvent = new LogStateEventArgs(); logEvent.LogType = logType; logEvent.State = state; DoStateChange(logEvent); }
public void LogStateEvent(StateLogType logType, QState state, string action) { LogStateEventArgs logEvent = new LogStateEventArgs(); logEvent.LogType = logType; logEvent.State = state; logEvent.LogText = action; DoStateChange(logEvent); }
public void LogStateEvent(StateLogType logType, QState state, QState initState) { System.Diagnostics.Debug.Assert(logType == StateLogType.Init); LogStateEventArgs logEvent = new LogStateEventArgs(); logEvent.LogType = logType; logEvent.State = state; logEvent.NextState = initState; DoStateChange(logEvent); }
public virtual void RaiseFinalStateReached(EventHandler handler, ILQHsm hsm, QState state) { if (handler != null) { LogStateEventArgs logEvent = new LogStateEventArgs(); logEvent.LogType = StateLogType.Final; logEvent.State = state; handler(hsm, logEvent); } }
public void LogStateEvent(StateLogType logType, QState state, QState toState, string eventName, string eventDescription) { LogStateEventArgs logEvent = new LogStateEventArgs(); logEvent.LogType = logType; logEvent.State = state; logEvent.NextState = toState; logEvent.EventName = eventName; logEvent.EventDescription = eventDescription; DoStateChange(logEvent); }
private void hsm_StateChange(object sender, EventArgs e) { qf4net.LogStateEventArgs args = e as qf4net.LogStateEventArgs; qf4net.ILQHsm hsm = sender as qf4net.ILQHsm; switch (args.LogType) { case qf4net.StateLogType.Exit: _WriterDec(); break; } switch (args.LogType) { case qf4net.StateLogType.Init: { _WriterWriteLine(Color.YellowGreen, "[{0}-{1}] {2} to {3}", hsm, args.LogType, args.State.Method.Name, args.NextState.Method.Name); } break; case qf4net.StateLogType.Entry: { _WriterWriteLine(Color.Green, "[{0}-{1}] {2}", hsm, args.LogType, args.State.Method.Name); } break; case qf4net.StateLogType.Exit: { _WriterWriteLine(Color.Goldenrod, "[{0}-{1}] {2}", hsm, args.LogType, args.State.Method.Name); } break; case qf4net.StateLogType.EventTransition: { _WriterWriteLine(Color.DarkBlue, "[{0}-{1}] {2} on {3} to {4} -> {5}", hsm, args.LogType, args.State.Method.Name, args.EventName, args.NextState.Method.Name, args.EventDescription); } break; case qf4net.StateLogType.Log: { _WriterWriteLine(Color.Brown, "[{0}-{1}] {2}", hsm, args.LogType, args.LogText); } break; default: throw new NotSupportedException("StateLogType." + args.LogType.ToString()); } switch (args.LogType) { case qf4net.StateLogType.Entry: _WriterInc(); break; } }
public void LogText(string fmt, params object[] args) { string msg; if (args == null || args.Length == 0) { msg = fmt; } else { msg = string.Format(fmt, args); } LogStateEventArgs logEvent = new LogStateEventArgs(); logEvent.LogType = StateLogType.Log; logEvent.LogText = msg; DoStateChange(logEvent); }
protected virtual void RaiseFinalStateReached(EventHandler handler, ILQHsm hsm, QState state) { if (handler != null) { LogStateEventArgs logEvent = new LogStateEventArgs (); logEvent.LogType = StateLogType.Final; logEvent.State = state; handler (hsm, logEvent); } }
protected void DoStateChange(LogStateEventArgs logEvent) { if (OnStateChange (logEvent)) { RaiseStateChange (StateChange, this, logEvent); } }
protected virtual bool OnStateChange(LogStateEventArgs logEvent) { return(true); }
protected void LogStateEvent(StateLogType logType, QState state, string action) { LogStateEventArgs logEvent = new LogStateEventArgs (); logEvent.LogType = logType; logEvent.State = state; logEvent.LogText = action; DoStateChange (logEvent); }
protected void LogStateEvent(StateLogType logType, QState state, QState initState) { System.Diagnostics.Debug.Assert (logType == StateLogType.Init); LogStateEventArgs logEvent = new LogStateEventArgs (); logEvent.LogType = logType; logEvent.State = state; logEvent.NextState = initState; DoStateChange (logEvent); }
protected void LogStateEvent(StateLogType logType, QState state) { LogStateEventArgs logEvent = new LogStateEventArgs (); logEvent.LogType = logType; logEvent.State = state; DoStateChange (logEvent); }
protected void LogStateEvent(StateLogType logType, QState state, QState toState, string eventName, string eventDescription) { LogStateEventArgs logEvent = new LogStateEventArgs (); logEvent.LogType = logType; logEvent.State = state; logEvent.NextState = toState; logEvent.EventName = eventName; logEvent.EventDescription = eventDescription; DoStateChange (logEvent); }
private void _Hsm_StateChange_RunInViewThread(ILQHsm hsm, LogStateEventArgs ea) { if(_View.InvokeRequired) { object[] args = new object[] {hsm, ea}; _View.Invoke (_Hsm_StateChange_RunInViewThread_Handler, args); } else { _Hsm_StateChange_Internal (hsm, ea); } }
protected void LogText(string fmt, params object[] args) { string msg; if (args == null || args.Length == 0) { msg = fmt; } else { msg = string.Format (fmt, args); } LogStateEventArgs logEvent = new LogStateEventArgs (); logEvent.LogType = StateLogType.Log; logEvent.LogText = msg; DoStateChange (logEvent); }
protected virtual bool OnStateChange(LogStateEventArgs logEvent) { return true; }
protected void RaiseStateChange(EventHandler handler, ILQHsm hsm, LogStateEventArgs logEvent) { if (handler != null) { handler (hsm, logEvent); } }
private void _Hsm_StateChange_Internal(ILQHsm hsm, LogStateEventArgs ea) { string currentStateName = null; string currentTransitionName = null; switch (ea.LogType) { case StateLogType.EventTransition: { currentStateName = ea.State.Method.Name; currentTransitionName = ea.EventDescription; } break; case StateLogType.Init: { currentStateName = ea.NextState.Method.Name; } break; case StateLogType.Restored: case StateLogType.Entry: case StateLogType.Final: { currentStateName = ea.State.Method.Name; } break; } if(currentStateName != null) { RefreshCurrentStateView (currentStateName, currentTransitionName); } }