public PhidgetServo(PhidgetServoConfiguration config) { if (config == null) throw new ArgumentNullException("config"); configuration = config; ParseConfiguration(); queue = new Utility.UpdateQueue<Dictionary<Devices, int>>(); servo_controller = new Servo(); }
public Webcam(string camera, IPAddress ipAddress, int port, int frame_rate = 5) { FilterInfoCollection videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice); if (videoDevices.Count < 1) throw new Exception("No video input devices available"); if (!string.IsNullOrEmpty(camera)) videoSource = new VideoCaptureDevice(camera); else { videoSource = new VideoCaptureDevice(videoDevices[0].MonikerString); } updateWorker = new Timer(); updateWorker.Elapsed += new ElapsedEventHandler(updateWorker_Elapsed); FrameRate = frame_rate; JPEGQuality = 10; isActive = false; jpegCodec = GetEncoderInfo("image/jpeg"); videoSource.DesiredFrameSize = new Size(320, 240); videoSource.NewFrame += new NewFrameEventHandler(videoSource_NewFrame); udp_sender = new Comms.UDP_Sender(ipAddress, port); raw_frame_queue = new Utility.UpdateQueue<byte[]>(-1); }
public Webcam(string ocu_ipAddress, CameraConfiguration config) { this.config = config; FilterInfoCollection videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice); if (videoDevices.Count < 1) throw new Exception("No video input devices available"); if (!string.IsNullOrEmpty(config.DeviceName)) videoSource = new VideoCaptureDevice(config.DeviceName); //videoSource = new VideoCaptureDevice(videoDevices[1].MonikerString); else { videoSource = new VideoCaptureDevice(videoDevices[0].MonikerString); } updateWorker = new Timer(); updateWorker.Elapsed += new ElapsedEventHandler(updateWorker_Elapsed); FrameRate = config.RCU_To_OCU_Framerate; JPEGQuality = config.JPEGQuality; isActive = false; jpegCodec = GetEncoderInfo("image/jpeg"); videoSource.DesiredFrameSize = new Size(320, 240); videoSource.NewFrame += new NewFrameEventHandler(videoSource_NewFrame); udp_sender = new Comms.UDP_Sender(ocu_ipAddress, config.SendPort); raw_frame_queue = new Utility.UpdateQueue<byte[]>(-1); }