public Form1() { InitializeComponent(); string id = ASCOM.DriverAccess.Focuser.Choose(""); ASCOM.Interface.IFocuser foc = new ASCOM.DriverAccess.Focuser(id); foc.Link = true; foc.Move(0); while (foc.IsMoving) ; foc.Move(1000); while (foc.IsMoving) ; while(true) { bool val = foc.Link; //foc.Halt(); int pos = foc.Position; double temp = foc.Temperature; val = foc.IsMoving; } }
private void buttonConnect_Click(object sender, EventArgs e) { if (IsConnected) { driver.Connected = false; btnMoveIn.Enabled = false; btnMoveOut.Enabled = false; btnSetPos.Enabled = false; textMaxPos.Enabled = false; textCurrentPos.Enabled = false; textMinPos.Enabled = false; textMoveIn.Enabled = false; textMoveOut.Enabled = false; textStepDelay.Enabled = false; txtTemp.Enabled = false; } else { driver = new ASCOM.DriverAccess.Focuser(Properties.Settings.Default.DriverId); driver.Connected = true; btnMoveIn.Enabled = true; btnMoveOut.Enabled = true; btnSetPos.Enabled = true; textMaxPos.Enabled = true; textCurrentPos.Enabled = true; textMinPos.Enabled = true; textMoveIn.Enabled = true; textMoveOut.Enabled = true; textStepDelay.Enabled = true; txtTemp.Enabled = true; } SetUIState(); }
public Form1() { InitializeComponent(); string id = ASCOM.DriverAccess.Focuser.Choose(""); ASCOM.Interface.IFocuser foc = new ASCOM.DriverAccess.Focuser(id); foc.Link = true; foc.Move(0); while (foc.IsMoving) { ; } foc.Move(1000); while (foc.IsMoving) { ; } while (true) { bool val = foc.Link; //foc.Halt(); int pos = foc.Position; double temp = foc.Temperature; val = foc.IsMoving; } }
static void Main(string[] args) { // Uncomment the code that's required #if UseChooser // choose the device string id = ASCOM.DriverAccess.Focuser.Choose(""); if (string.IsNullOrEmpty(id)) { return; } // create this device ASCOM.DriverAccess.Focuser device = new ASCOM.DriverAccess.Focuser(id); #else // this can be replaced by this code, it avoids the chooser and creates the driver class directly. ASCOM.DriverAccess.Focuser device = new ASCOM.DriverAccess.Focuser("ASCOM.HomeMade.Focuser"); #endif // now run some tests, adding code to your driver so that the tests will pass. // these first tests are common to all drivers. Console.WriteLine("name " + device.Name); Console.WriteLine("description " + device.Description); Console.WriteLine("DriverInfo " + device.DriverInfo); Console.WriteLine("driverVersion " + device.DriverVersion); // TODO add more code to test the driver. device.Connected = true; device.Move(50100); device.Connected = false; Console.WriteLine("Press Enter to finish"); Console.ReadLine(); }
public bool choose() { string id = ASCOM.DriverAccess.Focuser.Choose(""); if (string.IsNullOrEmpty(id)) return false; // create this device focuser = new ASCOM.DriverAccess.Focuser(id); return true; }
private void buttonConnect_Click(object sender, EventArgs e) { if (IsConnected) { driver.Connected = false; } else { driver = new ASCOM.DriverAccess.Focuser(Properties.Settings.Default.DriverId); driver.Connected = true; } SetUIState(); }
/// <summary> /// Initializes a new instance of the <see cref="TFocuser"/> class. /// Must be public for COM registration. /// </summary> public SSFocuser(string DriverID, byte DriverType) { MyDriverType = DriverType; if (MyDriverType == 0) { MySSFocuser = new ASCOM.DriverAccess.Focuser(DriverID); } else { tl = new TraceLogger("", "TFocuser"); //ReadProfile(); // Read device configuration from the ASCOM Profile store tl.LogMessage("Focuser", "Starting initialisation"); connectedState = false; // Initialise connected to false utilities = new Util(); //Initialise util object astroUtilities = new AstroUtils(); // Initialise astro utilities object //TODO: Implement your additional construction here tl.LogMessage("Focuser", "Completed initialisation"); } }
static void Main(string[] args) { string id = ASCOM.DriverAccess.Focuser.Choose(""); if (string.IsNullOrEmpty(id)) return; // create this device ASCOM.DriverAccess.Focuser focuser = new ASCOM.DriverAccess.Focuser(id); // now run some tests, adding code to your driver so that the tests will pass. // these first tests are common to all drivers. Console.WriteLine("name " + focuser.Name); Console.WriteLine("description " + focuser.Description); Console.WriteLine("DriverInfo " + focuser.DriverInfo); Console.WriteLine("driverVersion " + focuser.DriverVersion); // Output the trace file key and dir Console.WriteLine("Trace Files Directory at " + traceDirRegKey + " is " + getTraceDir()); // Connect to Focusser focuser.Connected = true; if (focuser.Connected) { Console.WriteLine("Connected"); } else { Console.WriteLine("Not Connected"); } // Tests commandTest(focuser, "V#"); // Disconnect from Focusser focuser.Connected = false; Console.WriteLine("Press Enter to finish"); Console.ReadLine(); }
private void buttonConnect_Click(object sender, EventArgs e) { if (IsConnected) { timer1.Enabled = false; driver.Connected = false; } else { driver = new ASCOM.DriverAccess.Focuser(Properties.Settings.Default.DriverId); try { driver.Connected = true; } catch (ASCOM.NotConnectedException ex) { // LogBox.AppendText(ex.Message + "\r\n"); return; } } SetUIState(); timer1.Enabled = true; }
/// <summary> /// Wrapper to reset telescope driver /// Later system would reinitiate it itself /// </summary> public void Reset() { Connected_flag = false; objFcouser = null; }