diff --git a/include/sot/core/device.hh b/include/sot/core/device.hh index d72d72ab8c35cdeb9d5f5d0208a580cb93d86483..f81de5ed79d050a51bab684bcc80f1b4544df5f0 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 bcb41c4ee35df362eca3a18a513a8e896da52e3e..0f4ee23dc7e43bb6e3da6edb5db221e31625556e 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; +}