public ObservableCollection <Camera.HSSpeed> hsspeeds; // this is set to either hsspeeds_EM or hsspeeds_Conv, depending whether EM Amp is used public CameraSettingsManager_ViewModel(Imager imager, WaveguideDB wgDB) { _imager = imager; _camera = _imager.m_camera; _wgDB = wgDB; _camera.GetCameraCapabilities(); _wgDB.GetAllCameraSettings(); CameraSettingsList = _wgDB.m_cameraSettingsList; if (CameraSettingsList.Count > 0) { CurrentCameraSettings = CameraSettingsList.ElementAt(0); } else { CurrentCameraSettings = new CameraSettingsContainer(); CurrentCameraSettings.CameraSettingID = 0; CurrentCameraSettings.VSSIndex = 0; CurrentCameraSettings.HSSIndex = 0; CurrentCameraSettings.VertClockAmpIndex = 0; CurrentCameraSettings.UseEMAmp = true; CurrentCameraSettings.UseFrameTransfer = true; CurrentCameraSettings.Description = ""; CurrentCameraSettings.IsDefault = true; CurrentCameraSettings.StartingExposure = 2; CurrentCameraSettings.ExposureLimit = 1000; CurrentCameraSettings.HighPixelThresholdPercent = 80; CurrentCameraSettings.LowPixelThresholdPercent = 10; // 60 if !IncreasingSignal (i.e. a decreasing signal) CurrentCameraSettings.MinPercentPixelsAboveLowThreshold = 50; CurrentCameraSettings.MaxPercentPixelsAboveHighThreshold = 10; CurrentCameraSettings.IncreasingSignal = true; CurrentCameraSettings.StartingBinning = 1; CurrentCameraSettings.EMGainLimit = 300; } // set camera capabilities vsspeeds = _camera.VSSpeeds; vertClockVoltageAmplitudes = _camera.VertClockVoltageAmplitudes; hsspeeds_EM = _camera.HSSpeeds_EM; hsspeeds_Conv = _camera.HSSpeeds_Conv; if (_currentCameraSettings.UseEMAmp) { hsspeeds = hsspeeds_EM; } else { hsspeeds = hsspeeds_Conv; } preAmpGains = _camera.PreAmpGains; readModes = _camera.ReadModes; acquisitionModes = _camera.AcquisitionModes; triggerModes = _camera.TriggerModes; eMGainModes = _camera.EMGainModes; adChannelOptions = _camera.ADChannelOptions; binningOptions = _camera.BinningOptions; }
// Constructor public CameraSetupModel(Imager imager, WaveguideDB wgDB, bool AllowCameraConfiguration, bool _isManualMode) { if (imager == null) { return; } if (imager.m_camera == null) { return; } myImager = imager; myCamera = MyImager.m_camera; myWgDB = wgDB; myCamera.GetCameraCapabilities(); // make sure camera properties are updated myWgDB.GetAllCameraSettings(); // make sure camera settings list in wgDB is populated cameraSettingsList = myWgDB.m_cameraSettingsList; if (CameraSettingsList.Count > 0) { CurrentCameraSettings = CameraSettingsList.ElementAt(0); } else { CurrentCameraSettings = new CameraSettingsContainer(); CurrentCameraSettings.CameraSettingID = 0; CurrentCameraSettings.VSSIndex = 0; CurrentCameraSettings.HSSIndex = 0; CurrentCameraSettings.VertClockAmpIndex = 0; CurrentCameraSettings.UseEMAmp = true; CurrentCameraSettings.UseFrameTransfer = true; CurrentCameraSettings.Description = ""; CurrentCameraSettings.IsDefault = true; CurrentCameraSettings.StartingExposure = 2; CurrentCameraSettings.ExposureLimit = 1000; CurrentCameraSettings.HighPixelThresholdPercent = 80; CurrentCameraSettings.LowPixelThresholdPercent = 10; // 60 if !IncreasingSignal (i.e. a decreasing signal) CurrentCameraSettings.MinPercentPixelsAboveLowThreshold = 50; CurrentCameraSettings.MaxPercentPixelsAboveHighThreshold = 10; CurrentCameraSettings.IncreasingSignal = true; CurrentCameraSettings.StartingBinning = 1; CurrentCameraSettings.EMGainLimit = 300; } cameraParams = MyCamera.m_cameraParams; acqParams = MyCamera.m_acqParams; exposure = 1; isOptimizing = false; // set camera capabilities vsspeeds = MyCamera.VSSpeeds; vertClockVoltageAmplitudes = MyCamera.VertClockVoltageAmplitudes; hsspeeds_EM = MyCamera.HSSpeeds_EM; hsspeeds_Conv = MyCamera.HSSpeeds_Conv; if (cameraParams.UseEMAmp) { hsspeeds = hsspeeds_EM; } else { hsspeeds = hsspeeds_Conv; } emGain_LowLimit = MyCamera.EMGain_LowLimit; emGain_HighLimit = MyCamera.EMGain_HighLimit; preAmpGains = MyCamera.PreAmpGains; binningOptions = MyCamera.BinningOptions; // get Camera Parameters cameraParams = MyCamera.m_cameraParams; // get Acquisition Parameters acqParams = MyCamera.m_acqParams; showConfigPanel = false; // start with configuration panel hidden enableConfig = AllowCameraConfiguration; // if false, hides the configuration tab so that configuration cannot be performed isManualMode = _isManualMode; applyMask = true; myWgDB.GetAllExcitationFilters(); exFilterList = new ObservableCollection <FilterContainer>(); foreach (FilterContainer fc in myWgDB.m_filterList) { if (fc.FilterChanger == 1) { exFilterList.Add(fc); } } exFilter = exFilterList[0]; myWgDB.GetAllEmissionFilters(); emFilterList = new ObservableCollection <FilterContainer>(); foreach (FilterContainer fc in myWgDB.m_filterList) { if (fc.FilterChanger == 0) { emFilterList.Add(fc); } } emFilter = emFilterList[0]; sliderLowPosition = 0.0; sliderHighPosition = 100.0; cycleTime = 1; minCycleTime = 1; maxCycleTime = 10000; WellSelectionPBLabel = ""; flatFieldCorrectionItems = new ObservableCollection <FlatFieldCorrectionItem>(); flatFieldCorrectionItems.Add(new FlatFieldCorrectionItem("None", FLATFIELD_SELECT.NONE)); flatFieldCorrectionItems.Add(new FlatFieldCorrectionItem("Fluorescent", FLATFIELD_SELECT.USE_FLUOR)); flatFieldCorrectionItems.Add(new FlatFieldCorrectionItem("Luminescent", FLATFIELD_SELECT.USE_LUMI)); flatFieldSelect = flatFieldCorrectionItems[0]; }