VESPERSEnergyScanActionController::VESPERSEnergyScanActionController(VESPERSEnergyScanConfiguration *configuration, QObject *parent) : AMStepScanActionController(configuration, parent), VESPERSScanController(configuration) { configuration_ = configuration; scan_ = new AMXASScan(); scan_->setName(configuration_->name()); scan_->setScanConfiguration(configuration_); scan_->setFileFormat("amCDFv1"); scan_->setIndexType("fileSystem"); scan_->setNotes(buildNotes()); scan_->rawData()->addScanAxis(AMAxisInfo("eV", 0, "Incident Energy", "eV")); useFeedback_ = true; originalEnergy_ = VESPERSBeamline::vespers()->mono()->energy(); AMControlInfoList list; list.append(VESPERSBeamline::vespers()->energy()->toInfo()); configuration_->setAxisControlInfos(list); AMDetectorInfoSet detectors; detectors.addDetectorInfo(VESPERSBeamline::vespers()->exposedDetectorByName("SplitIonChamber")->toInfo()); detectors.addDetectorInfo(VESPERSBeamline::vespers()->exposedDetectorByName("PreKBIonChamber")->toInfo()); detectors.addDetectorInfo(VESPERSBeamline::vespers()->exposedDetectorByName("MiniIonChamber")->toInfo()); detectors.addDetectorInfo(VESPERSBeamline::vespers()->exposedDetectorByName("PostIonChamber")->toInfo()); detectors.addDetectorInfo(VESPERSBeamline::vespers()->exposedDetectorByName("EnergySetpoint")->toInfo()); detectors.addDetectorInfo(VESPERSBeamline::vespers()->exposedDetectorByName("MasterDwellTime")->toInfo()); detectors.addDetectorInfo(VESPERSBeamline::vespers()->exposedDetectorByName("RingCurrent")->toInfo()); VESPERS::CCDDetectors ccdDetector = configuration_->ccdDetector(); if (ccdDetector.testFlag(VESPERS::Roper)) detectors.addDetectorInfo(VESPERSBeamline::vespers()->exposedDetectorByName("RoperFileNumber")->toInfo()); if (ccdDetector.testFlag(VESPERS::Mar)) detectors.addDetectorInfo(VESPERSBeamline::vespers()->exposedDetectorByName("MarFileNumber")->toInfo()); if (ccdDetector.testFlag(VESPERS::Pilatus)) detectors.addDetectorInfo(VESPERSBeamline::vespers()->exposedDetectorByName("PilatusFileNumber")->toInfo()); configuration_->setDetectorConfigurations(detectors); secondsElapsed_ = 0; secondsTotal_ = configuration_->totalTime(); elapsedTime_.setInterval(1000); connect(this, SIGNAL(started()), &elapsedTime_, SLOT(start())); connect(this, SIGNAL(cancelled()), &elapsedTime_, SLOT(stop())); connect(this, SIGNAL(paused()), &elapsedTime_, SLOT(stop())); connect(this, SIGNAL(resumed()), &elapsedTime_, SLOT(start())); connect(this, SIGNAL(failed()), &elapsedTime_, SLOT(stop())); connect(this, SIGNAL(finished()), &elapsedTime_, SLOT(stop())); connect(&elapsedTime_, SIGNAL(timeout()), this, SLOT(onScanTimerUpdate())); }
AMControlInfoList REIXSXESCalibration::computeSpectrometerPosition(int gratingIndex, double eV, double focusOffsetMm, double tiltOffsetDeg) const { qDebug() << "Spectrometer Geometry calculations for: " << gratingNames().at(gratingIndex) << eV << "eV," << focusOffsetMm << "mm defocus," << tiltOffsetDeg << "deg tilt offset:"; AMControlInfoList rv; double hexU = hexapodU(gratingIndex); QVector3D hexXYZ = hexapodXYZ(gratingIndex); QVector3D hexRST = hexapodRST(gratingIndex); QVector3D detPos = detectorPos(eV, gratingIndex); double theta = spectrometerTheta(detPos); double translation = detectorTranslation(detPos, theta, focusOffsetMm); double spectrometerRotation = spectrometerRotationDrive(theta); double tilt = tiltStageDrive(eV, gratingIndex, theta, tiltOffsetDeg); rv.append(AMControlInfo("spectrometerRotationDrive", spectrometerRotation, 0,0, "mm", 0.1, "Linear drive motor for spectrometer angle")); rv.append(AMControlInfo("detectorTranslation", translation, 0,0, "mm", 0.1, "Detector translation")); rv.append(AMControlInfo("detectorTiltDrive", tilt, 0.0, 0.0, "mm", 0.1, "Linear drive motor for detector tilt")); rv.append(AMControlInfo("hexapodX", hexXYZ.x(), 0, 0, "mm", 0.1, "Hexapod X position")); rv.append(AMControlInfo("hexapodY", hexXYZ.y(), 0, 0, "mm", 0.1, "Hexapod Y position")); rv.append(AMControlInfo("hexapodZ", hexXYZ.z(), 0, 0, "mm", 0.1, "Hexapod Z position")); rv.append(AMControlInfo("hexapodU", hexU, 0,0, "deg", 0.1, "Hexapod Tilt around X axis")); rv.append(AMControlInfo("hexapodR", hexRST.x(), 0,0, "mm", 0.1, "Hexapod rotation point R")); rv.append(AMControlInfo("hexapodS", hexRST.y(), 0,0, "mm", 0.1, "Hexapod rotation point S")); rv.append(AMControlInfo("hexapodT", hexRST.z(), 0,0, "mm", 0.1, "Hexapod rotation point T")); qDebug() << " Alpha required for rowland condition (deg):" << r2d(alpha(gratingIndex)); qDebug() << " Beta using that alpha, at " << eV << "eV:" << r2d(beta(eV, gratingIndex)); qDebug() << " Angle of slit-origin ray above y axis (deg)" << r2d(sTheta(gratingIndex)); qDebug() << " Grating tilt to achieve required alpha (deg):" << hexU; qDebug() << " r (mm):" << r(gratingIndex); qDebug() << " r-prime (mm):" << rPrime(eV, gratingIndex); qDebug() << " Spectrometer dTheta: angle up from y axis to center of detector (deg):" << r2d(dTheta(eV, gratingIndex)); qDebug() << " Detector position:" << detPos; qDebug() << " Spectrometer theta: (deg)" << r2d(theta); qDebug() << " Translation: (mm)" << translation; qDebug() << " Spectrometer rotation stage translation: (mm)" << spectrometerRotation; qDebug() << " Detector tilt phi (detector angle down to positive y axis) (deg):" << r2d(detectorPhi(eV, gratingIndex)); qDebug() << " Extra tilt on top of spectrometer angle" << r2d(detectorPhi(eV, gratingIndex) - theta); qDebug() << " Tilt stage translation: (mm)" << tilt; return rv; }
REIXSSampleMoveActionInfo::REIXSSampleMoveActionInfo(const AMControlInfoList &targetPosition, QObject *parent) : AMActionInfo("REIXS Sample Move", "REIXS Sample Move", ":/32x32/gnome-display-properties.png", parent) { x_ = 0; y_ = 0; z_ = 0; theta_ = 45; samplePlateId_ = 0; sampleIndex_ = 0; int index; if((index = targetPosition.indexOf("sampleX")) != -1) x_ = targetPosition.at(index).value(); if((index = targetPosition.indexOf("sampleY")) != -1) y_ = targetPosition.at(index).value(); if((index = targetPosition.indexOf("sampleZ")) != -1) z_ = targetPosition.at(index).value(); if((index = targetPosition.indexOf("sampleTheta")) != -1) theta_ = targetPosition.at(index).value(); updateDescriptions(); }