Skip to content
Snippets Groups Projects
Commit b56fbdce authored by Elliot Oram's avatar Elliot Oram
Browse files

Moved addition of logs from interface into algorithm

Refs #13649
parent 78f81e8e
No related branches found
No related tags found
No related merge requests found
...@@ -78,11 +78,21 @@ class ApplyPaalmanPingsCorrection(PythonAlgorithm): ...@@ -78,11 +78,21 @@ class ApplyPaalmanPingsCorrection(PythonAlgorithm):
# Use sample factor only # Use sample factor only
self._correct_sample() self._correct_sample()
correction_type = 'sample_corrections_only' correction_type = 'sample_corrections_only'
# Add corrections filename to log values
AddSampleLog(Workspace=self._output_ws_name,
LogName='corrections_filename',
LogType='String',
LogText=self._corrections_ws_name)
else: else:
# Do simple subtraction # Do simple subtraction
self._subtract() self._subtract()
correction_type = 'can_subtraction' correction_type = 'can_subtraction'
# Add container filename to log values
AddSampleLog(Workspace=self._output_ws_name,
LogName='container_filename',
LogType='String',
LogText=self._can_ws_name)
# Record the container scale factor # Record the container scale factor
if self._use_can and self._scale_can: if self._use_can and self._scale_can:
...@@ -97,6 +107,12 @@ class ApplyPaalmanPingsCorrection(PythonAlgorithm): ...@@ -97,6 +107,12 @@ class ApplyPaalmanPingsCorrection(PythonAlgorithm):
LogType='String', LogType='String',
LogText=correction_type) LogText=correction_type)
# Add original sample as log entry
AddSampleLog(Workspace=self._output_ws_name,
LogName='sample_filename',
LogType='String',
LogText=self._sample_ws_name)
self.setPropertyValue('OutputWorkspace', self._output_ws_name) self.setPropertyValue('OutputWorkspace', self._output_ws_name)
# Remove temporary workspaces # Remove temporary workspaces
......
...@@ -220,28 +220,6 @@ void ApplyPaalmanPings::absCorComplete(bool error) { ...@@ -220,28 +220,6 @@ void ApplyPaalmanPings::absCorComplete(bool error) {
if (save) if (save)
addSaveWorkspaceToQueue(QString::fromStdString(m_pythonExportWsName)); addSaveWorkspaceToQueue(QString::fromStdString(m_pythonExportWsName));
IAlgorithm_sptr addLogCorr =
AlgorithmManager::Instance().create("AddSampleLog");
addLogCorr->initialize();
addLogCorr->setProperty("Workspace", m_pythonExportWsName);
addLogCorr->setProperty("LogName", "correction_filename");
addLogCorr->setProperty(
"LogText", m_uiForm.dsCorrections->getCurrentDataName().toStdString());
addLogCorr->setProperty("LogType", "String");
m_batchAlgoRunner->addAlgorithm(addLogCorr);
IAlgorithm_sptr addLogSample =
AlgorithmManager::Instance().create("AddSampleLog");
addLogSample->initialize();
addLogSample->setProperty("Workspace", m_pythonExportWsName);
addLogSample->setProperty("LogName", "sample_filename");
addLogSample->setProperty(
"LogText", m_uiForm.dsSample->getCurrentDataName().toStdString());
addLogSample->setProperty("LogType", "String");
m_batchAlgoRunner->addAlgorithm(addLogSample);
// Run algorithm queue // Run algorithm queue
connect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this, connect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this,
SLOT(postProcessComplete(bool))); SLOT(postProcessComplete(bool)));
......
...@@ -263,28 +263,6 @@ void ContainerSubtraction::absCorComplete(bool error) { ...@@ -263,28 +263,6 @@ void ContainerSubtraction::absCorComplete(bool error) {
if (save) if (save)
addSaveWorkspaceToQueue(QString::fromStdString(m_pythonExportWsName)); addSaveWorkspaceToQueue(QString::fromStdString(m_pythonExportWsName));
IAlgorithm_sptr addLogContainer =
AlgorithmManager::Instance().create("AddSampleLog");
addLogContainer->initialize();
addLogContainer->setProperty("Workspace", m_pythonExportWsName);
addLogContainer->setProperty("LogName", "container_filename");
addLogContainer->setProperty(
"LogText", m_uiForm.dsContainer->getCurrentDataName().toStdString());
addLogContainer->setProperty("LogType", "String");
m_batchAlgoRunner->addAlgorithm(addLogContainer);
IAlgorithm_sptr addLogSample =
AlgorithmManager::Instance().create("AddSampleLog");
addLogSample->initialize();
addLogSample->setProperty("Workspace", m_pythonExportWsName);
addLogSample->setProperty("LogName", "sample_filename");
addLogSample->setProperty(
"LogText", m_uiForm.dsSample->getCurrentDataName().toStdString());
addLogSample->setProperty("LogType", "String");
m_batchAlgoRunner->addAlgorithm(addLogSample);
// Run algorithm queue // Run algorithm queue
connect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this, connect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this,
SLOT(postProcessComplete(bool))); SLOT(postProcessComplete(bool)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment