Line |
Branch |
Exec |
Source |
1 |
|
|
/* |
2 |
|
|
* Copyright 2019, |
3 |
|
|
* Joseph Mirabel |
4 |
|
|
* |
5 |
|
|
* LAAS-CNRS |
6 |
|
|
* |
7 |
|
|
*/ |
8 |
|
|
|
9 |
|
|
#include <dynamic-graph/command-setter.h> |
10 |
|
|
|
11 |
|
|
#include <sot/core/double-constant.hh> |
12 |
|
|
#include <sot/core/factory.hh> |
13 |
|
|
|
14 |
|
|
namespace dynamicgraph { |
15 |
|
|
namespace sot { |
16 |
|
|
|
17 |
|
✗ |
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(DoubleConstant, "DoubleConstant"); |
18 |
|
|
|
19 |
|
✗ |
DoubleConstant::DoubleConstant(const std::string &name) |
20 |
|
✗ |
: Entity(name), SOUT("DoubleConstant(" + name + ")::output(double)::sout") { |
21 |
|
✗ |
SOUT.setDependencyType(TimeDependency<int>::BOOL_DEPENDENT); |
22 |
|
✗ |
signalRegistration(SOUT); |
23 |
|
|
// |
24 |
|
|
// Commands |
25 |
|
|
|
26 |
|
|
// set |
27 |
|
|
std::string docstring = |
28 |
|
|
" \n" |
29 |
|
|
" Set value of output signal\n" |
30 |
|
|
" \n" |
31 |
|
|
" input:\n" |
32 |
|
|
" - a double\n" |
33 |
|
✗ |
" \n"; |
34 |
|
✗ |
addCommand("set", new ::dynamicgraph::command::Setter<DoubleConstant, double>( |
35 |
|
✗ |
*this, &DoubleConstant::setValue, docstring)); |
36 |
|
|
} |
37 |
|
|
|
38 |
|
✗ |
void DoubleConstant::setValue(const double &inValue) { |
39 |
|
✗ |
SOUT.setConstant(inValue); |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
} // namespace sot |
43 |
|
|
} // namespace dynamicgraph |
44 |
|
|
|