Commit 4943dc9f authored by Tom Hampson's avatar Tom Hampson
Browse files

Added tube counts to detector info in the instrument view's pick tab.

parent 43fba89c
......@@ -90,6 +90,7 @@ public:
void loadSettings(const QSettings &settings) override;
bool addToDisplayContextMenu(QMenu & /*unused*/) const override;
void selectTool(const ToolType tool);
SelectionType getSelectionType() const { return m_selectionType; }
std::shared_ptr<ProjectionSurface> getSurface() const;
const InstrumentWidget *getInstrumentWidget() const;
void clearWidgets();
......
......@@ -973,7 +973,26 @@ QString ComponentInfoController::displayDetectorInfo(size_t index) {
const QString counts = integrated == InstrumentActor::INVALID_VALUE
? "N/A"
: QString::number(integrated);
text += "Counts: " + counts + '\n';
text += "Pixel counts: " + counts + '\n';
// Display tube counts if the tube selection tool is active.
if (m_tab->getSelectionType() == InstrumentWidgetPickTab::Tube) {
int64_t tubeCounts = 0;
auto tube = componentInfo.parent(index);
auto tubeDetectors = componentInfo.detectorsInSubtree(tube);
for (auto detector : tubeDetectors) {
if (componentInfo.isDetector(detector)) {
const double pixelCounts = actor.getIntegratedCounts(detector);
if (pixelCounts != InstrumentActor::INVALID_VALUE) {
tubeCounts += pixelCounts;
}
}
}
text += "Tube counts: " + QString::number(tubeCounts) + '\n';
}
// display info about peak overlays
text += actor.getParameterInfo(index);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment