Unverified Commit d6d172dc authored by Zhou, Wenduo's avatar Zhou, Wenduo Committed by GitHub
Browse files

Merge pull request #32408 from mantidproject/ed68_live_starttime

Closed and merged because companion PR https://github.com/mantidproject/mantid/pull/32485 has been closed. 
parents 10170538 f8b3493e
......@@ -10,5 +10,7 @@ New and Improved
Bugfixes
--------
- Fixed arbitrary values not being accepted as the "Start Time" in StartLiveDataDialog.
:ref:`Release 6.3.0 <v6.3.0>`
\ No newline at end of file
:ref:`Release 6.3.0 <v6.3.0>`
......@@ -38,7 +38,7 @@ private slots:
void setDefaultAccumulationMethod(const QString & /*listener*/);
void updateUiElements(const QString & /*inst*/);
void accept() override;
void initListenerPropLayout(const QString & /*listener*/);
void initListenerPropLayout();
void updateConnectionChoices(const QString &inst_name);
void updateConnectionDetails(const QString &connection);
......
......@@ -185,7 +185,7 @@ void StartLiveDataDialog::initLayout() {
updateConnectionChoices(ui.cmbInstrument->currentText());
updateConnectionDetails(ui.cmbConnection->currentText());
setDefaultAccumulationMethod(ui.cmbConnListener->currentText());
initListenerPropLayout(ui.cmbConnListener->currentText());
initListenerPropLayout();
//=========== SLOTS =============
connect(ui.processingAlgo, SIGNAL(changedAlgorithm()), this, SLOT(changeProcessingAlgorithm()));
......@@ -378,17 +378,22 @@ void StartLiveDataDialog::updateUiElements(const QString &inst) {
void StartLiveDataDialog::accept() {
// Now manually set the StartTime property as there's a computation needed
DateAndTime startTime = DateAndTime::getCurrentTime() - ui.dateTimeEdit->value() * 60.0;
m_algorithm->setPropertyValue("StartTime", startTime.toISO8601String());
std::string starttime = startTime.toISO8601String();
// Store the value to property value map: property value can be only set from the map to m_algorithm
// as the last step before executing
QString propertyname = QString::fromStdString("StartTime");
QString propertyvalue = QString::fromStdString(starttime);
this->storePropertyValue(propertyname, propertyvalue);
// Call base class
AlgorithmDialog::accept(); // accept executes the algorithm
}
/**
* Update the Listener Properties group box for the current LiveListener.
*
* @param listener Name of the LiveListener class that is selected
*/
void StartLiveDataDialog::initListenerPropLayout(const QString &listener) {
void StartLiveDataDialog::initListenerPropLayout() {
// remove previous listener's properties
auto props = m_algorithm->getPropertiesInGroup("ListenerProperties");
for (auto &prop : props) {
......@@ -400,8 +405,6 @@ void StartLiveDataDialog::initListenerPropLayout(const QString &listener) {
// update algorithm's properties
if (ui.cmbInstrument->currentText().toStdString() != "") {
m_algorithm->setPropertyValue("Instrument", ui.cmbInstrument->currentText().toStdString());
m_algorithm->setPropertyValue("Listener", listener.toStdString());
// create or clear the layout
QLayout *layout = ui.listenerProps->layout();
if (!layout) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment