openETCS
case study for the European Train Control System developed for the authors dissertation
AdaptorStubsMOC.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010-2012
3  Johannes Feuser <feuser@uni-bremen.de>
4  This file is part of the openETCS library.
5 
6  The openETCS library is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  any later version.
10 
11  The openETCS library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with the openETCS library. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 /*!
21  * \author Johannes Feuser <feuser@uni-bremen.de>
22  * \brief empty (no implemented methods) classes for the dbus adaptor classes
23  */
24 
25 #ifndef __OETCS_DF_PS_ADAPTORSTUBSMOC_H__
26 #define __OETCS_DF_PS_ADAPTORSTUBSMOC_H__
27 
28 
29 
30 
31 #include <QObject>
32 #include <QString>
33 #include <list>
34 #include <QBitArray>
35 
36 
37 
38 
39 
40 namespace oETCS {
41 
42 namespace DF {
43 
44 namespace PS {
45 
46 
47 /*!
48  * \brief empty/stub class for the ::oETCS::DF::ABaliseDeviceIn adapter
49  *
50  * This class is meant to be extened for any certain in Balise device implementation.
51  */
52 class CBaliseDeviceIn : public ::QObject
53 {
54  Q_OBJECT
55  public:
56  /*!
57  * \brief default/general constructor
58  *
59  * \param[in] pParent optional pointer to a parent object, must be used,
60  * if stub is exetened by inheritance
61  */
62  CBaliseDeviceIn(::QObject * const pParent = nullptr) throw();
63 
64 
65 
66  /*!
67  * \brief destructor
68  */
69  virtual ~CBaliseDeviceIn() throw();
70 
71 
72 
73 
74  Q_SIGNALS:
75  /*!
76  * \brief signal for sending a new telegram
77  *
78  * This signal should be emitted, if a new telegram was received by the HW.
79  *
80  * \param[in] Bytes array of bytes of the new telegram
81  * \param[in] iBits number of bits only used from the beginning in the byte array
82  */
83  void NewTelegram(const QByteArray & Bytes, int iBits);
84 
85 
86 
87  /*!
88  * \brief signal for sending an error
89  *
90  * This signal should be emitted in the case that an error in the HW ocurres.
91  *
92  * \param[in] ErrorMessage textual description of the error
93  */
94  void Error(const ::QString& ErrorMessage);
95 
96 
97 
98 
99  private:
100  /*!
101  * \brief list of telegrams to be send (by polling/calling)
102  */
103  ::std::list< ::QBitArray > m_Telegrams;
104 
105 
106 
107 
108 }; // class CBaliseDeviceIn : public ::QObject
109 
110 
111 
112 /*!
113  * \brief empty/stub class for the ::oETCS::DF::ABaliseDeviceOut adapter
114  *
115  * This class is meant to be extened for any certain in Balise device implementation.
116  */
118 {
119  Q_OBJECT
120  public:
121  /*!
122  * \brief default/general constructor
123  *
124  * \param[in] pParent optional pointer to a parent object, must be used,
125  * if stub is exetened by inheritance
126  */
127  CBaliseDeviceOut(::QObject * const pParent = nullptr) throw();
128 
129 
130 
131  /*!
132  * \brief destructor
133  */
134  virtual ~CBaliseDeviceOut() throw();
135 
136 
137 
138 public Q_SLOTS:
139  /*!
140  * \brief sends a telegram
141  *
142  * This method should be reimplemented or extened for a concrete HW device.
143  *
144  * \param[in] Bits telegram to send as bits
145  */
146  virtual void SendTelegram(const ::QBitArray& Bits);
147 
148 
149 
150 
151  Q_SIGNALS:
152  /*!
153  * \brief signal for sending an error
154  *
155  * This signal should be emitted in the case that an error in the HW ocurres.
156  *
157  * \param[in] ErrorMessage textual description of the error
158  */
159  void Error(const ::QString& ErrorMessage);
160 
161 
162 
163 
164 }; // class CBaliseDeviceOut : public ::QObject
165 
166 
167 
168 /*!
169  * \brief empty/stub class for the ::oETCS::DF::AEmergencyBrake adapter
170  *
171  * This class is meant to be extened for any certain in emergency brake device implementation.
172  */
173 class CEmergencyBrake : public ::QObject
174 {
175  Q_OBJECT
176  public:
177  /*!
178  * \brief default/general constructor
179  *
180  * \param[in] pParent optional pointer to a parent object, must be used,
181  * if stub is exetened by inheritance
182  */
183  CEmergencyBrake(::QObject * const pParent = nullptr) throw();
184 
185 
186 
187  /*!
188  * \brief destructor
189  */
190  virtual ~CEmergencyBrake() throw();
191 
192 
193 
194 public Q_SLOTS:
195  /*!
196  * \brief gets the activation state
197  *
198  * This method should be reimplemented or extened for a concrete HW device.
199  *
200  * \return activation flag of the emergency brake
201  */
202  virtual bool GetActivation();
203 
204 
205 
206  /*!
207  * \brief sets the activation state
208  *
209  * This method should be reimplemented or extened for a concrete HW device.
210  *
211  * \param[in] bActivated the new activation flag
212  */
213  virtual void SetActivation(bool bActivated);
214 
215 
216 
217 
218  Q_SIGNALS:
219  /*!
220  * \brief signal for sending an error
221  *
222  * This signal should be emitted in the case that an error in the HW ocurres.
223  *
224  * \param[in] ErrorMessage textual description of the error
225  */
226  void Error(const ::QString& ErrorMessage);
227 
228 
229 
230 
231 }; // class CEmergencyBrake : public ::QObject
232 
233 
234 
235 /*!
236  * \brief empty/stub class for the ::oETCS::DF::AServiceBrake adapter
237  *
238  * This class is meant to be extened for any certain in service brake device implementation.
239  */
240 class CServiceBrake : public ::QObject
241 {
242  Q_OBJECT
243  public:
244  /*!
245  * \brief default/general constructor
246  *
247  * \param[in] pParent optional pointer to a parent object, must be used,
248  * if stub is exetened by inheritance
249  */
250  CServiceBrake(::QObject * const pParent = nullptr) throw();
251 
252 
253 
254  /*!
255  * \brief destructor
256  */
257  virtual ~CServiceBrake() throw();
258 
259 
260 
261 public Q_SLOTS:
262  /*!
263  * \brief gets the activation intensity
264  *
265  * This method should be reimplemented or extened for a concrete HW device.
266  *
267  * \return activation intensity of the service brake in [%]
268  */
269  virtual double GetIntensity();
270 
271 
272 
273  /*!
274  * \brief sets the activation intensity
275  *
276  * This method should be reimplemented or extened for a concrete HW device.
277  *
278  * \param[in] bIntensity the new activation intensity in [%]
279  */
280  virtual void SetIntensity(const double& dIntensity);
281 
282 
283 
284 
285  Q_SIGNALS:
286  /*!
287  * \brief signal for sending an error
288  *
289  * This signal should be emitted in the case that an error in the HW ocurres.
290  *
291  * \param[in] ErrorMessage textual description of the error
292  */
293  void Error(const ::QString& ErrorMessage);
294 
295 
296 
297 
298 }; // class CServiceBrake : public ::QObject
299 
300 
301 
302 /*!
303  * \brief empty/stub class for the ::oETCS::DF::AOdometer adapter
304  *
305  * This class is meant to be extened for any certain in odometer device implementation.
306  */
307 class COdometer : public ::QObject
308 {
309  Q_OBJECT
310  public:
311  /*!
312  * \brief default/general constructor
313  *
314  * \param[in] pParent optional pointer to a parent object, must be used,
315  * if stub is exetened by inheritance
316  */
317  COdometer(::QObject * const pParent = nullptr) throw();
318 
319 
320 
321  /*!
322  * \brief destructor
323  */
324  virtual ~COdometer() throw();
325 
326 
327 
328 public Q_SLOTS:
329  /*!
330  * \brief gets the current absolute position
331  *
332  * This method should be reimplemented or extened for a concrete HW device.
333  *
334  * \return current absolute position in [m]
335  */
336  virtual double GetAbsolutePosition();
337 
338 
339 
340  /*!
341  * \brief gets the current velocity
342  *
343  * This method should be reimplemented or extened for a concrete HW device.
344  *
345  * \return current velocity in [km/h]
346  */
347  virtual double GetVelocity();
348 
349 
350 
351 
352  Q_SIGNALS:
353  /*!
354  * \brief signal for sending an error
355  *
356  * This signal should be emitted in the case that an error in the HW ocurres.
357  *
358  * \param[in] ErrorMessage textual description of the error
359  */
360  void Error(const ::QString& ErrorMessage);
361 
362 
363 
364 
365 }; // class COdometer : public ::QObject
366 
367 
368 
369 
370 
371 } // namespace oETCS::DF::PS
372 
373 } // namespace oETCS::DF
374 
375 } // namespace oETCS
376 
377 #endif // __ OETCS_DF_PS_ADAPTORSTUBSMOC_H__

Copyright (C) 2010-2012 Johannes Feuser (feuser@uni-bremen.de)
The openETCS library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
The openETCS library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the openETCS library. If not, see "http://www.gnu.org/licenses/.