本文整理汇总了C++中AMListAction3类的典型用法代码示例。如果您正苦于以下问题:C++ AMListAction3类的具体用法?C++ AMListAction3怎么用?C++ AMListAction3使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AMListAction3类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AMListAction3
AMAction3* BioXASMirrorRollControl::createMoveAction(double setpoint)
{
AMAction3 *result = 0;
if (isConnected()) {
AMListAction3 *move = new AMListAction3(new AMListActionInfo3(name()+" move", name()+" move"), AMListAction3::Parallel);
double pitch = calculatePitch(upstreamInboard_->xPosition(), upstreamInboard_->yPosition(), upstreamInboard_->zPositionSetpoint(), upstreamOutboard_->xPosition(), upstreamOutboard_->yPosition(), upstreamOutboard_->zPositionSetpoint(), downstream_->xPosition(), downstream_->yPosition(), downstream_->zPositionSetpoint());
double height = calculateHeight(upstreamInboard_->xPosition(), upstreamInboard_->yPosition(), upstreamInboard_->zPositionSetpoint(), upstreamOutboard_->xPosition(), upstreamOutboard_->yPosition(), upstreamOutboard_->zPositionSetpoint(), downstream_->xPosition(), downstream_->yPosition(), downstream_->zPositionSetpoint());
double upstreamInboardDestination = calculateUpstreamInboardPosition(upstreamInboard_->xPosition(), upstreamInboard_->yPosition(), pitch, setpoint, height);
move->addSubAction(AMActionSupport::buildControlMoveAction(upstreamInboard_, upstreamInboardDestination));
double upstreamOutboardDestination = calculateUpstreamOutboardPosition(upstreamOutboard_->xPosition(), upstreamOutboard_->yPosition(), pitch, setpoint, height);
move->addSubAction(AMActionSupport::buildControlMoveAction(upstreamOutboard_, upstreamOutboardDestination));
double downstreamDestination = calculateDownstreamPosition(downstream_->xPosition(), downstream_->yPosition(), pitch, setpoint, height);
move->addSubAction(AMActionSupport::buildControlMoveAction(downstream_, downstreamDestination));
result = move;
}
return result;
}
示例2: createCleanupActions
AMAction3* VESPERSEnergyScanActionController::createCleanupActions()
{
AMListAction3 *cleanupAction = qobject_cast<AMListAction3 *>(buildCleanupAction());
cleanupAction->addSubAction(VESPERSBeamline::vespers()->mono()->createEaAction(originalEnergy_));
return cleanupAction;}
示例3: AMListAction3
AMAction3 * SGMGratingAngleControl::createMoveAction(double setpoint)
{
AMListAction3* moveAction = new AMListAction3(new AMListActionInfo3("Moving Grating Angle",
"Moving Grating Angle"),
AMListAction3::Sequential);
if(isClosedLoop()) {
moveAction->addSubAction(AMActionSupport::buildControlMoveAction(encoderControl_, setpoint));
} else {
// Get distance to move in terms of the encoder
double deltaDistanceEncoder = setpoint - value();
// Convert into steps
double deltaDistanceSteps = deltaDistanceEncoder * stepsPerEncoderCount();
// Get current step position
double currentStepPosition = stepMotorControl_->value();
// Get the setpoint in terms of steps
double stepSetpoint = currentStepPosition + deltaDistanceSteps;
// Up our tolerance
moveAction->addSubAction(new AMChangeToleranceAction(new AMChangeToleranceActionInfo(toInfo(), 400),this));
// Do the move
moveAction->addSubAction(AMActionSupport::buildControlMoveAction(stepMotorControl_, stepSetpoint));
}
return moveAction;
}
示例4: AMListAction3
AMAction3* SGMVATValveState::createMoveAction(double indexSetpoint)
{
AMListAction3 *action = new AMListAction3(new AMListActionInfo3("Moving leak valve", "Moving leak valve"), AMListAction3::Sequential);
AMAction3 *updateSpeed = 0;
// If the valve is opening, always want to move at the min speed.
if (int(indexSetpoint) == Open)
updateSpeed = AMActionSupport::buildControlMoveAction(speed_, SGMVATVALVE_SPEED_MIN);
else
updateSpeed = AMActionSupport::buildControlMoveAction(speed_, SGMVATVALVE_SPEED_MAX);
// Add modifying the speed to the list of actions.
action->addSubAction(updateSpeed);
// Add the valve position change.
action->addSubAction(AMSingleEnumeratedControl::createMoveAction(indexSetpoint));
// Return the action.
return action;
}
示例5: if
void AMAppController::updateScanEditorModelItem()
{
// Get the action, or if it's in a list, the current running action.
AMAction3 *currentAction = AMActionRunner3::workflow()->currentAction();
AMScanAction *action = 0;
if (currentAction && !currentAction->hasChildren())
action = qobject_cast<AMScanAction *>(currentAction);
else if (currentAction && currentAction->hasChildren()){
AMListAction3 *listAction = qobject_cast<AMListAction3 *>(currentAction);
if (listAction)
action = qobject_cast<AMScanAction *>(listAction->currentSubAction());
}
// Do something with it if the action is valid.
if (action && (action->state() == AMAction3::Running || action->inFinalState())){
AMGenericScanEditor *editor = editorFromScan(action->controller()->scan());
if (!editor)
return;
QString stateString;
switch(action->state()){
case AMAction3::Running:
stateString = "running";
break;
case AMAction3::Succeeded:
stateString = "succeeded";
break;
case AMAction3::Failed:
stateString = "failed";
break;
case AMAction3::Cancelled:
stateString = "cancelled";
break;
default:
stateString = "default";
break;
}
AMScanEditorModelItem *item = (AMScanEditorModelItem *)(mw_->windowPaneModel()->itemFromIndex(mw_->windowPaneModel()->indexForPane(editor)));
if (item)
item->scanActionStateChanged(stateString, editor == mw_->currentPane());
}
}
示例6: Q_UNUSED
AMAction3* IDEASBeamline::createScanCleanupAction(AMScanConfiguration *configuration)
{
Q_UNUSED(configuration)
AMListAction3 *cleanupActions = new AMListAction3(new AMListActionInfo3("IDEAS XAS Cleanup Actions", "IDEAS XAS Cleanup Actions"));
cleanupActions->addSubAction(IDEASBeamline::ideas()->scaler()->createDwellTimeAction3(0.25));
cleanupActions->addSubAction(IDEASBeamline::ideas()->scaler()->createContinuousEnableAction3(true));
return cleanupActions;
}
示例7: AMListAction3
AMAction3* AMScanActionControllerScanAssembler::generateActionTreeForStepAxis(AMControl *axisControl, AMScanAxis *stepScanAxis){
AMListAction3 *axisActions = new AMListAction3(new AMListActionInfo3(QString("Axis %1").arg(axisControl->name()), QString("Axis %1").arg(axisControl->name())), AMListAction3::Sequential);
// generate axis initialization list
AMListAction3 *initializationActions = new AMListAction3(new AMListActionInfo3(QString("Initializing %1").arg(axisControl->name()), QString("Initializing Axis with Control %1").arg(axisControl->name())), AMListAction3::Sequential);
AMControlInfo initializeControlPositionSetpoint = axisControl->toInfo();
initializeControlPositionSetpoint.setValue(stepScanAxis->axisStart());
AMControlMoveAction3 *initializeControlPosition = new AMControlMoveAction3(new AMControlMoveActionInfo3(initializeControlPositionSetpoint), axisControl);
initializeControlPosition->setGenerateScanActionMessage(true);
initializationActions->addSubAction(initializeControlPosition);
AMListAction3 *allRegionsList = new AMListAction3(new AMListActionInfo3(QString("%1 Regions for %2 Axis").arg(stepScanAxis->regionCount()).arg(axisControl->name()), QString("%1 Regions for %2 Axis").arg(stepScanAxis->regionCount()).arg(axisControl->name())), AMListAction3::Sequential);
for(int x = 0; x < stepScanAxis->regionCount(); x++)
allRegionsList->addSubAction(generateActionTreeForStepAxisRegion(axisControl, stepScanAxis->regionAt(x), (x == stepScanAxis->regionCount()-1) ));
// generate axis cleanup list
AMListAction3 *cleanupActions = new AMListAction3(new AMListActionInfo3(QString("Cleaning Up %1").arg(axisControl->name()), QString("Cleaning Up Axis with Control %1").arg(axisControl->name())), AMListAction3::Sequential);
AMAxisStartedAction *axisStartAction = new AMAxisStartedAction(new AMAxisStartedActionInfo(QString("%1 Axis").arg(axisControl->name()), AMScanAxis::StepAxis));
AMAxisFinishedAction *axisFinishAction = new AMAxisFinishedAction(new AMAxisFinishedActionInfo(QString("%1 Axis").arg(axisControl->name())));
axisActions->addSubAction(axisStartAction);
axisActions->addSubAction(initializationActions);
axisActions->addSubAction(allRegionsList);
axisActions->addSubAction(cleanupActions);
axisActions->addSubAction(axisFinishAction);
return axisActions;
}
示例8: AMListAction3
AMAction3 * SGMUndulatorControl::createMoveAction(double setpoint)
{
AMListAction3* moveAction = new AMListAction3(new AMListActionInfo3("Moving Undulator",
"Moving Undulator"),
AMListAction3::Sequential);
moveAction->addSubAction(AMActionSupport::buildControlMoveAction(encoderControl_,
setpoint));
return moveAction;
}
示例9: findActionsOfType
QList<AMAction3*> findActionsOfType(AMAction3 *rootAction, AMAction3 *typeAction){
QList<AMAction3*> retVal;
AMListAction3 *castToListAction = qobject_cast<AMListAction3*>(rootAction);
if(castToListAction){
for(int x = 0; x < castToListAction->subActionCount(); x++){
if(typeAction->metaObject()->className() == castToListAction->subActionAt(x)->metaObject()->className())
retVal.append(castToListAction->subActionAt(x));
retVal.append((findActionsOfType(castToListAction->subActionAt(x), typeAction)));
}
}
return retVal;
}
示例10: AMListAction3
AMAction3* BioXASCarbonFilterFarmActuatorPositionControl::createMoveAction(double setpoint)
{
AMListAction3 *action = new AMListAction3(new AMListActionInfo3("Move BioXAS Carbon Filter Farm Actuator", "Move BioXAS Carbon Filter Farm Actuator"), AMListAction3::Sequential);
AMAction3 *move = AMActionSupport::buildControlMoveAction(position_, setpoint);
action->addSubAction(move);
AMAction3 *check = AMActionSupport::buildControlWaitAction(status_, InPosition, TIMEOUT_MOVE);
action->addSubAction(check);
return action;
}
示例11: AMListAction3
AMAction3 *CLSMAXvMotor::createCalibrationAction(double oldPosition, double newPosition)
{
AMAction3 *result = 0;
if (isConnected()) {
AMListAction3 *calibrationAction = new AMListAction3(new AMListActionInfo3("Motor calibration", "Motor calibration"), AMListAction3::Sequential);
calibrationAction->addSubAction(AMActionSupport::buildControlMoveAction(this, oldPosition));
calibrationAction->addSubAction(AMActionSupport::buildControlMoveAction(EGUSetPosition_, newPosition));
result = calibrationAction;
}
return result;
}
示例12: AMListAction3
AMAction3 * AM3DCoordinatedSystemControl::createMoveAction(double setpoint)
{
AMListAction3* action = 0;
if(globalXAxis_ && globalYAxis_ && globalZAxis_) {
action = new AMListAction3(new AMListActionInfo3(QString("Moving %1").arg(name()),
QString("Moving %1 from %2 to %3")
.arg(value()).arg(setpoint)),
AMListAction3::Sequential);
AMListAction3* moveActions = new AMListAction3(new AMListActionInfo3(QString("Moving %1").arg(name()),
QString("Moving %1").arg(name())),
AMListAction3::Parallel);
// Grab the current global positions:
QVector3D currentGlobalSetpoints(globalXAxis_->setpoint(), globalYAxis_->setpoint(), globalZAxis_->setpoint());
// Transform it to our system:
QVector3D primeSetpoint = globalAxisToPrime(currentGlobalSetpoints);
// Set the value in terms of our system based on the axis we are:
switch(axis_) {
case XAxis:
primeSetpoint.setX(setpoint);
break;
case YAxis:
primeSetpoint.setY(setpoint);
break;
case ZAxis:
primeSetpoint.setZ(setpoint);
}
// Transform back the the global system:
QVector3D newGlobalSetpoints = primeAxisToGlobal(primeSetpoint);
// Create the required move actions in the global system:
moveActions->addSubAction(AMActionSupport::buildControlMoveAction(globalXAxis_, newGlobalSetpoints.x()));
moveActions->addSubAction(AMActionSupport::buildControlMoveAction(globalYAxis_, newGlobalSetpoints.y()));
moveActions->addSubAction(AMActionSupport::buildControlMoveAction(globalZAxis_, newGlobalSetpoints.z()));
action->addSubAction(moveActions);
}
return action;
}
示例13: AMListAction3
AMAction3* IDEASBeamline::createScanInitializationAction(AMScanConfiguration *configuration)
{
AMAction3 *result = 0;
AMStepScanConfiguration *stepScanConfiguration = qobject_cast<AMStepScanConfiguration*>(configuration);
if (stepScanConfiguration) {
AMListAction3 *initializationActions = new AMListAction3(new AMListActionInfo3("IDEAS XAS Initialization Stage 1", "IDEAS XAS Initialization Stage 1"), AMListAction3::Parallel);
initializationActions->addSubAction(AMBeamline::createInitializeScanAxisControlsAction(stepScanConfiguration));
initializationActions->addSubAction(IDEASBeamline::ideas()->scaler()->createContinuousEnableAction3(false));
initializationActions->addSubAction(IDEASBeamline::ideas()->scaler()->createDwellTimeAction3(stepScanConfiguration->scanAxisAt(0)->regionAt(0)->regionTime()));
result = initializationActions;
}
return result;
}
示例14: AMListAction3
CLSSIS3820ScalerDarkCurrentMeasurementAction::CLSSIS3820ScalerDarkCurrentMeasurementAction(CLSSIS3820ScalerDarkCurrentMeasurementActionInfo *info, QObject *parent) :
AMListAction3(info, AMListAction3::Sequential, parent)
{
CLSSIS3820Scaler *scaler = CLSBeamline::clsBeamline()->scaler();
double secondsDwell = scalerDarkCurrentMeasurementActionInfo()->dwellTime();
connect( this, SIGNAL(failed()), this, SLOT(onActionFailed()) );
if (scaler && scaler->isConnected() && secondsDwell > 0) {
// pre-measurement settings.
double oldDwell = scaler->dwellTime();
// first turn off beam.
// addSubAction(AMBeamline::bl()->createTurnOffBeamActions());
// set the scaler's dwell time to new time.
addSubAction(scaler->createDwellTimeAction3(secondsDwell));
// initiate a scaler measurement and wait until it is complete.
addSubAction(scaler->createStartAction3(true));
addSubAction(scaler->createWaitForDwellFinishedAction(secondsDwell + 5.0));
// notify attached and able scaler channel detectors that the latest measurement was a dark current measurement.
AMListAction3 *notifyChannelDetectors = new AMListAction3(new AMListActionInfo3("Set last measurement as dark current measurement", "Set last measurement as dark current measurement"));
for (int i = 0; i < scaler->channels().count(); i++) {
CLSSIS3820ScalerChannel *channel = scaler->channelAt(i);
if (channel && channel->isEnabled() && channel->detector() && channel->detector()->canDoDarkCurrentCorrection()) {
notifyChannelDetectors->addSubAction(channel->detector()->createSetLastMeasurementAsDarkCurrentAction());
}
}
addSubAction(notifyChannelDetectors);
// reset settings to pre-measurement conditions.
addSubAction(scaler->createDwellTimeAction3(oldDwell));
} else {
AMErrorMon::alert(this, CLSSIS3820SCALERDARKCURRENTMEASUREMENTACTION_SCALER_NOT_VALID, "Failed to complete dark current measurement--scaler not valid.");
setFailed();
}
}
示例15: AMAction3
// Copy constructor. Takes care of making copies of the sub-actions
AMListAction3::AMListAction3(const AMListAction3& other)
: AMAction3(other)
{
currentSubActionIndex_ = -1; // prior to running an subactions
subActionMode_ = other.subActionMode_;
if(subActionMode_ == AMListAction3::Parallel)
AMAction3::info()->setIconFileName(":/32x32/format-line-spacing-triple.png");
logSubActionsSeparately_ = other.shouldLogSubActionsSeparately();
logActionId_ = other.logActionId();
skipAfterCurrentAction_ = false;
loggingDatabase_ = other.loggingDatabase();
if (subActionMode_ == Sequential)
skipOptions_.append("After current action");
foreach(AMAction3* action, other.subActions_)
subActions_ << action->createCopy();
foreach(AMAction3* action, subActions_)
action->setParentAction(this);
}