Changeset 15 in flair-src for trunk/lib/FlairCore/src/RangeFinderPlot.cpp
- Timestamp:
- Apr 8, 2016, 3:40:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/RangeFinderPlot.cpp
r2 r15 11 11 // version: $Id: $ 12 12 // 13 // purpose: Class displaying a 2D plot on the ground station for laser range finder like Hokuyo 13 // purpose: Class displaying a 2D plot on the ground station for laser range 14 // finder like Hokuyo 14 15 // 15 16 // … … 26 27 using namespace flair::core; 27 28 28 namespace flair { namespace gui { 29 namespace flair { 30 namespace gui { 29 31 30 RangeFinderPlot::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; 32 RangeFinderPlot::RangeFinderPlot(const LayoutPosition *position, string name, 33 string x_name, float xmin, float xmax, 34 string y_name, float ymin, float ymax, 35 const cvmatrix *datas, float start_angle, 36 float end_angle, uint32_t nb_samples) 37 : SendData(position, name, "RangeFinderPlot", 200) { 38 this->datas = datas; 36 39 37 40 SetSendSize(datas->GetDataType().GetSize()); 38 41 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(); 42 SetVolatileXmlProp("xmin", xmin); 43 SetVolatileXmlProp("xmax", xmax); 44 SetVolatileXmlProp("ymin", ymin); 45 SetVolatileXmlProp("ymax", ymax); 46 SetVolatileXmlProp("x_name", x_name); 47 SetVolatileXmlProp("y_name", y_name); 48 SetVolatileXmlProp("start_angle", start_angle); 49 SetVolatileXmlProp("end_angle", end_angle); 50 SetVolatileXmlProp("nb_samples", nb_samples); 51 SetVolatileXmlProp( 52 "type", datas->GetDataType().GetElementDataType().GetDescription()); 53 SendXml(); 50 54 51 if(datas->Cols()!=1 || datas->Rows()!=nb_samples) Err("Wrong input matrix size\n"); 55 if (datas->Cols() != 1 || datas->Rows() != nb_samples) 56 Err("Wrong input matrix size\n"); 52 57 } 53 58 54 59 RangeFinderPlot::~RangeFinderPlot() {} 55 60 56 void RangeFinderPlot::CopyDatas(char *buf) const {57 58 memcpy(buf,datas->getCvMat()->data.ptr,datas->GetDataType().GetSize());59 61 void RangeFinderPlot::CopyDatas(char *buf) const { 62 datas->GetMutex(); 63 memcpy(buf, datas->getCvMat()->data.ptr, datas->GetDataType().GetSize()); 64 datas->ReleaseMutex(); 60 65 } 61 66
Note:
See TracChangeset
for help on using the changeset viewer.