source: pacpussensors/trunk/Sick/SickComponent.h@ 127

Last change on this file since 127 was 52, checked in by cfougera, 10 years ago

Memory leak bug resolved (dynamic memory allocation is no longer used).

File size: 2.6 KB
Line 
1/*********************************************************************
2// created: 2014-11-11 - 10:48
3// filename: SickComponent.h
4//
5// author: Cyril Fougeray
6// Copyright Heudiasyc UMR UTC/CNRS 6599
7//
8// version: $Id: $
9//
10// purpose: Declaration of the SickComponent class
11*********************************************************************/
12
13#ifndef SICKCOMPONENT_H
14#define SICKCOMPONENT_H
15
16#include "Pacpus/kernel/ComponentBase.h"
17#include "Pacpus/kernel/DbiteFile.h"
18
19#include <fstream>
20#include <QThread>
21#include <string>
22
23#include "SickLDMRSSensor.h"
24#include "SickLMSSensor.h"
25
26// Export macro for Sick DLL for Windows only
27#ifdef WIN32
28# ifdef SICK_EXPORTS
29 // make DLL
30# define SICK_API __declspec(dllexport)
31# else
32 // use DLL
33# define SICK_API __declspec(dllimport)
34# endif
35#else
36 // On other platforms, simply ignore this
37# define SICK_API
38#endif
39
40
41class QEvent;
42
43namespace pacpus {
44
45/**
46 * @brief The SickComponent class
47 *
48 * This class defines a PACPUS component used to acquire Sick lidars data.
49 */
50class SICK_API SickComponent
51 : /*public QThread
52 , */
53 public QObject, public ComponentBase
54{
55 Q_OBJECT
56
57public:
58 /// Constructor
59 SickComponent(QString name);
60
61 /// Destructor
62 ~SickComponent();
63
64 // void run() {}
65
66 virtual void stopActivity(); /*!< To stop the processing thread */
67 virtual void startActivity(); /*!< To start the processing thread */
68
69 /**
70 * @brief Configure compenent.
71 * @param config XML file passed in order to configure the Sick Component.
72 *
73 * This function instanciate every sensors configured through the XML file.
74 * The XML file must be formated as expected by this function.
75 * Depending on used sensors and how many, you should define these three property in a "Sick" node (X must start from '0') :
76 * - sickldmrs_X
77 * - sicklms151_X
78 * - sicklms511_X
79 *
80 * For example, let's say we have two Sick LMS151, one LDMRS and one LMS511 :
81 *
82 * <tt> <Sick type="SickComponent" sickldmrs_0="192.168.0.1:2111" sicklms151_0="192.168.0.10:2111" sicklms151_1="192.168.0.11:2111" sicklms511_0="192.168.1.50:2111" /> </tt>
83 *
84 * Do not forget \c type="SickComponent".
85 */
86 virtual ComponentBase::COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
87
88 SickComponent * myParent;
89
90private:
91 //! Vector of the different sensors used.
92 std::vector<AbstractSickSensor*> *S_sensors;
93};
94
95} // namespace pacpus
96
97#endif // SICKCOMPONENT_H
Note: See TracBrowser for help on using the repository browser.