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; } }
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; } }
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; } }
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(); }
void FocuserConnectionChanged(ASCOMConnectionState state) { if (state == ASCOMConnectionState.Connected || state == ASCOMConnectionState.Ready) { DisableEnableControls(true); } else if (state == ASCOMConnectionState.Disconnected || state == ASCOMConnectionState.Engaged) { DisableEnableControls(false); } }
void observatoryController_TelescopeConnectionChanged(ASCOMConnectionState connectionState) { if (connectionState != ASCOMConnectionState.Connected && connectionState != ASCOMConnectionState.Ready) { m_TelescopeIsConnected = false; m_FOVKnown = false; } }