/// <summary> /// set the camera to a pre-defined resolution (pixels x pixels) /// this image size needs to fit the beam size and pupil size /// </summary> private void ConfigureDevice(int selectedInstrId) { int spotsX = 0; int spotsY = 0; if ((0 == (selectedInstrId & WFS.DeviceOffsetWFS10)) && (0 == (selectedInstrId & WFS.DeviceOffsetWFS20))) { //we will always want the camera resolution to be 1280x1024 (maximum resolution), index 0. So that will be set here. Console.Write("Configure WFS camera with resolution index: " + highestCameraResolution.ToString() + " (" + WFS.CamWFSXPixel[highestCameraResolution].ToString() + " x " + WFS.CamWFSYPixel[highestCameraResolution].ToString() + " pixels)\n"); instrument.ConfigureCam(pixelFormat, highestCameraResolution, out spotsX, out spotsY); } else // the rest of this code (in the helper method) is unused. { if (0 != (selectedInstrId & WFS.DeviceOffsetWFS10)) // WFS10 instrument { Console.Write("Configure WFS10 camera with resolution index: " + sampleCameraResolWfs10.ToString() + " (" + WFS.CamWFSXPixel[sampleCameraResolWfs10].ToString() + " x " + WFS.CamWFSYPixel[sampleCameraResolWfs10].ToString() + " pixels)\n"); instrument.ConfigureCam(pixelFormat, sampleCameraResolWfs10, out spotsX, out spotsY); } else // WFS20 instrument { Console.Write("Configure WFS20 camera with resolution index: " + sampleCameraResolWfs20.ToString() + " (" + WFS.CamWFSXPixel[sampleCameraResolWfs20].ToString() + " x " + WFS.CamWFSYPixel[sampleCameraResolWfs20].ToString() + " pixels)\n"); instrument.ConfigureCam(pixelFormat, sampleCameraResolWfs20, out spotsX, out spotsY); } } Console.WriteLine("Camera is configured to detect " + spotsX.ToString() + " x " + spotsY.ToString() + " lenslet spots.\n", spotsX, spotsY); }
private void ConfigureDevice(int selectedInstrId) /// <summary> /// set the camera to a pre-defined resolution (pixels x pixels) /// this image size needs to fit the beam size and pupil size /// </summary> { int spotsX = 0; int spotsY = 0; if ((0 == (selectedInstrId & WFS.DeviceOffsetWFS10)) && (0 == (selectedInstrId & WFS.DeviceOffsetWFS20)) && (0 == (selectedInstrId & WFS.DeviceOffsetWFS30)) && (0 == (selectedInstrId & WFS.DeviceOffsetWFS40))) { Console.Write("Configure WFS camera with resolution index: " + sampleCameraResolWfs.ToString() + " (" + WFS.CamWFSXPixel[sampleCameraResolWfs].ToString() + " x " + WFS.CamWFSYPixel[sampleCameraResolWfs].ToString() + " pixels)\n"); instrument.ConfigureCam(pixelFormat, sampleCameraResolWfs, out spotsX, out spotsY); } else { if (0 != (selectedInstrId & WFS.DeviceOffsetWFS10)) // WFS10 instrument { Console.Write("Configure WFS10 camera with resolution index: " + sampleCameraResolWfs10.ToString() + " (" + WFS.CamWFSXPixel[sampleCameraResolWfs10].ToString() + " x " + WFS.CamWFSYPixel[sampleCameraResolWfs10].ToString() + " pixels)\n"); instrument.ConfigureCam(pixelFormat, sampleCameraResolWfs10, out spotsX, out spotsY); } if (0 != (selectedInstrId & WFS.DeviceOffsetWFS20)) // WFS20 instrument { Console.Write("Configure WFS20 camera with resolution index: " + sampleCameraResolWfs20.ToString() + " (" + WFS.CamWFSXPixel[sampleCameraResolWfs20].ToString() + " x " + WFS.CamWFSYPixel[sampleCameraResolWfs20].ToString() + " pixels)\n"); instrument.ConfigureCam(pixelFormat, sampleCameraResolWfs20, out spotsX, out spotsY); } if (0 != (selectedInstrId & WFS.DeviceOffsetWFS30)) // WFS30 instrument { Console.Write("Configure WFS30 camera with resolution index: " + sampleCameraResolWfs30.ToString() + " (" + WFS.CamWFSXPixel[sampleCameraResolWfs30].ToString() + " x " + WFS.CamWFSYPixel[sampleCameraResolWfs30].ToString() + " pixels)\n"); instrument.ConfigureCam(pixelFormat, sampleCameraResolWfs30, out spotsX, out spotsY); } if (0 != (selectedInstrId & WFS.DeviceOffsetWFS40)) // WFS40 instrument { Console.Write("Configure WFS40 camera with resolution index: " + sampleCameraResolWfs40.ToString() + " (" + WFS.CamWFSXPixel[sampleCameraResolWfs40].ToString() + " x " + WFS.CamWFSYPixel[sampleCameraResolWfs40].ToString() + " pixels)\n"); instrument.ConfigureCam(pixelFormat, sampleCameraResolWfs40, out spotsX, out spotsY); } } Console.WriteLine("Camera is configured to detect " + spotsX.ToString() + " x " + spotsY.ToString() + " lenslet spots.\n", spotsX, spotsY); }