示例#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;
        }
示例#2
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));
     }
 }