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

Last change on this file since 46 was 42, checked in by cfougera, 10 years ago

Last version

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 , public ComponentBase
53{
54 Q_OBJECT
55
56public:
57 /// Constructor
58 SickComponent(QString name);
59
60 /// Destructor
61 ~SickComponent();
62
63 void run() {}
64
65 virtual void stopActivity(); /*!< To stop the processing thread */
66 virtual void startActivity(); /*!< To start the processing thread */
67
68 /**
69 * @brief Configure compenent.
70 * @param config XML file passed in order to configure the Sick Component.
71 *
72 * This function instanciate every sensors configured through the XML file.
73 * The XML file must be formated as expected by this function.
74 * Depending on used sensors and how many, you should define these three property in a "Sick" node (X must start from '0') :
75 * - sickldmrs_X
76 * - sicklms151_X
77 * - sicklms511_X
78 *
79 * For example, let's say we have two Sick LMS151, one LDMRS and one LMS511 :
80 *
81 * <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>
82 *
83 * Do not forget \c type="SickComponent".
84 */
85 virtual ComponentBase::COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
86
87 SickComponent * myParent;
88
89private:
90 //! Vector of the different sensors used.
91 std::vector<AbstractSickSensor*> *S_sensors;
92};
93
94} // namespace pacpus
95
96#endif // SICKCOMPONENT_H
Note: See TracBrowser for help on using the repository browser.