Commit a0363375 authored by olivier stasse's avatar olivier stasse
Browse files

Exposes class name to the python side.

parent 45f00cff
......@@ -33,6 +33,7 @@ namespace dynamicgraph {
extern PyObject* getTime(PyObject* self, PyObject* args);
extern PyObject* setTime(PyObject* self, PyObject* args);
extern PyObject* getName(PyObject* self, PyObject* args);
extern PyObject* getClassName(PyObject* self, PyObject* args);
extern PyObject* display(PyObject* self, PyObject* args);
extern PyObject* displayDependencies(PyObject* self, PyObject* args);
extern PyObject* getValue(PyObject* self, PyObject* args);
......@@ -151,6 +152,8 @@ static PyMethodDef dynamicGraphMethods[] = {
METH_VARARGS, "Set time of a SignalBase"},
{"signal_base_get_name", dynamicgraph::python::signalBase::getName,
METH_VARARGS, "Get the name of a signal"},
{"signal_base_get_class_name", dynamicgraph::python::signalBase::getClassName,
METH_VARARGS, "Get the class name of a signal"},
{"signal_base_display", dynamicgraph::python::signalBase::display,
METH_VARARGS, "Print the signal in a string"},
{"signal_base_display_dependencies", dynamicgraph::python::signalBase::displayDependencies,
......
......@@ -165,7 +165,7 @@ class SignalBase (object) :
raise RuntimeError(
"A pointer is required to create SignalBase object.")
self.name=self.getName()
self.className=self.getClassName()
@property
def time(self) :
"""
......@@ -222,6 +222,12 @@ class SignalBase (object) :
"""
return wrap.signal_base_get_name(self.obj)
def getClassName(self):
"""
Get class name of signal
"""
return wrap.signal_base_get_class_name(self.obj)
def recompute(self, time):
"""
Force signal to recompute the value at given time.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment