Esempio n. 1
0
        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;
        }
Esempio n. 2
0
 /// <inheritdoc />
 public override void LinkStateReceived(ShutterLinkState state)
 {
     base.LinkStateReceived(state);
     if (state == ShutterLinkState.Online)
     {
         Machine.TransitionToState(new RequestStatusState(Machine));
     }
 }
Esempio n. 3
0
 /// <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));
     }
 }
Esempio n. 4
0
 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();
     }
 }
Esempio n. 5
0
 public void ShutterLinkStateChanged(ShutterLinkState state)
 {
     Logger.Info().Message("Shutter link state {state}", state).Write();
     ShutterLinkState = state;
     ShutterState.LinkStateReceived(state);
 }