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; }
AMInternalControlMoveAction::AMInternalControlMoveAction(AMControl *control, double setpoint, QObject *parent) : AMControlMoveAction(new AMControlMoveActionInfo( AMControlInfo(control ? control->name() : "internalControl", setpoint, control ? control->minimumValue() : 0, control ? control->maximumValue() : 0, control ? control->units() : "", control ? control->tolerance() : 0, control ? control->description() : "[Internal Use Only]")), parent) { internalControl_ = control; }