AMNumber CLSQE65000Detector::reading(const AMnDIndex &indexes) const{ if( (!isConnected()) || (indexes.rank() != 1) || (indexes.i() > 1024) ) return AMNumber(AMNumber::DimensionError); AMReadOnlyPVControl *tmpControl = qobject_cast<AMReadOnlyPVControl*>(spectrumControl_); return tmpControl->readPV()->lastIntegerValues().at(indexes.i()); }
CLSPGTDetector::CLSPGTDetector(const QString &name, const QString &baseName, AMBeamlineActionItem *toggleOnAction, AMBeamlineActionItem *toggleOffAction, AMOldDetector::ReadMethod readMethod, QObject *parent) : CLSPGTDetectorInfo(name, name, parent), AMOldDetector(name, readMethod) { baseName_ = baseName; toggleOnAction_ = toggleOnAction; toggleOffAction_ = toggleOffAction; allControls_ = new AMControlSet(); poweredOn_ = false; dataWaveformControl_ = new AMReadOnlyWaveformBinningPVControl(name+"Spectrum", baseName+":GetChannels", 0, 1024, this); dataWaveformControl_->setDescription("SDD Spectrum"); dataWaveformControl_->setContextKnownDescription("Spectrum"); hvControl_ = new AMPVControl(name+"HV", baseName+":Bias:VoltActual:fbk", baseName+":Bias:Volt", QString(), this, 0.5); hvControl_->setDescription("SDD High Voltage"); hvControl_->setContextKnownDescription("Voltage"); integrationTimeControl_ = new AMPVControl(name+"IntegrationTime", "BL1611-ID-1:AddOns:PGTDwellTime", "BL1611-ID-1:AddOns:PGTDwellTime", "", this, 0.1); integrationTimeControl_->setDescription("SDD Integration Time"); integrationTimeControl_->setContextKnownDescription("Integration Time"); integrationModeControl_ = new AMPVControl(name+"IntegrationMode", "BL1611-ID-1:AddOns:PGTDwellMode", "BL1611-ID-1:AddOns:PGTDwellMode", "", this, 0.1); integrationModeControl_->setDescription("SDD Integration Mode"); integrationModeControl_->setContextKnownDescription("Integration Mode"); dwellTriggerControl_ = new AMPVControl(name+"DwellTrigger", "BL1611-ID-1:AddOns:PGTDwellTrigger", "BL1611-ID-1:AddOns:PGTDwellTrigger", "", this, 0.1); dwellTriggerControl_->setDescription("SDD Dwell Trigger"); dwellTriggerControl_->setContextKnownDescription("Dwell Trigger"); AMReadOnlyPVControl *tmpControl = qobject_cast<AMReadOnlyPVControl*>(dataWaveformControl_); spectrumDataSource_ = new AM1DProcessVariableDataSource(tmpControl->readPV(), "Spectrum", this); allControls_->addControl(dataWaveformControl_); allControls_->addControl(hvControl_); allControls_->addControl(integrationTimeControl_); allControls_->addControl(integrationModeControl_); allControls_->addControl(dwellTriggerControl_); connect(allControls_, SIGNAL(connected(bool)), this, SLOT(onControlsConnected(bool))); connect(allControls_, SIGNAL(controlSetTimedOut()), this, SLOT(onControlsTimedOut())); connect(signalSource(), SIGNAL(connected(bool)), this, SLOT(onSettingsControlValuesChanged())); connect(signalSource(), SIGNAL(connected(bool)), this, SIGNAL(connected(bool))); connect(dataWaveformControl_, SIGNAL(valueChanged(double)), this, SLOT(onReadingsControlValuesChanged())); connect(tmpControl, SIGNAL(valueChanged(double)), this, SIGNAL(totalCountsChanged(double))); connect(hvControl_, SIGNAL(valueChanged(double)), this, SLOT(onSettingsControlValuesChanged())); connect(integrationTimeControl_, SIGNAL(valueChanged(double)), this, SLOT(onSettingsControlValuesChanged())); connect(integrationModeControl_, SIGNAL(valueChanged(double)), this, SLOT(onSettingsControlValuesChanged())); connect(dwellTriggerControl_, SIGNAL(valueChanged(double)), this, SLOT(onDwellTriggerChanged(double))); if(isConnected()){ onReadingsControlValuesChanged(); onSettingsControlValuesChanged(); } }
CLSPGTDetectorV2::CLSPGTDetectorV2(const QString &name, const QString &description, const QString &baseName, QObject *parent) : AMDetector(name, description, parent) { baseName_ = baseName; units_ = "Counts"; allControls_ = new AMControlSet(this); statusControl_ = new AMReadOnlyPVControl(name%"Status", baseName%":GetAcquire", this); integrationTimeControl_ = new AMPVControl(name%"IntegrationTime", "BL1611-ID-1:AddOns:PGTDwellTime", "BL1611-ID-1:AddOns:PGTDwellTime", "", this, 0.001); integrationTimeControl_->setDescription("SDD Integration Time"); integrationTimeControl_->setContextKnownDescription("Integration Time"); integrationModeControl_ = new AMPVControl(name%"IntegrationMode", "BL1611-ID-1:AddOns:PGTDwellMode", "BL1611-ID-1:AddOns:PGTDwellMode", "", this, 0.1); integrationModeControl_->setDescription("SDD Integration Mode"); integrationModeControl_->setContextKnownDescription("Integration Mode"); startAcquisitionControl_ = new AMPVControl(name%"StartAcquisition", "BL1611-ID-1:AddOns:PGTDwellTrigger", "BL1611-ID-1:AddOns:PGTDwellTrigger", "", this, 0.1); startAcquisitionControl_->setDescription("SDD Start Acquisition"); startAcquisitionControl_->setContextKnownDescription("Start Acquisition"); spectrumControl_ = new AMReadOnlyPVControl(name%"Spectrum", baseName%":GetChannels", this); spectrumControl_->setDescription("SDD Spectrum"); spectrumControl_->setContextKnownDescription("Spectrum"); binnedSpectrumControl_ = new AMReadOnlyWaveformBinningPVControl(name%"BinnedSpectrum", baseName%":GetChannels", 0, 1024, this); clearControl_ = new AMPVControl(name%"Clear", baseName%":ClearSpectrum.PROC", baseName%":ClearSpectrum.PROC", QString(), this, 0.1); powerControl_ = new AMPVControl(name%"PowerOn", baseName%":Power:fbk", baseName%":Power", QString(), this, 0.1); voltageControl_ = new AMPVControl(name%"HV", baseName+":Bias:VoltActual:fbk", baseName+":Bias:Volt", QString(), this, 0.5); voltageControl_->setDescription("SDD High Voltage"); voltageControl_->setContextKnownDescription("Voltage"); allControls_->addControl(statusControl_); allControls_->addControl(integrationTimeControl_); allControls_->addControl(integrationModeControl_); allControls_->addControl(startAcquisitionControl_); allControls_->addControl(spectrumControl_); allControls_->addControl(binnedSpectrumControl_); allControls_->addControl(clearControl_); allControls_->addControl(powerControl_); allControls_->addControl(voltageControl_); connect(allControls_, SIGNAL(connected(bool)), this, SLOT(onControlsConnected(bool))); connect(allControls_, SIGNAL(controlSetTimedOut()), this, SLOT(onControlsTimedOut())); connect(integrationTimeControl_, SIGNAL(valueChanged(double)), this, SIGNAL(acquisitionTimeChanged(double))); connect(integrationModeControl_, SIGNAL(valueChanged(double)), this, SIGNAL(acquisitionModeChanged())); connect(statusControl_, SIGNAL(valueChanged(double)), this, SLOT(onStatusControlChanged(double))); AMReadOnlyPVControl *tmpControl = qobject_cast<AMReadOnlyPVControl*>(spectrumControl_); spectrumDataSource_ = new AM1DProcessVariableDataSource(tmpControl->readPV(), "Spectrum", this); }
CLSQE65000Detector::CLSQE65000Detector(const QString &name, const QString &description, const QString &baseName, QObject *parent) : AMDetector(name, description, parent) { baseName_ = baseName; units_ = "Counts"; data_ = new double[1024]; for(int x = 0; x < 1024; x++) data_[x] = 0; allControls_ = new AMControlSet(this); spectrumControl_ = new AMReadOnlyPVControl(name%"Spectrum", baseName%":DarkCorrectedSpectra", this); spectrumControl_->setDescription("QE 65000 Spectrum"); spectrumControl_->setContextKnownDescription("Spectrum"); binnedSpectrumControl_ = new AMReadOnlyWaveformBinningPVControl(name%"BinnedSpectrum", baseName%":DarkCorrectedSpectra", 0, 1024, this); ((AMReadOnlyWaveformBinningPVControl*)binnedSpectrumControl_)->setAttemptDouble(true); integrationTimeControl_ = new AMPVControl(name%"IntegrationTime", baseName%":IntegrationTime:Value", baseName%":IntegrationTime:Value", "", this, 0.1); integrationTimeControl_->setDescription("QE 65000 Integration Time"); integrationTimeControl_->setContextKnownDescription("Integration Time"); startAcquisitionControl_ = new AMPVControl(name%"StartAcquisition", baseName%":Acquire", baseName%":Acquire", "", this, 0.1); startAcquisitionControl_->setDescription("QE 65000 Start Acquisition"); startAcquisitionControl_->setContextKnownDescription("Start Acquisition"); statusControl_ = new AMReadOnlyPVControl(name+"DwellStatus", baseName+":Acquiring", this); statusControl_->setDescription("QE 65000 Status"); statusControl_->setContextKnownDescription("Status"); allControls_->addControl(spectrumControl_); allControls_->addControl(binnedSpectrumControl_); allControls_->addControl(integrationTimeControl_); allControls_->addControl(startAcquisitionControl_); allControls_->addControl(statusControl_); connect(allControls_, SIGNAL(connected(bool)), this, SLOT(onControlsConnected(bool))); connect(allControls_, SIGNAL(controlSetTimedOut()), this, SLOT(onControlsTimedOut())); connect(spectrumControl_, SIGNAL(valueChanged(double)), this, SLOT(onSpectrumControlChanged(double))); connect(integrationTimeControl_, SIGNAL(valueChanged(double)), this, SIGNAL(acquisitionTimeChanged(double))); connect(statusControl_, SIGNAL(valueChanged(double)), this, SLOT(onStatusControlChanged(double))); AMReadOnlyPVControl *tmpControl = qobject_cast<AMReadOnlyPVControl*>(spectrumControl_); spectrumDataSource_ = new AM1DProcessVariableDataSource(tmpControl->readPV(), "Spectrum", this); }
QVector<int> CLSOceanOptics65000Detector::spectraValues() { AMReadOnlyPVControl *tmpControl = qobject_cast<AMReadOnlyPVControl*>(dataWaveformControl_); return tmpControl->readPV()->lastIntegerValues(); }