[2] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[2] | 4 | // %flair:license}
|
---|
| 5 | // created: 2014/07/23
|
---|
| 6 | // filename: RangeFinderPlot.cpp
|
---|
| 7 | //
|
---|
| 8 | // author: Guillaume Sanahuja
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
[15] | 13 | // purpose: Class displaying a 2D plot on the ground station for laser range
|
---|
| 14 | // finder like Hokuyo
|
---|
[2] | 15 | //
|
---|
| 16 | //
|
---|
| 17 | /*********************************************************************/
|
---|
| 18 |
|
---|
| 19 | #include "RangeFinderPlot.h"
|
---|
[214] | 20 | #include "Matrix.h"
|
---|
[2] | 21 | #include "LayoutPosition.h"
|
---|
| 22 |
|
---|
| 23 | using std::string;
|
---|
| 24 | using namespace flair::core;
|
---|
| 25 |
|
---|
[15] | 26 | namespace flair {
|
---|
| 27 | namespace gui {
|
---|
[2] | 28 |
|
---|
[15] | 29 | RangeFinderPlot::RangeFinderPlot(const LayoutPosition *position, string name,
|
---|
| 30 | string x_name, float xmin, float xmax,
|
---|
| 31 | string y_name, float ymin, float ymax,
|
---|
[214] | 32 | const Matrix *datas, float start_angle,
|
---|
[15] | 33 | float end_angle, uint32_t nb_samples)
|
---|
| 34 | : SendData(position, name, "RangeFinderPlot", 200) {
|
---|
| 35 | this->datas = datas;
|
---|
[221] | 36 |
|
---|
[15] | 37 | SetSendSize(datas->GetDataType().GetSize());
|
---|
[2] | 38 |
|
---|
[15] | 39 | SetVolatileXmlProp("xmin", xmin);
|
---|
| 40 | SetVolatileXmlProp("xmax", xmax);
|
---|
| 41 | SetVolatileXmlProp("ymin", ymin);
|
---|
| 42 | SetVolatileXmlProp("ymax", ymax);
|
---|
| 43 | SetVolatileXmlProp("x_name", x_name);
|
---|
| 44 | SetVolatileXmlProp("y_name", y_name);
|
---|
| 45 | SetVolatileXmlProp("start_angle", start_angle);
|
---|
| 46 | SetVolatileXmlProp("end_angle", end_angle);
|
---|
| 47 | SetVolatileXmlProp("nb_samples", nb_samples);
|
---|
| 48 | SetVolatileXmlProp(
|
---|
| 49 | "type", datas->GetDataType().GetElementDataType().GetDescription());
|
---|
| 50 | SendXml();
|
---|
[2] | 51 |
|
---|
[15] | 52 | if (datas->Cols() != 1 || datas->Rows() != nb_samples)
|
---|
| 53 | Err("Wrong input matrix size\n");
|
---|
[2] | 54 | }
|
---|
| 55 |
|
---|
| 56 | RangeFinderPlot::~RangeFinderPlot() {}
|
---|
| 57 |
|
---|
[15] | 58 | void RangeFinderPlot::CopyDatas(char *buf) const {
|
---|
[252] | 59 | datas->RawRead(buf);
|
---|
[2] | 60 | }
|
---|
| 61 |
|
---|
| 62 | } // end namespace gui
|
---|
| 63 | } // end namespace flair
|
---|