AMActionRunnerAddActionBar3::AMActionRunnerAddActionBar3(const QString& actionCategoryName, bool enableRepeatScans, QWidget *parent) :
	QWidget(parent)
{
	actionCategoryName_ = actionCategoryName;
	repeatScansEnabled_ = enableRepeatScans;
	estimatedTimeOfSingleScan_ = 0;

	overallScanTime_ = new QLabel("Estimated scan time: 0s");

	iterationsBox_ = new QSpinBox;
	iterationsBox_->setRange(1, 1000000);
	iterationsBox_->setPrefix("#: ");
	iterationsBox_->setAlignment(Qt::AlignCenter);
	iterationsBox_->setValue(1);

	startActionButton_ = new QPushButton("Start " % actionCategoryName_);
	addToQueueButton_ = new QPushButton("Add to Workflow");

	whenDoneLabel_ = new QLabel("When done here:");
	goToWorkflowOption_ = new QRadioButton("Show the workflow");
	setupAnotherActionOption_ = new QRadioButton("Setup another " % actionCategoryName_);

	QButtonGroup* bg = new QButtonGroup(this);
	bg->addButton(goToWorkflowOption_, 0);
	bg->addButton(setupAnotherActionOption_, 1);
	goToWorkflowOption_->setChecked(true);

	layout_ = new QVBoxLayout();

	QHBoxLayout* optionsHL = new QHBoxLayout();
	optionsHL->addWidget(whenDoneLabel_);
	optionsHL->addWidget(goToWorkflowOption_);
	optionsHL->addWidget(setupAnotherActionOption_);
	optionsHL->addStretch();

	if (repeatScansEnabled_) {
		optionsHL->addWidget(overallScanTime_);
		optionsHL->addWidget(new QLabel("<b>Iterations:</b>"));
		optionsHL->addWidget(iterationsBox_);
	}
	optionsHL->addWidget(addToQueueButton_);
	optionsHL->addWidget(startActionButton_);
	optionsHL->setContentsMargins(10, 0, 10, 20);

	layout_->addLayout(optionsHL);
	layout_->setContentsMargins(0,0,0,0);

	setLayout(layout_);

	connect(startActionButton_, SIGNAL(clicked()), this, SLOT(onStartActionRequested()));
	connect(addToQueueButton_, SIGNAL(clicked()), this, SLOT(onAddToQueueRequested()));
	connect(iterationsBox_, SIGNAL(valueChanged(int)), this, SLOT(onScanIterationsValueChange()));

	connect(AMActionRunner3::workflow(), SIGNAL(currentActionChanged(AMAction3*)), this, SLOT(reviewStartActionButtonState()));

	reviewStartActionButtonState();
}
Example #2
0
AMActionRunnerAddActionBar::AMActionRunnerAddActionBar(const QString& actionCategoryName, QWidget *parent) :
	QWidget(parent)
{
	actionCategoryName_ = actionCategoryName;

	startActionButton_ = new QPushButton("Start " % actionCategoryName_);
	addToQueueButton_ = new QPushButton("Add to Workflow");

	whenDoneLabel_ = new QLabel("When done here:");
	goToWorkflowOption_ = new QRadioButton("Show the workflow");
	setupAnotherActionOption_ = new QRadioButton("Setup another " % actionCategoryName_);

	QButtonGroup* bg = new QButtonGroup(this);
	bg->addButton(goToWorkflowOption_, 0);
	bg->addButton(setupAnotherActionOption_, 1);
	goToWorkflowOption_->setChecked(true);

	layout_ = new QVBoxLayout();

	QHBoxLayout* optionsHL = new QHBoxLayout();
	optionsHL->addWidget(whenDoneLabel_);
	optionsHL->addWidget(goToWorkflowOption_);
	optionsHL->addWidget(setupAnotherActionOption_);
	optionsHL->addStretch();
	optionsHL->addWidget(addToQueueButton_);
	optionsHL->addWidget(startActionButton_);
	optionsHL->setContentsMargins(10, 0, 10, 20);

	layout_->addLayout(optionsHL);
	layout_->setContentsMargins(0,0,0,0);

	setLayout(layout_);

	connect(startActionButton_, SIGNAL(clicked()), this, SLOT(onStartActionRequested()));
	connect(addToQueueButton_, SIGNAL(clicked()), this, SLOT(onAddToQueueRequested()));

	connect(AMActionRunner::s(), SIGNAL(currentActionChanged(AMAction*)), this, SLOT(reviewStartActionButtonState()));

	reviewStartActionButtonState();
}
Example #3
0
AMScanConfigurationViewHolder::AMScanConfigurationViewHolder(AMWorkflowManagerView* workflow, AMScanConfigurationView* view, QWidget *parent) :
	QWidget(parent)
{
	view_ = view;
	workflow_ = workflow;

	/*
	testExemplar_.setName("");
	testExemplar_.setDateTime(QDateTime::currentDateTime());
	testExemplar_.setRunName("SGM");
	testExemplar_.setRunStartDateTime(QDateTime::currentDateTime());
	testExemplar_.setRunEndDateTime(QDateTime::currentDateTime());
	testExemplar_.setFacilityName("SGM");
	testExemplar_.setFacilityDescription("CLS SGM Beamline");
	if(view_ && view_->configuration())
		testExemplar_.setScanConfiguration(view->configuration());
	testExemplar_.setSampleName("Eu Doped ZnO");
	testExemplar_.setSampleElements("Eu Zn O");
	testExemplar_.setSampleDateTime(QDateTime::currentDateTime());
	exemplarNameDictionary_ = new AMScanExemplarDictionary(&testExemplar_, this);
	exemplarNameDictionary_->setOperatingOnName(true);
	exemplarExportNameDictionary_ = new AMScanExemplarDictionary(&testExemplar_, this);
	exemplarExportNameDictionary_->setOperatingOnExportName(true);


	scanNameLabel_ = new QLabel("Scan Name:");
	scanNameExampleLabel_ = new QLabel("   ex,, ");
	scanNameDictionaryLineEdit_ = new AMDictionaryLineEdit(exemplarNameDictionary_, scanNameExampleLabel_);

	autoExportLabel_ = new QLabel("---->");
	doExportNameCheckBox_ = new QCheckBox("Set Name");
	doAutoExportCheckBox_ = new QCheckBox("Auto Export");

	exportNameLabel_ = new QLabel("Export Name:");
	exportNameExampleLabel_ = new QLabel("   ex,, ");
	exportNameDictionaryLineEdit_ = new AMDictionaryLineEdit(exemplarExportNameDictionary_, exportNameExampleLabel_);

	doExportNameCheckBox_->setChecked(false);
	doAutoExportCheckBox_->setChecked(true);
	exportNameLabel_->setEnabled(false);
	exportNameDictionaryLineEdit_->setEnabled(false);
	*/

	whenDoneLabel_ = new QLabel("When I'm done here:");

	startScanButton_ = new QPushButton("Start Scan");
	addToQueueButton_ = new QPushButton("Add to Workflow");

	goToWorkflowOption_ = new QRadioButton("Show me the workflow");
	setupAnotherScanOption_ = new QRadioButton("Setup another scan");

	QButtonGroup* bg = new QButtonGroup(this);
	bg->addButton(goToWorkflowOption_, 0);
	bg->addButton(setupAnotherScanOption_, 1);
	goToWorkflowOption_->setChecked(true);


	layout_ = new QVBoxLayout();
	if(view_)
		layout_->addWidget(view_);

	QHBoxLayout* optionsHL = new QHBoxLayout();
	optionsHL->addWidget(whenDoneLabel_);
	optionsHL->addWidget(goToWorkflowOption_);
	optionsHL->addWidget(setupAnotherScanOption_);
	optionsHL->addStretch();
	optionsHL->addWidget(addToQueueButton_);
	optionsHL->addWidget(startScanButton_);
	optionsHL->setContentsMargins(10, 0, 10, 20);

	layout_->addLayout(optionsHL);
	layout_->setContentsMargins(0,0,0,0);

	setLayout(layout_);

	connect(startScanButton_, SIGNAL(clicked()), this, SLOT(onStartScanRequested()));
	connect(addToQueueButton_, SIGNAL(clicked()), this, SLOT(onAddToQueueRequested()));

	connect(workflow_, SIGNAL(workflowStatusChanged(bool,bool,bool)), this, SLOT(reviewStartScanButtonState()));

	/*
	connect(doExportNameCheckBox_, SIGNAL(stateChanged(int)), this, SLOT(onDoExportNameCheckBoxStatedChanged(int)));
	*/

	reviewStartScanButtonState();
}