From 139db216fec807746e230edad3e4d3d296b265e7 Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Fri, 30 Oct 2020 11:50:42 +0100 Subject: [PATCH 1/3] added function to read depreciated commands --- docs/src/gendoc.cpp | 6 ++++++ slsDetectorSoftware/src/CmdProxy.cpp | 4 ++++ slsDetectorSoftware/src/CmdProxy.h | 1 + 3 files changed, 11 insertions(+) diff --git a/docs/src/gendoc.cpp b/docs/src/gendoc.cpp index d7742edeb..e4ee7d4f9 100644 --- a/docs/src/gendoc.cpp +++ b/docs/src/gendoc.cpp @@ -51,4 +51,10 @@ int main() { auto help = replace_all(tmp, "\n\t", "\n\t\t| "); fs << '\t' << cmd << usage << help << "\n"; } + + std::ofstream fs2("depreciated.txt"); + auto cmds = proxy.GetDepreciatedCommands(); + for (auto it : cmds){ + fs2 << it.first << ", " << it.second << '\n'; + } } diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 9da9abb9e..e33872787 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -74,6 +74,10 @@ std::vector CmdProxy::GetProxyCommands() { return commands; } +std::map CmdProxy::GetDepreciatedCommands(){ + return depreciated_functions; +} + void CmdProxy::WrongNumberOfParameters(size_t expected) { throw RuntimeError( "Command " + cmd + " expected <=" + std::to_string(expected) + diff --git a/slsDetectorSoftware/src/CmdProxy.h b/slsDetectorSoftware/src/CmdProxy.h index 4df0a4c98..f67bd4a45 100644 --- a/slsDetectorSoftware/src/CmdProxy.h +++ b/slsDetectorSoftware/src/CmdProxy.h @@ -534,6 +534,7 @@ class CmdProxy { bool ReplaceIfDepreciated(std::string &command); size_t GetFunctionMapSize() const noexcept { return functions.size(); }; std::vector GetProxyCommands(); + std::map GetDepreciatedCommands(); private: Detector *det; From 2f76afd8a6304e4332ffe8bd8aa32fef05dc57d0 Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Fri, 30 Oct 2020 12:07:54 +0100 Subject: [PATCH 2/3] added table under command line --- docs/src/commandline.rst | 9 +++++++++ docs/src/gendoc.cpp | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/src/commandline.rst b/docs/src/commandline.rst index 11cb67ed8..990d50403 100644 --- a/docs/src/commandline.rst +++ b/docs/src/commandline.rst @@ -30,3 +30,12 @@ Commands ----------- .. include:: ../commands.rst + + +Depreciated commands +------------------------ + +.. csv-table:: Depreciated commands + :file: ../depreciated.csv + :widths: 35, 35 + :header-rows: 1 diff --git a/docs/src/gendoc.cpp b/docs/src/gendoc.cpp index e4ee7d4f9..f0f38f867 100644 --- a/docs/src/gendoc.cpp +++ b/docs/src/gendoc.cpp @@ -52,7 +52,8 @@ int main() { fs << '\t' << cmd << usage << help << "\n"; } - std::ofstream fs2("depreciated.txt"); + std::ofstream fs2("depreciated.csv"); + fs2 << "Old, New\n"; auto cmds = proxy.GetDepreciatedCommands(); for (auto it : cmds){ fs2 << it.first << ", " << it.second << '\n'; From 3266b1380ff6857b1324156b92b3ffde1a689598 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 30 Oct 2020 13:10:05 +0100 Subject: [PATCH 3/3] updated note on dac commands --- docs/src/commandline.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/src/commandline.rst b/docs/src/commandline.rst index 990d50403..9cbfdd458 100644 --- a/docs/src/commandline.rst +++ b/docs/src/commandline.rst @@ -35,7 +35,13 @@ Commands Depreciated commands ------------------------ +.. note :: + All dac commands are preceded with the **dac** command. Use command **daclist** to get correct list of dac command arguments for current detector. + .. csv-table:: Depreciated commands :file: ../depreciated.csv :widths: 35, 35 :header-rows: 1 + + +