source: flair-src/trunk/lib/FlairSensorActuator/src/LaserRangeFinder.cpp @ 42

Last change on this file since 42 was 15, checked in by Bayard Gildas, 6 years ago

sources reformatted with flair-format-dir script

File size: 2.1 KB
RevLine 
[3]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[3]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
30using std::string;
31using namespace flair::core;
32using namespace flair::gui;
33
[15]34namespace flair {
35namespace sensor {
[3]36
[15]37LaserRangeFinder::LaserRangeFinder(const FrameworkManager *parent, string name)
38    : IODevice(parent, name) {
39  cvmatrix_descriptor *desc = new cvmatrix_descriptor(360, 1);
40  output = new cvmatrix(this, desc, floatType);
41  AddDataToLog(output);
[3]42
[15]43  // station sol
44  main_tab = new Tab(parent->GetTabWidget(), name);
45  tab = new TabWidget(main_tab->NewRow(), name);
46  sensor_tab = new Tab(tab, "Reglages");
47  setup_groupbox = new GroupBox(sensor_tab->NewRow(), name);
[3]48}
49
[15]50LaserRangeFinder::LaserRangeFinder(const IODevice *parent, std::string name)
51    : IODevice(parent, name) {
52  plot_tab = NULL;
53  main_tab = NULL;
54  tab = NULL;
55  sensor_tab = NULL;
56  setup_groupbox = NULL;
[3]57
[15]58  output = NULL;
[3]59}
60
[15]61LaserRangeFinder::~LaserRangeFinder() {}
[3]62
[15]63GroupBox *LaserRangeFinder::GetGroupBox(void) const { return setup_groupbox; }
[3]64
[15]65Layout *LaserRangeFinder::GetLayout(void) const { return sensor_tab; }
[3]66
[15]67RangeFinderPlot *LaserRangeFinder::GetPlot(void) const { return plot; }
[3]68
[15]69void LaserRangeFinder::UseDefaultPlot(void) {
70  if (tab == NULL) {
71    Err("not applicable for simulation part.\n");
72    return;
73  }
[3]74
[15]75  plot_tab = new Tab(tab, "Mesures");
76  plot = new RangeFinderPlot(plot_tab->NewRow(), "plot", "x", -30, 30, "y", -30,
77                             30, output, 0, 359, output->Rows());
[3]78}
79} // end namespace sensor
80} // end namespace flair
Note: See TracBrowser for help on using the repository browser.