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 | /*!
|
---|
6 | * \file VrpnClient.h
|
---|
7 | * \brief Class to connect to a Vrpn server
|
---|
8 | * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS
|
---|
9 | * 7253
|
---|
10 | * \date 2013/04/03
|
---|
11 | * \version 4.0
|
---|
12 | */
|
---|
13 |
|
---|
14 | #ifndef VRPNCLIENT_H
|
---|
15 | #define VRPNCLIENT_H
|
---|
16 |
|
---|
17 | #include <Thread.h>
|
---|
18 |
|
---|
19 | namespace flair {
|
---|
20 | namespace core {
|
---|
21 | class FrameworkManager;
|
---|
22 | class SerialPort;
|
---|
23 | }
|
---|
24 | namespace gui {
|
---|
25 | class TabWidget;
|
---|
26 | class Layout;
|
---|
27 | }
|
---|
28 | }
|
---|
29 |
|
---|
30 | class VrpnClient_impl;
|
---|
31 | class VrpnObject_impl;
|
---|
32 |
|
---|
33 | namespace flair {
|
---|
34 | namespace sensor {
|
---|
35 | /*! \class VrpnClient
|
---|
36 | *
|
---|
37 | * \brief Class to connect to a Vrpn server
|
---|
38 | */
|
---|
39 | class VrpnClient : public core::Thread {
|
---|
40 | friend class ::VrpnObject_impl;
|
---|
41 |
|
---|
42 | public:
|
---|
43 | /*!
|
---|
44 | * \brief Constructor
|
---|
45 | *
|
---|
46 | * Construct a VrpnClient. Connection is done by IP.
|
---|
47 | *
|
---|
48 | * \param parent parent
|
---|
49 | * \param name name
|
---|
50 | * \param address server address
|
---|
51 | * \param us_period Thread period in us
|
---|
52 | * \param priority priority of the Thread
|
---|
53 | */
|
---|
54 | VrpnClient(const core::FrameworkManager *parent, std::string name,
|
---|
55 | std::string address, uint16_t us_period, uint8_t priority);
|
---|
56 |
|
---|
57 | /*!
|
---|
58 | * \brief Constructor
|
---|
59 | *
|
---|
60 | * Construct a VrpnClient. Connection is done by XBee modem.
|
---|
61 | *
|
---|
62 | * \param parent parent
|
---|
63 | * \param name name
|
---|
64 | * \param serialport SerialPort for XBee modem
|
---|
65 | * \param us_period Xbee RX timeout in us
|
---|
66 | * \param priority priority of the Thread
|
---|
67 | */
|
---|
68 | VrpnClient(const core::FrameworkManager *parent, std::string name,
|
---|
69 | core::SerialPort *serialport, uint16_t us_period,
|
---|
70 | uint8_t priority);
|
---|
71 |
|
---|
72 | /*!
|
---|
73 | * \brief Destructor
|
---|
74 | *
|
---|
75 | */
|
---|
76 | ~VrpnClient();
|
---|
77 |
|
---|
78 | /*!
|
---|
79 | * \brief Setup Layout
|
---|
80 | *
|
---|
81 | * \return a Layout available
|
---|
82 | */
|
---|
83 | gui::Layout *GetLayout(void) const;
|
---|
84 |
|
---|
85 | /*!
|
---|
86 | * \brief Setup Tab
|
---|
87 | *
|
---|
88 | * \return a Tab available
|
---|
89 | */
|
---|
90 | gui::TabWidget *GetTabWidget(void) const;
|
---|
91 |
|
---|
92 | /*!
|
---|
93 | * \brief Is XBee used?
|
---|
94 | *
|
---|
95 | * \return true if connection is based on XBee modem
|
---|
96 | */
|
---|
97 | bool UseXbee(void) const;
|
---|
98 |
|
---|
99 | private:
|
---|
100 | /*!
|
---|
101 | * \brief Run function
|
---|
102 | *
|
---|
103 | * Reimplemented from Thread.
|
---|
104 | *
|
---|
105 | */
|
---|
106 | void Run(void);
|
---|
107 |
|
---|
108 | class VrpnClient_impl *pimpl_;
|
---|
109 | };
|
---|
110 | } // end namespace sensor
|
---|
111 | } // end namespace flair
|
---|
112 | #endif // VRPNCLIENT_H
|
---|