private void SetShutterLinkState(ShutterLinkState disposition) { ShutterLinkStateAnnunciator.Text = disposition.DisplayEquivalent(); switch (disposition) { case ShutterLinkState.Start: ShutterLinkStateAnnunciator.ForeColor = Color.FromArgb(200, 4, 4); ShutterLinkStateAnnunciator.Cadence = CadencePattern.SteadyOn; break; case ShutterLinkState.WaitAT: case ShutterLinkState.Config: ShutterLinkStateAnnunciator.ForeColor = Color.FromArgb(200, 4, 4); ShutterLinkStateAnnunciator.Cadence = CadencePattern.SteadyOn; break; case ShutterLinkState.Detect: ShutterLinkStateAnnunciator.ForeColor = Color.PaleGoldenrod; ShutterLinkStateAnnunciator.Cadence = CadencePattern.BlinkSlow; break; case ShutterLinkState.Online: ShutterLinkStateAnnunciator.ForeColor = Color.DarkSeaGreen; ShutterLinkStateAnnunciator.Cadence = CadencePattern.SteadyOn; break; default: throw new ArgumentOutOfRangeException(nameof(disposition), disposition, null); } ShutterLinkStateAnnunciator.Mute = false; ShutterLinkStateAnnunciator.Enabled = true; }
/// <inheritdoc /> public override void LinkStateReceived(ShutterLinkState state) { base.LinkStateReceived(state); if (state == ShutterLinkState.Online) { Machine.TransitionToState(new RequestStatusState(Machine)); } }
/// <inheritdoc /> public virtual void LinkStateReceived(ShutterLinkState state) { Log.Debug().Message("Link state {state}/{displayState}", state, state.DisplayEquivalent()).Write(); if (state != ShutterLinkState.Online) { Machine.TransitionToState(new OfflineState(Machine)); } }
private void LinkStateUpdateOnNext(ShutterLinkState state) { try { stateMachine.ShutterLinkStateChanged(state); } catch (Exception ex) { Log.Error().Exception(ex).Message("Error while processing link state update: {linkState}", state) .Write(); } }
public void ShutterLinkStateChanged(ShutterLinkState state) { Logger.Info().Message("Shutter link state {state}", state).Write(); ShutterLinkState = state; ShutterState.LinkStateReceived(state); }