From 2b48184e8e9ac1bcbfbec7501b3eb01783fa5c6c Mon Sep 17 00:00:00 2001
From: Phil <philipc99@hotmail.co.uk>
Date: Thu, 10 Oct 2019 11:23:43 +0100
Subject: [PATCH] Re #26867 fix doxygen error maybe

---
 .../inc/MantidAlgorithms/CreateDetectorTable.h    | 14 ++++++++------
 Framework/Algorithms/src/CreateDetectorTable.cpp  | 15 +++++++++++++--
 .../WorkspaceTreeWidgetSimple.cpp                 |  4 ++++
 3 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreateDetectorTable.h b/Framework/Algorithms/inc/MantidAlgorithms/CreateDetectorTable.h
index 97f91118f9a..8967bc24341 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CreateDetectorTable.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CreateDetectorTable.h
@@ -42,18 +42,20 @@ public:
            "workspace and optionally the data for that detector";
   }
 
+private:
+  /// Initialisation code
+  void init() override;
+  /// Execution code
+  void exec() override;
+
+  /// Creates table workspace of detector information from a given workspace
   API::ITableWorkspace_sptr CreateDetectorTable::createDetectorTableWorkspace(
       const std::string &wsName, const API::MatrixWorkspace_sptr &ws,
       const std::vector<int> &indices, bool include_data);
 
+  /// Converts a list to a string, shortened if necessary
   std::string
   CreateDetectorTable::createTruncatedList(const std::set<int> &elements);
-
-private:
-  /// Initialisation code
-  void init() override;
-  /// Execution code
-  void exec() override;
 };
 
 } // namespace Algorithm
diff --git a/Framework/Algorithms/src/CreateDetectorTable.cpp b/Framework/Algorithms/src/CreateDetectorTable.cpp
index 7f8ce68b9cc..5235445bb8b 100644
--- a/Framework/Algorithms/src/CreateDetectorTable.cpp
+++ b/Framework/Algorithms/src/CreateDetectorTable.cpp
@@ -62,12 +62,14 @@ void CreateDetectorTable::exec() {
 }
 
 /**
- * Create the instrument detector table from a MatrixWorkspace
+ * Create the instrument detector table workspace from a MatrixWorkspace
  * @param wsName :: The name of the workspace
  * @param ws :: A pointer to a MatrixWorkspace
  * @param indices :: Limit the table to these workspace indices
  * @param include_data :: If true then first value from the each spectrum is
  * displayed
+ *
+ * @return A pointer to the table workspace of detector information
  */
 ITableWorkspace_sptr CreateDetectorTable::createDetectorTableWorkspace(
     const std::string &wsName, const MatrixWorkspace_sptr &ws,
@@ -137,7 +139,7 @@ ITableWorkspace_sptr CreateDetectorTable::createDetectorTableWorkspace(
       ws->getInstrument()->getReferenceFrame()->pointingAlongBeam();
   const auto sampleDist = sample->getPos()[beamAxisIndex];
   bool signedThetaParamRetrieved{false},
-      showSignedTwoTheta{false}; // If true,  signedVersion of the two theta
+      showSignedTwoTheta{false}; // If true, signedVersion of the two theta
                                  // value should be displayed
 
   for (int row = 0; row < nrows; ++row) {
@@ -254,6 +256,15 @@ ITableWorkspace_sptr CreateDetectorTable::createDetectorTableWorkspace(
   return t;
 }
 
+/**
+ * Converts a set of ints to a string with each element separated by a
+ * comma. If there are more than 10 elements, the format "a,b...(n more)...y,z"
+ * is used.
+ *
+ * @param elements :: The set of elements to be converted
+ *
+ * @return The truncated list as a string
+ */
 std::string
 CreateDetectorTable::createTruncatedList(const std::set<int> &elements) {
   std::string truncated{""};
diff --git a/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidgetSimple.cpp b/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidgetSimple.cpp
index 7f3acc06398..2e2b1f059dc 100644
--- a/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidgetSimple.cpp
+++ b/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidgetSimple.cpp
@@ -11,6 +11,7 @@
 
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/FileProperty.h"
+#include "MantidAPI/IPeaksWorkspace.h"
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/WorkspaceGroup.h"
@@ -121,6 +122,9 @@ void WorkspaceTreeWidgetSimple::popupContextMenu() {
     } else if (boost::dynamic_pointer_cast<ITableWorkspace>(workspace)) {
       menu->addAction(m_showData);
       menu->addAction(m_showAlgorithmHistory);
+      if (boost::dynamic_pointer_cast<IPeaksWorkspace>(workspace)) {
+        menu->addAction(m_showDetectors);
+      }
     } else if (boost::dynamic_pointer_cast<IMDWorkspace>(workspace)) {
       menu->addAction(m_showAlgorithmHistory);
       menu->addAction(m_sampleLogs);
-- 
GitLab