Skip to content

Commit

Permalink
Property name and GUI cleanups
Browse files Browse the repository at this point in the history
Changed the property name from EndRunBehavior to RunTransitionBehavior
which is now a better description.  Updated all the references to the
old behavor (including test and GUI code).  Also changed the label in
the StartLiveData dialog window.

Refs #7209
  • Loading branch information
rgmiller committed Apr 10, 2014
1 parent 476c32c commit 5622e3b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/LiveData/src/LiveDataAlgorithm.cpp
Expand Up @@ -103,9 +103,9 @@ namespace LiveData
runOptions.push_back("Restart");
runOptions.push_back("Stop");
runOptions.push_back("Rename");
declareProperty("EndRunBehavior", "Restart", boost::make_shared<StringListValidator>(runOptions),
"What to do when a run ends?\n"
" - Restart: the accumulated data from the previous run is discarded.\n"
declareProperty("RunTransitionBehavior", "Restart", boost::make_shared<StringListValidator>(runOptions),
"What to do at run start/end boundaries?\n"
" - Restart: the previously accumulated data is discarded.\n"
" - Stop: live data monitoring ends.\n"
" - Rename: the previous workspaces are renamed, and monitoring continues with cleared ones.");

Expand Down
10 changes: 5 additions & 5 deletions Code/Mantid/Framework/LiveData/src/MonitorLiveData.cpp
Expand Up @@ -199,18 +199,18 @@ namespace LiveData
message << "Run";
if ( runNumber != 0 ) message << " #" << runNumber;
message << " ended. ";
std::string EndRunBehavior = this->getPropertyValue("EndRunBehavior");
if (EndRunBehavior == "Stop")
std::string RunTransitionBehavior = this->getPropertyValue("RunTransitionBehavior");
if (RunTransitionBehavior == "Stop")
{
g_log.notice() << message.str() << "Stopping live data monitoring.\n";
break;
}
else if (EndRunBehavior == "Restart")
else if (RunTransitionBehavior == "Restart")
{
g_log.notice() << message.str() << "Clearing existing workspace.\n";
NextAccumulationMethod = "Replace";
}
else if (EndRunBehavior == "Rename")
else if (RunTransitionBehavior == "Rename")
{
g_log.notice() << message.str() << "Renaming existing workspace.\n";
NextAccumulationMethod = "Replace";
Expand Down Expand Up @@ -250,7 +250,7 @@ namespace LiveData
g_log.warning() << "Cannot process live data as quickly as requested: requested every " << UpdateEvery << " seconds but it takes " << seconds << " seconds!" << std::endl;
} // loop until aborted

// Set the outputs (only applicable when EndRunBehavior is "Stop")
// Set the outputs (only applicable when RunTransitionBehavior is "Stop")
Workspace_sptr OutputWS = AnalysisDataService::Instance().retrieveWS<Workspace>(OutputWorkspace);
this->setProperty("OutputWorkspace", OutputWS);
if (!AccumulationWorkspace.empty())
Expand Down
16 changes: 8 additions & 8 deletions Code/Mantid/Framework/LiveData/test/MonitorLiveDataTest.h
Expand Up @@ -60,15 +60,15 @@ class MonitorLiveDataTest : public CxxTest::TestSuite
/** Create but don't start a MonitorLiveData thread */
boost::shared_ptr<MonitorLiveData> makeAlgo(std::string output, std::string accumWS="",
std::string AccumulationMethod="Replace",
std::string EndRunBehavior="Restart", std::string UpdateEvery="1")
std::string RunTransitionBehavior="Restart", std::string UpdateEvery="1")
{
auto alg = boost::dynamic_pointer_cast<MonitorLiveData>(AlgorithmManager::Instance().create("MonitorLiveData", -1, false));
alg->setPropertyValue("Instrument", "TestDataListener");
alg->setPropertyValue("UpdateEvery", UpdateEvery);
alg->setPropertyValue("AccumulationMethod", AccumulationMethod);
alg->setPropertyValue("AccumulationWorkspace", accumWS);
alg->setProperty("PreserveEvents", true);
alg->setPropertyValue("EndRunBehavior", EndRunBehavior);
alg->setPropertyValue("RunTransitionBehavior", RunTransitionBehavior);
alg->setPropertyValue("OutputWorkspace", output);
return alg;
}
Expand Down Expand Up @@ -131,8 +131,8 @@ class MonitorLiveDataTest : public CxxTest::TestSuite


//--------------------------------------------------------------------------------------------
/** Stop live data if EndRunBehavior="Stop" */
void test_EndRunBehavior_Stop()
/** Stop live data if RunTransitionBehavior="Stop" */
void test_RunTransitionBehavior_Stop()
{
// Will reset after the 2nd call to extract data
ConfigService::Instance().setString("testdatalistener.m_changeStatusAfter", "3");
Expand Down Expand Up @@ -170,8 +170,8 @@ class MonitorLiveDataTest : public CxxTest::TestSuite
}

//--------------------------------------------------------------------------------------------
/** Clear the accumulated data when a run ends if EndRunBehavior="Restart" */
void test_EndRunBehavior_Restart()
/** Clear the accumulated data when a run ends if RunTransitionBehavior="Restart" */
void test_RunTransitionBehavior_Restart()
{
// Will reset after the 2nd call to extract data
ConfigService::Instance().setString("testdatalistener.m_changeStatusAfter", "4");
Expand All @@ -194,8 +194,8 @@ class MonitorLiveDataTest : public CxxTest::TestSuite


//--------------------------------------------------------------------------------------------
/** Keep the old accumulated data when a run ends if EndRunBehavior="Rename" */
void test_EndRunBehavior_Rename()
/** Keep the old accumulated data when a run ends if RunTransitionBehavior="Rename" */
void test_RunTransitionBehavior_Rename()
{
// Will reset after the 2nd call to extract data
ConfigService::Instance().setString("testdatalistener.m_changeStatusAfter", "4");
Expand Down
Expand Up @@ -433,14 +433,14 @@ QGroupBox::title { background-color: transparent; subcontrol-position: top cent
</spacer>
</item>
<item>
<widget class="QLabel" name="lblEndRunBehavior">
<widget class="QLabel" name="lblRunTransitionBehavior">
<property name="text">
<string>At End of Run:</string>
<string>At Run Transition:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cmbEndRunBehavior"/>
<widget class="QComboBox" name="cmbRunTransitionBehavior"/>
</item>
<item>
<spacer name="horizontalSpacer_12">
Expand Down
Expand Up @@ -110,8 +110,8 @@ void StartLiveDataDialog::initLayout()
tie(ui.chkPreserveEvents, "PreserveEvents");
chkPreserveEventsToggled();

tie(ui.cmbEndRunBehavior, "EndRunBehavior");
fillAndSetComboBox("EndRunBehavior", ui.cmbEndRunBehavior);
tie(ui.cmbRunTransitionBehavior, "RunTransitionBehavior");
fillAndSetComboBox("RunTransitionBehavior", ui.cmbRunTransitionBehavior);

tie(ui.editAccumulationWorkspace, "AccumulationWorkspace", ui.gridLayout);
tie(ui.editOutputWorkspace, "OutputWorkspace", ui.gridLayout);
Expand Down

0 comments on commit 5622e3b

Please sign in to comment.