Skip to content

Commit

Permalink
Use a data selctor for calibration file
Browse files Browse the repository at this point in the history
Refs #10264
  • Loading branch information
DanNixon committed Sep 25, 2014
1 parent 6ba04bd commit 69e51d6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 34 deletions.
Expand Up @@ -1455,52 +1455,50 @@ Later steps in the process (saving, renaming) will not be done.</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="slice_pbPlotRaw">
<property name="text">
<string>Plot Raw</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="loDiagnosticsCalibrationFile">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="slice_ckUseCalib">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Use Calibration File</string>
<string>Use Calibration</string>
</property>
</widget>
</item>
<item>
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="slice_calibFile" native="true">
<property name="enabled">
<bool>false</bool>
</property>
<widget class="MantidQt::MantidWidgets::DataSelector" name="slice_dsCalibFile" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>41</verstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="findRunFiles" stdset="0">
<bool>false</bool>
<property name="autoLoad" stdset="0">
<bool>true</bool>
</property>
<property name="label" stdset="0">
<property name="loadLabelText" stdset="0">
<string/>
</property>
<property name="multipleFiles" stdset="0">
<bool>false</bool>
</property>
<property name="optional" stdset="0">
<bool>true</bool>
<property name="workspaceSuffixes" stdset="0">
<stringlist>
<string>_calib</string>
</stringlist>
</property>
<property name="fileExtensions" stdset="0">
<property name="fileBrowserSuffixes" stdset="0">
<stringlist>
<string>_calib.nxs</string>
</stringlist>
</property>
<property name="showLoad" stdset="0">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -2546,9 +2544,6 @@ Later steps in the process (saving, renaming) will not be done.</string>
<tabstop>cal_ckRES</tabstop>
<tabstop>cal_ckPlotResult</tabstop>
<tabstop>slice_inputFile</tabstop>
<tabstop>slice_pbPlotRaw</tabstop>
<tabstop>slice_ckUseCalib</tabstop>
<tabstop>slice_calibFile</tabstop>
<tabstop>slice_ckVerbose</tabstop>
<tabstop>slice_ckPlot</tabstop>
<tabstop>slice_ckSave</tabstop>
Expand Down
Expand Up @@ -400,7 +400,7 @@ void IndirectDataReduction::loadSettings()
settings.setValue("last_directory", m_saveDir);
m_uiForm.ind_calibFile->readSettings(settings.group());
m_uiForm.ind_mapFile->readSettings(settings.group());
m_uiForm.slice_calibFile->readSettings(settings.group());
m_uiForm.slice_dsCalibFile->readSettings(settings.group());
m_uiForm.moment_dsInput->readSettings(settings.group());
m_uiForm.transInputFile->readSettings(settings.group());
m_uiForm.transCanFile->readSettings(settings.group());
Expand Down
Expand Up @@ -95,13 +95,13 @@ namespace CustomInterfaces
connect(m_blnManager, SIGNAL(valueChanged(QtProperty*, bool)), this, SLOT(sliceTwoRanges(QtProperty*, bool)));
// Plot slice miniplot when file has finished loading
connect(m_uiForm.slice_inputFile, SIGNAL(filesFound()), this, SLOT(slicePlotRaw()));
// Plot slice miniplot when user clicks Plot Raw
connect(m_uiForm.slice_pbPlotRaw, SIGNAL(clicked()), this, SLOT(slicePlotRaw()));
// Enables/disables calibration file selection when user toggles Use Calibratin File checkbox
connect(m_uiForm.slice_ckUseCalib, SIGNAL(toggled(bool)), this, SLOT(sliceCalib(bool)));

// Set default UI state
sliceTwoRanges(0, false);
m_uiForm.slice_ckUseCalib->setChecked(false);
sliceCalib(false);
}

//----------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -141,8 +141,8 @@ namespace CustomInterfaces

if(m_uiForm.slice_ckUseCalib->isChecked())
{
/* m_uiForm.slice_calibFile->getFirstFilename(); */
/* sliceAlg->setProperty("CalibrationWorkspace", ); */
QString calibWsName = m_uiForm.slice_dsCalibFile->getCurrentDataName();
sliceAlg->setProperty("CalibrationWorkspace", calibWsName.toStdString());
}

if(m_blnManager->value(m_properties["UseTwoRanges"]))
Expand Down Expand Up @@ -270,8 +270,7 @@ namespace CustomInterfaces
*/
void IndirectDiagnostics::sliceCalib(bool state)
{
m_uiForm.slice_calibFile->setEnabled(state);
m_uiForm.slice_calibFile->isOptional(!state);
m_uiForm.slice_dsCalibFile->setEnabled(state);
}

/**
Expand Down

0 comments on commit 69e51d6

Please sign in to comment.