openETCS
case study for the European Train Control System developed for the authors dissertation
|
simulative odometer class More...
#include <Simulation.h>
Signals | |
void | Error (const ::QString &ErrorMessage) |
signal for sending an error |
Public Member Functions | |
COdometer (const double &dInitialPosition=0.0, const double &dInitialVelocity=0.0) throw () | |
default/general constructor | |
virtual double | GetAbsolutePosition () |
gets the current absolute position | |
virtual double | GetVelocity () |
gets the current velocity | |
void | ResetPosition (const double &dPosition=0) throw () |
resets the position | |
void | SetVelocity (const double &dVelocity) throw () |
sets the current velocity | |
virtual | ~COdometer () throw () |
destructor |
Private Attributes | |
double | m_dPosition |
current position in [m] | |
double | m_dVelocity |
value of the current velocity in [km/h] | |
oETCS::DF::TIME_POINT_T | m_LastCalculation |
last calculation time point for the position | |
::std::recursive_mutex | m_Mutex |
muteable exclusion for internal states |
simulative odometer class
Definition at line 53 of file Simulation.h.
|
explicit |
default/general constructor
[in] | dInitialPosition | optional initial position (default 0.0) in [m] |
[in] | dInitialVelocity | optional initial velocity (default 0.0) in [km/h] |
Definition at line 39 of file Simulation.cpp.
|
virtual |
destructor
Reimplemented from oETCS::DF::PS::COdometer.
Definition at line 54 of file Simulation.cpp.
|
signalinherited |
signal for sending an error
This signal should be emitted in the case that an error in the HW ocurres.
[in] | ErrorMessage | textual description of the error |
Definition at line 802 of file PlatformSpecificClientsMOC.cpp.
|
virtual |
gets the current absolute position
Calculates the position by integrating the current speed over the time difference from the last calculation time point m_LastCalculation.
Reimplemented from oETCS::DF::PS::COdometer.
Definition at line 65 of file Simulation.cpp.
References m_dPosition, m_dVelocity, m_LastCalculation, and m_Mutex.
Referenced by GetPosition().
|
virtual |
gets the current velocity
Reimplemented from oETCS::DF::PS::COdometer.
Definition at line 97 of file Simulation.cpp.
References m_dVelocity, and m_Mutex.
Referenced by GetVelocity(), and oETCS::DF::PS::SIM::CServiceBrake::OdometerThread().
void oETCS::DF::PS::SIM::COdometer::ResetPosition | ( | const double & | dPosition = 0 | ) | throw () |
resets the position
Also resets the last calculation time to now.
[in] | dPosition | optinal position in [m] |
Definition at line 154 of file Simulation.cpp.
Referenced by ResetPosition().
void oETCS::DF::PS::SIM::COdometer::SetVelocity | ( | const double & | dVelocity | ) | throw () |
sets the current velocity
Also calculates the position by integrating the old speed over the time difference from the last calculation time point m_LastCalculation.
[in] | dVelocity | new velocity in [km/s] |
Definition at line 122 of file Simulation.cpp.
Referenced by oETCS::DF::PS::SIM::CServiceBrake::OdometerThread(), and SetVelocity().
|
private |
current position in [m]
Definition at line 129 of file Simulation.h.
Referenced by GetAbsolutePosition().
|
private |
value of the current velocity in [km/h]
Definition at line 122 of file Simulation.h.
Referenced by GetAbsolutePosition(), and GetVelocity().
|
private |
last calculation time point for the position
Definition at line 136 of file Simulation.h.
Referenced by GetAbsolutePosition().
|
private |
muteable exclusion for internal states
Definition at line 143 of file Simulation.h.
Referenced by GetAbsolutePosition(), and GetVelocity().
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/.