public bool CloseShutter(CustomConfig config) { try { if (config.AttachedObject == null) return false; SerialPort serialPort = config.AttachedObject as SerialPort; if (serialPort == null) throw new ArgumentNullException("serialPort"); if (config.Get("IsHexa") == "True") { var data = StringToByteArray(config.Get("CaptureOff")); serialPort.Write(data, 0, data.Length); } else { serialPort.WriteLine(config.Get("CaptureOff")); } serialPort.Close(); config.AttachedObject = null; } catch (Exception ex) { Log.Debug("ArduinoShutterRelease", ex); StaticHelper.Instance.SystemMessage = "Error Shutter " + ex.Message; } return true; }
public bool OpenShutter(CustomConfig config) { if (config.AttachedObject != null) CloseShutter(config); SerialPort serialPort = new SerialPort(config.Get("Port")); serialPort.Open(); serialPort.RtsEnable = true; config.AttachedObject = serialPort; return true; }
public DCCUSBShutterReleaseConfig(CustomConfig config) { CustomConfig = config; InitializeComponent(); string[] ports = SerialPort.GetPortNames(); foreach (string port in ports) { cmb_ports.Items.Add(port); } }
public bool Capture(CustomConfig config) { Connect(); RelayDeviceWrapper.usb_relay_device_close_all_relay_channel(Hd); Thread.Sleep(500); RelayDeviceWrapper.usb_relay_device_open_all_relay_channel(Hd); RelayDeviceWrapper.usb_relay_device_close(Hd); Hd = 0; return true; }
public bool CloseShutter(CustomConfig config) { if (config.AttachedObject == null) return false; SerialPort serialPort = config.AttachedObject as SerialPort; if (serialPort == null) throw new ArgumentNullException("serialPort"); serialPort.RtsEnable = false; serialPort.Close(); config.AttachedObject = null; return true; }
public UserControl GetConfig(CustomConfig config) { try { return new UsbRelayReleaseConfig(config); } catch (Exception exception) { Log.Error("", exception); } return null; }
public UserControl GetConfig(CustomConfig config) { try { return new SerialPortShutterReleaseConfig(config); } catch (Exception exception) { Log.Error("", exception); } return null; }
public bool OpenShutter(CustomConfig config) { try { if (config.AttachedObject != null) CloseShutter(config); SerialPort serialPort = new SerialPort(config.Get("Port")); serialPort.Open(); serialPort.RtsEnable = true; config.AttachedObject = serialPort; } catch (Exception ex) { Log.Debug("Comm OpenShutter", ex); StaticHelper.Instance.SystemMessage = "Error Shutter " + ex.Message; } return true; }
public bool OpenShutter(CustomConfig config) { try { if (config.AttachedObject != null) CloseShutter(config); SerialPort serialPort = new SerialPort(config.Get("Port")); serialPort.Open(); serialPort.WriteTimeout = 3500; var data = StringToByteArray(config.Get("Init")); serialPort.Write(data, 0, data.Length); data = StringToByteArray(config.Get("CaptureOn")); serialPort.Write(data, 0, data.Length); config.AttachedObject = serialPort; } catch (Exception ex) { Log.Debug("UsbRelayRelease", ex); StaticHelper.Instance.SystemMessage = "Error Shutter " + ex.Message; } return true; }
public bool CloseShutter(CustomConfig config) { return true; }
public bool OpenShutter(CustomConfig config) { Capture(config); return true; }
public bool DeassertFocus(CustomConfig config) { throw new NotImplementedException(); }
public UsbRelayReleaseConfig() { CustomConfig = new CustomConfig(); InitializeComponent(); }
public bool DeassertFocus(CustomConfig config) { SendCommand("4", config.Get("Port")); return true; }
public bool DeassertFocus(CustomConfig config) { //throw new NotImplementedException(); return true; }
public bool CanExecute(CustomConfig config) { return true; }
public bool Focus(CustomConfig config) { SendCommand("0", config.Get("Port")); SendCommand("6", config.Get("Port")); return true; }
public bool Capture(CustomConfig config) { SendCommand("0", config.Get("Port")); SendCommand("5", config.Get("Port")); return true; }
public ArduinoShutterReleaseConfig() { CustomConfig = new CustomConfig(); InitializeComponent(); }
public bool CloseShutter(CustomConfig config) { try { if (config.AttachedObject == null) return false; SerialPort serialPort = config.AttachedObject as SerialPort; if (serialPort == null) throw new ArgumentNullException("serialPort"); serialPort.RtsEnable = false; serialPort.Close(); config.AttachedObject = null; } catch (Exception ex) { Log.Debug("Comm CloseShutter", ex); StaticHelper.Instance.SystemMessage = "Error Shutter " + ex.Message; } return true; }
public bool Capture(CustomConfig config) { return true; }
public DCCUSBShutterReleaseConfig() { InitializeComponent(); CustomConfig = new CustomConfig(); }
public bool Focus(CustomConfig config) { return true; }
public bool CloseShutter(CustomConfig config) { DSUSB_FocusDeassert(); if (!DSUSB_ShutterClose()) throw new Exception(string.Format("Error close shutter device {0}", config.Name)); DSUSB_LEDRed(); return true; }
public UserControl GetConfig(CustomConfig config) { return new SerialPortShutterReleaseConfig(config); }
public SerialPortShutterReleaseConfig() { InitializeComponent(); CustomConfig = new CustomConfig(); }
public bool DeassertFocus(CustomConfig config) { return true; }
public bool CloseShutter(CustomConfig config) { SendCommand("3", config.Get("Port")); return true; }
public bool OpenShutter(CustomConfig config) { SendCommand("2", config.Get("Port")); return true; }
public bool OpenShutter(CustomConfig config) { if (!DSUSB_Reset() && !DSUSB_Open()) throw new Exception(string.Format("Error connect device {0} ", config.Name)); DSUSB_LEDRed(); if(!OpenShutter()) throw new Exception(string.Format("Error open shutter device {0} ", config.Name)); DSUSB_FocusAssert(); DSUSB_LEDGreen(); return true; }