/** Sets the calibration for the trip */ void cwTrip::setCalibration(cwTripCalibration* calibration) { if(calibration != Calibration) { Calibration->deleteLater(); Calibration = calibration; Calibration->setParent(this); emit calibrationChanged(); } }
void REIXSXESSpectrometerControlEditor::setupConnections() { connect(spectrometer_, SIGNAL(valueChanged(double)), this, SLOT(updateCurrentEnergyStatus(double))); connect(spectrometer_, SIGNAL(calibrationChanged()), this, SLOT(populateGratingComboBox())); connect(spectrometer_, SIGNAL(gratingChanged(int)), this, SLOT(updateCurrentGratingStatus())); connect(spectrometer_, SIGNAL(movingChanged(bool)), this, SLOT(updateCurrentGratingStatus())); connect(spectrometer_, SIGNAL(moveSucceeded()), this, SLOT(onSpectrometerMoveSucceeded())); connect(spectrometer_, SIGNAL(moveFailed(int)), this, SLOT(onSpectrometerMoveFailed(int))); connect(spectrometer_->gratingMask(), SIGNAL(valueChanged(double)), this, SLOT(updateMaskPosition())); connect(spectrometer_->gratingMask(), SIGNAL(connected(bool)), this, SLOT(updateMaskPosition())); connect(maskComboBox_, SIGNAL(currentIndexChanged(QString)), this, SLOT(on_maskComboBox_currentIndexChanged(QString))); connect(energyBox_, SIGNAL(valueChanged(double)), this, SLOT(updateCurrentEnergyStatus())); connect(gratingSelectorBox_, SIGNAL(currentIndexChanged(int)), this, SLOT(onGratingComboBoxActivated(int))); connect(stopButton_, SIGNAL(clicked()), this, SLOT(onStopButtonClicked())); connect(moveNowButton_, SIGNAL(clicked()), this, SLOT(onMoveButtonClicked())); connect(energyBox_, SIGNAL(valueChanged(double)), this, SLOT(updateEnergyRange())); connect(tiltOffsetBox_, SIGNAL(valueChanged(double)), this, SLOT(updateEnergyRange())); connect(gratingSelectorBox_, SIGNAL(currentIndexChanged(int)), this, SLOT(updateEnergyRange())); }
bool REIXSSpectrometer::loadSpectrometerCalibration(AMDatabase *db, int databaseId) { if(databaseId >= 1) { if(!calibration_.loadFromDb(db, databaseId)) return false; } else { calibration_ = REIXSXESCalibration2(); } // need to check grating indexes... Are they too big? if(currentGrating_ >= calibration_.gratingCount()) { currentGrating_ = -1; } if(specifiedGrating_ >= calibration_.gratingCount()) { specifiedGrating_ = 0; } emit calibrationChanged(); return true; }