diff --git a/src/signal-wrapper.cc b/src/signal-wrapper.cc index fe6e5f1c458dbb88ca31e2cb8e43e4e4c346e870..7e244c70ac21ffe2897607215b12b56f3c941782 100644 --- a/src/signal-wrapper.cc +++ b/src/signal-wrapper.cc @@ -18,6 +18,7 @@ #include <Python.h> #include <dynamic-graph/factory.h> +#include <dynamic-graph/command-bind.h> namespace dynamicgraph { namespace python { @@ -37,6 +38,16 @@ namespace dynamicgraph { PythonSignalContainer::PythonSignalContainer(const std::string& name) : Entity (name) { + std::string docstring; + + docstring = " \n" + " Remove a signal\n" + " \n" + " Input:\n" + " - name of the signal\n" + " \n"; + addCommand("rmSignal", + command::makeCommandVoid1(*this,&PythonSignalContainer::rmSignal,docstring)); } void PythonSignalContainer::signalRegistration (const SignalArray<int>& signals) @@ -44,6 +55,11 @@ namespace dynamicgraph { Entity::signalRegistration (signals); } + void PythonSignalContainer::rmSignal (const std::string& name) + { + Entity::signalDeregistration (name); + } + DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(PythonSignalContainer, "PythonSignalContainer"); template <class T, class Time> diff --git a/src/signal-wrapper.hh b/src/signal-wrapper.hh index 339b1ba81d25ce6e12023f9c4c2228391e5ff402..c26e9ac6ca2e1787812d386e3eaef939aa03d108 100644 --- a/src/signal-wrapper.hh +++ b/src/signal-wrapper.hh @@ -41,6 +41,8 @@ namespace dynamicgraph { PythonSignalContainer (const std::string& name); void signalRegistration (const SignalArray<int>& signals); + + void rmSignal (const std::string& name); }; template <class T, class Time>