source: flair-src/trunk/lib/FlairCore/src/RangeFinderPlot.cpp

Last change on this file was 330, checked in by Sanahuja Guillaume, 2 years ago

use less bandwidth in vprnlite

File size: 1.9 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
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//
13//  purpose:    Class displaying a 2D plot on the ground station for laser range
14//  finder like Hokuyo
15//
16//
17/*********************************************************************/
18
19#include "RangeFinderPlot.h"
20#include "Matrix.h"
21#include "LayoutPosition.h"
22
23using std::string;
24using namespace flair::core;
25
26namespace flair {
27namespace gui {
28
29RangeFinderPlot::RangeFinderPlot(const LayoutPosition *position, string name,
30                                 string x_name, float xmin, float xmax,
31                                 string y_name, float ymin, float ymax,
32                                 const Matrix *datas, float start_angle,
33                                 float end_angle, uint32_t nb_samples)
34    : SendData(position, name, "RangeFinderPlot", 200) {
35  this->datas = datas;
36
37  SetSendSize(datas->GetDataType().GetSize());
38
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();
51
52  if (datas->Cols() != 1 || datas->Rows() != nb_samples)
53    Err("Wrong input matrix size\n");
54}
55
56RangeFinderPlot::~RangeFinderPlot() {}
57
58void RangeFinderPlot::CopyDatas(char *buf) const {
59  datas->RawRead(buf);
60}
61
62} // end namespace gui
63} // end namespace flair
Note: See TracBrowser for help on using the repository browser.