openETCS
case study for the European Train Control System developed for the authors dissertation
|
Driver Machine Interface Qt4 class. More...
#include <DriverMachineInterfaceMOC.h>
Public Slots | |
void | DataEntered () throw () |
slot for notification about entered data | |
QStringList | GetInputs () |
gets all active inputs | |
::QStringList | GetOutputs () |
gets all available ouputs | |
QString | GetOutputValue (const QString &OutputName) |
gets a value of a certain output | |
bool | HasInput () |
gets the flag for the existence of any input field | |
void | SetBooleanValue (const QString &InputName, bool bValue) |
sets a value of an boolean input field | |
void | SetDoubleValue (const QString &InputName, double dValue) |
sets a value of an double input field | |
void | SetIntegerValue (const QString &InputName, int iValue) |
sets a value of an integer input field | |
void | SetStringValue (const QString &InputName, const QString &Value) |
sets a value of an string input field | |
virtual void | UpdateSlot () throw () |
slot after a Update() message from the EVC State Machine |
Signals | |
void | Error (const ::QString &ErrorMessage) |
signal for sending an error | |
void | Updated () |
signal emited, if a Update() message from the EVC state machine was received |
Public Member Functions | |
CDMIQWidget (oETCS::DF::CEVCStateMachine *const pStateMachine, QWidget *pWidgetParent=0, const bool &bSimAdaptor=false) throw () | |
general constructor | |
virtual void | Detached () throw () |
notifies an observer about it was detached by the EVC state machine | |
virtual void | Update () throw () |
updates the observer representation | |
virtual | ~CDMIQWidget () throw () |
destructor |
Static Public Member Functions | |
template<class ELEMENT_T , class CONTAINER_T = ::std::vector< ELEMENT_T >> | |
static bool | IsPartOf (const ELEMENT_T &Element, const CONTAINER_T &Container) throw () |
checks, if an element is part of an vector |
Protected Attributes | |
oETCS::DF::CEVCStateMachine *const | m_pStateMachine |
pointer to the related state machine |
Private Attributes | |
::std::vector< ::QPushButton * > | m_InputButtons |
vector of pointer to all push buttons to submit entered data by the driver | |
::std::vector< ::QWidget * > | m_InputWidgets |
vector with pointers to all input widgets | |
::std::vector< ::QLabel * > | m_Labels |
vector with pointers to labels used for inputs and outputs in grid layout | |
::QGridLayout | m_Layout |
layout object of the Dialog | |
::QMutex | m_Mutex |
mutable exclusion for setting DMI values while subject changes | |
::std::vector< ::QWidget * > | m_OutputWidgets |
vector with pointers to all output widgets | |
::ADMI * | m_pAdaptor |
pointer to the DMI adaptor object (used for simulation only) | |
oETCS::DF::CDMISubject * | m_pLastSubject |
poniter to the last subject used in Update(). |
Driver Machine Interface Qt4 class.
Observer implementation as Qt4 QWidget.
Definition at line 62 of file DriverMachineInterfaceMOC.h.
|
explicit |
general constructor
Attaches the concrete Qt4 observer to a EVC state machine object.
[in] | pStateMachine | pointer to the related state machine |
[in] | pWidgetParent | optional pointer to the parent QWidget object |
[in] | bSimAdaptor | optional flag to actiavate instance as D-Bus adaptor for simulation |
Definition at line 36 of file DriverMachineInterfaceMOC.cpp.
|
virtual |
destructor
Definition at line 100 of file DriverMachineInterfaceMOC.cpp.
References m_InputButtons, m_InputWidgets, m_Labels, m_Layout, m_OutputWidgets, and m_pAdaptor.
|
slot |
slot for notification about entered data
Definition at line 199 of file DriverMachineInterfaceMOC.cpp.
References oETCS::DF::BOOL, oETCS::DF::DOUBLE, oETCS::DF::DOUBLE_ARRAY, oETCS::DF::INT, IsPartOf(), oETCS::DF::CDMIInput::m_AllowedBoolInputs, oETCS::DF::CDMIInput::m_AllowedDoubleInputs, oETCS::DF::CDMIInput::m_AllowedIntInputs, oETCS::DF::CDMIInput::m_AllowedStringInputs, m_InputButtons, oETCS::DF::CDMISubject::m_Inputs, m_InputWidgets, m_Mutex, m_pLastSubject, and oETCS::DF::STRING.
Referenced by UpdateSlot().
|
virtual |
notifies an observer about it was detached by the EVC state machine
In the implementation for the Qt observer this cause a closing of the QWidget.
Implements oETCS::DF::CDMIObserver.
Definition at line 187 of file DriverMachineInterfaceMOC.cpp.
|
signal |
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 |
|
slot |
gets all active inputs
Definition at line 691 of file DriverMachineInterfaceMOC.cpp.
References m_InputWidgets, m_Labels, and m_OutputWidgets.
Referenced by HasInput().
|
slot |
gets all available ouputs
Definition at line 736 of file DriverMachineInterfaceMOC.cpp.
References m_Labels, m_Mutex, and m_OutputWidgets.
|
slot |
gets a value of a certain output
[in] | OutputName | name of the output field |
Definition at line 773 of file DriverMachineInterfaceMOC.cpp.
References m_InputWidgets, m_Labels, m_Mutex, and m_OutputWidgets.
|
slot |
gets the flag for the existence of any input field
Definition at line 836 of file DriverMachineInterfaceMOC.cpp.
References GetInputs().
|
inlinestatic |
checks, if an element is part of an vector
[in] | Element | element to be searched in container |
[in] | Container | container to be searched in |
Definition at line 293 of file DriverMachineInterfaceMOC.h.
Referenced by DataEntered().
|
slot |
sets a value of an boolean input field
[in] | InputName | name of the input field |
[in] | bValue | new value |
Definition at line 854 of file DriverMachineInterfaceMOC.cpp.
References m_InputButtons, m_InputWidgets, m_Labels, m_Mutex, and m_OutputWidgets.
|
slot |
sets a value of an double input field
[in] | InputName | name of the input field |
[in] | dValue | new value |
Definition at line 938 of file DriverMachineInterfaceMOC.cpp.
References m_InputButtons, m_InputWidgets, m_Labels, m_Mutex, and m_OutputWidgets.
|
slot |
sets a value of an integer input field
[in] | InputName | name of the input field |
[in] | iValue | new value |
Definition at line 1022 of file DriverMachineInterfaceMOC.cpp.
References m_InputButtons, m_InputWidgets, m_Labels, m_Mutex, and m_OutputWidgets.
|
slot |
sets a value of an string input field
[in] | InputName | name of the input field |
[in] | Value | new value |
Definition at line 1095 of file DriverMachineInterfaceMOC.cpp.
References m_InputButtons, m_InputWidgets, m_Labels, m_Mutex, and m_OutputWidgets.
|
virtual |
updates the observer representation
Implements oETCS::DF::CDMIObserver.
Definition at line 175 of file DriverMachineInterfaceMOC.cpp.
References Updated().
|
signal |
|
virtualslot |
slot after a Update() message from the EVC State Machine
Definition at line 407 of file DriverMachineInterfaceMOC.cpp.
References oETCS::DF::BOOL, DataEntered(), oETCS::DF::DOUBLE, oETCS::DF::DOUBLE_ARRAY, oETCS::DF::CEVCStateMachine::GetCurrentDMI(), oETCS::DF::INT, oETCS::DF::CDMIOutput::m_DoubleArrayMessage, m_InputButtons, oETCS::DF::CDMISubject::m_Inputs, m_InputWidgets, m_Labels, m_Layout, m_Mutex, oETCS::DF::CDMISubject::m_Outputs, m_OutputWidgets, m_pLastSubject, oETCS::DF::CDMIObserver::m_pStateMachine, and oETCS::DF::STRING.
|
private |
vector of pointer to all push buttons to submit entered data by the driver
Definition at line 278 of file DriverMachineInterfaceMOC.h.
Referenced by DataEntered(), SetBooleanValue(), SetDoubleValue(), SetIntegerValue(), SetStringValue(), UpdateSlot(), and ~CDMIQWidget().
|
private |
vector with pointers to all input widgets
Definition at line 257 of file DriverMachineInterfaceMOC.h.
Referenced by DataEntered(), GetInputs(), GetOutputValue(), SetBooleanValue(), SetDoubleValue(), SetIntegerValue(), SetStringValue(), UpdateSlot(), and ~CDMIQWidget().
|
private |
vector with pointers to labels used for inputs and outputs in grid layout
Definition at line 250 of file DriverMachineInterfaceMOC.h.
Referenced by GetInputs(), GetOutputs(), GetOutputValue(), SetBooleanValue(), SetDoubleValue(), SetIntegerValue(), SetStringValue(), UpdateSlot(), and ~CDMIQWidget().
|
private |
layout object of the Dialog
Definition at line 243 of file DriverMachineInterfaceMOC.h.
Referenced by UpdateSlot(), and ~CDMIQWidget().
|
private |
mutable exclusion for setting DMI values while subject changes
Definition at line 285 of file DriverMachineInterfaceMOC.h.
Referenced by DataEntered(), GetOutputs(), GetOutputValue(), SetBooleanValue(), SetDoubleValue(), SetIntegerValue(), SetStringValue(), and UpdateSlot().
|
private |
vector with pointers to all output widgets
Definition at line 264 of file DriverMachineInterfaceMOC.h.
Referenced by GetInputs(), GetOutputs(), GetOutputValue(), SetBooleanValue(), SetDoubleValue(), SetIntegerValue(), SetStringValue(), UpdateSlot(), and ~CDMIQWidget().
|
private |
pointer to the DMI adaptor object (used for simulation only)
Definition at line 236 of file DriverMachineInterfaceMOC.h.
Referenced by ~CDMIQWidget().
|
private |
poniter to the last subject used in Update().
Definition at line 271 of file DriverMachineInterfaceMOC.h.
Referenced by DataEntered(), and UpdateSlot().
|
protectedinherited |
pointer to the related state machine
Definition at line 1526 of file EVCStateMachine.h.
Referenced by UpdateSlot().
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/.