| 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/22
|
---|
| 6 | // filename: LaserRangeFinder.cpp
|
---|
| 7 | //
|
---|
| 8 | // author: César RICHARD
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: Classe generique des recepteurs LaserRangeFinder
|
---|
| 14 | //
|
---|
| 15 | //
|
---|
| 16 | /*********************************************************************/
|
---|
| 17 |
|
---|
| 18 | #include "LaserRangeFinder.h"
|
---|
| 19 | #include <cvmatrix.h>
|
---|
| 20 | #include <Tab.h>
|
---|
| 21 | #include <TabWidget.h>
|
---|
| 22 | #include <GridLayout.h>
|
---|
| 23 | #include <GroupBox.h>
|
---|
| 24 | #include <PushButton.h>
|
---|
| 25 | #include <FrameworkManager.h>
|
---|
| 26 | #include <Label.h>
|
---|
| 27 | #include <RangeFinderPlot.h>
|
---|
| 28 | #include <string.h>
|
---|
| 29 |
|
---|
| 30 | using std::string;
|
---|
| 31 | using namespace flair::core;
|
---|
| 32 | using namespace flair::gui;
|
---|
| 33 |
|
---|
| 34 | namespace flair { namespace sensor {
|
---|
| 35 |
|
---|
| 36 | LaserRangeFinder::LaserRangeFinder(const FrameworkManager* parent,string name) : IODevice(parent,name) {
|
---|
| 37 | cvmatrix_descriptor* desc=new cvmatrix_descriptor(360,1);
|
---|
| 38 | output=new cvmatrix(this,desc,floatType);
|
---|
| 39 | AddDataToLog(output);
|
---|
| 40 |
|
---|
| 41 | //station sol
|
---|
| 42 | main_tab=new Tab(parent->GetTabWidget(),name);
|
---|
| 43 | tab=new TabWidget(main_tab->NewRow(),name);
|
---|
| 44 | sensor_tab=new Tab(tab,"Reglages");
|
---|
| 45 | setup_groupbox=new GroupBox(sensor_tab->NewRow(),name);
|
---|
| 46 |
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | LaserRangeFinder::LaserRangeFinder(const IODevice* parent,std::string name) : IODevice(parent,name)
|
---|
| 50 | {
|
---|
| 51 | plot_tab=NULL;
|
---|
| 52 | main_tab=NULL;
|
---|
| 53 | tab=NULL;
|
---|
| 54 | sensor_tab=NULL;
|
---|
| 55 | setup_groupbox=NULL;
|
---|
| 56 |
|
---|
| 57 | output=NULL;
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 | LaserRangeFinder::~LaserRangeFinder()
|
---|
| 61 | {
|
---|
| 62 |
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 |
|
---|
| 66 | GroupBox* LaserRangeFinder::GetGroupBox(void) const
|
---|
| 67 | {
|
---|
| 68 | return setup_groupbox;
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | Layout* LaserRangeFinder::GetLayout(void) const
|
---|
| 72 | {
|
---|
| 73 | return sensor_tab;
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 |
|
---|
| 77 | RangeFinderPlot* LaserRangeFinder::GetPlot(void) const
|
---|
| 78 | {
|
---|
| 79 | return plot;
|
---|
| 80 | }
|
---|
| 81 |
|
---|
| 82 | void LaserRangeFinder::UseDefaultPlot(void)
|
---|
| 83 | {
|
---|
| 84 | if(tab==NULL)
|
---|
| 85 | {
|
---|
| 86 | Err("not applicable for simulation part.\n");
|
---|
| 87 | return;
|
---|
| 88 | }
|
---|
| 89 |
|
---|
| 90 | plot_tab=new Tab(tab,"Mesures");
|
---|
| 91 | plot=new RangeFinderPlot(plot_tab->NewRow(),"plot","x",-30,30,"y",-30,30,output,0,359,output->Rows());
|
---|
| 92 | }
|
---|
| 93 | } // end namespace sensor
|
---|
| 94 | } // end namespace flair
|
---|