[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 | #include <cxcore.h>
|
---|
| 23 |
|
---|
| 24 | using std::string;
|
---|
| 25 | using namespace flair::core;
|
---|
| 26 |
|
---|
[15] | 27 | namespace flair {
|
---|
| 28 | namespace gui {
|
---|
[2] | 29 |
|
---|
[15] | 30 | RangeFinderPlot::RangeFinderPlot(const LayoutPosition *position, string name,
|
---|
| 31 | string x_name, float xmin, float xmax,
|
---|
| 32 | string y_name, float ymin, float ymax,
|
---|
[214] | 33 | const Matrix *datas, float start_angle,
|
---|
[15] | 34 | float end_angle, uint32_t nb_samples)
|
---|
| 35 | : SendData(position, name, "RangeFinderPlot", 200) {
|
---|
| 36 | this->datas = datas;
|
---|
[221] | 37 |
|
---|
[15] | 38 | SetSendSize(datas->GetDataType().GetSize());
|
---|
[2] | 39 |
|
---|
[15] | 40 | SetVolatileXmlProp("xmin", xmin);
|
---|
| 41 | SetVolatileXmlProp("xmax", xmax);
|
---|
| 42 | SetVolatileXmlProp("ymin", ymin);
|
---|
| 43 | SetVolatileXmlProp("ymax", ymax);
|
---|
| 44 | SetVolatileXmlProp("x_name", x_name);
|
---|
| 45 | SetVolatileXmlProp("y_name", y_name);
|
---|
| 46 | SetVolatileXmlProp("start_angle", start_angle);
|
---|
| 47 | SetVolatileXmlProp("end_angle", end_angle);
|
---|
| 48 | SetVolatileXmlProp("nb_samples", nb_samples);
|
---|
| 49 | SetVolatileXmlProp(
|
---|
| 50 | "type", datas->GetDataType().GetElementDataType().GetDescription());
|
---|
| 51 | SendXml();
|
---|
[2] | 52 |
|
---|
[15] | 53 | if (datas->Cols() != 1 || datas->Rows() != nb_samples)
|
---|
| 54 | Err("Wrong input matrix size\n");
|
---|
[2] | 55 | }
|
---|
| 56 |
|
---|
| 57 | RangeFinderPlot::~RangeFinderPlot() {}
|
---|
| 58 |
|
---|
[15] | 59 | void RangeFinderPlot::CopyDatas(char *buf) const {
|
---|
[221] | 60 | datas->CopyDatas(buf);
|
---|
[2] | 61 | }
|
---|
| 62 |
|
---|
| 63 | } // end namespace gui
|
---|
| 64 | } // end namespace flair
|
---|