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

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

flaircore

File size: 2.0 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 finder like Hokuyo
14//
15//
16/*********************************************************************/
17
18#include "RangeFinderPlot.h"
19#include "cvmatrix.h"
20#include "Layout.h"
21#include "LayoutPosition.h"
22#include "FrameworkManager.h"
23#include <cxcore.h>
24
25using std::string;
26using namespace flair::core;
27
28namespace flair { namespace gui {
29
30RangeFinderPlot::RangeFinderPlot(const LayoutPosition* position,string name,
31 string x_name,float xmin,float xmax,
32 string y_name,float ymin,float ymax,
33 const cvmatrix* datas,float start_angle,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("type",datas->GetDataType().GetElementDataType().GetDescription());
49 SendXml();
50
51 if(datas->Cols()!=1 || datas->Rows()!=nb_samples) Err("Wrong input matrix size\n");
52}
53
54RangeFinderPlot::~RangeFinderPlot() {}
55
56void RangeFinderPlot::CopyDatas(char* buf) const {
57 datas->GetMutex();
58 memcpy(buf,datas->getCvMat()->data.ptr,datas->GetDataType().GetSize());
59 datas->ReleaseMutex();
60}
61
62} // end namespace gui
63} // end namespace flair
Note: See TracBrowser for help on using the repository browser.