Skip to content

Commit

Permalink
re #8245: sans trans fit option SANSRunWindow
Browse files Browse the repository at this point in the history
Correct the SANSRunWindow to process properly the FIT trans option.

1 - Separate the loading Trans settings and the selector changing option.
2 - Correct the option to identify fit on/off
3 - Correct the parser of the fitMethod for CAN
  • Loading branch information
gesnerpassos committed Oct 28, 2013
1 parent d68a5b1 commit 76829d8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ private slots:
/// Adds a warning message to the tab title
void setLoggerTabTitleToWarn();
/// Handle selection of the transmission
void transSelectorChanged(int );

void transSelectorChanged(int );
void loadTransmissionSettings();

private:
/// used to specify the range of validation to do
Expand Down
24 changes: 15 additions & 9 deletions Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,8 @@ bool SANSRunWindow::loadUserFile()
"print i.ReductionSingleton().DQXY"), m_uiForm.qy_dqy,
m_uiForm.qy_dqy_opt);

// The tramission line of the Limits section (read settings for sample and can)
transSelectorChanged(1); transSelectorChanged(0);

// The tramission line of the Limits section (read settings for sample and can)
loadTransmissionSettings();

// The front rescale/shift section
m_uiForm.frontDetRescale->setText(runReduceScriptFunction(
Expand Down Expand Up @@ -3500,6 +3499,10 @@ void SANSRunWindow::transSelectorChanged(int currindex){
m_uiForm.trans_max_can, m_uiForm.trans_opt_can};
for (size_t i = 0; i< 6; i++) wid[i]->setVisible(visible);

}

void SANSRunWindow::loadTransmissionSettings(){

QString transMin = runReduceScriptFunction(
"print i.ReductionSingleton().transmission_calculator.lambdaMin('SAMPLE')").trimmed();
if (transMin == "None")
Expand All @@ -3513,20 +3516,20 @@ void SANSRunWindow::transSelectorChanged(int currindex){
m_uiForm.trans_max->setText(runReduceScriptFunction(
"print i.ReductionSingleton().transmission_calculator.lambdaMax('SAMPLE')").trimmed());
}

QString text = runReduceScriptFunction(
"print i.ReductionSingleton().transmission_calculator.fitMethod('SAMPLE')").trimmed();
int index = m_uiForm.trans_opt->findText(text, Qt::MatchFixedString);
if( index >= 0 )
{
m_uiForm.trans_opt->setCurrentIndex(index);
}
if ( text == "Off" || text == "None" )
if ( text == "OFF" || text == "None" )
m_uiForm.transFitOnOff->setChecked(false);
else
m_uiForm.transFitOnOff->setChecked(true);

if (visible){
transMin = runReduceScriptFunction(
transMin = runReduceScriptFunction(
"print i.ReductionSingleton().transmission_calculator.lambdaMin('CAN')").trimmed();
if (transMin == "None")
{
Expand All @@ -3541,16 +3544,19 @@ void SANSRunWindow::transSelectorChanged(int currindex){
}
text = runReduceScriptFunction(
"print i.ReductionSingleton().transmission_calculator.fitMethod('CAN')").trimmed();
index = m_uiForm.trans_opt_can->findText(text, Qt::MatchCaseSensitive);
index = m_uiForm.trans_opt_can->findText(text, Qt::MatchFixedString);
if( index >= 0 )
{
m_uiForm.trans_opt_can->setCurrentIndex(index);
}
if ( text == "Off" || text == "None" )
if ( text == "OFF" || text == "None" )
m_uiForm.transFitOnOff_can->setChecked(false);
else
m_uiForm.transFitOnOff_can->setChecked(true);
}

bool separated = runReduceScriptFunction("print i.ReductionSingleton().transmission_calculator.isSeparate()").trimmed()=="True";

m_uiForm.trans_selector_opt->setCurrentIndex(separated?1:0);


}
Expand Down

0 comments on commit 76829d8

Please sign in to comment.