Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
dynamic-graph-python
Commits
87872a58
Commit
87872a58
authored
Sep 30, 2011
by
Thomas Moulard
Committed by
Florent Lamiraux florent@laas.fr
Dec 11, 2011
Browse files
Add tools.py file containing addTrace.
parent
810ad4a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/CMakeLists.txt
View file @
87872a58
...
...
@@ -111,6 +111,7 @@ SET (PYTHON_SOURCES
dynamic_graph/signal_base.py
dynamic_graph/matlab.py
dynamic_graph/script_shortcuts.py
dynamic_graph/tools.py
)
SET
(
PYTHON_SOURCES_FULLPATH
""
)
...
...
src/dynamic_graph/tools.py
0 → 100644
View file @
87872a58
# -*- coding: utf-8 -*-
# Copyright 2011, Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST
#
# This file is part of dynamic-graph.
# dynamic-graph is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# dynamic-graph is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Lesser Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with
# dynamic-graph. If not, see <http://www.gnu.org/licenses/>.
from
__future__
import
print_function
def
addTrace
(
robot
,
trace
,
entityName
,
signalName
,
autoRecompute
=
True
):
"""
Add a signal to a tracer and recompute it automatically if necessary.
"""
signal
=
'{0}.{1}'
.
format
(
entityName
,
signalName
)
filename
=
'{0}-{1}'
.
format
(
entityName
,
signalName
)
trace
.
add
(
signal
,
filename
)
if
autoRecompute
:
robot
.
device
.
after
.
addSignal
(
signal
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment