From 61cf3e4a9acd70dc4116fc297f73fd0168edee3c Mon Sep 17 00:00:00 2001
From: Olivier Stasse <ostasse@laas.fr>
Date: Mon, 13 May 2019 07:03:14 +0200
Subject: [PATCH] [device] cmdDisplay

---
 include/sot/core/device.hh |  1 +
 src/tools/device.cpp       | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/include/sot/core/device.hh b/include/sot/core/device.hh
index d72d72ab..f81de5ed 100644
--- a/include/sot/core/device.hh
+++ b/include/sot/core/device.hh
@@ -107,6 +107,7 @@ namespace dynamicgraph {
 
     public: /* --- DISPLAY --- */
       virtual void display(std::ostream& os) const;
+      virtual void cmdDisplay();
       SOT_CORE_EXPORT friend std::ostream&
       operator<<(std::ostream& os,const Device& r) {
         r.display(os); return os;
diff --git a/src/tools/device.cpp b/src/tools/device.cpp
index bcb41c4e..0f4ee23d 100644
--- a/src/tools/device.cpp
+++ b/src/tools/device.cpp
@@ -174,6 +174,16 @@ Device( const std::string& n )
        (*this,&Device::setSecondOrderIntegration,
 	docstring));
 
+    /* Display information */
+    docstring =
+        "\n"
+        "    Display information on device  \n"
+        "\n";
+    addCommand
+      ("display",
+       command::makeCommandVoid0
+       (*this,&Device::cmdDisplay,docstring));
+
     /* SET of control input type. */
     docstring =
         "\n"
@@ -597,3 +607,10 @@ void Device::display ( std::ostream& os ) const
      << "sanityCheck: " << sanityCheck_<< endl
      << "controlInputType:" << controlInputType_ << endl;
 }
+
+void Device::cmdDisplay ( )
+{
+  std::cout << name <<": "<<state_<<endl
+     << "sanityCheck: " << sanityCheck_<< endl
+     << "controlInputType:" << controlInputType_ << endl;
+}
-- 
GitLab