Skip to content

Commit

Permalink
Finish the work on this ticket. Refs #6737.
Browse files Browse the repository at this point in the history
1. Throw an exception if user specifies the name of the output table workspace
same as input matrix workspace.
2. Change the property for output correction file to optional save.
  • Loading branch information
wdzhou committed Apr 17, 2013
1 parent e1aafdc commit 698627a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Code/Mantid/Framework/Algorithms/src/CreateLogTimeCorrection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ namespace Algorithms
auto outwsprop = new WorkspaceProperty<TableWorkspace>("Outputworkspace", "AnonymousOut", Direction::Output);
declareProperty(outwsprop, "Name of the output workspace containing the corrections.");

auto fileprop = new FileProperty("OutputFilename", "", FileProperty::Save);
auto fileprop = new FileProperty("OutputFilename", "", FileProperty::OptionalSave);
declareProperty(fileprop, "Name of the output time correction file.");

return;
}


//----------------------------------------------------------------------------------------------
/** Main execution body
*/
void CreateLogTimeCorrection::exec()
{
// 1. Process input
Expand All @@ -80,6 +82,16 @@ namespace Algorithms
throw runtime_error(errss.str());
}

// Check whether the output workspace name is same as input
string outwsname = getPropertyValue("OutputWorkspace");
if (outwsname.compare(m_dataWS->name()) == 0)
{
stringstream errmsg;
errmsg << "It is not allowed to use the same name by both input matrix workspace and output table workspace.";
g_log.error(errmsg.str());
throw runtime_error(errmsg.str());
}

// 2. Explore geometry
getInstrumentSetup();

Expand Down

0 comments on commit 698627a

Please sign in to comment.