Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong detector selection when loading high angle bank user files in ISIS SANS #18926

Merged
merged 3 commits into from Feb 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 27 additions & 2 deletions MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
Expand Up @@ -3521,8 +3521,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
1 change: 1 addition & 0 deletions docs/source/release/v3.10.0/sans.rst
Expand Up @@ -8,6 +8,7 @@ SANS Changes
Bug Fixes
---------
- Fixed wrong first spectrum number for LARMOR. The first non-monitor spectrum number is 11, but it had been set to 10.
- Fixed inconsistent detector selection for high-angle-bank-type detectors.

|

Expand Down