summaryrefslogtreecommitdiff
path: root/digital
diff options
context:
space:
mode:
authorOlivier Lanneluc2013-04-27 00:11:52 +0200
committerNicolas Schodet2013-04-27 00:11:52 +0200
commitc4f4fcd21a3440014c35152e6258033351ed7dc0 (patch)
tree37cac239935c3580ac4556bf7390997d6be2d6cf /digital
parentac36d70fb2aca75a6bb201351346cb6e97715d39 (diff)
digital/io-hub/src/common-cc: add simulation path report
Diffstat (limited to 'digital')
-rw-r--r--digital/io-hub/src/common-cc/simu_report.host.cc10
-rw-r--r--digital/io-hub/src/common-cc/simu_report.host.hh3
2 files changed, 13 insertions, 0 deletions
diff --git a/digital/io-hub/src/common-cc/simu_report.host.cc b/digital/io-hub/src/common-cc/simu_report.host.cc
index 2a3f98fd..e28df533 100644
--- a/digital/io-hub/src/common-cc/simu_report.host.cc
+++ b/digital/io-hub/src/common-cc/simu_report.host.cc
@@ -28,6 +28,7 @@ SimuReport::SimuReport (ucoo::Host &host)
{
std::string instance (host.get_instance ());
pos_mtype_ = node_.reserve (instance + ":pos-report");
+ path_mtype_ = node_.reserve (instance + ":path");
}
void
@@ -40,3 +41,12 @@ SimuReport::pos (vect_t *pos, int pos_nb, uint8_t id)
node_.send (msg);
}
+void
+SimuReport::path (const vect_t *pos, int pos_nb)
+{
+ ucoo::mex::Msg msg (path_mtype_);
+ for (; pos_nb; pos++, pos_nb--)
+ msg.push ("hh") << pos->x << pos->y;
+ node_.send (msg);
+}
+
diff --git a/digital/io-hub/src/common-cc/simu_report.host.hh b/digital/io-hub/src/common-cc/simu_report.host.hh
index 8e8929ad..eaf50281 100644
--- a/digital/io-hub/src/common-cc/simu_report.host.hh
+++ b/digital/io-hub/src/common-cc/simu_report.host.hh
@@ -34,9 +34,12 @@ class SimuReport
SimuReport (ucoo::Host &host);
/// Report positions.
void pos (vect_t *pos, int pos_nb, uint8_t id);
+ /// Report path.
+ void path (const vect_t *pos, int pos_nb);
private:
ucoo::mex::Node &node_;
ucoo::mex::mtype_t pos_mtype_;
+ ucoo::mex::mtype_t path_mtype_;
};
#endif // simu_report_host_hh