void SXRMBBeamline::setupConnections() { connect(CLSStorageRing::sr1(), SIGNAL(beamAvaliability(bool)), this, SLOT(onStorageRingBeamAvailabilityChanged(bool))); connect(beamlineStatus_, SIGNAL(valueChanged(double)), this, SLOT(onBeamlineStatusPVValueChanged(double))); connect(beamlineStatus_, SIGNAL(connected(bool)), this, SLOT(onBeamlineStatusPVConnected(bool))); connect(jjSlits_, SIGNAL(connectedChanged(bool)), this, SLOT(onPVConnectedHelper()) ); connect(PSH1406B1002Shutter_, SIGNAL(stateChanged(int)), this, SLOT(onPhotonShutterStateChanged())); connect(endstationControl_, SIGNAL(connected(bool)), this, SLOT(onEndstationPVConnected(bool))); connect(endstationControl_, SIGNAL(valueChanged(double)), this, SLOT(onEndstationPVValueChanged(double))); connect(energy_, SIGNAL(connected(bool)), this, SLOT(onEnergyPVConnected(bool))); connect(microprobeSampleStageControlSet_, SIGNAL(connected(bool)), this, SLOT(onSampleStagePVsConnected(bool))); connect(solidStateSampleStageControlSet_, SIGNAL(connected(bool)), this, SLOT(onSampleStagePVsConnected(bool))); connect(ambiantWithGasChamberSampleStageControlSet_, SIGNAL(connected(bool)), this, SLOT(onSampleStagePVsConnected(bool))); connect(ambiantWithoutGasChamberSampleStageControlSet_, SIGNAL(connected(bool)), this, SLOT(onSampleStagePVsConnected(bool))); connect(beamlineControlShutterSet_, SIGNAL(connected(bool)), this, SLOT(onBeamlineControlShuttersConnected(bool))); connect(beamlineControlShutterSet_, SIGNAL(controlSetTimedOut()), this, SIGNAL(beamlineControlShuttersTimeout())); if (beamlineStatus_->isConnected()) { onBeamlineStatusPVConnected(true); } if (endstationControl_->isConnected()) { onEndstationPVValueChanged(endstationControl_->value()); } }
VESPERSCCDDetector::VESPERSCCDDetector(const QString &name, const QString &description, QObject *parent) : AMDetector(name, description, parent) { units_ = "Counts"; allControls_ = new AMControlSet(this); connect(allControls_, SIGNAL(connected(bool)), this, SLOT(onControlsConnected(bool))); connect(allControls_, SIGNAL(controlSetTimedOut()), this, SLOT(onControlsTimedOut())); connect(&elapsedTimer_, SIGNAL(timeout()), this, SLOT(onElapsedTimeChanged())); }
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); }
CLSOceanOptics65000Detector::CLSOceanOptics65000Detector(const QString &name, const QString &baseName, AMOldDetector::ReadMethod readMethod, QObject *parent) : CLSOceanOptics65000DetectorInfo(name, name, parent), AMOldDetector(name, readMethod) { baseName_ = baseName; allControls_ = new AMControlSet(); dataWaveformControl_ = new AMReadOnlyWaveformBinningPVControl(name+"Spectrum", baseName+":DarkCorrectedSpectra", 0, 1024, this); dataWaveformControl_->setDescription("OceanOptics 65000 Spectrum"); dataWaveformControl_->setContextKnownDescription("Spectrum"); integrationTimeControl_ = new AMPVControl(name+"IntegrationTime", baseName+":IntegrationTime:Value", baseName+":IntegrationTime:Value", "", this, 0.1); integrationTimeControl_->setDescription("OceanOptics 65000 Integration Time"); integrationTimeControl_->setContextKnownDescription("Integration Time"); dwellTriggerControl_ = new AMPVControl(name+"DwellTrigger", baseName+":Acquire", baseName+":Acquire", "", this, 0.1); dwellTriggerControl_->setDescription("OceanOptics 65000 Dwell Trigger"); dwellTriggerControl_->setContextKnownDescription("Dwell Trigger"); dwellStateControl_ = new AMReadOnlyPVControl(name+"DwellStatus", baseName+":Acquiring", this); dwellStateControl_->setDescription("OceanOptics 65000 Dwell Status"); dwellStateControl_->setContextKnownDescription("Dwell Status"); allControls_->addControl(dataWaveformControl_); allControls_->addControl(integrationTimeControl_); allControls_->addControl(dwellTriggerControl_); allControls_->addControl(dwellStateControl_); AMReadOnlyWaveformBinningPVControl *tmpControl = qobject_cast<AMReadOnlyWaveformBinningPVControl*>(dataWaveformControl_); tmpControl->setAttemptDouble(true); spectrumDataSource_ = new AM1DProcessVariableDataSource(tmpControl->readPV(), "Spectrum", this); 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(integrationTimeControl_, SIGNAL(valueChanged(double)), this, SLOT(onSettingsControlValuesChanged())); connect(dwellStateControl_, SIGNAL(valueChanged(double)), this, SLOT(onStatusChanged(double))); connect(tmpControl, SIGNAL(valueChanged(double)), this, SIGNAL(totalCountsChanged(double))); }
void VESPERSBeamline::setupSampleStage() { sampleStageHorizontal_ = new AMPVwStatusControl("Horizontal Sample Stage", "TS1607-2-B21-01:H:user:mm:sp", "TS1607-2-B21-01:H:user:mm", "TS1607-2-B21-01:H:status", "TS1607-2-B21-01:HNV:stop.PROC", this, 0.01, 10.0); sampleStageVertical_ = new AMPVwStatusControl("Vertical Sample Stage", "TS1607-2-B21-01:V:user:mm:sp", "TS1607-2-B21-01:V:user:mm", "TS1607-2-B21-01:V:status", "TS1607-2-B21-01:HNV:stop.PROC", this, 0.01, 10.0); sampleStageNormal_ = new AMPVwStatusControl("Normal Sample Stage", "TS1607-2-B21-01:N:user:mm:sp", "TS1607-2-B21-01:N:user:mm", "TS1607-2-B21-01:N:status", "TS1607-2-B21-01:HNV:stop.PROC", this, 0.01, 10.0); ((AMPVwStatusControl *)sampleStageHorizontal_)->setMoveStartTolerance(0.0001); ((AMPVwStatusControl *)sampleStageVertical_)->setMoveStartTolerance(0.0001); ((AMPVwStatusControl *)sampleStageNormal_)->setMoveStartTolerance(0.0001); // sampleStageHorizontal_ = new CLSMAXvMotor("Horizontal Sample Stage", "TS1607-2-B21-01:H:user", "Horizontal Pseudo Motor", false, 0.01, 10.0, this); // sampleStageVertical_ = new CLSMAXvMotor("Vertical Sample Stage", "TS1607-2-B21-01:V:user", "Vertical Pseudo Motor", false, 0.01, 10.0, this); // sampleStageNormal_ = new CLSMAXvMotor("Normal Sample Stage", "TS1607-2-B21-01:N:user", "Horizontal Pseudo Motor", false, 0.01, 10.0, this); // sampleStageX_ = new CLSMAXvMotor("X motor", "SVM1607-2-B21-02", "X Motor Sample Stage", true, 0.01, 10.0, this); // sampleStageY_ = new CLSMAXvMotor("Y (normal) motor", "SVM1607-2-B21-03", "Y Motor Sample Stage", true, 0.01, 10.0, this); // sampleStageZ_ = new CLSMAXvMotor("Z motor", "SVM1607-2-B21-01", "Z Motor Sample Stage", true, 0.01, 10.0, this); // ((CLSMAXvMotor *)sampleStageX_)->setMoveStartTolerance(0.0001); // ((CLSMAXvMotor *)sampleStageY_)->setMoveStartTolerance(0.0001); // ((CLSMAXvMotor *)sampleStageZ_)->setMoveStartTolerance(0.0001); sampleStageX_ = new AMPVwStatusControl("X Motor Sample Stage", "TS1607-2-B21-01:X:user:mm:sp", "TS1607-2-B21-01:X:user:mm", "TS1607-2-B21-01:X:status", "TS1607-2-B21-01:XYZ:stop.PROC", this, 0.01, 10.0); sampleStageY_ = new AMPVwStatusControl("Y Motor Sample Stage", "TS1607-2-B21-01:Y:user:mm:sp", "TS1607-2-B21-01:Y:user:mm", "TS1607-2-B21-01:Y:status", "TS1607-2-B21-01:XYZ:stop.PROC", this, 0.01, 10.0); sampleStageZ_ = new AMPVwStatusControl("Z Motor Sample Stage", "TS1607-2-B21-01:Z:user:mm:sp", "TS1607-2-B21-01:Z:user:mm", "TS1607-2-B21-01:Z:status", "TS1607-2-B21-01:XYZ:stop.PROC", this, 0.01, 10.0); ((AMPVwStatusControl *)sampleStageX_)->setMoveStartTolerance(0.0001); ((AMPVwStatusControl *)sampleStageY_)->setMoveStartTolerance(0.0001); ((AMPVwStatusControl *)sampleStageZ_)->setMoveStartTolerance(0.0001); pseudoSampleStage_ = new VESPERSSampleStageControl(sampleStageHorizontal_, sampleStageVertical_, sampleStageNormal_, this); pseudoSampleStage_->setXRange(-1700000, 1700000); pseudoSampleStage_->setYRange(-1200000, 1200000); pseudoSampleStage_->setZRange(-1200000, 1200000); realSampleStage_ = new VESPERSSampleStageControl(sampleStageX_, sampleStageZ_, sampleStageY_, this); realSampleStage_->setXRange(-1700000, 1700000); realSampleStage_->setYRange(-1200000, 1200000); realSampleStage_->setZRange(-1200000, 1200000); sampleStageMotorSet_ = new AMControlSet(this); sampleStageMotorSet_->addControl(sampleStageHorizontal_); sampleStageMotorSet_->addControl(sampleStageVertical_); sampleStageMotorSet_->addControl(sampleStageNormal_); sampleStageMotorSet_->addControl(sampleStageX_); sampleStageMotorSet_->addControl(sampleStageY_); sampleStageMotorSet_->addControl(sampleStageZ_); connect(sampleStageMotorSet_, SIGNAL(controlSetTimedOut()), this, SLOT(sampleStageError())); sampleStagePidX_ = new AMPVControl("Sample Stage PID X", "SVM1607-2-B21-02:hold:sp", "SVM1607-2-B21-02:hold", QString(), this); sampleStagePidY_ = new AMPVControl("Sample Stage PID Y", "SVM1607-2-B21-03:hold:sp", "SVM1607-2-B21-03:hold", QString(), this); sampleStagePidZ_ = new AMPVControl("Sample Stage PID Z", "SVM1607-2-B21-01:hold:sp", "SVM1607-2-B21-01:hold", QString(), this); sampleStagePID_ = new VESPERSPIDLoopControl("PID - Sample Stage", sampleStagePidX_, sampleStagePidY_, sampleStagePidZ_, this); wireStageHorizontal_ = new AMPVwStatusControl("Horizontal Wire Stage", "TS1607-2-B21-02:H:user:mm:sp", "TS1607-2-B21-02:H:user:mm", "TS1607-2-B21-02:H:status", "TS1607-2-B21-02:HNV:stop.PROC", this, 0.01, 10.0); wireStageVertical_ = new AMPVwStatusControl("Vertical Wire Stage", "TS1607-2-B21-02:V:user:mm:sp", "TS1607-2-B21-02:V:user:mm", "TS1607-2-B21-02:V:status", "TS1607-2-B21-02:HNV:stop.PROC", this, 0.01, 10.0); wireStageNormal_ = new AMPVwStatusControl("Normal Wire Stage", "TS1607-2-B21-02:N:user:mm:sp", "TS1607-2-B21-02:N:user:mm", "TS1607-2-B21-02:N:status", "TS1607-2-B21-02:HNV:stop.PROC", this, 0.01, 10.0); ((AMPVwStatusControl *)sampleStageHorizontal_)->setMoveStartTolerance(0.0001); ((AMPVwStatusControl *)sampleStageVertical_)->setMoveStartTolerance(0.0001); ((AMPVwStatusControl *)sampleStageNormal_)->setMoveStartTolerance(0.0001); pseudoWireStage_ = new VESPERSSampleStageControl(wireStageHorizontal_, wireStageVertical_, wireStageNormal_, this); pseudoWireStage_->setXRange(-1700000, 1700000); pseudoWireStage_->setYRange(-1200000, 1200000); pseudoWireStage_->setZRange(-1200000, 1200000); }