Skip to content

Commit

Permalink
Cherry pick pull request #18926
Browse files Browse the repository at this point in the history
Refs #18924 Add fix for detector selection

(cherry picked from commit a7a9ee7)

Refs #18924 Formatting

(cherry picked from commit 393ac4b)

Add to patch release notes.
  • Loading branch information
martyngigg committed Feb 23, 2017
1 parent b103346 commit 80792d6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
29 changes: 27 additions & 2 deletions MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
Expand Up @@ -3524,8 +3524,33 @@ void SANSRunWindow::fillDetectNames(QComboBox *output) {
"to continue by selecting a valid instrument");
}

output->setItemText(0, dets[1]);
output->setItemText(1, dets[3]);
// The setting of the detector here has been the cause of problems for
// (apparently years).
// The code assumes for the indices
// | | LOQ | SANS2D | LARMOR |
// |-----|--------------------|----------------|-------------------------|
// | 0 | main-detector-bank | rear-detector | DetectorBench |
// | 1 | HAB | front-detector | front-detector (unused) |
// | 2 | both | both | both |
// | 3 | merged | merged | merged |
// But the Python method above listDetectors will return the selected detector
// first,
// ie if HAB was selected on LOQ, then it would return
// ["HAB","main-detector-bank"]
// if main-detector-bank was selected on LOQ, then it would return
// ["main-detector-bank", "HAB"]
// which means we need to assign the names to the right slots.
QStringList detectorNames = {dets[1], dets[3]};
for (auto &name : detectorNames) {
if (name == "main-detector-bank" || name == "rear-detector" ||
name == "DetectorBench") {
output->setItemText(0, name);
}

if (name == "HAB" || name == "front-detector") {
output->setItemText(1, name);
}
}
}
/** Checks if the workspace is a group and returns the first member of group,
* throws
Expand Down
4 changes: 4 additions & 0 deletions docs/source/release/v3.9.1/index.rst
Expand Up @@ -26,6 +26,8 @@ Changes in this version

* `18891 <https://www.github.com/mantidproject/mantid/pull/18891>`_ Fix bug in gd_prtn_chrg for chunked data
* `18907 <https://www.github.com/mantidproject/mantid/pull/18907>`_ Fix zeropadding for IMAT in Facilities.XML
* `18926 <https://www.github.com/mantidproject/mantid/pull/18926>`_ Fix wrong detector selection when loading high angle bank user files in ISIS SANS


Summary of impact
-----------------
Expand All @@ -38,6 +40,8 @@ Summary of impact
+-------+-----------------------------------------------------------------------------------+---------------------------------------------+--------------+
| 18907 | Allows IMAT to use general file finding mechanism | Facilities file update | **low** |
+-------+-----------------------------------------------------------------------------------+---------------------------------------------+--------------+
| 18926 | Enables ISIS SANS to select the correct bank of the detector | Fix interpreation of list indices in GUI | **low** |
+-------+-----------------------------------------------------------------------------------+---------------------------------------------+--------------+


.. _download page: http://download.mantidproject.org
Expand Down

0 comments on commit 80792d6

Please sign in to comment.