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

Add functionality to several slots in UI

Refs #13110
parent 4144a7a7
No related branches found
No related tags found
No related merge requests found
......@@ -20,9 +20,9 @@ private slots:
/// Updates the preview mini plot
void plotPreview(int specIndex);
/// Handle abs. correction algorithm completion
void absCorComplete(bool error);
//void absCorComplete(bool error);
/// Handle convert units and save algorithm completion
void postProcessComplete(bool error);
//void postProcessComplete(bool error);
private:
virtual void setup();
......
......@@ -32,5 +32,75 @@ void ContainerSubtraction::loadSettings(const QSettings &settings) {
m_uiForm.dsContainer->readSettings(settings.group());
m_uiForm.dsSample->readSettings(settings.group());
}
/**
* Disables corrections when using S(Q, w) as input data.
*
* @param dataName Name of new data source
*/
void ContainerSubtraction::newData(const QString &dataName) {
const MatrixWorkspace_sptr sampleWs =
AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
dataName.toStdString());
m_uiForm.spPreviewSpec->setMaximum(
static_cast<int>(sampleWs->getNumberHistograms()) - 1);
// Plot the sample curve
m_uiForm.ppPreview->clear();
m_uiForm.ppPreview->addSpectrum("Sample", sampleWs, 0, Qt::black);
}
/**
* Handles when the type of geometry changes
*
* Updates the file extension to search for
*/
void ContainerSubtraction::handleGeometryChange(int index) {
QString ext("");
switch (index) {
case 0:
// Geometry is flat
ext = "_flt_abs";
break;
case 1:
// Geometry is cylinder
ext = "_cyl_abs";
break;
case 2:
// Geometry is annulus
ext = "_ann_abs";
break;
}
/*m_uiForm.dsCorrections->setWSSuffixes(QStringList(ext));
m_uiForm.dsCorrections->setFBSuffixes(QStringList(ext + ".nxs"));*/
}
/**
* Replots the preview plot.
*
* @param specIndex Spectrum index to plot
*/
void ContainerSubtraction::plotPreview(int specIndex) {
//bool useCan = m_uiForm.ckUseCan->isChecked();
m_uiForm.ppPreview->clear();
// Plot sample
m_uiForm.ppPreview->addSpectrum(
"Sample", m_uiForm.dsSample->getCurrentDataName(), specIndex, Qt::black);
// Plot result
if (!m_pythonExportWsName.empty())
m_uiForm.ppPreview->addSpectrum(
"Corrected", QString::fromStdString(m_pythonExportWsName), specIndex,
Qt::green);
// Plot can
/* if (useCan)
m_uiForm.ppPreview->addSpectrum(
"Can", m_uiForm.dsContainer->getCurrentDataName(), specIndex, Qt::red);*/
}
}
}
\ No newline at end of file
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