/// <summary> /// Setup a CcdCamera device /// </summary> /// <param name="deviceId">DeviceId. 0=fake, 1=QCam, 2=OrcaER</param> public void CcdCam_Create(int deviceId) { string pipeName = ""; if (deviceId == 0) { pipeName = "Lab.Acq.Fake"; } else if (deviceId == 1) { pipeName = "Lab.Acq.QImaging.QCam"; } else if (deviceId == 2) { pipeName = "Lab.Acq.NI.Imaq"; } else { throw new System.ArgumentException("invalid device id: select 0, 1 or 2 for fake, qcam, or orcaER"); } if (cams.ContainsKey(deviceId)) { throw new ArgumentException("Device already created!"); } CcdCam c = new CcdCam(pipeName); cams.TryAdd(deviceId, c); }
public static void test() { var c = new CcdCam("Lab.Acq.Fake"); var size = c.Size; VideoSettingsStaticStruct s; s.Binning = BinningMode.Binning1x1; s.RoiX = 16; s.RoiY = 32; s.RoiWidth = 256; s.RoiHeight = 128; s.Trigger = 0; c.SetVideoSettingsStatic(s); c.Start(); VideoFrame f; bool ok = c.TryGetFrame(out f); Console.WriteLine(ok); if (ok) { Console.WriteLine(f.FrameNumber); } c.Stop(); c.Dispose(); }