Esempio n. 1
0
 public void TelescopeConnectionChanged(ASCOMConnectionState state)
 {
     RefreshASCOMStatusControls(state, tssASCOMTelescope);
     if (state == ASCOMConnectionState.Connected || state == ASCOMConnectionState.Ready)
     {
         tsbTelControl.Text = "Control Telescope";
         tsbTelControl.Enabled = true;
     }
     else if (state == ASCOMConnectionState.Disconnected || state == ASCOMConnectionState.Engaged)
     {
         tsbTelControl.Text = "Connect to Telescope";
         tsbTelControl.Enabled = true;
         m_LastTelescopeState = null;
         UpdateConnectedDevicesState();
     }
     else
     {
         tsbTelControl.Enabled = false;
     }
 }
Esempio n. 2
0
 void VideoConnectionChanged(ASCOMConnectionState state)
 {
     RefreshASCOMStatusControls(state, tssCameraControl);
     if (state == ASCOMConnectionState.Connected || state == ASCOMConnectionState.Ready)
     {
         tsbCamControl.Text = "Control Camera";
         tsbCamControl.Enabled = true;
     }
     else if (state == ASCOMConnectionState.Disconnected || state == ASCOMConnectionState.Engaged)
     {
         tsbCamControl.Text = "Connect to Camera";
         tsbCamControl.Enabled = true;
         m_LastVideoCameraState = null;
     }
     else
     {
         tsbCamControl.Enabled = false;
     }
 }
Esempio n. 3
0
 public void FocuserConnectionChanged(ASCOMConnectionState state)
 {
     RefreshASCOMStatusControls(state, tssASCOMFocuser);
     if (state == ASCOMConnectionState.Connected || state == ASCOMConnectionState.Ready)
     {
         tsbFocControl.Text = "Control Focuser";
         tsbFocControl.Enabled = true;
     }
     else if (state == ASCOMConnectionState.Disconnected || state == ASCOMConnectionState.Engaged)
     {
         tsbFocControl.Text = "Connect to Focuser";
         tsbFocControl.Enabled = true;
         m_LastFocuserState = null;
         UpdateConnectedDevicesState();
     }
     else
     {
         tsbFocControl.Enabled = false;
     }
 }
Esempio n. 4
0
        private void RefreshASCOMStatusControls(ASCOMConnectionState state, ToolStripStatusLabel label)
        {
            switch (state)
            {
                case ASCOMConnectionState.Disconnected:
                    label.Visible = false;
                    break;
                case ASCOMConnectionState.Connecting:
                case ASCOMConnectionState.Engaged:
                    label.ForeColor = Color.Goldenrod;
                    label.Visible = true;
                    break;
                case ASCOMConnectionState.Connected:
                case ASCOMConnectionState.Ready:
                    label.ForeColor = Color.Green;
                    label.Visible = true;
                    break;
                case ASCOMConnectionState.Disconnecting:
                    label.ForeColor = Color.SlateGray;
                    label.Visible = true;
                    break;
                case ASCOMConnectionState.NotResponding:
                    label.ForeColor = Color.Black;
                    label.Visible = true;
                    break;

                case ASCOMConnectionState.Errored:
                    label.ForeColor = Color.Red;
                    label.Visible = true;
                    break;
            }

            tsbTelControl.Visible = ObservatoryController.IsASCOMPlatformInstalled;
            tsbFocControl.Visible = ObservatoryController.IsASCOMPlatformInstalled;
            tsbCamControl.Visible = m_ObservatoryController.HasVideoCamera || ObservatoryController.IsASCOMPlatformVideoAvailable;

            UpdateASCOMConnectivityState();
        }
Esempio n. 5
0
 void FocuserConnectionChanged(ASCOMConnectionState state)
 {
     if (state == ASCOMConnectionState.Connected || state == ASCOMConnectionState.Ready)
     {
         DisableEnableControls(true);
     }
     else if (state == ASCOMConnectionState.Disconnected || state == ASCOMConnectionState.Engaged)
     {
         DisableEnableControls(false);
     }
 }
Esempio n. 6
0
 void observatoryController_TelescopeConnectionChanged(ASCOMConnectionState connectionState)
 {
     if (connectionState != ASCOMConnectionState.Connected && connectionState != ASCOMConnectionState.Ready)
     {
         m_TelescopeIsConnected = false;
         m_FOVKnown = false;
     }
 }