Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/10749_add_sofqw3_back_to…
Browse files Browse the repository at this point in the history
…_sqw_tab'
  • Loading branch information
Lottie Greenwood committed Dec 10, 2014
2 parents 03a70e1 + d4de111 commit e75b1de
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
Expand Up @@ -2166,6 +2166,19 @@ Later steps in the process (saving, renaming) will not be done.</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="sqw_lbRebinType">
<property name="minimumSize">
<size>
<width>43</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Rebin Type:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="sqw_valQWidth">
<property name="styleSheet">
Expand Down Expand Up @@ -2294,6 +2307,41 @@ Later steps in the process (saving, renaming) will not be done.</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="sqw_cbRebinType">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<item>
<property name="text">
<string>Parallelepiped (SofQW2)</string>
</property>
</item>
<item>
<property name="text">
<string>Parallelepiped/Fractional Area (SofQW3)</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down Expand Up @@ -2818,6 +2866,7 @@ Later steps in the process (saving, renaming) will not be done.</string>
<tabstop>trans_ckVerbose</tabstop>
<tabstop>trans_ckPlot</tabstop>
<tabstop>trans_ckSave</tabstop>
<tabstop>sqw_cbRebinType</tabstop>
<tabstop>sqw_leQLow</tabstop>
<tabstop>sqw_leQWidth</tabstop>
<tabstop>sqw_leQHigh</tabstop>
Expand Down
23 changes: 22 additions & 1 deletion Code/Mantid/MantidQt/CustomInterfaces/src/IndirectSqw.cpp
Expand Up @@ -174,10 +174,18 @@ namespace CustomInterfaces
m_batchAlgoRunner->addAlgorithm(energyRebinAlg);
}

// Get correct S(Q, w) algorithm
QString eFixed = getInstrumentDetails()["efixed-val"];

IAlgorithm_sptr sqwAlg;
QString rebinType = m_uiForm.sqw_cbRebinType->currentText();

if(rebinType == "Parallelepiped (SofQW2)")
sqwAlg = AlgorithmManager::Instance().create("SofQW2");
else if(rebinType == "Parallelepiped/Fractional Area (SofQW3)")
sqwAlg = AlgorithmManager::Instance().create("SofQW3");

// S(Q, w) algorithm
IAlgorithm_sptr sqwAlg = AlgorithmManager::Instance().create("SofQW2");
sqwAlg->initialize();

BatchAlgorithmRunner::AlgorithmRuntimeProps sqwInputProps;
Expand All @@ -193,6 +201,19 @@ namespace CustomInterfaces

m_batchAlgoRunner->addAlgorithm(sqwAlg, sqwInputProps);

// Add sample log for S(Q, w) algorithm used
IAlgorithm_sptr sampleLogAlg = AlgorithmManager::Instance().create("AddSampleLog");
sampleLogAlg->initialize();

sampleLogAlg->setProperty("LogName", "rebin_type");
sampleLogAlg->setProperty("LogType", "String");
sampleLogAlg->setProperty("LogText", rebinType.toStdString());

BatchAlgorithmRunner::AlgorithmRuntimeProps inputToAddSampleLogProps;
inputToAddSampleLogProps["Workspace"] = sqwWsName.toStdString();

m_batchAlgoRunner->addAlgorithm(sampleLogAlg, inputToAddSampleLogProps);

// Save S(Q, w) workspace
if(m_uiForm.sqw_ckSave->isChecked())
{
Expand Down

0 comments on commit e75b1de

Please sign in to comment.