private void Dispose(bool disposing) { if (disposed) { return; } if (disposing) { // cleanup managed resources (none to cleanup for now) } // Clean up the tracelogger and util objects if (m_mount != null) { SharedResources.DisconnectMount(); m_mount = null; m_camera = null; } SharedResources.PutTraceLogger(); tl = null; utilities.Dispose(); utilities = null; astroUtilities.Dispose(); astroUtilities = null; transform.Dispose(); transform = null; disposed = true; }
private void clearSwitch_Click(object sender, EventArgs e) { settings.Set("switchDriverId", String.Empty); switchDriverName.Text = DeviceName("Switch", String.Empty); SharedResources.FreeMount(); LoadSwitches(); }
private void MainForm_FormClosed(object sender, FormClosedEventArgs e) { if (m_tl != null) { SharedResources.PutTraceLogger(); m_tl = null; } }
/// <summary> /// Initializes a new instance of the <see cref="EqPlatformAdapter"/> class. /// Must be public for COM registration. /// </summary> public Camera() { driverID = Marshal.GenerateProgIdForType(this.GetType()); tl = SharedResources.GetTraceLogger(); tl.LogMessage("Camera", "Starting initialisation"); tl.LogMessage("Camera", "Completed initialisation"); }
private void switchSetup_Click(object sender, EventArgs e) { try { SharedResources.SetupSwitch(); } catch (Exception ex) { m_tl.LogMessage("MainForm", ex.ToString()); string msg = String.Format("Could not open switch setup:\n\n{0}\n\nPlease resolve the problem and try again.", ex.Message); MessageBox.Show(msg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// Initializes a new instance of the <see cref="EqPlatformAdapter"/> class. /// Must be public for COM registration. /// </summary> public Telescope() { driverID = Marshal.GenerateProgIdForType(this.GetType()); tl = SharedResources.GetTraceLogger(); tl.LogMessage("Telescope", "Starting initialisation"); utilities = new Util(); //Initialise util object astroUtilities = new AstroUtils(); // Initialise astro utilities object transform = new Transform(); tl.LogMessage("Telescope", "Completed initialisation"); }
private void chooseSwitch_Click(object sender, EventArgs e) { string switchDriverId = settings.Get("switchDriverId"); using (ASCOM.Utilities.Chooser chooser = new Utilities.Chooser()) { chooser.DeviceType = "Switch"; string val = chooser.Choose(switchDriverId); if (!String.IsNullOrEmpty(val) && val != switchDriverId) { settings.Set("switchDriverId", val); switchDriverName.Text = DeviceName("Switch", val); SharedResources.FreeMount(); } } LoadSwitches(); }
private void chooseCam_Click(object sender, EventArgs e) { string camId = settings.Get("cameraId"); using (ASCOM.Utilities.Chooser chooser = new Utilities.Chooser()) { chooser.DeviceType = "Camera"; string val = chooser.Choose(camId); if (!String.IsNullOrEmpty(val) && val != camId) { if (val == SharedResources.CamDriverId) { return; // reject choice of this driver! } settings.Set("cameraId", val); camName.Text = DeviceName("Camera", val); SharedResources.FreeCamera(); } } }
private void chooseMount_Click(object sender, EventArgs e) { string scopeId = settings.Get("scopeId"); using (ASCOM.Utilities.Chooser chooser = new Utilities.Chooser()) { chooser.DeviceType = "Telescope"; string val = chooser.Choose(scopeId); if (!String.IsNullOrEmpty(val) && val != scopeId) { if (val == SharedResources.ScopeDriverId) { return; // reject choice of this driver! } settings.Set("scopeId", val); mountName.Text = DeviceName("Telescope", val); SharedResources.FreeMount(); } } }
private void Dispose(bool disposing) { if (disposed) { return; } if (disposing) { // free managed resources here } if (m_camera != null) { SharedResources.DisconnectCamera(); m_camera = null; } SharedResources.PutTraceLogger(); tl = null; disposed = true; }
private void cbTrace_CheckedChanged(object sender, EventArgs e) { bool enable = cbTrace.Checked; SharedResources.EnableLogging(enable); }
public MainForm() { InitializeComponent(); expand.Text = "Settings ▼"; m_tl = SharedResources.GetTraceLogger(); }