private static void DoTask() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); QLHelper helper = QLHelper.ChooseDevice(); if (helper == null) { return; } if (!helper.SetupPassword()) { return; } if (!helper.SetupCalibration()) { return; } // Start the device. QLError error = QuickLink2API.QLDevice_Start(helper.DeviceId); if (error != QLError.QL_ERROR_OK) { Console.WriteLine("QLDevice_Start() returned {0} for device {1}.", error.ToString(), helper.DeviceId); return; } Console.WriteLine("Device has been started."); Console.WriteLine(); using (GazeForm mainForm = new GazeForm(helper.DeviceId)) { mainForm.ShowDialog(); } // Stop the device. error = QuickLink2API.QLDevice_Stop(helper.DeviceId); if (error != QLError.QL_ERROR_OK) { Console.WriteLine("QLDevice_Stop() returned {0} for device {1}.", error.ToString(), helper.DeviceId); return; } Console.WriteLine("Stopped Device."); }
public void RunBeforeAnyTests() { Console.WriteLine(note); Helper = QLHelper.ChooseDevice(); if (Helper == null) { Assert.Ignore("Cannot run tests without a device."); return; } if (!Helper.SetupPassword()) { Assert.Ignore("Failed to setup password for device."); return; } }
private static void doTask() { int[] deviceIds; QLError error = QLHelper.DeviceEnumerate(out deviceIds); if (error != QLError.QL_ERROR_OK) { Console.WriteLine("QLDevice_Enumerate() returned {0}.", error.ToString()); return; } QLHelper.PrintListOfDeviceInfo(deviceIds); Console.WriteLine(); for (int i = 0; i < deviceIds.Length; i++) { QLHelper helper = QLHelper.FromDeviceId(deviceIds[i]); if (!helper.SetupPassword()) { continue; } error = QuickLink2API.QLDevice_Start(helper.DeviceId); if (error != QLError.QL_ERROR_OK) { Console.WriteLine("QLDevice_Start() returned {0} for device {1}.", error.ToString(), helper.DeviceId); continue; } error = QuickLink2API.QLDevice_Stop(helper.DeviceId); if (error != QLError.QL_ERROR_OK) { Console.WriteLine("QLDevice_Stop() returned {0} for device {1}.", error.ToString(), helper.DeviceId); continue; } Console.WriteLine("Device {0} stopped.", helper.DeviceId); } }
private static void Main(string[] args) { DisableCloseButton(); QLHelper helper = QLHelper.ChooseDevice(); if (helper != null) { if (LoadSettingsFrom(helper.DeviceId)) { PrintSettings(); } } // Flush the input buffer. while (Console.KeyAvailable) { Console.ReadKey(true); } Console.WriteLine(); Console.WriteLine("Press any key to exit."); Console.ReadKey(); }
static void Main(string[] args) { DisableCloseButton(); QLHelper helper = QLHelper.ChooseDevice(); if (helper != null) { if (helper.SetupPassword()) { helper.SetupCalibration(true); } } // Flush the input buffer. while (Console.KeyAvailable) { Console.ReadKey(true); } Console.WriteLine(); Console.WriteLine("Press any key to exit."); Console.ReadKey(); }