openPASS GUI: Modules

Documentation of openPASS-GUI 0.6
Modules
Here is a list of all modules:
Agent Configuration Plugin | The Agent Configuration Plugin provides a graphical user interface for creating agent profiles to be used in a scenarion-based traffic simulation
Component Plugin | The Component Plugin (CP) is dedicated for managing the component XML metadata
System Plugin | The System Plugin (SP) is dedicated for modelling systems
Traffic Simulation Plugin | The Traffic Simulation Plugin provides a graphical user interface for configuring scenario-based simulations
Window Plugin | The Window Plugin (WP) is dedicated for managing the View of the application
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Agent Configuration Plugin

Files
Agent Configuration Plugin

The Agent Configuration Plugin provides a graphical user interface for creating agent profiles to be used in a scenarion-based traffic simulation. More...

Files

file | AgentConfigurationCombinationPresenter.h
This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of this plugin to the profiles catalogue XML file needed by the simulation slave.
file | AgentConfigurationInterface.h
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-relevant ProfilesCatalog.xml files.
file | AgentConfigurationModel.h
This class implements the functionality of AgentConfigurationInterface.
file | AgentConfigurationPresenter.h
This class defines the presenter object which handles events from the view (AgentConfigurationView) and edits the model data (AgentConfigurationInterface) accordingly.
file | AgentConfigurationView.h
This class constitutes the main view of the agent configuration plugin. It instantiates the action menu as well as a tab widget as a container widget for views of agent, driver and vehicle profiles as well as the undo stack. The main task of this view is to emit signals upon user actions on the action menu which are handled in the corresponding prestenter object (AgentConfigurationPresenter).
file | AgentItemInterface.h
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-relevant profiles cataloge (*.xml) under <AgentProfiles>.
file | AgentItemModel.h
This class implements the functionality of AgentItemInterface.
file | AgentItemModel.h
This class implements the functionality of AgentItemInterface.
file | AgentMapInterface.h
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map.
file | AgentMapModel.h
This class implements the functionality of AgentMapInterface.
file | AgentMapPresenter.h
This file contains the class AgentMapPresenter defining the presenter object for agent profiles as well as the classes for all undo-command objects used by AgentMapPresenter.
file | AgentMapView.h
This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu for selecting a profile to be edited as well as buttons for removing and adding agent profiles. Further, a menu for editing the type ("dynamic" or "static") is provided whose selection switches between two different views. If the type "dynamic" is selected, two tables for assigning driver and vehicle profiles with probabilities appear. If type "static" is selected, the view is reduced to a selection menu for a system config + system as well as a vehicle model catalogue + model. The switching between the two modes is realized via a stacked widget whose pages contain the GUI elements being exclusive for the selected mode. Further information on how to use this view can be found in the GUI tutorial.
file | DriverProfileItemInterface.h
This class defines objects containing all relevant information on driver profiles.
file | DriverProfileItemModel.h
This class implements the functionality of DriverProfileItemInterface.
file | DriverProfileMapInterface.h
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map.
file | DriverProfileMapModel.h
This class implements the functionality of DriverProfileMapInterface.
file | DriverProfilesMapPresenter.h
This class constitutes the re-implementation of QAbstractTableModel for the table view of driver profiles. In fact, this class implements a wrapper for the map of driver profiles (DriverProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework.
file | DriverProfilesPresenter.h
This file contains the class DriverProfilesPresenter defining the presenter object for driver profiles as well as the classes for all undo-command objects used by DriverProfilesPresenter.
file | DriverProfilesView.h
This class defines the view for editing driver profiles. The view constitutes a combo box for switching between different driver profiles, add-, remove- and rename buttons and a table view for editing the parameters of the driver profile. Further information on how to use this view can be found in the GUI tutorial.
file | ParameterItemInterface.h
This class defines parameters.
file | ParameterItemModel.h
This class implements the functionality of ParameterItemInterface.
file | ParameterMapInterface.h
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.
file | ParameterMapModel.h
This class implements the functionality of ParameterMapInterface.
file | ParameterMapPresenter.h
This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters. In fact, this class implements a wrapper for the map of parameters (ParameterMapInterface) to be editable by QTableView objects within Qt's Model/View framework.
file | SensorItemInterface.h
This file contains the class declaration of a sensor data object as well as a structure for a sensor position.
file | SensorItemModel.h
This class implements the functionality of SensorItemInterface.
file | SensorMapInterface.h
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are registered. It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.
file | SensorMapModel.h
This class implements the functionality of SensorMapInterface.
file | SensorProfileItemInterface.h
This class defines objects containing all relevant information on sensor profiles.
file | SensorProfileItemModel.h
This class implements the functionality of SensorProfileItemInterface.
file | SensorProfileMapInterface.h
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInterface) are registered. As a key identifier the pair of sensor name and type (corrsponding to its implementation) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.
file | SensorProfileMapModel.h
This class implements the functionality of SensorProfileMapInterface.
file | SystemProfilePresenter.h
This class constitutes the re-implementation of QAbstractTableModel for the table view of systems with a given algorithm type. The corresponding model data object is referred to as "system profile". In fact, this class implements a wrapper for these system profiles to be editable by QTableView objects within Qt's Model/View framework.
file | SystemProfileView.h
This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm type onto probabilities.
file | VehicleComponentItemInterface.h
The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a algorithms that will be built into a vehicle with a certain probability.
file | VehicleComponentItemModel.h
This class implements the functionality of VehicleComponentItemInterface.
file | VehicleComponentMapInterface.h
This class constitutes a container class for vehicle component data (instances of VehicleComponentItemInterface) using the vehicle component's type (i.e. the algorithm it represents) as a key identifier. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.
file | VehicleComponentMapModel.h
This class implements the functionality of VehicleComponentMapInterface.
file | VehicleComponentProfileItemInterface.h
This class defines vehicle component profiles which contain the parameterization of a vehicle component, i.e. an instance of the VehicleComponentItemInterface class.
file | VehicleComponentProfileItemModel.h
This class implements the functionality of VehicleComponentProfileItemInterface.
file | VehicleComponentProfileMapInterface.h
This class constitutes a container class for vehicle component profiles (instances of VehicleComponentProfileItemInterface). As a key identifier the pair of the profile's name and type (corrsponding to to the implementation/algorithm of the vehicle component) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.
file | VehicleComponentProfileMapModel.h
This class implements the functionality of VehicleComponentProfileMapInterface.
file | VehicleProfileItemInterface.h
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the simulation.
file | VehicleProfileItemModel.h
This class implements the functionality of VehicleProfileItemInterface.
file | VehicleProfileMapInterface.h
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map.
file | VehicleProfileMapModel.h
This class implements the functionality of VehicleProfileMapInterface.
file | VehicleProfilesMapPresenter.h
This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle profiles. In fact, this class implements a wrapper for the map of vehicle profiles (VehicleProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework.
file | VehicleProfilesPresenter.h
This file contains the class VehicleProfilesPresenter defining the presenter object for vehicle profiles as well as the classes for all undo-command objects used by VehicleProfilesPresenter.
file | VehicleProfilesView.h
This class defines the view for editing vehicle profiles. The view constitutes a combo box for selecting and buttons for adding, removing and renaming vehicle profiles. Further, GUI elements for vehicle model catalogue and vehicle model as well as for the system config are provided. Systems defined in a system config are sorted by the algorithm type used therein. For the corresponding selection of an algorithm type, a combo box including add- and remove- buttons is set up. The dynamic instantiation of the table views for systems of a certain algorithm type (SystemProfileView) is performed in the presenter object (VehicleProfilesPresenter). This object calls public methods of this class in order to instantiate the table views and and lay them out in this widget.

Detailed Description

The Agent Configuration Plugin provides a graphical user interface for creating agent profiles to be used in a scenarion-based traffic simulation.

Agent Configuration Plugin

The Agent Configuration Plugin provides a graphical user interface for configuring agent profiles to be used in a scenario-based simulation. Agent profiles can be of "dynamic" or "static" type. Static agent profiles contain a static definition of an agent by a vehicle model and a system from a system config XML file. The system exactly determines the agent's tasks during a simulation cycle. In contrast, dynamic agent profiles only refer to vehicle and driver profiles from which an agent is stochastically built and spawned in the simulation world. The corresponding vehicle and driver profiles are also defined in the profiles catalogue and, hence, configured in this plugin as well. Vehicle profiles contain instructions on how to build a vehicle. They contain a vehicle model as well as optional safety systems that can be assigned to probabilities which determine whether it is instantiated in a simulation. Furthermore, the concrete parameterisation of these systems can be made stochastic as well. Driver profiles describe the drivers behaviour (driver model) and the parameterization. So far, only one driver model (which follows the agent in front) is implemented. For further details on the profile-based agent configuration ansat, please consult the documentation of the simulation framework.

It should be noted that there is a temporary coexistence of two XML files for storing the definition of agent profiles. On one hand, there is the actual XML-file required by the simulation core and, on the other hand, there is a ui-file which restores the view of the GUI. The reason for this coexistence is, that during the development process, it turned out that vehicle profiles of the XML-file contain pieces of information which is usually provided by a system config file. In order to maintain a consistent way of defining systems via a system config in the system editor, we decided to write an exporter which gathers these pieces of information from a system config file. Thus, when configuring vehicle profiles via the GUI, the user selects systems from a system config and assigns them to probabilties. In the exporter, the definitions are then exported to the XML-file required by the simulation core. In order to be also able to restore the GUI's view, using the reference to a system config, the ui-file has been developed as a temporary work around.

This plugin is implemented using a model-presenter-view architectual pattern. The model classes define the basic objects for containing the values of the XML elements of the profile catalogue XML file. They also provide setter and getter methods for editing its content. In all cases, the model classes do not know about the presenters and views. The view classes define the appearence and and UI objects the user can interact with. In this implementation, the views are entirely passive, i.e. they contain no logic of the application and, especially, do not know about the model objects.

All user interfactions with the view lead to the emisson of signals which are noticed by the presenters. These presenter classes define the logic of the application, i.e. all signals emitted by views are connected to slots which edit the model using its setter and getter methods. Sometimes, models also send signals after they have been edited such that the views can be updated to display the new model values. This usually happens when the same model is presented to more than one view. All operations of the presenter on model data can be undone and redone. For this purpose, Qt's Undo Framework is applied, i.e. all commands are encapsulated into command objects whose classes re-implement the redo/undo methods of the base class QUndoCommand. These classes are usually declared in the same file which also contains the presenter class. The corresponding presenter object usually instantiates the command object and pushes it to the undo stack.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationCombinationPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
Classes
AgentConfigurationCombinationPresenter.h File Reference
Agent Configuration Plugin

This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of this plugin to the profiles catalogue XML file needed by the simulation slave. More...

Detailed Description

This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of this plugin to the profiles catalogue XML file needed by the simulation slave.

The only reason why this class exists is because, for a dynamic agent profile, the profiles catalogue partly repeats information already contained in a system config file. In order to maintain a consistent way of defining systems using the system config, this presenter object gathers the required information from the system config and exports it into the format needed by the profiles catalogue.

Note
In future releases, the way of defining dynamic and static agent will be unified in order to avoid such a doubling of information in two different files. Hence, this class is only temporary and we refrain from giving a detailed documentation here.

Definition in file AgentConfigurationCombinationPresenter.h.

Go to the source code of this file.

Classes

class AgentConfigurationCombinationPresenter
This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of this plugin to the profiles catalogue XML file needed by the simulation slave. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationCombinationPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
AgentConfigurationCombinationPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
30
31 #ifndef VEHICLEPROFILESCOMBINATIONPRESENTER_H
32 #define VEHICLEPROFILESCOMBINATIONPRESENTER_H
33
34 #include "openPASS-System/SystemInterface.h"
35 #include "openPASS-AgentConfiguration/VehicleProfileMapInterface.h"
36 #include "openPASS-AgentConfiguration/SensorProfileMapInterface.h"
37 #include "openPASS-AgentConfiguration/VehicleComponentProfileMapInterface.h"
38 #include "openPASS-Project/ProjectInterface.h"
39
40 #include "Models/AgentConfigurationCombinationXMLSaveModel.h"
41
42 #include "Views/AgentConfigurationView.h"
43
44 #include <QObject>
45
46 //-----------------------------------------------------------------------------
62 //-----------------------------------------------------------------------------
63 class AgentConfigurationCombinationPresenter : public QObject
64 {
65 Q_OBJECT
66
67 public:
68 explicit AgentConfigurationCombinationPresenter(AgentConfigurationInterface * agentConfiguration,
69 AgentConfigurationView *agentConfigurationView,
70 SystemInterface * system,
71 ProjectInterface * const project,
72 QObject *parent = nullptr);
73
74
75 ~AgentConfigurationCombinationPresenter() = default;
76
77 public Q_SLOTS:
78 void convert();
79
80 private:
81 void addSystem(QString const & systemTitle);
82
83 void addVehicleComponentProfile(VehicleComponentProfileMapInterface::ID id,
84 SystemComponentParameterMapInterface * parameters );
85
86 void addSensor(SystemComponentItemInterface * sensor,
87 VehicleComponentItemInterface * component,
88 SystemComponentInputItemInterface const * AlgoInput);
89
90 private:
91 SensorProfileItemInterface * findSensorProfile(SystemComponentItemInterface * sensor);
92
93 SensorItemInterface * findVehicleSensor(SystemComponentItemInterface * sensor,
94 SensorProfileItemInterface * profile);
95
96 bool sensorParametersIdentical(ParameterMapInterface* profileParameters,
97 SystemComponentParameterMapInterface * sensorParameters);
98
99 bool sensorPositionsIdentical(SystemComponentItemInterface * sensor,
100 SensorItemInterface * vehicleSensor );
101
102 private:
103 AgentConfigurationInterface * const agentConfiguration;
104 AgentConfigurationView * const agentConfigurationView;
105
106 private:
107 VehicleProfileItemInterface * currentVehicleProfile;
108
109 private:
110 VehicleProfileMapInterface * const vehicleProfiles;
111 SensorProfileMapInterface * const sensorProfiles;
112 VehicleComponentProfileMapInterface * const componentProfiles;
113 SystemInterface * const system;
114 ProjectInterface * const project;
115
116 };
117
118 #endif // VEHICLEPROFILESCOMBINATIONPRESENTER_H
SystemComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component registered in a s...
Definition: SystemComponentParameterMapInterface.h:22
AgentConfigurationCombinationPresenter
This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of t...
Definition: AgentConfigurationCombinationPresenter.h:63
AgentConfigurationView.h
This class constitutes the main view of the agent configuration plugin. It instantiates the action me...
AgentConfigurationView
This class constitutes the main view of the agent configuration plugin. It instantiates the action me...
Definition: AgentConfigurationView.h:50
VehicleProfileItemInterface
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
Definition: VehicleProfileItemInterface.h:71
SystemInterface.h
The System Interface (SI) contains the functions creating systems and creating a tree listing the com...
SensorProfileMapInterface.h
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
VehicleComponentProfileMapInterface.h
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
SensorItemInterface
The SensorItemInterface class combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to a sensor data object.
Definition: SensorItemInterface.h:56
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
VehicleComponentProfileMapInterface::ID
QPair< Name, Type > ID
typedef for the pair of name and type used as an Id
Definition: VehicleComponentProfileMapInterface.h:49
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
Definition: SensorProfileMapInterface.h:41
SystemInterface
This class manages creating new systems and also creating the tree of components loaded from a librar...
Definition: SystemInterface.h:27
VehicleProfileMapInterface.h
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
VehicleComponentItemInterface
The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a ...
Definition: VehicleComponentItemInterface.h:42
SensorProfileItemInterface
This class defines objects containing all relevant information on sensor profiles.
Definition: SensorProfileItemInterface.h:36
VehicleComponentProfileMapInterface
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
Definition: VehicleComponentProfileMapInterface.h:41
AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
Definition: AgentConfigurationInterface.h:52
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
AgentConfigurationInterface.h File Reference
Agent Configuration Plugin

This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-relevant ProfilesCatalog.xml files. More...

Detailed Description

This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-relevant ProfilesCatalog.xml files.

It provides access to the maps (container classes) of agent profiles, vehicle profiles and driver profiles. Additionally, in the ProfilesCatalog.xml vehicle component profiles (representing algorithms of ADAS) and sensor profiles occur which are also referenced by this class.

Definition in file AgentConfigurationInterface.h.

Go to the source code of this file.

Classes

class AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-relevant ProfilesCatalog.xml files. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
AgentConfigurationInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
24
25 #ifndef AGENTCONFIGURATIONINTERFACE_H
26 #define AGENTCONFIGURATIONINTERFACE_H
27
28 #include "openPASS/ServiceInterface.h"
29
30 #include "openPASS-AgentConfiguration/AgentMapInterface.h"
31 #include "openPASS-AgentConfiguration/VehicleProfileMapInterface.h"
32 #include "openPASS-AgentConfiguration/DriverProfileMapInterface.h"
33 #include "openPASS-AgentConfiguration/VehicleComponentProfileMapInterface.h"
34 #include "openPASS-AgentConfiguration/SensorProfileMapInterface.h"
35
36 #include <QObject>
37
38 static ServiceManagerInterface::ID const AgentConfigurationInterfaceID =
39 ServiceManagerInterfaceID("openPASS.AgentConfiguration.AgentConfigurationInterface");
40
41 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
52 class AgentConfigurationInterface : public QObject,
53 public ServiceInterface<AgentConfigurationInterface, AgentConfigurationInterfaceID>
54 {
55 Q_OBJECT
56
57 public:
58 explicit AgentConfigurationInterface(QObject * const parent = nullptr)
59 : QObject(parent), ServiceInterface(this) {}
60 virtual ~AgentConfigurationInterface() = default;
61
62 public:
63 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 virtual AgentMapInterface * getAgents() const = 0;
69
70 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 virtual VehicleProfileMapInterface * getVehicleProfiles() const = 0;
76
77 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 virtual DriverProfileMapInterface * getDriverProfiles() const = 0;
83
84 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 virtual VehicleComponentProfileMapInterface * getVehicleComponentProfiles() const = 0;
91
92 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 virtual SensorProfileMapInterface * getSensorProfiles() const = 0;
98
99 };
100
101 #endif // AGENTCONFIGURATIONINTERFACE_H
AgentConfigurationInterface::getDriverProfiles
virtual DriverProfileMapInterface * getDriverProfiles() const =0
Method which provides access to the map of driver profiles.
AgentConfigurationInterface::getVehicleProfiles
virtual VehicleProfileMapInterface * getVehicleProfiles() const =0
Method which provides access to the map of vehicle profiles.
ServiceInterface.h
...
SensorProfileMapInterface.h
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
VehicleComponentProfileMapInterface.h
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
DriverProfileMapInterface.h
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
AgentConfigurationInterface::getSensorProfiles
virtual SensorProfileMapInterface * getSensorProfiles() const =0
Method which provides access to the map of sensor profiles.
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
AgentMapInterface.h
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
AgentConfigurationInterface::getVehicleComponentProfiles
virtual VehicleComponentProfileMapInterface * getVehicleComponentProfiles() const =0
Method which provides access to the map of vehicle component profiles (in fact, ADAS algorithms)...
SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
Definition: SensorProfileMapInterface.h:41
VehicleProfileMapInterface.h
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
VehicleComponentProfileMapInterface
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
Definition: VehicleComponentProfileMapInterface.h:41
AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
Definition: AgentMapInterface.h:37
AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
Definition: AgentConfigurationInterface.h:52
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
AgentConfigurationInterface::getAgents
virtual AgentMapInterface * getAgents() const =0
Method which provides access to the map of agent profiles.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
AgentConfigurationModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of AgentConfigurationInterface. More...

Detailed Description

This class implements the functionality of AgentConfigurationInterface.

Definition in file AgentConfigurationModel.h.

Go to the source code of this file.

Classes

class AgentConfigurationModel
This class implements the functionality of AgentConfigurationInterface. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentConfigurationModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16 #ifndef AGENTCONFIGURATIONMODEL_H
17 #define AGENTCONFIGURATIONMODEL_H
18
19 #include "openPASS-AgentConfiguration/AgentConfigurationInterface.h"
20
21 #include "Models/AgentMapModel.h"
22 #include "Models/VehicleProfileMapModel.h"
23 #include "Models/DriverProfileMapModel.h"
24 #include "Models/VehicleComponentProfileMapModel.h"
25 #include "Models/SensorProfileMapModel.h"
26
27 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
30 class AgentConfigurationModel : public AgentConfigurationInterface
31 {
32 Q_OBJECT
33
34 public:
35 explicit AgentConfigurationModel(QObject *parent = nullptr);
36 virtual ~AgentConfigurationModel() override = default;
37
38 public:
39 virtual AgentMapInterface * getAgents() const override;
40 virtual VehicleProfileMapInterface * getVehicleProfiles() const override;
41 virtual DriverProfileMapInterface * getDriverProfiles() const override;
42 virtual VehicleComponentProfileMapInterface * getVehicleComponentProfiles() const override;
43 virtual SensorProfileMapInterface * getSensorProfiles() const override;
44
45 public:
46 AgentMapModel * const agents;
47 VehicleProfileMapModel * const vehicleProfiles;
48 DriverProfileMapModel * const driverProfiles;
49 VehicleComponentProfileMapModel * const componentProfiles;
50 SensorProfileMapModel * const sensorProfiles;
51
52
53 };
54
55 #endif // AGENTCONFIGURATIONMODEL_H
AgentConfigurationModel::agents
AgentMapModel *const agents
the pointer to the map of agent profiles
Definition: AgentConfigurationModel.h:46
AgentConfigurationModel::getVehicleComponentProfiles
virtual VehicleComponentProfileMapInterface * getVehicleComponentProfiles() const override
Method which provides access to the map of vehicle component profiles (in fact, ADAS algorithms)...
Definition: AgentConfigurationModel.cpp:39
AgentMapModel
This class implements the functionality of AgentMapInterface.
Definition: AgentMapModel.h:27
AgentConfigurationModel::driverProfiles
DriverProfileMapModel *const driverProfiles
the pointer to the map of driver profiles
Definition: AgentConfigurationModel.h:48
AgentConfigurationModel::getDriverProfiles
virtual DriverProfileMapInterface * getDriverProfiles() const override
Method which provides access to the map of driver profiles.
Definition: AgentConfigurationModel.cpp:34
DriverProfileMapModel.h
This class implements the functionality of DriverProfileMapInterface.
VehicleComponentProfileMapModel.h
This class implements the functionality of VehicleComponentProfileMapInterface.
AgentConfigurationModel::componentProfiles
VehicleComponentProfileMapModel *const componentProfiles
the pointer to the map of vehicle component profiles (corresponding to algorithms of an ADAS) ...
Definition: AgentConfigurationModel.h:49
AgentConfigurationInterface.h
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
VehicleProfileMapModel.h
This class implements the functionality of VehicleProfileMapInterface.
DriverProfileMapModel
This class implements the functionality of DriverProfileMapInterface.
Definition: DriverProfileMapModel.h:25
AgentConfigurationModel::getAgents
virtual AgentMapInterface * getAgents() const override
Method which provides access to the map of agent profiles.
Definition: AgentConfigurationModel.cpp:24
AgentConfigurationModel
This class implements the functionality of AgentConfigurationInterface.
Definition: AgentConfigurationModel.h:30
AgentMapModel.h
This class implements the functionality of AgentMapInterface.
VehicleComponentProfileMapModel
This class implements the functionality of VehicleComponentProfileMapInterface.
Definition: VehicleComponentProfileMapModel.h:26
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
AgentConfigurationModel::getSensorProfiles
virtual SensorProfileMapInterface * getSensorProfiles() const override
Method which provides access to the map of sensor profiles.
Definition: AgentConfigurationModel.cpp:44
AgentConfigurationModel::sensorProfiles
SensorProfileMapModel *const sensorProfiles
the pointer to the map of sensor profiles
Definition: AgentConfigurationModel.h:50
VehicleProfileMapModel
This class implements the functionality of VehicleProfileMapInterface.
Definition: VehicleProfileMapModel.h:25
SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
Definition: SensorProfileMapInterface.h:41
AgentConfigurationModel::getVehicleProfiles
virtual VehicleProfileMapInterface * getVehicleProfiles() const override
Method which provides access to the map of vehicle profiles.
Definition: AgentConfigurationModel.cpp:29
AgentConfigurationModel::vehicleProfiles
VehicleProfileMapModel *const vehicleProfiles
the pointer to the map of vehicle profiles
Definition: AgentConfigurationModel.h:47
VehicleComponentProfileMapInterface
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
Definition: VehicleComponentProfileMapInterface.h:41
AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
Definition: AgentMapInterface.h:37
SensorProfileMapModel.h
This class implements the functionality of SensorProfileMapInterface.
AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
Definition: AgentConfigurationInterface.h:52
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
SensorProfileMapModel
This class implements the functionality of SensorProfileMapInterface.
Definition: SensorProfileMapModel.h:25
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
Classes
AgentConfigurationPresenter.h File Reference
Agent Configuration Plugin

This class defines the presenter object which handles events from the view (AgentConfigurationView) and edits the model data (AgentConfigurationInterface) accordingly. More...

Detailed Description

This class defines the presenter object which handles events from the view (AgentConfigurationView) and edits the model data (AgentConfigurationInterface) accordingly.

Definition in file AgentConfigurationPresenter.h.

Go to the source code of this file.

Classes

class AgentConfigurationPresenter
This class defines the presenter object which handles events from the view (AgentConfigurationView) and edits the model data (AgentConfigurationInterface) accordingly. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
AgentConfigurationPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
17 //-----------------------------------------------------------------------------
18
19 #ifndef AGENTCONFIGURATIONPRESENTER_H
20 #define AGENTCONFIGURATIONPRESENTER_H
21
22 #include "openPASS-System/SystemInterface.h"
23 #include "openPASS-AgentConfiguration/AgentConfigurationInterface.h"
24 #include "openPASS-Project/ProjectInterface.h"
25
26 #include "Presenters/AgentMapPresenter.h"
27 #include "Presenters/VehicleProfilesPresenter.h"
28 #include "Presenters/DriverProfilesPresenter.h"
29
30 #include "Views/AgentConfigurationView.h"
31
32 #include <QObject>
33 #include <QUndoStack>
34 #include <QShortcut>
35
36 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
41 class AgentConfigurationPresenter : public QObject
42 {
43 Q_OBJECT
44
45 public:
46 explicit AgentConfigurationPresenter(AgentConfigurationInterface * const agentConfiguration,
47 AgentConfigurationView * const agentConfigurationView,
48 SystemInterface * const system,
49 ProjectInterface * const project,
50 QObject *parent = nullptr);
51 virtual ~AgentConfigurationPresenter() = default;
52
53 private Q_SLOTS:
54 //-----------------------------------------------------------------------------
59 //-----------------------------------------------------------------------------
60 void save();
61
62 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 void load();
69
70 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 void clear();
76
77 private:
78 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
85 void copyAgentProfiles(AgentConfigurationInterface const * const from);
86
87 //-----------------------------------------------------------------------------
93 //-----------------------------------------------------------------------------
94 void copyDriverProfiles(AgentConfigurationInterface const * const from);
95
96 //-----------------------------------------------------------------------------
102 //-----------------------------------------------------------------------------
103 void copyVehicleProfiles(AgentConfigurationInterface const * const from);
104
105 private:
106 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
110 void clearAgentProfiles();
111
112 //-----------------------------------------------------------------------------
115 //-----------------------------------------------------------------------------
116 void clearDriverProfiles();
117
118 //-----------------------------------------------------------------------------
121 //-----------------------------------------------------------------------------
122 void clearVehicleProfiles();
123
124 private:
125 AgentConfigurationInterface * const agentConfiguration;
126 AgentConfigurationView * const agentConfigurationView;
127 ProjectInterface * const project;
128
129 private:
130 QUndoStack * const undoStack;
131 QShortcut * const redo;
132 QShortcut * const undo;
133
134 private:
135 AgentMapPresenter * const agentsPresenter;
136 VehicleProfilesPresenter * const vehicleProfilesPresenter;
137 DriverProfilesPresenter * const driverProfilesPresenter;
138 };
139
140 #endif // AGENTCONFIGURATIONPRESENTER_H
AgentConfigurationPresenter::save
void save()
Slot triggered by the AgentConfigurationView::SaveSetup signal. Opens the filedialog to let the user ...
Definition: AgentConfigurationPresenter.cpp:62
AgentMapPresenter.h
This file contains the class AgentMapPresenter defining the presenter object for agent profiles as we...
AgentConfigurationPresenter::undoStack
QUndoStack *const undoStack
pointer to the undo stack
Definition: AgentConfigurationPresenter.h:130
DriverProfilesPresenter.h
This file contains the class DriverProfilesPresenter defining the presenter object for driver profile...
VehicleProfilesPresenter
This class defines the presenter object for vehicle profiles which handles user events from the view ...
Definition: VehicleProfilesPresenter.h:59
AgentConfigurationPresenter
This class defines the presenter object which handles events from the view (AgentConfigurationView) a...
Definition: AgentConfigurationPresenter.h:41
AgentConfigurationView.h
This class constitutes the main view of the agent configuration plugin. It instantiates the action me...
AgentConfigurationPresenter::project
ProjectInterface *const project
pointer to the project interface for accessing the file structure of openPASS
Definition: AgentConfigurationPresenter.h:127
AgentConfigurationPresenter::clearVehicleProfiles
void clearVehicleProfiles()
Method which performs an undoable clear operation on all vehicle profiles currently created...
Definition: AgentConfigurationPresenter.cpp:133
AgentConfigurationPresenter::copyVehicleProfiles
void copyVehicleProfiles(AgentConfigurationInterface const *const from)
Method which performs an undoable copy of the vehicle profiles from the given instance of AgentConfig...
Definition: AgentConfigurationPresenter.cpp:221
AgentConfigurationPresenter::vehicleProfilesPresenter
VehicleProfilesPresenter *const vehicleProfilesPresenter
pointer to the presenter object of vehicle profiles
Definition: AgentConfigurationPresenter.h:136
DriverProfilesPresenter
This class defines the presenter object for driver profiles which handles user events from the view (...
Definition: DriverProfilesPresenter.h:50
AgentConfigurationPresenter::clear
void clear()
Slot triggered by the AgentConfigurationView::ClearSetup signal. Clears the whole model data (using t...
Definition: AgentConfigurationPresenter.cpp:99
AgentConfigurationView
This class constitutes the main view of the agent configuration plugin. It instantiates the action me...
Definition: AgentConfigurationView.h:50
AgentConfigurationPresenter::clearDriverProfiles
void clearDriverProfiles()
Method which performs an undoable clear operation on all driver profiles currently created...
Definition: AgentConfigurationPresenter.cpp:122
AgentConfigurationPresenter::redo
QShortcut *const redo
shortcut for performing a redo action
Definition: AgentConfigurationPresenter.h:131
SystemInterface.h
The System Interface (SI) contains the functions creating systems and creating a tree listing the com...
AgentConfigurationPresenter::undo
QShortcut *const undo
shortcut for performing an undo action
Definition: AgentConfigurationPresenter.h:132
AgentConfigurationInterface.h
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
AgentConfigurationPresenter::clearAgentProfiles
void clearAgentProfiles()
Method which performs an undoable clear operation on all agent profiles currently created...
Definition: AgentConfigurationPresenter.cpp:111
AgentConfigurationPresenter::agentConfiguration
AgentConfigurationInterface *const agentConfiguration
pointer to the overall model interface of this plugin
Definition: AgentConfigurationPresenter.h:125
AgentConfigurationPresenter::agentsPresenter
AgentMapPresenter *const agentsPresenter
pointer to the presenter object of agent profiles
Definition: AgentConfigurationPresenter.h:135
AgentMapPresenter
The AgentMapPresenter class handles user events from the view (AgentMapView) and edits the model data...
Definition: AgentMapPresenter.h:54
AgentConfigurationPresenter::copyDriverProfiles
void copyDriverProfiles(AgentConfigurationInterface const *const from)
Method which performs an undoable copy of the driver profiles from the given instance of AgentConfigu...
Definition: AgentConfigurationPresenter.cpp:203
AgentConfigurationPresenter::copyAgentProfiles
void copyAgentProfiles(AgentConfigurationInterface const *const from)
Method which performs an undoable copy of the agent profiles from the given instance of AgentConfigur...
Definition: AgentConfigurationPresenter.cpp:144
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
SystemInterface
This class manages creating new systems and also creating the tree of components loaded from a librar...
Definition: SystemInterface.h:27
AgentConfigurationPresenter::driverProfilesPresenter
DriverProfilesPresenter *const driverProfilesPresenter
pointer to the presenter object of driver profiles
Definition: AgentConfigurationPresenter.h:137
VehicleProfilesPresenter.h
This file contains the class VehicleProfilesPresenter defining the presenter object for vehicle profi...
AgentConfigurationPresenter::agentConfigurationView
AgentConfigurationView *const agentConfigurationView
pointer to the overall view of this plugin
Definition: AgentConfigurationPresenter.h:126
AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
Definition: AgentConfigurationInterface.h:52
AgentConfigurationPresenter::load
void load()
Slot triggered by the AgentConfigurationView::LoadSetup signal. Loads the *.ui file selected by the u...
Definition: AgentConfigurationPresenter.cpp:72
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
Classes
AgentConfigurationView.h File Reference
Agent Configuration Plugin

This class constitutes the main view of the agent configuration plugin. It instantiates the action menu as well as a tab widget as a container widget for views of agent, driver and vehicle profiles as well as the undo stack. The main task of this view is to emit signals upon user actions on the action menu which are handled in the corresponding prestenter object (AgentConfigurationPresenter). More...

Detailed Description

This class constitutes the main view of the agent configuration plugin. It instantiates the action menu as well as a tab widget as a container widget for views of agent, driver and vehicle profiles as well as the undo stack. The main task of this view is to emit signals upon user actions on the action menu which are handled in the corresponding prestenter object (AgentConfigurationPresenter).

Definition in file AgentConfigurationView.h.

Go to the source code of this file.

Classes

class AgentConfigurationView
This class constitutes the main view of the agent configuration plugin. It instantiates the action menu as well as a tab widget as a container widget for views of agent, driver and vehicle profiles as well as the undo stack. The main task of this view is to emit signals upon user actions on the action menu which are handled in the corresponding prestenter object (AgentConfigurationPresenter). More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
AgentConfigurationView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
22
23 #ifndef AGENTCONFIGURATIONVIEW_H
24 #define AGENTCONFIGURATIONVIEW_H
25
26 #include "openPASS-Window/WindowInterface.h"
27
28 #include "AgentMapView.h"
29 #include "VehicleProfilesView.h"
30 #include "DriverProfilesView.h"
31
32 #include <QString>
33 #include <QWidget>
34 #include <QResizeEvent>
35 #include <QUndoView>
36
37 namespace Ui {
38 class AgentConfigurationView;
39 }
40
41 //-----------------------------------------------------------------------------
49 //-----------------------------------------------------------------------------
50 class AgentConfigurationView : public QWidget
51 {
52 Q_OBJECT
53
54 public:
55 explicit AgentConfigurationView(WindowInterface * const window,
56 QWidget *parent = nullptr);
57 virtual ~AgentConfigurationView();
58
59 Q_SIGNALS:
60 //-----------------------------------------------------------------------------
62 //-----------------------------------------------------------------------------
63 void SaveSetup();
64
65 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 void LoadSetup();
69
70 //-----------------------------------------------------------------------------
72 //-----------------------------------------------------------------------------
73 void ExportSetup();
74
75 //-----------------------------------------------------------------------------
78 //-----------------------------------------------------------------------------
79 void ClearSetup();
80
81 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 void Undo();
85
86 //-----------------------------------------------------------------------------
88 //-----------------------------------------------------------------------------
89 void Redo();
90
91 private Q_SLOTS:
92 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 void actionSave();
98
99 //-----------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
104 void actionLoad();
105
106 //-----------------------------------------------------------------------------
110 //-----------------------------------------------------------------------------
111 void actionExport();
112
113 //-----------------------------------------------------------------------------
117 //-----------------------------------------------------------------------------
118 void actionClear();
119
120 //-----------------------------------------------------------------------------
123 //-----------------------------------------------------------------------------
124 void actionUndo();
125
126 //-----------------------------------------------------------------------------
129 //-----------------------------------------------------------------------------
130 void actionRedo();
131
132 //-----------------------------------------------------------------------------
135 //-----------------------------------------------------------------------------
136 void actionHistory();
137
138 public:
139 //-----------------------------------------------------------------------------
143 //-----------------------------------------------------------------------------
144 QUndoView * getUndoView() const;
145
146 //-----------------------------------------------------------------------------
150 //-----------------------------------------------------------------------------
151 AgentMapView * getAgentsView() const;
152
153 //-----------------------------------------------------------------------------
157 //-----------------------------------------------------------------------------
158 VehicleProfilesView * getVehicleProfilesView() const;
159
160 //-----------------------------------------------------------------------------
164 //-----------------------------------------------------------------------------
165 DriverProfilesView * getDriverProfilesView() const;
166
167 private:
168 static WindowInterface::ID const ViewID;
169
170 private:
171 WindowInterface * const window;
172 QUndoView * const undoView;
173
174 private:
175 WindowInterface::Action * const actionMenuSave;
176 WindowInterface::Action * const actionMenuExport;
177 WindowInterface::Action * const actionMenuLoad;
178 WindowInterface::Action * const actionMenuClear;
179 WindowInterface::Action * const actionMenuUndo;
180 WindowInterface::Action * const actionMenuRedo;
181 WindowInterface::Action * const actionMenuHistory;
182
183 private:
184 Ui::AgentConfigurationView *ui;
185 AgentMapView * agentsView;
186 VehicleProfilesView * vehicleProfilesView;
187 DriverProfilesView * driverProfilesView;
188
189
190 };
191
192 #endif // AGENTCONFIGURATIONVIEW_H
AgentConfigurationView::ViewID
static WindowInterface::ID const ViewID
a static Id used to register the view of this plugin in the window plugin
Definition: AgentConfigurationView.h:168
AgentMapView
This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu ...
Definition: AgentMapView.h:56
AgentConfigurationView::actionMenuLoad
WindowInterface::Action *const actionMenuLoad
The action menu object for loading a profiles catalogue file.
Definition: AgentConfigurationView.h:177
AgentConfigurationView::actionMenuRedo
WindowInterface::Action *const actionMenuRedo
The action menu object for redoing actions.
Definition: AgentConfigurationView.h:180
WindowInterface
This class manages the registration and deregistration of Window Views which include the menu bar wit...
Definition: WindowInterface.h:44
AgentConfigurationView::getVehicleProfilesView
VehicleProfilesView * getVehicleProfilesView() const
Method that returns the view for vehicle profies.
Definition: AgentConfigurationView.cpp:137
AgentConfigurationView::actionMenuExport
WindowInterface::Action *const actionMenuExport
The action menu object for exporting an old profiles catalogue file.
Definition: AgentConfigurationView.h:176
AgentConfigurationView::vehicleProfilesView
VehicleProfilesView * vehicleProfilesView
the view for editing vehicle profiles
Definition: AgentConfigurationView.h:186
Ui
Definition: EnvironmentDisplayView.h:29
AgentConfigurationView::actionClear
void actionClear()
Slot which is triggered when the clear-button of the action menu has been clicked. Prompts a dialog box to inform the user that the whole worksheet is going to be cleared. If user confirms, the ClearSetup signal is emitted.
Definition: AgentConfigurationView.cpp:114
AgentConfigurationView::window
WindowInterface *const window
the pointer to the window plugin for registering and deregistering this view
Definition: AgentConfigurationView.h:171
AgentMapView.h
This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu ...
AgentConfigurationView::actionSave
void actionSave()
Slot which is triggered when the save-button of the action menu has been clicked. Prompts a file dial...
Definition: AgentConfigurationView.cpp:88
AgentConfigurationView
This class constitutes the main view of the agent configuration plugin. It instantiates the action me...
Definition: AgentConfigurationView.h:50
AgentConfigurationView::getUndoView
QUndoView * getUndoView() const
Method that returns the undo view.
Definition: AgentConfigurationView.cpp:148
AgentConfigurationView::actionMenuUndo
WindowInterface::Action *const actionMenuUndo
The action menu object for undoing actions.
Definition: AgentConfigurationView.h:179
AgentConfigurationView::Redo
void Redo()
Signal, emitted after the redo-button in the action menu has been clicked.
AgentConfigurationView::actionHistory
void actionHistory()
Slot which is triggered when the command history button is clicked. Will show or hide the command his...
Definition: AgentConfigurationView.cpp:74
WindowInterface.h
The Window Interface (WI) contains the functions managing the Window View of openPASS application...
AgentConfigurationView::ui
Ui::AgentConfigurationView * ui
the ui object defining the views appearance
Definition: AgentConfigurationView.h:184
AgentConfigurationView::undoView
QUndoView *const undoView
the view of the undo stack
Definition: AgentConfigurationView.h:172
AgentConfigurationView::ClearSetup
void ClearSetup()
Signal, emitted after the clear-button in the action menu has been clicked and the user warning has b...
AgentConfigurationView::actionUndo
void actionUndo()
Slot which is triggered when the undo-button of the action menu has been clicked. Will trigger the un...
Definition: AgentConfigurationView.cpp:109
WindowInterface::Action
QPushButton Action
The button in the menu of the stacked widget.
Definition: WindowInterface.h:56
AgentConfigurationView::actionRedo
void actionRedo()
Slot which is triggered when the redo-button of the action menu has been clicked. Will trigger the re...
Definition: AgentConfigurationView.cpp:104
AgentConfigurationView::Undo
void Undo()
Signal, emitted after the undo-button in the action menu has been clicked.
AgentConfigurationView::agentsView
AgentMapView * agentsView
the view for editing agent profiles
Definition: AgentConfigurationView.h:185
AgentConfigurationView::getAgentsView
AgentMapView * getAgentsView() const
Method that returns the view for agent profies.
Definition: AgentConfigurationView.cpp:132
VehicleProfilesView.h
This class defines the view for editing vehicle profiles. The view constitutes a combo box for select...
AgentConfigurationView::driverProfilesView
DriverProfilesView * driverProfilesView
the view for editing driver profiles
Definition: AgentConfigurationView.h:187
AgentConfigurationView::actionExport
void actionExport()
Slot which is triggered when the export-button of the action menu has been clicked. Prompts a file dialog box to let the user select a filepath. Afterwards the signal ExportSetup is emitted transmitting the selected filepath.
Definition: AgentConfigurationView.cpp:93
AgentConfigurationView::actionMenuSave
WindowInterface::Action *const actionMenuSave
The action menu object for saving a profiles catalogue file.
Definition: AgentConfigurationView.h:175
AgentConfigurationView::actionMenuHistory
WindowInterface::Action *const actionMenuHistory
The action menu object for showing the command history.
Definition: AgentConfigurationView.h:181
DriverProfilesView.h
This class defines the view for editing driver profiles. The view constitutes a combo box for switchi...
AgentConfigurationView::ExportSetup
void ExportSetup()
Signal, emitted after the export-button in the action menu has been clicked.
VehicleProfilesView
This class defines the view for editing vehicle profiles. The view constitutes a combo box for select...
Definition: VehicleProfilesView.h:56
AgentConfigurationView::LoadSetup
void LoadSetup()
Signal, emitted after the load-button in the action menu has been clicked.
AgentConfigurationView::actionMenuClear
WindowInterface::Action *const actionMenuClear
The action menu object for clearing the entire worksheet.
Definition: AgentConfigurationView.h:178
AgentConfigurationView::SaveSetup
void SaveSetup()
Signal, emitted after the save-button in the action menu has been clicked.
WindowInterface::ID
QString ID
The identifier of the stacked widget.
Definition: WindowInterface.h:50
DriverProfilesView
This class defines the view for editing driver profiles. The view constitutes a combo box for switchi...
Definition: DriverProfilesView.h:41
AgentConfigurationView::actionLoad
void actionLoad()
Slot which is triggered when the load-button of the action menu has been clicked. Prompts a file dial...
Definition: AgentConfigurationView.cpp:99
AgentConfigurationView::getDriverProfilesView
DriverProfilesView * getDriverProfilesView() const
Method that returns the view for driver profies.
Definition: AgentConfigurationView.cpp:143
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
AgentItemInterface.h File Reference
Agent Configuration Plugin

This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-relevant profiles cataloge (*.xml) under <AgentProfiles>. More...

Detailed Description

This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-relevant profiles cataloge (*.xml) under <AgentProfiles>.

In particular, this class gains accesss to the maps of vehicle and driver profiles for dynamic agent profiles. For static agent profiles, this class defines setter and getter methods for vehicle model catalogue and system config as well as models and systems defined therein.

Definition in file AgentItemInterface.h.

Go to the source code of this file.

Classes

class AgentItemInterface
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-relevant profiles cataloge (*.xml) under <AgentProfiles>. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
AgentItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
22
23 #ifndef AGENTITEMINTERFACE_H
24 #define AGENTITEMINTERFACE_H
25
26 #include <QObject>
27 #include <QMap>
28
29 //-----------------------------------------------------------------------------
37 //-----------------------------------------------------------------------------
38 class AgentItemInterface : public QObject
39 {
40 Q_OBJECT
41
42 public:
43 using Name = QString;
44 using Type = QString;
45 using Probability = double;
46
47 public:
48 using SystemConfig = QString;
49 using SystemID = unsigned int;
50 using SystemTitle = QString;
51 using System = QPair<SystemID, SystemTitle>;
52 using VehicleModelCatalogue = QString;
53 using VehicleModel = QString;
54
55 public:
56 using VehicleProfile = QString;
57 using VehicleProfiles = QMap<VehicleProfile, Probability>;
58
59 public:
60 using DriverProfile = QString;
61 using DriverProfiles = QMap<DriverProfile, Probability>;
62
63 public:
64 explicit AgentItemInterface (QObject * parent = nullptr)
65 : QObject(parent){}
66 virtual ~AgentItemInterface() = default;
67
68 public:
69 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 virtual Name getName() const = 0;
76
77 public:
78 //-----------------------------------------------------------------------------
82 //-----------------------------------------------------------------------------
83 virtual Type getType() const = 0;
84
85 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 virtual void setType(const Type &_type) = 0;
92
93 public:
94 //-----------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------
100 virtual VehicleProfiles * getVehicleProfiles() const = 0;
101
102 //-----------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------
108 virtual DriverProfiles * getDriverProfiles() const = 0;
109
110 public:
111 //-----------------------------------------------------------------------------
116 //-----------------------------------------------------------------------------
117 virtual VehicleModel getVehicleModel() const = 0;
118
119 //-----------------------------------------------------------------------------
124 //-----------------------------------------------------------------------------
125 virtual void setVehicleModel(VehicleModel const & _vehicleModel) = 0;
126
127 public:
128 //-----------------------------------------------------------------------------
133 //-----------------------------------------------------------------------------
134 virtual VehicleModelCatalogue getVehicleModelCatalogue() const = 0;
135
136 //-----------------------------------------------------------------------------
141 //-----------------------------------------------------------------------------
142 virtual void setVehicleModelCatalogue(VehicleModelCatalogue const & _vehicleModelCatalogue) = 0;
143
144 public:
145 //-----------------------------------------------------------------------------
150 //-----------------------------------------------------------------------------
151 virtual SystemID getSystemID() const = 0;
152
153 //-----------------------------------------------------------------------------
158 //-----------------------------------------------------------------------------
159 virtual void setSystemID(SystemID const & _systemID) = 0;
160
161 public:
162 //-----------------------------------------------------------------------------
167 //-----------------------------------------------------------------------------
168 virtual SystemTitle getSystemTitle() const = 0;
169
170 //-----------------------------------------------------------------------------
175 //-----------------------------------------------------------------------------
176 virtual void setSystemTitle(SystemTitle const & _systemTitle) = 0;
177
178 public:
179 //-----------------------------------------------------------------------------
184 //-----------------------------------------------------------------------------
185 virtual SystemConfig getSystemConfig() const = 0;
186
187 //-----------------------------------------------------------------------------
192 //-----------------------------------------------------------------------------
193 virtual void setSystemConfig(SystemConfig const & _systemConfig) = 0;
194
195 public:
196 //-----------------------------------------------------------------------------
203 //-----------------------------------------------------------------------------
204 virtual System * getSystem() = 0;
205 };
206
207 #endif // AGENTITEMINTERFACE_H
AgentItemInterface::getVehicleModelCatalogue
virtual VehicleModelCatalogue getVehicleModelCatalogue() const =0
Method which returns the current vehicle model catalogue (for static agent profiles).
AgentItemInterface::getVehicleModel
virtual VehicleModel getVehicleModel() const =0
Method which returns the currently selected vehicle profile (for static agent profiles).
AgentItemInterface::DriverProfile
QString DriverProfile
the nome of a driver profile
Definition: AgentItemInterface.h:60
AgentItemInterface::setVehicleModel
virtual void setVehicleModel(VehicleModel const &_vehicleModel)=0
Method which sets the currently selected vehicle profile to the one passed as an argument (for static...
AgentItemInterface::SystemID
unsigned int SystemID
the id of a system defined in a system config
Definition: AgentItemInterface.h:49
AgentItemInterface::VehicleProfiles
QMap< VehicleProfile, Probability > VehicleProfiles
the mapping of a vehicle profile to the instantiation probability
Definition: AgentItemInterface.h:57
AgentItemInterface::SystemTitle
QString SystemTitle
the title of a system defined in a system config
Definition: AgentItemInterface.h:50
AgentItemInterface::getType
virtual Type getType() const =0
Method which returns the type of this agent profile.
AgentItemInterface::setSystemTitle
virtual void setSystemTitle(SystemTitle const &_systemTitle)=0
Method which sets the currently selected system title to the one passed as an argument (for static ag...
AgentItemInterface::System
QPair< SystemID, SystemTitle > System
the pair of id and title of a system in system config (used as system reference)
Definition: AgentItemInterface.h:51
AgentItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profi...
AgentItemInterface::Type
QString Type
the type of the agent profile (dynamic or static)
Definition: AgentItemInterface.h:44
AgentItemInterface::VehicleModel
QString VehicleModel
a vehicle model defined in a vehicle model catalogue file
Definition: AgentItemInterface.h:53
AgentItemInterface::getSystemTitle
virtual SystemTitle getSystemTitle() const =0
Method which returns the title of the currently selected system (for static agent profiles)...
AgentItemInterface::VehicleModelCatalogue
QString VehicleModelCatalogue
the vehicle model catalogue file
Definition: AgentItemInterface.h:52
AgentItemInterface::getSystem
virtual System * getSystem()=0
Method which returns a pointer to the system (i.e. the pair of system id and title) currently selecte...
AgentItemInterface::Name
QString Name
the name of the agent profiles
Definition: AgentItemInterface.h:43
AgentItemInterface::getSystemID
virtual SystemID getSystemID() const =0
Method which returns the id of the currently selected system (for static agent profiles).
AgentItemInterface::getSystemConfig
virtual SystemConfig getSystemConfig() const =0
Method which returns the current system config file (for static agent profiles).
AgentItemInterface::setType
virtual void setType(const Type &_type)=0
Method which sets the type of this agent profile to the one passed as an argument.
AgentItemInterface::SystemConfig
QString SystemConfig
the system config file
Definition: AgentItemInterface.h:48
AgentItemInterface::VehicleProfile
QString VehicleProfile
the name of a vehicle profile
Definition: AgentItemInterface.h:56
AgentItemInterface::getVehicleProfiles
virtual VehicleProfiles * getVehicleProfiles() const =0
Method which returns a pointer to the map of vehicle profiles, i.e. the mapping of vehicle profiles t...
AgentItemInterface
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
Definition: AgentItemInterface.h:38
AgentItemInterface::setSystemConfig
virtual void setSystemConfig(SystemConfig const &_systemConfig)=0
Method which sets the current system config file to the one passed as an argument (for static agent p...
AgentItemInterface::setVehicleModelCatalogue
virtual void setVehicleModelCatalogue(VehicleModelCatalogue const &_vehicleModelCatalogue)=0
Method which sets the current vehicle model catalogue to the one passed as an argument (for static ag...
AgentItemInterface::setSystemID
virtual void setSystemID(SystemID const &_systemID)=0
Method which sets the currently selected system id to the one passed as an argument (for static agent...
AgentItemInterface::DriverProfiles
QMap< DriverProfile, Probability > DriverProfiles
the mapping of a driver profile to the instantiation probability
Definition: AgentItemInterface.h:61
AgentItemInterface::Probability
double Probability
a probability value (e.g. of a driver or a vehicle profile)
Definition: AgentItemInterface.h:45
AgentItemInterface::getDriverProfiles
virtual DriverProfiles * getDriverProfiles() const =0
Method which returns a pointer to the map of driver profiles, i.e. the mapping of driver profiles to ...
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentItemModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentItemModel.h File Reference
Agent Configuration Plugin | Agent Configuration Plugin

This class implements the functionality of AgentItemInterface. More...

Detailed Description

This class implements the functionality of AgentItemInterface.

Definition in file AgentItemModel.h.

Go to the source code of this file.

Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentItemModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentItemModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef AGENTITEMMODEL_H
18 #define AGENTITEMMODEL_H
19
20 #include "openPASS-AgentConfiguration/AgentItemInterface.h"
21
22 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
27 class AgentItemModel : public AgentItemInterface
28 {
29 public:
30 explicit AgentItemModel(QObject *parent = nullptr);
31 AgentItemModel(AgentItemInterface const * const agent, QObject *parent = nullptr);
32 virtual ~AgentItemModel() override;
33
34 public:
35 virtual AgentItemInterface::Name getName() const override;
36
37 public:
38 virtual Type getType() const override;
39 virtual void setType(const Type &_type) override;
40
41 public:
42 virtual VehicleProfiles * getVehicleProfiles() const override;
43 virtual DriverProfiles * getDriverProfiles() const override;
44
45 public:
46 virtual VehicleModel getVehicleModel() const override;
47 virtual void setVehicleModel(VehicleModel const & _vehicleModel) override;
48
49 public:
50 virtual VehicleModelCatalogue getVehicleModelCatalogue() const override;
51 virtual void setVehicleModelCatalogue(VehicleModelCatalogue const & _vehicleModelCatalogue) override;
52
53 public:
54 virtual SystemID getSystemID() const override;
55 virtual void setSystemID(SystemID const & _systemID) override;
56
57 public:
58 virtual SystemTitle getSystemTitle() const override;
59 virtual void setSystemTitle(SystemTitle const & _systemTitle) override;
60
61 public:
62 virtual SystemConfig getSystemConfig() const override;
63 virtual void setSystemConfig(SystemConfig const & _systemConfig) override;
64
65 public:
66 virtual System * getSystem() override;
67
68 private:
69 VehicleProfiles * const vehicleProfiles;
70 DriverProfiles * const driverProfiles;
71 Type type;
72 SystemConfig systemConfig;
73 System system;
74 VehicleModelCatalogue vehicleModelCatalogue;
75 VehicleModel vehicleModel;
76
77 };
78
79 #endif // AGENTITEMMODEL_H
AgentItemInterface::getVehicleModelCatalogue
virtual VehicleModelCatalogue getVehicleModelCatalogue() const =0
Method which returns the current vehicle model catalogue (for static agent profiles).
AgentItemInterface::getVehicleModel
virtual VehicleModel getVehicleModel() const =0
Method which returns the currently selected vehicle profile (for static agent profiles).
AgentItemInterface::setVehicleModel
virtual void setVehicleModel(VehicleModel const &_vehicleModel)=0
Method which sets the currently selected vehicle profile to the one passed as an argument (for static...
AgentItemInterface::SystemID
unsigned int SystemID
the id of a system defined in a system config
Definition: AgentItemInterface.h:49
AgentItemInterface::VehicleProfiles
QMap< VehicleProfile, Probability > VehicleProfiles
the mapping of a vehicle profile to the instantiation probability
Definition: AgentItemInterface.h:57
AgentItemInterface::SystemTitle
QString SystemTitle
the title of a system defined in a system config
Definition: AgentItemInterface.h:50
AgentItemInterface::getType
virtual Type getType() const =0
Method which returns the type of this agent profile.
AgentItemInterface::setSystemTitle
virtual void setSystemTitle(SystemTitle const &_systemTitle)=0
Method which sets the currently selected system title to the one passed as an argument (for static ag...
AgentItemInterface::System
QPair< SystemID, SystemTitle > System
the pair of id and title of a system in system config (used as system reference)
Definition: AgentItemInterface.h:51
AgentItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profi...
AgentItemInterface::Type
QString Type
the type of the agent profile (dynamic or static)
Definition: AgentItemInterface.h:44
AgentItemInterface::VehicleModel
QString VehicleModel
a vehicle model defined in a vehicle model catalogue file
Definition: AgentItemInterface.h:53
AgentItemInterface::getSystemTitle
virtual SystemTitle getSystemTitle() const =0
Method which returns the title of the currently selected system (for static agent profiles)...
AgentItemInterface::VehicleModelCatalogue
QString VehicleModelCatalogue
the vehicle model catalogue file
Definition: AgentItemInterface.h:52
AgentItemInterface.h
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
AgentItemInterface::getSystem
virtual System * getSystem()=0
Method which returns a pointer to the system (i.e. the pair of system id and title) currently selecte...
AgentItemInterface::Name
QString Name
the name of the agent profiles
Definition: AgentItemInterface.h:43
AgentItemInterface::getSystemID
virtual SystemID getSystemID() const =0
Method which returns the id of the currently selected system (for static agent profiles).
AgentItemInterface::getSystemConfig
virtual SystemConfig getSystemConfig() const =0
Method which returns the current system config file (for static agent profiles).
AgentItemInterface::setType
virtual void setType(const Type &_type)=0
Method which sets the type of this agent profile to the one passed as an argument.
AgentItemInterface::SystemConfig
QString SystemConfig
the system config file
Definition: AgentItemInterface.h:48
AgentItemInterface::getVehicleProfiles
virtual VehicleProfiles * getVehicleProfiles() const =0
Method which returns a pointer to the map of vehicle profiles, i.e. the mapping of vehicle profiles t...
AgentItemInterface
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
Definition: AgentItemInterface.h:38
AgentItemInterface::setSystemConfig
virtual void setSystemConfig(SystemConfig const &_systemConfig)=0
Method which sets the current system config file to the one passed as an argument (for static agent p...
AgentItemInterface::setVehicleModelCatalogue
virtual void setVehicleModelCatalogue(VehicleModelCatalogue const &_vehicleModelCatalogue)=0
Method which sets the current vehicle model catalogue to the one passed as an argument (for static ag...
AgentItemInterface::setSystemID
virtual void setSystemID(SystemID const &_systemID)=0
Method which sets the currently selected system id to the one passed as an argument (for static agent...
AgentItemInterface::DriverProfiles
QMap< DriverProfile, Probability > DriverProfiles
the mapping of a driver profile to the instantiation probability
Definition: AgentItemInterface.h:61
AgentItemInterface::getDriverProfiles
virtual DriverProfiles * getDriverProfiles() const =0
Method which returns a pointer to the map of driver profiles, i.e. the mapping of driver profiles to ...
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
AgentMapInterface.h File Reference
Agent Configuration Plugin

This class constitutes a container class in which agent profiles (instances of AgentItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map. More...

Detailed Description

This class constitutes a container class in which agent profiles (instances of AgentItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map.

Definition in file AgentMapInterface.h.

Go to the source code of this file.

Classes

class AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
AgentMapInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
21 #ifndef AGENTMAPINTERFACE_H
22 #define AGENTMAPINTERFACE_H
23
24 #include "openPASS-AgentConfiguration/AgentItemInterface.h"
25
26 #include <QObject>
27 #include <QMap>
28
29 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
37 class AgentMapInterface : public QObject
38 {
39 Q_OBJECT
40
41 public:
42 using Name = AgentItemInterface::Name;
43 using Item = AgentItemInterface;
44
45 public:
46 using Map = QMap<Name, Item *>;
47 using Iterator = Map::Iterator;
48 using ConstIterator = Map::ConstIterator;
49
50 public:
51 explicit AgentMapInterface (QObject * parent = nullptr)
52 : QObject(parent){}
53 virtual ~AgentMapInterface() = default;
54
55 Q_SIGNALS:
56 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 void added(Name name);
63
64 //-----------------------------------------------------------------------------
69 //-----------------------------------------------------------------------------
70 void removed(Name name);
71
72 //-----------------------------------------------------------------------------
78 //-----------------------------------------------------------------------------
79 void modifiedName(Name oldName, Name newName);
80
81 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 void cleared();
85
86 public:
87 //-----------------------------------------------------------------------------
92 //-----------------------------------------------------------------------------
93 virtual AgentMapInterface::Iterator begin() = 0;
94
95 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
102 virtual AgentMapInterface::ConstIterator constBegin() const = 0;
103
104 public:
105 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
110 virtual AgentMapInterface::Iterator end() = 0;
111
112 //-----------------------------------------------------------------------------
117 //-----------------------------------------------------------------------------
118 virtual AgentMapInterface::ConstIterator constEnd() const = 0;
119
120 public:
121 //-----------------------------------------------------------------------------
128 //-----------------------------------------------------------------------------
129 virtual bool add(AgentMapInterface::Name const & name) = 0;
130
131 //-----------------------------------------------------------------------------
139 //-----------------------------------------------------------------------------
140 virtual bool add(AgentMapInterface::Name const &name,
141 AgentMapInterface::Item const * const item) = 0;
142
143 public:
144 //-----------------------------------------------------------------------------
153 //-----------------------------------------------------------------------------
154 virtual bool remove(AgentMapInterface::Name const & name) = 0;
155
156 public:
157 //-----------------------------------------------------------------------------
166 //-----------------------------------------------------------------------------
167 virtual AgentMapInterface::Item * getItem(AgentMapInterface::Name const & name) const = 0;
168
169 public:
170 //-----------------------------------------------------------------------------
177 //-----------------------------------------------------------------------------
178 virtual void setName(AgentMapInterface::Item * const item,
179 AgentMapInterface::Name const & name) = 0;
180
181 //-----------------------------------------------------------------------------
186 //-----------------------------------------------------------------------------
187 virtual AgentMapInterface::Name getName(AgentMapInterface::Item * const item) const = 0;
188
189 public:
190 //-----------------------------------------------------------------------------
196 //-----------------------------------------------------------------------------
197 virtual bool contains (AgentMapInterface::Name const & name) const =0;
198
199 //-----------------------------------------------------------------------------
203 //-----------------------------------------------------------------------------
204 virtual int count() const =0;
205
206 public:
207 //-----------------------------------------------------------------------------
211 //-----------------------------------------------------------------------------
212 virtual QStringList keys() const =0;
213
214 //-----------------------------------------------------------------------------
218 //-----------------------------------------------------------------------------
219 virtual QList<Item*> values() const =0;
220
221 };
222
223 #endif // AGENTMAPINTERFACE_H
AgentMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a constant iterator for read-only operations
Definition: AgentMapInterface.h:48
AgentMapInterface::added
void added(Name name)
Signal emitted when an agent profile has been added to the map. Transmits the name of the correpondin...
AgentMapInterface::add
virtual bool add(AgentMapInterface::Name const &name)=0
Method which creates a new agent profile (instance of AgentItemInterface) and adds it to the map unde...
AgentMapInterface::constEnd
virtual AgentMapInterface::ConstIterator constEnd() const =0
Gets an iterator pointing at the end of the map after the last agent profile (use for read-only)...
AgentMapInterface::begin
virtual AgentMapInterface::Iterator begin()=0
Gets an iterator pointing to the first agent profile in the map.
AgentMapInterface::count
virtual int count() const =0
Method which returns the number of registered agent profiles.
AgentMapInterface::modifiedName
void modifiedName(Name oldName, Name newName)
Signal emitted when the name of the agent profile has been changed. Transmits both, the new and old names of the profile.
AgentMapInterface::Iterator
Map::Iterator Iterator
an iterator for searching within the map
Definition: AgentMapInterface.h:47
AgentMapInterface::Map
QMap< Name, Item * > Map
the map (container class) for registering agent profiles
Definition: AgentMapInterface.h:46
AgentMapInterface::Name
AgentItemInterface::Name Name
the name of the agent profile (key identifier)
Definition: AgentMapInterface.h:42
AgentMapInterface::end
virtual AgentMapInterface::Iterator end()=0
Gets an iterator pointing to the end of the map after the last agent profile.
AgentItemInterface.h
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
AgentMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all agent profiles in the map.
AgentItemInterface::Name
QString Name
the name of the agent profiles
Definition: AgentItemInterface.h:43
AgentMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all agent profile names in the map.
AgentMapInterface::getItem
virtual AgentMapInterface::Item * getItem(AgentMapInterface::Name const &name) const =0
Method which returns a pointer to the agent profile with the given name. If the map does not contain ...
AgentMapInterface::setName
virtual void setName(AgentMapInterface::Item *const item, AgentMapInterface::Name const &name)=0
Method wich changes the name of the given agent profile to the one passed as second argument...
AgentMapInterface::cleared
void cleared()
Signal emitted when the map has been cleared.
AgentItemInterface
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
Definition: AgentItemInterface.h:38
AgentMapInterface::getName
virtual AgentMapInterface::Name getName(AgentMapInterface::Item *const item) const =0
Method wich returns the name of the given agent profile.
AgentMapInterface::constBegin
virtual AgentMapInterface::ConstIterator constBegin() const =0
Gets an iterator pointing to the first agent profile in the map (use for read-only since pointing at ...
AgentMapInterface::removed
void removed(Name name)
Signal emitted when an agent profile has been removed from the map. Transmits the name of the correpo...
AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
Definition: AgentMapInterface.h:37
AgentMapInterface::contains
virtual bool contains(AgentMapInterface::Name const &name) const =0
Method wich checks whether the map contains an agent profile with the given name. ...
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
AgentMapModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of AgentMapInterface. More...

Detailed Description

This class implements the functionality of AgentMapInterface.

Definition in file AgentMapModel.h.

Go to the source code of this file.

Classes

class AgentMapModel
This class implements the functionality of AgentMapInterface. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentMapModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef AGENTMAPMODEL_H
18 #define AGENTMAPMODEL_H
19
20 #include "openPASS-AgentConfiguration/AgentMapInterface.h"
21
22 #include "Models/AgentItemModel.h"
23
24 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
27 class AgentMapModel : public AgentMapInterface
28 {
29
30 public:
31 AgentMapModel(QObject * parent = nullptr);
32 virtual ~AgentMapModel() override = default;
33
34 public:
35 virtual AgentMapInterface::Iterator begin() override;
36 virtual AgentMapInterface::ConstIterator constBegin() const override;
37
38 public:
39 virtual AgentMapInterface::Iterator end() override;
40 virtual AgentMapInterface::ConstIterator constEnd() const override;
41
42 public:
43 virtual bool add(AgentMapInterface::Name const & name) override;
44 virtual bool add(const AgentMapInterface::Name &name, const Item * const item) override;
45
46 public:
47 virtual bool remove(AgentMapInterface::Name const & name) override;
48
49 public:
50 virtual AgentMapInterface::Item * getItem(AgentMapInterface::Name const & name) const override;
51
52 public:
53 virtual void setName(AgentMapInterface::Item * const item,
54 AgentMapInterface::Name const &name) override;
55
56 virtual AgentMapInterface::Name getName(AgentMapInterface::Item * const item) const override;
57
58 public:
59 virtual bool contains (AgentMapInterface::Name const & name) const override;
60 virtual int count() const override;
61
62 public:
63 virtual QStringList keys() const override;
64 virtual QList<Item*> values() const override;
65
66 protected:
67 AgentMapInterface::Map agents;
68
69 };
70
71 #endif // AGENTMAPMODEL_H
AgentMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a constant iterator for read-only operations
Definition: AgentMapInterface.h:48
AgentMapModel
This class implements the functionality of AgentMapInterface.
Definition: AgentMapModel.h:27
AgentMapModel::add
virtual bool add(AgentMapInterface::Name const &name) override
Method which creates a new agent profile (instance of AgentItemInterface) and adds it to the map unde...
Definition: AgentMapModel.cpp:42
AgentMapModel::contains
virtual bool contains(AgentMapInterface::Name const &name) const override
Method wich checks whether the map contains an agent profile with the given name. ...
Definition: AgentMapModel.cpp:108
AgentMapModel::getItem
virtual AgentMapInterface::Item * getItem(AgentMapInterface::Name const &name) const override
Method which returns a pointer to the agent profile with the given name. If the map does not contain ...
Definition: AgentMapModel.cpp:79
AgentMapModel::values
virtual QList< Item * > values() const override
Method which returns a list of pointers to all agent profiles in the map.
Definition: AgentMapModel.cpp:118
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67
AgentMapInterface::Iterator
Map::Iterator Iterator
an iterator for searching within the map
Definition: AgentMapInterface.h:47
AgentMapInterface::Map
QMap< Name, Item * > Map
the map (container class) for registering agent profiles
Definition: AgentMapInterface.h:46
AgentMapModel::keys
virtual QStringList keys() const override
Method which returns the (string) list of all agent profile names in the map.
Definition: AgentMapModel.cpp:113
AgentMapInterface::Name
AgentItemInterface::Name Name
the name of the agent profile (key identifier)
Definition: AgentMapInterface.h:42
AgentMapModel::begin
virtual AgentMapInterface::Iterator begin() override
Gets an iterator pointing to the first agent profile in the map.
Definition: AgentMapModel.cpp:21
AgentMapInterface.h
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
AgentMapModel::setName
virtual void setName(AgentMapInterface::Item *const item, AgentMapInterface::Name const &name) override
Method wich changes the name of the given agent profile to the one passed as second argument...
Definition: AgentMapModel.cpp:95
AgentMapModel::end
virtual AgentMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last agent profile.
Definition: AgentMapModel.cpp:31
AgentMapModel::constEnd
virtual AgentMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last agent profile (use for read-only)...
Definition: AgentMapModel.cpp:36
AgentItemInterface
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
Definition: AgentItemInterface.h:38
AgentMapModel::constBegin
virtual AgentMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first agent profile in the map (use for read-only since pointing at ...
Definition: AgentMapModel.cpp:26
AgentMapModel::getName
virtual AgentMapInterface::Name getName(AgentMapInterface::Item *const item) const override
Method wich returns the name of the given agent profile.
Definition: AgentMapModel.cpp:90
AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
Definition: AgentMapInterface.h:37
AgentItemModel.h
This class implements the functionality of AgentItemInterface.
AgentMapModel::count
virtual int count() const override
Method which returns the number of registered agent profiles.
Definition: AgentMapModel.cpp:123
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
Classes
AgentMapPresenter.h File Reference
Agent Configuration Plugin

This file contains the class AgentMapPresenter defining the presenter object for agent profiles as well as the classes for all undo-command objects used by AgentMapPresenter. More...

Detailed Description

This file contains the class AgentMapPresenter defining the presenter object for agent profiles as well as the classes for all undo-command objects used by AgentMapPresenter.

The AgentMapPresenter class handles user events from the view (AgentMapView) and edits the model data (AgentMapInterface) accordingly. Since all actions performed on the model data (i.e. the *.ui file) should be undoable, the presenter instantiates the corresponding undo-commands and pushes them onto the undo stack. The actual operation on the model is then performed in these command object using the re-implementations of the undo/redo methods. See Qt's undo framework for further details.

Definition in file AgentMapPresenter.h.

Go to the source code of this file.

Classes

class | AgentMapPresenter
The AgentMapPresenter class handles user events from the view (AgentMapView) and edits the model data (AgentMapInterface) accordingly. Since all actions performed on the model data (i.e. the *.ui file) should be undoable, the presenter instantiates the corresponding undo-commands and pushes them onto the undo stack. The actual operation on the model is then performed in these command object using the re-implementations of the undo/redo methods. See Qt's undo framework for further details. More...
class | AgentProfileCommands::AddAgentProfile
This class defines the command for undoable add-operations on the map of agent profiles (AgentMapInterface). More...
class | AgentProfileCommands::AddDriverProfile
This class defines the command for undoable add-operations on the driver profiles table of the currently edited agent profile (for dynamic agent profiles only). More...
class | AgentProfileCommands::AddVehicleProfile
This class defines the command for undoable add-operations on the vehicle profiles table of the currently edited agent profile (for dynamic agent profiles only). More...
class | AgentProfileCommands::EditAgentModel
This class defines the command for undoable set-operations on the vehicle model of the currently edited agent profile (for static profiles only). More...
class | AgentProfileCommands::EditAgentModelCatalogue
This class defines the command for undoable set-operations on the vehicle model catalogue of the currently edited agent profile (for static profiles only). More...
class | AgentProfileCommands::EditAgentProfile
This class defines the command for undoable renaming-operations on the map of agent profiles (AgentMapInterface). More...
class | AgentProfileCommands::EditAgentSystem
This class defines the command for undoable set-operations on the system of the currently edited agent profile (for static profiles only). More...
class | AgentProfileCommands::EditAgentSystemConfig
This class defines the command for undoable set-operations on the system config file of the currently edited agent profile (for static profiles only). More...
class | AgentProfileCommands::EditAgentType
This class defines the command for undoable set-operations on the type (static or dynamic) of an agent profile. More...
class | AgentProfileCommands::RemoveAgentProfile
This class defines the command for undoable remove-operations on the map of agent profiles (AgentMapInterface). More...
class | AgentProfileCommands::RemoveDriverProfile
This class defines the command for undoable remove-operations on the driver profiles table of the currently edited agent profile (for dynamic agent profiles only). More...
class | AgentProfileCommands::RemoveVehicleProfile
This class defines the command for undoable remove-operations on the vehicle profiles table of the currently edited agent profile (for dynamic agent profiles only). More...
class | AgentProfileCommands::SetCurrentAgent
This class defines the command for undoable set-operations on the currently selected agent profile. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
AgentMapPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
27
28 #ifndef AGENTMAPPRESENTER_H
29 #define AGENTMAPPRESENTER_H
30
31 #include "openPASS-AgentConfiguration/AgentMapInterface.h"
32 #include "openPASS-AgentConfiguration/VehicleProfileMapInterface.h"
33 #include "openPASS-AgentConfiguration/DriverProfileMapInterface.h"
34 #include "openPASS-Project/ProjectInterface.h"
35
36 #include "Presenters/VehicleProfilesMapPresenter.h"
37 #include "Presenters/DriverProfilesMapPresenter.h"
38
39 #include "Views/AgentMapView.h"
40
41 #include <QObject>
42 #include <QUndoStack>
43
44 //-----------------------------------------------------------------------------
53 //-----------------------------------------------------------------------------
54 class AgentMapPresenter : public QObject
55 {
56 Q_OBJECT
57 public:
58 explicit AgentMapPresenter(AgentMapInterface * agents,
59 VehicleProfileMapInterface *vehicleProfiles,
60 DriverProfileMapInterface *driverProfiles,
61 AgentMapView * agentsView,
62 ProjectInterface * const project,
63 QUndoStack * const undoStack,
64 QObject *parent = nullptr);
65 virtual ~AgentMapPresenter() = default;
66
67
68 private Q_SLOTS:
69 //-----------------------------------------------------------------------------
76 //-----------------------------------------------------------------------------
77 void setCurrentAgent(const QString &name);
78
79 //-----------------------------------------------------------------------------
85 //-----------------------------------------------------------------------------
86 void setType(const QString &type);
87
88 //-----------------------------------------------------------------------------
94 //-----------------------------------------------------------------------------
95 void addAgent(QString const & name);
96
97 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
105 void removeAgent(QString const & name);
106
107 //-----------------------------------------------------------------------------
113 //-----------------------------------------------------------------------------
114 void editAgent(QString const & oldName, QString const & newName);
115
116 private Q_SLOTS:
117 //-----------------------------------------------------------------------------
125 //-----------------------------------------------------------------------------
126 void addVehicleProfile();
127
128 //-----------------------------------------------------------------------------
136 //-----------------------------------------------------------------------------
137 void removeVehicleProfile( const int &row);
138
139 //-----------------------------------------------------------------------------
146 //-----------------------------------------------------------------------------
147 void updateVehicleSelectionItems();
148
149 //-----------------------------------------------------------------------------
156 //-----------------------------------------------------------------------------
157 void checkVehicleProbabilities();
158
159 private Q_SLOTS:
160 //-----------------------------------------------------------------------------
168 //-----------------------------------------------------------------------------
169 void addDriverProfile();
170
171 //-----------------------------------------------------------------------------
179 //-----------------------------------------------------------------------------
180 void removeDriverProfile(const int &row);
181
182 //-----------------------------------------------------------------------------
189 //-----------------------------------------------------------------------------
190 void updateDriverSelectionItems();
191
192 //-----------------------------------------------------------------------------
199 //-----------------------------------------------------------------------------
200 void checkDriverProbabilities();
201
202 public Q_SLOTS:
203 //-----------------------------------------------------------------------------
211 //-----------------------------------------------------------------------------
212 void setSystemConfig();
213
214 //-----------------------------------------------------------------------------
222 //-----------------------------------------------------------------------------
223 void refreshSystemConfig();
224
225 //-----------------------------------------------------------------------------
231 //-----------------------------------------------------------------------------
232 void setSystemItems(QString const &systemConfig);
233
234 //-----------------------------------------------------------------------------
242 //-----------------------------------------------------------------------------
243 void setSystem(QString const &system);
244
245 public Q_SLOTS:
246 //-----------------------------------------------------------------------------
254 //-----------------------------------------------------------------------------
255 void setModelCatalogue();
256
257 //-----------------------------------------------------------------------------
265 //-----------------------------------------------------------------------------
266 void refreshModelCatalogue();
267
268 //-----------------------------------------------------------------------------
274 //-----------------------------------------------------------------------------
275 void setModelItems(QString const &modelCatalogue);
276
277 //-----------------------------------------------------------------------------
283 //-----------------------------------------------------------------------------
284 void setModel(QString const &model);
285
286 public:
287 //-----------------------------------------------------------------------------
290 //-----------------------------------------------------------------------------
291 void updateView();
292
293 //-----------------------------------------------------------------------------
296 //-----------------------------------------------------------------------------
297 void updateAgentSelectionItems();
298
299 private:
300 //-----------------------------------------------------------------------------
305 //-----------------------------------------------------------------------------
306 void setupVehicleProfilesMap();
307
308 //-----------------------------------------------------------------------------
313 //-----------------------------------------------------------------------------
314 void setupDriverProfilesMap();
315
316 private:
317 friend class AgentConfigurationPresenter;
318
319 private:
320 //-----------------------------------------------------------------------------
329 //-----------------------------------------------------------------------------
330 AgentItemInterface::VehicleProfile findUnusedVehicleProfile();
331
332 //-----------------------------------------------------------------------------
341 //-----------------------------------------------------------------------------
342 AgentItemInterface::DriverProfile findUnusedDriverProfile();
343
344 private:
345 AgentMapInterface * const agents;
346 VehicleProfileMapInterface * const vehicleProfiles;
347 DriverProfileMapInterface * const driverProfiles;
348 AgentItemInterface * currentAgent;
349
350 private:
351 AgentMapView * const agentsView;
352 VehicleProfilesMapPresenter * vehicleProfilesMap;
353 DriverProfilesMapPresenter * driverProfilesMap;
354
355 private:
356 ProjectInterface * const project;
357 QUndoStack * const undoStack;
358
359 private:
360 QList<QString> *vehicleProfilesList;
361 QList<QString> *driverProfilesList;
362 QList<QString> systemList;
363 QList<QString> modelList;
364 static double default_probability;
365
366 };
367
368 namespace AgentProfileCommands {
369
370
371 //-----------------------------------------------------------------------------
374 //-----------------------------------------------------------------------------
375 class SetCurrentAgent : public QUndoCommand
376 {
377
378 public:
379 SetCurrentAgent(AgentMapInterface const * const agents,
380 AgentItemInterface ** const currentAgent,
381 AgentItemInterface::Name const newAgent,
382 VehicleProfilesMapPresenter * const vehicleProfilesMap,
383 DriverProfilesMapPresenter * const driverProfilesMap,
384 AgentMapPresenter * const agentMap,
385 QUndoCommand * parent = nullptr);
386
387 public:
388 void redo() override;
389 void undo() override;
390
391 private:
392 AgentMapInterface const * const agents;
393 AgentItemInterface ** const currentAgent;
394 AgentItemInterface::Name const newAgent;
395 AgentItemInterface::Name const oldAgent;
396
397 private:
398 AgentMapPresenter * const agentsMap;
399 VehicleProfilesMapPresenter * const vehicleProfilesMap;
400 DriverProfilesMapPresenter * const driverProfilesMap;
401
402 };
403
404 //-----------------------------------------------------------------------------
407 //-----------------------------------------------------------------------------
408 class AddAgentProfile : public QUndoCommand
409 {
410
411 public:
412 AddAgentProfile(AgentMapInterface * const agents,
413 AgentMapView * const agentsView,
414 AgentMapInterface::Name const &name,
415 QUndoCommand * parent = nullptr);
416 public:
417 void redo() override;
418 void undo() override;
419
420 private:
421 AgentMapInterface * const agents;
422 AgentMapView * const agentsView;
423 AgentMapInterface::Name const name;
424 };
425
426 //-----------------------------------------------------------------------------
429 //-----------------------------------------------------------------------------
430 class RemoveAgentProfile : public QUndoCommand
431 {
432
433 public:
434 RemoveAgentProfile(AgentMapInterface * const agents,
435 AgentMapView * const agentsView,
436 AgentMapInterface::Name const &name,
437 QUndoCommand * parent = nullptr);
438 virtual ~RemoveAgentProfile() override;
439
440 public:
441 void redo() override;
442 void undo() override;
443
444 private:
445 AgentMapInterface * const agents;
446 AgentMapView * const agentsView;
447 AgentMapInterface::Name const name;
448 AgentItemInterface const * const agent;
449 };
450
451 //-----------------------------------------------------------------------------
454 //-----------------------------------------------------------------------------
455 class EditAgentProfile : public QUndoCommand
456 {
457
458 public:
459 EditAgentProfile(AgentMapInterface * const agents,
460 AgentMapView * const agentsView,
461 AgentItemInterface::Name const &oldName,
462 AgentItemInterface::Name const &newName,
463 QUndoCommand *parent = nullptr);
464
465 public:
466 void redo() override;
467 void undo() override;
468
469 private:
470 AgentMapInterface * const agents;
471 AgentMapView * const agentsView;
472 AgentItemInterface::Name const oldName;
473 AgentItemInterface::Name const newName;
474 };
475
476 //-----------------------------------------------------------------------------
479 //-----------------------------------------------------------------------------
480 class EditAgentType : public QUndoCommand
481 {
482 public:
483 EditAgentType(AgentMapInterface * const agents,
484 AgentItemInterface::Name const &agentName,
485 AgentItemInterface::Type const &newType,
486 AgentMapPresenter * const agentsPresenter,
487 QUndoCommand *parent = nullptr);
488
489 public:
490 void redo() override;
491 void undo() override;
492
493 private:
494 AgentMapInterface * const agents;
495 AgentMapInterface::Name const agentName;
496 AgentItemInterface::Type const newType;
497 AgentItemInterface::Type const oldType;
498 AgentMapPresenter * const agentsPresenter;
499 };
500
501 //-----------------------------------------------------------------------------
505 //-----------------------------------------------------------------------------
506 class EditAgentSystemConfig : public QUndoCommand
507 {
508
509 public:
510 EditAgentSystemConfig(AgentMapInterface * const agents,
511 AgentMapView * const agentsView,
512 AgentMapPresenter * const agentsPresenter,
513 AgentItemInterface::Name const &agentName,
514 AgentItemInterface::SystemConfig const &newSystemConfig,
515 QUndoCommand *parent = nullptr);
516
517 public:
518 void redo() override;
519 void undo() override;
520
521 private:
522 AgentMapInterface * const agents;
523 AgentMapView * const agentsView;
524 AgentMapPresenter * const agentsPresenter;
525 AgentItemInterface::Name const agentName;
526 AgentItemInterface::SystemConfig const newSystemConfig;
527 AgentItemInterface::SystemConfig const oldSystemConfig;
528 };
529
530 //-----------------------------------------------------------------------------
534 //-----------------------------------------------------------------------------
535 class EditAgentSystem: public QUndoCommand
536 {
537
538 public:
539 EditAgentSystem(AgentMapInterface * const agents,
540 AgentMapView * const agentsView,
541 AgentItemInterface::Name const &agentName,
542 AgentItemInterface::SystemTitle const &newTitle,
543 AgentItemInterface::SystemID const &newId,
544 QUndoCommand *parent = nullptr);
545
546 public:
547 void redo() override;
548 void undo() override;
549
550 private:
551 AgentMapInterface * const agents;
552 AgentMapView * const agentsView;
553 AgentItemInterface::Name const agentName;
554 AgentItemInterface::SystemTitle const newTitle;
555 AgentItemInterface::SystemID const newId;
556 AgentItemInterface::SystemTitle const oldTitle;
557 AgentItemInterface::SystemID const oldId;
558
559 };
560
561 //-----------------------------------------------------------------------------
565 //-----------------------------------------------------------------------------
566 class EditAgentModelCatalogue : public QUndoCommand
567 {
568 public:
569 EditAgentModelCatalogue(AgentMapInterface * const agents,
570 AgentMapView * const agentsView,
571 AgentMapPresenter * const agentsPresenter,
572 AgentItemInterface::Name const &agentName,
573 AgentItemInterface::VehicleModelCatalogue const &newModelCatalogue,
574 QUndoCommand *parent = nullptr);
575
576 public:
577 void redo() override;
578 void undo() override;
579
580 private:
581 AgentMapInterface * const agents;
582 AgentMapView * const agentsView;
583 AgentMapPresenter * const agentsPresenter;
584 AgentItemInterface::Name const agentName;
585 AgentItemInterface::VehicleModelCatalogue const newModelCatalogue;
586 AgentItemInterface::VehicleModelCatalogue const oldModelCatalogue;
587 };
588
589 //-----------------------------------------------------------------------------
593 //-----------------------------------------------------------------------------
594 class EditAgentModel : public QUndoCommand
595 {
596 public:
597 EditAgentModel(AgentMapInterface * const agents,
598 AgentMapView * const agentsView,
599 AgentItemInterface::Name const &agentName,
600 AgentItemInterface::VehicleModel const &newModel,
601 QUndoCommand *parent = nullptr);
602
603 public:
604 void redo() override;
605 void undo() override;
606
607 private:
608 AgentMapInterface * const agents;
609 AgentMapView * const agentsView;
610 AgentItemInterface::Name const agentName;
611 AgentItemInterface::VehicleModel const newModel;
612 AgentItemInterface::VehicleModel const oldModel;
613 };
614
615 //-----------------------------------------------------------------------------
619 //-----------------------------------------------------------------------------
620 class AddDriverProfile : public QUndoCommand
621 {
622
623 public:
624 AddDriverProfile(DriverProfilesMapPresenter * const drivers,
625 AgentItemInterface::DriverProfile const &profile,
626 AgentItemInterface::Probability const &probability,
627 QUndoCommand *parent = nullptr);
628
629 public:
630 void redo() override;
631 void undo() override;
632
633 private:
634 DriverProfilesMapPresenter * const drivers;
635 AgentItemInterface::DriverProfile const profile;
636 AgentItemInterface::Probability const probability;
637
638 };
639
640 //-----------------------------------------------------------------------------
644 //-----------------------------------------------------------------------------
645 class RemoveDriverProfile : public QUndoCommand
646 {
647
648 public:
649 RemoveDriverProfile(DriverProfilesMapPresenter * const drivers,
650 int const &row,
651 QUndoCommand *parent = nullptr);
652
653 public:
654 void redo() override;
655 void undo() override;
656
657 private:
658 DriverProfilesMapPresenter * const drivers;
659 int const row;
660 AgentItemInterface::DriverProfile const profile;
661 AgentItemInterface::Probability const probability;
662
663 };
664
665 //-----------------------------------------------------------------------------
669 //-----------------------------------------------------------------------------
670 class AddVehicleProfile : public QUndoCommand
671 {
672
673 public:
674 AddVehicleProfile(VehicleProfilesMapPresenter * const vehicles,
675 AgentItemInterface::VehicleProfile const &profile,
676 AgentItemInterface::Probability const &probability,
677 QUndoCommand *parent = nullptr);
678
679 public:
680 void redo() override;
681 void undo() override;
682
683 private:
684 VehicleProfilesMapPresenter * const vehicles;
685 AgentItemInterface::VehicleProfile const profile;
686 AgentItemInterface::Probability const probability;
687
688 };
689
690 //-----------------------------------------------------------------------------
694 //-----------------------------------------------------------------------------
695 class RemoveVehicleProfile : public QUndoCommand
696 {
697
698 public:
699 RemoveVehicleProfile(VehicleProfilesMapPresenter * const vehicles,
700 int const &row,
701 QUndoCommand *parent = nullptr);
702
703 public:
704 void redo() override;
705 void undo() override;
706
707 private:
708 VehicleProfilesMapPresenter * const vehicles;
709 int const row;
710 AgentItemInterface::VehicleProfile const profile;
711 AgentItemInterface::Probability const probability;
712
713 };
714
715 }
716
717 #endif // AGENTMAPPRESENTER_H
AgentProfileCommands::EditAgentType
This class defines the command for undoable set-operations on the type (static or dynamic) of an agen...
Definition: AgentMapPresenter.h:480
AgentMapPresenter::vehicleProfilesMap
VehicleProfilesMapPresenter * vehicleProfilesMap
the pointer to the presenter object of the table for assigning vehicle profiles to the current agent ...
Definition: AgentMapPresenter.h:352
AgentMapPresenter::setModelCatalogue
void setModelCatalogue()
Slot triggered by the AgentMapView::setModelCatalogue signal. Opens a file dialog for the user to sel...
Definition: AgentMapPresenter.cpp:396
AgentMapView
This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu ...
Definition: AgentMapView.h:56
AgentItemInterface::DriverProfile
QString DriverProfile
the nome of a driver profile
Definition: AgentItemInterface.h:60
AgentMapPresenter::checkDriverProbabilities
void checkDriverProbabilities()
Slot triggered by the DriverProfilesMapPresenter::checkProbabilities signal. Calculates the probabili...
Definition: AgentMapPresenter.cpp:225
AgentMapPresenter::setSystemConfig
void setSystemConfig()
Slot triggered by the AgentMapView::setSystemConfig signal. Opens a file dialog for the user to selec...
Definition: AgentMapPresenter.cpp:294
AgentItemInterface::SystemID
unsigned int SystemID
the id of a system defined in a system config
Definition: AgentItemInterface.h:49
AgentProfileCommands::AddAgentProfile
This class defines the command for undoable add-operations on the map of agent profiles (AgentMapInte...
Definition: AgentMapPresenter.h:408
AgentMapPresenter::modelList
QList< QString > modelList
a list of all vehicle models available in the currently selected vehicle model catalogue ...
Definition: AgentMapPresenter.h:363
AgentProfileCommands::EditAgentProfile
This class defines the command for undoable renaming-operations on the map of agent profiles (AgentMa...
Definition: AgentMapPresenter.h:455
AgentConfigurationPresenter
This class defines the presenter object which handles events from the view (AgentConfigurationView) a...
Definition: AgentConfigurationPresenter.h:41
AgentItemInterface::SystemTitle
QString SystemTitle
the title of a system defined in a system config
Definition: AgentItemInterface.h:50
AgentProfileCommands::RemoveDriverProfile
This class defines the command for undoable remove-operations on the driver profiles table of the cur...
Definition: AgentMapPresenter.h:645
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentMapPresenter::removeDriverProfile
void removeDriverProfile(const int &row)
Slot triggered by the AgentMapView::removeDriverProfile signal. Performs an undoable remove-operation...
Definition: AgentMapPresenter.cpp:213
AgentMapPresenter::refreshSystemConfig
void refreshSystemConfig()
Slot triggered by the AgentMapView::refreshSystemConfig and ProjectInterface::update signals...
Definition: AgentMapPresenter.cpp:316
AgentMapPresenter::setupVehicleProfilesMap
void setupVehicleProfilesMap()
Method which is called by the constructor. Instantiates and sets up the presenter object (VehicleProf...
Definition: AgentMapPresenter.cpp:78
AgentMapPresenter::setCurrentAgent
void setCurrentAgent(const QString &name)
Slot triggered by the AgentMapView::selectionChanged signal. Performs an undoable set-operation on th...
Definition: AgentMapPresenter.cpp:106
AgentProfileCommands::SetCurrentAgent
This class defines the command for undoable set-operations on the currently selected agent profile...
Definition: AgentMapPresenter.h:375
AgentMapPresenter::setModelItems
void setModelItems(QString const &modelCatalogue)
Slot which is used to scan the model catalogue file for available vehicle models. Updates the selecti...
Definition: AgentMapPresenter.cpp:451
AgentMapView.h
This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu ...
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentMapPresenter::agents
AgentMapInterface *const agents
the pointer to the map of agent profiles (edited by this presenter)
Definition: AgentMapPresenter.h:345
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentItemInterface::Type
QString Type
the type of the agent profile (dynamic or static)
Definition: AgentItemInterface.h:44
AgentProfileCommands::RemoveAgentProfile
This class defines the command for undoable remove-operations on the map of agent profiles (AgentMapI...
Definition: AgentMapPresenter.h:430
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
DriverProfilesMapPresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of driver prof...
Definition: DriverProfilesMapPresenter.h:33
AgentItemInterface::VehicleModel
QString VehicleModel
a vehicle model defined in a vehicle model catalogue file
Definition: AgentItemInterface.h:53
DriverProfileMapInterface.h
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
AgentMapInterface::Name
AgentItemInterface::Name Name
the name of the agent profile (key identifier)
Definition: AgentMapInterface.h:42
AgentMapPresenter::setType
void setType(const QString &type)
Slot triggered by the AgentMapView::typeChanged signal. Performs an undoable set-operation on the typ...
Definition: AgentMapPresenter.cpp:113
AgentItemInterface::VehicleModelCatalogue
QString VehicleModelCatalogue
the vehicle model catalogue file
Definition: AgentItemInterface.h:52
AgentProfileCommands::AddDriverProfile
This class defines the command for undoable add-operations on the driver profiles table of the curren...
Definition: AgentMapPresenter.h:620
AgentMapPresenter::addVehicleProfile
void addVehicleProfile()
Slot triggered by the AgentMapView::addVehicleProfile signal. Performs an undoable add-operation on t...
Definition: AgentMapPresenter.cpp:151
AgentMapPresenter::checkVehicleProbabilities
void checkVehicleProbabilities()
Slot triggered by the VehicleProfilesMapPresenter::checkProbabilities signal. Calculates the probabil...
Definition: AgentMapPresenter.cpp:193
AgentMapPresenter::setSystemItems
void setSystemItems(QString const &systemConfig)
Slot which is used to scan the given system config for available systems. Updates the selection of th...
Definition: AgentMapPresenter.cpp:350
AgentMapPresenter::setupDriverProfilesMap
void setupDriverProfilesMap()
Method which is called by the constructor. Instantiates and sets up the presenter object (DriverProfi...
Definition: AgentMapPresenter.cpp:92
AgentMapPresenter::findUnusedDriverProfile
AgentItemInterface::DriverProfile findUnusedDriverProfile()
Method which scans the driver profiles map (DriverProfileMapInterface) for the first entry which is n...
Definition: AgentMapPresenter.cpp:170
AgentItemInterface::Name
QString Name
the name of the agent profiles
Definition: AgentItemInterface.h:43
DriverProfilesMapPresenter.h
This class constitutes the re-implementation of QAbstractTableModel for the table view of driver prof...
AgentMapPresenter::removeVehicleProfile
void removeVehicleProfile(const int &row)
Slot triggered by the AgentMapView::removeVehicleProfile signal. Performs an undoable remove-operatio...
Definition: AgentMapPresenter.cpp:181
AgentMapPresenter::updateDriverSelectionItems
void updateDriverSelectionItems()
Slot triggered by the DriverProfileMapInterface::added, DriverProfileMapInterface::removed and Driver...
Definition: AgentMapPresenter.cpp:219
AgentMapPresenter::removeAgent
void removeAgent(QString const &name)
Slot triggered by the AgentMapView::remove signal. Performs an undoable remove-operation on the agent...
Definition: AgentMapPresenter.cpp:129
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
AgentMapPresenter::editAgent
void editAgent(QString const &oldName, QString const &newName)
Slot triggered by the AgentMapView::modifiedName signal. Performs an undoable rename-operation on the...
Definition: AgentMapPresenter.cpp:145
AgentMapInterface.h
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
AgentMapPresenter::driverProfilesMap
DriverProfilesMapPresenter * driverProfilesMap
the pointer to the presenter object of the table for assigning driver profiles to the current agent p...
Definition: AgentMapPresenter.h:353
AgentProfileCommands::EditAgentModelCatalogue
This class defines the command for undoable set-operations on the vehicle model catalogue of the curr...
Definition: AgentMapPresenter.h:566
AgentMapPresenter
The AgentMapPresenter class handles user events from the view (AgentMapView) and edits the model data...
Definition: AgentMapPresenter.h:54
AgentMapPresenter::updateView
void updateView()
Method which updates the complete view (AgentMapView) according to the model data of the current agen...
Definition: AgentMapPresenter.cpp:237
AgentMapPresenter::driverProfiles
DriverProfileMapInterface *const driverProfiles
the pointer to the driver profiles&#39; map
Definition: AgentMapPresenter.h:347
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
VehicleProfilesMapPresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle pro...
Definition: VehicleProfilesMapPresenter.h:33
AgentMapPresenter::project
ProjectInterface *const project
the pointer to the project interface for accessing the path settings
Definition: AgentMapPresenter.h:356
AgentProfileCommands::EditAgentSystem
This class defines the command for undoable set-operations on the system of the currently edited agen...
Definition: AgentMapPresenter.h:535
AgentMapPresenter::setSystem
void setSystem(QString const &system)
Slot triggered by the AgentMapView::selectedSystem signal. First extracts Id and title of the given s...
Definition: AgentMapPresenter.cpp:280
AgentItemInterface::SystemConfig
QString SystemConfig
the system config file
Definition: AgentItemInterface.h:48
AgentMapPresenter::updateVehicleSelectionItems
void updateVehicleSelectionItems()
Slot triggered by the VehicleProfileMapInterface::added, VehicleProfileMapInterface::removed and Vehi...
Definition: AgentMapPresenter.cpp:187
AgentItemInterface::VehicleProfile
QString VehicleProfile
the name of a vehicle profile
Definition: AgentItemInterface.h:56
AgentMapPresenter::setModel
void setModel(QString const &model)
Slot triggered by the AgentMapView::setModel signal. Performs an undoable assignment of the given veh...
Definition: AgentMapPresenter.cpp:390
VehicleProfilesMapPresenter.h
This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle pro...
AgentItemInterface
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
Definition: AgentItemInterface.h:38
VehicleProfileMapInterface.h
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
AgentProfileCommands::RemoveVehicleProfile
This class defines the command for undoable remove-operations on the vehicle profiles table of the cu...
Definition: AgentMapPresenter.h:695
AgentMapPresenter::refreshModelCatalogue
void refreshModelCatalogue()
Slot triggered by the AgentMapView::refreshModelCatalogue and ProjectInterface::update signals...
Definition: AgentMapPresenter.cpp:420
AgentMapPresenter::addDriverProfile
void addDriverProfile()
Slot triggered by the AgentMapView::addDriverProfile signal. Performs an undoable add-operation on th...
Definition: AgentMapPresenter.cpp:205
AgentProfileCommands::EditAgentModel
This class defines the command for undoable set-operations on the vehicle model of the currently edit...
Definition: AgentMapPresenter.h:594
AgentProfileCommands::EditAgentSystemConfig
This class defines the command for undoable set-operations on the system config file of the currently...
Definition: AgentMapPresenter.h:506
AgentMapPresenter::findUnusedVehicleProfile
AgentItemInterface::VehicleProfile findUnusedVehicleProfile()
Method which scans the vehicle profiles map (VehicleProfileMapInterface) for the first entry which is...
Definition: AgentMapPresenter.cpp:159
AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
Definition: AgentMapInterface.h:37
AgentItemInterface::Probability
double Probability
a probability value (e.g. of a driver or a vehicle profile)
Definition: AgentItemInterface.h:45
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
AgentMapPresenter::driverProfilesList
QList< QString > * driverProfilesList
a pointer to a list of driver profiles containing all profiles registered in DriverProfileMapInterfac...
Definition: AgentMapPresenter.h:361
AgentMapPresenter::updateAgentSelectionItems
void updateAgentSelectionItems()
Method which updates the combo box list of available agent profiles to the ones currently defined in ...
Definition: AgentMapPresenter.cpp:275
AgentProfileCommands
Definition: AgentMapPresenter.h:368
AgentMapPresenter::vehicleProfiles
VehicleProfileMapInterface *const vehicleProfiles
the pointer to the vehicle profiles&#39; map
Definition: AgentMapPresenter.h:346
AgentMapPresenter::systemList
QList< QString > systemList
a list of all systems available in the currently selected system config
Definition: AgentMapPresenter.h:362
AgentProfileCommands::AddVehicleProfile
This class defines the command for undoable add-operations on the vehicle profiles table of the curre...
Definition: AgentMapPresenter.h:670
AgentMapPresenter::addAgent
void addAgent(QString const &name)
Slot triggered by the AgentMapView::add signal. Performs an undoable add-operation on the agent profi...
Definition: AgentMapPresenter.cpp:118
AgentMapPresenter::vehicleProfilesList
QList< QString > * vehicleProfilesList
a pointer to a list of vehicle profiles containing all profiles registered in VehicleProfileMapInterf...
Definition: AgentMapPresenter.h:360
AgentMapPresenter::default_probability
static double default_probability
a default probability
Definition: AgentMapPresenter.h:364
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
Classes
AgentMapView.h File Reference
Agent Configuration Plugin

This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu for selecting a profile to be edited as well as buttons for removing and adding agent profiles. Further, a menu for editing the type ("dynamic" or "static") is provided whose selection switches between two different views. If the type "dynamic" is selected, two tables for assigning driver and vehicle profiles with probabilities appear. If type "static" is selected, the view is reduced to a selection menu for a system config + system as well as a vehicle model catalogue + model. The switching between the two modes is realized via a stacked widget whose pages contain the GUI elements being exclusive for the selected mode. Further information on how to use this view can be found in the GUI tutorial. More...

Detailed Description

This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu for selecting a profile to be edited as well as buttons for removing and adding agent profiles. Further, a menu for editing the type ("dynamic" or "static") is provided whose selection switches between two different views. If the type "dynamic" is selected, two tables for assigning driver and vehicle profiles with probabilities appear. If type "static" is selected, the view is reduced to a selection menu for a system config + system as well as a vehicle model catalogue + model. The switching between the two modes is realized via a stacked widget whose pages contain the GUI elements being exclusive for the selected mode. Further information on how to use this view can be found in the GUI tutorial.

Definition in file AgentMapView.h.

Go to the source code of this file.

Classes

class AgentMapView
This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu for selecting a profile to be edited as well as buttons for removing and adding agent profiles. Further, a menu for editing the type ("dynamic" or "static") is provided whose selection switches between two different views. If the type "dynamic" is selected, two tables for assigning driver and vehicle profiles with probabilities appear. If type "static" is selected, the view is reduced to a selection menu for a system config + system as well as a vehicle model catalogue + model. The switching between the two modes is realized via a stacked widget whose pages contain the GUI elements being exclusive for the selected mode. Further information on how to use this view can be found in the GUI tutorial. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
AgentMapView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------
28
29 #ifndef AGENTMAPVIEW_H
30 #define AGENTMAPVIEW_H
31
32 #include "WidgetView.h"
33
34 #include <QWidget>
35 #include <QTableView>
36
37 namespace Ui {
38 class AgentMapView;
39 }
40
41 //-----------------------------------------------------------------------------
55 //-----------------------------------------------------------------------------
56 class AgentMapView : public WidgetView
57 {
58 Q_OBJECT
59
60 public:
61 explicit AgentMapView(QWidget *parent = nullptr);
62 ~AgentMapView();
63
64 Q_SIGNALS:
65 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 void add(QString const & name);
73
74 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
81 void remove(QString const & name);
82
83 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 void selectionChanged(QString const & name);
91
92 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 void typeChanged(QString const &type);
99
100 //-----------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------
108 void modifiedName(QString const & oldName, QString const & newName);
109
110 Q_SIGNALS:
111 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------
115 void addVehicleProfile();
116
117 //-----------------------------------------------------------------------------
123 //-----------------------------------------------------------------------------
124 void removeVehicleProfile(const int &row);
125
126 Q_SIGNALS:
127 //-----------------------------------------------------------------------------
130 //-----------------------------------------------------------------------------
131 void addDriverProfile();
132
133 //-----------------------------------------------------------------------------
139 //-----------------------------------------------------------------------------
140 void removeDriverProfile(const int &row);
141
142 Q_SIGNALS:
143 //-----------------------------------------------------------------------------
146 //-----------------------------------------------------------------------------
147 void refreshSystemConfig();
148
149 //-----------------------------------------------------------------------------
152 //-----------------------------------------------------------------------------
153 void setSystemConfig();
154
155 //-----------------------------------------------------------------------------
160 //-----------------------------------------------------------------------------
161 void selectedSystem(QString const &system);
162
163 //-----------------------------------------------------------------------------
166 //-----------------------------------------------------------------------------
167 void refreshModelCatalogue();
168
169 //-----------------------------------------------------------------------------
172 //-----------------------------------------------------------------------------
173 void setModelCatalogue();
174
175 //-----------------------------------------------------------------------------
180 //-----------------------------------------------------------------------------
181 void setModel(QString const &model);
182
183
184 private Q_SLOTS:
185 //-----------------------------------------------------------------------------
188 //-----------------------------------------------------------------------------
189 void on_add_clicked();
190
191 //-----------------------------------------------------------------------------
194 //-----------------------------------------------------------------------------
195 void on_remove_clicked();
196
197 //-----------------------------------------------------------------------------
201 //-----------------------------------------------------------------------------
202 void on_edit_clicked();
203
204 //-----------------------------------------------------------------------------
209 //-----------------------------------------------------------------------------
210 void on_AgentProfileSelection_activated(const QString &name);
211
212 //-----------------------------------------------------------------------------
217 //-----------------------------------------------------------------------------
218 void on_Type_activated(const QString &type);
219
220 private Q_SLOTS:
221 //-----------------------------------------------------------------------------
224 //-----------------------------------------------------------------------------
225 void on_addVehicle_clicked();
226
227 //-----------------------------------------------------------------------------
230 //-----------------------------------------------------------------------------
231 void on_removeVehicle_clicked();
232
233 private Q_SLOTS:
234 //-----------------------------------------------------------------------------
237 //-----------------------------------------------------------------------------
238 void on_addDriver_clicked();
239
240 //-----------------------------------------------------------------------------
243 //-----------------------------------------------------------------------------
244 void on_removeDriver_clicked();
245
246 private Q_SLOTS:
247 //-----------------------------------------------------------------------------
252 //-----------------------------------------------------------------------------
253 void on_system_activated(const QString &system);
254
255 //-----------------------------------------------------------------------------
258 //-----------------------------------------------------------------------------
259 void on_systemConfigBrowse_clicked();
260
261 //-----------------------------------------------------------------------------
264 //-----------------------------------------------------------------------------
265 void on_systemConfigRefresh_clicked();
266
267 private Q_SLOTS:
268 //-----------------------------------------------------------------------------
271 //-----------------------------------------------------------------------------
272 void on_ModelCatalogueBrowse_clicked();
273
274 //-----------------------------------------------------------------------------
277 //-----------------------------------------------------------------------------
278 void on_ModelCatalogueRefresh_clicked();
279
280 //-----------------------------------------------------------------------------
285 //-----------------------------------------------------------------------------
286 void on_Model_activated(const QString &model);
287
288 public:
289 //-----------------------------------------------------------------------------
293 //-----------------------------------------------------------------------------
294 QTableView * getVehicleProfilesView() const;
295
296 //-----------------------------------------------------------------------------
300 //-----------------------------------------------------------------------------
301 QTableView * getDriverProfilesView() const;
302
303 public:
304 //-----------------------------------------------------------------------------
310 //-----------------------------------------------------------------------------
311 void addAgent(QString const & name);
312
313 //-----------------------------------------------------------------------------
319 //-----------------------------------------------------------------------------
320 void removeAgent(QString const & name);
321
322 //-----------------------------------------------------------------------------
328 //-----------------------------------------------------------------------------
329 void setAgentSelectionItems(QStringList const &names);
330
331 //-----------------------------------------------------------------------------
337 //-----------------------------------------------------------------------------
338 void setCurrentAgent(QString const & name);
339
340 //-----------------------------------------------------------------------------
346 //-----------------------------------------------------------------------------
347 void setCurrentType(QString const &type);
348
349 //-----------------------------------------------------------------------------
354 //-----------------------------------------------------------------------------
355 void clear();
356
357 public:
358 //-----------------------------------------------------------------------------
363 //-----------------------------------------------------------------------------
364 void setCurrentSystemConfig(const QString &systemConfig);
365
366 //-----------------------------------------------------------------------------
372 //-----------------------------------------------------------------------------
373 void setSystemSelectionItems(const QStringList &systemItems);
374
375 //-----------------------------------------------------------------------------
380 //-----------------------------------------------------------------------------
381 void setCurrentSystem(const QString &system);
382
383 //-----------------------------------------------------------------------------
389 //-----------------------------------------------------------------------------
390 void setCurrentModelCatalogue(const QString &modelCatalogue);
391
392 //-----------------------------------------------------------------------------
398 //-----------------------------------------------------------------------------
399 void setModelSelectionItems(const QStringList &modelItems);
400
401 //-----------------------------------------------------------------------------
406 //-----------------------------------------------------------------------------
407 void setCurrentModel(const QString &model);
408
409 public:
410 //-----------------------------------------------------------------------------
417 //-----------------------------------------------------------------------------
418 void enableConfiguration(bool enable);
419
420 //-----------------------------------------------------------------------------
427 //-----------------------------------------------------------------------------
428 void enableModelView(bool enable);
429
430 //-----------------------------------------------------------------------------
437 //-----------------------------------------------------------------------------
438 void enableSystemView(bool enable);
439
440 public:
441 //-----------------------------------------------------------------------------
446 //-----------------------------------------------------------------------------
447 void setSystemConfigError(QString const &message);
448
449 //-----------------------------------------------------------------------------
454 //-----------------------------------------------------------------------------
455 void setModelCatalogueError(QString const &message);
456
457 //-----------------------------------------------------------------------------
462 //-----------------------------------------------------------------------------
463 void setDriverProbabilityError(bool error);
464
465 //-----------------------------------------------------------------------------
470 //-----------------------------------------------------------------------------
471 void setVehicleProbabilityError(bool error);
472
473 private:
474 //-----------------------------------------------------------------------------
484 //-----------------------------------------------------------------------------
485 bool eventFilter(QObject *watched, QEvent *event);
486
487 private:
488 Ui::AgentMapView *ui;
489 };
490
491 #endif // AGENTMAPVIEW_H
AgentMapView
This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu ...
Definition: AgentMapView.h:56
AgentMapView::on_Type_activated
void on_Type_activated(const QString &type)
Slot which emits the typeChanged signal after changing the current selection of the type selection bo...
Definition: AgentMapView.cpp:198
AgentMapView::modifiedName
void modifiedName(QString const &oldName, QString const &newName)
Signal, emitted after the rename-button has been pressed. Transmits the new name inserted by the user...
AgentMapView::setSystemSelectionItems
void setSystemSelectionItems(const QStringList &systemItems)
Method which the sets the systems&#39; selection list (drop down menu) to the one passed as an argument...
Definition: AgentMapView.cpp:229
AgentMapView::setModelCatalogue
void setModelCatalogue()
Signal, emitted after the browse-button of the vehicle model catalogue has been pressed (only in "sta...
AgentMapView::clear
void clear()
Method which clears the current selection elements for static agent profiles and sets the type and mo...
Definition: AgentMapView.cpp:142
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
AgentMapView::setCurrentModel
void setCurrentModel(const QString &model)
Method which the sets the vehicle model currently displayed by the vehicle models&#39; drop down menu to ...
Definition: AgentMapView.cpp:258
AgentMapView::on_AgentProfileSelection_activated
void on_AgentProfileSelection_activated(const QString &name)
Slot which emits the selectionChanged signal after changing the current selection of the agent profil...
Definition: AgentMapView.cpp:137
AgentMapView::on_system_activated
void on_system_activated(const QString &system)
Slot which emits the selectedSystem signal after the current entry of the system selection box is cha...
Definition: AgentMapView.cpp:203
AgentMapView::enableModelView
void enableModelView(bool enable)
Method which enables or disables the drop down menu for vehicle models (for static agent profiles)...
Definition: AgentMapView.cpp:41
AgentMapView::setSystemConfig
void setSystemConfig()
Signal, emitted after the browse-button of the system config has been pressed (only in "static" mode)...
AgentMapView::setModel
void setModel(QString const &model)
Signal, emitted after the current entry in the vehicle model selection box has been changed by the us...
AgentMapView::setCurrentModelCatalogue
void setCurrentModelCatalogue(const QString &modelCatalogue)
Method which the currently displayed vehicle model catalogue to the one passed as an argument...
Definition: AgentMapView.cpp:253
AgentMapView::on_removeVehicle_clicked
void on_removeVehicle_clicked()
Slot which emits the removeVehicleProfile signal after the remove-button for vehicle profiles has bee...
Definition: AgentMapView.cpp:159
AgentMapView::setModelSelectionItems
void setModelSelectionItems(const QStringList &modelItems)
Method which the sets the vehicle models&#39; selection list (drop down menu) to the one passed as an arg...
Definition: AgentMapView.cpp:264
AgentMapView::on_add_clicked
void on_add_clicked()
Slot which emits the add signal after the add-button for agent profiles has been added.
Definition: AgentMapView.cpp:74
AgentMapView::refreshSystemConfig
void refreshSystemConfig()
Signal, emitted after the refresh-button of the system config has been pressed (only in "static" mode...
AgentMapView::removeAgent
void removeAgent(QString const &name)
Method which removes the given agent profile name from the agent selection list (drop down menu for a...
Definition: AgentMapView.cpp:130
AgentMapView::removeDriverProfile
void removeDriverProfile(const int &row)
Signal, emitted after the remove-button for driver profiles has been clicked by the user (only in "dy...
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488
AgentMapView::setCurrentSystem
void setCurrentSystem(const QString &system)
Method which the sets the system currently displayed by the systems&#39; drop down menu to the one passed...
Definition: AgentMapView.cpp:223
AgentMapView::enableConfiguration
void enableConfiguration(bool enable)
Method which enables or disables the GUI elements of this view, apart from the add-button for adding ...
Definition: AgentMapView.cpp:51
AgentMapView::selectionChanged
void selectionChanged(QString const &name)
Signal, emitted after the current entry of the combo box for available agent profiles has been change...
AgentMapView::setCurrentAgent
void setCurrentAgent(QString const &name)
Method which sets the agent profile name to be currently shown in the drop down menu for agent profil...
Definition: AgentMapView.cpp:113
AgentMapView::refreshModelCatalogue
void refreshModelCatalogue()
Signal, emitted after the refresh-button of the vehicle model catalogue has been pressed (only in "st...
AgentMapView::add
void add(QString const &name)
Signal, emitted after the add-button for agent profiles has been clicked and a name for a new profile...
AgentMapView::getVehicleProfilesView
QTableView * getVehicleProfilesView() const
Method which provides access to the table view for vehicle profiles.
Definition: AgentMapView.cpp:174
AgentMapView::addAgent
void addAgent(QString const &name)
Method which adds the given agent profile name to the agent selection list (drop down menu for agent ...
Definition: AgentMapView.cpp:119
AgentMapView::setVehicleProbabilityError
void setVehicleProbabilityError(bool error)
Method puts a probability error message above the vehicle profiles&#39; table if given error flag is "tru...
Definition: AgentMapView.cpp:302
AgentMapView::on_addDriver_clicked
void on_addDriver_clicked()
Slot which emits the addDriverProfile signal after the add-button for driver profiles has been clicke...
Definition: AgentMapView.cpp:164
AgentMapView::setAgentSelectionItems
void setAgentSelectionItems(QStringList const &names)
Method which clears the selection list for agent profiles (drop down menu) and inserts the given list...
Definition: AgentMapView.cpp:124
AgentMapView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter for catching the resize-events of the driver and vehicle profile...
Definition: AgentMapView.cpp:270
AgentMapView::on_systemConfigBrowse_clicked
void on_systemConfigBrowse_clicked()
Slot which emits the setSystemConfig signal after the browse-button for the system config file has be...
Definition: AgentMapView.cpp:208
AgentMapView::getDriverProfilesView
QTableView * getDriverProfilesView() const
Method which provides access to the table view for driver profiles.
Definition: AgentMapView.cpp:179
AgentMapView::enableSystemView
void enableSystemView(bool enable)
Method which enables or disables the drop down menu for systems (for static agent profiles)...
Definition: AgentMapView.cpp:46
AgentMapView::setCurrentSystemConfig
void setCurrentSystemConfig(const QString &systemConfig)
Method which the currently displayed system config file to the one passed as an argument.
Definition: AgentMapView.cpp:218
AgentMapView::selectedSystem
void selectedSystem(QString const &system)
Signal, emitted after the current entry in the system selection box has been changed by the user...
AgentMapView::on_edit_clicked
void on_edit_clicked()
Slot which is triggered after the rename-button for the agent profile has been clicked. Opens a Dialog box asking the user to enter a new name for the currently selected agent profile.
Definition: AgentMapView.cpp:102
AgentMapView::on_remove_clicked
void on_remove_clicked()
Slot which emits the remove signal after the remove-button for agent profiles has been added...
Definition: AgentMapView.cpp:88
AgentMapView::typeChanged
void typeChanged(QString const &type)
Signal, emitted after the current entry of the combo box for the agent type (dynamic or static) has c...
AgentMapView::addDriverProfile
void addDriverProfile()
Signal, emitted after add-button for driver profiles has been clicked by the user (only in "dynamic" ...
AgentMapView::on_ModelCatalogueBrowse_clicked
void on_ModelCatalogueBrowse_clicked()
Slot which emits the setModelCatalogue signal after the browse-button for the vehicle model catalogue...
Definition: AgentMapView.cpp:238
AgentMapView::on_removeDriver_clicked
void on_removeDriver_clicked()
Slot which emits the removeDriverProfile signal after the remove-button for driver profiles has been ...
Definition: AgentMapView.cpp:169
AgentMapView::setModelCatalogueError
void setModelCatalogueError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for editing the veh...
Definition: AgentMapView.cpp:288
AgentMapView::on_systemConfigRefresh_clicked
void on_systemConfigRefresh_clicked()
Slot which is triggered when the refresh-button for a system config file is clicked. Emits the refreshSystemConfig signal.
Definition: AgentMapView.cpp:213
AgentMapView::on_ModelCatalogueRefresh_clicked
void on_ModelCatalogueRefresh_clicked()
Slot which is triggered when the refresh-button for a vehicle model catalogue is clicked. Emits the refreshModelCatalogue signal.
Definition: AgentMapView.cpp:243
AgentMapView::addVehicleProfile
void addVehicleProfile()
Signal, emitted after add-button for vehicle profiles has been clicked by the user (only in "dynamic"...
AgentMapView::on_Model_activated
void on_Model_activated(const QString &model)
Slot which emits the setModel signal after the current entry of the vehicle model selection box is ch...
Definition: AgentMapView.cpp:248
AgentMapView::removeVehicleProfile
void removeVehicleProfile(const int &row)
Signal, emitted after the remove-button for vehicle profiles has been clicked by the user (only in "d...
AgentMapView::setDriverProbabilityError
void setDriverProbabilityError(bool error)
Method puts a probability error message above the driver profiles&#39; table if given error flag is "true...
Definition: AgentMapView.cpp:293
AgentMapView::on_addVehicle_clicked
void on_addVehicle_clicked()
Slot which emits the addVehicleProfile signal after the add-button for vehicle profiles has been clic...
Definition: AgentMapView.cpp:154
AgentMapView::setCurrentType
void setCurrentType(QString const &type)
Method which sets the agent profile type (dynamic or static) shown in the corresponding drop down men...
Definition: AgentMapView.cpp:184
AgentMapView::setSystemConfigError
void setSystemConfigError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for the system conf...
Definition: AgentMapView.cpp:283
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
DriverProfileItemInterface.h File Reference
Agent Configuration Plugin

This class defines objects containing all relevant information on driver profiles. More...

Detailed Description

This class defines objects containing all relevant information on driver profiles.

In particular, the name, some config file and all parameters are part of driver profiles. The driver config refers to some XML metadata describing a driver model algorithm. Note that such an XML file has not been developed for driver models yet and, thus, driver configs are not yet in use.

Definition in file DriverProfileItemInterface.h.

Go to the source code of this file.

Classes

class DriverProfileItemInterface
This class defines objects containing all relevant information on driver profiles. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
DriverProfileItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
23
24 #ifndef DRIVERPROFILEITEMINTERFACE_H
25 #define DRIVERPROFILEITEMINTERFACE_H
26
27 #include "openPASS-AgentConfiguration/ParameterMapInterface.h"
28
29 #include <QObject>
30 #include <QString>
31 #include <QMap>
32
33 //-----------------------------------------------------------------------------
42 //-----------------------------------------------------------------------------
43 class DriverProfileItemInterface : public QObject
44 {
45 Q_OBJECT
46
47 public:
48 using Name = QString;
49 using DriverConfig = QString;
50 using Parameters = ParameterMapInterface;
51
52 public:
53 DriverProfileItemInterface(QObject * const parent = nullptr) : QObject(parent) {}
54 ~DriverProfileItemInterface() = default;
55
56 public:
57 //-----------------------------------------------------------------------------
63 //-----------------------------------------------------------------------------
64 virtual Name getName() const = 0;
65
66 public:
67 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 virtual DriverConfig getConfig() const = 0;
75
76 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 virtual void setConfig(DriverConfig const &_driverConfig ) = 0;
85
86 public:
87 //-----------------------------------------------------------------------------
92 //-----------------------------------------------------------------------------
93 virtual Parameters * getParameters() const = 0;
94
95 };
96
97 #endif // DRIVERPROFILEITEMINTERFACE_H
DriverProfileItemInterface::getConfig
virtual DriverConfig getConfig() const =0
Method which returns the driver configuration file containing XML metadata.
DriverProfileItemInterface
This class defines objects containing all relevant information on driver profiles.
Definition: DriverProfileItemInterface.h:43
DriverProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this driver profile. In fact, this is the key identifier under which...
ParameterMapInterface.h
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
DriverProfileItemInterface::Name
QString Name
typedef for the driver profile&#39;s name
Definition: DriverProfileItemInterface.h:48
DriverProfileItemInterface::setConfig
virtual void setConfig(DriverConfig const &_driverConfig)=0
Method which sets the driver configuration file containing XML metadata to the one passed as an argum...
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
DriverProfileItemInterface::Parameters
ParameterMapInterface Parameters
typedef for the parameters of the driver profile
Definition: DriverProfileItemInterface.h:50
DriverProfileItemInterface::DriverConfig
QString DriverConfig
typedef for the driver config file
Definition: DriverProfileItemInterface.h:49
DriverProfileItemInterface::getParameters
virtual Parameters * getParameters() const =0
Method which returns the parameter map (ParameterMapInterface) of this driver profile.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileItemModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
DriverProfileItemModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of DriverProfileItemInterface. More...

Detailed Description

This class implements the functionality of DriverProfileItemInterface.

Definition in file DriverProfileItemModel.h.

Go to the source code of this file.

Classes

class DriverProfileItemModel
This class implements the functionality of DriverProfileItemInterface. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileItemModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
DriverProfileItemModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef DRIVERPROFILEITEMMODEL_H
18 #define DRIVERPROFILEITEMMODEL_H
19
20 #include "openPASS-AgentConfiguration/DriverProfileItemInterface.h"
21
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 class DriverProfileItemModel : public DriverProfileItemInterface
26 {
27 Q_OBJECT
28
29 public:
30 DriverProfileItemModel(QObject * parent = nullptr);
31 DriverProfileItemModel(DriverProfileItemInterface const * const driverProfile, QObject * parent = nullptr);
32 virtual ~DriverProfileItemModel() override = default;
33
34 public:
35 virtual Name getName() const override;
36
37 public:
38 virtual DriverConfig getConfig() const override;
39 virtual void setConfig(const DriverConfig &_driverConfig ) override;
40
41 public:
42 virtual Parameters* getParameters() const override;
43
44
45 private:
46 Parameters * const parameters;
47 DriverConfig driverConfig;
48 };
49
50 #endif // DRIVERPROFILEITEMMODEL_H
DriverProfileItemInterface
This class defines objects containing all relevant information on driver profiles.
Definition: DriverProfileItemInterface.h:43
DriverProfileItemInterface::Name
QString Name
typedef for the driver profile&#39;s name
Definition: DriverProfileItemInterface.h:48
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
DriverProfileItemInterface::DriverConfig
QString DriverConfig
typedef for the driver config file
Definition: DriverProfileItemInterface.h:49
DriverProfileItemModel::setConfig
virtual void setConfig(const DriverConfig &_driverConfig) override
Method which sets the driver configuration file containing XML metadata to the one passed as an argum...
Definition: DriverProfileItemModel.cpp:60
DriverProfileItemModel::parameters
Parameters *const parameters
instance of ParameterMapInterface for storing parameters
Definition: DriverProfileItemModel.h:46
DriverProfileItemModel::driverConfig
DriverConfig driverConfig
string object for storing the driver configuration file (so far, not used!)
Definition: DriverProfileItemModel.h:47
DriverProfileItemModel::getParameters
virtual Parameters * getParameters() const override
Method which returns the parameter map (ParameterMapInterface) of this driver profile.
Definition: DriverProfileItemModel.cpp:49
DriverProfileItemModel
This class implements the functionality of DriverProfileItemInterface.
Definition: DriverProfileItemModel.h:25
DriverProfileItemModel::getConfig
virtual DriverConfig getConfig() const override
Method which returns the driver configuration file containing XML metadata.
Definition: DriverProfileItemModel.cpp:55
DriverProfileItemInterface.h
This class defines objects containing all relevant information on driver profiles.
DriverProfileItemModel::getName
virtual Name getName() const override
Method which returns the name of this driver profile. In fact, this is the key identifier under which...
Definition: DriverProfileItemModel.cpp:42
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileMapInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
DriverProfileMapInterface.h File Reference
Agent Configuration Plugin

This class constitutes a container class in which driver profiles (instances of DriverProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map. More...

Detailed Description

This class constitutes a container class in which driver profiles (instances of DriverProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map.

Definition in file DriverProfileMapInterface.h.

Go to the source code of this file.

Classes

class DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
DriverProfileMapInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
21
22 #ifndef DRIVERPROFILEMAPINTERFACE_H
23 #define DRIVERPROFILEMAPINTERFACE_H
24
25 #include "openPASS-AgentConfiguration/DriverProfileItemInterface.h"
26
27 #include <QObject>
28
29 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
37 class DriverProfileMapInterface : public QObject
38 {
39 Q_OBJECT
40
41 public:
42 using Name = DriverProfileItemInterface::Name;
43 using Item = DriverProfileItemInterface;
44
45 public:
46 using Map = QMap<Name, Item *>;
47 using Iterator = Map::Iterator;
48 using ConstIterator = Map::ConstIterator;
49
50 public:
51 DriverProfileMapInterface(QObject * const parent = nullptr) : QObject(parent){}
52 ~DriverProfileMapInterface() = default;
53
54 Q_SIGNALS:
55 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 void added(Name const & name);
62
63 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 void removed(Name const & name);
70
71 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 void modifiedName(Name const & oldName, Name const & newName);
79
80 public:
81 //-----------------------------------------------------------------------------
86 //-----------------------------------------------------------------------------
87 virtual DriverProfileMapInterface::Iterator begin() = 0;
88
89 //-----------------------------------------------------------------------------
95 //-----------------------------------------------------------------------------
96 virtual DriverProfileMapInterface::ConstIterator constBegin() const = 0;
97
98 public:
99 //-----------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
104 virtual DriverProfileMapInterface::Iterator end() = 0;
105
106 //-----------------------------------------------------------------------------
111 //-----------------------------------------------------------------------------
112 virtual DriverProfileMapInterface::ConstIterator constEnd() const = 0;
113
114 public:
115 //-----------------------------------------------------------------------------
122 //-----------------------------------------------------------------------------
123 virtual bool add(DriverProfileMapInterface::Name const & name) = 0;
124
125 //-----------------------------------------------------------------------------
133 //-----------------------------------------------------------------------------
134 virtual bool add(DriverProfileMapInterface::Name const & name,
135 DriverProfileMapInterface::Item const * const driver) = 0;
136
137 public:
138 //-----------------------------------------------------------------------------
147 //-----------------------------------------------------------------------------
148 virtual bool remove(DriverProfileMapInterface::Name const & name) = 0;
149
150 public:
151 //-----------------------------------------------------------------------------
160 //-----------------------------------------------------------------------------
161 virtual DriverProfileMapInterface::Item * getItem(DriverProfileMapInterface::Name const & name) const = 0;
162
163 public:
164 //-----------------------------------------------------------------------------
171 //-----------------------------------------------------------------------------
172 virtual void setName(DriverProfileMapInterface::Item * const item,
173 DriverProfileMapInterface::Name const & name) = 0;
174
175 //-----------------------------------------------------------------------------
180 //-----------------------------------------------------------------------------
181 virtual DriverProfileMapInterface::Name getName(DriverProfileMapInterface::Item * const item) const = 0;
182
183 public:
184 //-----------------------------------------------------------------------------
190 //-----------------------------------------------------------------------------
191 virtual bool contains (DriverProfileMapInterface::Name const & name) const =0;
192
193 //-----------------------------------------------------------------------------
197 //-----------------------------------------------------------------------------
198 virtual int count() const =0;
199
200 public:
201 //-----------------------------------------------------------------------------
205 //-----------------------------------------------------------------------------
206 virtual QStringList keys() const =0;
207
208 //-----------------------------------------------------------------------------
212 //-----------------------------------------------------------------------------
213 virtual QList<Item*> values() const =0;
214 };
215
216 #endif // DRIVERPROFILEMAPINTERFACE_H
DriverProfileMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all driver profile names in the map.
DriverProfileMapInterface::modifiedName
void modifiedName(Name const &oldName, Name const &newName)
Signal emitted when the name of the driver profile has been changed. Transmits both, the new and old names of the profile.
DriverProfileItemInterface
This class defines objects containing all relevant information on driver profiles.
Definition: DriverProfileItemInterface.h:43
DriverProfileMapInterface::contains
virtual bool contains(DriverProfileMapInterface::Name const &name) const =0
Method wich checks whether the map contains a driver profile with the given name. ...
DriverProfileMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all driver profiles in the map.
DriverProfileMapInterface::getItem
virtual DriverProfileMapInterface::Item * getItem(DriverProfileMapInterface::Name const &name) const =0
Method which returns a pointer to the driver profile with the given name. If the map does not contain...
DriverProfileMapInterface::setName
virtual void setName(DriverProfileMapInterface::Item *const item, DriverProfileMapInterface::Name const &name)=0
Method wich changes the name of the given driver profile to the one passed as second argument...
DriverProfileItemInterface::Name
QString Name
typedef for the driver profile&#39;s name
Definition: DriverProfileItemInterface.h:48
DriverProfileMapInterface::Map
QMap< Name, Item * > Map
typedef for the map, i.e. the container object of driver profiles
Definition: DriverProfileMapInterface.h:46
DriverProfileMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: DriverProfileMapInterface.h:47
DriverProfileMapInterface::removed
void removed(Name const &name)
Signal emitted when a driver profile has been removed from the map. Transmits the name of the correpo...
DriverProfileMapInterface::added
void added(Name const &name)
Signal emitted when a driver profile has been added to the map. Transmits the name of the correpondin...
DriverProfileMapInterface::getName
virtual DriverProfileMapInterface::Name getName(DriverProfileMapInterface::Item *const item) const =0
Method wich returns the name of the given driver profile.
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
DriverProfileMapInterface::Name
DriverProfileItemInterface::Name Name
typedef for driver profile names (= key identifiers of the map)
Definition: DriverProfileMapInterface.h:42
DriverProfileMapInterface::count
virtual int count() const =0
Method which returns the number of driver profiles in the map.
DriverProfileMapInterface::constEnd
virtual DriverProfileMapInterface::ConstIterator constEnd() const =0
Gets an iterator pointing at the end of the map after the last driver profile (use for read-only)...
DriverProfileMapInterface::constBegin
virtual DriverProfileMapInterface::ConstIterator constBegin() const =0
Gets an iterator pointing to the first driver profile in the map (use for read-only since pointing at...
DriverProfileItemInterface.h
This class defines objects containing all relevant information on driver profiles.
DriverProfileMapInterface::begin
virtual DriverProfileMapInterface::Iterator begin()=0
Gets an iterator pointing to the first driver profile in the map.
DriverProfileMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: DriverProfileMapInterface.h:48
DriverProfileMapInterface::add
virtual bool add(DriverProfileMapInterface::Name const &name)=0
Method which creates a new driver profile (instance of DriverProfileItemInterface) and adds it to the...
DriverProfileMapInterface::end
virtual DriverProfileMapInterface::Iterator end()=0
Gets an iterator pointing to the end of the map after the last driver profile.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileMapModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
DriverProfileMapModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of DriverProfileMapInterface. More...

Detailed Description

This class implements the functionality of DriverProfileMapInterface.

Definition in file DriverProfileMapModel.h.

Go to the source code of this file.

Classes

class DriverProfileMapModel
This class implements the functionality of DriverProfileMapInterface. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileMapModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
DriverProfileMapModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef DRIVERPROFILEMAPMODEL_H
18 #define DRIVERPROFILEMAPMODEL_H
19
20 #include "openPASS-AgentConfiguration/DriverProfileMapInterface.h"
21
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 class DriverProfileMapModel : public DriverProfileMapInterface
26 {
27
28 Q_OBJECT
29
30 public:
31 DriverProfileMapModel(QObject * const parent = nullptr);
32 virtual ~DriverProfileMapModel() override = default;
33
34 public:
35 virtual DriverProfileMapInterface::Iterator begin() override;
36 virtual DriverProfileMapInterface::ConstIterator constBegin() const override;
37
38 public:
39 virtual DriverProfileMapInterface::Iterator end()override;
40 virtual DriverProfileMapInterface::ConstIterator constEnd() const override;
41
42 public:
43 virtual bool add(DriverProfileMapInterface::Name const & name)override;
44 virtual bool add(DriverProfileMapInterface::Name const & name,
45 DriverProfileMapInterface::Item const * const driver) override;
46
47 public:
48 virtual bool remove(DriverProfileMapInterface::Name const & name) override;
49
50 public:
51 virtual DriverProfileMapInterface::Item * getItem(DriverProfileMapInterface::Name const & name) const override;
52
53 public:
54 virtual void setName(DriverProfileMapInterface::Item * const item,
55 DriverProfileMapInterface::Name const & name) override;
56
57 virtual DriverProfileMapInterface::Name getName(DriverProfileMapInterface::Item * const item) const override;
58
59 public:
60 virtual bool contains (DriverProfileMapInterface::Name const & name) const override;
61 virtual int count() const override;
62
63
64 public:
65 virtual QStringList keys() const override;
66 virtual QList<Item*> values() const override;
67
68 private:
69 Map driverProfiles;
70 };
71
72 #endif // DRIVERPROFILEMAPMODEL_H
DriverProfileItemInterface
This class defines objects containing all relevant information on driver profiles.
Definition: DriverProfileItemInterface.h:43
DriverProfileMapModel::getItem
virtual DriverProfileMapInterface::Item * getItem(DriverProfileMapInterface::Name const &name) const override
Method which returns a pointer to the driver profile with the given name. If the map does not contain...
Definition: DriverProfileMapModel.cpp:81
DriverProfileMapModel::constEnd
virtual DriverProfileMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last driver profile (use for read-only)...
Definition: DriverProfileMapModel.cpp:36
DriverProfileMapInterface::Map
QMap< Name, Item * > Map
typedef for the map, i.e. the container object of driver profiles
Definition: DriverProfileMapInterface.h:46
DriverProfileMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: DriverProfileMapInterface.h:47
DriverProfileMapModel::setName
virtual void setName(DriverProfileMapInterface::Item *const item, DriverProfileMapInterface::Name const &name) override
Method wich changes the name of the given driver profile to the one passed as second argument...
Definition: DriverProfileMapModel.cpp:95
DriverProfileMapModel::add
virtual bool add(DriverProfileMapInterface::Name const &name) override
Method which creates a new driver profile (instance of DriverProfileItemInterface) and adds it to the...
Definition: DriverProfileMapModel.cpp:42
DriverProfileMapInterface.h
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
DriverProfileMapModel
This class implements the functionality of DriverProfileMapInterface.
Definition: DriverProfileMapModel.h:25
DriverProfileMapModel::count
virtual int count() const override
Method which returns the number of driver profiles in the map.
Definition: DriverProfileMapModel.cpp:123
DriverProfileMapModel::contains
virtual bool contains(DriverProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a driver profile with the given name. ...
Definition: DriverProfileMapModel.cpp:108
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
DriverProfileMapInterface::Name
DriverProfileItemInterface::Name Name
typedef for driver profile names (= key identifiers of the map)
Definition: DriverProfileMapInterface.h:42
DriverProfileMapModel::begin
virtual DriverProfileMapInterface::Iterator begin() override
Gets an iterator pointing to the first driver profile in the map.
Definition: DriverProfileMapModel.cpp:21
DriverProfileMapModel::end
virtual DriverProfileMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last driver profile.
Definition: DriverProfileMapModel.cpp:31
DriverProfileMapModel::constBegin
virtual DriverProfileMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first driver profile in the map (use for read-only since pointing at...
Definition: DriverProfileMapModel.cpp:26
DriverProfileMapModel::values
virtual QList< Item * > values() const override
Method which returns a list of pointers to all driver profiles in the map.
Definition: DriverProfileMapModel.cpp:118
DriverProfileMapModel::getName
virtual DriverProfileMapInterface::Name getName(DriverProfileMapInterface::Item *const item) const override
Method wich returns the name of the given driver profile.
Definition: DriverProfileMapModel.cpp:90
DriverProfileMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: DriverProfileMapInterface.h:48
DriverProfileMapModel::keys
virtual QStringList keys() const override
Method which returns the (string) list of all driver profile names in the map.
Definition: DriverProfileMapModel.cpp:113
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfilesMapPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
Classes
DriverProfilesMapPresenter.h File Reference
Agent Configuration Plugin

This class constitutes the re-implementation of QAbstractTableModel for the table view of driver profiles. In fact, this class implements a wrapper for the map of driver profiles (DriverProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework. More...

Detailed Description

This class constitutes the re-implementation of QAbstractTableModel for the table view of driver profiles. In fact, this class implements a wrapper for the map of driver profiles (DriverProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework.

Definition in file DriverProfilesMapPresenter.h.

Go to the source code of this file.

Classes

class DriverProfilesMapPresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of driver profiles. In fact, this class implements a wrapper for the map of driver profiles (DriverProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfilesMapPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
DriverProfilesMapPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19
20 #ifndef DRIVERPROFILESMAPPRESENTER_H
21 #define DRIVERPROFILESMAPPRESENTER_H
22
23 #include "openPASS-AgentConfiguration/AgentItemInterface.h"
24
25 #include <QAbstractTableModel>
26
27 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
33 class DriverProfilesMapPresenter : public QAbstractTableModel
34 {
35 Q_OBJECT
36
37 public:
38 explicit DriverProfilesMapPresenter(AgentItemInterface::DriverProfiles * driverProfiles = nullptr,
39 QObject *parent = nullptr);
40
41 Q_SIGNALS:
42 //-----------------------------------------------------------------------------
46 //-----------------------------------------------------------------------------
47 void checkProbabilities();
48
49 public:
50 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
63
64 public:
65 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
75
76 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
85 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
86
87 public:
88 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
98
99 //-----------------------------------------------------------------------------
108 //-----------------------------------------------------------------------------
109 bool setData(const QModelIndex &index, const QVariant &value,
110 int role = Qt::EditRole) override;
111
112 //-----------------------------------------------------------------------------
119 //-----------------------------------------------------------------------------
120 Qt::ItemFlags flags(const QModelIndex& index) const override;
121
122 public:
123 //-----------------------------------------------------------------------------
128 //-----------------------------------------------------------------------------
129 virtual void addRow(const int &row,
130 AgentItemInterface::DriverProfile const & profile,
131 AgentItemInterface::Probability const & probability);
132
133 //-----------------------------------------------------------------------------
141 //-----------------------------------------------------------------------------
142 virtual bool removeRow(const int &row);
143
144 //-----------------------------------------------------------------------------
149 //-----------------------------------------------------------------------------
150 void setDriverProfiles(AgentItemInterface::DriverProfiles * const _driverProfiles);
151
152 //-----------------------------------------------------------------------------
155 //-----------------------------------------------------------------------------
156 void update();
157
158 public Q_SLOTS:
159 //-----------------------------------------------------------------------------
164 //-----------------------------------------------------------------------------
165 void editName( AgentItemInterface::DriverProfile const & oldName,
166 AgentItemInterface::DriverProfile const & newName );
167
168 //-----------------------------------------------------------------------------
172 //-----------------------------------------------------------------------------
173 void remove(AgentItemInterface::DriverProfile const & profile);
174
175 private:
176 AgentItemInterface::DriverProfiles * driverProfiles;
177
178 private:
179 QStringList _columnHeaders;
180 QMap<int, AgentItemInterface::DriverProfile> RowToProfile;
181 };
182
183 #endif // DRIVERPROFILESMAPPRESENTER_H
AgentItemInterface::DriverProfile
QString DriverProfile
the nome of a driver profile
Definition: AgentItemInterface.h:60
DriverProfilesMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: DriverProfilesMapPresenter.cpp:32
DriverProfilesMapPresenter::checkProbabilities
void checkProbabilities()
Signal emitted whenever the probability sum of the driver profile table should be checked...
DriverProfilesMapPresenter::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: DriverProfilesMapPresenter.cpp:71
DriverProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::DriverProfile > RowToProfile
a mapping of row indices to profile names
Definition: DriverProfilesMapPresenter.h:180
DriverProfilesMapPresenter::_columnHeaders
QStringList _columnHeaders
the list containing the header data for columns
Definition: DriverProfilesMapPresenter.h:179
DriverProfilesMapPresenter::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! ...
Definition: DriverProfilesMapPresenter.cpp:98
DriverProfilesMapPresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of driver prof...
Definition: DriverProfilesMapPresenter.h:33
DriverProfilesMapPresenter::setDriverProfiles
void setDriverProfiles(AgentItemInterface::DriverProfiles *const _driverProfiles)
Method which sets the currently processed driver profiles map to the given argument.
Definition: DriverProfilesMapPresenter.cpp:144
AgentItemInterface.h
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
DriverProfilesMapPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: DriverProfilesMapPresenter.cpp:42
DriverProfilesMapPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: DriverProfilesMapPresenter.cpp:49
DriverProfilesMapPresenter::removeRow
virtual bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: DriverProfilesMapPresenter.cpp:124
DriverProfilesMapPresenter::update
void update()
Method which updates the table according to the current entries of driverProfiles.
Definition: DriverProfilesMapPresenter.cpp:151
DriverProfilesMapPresenter::editName
void editName(AgentItemInterface::DriverProfile const &oldName, AgentItemInterface::DriverProfile const &newName)
Slot which changes the name of the driver profile.
Definition: DriverProfilesMapPresenter.cpp:170
AgentItemInterface::DriverProfiles
QMap< DriverProfile, Probability > DriverProfiles
the mapping of a driver profile to the instantiation probability
Definition: AgentItemInterface.h:61
DriverProfilesMapPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: DriverProfilesMapPresenter.cpp:21
DriverProfilesMapPresenter::addRow
virtual void addRow(const int &row, AgentItemInterface::DriverProfile const &profile, AgentItemInterface::Probability const &probability)
Method that adds a new row, i.e. a driver profile with the given probability.
Definition: DriverProfilesMapPresenter.cpp:104
AgentItemInterface::Probability
double Probability
a probability value (e.g. of a driver or a vehicle profile)
Definition: AgentItemInterface.h:45
DriverProfilesMapPresenter::driverProfiles
AgentItemInterface::DriverProfiles * driverProfiles
the pointer to the map of driver profiles assigned to an agent profile
Definition: DriverProfilesMapPresenter.h:176
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfilesPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
Classes
DriverProfilesPresenter.h File Reference
Agent Configuration Plugin

This file contains the class DriverProfilesPresenter defining the presenter object for driver profiles as well as the classes for all undo-command objects used by DriverProfilesPresenter. More...

Detailed Description

This file contains the class DriverProfilesPresenter defining the presenter object for driver profiles as well as the classes for all undo-command objects used by DriverProfilesPresenter.

The DriverProfilesPresenter class handles user events from the view (DriverProfilesView) and edits the model data (DriverProfileMapInterface) accordingly. Since all actions performed on the model data (i.e. the *.ui file) should be undoable, the presenter instantiates the corresponding undo-commands and pushes them onto the undo stack. The actual operation on the model is then performed in these command object using the re-implementations of the undo/redo methods. See Qt's undo framework for further details.

Definition in file DriverProfilesPresenter.h.

Go to the source code of this file.

Classes

class | DriverProfileCommands::AddDriverProfile
This class defines the command for undoable add-operations on the map of driver profiles (DriverProfileMapInterface). More...
class | DriverProfileCommands::EditDriverProfile
This class defines the command for undoable renaming-operations on the map of driver profiles (DriverProfileMapInterface). More...
class | DriverProfileCommands::RemoveDriverProfile
This class defines the command for undoable remove-operations on the map of driver profiles (DriverProfileMapInterface). More...
class | DriverProfileCommands::SetCurrentDriver
This class defines the command for undoable set-operations on the currently selected driver profile. More...
class | DriverProfilesPresenter
This class defines the presenter object for driver profiles which handles user events from the view (DriverProfilesView) and edits the model data (DriverProfileMapInterface) accordingly. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfilesPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
DriverProfilesPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
27
28 #ifndef DRIVERPROFILESPRESENTER_H
29 #define DRIVERPROFILESPRESENTER_H
30
31 #include "openPASS-AgentConfiguration/DriverProfileMapInterface.h"
32 #include "Presenters/ParameterMapPresenter.h"
33 #include "Views/DriverProfilesView.h"
34
35 #include <QObject>
36 #include <QUndoStack>
37
38 //-----------------------------------------------------------------------------
49 //-----------------------------------------------------------------------------
50 class DriverProfilesPresenter : public QObject
51 {
52
53 public:
54 DriverProfilesPresenter(DriverProfileMapInterface * drivers,
55 DriverProfilesView * driversView,
56 QUndoStack * const undoStack,
57 QObject * parent = nullptr);
58 virtual ~DriverProfilesPresenter() override = default;
59
60 private Q_SLOTS:
61 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 void setCurrentDriver(const QString &name);
70
71 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 void addDriver(const QString &name);
79
80 //-----------------------------------------------------------------------------
87 //-----------------------------------------------------------------------------
88 void removeDriver(const QString &name);
89
90 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 void editDriver(const QString &oldName, const QString &newName);
98
99 //-----------------------------------------------------------------------------
106 //-----------------------------------------------------------------------------
107 void setDriverConfig(const QString &filepath);
108
109 private:
110 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------
115 void setParameterDelegates();
116
117 public:
118 //-----------------------------------------------------------------------------
121 //-----------------------------------------------------------------------------
122 void updateView();
123
124 //-----------------------------------------------------------------------------
127 //-----------------------------------------------------------------------------
128 void updateDriverSelectionItems();
129
130 private:
131 DriverProfileMapInterface * const drivers;
132 DriverProfileItemInterface * currentDriver;
133 DriverProfilesView * const driversView;
134 QUndoStack * const undoStack;
135 ParameterMapPresenter * parameters;
136 QList<QString> bool_list = {"true","false"};
137
138 private:
139 friend class AgentConfigurationPresenter;
140 };
141
142
143 namespace DriverProfileCommands {
144
145
146 //-----------------------------------------------------------------------------
149 //-----------------------------------------------------------------------------
150 class SetCurrentDriver : public QUndoCommand
151 {
152
153 public:
154 SetCurrentDriver(DriverProfileMapInterface const * const drivers,
155 DriverProfileItemInterface ** const currentDriver,
156 DriverProfileItemInterface::Name const newDriver,
157 ParameterMapPresenter * const parameters,
158 DriverProfilesPresenter * const driversPresenter,
159 QUndoCommand *parent = nullptr);
160
161 public:
162 void redo() override;
163 void undo() override;
164
165 private:
166 DriverProfileMapInterface const * const drivers;
167 DriverProfileItemInterface ** const currentDriver;
168 DriverProfileItemInterface::Name const newDriver;
169 DriverProfileItemInterface::Name const oldDriver;
170 ParameterMapPresenter * const parameters;
171 DriverProfilesPresenter * const driversPresenter;
172 };
173
174 //-----------------------------------------------------------------------------
177 //-----------------------------------------------------------------------------
178 class EditDriverProfile : public QUndoCommand
179 {
180
181 public:
182 EditDriverProfile(DriverProfileMapInterface * const drivers,
183 DriverProfilesView * const driversView,
184 DriverProfileMapInterface::Name const &newName,
185 DriverProfileMapInterface::Name const &oldName,
186 QUndoCommand *parent = nullptr);
187 public:
188 void redo() override;
189 void undo() override;
190
191 private:
192 DriverProfileMapInterface * const drivers;
193 DriverProfilesView * const driversView;
194 DriverProfileMapInterface::Name const newName;
195 DriverProfileMapInterface::Name const oldName;
196 };
197
198 //-----------------------------------------------------------------------------
201 //-----------------------------------------------------------------------------
202 class AddDriverProfile : public QUndoCommand
203 {
204 public:
205 AddDriverProfile(DriverProfileMapInterface * const drivers,
206 DriverProfilesView * const driversView,
207 DriverProfileMapInterface::Name const &name,
208 QUndoCommand *parent = nullptr);
209
210 AddDriverProfile(DriverProfileMapInterface * const drivers,
211 DriverProfilesView * const driversView,
212 DriverProfileMapInterface::Name const &name,
213 DriverProfileItemInterface::Parameters const * const parameterMap,
214 QUndoCommand *parent = nullptr);
215
216 virtual ~AddDriverProfile() override;
217
218 public:
219 void redo() override;
220 void undo() override;
221
222 private:
223 void addParameter(DriverProfileItemInterface::Parameters * const parameterMap,
224 ParameterItemInterface::Key const & key,
225 ParameterItemInterface::Type const & type,
226 ParameterItemInterface::Unit const & unit,
227 ParameterItemInterface::Value const & value);
228 void setParameters();
229
230 private:
231 DriverProfileMapInterface * const drivers;
232 DriverProfilesView * const driversView;
233 DriverProfileMapInterface::Name const name;
234 DriverProfileItemInterface::Parameters * const parameters;
235 };
236
237 //-----------------------------------------------------------------------------
240 //-----------------------------------------------------------------------------
241 class RemoveDriverProfile: public QUndoCommand
242 {
243 public:
244 RemoveDriverProfile(DriverProfileMapInterface * const drivers,
245 DriverProfilesView * const driversView,
246 DriverProfileMapInterface::Name const &name,
247 QUndoCommand *parent = nullptr);
248
249 virtual ~RemoveDriverProfile() override;
250
251 public:
252 void redo() override;
253 void undo() override;
254
255 private:
256 DriverProfileMapInterface * const drivers;
257 DriverProfilesView * const driversView;
258 DriverProfileMapInterface::Name const name;
259 DriverProfileItemInterface const * const driver;
260
261 };
262
263 }
264 #endif // DRIVERPROFILESPRESENTER_H
DriverProfilesPresenter::setCurrentDriver
void setCurrentDriver(const QString &name)
Slot triggered by the DriverProfilesView::selectionChanged signal. Performs an undoable set-operation...
Definition: DriverProfilesPresenter.cpp:46
DriverProfilesPresenter::editDriver
void editDriver(const QString &oldName, const QString &newName)
Slot triggered by the DriverProfilesView::editedName signal. Performs an undoable rename-operation on...
Definition: DriverProfilesPresenter.cpp:76
DriverProfileItemInterface
This class defines objects containing all relevant information on driver profiles.
Definition: DriverProfileItemInterface.h:43
ParameterItemInterface::Key
QString Key
typedef for the key description
Definition: ParameterItemInterface.h:47
AgentConfigurationPresenter
This class defines the presenter object which handles events from the view (AgentConfigurationView) a...
Definition: AgentConfigurationPresenter.h:41
ParameterItemInterface::Value
QString Value
typedef for the parameter&#39;s value
Definition: ParameterItemInterface.h:48
DriverProfilesPresenter
This class defines the presenter object for driver profiles which handles user events from the view (...
Definition: DriverProfilesPresenter.h:50
DriverProfileItemInterface::Name
QString Name
typedef for the driver profile&#39;s name
Definition: DriverProfileItemInterface.h:48
ParameterItemInterface::Unit
QString Unit
typedef for the parameter&#39;s unit
Definition: ParameterItemInterface.h:49
DriverProfileCommands
Definition: DriverProfilesPresenter.h:143
DriverProfilesPresenter::removeDriver
void removeDriver(const QString &name)
Slot triggered by the DriverProfilesView::removeDriverProfile signal. Performs an undoable remove-ope...
Definition: DriverProfilesPresenter.cpp:61
DriverProfilesPresenter::bool_list
QList< QString > bool_list
a combo box selection list for a parameter delegate representing a boolian variable ...
Definition: DriverProfilesPresenter.h:136
ParameterMapPresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters...
Definition: ParameterMapPresenter.h:33
DriverProfilesPresenter::currentDriver
DriverProfileItemInterface * currentDriver
a pointer to the currently edited driver profile
Definition: DriverProfilesPresenter.h:132
DriverProfileMapInterface.h
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
DriverProfilesPresenter::setParameterDelegates
void setParameterDelegates()
Method which sets the delegates of the parameter table&#39;s cells according to the current model data...
Definition: DriverProfilesPresenter.cpp:122
DriverProfilesPresenter::addDriver
void addDriver(const QString &name)
Slot triggered by the DriverProfilesView::addDriverProfile signal. Performs an undoable add-operation...
Definition: DriverProfilesPresenter.cpp:52
DriverProfilesPresenter::updateView
void updateView()
Method which updates the complete view (DriverProfilesView) according to the model data of the curren...
Definition: DriverProfilesPresenter.cpp:97
DriverProfileCommands::EditDriverProfile
This class defines the command for undoable renaming-operations on the map of driver profiles (Driver...
Definition: DriverProfilesPresenter.h:178
DriverProfileCommands::SetCurrentDriver
This class defines the command for undoable set-operations on the currently selected driver profile...
Definition: DriverProfilesPresenter.h:150
ParameterMapPresenter.h
This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters...
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
DriverProfileMapInterface::Name
DriverProfileItemInterface::Name Name
typedef for driver profile names (= key identifiers of the map)
Definition: DriverProfileMapInterface.h:42
ParameterItemInterface::Type
QString Type
typedef for the data type
Definition: ParameterItemInterface.h:46
DriverProfilesPresenter::driversView
DriverProfilesView *const driversView
a pointer to the view for driver profiles
Definition: DriverProfilesPresenter.h:133
DriverProfilesView.h
This class defines the view for editing driver profiles. The view constitutes a combo box for switchi...
DriverProfilesPresenter::setDriverConfig
void setDriverConfig(const QString &filepath)
Slot for setting the driver configuration file.
Definition: DriverProfilesPresenter.cpp:85
DriverProfileCommands::AddDriverProfile
This class defines the command for undoable add-operations on the map of driver profiles (DriverProfi...
Definition: DriverProfilesPresenter.h:202
DriverProfilesPresenter::updateDriverSelectionItems
void updateDriverSelectionItems()
Method which updates the combo box list of available driver profiles to the ones currently defined in...
Definition: DriverProfilesPresenter.cpp:117
DriverProfileCommands::RemoveDriverProfile
This class defines the command for undoable remove-operations on the map of driver profiles (DriverPr...
Definition: DriverProfilesPresenter.h:241
DriverProfilesPresenter::parameters
ParameterMapPresenter * parameters
a pointer to the presenter object for the parameters of a driver profile
Definition: DriverProfilesPresenter.h:135
DriverProfilesPresenter::drivers
DriverProfileMapInterface *const drivers
the map of driver profiles
Definition: DriverProfilesPresenter.h:131
DriverProfilesView
This class defines the view for editing driver profiles. The view constitutes a combo box for switchi...
Definition: DriverProfilesView.h:41
DriverProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: DriverProfilesPresenter.h:134
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfilesView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
Classes
DriverProfilesView.h File Reference
Agent Configuration Plugin

This class defines the view for editing driver profiles. The view constitutes a combo box for switching between different driver profiles, add-, remove- and rename buttons and a table view for editing the parameters of the driver profile. Further information on how to use this view can be found in the GUI tutorial. More...

Detailed Description

This class defines the view for editing driver profiles. The view constitutes a combo box for switching between different driver profiles, add-, remove- and rename buttons and a table view for editing the parameters of the driver profile. Further information on how to use this view can be found in the GUI tutorial.

Definition in file DriverProfilesView.h.

Go to the source code of this file.

Classes

class DriverProfilesView
This class defines the view for editing driver profiles. The view constitutes a combo box for switching between different driver profiles, add-, remove- and rename buttons and a table view for editing the parameters of the driver profile. Further information on how to use this view can be found in the GUI tutorial. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfilesView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
DriverProfilesView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
21
22 #ifndef DRIVERPROFILESVIEW_H
23 #define DRIVERPROFILESVIEW_H
24
25 #include "WidgetView.h"
26
27 #include <QTableView>
28
29 namespace Ui {
30 class DriverProfilesView;
31 }
32
33 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
41 class DriverProfilesView : public WidgetView
42 {
43 Q_OBJECT
44
45 public:
46 explicit DriverProfilesView(QWidget *parent = nullptr);
47 ~DriverProfilesView();
48
49 Q_SIGNALS:
50 //-----------------------------------------------------------------------------
56 //-----------------------------------------------------------------------------
57 void addDriverProfile(QString const &name);
58
59 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
66 void removeDriverProfile(QString const &name);
67
68 //-----------------------------------------------------------------------------
75 //-----------------------------------------------------------------------------
76 void editedName(QString const & oldName, QString const &newName);
77
78 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
85 void selectionChanged(QString const &name);
86
87 //-----------------------------------------------------------------------------
92 //-----------------------------------------------------------------------------
93 void selectedDriverConfig(QString const &filepath);
94
95 private Q_SLOTS:
96 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
102 void on_Name_activated(const QString &name);
103
104 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
110 void on_add_clicked();
111
112 //-----------------------------------------------------------------------------
116 //-----------------------------------------------------------------------------
117 void on_remove_clicked();
118
119 //-----------------------------------------------------------------------------
124 //-----------------------------------------------------------------------------
125 void on_edit_clicked();
126
127 private Q_SLOTS:
128 //-----------------------------------------------------------------------------
134 //-----------------------------------------------------------------------------
135 void on_Browse_clicked();
136
137 public:
138 //-----------------------------------------------------------------------------
140 //-----------------------------------------------------------------------------
141 QTableView * getParameterView() const;
142
143 public:
144 //-----------------------------------------------------------------------------
150 //-----------------------------------------------------------------------------
151 void setCurrentDriver(QString const &name);
152
153 //-----------------------------------------------------------------------------
159 //-----------------------------------------------------------------------------
160 void addDriverView(QString const &name);
161
162 //-----------------------------------------------------------------------------
168 //-----------------------------------------------------------------------------
169 void removeDriverView(QString const &name);
170
171 //-----------------------------------------------------------------------------
177 //-----------------------------------------------------------------------------
178 void setDriverSelectionItems(QStringList const &names);
179
180 public:
181 //-----------------------------------------------------------------------------
186 //-----------------------------------------------------------------------------
187 void setConfigView(QString const &filepath);
188
189 public:
190 //-----------------------------------------------------------------------------
199 //-----------------------------------------------------------------------------
200 void enableConfiguration(bool enable);
201
202 private:
203 //-----------------------------------------------------------------------------
213 //-----------------------------------------------------------------------------
214 bool eventFilter(QObject *watched, QEvent *event);
215
216
217 private:
218 Ui::DriverProfilesView *ui;
219 };
220
221 #endif // DRIVERPROFILESVIEW_H
DriverProfilesView::ui
Ui::DriverProfilesView * ui
the ui object containing all GUI elements of this view
Definition: DriverProfilesView.h:218
DriverProfilesView::getParameterView
QTableView * getParameterView() const
Method which provides access to the table view for parameters.
Definition: DriverProfilesView.cpp:36
DriverProfilesView::removeDriverView
void removeDriverView(QString const &name)
Method which removes the given driver profile name from the driver selection list (drop down menu for...
Definition: DriverProfilesView.cpp:128
DriverProfilesView::on_Browse_clicked
void on_Browse_clicked()
Slot triggered by clicking the browse-button for the driver configuration file. Opens a file dialog a...
Definition: DriverProfilesView.cpp:92
DriverProfilesView::setDriverSelectionItems
void setDriverSelectionItems(QStringList const &names)
Method which clears the selection list for driver profiles (drop down menu) and inserts the given lis...
Definition: DriverProfilesView.cpp:112
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
DriverProfilesView::removeDriverProfile
void removeDriverProfile(QString const &name)
Signal, emitted after the remove-button for driver profiles has been clicked. Transmits the name of t...
DriverProfilesView::editedName
void editedName(QString const &oldName, QString const &newName)
Signal, emitted after the rename-button has been pressed and a new name for the current profile has b...
DriverProfilesView::selectedDriverConfig
void selectedDriverConfig(QString const &filepath)
Signal for transmitting the filepath of the driver conifg (so far, not in use).
DriverProfilesView::selectionChanged
void selectionChanged(QString const &name)
Signal, emitted after the current entry of the combo box for available driver profiles has been chang...
DriverProfilesView::on_edit_clicked
void on_edit_clicked()
Slot triggered when the user clicks the rename-button for driver profiles. Opens a dialog asking the ...
Definition: DriverProfilesView.cpp:77
DriverProfilesView::addDriverProfile
void addDriverProfile(QString const &name)
Signal, emitted after the add-button for driver profiles has been clicked and a name for a new profil...
DriverProfilesView::enableConfiguration
void enableConfiguration(bool enable)
Method which enables or disables the GUI elements of this view, apart from the add-button for adding ...
Definition: DriverProfilesView.cpp:135
DriverProfilesView::on_remove_clicked
void on_remove_clicked()
Slot triggered when the user clicks the remove-button for driver profiles. Emits the removeDriverProf...
Definition: DriverProfilesView.cpp:60
DriverProfilesView::on_Name_activated
void on_Name_activated(const QString &name)
Slot which emits the selectionChanged signal after the user has made a selection in the drop down men...
Definition: DriverProfilesView.cpp:41
DriverProfilesView::setCurrentDriver
void setCurrentDriver(QString const &name)
Method which sets the driver profile name to be currently shown in the drop down menu for driver prof...
Definition: DriverProfilesView.cpp:106
DriverProfilesView::addDriverView
void addDriverView(QString const &name)
Method which adds the given driver profile name to the driver selection list (drop down menu for driv...
Definition: DriverProfilesView.cpp:123
DriverProfilesView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter for catching the resize-events of the parameter table&#39;s view...
Definition: DriverProfilesView.cpp:145
DriverProfilesView::setConfigView
void setConfigView(QString const &filepath)
Method which sets the filepath shown displayed in the driver config view to the one passed as an argu...
Definition: DriverProfilesView.cpp:118
DriverProfilesView
This class defines the view for editing driver profiles. The view constitutes a combo box for switchi...
Definition: DriverProfilesView.h:41
DriverProfilesView::on_add_clicked
void on_add_clicked()
Slot triggered when the user clicks the add-button for driver profiles. Opens a dialog asking the use...
Definition: DriverProfilesView.cpp:47
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
ParameterItemInterface.h File Reference
Agent Configuration Plugin

This class defines parameters. More...

Detailed Description

This class defines parameters.

Parameters consist of a key description, a datatype, a value and a unit. If parameters are registered in a map container class (here ParameterMapInterface), they also have a key identifier which can be accessed here. For simplicity, especially when bringing the parameters to an XML representation, all attributes are modeled as strings.

Definition in file ParameterItemInterface.h.

Go to the source code of this file.

Classes

class ParameterItemInterface
This class defines parameters. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
ParameterItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
23 #ifndef PARAMETERITEMINTERFACE_H
24 #define PARAMETERITEMINTERFACE_H
25
26 #include <QObject>
27 #include <QString>
28
29 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
39 class ParameterItemInterface: public QObject
40 {
41
42 Q_OBJECT
43
44 public:
45 using ID = unsigned int;
46 using Type = QString;
47 using Key = QString;
48 using Value = QString;
49 using Unit = QString;
50
51 public:
52 ParameterItemInterface(QObject * const parent = nullptr) : QObject(parent){}
53 virtual ~ParameterItemInterface() = default;
54
55 public:
56 //-----------------------------------------------------------------------------
62 //-----------------------------------------------------------------------------
63 virtual ID getID() const = 0;
64
65 public:
66 //-----------------------------------------------------------------------------
70 //-----------------------------------------------------------------------------
71 virtual Type getType() const = 0;
72
73 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 virtual void setType(Type const &type) = 0;
79
80 public:
81 //-----------------------------------------------------------------------------
85 //-----------------------------------------------------------------------------
86 virtual Key getKey() const = 0;
87
88 //-----------------------------------------------------------------------------
92 //-----------------------------------------------------------------------------
93 virtual void setKey(Key const &key) = 0;
94
95 public:
96 //-----------------------------------------------------------------------------
100 //-----------------------------------------------------------------------------
101 virtual Value getValue() const = 0;
102
103 //-----------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------
108 virtual void setValue(Value const &value) = 0;
109
110 public:
111 //-----------------------------------------------------------------------------
115 //-----------------------------------------------------------------------------
116 virtual Unit getUnit() const = 0;
117
118 //-----------------------------------------------------------------------------
122 //-----------------------------------------------------------------------------
123 virtual void setUnit(Value const &unit) = 0;
124 };
125
126 #endif // PARAMETERITEMINTERFACE_H
ParameterItemInterface::Key
QString Key
typedef for the key description
Definition: ParameterItemInterface.h:47
ParameterItemInterface::Value
QString Value
typedef for the parameter&#39;s value
Definition: ParameterItemInterface.h:48
ParameterItemInterface::setUnit
virtual void setUnit(Value const &unit)=0
Method which sets the unit of this parameter to the given one.
ParameterItemInterface::Unit
QString Unit
typedef for the parameter&#39;s unit
Definition: ParameterItemInterface.h:49
ParameterItemInterface::getUnit
virtual Unit getUnit() const =0
Method which returns the unit of this parameter.
ParameterItemInterface::getValue
virtual Value getValue() const =0
Method which returns the value of this parameter.
ParameterItemInterface::getID
virtual ID getID() const =0
Method which returns the Id of this parameter if this parameter is registered in a map (ParameterMapI...
ParameterItemInterface::setValue
virtual void setValue(Value const &value)=0
Method which sets the value of this parameter to the given one.
ParameterItemInterface::ID
unsigned int ID
typedef for the parameters id (when registered in a map)
Definition: ParameterItemInterface.h:45
ParameterItemInterface::getType
virtual Type getType() const =0
Method which returns the datatype of this parameter.
ParameterItemInterface::getKey
virtual Key getKey() const =0
Method which returns the key description of this parameter.
ParameterItemInterface::setType
virtual void setType(Type const &type)=0
Method which sets the datatype of this parameter to the given type.
ParameterItemInterface::Type
QString Type
typedef for the data type
Definition: ParameterItemInterface.h:46
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
ParameterItemInterface::setKey
virtual void setKey(Key const &key)=0
Method which sets the key description of this parameter to the given one.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterItemModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
ParameterItemModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of ParameterItemInterface. More...

Detailed Description

This class implements the functionality of ParameterItemInterface.

Definition in file ParameterItemModel.h.

Go to the source code of this file.

Classes

class ParameterItemModel
This class implements the functionality of ParameterItemInterface. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterItemModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
ParameterItemModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef PARAMETERITEMMODEL_H
18 #define PARAMETERITEMMODEL_H
19
20 #include "openPASS-AgentConfiguration/ParameterItemInterface.h"
21
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 class ParameterItemModel : public ParameterItemInterface
26 {
27
28 Q_OBJECT
29
30 public:
31 ParameterItemModel(QObject *parent=nullptr);
32 ParameterItemModel(ParameterItemInterface const * const parameter,
33 QObject *parent = nullptr);
34 virtual ~ParameterItemModel() override = default;
35
36 public:
37 virtual ID getID() const override;
38
39 public:
40 virtual Type getType() const override;
41 virtual void setType(Type const &_type) override;
42
43 public:
44 virtual Key getKey() const override;
45 virtual void setKey(Key const &_key) override;
46
47 public:
48 virtual Value getValue() const override;
49 virtual void setValue(Value const &_value) override;
50
51 public:
52 virtual Unit getUnit() const override;
53 virtual void setUnit(Value const &_unit) override;
54
55 private:
56 Type type;
57 Key key;
58 Value value;
59 Unit unit;
60
61 private:
62 static Type default_type;
63 static Key default_key;
64 static Value default_value;
65 static Unit default_unit;
66 };
67
68 #endif // PARAMETERITEMMODEL_H
ParameterItemModel
This class implements the functionality of ParameterItemInterface.
Definition: ParameterItemModel.h:25
ParameterItemModel::setUnit
virtual void setUnit(Value const &_unit) override
Method which sets the unit of this parameter to the given one.
Definition: ParameterItemModel.cpp:81
ParameterItemInterface::Key
QString Key
typedef for the key description
Definition: ParameterItemInterface.h:47
ParameterItemInterface::Value
QString Value
typedef for the parameter&#39;s value
Definition: ParameterItemInterface.h:48
ParameterItemModel::setValue
virtual void setValue(Value const &_value) override
Method which sets the value of this parameter to the given one.
Definition: ParameterItemModel.cpp:71
ParameterItemModel::getValue
virtual Value getValue() const override
Method which returns the value of this parameter.
Definition: ParameterItemModel.cpp:66
ParameterItemModel::unit
Unit unit
the string object for the parameter&#39;s unit
Definition: ParameterItemModel.h:59
ParameterItemModel::getUnit
virtual Unit getUnit() const override
Method which returns the unit of this parameter.
Definition: ParameterItemModel.cpp:76
ParameterItemModel::getType
virtual Type getType() const override
Method which returns the datatype of this parameter.
Definition: ParameterItemModel.cpp:46
ParameterItemModel::default_key
static Key default_key
the default key desription
Definition: ParameterItemModel.h:63
ParameterItemInterface::Unit
QString Unit
typedef for the parameter&#39;s unit
Definition: ParameterItemInterface.h:49
ParameterItemModel::default_type
static Type default_type
the default datatype
Definition: ParameterItemModel.h:62
ParameterItemInterface.h
This class defines parameters.
ParameterItemInterface::ID
unsigned int ID
typedef for the parameters id (when registered in a map)
Definition: ParameterItemInterface.h:45
ParameterItemModel::key
Key key
the string object for the parameter&#39;s description
Definition: ParameterItemModel.h:57
ParameterItemModel::type
Type type
the string object for the parameter&#39;s datatype
Definition: ParameterItemModel.h:56
ParameterItemInterface::Type
QString Type
typedef for the data type
Definition: ParameterItemInterface.h:46
ParameterItemModel::getID
virtual ID getID() const override
Method which returns the Id of this parameter if this parameter is registered in a map (ParameterMapI...
Definition: ParameterItemModel.cpp:39
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
ParameterItemModel::default_value
static Value default_value
the default value
Definition: ParameterItemModel.h:64
ParameterItemModel::getKey
virtual Key getKey() const override
Method which returns the key description of this parameter.
Definition: ParameterItemModel.cpp:56
ParameterItemModel::setKey
virtual void setKey(Key const &_key) override
Method which sets the key description of this parameter to the given one.
Definition: ParameterItemModel.cpp:61
ParameterItemModel::setType
virtual void setType(Type const &_type) override
Method which sets the datatype of this parameter to the given type.
Definition: ParameterItemModel.cpp:51
ParameterItemModel::default_unit
static Unit default_unit
the default unit
Definition: ParameterItemModel.h:65
ParameterItemModel::value
Value value
the parameter&#39;s value. Taken as a string in order to make it independent its datatype ...
Definition: ParameterItemModel.h:58
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterMapInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
ParameterMapInterface.h File Reference
Agent Configuration Plugin

This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...

Detailed Description

This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.

Definition in file ParameterMapInterface.h.

Go to the source code of this file.

Classes

class ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
ParameterMapInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
19 //-----------------------------------------------------------------------------
20
21
22 #ifndef PARAMETERMAPINTERFACE_H
23 #define PARAMETERMAPINTERFACE_H
24
25 #include "openPASS-AgentConfiguration/ParameterItemInterface.h"
26
27 #include <QObject>
28 #include <QMap>
29 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
36 class ParameterMapInterface: public QObject
37 {
38
39 Q_OBJECT
40
41 public:
42 using ID = ParameterItemInterface::ID;
43 using Item = ParameterItemInterface;
44
45 public:
46 using Map = QMap<ID, Item *>;
47 using Iterator = Map::Iterator;
48 using ConstIterator = Map::ConstIterator;
49
50 public:
51 ParameterMapInterface(QObject * const parent = nullptr) : QObject(parent){}
52 virtual ~ParameterMapInterface() = default;
53
54 public:
55 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 virtual ParameterMapInterface::Iterator begin() = 0;
62
63 //-----------------------------------------------------------------------------
69 //-----------------------------------------------------------------------------
70 virtual ParameterMapInterface::ConstIterator constBegin() const = 0;
71
72 public:
73 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 virtual ParameterMapInterface::Iterator end() = 0;
79
80 //-----------------------------------------------------------------------------
85 //-----------------------------------------------------------------------------
86 virtual ParameterMapInterface::ConstIterator constEnd() const = 0;
87
88 public:
89 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 virtual bool add(ParameterMapInterface::ID const & id) = 0;
98
99 //-----------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------
108 virtual bool add(ParameterMapInterface::ID const & id,
109 ParameterMapInterface::Item const * const item) = 0;
110
111 //-----------------------------------------------------------------------------
118 //-----------------------------------------------------------------------------
119 virtual bool add(ParameterMapInterface::Item * const item) = 0;
120
121 public:
122 //-----------------------------------------------------------------------------
131 //-----------------------------------------------------------------------------
132 virtual bool remove(ParameterMapInterface::ID const & id) = 0;
133
134 //-----------------------------------------------------------------------------
143 //-----------------------------------------------------------------------------
144 virtual bool remove(ParameterMapInterface::Item * const item) = 0;
145
146 public:
147 virtual ParameterMapInterface::Item * getItem(ParameterMapInterface::ID const & id) const = 0;
148
149 public:
150 //-----------------------------------------------------------------------------
156 //-----------------------------------------------------------------------------
157 virtual void setID(ParameterMapInterface::Item * const item,
158 ParameterMapInterface::ID const & id) = 0;
159
160 //-----------------------------------------------------------------------------
167 //-----------------------------------------------------------------------------
168 virtual ParameterMapInterface::ID getID(ParameterMapInterface::Item * const item) const = 0;
169
170 //-----------------------------------------------------------------------------
175 //-----------------------------------------------------------------------------
176 virtual ParameterMapInterface::ID generateID() = 0;
177
178 public:
179 //-----------------------------------------------------------------------------
186 //-----------------------------------------------------------------------------
187 virtual bool contains(ParameterMapInterface::ID const & id) const =0;
188
189 //-----------------------------------------------------------------------------
193 //-----------------------------------------------------------------------------
194 virtual int count() const =0;
195
196 public:
197 //-----------------------------------------------------------------------------
199 //-----------------------------------------------------------------------------
200 virtual void clear() =0;
201
202 public:
203 //-----------------------------------------------------------------------------
207 //-----------------------------------------------------------------------------
208 virtual QList<ID> keys() const =0;
209
210 //-----------------------------------------------------------------------------
215 //-----------------------------------------------------------------------------
216 virtual QList<Item*> values() const =0;
217 };
218
219 #endif //PARAMETERMAPINTERFACE_H
ParameterMapInterface::clear
virtual void clear()=0
Method which deletes all registered parameters and clears the map.
ParameterMapInterface::begin
virtual ParameterMapInterface::Iterator begin()=0
Gets an iterator pointing to the first parameter in the map.
ParameterItemInterface.h
This class defines parameters.
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
ParameterItemInterface::ID
unsigned int ID
typedef for the parameters id (when registered in a map)
Definition: ParameterItemInterface.h:45
ParameterMapInterface::ConstIterator
Map::ConstIterator ConstIterator
typedef for a constant iterator (read-only operations)
Definition: ParameterMapInterface.h:48
ParameterMapInterface::Iterator
Map::Iterator Iterator
typedef for an iterator
Definition: ParameterMapInterface.h:47
ParameterMapInterface::constEnd
virtual ParameterMapInterface::ConstIterator constEnd() const =0
Gets an iterator pointing at the end of the map after the last parameter (use for read-only)...
ParameterMapInterface::contains
virtual bool contains(ParameterMapInterface::ID const &id) const =0
Method wich checks whether the map contains a parameter of the given id.
ParameterMapInterface::getID
virtual ParameterMapInterface::ID getID(ParameterMapInterface::Item *const item) const =0
Method wich returns the id of the given parameter, if contained in the map. Otherwise an empty id is ...
ParameterMapInterface::Map
QMap< ID, Item * > Map
typedef for the map of parameters
Definition: ParameterMapInterface.h:46
ParameterMapInterface::count
virtual int count() const =0
Method which returns the number of parameter in the map.
ParameterMapInterface::values
virtual QList< Item * > values() const =0
Method which returns the list of all parameters registered in this map.
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
ParameterMapInterface::generateID
virtual ParameterMapInterface::ID generateID()=0
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
ParameterMapInterface::ID
ParameterItemInterface::ID ID
typedef for the id of a parameter
Definition: ParameterMapInterface.h:42
ParameterMapInterface::end
virtual ParameterMapInterface::Iterator end()=0
Gets an iterator pointing to the end of the map after the last parameter.
ParameterMapInterface::keys
virtual QList< ID > keys() const =0
Method which returns the list of all ids used in the map.
ParameterMapInterface::constBegin
virtual ParameterMapInterface::ConstIterator constBegin() const =0
Gets an iterator pointing to the first parameter in the map (use for read-only since pointing at cons...
ParameterMapInterface::setID
virtual void setID(ParameterMapInterface::Item *const item, ParameterMapInterface::ID const &id)=0
Method wich changes the id of the given parameter to the one passed as second argument.
ParameterMapInterface::add
virtual bool add(ParameterMapInterface::ID const &id)=0
Method which creates a parameter (instance of ParameterItemInterface) and adds it to the map under th...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterMapModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
ParameterMapModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of ParameterMapInterface. More...

Detailed Description

This class implements the functionality of ParameterMapInterface.

Definition in file ParameterMapModel.h.

Go to the source code of this file.

Classes

class ParameterMapModel
This class implements the functionality of ParameterMapInterface. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterMapModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
ParameterMapModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef PARAMETERMAPMODEL_H
18 #define PARAMETERMAPMODEL_H
19
20 #include "openPASS-AgentConfiguration/ParameterMapInterface.h"
21
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 class ParameterMapModel : public ParameterMapInterface
26 {
27
28 Q_OBJECT
29
30 public:
31 ParameterMapModel(QObject *parent=nullptr);
32 virtual ~ParameterMapModel() override = default;
33
34 public:
35 virtual ParameterMapInterface::Iterator begin() override;
36 virtual ParameterMapInterface::ConstIterator constBegin() const override;
37
38 public:
39 virtual ParameterMapInterface::Iterator end() override;
40 virtual ParameterMapInterface::ConstIterator constEnd() const override;
41
42 public:
43 virtual bool add(ParameterMapInterface::ID const & id) override;
44 virtual bool add(ParameterMapInterface::ID const & id, ParameterMapInterface::Item const * const item) override;
45 virtual bool add(ParameterMapInterface::Item * const item) override;
46
47 public:
48 virtual bool remove(ParameterMapInterface::ID const & id) override;
49 virtual bool remove(ParameterMapInterface::Item * const item) override;
50
51 public:
52 virtual ParameterMapInterface::Item * getItem(ParameterMapInterface::ID const & id) const override;
53
54 public:
55 virtual void setID(ParameterMapInterface::Item * const item,
56 ParameterMapInterface::ID const & id) override;
57
58 virtual ParameterMapInterface::ID getID(ParameterMapInterface::Item * const item) const override;
59
60 virtual ParameterMapInterface::ID generateID() override;
61
62 public:
63 virtual bool contains (ParameterMapInterface::ID const & id) const override;
64 virtual int count() const override;
65
66 public:
67 virtual void clear() override;
68
69 public:
70 virtual QList<ID> keys() const override;
71 virtual QList<Item*> values() const override;
72
73 private:
74 Map parameters;
75 };
76
77 #endif // PARAMETERMAPMODEL_H
ParameterMapModel::constEnd
virtual ParameterMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last parameter (use for read-only)...
Definition: ParameterMapModel.cpp:36
ParameterMapModel::clear
virtual void clear() override
Method which deletes all registered parameters and clears the map.
Definition: ParameterMapModel.cpp:160
ParameterMapInterface.h
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
ParameterMapModel::count
virtual int count() const override
Method which returns the number of parameter in the map.
Definition: ParameterMapModel.cpp:155
ParameterMapModel::contains
virtual bool contains(ParameterMapInterface::ID const &id) const override
Method wich checks whether the map contains a parameter of the given id.
Definition: ParameterMapModel.cpp:140
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
ParameterMapInterface::ConstIterator
Map::ConstIterator ConstIterator
typedef for a constant iterator (read-only operations)
Definition: ParameterMapInterface.h:48
ParameterMapModel::end
virtual ParameterMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last parameter.
Definition: ParameterMapModel.cpp:31
ParameterMapModel::begin
virtual ParameterMapInterface::Iterator begin() override
Gets an iterator pointing to the first parameter in the map.
Definition: ParameterMapModel.cpp:21
ParameterMapInterface::Iterator
Map::Iterator Iterator
typedef for an iterator
Definition: ParameterMapInterface.h:47
ParameterMapModel::keys
virtual QList< ID > keys() const override
Method which returns the list of all ids used in the map.
Definition: ParameterMapModel.cpp:145
ParameterMapModel::generateID
virtual ParameterMapInterface::ID generateID() override
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
Definition: ParameterMapModel.cpp:127
ParameterMapModel
This class implements the functionality of ParameterMapInterface.
Definition: ParameterMapModel.h:25
ParameterMapInterface::Map
QMap< ID, Item * > Map
typedef for the map of parameters
Definition: ParameterMapInterface.h:46
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
ParameterMapModel::getID
virtual ParameterMapInterface::ID getID(ParameterMapInterface::Item *const item) const override
Method wich returns the id of the given parameter, if contained in the map. Otherwise an empty id is ...
Definition: ParameterMapModel.cpp:112
ParameterMapModel::values
virtual QList< Item * > values() const override
Method which returns the list of all parameters registered in this map.
Definition: ParameterMapModel.cpp:150
ParameterMapModel::setID
virtual void setID(ParameterMapInterface::Item *const item, ParameterMapInterface::ID const &id) override
Method wich changes the id of the given parameter to the one passed as second argument.
Definition: ParameterMapModel.cpp:117
ParameterMapInterface::ID
ParameterItemInterface::ID ID
typedef for the id of a parameter
Definition: ParameterMapInterface.h:42
ParameterMapModel::add
virtual bool add(ParameterMapInterface::ID const &id) override
Method which creates a parameter (instance of ParameterItemInterface) and adds it to the map under th...
Definition: ParameterMapModel.cpp:42
ParameterMapModel::constBegin
virtual ParameterMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first parameter in the map (use for read-only since pointing at cons...
Definition: ParameterMapModel.cpp:26
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterMapPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
Classes
ParameterMapPresenter.h File Reference
Agent Configuration Plugin

This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters. In fact, this class implements a wrapper for the map of parameters (ParameterMapInterface) to be editable by QTableView objects within Qt's Model/View framework. More...

Detailed Description

This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters. In fact, this class implements a wrapper for the map of parameters (ParameterMapInterface) to be editable by QTableView objects within Qt's Model/View framework.

Definition in file ParameterMapPresenter.h.

Go to the source code of this file.

Classes

class ParameterMapPresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters. In fact, this class implements a wrapper for the map of parameters (ParameterMapInterface) to be editable by QTableView objects within Qt's Model/View framework. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterMapPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
ParameterMapPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19
20 #ifndef PARAMETERMAPPRESENTER_H
21 #define PARAMETERMAPPRESENTER_H
22
23 #include "openPASS-AgentConfiguration/ParameterMapInterface.h"
24
25 #include <QAbstractTableModel>
26
27 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
33 class ParameterMapPresenter : public QAbstractTableModel
34 {
35 Q_OBJECT
36
37 public:
38 explicit ParameterMapPresenter(ParameterMapInterface * parameters = nullptr,
39 QObject *parent = nullptr);
40
41 public:
42 //-----------------------------------------------------------------------------
53 //-----------------------------------------------------------------------------
54 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
55
56 public:
57 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
66 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
67
68 //-----------------------------------------------------------------------------
76 //-----------------------------------------------------------------------------
77 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
78
79 public:
80 //-----------------------------------------------------------------------------
88 //-----------------------------------------------------------------------------
89 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
90
91 //-----------------------------------------------------------------------------
100 //-----------------------------------------------------------------------------
101 bool setData(const QModelIndex &index, const QVariant &value,
102 int role = Qt::EditRole) override;
103
104 //-----------------------------------------------------------------------------
111 //-----------------------------------------------------------------------------
112 Qt::ItemFlags flags(const QModelIndex& index) const override;
113
114 public:
115 //-----------------------------------------------------------------------------
121 //-----------------------------------------------------------------------------
122 virtual void addRow(ParameterItemInterface::Type _type,
123 ParameterItemInterface::Key _key,
124 ParameterItemInterface::Unit _unit,
125 ParameterItemInterface::Value _value);
126
127 //-----------------------------------------------------------------------------
135 //-----------------------------------------------------------------------------
136 virtual bool removeRow(const int &row);
137
138 //-----------------------------------------------------------------------------
143 //-----------------------------------------------------------------------------
144 void setParameters(ParameterMapInterface * _parameters);
145
146 //-----------------------------------------------------------------------------
149 //-----------------------------------------------------------------------------
150 void update();
151
152 private:
153 QMap<int, ParameterMapInterface::ID> RowToID;
154 QStringList _columnHeaders;
155 ParameterMapInterface *parameters;
156 };
157
158 #endif // PARAMETERMAPPRESENTER_H
ParameterMapPresenter::addRow
virtual void addRow(ParameterItemInterface::Type _type, ParameterItemInterface::Key _key, ParameterItemInterface::Unit _unit, ParameterItemInterface::Value _value)
Method that adds a new row, i.e. a new parameter with the given attributes.
Definition: ParameterMapPresenter.cpp:106
ParameterItemInterface::Key
QString Key
typedef for the key description
Definition: ParameterItemInterface.h:47
ParameterItemInterface::Value
QString Value
typedef for the parameter&#39;s value
Definition: ParameterItemInterface.h:48
ParameterMapInterface.h
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
ParameterItemInterface::Unit
QString Unit
typedef for the parameter&#39;s unit
Definition: ParameterItemInterface.h:49
ParameterMapPresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters...
Definition: ParameterMapPresenter.h:33
ParameterMapPresenter::parameters
ParameterMapInterface * parameters
the pointer to the map of parameters edited by this table wrapper
Definition: ParameterMapPresenter.h:155
ParameterMapPresenter::_columnHeaders
QStringList _columnHeaders
a string list containing the column header data of the table
Definition: ParameterMapPresenter.h:154
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
ParameterMapPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: ParameterMapPresenter.cpp:49
ParameterMapPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: ParameterMapPresenter.cpp:21
ParameterMapPresenter::setParameters
void setParameters(ParameterMapInterface *_parameters)
Method which sets the currently processed parameter map to the given argument.
Definition: ParameterMapPresenter.cpp:150
ParameterMapPresenter::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: ParameterMapPresenter.cpp:76
ParameterMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: ParameterMapPresenter.cpp:32
ParameterMapPresenter::update
void update()
Method which updates the table according to the current entries of parameters.
Definition: ParameterMapPresenter.cpp:156
ParameterMapPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: ParameterMapPresenter.cpp:42
ParameterItemInterface::Type
QString Type
typedef for the data type
Definition: ParameterItemInterface.h:46
ParameterMapPresenter::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! ...
Definition: ParameterMapPresenter.cpp:98
ParameterMapPresenter::RowToID
QMap< int, ParameterMapInterface::ID > RowToID
a map of row indices to parameter Ids
Definition: ParameterMapPresenter.h:153
ParameterMapPresenter::removeRow
virtual bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: ParameterMapPresenter.cpp:131
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
SensorItemInterface.h File Reference
Agent Configuration Plugin

This file contains the class declaration of a sensor data object as well as a structure for a sensor position. More...

Detailed Description

This file contains the class declaration of a sensor data object as well as a structure for a sensor position.

The SensorItemInterface class combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to one sensor data object. The sensor position strucutre gathers all variables which specify a sensor position. This includes three spatial coordinates (vehicle reference frame) as well as three angles (Euler angles) for the orientation. Additionally, a name for identifying/characterizing the sensor position is provided.

Definition in file SensorItemInterface.h.

Go to the source code of this file.

Classes

class | SensorItemInterface
The SensorItemInterface class combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to a sensor data object. More...
struct | SensorPosition
This structure gathers all variables which specify a sensor position. This includes three spatial coordinates (vehicle reference frame) as well as three angles (Euler angles) for the orientation. Additionally, a name for identifying/characterizing the sensor position is provided. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
SensorItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25
26 #ifndef SENSORITEMINTERFACE_H
27 #define SENSORITEMINTERFACE_H
28
29 #include "openPASS-AgentConfiguration/SensorProfileItemInterface.h"
30
31 #include <QObject>
32
33 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
39 struct SensorPosition
40 {
41 QString Name;
42
43 double roll;
44 double yaw;
45 double pitch;
46
47 double height;
48 double lateral;
49 double longitudinal;
50 };
51
52 //-----------------------------------------------------------------------------
55 //-----------------------------------------------------------------------------
56 class SensorItemInterface: public QObject
57 {
58
59 Q_OBJECT
60
61 public:
62 using ID = unsigned int;
63 using Profile = SensorProfileItemInterface;
64
65 public:
66 SensorItemInterface(QObject * const parent = nullptr) : QObject(parent){}
67 virtual ~SensorItemInterface() = default;
68
69 public:
70 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 virtual SensorPosition getSensorPosition() const =0;
76
77 //-----------------------------------------------------------------------------
82 //-----------------------------------------------------------------------------
83 virtual void setSensorPosition(SensorPosition const & position) =0;
84
85 public:
86 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 virtual Profile * getSensorProfile() const =0;
92
93 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 virtual void setSensorProfile(Profile * const _profile) =0;
99
100 public:
101 //-----------------------------------------------------------------------------
106 //-----------------------------------------------------------------------------
107 virtual ID getID() const =0;
108
109 };
110
111 #endif // SENSORITEMINTERFACE_H
SensorItemInterface::getSensorPosition
virtual SensorPosition getSensorPosition() const =0
Method which returns the position of the sensor.
SensorItemInterface::Profile
SensorProfileItemInterface Profile
tpedef for the sensor profile
Definition: SensorItemInterface.h:63
SensorItemInterface
The SensorItemInterface class combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to a sensor data object.
Definition: SensorItemInterface.h:56
SensorProfileItemInterface.h
This class defines objects containing all relevant information on sensor profiles.
SensorPosition
This structure gathers all variables which specify a sensor position. This includes three spatial coo...
Definition: SensorItemInterface.h:39
SensorItemInterface::getID
virtual ID getID() const =0
Method which returns the id of this sensor, if this sensor is registered in a map (SensorMapInterface...
SensorItemInterface::getSensorProfile
virtual Profile * getSensorProfile() const =0
Method which returns the sensor profile which is currently used.
SensorItemInterface::setSensorProfile
virtual void setSensorProfile(Profile *const _profile)=0
Method which sets the sensor profile to the one passed as an argument.
SensorItemInterface::setSensorPosition
virtual void setSensorPosition(SensorPosition const &position)=0
Method which sets the position of the sensor to the one passed as an argument.
SensorProfileItemInterface
This class defines objects containing all relevant information on sensor profiles.
Definition: SensorProfileItemInterface.h:36
SensorItemInterface::ID
unsigned int ID
typedef for the sensor&#39;s key identifier
Definition: SensorItemInterface.h:62
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorItemModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
SensorItemModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of SensorItemInterface. More...

Detailed Description

This class implements the functionality of SensorItemInterface.

Definition in file SensorItemModel.h.

Go to the source code of this file.

Classes

class SensorItemModel
This class implements the functionality of SensorItemInterface. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorItemModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
SensorItemModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef SENSORITEMMODEL_H
18 #define SENSORITEMMODEL_H
19
20 #include "openPASS-AgentConfiguration/SensorItemInterface.h"
21
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 class SensorItemModel : public SensorItemInterface
26 {
27 public:
28 SensorItemModel(QObject * parent = nullptr);
29 virtual ~SensorItemModel() override = default;
30
31 public:
32 virtual SensorPosition getSensorPosition() const override;
33 virtual void setSensorPosition(SensorPosition const & _position) override;
34
35 public:
36 virtual Profile * getSensorProfile() const override;
37 virtual void setSensorProfile(Profile * const _profile) override;
38
39 public:
40 virtual ID getID() const override;
41
42 private:
43 SensorPosition position;
44 Profile * profile;
45 static SensorPosition default_position;
46
47 };
48
49 #endif // SENSORITEMMODEL_H
SensorItemModel::setSensorProfile
virtual void setSensorProfile(Profile *const _profile) override
Method which sets the sensor profile to the one passed as an argument.
Definition: SensorItemModel.cpp:40
SensorItemInterface::Profile
SensorProfileItemInterface Profile
tpedef for the sensor profile
Definition: SensorItemInterface.h:63
SensorItemModel::position
SensorPosition position
the structure for storing sensor positioning data
Definition: SensorItemModel.h:43
SensorItemModel::setSensorPosition
virtual void setSensorPosition(SensorPosition const &_position) override
Method which sets the position of the sensor to the one passed as an argument.
Definition: SensorItemModel.cpp:30
SensorItemInterface
The SensorItemInterface class combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to a sensor data object.
Definition: SensorItemInterface.h:56
SensorItemModel
This class implements the functionality of SensorItemInterface.
Definition: SensorItemModel.h:25
SensorItemModel::getSensorPosition
virtual SensorPosition getSensorPosition() const override
Method which returns the position of the sensor.
Definition: SensorItemModel.cpp:25
SensorPosition
This structure gathers all variables which specify a sensor position. This includes three spatial coo...
Definition: SensorItemInterface.h:39
SensorItemModel::default_position
static SensorPosition default_position
the default position structure
Definition: SensorItemModel.h:45
SensorItemModel::getSensorProfile
virtual Profile * getSensorProfile() const override
Method which returns the sensor profile which is currently used.
Definition: SensorItemModel.cpp:35
SensorItemModel::getID
virtual ID getID() const override
Method which returns the id of this sensor, if this sensor is registered in a map (SensorMapInterface...
Definition: SensorItemModel.cpp:46
SensorItemInterface.h
This file contains the class declaration of a sensor data object as well as a structure for a sensor ...
SensorItemModel::profile
Profile * profile
the pointer to the sensor&#39;s profile
Definition: SensorItemModel.h:44
SensorItemInterface::ID
unsigned int ID
typedef for the sensor&#39;s key identifier
Definition: SensorItemInterface.h:62
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorMapInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
SensorMapInterface.h File Reference
Agent Configuration Plugin

This class constitutes a container class in which sensor data (instances of SensorItemInterface) are registered. It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...

Detailed Description

This class constitutes a container class in which sensor data (instances of SensorItemInterface) are registered. It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.

Definition in file SensorMapInterface.h.

Go to the source code of this file.

Classes

class SensorMapInterface
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are registered. It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
SensorMapInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
19 //-----------------------------------------------------------------------------
20
21 #ifndef SENSORMAPINTERFACE_H
22 #define SENSORMAPINTERFACE_H
23
24 #include "openPASS-AgentConfiguration/SensorItemInterface.h"
25
26 #include <QObject>
27 #include <QMap>
28
29 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
36 class SensorMapInterface: public QObject
37 {
38
39 Q_OBJECT
40
41 public:
42 using ID = SensorItemInterface::ID;
43 using Item = SensorItemInterface;
44
45 public:
46 using Map = QMap<ID, Item *>;
47 using Iterator = Map::Iterator;
48 using ConstIterator = Map::ConstIterator;
49
50 public:
51 SensorMapInterface(QObject * const parent = nullptr) : QObject(parent){}
52 virtual ~SensorMapInterface() = default;
53
54 public:
55 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 virtual SensorMapInterface::Iterator begin() = 0;
62
63 //-----------------------------------------------------------------------------
69 //-----------------------------------------------------------------------------
70 virtual SensorMapInterface::ConstIterator constBegin() const = 0;
71
72 public:
73 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 virtual SensorMapInterface::Iterator end() = 0;
79
80 //-----------------------------------------------------------------------------
85 //-----------------------------------------------------------------------------
86 virtual SensorMapInterface::ConstIterator constEnd() const = 0;
87
88 public:
89 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 virtual bool add(SensorMapInterface::ID const & id) = 0;
98
99 //-----------------------------------------------------------------------------
106 //-----------------------------------------------------------------------------
107 virtual bool add(SensorMapInterface::Item * const item) = 0;
108
109 public:
110 //-----------------------------------------------------------------------------
119 //-----------------------------------------------------------------------------
120 virtual bool remove(SensorMapInterface::ID const & id) = 0;
121
122 //-----------------------------------------------------------------------------
131 //-----------------------------------------------------------------------------
132 virtual bool remove(SensorMapInterface::Item * const item) = 0;
133
134 public:
135 //-----------------------------------------------------------------------------
144 //-----------------------------------------------------------------------------
145 virtual SensorMapInterface::Item * getItem(SensorMapInterface::ID const & id) const = 0;
146
147 public:
148 //-----------------------------------------------------------------------------
154 //-----------------------------------------------------------------------------
155 virtual void setID(SensorMapInterface::Item * const item,
156 SensorMapInterface::ID const & id) = 0;
157
158 //-----------------------------------------------------------------------------
165 //-----------------------------------------------------------------------------
166 virtual SensorMapInterface::ID getID(SensorMapInterface::Item * const item) const = 0;
167
168 //-----------------------------------------------------------------------------
173 //-----------------------------------------------------------------------------
174 virtual SensorMapInterface::ID generateID() =0;
175
176 public:
177 //-----------------------------------------------------------------------------
184 //-----------------------------------------------------------------------------
185 virtual bool contains (SensorMapInterface::ID const & id) const =0;
186
187 //-----------------------------------------------------------------------------
191 //-----------------------------------------------------------------------------
192 virtual int count() const =0;
193
194 public:
195 //-----------------------------------------------------------------------------
197 //-----------------------------------------------------------------------------
198 virtual void clear() =0;
199
200 public:
201 //-----------------------------------------------------------------------------
205 //-----------------------------------------------------------------------------
206 virtual QList<ID> keys() const =0;
207
208 //-----------------------------------------------------------------------------
213 //-----------------------------------------------------------------------------
214 virtual QList<Item*> values() const =0;
215 };
216
217 #endif // SENSORMAPINTERFACE_H
SensorMapInterface::constEnd
virtual SensorMapInterface::ConstIterator constEnd() const =0
Gets an iterator pointing at the end of the map after the last sensor data object (use for read-only)...
SensorMapInterface::setID
virtual void setID(SensorMapInterface::Item *const item, SensorMapInterface::ID const &id)=0
Method wich changes the id of the given sensor data object to the one passed as second argument...
SensorMapInterface::end
virtual SensorMapInterface::Iterator end()=0
Gets an iterator pointing to the end of the map after the last dsensor data object.
SensorItemInterface
The SensorItemInterface class combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to a sensor data object.
Definition: SensorItemInterface.h:56
SensorMapInterface::keys
virtual QList< ID > keys() const =0
Method which returns the list of all ids used in the map.
SensorMapInterface::begin
virtual SensorMapInterface::Iterator begin()=0
Gets an iterator pointing to the first sensor data object in the map.
SensorMapInterface::clear
virtual void clear()=0
Method which deletes all sensor data objects and clears the map.
SensorMapInterface::getItem
virtual SensorMapInterface::Item * getItem(SensorMapInterface::ID const &id) const =0
Method which returns a pointer to the sensor data object specified by the given id. If the map does not contain an object with the given id, nullptr is returned.
SensorMapInterface::Iterator
Map::Iterator Iterator
typedef for an iterator
Definition: SensorMapInterface.h:47
SensorMapInterface::getID
virtual SensorMapInterface::ID getID(SensorMapInterface::Item *const item) const =0
Method wich returns the id of the given sensor data object, if contained in the map. Otherwise an empty id is returned.
SensorMapInterface::add
virtual bool add(SensorMapInterface::ID const &id)=0
Method which creates a sensor data object (instance of SensorItemInterface) and adds it to the map un...
SensorMapInterface::Map
QMap< ID, Item * > Map
typedef for the map of sensor data
Definition: SensorMapInterface.h:46
SensorMapInterface::constBegin
virtual SensorMapInterface::ConstIterator constBegin() const =0
Gets an iterator pointing to the first sensor data object in the map (use for read-only since pointin...
SensorItemInterface.h
This file contains the class declaration of a sensor data object as well as a structure for a sensor ...
SensorMapInterface::count
virtual int count() const =0
Method which returns the number of items in the map.
SensorMapInterface
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are ...
Definition: SensorMapInterface.h:36
SensorMapInterface::values
virtual QList< Item * > values() const =0
Method which returns the list of all sensor data objects registered in this map.
SensorItemInterface::ID
unsigned int ID
typedef for the sensor&#39;s key identifier
Definition: SensorItemInterface.h:62
SensorMapInterface::generateID
virtual SensorMapInterface::ID generateID()=0
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
SensorMapInterface::ID
SensorItemInterface::ID ID
typedef for the id of the sensor data object
Definition: SensorMapInterface.h:42
SensorMapInterface::ConstIterator
Map::ConstIterator ConstIterator
typedef for a constant iterator (read-only operations)
Definition: SensorMapInterface.h:48
SensorMapInterface::contains
virtual bool contains(SensorMapInterface::ID const &id) const =0
Method wich checks whether the map contains a sensor data object of the given id. ...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorMapModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
SensorMapModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of SensorMapInterface. More...

Detailed Description

This class implements the functionality of SensorMapInterface.

Definition in file SensorMapModel.h.

Go to the source code of this file.

Classes

class SensorMapModel
This class implements the functionality of SensorMapInterface. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorMapModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
SensorMapModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef SENSORMAPMODEL_H
18 #define SENSORMAPMODEL_H
19
20 #include "openPASS-AgentConfiguration/SensorMapInterface.h"
21
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 class SensorMapModel : public SensorMapInterface
26 {
27
28 Q_OBJECT
29
30 public:
31 SensorMapModel(QObject *parent=nullptr);
32 ~SensorMapModel() = default;
33
34 public:
35 virtual SensorMapInterface::Iterator begin() override;
36 virtual SensorMapInterface::ConstIterator constBegin() const override;
37
38 public:
39 virtual SensorMapInterface::Iterator end() override;
40 virtual SensorMapInterface::ConstIterator constEnd() const override;
41
42 public:
43 virtual bool add(SensorMapInterface::ID const & id) override;
44 virtual bool add(SensorMapInterface::Item * const item) override;
45
46 public:
47 virtual bool remove(SensorMapInterface::ID const & id) override;
48 virtual bool remove(SensorMapInterface::Item * const item) override;
49
50 public:
51 virtual SensorMapInterface::Item * getItem(SensorMapInterface::ID const & id) const override;
52
53 public:
54 virtual void setID(SensorMapInterface::Item * const item,
55 SensorMapInterface::ID const & id) override;
56
57 virtual SensorMapInterface::ID getID(SensorMapInterface::Item * const item) const override;
58
59 virtual SensorMapInterface::ID generateID() override;
60
61 public:
62 virtual bool contains (SensorMapInterface::ID const & id) const override;
63 virtual int count() const override;
64
65 public:
66 virtual void clear() override;
67
68 public:
69 virtual QList<ID> keys() const override;
70 virtual QList<Item*> values() const override;
71
72 private:
73 SensorMapInterface::Map sensors;
74
75 };
76
77 #endif // SENSORMAPMODEL_H
SensorMapModel::setID
virtual void setID(SensorMapInterface::Item *const item, SensorMapInterface::ID const &id) override
Method wich changes the id of the given sensor data object to the one passed as second argument...
Definition: SensorMapModel.cpp:106
SensorMapModel::getID
virtual SensorMapInterface::ID getID(SensorMapInterface::Item *const item) const override
Method wich returns the id of the given sensor data object, if contained in the map. Otherwise an empty id is returned.
Definition: SensorMapModel.cpp:101
SensorItemInterface
The SensorItemInterface class combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to a sensor data object.
Definition: SensorItemInterface.h:56
SensorMapModel::keys
virtual QList< ID > keys() const override
Method which returns the list of all ids used in the map.
Definition: SensorMapModel.cpp:134
SensorMapInterface.h
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are ...
SensorMapModel::add
virtual bool add(SensorMapInterface::ID const &id) override
Method which creates a sensor data object (instance of SensorItemInterface) and adds it to the map un...
Definition: SensorMapModel.cpp:42
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73
SensorMapModel::constBegin
virtual SensorMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first sensor data object in the map (use for read-only since pointin...
Definition: SensorMapModel.cpp:26
SensorMapModel
This class implements the functionality of SensorMapInterface.
Definition: SensorMapModel.h:25
SensorMapModel::begin
virtual SensorMapInterface::Iterator begin() override
Gets an iterator pointing to the first sensor data object in the map.
Definition: SensorMapModel.cpp:21
SensorMapInterface::Iterator
Map::Iterator Iterator
typedef for an iterator
Definition: SensorMapInterface.h:47
SensorMapModel::constEnd
virtual SensorMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last sensor data object (use for read-only)...
Definition: SensorMapModel.cpp:36
SensorMapModel::clear
virtual void clear() override
Method which deletes all sensor data objects and clears the map.
Definition: SensorMapModel.cpp:149
SensorMapModel::contains
virtual bool contains(SensorMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor data object of the given id. ...
Definition: SensorMapModel.cpp:129
SensorMapInterface::Map
QMap< ID, Item * > Map
typedef for the map of sensor data
Definition: SensorMapInterface.h:46
SensorMapModel::end
virtual SensorMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last dsensor data object.
Definition: SensorMapModel.cpp:31
SensorMapModel::values
virtual QList< Item * > values() const override
Method which returns the list of all sensor data objects registered in this map.
Definition: SensorMapModel.cpp:139
SensorMapModel::generateID
virtual SensorMapInterface::ID generateID() override
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
Definition: SensorMapModel.cpp:116
SensorMapInterface
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are ...
Definition: SensorMapInterface.h:36
SensorMapModel::count
virtual int count() const override
Method which returns the number of items in the map.
Definition: SensorMapModel.cpp:144
SensorMapModel::getItem
virtual SensorMapInterface::Item * getItem(SensorMapInterface::ID const &id) const override
Method which returns a pointer to the sensor data object specified by the given id. If the map does not contain an object with the given id, nullptr is returned.
Definition: SensorMapModel.cpp:92
SensorMapInterface::ID
SensorItemInterface::ID ID
typedef for the id of the sensor data object
Definition: SensorMapInterface.h:42
SensorMapInterface::ConstIterator
Map::ConstIterator ConstIterator
typedef for a constant iterator (read-only operations)
Definition: SensorMapInterface.h:48
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
SensorProfileItemInterface.h File Reference
Agent Configuration Plugin

This class defines objects containing all relevant information on sensor profiles. More...

Detailed Description

This class defines objects containing all relevant information on sensor profiles.

In particular, the name, the type descibing the sensor's implementation and all parameters constitute a sensor profile addressed by this class.

Definition in file SensorProfileItemInterface.h.

Go to the source code of this file.

Classes

class SensorProfileItemInterface
This class defines objects containing all relevant information on sensor profiles. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
SensorProfileItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
19 //-----------------------------------------------------------------------------
20
21 #ifndef SENSORPROFILEITEMINTERFACE_H
22 #define SENSORPROFILEITEMINTERFACE_H
23
24 #include "openPASS-AgentConfiguration/ParameterMapInterface.h"
25
26 #include <QObject>
27 #include <QPair>
28
29 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
36 class SensorProfileItemInterface: public QObject
37 {
38
39 Q_OBJECT
40
41 public:
42 using Name = QString;
43 using Type = QString;
44 using ID = QPair<Name, Type>;
45 using Parameters = ParameterMapInterface;
46
47 public:
48 SensorProfileItemInterface(QObject * const parent = nullptr) : QObject(parent){}
49 virtual ~SensorProfileItemInterface() = default;
50
51 public:
52 //-----------------------------------------------------------------------------
57 //-----------------------------------------------------------------------------
58 virtual Parameters * getParameters() const = 0;
59
60 public:
61 //-----------------------------------------------------------------------------
66 //-----------------------------------------------------------------------------
67 virtual ID getID() const = 0;
68
69 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 virtual Name getName() const = 0;
75
76 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 virtual Type getType() const = 0;
83
84 };
85
86 #endif // SENSORPROFILEITEMINTERFACE_H
SensorProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of the sensor profile.
ParameterMapInterface.h
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
SensorProfileItemInterface::getType
virtual Type getType() const =0
Method which returns the type (implementation) of the sensor adressed by this profile.
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
SensorProfileItemInterface::getParameters
virtual Parameters * getParameters() const =0
Method which returns the parameter map of this sensor profile (instance of ParameterMapInterface).
SensorProfileItemInterface::ID
QPair< Name, Type > ID
typedef for the identifier of a sensor profile, i.e. its name and type
Definition: SensorProfileItemInterface.h:44
SensorProfileItemInterface::Name
QString Name
typedef for the sensor profile&#39;s name
Definition: SensorProfileItemInterface.h:42
SensorProfileItemInterface::Parameters
ParameterMapInterface Parameters
typedef for the sensor profile&#39;s parameters
Definition: SensorProfileItemInterface.h:45
SensorProfileItemInterface
This class defines objects containing all relevant information on sensor profiles.
Definition: SensorProfileItemInterface.h:36
SensorProfileItemInterface::getID
virtual ID getID() const =0
Method which returns the identifier of the sensor profile, i.e. the pair of name and type...
SensorProfileItemInterface::Type
QString Type
typedef for the sensor&#39;s type (implementation)
Definition: SensorProfileItemInterface.h:43
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileItemModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
SensorProfileItemModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of SensorProfileItemInterface. More...

Detailed Description

This class implements the functionality of SensorProfileItemInterface.

Definition in file SensorProfileItemModel.h.

Go to the source code of this file.

Classes

class SensorProfileItemModel
This class implements the functionality of SensorProfileItemInterface. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileItemModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
SensorProfileItemModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef SENSORPROFILEITEMMODEL_H
18 #define SENSORPROFILEITEMMODEL_H
19
20 #include "openPASS-AgentConfiguration/SensorProfileItemInterface.h"
21
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 class SensorProfileItemModel : public SensorProfileItemInterface
26 {
27
28 Q_OBJECT
29
30 public:
31 SensorProfileItemModel(QObject *parent = nullptr);
32 ~SensorProfileItemModel() = default;
33
34 public:
35 virtual Parameters * getParameters() const override;
36
37
38 public:
39 virtual ID getID() const override;
40 virtual Name getName() const override;
41 virtual Type getType() const override;
42
43 private:
44 Parameters * const parameters;
45
46 };
47
48 #endif // SENSORPROFILEITEMMODEL_H
SensorProfileItemModel::getParameters
virtual Parameters * getParameters() const override
Method which returns the parameter map of this sensor profile (instance of ParameterMapInterface).
Definition: SensorProfileItemModel.cpp:40
SensorProfileItemInterface.h
This class defines objects containing all relevant information on sensor profiles.
SensorProfileItemModel::getType
virtual Type getType() const override
Method which returns the type (implementation) of the sensor adressed by this profile.
Definition: SensorProfileItemModel.cpp:32
SensorProfileItemModel::getID
virtual ID getID() const override
Method which returns the identifier of the sensor profile, i.e. the pair of name and type...
Definition: SensorProfileItemModel.cpp:45
SensorProfileItemModel
This class implements the functionality of SensorProfileItemInterface.
Definition: SensorProfileItemModel.h:25
SensorProfileItemModel::parameters
Parameters *const parameters
pointer to the parameter map of the sensor profile
Definition: SensorProfileItemModel.h:44
SensorProfileItemInterface::ID
QPair< Name, Type > ID
typedef for the identifier of a sensor profile, i.e. its name and type
Definition: SensorProfileItemInterface.h:44
SensorProfileItemInterface::Name
QString Name
typedef for the sensor profile&#39;s name
Definition: SensorProfileItemInterface.h:42
SensorProfileItemInterface::Parameters
ParameterMapInterface Parameters
typedef for the sensor profile&#39;s parameters
Definition: SensorProfileItemInterface.h:45
SensorProfileItemModel::getName
virtual Name getName() const override
Method which returns the name of the sensor profile.
Definition: SensorProfileItemModel.cpp:24
SensorProfileItemInterface
This class defines objects containing all relevant information on sensor profiles.
Definition: SensorProfileItemInterface.h:36
SensorProfileItemInterface::Type
QString Type
typedef for the sensor&#39;s type (implementation)
Definition: SensorProfileItemInterface.h:43
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileMapInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
SensorProfileMapInterface.h File Reference
Agent Configuration Plugin

This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInterface) are registered. As a key identifier the pair of sensor name and type (corrsponding to its implementation) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...

Detailed Description

This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInterface) are registered. As a key identifier the pair of sensor name and type (corrsponding to its implementation) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.

Definition in file SensorProfileMapInterface.h.

Go to the source code of this file.

Classes

class SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInterface) are registered. As a key identifier the pair of sensor name and type (corrsponding to its implementation) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
SensorProfileMapInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
22
23 #ifndef SENSORPROFILEMAPINTERFACE_H
24 #define SENSORPROFILEMAPINTERFACE_H
25
26 #include "openPASS-AgentConfiguration/SensorProfileItemInterface.h"
27
28 #include <QObject>
29 #include <QPair>
30 #include <QMap>
31
32 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
41 class SensorProfileMapInterface: public QObject
42 {
43
44 Q_OBJECT
45
46 public:
47 using Name = SensorProfileItemInterface::Name;
48 using Type = SensorProfileItemInterface::Type;
49 using ID = QPair<Name, Type>;
50 using Item = SensorProfileItemInterface;
51
52 public:
53 using Map = QMap<ID, Item *>;
54 using Iterator = Map::Iterator;
55 using ConstIterator = Map::ConstIterator;
56
57 public:
58 SensorProfileMapInterface(QObject * const parent = nullptr) : QObject(parent){}
59 virtual ~SensorProfileMapInterface() = default;
60
61
62 public:
63 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 virtual SensorProfileMapInterface::Iterator begin() = 0;
70
71 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 virtual SensorProfileMapInterface::ConstIterator constBegin() const = 0;
79
80 public:
81 //-----------------------------------------------------------------------------
85 //-----------------------------------------------------------------------------
86 virtual SensorProfileMapInterface::Iterator end() = 0;
87
88 //-----------------------------------------------------------------------------
93 //-----------------------------------------------------------------------------
94 virtual SensorProfileMapInterface::ConstIterator constEnd() const = 0;
95
96 public:
97 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
105 virtual bool add(SensorProfileMapInterface::ID const & id) = 0;
106
107 public:
108 //-----------------------------------------------------------------------------
117 //-----------------------------------------------------------------------------
118 virtual bool remove(SensorProfileMapInterface::ID const & id) = 0;
119
120 public:
121 //-----------------------------------------------------------------------------
130 //-----------------------------------------------------------------------------
131 virtual SensorProfileMapInterface::Item * getItem(SensorProfileMapInterface::ID const & id) const = 0;
132
133 public:
134 //-----------------------------------------------------------------------------
141 //-----------------------------------------------------------------------------
142 virtual void setID(SensorProfileMapInterface::Item * const item,
143 SensorProfileMapInterface::ID const & id) = 0;
144
145 //-----------------------------------------------------------------------------
150 //-----------------------------------------------------------------------------
151 virtual SensorProfileMapInterface::ID getID(SensorProfileMapInterface::Item * const item) const = 0;
152
153 //-----------------------------------------------------------------------------
160 //-----------------------------------------------------------------------------
161 virtual Name generateName(Type type) =0;
162
163 public:
164 //-----------------------------------------------------------------------------
170 //-----------------------------------------------------------------------------
171 virtual bool contains (SensorProfileMapInterface::ID const & id) const =0;
172
173 //-----------------------------------------------------------------------------
177 //-----------------------------------------------------------------------------
178 virtual int count() const =0;
179
180 public:
181 //-----------------------------------------------------------------------------
183 //-----------------------------------------------------------------------------
184 virtual void clear() =0;
185
186 public:
187 //-----------------------------------------------------------------------------
191 //-----------------------------------------------------------------------------
192 virtual QList<ID> keys() const =0;
193
194 //-----------------------------------------------------------------------------
198 //-----------------------------------------------------------------------------
199 virtual QList<Item*> values() const =0;
200
201 };
202
203
204 #endif // SENSORPROFILEMAPINTERFACE_H
SensorProfileMapInterface::Map
QMap< ID, Item * > Map
typedef for the map, i.e. the container object of sensor profiles
Definition: SensorProfileMapInterface.h:53
SensorProfileMapInterface::clear
virtual void clear()=0
Method which deletes all registered sensor profiles and clears the map.
SensorProfileMapInterface::end
virtual SensorProfileMapInterface::Iterator end()=0
Gets an iterator pointing to the end of the map after the last sensor profile.
SensorProfileMapInterface::add
virtual bool add(SensorProfileMapInterface::ID const &id)=0
Method which creates a new sensor profile (instance of SensorProfileItemInterface) and adds it to the...
SensorProfileMapInterface::begin
virtual SensorProfileMapInterface::Iterator begin()=0
Gets an iterator pointing to the first sensor profile in the map.
SensorProfileMapInterface::keys
virtual QList< ID > keys() const =0
Method which returns the list of all sensor profile Ids in the map.
SensorProfileItemInterface.h
This class defines objects containing all relevant information on sensor profiles.
SensorProfileMapInterface::generateName
virtual Name generateName(Type type)=0
Method wich generates a default name of the pattern "Standard %1" for a sensor profile of the given t...
SensorProfileMapInterface::getItem
virtual SensorProfileMapInterface::Item * getItem(SensorProfileMapInterface::ID const &id) const =0
Method which returns a pointer to the sensor profile with the given Id. If the map does not contain a...
SensorProfileMapInterface::count
virtual int count() const =0
Method which returns the number of sensor profiles in the map.
SensorProfileMapInterface::contains
virtual bool contains(SensorProfileMapInterface::ID const &id) const =0
Method wich checks whether the map contains a sensor profile with the given Id.
SensorProfileMapInterface::constEnd
virtual SensorProfileMapInterface::ConstIterator constEnd() const =0
Gets an iterator pointing at the end of the map after the last sensor profile (use for read-only)...
SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
Definition: SensorProfileMapInterface.h:41
SensorProfileItemInterface::Name
QString Name
typedef for the sensor profile&#39;s name
Definition: SensorProfileItemInterface.h:42
SensorProfileMapInterface::getID
virtual SensorProfileMapInterface::ID getID(SensorProfileMapInterface::Item *const item) const =0
Method wich returns the Id of the given sensor profile.
SensorProfileMapInterface::Type
SensorProfileItemInterface::Type Type
typedef for the sensor type (i.e. its algorithm/implementation)
Definition: SensorProfileMapInterface.h:48
SensorProfileMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: SensorProfileMapInterface.h:54
SensorProfileMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all sensor profiles in the map.
SensorProfileItemInterface
This class defines objects containing all relevant information on sensor profiles.
Definition: SensorProfileItemInterface.h:36
SensorProfileMapInterface::Name
SensorProfileItemInterface::Name Name
typedef for the sensor profiles name
Definition: SensorProfileMapInterface.h:47
SensorProfileMapInterface::setID
virtual void setID(SensorProfileMapInterface::Item *const item, SensorProfileMapInterface::ID const &id)=0
Method wich changes the Id of the given sensor profile to the one passed as second argument...
SensorProfileMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: SensorProfileMapInterface.h:55
SensorProfileMapInterface::ID
QPair< Name, Type > ID
typedef for the pair of name and type used as an Id
Definition: SensorProfileMapInterface.h:49
SensorProfileMapInterface::constBegin
virtual SensorProfileMapInterface::ConstIterator constBegin() const =0
Gets an iterator pointing to the first sensor profile in the map (use for read-only since pointing at...
SensorProfileItemInterface::Type
QString Type
typedef for the sensor&#39;s type (implementation)
Definition: SensorProfileItemInterface.h:43
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileMapModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
SensorProfileMapModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of SensorProfileMapInterface. More...

Detailed Description

This class implements the functionality of SensorProfileMapInterface.

Definition in file SensorProfileMapModel.h.

Go to the source code of this file.

Classes

class SensorProfileMapModel
This class implements the functionality of SensorProfileMapInterface. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileMapModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
SensorProfileMapModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef SENSORPROFILEMAPMODEL_H
18 #define SENSORPROFILEMAPMODEL_H
19
20 #include "openPASS-AgentConfiguration/SensorProfileMapInterface.h"
21
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 class SensorProfileMapModel : public SensorProfileMapInterface
26 {
27
28 Q_OBJECT
29
30 public:
31 SensorProfileMapModel(QObject *parent = nullptr);
32 ~SensorProfileMapModel()=default;
33
34
35 public:
36 virtual SensorProfileMapInterface::Iterator begin() override;
37 virtual SensorProfileMapInterface::ConstIterator constBegin() const override;
38
39 public:
40 virtual SensorProfileMapInterface::Iterator end() override;
41 virtual SensorProfileMapInterface::ConstIterator constEnd() const override;
42
43 public:
44 virtual bool add(SensorProfileMapInterface::ID const & id) override;
45
46 public:
47 virtual bool remove(SensorProfileMapInterface::ID const & id) override;
48
49 public:
50 virtual SensorProfileMapInterface::Item * getItem(SensorProfileMapInterface::ID const & id) const override;
51
52 public:
53 virtual void setID(SensorProfileMapInterface::Item * const item,
54 SensorProfileMapInterface::ID const & id) override;
55
56 virtual SensorProfileMapInterface::ID getID(SensorProfileMapInterface::Item * const item) const override;
57
58 virtual Name generateName(Type type) override;
59
60 public:
61 virtual bool contains (SensorProfileMapInterface::ID const & id) const override;
62 virtual int count() const override;
63
64 public:
65 virtual void clear() override;
66
67 public:
68 virtual QList<ID> keys() const override;
69 virtual QList<Item*> values() const override;
70
71 private:
72 Map sensorProfiles;
73
74 };
75
76 #endif // SENSORPROFILEMAPMODEL_H
SensorProfileMapModel::keys
virtual QList< ID > keys() const override
Method which returns the list of all sensor profile Ids in the map.
Definition: SensorProfileMapModel.cpp:112
SensorProfileMapInterface::Map
QMap< ID, Item * > Map
typedef for the map, i.e. the container object of sensor profiles
Definition: SensorProfileMapInterface.h:53
SensorProfileMapModel::count
virtual int count() const override
Method which returns the number of sensor profiles in the map.
Definition: SensorProfileMapModel.cpp:122
SensorProfileMapModel::values
virtual QList< Item * > values() const override
Method which returns a list of pointers to all sensor profiles in the map.
Definition: SensorProfileMapModel.cpp:117
SensorProfileMapModel::generateName
virtual Name generateName(Type type) override
Method wich generates a default name of the pattern "Standard %1" for a sensor profile of the given t...
Definition: SensorProfileMapModel.cpp:88
SensorProfileMapModel::constEnd
virtual SensorProfileMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last sensor profile (use for read-only)...
Definition: SensorProfileMapModel.cpp:36
SensorProfileMapInterface.h
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
SensorProfileMapModel::getItem
virtual SensorProfileMapInterface::Item * getItem(SensorProfileMapInterface::ID const &id) const override
Method which returns a pointer to the sensor profile with the given Id. If the map does not contain a...
Definition: SensorProfileMapModel.cpp:64
SensorProfileMapModel::clear
virtual void clear() override
Method which deletes all registered sensor profiles and clears the map.
Definition: SensorProfileMapModel.cpp:127
SensorProfileMapModel::add
virtual bool add(SensorProfileMapInterface::ID const &id) override
Method which creates a new sensor profile (instance of SensorProfileItemInterface) and adds it to the...
Definition: SensorProfileMapModel.cpp:42
SensorProfileMapModel::constBegin
virtual SensorProfileMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first sensor profile in the map (use for read-only since pointing at...
Definition: SensorProfileMapModel.cpp:26
SensorProfileMapModel::begin
virtual SensorProfileMapInterface::Iterator begin() override
Gets an iterator pointing to the first sensor profile in the map.
Definition: SensorProfileMapModel.cpp:21
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72
SensorProfileMapModel::end
virtual SensorProfileMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last sensor profile.
Definition: SensorProfileMapModel.cpp:31
SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
Definition: SensorProfileMapInterface.h:41
SensorProfileMapModel::setID
virtual void setID(SensorProfileMapInterface::Item *const item, SensorProfileMapInterface::ID const &id) override
Method wich changes the Id of the given sensor profile to the one passed as second argument...
Definition: SensorProfileMapModel.cpp:78
SensorProfileMapModel::contains
virtual bool contains(SensorProfileMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor profile with the given Id.
Definition: SensorProfileMapModel.cpp:107
SensorProfileMapInterface::Type
SensorProfileItemInterface::Type Type
typedef for the sensor type (i.e. its algorithm/implementation)
Definition: SensorProfileMapInterface.h:48
SensorProfileMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: SensorProfileMapInterface.h:54
SensorProfileMapInterface::Name
SensorProfileItemInterface::Name Name
typedef for the sensor profiles name
Definition: SensorProfileMapInterface.h:47
SensorProfileItemInterface
This class defines objects containing all relevant information on sensor profiles.
Definition: SensorProfileItemInterface.h:36
SensorProfileMapModel::getID
virtual SensorProfileMapInterface::ID getID(SensorProfileMapInterface::Item *const item) const override
Method wich returns the Id of the given sensor profile.
Definition: SensorProfileMapModel.cpp:73
SensorProfileMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: SensorProfileMapInterface.h:55
SensorProfileMapModel
This class implements the functionality of SensorProfileMapInterface.
Definition: SensorProfileMapModel.h:25
SensorProfileMapInterface::ID
QPair< Name, Type > ID
typedef for the pair of name and type used as an Id
Definition: SensorProfileMapInterface.h:49
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemProfilePresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
Classes
SystemProfilePresenter.h File Reference
Agent Configuration Plugin

This class constitutes the re-implementation of QAbstractTableModel for the table view of systems with a given algorithm type. The corresponding model data object is referred to as "system profile". In fact, this class implements a wrapper for these system profiles to be editable by QTableView objects within Qt's Model/View framework. More...

Detailed Description

This class constitutes the re-implementation of QAbstractTableModel for the table view of systems with a given algorithm type. The corresponding model data object is referred to as "system profile". In fact, this class implements a wrapper for these system profiles to be editable by QTableView objects within Qt's Model/View framework.

Definition in file SystemProfilePresenter.h.

Go to the source code of this file.

Classes

class SystemProfilePresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of systems with a given algorithm type. The corresponding model data object is referred to as "system profile". In fact, this class implements a wrapper for these system profiles to be editable by QTableView objects within Qt's Model/View framework. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemProfilePresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
SystemProfilePresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
19 //-----------------------------------------------------------------------------
20
21
22 #ifndef SYSTEMPROFILEPRESENTER_H
23 #define SYSTEMPROFILEPRESENTER_H
24
25 #include "openPASS-AgentConfiguration/VehicleProfileItemInterface.h"
26 #include <QAbstractTableModel>
27
28 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
35 class SystemProfilePresenter : public QAbstractTableModel
36 {
37 Q_OBJECT
38
39 public:
40 explicit SystemProfilePresenter(VehicleProfileItemInterface::Systems * const systems,
41 QObject *parent = nullptr);
42
43 ~SystemProfilePresenter() override = default;
44
45 public:
46 //-----------------------------------------------------------------------------
57 //-----------------------------------------------------------------------------
58 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
59
60 public:
61 //-----------------------------------------------------------------------------
69 //-----------------------------------------------------------------------------
70 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
71
72 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
81 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
82
83 public:
84 //-----------------------------------------------------------------------------
92 //-----------------------------------------------------------------------------
93 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
94
95 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
105 bool setData(const QModelIndex &index, const QVariant &value,
106 int role = Qt::EditRole) override;
107
108 //-----------------------------------------------------------------------------
115 //-----------------------------------------------------------------------------
116 Qt::ItemFlags flags(const QModelIndex& index) const override;
117
118 public:
119 //-----------------------------------------------------------------------------
124 //-----------------------------------------------------------------------------
125 virtual void addRow(int const &row,
126 VehicleProfileItemInterface::System system,
127 VehicleProfileItemInterface::Probability probability);
128
129 //-----------------------------------------------------------------------------
137 //-----------------------------------------------------------------------------
138 virtual bool removeRow(const int &row);
139
140 //-----------------------------------------------------------------------------
145 //-----------------------------------------------------------------------------
146 void setSystems(VehicleProfileItemInterface::Systems * const _systems);
147
148
149 //-----------------------------------------------------------------------------
152 //-----------------------------------------------------------------------------
153 void update();
154
155 private:
156 VehicleProfileItemInterface::Systems * systems;
157
158 private:
159 QStringList _columnHeaders;
160 QMap<int, VehicleProfileItemInterface::System> RowToSystem;
161 };
162
163 #endif // SYSTEMPROFILEPRESENTER_H
VehicleProfileItemInterface::System
QPair< SystemID, SystemTitle > System
typedef for a system (here, the system Id and title are sufficient)
Definition: VehicleProfileItemInterface.h:87
SystemProfilePresenter::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: SystemProfilePresenter.cpp:73
SystemProfilePresenter::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! ...
Definition: SystemProfilePresenter.cpp:91
SystemProfilePresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: SystemProfilePresenter.cpp:39
VehicleProfileItemInterface::Probability
double Probability
typedef for a probability
Definition: VehicleProfileItemInterface.h:77
SystemProfilePresenter::setSystems
void setSystems(VehicleProfileItemInterface::Systems *const _systems)
Method which sets the currently processed systems map to the given argument.
Definition: SystemProfilePresenter.cpp:136
SystemProfilePresenter::RowToSystem
QMap< int, VehicleProfileItemInterface::System > RowToSystem
the mapping of row indices to systems
Definition: SystemProfilePresenter.h:160
SystemProfilePresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of systems wit...
Definition: SystemProfilePresenter.h:35
SystemProfilePresenter::_columnHeaders
QStringList _columnHeaders
the string list of header data for columns
Definition: SystemProfilePresenter.h:159
SystemProfilePresenter::removeRow
virtual bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: SystemProfilePresenter.cpp:117
SystemProfilePresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: SystemProfilePresenter.cpp:21
SystemProfilePresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: SystemProfilePresenter.cpp:32
SystemProfilePresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: SystemProfilePresenter.cpp:46
SystemProfilePresenter::update
void update()
Method which updates the table according to the current entries of systems.
Definition: SystemProfilePresenter.cpp:144
VehicleProfileItemInterface::Systems
QMap< System, Probability > Systems
typedef for the map assigning probabilities to systems
Definition: VehicleProfileItemInterface.h:88
SystemProfilePresenter::systems
VehicleProfileItemInterface::Systems * systems
the map of systems to be edited by this presenter
Definition: SystemProfilePresenter.h:156
SystemProfilePresenter::addRow
virtual void addRow(int const &row, VehicleProfileItemInterface::System system, VehicleProfileItemInterface::Probability probability)
Method that adds a new row, i.e. a system with the given probability.
Definition: SystemProfilePresenter.cpp:99
VehicleProfileItemInterface.h
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemProfileView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
Classes
SystemProfileView.h File Reference
Agent Configuration Plugin

This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm type onto probabilities. More...

Detailed Description

This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm type onto probabilities.

The view constitutes a table view for assigning systems to probabilities, buttons for adding and removing systems and a combobox to select systems for adding.

Definition in file SystemProfileView.h.

Go to the source code of this file.

Classes

class SystemProfileView
This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm type onto probabilities. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemProfileView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
SystemProfileView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
21
22 #ifndef SYSTEMPROFILEVIEW_H
23 #define SYSTEMPROFILEVIEW_H
24
25 #include <QWidget>
26 #include <QTableView>
27
28 namespace Ui {
29 class SystemProfileView;
30 }
31
32 //-----------------------------------------------------------------------------
39 //-----------------------------------------------------------------------------
40 class SystemProfileView : public QWidget
41 {
42 Q_OBJECT
43
44 public:
45 explicit SystemProfileView(QString AlgoType,
46 QWidget *parent = nullptr);
47 ~SystemProfileView();
48
49 Q_SIGNALS:
50 //-----------------------------------------------------------------------------
58 //-----------------------------------------------------------------------------
59 void addSystem(QString AlgoType, QString const & selectionItem);
60
61 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 void removeSystem(QString AlgoType, const int &row);
70
71 private Q_SLOTS:
72 //-----------------------------------------------------------------------------
76 //-----------------------------------------------------------------------------
77 void on_addSystem_clicked();
78
79 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 void on_removeSystem_clicked();
85
86 public:
87 //-----------------------------------------------------------------------------
93 //-----------------------------------------------------------------------------
94 void setSelectionItems(const QList<QString> &items);
95
96 //-----------------------------------------------------------------------------
100 //-----------------------------------------------------------------------------
101 QTableView * getSystemView() const;
102
103 private:
104 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------
115 bool eventFilter(QObject *watched, QEvent *event);
116
117 private:
118 Ui::SystemProfileView *ui;
119 };
120
121 #endif // SYSTEMPROFILEVIEW_H
SystemProfileView::on_removeSystem_clicked
void on_removeSystem_clicked()
Slot triggered when the remove-button for systems is clicked. Emits the removeSystem signal transmitt...
Definition: SystemProfileView.cpp:48
SystemProfileView::ui
Ui::SystemProfileView * ui
the ui object containing all GUI elements of this view
Definition: SystemProfileView.h:118
SystemProfileView::removeSystem
void removeSystem(QString AlgoType, const int &row)
Signal, emitted after the remove-button for systems has been clicked. Transmits the algorithm type an...
SystemProfileView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter for catching the resize-events of the systems&#39; table view...
Definition: SystemProfileView.cpp:59
Ui
Definition: EnvironmentDisplayView.h:29
SystemProfileView::on_addSystem_clicked
void on_addSystem_clicked()
Slot triggered when the add-button for systems is clicked. Emits the addSystem signal transmitting th...
Definition: SystemProfileView.cpp:43
SystemProfileView::addSystem
void addSystem(QString AlgoType, QString const &selectionItem)
Signal, emitted when the add-button for systems has been clicked. Transmits the algorithm type and th...
SystemProfileView::getSystemView
QTableView * getSystemView() const
Method which provides access to the table view for systems.
Definition: SystemProfileView.cpp:38
SystemProfileView
This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm ...
Definition: SystemProfileView.h:40
SystemProfileView::setSelectionItems
void setSelectionItems(const QList< QString > &items)
Method which clears the selection list for the systems&#39; combo box and inserts the given list...
Definition: SystemProfileView.cpp:53
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
VehicleComponentItemInterface.h File Reference
Agent Configuration Plugin

The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a algorithms that will be built into a vehicle with a certain probability. More...

Detailed Description

The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a algorithms that will be built into a vehicle with a certain probability.

The stored data comprise the algorithm of the component (type), a profile containing the parameterization together with probabilities for the profile to be instantiated and, finally, sensor links if the component requires sensor data.

Definition in file VehicleComponentItemInterface.h.

Go to the source code of this file.

Classes

class VehicleComponentItemInterface
The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a algorithms that will be built into a vehicle with a certain probability. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
VehicleComponentItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
23
24 #ifndef VEHICLECOMPONENTITEMINTERFACE_H
25 #define VEHICLECOMPONENTITEMINTERFACE_H
26
27 #include "openPASS-AgentConfiguration/VehicleComponentProfileItemInterface.h"
28
29 #include <QObject>
30 #include <QMap>
31
32 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
42 class VehicleComponentItemInterface: public QObject
43 {
44
45 Q_OBJECT
46
47 public:
48 using Type = QString;
49 using Profile = VehicleComponentProfileItemInterface;
50 using Probability = double;
51
52 public:
53 using Profiles = QMap<Profile *, Probability>;
54 using SensorLinks = QMap<unsigned int, QString>;
55
56 public:
57 VehicleComponentItemInterface(QObject * const parent = nullptr) : QObject(parent){}
58 virtual ~VehicleComponentItemInterface() = default;
59
60 public:
61 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
66 virtual Profiles * getProfiles() const = 0;
67
68 //-----------------------------------------------------------------------------
72 //-----------------------------------------------------------------------------
73 virtual SensorLinks * getSensorLinks() const = 0;
74
75 public:
76 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
81 virtual Type getType() const = 0;
82
83 };
84
85 #endif // VEHICLECOMPONENTITEMINTERFACE_H
VehicleComponentProfileItemInterface.h
This class defines vehicle component profiles which contain the parameterization of a vehicle compone...
VehicleComponentItemInterface::getType
virtual Type getType() const =0
Method which returns type (algorithm) of the vehicle component.
VehicleComponentProfileItemInterface
This class defines vehicle component profiles which contain the parameterization of a vehicle compone...
Definition: VehicleComponentProfileItemInterface.h:40
VehicleComponentItemInterface::getProfiles
virtual Profiles * getProfiles() const =0
Method which returns the map of profiles assigned to probabilites.
VehicleComponentItemInterface::Probability
double Probability
typedef for a probability
Definition: VehicleComponentItemInterface.h:50
VehicleComponentItemInterface::Type
QString Type
typedef for the component type (= algorithm)
Definition: VehicleComponentItemInterface.h:48
VehicleComponentItemInterface
The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a ...
Definition: VehicleComponentItemInterface.h:42
VehicleComponentItemInterface::Profiles
QMap< Profile *, Probability > Profiles
typedef for the map which assigns probabilities to profiles
Definition: VehicleComponentItemInterface.h:53
VehicleComponentItemInterface::SensorLinks
QMap< unsigned int, QString > SensorLinks
typedef for the map describing sensor links
Definition: VehicleComponentItemInterface.h:54
VehicleComponentItemInterface::getSensorLinks
virtual SensorLinks * getSensorLinks() const =0
Method which returns the map of sensor links.
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentItemModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
VehicleComponentItemModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of VehicleComponentItemInterface. More...

Detailed Description

This class implements the functionality of VehicleComponentItemInterface.

Definition in file VehicleComponentItemModel.h.

Go to the source code of this file.

Classes

class VehicleComponentItemModel
This class implements the functionality of VehicleComponentItemInterface. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentItemModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
VehicleComponentItemModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef VEHICLECOMPONENTITEMMODEL_H
18 #define VEHICLECOMPONENTITEMMODEL_H
19
20 #include "openPASS-AgentConfiguration/VehicleComponentItemInterface.h"
21
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 class VehicleComponentItemModel : public VehicleComponentItemInterface
26 {
27 Q_OBJECT
28
29 public:
30 VehicleComponentItemModel(QObject *parent = nullptr);
31 virtual ~VehicleComponentItemModel() override;
32
33 public:
34 virtual Profiles * getProfiles() const override;
35 virtual SensorLinks * getSensorLinks() const override;
36
37 public:
38 virtual Type getType() const override;
39
40 private:
41 Profiles * const profiles;
42 SensorLinks * const sensorLinks;
43
44 };
45
46 #endif // VEHICLECOMPONENTITEMMODEL_H
VehicleComponentItemModel::sensorLinks
SensorLinks *const sensorLinks
the pointer to the map defining sensor links
Definition: VehicleComponentItemModel.h:42
VehicleComponentItemInterface.h
The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a ...
VehicleComponentItemModel::getSensorLinks
virtual SensorLinks * getSensorLinks() const override
Method which returns the map of sensor links.
Definition: VehicleComponentItemModel.cpp:39
VehicleComponentItemModel
This class implements the functionality of VehicleComponentItemInterface.
Definition: VehicleComponentItemModel.h:25
VehicleComponentItemModel::profiles
Profiles *const profiles
the pointer to the vehicle component profiles
Definition: VehicleComponentItemModel.h:41
VehicleComponentItemModel::getProfiles
virtual Profiles * getProfiles() const override
Method which returns the map of profiles assigned to probabilites.
Definition: VehicleComponentItemModel.cpp:34
VehicleComponentItemModel::getType
virtual Type getType() const override
Method which returns type (algorithm) of the vehicle component.
Definition: VehicleComponentItemModel.cpp:27
VehicleComponentItemInterface::Type
QString Type
typedef for the component type (= algorithm)
Definition: VehicleComponentItemInterface.h:48
VehicleComponentItemInterface
The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a ...
Definition: VehicleComponentItemInterface.h:42
VehicleComponentItemInterface::Profiles
QMap< Profile *, Probability > Profiles
typedef for the map which assigns probabilities to profiles
Definition: VehicleComponentItemInterface.h:53
VehicleComponentItemInterface::SensorLinks
QMap< unsigned int, QString > SensorLinks
typedef for the map describing sensor links
Definition: VehicleComponentItemInterface.h:54
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentMapInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
VehicleComponentMapInterface.h File Reference
Agent Configuration Plugin

This class constitutes a container class for vehicle component data (instances of VehicleComponentItemInterface) using the vehicle component's type (i.e. the algorithm it represents) as a key identifier. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...

Detailed Description

This class constitutes a container class for vehicle component data (instances of VehicleComponentItemInterface) using the vehicle component's type (i.e. the algorithm it represents) as a key identifier. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.

Definition in file VehicleComponentMapInterface.h.

Go to the source code of this file.

Classes

class VehicleComponentMapInterface
This class constitutes a container class for vehicle component data (instances of VehicleComponentItemInterface) using the vehicle component's type (i.e. the algorithm it represents) as a key identifier. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
VehicleComponentMapInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
21
22 #ifndef VEHICLECOMPONENTMAPINTERFACE_H
23 #define VEHICLECOMPONENTMAPINTERFACE_H
24
25 #include "openPASS-AgentConfiguration/VehicleComponentItemInterface.h"
26
27 #include <QObject>
28 #include <QMap>
29
30 //-----------------------------------------------------------------------------
37 //-----------------------------------------------------------------------------
38 class VehicleComponentMapInterface: public QObject
39 {
40 Q_OBJECT
41
42 public:
43 using Type = VehicleComponentItemInterface::Type;
44 using Item = VehicleComponentItemInterface;
45
46 public:
47 using Map = QMap<Type, Item *>;
48 using Iterator = Map::Iterator;
49 using ConstIterator = Map::ConstIterator;
50
51 public:
52 VehicleComponentMapInterface(QObject * const parent = nullptr) : QObject(parent){}
53 virtual ~VehicleComponentMapInterface() = default;
54
55
56 public:
57 //-----------------------------------------------------------------------------
62 //-----------------------------------------------------------------------------
63 virtual VehicleComponentMapInterface::Iterator begin() = 0;
64
65 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 virtual VehicleComponentMapInterface::ConstIterator constBegin() const = 0;
73
74 public:
75 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
81 virtual VehicleComponentMapInterface::Iterator end() = 0;
82
83 //-----------------------------------------------------------------------------
88 //-----------------------------------------------------------------------------
89 virtual VehicleComponentMapInterface::ConstIterator constEnd() const = 0;
90
91 public:
92 //-----------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------
100 virtual bool add(VehicleComponentMapInterface::Type const & type) = 0;
101
102 public:
103 //-----------------------------------------------------------------------------
112 //-----------------------------------------------------------------------------
113 virtual bool remove(VehicleComponentMapInterface::Type const & type) = 0;
114
115 public:
116 //-----------------------------------------------------------------------------
126 //-----------------------------------------------------------------------------
127 virtual VehicleComponentMapInterface::Item * getItem(VehicleComponentMapInterface::Type const & type) const = 0;
128
129 public:
130 //-----------------------------------------------------------------------------
137 //-----------------------------------------------------------------------------
138 virtual void setType(VehicleComponentMapInterface::Item * const item,
139 VehicleComponentMapInterface::Type const & type) = 0;
140
141 //-----------------------------------------------------------------------------
146 //-----------------------------------------------------------------------------
147 virtual VehicleComponentMapInterface::Type getType(VehicleComponentMapInterface::Item * const item) const = 0;
148
149 public:
150 //-----------------------------------------------------------------------------
156 //-----------------------------------------------------------------------------
157 virtual bool contains (VehicleComponentMapInterface::Type const & type) const =0;
158
159 //-----------------------------------------------------------------------------
165 //-----------------------------------------------------------------------------
166 virtual int count() const =0;
167
168 public:
169 //-----------------------------------------------------------------------------
172 //-----------------------------------------------------------------------------
173 virtual void clear() =0;
174
175 public:
176 //-----------------------------------------------------------------------------
180 //-----------------------------------------------------------------------------
181 virtual QStringList keys() const =0;
182
183 //-----------------------------------------------------------------------------
189 //-----------------------------------------------------------------------------
190 virtual QList<Item*> values() const =0;
191 };
192
193 #endif // VEHICLECOMPONENTMAPINTERFACE_H
194
195
VehicleComponentMapInterface::clear
virtual void clear()=0
Method which deletes all registered vehicle component data objects and clears the map...
VehicleComponentMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: VehicleComponentMapInterface.h:48
VehicleComponentMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all vehicle component data objects in the map...
VehicleComponentItemInterface.h
The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a ...
VehicleComponentMapInterface::add
virtual bool add(VehicleComponentMapInterface::Type const &type)=0
Method which creates a new vehicle component data object (instance of VehicleComponentItemInterface) ...
VehicleComponentMapInterface::constEnd
virtual VehicleComponentMapInterface::ConstIterator constEnd() const =0
Gets an iterator pointing at the end of the map after the last vehicle component data object (use for...
VehicleComponentMapInterface::setType
virtual void setType(VehicleComponentMapInterface::Item *const item, VehicleComponentMapInterface::Type const &type)=0
Method wich changes the type of the given vehicle component data object to the one passed as second a...
VehicleComponentMapInterface::keys
virtual QStringList keys() const =0
Method which returns the list of all vehicle component types in the map.
VehicleComponentMapInterface::begin
virtual VehicleComponentMapInterface::Iterator begin()=0
Gets an iterator pointing to the first vehicle component data in the map.
VehicleComponentMapInterface::count
virtual int count() const =0
Method which returns the number of vehicle component data objects in the map.
VehicleComponentMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: VehicleComponentMapInterface.h:49
VehicleComponentMapInterface
This class constitutes a container class for vehicle component data (instances of VehicleComponentIte...
Definition: VehicleComponentMapInterface.h:38
VehicleComponentMapInterface::end
virtual VehicleComponentMapInterface::Iterator end()=0
Gets an iterator pointing to the end of the map after the last vehicle component data object...
VehicleComponentMapInterface::contains
virtual bool contains(VehicleComponentMapInterface::Type const &type) const =0
Method wich checks whether the map contains a vehicle component data object with the given type...
VehicleComponentItemInterface::Type
QString Type
typedef for the component type (= algorithm)
Definition: VehicleComponentItemInterface.h:48
VehicleComponentItemInterface
The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a ...
Definition: VehicleComponentItemInterface.h:42
VehicleComponentMapInterface::Map
QMap< Type, Item * > Map
typedef for the map, i.e. the container object of vehicle component data
Definition: VehicleComponentMapInterface.h:47
VehicleComponentMapInterface::getItem
virtual VehicleComponentMapInterface::Item * getItem(VehicleComponentMapInterface::Type const &type) const =0
Method which returns a pointer to the vehicle component data object of the given type. If the map does not contain a vehicle component data object of that type, nullptr is returned.
VehicleComponentMapInterface::Type
VehicleComponentItemInterface::Type Type
typedef for the vehicle component&#39;s type
Definition: VehicleComponentMapInterface.h:43
VehicleComponentMapInterface::constBegin
virtual VehicleComponentMapInterface::ConstIterator constBegin() const =0
Gets an iterator pointing to the first vehicle component data object in the map (use for read-only si...
VehicleComponentMapInterface::getType
virtual VehicleComponentMapInterface::Type getType(VehicleComponentMapInterface::Item *const item) const =0
Method wich returns the type of the given vehicle component data object.
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentMapModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
VehicleComponentMapModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of VehicleComponentMapInterface. More...

Detailed Description

This class implements the functionality of VehicleComponentMapInterface.

Definition in file VehicleComponentMapModel.h.

Go to the source code of this file.

Classes

class VehicleComponentMapModel
This class implements the functionality of VehicleComponentMapInterface. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentMapModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
VehicleComponentMapModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef VEHICLECOMPONENTMAPMODEL_H
18 #define VEHICLECOMPONENTMAPMODEL_H
19
20 #include "openPASS-AgentConfiguration/VehicleComponentMapInterface.h"
21
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 class VehicleComponentMapModel : public VehicleComponentMapInterface
26 {
27 Q_OBJECT
28
29 public:
30 VehicleComponentMapModel(QObject * parent = nullptr);
31 ~VehicleComponentMapModel() = default;
32
33 public:
34 virtual VehicleComponentMapInterface::Iterator begin() override;
35 virtual VehicleComponentMapInterface::ConstIterator constBegin() const override;
36
37 public:
38 virtual VehicleComponentMapInterface::Iterator end() override;
39 virtual VehicleComponentMapInterface::ConstIterator constEnd() const override;
40
41 public:
42 virtual bool add(VehicleComponentMapInterface::Type const & type) override;
43
44 public:
45 virtual bool remove(VehicleComponentMapInterface::Type const & type) override;
46
47 public:
48 virtual VehicleComponentMapInterface::Item * getItem(VehicleComponentMapInterface::Type const & type) const override;
49
50 public:
51 virtual void setType(VehicleComponentMapInterface::Item * const item,
52 VehicleComponentMapInterface::Type const & type) override;
53
54 virtual VehicleComponentMapInterface::Type getType(VehicleComponentMapInterface::Item * const item) const override;
55
56 public:
57 virtual bool contains (VehicleComponentMapInterface::Type const & type) const override;
58 virtual int count() const override;
59
60 public:
61 virtual void clear() override;
62
63 public:
64 virtual QStringList keys() const override;
65 virtual QList<Item*> values() const override;
66
67 private:
68 VehicleComponentMapInterface::Map components;
69 };
70
71 #endif // VEHICLECOMPONENTMAPMODEL_H
VehicleComponentMapModel::keys
virtual QStringList keys() const override
Method which returns the list of all vehicle component types in the map.
Definition: VehicleComponentMapModel.cpp:95
VehicleComponentMapModel::values
virtual QList< Item * > values() const override
Method which returns a list of pointers to all vehicle component data objects in the map...
Definition: VehicleComponentMapModel.cpp:100
VehicleComponentMapModel::count
virtual int count() const override
Method which returns the number of vehicle component data objects in the map.
Definition: VehicleComponentMapModel.cpp:105
VehicleComponentMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: VehicleComponentMapInterface.h:48
VehicleComponentMapModel::getType
virtual VehicleComponentMapInterface::Type getType(VehicleComponentMapInterface::Item *const item) const override
Method wich returns the type of the given vehicle component data object.
Definition: VehicleComponentMapModel.cpp:74
VehicleComponentMapModel::begin
virtual VehicleComponentMapInterface::Iterator begin() override
Gets an iterator pointing to the first vehicle component data in the map.
Definition: VehicleComponentMapModel.cpp:22
VehicleComponentMapModel::clear
virtual void clear() override
Method which deletes all registered vehicle component data objects and clears the map...
Definition: VehicleComponentMapModel.cpp:110
VehicleComponentMapModel::add
virtual bool add(VehicleComponentMapInterface::Type const &type) override
Method which creates a new vehicle component data object (instance of VehicleComponentItemInterface) ...
Definition: VehicleComponentMapModel.cpp:43
VehicleComponentMapInterface.h
This class constitutes a container class for vehicle component data (instances of VehicleComponentIte...
VehicleComponentMapModel::getItem
virtual VehicleComponentMapInterface::Item * getItem(VehicleComponentMapInterface::Type const &type) const override
Method which returns a pointer to the vehicle component data object of the given type. If the map does not contain a vehicle component data object of that type, nullptr is returned.
Definition: VehicleComponentMapModel.cpp:65
VehicleComponentMapModel::constBegin
virtual VehicleComponentMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first vehicle component data object in the map (use for read-only si...
Definition: VehicleComponentMapModel.cpp:27
VehicleComponentMapModel
This class implements the functionality of VehicleComponentMapInterface.
Definition: VehicleComponentMapModel.h:25
VehicleComponentMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: VehicleComponentMapInterface.h:49
VehicleComponentMapInterface
This class constitutes a container class for vehicle component data (instances of VehicleComponentIte...
Definition: VehicleComponentMapInterface.h:38
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68
VehicleComponentMapModel::setType
virtual void setType(VehicleComponentMapInterface::Item *const item, VehicleComponentMapInterface::Type const &type) override
Method wich changes the type of the given vehicle component data object to the one passed as second a...
Definition: VehicleComponentMapModel.cpp:79
VehicleComponentItemInterface
The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a ...
Definition: VehicleComponentItemInterface.h:42
VehicleComponentMapModel::contains
virtual bool contains(VehicleComponentMapInterface::Type const &type) const override
Method wich checks whether the map contains a vehicle component data object with the given type...
Definition: VehicleComponentMapModel.cpp:90
VehicleComponentMapInterface::Map
QMap< Type, Item * > Map
typedef for the map, i.e. the container object of vehicle component data
Definition: VehicleComponentMapInterface.h:47
VehicleComponentMapModel::constEnd
virtual VehicleComponentMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last vehicle component data object (use for...
Definition: VehicleComponentMapModel.cpp:37
VehicleComponentMapInterface::Type
VehicleComponentItemInterface::Type Type
typedef for the vehicle component&#39;s type
Definition: VehicleComponentMapInterface.h:43
VehicleComponentMapModel::end
virtual VehicleComponentMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last vehicle component data object...
Definition: VehicleComponentMapModel.cpp:32
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
VehicleComponentProfileItemInterface.h File Reference
Agent Configuration Plugin

This class defines vehicle component profiles which contain the parameterization of a vehicle component, i.e. an instance of the VehicleComponentItemInterface class. More...

Detailed Description

This class defines vehicle component profiles which contain the parameterization of a vehicle component, i.e. an instance of the VehicleComponentItemInterface class.

The profiles are characterized by a name and the type of the vehicle component (algorithm) they correspond to. Further, the profiles access the parameter map.

Definition in file VehicleComponentProfileItemInterface.h.

Go to the source code of this file.

Classes

class VehicleComponentProfileItemInterface
This class defines vehicle component profiles which contain the parameterization of a vehicle component, i.e. an instance of the VehicleComponentItemInterface class. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
VehicleComponentProfileItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
22
23 #ifndef VEHICLECOMPONENTPROFILEITEMINTERFACE_H
24 #define VEHICLECOMPONENTPROFILEITEMINTERFACE_H
25
26 #include "openPASS-AgentConfiguration/ParameterMapInterface.h"
27
28 #include <QObject>
29 #include <QMap>
30
31 //-----------------------------------------------------------------------------
39 //-----------------------------------------------------------------------------
40 class VehicleComponentProfileItemInterface: public QObject
41 {
42
43 Q_OBJECT
44
45 public:
46 using Name = QString;
47 using Type = QString;
48 using Parameters = ParameterMapInterface;
49
50 public:
51 VehicleComponentProfileItemInterface(QObject * const parent = nullptr) : QObject(parent){}
52 virtual ~VehicleComponentProfileItemInterface() = default;
53
54 public:
55 //-----------------------------------------------------------------------------
59 //-----------------------------------------------------------------------------
60 virtual Parameters * getParameters() const = 0;
61
62 public:
63 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 virtual Name getName() const = 0;
69
70 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 virtual Type getType() const = 0;
76 };
77
78 #endif // VEHICLECOMPONENTPROFILEITEMINTERFACE_H
VehicleComponentProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of the vehicle component profile.
ParameterMapInterface.h
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
VehicleComponentProfileItemInterface::getType
virtual Type getType() const =0
Method which returns the type of the corresponding vehicle component.
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
VehicleComponentProfileItemInterface::Type
QString Type
typedef for the type (algorithm) of the corresponding vehicle component
Definition: VehicleComponentProfileItemInterface.h:47
VehicleComponentProfileItemInterface
This class defines vehicle component profiles which contain the parameterization of a vehicle compone...
Definition: VehicleComponentProfileItemInterface.h:40
VehicleComponentProfileItemInterface::Name
QString Name
typedef for the name of the profile
Definition: VehicleComponentProfileItemInterface.h:46
VehicleComponentProfileItemInterface::Parameters
ParameterMapInterface Parameters
typedef for the parameter map
Definition: VehicleComponentProfileItemInterface.h:48
VehicleComponentProfileItemInterface::getParameters
virtual Parameters * getParameters() const =0
Method which returns the parameter map of the vehicle component profile.
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileItemModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
VehicleComponentProfileItemModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of VehicleComponentProfileItemInterface. More...

Detailed Description

This class implements the functionality of VehicleComponentProfileItemInterface.

Definition in file VehicleComponentProfileItemModel.h.

Go to the source code of this file.

Classes

class VehicleComponentProfileItemModel
This class implements the functionality of VehicleComponentProfileItemInterface. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileItemModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
VehicleComponentProfileItemModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef VEHICLECOMPONENTPROFILEITEMMODEL_H
18 #define VEHICLECOMPONENTPROFILEITEMMODEL_H
19
20 #include "openPASS-AgentConfiguration/VehicleComponentProfileItemInterface.h"
21
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 class VehicleComponentProfileItemModel : public VehicleComponentProfileItemInterface
26 {
27
28 Q_OBJECT
29
30 public:
31 VehicleComponentProfileItemModel(QObject *parent = nullptr);
32 ~VehicleComponentProfileItemModel() override = default;
33
34 public:
35 virtual Parameters * getParameters() const override;
36
37 public:
38 virtual Name getName() const override;
39 virtual Type getType() const override;
40
41 private:
42 Parameters * const parameters;
43 };
44
45 #endif // VEHICLECOMPONENTPROFILEITEMMODEL_H
VehicleComponentProfileItemModel::getName
virtual Name getName() const override
Method which returns the name of the vehicle component profile.
Definition: VehicleComponentProfileItemModel.cpp:26
VehicleComponentProfileItemInterface.h
This class defines vehicle component profiles which contain the parameterization of a vehicle compone...
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
VehicleComponentProfileItemInterface::Type
QString Type
typedef for the type (algorithm) of the corresponding vehicle component
Definition: VehicleComponentProfileItemInterface.h:47
VehicleComponentProfileItemInterface
This class defines vehicle component profiles which contain the parameterization of a vehicle compone...
Definition: VehicleComponentProfileItemInterface.h:40
VehicleComponentProfileItemModel::getType
virtual Type getType() const override
Method which returns the type of the corresponding vehicle component.
Definition: VehicleComponentProfileItemModel.cpp:34
VehicleComponentProfileItemModel::parameters
Parameters *const parameters
the pointer to the parameter map of this profile
Definition: VehicleComponentProfileItemModel.h:42
VehicleComponentProfileItemModel::getParameters
virtual Parameters * getParameters() const override
Method which returns the parameter map of the vehicle component profile.
Definition: VehicleComponentProfileItemModel.cpp:42
VehicleComponentProfileItemInterface::Name
QString Name
typedef for the name of the profile
Definition: VehicleComponentProfileItemInterface.h:46
VehicleComponentProfileItemModel
This class implements the functionality of VehicleComponentProfileItemInterface.
Definition: VehicleComponentProfileItemModel.h:25
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileMapInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
VehicleComponentProfileMapInterface.h File Reference
Agent Configuration Plugin

This class constitutes a container class for vehicle component profiles (instances of VehicleComponentProfileItemInterface). As a key identifier the pair of the profile's name and type (corrsponding to to the implementation/algorithm of the vehicle component) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...

Detailed Description

This class constitutes a container class for vehicle component profiles (instances of VehicleComponentProfileItemInterface). As a key identifier the pair of the profile's name and type (corrsponding to to the implementation/algorithm of the vehicle component) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.

Definition in file VehicleComponentProfileMapInterface.h.

Go to the source code of this file.

Classes

class VehicleComponentProfileMapInterface
This class constitutes a container class for vehicle component profiles (instances of VehicleComponentProfileItemInterface). As a key identifier the pair of the profile's name and type (corrsponding to to the implementation/algorithm of the vehicle component) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
VehicleComponentProfileMapInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
22
23 #ifndef VEHICLECOMPONENTPROFILEMAPINTERFACE_H
24 #define VEHICLECOMPONENTPROFILEMAPINTERFACE_H
25
26 #include "openPASS-AgentConfiguration/VehicleComponentProfileItemInterface.h"
27
28 #include <QObject>
29 #include <QPair>
30 #include <QMap>
31
32 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
41 class VehicleComponentProfileMapInterface: public QObject
42 {
43
44 Q_OBJECT
45
46 public:
47 using Name = VehicleComponentProfileItemInterface::Name;
48 using Type = VehicleComponentProfileItemInterface::Type;
49 using ID = QPair<Name, Type>;
50 using Item = VehicleComponentProfileItemInterface;
51
52 public:
53 using Map = QMap<ID, Item *>;
54 using Iterator = Map::Iterator;
55 using ConstIterator = Map::ConstIterator;
56
57 public:
58 VehicleComponentProfileMapInterface(QObject * const parent = nullptr) : QObject(parent){}
59 virtual ~VehicleComponentProfileMapInterface() = default;
60
61
62 public:
63 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 virtual VehicleComponentProfileMapInterface::Iterator begin() = 0;
70
71 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 virtual VehicleComponentProfileMapInterface::ConstIterator constBegin() const = 0;
79
80 public:
81 //-----------------------------------------------------------------------------
85 //-----------------------------------------------------------------------------
86 virtual VehicleComponentProfileMapInterface::Iterator end() = 0;
87
88 //-----------------------------------------------------------------------------
93 //-----------------------------------------------------------------------------
94 virtual VehicleComponentProfileMapInterface::ConstIterator constEnd() const = 0;
95
96 public:
97 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
105 virtual bool add(VehicleComponentProfileMapInterface::ID const & id) = 0;
106
107 public:
108 //-----------------------------------------------------------------------------
117 //-----------------------------------------------------------------------------
118 virtual bool remove(VehicleComponentProfileMapInterface::ID const & id) = 0;
119
120 public:
121 //-----------------------------------------------------------------------------
130 //-----------------------------------------------------------------------------
131 virtual VehicleComponentProfileMapInterface::Item * getItem(VehicleComponentProfileMapInterface::ID const & id) const = 0;
132
133 public:
134 //-----------------------------------------------------------------------------
141 //-----------------------------------------------------------------------------
142 virtual void setID(VehicleComponentProfileMapInterface::Item * const item,
143 VehicleComponentProfileMapInterface::ID const & id) = 0;
144
145 //-----------------------------------------------------------------------------
150 //-----------------------------------------------------------------------------
151 virtual VehicleComponentProfileMapInterface::ID getID(VehicleComponentProfileMapInterface::Item * const item) const = 0;
152
153 public:
154 //-----------------------------------------------------------------------------
160 //-----------------------------------------------------------------------------
161 virtual bool contains(VehicleComponentProfileMapInterface::ID const & id) const = 0;
162
163 //-----------------------------------------------------------------------------
167 //-----------------------------------------------------------------------------
168 virtual int count() const = 0;
169
170 public:
171 //-----------------------------------------------------------------------------
173 //-----------------------------------------------------------------------------
174 virtual void clear() = 0;
175
176 public:
177 //-----------------------------------------------------------------------------
181 //-----------------------------------------------------------------------------
182 virtual QList<ID> keys() const =0;
183
184 //-----------------------------------------------------------------------------
188 //-----------------------------------------------------------------------------
189 virtual QList<Item*> values() const =0;
190 };
191
192 #endif // VEHICLECOMPONENTPROFILEMAPINTERFACE_H
VehicleComponentProfileMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: VehicleComponentProfileMapInterface.h:54
VehicleComponentProfileMapInterface::begin
virtual VehicleComponentProfileMapInterface::Iterator begin()=0
Gets an iterator pointing to the first vehicle component profile in the map.
VehicleComponentProfileMapInterface::keys
virtual QList< ID > keys() const =0
Method which returns the list of all vehicle component profile Ids in the map.
VehicleComponentProfileMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all vehicle component profiles in the map.
VehicleComponentProfileMapInterface::Type
VehicleComponentProfileItemInterface::Type Type
typedef for the sensor type (i.e. its algorithm/implementation)
Definition: VehicleComponentProfileMapInterface.h:48
VehicleComponentProfileItemInterface.h
This class defines vehicle component profiles which contain the parameterization of a vehicle compone...
VehicleComponentProfileMapInterface::end
virtual VehicleComponentProfileMapInterface::Iterator end()=0
Gets an iterator pointing to the end of the map after the last vehicle component profile.
VehicleComponentProfileMapInterface::constBegin
virtual VehicleComponentProfileMapInterface::ConstIterator constBegin() const =0
Gets an iterator pointing to the first vehicle component profile in the map (use for read-only since ...
VehicleComponentProfileMapInterface::count
virtual int count() const =0
Method which returns the number of vehicle component profiles in the map.
VehicleComponentProfileMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: VehicleComponentProfileMapInterface.h:55
VehicleComponentProfileMapInterface::getItem
virtual VehicleComponentProfileMapInterface::Item * getItem(VehicleComponentProfileMapInterface::ID const &id) const =0
Method which returns a pointer to the vehicle component profile with the given Id. If the map does not contain a vehicle component profile with this Id, nullptr is returned.
VehicleComponentProfileItemInterface::Type
QString Type
typedef for the type (algorithm) of the corresponding vehicle component
Definition: VehicleComponentProfileItemInterface.h:47
VehicleComponentProfileMapInterface::Name
VehicleComponentProfileItemInterface::Name Name
typedef for the vehicle component profiles name
Definition: VehicleComponentProfileMapInterface.h:47
VehicleComponentProfileItemInterface
This class defines vehicle component profiles which contain the parameterization of a vehicle compone...
Definition: VehicleComponentProfileItemInterface.h:40
VehicleComponentProfileMapInterface::contains
virtual bool contains(VehicleComponentProfileMapInterface::ID const &id) const =0
Method wich checks whether the map contains a vehicle component profile with the given Id...
VehicleComponentProfileMapInterface::getID
virtual VehicleComponentProfileMapInterface::ID getID(VehicleComponentProfileMapInterface::Item *const item) const =0
Method wich returns the Id of the given vehicle component profile.
VehicleComponentProfileMapInterface::add
virtual bool add(VehicleComponentProfileMapInterface::ID const &id)=0
Method which creates a new vehicle component profile (instance of VehicleComponentProfileItemInterfac...
VehicleComponentProfileMapInterface::ID
QPair< Name, Type > ID
typedef for the pair of name and type used as an Id
Definition: VehicleComponentProfileMapInterface.h:49
VehicleComponentProfileMapInterface::constEnd
virtual VehicleComponentProfileMapInterface::ConstIterator constEnd() const =0
Gets an iterator pointing at the end of the map after the last vehicle component profile (use for rea...
VehicleComponentProfileMapInterface::setID
virtual void setID(VehicleComponentProfileMapInterface::Item *const item, VehicleComponentProfileMapInterface::ID const &id)=0
Method wich changes the Id of the given vehicle component profile to the one passed as second argumen...
VehicleComponentProfileItemInterface::Name
QString Name
typedef for the name of the profile
Definition: VehicleComponentProfileItemInterface.h:46
VehicleComponentProfileMapInterface
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
Definition: VehicleComponentProfileMapInterface.h:41
VehicleComponentProfileMapInterface::clear
virtual void clear()=0
Method which deletes all registered vehicle component profiles and clears the map.
VehicleComponentProfileMapInterface::Map
QMap< ID, Item * > Map
typedef for the map, i.e. the container object of vehicle component profiles
Definition: VehicleComponentProfileMapInterface.h:53
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileMapModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
VehicleComponentProfileMapModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of VehicleComponentProfileMapInterface. More...

Detailed Description

This class implements the functionality of VehicleComponentProfileMapInterface.

Definition in file VehicleComponentProfileMapModel.h.

Go to the source code of this file.

Classes

class VehicleComponentProfileMapModel
This class implements the functionality of VehicleComponentProfileMapInterface. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileMapModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
VehicleComponentProfileMapModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17
18 #ifndef VEHICLECOMPONENTPROFILEMAPMODEL_H
19 #define VEHICLECOMPONENTPROFILEMAPMODEL_H
20
21 #include "openPASS-AgentConfiguration/VehicleComponentProfileMapInterface.h"
22
23 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
26 class VehicleComponentProfileMapModel : public VehicleComponentProfileMapInterface
27 {
28 Q_OBJECT
29
30 public:
31 VehicleComponentProfileMapModel(QObject *parent = nullptr);
32 ~VehicleComponentProfileMapModel() = default;
33
34 public:
35 virtual VehicleComponentProfileMapInterface::Iterator begin() override;
36 virtual VehicleComponentProfileMapInterface::ConstIterator constBegin() const override;
37
38 public:
39 virtual VehicleComponentProfileMapInterface::Iterator end() override;
40 virtual VehicleComponentProfileMapInterface::ConstIterator constEnd() const override;
41
42 public:
43 virtual bool add(VehicleComponentProfileMapInterface::ID const & id) override;
44
45 public:
46 virtual bool remove(VehicleComponentProfileMapInterface::ID const & id) override;
47
48 public:
49 virtual VehicleComponentProfileMapInterface::Item * getItem(VehicleComponentProfileMapInterface::ID const & id) const override;
50
51 public:
52 virtual void setID(VehicleComponentProfileMapInterface::Item * const item,
53 VehicleComponentProfileMapInterface::ID const & id) override;
54
55 virtual VehicleComponentProfileMapInterface::ID getID(VehicleComponentProfileMapInterface::Item * const item) const override;
56
57
58 public:
59 virtual bool contains(VehicleComponentProfileMapInterface::ID const & id) const override;
60 virtual int count() const override;
61
62 public:
63 virtual void clear() override;
64
65 public:
66 virtual QList<ID> keys() const override;
67 virtual QList<Item*> values() const override;
68
69 private:
70 VehicleComponentProfileMapInterface::Map componentProfiles;
71 };
72
73 #endif // VEHICLECOMPONENTPROFILEMAPMODEL_H
VehicleComponentProfileMapModel::clear
virtual void clear() override
Method which deletes all registered vehicle component profiles and clears the map.
Definition: VehicleComponentProfileMapModel.cpp:110
VehicleComponentProfileMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: VehicleComponentProfileMapInterface.h:54
VehicleComponentProfileMapModel::end
virtual VehicleComponentProfileMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last vehicle component profile.
Definition: VehicleComponentProfileMapModel.cpp:32
VehicleComponentProfileMapModel::getItem
virtual VehicleComponentProfileMapInterface::Item * getItem(VehicleComponentProfileMapInterface::ID const &id) const override
Method which returns a pointer to the vehicle component profile with the given Id. If the map does not contain a vehicle component profile with this Id, nullptr is returned.
Definition: VehicleComponentProfileMapModel.cpp:65
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70
VehicleComponentProfileMapModel::constEnd
virtual VehicleComponentProfileMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last vehicle component profile (use for rea...
Definition: VehicleComponentProfileMapModel.cpp:37
VehicleComponentProfileMapInterface.h
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
VehicleComponentProfileMapModel::values
virtual QList< Item * > values() const override
Method which returns a list of pointers to all vehicle component profiles in the map.
Definition: VehicleComponentProfileMapModel.cpp:100
VehicleComponentProfileMapModel::constBegin
virtual VehicleComponentProfileMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first vehicle component profile in the map (use for read-only since ...
Definition: VehicleComponentProfileMapModel.cpp:27
VehicleComponentProfileMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: VehicleComponentProfileMapInterface.h:55
VehicleComponentProfileMapModel::setID
virtual void setID(VehicleComponentProfileMapInterface::Item *const item, VehicleComponentProfileMapInterface::ID const &id) override
Method wich changes the Id of the given vehicle component profile to the one passed as second argumen...
Definition: VehicleComponentProfileMapModel.cpp:79
VehicleComponentProfileMapModel::contains
virtual bool contains(VehicleComponentProfileMapInterface::ID const &id) const override
Method wich checks whether the map contains a vehicle component profile with the given Id...
Definition: VehicleComponentProfileMapModel.cpp:90
VehicleComponentProfileItemInterface
This class defines vehicle component profiles which contain the parameterization of a vehicle compone...
Definition: VehicleComponentProfileItemInterface.h:40
VehicleComponentProfileMapModel
This class implements the functionality of VehicleComponentProfileMapInterface.
Definition: VehicleComponentProfileMapModel.h:26
VehicleComponentProfileMapInterface::ID
QPair< Name, Type > ID
typedef for the pair of name and type used as an Id
Definition: VehicleComponentProfileMapInterface.h:49
VehicleComponentProfileMapModel::begin
virtual VehicleComponentProfileMapInterface::Iterator begin() override
Gets an iterator pointing to the first vehicle component profile in the map.
Definition: VehicleComponentProfileMapModel.cpp:22
VehicleComponentProfileMapModel::keys
virtual QList< ID > keys() const override
Method which returns the list of all vehicle component profile Ids in the map.
Definition: VehicleComponentProfileMapModel.cpp:95
VehicleComponentProfileMapModel::count
virtual int count() const override
Method which returns the number of vehicle component profiles in the map.
Definition: VehicleComponentProfileMapModel.cpp:105
VehicleComponentProfileMapInterface
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
Definition: VehicleComponentProfileMapInterface.h:41
VehicleComponentProfileMapModel::add
virtual bool add(VehicleComponentProfileMapInterface::ID const &id) override
Method which creates a new vehicle component profile (instance of VehicleComponentProfileItemInterfac...
Definition: VehicleComponentProfileMapModel.cpp:43
VehicleComponentProfileMapModel::getID
virtual VehicleComponentProfileMapInterface::ID getID(VehicleComponentProfileMapInterface::Item *const item) const override
Method wich returns the Id of the given vehicle component profile.
Definition: VehicleComponentProfileMapModel.cpp:74
VehicleComponentProfileMapInterface::Map
QMap< ID, Item * > Map
typedef for the map, i.e. the container object of vehicle component profiles
Definition: VehicleComponentProfileMapInterface.h:53
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
VehicleProfileItemInterface.h File Reference
Agent Configuration Plugin

This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the simulation. More...

Detailed Description

This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the simulation.

This particularly comprises the vehicle model and optional driver assistance systems (ADAS) and sensors. In the profile catalogue (see documentation of the simulation core), ADAS and sensors are defined by the XML elements <components> and <sensors>, respectively. In this catalogue, it is also defined how vehicle components (ADAS) are connected to sensors via the so-called <sensorLinks> elements. Furthermore, the (stochastic) parameterizations of sensors and vehicle components is established via sensor profiles and vehicle component profiles, respectively. However, the GUI offers the System Editor Plugin where these pieces of information on ADAS and sensors are edited by the user. Therefore, a system config XML file exported from the System Editor Plugin is referenced here in order to extract this information. While for the GUI, the reference to specific systems of a system config XML file is sufficient, the profile catalogue needs these information to be transferred to the corresponding profiles which are, thus, also part of this class. Note, that a special feature OpenPASS that ADAS and their parameterization (profiles) can be equipped stochastically. Hence, the systems defined in the system config are assigned to the corresponding probabilities.

Definition in file VehicleProfileItemInterface.h.

Go to the source code of this file.

Classes

class VehicleProfileItemInterface
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the simulation. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
VehicleProfileItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
37
38 #ifndef VEHICLEPROFILEITEMINTERFACE_H
39 #define VEHICLEPROFILEITEMINTERFACE_H
40
41 #include "openPASS-AgentConfiguration/VehicleComponentMapInterface.h"
42 #include "openPASS-AgentConfiguration/SensorMapInterface.h"
43
44 #include <QObject>
45 #include <QMap>
46
47 //-----------------------------------------------------------------------------
70 //-----------------------------------------------------------------------------
71 class VehicleProfileItemInterface : public QObject
72 {
73 Q_OBJECT
74
75 public:
76 using Name = QString;
77 using Probability = double;
78
79 using Model = QString;
80 using ModelCatalogue = QString;
81
82 using SystemConfig = QString;
83 using SystemID = unsigned int;
84 using SystemTitle = QString;
85 using AlgoType = QString;
86
87 using System = QPair <SystemID , SystemTitle>;
88 using Systems = QMap <System, Probability>;
89 using SystemProfiles = QMap <AlgoType, Systems*>;
90
91 public:
92 using VehicleComponents = VehicleComponentMapInterface;
93 using Sensors = SensorMapInterface;
94
95 public:
96 VehicleProfileItemInterface(QObject * const parent = nullptr) : QObject(parent) {}
97 virtual ~VehicleProfileItemInterface() = default;
98
99 public:
100 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
105 virtual Name getName() const = 0;
106
107 public:
108 //-----------------------------------------------------------------------------
113 //-----------------------------------------------------------------------------
114 virtual ModelCatalogue getModelCatalogue() const = 0;
115
116 //-----------------------------------------------------------------------------
121 //-----------------------------------------------------------------------------
122 virtual void setModelCatalogue(ModelCatalogue const & _modelCatalogue) = 0;
123
124 public:
125 //-----------------------------------------------------------------------------
129 //-----------------------------------------------------------------------------
130 virtual Model getModel() const = 0;
131
132 //-----------------------------------------------------------------------------
136 //-----------------------------------------------------------------------------
137 virtual void setModel(Model const & _model) = 0;
138
139 public:
140 //-----------------------------------------------------------------------------
144 //-----------------------------------------------------------------------------
145 virtual SystemConfig getSystemConfig() const = 0;
146
147 //-----------------------------------------------------------------------------
153 //-----------------------------------------------------------------------------
154 virtual void setSystemConfig(SystemConfig const & _systemConfig) = 0;
155
156 public:
157 //-----------------------------------------------------------------------------
164 //-----------------------------------------------------------------------------
165 virtual SystemProfiles * getSystemProfiles() const =0;
166
167 public:
168 //-----------------------------------------------------------------------------
175 //-----------------------------------------------------------------------------
176 virtual Systems * getSystems(AlgoType const &_type) const = 0;
177
178 public:
179 //-----------------------------------------------------------------------------
189 //-----------------------------------------------------------------------------
190 virtual VehicleComponents * getVehicleComponents() const = 0;
191
192 //-----------------------------------------------------------------------------
201 //-----------------------------------------------------------------------------
202 virtual Sensors * getSensors() const = 0;
203
204 };
205
206 #endif // VEHICLEPROFILEITEMINTERFACE_H
VehicleProfileItemInterface::getSystemConfig
virtual SystemConfig getSystemConfig() const =0
Method which returns the name of the current system config XML file.
VehicleProfileItemInterface::System
QPair< SystemID, SystemTitle > System
typedef for a system (here, the system Id and title are sufficient)
Definition: VehicleProfileItemInterface.h:87
VehicleProfileItemInterface::Name
QString Name
typedef for the name of the vehicle profile
Definition: VehicleProfileItemInterface.h:76
VehicleProfileItemInterface::ModelCatalogue
QString ModelCatalogue
typedef for the vehicle model catalogue
Definition: VehicleProfileItemInterface.h:80
VehicleProfileItemInterface::SystemConfig
QString SystemConfig
typedef for the system config XML file
Definition: VehicleProfileItemInterface.h:82
VehicleProfileItemInterface
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
Definition: VehicleProfileItemInterface.h:71
VehicleProfileItemInterface::Probability
double Probability
typedef for a probability
Definition: VehicleProfileItemInterface.h:77
VehicleProfileItemInterface::Model
QString Model
typedef for the vehicle model
Definition: VehicleProfileItemInterface.h:79
VehicleProfileItemInterface::VehicleComponents
VehicleComponentMapInterface VehicleComponents
typedef for the vehicle component (-> to be exported from systems in system config) ...
Definition: VehicleProfileItemInterface.h:92
VehicleProfileItemInterface::setModelCatalogue
virtual void setModelCatalogue(ModelCatalogue const &_modelCatalogue)=0
Method which sets the current vehicle model catalogue to the one passed as an argument.
VehicleProfileItemInterface::getVehicleComponents
virtual VehicleComponents * getVehicleComponents() const =0
Method which returns the map of vehicle components, i.e. the container class for instances of the Veh...
SensorMapInterface.h
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are ...
VehicleComponentMapInterface.h
This class constitutes a container class for vehicle component data (instances of VehicleComponentIte...
VehicleProfileItemInterface::getModelCatalogue
virtual ModelCatalogue getModelCatalogue() const =0
Method which returns the current vehicle model catalogue.
VehicleProfileItemInterface::getSystemProfiles
virtual SystemProfiles * getSystemProfiles() const =0
Method which returns all mappings of systems to probabilities sorted by their algorithm type...
VehicleProfileItemInterface::setModel
virtual void setModel(Model const &_model)=0
Method which sets the current vehicle model to the one passed as an argument.
VehicleComponentMapInterface
This class constitutes a container class for vehicle component data (instances of VehicleComponentIte...
Definition: VehicleComponentMapInterface.h:38
VehicleProfileItemInterface::Sensors
SensorMapInterface Sensors
typedef for sensors (-> to be exported from systems in system config)
Definition: VehicleProfileItemInterface.h:93
VehicleProfileItemInterface::getSystems
virtual Systems * getSystems(AlgoType const &_type) const =0
Method which returns the mapping of all systems of the given algorithm type to their equipment probab...
VehicleProfileItemInterface::getModel
virtual Model getModel() const =0
Method which returns the currently selected vehicle model.
VehicleProfileItemInterface::Systems
QMap< System, Probability > Systems
typedef for the map assigning probabilities to systems
Definition: VehicleProfileItemInterface.h:88
VehicleProfileItemInterface::getSensors
virtual Sensors * getSensors() const =0
Method which returns the map of sensors, i.e. the container class for instances of the SensorItemInte...
VehicleProfileItemInterface::AlgoType
QString AlgoType
typedef for the algorithm type (in fact, the implementation of the algorithm)
Definition: VehicleProfileItemInterface.h:85
VehicleProfileItemInterface::SystemTitle
QString SystemTitle
typedef for the system title
Definition: VehicleProfileItemInterface.h:84
VehicleProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of the vehicle profile.
SensorMapInterface
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are ...
Definition: SensorMapInterface.h:36
VehicleProfileItemInterface::setSystemConfig
virtual void setSystemConfig(SystemConfig const &_systemConfig)=0
Method which sets the current system config XML file to the one passed as an argument.
VehicleProfileItemInterface::SystemID
unsigned int SystemID
typedef for a system Id (valid in corresponding system config XML file)
Definition: VehicleProfileItemInterface.h:83
VehicleProfileItemInterface::SystemProfiles
QMap< AlgoType, Systems * > SystemProfiles
typedef for the map sorting the probability-assigned systems by the algorithm type ...
Definition: VehicleProfileItemInterface.h:89
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileItemModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
VehicleProfileItemModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of VehicleProfileItemInterface. More...

Detailed Description

This class implements the functionality of VehicleProfileItemInterface.

Definition in file VehicleProfileItemModel.h.

Go to the source code of this file.

Classes

class VehicleProfileItemModel
This class implements the functionality of VehicleProfileItemInterface. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileItemModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
VehicleProfileItemModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef VEHICLEPROFILEITEMMODEL_H
18 #define VEHICLEPROFILEITEMMODEL_H
19
20 #include "openPASS-AgentConfiguration/VehicleProfileItemInterface.h"
21
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 class VehicleProfileItemModel : public VehicleProfileItemInterface
26 {
27
28 Q_OBJECT
29
30 public:
31 VehicleProfileItemModel(QObject *parent = nullptr);
32 VehicleProfileItemModel(VehicleProfileItemInterface const * const vehicle, QObject *parent = nullptr);
33 virtual ~VehicleProfileItemModel() override;
34
35 public:
36 virtual Name getName() const override;
37
38 public:
39 virtual ModelCatalogue getModelCatalogue() const override;
40 virtual void setModelCatalogue(ModelCatalogue const & _modelCatalogue) override;
41
42 public:
43 virtual Model getModel() const override;
44 virtual void setModel(Model const & _model) override;
45
46 public:
47 virtual SystemConfig getSystemConfig() const override;
48 virtual void setSystemConfig( SystemConfig const & _systemConfig) override;
49
50 public:
51 virtual SystemProfiles * getSystemProfiles() const override;
52
53 public:
54 virtual Systems * getSystems(AlgoType const &_type) const override;
55
56
57 public:
58 virtual VehicleComponents * getVehicleComponents() const override;
59 virtual Sensors * getSensors() const override;
60
61
62 private:
63 ModelCatalogue modelCatalogue;
64 Model model;
65 SystemConfig systemConfig;
66 SystemProfiles * systemProfiles;
67
68 private:
69 VehicleComponents * const components;
70 Sensors * const sensors;
71 };
72
73 #endif // VEHICLEPROFILEITEMMODEL_H
VehicleProfileItemModel::setModelCatalogue
virtual void setModelCatalogue(ModelCatalogue const &_modelCatalogue) override
Method which sets the current vehicle model catalogue to the one passed as an argument.
Definition: VehicleProfileItemModel.cpp:79
VehicleProfileItemModel::getModelCatalogue
virtual ModelCatalogue getModelCatalogue() const override
Method which returns the current vehicle model catalogue.
Definition: VehicleProfileItemModel.cpp:74
VehicleProfileItemInterface::Name
QString Name
typedef for the name of the vehicle profile
Definition: VehicleProfileItemInterface.h:76
VehicleProfileItemInterface::ModelCatalogue
QString ModelCatalogue
typedef for the vehicle model catalogue
Definition: VehicleProfileItemInterface.h:80
VehicleProfileItemInterface::SystemConfig
QString SystemConfig
typedef for the system config XML file
Definition: VehicleProfileItemInterface.h:82
VehicleProfileItemModel::setModel
virtual void setModel(Model const &_model) override
Method which sets the current vehicle model to the one passed as an argument.
Definition: VehicleProfileItemModel.cpp:69
VehicleProfileItemModel::getSystems
virtual Systems * getSystems(AlgoType const &_type) const override
Method which returns the mapping of all systems of the given algorithm type to their equipment probab...
Definition: VehicleProfileItemModel.cpp:99
VehicleProfileItemModel::getSystemConfig
virtual SystemConfig getSystemConfig() const override
Method which returns the name of the current system config XML file.
Definition: VehicleProfileItemModel.cpp:84
VehicleProfileItemModel::systemConfig
SystemConfig systemConfig
the string object storing the selected system config file
Definition: VehicleProfileItemModel.h:65
VehicleProfileItemInterface
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
Definition: VehicleProfileItemInterface.h:71
VehicleProfileItemInterface::Model
QString Model
typedef for the vehicle model
Definition: VehicleProfileItemInterface.h:79
VehicleProfileItemInterface::VehicleComponents
VehicleComponentMapInterface VehicleComponents
typedef for the vehicle component (-> to be exported from systems in system config) ...
Definition: VehicleProfileItemInterface.h:92
VehicleProfileItemModel::getSystemProfiles
virtual SystemProfiles * getSystemProfiles() const override
Method which returns all mappings of systems to probabilities sorted by their algorithm type...
Definition: VehicleProfileItemModel.cpp:94
VehicleProfileItemModel::setSystemConfig
virtual void setSystemConfig(SystemConfig const &_systemConfig) override
Method which sets the current system config XML file to the one passed as an argument.
Definition: VehicleProfileItemModel.cpp:89
VehicleProfileItemModel::getName
virtual Name getName() const override
Method which returns the name of the vehicle profile.
Definition: VehicleProfileItemModel.cpp:57
VehicleProfileItemModel::getSensors
virtual Sensors * getSensors() const override
Method which returns the map of sensors, i.e. the container class for instances of the SensorItemInte...
Definition: VehicleProfileItemModel.cpp:111
VehicleProfileItemModel::sensors
Sensors *const sensors
the map containing all sensor data
Definition: VehicleProfileItemModel.h:70
VehicleProfileItemModel::getVehicleComponents
virtual VehicleComponents * getVehicleComponents() const override
Method which returns the map of vehicle components, i.e. the container class for instances of the Veh...
Definition: VehicleProfileItemModel.cpp:106
VehicleProfileItemModel::getModel
virtual Model getModel() const override
Method which returns the currently selected vehicle model.
Definition: VehicleProfileItemModel.cpp:64
VehicleProfileItemInterface::Systems
QMap< System, Probability > Systems
typedef for the map assigning probabilities to systems
Definition: VehicleProfileItemInterface.h:88
VehicleProfileItemModel::components
VehicleComponents *const components
the map containing all vehicle component data
Definition: VehicleProfileItemModel.h:69
VehicleProfileItemModel::model
Model model
the string object storing the current vehicle model
Definition: VehicleProfileItemModel.h:64
VehicleProfileItemModel
This class implements the functionality of VehicleProfileItemInterface.
Definition: VehicleProfileItemModel.h:25
VehicleProfileItemInterface::AlgoType
QString AlgoType
typedef for the algorithm type (in fact, the implementation of the algorithm)
Definition: VehicleProfileItemInterface.h:85
VehicleProfileItemModel::modelCatalogue
ModelCatalogue modelCatalogue
the string object storing the selected vehicle model catalogue
Definition: VehicleProfileItemModel.h:63
SensorMapInterface
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are ...
Definition: SensorMapInterface.h:36
VehicleProfileItemInterface.h
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
VehicleProfileItemInterface::SystemProfiles
QMap< AlgoType, Systems * > SystemProfiles
typedef for the map sorting the probability-assigned systems by the algorithm type ...
Definition: VehicleProfileItemInterface.h:89
VehicleProfileItemModel::systemProfiles
SystemProfiles * systemProfiles
the map registering mappings of systems onto probabilities using the algorithm type as a key identifi...
Definition: VehicleProfileItemModel.h:66
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileMapInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
Classes
VehicleProfileMapInterface.h File Reference
Agent Configuration Plugin

This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map. More...

Detailed Description

This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map.

Definition in file VehicleProfileMapInterface.h.

Go to the source code of this file.

Classes

class VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
VehicleProfileMapInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
21
22
23 #ifndef VEHICLEPROFILEMAPINTERFACE_H
24 #define VEHICLEPROFILEMAPINTERFACE_H
25
26 #include "openPASS-AgentConfiguration/VehicleProfileItemInterface.h"
27
28 #include <QObject>
29 #include <QMap>
30
31 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
39 class VehicleProfileMapInterface : public QObject
40 {
41 Q_OBJECT
42
43 public:
44 using Name = VehicleProfileItemInterface::Name;
45 using Item = VehicleProfileItemInterface;
46
47 public:
48 using Map = QMap<Name, Item *>;
49 using Iterator = Map::Iterator;
50 using ConstIterator = Map::ConstIterator;
51
52 public:
53 explicit VehicleProfileMapInterface(QObject * const parent = nullptr) : QObject(parent){}
54 virtual ~VehicleProfileMapInterface() = default;
55
56
57 Q_SIGNALS:
58 //-----------------------------------------------------------------------------
63 //-----------------------------------------------------------------------------
64 void removed(Name const & name);
65
66 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 void added(Name const & name);
73
74 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
81 void modifiedName(Name const & oldName, Name const & newName);
82
83 public:
84 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 virtual VehicleProfileMapInterface::Iterator begin() = 0;
91
92 //-----------------------------------------------------------------------------
98 //-----------------------------------------------------------------------------
99 virtual VehicleProfileMapInterface::ConstIterator constBegin() const = 0;
100
101 public:
102 //-----------------------------------------------------------------------------
106 //-----------------------------------------------------------------------------
107 virtual VehicleProfileMapInterface::Iterator end() = 0;
108
109 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------
115 virtual VehicleProfileMapInterface::ConstIterator constEnd() const = 0;
116
117 public:
118 //-----------------------------------------------------------------------------
125 //-----------------------------------------------------------------------------
126 virtual bool add(VehicleProfileMapInterface::Name const & name) = 0;
127
128 //-----------------------------------------------------------------------------
136 //-----------------------------------------------------------------------------
137 virtual bool add(VehicleProfileMapInterface::Name const & name,
138 VehicleProfileMapInterface::Item const * const item) = 0;
139
140 public:
141 //-----------------------------------------------------------------------------
150 //-----------------------------------------------------------------------------
151 virtual bool remove(VehicleProfileMapInterface::Name const & name) = 0;
152
153 public:
154 //-----------------------------------------------------------------------------
163 //-----------------------------------------------------------------------------
164 virtual VehicleProfileMapInterface::Item * getItem(VehicleProfileMapInterface::Name const & name) const = 0;
165
166 public:
167 //-----------------------------------------------------------------------------
174 //-----------------------------------------------------------------------------
175 virtual void setName(VehicleProfileMapInterface::Item * const item,
176 VehicleProfileMapInterface::Name const & name) = 0;
177
178 //-----------------------------------------------------------------------------
183 //-----------------------------------------------------------------------------
184 virtual VehicleProfileMapInterface::Name getName(VehicleProfileMapInterface::Item * const item) const = 0;
185
186 public:
187 //-----------------------------------------------------------------------------
193 //-----------------------------------------------------------------------------
194 virtual bool contains (VehicleProfileMapInterface::Name const & name) const =0;
195
196 //-----------------------------------------------------------------------------
200 //-----------------------------------------------------------------------------
201 virtual int count() const =0;
202
203 public:
204 //-----------------------------------------------------------------------------
208 //-----------------------------------------------------------------------------
209 virtual QStringList keys() const =0;
210
211 //-----------------------------------------------------------------------------
215 //-----------------------------------------------------------------------------
216 virtual QList<Item*> values() const =0;
217 };
218
219
220 #endif // VEHICLEPROFILEMAPINTERFACE_H
VehicleProfileMapInterface::setName
virtual void setName(VehicleProfileMapInterface::Item *const item, VehicleProfileMapInterface::Name const &name)=0
Method wich changes the name of the given vehicle profile to the one passed as second argument...
VehicleProfileItemInterface::Name
QString Name
typedef for the name of the vehicle profile
Definition: VehicleProfileItemInterface.h:76
VehicleProfileMapInterface::begin
virtual VehicleProfileMapInterface::Iterator begin()=0
Gets an iterator pointing to the first vehicle profile in the map.
VehicleProfileMapInterface::contains
virtual bool contains(VehicleProfileMapInterface::Name const &name) const =0
Method wich checks whether the map contains a vehicle profile with the given name.
VehicleProfileMapInterface::added
void added(Name const &name)
Signal emitted when a vehicle profile has been added to the map. Transmits the name of the correpondi...
VehicleProfileItemInterface
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
Definition: VehicleProfileItemInterface.h:71
VehicleProfileMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: VehicleProfileMapInterface.h:50
VehicleProfileMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all vehicle profile names in the map.
VehicleProfileMapInterface::Name
VehicleProfileItemInterface::Name Name
typedef for vehicle profile names (= key identifiers of the map)
Definition: VehicleProfileMapInterface.h:44
VehicleProfileMapInterface::count
virtual int count() const =0
Method which returns the number of vehicle profiles in the map.
VehicleProfileMapInterface::Map
QMap< Name, Item * > Map
typedef for the map, i.e. the container object of vehicle profiles
Definition: VehicleProfileMapInterface.h:48
VehicleProfileMapInterface::modifiedName
void modifiedName(Name const &oldName, Name const &newName)
Signal emitted when the name of the vehicle profile has been changed. Transmits both, the new and old names of the profile.
VehicleProfileMapInterface::getItem
virtual VehicleProfileMapInterface::Item * getItem(VehicleProfileMapInterface::Name const &name) const =0
Method which returns a pointer to the vehicle profile with the given name. If the map does not contai...
VehicleProfileMapInterface::add
virtual bool add(VehicleProfileMapInterface::Name const &name)=0
Method which creates a new vehicle profile (instance of VehicleProfileItemInterface) and adds it to t...
VehicleProfileMapInterface::constEnd
virtual VehicleProfileMapInterface::ConstIterator constEnd() const =0
Gets an iterator pointing at the end of the map after the last vehicle profile (use for read-only)...
VehicleProfileMapInterface::constBegin
virtual VehicleProfileMapInterface::ConstIterator constBegin() const =0
Gets an iterator pointing to the first vehicle profile in the map (use for read-only since pointing a...
VehicleProfileMapInterface::removed
void removed(Name const &name)
Signal emitted when a vehicle profile has been removed from the map. Transmits the name of the correp...
VehicleProfileMapInterface::end
virtual VehicleProfileMapInterface::Iterator end()=0
Gets an iterator pointing to the end of the map after the last vehicle profile.
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
VehicleProfileMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: VehicleProfileMapInterface.h:49
VehicleProfileMapInterface::getName
virtual VehicleProfileMapInterface::Name getName(VehicleProfileMapInterface::Item *const item) const =0
Method wich returns the name of the given vehicle profile.
VehicleProfileItemInterface.h
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
VehicleProfileMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all vehicle profiles in the map.
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileMapModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Classes
VehicleProfileMapModel.h File Reference
Agent Configuration Plugin

This class implements the functionality of VehicleProfileMapInterface. More...

Detailed Description

This class implements the functionality of VehicleProfileMapInterface.

Definition in file VehicleProfileMapModel.h.

Go to the source code of this file.

Classes

class VehicleProfileMapModel
This class implements the functionality of VehicleProfileMapInterface. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileMapModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
VehicleProfileMapModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef VEHICLEPROFILEMAPMODEL_H
18 #define VEHICLEPROFILEMAPMODEL_H
19
20 #include "openPASS-AgentConfiguration/VehicleProfileMapInterface.h"
21
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
25 class VehicleProfileMapModel : public VehicleProfileMapInterface
26 {
27 Q_OBJECT
28 public:
29 explicit VehicleProfileMapModel(QObject *parent = nullptr);
30 virtual ~VehicleProfileMapModel() override = default;
31
32 public:
33 virtual VehicleProfileMapInterface::Iterator begin() override;
34 virtual VehicleProfileMapInterface::ConstIterator constBegin() const override;
35
36 public:
37 virtual VehicleProfileMapInterface::Iterator end()override;
38 virtual VehicleProfileMapInterface::ConstIterator constEnd() const override;
39
40 public:
41 virtual bool add(VehicleProfileMapInterface::Name const & name) override;
42 virtual bool add(VehicleProfileMapInterface::Name const & name,
43 VehicleProfileMapInterface::Item const * const item) override;
44
45 public:
46 virtual bool remove(VehicleProfileMapInterface::Name const & name) override;
47
48 public:
49 virtual VehicleProfileMapInterface::Item * getItem(VehicleProfileMapInterface::Name const & name) const override;
50
51 public:
52 virtual void setName(VehicleProfileMapInterface::Item * const item,
53 VehicleProfileMapInterface::Name const & name) override;
54
55 virtual VehicleProfileMapInterface::Name getName(VehicleProfileMapInterface::Item * const item) const override;
56
57 public:
58 virtual bool contains (VehicleProfileMapInterface::Name const & name) const override;
59 virtual int count() const override;
60
61 public:
62 virtual QStringList keys() const override;
63 virtual QList<Item*> values() const override;
64
65 private:
66 VehicleProfileMapInterface::Map profiles;
67 };
68
69 #endif // VEHICLEPROFILEMAPMODEL_H
VehicleProfileMapModel::constEnd
virtual VehicleProfileMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last vehicle profile (use for read-only)...
Definition: VehicleProfileMapModel.cpp:36
VehicleProfileMapModel::count
virtual int count() const override
Method which returns the number of vehicle profiles in the map.
Definition: VehicleProfileMapModel.cpp:123
VehicleProfileMapModel::getItem
virtual VehicleProfileMapInterface::Item * getItem(VehicleProfileMapInterface::Name const &name) const override
Method which returns a pointer to the vehicle profile with the given name. If the map does not contai...
Definition: VehicleProfileMapModel.cpp:79
VehicleProfileMapModel::values
virtual QList< Item * > values() const override
Method which returns a list of pointers to all vehicle profiles in the map.
Definition: VehicleProfileMapModel.cpp:118
VehicleProfileItemInterface
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
Definition: VehicleProfileItemInterface.h:71
VehicleProfileMapModel::getName
virtual VehicleProfileMapInterface::Name getName(VehicleProfileMapInterface::Item *const item) const override
Method wich returns the name of the given vehicle profile.
Definition: VehicleProfileMapModel.cpp:90
VehicleProfileMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: VehicleProfileMapInterface.h:50
VehicleProfileMapModel::keys
virtual QStringList keys() const override
Method which returns the (string) list of all vehicle profile names in the map.
Definition: VehicleProfileMapModel.cpp:113
VehicleProfileMapInterface::Name
VehicleProfileItemInterface::Name Name
typedef for vehicle profile names (= key identifiers of the map)
Definition: VehicleProfileMapInterface.h:44
VehicleProfileMapModel::contains
virtual bool contains(VehicleProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a vehicle profile with the given name.
Definition: VehicleProfileMapModel.cpp:108
VehicleProfileMapModel::add
virtual bool add(VehicleProfileMapInterface::Name const &name) override
Method which creates a new vehicle profile (instance of VehicleProfileItemInterface) and adds it to t...
Definition: VehicleProfileMapModel.cpp:42
VehicleProfileMapInterface::Map
QMap< Name, Item * > Map
typedef for the map, i.e. the container object of vehicle profiles
Definition: VehicleProfileMapInterface.h:48
VehicleProfileMapModel
This class implements the functionality of VehicleProfileMapInterface.
Definition: VehicleProfileMapModel.h:25
VehicleProfileMapModel::constBegin
virtual VehicleProfileMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first vehicle profile in the map (use for read-only since pointing a...
Definition: VehicleProfileMapModel.cpp:26
VehicleProfileMapInterface.h
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
VehicleProfileMapModel::begin
virtual VehicleProfileMapInterface::Iterator begin() override
Gets an iterator pointing to the first vehicle profile in the map.
Definition: VehicleProfileMapModel.cpp:21
VehicleProfileMapModel::setName
virtual void setName(VehicleProfileMapInterface::Item *const item, VehicleProfileMapInterface::Name const &name) override
Method wich changes the name of the given vehicle profile to the one passed as second argument...
Definition: VehicleProfileMapModel.cpp:95
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
VehicleProfileMapModel::end
virtual VehicleProfileMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last vehicle profile.
Definition: VehicleProfileMapModel.cpp:31
VehicleProfileMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: VehicleProfileMapInterface.h:49
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfilesMapPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
Classes
VehicleProfilesMapPresenter.h File Reference
Agent Configuration Plugin

This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle profiles. In fact, this class implements a wrapper for the map of vehicle profiles (VehicleProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework. More...

Detailed Description

This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle profiles. In fact, this class implements a wrapper for the map of vehicle profiles (VehicleProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework.

Definition in file VehicleProfilesMapPresenter.h.

Go to the source code of this file.

Classes

class VehicleProfilesMapPresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle profiles. In fact, this class implements a wrapper for the map of vehicle profiles (VehicleProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfilesMapPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
VehicleProfilesMapPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19
20 #ifndef VEHICLEPROFILESMAPPRESENTER_H
21 #define VEHICLEPROFILESMAPPRESENTER_H
22
23 #include "openPASS-AgentConfiguration/AgentItemInterface.h"
24
25 #include <QAbstractTableModel>
26
27 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
33 class VehicleProfilesMapPresenter : public QAbstractTableModel
34 {
35 Q_OBJECT
36
37 public:
38 explicit VehicleProfilesMapPresenter( AgentItemInterface::VehicleProfiles * vehicleProfiles = nullptr,
39 QObject *parent = nullptr);
40
41 Q_SIGNALS:
42 //-----------------------------------------------------------------------------
46 //-----------------------------------------------------------------------------
47 void checkProbabilities();
48
49 public:
50 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
63
64 public:
65 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
75
76 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
85 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
86
87 public:
88 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
98
99 //-----------------------------------------------------------------------------
108 //-----------------------------------------------------------------------------
109 bool setData(const QModelIndex &index, const QVariant &value,
110 int role = Qt::EditRole) override;
111
112 //-----------------------------------------------------------------------------
119 //-----------------------------------------------------------------------------
120 Qt::ItemFlags flags(const QModelIndex& index) const override;
121
122 public:
123 //-----------------------------------------------------------------------------
128 //-----------------------------------------------------------------------------
129 virtual void addRow(int const &row,
130 AgentItemInterface::VehicleProfile const & profile,
131 AgentItemInterface::Probability const & probability);
132
133 //-----------------------------------------------------------------------------
141 //-----------------------------------------------------------------------------
142 virtual bool removeRow(const int &row);
143
144 //-----------------------------------------------------------------------------
149 //-----------------------------------------------------------------------------
150 void setVehicleProfiles(AgentItemInterface::VehicleProfiles * const _vehicleProfiles);
151
152 //-----------------------------------------------------------------------------
155 //-----------------------------------------------------------------------------
156 void update();
157
158 public Q_SLOTS:
159 //-----------------------------------------------------------------------------
164 //-----------------------------------------------------------------------------
165 void editName(AgentItemInterface::VehicleProfile const & oldName,
166 AgentItemInterface::VehicleProfile const & newName);
167
168 //-----------------------------------------------------------------------------
172 //-----------------------------------------------------------------------------
173 void remove(AgentItemInterface::VehicleProfile const & profile);
174
175
176 private:
177 AgentItemInterface::VehicleProfiles * vehicleProfiles;
178
179 private:
180 QStringList _columnHeaders;
181 QMap<int, AgentItemInterface::VehicleProfile> RowToProfile;
182 };
183
184 #endif // VEHICLEPROFILESMAPPRESENTER_H
VehicleProfilesMapPresenter::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! ...
Definition: VehicleProfilesMapPresenter.cpp:98
AgentItemInterface::VehicleProfiles
QMap< VehicleProfile, Probability > VehicleProfiles
the mapping of a vehicle profile to the instantiation probability
Definition: AgentItemInterface.h:57
VehicleProfilesMapPresenter::update
void update()
Method which updates the table according to the current entries of vehicleProfiles.
Definition: VehicleProfilesMapPresenter.cpp:149
VehicleProfilesMapPresenter::vehicleProfiles
AgentItemInterface::VehicleProfiles * vehicleProfiles
the pointer to the map of vehicle profiles assigned to an agent profile
Definition: VehicleProfilesMapPresenter.h:177
VehicleProfilesMapPresenter::removeRow
virtual bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: VehicleProfilesMapPresenter.cpp:122
VehicleProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::VehicleProfile > RowToProfile
a mapping of row indices to profile names
Definition: VehicleProfilesMapPresenter.h:181
VehicleProfilesMapPresenter::checkProbabilities
void checkProbabilities()
Signal emitted whenever the probability sum of the vehicle profile table should be checked...
VehicleProfilesMapPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: VehicleProfilesMapPresenter.cpp:21
AgentItemInterface.h
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
VehicleProfilesMapPresenter::editName
void editName(AgentItemInterface::VehicleProfile const &oldName, AgentItemInterface::VehicleProfile const &newName)
Slot which changes the name of the vehicle profile.
Definition: VehicleProfilesMapPresenter.cpp:167
VehicleProfilesMapPresenter::addRow
virtual void addRow(int const &row, AgentItemInterface::VehicleProfile const &profile, AgentItemInterface::Probability const &probability)
Method that adds a new row, i.e. a vehicle profile with the given probability.
Definition: VehicleProfilesMapPresenter.cpp:103
VehicleProfilesMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: VehicleProfilesMapPresenter.cpp:32
VehicleProfilesMapPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: VehicleProfilesMapPresenter.cpp:49
VehicleProfilesMapPresenter::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: VehicleProfilesMapPresenter.cpp:71
VehicleProfilesMapPresenter::_columnHeaders
QStringList _columnHeaders
the list containing the header data for columns
Definition: VehicleProfilesMapPresenter.h:180
VehicleProfilesMapPresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle pro...
Definition: VehicleProfilesMapPresenter.h:33
AgentItemInterface::VehicleProfile
QString VehicleProfile
the name of a vehicle profile
Definition: AgentItemInterface.h:56
VehicleProfilesMapPresenter::setVehicleProfiles
void setVehicleProfiles(AgentItemInterface::VehicleProfiles *const _vehicleProfiles)
Method which sets the currently processed vehicle profiles map to the given argument.
Definition: VehicleProfilesMapPresenter.cpp:142
AgentItemInterface::Probability
double Probability
a probability value (e.g. of a driver or a vehicle profile)
Definition: AgentItemInterface.h:45
VehicleProfilesMapPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: VehicleProfilesMapPresenter.cpp:42
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfilesPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
Classes
VehicleProfilesPresenter.h File Reference
Agent Configuration Plugin

This file contains the class VehicleProfilesPresenter defining the presenter object for vehicle profiles as well as the classes for all undo-command objects used by VehicleProfilesPresenter. More...

Detailed Description

This file contains the class VehicleProfilesPresenter defining the presenter object for vehicle profiles as well as the classes for all undo-command objects used by VehicleProfilesPresenter.

The VehicleProfilesPresenter class handles user events from the view (VehicleProfilesView) and edits the model data (VehicleProfileMapInterface) accordingly. Since all actions performed on the model data (i.e. the *.ui file) should be undoable, the presenter instantiates the corresponding undo-commands and pushes them onto the undo stack. The actual operation on the model is then performed in these command object using the re-implementations of the undo/redo methods. See Qt's undo framework for further details.

Definition in file VehicleProfilesPresenter.h.

Go to the source code of this file.

Classes

class | VehicleProfileCommands::AddSystem
This class defines the command for undoable add-operations on the map of systems of a specific algorithm type. More...
class | VehicleProfileCommands::AddSystemProfile
This class defines the command for undoably creating a new map for systems of a specific algorithm type to be assigned to the current vehicle profile. More...
class | VehicleProfileCommands::AddVehicleProfile
This class defines the command for undoable add-operations on the map of vehicle profiles (VehicleProfileMapInterface). More...
class | VehicleProfileCommands::EditVehicleProfile
This class defines the command for undoable renaming-operations on the map of vehicle profiles (VehicleProfileMapInterface). More...
class | VehicleProfileCommands::RemoveSystem
This class defines the command for undoable remove-operations on the map of systems of a specific algorithm type. More...
class | VehicleProfileCommands::RemoveSystemProfile
This class defines the command for undoably removing the map for systems of a specific algorithm type assigned to the current vehicle profile. More...
class | VehicleProfileCommands::RemoveVehicleProfile
This class defines the command for undoable remove-operations on the map of vehicle profiles (VehicleProfileMapInterface). More...
class | VehicleProfileCommands::SetCurrentVehicle
This class defines the command for undoable set-operations on the currently selected vehicle profile. More...
class | VehicleProfileCommands::SetModel
This class defines the command for undoable set-operations on the vehicle model of the currently edited vehicle profile. More...
class | VehicleProfileCommands::SetModelCatalogue
This class defines the command for undoable set-operations on the vehicle model catalogue of the currently edited vehicle profile. More...
class | VehicleProfileCommands::SetSystemConfig
This class defines the command for undoable set-operations on the system config of the currently edited vehicle profile. More...
class | VehicleProfilesPresenter
This class defines the presenter object for vehicle profiles which handles user events from the view (VehicleProfilesView) and edits the model data (VehicleProfileMapInterface) accordingly. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfilesPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
VehicleProfilesPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
27
28 #ifndef VEHICLEPROFILEMAPPRESENTER_H
29 #define VEHICLEPROFILEMAPPRESENTER_H
30
31 #include "openPASS-System/SystemInterface.h"
32 #include "openPASS-AgentConfiguration/VehicleProfileMapInterface.h"
33 #include "openPASS-AgentConfiguration/SensorProfileMapInterface.h"
34 #include "openPASS-AgentConfiguration/VehicleComponentProfileMapInterface.h"
35 #include "openPASS-Project/ProjectInterface.h"
36
37 #include "Views/VehicleProfilesView.h"
38
39 #include <QObject>
40 #include <QMap>
41 #include <QList>
42 #include <QUndoStack>
43
44 class SystemProfilePresenter;
45
46
47 //-----------------------------------------------------------------------------
58 //-----------------------------------------------------------------------------
59 class VehicleProfilesPresenter : public QObject
60 {
61 Q_OBJECT
62
63 public:
64 explicit VehicleProfilesPresenter(VehicleProfileMapInterface * vehicleProfiles,
65 VehicleProfilesView * vehicleProfilesView,
66 SystemInterface *systemInterface,
67 ProjectInterface * const project,
68 QUndoStack * const undoStack,
69 QObject *parent = nullptr);
70
71 ~VehicleProfilesPresenter();
72
73 private Q_SLOTS:
74 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 void setCurrentVehicleProfile(QString const &name);
83
84 private Q_SLOTS:
85 //-----------------------------------------------------------------------------
91 //-----------------------------------------------------------------------------
92 void addVehicleProfile(QString const & name);
93
94 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
102 void removeVehicleProfile(QString const &name);
103
104 //-----------------------------------------------------------------------------
110 //-----------------------------------------------------------------------------
111 void editVehicleProfileName(QString const &oldName, QString const &newName);
112
113 private Q_SLOTS:
114 //-----------------------------------------------------------------------------
120 //-----------------------------------------------------------------------------
121 void setSystemConfig();
122
123 //-----------------------------------------------------------------------------
133 //-----------------------------------------------------------------------------
134 void addSystemProfile(QString const &type);
135
136 //-----------------------------------------------------------------------------
146 //-----------------------------------------------------------------------------
147 void removeSystemProfile(QString const &type);
148
149 private Q_SLOTS:
150 //-----------------------------------------------------------------------------
159 //-----------------------------------------------------------------------------
160 void addSystem(QString const &type , QString const & selectionItem);
161
162 //-----------------------------------------------------------------------------
170 //-----------------------------------------------------------------------------
171 void removeSystem( QString const &type, int const &row );
172
173 private Q_SLOTS:
174 //-----------------------------------------------------------------------------
181 //-----------------------------------------------------------------------------
182 void setModelCatalogue();
183
184 //-----------------------------------------------------------------------------
190 //-----------------------------------------------------------------------------
191 void setModel(QString const &modelName);
192
193 private:
194 //-----------------------------------------------------------------------------
197 //-----------------------------------------------------------------------------
198 void updateSystemList();
199
200 //-----------------------------------------------------------------------------
206 //-----------------------------------------------------------------------------
207 bool systemsConsistent();
208
209 //-----------------------------------------------------------------------------
213 //-----------------------------------------------------------------------------
214 void updateSystemsView();
215
216 public Q_SLOTS:
217 //-----------------------------------------------------------------------------
223 //-----------------------------------------------------------------------------
224 void loadModelCatalogue(QString const &filepath);
225
226 //-----------------------------------------------------------------------------
230 //-----------------------------------------------------------------------------
231 void refreshModelCatalogue();
232
233 //-----------------------------------------------------------------------------
237 //-----------------------------------------------------------------------------
238 void refreshSystemConfig();
239
240 public:
241 //-----------------------------------------------------------------------------
244 //-----------------------------------------------------------------------------
245 void updateView();
246
247 //-----------------------------------------------------------------------------
250 //-----------------------------------------------------------------------------
251 void updateVehicleSelectionItems();
252
253 private:
254 friend class AgentConfigurationPresenter;
255
256 private:
257 VehicleProfileItemInterface * currentVehicleProfile;
258 VehicleProfileMapInterface * const vehicleProfiles;
259 VehicleProfilesView * const vehicleProfilesView;
260 SystemInterface * const systemInterface;
261 ProjectInterface * const project;
262 QUndoStack * const undoStack;
263
264 private:
265 QMap <VehicleProfileItemInterface::Name , QMap<QString, SystemProfilePresenter*>*> systemProfilePresenters;
266 QMap <QString, QList<QString> > systemList;
267 QList<QString> modelList;
268 static double default_probability;
269 };
270
271 namespace VehicleProfileCommands {
272
273 //-----------------------------------------------------------------------------
276 //-----------------------------------------------------------------------------
277 class SetCurrentVehicle : public QUndoCommand
278 {
279 public:
280 SetCurrentVehicle(VehicleProfileMapInterface const * const vehicles,
281 VehicleProfileItemInterface ** const currentVehicle,
282 VehicleProfileItemInterface::Name const newVehicle,
283 VehicleProfilesPresenter * const vehiclesPresenter,
284 QUndoCommand *parent = nullptr);
285
286 public:
287 void redo() override;
288 void undo() override;
289
290 private:
291 VehicleProfileMapInterface const * const vehicles;
292 VehicleProfileItemInterface ** const currentVehicle;
293 VehicleProfileItemInterface::Name const newVehicle;
294 VehicleProfileItemInterface::Name const oldVehicle;
295 VehicleProfilesPresenter * const vehiclesPresenter;
296 };
297
298 //-----------------------------------------------------------------------------
301 //-----------------------------------------------------------------------------
302 class AddVehicleProfile : public QUndoCommand
303 {
304
305 public:
306 AddVehicleProfile(VehicleProfileMapInterface * const vehicles,
307 VehicleProfilesView * const vehiclesView,
308 VehicleProfileMapInterface::Name const &name,
309 QMap <VehicleProfileItemInterface::Name , QMap<QString, SystemProfilePresenter*> * > * const systemProfilePresenters,
310 QUndoCommand * parent = nullptr);
311
312 ~AddVehicleProfile() override;
313 public:
314 void redo() override;
315 void undo() override;
316
317 private:
318 VehicleProfileMapInterface * const vehicles;
319 VehicleProfilesView * const vehiclesView;
320 VehicleProfileMapInterface::Name const name;
321 QMap <VehicleProfileItemInterface::Name , QMap<QString, SystemProfilePresenter*> * > * const systemProfilePresenters;
322 QMap<QString, SystemProfilePresenter*> * addedSystemProfiles;
323 };
324
325 //-----------------------------------------------------------------------------
328 //-----------------------------------------------------------------------------
329 class RemoveVehicleProfile : public QUndoCommand
330 {
331
332 public:
333 RemoveVehicleProfile(VehicleProfileMapInterface * const vehicles,
334 VehicleProfilesView * const vehiclesView,
335 VehicleProfileMapInterface::Name const &name,
336 QMap <VehicleProfileItemInterface::Name , QMap<QString, SystemProfilePresenter*> * > * const systemProfilePresenters,
337 QUndoCommand * parent = nullptr);
338 virtual ~RemoveVehicleProfile() override;
339
340 public:
341 void redo() override;
342 void undo() override;
343
344 private:
345 VehicleProfileMapInterface * const vehicles;
346 VehicleProfilesView * const vehiclesView;
347 VehicleProfileMapInterface::Name const name;
348 VehicleProfileMapInterface::Item const * const vehicle;
349 QMap <VehicleProfileItemInterface::Name , QMap<QString, SystemProfilePresenter*>*> * const systemProfilePresenters;
350 QMap<QString, SystemProfilePresenter*> * removedSystemProfiles;
351 };
352
353 //-----------------------------------------------------------------------------
356 //-----------------------------------------------------------------------------
357 class EditVehicleProfile : public QUndoCommand
358 {
359
360 public:
361 EditVehicleProfile(VehicleProfileMapInterface * const vehicles,
362 VehicleProfilesView * const vehiclesView,
363 VehicleProfileMapInterface::Name const &oldName,
364 VehicleProfileMapInterface::Name const &newName,
365 QUndoCommand *parent = nullptr);
366
367 public:
368 void redo() override;
369 void undo() override;
370
371 private:
372 VehicleProfileMapInterface * const vehicles;
373 VehicleProfilesView * const vehiclesView;
374 VehicleProfileMapInterface::Name const oldName;
375 VehicleProfileMapInterface::Name const newName;
376
377 };
378
379 //-----------------------------------------------------------------------------
382 //-----------------------------------------------------------------------------
383 class SetModelCatalogue : public QUndoCommand
384 {
385
386 public:
387 SetModelCatalogue(VehicleProfileMapInterface * const vehicles,
388 VehicleProfilesView * const vehicleProfilesView,
389 VehicleProfileItemInterface::Name const &vehicleName,
390 VehicleProfileItemInterface::ModelCatalogue const &newModelCatalogue,
391 VehicleProfilesPresenter * const vehicleProfilesPresenter,
392 QUndoCommand *parent = nullptr);
393 public:
394 void redo() override;
395 void undo() override;
396
397 private:
398 VehicleProfileMapInterface * const vehicles;
399 VehicleProfilesView * const vehicleProfilesView;
400 VehicleProfileItemInterface::Name const vehicleName;
401 VehicleProfileItemInterface::ModelCatalogue const newModelCatalogue;
402 VehicleProfileItemInterface::ModelCatalogue const oldModelCatalogue;
403 VehicleProfilesPresenter * const vehicleProfilesPresenter;
404 };
405
406 //-----------------------------------------------------------------------------
409 //-----------------------------------------------------------------------------
410 class SetModel : public QUndoCommand
411 {
412
413 public:
414 SetModel(VehicleProfileMapInterface * const vehicles,
415 VehicleProfilesView * const vehicleProfilesView,
416 VehicleProfileItemInterface::Name const &vehicleName,
417 VehicleProfileItemInterface::Model const &newModel,
418 QUndoCommand *parent = nullptr);
419
420 public:
421 void redo() override;
422 void undo() override;
423
424 private:
425 VehicleProfileMapInterface * const vehicles;
426 VehicleProfilesView * const vehicleProfilesView;
427 VehicleProfileItemInterface::Name const vehicleName;
428 VehicleProfileItemInterface::Model const newModel;
429 VehicleProfileItemInterface::Model const oldModel;
430 };
431
432 //-----------------------------------------------------------------------------
435 //-----------------------------------------------------------------------------
436 class SetSystemConfig : public QUndoCommand
437 {
438
439 public:
440 SetSystemConfig(VehicleProfileMapInterface * const vehicles,
441 VehicleProfilesView * const vehicleProfilesView,
442 VehicleProfileItemInterface::Name const &vehicleName,
443 VehicleProfileItemInterface::SystemConfig const &newSystemConfig,
444 VehicleProfilesPresenter * const vehicleProfilesPresenter,
445 QUndoCommand *parent = nullptr);
446 public:
447 void redo() override;
448 void undo() override;
449
450 private:
451 VehicleProfileMapInterface * const vehicles;
452 VehicleProfilesView * const vehicleProfilesView;
453 VehicleProfileItemInterface::Name const vehicleName;
454 VehicleProfileItemInterface::SystemConfig const newSystemConfig;
455 VehicleProfileItemInterface::SystemConfig const oldSystemConfig;
456 VehicleProfilesPresenter * const vehicleProfilesPresenter;
457 };
458
459 //-----------------------------------------------------------------------------
463 //-----------------------------------------------------------------------------
464 class AddSystemProfile : public QUndoCommand
465 {
466
467 public:
468 AddSystemProfile(VehicleProfileMapInterface * const vehicles,
469 VehicleProfileItemInterface::Name const &vehicleName,
470 QString const &type,
471 QMap<QString, SystemProfilePresenter*> * const systemProfilePresenters,
472 VehicleProfilesPresenter * const vehicleProfilesPresenter,
473 QUndoCommand *parent = nullptr);
474
475 ~AddSystemProfile() override;
476
477 public:
478 void redo() override;
479 void undo() override;
480
481 private:
482 VehicleProfileMapInterface * const vehicles;
483 VehicleProfileItemInterface::Name const vehicleName;
484 QString const type;
485 VehicleProfilesPresenter * const vehicleProfilesPresenter;
486 QMap<QString, SystemProfilePresenter*> * const systemProfilePresenters;
487 SystemProfilePresenter * const systemProfilePresenter;
488 bool deletable;
489 };
490
491 //-----------------------------------------------------------------------------
495 //-----------------------------------------------------------------------------
496 class RemoveSystemProfile : public QUndoCommand
497 {
498 public:
499 RemoveSystemProfile(VehicleProfileMapInterface * const vehicles,
500 VehicleProfileItemInterface::Name const &vehicleName,
501 QString const &type,
502 QMap<QString, SystemProfilePresenter*> * const systemProfilePresenters,
503 VehicleProfilesPresenter * const vehicleProfilesPresenter,
504 QUndoCommand *parent = nullptr);
505
506 ~RemoveSystemProfile() override;
507
508 public:
509 void redo() override;
510 void undo() override;
511
512 private:
513 VehicleProfileMapInterface * const vehicles;
514 VehicleProfileItemInterface::Name const vehicleName;
515 QString const type;
516 VehicleProfilesPresenter * const vehicleProfilesPresenter;
517 QMap<QString, SystemProfilePresenter*> * const systemProfilePresenters;
518 SystemProfilePresenter * const systemProfilePresenter;
519 bool deletable;
520 };
521
522
523 //-----------------------------------------------------------------------------
526 //-----------------------------------------------------------------------------
527 class AddSystem : public QUndoCommand
528 {
529
530 public:
531 AddSystem(SystemProfilePresenter * const systems,
532 VehicleProfileItemInterface::System const &system,
533 VehicleProfileItemInterface::Probability const &probability,
534 QUndoCommand * parent = nullptr);
535
536 public:
537 void redo() override;
538 void undo() override;
539
540 private:
541 SystemProfilePresenter * const systems;
542 VehicleProfileItemInterface::System const system;
543 VehicleProfileItemInterface::Probability const probability;
544 };
545
546 //-----------------------------------------------------------------------------
549 //-----------------------------------------------------------------------------
550 class RemoveSystem : public QUndoCommand
551 {
552
553 public:
554 RemoveSystem(SystemProfilePresenter * const systems,
555 int const &row,
556 QUndoCommand * parent = nullptr);
557
558 public:
559 void redo() override;
560 void undo() override;
561
562 private:
563 SystemProfilePresenter * const systems;
564 int const row;
565 VehicleProfileItemInterface::System const system;
566 VehicleProfileItemInterface::Probability const probability;
567 };
568
569 }
570
571 #endif // VEHICLEPROFILEMAPPRESENTER_H
VehicleProfilesPresenter::removeSystemProfile
void removeSystemProfile(QString const &type)
Slot, triggered by the VehicleProfilesView::removeSystemProfile signal. Undoably removes the map for ...
Definition: VehicleProfilesPresenter.cpp:214
VehicleProfilesPresenter::removeVehicleProfile
void removeVehicleProfile(QString const &name)
Slot triggered by the VehicleProfilesView::removeVehicleProfile signal. Performs an undoable remove-o...
Definition: VehicleProfilesPresenter.cpp:89
VehicleProfilesPresenter
This class defines the presenter object for vehicle profiles which handles user events from the view ...
Definition: VehicleProfilesPresenter.h:59
VehicleProfileItemInterface::System
QPair< SystemID, SystemTitle > System
typedef for a system (here, the system Id and title are sufficient)
Definition: VehicleProfileItemInterface.h:87
VehicleProfilesPresenter::loadModelCatalogue
void loadModelCatalogue(QString const &filepath)
Method which scans the vehicle model catalogue specified by the given filepath and stores the vehicle...
Definition: VehicleProfilesPresenter.cpp:311
VehicleProfilesPresenter::updateVehicleSelectionItems
void updateVehicleSelectionItems()
Method which updates the combo box list of available vehicle profiles to the ones currently defined i...
Definition: VehicleProfilesPresenter.cpp:432
VehicleProfileCommands::AddSystem
This class defines the command for undoable add-operations on the map of systems of a specific algori...
Definition: VehicleProfilesPresenter.h:527
AgentConfigurationPresenter
This class defines the presenter object which handles events from the view (AgentConfigurationView) a...
Definition: AgentConfigurationPresenter.h:41
VehicleProfilesPresenter::addSystemProfile
void addSystemProfile(QString const &type)
Slot, triggered by the VehicleProfilesView::addSystemProfile signal. Undoably adds a map for systems ...
Definition: VehicleProfilesPresenter.cpp:202
VehicleProfileCommands
Definition: VehicleProfilesPresenter.h:271
VehicleProfileItemInterface::Name
QString Name
typedef for the name of the vehicle profile
Definition: VehicleProfileItemInterface.h:76
VehicleProfileItemInterface::ModelCatalogue
QString ModelCatalogue
typedef for the vehicle model catalogue
Definition: VehicleProfileItemInterface.h:80
VehicleProfilesPresenter::systemProfilePresenters
QMap< VehicleProfileItemInterface::Name, QMap< QString, SystemProfilePresenter * > * > systemProfilePresenters
a container for each vehicle profile that stores all table presenter objects for systems of a certain...
Definition: VehicleProfilesPresenter.h:265
VehicleProfileItemInterface::SystemConfig
QString SystemConfig
typedef for the system config XML file
Definition: VehicleProfileItemInterface.h:82
VehicleProfilesPresenter::modelList
QList< QString > modelList
the list of all models in the current vehicle model catalogue
Definition: VehicleProfilesPresenter.h:267
VehicleProfilesPresenter::setSystemConfig
void setSystemConfig()
Slot triggered by the VehicleProfilesView::changeSystemConfig signal. Opens a file dialog for the use...
Definition: VehicleProfilesPresenter.cpp:113
VehicleProfileItemInterface
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
Definition: VehicleProfileItemInterface.h:71
VehicleProfileCommands::SetModelCatalogue
This class defines the command for undoable set-operations on the vehicle model catalogue of the curr...
Definition: VehicleProfilesPresenter.h:383
VehicleProfileItemInterface::Probability
double Probability
typedef for a probability
Definition: VehicleProfileItemInterface.h:77
VehicleProfileItemInterface::Model
QString Model
typedef for the vehicle model
Definition: VehicleProfileItemInterface.h:79
SystemInterface.h
The System Interface (SI) contains the functions creating systems and creating a tree listing the com...
VehicleProfilesPresenter::systemInterface
SystemInterface *const systemInterface
a pointer to the system interface of the System editor. Serves as a container into which the system c...
Definition: VehicleProfilesPresenter.h:260
SensorProfileMapInterface.h
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
VehicleProfilesPresenter::setCurrentVehicleProfile
void setCurrentVehicleProfile(QString const &name)
Slot triggered by the VehicleProfilesView::selectedVehicleProfile signal. Performs an undoable set-op...
Definition: VehicleProfilesPresenter.cpp:74
VehicleProfilesPresenter::updateSystemList
void updateSystemList()
Method which updates the list of all available systems in the currently selected system config...
Definition: VehicleProfilesPresenter.cpp:168
VehicleComponentProfileMapInterface.h
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
VehicleProfilesPresenter::vehicleProfiles
VehicleProfileMapInterface *const vehicleProfiles
the pointer to the map of vehicle profiles
Definition: VehicleProfilesPresenter.h:258
SystemProfilePresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of systems wit...
Definition: SystemProfilePresenter.h:35
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
VehicleProfileMapInterface::Name
VehicleProfileItemInterface::Name Name
typedef for vehicle profile names (= key identifiers of the map)
Definition: VehicleProfileMapInterface.h:44
VehicleProfileCommands::RemoveSystem
This class defines the command for undoable remove-operations on the map of systems of a specific alg...
Definition: VehicleProfilesPresenter.h:550
VehicleProfileCommands::EditVehicleProfile
This class defines the command for undoable renaming-operations on the map of vehicle profiles (Vehic...
Definition: VehicleProfilesPresenter.h:357
VehicleProfilesPresenter::editVehicleProfileName
void editVehicleProfileName(QString const &oldName, QString const &newName)
Slot triggered by the VehicleProfilesView::modifiedName signal. Performs an undoable rename-operation...
Definition: VehicleProfilesPresenter.cpp:104
VehicleProfilesPresenter::setModel
void setModel(QString const &modelName)
Slot triggered by the VehicleProfilesView::modifiedModel signal. Performs an undoable assignment of t...
Definition: VehicleProfilesPresenter.cpp:344
VehicleProfilesPresenter::currentVehicleProfile
VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
Definition: VehicleProfilesPresenter.h:257
VehicleProfilesPresenter::systemsConsistent
bool systemsConsistent()
Method which checks whether all assigned systems are consistent with the currently selected system co...
Definition: VehicleProfilesPresenter.cpp:414
VehicleProfilesPresenter::vehicleProfilesView
VehicleProfilesView *const vehicleProfilesView
the pointer to the view displaying the currently edited profile
Definition: VehicleProfilesPresenter.h:259
VehicleProfileCommands::SetCurrentVehicle
This class defines the command for undoable set-operations on the currently selected vehicle profile...
Definition: VehicleProfilesPresenter.h:277
VehicleProfilesPresenter::setModelCatalogue
void setModelCatalogue()
Slot triggered by the VehicleProfilesView::changeModelCatalogue signal. Opens a file dialog for the u...
Definition: VehicleProfilesPresenter.cpp:257
VehicleProfilesPresenter::default_probability
static double default_probability
a default probability
Definition: VehicleProfilesPresenter.h:268
VehicleProfileCommands::RemoveVehicleProfile
This class defines the command for undoable remove-operations on the map of vehicle profiles (Vehicle...
Definition: VehicleProfilesPresenter.h:329
VehicleProfilesPresenter::refreshSystemConfig
void refreshSystemConfig()
Slot triggered by the VehicleProfilesView::refreshSystemConfig and ProjectInterface::update signals...
Definition: VehicleProfilesPresenter.cpp:128
VehicleProfilesPresenter::updateSystemsView
void updateSystemsView()
Method which completely re-builds the view of all system tables which are included into the currently...
Definition: VehicleProfilesPresenter.cpp:386
VehicleProfilesView.h
This class defines the view for editing vehicle profiles. The view constitutes a combo box for select...
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
SystemInterface
This class manages creating new systems and also creating the tree of components loaded from a librar...
Definition: SystemInterface.h:27
VehicleProfileCommands::SetSystemConfig
This class defines the command for undoable set-operations on the system config of the currently edit...
Definition: VehicleProfilesPresenter.h:436
VehicleProfilesPresenter::refreshModelCatalogue
void refreshModelCatalogue()
Slot triggered by the VehicleProfilesView::refreshModelCatalogue and ProjectInterface::update signals...
Definition: VehicleProfilesPresenter.cpp:281
VehicleProfileCommands::RemoveSystemProfile
This class defines the command for undoably removing the map for systems of a specific algorithm type...
Definition: VehicleProfilesPresenter.h:496
VehicleProfileMapInterface.h
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
VehicleProfilesView
This class defines the view for editing vehicle profiles. The view constitutes a combo box for select...
Definition: VehicleProfilesView.h:56
VehicleProfilesPresenter::systemList
QMap< QString, QList< QString > > systemList
the list of all systems in the current system config sorted by the algorithm type ...
Definition: VehicleProfilesPresenter.h:266
VehicleProfileCommands::AddVehicleProfile
This class defines the command for undoable add-operations on the map of vehicle profiles (VehiclePro...
Definition: VehicleProfilesPresenter.h:302
VehicleProfileCommands::SetModel
This class defines the command for undoable set-operations on the vehicle model of the currently edit...
Definition: VehicleProfilesPresenter.h:410
VehicleProfilesPresenter::addSystem
void addSystem(QString const &type, QString const &selectionItem)
Slot, triggered by the SystemProfileView::addSystem signal. Undoably adds the given system selection ...
Definition: VehicleProfilesPresenter.cpp:227
VehicleProfilesPresenter::updateView
void updateView()
Method which completely re-builds the view according to the model data of the currently selected vehi...
Definition: VehicleProfilesPresenter.cpp:351
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
VehicleProfilesPresenter::project
ProjectInterface *const project
a pointer to the project interface for accessing the config file structure
Definition: VehicleProfilesPresenter.h:261
VehicleProfilesPresenter::addVehicleProfile
void addVehicleProfile(QString const &name)
Slot triggered by the VehicleProfilesView::addVehicleProfile signal. Performs an undoable add-operati...
Definition: VehicleProfilesPresenter.cpp:81
VehicleProfilesPresenter::removeSystem
void removeSystem(QString const &type, int const &row)
Slot, triggered by the SystemProfileView::removeSystem signal. Undoably removes the specified row fro...
Definition: VehicleProfilesPresenter.cpp:249
VehicleProfileCommands::AddSystemProfile
This class defines the command for undoably creating a new map for systems of a specific algorithm ty...
Definition: VehicleProfilesPresenter.h:464
VehicleProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: VehicleProfilesPresenter.h:262
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfilesView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
Classes
VehicleProfilesView.h File Reference
Agent Configuration Plugin

This class defines the view for editing vehicle profiles. The view constitutes a combo box for selecting and buttons for adding, removing and renaming vehicle profiles. Further, GUI elements for vehicle model catalogue and vehicle model as well as for the system config are provided. Systems defined in a system config are sorted by the algorithm type used therein. For the corresponding selection of an algorithm type, a combo box including add- and remove- buttons is set up. The dynamic instantiation of the table views for systems of a certain algorithm type (SystemProfileView) is performed in the presenter object (VehicleProfilesPresenter). This object calls public methods of this class in order to instantiate the table views and and lay them out in this widget. More...

Detailed Description

This class defines the view for editing vehicle profiles. The view constitutes a combo box for selecting and buttons for adding, removing and renaming vehicle profiles. Further, GUI elements for vehicle model catalogue and vehicle model as well as for the system config are provided. Systems defined in a system config are sorted by the algorithm type used therein. For the corresponding selection of an algorithm type, a combo box including add- and remove- buttons is set up. The dynamic instantiation of the table views for systems of a certain algorithm type (SystemProfileView) is performed in the presenter object (VehicleProfilesPresenter). This object calls public methods of this class in order to instantiate the table views and and lay them out in this widget.

Definition in file VehicleProfilesView.h.

Go to the source code of this file.

Classes

class VehicleProfilesView
This class defines the view for editing vehicle profiles. The view constitutes a combo box for selecting and buttons for adding, removing and renaming vehicle profiles. Further, GUI elements for vehicle model catalogue and vehicle model as well as for the system config are provided. Systems defined in a system config are sorted by the algorithm type used therein. For the corresponding selection of an algorithm type, a combo box including add- and remove- buttons is set up. The dynamic instantiation of the table views for systems of a certain algorithm type (SystemProfileView) is performed in the presenter object (VehicleProfilesPresenter). This object calls public methods of this class in order to instantiate the table views and and lay them out in this widget. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfilesView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
VehicleProfilesView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
27
28
29 #ifndef VEHICLEPROFILESVIEW_H
30 #define VEHICLEPROFILESVIEW_H
31
32 #include "Views/WidgetView.h"
33 #include "Views/SystemProfileView.h"
34
35 #include <QString>
36 #include <QStringList>
37
38 namespace Ui {
39 class VehicleProfilesView;
40 }
41
42 //-----------------------------------------------------------------------------
55 //-----------------------------------------------------------------------------
56 class VehicleProfilesView : public WidgetView
57 {
58 Q_OBJECT
59
60 public:
61 explicit VehicleProfilesView(QWidget *parent = nullptr);
62 ~VehicleProfilesView();
63
64 Q_SIGNALS:
65 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 void addVehicleProfile(QString const &name);
73
74 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
81 void removeVehicleProfile(QString const &name);
82
83 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 void modifiedName(QString const & oldName, QString const &newName);
92
93 //-----------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------
100 void selectedVehicleProfile(QString const &name);
101
102 Q_SIGNALS:
103 //-----------------------------------------------------------------------------
106 //-----------------------------------------------------------------------------
107 void refreshModelCatalogue();
108
109 //-----------------------------------------------------------------------------
112 //-----------------------------------------------------------------------------
113 void changeModelCatalogue();
114
115 //-----------------------------------------------------------------------------
120 //-----------------------------------------------------------------------------
121 void modifiedModel(QString const &ModelName);
122
123 Q_SIGNALS:
124 //-----------------------------------------------------------------------------
127 //-----------------------------------------------------------------------------
128 void changeSystemConfig();
129
130 //-----------------------------------------------------------------------------
133 //-----------------------------------------------------------------------------
134 void refreshSystemConfig();
135
136 //-----------------------------------------------------------------------------
144 //-----------------------------------------------------------------------------
145 void addSystemProfile(QString const &type);
146
147 //-----------------------------------------------------------------------------
155 //-----------------------------------------------------------------------------
156 void removeSystemProfile(QString const &type);
157
158 private Q_SLOTS:
159 //-----------------------------------------------------------------------------
165 //-----------------------------------------------------------------------------
166 void on_Name_activated(const QString &name);
167
168 //-----------------------------------------------------------------------------
172 //-----------------------------------------------------------------------------
173 void on_add_clicked();
174
175 //-----------------------------------------------------------------------------
180 //-----------------------------------------------------------------------------
181 void on_remove_clicked();
182
183 //-----------------------------------------------------------------------------
188 //-----------------------------------------------------------------------------
189 void on_edit_clicked();
190
191 private Q_SLOTS:
192 //-----------------------------------------------------------------------------
195 //-----------------------------------------------------------------------------
196 void on_modelCatalogue_Refresh_clicked();
197
198 //-----------------------------------------------------------------------------
201 //-----------------------------------------------------------------------------
202 void on_modelCatalogue_Browse_clicked();
203
204 //-----------------------------------------------------------------------------
210 //-----------------------------------------------------------------------------
211 void on_Model_activated(const QString &model);
212
213 private Q_SLOTS:
214 //-----------------------------------------------------------------------------
217 //-----------------------------------------------------------------------------
218 void on_systemConfigRefresh_clicked();
219
220 //-----------------------------------------------------------------------------
223 //-----------------------------------------------------------------------------
224 void on_systemConfigBrowse_clicked();
225
226 //-----------------------------------------------------------------------------
230 //-----------------------------------------------------------------------------
231 void on_addSystemProfile_clicked();
232
233 //-----------------------------------------------------------------------------
237 //-----------------------------------------------------------------------------
238 void on_removeSystemProfile_clicked();
239
240 public:
241 //-----------------------------------------------------------------------------
247 //-----------------------------------------------------------------------------
248 void setCurrentVehicle(QString const &name);
249
250 //-----------------------------------------------------------------------------
256 //-----------------------------------------------------------------------------
257 void addVehicleProfileSelectionItem(QString const &name);
258
259 //-----------------------------------------------------------------------------
265 //-----------------------------------------------------------------------------
266 void removeVehicleProfileSelectionItem(QString const &name);
267
268 //-----------------------------------------------------------------------------
274 //-----------------------------------------------------------------------------
275 void setVehicleProfileSelectionItems(QStringList const &names);
276
277 public:
278 //-----------------------------------------------------------------------------
284 //-----------------------------------------------------------------------------
285 void setModelCatalogue(QString const &filepath);
286
287 //-----------------------------------------------------------------------------
292 //-----------------------------------------------------------------------------
293 void setModel(QString const &model);
294
295 //-----------------------------------------------------------------------------
301 //-----------------------------------------------------------------------------
302 void setModelSelectionItems(QStringList const &models);
303
304 //-----------------------------------------------------------------------------
309 //-----------------------------------------------------------------------------
310 void setModelCatalogueError(QString const &message);
311
312 //-----------------------------------------------------------------------------
318 //-----------------------------------------------------------------------------
319 void enableModelView(bool enable);
320
321 public:
322 //-----------------------------------------------------------------------------
329 //-----------------------------------------------------------------------------
330 void enableConfiguration(bool enable);
331
332 public:
333 //-----------------------------------------------------------------------------
339 //-----------------------------------------------------------------------------
340 void setSystemConfig(QString const &systemConfig);
341
342 //-----------------------------------------------------------------------------
348 //-----------------------------------------------------------------------------
349 void setSystemProfileSelection(QList<QString> profiles);
350
351 //-----------------------------------------------------------------------------
356 //-----------------------------------------------------------------------------
357 void setSystemConfigError(QString const &message);
358
359 //-----------------------------------------------------------------------------
364 //-----------------------------------------------------------------------------
365 void setSystemProfilesError(QString const &message);
366
367 public:
368 //-----------------------------------------------------------------------------
379 //-----------------------------------------------------------------------------
380 SystemProfileView * addSystemProfileView( QString const &type );
381
382 //-----------------------------------------------------------------------------
388 //-----------------------------------------------------------------------------
389 void removeSystemProfileView( QString const &type );
390
391 //-----------------------------------------------------------------------------
394 //-----------------------------------------------------------------------------
395 void clearSystemProfileViews();
396
397
398 private:
399 Ui::VehicleProfilesView *ui;
400 };
401
402 #endif // VEHICLEPROFILESVIEW_H
VehicleProfilesView::on_systemConfigRefresh_clicked
void on_systemConfigRefresh_clicked()
Slot triggered when the user clicks the refresh-button for the system config file. Emits the refreshSystemConfig signal.
Definition: VehicleProfilesView.cpp:88
VehicleProfilesView::refreshSystemConfig
void refreshSystemConfig()
Signal, emitted after the refresh-button of the system config file has been pressed.
VehicleProfilesView::on_edit_clicked
void on_edit_clicked()
Slot triggered when the user clicks the rename-button for vehicle profiles. Opens a dialog box asking...
Definition: VehicleProfilesView.cpp:68
VehicleProfilesView::refreshModelCatalogue
void refreshModelCatalogue()
Signal, emitted after the refresh-button of the vehicle model catalogue has been pressed.
VehicleProfilesView::setSystemProfileSelection
void setSystemProfileSelection(QList< QString > profiles)
Method which the sets the selection list of algorithm types (referred to as system profiles in the co...
Definition: VehicleProfilesView.cpp:212
VehicleProfilesView::addSystemProfileView
SystemProfileView * addSystemProfileView(QString const &type)
Method which creates an instance of SystemProfileView, i.e. a table for assigning systems of the give...
Definition: VehicleProfilesView.cpp:190
VehicleProfilesView::setSystemConfigError
void setSystemConfigError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for the system conf...
Definition: VehicleProfilesView.cpp:227
VehicleProfilesView::removeSystemProfile
void removeSystemProfile(QString const &type)
Signal, emitted after the remove-button of an algorithm type has been clicked. Transmits the algorith...
VehicleProfilesView::setModelCatalogue
void setModelCatalogue(QString const &filepath)
Method which sets the currently displayed vehicle model catalogue to the one passed as an argument...
Definition: VehicleProfilesView.cpp:185
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399
VehicleProfilesView::on_addSystemProfile_clicked
void on_addSystemProfile_clicked()
Slot triggered when the user clicks the add-button next to the algorithm type combo box...
Definition: VehicleProfilesView.cpp:123
VehicleProfilesView::on_systemConfigBrowse_clicked
void on_systemConfigBrowse_clicked()
Slot triggered when the user clicks the browse-button for the system config file. Emits the changeSys...
Definition: VehicleProfilesView.cpp:83
VehicleProfilesView::on_add_clicked
void on_add_clicked()
Slot triggered when the user clicks the add-button for vehicle profiles and has typed in a valid name...
Definition: VehicleProfilesView.cpp:38
VehicleProfilesView::setModelCatalogueError
void setModelCatalogueError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for editing the veh...
Definition: VehicleProfilesView.cpp:232
VehicleProfilesView::modifiedName
void modifiedName(QString const &oldName, QString const &newName)
Signal, emitted after the rename-button has been pressed and a new name for the current profile has b...
VehicleProfilesView::changeSystemConfig
void changeSystemConfig()
Signal, emitted after the browse-button of the system config file has been pressed.
VehicleProfilesView::on_Name_activated
void on_Name_activated(const QString &name)
Slot triggered when the user changes the vehicle profile displayed by the corresponding combo box...
Definition: VehicleProfilesView.cpp:128
VehicleProfilesView::setSystemConfig
void setSystemConfig(QString const &systemConfig)
Method which sets the currently displayed system config file to the one passed as an argument...
Definition: VehicleProfilesView.cpp:175
VehicleProfilesView::clearSystemProfileViews
void clearSystemProfileViews()
Method which deletes all instances of SystemProfileView, i.e. the table for assigning systems to prob...
Definition: VehicleProfilesView.cpp:218
VehicleProfilesView::selectedVehicleProfile
void selectedVehicleProfile(QString const &name)
Signal, emitted after the current entry of the combo box for available vehicle profiles has been chan...
VehicleProfilesView::addVehicleProfileSelectionItem
void addVehicleProfileSelectionItem(QString const &name)
Method which adds the given vehicle profile name to the selection list in the combo box for vehicle p...
Definition: VehicleProfilesView.cpp:99
VehicleProfilesView::on_modelCatalogue_Browse_clicked
void on_modelCatalogue_Browse_clicked()
Slot triggered when the user clicks the browse-button for the vehicle model catalogue. Emits the changeModelCatalogue signal.
Definition: VehicleProfilesView.cpp:133
VehicleProfilesView::setModel
void setModel(QString const &model)
Method which the sets the vehicle model currently displayed by the vehicle models&#39; combo box to the o...
Definition: VehicleProfilesView.cpp:180
VehicleProfilesView::addSystemProfile
void addSystemProfile(QString const &type)
Signal, emitted after the add-button of an algorithm type has been clicked. Transmits the algorithm t...
VehicleProfilesView::on_Model_activated
void on_Model_activated(const QString &model)
Slot triggered when the user changes the current entry of the vehicle model&#39;s combo box...
Definition: VehicleProfilesView.cpp:143
VehicleProfilesView::on_remove_clicked
void on_remove_clicked()
Slot triggered when the user clicks the remove-button for vehicle profiles. Emits the removeVehiclePr...
Definition: VehicleProfilesView.cpp:51
VehicleProfilesView::setCurrentVehicle
void setCurrentVehicle(QString const &name)
Method which sets the vehicle profile name to be currently shown in the combo box for vehicle profile...
Definition: VehicleProfilesView.cpp:93
VehicleProfilesView::changeModelCatalogue
void changeModelCatalogue()
Signal, emitted after the browse-button of the vehicle model catalogue has been pressed.
VehicleProfilesView::removeVehicleProfileSelectionItem
void removeVehicleProfileSelectionItem(QString const &name)
Method which removes the given vehicle profile name from the selection list in the combo box for vehi...
Definition: VehicleProfilesView.cpp:106
VehicleProfilesView::enableModelView
void enableModelView(bool enable)
Method which enables or disables the combo box for vehicle models. Disabling the menu usually happens...
Definition: VehicleProfilesView.cpp:154
VehicleProfilesView::setModelSelectionItems
void setModelSelectionItems(QStringList const &models)
Method which the sets the vehicle models&#39; selection list (combo box) to the one passed as an argument...
Definition: VehicleProfilesView.cpp:148
VehicleProfilesView
This class defines the view for editing vehicle profiles. The view constitutes a combo box for select...
Definition: VehicleProfilesView.h:56
VehicleProfilesView::setSystemProfilesError
void setSystemProfilesError(QString const &message)
Method which displays the given error message (red color) above the tables in which systems of a cert...
Definition: VehicleProfilesView.cpp:237
VehicleProfilesView::enableConfiguration
void enableConfiguration(bool enable)
Method which enables or disables the GUI elements of this view, apart from the add-button for adding ...
Definition: VehicleProfilesView.cpp:159
VehicleProfilesView::on_removeSystemProfile_clicked
void on_removeSystemProfile_clicked()
Slot triggered when the user clicks the remove-button next to the algorithm type combo box...
Definition: VehicleProfilesView.cpp:118
SystemProfileView
This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm ...
Definition: SystemProfileView.h:40
VehicleProfilesView::modifiedModel
void modifiedModel(QString const &ModelName)
Signal, emitted after the current entry in the vehicle models&#39; combo box has been changed by the user...
VehicleProfilesView::on_modelCatalogue_Refresh_clicked
void on_modelCatalogue_Refresh_clicked()
Slot triggered when the user clicks the refresh-button for the vehicle model catalogue. Emits the refreshModelCatalogue signal.
Definition: VehicleProfilesView.cpp:138
SystemProfileView.h
This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm ...
VehicleProfilesView::setVehicleProfileSelectionItems
void setVehicleProfileSelectionItems(QStringList const &names)
Method which clears the selection list for vehicle profiles (combo box) and inserts the given list...
Definition: VehicleProfilesView.cpp:112
VehicleProfilesView::removeSystemProfileView
void removeSystemProfileView(QString const &type)
Method which deletes the instance of SystemProfileView, i.e. the table for assigning systems of the g...
Definition: VehicleProfilesView.cpp:201
VehicleProfilesView::removeVehicleProfile
void removeVehicleProfile(QString const &name)
Signal, emitted after the remove-button for vehicle profiles has been clicked. Transmits the name of ...
VehicleProfilesView::addVehicleProfile
void addVehicleProfile(QString const &name)
Signal, emitted after the add-button for vehicle profiles has been clicked and a name for a new profi...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Component Plugin

Files
Component Plugin

The Component Plugin (CP) is dedicated for managing the component XML metadata. More...

Files

file | ComponentInputItemInterface.h
The Component Input Item Interface (CIII) contains the functions setters and getters of the items constituing an input of a component. This interface belongs to the Component Plugin (CP).
file | ComponentInputMapInterface.h
The Component Input Map Interface (CIMI) contains the functions managing the registration and deregistration of the inputs of a component. This interface belongs to the Component Plugin (CP).
file | ComponentInterface.h
The Component Interface (CI) contains the functions creating components. This interface belongs to the Component Plugin (CP).
file | ComponentItemInterface.h
The Component Item Interface (CII) contains the functions setters and getters of the items constituing a component. This interface belongs to the Component Plugin (CP).
file | ComponentMapInterface.h
The Component Map Interface (CMI) contains the functions managing the registration and deregistration of components. This interface belongs to the Component Plugin (CP).
file | ComponentOutputItemInterface.h
The Component Output Item Interface (COII) contains the functions setters and getters of the items constituing an output of a component. This interface belongs to the Component Plugin (CP).
file | ComponentOutputMapInterface.h
The Component Output Map Interface (COMI) contains the functions managing the registration and deregistration of the outputs of a component. This interface belongs to the Component Plugin (CP).
file | ComponentParameterItemInterface.h
The Component Parameter Item Interface (CPII) contains the functions setters and getters of the items constituing a parameter of a component. This interface belongs to the Component Plugin (CP).
file | ComponentParameterMapInterface.h
The Component Parameter Map Interface (CPMI) contains the functions managing the registration and deregistration of the parameters of a component. This interface belongs to the Component Plugin (CP).
file | ComponentScheduleInterface.h
The Component Schedule Interface (CSI) contains the functions setters and getters for the schedule parameters of a component. This interface belongs to the Component Plugin (CP).

Detailed Description

The Component Plugin (CP) is dedicated for managing the component XML metadata.

Dependencies

plugin_component__inherit__graph.svg

Component Plugin

The Component Plugin is used for organising components. From the user perspective, components can be thought of pre-compiled black boxes which accept inputs, execute some action and generate output. The openPASS System Editor Plugin allows users to interconnect components in order to realise a signal flow from a component output to another component's input. For instance, a component representing a sensor can read simulation data (e.g. the distance to the agent in front) and transmit them to a component representing an ADAS algorithm (e.g. an ACC), which determines a desirered acceleration or decceleration. These desired values can be further transmitted to another component representing an actuator which tries to manipulates the vehicle such that the desired acceleration values are reached. Hence, the concept of connectable components provides a highly modular and flexible way to build ADAS functions.

From the programmer's perspective, components are described by two files. On one hand, there is a library (*.dll) which contains the implementation of the component. On the other hand, there is an XML-file describing the component's metadata which will be needed by other plugins, e.g. to visualise the component, or by the simulation slave. The present Component Plugin provides classes for editing, loading and saving the XML metadata of components.

Component XML Definition

Fig. 1: The XML definition of a component

The structure of the component's XML metadata is illustrated in Fig. 1. Each block corresponds to an XML element introduced by XML tags. The "type" element can have the content "Algorithm", "Sensor", "Action", "Logical", "Misc" or "Subsystem" and characterises the role, a component plays in an ADAS. Usually (but not strictly), "Sensors" are meant to read data from the simulation world, "Actions" to set the agents' dynamical properties (e.g. accelerations) and "Algorithms" to evaluate data and to determine desired actions. Further, "Logical" components can be used to realise logical gatters and "Misc" components are those which cannot be categorized into one the aforementioned types. The type "Subsystem" constitutes a special component type used to represent component groups as a subsystem, see System Editor Plugin for details. The "title" element allows the user to give a name to the component. The "schedule" element has subelements defining the default values for the offset, cycle and response times. These properties control the execution of the component dll in a simulation. In particular, the offset time sets the time it takes to activate the component after the simulation has started. The cycle time constitutes the time interval in which the component is executed and the response time defines a time delay between updating inputs and outputs. The XML-file also contains a description of the parameters, inputs and outputs as detailed in the right side of Fig. 1. Each parameter, input or output has an ID which is strictly connected the ones used in the implementation (*.dll file). Further, title, data type (type) and unit are specified, which allow the System Editor to show these properties to the user and to check the compatibility of connections between components. In addition to these properties, a parameter item has a "value" element containing the default value of the parameter. An input item has an additional "cardinality" element which determines the number of connections in which this input can be involved. Note, that the implementation must take care of the cardinality, i.e. it must support multiple input signals under the same ID. It is also worth noting that the cardinality will be deprecated in later versions of openPASS. An example of an XML-file for a test component of type "Algorithm" is shown in Fig. 2, together with its view in the System Editor .

Fig. 2: An XML example of a test component and its appearance in the system editor

Remarks on the Implementation

The implementation of the Component Plugin strictly follows the XML structure discussed above. Each XML element corresponds to a class containing attributes referring to the content of the XML element. Further, setter and getter methods for manipulating the content are defined. More precisely, there are always two classes for each XML element: an interface and a model class. The interface class is meant to be referenced by other classes or plugins and only contains virtual declarations of the setter and getter methods. The model class inherits from the corresponding interface, implements the functionality of the methods and contains the attributes. Note, that a model is not meant to be referenced by other plugins.

The nomenclature of the classes is chosen such that a class name tells the developer which parts of the XML element it addresses. For instance, the name of the ComponentInputMapInterface class should imply that its methods address the map of all component inputs, i.e. it corresponds to the <inputs> XML element. If the developer wants to adjust a method concerning the title of a component parameter item, he/she should have a look at the classes ComponentParameterItemModel and ComponentParameterItemInterface.

It is worth noting at the end, that all components are registered in a map defined in ComponentMapInterface and ComponentMapModel classes. This map will be filled when component XML-files are loaded from a certain directory. As key identifiers of the components in the map, the names of the library (*.dll) files are used.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentInputItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
Classes
ComponentInputItemInterface.h File Reference
Component Plugin

The Component Input Item Interface (CIII) contains the functions setters and getters of the items constituing an input of a component. This interface belongs to the Component Plugin (CP). More...

Detailed Description

The Component Input Item Interface (CIII) contains the functions setters and getters of the items constituing an input of a component. This interface belongs to the Component Plugin (CP).

Definition in file ComponentInputItemInterface.h.

Go to the source code of this file.

Classes

class ComponentInputItemInterface
This class defines the items constituing an input of a component: More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentInputItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
ComponentInputItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19
20 #ifndef COMPONENTINPUTITEMINTERFACE_H
21 #define COMPONENTINPUTITEMINTERFACE_H
22
23 #include <QObject>
24 #include <QString>
25
34 class ComponentInputItemInterface : public QObject
35 {
36 Q_OBJECT
37
38 public:
39 using ID = unsigned int;
40 using Type = QString;
41 using Title = QString;
42 using Unit = QString;
43 using Cardinality = QString;
44
45 public:
46 explicit ComponentInputItemInterface(QObject * const parent = nullptr)
47 : QObject(parent) {}
48 virtual ~ComponentInputItemInterface() = default;
49
50 Q_SIGNALS:
51 //-----------------------------------------------------------------------------
55 //-----------------------------------------------------------------------------
56 void cleared() const;
57
58 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 void modifiedType() const;
63
64 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 void modifiedTitle() const;
69
70 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 void modifiedUnit() const;
75
76 //-----------------------------------------------------------------------------
79 //-----------------------------------------------------------------------------
80 void modifiedCardinality() const;
81
82 public:
83 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 virtual bool clear() = 0;
91
92 public:
93 //-----------------------------------------------------------------------------
98 //-----------------------------------------------------------------------------
99 virtual bool setID(ComponentInputItemInterface::ID const & id) = 0;
100
101 //-----------------------------------------------------------------------------
105 //-----------------------------------------------------------------------------
106 virtual ComponentInputItemInterface::ID getID() const = 0;
107
108 public:
109 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------
115 virtual bool setType(ComponentInputItemInterface::Type const & type) = 0;
116
117 //-----------------------------------------------------------------------------
121 //-----------------------------------------------------------------------------
122 virtual ComponentInputItemInterface::Type getType() const = 0;
123
124 public:
125 //-----------------------------------------------------------------------------
130 //-----------------------------------------------------------------------------
131 virtual bool setTitle(ComponentInputItemInterface::Title const & title) = 0;
132
133 //-----------------------------------------------------------------------------
137 //-----------------------------------------------------------------------------
138 virtual ComponentInputItemInterface::Title getTitle() const = 0;
139
140 public:
141 //-----------------------------------------------------------------------------
146 //-----------------------------------------------------------------------------
147 virtual bool setUnit(ComponentInputItemInterface::Unit const & unit) = 0;
148
149 //-----------------------------------------------------------------------------
153 //-----------------------------------------------------------------------------
154 virtual ComponentInputItemInterface::Unit getUnit() const = 0;
155
156 public:
157 //-----------------------------------------------------------------------------
162 //-----------------------------------------------------------------------------
163 virtual bool setCardinality(ComponentInputItemInterface::Cardinality const & cardinality) = 0;
164
165 //-----------------------------------------------------------------------------
169 //-----------------------------------------------------------------------------
170 virtual ComponentInputItemInterface::Cardinality getCardinality() const = 0;
171 };
172
173 #endif // COMPONENTINPUTITEMINTERFACE_H
ComponentInputItemInterface::setTitle
virtual bool setTitle(ComponentInputItemInterface::Title const &title)=0
Sets the title of the current registered input.
ComponentInputItemInterface::getUnit
virtual ComponentInputItemInterface::Unit getUnit() const =0
Gets the unit of the current registered input.
ComponentInputItemInterface
This class defines the items constituing an input of a component:
Definition: ComponentInputItemInterface.h:34
ComponentInputItemInterface::setCardinality
virtual bool setCardinality(ComponentInputItemInterface::Cardinality const &cardinality)=0
Sets the cardinality of the current registered input.
ComponentInputItemInterface::modifiedType
void modifiedType() const
Triggers signal to inform that the type of a component input has been modified.
ComponentInputItemInterface::cleared
void cleared() const
Triggers signal to inform that a component input has been successfully removed (used to update the ta...
ComponentInputItemInterface::getCardinality
virtual ComponentInputItemInterface::Cardinality getCardinality() const =0
Gets the cardinality of the current registered input.
ComponentInputItemInterface::setType
virtual bool setType(ComponentInputItemInterface::Type const &type)=0
Sets the type of the current registered input.
ComponentInputItemInterface::clear
virtual bool clear()=0
Resets the items constituing the input of the component. (e.g. function called when users pressing on...
ComponentInputItemInterface::setUnit
virtual bool setUnit(ComponentInputItemInterface::Unit const &unit)=0
Sets the unit of the current registered input.
ComponentInputItemInterface::modifiedUnit
void modifiedUnit() const
Triggers signal to inform that the unit of a component input has been modified.
ComponentInputItemInterface::modifiedTitle
void modifiedTitle() const
Triggers signal to inform that the title of a component input has been modified.
ComponentInputItemInterface::getTitle
virtual ComponentInputItemInterface::Title getTitle() const =0
Gets the title of the current registered input.
ComponentInputItemInterface::modifiedCardinality
void modifiedCardinality() const
Triggers signal to inform that the cadinality of a component input has been modified.
ComponentInputItemInterface::setID
virtual bool setID(ComponentInputItemInterface::ID const &id)=0
Sets a key identifier id for the current registered input.
ComponentInputItemInterface::getID
virtual ComponentInputItemInterface::ID getID() const =0
Gets the key identifier of the current registered input.
ComponentInputItemInterface::getType
virtual ComponentInputItemInterface::Type getType() const =0
Gets the type of the current registered input.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentInputMapInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
Classes
ComponentInputMapInterface.h File Reference
Component Plugin

The Component Input Map Interface (CIMI) contains the functions managing the registration and deregistration of the inputs of a component. This interface belongs to the Component Plugin (CP). More...

Detailed Description

The Component Input Map Interface (CIMI) contains the functions managing the registration and deregistration of the inputs of a component. This interface belongs to the Component Plugin (CP).

Definition in file ComponentInputMapInterface.h.

Go to the source code of this file.

Classes

class ComponentInputMapInterface
This class manages the registration and deregistration of inputs of a component. It provides a map as container with unique identifiers as a keys to sort the inputs. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentInputMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
ComponentInputMapInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19
20 #ifndef COMPONENTINPUTMAPINTERFACE_H
21 #define COMPONENTINPUTMAPINTERFACE_H
22
23 #include "openPASS-Component/ComponentInputItemInterface.h"
24 #include <QMap>
25 #include <QObject>
26
32 class ComponentInputMapInterface : public QObject
33 {
34 Q_OBJECT
35
36 public:
37 using ID = ComponentInputItemInterface::ID;
38 using Item = ComponentInputItemInterface;
39 using Index = int;
40
41 public:
42 using Map = QMap<ID, Item *>;
43 using Iterator = Map::Iterator;
44 using ConstIterator = Map::ConstIterator;
45
46 public:
47 explicit ComponentInputMapInterface(QObject * const parent = nullptr)
48 : QObject(parent) {}
49 virtual ~ComponentInputMapInterface() = default;
50
51 Q_SIGNALS:
52 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 void added(Item *item) const;
56
57 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 void cleared() const;
62
63 //-----------------------------------------------------------------------------
66 //-----------------------------------------------------------------------------
67 void modifiedID() const;
68
69 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 void removed(Item *item) const;
73
74 public:
75 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
81 virtual bool add(ComponentInputMapInterface::ID const & id) = 0;
82
83 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 virtual bool add(ComponentInputMapInterface::ID const & id,
92 ComponentInputMapInterface::Item * const item) = 0;
93
94 //-----------------------------------------------------------------------------
100 //-----------------------------------------------------------------------------
101 virtual bool add(ComponentInputMapInterface::Item * const item) = 0;
102
103 public:
104 //-----------------------------------------------------------------------------
110 //-----------------------------------------------------------------------------
111 virtual ComponentInputMapInterface::Iterator begin() = 0;
112
113 //-----------------------------------------------------------------------------
119 //-----------------------------------------------------------------------------
120 virtual ComponentInputMapInterface::ConstIterator begin() const = 0;
121
122 public:
123 //-----------------------------------------------------------------------------
127 //-----------------------------------------------------------------------------
128 virtual bool clear() = 0;
129
130 public:
131 //-----------------------------------------------------------------------------
135 //-----------------------------------------------------------------------------
136 virtual int count() const = 0;
137
138 public:
139 //-----------------------------------------------------------------------------
145 //-----------------------------------------------------------------------------
146 virtual bool contains(ComponentInputMapInterface::ID const & id) const = 0;
147
148 //-----------------------------------------------------------------------------
154 //-----------------------------------------------------------------------------
155 virtual bool contains(ComponentInputMapInterface::Item * const item) const = 0;
156
157 //-----------------------------------------------------------------------------
163 //-----------------------------------------------------------------------------
164 virtual bool contains(ComponentInputMapInterface::Index const & index) const = 0;
165
166 public:
167 //-----------------------------------------------------------------------------
172 //-----------------------------------------------------------------------------
173 virtual ComponentInputMapInterface::Iterator end() = 0;
174
175 //-----------------------------------------------------------------------------
180 //-----------------------------------------------------------------------------
181 virtual ComponentInputMapInterface::ConstIterator end() const = 0;
182
183 public:
184 //-----------------------------------------------------------------------------
191 //-----------------------------------------------------------------------------
192 virtual bool setID(ComponentInputMapInterface::Item * const item,
193 ComponentInputMapInterface::ID const & id) = 0;
194
195 //-----------------------------------------------------------------------------
199 //-----------------------------------------------------------------------------
200 virtual ComponentInputMapInterface::ID generateID() const = 0;
201
202 //-----------------------------------------------------------------------------
208 //-----------------------------------------------------------------------------
209 virtual ComponentInputMapInterface::ID getID(ComponentInputMapInterface::Item * const item) const = 0;
210
211 //-----------------------------------------------------------------------------
217 //-----------------------------------------------------------------------------
218 virtual ComponentInputMapInterface::ID getID(ComponentInputMapInterface::Index const & index) const = 0;
219
220 public:
221 //-----------------------------------------------------------------------------
227 //-----------------------------------------------------------------------------
228 virtual ComponentInputMapInterface::Index getIndex(ComponentInputMapInterface::ID const & id) const = 0;
229
230 //-----------------------------------------------------------------------------
236 //-----------------------------------------------------------------------------
237 virtual ComponentInputMapInterface::Index getIndex(ComponentInputMapInterface::Item * const item) const = 0;
238
239 public:
240 //-----------------------------------------------------------------------------
245 //-----------------------------------------------------------------------------
246 virtual ComponentInputMapInterface::Item * getItem(ComponentInputMapInterface::ID const & id) const = 0;
247
248 //-----------------------------------------------------------------------------
253 //-----------------------------------------------------------------------------
254 virtual ComponentInputMapInterface::Item * getItem(ComponentInputMapInterface::Index const & index) const = 0;
255
256 public:
257 //-----------------------------------------------------------------------------
262 //-----------------------------------------------------------------------------
263 virtual bool remove(ComponentInputMapInterface::ID const & id) = 0;
264
265 //-----------------------------------------------------------------------------
270 //-----------------------------------------------------------------------------
271 virtual bool remove(ComponentInputMapInterface::Item * const item) = 0;
272
273 //-----------------------------------------------------------------------------
279 //-----------------------------------------------------------------------------
280 virtual bool remove(ComponentInputMapInterface::Index const & index) = 0;
281
282 public:
283 //-----------------------------------------------------------------------------
288 //-----------------------------------------------------------------------------
289 virtual Item * createInput() const = 0;
290 };
291
292 #endif // COMPONENTINPUTMAPINTERFACE_H
ComponentInputMapInterface::generateID
virtual ComponentInputMapInterface::ID generateID() const =0
Generates a unique key identifier for the new input registered in the map.
ComponentInputMapInterface::createInput
virtual Item * createInput() const =0
Creates a new component input item and returns a pointer to it.
ComponentInputMapInterface::count
virtual int count() const =0
Counts the number of component input related-objects registered.
ComponentInputMapInterface::begin
virtual ComponentInputMapInterface::Iterator begin()=0
Gets an iterator pointing at the first component input related-object in the map. ...
ComponentInputMapInterface::getIndex
virtual ComponentInputMapInterface::Index getIndex(ComponentInputMapInterface::ID const &id) const =0
Gets the index position in the container (map) of the input related-object with the key identifier id...
ComponentInputMapInterface::contains
virtual bool contains(ComponentInputMapInterface::ID const &id) const =0
Verifies if the container (map) contains the component input related-object under the key identifier ...
ComponentInputMapInterface::getID
virtual ComponentInputMapInterface::ID getID(ComponentInputMapInterface::Item *const item) const =0
Gets the key identifier of the component input related-object item from the container (map)...
ComponentInputItemInterface
This class defines the items constituing an input of a component:
Definition: ComponentInputItemInterface.h:34
ComponentInputMapInterface::added
void added(Item *item) const
Triggers signal to inform that a component input has been registered.
ComponentInputMapInterface::end
virtual ComponentInputMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last component input related-object.
ComponentInputItemInterface.h
The Component Input Item Interface (CIII) contains the functions setters and getters of the items con...
ComponentInputMapInterface
This class manages the registration and deregistration of inputs of a component. It provides a map as...
Definition: ComponentInputMapInterface.h:32
ComponentInputMapInterface::ID
ComponentInputItemInterface::ID ID
The input&#39;s key.
Definition: ComponentInputMapInterface.h:37
ComponentInputMapInterface::getItem
virtual ComponentInputMapInterface::Item * getItem(ComponentInputMapInterface::ID const &id) const =0
Gets the input related-object under the key identifier id.
ComponentInputMapInterface::modifiedID
void modifiedID() const
Triggers signal to inform that a key id of a component input has been modified.
ComponentInputMapInterface::add
virtual bool add(ComponentInputMapInterface::ID const &id)=0
Registers a new input related-object under the key identifier id.
ComponentInputMapInterface::Map
QMap< ID, Item * > Map
The container registering inputs.
Definition: ComponentInputMapInterface.h:42
ComponentInputMapInterface::clear
virtual bool clear()=0
Removes all the input related-objects registered (clear the container).
ComponentInputMapInterface::setID
virtual bool setID(ComponentInputMapInterface::Item *const item, ComponentInputMapInterface::ID const &id)=0
Sets a key identifier id for the component input related-object item registered in the container (map...
ComponentInputMapInterface::removed
void removed(Item *item) const
Triggers signal to inform that a component input has been deregistered.
ComponentInputMapInterface::cleared
void cleared() const
Triggers signal to inform that all inputs have been successfully removed from the container (map)...
ComponentInputMapInterface::Item
ComponentInputItemInterface Item
The object defining input.
Definition: ComponentInputMapInterface.h:38
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
Classes
ComponentInterface.h File Reference
Component Plugin

The Component Interface (CI) contains the functions creating components. This interface belongs to the Component Plugin (CP). More...

Detailed Description

The Component Interface (CI) contains the functions creating components. This interface belongs to the Component Plugin (CP).

Definition in file ComponentInterface.h.

Go to the source code of this file.

Classes

class ComponentInterface
This class manages creating new component and also creating the map which registers created components. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
ComponentInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
17 //-----------------------------------------------------------------------------
18
19 #ifndef COMPONENTINTERFACE_H
20 #define COMPONENTINTERFACE_H
21
22 #include "openPASS/ServiceInterface.h"
23 #include "openPASS-Component/ComponentItemInterface.h"
24 #include "openPASS-Component/ComponentMapInterface.h"
25 #include <QObject>
26
27 static ServiceManagerInterface::ID const ComponentInterfaceID =
28 ServiceManagerInterfaceID("openPASS.Component.ComponentInterface");
29
34 class ComponentInterface : public QObject,
35 public ServiceInterface<ComponentInterface, ComponentInterfaceID>
36 {
37 Q_OBJECT
38
39 public:
40 using Item = ComponentItemInterface;
41 using Map = ComponentMapInterface;
42
43 public:
44 explicit ComponentInterface(QObject * const parent = nullptr)
45 : QObject(parent), ServiceInterface(this) {}
46 virtual ~ComponentInterface() = default;
47
48 public:
49 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 virtual ComponentInterface::Item * createComponentItem(QObject * const parent) const = 0;
56
57 //-----------------------------------------------------------------------------
63 //-----------------------------------------------------------------------------
64 virtual ComponentInterface::Map * createComponentMap(QObject * const parent) const = 0;
65 };
66
67 #endif // COMPONENTINTERFACE_H
ComponentMapInterface.h
The Component Map Interface (CMI) contains the functions managing the registration and deregistration...
ServiceInterface.h
...
ComponentItemInterface.h
The Component Item Interface (CII) contains the functions setters and getters of the items constituin...
ComponentItemInterface
This class defines the items constituing a component:
Definition: ComponentItemInterface.h:40
ComponentMapInterface
This class manages the registration and deregistration of objects defining a component (component rel...
Definition: ComponentMapInterface.h:32
ComponentInterface::createComponentMap
virtual ComponentInterface::Map * createComponentMap(QObject *const parent) const =0
Creates a map to register components which is owned by the parent object parent.
ComponentInterface::createComponentItem
virtual ComponentInterface::Item * createComponentItem(QObject *const parent) const =0
Creates the object defining a component with as parent object parent.
ComponentInterface
This class manages creating new component and also creating the map which registers created component...
Definition: ComponentInterface.h:34
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
Classes
ComponentItemInterface.h File Reference
Component Plugin

The Component Item Interface (CII) contains the functions setters and getters of the items constituing a component. This interface belongs to the Component Plugin (CP). More...

Detailed Description

The Component Item Interface (CII) contains the functions setters and getters of the items constituing a component. This interface belongs to the Component Plugin (CP).

Definition in file ComponentItemInterface.h.

Go to the source code of this file.

Classes

class ComponentItemInterface
This class defines the items constituing a component: More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
ComponentItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19
20 #ifndef COMPONENTITEMINTERFACE_H
21 #define COMPONENTITEMINTERFACE_H
22
23 #include "openPASS-Component/ComponentInputMapInterface.h"
24 #include "openPASS-Component/ComponentOutputMapInterface.h"
25 #include "openPASS-Component/ComponentParameterMapInterface.h"
26 #include "openPASS-Component/ComponentScheduleInterface.h"
27 #include <QObject>
28 #include <QString>
29
40 class ComponentItemInterface : public QObject
41 {
42 Q_OBJECT
43
44 public:
45 using Name = QString;
46 enum class Type : unsigned char
47 {
48 Action = 0,
49 Algorithm = 1,
50 Sensor = 2,
51 Misc = 3,
52 Logical = 4,
53 Subsystem = 5
54 };
55 using Title = QString;
56 using Schedule = ComponentScheduleInterface;
57 using ParameterMap = ComponentParameterMapInterface;
58 using InputMap = ComponentInputMapInterface;
59 using OutputMap = ComponentOutputMapInterface;
60
61 public:
62 explicit ComponentItemInterface(QObject * const parent = nullptr)
63 : QObject(parent) {}
64 virtual ~ComponentItemInterface() = default;
65
66 Q_SIGNALS:
67 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 void cleared() const;
73
74 //-----------------------------------------------------------------------------
78 //-----------------------------------------------------------------------------
79 void loaded() const;
80
81 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 void saved() const;
85
86 Q_SIGNALS:
87 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 void modifiedType() const;
91
92 //-----------------------------------------------------------------------------
94 //-----------------------------------------------------------------------------
95 void modifiedTitle() const;
96
97 //-----------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------
100 void modifiedName();
101
102 public:
103 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
110 virtual bool clear() = 0;
111
112 //-----------------------------------------------------------------------------
119 //-----------------------------------------------------------------------------
120 virtual bool load(QString const & filepath) = 0;
121
122 //-----------------------------------------------------------------------------
129 //-----------------------------------------------------------------------------
130 virtual bool save(QString const & filepath) const = 0;
131
132 public:
133 //-----------------------------------------------------------------------------
137 //-----------------------------------------------------------------------------
138 virtual ComponentItemInterface::Name getName() const = 0;
139
140 public:
141 //-----------------------------------------------------------------------------
145 //-----------------------------------------------------------------------------
146 virtual bool setType(ComponentItemInterface::Type const & type) = 0;
147
148 //-----------------------------------------------------------------------------
152 //-----------------------------------------------------------------------------
153 virtual ComponentItemInterface::Type getType() const = 0;
154
155 public:
156 //-----------------------------------------------------------------------------
160 //-----------------------------------------------------------------------------
161 virtual bool setTitle(ComponentItemInterface::Title const & title) = 0;
162
163 //-----------------------------------------------------------------------------
167 //-----------------------------------------------------------------------------
168 virtual ComponentItemInterface::Title getTitle() const = 0;
169
170 public:
171 //-----------------------------------------------------------------------------
176 //-----------------------------------------------------------------------------
177 virtual ComponentItemInterface::Schedule * getSchedule() const = 0;
178
179 //-----------------------------------------------------------------------------
183 //-----------------------------------------------------------------------------
184 virtual ComponentItemInterface::ParameterMap * getParameters() const = 0;
185
186 //-----------------------------------------------------------------------------
190 //-----------------------------------------------------------------------------
191 virtual ComponentItemInterface::InputMap * getInputs() const = 0;
192
193 //-----------------------------------------------------------------------------
197 //-----------------------------------------------------------------------------
198 virtual ComponentItemInterface::OutputMap * getOutputs() const = 0;
199 };
200
201 #endif // COMPONENTITEMINTERFACE_H
ComponentItemInterface::getParameters
virtual ComponentItemInterface::ParameterMap * getParameters() const =0
Gets the parameters of the current registered component.
ComponentItemInterface::setType
virtual bool setType(ComponentItemInterface::Type const &type)=0
Sets the type of the current registered component.
ComponentInputMapInterface.h
The Component Input Map Interface (CIMI) contains the functions managing the registration and deregis...
ComponentItemInterface
This class defines the items constituing a component:
Definition: ComponentItemInterface.h:40
ComponentItemInterface::saved
void saved() const
Triggers signal to inform that a component has been saved successfully.
ComponentItemInterface::getOutputs
virtual ComponentItemInterface::OutputMap * getOutputs() const =0
Gets the outputs of the current registered component.
ComponentItemInterface::getSchedule
virtual ComponentItemInterface::Schedule * getSchedule() const =0
Gets the simulation schedule related parameters of the current registered component.
ComponentOutputMapInterface
This class manages the registration and deregistration of outputs of a component. It provides a map a...
Definition: ComponentOutputMapInterface.h:32
ComponentOutputMapInterface.h
The Component Output Map Interface (COMI) contains the functions managing the registration and deregi...
ComponentItemInterface::Title
QString Title
The Title of the component.
Definition: ComponentItemInterface.h:55
ComponentScheduleInterface
This class defines the schedule parameters of a component:
Definition: ComponentScheduleInterface.h:31
ComponentItemInterface::getInputs
virtual ComponentItemInterface::InputMap * getInputs() const =0
Gets the inputs of the current registered component.
ComponentItemInterface::getTitle
virtual ComponentItemInterface::Title getTitle() const =0
Gets the title of the current registered component.
ComponentItemInterface::modifiedTitle
void modifiedTitle() const
Triggers signal to inform that the title of a component has been modified.
ComponentItemInterface::load
virtual bool load(QString const &filepath)=0
Loads a component from a file located in the given path filepath. (e.g. function called when users pr...
ComponentItemInterface::getName
virtual ComponentItemInterface::Name getName() const =0
Gets the key name of the current component registered in the container (map).
ComponentItemInterface::clear
virtual bool clear()=0
Clears the items constituing the component. (e.g. function called when users pressing on <New compone...
ComponentInputMapInterface
This class manages the registration and deregistration of inputs of a component. It provides a map as...
Definition: ComponentInputMapInterface.h:32
ComponentItemInterface::getType
virtual ComponentItemInterface::Type getType() const =0
Gets the type of the current registered component.
ComponentItemInterface::save
virtual bool save(QString const &filepath) const =0
Saves a component to a file stored in the given path filepath. (e.g. function called when users press...
ComponentItemInterface::modifiedName
void modifiedName()
Triggers signal to inform that the name (library) of a component has been modified.
ComponentItemInterface::setTitle
virtual bool setTitle(ComponentItemInterface::Title const &title)=0
Sets a title to the current registered component.
ComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component. It provides a map as container with unique identifiers as a keys to sort the parameters.
Definition: ComponentParameterMapInterface.h:33
ComponentItemInterface::modifiedType
void modifiedType() const
Triggers signal to inform that the type of a component has been modified.
ComponentItemInterface::Name
QString Name
The component&#39;s key name.
Definition: ComponentItemInterface.h:45
ComponentItemInterface::cleared
void cleared() const
Triggers signal to inform that a component has been reset successfully (used to update the Window Vie...
ComponentScheduleInterface.h
The Component Schedule Interface (CSI) contains the functions setters and getters for the schedule pa...
ComponentParameterMapInterface.h
The Component Parameter Map Interface (CPMI) contains the functions managing the registration and der...
ComponentItemInterface::loaded
void loaded() const
Triggers signal to inform that a component has been loaded successfully (e.g. used to update the Wind...
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentMapInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
Classes
ComponentMapInterface.h File Reference
Component Plugin

The Component Map Interface (CMI) contains the functions managing the registration and deregistration of components. This interface belongs to the Component Plugin (CP). More...

Detailed Description

The Component Map Interface (CMI) contains the functions managing the registration and deregistration of components. This interface belongs to the Component Plugin (CP).

Definition in file ComponentMapInterface.h.

Go to the source code of this file.

Classes

class ComponentMapInterface
This class manages the registration and deregistration of objects defining a component (component related-objects) using as identifier a key name. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
ComponentMapInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19
20 #ifndef COMPONENTMAPINTERFACE_H
21 #define COMPONENTMAPINTERFACE_H
22
23 #include "openPASS-Component/ComponentItemInterface.h"
24 #include <QMap>
25 #include <QObject>
26 #include <QString>
27
32 class ComponentMapInterface : public QObject
33 {
34 Q_OBJECT
35
36 public:
37 using Name = ComponentItemInterface::Name;
38 using Item = ComponentItemInterface;
39 using Index = int;
40
41 public:
42 using Map = QMap<Name, Item *>;
43 using Iterator = Map::Iterator;
44 using ConstIterator = Map::ConstIterator;
45
46 public:
47 explicit ComponentMapInterface(QObject * const parent = nullptr)
48 : QObject(parent) {}
49 virtual ~ComponentMapInterface() = default;
50
51 Q_SIGNALS:
52 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 void added() const;
56
57 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 void modifiedName() const;
62
63 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
66 void removed() const;
67
68 public:
69 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 virtual bool add(ComponentMapInterface::Name const & name) = 0;
76
77 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 virtual bool add(ComponentMapInterface::Name const & name,
85 ComponentMapInterface::Item * const item) = 0;
86
87 //-----------------------------------------------------------------------------
95 //-----------------------------------------------------------------------------
96 virtual bool add(ComponentMapInterface::Name const & name,
97 QString const & filepath) = 0;
98
99 public:
100 //-----------------------------------------------------------------------------
105 //-----------------------------------------------------------------------------
106 virtual ComponentMapInterface::Iterator begin() = 0;
107
108 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------
115 virtual ComponentMapInterface::ConstIterator begin() const = 0;
116
117 public:
118 //-----------------------------------------------------------------------------
122 //-----------------------------------------------------------------------------
123 virtual bool clear() = 0;
124
125 public:
126 //-----------------------------------------------------------------------------
130 //-----------------------------------------------------------------------------
131 virtual int count() const = 0;
132
133 public:
134 //-----------------------------------------------------------------------------
140 //-----------------------------------------------------------------------------
141 virtual bool contains(ComponentMapInterface::Name const & name) const = 0;
142
143 //-----------------------------------------------------------------------------
148 //-----------------------------------------------------------------------------
149 virtual bool contains(ComponentMapInterface::Item * const item) const = 0;
150
151 //-----------------------------------------------------------------------------
157 //-----------------------------------------------------------------------------
158 virtual bool contains(ComponentMapInterface::Index const & index) const = 0;
159
160 public:
161 //-----------------------------------------------------------------------------
166 //-----------------------------------------------------------------------------
167 virtual ComponentMapInterface::Iterator end() = 0;
168
169 //-----------------------------------------------------------------------------
174 //-----------------------------------------------------------------------------
175 virtual ComponentMapInterface::ConstIterator end() const = 0;
176
177 public:
178 //-----------------------------------------------------------------------------
185 //-----------------------------------------------------------------------------
186 virtual bool setName(ComponentMapInterface::Item * const item,
187 ComponentMapInterface::Name const & name) = 0;
188
189 //-----------------------------------------------------------------------------
195 //-----------------------------------------------------------------------------
196 virtual ComponentMapInterface::Name getName(ComponentMapInterface::Item * const item) const = 0;
197
198 //-----------------------------------------------------------------------------
204 //-----------------------------------------------------------------------------
205 virtual ComponentMapInterface::Name getName(ComponentMapInterface::Index const & index) const = 0;
206
207 public:
208 //-----------------------------------------------------------------------------
214 //-----------------------------------------------------------------------------
215 virtual ComponentMapInterface::Index getIndex(ComponentMapInterface::Name const & name) const = 0;
216
217 //-----------------------------------------------------------------------------
223 //-----------------------------------------------------------------------------
224 virtual ComponentMapInterface::Index getIndex(ComponentMapInterface::Item * const item) const = 0;
225
226 public:
227 //-----------------------------------------------------------------------------
232 //-----------------------------------------------------------------------------
233 virtual ComponentMapInterface::Item * getItem(ComponentMapInterface::Name const & name) const = 0;
234
235 //-----------------------------------------------------------------------------
241 //-----------------------------------------------------------------------------
242 virtual ComponentMapInterface::Item * getItem(ComponentMapInterface::Index const & index) const = 0;
243
244 public:
245 //-----------------------------------------------------------------------------
250 //-----------------------------------------------------------------------------
251 virtual bool remove(ComponentMapInterface::Name const & name) = 0;
252
253 //-----------------------------------------------------------------------------
258 //-----------------------------------------------------------------------------
259 virtual bool remove(ComponentMapInterface::Item * const item) = 0;
260
261 //-----------------------------------------------------------------------------
267 //-----------------------------------------------------------------------------
268 virtual bool remove(ComponentMapInterface::Index const & index) = 0;
269 virtual bool remove(ComponentItemInterface::Type const & type) = 0;
270
271 public:
272 virtual QList<Item*> values() const = 0;
273 };
274
275 #endif // COMPONENTMAPINTERFACE_H
ComponentMapInterface::end
virtual ComponentMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last component related-object.
ComponentItemInterface.h
The Component Item Interface (CII) contains the functions setters and getters of the items constituin...
ComponentMapInterface::clear
virtual bool clear()=0
Removes all the component related-objects registered (clear the container).
ComponentItemInterface
This class defines the items constituing a component:
Definition: ComponentItemInterface.h:40
ComponentMapInterface::setName
virtual bool setName(ComponentMapInterface::Item *const item, ComponentMapInterface::Name const &name)=0
Sets a key name name for the component related-object item registered in the container (map)...
ComponentMapInterface
This class manages the registration and deregistration of objects defining a component (component rel...
Definition: ComponentMapInterface.h:32
ComponentMapInterface::begin
virtual ComponentMapInterface::Iterator begin()=0
Gets an iterator pointing at the first component related-object in the map.
ComponentMapInterface::add
virtual bool add(ComponentMapInterface::Name const &name)=0
Registers a new component related-object under the key name name.
ComponentMapInterface::Map
QMap< Name, Item * > Map
The container registering components.
Definition: ComponentMapInterface.h:42
ComponentMapInterface::Name
ComponentItemInterface::Name Name
The component&#39;s key name.
Definition: ComponentMapInterface.h:37
ComponentMapInterface::count
virtual int count() const =0
Counts the number of component related-objects registered.
ComponentMapInterface::getIndex
virtual ComponentMapInterface::Index getIndex(ComponentMapInterface::Name const &name) const =0
Gets the index position in the container (map) of the component related-object with the key name name...
ComponentMapInterface::getItem
virtual ComponentMapInterface::Item * getItem(ComponentMapInterface::Name const &name) const =0
Gets the component related-object under the key name name.
ComponentItemInterface::Name
QString Name
The component&#39;s key name.
Definition: ComponentItemInterface.h:45
ComponentMapInterface::contains
virtual bool contains(ComponentMapInterface::Name const &name) const =0
Verifies if the container (map) contains the component related-object under the key name name...
ComponentMapInterface::modifiedName
void modifiedName() const
Triggers signal to inform that a key name of a registered component has been modified.
ComponentMapInterface::removed
void removed() const
Triggers signal to inform that a component has been deregistered.
ComponentMapInterface::getName
virtual ComponentMapInterface::Name getName(ComponentMapInterface::Item *const item) const =0
Gets the key name of the component related-object item from the container (map).
ComponentMapInterface::added
void added() const
Triggers signal to inform that a component has been registered.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentOutputItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
Classes
ComponentOutputItemInterface.h File Reference
Component Plugin

The Component Output Item Interface (COII) contains the functions setters and getters of the items constituing an output of a component. This interface belongs to the Component Plugin (CP). More...

Detailed Description

The Component Output Item Interface (COII) contains the functions setters and getters of the items constituing an output of a component. This interface belongs to the Component Plugin (CP).

Definition in file ComponentOutputItemInterface.h.

Go to the source code of this file.

Classes

class ComponentOutputItemInterface
This class defines the items constituing an output of a component: More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentOutputItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
ComponentOutputItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19
20 #ifndef COMPONENTOUTPUTITEMINTERFACE_H
21 #define COMPONENTOUTPUTITEMINTERFACE_H
22
23 #include <QObject>
24 #include <QString>
25
33 class ComponentOutputItemInterface : public QObject
34 {
35 Q_OBJECT
36
37 public:
38 using ID = unsigned int;
39 using Type = QString;
40 using Title = QString;
41 using Unit = QString;
42
43 public:
44 explicit ComponentOutputItemInterface(QObject * const parent = nullptr)
45 : QObject(parent) {}
46 virtual ~ComponentOutputItemInterface() = default;
47
48 Q_SIGNALS:
49 //-----------------------------------------------------------------------------
53 //-----------------------------------------------------------------------------
54 void cleared() const;
55
56 //-----------------------------------------------------------------------------
59 //-----------------------------------------------------------------------------
60 void modifiedType() const;
61
62 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
66 void modifiedTitle() const;
67
68 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 void modifiedUnit() const;
73
74 public:
75 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 virtual bool clear() = 0;
83
84 public:
85 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 virtual bool setID(ComponentOutputItemInterface::ID const & id) = 0;
92
93 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 virtual ComponentOutputItemInterface::ID getID() const = 0;
99
100 public:
101 //-----------------------------------------------------------------------------
106 //-----------------------------------------------------------------------------
107 virtual bool setType(ComponentOutputItemInterface::Type const & type) = 0;
108
109 //-----------------------------------------------------------------------------
113 //-----------------------------------------------------------------------------
114 virtual ComponentOutputItemInterface::Type getType() const = 0;
115
116 public:
117 //-----------------------------------------------------------------------------
122 //-----------------------------------------------------------------------------
123 virtual bool setTitle(ComponentOutputItemInterface::Title const & title) = 0;
124
125 //-----------------------------------------------------------------------------
129 //-----------------------------------------------------------------------------
130 virtual ComponentOutputItemInterface::Title getTitle() const = 0;
131
132 public:
133 //-----------------------------------------------------------------------------
138 //-----------------------------------------------------------------------------
139 virtual bool setUnit(ComponentOutputItemInterface::Unit const & unit) = 0;
140
141 //-----------------------------------------------------------------------------
145 //-----------------------------------------------------------------------------
146 virtual ComponentOutputItemInterface::Unit getUnit() const = 0;
147 };
148
149 #endif // COMPONENTOUTPUTITEMINTERFACE_H
ComponentOutputItemInterface::getUnit
virtual ComponentOutputItemInterface::Unit getUnit() const =0
Gets the unit of the current registered output.
ComponentOutputItemInterface::setTitle
virtual bool setTitle(ComponentOutputItemInterface::Title const &title)=0
Sets the title of the current registered output.
ComponentOutputItemInterface::getTitle
virtual ComponentOutputItemInterface::Title getTitle() const =0
Gets the title of the current registered output.
ComponentOutputItemInterface::setID
virtual bool setID(ComponentOutputItemInterface::ID const &id)=0
Sets a key identifier id for the current registered output.
ComponentOutputItemInterface::setType
virtual bool setType(ComponentOutputItemInterface::Type const &type)=0
Sets the type of the current registered output.
ComponentOutputItemInterface::getID
virtual ComponentOutputItemInterface::ID getID() const =0
Gets the key identifier of the current registered output.
ComponentOutputItemInterface::modifiedType
void modifiedType() const
Triggers signal to inform that the type of a component output has been modified.
ComponentOutputItemInterface::cleared
void cleared() const
Triggers signal to inform that a component output has been successfully removed (used to update the t...
ComponentOutputItemInterface::setUnit
virtual bool setUnit(ComponentOutputItemInterface::Unit const &unit)=0
Sets the unit of the current registered output.
ComponentOutputItemInterface::clear
virtual bool clear()=0
Resets the items constituing the output of the component. (e.g. function called when users pressing o...
ComponentOutputItemInterface
This class defines the items constituing an output of a component:
Definition: ComponentOutputItemInterface.h:33
ComponentOutputItemInterface::getType
virtual ComponentOutputItemInterface::Type getType() const =0
Gets the type of the current registered output.
ComponentOutputItemInterface::modifiedTitle
void modifiedTitle() const
Triggers signal to inform that the title of a component output has been modified. ...
ComponentOutputItemInterface::modifiedUnit
void modifiedUnit() const
Triggers signal to inform that the unit of a component output has been modified.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentOutputMapInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
Classes
ComponentOutputMapInterface.h File Reference
Component Plugin

The Component Output Map Interface (COMI) contains the functions managing the registration and deregistration of the outputs of a component. This interface belongs to the Component Plugin (CP). More...

Detailed Description

The Component Output Map Interface (COMI) contains the functions managing the registration and deregistration of the outputs of a component. This interface belongs to the Component Plugin (CP).

Definition in file ComponentOutputMapInterface.h.

Go to the source code of this file.

Classes

class ComponentOutputMapInterface
This class manages the registration and deregistration of outputs of a component. It provides a map as container with unique identifiers as a keys to sort the outputs. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentOutputMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
ComponentOutputMapInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19
20 #ifndef COMPONENTOUTPUTMAPINTERFACE_H
21 #define COMPONENTOUTPUTMAPINTERFACE_H
22
23 #include "openPASS-Component/ComponentOutputItemInterface.h"
24 #include <QMap>
25 #include <QObject>
26
32 class ComponentOutputMapInterface : public QObject
33 {
34 Q_OBJECT
35
36 public:
37 using ID = ComponentOutputItemInterface::ID;
38 using Item = ComponentOutputItemInterface;
39 using Index = int;
40
41 public:
42 using Map = QMap<ID, Item *>;
43 using Iterator = Map::Iterator;
44 using ConstIterator = Map::ConstIterator;
45
46 public:
47 explicit ComponentOutputMapInterface(QObject * const parent = nullptr)
48 : QObject(parent) {}
49 virtual ~ComponentOutputMapInterface() = default;
50
51 Q_SIGNALS:
52 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 void added(Item *item) const;
56
57 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 void cleared() const;
62
63 //-----------------------------------------------------------------------------
66 //-----------------------------------------------------------------------------
67 void modifiedID() const;
68
69 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 void removed(Item *item) const;
73
74 public:
75 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
81 virtual bool add(ComponentOutputMapInterface::ID const & id) = 0;
82
83 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 virtual bool add(ComponentOutputMapInterface::ID const & id,
92 ComponentOutputMapInterface::Item * const item) = 0;
93
94 //-----------------------------------------------------------------------------
100 //-----------------------------------------------------------------------------
101 virtual bool add(ComponentOutputMapInterface::Item * const item) = 0;
102
103 public:
104 //-----------------------------------------------------------------------------
110 //-----------------------------------------------------------------------------
111 virtual ComponentOutputMapInterface::Iterator begin() = 0;
112
113 //-----------------------------------------------------------------------------
119 //-----------------------------------------------------------------------------
120 virtual ComponentOutputMapInterface::ConstIterator begin() const = 0;
121
122 public:
123 //-----------------------------------------------------------------------------
127 //-----------------------------------------------------------------------------
128 virtual bool clear() = 0;
129
130 public:
131 //-----------------------------------------------------------------------------
135 //-----------------------------------------------------------------------------
136 virtual int count() const = 0;
137
138 public:
139 //-----------------------------------------------------------------------------
145 //-----------------------------------------------------------------------------
146 virtual bool contains(ComponentOutputMapInterface::ID const & id) const = 0;
147
148 //-----------------------------------------------------------------------------
154 //-----------------------------------------------------------------------------
155 virtual bool contains(ComponentOutputMapInterface::Item * const item) const = 0;
156
157 //-----------------------------------------------------------------------------
163 //-----------------------------------------------------------------------------
164 virtual bool contains(ComponentOutputMapInterface::Index const & index) const = 0;
165
166 public:
167 //-----------------------------------------------------------------------------
172 //-----------------------------------------------------------------------------
173 virtual ComponentOutputMapInterface::Iterator end() = 0;
174
175 //-----------------------------------------------------------------------------
180 //-----------------------------------------------------------------------------
181 virtual ComponentOutputMapInterface::ConstIterator end() const = 0;
182
183 public:
184 //-----------------------------------------------------------------------------
191 //-----------------------------------------------------------------------------
192 virtual bool setID(ComponentOutputMapInterface::Item * const item,
193 ComponentOutputMapInterface::ID const & id) = 0;
194
195 //-----------------------------------------------------------------------------
199 //-----------------------------------------------------------------------------
200 virtual ComponentOutputMapInterface::ID generateID() const = 0;
201
202 //-----------------------------------------------------------------------------
208 //-----------------------------------------------------------------------------
209 virtual ComponentOutputMapInterface::ID getID(ComponentOutputMapInterface::Item * const item) const = 0;
210
211 //-----------------------------------------------------------------------------
217 //-----------------------------------------------------------------------------
218 virtual ComponentOutputMapInterface::ID getID(ComponentOutputMapInterface::Index const & index) const = 0;
219
220 public:
221 //-----------------------------------------------------------------------------
227 //-----------------------------------------------------------------------------
228 virtual ComponentOutputMapInterface::Index getIndex(ComponentOutputMapInterface::ID const & id) const = 0;
229
230 //-----------------------------------------------------------------------------
236 //-----------------------------------------------------------------------------
237 virtual ComponentOutputMapInterface::Index getIndex(ComponentOutputMapInterface::Item * const item) const = 0;
238
239 public:
240 //-----------------------------------------------------------------------------
245 //-----------------------------------------------------------------------------
246 virtual ComponentOutputMapInterface::Item * getItem(ComponentOutputMapInterface::ID const & id) const = 0;
247
248 //-----------------------------------------------------------------------------
253 //-----------------------------------------------------------------------------
254 virtual ComponentOutputMapInterface::Item * getItem(ComponentOutputMapInterface::Index const & index) const = 0;
255
256 public:
257 //-----------------------------------------------------------------------------
262 //-----------------------------------------------------------------------------
263 virtual bool remove(ComponentOutputMapInterface::ID const & id) = 0;
264
265 //-----------------------------------------------------------------------------
270 //-----------------------------------------------------------------------------
271 virtual bool remove(ComponentOutputMapInterface::Item * const item) = 0;
272
273 //-----------------------------------------------------------------------------
279 //-----------------------------------------------------------------------------
280 virtual bool remove(ComponentOutputMapInterface::Index const & index) = 0;
281
282 public:
283 //-----------------------------------------------------------------------------
289 //-----------------------------------------------------------------------------
290 virtual Item * createOutput() const = 0;
291 };
292
293 #endif // COMPONENTOUTPUTMAPINTERFACE_H
ComponentOutputItemInterface.h
The Component Output Item Interface (COII) contains the functions setters and getters of the items co...
ComponentOutputMapInterface::createOutput
virtual Item * createOutput() const =0
Creates a component output item and returns a pointer to it.
ComponentOutputMapInterface::Map
QMap< ID, Item * > Map
The container registering outputs.
Definition: ComponentOutputMapInterface.h:42
ComponentOutputMapInterface::added
void added(Item *item) const
Triggers signal to inform that a component output has been registered.
ComponentOutputMapInterface::clear
virtual bool clear()=0
Removes all the output related-objects registered (clear the container).
ComponentOutputMapInterface
This class manages the registration and deregistration of outputs of a component. It provides a map a...
Definition: ComponentOutputMapInterface.h:32
ComponentOutputMapInterface::setID
virtual bool setID(ComponentOutputMapInterface::Item *const item, ComponentOutputMapInterface::ID const &id)=0
Sets a key identifier id for the component output related-object item registered in the container (ma...
ComponentOutputMapInterface::count
virtual int count() const =0
Counts the number of component output related-objects registered.
ComponentOutputMapInterface::getID
virtual ComponentOutputMapInterface::ID getID(ComponentOutputMapInterface::Item *const item) const =0
Gets the key identifier of the component output related-object item from the container (map)...
ComponentOutputMapInterface::contains
virtual bool contains(ComponentOutputMapInterface::ID const &id) const =0
Verifies if the container (map) contains the component output related-object under the key identifier...
ComponentOutputMapInterface::generateID
virtual ComponentOutputMapInterface::ID generateID() const =0
Generates a unique key identifier for the new output registered in the map.
ComponentOutputMapInterface::getIndex
virtual ComponentOutputMapInterface::Index getIndex(ComponentOutputMapInterface::ID const &id) const =0
Gets the index position in the container (map) of the output related-object with the key identifier i...
ComponentOutputMapInterface::modifiedID
void modifiedID() const
Triggers signal to inform that a key id of a component output has been modified.
ComponentOutputMapInterface::add
virtual bool add(ComponentOutputMapInterface::ID const &id)=0
Registers a new output related-object under the key identifier id.
ComponentOutputMapInterface::ID
ComponentOutputItemInterface::ID ID
The output&#39;s key.
Definition: ComponentOutputMapInterface.h:37
ComponentOutputMapInterface::begin
virtual ComponentOutputMapInterface::Iterator begin()=0
Gets an iterator pointing at the first component output related-object in the map.
ComponentOutputMapInterface::removed
void removed(Item *item) const
Triggers signal to inform that a component output has been deregistered.
ComponentOutputMapInterface::getItem
virtual ComponentOutputMapInterface::Item * getItem(ComponentOutputMapInterface::ID const &id) const =0
Gets the output related-object under the key identifier id.
ComponentOutputMapInterface::end
virtual ComponentOutputMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last component output related-object.
ComponentOutputItemInterface
This class defines the items constituing an output of a component:
Definition: ComponentOutputItemInterface.h:33
ComponentOutputMapInterface::Item
ComponentOutputItemInterface Item
The object defining output.
Definition: ComponentOutputMapInterface.h:38
ComponentOutputMapInterface::cleared
void cleared() const
Triggers signal to inform that all outputs have been successfully removed from the container (map)...
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentParameterItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
Classes
ComponentParameterItemInterface.h File Reference
Component Plugin

The Component Parameter Item Interface (CPII) contains the functions setters and getters of the items constituing a parameter of a component. This interface belongs to the Component Plugin (CP). More...

Detailed Description

The Component Parameter Item Interface (CPII) contains the functions setters and getters of the items constituing a parameter of a component. This interface belongs to the Component Plugin (CP).

Definition in file ComponentParameterItemInterface.h.

Go to the source code of this file.

Classes

class ComponentParameterItemInterface
This class defines the items constituing a parameter of a component: More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentParameterItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
ComponentParameterItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19
20 #ifndef COMPONENTPARAMETERITEMINTERFACE_H
21 #define COMPONENTPARAMETERITEMINTERFACE_H
22
23 #include <QObject>
24 #include <QString>
25
34 class ComponentParameterItemInterface : public QObject
35 {
36 Q_OBJECT
37
38 public:
39 using ID = unsigned int;
40 using Type = QString;
41 using Title = QString;
42 using Unit = QString;
43 using Value = QString;
44
45 public:
46 explicit ComponentParameterItemInterface(QObject * const parent = nullptr)
47 : QObject(parent) {}
48 virtual ~ComponentParameterItemInterface() = default;
49
50 Q_SIGNALS:
51 //-----------------------------------------------------------------------------
55 //-----------------------------------------------------------------------------
56 void cleared() const;
57
58 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 void modifiedType() const;
63
64 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 void modifiedTitle() const;
69
70 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 void modifiedUnit() const;
75
76 //-----------------------------------------------------------------------------
79 //-----------------------------------------------------------------------------
80 void modifiedValue() const;
81
82 public:
83 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 virtual bool clear() = 0;
91
92 public:
93 //-----------------------------------------------------------------------------
98 //-----------------------------------------------------------------------------
99 virtual bool setID(ComponentParameterItemInterface::ID const & id) = 0;
100
101 //-----------------------------------------------------------------------------
105 //-----------------------------------------------------------------------------
106 virtual ComponentParameterItemInterface::ID getID() const = 0;
107
108 public:
109 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------
115 virtual bool setType(ComponentParameterItemInterface::Type const & type) = 0;
116
117 //-----------------------------------------------------------------------------
121 //-----------------------------------------------------------------------------
122 virtual ComponentParameterItemInterface::Type getType() const = 0;
123
124 public:
125 //-----------------------------------------------------------------------------
130 //-----------------------------------------------------------------------------
131 virtual bool setTitle(ComponentParameterItemInterface::Title const & title) = 0;
132
133 //-----------------------------------------------------------------------------
137 //-----------------------------------------------------------------------------
138 virtual ComponentParameterItemInterface::Title getTitle() const = 0;
139
140 public:
141 //-----------------------------------------------------------------------------
146 //-----------------------------------------------------------------------------
147 virtual bool setUnit(ComponentParameterItemInterface::Unit const & unit) = 0;
148
149 //-----------------------------------------------------------------------------
153 //-----------------------------------------------------------------------------
154 virtual ComponentParameterItemInterface::Unit getUnit() const = 0;
155
156 public:
157 //-----------------------------------------------------------------------------
162 //-----------------------------------------------------------------------------
163 virtual bool setValue(ComponentParameterItemInterface::Value const & value) = 0;
164
165 //-----------------------------------------------------------------------------
169 //-----------------------------------------------------------------------------
170 virtual ComponentParameterItemInterface::Value getValue() const = 0;
171 };
172
173 #endif // COMPONENTPARAMETERITEMINTERFACE_H
ComponentParameterItemInterface::cleared
void cleared() const
Triggers signal to inform that a component parameter has been successfully removed (used to update th...
ComponentParameterItemInterface::setTitle
virtual bool setTitle(ComponentParameterItemInterface::Title const &title)=0
Sets the title of the current registered parameter.
ComponentParameterItemInterface::getValue
virtual ComponentParameterItemInterface::Value getValue() const =0
Gets the value of the current registered parameter.
ComponentParameterItemInterface::setValue
virtual bool setValue(ComponentParameterItemInterface::Value const &value)=0
Sets the value of the current registered parameter.
ComponentParameterItemInterface::setID
virtual bool setID(ComponentParameterItemInterface::ID const &id)=0
Sets a key identifier id for the current registered parameter.
ComponentParameterItemInterface::modifiedTitle
void modifiedTitle() const
Triggers signal to inform that the title of a component parameter has been modified.
ComponentParameterItemInterface::clear
virtual bool clear()=0
Resets the items constituing the parameter of the component. (e.g. function called when users pressin...
ComponentParameterItemInterface::getTitle
virtual ComponentParameterItemInterface::Title getTitle() const =0
Gets the title of the current registered parameter.
ComponentParameterItemInterface::setType
virtual bool setType(ComponentParameterItemInterface::Type const &type)=0
Sets the type of the current registered parameter.
ComponentParameterItemInterface
This class defines the items constituing a parameter of a component:
Definition: ComponentParameterItemInterface.h:34
ComponentParameterItemInterface::modifiedType
void modifiedType() const
Triggers signal to inform that the type of a component parameter has been modified.
ComponentParameterItemInterface::getType
virtual ComponentParameterItemInterface::Type getType() const =0
Gets the type of the current registered parameter.
ComponentParameterItemInterface::modifiedValue
void modifiedValue() const
Triggers signal to inform that the value of a component parameter has been modified.
ComponentParameterItemInterface::getID
virtual ComponentParameterItemInterface::ID getID() const =0
Gets the key identifier of the current registered parameter.
ComponentParameterItemInterface::getUnit
virtual ComponentParameterItemInterface::Unit getUnit() const =0
Gets the unit of the current registered parameter.
ComponentParameterItemInterface::modifiedUnit
void modifiedUnit() const
Triggers signal to inform that the unit of a component parameter has been modified.
ComponentParameterItemInterface::setUnit
virtual bool setUnit(ComponentParameterItemInterface::Unit const &unit)=0
Sets the unit of the current registered parameter.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentParameterMapInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
Classes
ComponentParameterMapInterface.h File Reference
Component Plugin

The Component Parameter Map Interface (CPMI) contains the functions managing the registration and deregistration of the parameters of a component. This interface belongs to the Component Plugin (CP). More...

Detailed Description

The Component Parameter Map Interface (CPMI) contains the functions managing the registration and deregistration of the parameters of a component. This interface belongs to the Component Plugin (CP).

Definition in file ComponentParameterMapInterface.h.

Go to the source code of this file.

Classes

class ComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component. It provides a map as container with unique identifiers as a keys to sort the parameters. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentParameterMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
ComponentParameterMapInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19
20 #ifndef COMPONENTPARAMETERMAPINTERFACE_H
21 #define COMPONENTPARAMETERMAPINTERFACE_H
22
23 #include "openPASS-Component/ComponentParameterItemInterface.h"
24 #include "openPASS-Component/ComponentTypedefMapInterface.h"
25 #include <QMap>
26 #include <QObject>
27
33 class ComponentParameterMapInterface : public QObject
34 {
35 Q_OBJECT
36
37 public:
38 using ID = ComponentParameterItemInterface::ID;
39 using Item = ComponentParameterItemInterface;
40 using Index = int;
41
42 public:
43 using Map = QMap<ID, Item *>;
44 using Iterator = Map::Iterator;
45 using ConstIterator = Map::ConstIterator;
46
47 public:
48 explicit ComponentParameterMapInterface(QObject * const parent = nullptr)
49 : QObject(parent) {}
50 virtual ~ComponentParameterMapInterface() = default;
51
52 Q_SIGNALS:
53 //-----------------------------------------------------------------------------
55 //-----------------------------------------------------------------------------
56 void added(Item * item) const;
57
58 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 void cleared() const;
63
64 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 void modifiedID() const;
69
70 //-----------------------------------------------------------------------------
72 //-----------------------------------------------------------------------------
73 void removed(Item * item) const;
74
75 public:
76 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 virtual bool add(ComponentParameterMapInterface::Item * const item) = 0;
83
84 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 virtual bool add(ComponentParameterMapInterface::ID const & id) = 0;
91
92 //-----------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------
100 virtual bool add(ComponentParameterMapInterface::ID const & id,
101 ComponentParameterMapInterface::Item * const item) = 0;
102
103 //-----------------------------------------------------------------------------
108 //-----------------------------------------------------------------------------
109 virtual ComponentParameterMapInterface::Item * createParameter() const = 0;
110
111 public:
112 //-----------------------------------------------------------------------------
118 //-----------------------------------------------------------------------------
119 virtual ComponentParameterMapInterface::Iterator begin() = 0;
120
121 //-----------------------------------------------------------------------------
127 //-----------------------------------------------------------------------------
128 virtual ComponentParameterMapInterface::ConstIterator begin() const = 0;
129
130 public:
131 //-----------------------------------------------------------------------------
135 //-----------------------------------------------------------------------------
136 virtual bool clear() = 0;
137
138 public:
139 //-----------------------------------------------------------------------------
143 //-----------------------------------------------------------------------------
144 virtual int count() const = 0;
145
146 public:
147 //-----------------------------------------------------------------------------
153 //-----------------------------------------------------------------------------
154 virtual bool contains(ComponentParameterMapInterface::ID const & id) const = 0;
155
156 //-----------------------------------------------------------------------------
162 //-----------------------------------------------------------------------------
163 virtual bool contains(ComponentParameterMapInterface::Item * const item) const = 0;
164
165 //-----------------------------------------------------------------------------
171 //-----------------------------------------------------------------------------
172 virtual bool contains(ComponentParameterMapInterface::Index const & index) const = 0;
173
174 public:
175 //-----------------------------------------------------------------------------
180 //-----------------------------------------------------------------------------
181 virtual ComponentParameterMapInterface::Iterator end() = 0;
182
183 //-----------------------------------------------------------------------------
188 //-----------------------------------------------------------------------------
189 virtual ComponentParameterMapInterface::ConstIterator end() const = 0;
190
191 public:
192 //-----------------------------------------------------------------------------
199 //-----------------------------------------------------------------------------
200 virtual bool setID(ComponentParameterMapInterface::Item * const item,
201 ComponentParameterMapInterface::ID const & id) = 0;
202
203 //-----------------------------------------------------------------------------
208 //-----------------------------------------------------------------------------
209 virtual ComponentParameterMapInterface::ID generateID() const = 0;
210
211 //-----------------------------------------------------------------------------
217 //-----------------------------------------------------------------------------
218 virtual ComponentParameterMapInterface::ID getID(ComponentParameterMapInterface::Item * const item) const = 0;
219
220 //-----------------------------------------------------------------------------
226 //-----------------------------------------------------------------------------
227 virtual ComponentParameterMapInterface::ID getID(ComponentParameterMapInterface::Index const & index) const = 0;
228
229 public:
230 //-----------------------------------------------------------------------------
236 //-----------------------------------------------------------------------------
237 virtual ComponentParameterMapInterface::Index getIndex(ComponentParameterMapInterface::ID const & id) const = 0;
238
239 //-----------------------------------------------------------------------------
245 //-----------------------------------------------------------------------------
246 virtual ComponentParameterMapInterface::Index getIndex(ComponentParameterMapInterface::Item * const item) const = 0;
247
248 public:
249 //-----------------------------------------------------------------------------
254 //-----------------------------------------------------------------------------
255 virtual ComponentParameterMapInterface::Item * getItem(ComponentParameterMapInterface::ID const & id) const = 0;
256
257 //-----------------------------------------------------------------------------
263 //-----------------------------------------------------------------------------
264 virtual ComponentParameterMapInterface::Item * getItem(ComponentParameterMapInterface::Index const & index) const = 0;
265
266 public:
267 //-----------------------------------------------------------------------------
272 //-----------------------------------------------------------------------------
273 virtual bool remove(ComponentParameterMapInterface::ID const & id) = 0;
274
275 //-----------------------------------------------------------------------------
280 //-----------------------------------------------------------------------------
281 virtual bool remove(ComponentParameterMapInterface::Item * const item) = 0;
282
283 //-----------------------------------------------------------------------------
289 //-----------------------------------------------------------------------------
290 virtual bool remove(ComponentParameterMapInterface::Index const & index) = 0;
291
292 public:
293 virtual ComponentTypedefMapInterface * getParameterTypeMap() const = 0;
294 };
295
296 #endif // COMPONENTOUTPUTMAPINTERFACE_H
ComponentParameterMapInterface::contains
virtual bool contains(ComponentParameterMapInterface::ID const &id) const =0
Verifies if the container (map) contains the component parameter related-object under the key identif...
ComponentParameterMapInterface::cleared
void cleared() const
Triggers signal to inform that all parameters have been successfully removed from the container (map)...
ComponentParameterMapInterface::Map
QMap< ID, Item * > Map
The container registering parameters.
Definition: ComponentParameterMapInterface.h:43
ComponentParameterMapInterface::getID
virtual ComponentParameterMapInterface::ID getID(ComponentParameterMapInterface::Item *const item) const =0
Gets the key identifier of the component parameter related-object item from the container (map)...
ComponentParameterItemInterface.h
The Component Parameter Item Interface (CPII) contains the functions setters and getters of the items...
ComponentParameterMapInterface::getItem
virtual ComponentParameterMapInterface::Item * getItem(ComponentParameterMapInterface::ID const &id) const =0
Gets the parameter related-object under the key identifier id.
ComponentParameterMapInterface::ID
ComponentParameterItemInterface::ID ID
The parameter&#39;s key.
Definition: ComponentParameterMapInterface.h:38
ComponentParameterMapInterface::added
void added(Item *item) const
Triggers signal to inform that a component parameter has been registered.
ComponentParameterMapInterface::end
virtual ComponentParameterMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last component parameter related-object...
ComponentParameterMapInterface::begin
virtual ComponentParameterMapInterface::Iterator begin()=0
Gets an iterator pointing at the first component parameter related-object in the map.
ComponentParameterMapInterface::setID
virtual bool setID(ComponentParameterMapInterface::Item *const item, ComponentParameterMapInterface::ID const &id)=0
Sets a key identifier id for the component parameter related-object item registered in the container ...
ComponentParameterMapInterface::Item
ComponentParameterItemInterface Item
The object defining the parameter.
Definition: ComponentParameterMapInterface.h:39
ComponentParameterItemInterface
This class defines the items constituing a parameter of a component:
Definition: ComponentParameterItemInterface.h:34
ComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component. It provides a map as container with unique identifiers as a keys to sort the parameters.
Definition: ComponentParameterMapInterface.h:33
ComponentParameterMapInterface::createParameter
virtual ComponentParameterMapInterface::Item * createParameter() const =0
Creates a new parameter object and returns a pointer to it. The parameter is not added to this map...
ComponentParameterMapInterface::getIndex
virtual ComponentParameterMapInterface::Index getIndex(ComponentParameterMapInterface::ID const &id) const =0
Gets the index position in the container (map) of the component parameter related-object with the key...
ComponentParameterMapInterface::clear
virtual bool clear()=0
Removes all the paramter related-objects registered (clear the container).
ComponentParameterMapInterface::generateID
virtual ComponentParameterMapInterface::ID generateID() const =0
Generates a unique key identifier for the new parameter registered in the container (map)...
ComponentParameterMapInterface::add
virtual bool add(ComponentParameterMapInterface::Item *const item)=0
Registers the given parameter under an automatically generated key.
ComponentParameterMapInterface::modifiedID
void modifiedID() const
Triggers signal to inform that a key id of a component parameter has been modified.
ComponentParameterMapInterface::removed
void removed(Item *item) const
Triggers signal to inform that a component parameter has been deregistered.
ComponentParameterMapInterface::count
virtual int count() const =0
Counts the number of component parameter related-objects registered.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentScheduleInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
Classes
ComponentScheduleInterface.h File Reference
Component Plugin

The Component Schedule Interface (CSI) contains the functions setters and getters for the schedule parameters of a component. This interface belongs to the Component Plugin (CP). More...

Detailed Description

The Component Schedule Interface (CSI) contains the functions setters and getters for the schedule parameters of a component. This interface belongs to the Component Plugin (CP).

Definition in file ComponentScheduleInterface.h.

Go to the source code of this file.

Classes

class ComponentScheduleInterface
This class defines the schedule parameters of a component: More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentScheduleInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
ComponentScheduleInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19
20 #ifndef COMPONENTSCHEDULEINTERFACE_H
21 #define COMPONENTSCHEDULEINTERFACE_H
22
23 #include <QObject>
24
31 class ComponentScheduleInterface : public QObject
32 {
33 Q_OBJECT
34
35 public:
36 using Offset = unsigned int;
37 using Cycle = unsigned int;
38 using Response = unsigned int;
39
40 public:
41 explicit ComponentScheduleInterface(QObject * const parent = nullptr)
42 : QObject(parent) {}
43 virtual ~ComponentScheduleInterface() = default;
44
45 Q_SIGNALS:
46 //-----------------------------------------------------------------------------
49 //-----------------------------------------------------------------------------
50 void cleared() const;
51
52 //-----------------------------------------------------------------------------
55 //-----------------------------------------------------------------------------
56 void modifiedOffset() const;
57
58 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 void modifiedCycle() const;
63
64 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 void modifiedResponse() const;
69
70 public:
71 //-----------------------------------------------------------------------------
75 //-----------------------------------------------------------------------------
76 virtual bool clear() = 0;
77
78 public:
79 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
85 virtual bool setOffset(ComponentScheduleInterface::Offset const & offset) = 0;
86
87 //-----------------------------------------------------------------------------
91 //-----------------------------------------------------------------------------
92 virtual ComponentScheduleInterface::Offset getOffset() const = 0;
93
94 public:
95 //-----------------------------------------------------------------------------
100 //-----------------------------------------------------------------------------
101 virtual bool setCycle(ComponentScheduleInterface::Cycle const & cycle) = 0;
102
103 //-----------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------
108 virtual ComponentScheduleInterface::Cycle getCycle() const = 0;
109
110 public:
111 //-----------------------------------------------------------------------------
116 //-----------------------------------------------------------------------------
117 virtual bool setResponse(ComponentScheduleInterface::Response const & response) = 0;
118
119 //-----------------------------------------------------------------------------
123 //-----------------------------------------------------------------------------
124 virtual ComponentScheduleInterface::Response getResponse() const = 0;
125 };
126
127 #endif // COMPONENTSCHEDULEINTERFACE_H
ComponentScheduleInterface::setCycle
virtual bool setCycle(ComponentScheduleInterface::Cycle const &cycle)=0
Sets the Cycle Time for the current registered component.
ComponentScheduleInterface::modifiedCycle
void modifiedCycle() const
Triggers signal to inform that the Cycle Time of a component has been modified.
ComponentScheduleInterface::modifiedResponse
void modifiedResponse() const
Triggers signal to inform that the Response Time of a component has been modified.
ComponentScheduleInterface::setOffset
virtual bool setOffset(ComponentScheduleInterface::Offset const &offset)=0
Sets the Offset Time for the current registered component.
ComponentScheduleInterface
This class defines the schedule parameters of a component:
Definition: ComponentScheduleInterface.h:31
ComponentScheduleInterface::getResponse
virtual ComponentScheduleInterface::Response getResponse() const =0
Gets the Response Time for the current registered component.
ComponentScheduleInterface::clear
virtual bool clear()=0
Clears the items constituing the schedule parameters of the current component.
ComponentScheduleInterface::cleared
void cleared() const
Triggers signal to inform that the schedule parameters of the current component has been reset succes...
ComponentScheduleInterface::getOffset
virtual ComponentScheduleInterface::Offset getOffset() const =0
Gets the Offset Time for the current registered component.
ComponentScheduleInterface::getCycle
virtual ComponentScheduleInterface::Cycle getCycle() const =0
Gets the Cycle Time for the current registered component.
ComponentScheduleInterface::setResponse
virtual bool setResponse(ComponentScheduleInterface::Response const &response)=0
Sets the Response Time for the current registered component.
ComponentScheduleInterface::modifiedOffset
void modifiedOffset() const
Triggers signal to inform that the Offset Time of a component has been modified.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: System Plugin

Files
System Plugin

The System Plugin (SP) is dedicated for modelling systems. More...

Files

file | SystemComponentInputItemInterface.h
The System Component Input Item Interface (SCIII) contains the functions getters of the items constituing an input of a component and accesses the items of the parent component.
file | SystemComponentInputMapInterface.h
The System Component Input Map Interface (SCIMI) contains the functions managing the registration and deregistration of the inputs of a component registered in a system. This interface belongs to the System Plugin (SP).
file | SystemComponentItemInterface.h
The System Component Item Interface (SCmII) contains the functions setters and getters of the items constituing a component registered in a system. This interface belongs to the System Plugin (SP).
file | SystemComponentManagerInterface.h
The System Component Manager Interface (SCMI) contains the functions loading components as a library that can be used to build a system. This interface belongs to the System Plugin (SP).
file | SystemComponentMapInterface.h
The System Component Map Interface (SCmMI) contains the functions managing the registration and deregistration of components building a system. This interface belongs to the System Plugin (SP).
file | SystemComponentOutputItemInterface.h
The System Component Output Item Interface (SCOII) contains the functions getters of the items constituing an output of a component and accesses the object parent the component. This interface belongs to the System Plugin (SP).
file | SystemComponentOutputMapInterface.h
The System Component Output Map Interface (SCOMI) contains the functions managing the registration and deregistration of the outputs of a component registered in a system. This interface belongs to the System Plugin (SP).
file | SystemComponentParameterItemInterface.h
The System Component Parameter Item Interface (SCPII) contains the functions setters and getters of the items constituing a parameter of a component registered in a system. This interface belongs to the System Plugin (SP).
file | SystemComponentParameterMapInterface.h
The System Component Parameter Map Interface (SCPMI) contains the functions managing the registration and deregistration of the parameters of a component registered to a system. This interface belongs to the System Plugin (CP).
file | SystemComponentScheduleInterface.h
The System Component Schedule Interface (SCSI) contains the functions setters and getters for the simulation schedule related parameters of a component registered in a system. This interface belongs to the System Plugin (SP).
file | SystemConnectionItemInterface.h
The System Connection Item Interface (SCnII) contains the functions getters of the items constituing the connection between two components of a system. This interface belongs to the System Plugin (SP).
file | SystemConnectionMapInterface.h
The System Connection Map Interface (SCnMI) contains the functions managing the registration and deregistration of connections linking components building a system. This interface belongs to the System Plugin (SP).
file | SystemInterface.h
The System Interface (SI) contains the functions creating systems and creating a tree listing the components loaded from library. This interface belongs to the System Plugin (SP).
file | SystemItemInterface.h
The System Item Interface (SII) contains the functions setters and getters of the items constituing a system. This interface belongs to the System Plugin (SP).
file | SystemMapInterface.h
The System Map Interface (SMI) contains the functions managing the registration and deregistration of systems. This interface belongs to the System Plugin (SP).

Detailed Description

The System Plugin (SP) is dedicated for modelling systems.

System Plugin

The System Plugin (SP) is dedicated for modelling systems. It integrates the definition structure of a system and the GUI (called the System Editor) for modelling such a system.

System Definition

A system is defined with the following items:

  • an identifier id for referencing,
  • a title to name the system,
  • a parameter "Priority" which order the execution of the system algorithm during a simulation,
  • a set of components presented as small modules to dissociate a complex algorithm into modular blocs
  • a set of connections linking the components to model the data flow.

Components

The components are provided from a library. They are referenced according to their name in the library. When a component is selected and used for a system, it is registered with an identifier id. This allows to have a duplicated component in a system having the same reference name but different identifiers in order to distinguish them. The definition of a component is introduced in the page Component Plugin (CP). When a component is used in a system, the following items are registered:

  • an identifier id to distinguish duplicata components in a system,
  • the reference name according to the library (to get the inputs and outputs),
  • a title to distinguish duplicata components for the user,
  • a parameter set "schedule" which control the execution of the component algorithm during a simulation (defined in component),
  • the parameters with their items as defined in a component,
  • the position of the component in the System Editor (see section GUI definition).

Connections

The connections are modelling the data transmission from one output of a component to one or several inputs of other components of the system. These connections are established between outputs and inputs having the same type and unit data.

Note
An exemption for output or input that has no unit can be connected to any other one.

When a connection is established in a system, the following items are registered:

  • an identifier id for the connection
  • the identifer id of the component source (starting of the connection)
  • the identifier id of the ouput of the component source
  • the identifier id of the component target (ending of the connection)
  • the identifier id of the input of the component target
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentInputItemInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemComponentInputItemInterface.h File Reference
System Plugin

The System Component Input Item Interface (SCIII) contains the functions getters of the items constituing an input of a component and accesses the items of the parent component. More...

Detailed Description

The System Component Input Item Interface (SCIII) contains the functions getters of the items constituing an input of a component and accesses the items of the parent component.

The System Component Input Item Interface (SCIII) contains the functions getters of the items constituing an input of a component and accesses the items of the parent component.
This interface belongs to the System Plugin (SP).

Definition in file SystemComponentInputItemInterface.h.

Go to the source code of this file.

Classes

class SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentInputItemInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemComponentInputItemInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
14 //-----------------------------------------------------------------------------
15
16 #ifndef SYSTEMCOMPONENTINPUTITEMINTERFACE_H
17 #define SYSTEMCOMPONENTINPUTITEMINTERFACE_H
18
19 #include "openPASS-Component/ComponentInputItemInterface.h"
20 #include <QObject>
21
22 class SystemComponentItemInterface;
23
34 class SystemComponentInputItemInterface : public QObject
35 {
36 Q_OBJECT
37
38 public:
39 using ID = ComponentInputItemInterface::ID;
40 using Type = ComponentInputItemInterface::Type;
41 using Title = ComponentInputItemInterface::Title;
42 using Unit = ComponentInputItemInterface::Unit;
43 using Cardinality = ComponentInputItemInterface::Cardinality;
44
45 public:
46 explicit SystemComponentInputItemInterface(QObject * const parent = nullptr)
47 : QObject(parent) {}
48 virtual ~SystemComponentInputItemInterface() = default;
49
50 public:
51 //-----------------------------------------------------------------------------
56 //-----------------------------------------------------------------------------
57 virtual SystemComponentItemInterface * getComponent() const = 0;
58
59 public:
60 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
66 virtual SystemComponentInputItemInterface::ID getID() const = 0;
67
68 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 virtual SystemComponentInputItemInterface::Type getType() const = 0;
75
76 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 virtual SystemComponentInputItemInterface::Title getTitle() const = 0;
83
84 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 virtual SystemComponentInputItemInterface::Unit getUnit() const = 0;
91
92 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 virtual SystemComponentInputItemInterface::Cardinality getCardinality() const = 0;
99 };
100
101 #endif // SYSTEMCOMPONENTINPUTITEMINTERFACE_H
SystemComponentInputItemInterface::getCardinality
virtual SystemComponentInputItemInterface::Cardinality getCardinality() const =0
Gets the cardinality of the current registered input.
SystemComponentInputItemInterface::Type
ComponentInputItemInterface::Type Type
The type of the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:40
SystemComponentInputItemInterface::ID
ComponentInputItemInterface::ID ID
The identifier of the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:39
ComponentInputItemInterface.h
The Component Input Item Interface (CIII) contains the functions setters and getters of the items con...
SystemComponentInputItemInterface::getType
virtual SystemComponentInputItemInterface::Type getType() const =0
Gets the type of the current registered input.
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentInputItemInterface::getUnit
virtual SystemComponentInputItemInterface::Unit getUnit() const =0
Gets the unit of the current registered input.
SystemComponentInputItemInterface::Cardinality
ComponentInputItemInterface::Cardinality Cardinality
The cardinality of the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:43
SystemComponentInputItemInterface::Unit
ComponentInputItemInterface::Unit Unit
The unit of the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:42
SystemComponentInputItemInterface::getID
virtual SystemComponentInputItemInterface::ID getID() const =0
Gets the key identifier of the current registered input.
SystemComponentInputItemInterface::Title
ComponentInputItemInterface::Title Title
The title for the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:41
SystemComponentInputItemInterface::getComponent
virtual SystemComponentItemInterface * getComponent() const =0
Gets the parent component where the current input belongs to.
SystemComponentInputItemInterface::getTitle
virtual SystemComponentInputItemInterface::Title getTitle() const =0
Gets the title of the current registered input.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentInputMapInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemComponentInputMapInterface.h File Reference
System Plugin

The System Component Input Map Interface (SCIMI) contains the functions managing the registration and deregistration of the inputs of a component registered in a system. This interface belongs to the System Plugin (SP). More...

Detailed Description

The System Component Input Map Interface (SCIMI) contains the functions managing the registration and deregistration of the inputs of a component registered in a system. This interface belongs to the System Plugin (SP).

Definition in file SystemComponentInputMapInterface.h.

Go to the source code of this file.

Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentInputMapInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemComponentInputMapInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
10
11 #ifndef SYSTEMCOMPONENTINPUTMAPINTERFACE_H
12 #define SYSTEMCOMPONENTINPUTMAPINTERFACE_H
13
14 #include "openPASS-System/SystemComponentInputItemInterface.h"
15 #include <QMap>
16 #include <QObject>
17
18 class SystemComponentInputMapInterface : public QObject
19 {
20 Q_OBJECT
21
22 public:
23 using ID = SystemComponentInputItemInterface::ID;
24 using Item = SystemComponentInputItemInterface;
25
26 public:
27 using Map = QMap<ID, Item *>;
28 using Iterator = Map::Iterator;
29 using ConstIterator = Map::ConstIterator;
30
31 public:
32 explicit SystemComponentInputMapInterface(QObject * const parent = nullptr)
33 : QObject(parent) {}
34 virtual ~SystemComponentInputMapInterface() = default;
35
36 public:
37 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
42 virtual SystemComponentInputMapInterface::Iterator begin() = 0;
43
44 //-----------------------------------------------------------------------------
49 //-----------------------------------------------------------------------------
50 virtual SystemComponentInputMapInterface::ConstIterator begin() const = 0;
51
52 public:
53 //-----------------------------------------------------------------------------
58 //-----------------------------------------------------------------------------
59 virtual bool contains(SystemComponentInputMapInterface::ID const & id) const = 0;
60
61 public:
62 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 virtual SystemComponentInputMapInterface::Iterator end() = 0;
69
70 //-----------------------------------------------------------------------------
75 //-----------------------------------------------------------------------------
76 virtual SystemComponentInputMapInterface::ConstIterator end() const = 0;
77
78 public:
79 //-----------------------------------------------------------------------------
85 //-----------------------------------------------------------------------------
86 virtual SystemComponentInputMapInterface::ID getID(SystemComponentInputMapInterface::Item * const item) const = 0;
87
88 //-----------------------------------------------------------------------------
93 //-----------------------------------------------------------------------------
94 virtual SystemComponentInputMapInterface::Item * getItem(SystemComponentInputMapInterface::ID const & id) const = 0;
95 };
96
97 #endif // SYSTEMCOMPONENTINPUTMAPINTERFACE_H
SystemComponentInputItemInterface::ID
ComponentInputItemInterface::ID ID
The identifier of the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:39
SystemComponentInputItemInterface.h
The System Component Input Item Interface (SCIII) contains the functions getters of the items constit...
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentItemInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemComponentItemInterface.h File Reference
System Plugin

The System Component Item Interface (SCmII) contains the functions setters and getters of the items constituing a component registered in a system. This interface belongs to the System Plugin (SP). More...

Detailed Description

The System Component Item Interface (SCmII) contains the functions setters and getters of the items constituing a component registered in a system. This interface belongs to the System Plugin (SP).

Definition in file SystemComponentItemInterface.h.

Go to the source code of this file.

Classes

class SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system: More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentItemInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemComponentItemInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
10
11 #ifndef SYSTEMCOMPONENTITEMINTERFACE_H
12 #define SYSTEMCOMPONENTITEMINTERFACE_H
13
14 #include "openPASS-Component/ComponentItemInterface.h"
15 #include "openPASS-System/SystemComponentInputMapInterface.h"
16 #include "openPASS-System/SystemComponentOutputMapInterface.h"
17 #include "openPASS-System/SystemComponentParameterMapInterface.h"
18 #include "openPASS-System/SystemComponentScheduleInterface.h"
19 #include <QObject>
20 #include <QPoint>
21
35 class SystemComponentItemInterface : public QObject
36 {
37 Q_OBJECT
38
39 public:
40 using ID = unsigned int;
41 using Library = ComponentItemInterface::Name;
42 using Type = ComponentItemInterface::Type;
43 using Title = ComponentItemInterface::Title;
44 using Schedule = SystemComponentScheduleInterface;
45 using ParameterMap = SystemComponentParameterMapInterface;
46 using InputMap = SystemComponentInputMapInterface;
47 using OutputMap = SystemComponentOutputMapInterface;
48 using Position = QPoint;
49
50 public:
51 explicit SystemComponentItemInterface(QObject * const parent = nullptr)
52 : QObject(parent) {}
53 virtual ~SystemComponentItemInterface() = default;
54
55 Q_SIGNALS:
56 //-----------------------------------------------------------------------------
58 //-----------------------------------------------------------------------------
59 void modifiedTitle() const;
60
61 //-----------------------------------------------------------------------------
64 //-----------------------------------------------------------------------------
65 void modifiedPosition() const;
66
67 public:
68 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 virtual bool duplicate(SystemComponentItemInterface::Position const & position) = 0;
76
77 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 virtual bool remove() = 0;
83
84 public:
85 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 virtual SystemComponentItemInterface::ID getID() const = 0;
91
92 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 virtual SystemComponentItemInterface::Library getLibrary() const = 0;
98
99 //-----------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
104 virtual SystemComponentItemInterface::Type getType() const = 0;
105
106 public:
107 //-----------------------------------------------------------------------------
111 //-----------------------------------------------------------------------------
112 virtual bool setTitle(SystemComponentItemInterface::Title const & title) = 0;
113
114 //-----------------------------------------------------------------------------
118 //-----------------------------------------------------------------------------
119 virtual SystemComponentItemInterface::Title getTitle() const = 0;
120
121 public:
122 //-----------------------------------------------------------------------------
127 //-----------------------------------------------------------------------------
128 virtual SystemComponentItemInterface::Schedule * getSchedule() const = 0;
129
130 //-----------------------------------------------------------------------------
134 //-----------------------------------------------------------------------------
135 virtual SystemComponentItemInterface::ParameterMap * getParameters() const = 0;
136
137 //-----------------------------------------------------------------------------
141 //-----------------------------------------------------------------------------
142 virtual SystemComponentItemInterface::InputMap * getInputs() const = 0;
143
144 //-----------------------------------------------------------------------------
148 //-----------------------------------------------------------------------------
149 virtual SystemComponentItemInterface::OutputMap * getOutputs() const = 0;
150
151 public:
152 //-----------------------------------------------------------------------------
156 //-----------------------------------------------------------------------------
157 virtual bool setPosition(SystemComponentItemInterface::Position const & position) = 0;
158
159 //-----------------------------------------------------------------------------
163 //-----------------------------------------------------------------------------
164 virtual SystemComponentItemInterface::Position getPosition() const = 0;
165 };
166
167 #endif // SYSTEMCOMPONENTITEMINTERFACE_H
SystemComponentItemInterface::getSchedule
virtual SystemComponentItemInterface::Schedule * getSchedule() const =0
Gets the simulation schedule related parameters of the current registered component.
SystemComponentItemInterface::ID
unsigned int ID
The component&#39;s key identifier in the system.
Definition: SystemComponentItemInterface.h:40
SystemComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component registered in a s...
Definition: SystemComponentParameterMapInterface.h:22
SystemComponentItemInterface::setPosition
virtual bool setPosition(SystemComponentItemInterface::Position const &position)=0
Sets the position of the current registered component in the System Editor.
ComponentItemInterface.h
The Component Item Interface (CII) contains the functions setters and getters of the items constituin...
SystemComponentOutputMapInterface
This class manages the registration and deregistration of outputs of a component registered in a syst...
Definition: SystemComponentOutputMapInterface.h:22
SystemComponentItemInterface::Position
QPoint Position
The position of the component in the System Editor.
Definition: SystemComponentItemInterface.h:48
ComponentItemInterface::Title
QString Title
The Title of the component.
Definition: ComponentItemInterface.h:55
SystemComponentParameterMapInterface.h
The System Component Parameter Map Interface (SCPMI) contains the functions managing the registration...
SystemComponentScheduleInterface
This class defines the simulation schedule related parameters of a component registered in a system: ...
Definition: SystemComponentScheduleInterface.h:25
SystemComponentScheduleInterface.h
The System Component Schedule Interface (SCSI) contains the functions setters and getters for the sim...
SystemComponentItemInterface::getLibrary
virtual SystemComponentItemInterface::Library getLibrary() const =0
Gets the key name of the current component as registered in the library.
SystemComponentItemInterface::getInputs
virtual SystemComponentItemInterface::InputMap * getInputs() const =0
Gets the inputs of the current registered component.
SystemComponentItemInterface::Title
ComponentItemInterface::Title Title
The Title of the component.
Definition: SystemComponentItemInterface.h:43
SystemComponentItemInterface::modifiedTitle
void modifiedTitle() const
Triggers signal to inform that the title of a component has been modified.
SystemComponentItemInterface::getOutputs
virtual SystemComponentItemInterface::OutputMap * getOutputs() const =0
Gets the outputs of the current registered component.
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentItemInterface::getTitle
virtual SystemComponentItemInterface::Title getTitle() const =0
Gets the title of the current registered component.
SystemComponentItemInterface::getParameters
virtual SystemComponentItemInterface::ParameterMap * getParameters() const =0
Gets the parameters of the current registered component.
SystemComponentItemInterface::setTitle
virtual bool setTitle(SystemComponentItemInterface::Title const &title)=0
Sets a title to the current registered component.
SystemComponentInputMapInterface.h
The System Component Input Map Interface (SCIMI) contains the functions managing the registration and...
SystemComponentItemInterface::modifiedPosition
void modifiedPosition() const
Triggers signal to inform that the position of a component has been modified in the System Editor...
SystemComponentItemInterface::getID
virtual SystemComponentItemInterface::ID getID() const =0
Gets the key identifier of the current component registered in the system.
SystemComponentItemInterface::duplicate
virtual bool duplicate(SystemComponentItemInterface::Position const &position)=0
Duplicates the current component and registers it to the map with a new identifier and a position in ...
SystemComponentItemInterface::getType
virtual SystemComponentItemInterface::Type getType() const =0
Gets the type of the current registered component.
SystemComponentOutputMapInterface.h
The System Component Output Map Interface (SCOMI) contains the functions managing the registration an...
ComponentItemInterface::Name
QString Name
The component&#39;s key name.
Definition: ComponentItemInterface.h:45
SystemComponentItemInterface::InputMap
SystemComponentInputMapInterface InputMap
The container registering the inputs of the component.
Definition: SystemComponentItemInterface.h:46
SystemComponentItemInterface::getPosition
virtual SystemComponentItemInterface::Position getPosition() const =0
Gets the position of the current registered component.
SystemComponentItemInterface::Library
ComponentItemInterface::Name Library
The component&#39;s key name (registered in the library)
Definition: SystemComponentItemInterface.h:41
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentManagerInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemComponentManagerInterface.h File Reference
System Plugin

The System Component Manager Interface (SCMI) contains the functions loading components as a library that can be used to build a system. This interface belongs to the System Plugin (SP). More...

Detailed Description

The System Component Manager Interface (SCMI) contains the functions loading components as a library that can be used to build a system. This interface belongs to the System Plugin (SP).

Definition in file SystemComponentManagerInterface.h.

Go to the source code of this file.

Classes

class SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions for these components. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentManagerInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemComponentManagerInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
8 //-----------------------------------------------------------------------------
9
10 #ifndef SYSTEMCOMPONENTMANAGERINTERFACE_H
11 #define SYSTEMCOMPONENTMANAGERINTERFACE_H
12
13 #include "openPASS-Component/ComponentItemInterface.h"
14 #include <QDir>
15 #include <QList>
16 #include <QObject>
17
22 class SystemComponentManagerInterface : public QObject
23 {
24 Q_OBJECT
25
26 public:
27 explicit SystemComponentManagerInterface(QObject * const parent = nullptr)
28 : QObject(parent) {}
29 virtual ~SystemComponentManagerInterface() = default;
30
31 public:
32 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
42 virtual bool loadFromDirectory(QDir const & directory) = 0;
43
44 //-----------------------------------------------------------------------------
52 //-----------------------------------------------------------------------------
53 virtual QList<ComponentItemInterface::Title> listTitlesByType(ComponentItemInterface::Type const & type) const = 0;
54
55 //-----------------------------------------------------------------------------
63 //-----------------------------------------------------------------------------
64 virtual ComponentItemInterface * lookupItemByName(ComponentItemInterface::Name const & name) const = 0;
65
66 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 virtual ComponentItemInterface * lookupItemByTitle(ComponentItemInterface::Title const & title) const = 0;
76 };
77
78 #endif // SYSTEMCOMPONENTMANAGERINTERFACE_H
ComponentItemInterface.h
The Component Item Interface (CII) contains the functions setters and getters of the items constituin...
ComponentItemInterface
This class defines the items constituing a component:
Definition: ComponentItemInterface.h:40
ComponentItemInterface::Title
QString Title
The Title of the component.
Definition: ComponentItemInterface.h:55
SystemComponentManagerInterface::listTitlesByType
virtual QList< ComponentItemInterface::Title > listTitlesByType(ComponentItemInterface::Type const &type) const =0
Gets a list of titles of loaded components sorted according to the specified type type (Action...
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemComponentManagerInterface::loadFromDirectory
virtual bool loadFromDirectory(QDir const &directory)=0
Loads XML files defining components from the selected directory directory. The filenames are register...
SystemComponentManagerInterface::lookupItemByTitle
virtual ComponentItemInterface * lookupItemByTitle(ComponentItemInterface::Title const &title) const =0
Gets a pointer to the component related-object with the specified title title. This function is calle...
SystemComponentManagerInterface::lookupItemByName
virtual ComponentItemInterface * lookupItemByName(ComponentItemInterface::Name const &name) const =0
Gets a pointer to the component related-object with the specified key name name. This function is cal...
ComponentItemInterface::Name
QString Name
The component&#39;s key name.
Definition: ComponentItemInterface.h:45
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentMapInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemComponentMapInterface.h File Reference
System Plugin

The System Component Map Interface (SCmMI) contains the functions managing the registration and deregistration of components building a system. This interface belongs to the System Plugin (SP). More...

Detailed Description

The System Component Map Interface (SCmMI) contains the functions managing the registration and deregistration of components building a system. This interface belongs to the System Plugin (SP).

Definition in file SystemComponentMapInterface.h.

Go to the source code of this file.

Classes

class SystemComponentMapInterface
This class manages the registration and deregistration of objects defining components (component related-objects) belonging to a system. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentMapInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemComponentMapInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
10
11 #ifndef SYSTEMCOMPONENTMAPINTERFACE_H
12 #define SYSTEMCOMPONENTMAPINTERFACE_H
13
14 #include "openPASS-System/SystemComponentItemInterface.h"
15 #include <QMap>
16 #include <QObject>
17
22 class SystemComponentMapInterface : public QObject
23 {
24 Q_OBJECT
25
26 public:
27 using ID = SystemComponentItemInterface::ID;
28 using Item = SystemComponentItemInterface;
29
30 public:
31 using Map = QMap<ID, Item *>;
32 using Iterator = Map::Iterator;
33 using ConstIterator = Map::ConstIterator;
34
35 public:
36 explicit SystemComponentMapInterface(QObject * const parent = nullptr)
37 : QObject(parent) {}
38 virtual ~SystemComponentMapInterface() = default;
39
40 Q_SIGNALS:
41 //-----------------------------------------------------------------------------
46 //-----------------------------------------------------------------------------
47 void mode(bool const & modify) const;
48
49 Q_SIGNALS:
50 //-----------------------------------------------------------------------------
53 //-----------------------------------------------------------------------------
54 void cleared() const;
55
56 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 void added(SystemComponentMapInterface::Item * const component) const;
63
64 //-----------------------------------------------------------------------------
69 //-----------------------------------------------------------------------------
70 void removed(SystemComponentMapInterface::Item * const component) const;
71
72 public:
73 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 virtual bool add(SystemComponentMapInterface::ID const & id,
83 SystemComponentMapInterface::Item * const component) = 0;
84
85 //-----------------------------------------------------------------------------
93 //-----------------------------------------------------------------------------
94 virtual bool add(ComponentItemInterface const * const component,
95 SystemComponentItemInterface::Position const & position) = 0;
96
97 public:
98 //-----------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
104 virtual SystemComponentMapInterface::Iterator begin() = 0;
105
106 //-----------------------------------------------------------------------------
112 //-----------------------------------------------------------------------------
113 virtual SystemComponentMapInterface::ConstIterator begin() const = 0;
114
115 public:
116 //-----------------------------------------------------------------------------
120 //-----------------------------------------------------------------------------
121 virtual bool clear() = 0;
122
123 //-----------------------------------------------------------------------------
131 //-----------------------------------------------------------------------------
132 virtual bool contains(SystemComponentMapInterface::ID const &id) const = 0;
133
134 public:
135 //-----------------------------------------------------------------------------
140 //-----------------------------------------------------------------------------
141 virtual SystemComponentMapInterface::Iterator end() = 0;
142
143 //-----------------------------------------------------------------------------
148 //-----------------------------------------------------------------------------
149 virtual SystemComponentMapInterface::ConstIterator end() const = 0;
150
151 public:
152 //-----------------------------------------------------------------------------
158 //-----------------------------------------------------------------------------
159 virtual SystemComponentMapInterface::ID getID(SystemComponentMapInterface::Item * const item) const = 0;
160
161 //-----------------------------------------------------------------------------
167 //-----------------------------------------------------------------------------
168 virtual SystemComponentMapInterface::Item * getItem(SystemComponentMapInterface::ID const & id) const = 0;
169
170 public:
171 //-----------------------------------------------------------------------------
177 //-----------------------------------------------------------------------------
178 virtual bool remove(SystemComponentMapInterface::ID const & id) = 0;
179 };
180
181 #endif // SYSTEMCOMPONENTMAPINTERFACE_H
SystemComponentItemInterface::ID
unsigned int ID
The component&#39;s key identifier in the system.
Definition: SystemComponentItemInterface.h:40
SystemComponentMapInterface::clear
virtual bool clear()=0
Deregisters or remove all the components from the map (system).
SystemComponentMapInterface::removed
void removed(SystemComponentMapInterface::Item *const component) const
Triggers signal to inform that the component component have been successfully removed from the map (s...
ComponentItemInterface
This class defines the items constituing a component:
Definition: ComponentItemInterface.h:40
SystemComponentMapInterface::begin
virtual SystemComponentMapInterface::Iterator begin()=0
Gets an iterator pointing at the first component related-object in the map.
SystemComponentItemInterface::Position
QPoint Position
The position of the component in the System Editor.
Definition: SystemComponentItemInterface.h:48
SystemComponentMapInterface::cleared
void cleared() const
Triggers signal to inform that all components have been successfully removed from the map (system)...
SystemComponentMapInterface::contains
virtual bool contains(SystemComponentMapInterface::ID const &id) const =0
Verifies if the map contains the component related-object under the key identifier id...
SystemComponentMapInterface::add
virtual bool add(SystemComponentMapInterface::ID const &id, SystemComponentMapInterface::Item *const component)=0
Registers to the map the component related-object component under the key identifier id ...
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentMapInterface::mode
void mode(bool const &modify) const
Triggers signal to enable (when modify set to true) or disable (when set to false) the automatic repo...
SystemComponentItemInterface.h
The System Component Item Interface (SCmII) contains the functions setters and getters of the items c...
SystemComponentMapInterface::Map
QMap< ID, Item * > Map
The container registering components belonging to a system.
Definition: SystemComponentMapInterface.h:31
SystemComponentMapInterface::getItem
virtual SystemComponentMapInterface::Item * getItem(SystemComponentMapInterface::ID const &id) const =0
Gets the component related-object under the key identifier id that belongs to a system.
SystemComponentMapInterface::added
void added(SystemComponentMapInterface::Item *const component) const
Triggers signal to inform that the component component have been successfully added to the map (syste...
SystemComponentMapInterface::end
virtual SystemComponentMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last component related-object.
SystemComponentMapInterface::getID
virtual SystemComponentMapInterface::ID getID(SystemComponentMapInterface::Item *const item) const =0
Gets the key identifier of the component related-object item belonging to a system.
SystemComponentMapInterface::ID
SystemComponentItemInterface::ID ID
The identifier of a component.
Definition: SystemComponentMapInterface.h:27
SystemComponentMapInterface
This class manages the registration and deregistration of objects defining components (component rela...
Definition: SystemComponentMapInterface.h:22
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentOutputItemInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemComponentOutputItemInterface.h File Reference
System Plugin

The System Component Output Item Interface (SCOII) contains the functions getters of the items constituing an output of a component and accesses the object parent the component. This interface belongs to the System Plugin (SP). More...

Detailed Description

The System Component Output Item Interface (SCOII) contains the functions getters of the items constituing an output of a component and accesses the object parent the component. This interface belongs to the System Plugin (SP).

Definition in file SystemComponentOutputItemInterface.h.

Go to the source code of this file.

Classes

class SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system. These items are provided from the class defined in the Component Output Item Interface. This current class also provides access to the parent component where the output belongs to. This access allows retracing the connections by getting the output with its relative component (parent). More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentOutputItemInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemComponentOutputItemInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
10
11 #ifndef SYSTEMCOMPONENTOUTPUTITEMINTERFACE_H
12 #define SYSTEMCOMPONENTOUTPUTITEMINTERFACE_H
13
14 #include "openPASS-Component/ComponentOutputItemInterface.h"
15 #include <QObject>
16
17 class SystemComponentItemInterface;
18
26 class SystemComponentOutputItemInterface : public QObject
27 {
28 Q_OBJECT
29
30 public:
31 using ID = ComponentOutputItemInterface::ID;
32 using Type = ComponentOutputItemInterface::Type;
33 using Title = ComponentOutputItemInterface::Title;
34 using Unit = ComponentOutputItemInterface::Unit;
35
36 public:
37 explicit SystemComponentOutputItemInterface(QObject * const parent = nullptr)
38 : QObject(parent) {}
39 virtual ~SystemComponentOutputItemInterface() = default;
40
41 public:
42 //-----------------------------------------------------------------------------
46 //-----------------------------------------------------------------------------
47 virtual SystemComponentItemInterface * getComponent() const = 0;
48
49 public:
50 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 virtual SystemComponentOutputItemInterface::ID getID() const = 0;
56
57 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 virtual SystemComponentOutputItemInterface::Type getType() const = 0;
63
64 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 virtual SystemComponentOutputItemInterface::Title getTitle() const = 0;
70
71 //-----------------------------------------------------------------------------
75 //-----------------------------------------------------------------------------
76 virtual SystemComponentOutputItemInterface::Unit getUnit() const = 0;
77 };
78
79 #endif // SYSTEMCOMPONENTOUTPUTITEMINTERFACE_H
ComponentOutputItemInterface.h
The Component Output Item Interface (COII) contains the functions setters and getters of the items co...
SystemComponentOutputItemInterface::getID
virtual SystemComponentOutputItemInterface::ID getID() const =0
Gets the key identifier of the current registered output.
SystemComponentOutputItemInterface::getComponent
virtual SystemComponentItemInterface * getComponent() const =0
Gets the parent component where the current output belongs to.
SystemComponentOutputItemInterface::getType
virtual SystemComponentOutputItemInterface::Type getType() const =0
Gets the type of the current registered output.
SystemComponentOutputItemInterface::getUnit
virtual SystemComponentOutputItemInterface::Unit getUnit() const =0
Gets the unit of the current registered output.
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentOutputItemInterface::getTitle
virtual SystemComponentOutputItemInterface::Title getTitle() const =0
Gets the title of the current registered output.
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentOutputMapInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemComponentOutputMapInterface.h File Reference
System Plugin

The System Component Output Map Interface (SCOMI) contains the functions managing the registration and deregistration of the outputs of a component registered in a system. This interface belongs to the System Plugin (SP). More...

Detailed Description

The System Component Output Map Interface (SCOMI) contains the functions managing the registration and deregistration of the outputs of a component registered in a system. This interface belongs to the System Plugin (SP).

Definition in file SystemComponentOutputMapInterface.h.

Go to the source code of this file.

Classes

class SystemComponentOutputMapInterface
This class manages the registration and deregistration of outputs of a component registered in a system. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentOutputMapInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemComponentOutputMapInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
10
11 #ifndef SYSTEMCOMPONENTOUTPUTMAPINTERFACE_H
12 #define SYSTEMCOMPONENTOUTPUTMAPINTERFACE_H
13
14 #include "openPASS-System/SystemComponentOutputItemInterface.h"
15 #include <QMap>
16 #include <QObject>
17
22 class SystemComponentOutputMapInterface : public QObject
23 {
24 Q_OBJECT
25
26 public:
27 using ID = SystemComponentOutputItemInterface::ID;
28 using Item = SystemComponentOutputItemInterface;
29
30 public:
31 using Map = QMap<ID, Item *>;
32 using Iterator = Map::Iterator;
33 using ConstIterator = Map::ConstIterator;
34
35 public:
36 explicit SystemComponentOutputMapInterface(QObject * const parent = nullptr)
37 : QObject(parent) {}
38 virtual ~SystemComponentOutputMapInterface() = default;
39
40 public:
41 //-----------------------------------------------------------------------------
45 //-----------------------------------------------------------------------------
46 virtual SystemComponentOutputMapInterface::Iterator begin() = 0;
47
48 //-----------------------------------------------------------------------------
53 //-----------------------------------------------------------------------------
54 virtual SystemComponentOutputMapInterface::ConstIterator begin() const = 0;
55
56 public:
57 //-----------------------------------------------------------------------------
62 //-----------------------------------------------------------------------------
63 virtual bool contains(SystemComponentOutputMapInterface::ID const & id) const = 0;
64
65 public:
66 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 virtual SystemComponentOutputMapInterface::Iterator end() = 0;
73
74 //-----------------------------------------------------------------------------
79 //-----------------------------------------------------------------------------
80 virtual SystemComponentOutputMapInterface::ConstIterator end() const = 0;
81
82 public:
83 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 virtual SystemComponentOutputMapInterface::ID getID(SystemComponentOutputMapInterface::Item * const item) const = 0;
91
92 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 virtual SystemComponentOutputMapInterface::Item * getItem(SystemComponentOutputMapInterface::ID const & id) const = 0;
99 };
100
101 #endif // SYSTEMCOMPONENTOUTPUTMAPMODEL_H
SystemComponentOutputMapInterface
This class manages the registration and deregistration of outputs of a component registered in a syst...
Definition: SystemComponentOutputMapInterface.h:22
SystemComponentOutputMapInterface::Map
QMap< ID, Item * > Map
The container registering outputs.
Definition: SystemComponentOutputMapInterface.h:31
SystemComponentOutputMapInterface::end
virtual SystemComponentOutputMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last registered output. ...
SystemComponentOutputMapInterface::getItem
virtual SystemComponentOutputMapInterface::Item * getItem(SystemComponentOutputMapInterface::ID const &id) const =0
Gets the registered output related-object under the key identifier id.
SystemComponentOutputMapInterface::getID
virtual SystemComponentOutputMapInterface::ID getID(SystemComponentOutputMapInterface::Item *const item) const =0
Gets the key identifier of the component output related-object item as registered in the map...
SystemComponentOutputMapInterface::begin
virtual SystemComponentOutputMapInterface::Iterator begin()=0
Gets an iterator pointing at the first registered output in the map.
SystemComponentOutputItemInterface.h
The System Component Output Item Interface (SCOII) contains the functions getters of the items consti...
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemComponentOutputMapInterface::ID
SystemComponentOutputItemInterface::ID ID
The output&#39;s key identifier.
Definition: SystemComponentOutputMapInterface.h:27
SystemComponentOutputMapInterface::contains
virtual bool contains(SystemComponentOutputMapInterface::ID const &id) const =0
Verifies if the map contains the output under the key identifier id.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterItemInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemComponentParameterItemInterface.h File Reference
System Plugin

The System Component Parameter Item Interface (SCPII) contains the functions setters and getters of the items constituing a parameter of a component registered in a system. This interface belongs to the System Plugin (SP). More...

Detailed Description

The System Component Parameter Item Interface (SCPII) contains the functions setters and getters of the items constituing a parameter of a component registered in a system. This interface belongs to the System Plugin (SP).

Definition in file SystemComponentParameterItemInterface.h.

Go to the source code of this file.

Classes

class SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system. These items are provided from the class defined in the Component Parameter Item Interface. They are not modifiable in this class except the Value through callbacks defined for the System Editor. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterItemInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemComponentParameterItemInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
10
11 #ifndef SYSTEMCOMPONENTPARAMETERITEMINTERFACE_H
12 #define SYSTEMCOMPONENTPARAMETERITEMINTERFACE_H
13
14 #include "openPASS-Component/ComponentParameterItemInterface.h"
15 #include <QObject>
16
23 class SystemComponentParameterItemInterface : public QObject
24 {
25 Q_OBJECT
26
27 public:
28 using ID = ComponentParameterItemInterface::ID;
29 using Type = ComponentParameterItemInterface::Type;
30 using Title = ComponentParameterItemInterface::Title;
31 using Unit = ComponentParameterItemInterface::Unit;
32 using Value = ComponentParameterItemInterface::Value;
33
34 public:
35 explicit SystemComponentParameterItemInterface(QObject * const parent = nullptr)
36 : QObject(parent) {}
37 virtual ~SystemComponentParameterItemInterface() = default;
38
39 Q_SIGNALS:
40 //-----------------------------------------------------------------------------
43 //-----------------------------------------------------------------------------
44 void modifiedValue() const;
45
46 public:
47 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
52 virtual SystemComponentParameterItemInterface::ID getID() const = 0;
53
54 //-----------------------------------------------------------------------------
58 //-----------------------------------------------------------------------------
59 virtual SystemComponentParameterItemInterface::Type getType() const = 0;
60
61 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
66 virtual SystemComponentParameterItemInterface::Title getTitle() const = 0;
67
68 //-----------------------------------------------------------------------------
72 //-----------------------------------------------------------------------------
73 virtual SystemComponentParameterItemInterface::Unit getUnit() const = 0;
74
75 public:
76 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
81 virtual bool setValue(SystemComponentParameterItemInterface::Value const & value) = 0;
82
83 //-----------------------------------------------------------------------------
87 //-----------------------------------------------------------------------------
88 virtual SystemComponentParameterItemInterface::Value getValue() const = 0;
89 };
90
91 #endif // SYSTEMCOMPONENTPARAMETERITEMINTERFACE_H
SystemComponentParameterItemInterface::getType
virtual SystemComponentParameterItemInterface::Type getType() const =0
Gets the type of the current registered parameter.
SystemComponentParameterItemInterface::setValue
virtual bool setValue(SystemComponentParameterItemInterface::Value const &value)=0
Sets the value of the current registered parameter.
SystemComponentParameterItemInterface::getUnit
virtual SystemComponentParameterItemInterface::Unit getUnit() const =0
Gets the unit of the current registered parameter.
ComponentParameterItemInterface.h
The Component Parameter Item Interface (CPII) contains the functions setters and getters of the items...
SystemComponentParameterItemInterface::getTitle
virtual SystemComponentParameterItemInterface::Title getTitle() const =0
Gets the title of the current registered parameter.
SystemComponentParameterItemInterface::getID
virtual SystemComponentParameterItemInterface::ID getID() const =0
Gets the key identifier of the current registered parameter.
SystemComponentParameterItemInterface::modifiedValue
void modifiedValue() const
Triggers signal to inform that the value of the registered parameter has been modified.
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
SystemComponentParameterItemInterface::getValue
virtual SystemComponentParameterItemInterface::Value getValue() const =0
Gets the value of the current registered parameter.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterMapInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemComponentParameterMapInterface.h File Reference
System Plugin

The System Component Parameter Map Interface (SCPMI) contains the functions managing the registration and deregistration of the parameters of a component registered to a system. This interface belongs to the System Plugin (CP). More...

Detailed Description

The System Component Parameter Map Interface (SCPMI) contains the functions managing the registration and deregistration of the parameters of a component registered to a system. This interface belongs to the System Plugin (CP).

Definition in file SystemComponentParameterMapInterface.h.

Go to the source code of this file.

Classes

class SystemComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component registered in a system. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterMapInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemComponentParameterMapInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
10
11 #ifndef SYSTEMCOMPONENTPARAMETERMAPINTERFACE_H
12 #define SYSTEMCOMPONENTPARAMETERMAPINTERFACE_H
13
14 #include "openPASS-System/SystemComponentParameterItemInterface.h"
15 #include <QMap>
16 #include <QObject>
17
22 class SystemComponentParameterMapInterface : public QObject
23 {
24 Q_OBJECT
25
26 public:
27 using ID = SystemComponentParameterItemInterface::ID;
28 using Item = SystemComponentParameterItemInterface;
29
30 public:
31 using Map = QMap<ID, Item *>;
32 using Iterator = Map::Iterator;
33 using ConstIterator = Map::ConstIterator;
34
35 public:
36 explicit SystemComponentParameterMapInterface(QObject * const parent = nullptr)
37 : QObject(parent) {}
38 virtual ~SystemComponentParameterMapInterface() = default;
39
40 public:
41 //-----------------------------------------------------------------------------
46 //-----------------------------------------------------------------------------
47 virtual SystemComponentParameterMapInterface::Iterator begin() = 0;
48
49 //-----------------------------------------------------------------------------
55 //-----------------------------------------------------------------------------
56 virtual SystemComponentParameterMapInterface::ConstIterator begin() const = 0;
57
58 public:
59 //-----------------------------------------------------------------------------
63 //-----------------------------------------------------------------------------
64 virtual int count() const = 0;
65
66 public:
67 //-----------------------------------------------------------------------------
72 //-----------------------------------------------------------------------------
73 virtual SystemComponentParameterMapInterface::Iterator end() = 0;
74 //-----------------------------------------------------------------------------
79 //-----------------------------------------------------------------------------
80 virtual SystemComponentParameterMapInterface::ConstIterator end() const = 0;
81
82 public:
83 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 virtual SystemComponentParameterMapInterface::ID getID(SystemComponentParameterMapInterface::Item * const item) const = 0;
91
92 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 virtual SystemComponentParameterMapInterface::Item * getItem(SystemComponentParameterMapInterface::ID const & id) const = 0;
99 };
100
101 #endif // SYSTEMCOMPONENTPARAMETERMAPINTERFACE_H
SystemComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component registered in a s...
Definition: SystemComponentParameterMapInterface.h:22
SystemComponentParameterMapInterface::count
virtual int count() const =0
Counts the number of parameters registered for a component.
SystemComponentParameterMapInterface::getItem
virtual SystemComponentParameterMapInterface::Item * getItem(SystemComponentParameterMapInterface::ID const &id) const =0
Gets the registered parameter related-object under the key identifier id.
SystemComponentParameterMapInterface::ID
SystemComponentParameterItemInterface::ID ID
The parameter&#39;s key identifier.
Definition: SystemComponentParameterMapInterface.h:27
SystemComponentParameterMapInterface::end
virtual SystemComponentParameterMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last registered parameter.
SystemComponentParameterMapInterface::begin
virtual SystemComponentParameterMapInterface::Iterator begin()=0
Gets an iterator pointing at the first registered parameter in the map.
SystemComponentParameterMapInterface::getID
virtual SystemComponentParameterMapInterface::ID getID(SystemComponentParameterMapInterface::Item *const item) const =0
Gets the key identifier of the registered parameter related-object item in the map.
SystemComponentParameterMapInterface::Map
QMap< ID, Item * > Map
The container registering parameters.
Definition: SystemComponentParameterMapInterface.h:31
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
SystemComponentParameterItemInterface.h
The System Component Parameter Item Interface (SCPII) contains the functions setters and getters of t...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentScheduleInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemComponentScheduleInterface.h File Reference
System Plugin

The System Component Schedule Interface (SCSI) contains the functions setters and getters for the simulation schedule related parameters of a component registered in a system. This interface belongs to the System Plugin (SP). More...

Detailed Description

The System Component Schedule Interface (SCSI) contains the functions setters and getters for the simulation schedule related parameters of a component registered in a system. This interface belongs to the System Plugin (SP).

Definition in file SystemComponentScheduleInterface.h.

Go to the source code of this file.

Classes

class SystemComponentScheduleInterface
This class defines the simulation schedule related parameters of a component registered in a system: More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentScheduleInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemComponentScheduleInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
10
11 #ifndef SYSTEMCOMPONENTSCHEDULEINTERFACE_H
12 #define SYSTEMCOMPONENTSCHEDULEINTERFACE_H
13
14 #include "openPASS-Component/ComponentScheduleInterface.h"
15 #include <QObject>
16
25 class SystemComponentScheduleInterface : public QObject
26 {
27 Q_OBJECT
28
29 public:
30 using Priority = unsigned int;
31 using Offset = ComponentScheduleInterface::Offset;
32 using Cycle = ComponentScheduleInterface::Cycle;
33 using Response = ComponentScheduleInterface::Response;
34
35 public:
36 explicit SystemComponentScheduleInterface(QObject * const parent = nullptr)
37 : QObject(parent) {}
38 virtual ~SystemComponentScheduleInterface() = default;
39
40 Q_SIGNALS:
41 //-----------------------------------------------------------------------------
44 //-----------------------------------------------------------------------------
45 void modifiedPriority() const;
46
47 //-----------------------------------------------------------------------------
50 //-----------------------------------------------------------------------------
51 void modifiedOffset() const;
52
53 //-----------------------------------------------------------------------------
56 //-----------------------------------------------------------------------------
57 void modifiedCycle() const;
58
59 //-----------------------------------------------------------------------------
62 //-----------------------------------------------------------------------------
63 void modifiedResponse() const;
64
65 public:
66 //-----------------------------------------------------------------------------
70 //-----------------------------------------------------------------------------
71 virtual bool setPriority(SystemComponentScheduleInterface::Priority const & priority) = 0;
72
73 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 virtual SystemComponentScheduleInterface::Priority getPriority() const = 0;
79
80 public:
81 //-----------------------------------------------------------------------------
85 //-----------------------------------------------------------------------------
86 virtual bool setOffset(SystemComponentScheduleInterface::Offset const & offset) = 0;
87
88 //-----------------------------------------------------------------------------
92 //-----------------------------------------------------------------------------
93 virtual SystemComponentScheduleInterface::Offset getOffset() const = 0;
94
95 public:
96 //-----------------------------------------------------------------------------
100 //-----------------------------------------------------------------------------
101 virtual bool setCycle(SystemComponentScheduleInterface::Cycle const & cycle) = 0;
102
103 //-----------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------
108 virtual SystemComponentScheduleInterface::Cycle getCycle() const = 0;
109
110 public:
111 //-----------------------------------------------------------------------------
115 //-----------------------------------------------------------------------------
116 virtual bool setResponse(SystemComponentScheduleInterface::Response const & response) = 0;
117
118 //-----------------------------------------------------------------------------
122 //-----------------------------------------------------------------------------
123 virtual SystemComponentScheduleInterface::Response getResponse() const = 0;
124 };
125
126 #endif // SYSTEMCOMPONENTSCHEDULEINTERFACE_H
SystemComponentScheduleInterface::setResponse
virtual bool setResponse(SystemComponentScheduleInterface::Response const &response)=0
Sets the Response Time for the current registered component.
SystemComponentScheduleInterface::modifiedCycle
void modifiedCycle() const
Triggers signal to inform that the Cycle Time of the component has been modified. ...
SystemComponentScheduleInterface::getPriority
virtual SystemComponentScheduleInterface::Priority getPriority() const =0
Gets the Priority for the current registered component.
SystemComponentScheduleInterface::setCycle
virtual bool setCycle(SystemComponentScheduleInterface::Cycle const &cycle)=0
Sets the Cycle Time for the current registered component.
SystemComponentScheduleInterface
This class defines the simulation schedule related parameters of a component registered in a system: ...
Definition: SystemComponentScheduleInterface.h:25
SystemComponentScheduleInterface::setPriority
virtual bool setPriority(SystemComponentScheduleInterface::Priority const &priority)=0
Sets the Priority for the current registered component.
SystemComponentScheduleInterface::getOffset
virtual SystemComponentScheduleInterface::Offset getOffset() const =0
Gets the Offset Time for the current registered component.
SystemComponentScheduleInterface::getResponse
virtual SystemComponentScheduleInterface::Response getResponse() const =0
Gets the Response Time for the current registered component.
SystemComponentScheduleInterface::modifiedResponse
void modifiedResponse() const
Triggers signal to inform that the Response Time of the component has been modified.
SystemComponentScheduleInterface::modifiedPriority
void modifiedPriority() const
Triggers signal to inform that the Priority of the component has been modified.
SystemComponentScheduleInterface::setOffset
virtual bool setOffset(SystemComponentScheduleInterface::Offset const &offset)=0
Sets the Priority for the current registered component.
SystemComponentScheduleInterface::modifiedOffset
void modifiedOffset() const
Triggers signal to inform that the Offset Time of the component has been modified.
SystemComponentScheduleInterface::getCycle
virtual SystemComponentScheduleInterface::Cycle getCycle() const =0
Gets the Cycle Time for the current registered component.
ComponentScheduleInterface.h
The Component Schedule Interface (CSI) contains the functions setters and getters for the schedule pa...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemConnectionItemInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemConnectionItemInterface.h File Reference
System Plugin

The System Connection Item Interface (SCnII) contains the functions getters of the items constituing the connection between two components of a system. This interface belongs to the System Plugin (SP). More...

Detailed Description

The System Connection Item Interface (SCnII) contains the functions getters of the items constituing the connection between two components of a system. This interface belongs to the System Plugin (SP).

Definition in file SystemConnectionItemInterface.h.

Go to the source code of this file.

Classes

class SystemConnectionItemInterface
This class defines the items constituing the connection that is established between two components of a system: More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemConnectionItemInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemConnectionItemInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
10
11 #ifndef SYSTEMCONNECTIONITEMINTERFACE_H
12 #define SYSTEMCONNECTIONITEMINTERFACE_H
13
14 #include "openPASS-System/SystemComponentInputItemInterface.h"
15 #include "openPASS-System/SystemComponentOutputItemInterface.h"
16 #include <QObject>
17
27 class SystemConnectionItemInterface : public QObject
28 {
29 Q_OBJECT
30
31 public:
32 using ID = unsigned int;
33 using Source = SystemComponentOutputItemInterface;
34 using Target = SystemComponentInputItemInterface;
35
36 public:
37 explicit SystemConnectionItemInterface(QObject * const parent = nullptr)
38 : QObject(parent) {}
39 virtual ~SystemConnectionItemInterface() = default;
40
41 public:
42 //-----------------------------------------------------------------------------
46 //-----------------------------------------------------------------------------
47 virtual SystemConnectionItemInterface::ID getID() const = 0;
48
49 //-----------------------------------------------------------------------------
53 //-----------------------------------------------------------------------------
54 virtual SystemConnectionItemInterface::Source const * getSource() const = 0;
55
56 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 virtual SystemConnectionItemInterface::Target const * getTarget() const = 0;
62
63 //-----------------------------------------------------------------------------
70 //-----------------------------------------------------------------------------
71 virtual bool isCompatible() const = 0;
72 };
73
74 #endif // SYSTEMCONNECTIONITEMINTERFACE_H
SystemConnectionItemInterface::ID
unsigned int ID
The identifie of a connection between two components.
Definition: SystemConnectionItemInterface.h:32
SystemConnectionItemInterface::getID
virtual SystemConnectionItemInterface::ID getID() const =0
Gets the key identifier of this connection in accordance to the system.
SystemComponentInputItemInterface.h
The System Component Input Item Interface (SCIII) contains the functions getters of the items constit...
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemConnectionItemInterface::getSource
virtual SystemConnectionItemInterface::Source const * getSource() const =0
Gets the starting of a connection which is the output of a component.
SystemConnectionItemInterface::isCompatible
virtual bool isCompatible() const =0
Verifies if the output source of a component is compatible with the input target of the component sel...
SystemConnectionItemInterface::getTarget
virtual SystemConnectionItemInterface::Target const * getTarget() const =0
Gets the ending of a connection which is the input of a component.
SystemComponentOutputItemInterface.h
The System Component Output Item Interface (SCOII) contains the functions getters of the items consti...
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemConnectionItemInterface
This class defines the items constituing the connection that is established between two components of...
Definition: SystemConnectionItemInterface.h:27
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemConnectionMapInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemConnectionMapInterface.h File Reference
System Plugin

The System Connection Map Interface (SCnMI) contains the functions managing the registration and deregistration of connections linking components building a system. This interface belongs to the System Plugin (SP). More...

Detailed Description

The System Connection Map Interface (SCnMI) contains the functions managing the registration and deregistration of connections linking components building a system. This interface belongs to the System Plugin (SP).

Definition in file SystemConnectionMapInterface.h.

Go to the source code of this file.

Classes

class SystemConnectionMapInterface
This class manages the registration and deregistration of objects defining connections (connection related-objects) that model the data flow between the components constituing a system. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemConnectionMapInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemConnectionMapInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
10
11 #ifndef SYSTEMCONNECTIONMAPINTERFACE_H
12 #define SYSTEMCONNECTIONMAPINTERFACE_H
13
14 #include "openPASS-System/SystemComponentItemInterface.h"
15 #include "openPASS-System/SystemConnectionItemInterface.h"
16 #include <QList>
17 #include <QMap>
18 #include <QObject>
19
25 class SystemConnectionMapInterface : public QObject
26 {
27 Q_OBJECT
28
29 public:
30 using ID = SystemConnectionItemInterface::ID;
31 using Item = SystemConnectionItemInterface;
32
33 public:
34 using Map = QMap<ID, Item *>;
35 using Iterator = Map::Iterator;
36 using ConstIterator = Map::ConstIterator;
37
38 public:
39 using Component = SystemComponentItemInterface;
40 using Source = SystemConnectionItemInterface::Source;
41 using Target = SystemConnectionItemInterface::Target;
42
43 public:
44 explicit SystemConnectionMapInterface(QObject * const parent = nullptr)
45 : QObject(parent) {}
46 virtual ~SystemConnectionMapInterface() = default;
47
48 Q_SIGNALS:
49 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 void mode(bool const & modify) const;
56
57 Q_SIGNALS:
58 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 void modified() const;
63
64 public:
65 //-----------------------------------------------------------------------------
70 //-----------------------------------------------------------------------------
71 virtual SystemConnectionMapInterface::Iterator begin() = 0;
72
73 //-----------------------------------------------------------------------------
79 //-----------------------------------------------------------------------------
80 virtual SystemConnectionMapInterface::ConstIterator begin() const = 0;
81
82 public:
83 //-----------------------------------------------------------------------------
88 //-----------------------------------------------------------------------------
89 virtual SystemConnectionMapInterface::Iterator end() = 0;
90
91 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 virtual SystemConnectionMapInterface::ConstIterator end() const = 0;
98
99 public:
100 //-----------------------------------------------------------------------------
106 //-----------------------------------------------------------------------------
107 virtual SystemConnectionMapInterface::ID getID(SystemConnectionMapInterface::Item * const item) const = 0;
108
109 //-----------------------------------------------------------------------------
115 //-----------------------------------------------------------------------------
116 virtual SystemConnectionMapInterface::Item * getItem(SystemConnectionMapInterface::ID const & id) const = 0;
117
118 public:
119 //-----------------------------------------------------------------------------
123 //-----------------------------------------------------------------------------
124 virtual bool clear() = 0;
125
126 //-----------------------------------------------------------------------------
136 //-----------------------------------------------------------------------------
137 virtual bool add(SystemConnectionMapInterface::ID const & id,
138 SystemConnectionMapInterface::Source const * const source,
139 SystemConnectionMapInterface::Target const * const target) = 0;
140
141 //-----------------------------------------------------------------------------
150 //-----------------------------------------------------------------------------
151 virtual bool add(SystemConnectionMapInterface::Source const * const source,
152 SystemConnectionMapInterface::Target const * const target) = 0;
153
154 //-----------------------------------------------------------------------------
161 //-----------------------------------------------------------------------------
162 virtual bool contains(SystemConnectionMapInterface::Source const * const source,
163 SystemConnectionMapInterface::Target const * const target) const = 0;
164
165 //-----------------------------------------------------------------------------
171 //-----------------------------------------------------------------------------
172 virtual bool remove(SystemConnectionMapInterface::Component const * const component) = 0;
173
174 //-----------------------------------------------------------------------------
179 //-----------------------------------------------------------------------------
180 virtual bool remove(SystemConnectionMapInterface::Source const * const source) = 0;
181
182 //-----------------------------------------------------------------------------
187 //-----------------------------------------------------------------------------
188 virtual bool remove(SystemConnectionMapInterface::Target const * const target) = 0;
189 };
190
191 #endif // SYSTEMCONNECTIONMAPINTERFACE_H
SystemConnectionMapInterface::modified
void modified() const
Triggers signal to inform that connections have been modified (Called to update the View in the Syste...
SystemConnectionItemInterface::ID
unsigned int ID
The identifie of a connection between two components.
Definition: SystemConnectionItemInterface.h:32
SystemConnectionMapInterface::contains
virtual bool contains(SystemConnectionMapInterface::Source const *const source, SystemConnectionMapInterface::Target const *const target) const =0
Verifies if the map contains the connection related-object with the items source and target correspon...
SystemConnectionItemInterface::Source
SystemComponentOutputItemInterface Source
The output of a component of a system (connection extremity)
Definition: SystemConnectionItemInterface.h:33
SystemConnectionItemInterface::Target
SystemComponentInputItemInterface Target
The input of a component of a system (connection extremity)
Definition: SystemConnectionItemInterface.h:34
SystemConnectionMapInterface::mode
void mode(bool const &modify) const
Triggers signal to enable (when modify set to true) or disable (when set to false) the automatic repo...
SystemConnectionMapInterface::getItem
virtual SystemConnectionMapInterface::Item * getItem(SystemConnectionMapInterface::ID const &id) const =0
Gets the connection related-object under the key identifier id that belongs to a system.
SystemConnectionMapInterface::ID
SystemConnectionItemInterface::ID ID
The identifier of a connection.
Definition: SystemConnectionMapInterface.h:30
SystemConnectionMapInterface::begin
virtual SystemConnectionMapInterface::Iterator begin()=0
Gets an iterator pointing at the first connection related-object in the map.
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemConnectionMapInterface::add
virtual bool add(SystemConnectionMapInterface::ID const &id, SystemConnectionMapInterface::Source const *const source, SystemConnectionMapInterface::Target const *const target)=0
Registers to the map the connection related-object under the key identifier id and with the pair of i...
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemConnectionMapInterface::Map
QMap< ID, Item * > Map
The container registering the connections.
Definition: SystemConnectionMapInterface.h:34
SystemComponentItemInterface.h
The System Component Item Interface (SCmII) contains the functions setters and getters of the items c...
SystemConnectionItemInterface.h
The System Connection Item Interface (SCnII) contains the functions getters of the items constituing ...
SystemConnectionMapInterface::clear
virtual bool clear()=0
Deregisters or remove all the connections from the map (system).
SystemConnectionMapInterface
This class manages the registration and deregistration of objects defining connections (connection re...
Definition: SystemConnectionMapInterface.h:25
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemConnectionMapInterface::end
virtual SystemConnectionMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last connection related-object.
SystemConnectionItemInterface
This class defines the items constituing the connection that is established between two components of...
Definition: SystemConnectionItemInterface.h:27
SystemConnectionMapInterface::getID
virtual SystemConnectionMapInterface::ID getID(SystemConnectionMapInterface::Item *const item) const =0
Gets the key identifier of the connection related-object item belonging to a system.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemInterface.h File Reference
System Plugin

The System Interface (SI) contains the functions creating systems and creating a tree listing the components loaded from library. This interface belongs to the System Plugin (SP). More...

Detailed Description

The System Interface (SI) contains the functions creating systems and creating a tree listing the components loaded from library. This interface belongs to the System Plugin (SP).

Definition in file SystemInterface.h.

Go to the source code of this file.

Classes

class SystemInterface
This class manages creating new systems and also creating the tree of components loaded from a library and used to build systems. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
8 //-----------------------------------------------------------------------------
9
10 #ifndef SYSTEMINTERFACE_H
11 #define SYSTEMINTERFACE_H
12
13 #include "openPASS/ServiceInterface.h"
14 #include "openPASS-System/SystemComponentManagerInterface.h"
15 #include "openPASS-System/SystemMapInterface.h"
16 #include <QIODevice>
17 #include <QObject>
18 #include <QString>
19
20 static ServiceManagerInterface::ID const SystemInterfaceID =
21 ServiceManagerInterfaceID("openPASS.System.SystemInterface");
22
27 class SystemInterface : public QObject,
28 public ServiceInterface<SystemInterface, SystemInterfaceID>
29 {
30 Q_OBJECT
31
32 public:
33 explicit SystemInterface(QObject * const parent = nullptr)
34 : QObject(parent), ServiceInterface(this) {}
35 virtual ~SystemInterface() = default;
36
37 Q_SIGNALS:
38 //-----------------------------------------------------------------------------
42 //-----------------------------------------------------------------------------
43 void cleared() const;
44
45 //-----------------------------------------------------------------------------
49 //-----------------------------------------------------------------------------
50 void loaded() const;
51
52 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 void saved() const;
56
57 public:
58 //-----------------------------------------------------------------------------
63 //-----------------------------------------------------------------------------
64 virtual bool clear() = 0;
65
66 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 virtual bool load(QString const & filepath) = 0;
75
76 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 virtual bool load(QIODevice * const device) = 0;
83
84 //-----------------------------------------------------------------------------
91 //-----------------------------------------------------------------------------
92 virtual bool save(QString const & filepath) const = 0;
93
94 //-----------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------
100 virtual bool save(QIODevice * const device) const = 0;
101
102 public:
103 //-----------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------
108 virtual SystemComponentManagerInterface * getComponents() const = 0;
109
110 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------
115 virtual SystemMapInterface * getSystems() const = 0;
116 };
117
118 #endif // SYSTEMINTERFACE_H
ServiceInterface.h
...
SystemMapInterface.h
The System Map Interface (SMI) contains the functions managing the registration and deregistration of...
SystemInterface::loaded
void loaded() const
Triggers signal to inform that a system has been loaded successfully (e.g. used to update the System ...
SystemInterface::getComponents
virtual SystemComponentManagerInterface * getComponents() const =0
Creates an object managing the load and search of components.
SystemInterface::saved
void saved() const
Triggers signal to inform that a system has been saved successfully.
SystemComponentManagerInterface.h
The System Component Manager Interface (SCMI) contains the functions loading components as a library ...
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemMapInterface
This class manages the registration and deregistration of object defining a system (system related-ob...
Definition: SystemMapInterface.h:21
SystemInterface::cleared
void cleared() const
Triggers signal to inform that a system has been reset successfully (e.g. used to update the System E...
SystemInterface::clear
virtual bool clear()=0
Resets the system (e.g. function called when users pressing on <New> button in the System Editor)...
SystemInterface::load
virtual bool load(QString const &filepath)=0
Loads a system from a file located in the given path filepath. (e.g. function called when users press...
SystemInterface
This class manages creating new systems and also creating the tree of components loaded from a librar...
Definition: SystemInterface.h:27
SystemInterface::getSystems
virtual SystemMapInterface * getSystems() const =0
Creates a map (container) to register systems.
SystemInterface::save
virtual bool save(QString const &filepath) const =0
Saves a system to a file stored in the given path filepath. (e.g. function called when users pressing...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemItemInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemItemInterface.h File Reference
System Plugin

The System Item Interface (SII) contains the functions setters and getters of the items constituing a system. This interface belongs to the System Plugin (SP). More...

Detailed Description

The System Item Interface (SII) contains the functions setters and getters of the items constituing a system. This interface belongs to the System Plugin (SP).

Definition in file SystemItemInterface.h.

Go to the source code of this file.

Classes

class SystemItemInterface
This class defines the items constituing a system: More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemItemInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemItemInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
8 //-----------------------------------------------------------------------------
9
10 #ifndef SYSTEMITEMINTERFACE_H
11 #define SYSTEMITEMINTERFACE_H
12
13 #include "openPASS-System/SystemComponentMapInterface.h"
14 #include "openPASS-System/SystemConnectionMapInterface.h"
15 #include <QObject>
16 #include <QString>
17
26 class SystemItemInterface : public QObject
27 {
28 Q_OBJECT
29
30 public:
31 using ID = unsigned int;
32 using Title = QString;
33 using Priority = unsigned int;
34 using ComponentMap = SystemComponentMapInterface;
35 using ConnectionMap = SystemConnectionMapInterface;
36
37 public:
38 explicit SystemItemInterface(QObject * const parent = nullptr)
39 : QObject(parent) {}
40 virtual ~SystemItemInterface() = default;
41
42 Q_SIGNALS:
43 //-----------------------------------------------------------------------------
45 //-----------------------------------------------------------------------------
46 void modifiedTitle() const;
47
48 //-----------------------------------------------------------------------------
50 //-----------------------------------------------------------------------------
51 void modifiedPriority() const;
52
53 public:
54 //-----------------------------------------------------------------------------
59 //-----------------------------------------------------------------------------
60 virtual SystemItemInterface::ID getID() const = 0;
61
62 public:
63 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 virtual bool setTitle(SystemItemInterface::Title const & title) = 0;
69
70 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 virtual SystemItemInterface::Title getTitle() const = 0;
76
77 public:
78 //-----------------------------------------------------------------------------
82 //-----------------------------------------------------------------------------
83 virtual bool setPriority(SystemItemInterface::Priority const & priority) = 0;
84
85 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 virtual SystemItemInterface::Priority getPriority() const = 0;
91
92 public:
93 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 virtual SystemItemInterface::ComponentMap * getComponents() const = 0;
99
100 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
105 virtual SystemItemInterface::ConnectionMap * getConnections() const = 0;
106
107 public:
108 //-----------------------------------------------------------------------------
117 //-----------------------------------------------------------------------------
118 virtual QList<SystemConnectionMapInterface::Source const *> getCompatibleSources(
119 SystemConnectionMapInterface::Target const * const target) = 0;
120
121 //-----------------------------------------------------------------------------
130 //-----------------------------------------------------------------------------
131 virtual QList<SystemConnectionMapInterface::Target const *> getCompatibleTargets(
132 SystemConnectionMapInterface::Source const * const source) = 0;
133 };
134
135 #endif // SYSTEMITEMINTERFACE_H
SystemItemInterface::getConnections
virtual SystemItemInterface::ConnectionMap * getConnections() const =0
Creates a map to register connections that link the components of the system.
SystemItemInterface::getCompatibleSources
virtual QList< SystemConnectionMapInterface::Source const * > getCompatibleSources(SystemConnectionMapInterface::Target const *const target)=0
Gets a list of outputs of components constituing the current system. These outputs are checked to be ...
SystemItemInterface::getTitle
virtual SystemItemInterface::Title getTitle() const =0
Gets the title of the current registered system.
SystemItemInterface::getCompatibleTargets
virtual QList< SystemConnectionMapInterface::Target const * > getCompatibleTargets(SystemConnectionMapInterface::Source const *const source)=0
Gets a list of inputs of components constituing the current system. These inputs are checked to be co...
SystemItemInterface::ID
unsigned int ID
The identifier of the system.
Definition: SystemItemInterface.h:31
SystemItemInterface::Title
QString Title
The title for the system.
Definition: SystemItemInterface.h:32
SystemItemInterface::modifiedPriority
void modifiedPriority() const
Triggers signal to inform that the priority of a system has been modified.
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
SystemItemInterface::Priority
unsigned int Priority
The parameter Priority for the system.
Definition: SystemItemInterface.h:33
SystemConnectionMapInterface
This class manages the registration and deregistration of objects defining connections (connection re...
Definition: SystemConnectionMapInterface.h:25
SystemComponentMapInterface.h
The System Component Map Interface (SCmMI) contains the functions managing the registration and dereg...
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemItemInterface::getComponents
virtual SystemItemInterface::ComponentMap * getComponents() const =0
Creates a map to register components that build the system.
SystemItemInterface::setPriority
virtual bool setPriority(SystemItemInterface::Priority const &priority)=0
Sets a priority to the current registered system.
SystemItemInterface::modifiedTitle
void modifiedTitle() const
Triggers signal to inform that the title of a system has been modified.
SystemItemInterface::getPriority
virtual SystemItemInterface::Priority getPriority() const =0
Gets the priority of the current registered system.
SystemItemInterface::getID
virtual SystemItemInterface::ID getID() const =0
Gets from the map (container) the key identifier of the current registered system.
SystemComponentMapInterface
This class manages the registration and deregistration of objects defining components (component rela...
Definition: SystemComponentMapInterface.h:22
SystemConnectionMapInterface.h
The System Connection Map Interface (SCnMI) contains the functions managing the registration and dere...
SystemItemInterface::setTitle
virtual bool setTitle(SystemItemInterface::Title const &title)=0
Sets a title to the current registered system.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemMapInterface.h File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
Classes
SystemMapInterface.h File Reference
System Plugin

The System Map Interface (SMI) contains the functions managing the registration and deregistration of systems. This interface belongs to the System Plugin (SP). More...

Detailed Description

The System Map Interface (SMI) contains the functions managing the registration and deregistration of systems. This interface belongs to the System Plugin (SP).

Definition in file SystemMapInterface.h.

Go to the source code of this file.

Classes

class SystemMapInterface
This class manages the registration and deregistration of object defining a system (system related-objects) using as identifier a key id. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemMapInterface.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
SystemMapInterface.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
8 //-----------------------------------------------------------------------------
9
10 #ifndef SYSTEMMAPINTERFACE_H
11 #define SYSTEMMAPINTERFACE_H
12
13 #include "openPASS-System/SystemItemInterface.h"
14 #include <QMap>
15 #include <QObject>
16
21 class SystemMapInterface : public QObject
22 {
23 Q_OBJECT
24
25 public:
26 using ID = SystemItemInterface::ID;
27 using Item = SystemItemInterface;
28
29 public:
30 using Map = QMap<ID, Item *>;
31 using Iterator = Map::Iterator;
32 using ConstIterator = Map::ConstIterator;
33
34 public:
35 explicit SystemMapInterface(QObject * const parent = nullptr)
36 : QObject(parent) {}
37 virtual ~SystemMapInterface() = default;
38
39 public:
40 //-----------------------------------------------------------------------------
45 //-----------------------------------------------------------------------------
46 virtual SystemMapInterface::Iterator begin() = 0;
47
48 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 virtual SystemMapInterface::ConstIterator begin() const = 0;
56
57 public:
58 //-----------------------------------------------------------------------------
63 //-----------------------------------------------------------------------------
64 virtual SystemMapInterface::Iterator end() = 0;
65
66 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 virtual SystemMapInterface::ConstIterator end() const = 0;
73
74 public:
75 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 virtual SystemMapInterface::ID getID(SystemMapInterface::Item * const item) const = 0;
83
84 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 virtual SystemMapInterface::Item * getItem(SystemMapInterface::ID const & id) const = 0;
91
92 public:
93 //-----------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------
100 virtual bool clear() = 0;
101 };
102
103 #endif // SYSTEMMAPINTERFACE_H
SystemMapInterface::Map
QMap< ID, Item * > Map
The container registering systems.
Definition: SystemMapInterface.h:30
SystemMapInterface::begin
virtual SystemMapInterface::Iterator begin()=0
Gets an iterator pointing at the first system related-object in the map.
SystemItemInterface::ID
unsigned int ID
The identifier of the system.
Definition: SystemItemInterface.h:31
SystemMapInterface::getItem
virtual SystemMapInterface::Item * getItem(SystemMapInterface::ID const &id) const =0
Gets the system related-object under the key identifier id.
SystemMapInterface::getID
virtual SystemMapInterface::ID getID(SystemMapInterface::Item *const item) const =0
Gets the key identifier of the system related-object item from the container (map).
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
SystemMapInterface
This class manages the registration and deregistration of object defining a system (system related-ob...
Definition: SystemMapInterface.h:21
SystemMapInterface::end
virtual SystemMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last system related-object.
SystemMapInterface::clear
virtual bool clear()=0
Clears the items constituing the system. (e.g. function called when users pressing on <New> button in...
SystemItemInterface.h
The System Item Interface (SII) contains the functions setters and getters of the items constituing a...
SystemMapInterface::ID
SystemItemInterface::ID ID
The identifier of a system.
Definition: SystemMapInterface.h:26
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Traffic Simulation Plugin

Files
Traffic Simulation Plugin

The Traffic Simulation Plugin provides a graphical user interface for configuring scenario-based simulations. More...

Files

file | EnvironmentDisplayPresenter.h
This class defines the presenter which controls the content to be displayed in the EnvironmentDisplayView widget.
file | EnvironmentDisplayView.h
This class provides a display for a quick overview of the environment configuration.
file | EnvironmentInterface.h
The EnvironmentInterface class provides setter and getter methods for the maps of environmental parameters, listed under <EnvironmentConfig> in the slaveConfig XML file.
file | EnvironmentItemInterface.h
The EnvironmentItemInterface class provides methods for reading and editing environment parameters.
file | EnvironmentItemModel.h
The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class.
file | EnvironmentMapPresenter.h
This class describes the presenter objects of the environment parameter maps.
file | EnvironmentModel.h
The Environment Model implements the functionality of the EnvironmentInterface class.
file | EnvironmentPresenter.h
This class defines the presenter object which handles user events coming from the view (EnvironmentView) and edits the model accordingly (EnvironmentInterface).
file | EnvironmentView.h
This class provides an editor for configuring the environment setup, i.e. it is filled with the content stored in an EnvironmentInterface instance.
file | ExperimentBaseView.h
This class provides a resizable container widget for the content of the experiment tab's scroll area.
file | ExperimentInterface.h
The Experiment Interface provides setter and getter methods for the XML elements listed under <ExperimentConfig> in the slaveConfig XML file.
file | ExperimentModel.h
The ExperimentModel class implements the functionality of the ExperimentInterface class.
file | ExperimentPresenter.h
This class defines the presenter object which handles user events coming from the view (ExperimentView) and edits the model accordingly (ExperimentInterface).
file | ExperimentView.h
This class provides an editor for configuring the experiment setup, i.e. it is filled with the content stored in an ExperimentInterface instance.
file | LibrariesPresenter.h
This class describes the presenter object of the map of included libraries.
file | LibrariesPresenter.h
This class describes the presenter object of the map of included libraries.
file | ScenarioAgentsPresenter.h
This class describes the presenter object of the scenario agents map.
file | ScenarioBaseView.h
This class provides a resizable container widget for the content of the scenario tab's scroll area.
file | ScenarioDisplayPresenter.h
This class defines the presenter which controls the content to be displayed in the ScenarioDisplayView widget.
file | ScenarioDisplayView.h
This class provides a display for a quick overview of the scenario configuration.
file | ScenarioInterface.h
The Scenario Interface provides setter and getter methods for the combination XML elements related to an Open Scenario File.
file | ScenarioModel.h
The Scenario Model class implements the functionality of the ScenarioItemInterface class.
file | ScenarioPresenter.h
This class defines the presenter object which handles user events coming from the view (ScenarioView) and edits the model accordingly (ScenarioInterface).
file | ScenarioView.h
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content stored in an ScenarioInterface instance.
file | StatusBarView.h
This class defines a status bar.
file | TrafficBaseView.h
This class provides a resizable container widget for the content of the traffic tab.
file | TrafficDisplayPresenter.h
This class defines the presenter which controls the content to be displayed in the TrafficDisplayView widget.
file | TrafficDisplayView.h
This class provides a display for a quick overview of the traffic configuration.
file | TrafficInterface.h
The Traffic Interface provides setter and getter methods for the combination XML subelements listed under the <TrafficConfig> element.
file | TrafficItemInterface.h
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the traffic configuration setup.
file | TrafficItemMapInterface.h
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be registered under a key identifier (ID). The traffic items are defined in the TrafficItemInterface class.
file | TrafficItemMapModel.h
The TrafficItemMapModel class implements functionality of the TrafficItemMapInterface class.
file | TrafficItemMapPresenter.h
This class describes the presenter objects of the traffic parameter maps.
file | TrafficItemModel.h
The TrafficItemModel class implements functionality of the TrafficItemInterface class.
file | TrafficItemView.h
This class defines a general view for a traffic item, which can be a volume, platoon rate, velocity, homogeneity or an agent profile.
file | TrafficLanesPresenter.h
This class defines the presenter object which handles events coming from the view (TrafficLanesView) and edits the model accordingly (TrafficInterface).
file | TrafficLanesView.h
This class defines the editor widget for assigning agent profiles to regular and rightmost lanes.
file | TrafficModel.h
The TrafficModel class implements the functionality of the TrafficInterface class.
file | TrafficParametersPresenter.h
This class defines the presenter object which handles events coming from the view (TrafficParametersView) and edits the model accordingly (TrafficInterface), i.e. more specifically the parameters therein.
file | TrafficParametersView.h
This class defines the editor widget for traffic parameters and their probabilities.
file | TrafficPresenter.h
This class defines the presenter object which handles user events coming from the view (TrafficView) and edits the model accordingly (TrafficInterface).
file | TrafficSimulationInterface.h
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
file | TrafficSimulationModel.h
The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class.
file | TrafficSimulationPresenter.h
This class defines the presenter object for the main view of the Traffic Simulation Plugin and instantiates all other presenters.
file | TrafficSimulationView.h
This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other configuration views as child widgets.
file | TrafficSimulationXMLBaseModel.h
This class defines the XML element names of the combination XML file.
file | TrafficSimulationXMLLoadModel.h
This class provides routines for loading the combination XML file and for storing all information in the corresponding instances of the model classes.
file | TrafficSimulationXMLLoadModel.h
This class provides routines for loading the combination XML file and for storing all information in the corresponding instances of the model classes.
file | TrafficView.h
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content stored in an TrafficInterface instance.

Detailed Description

The Traffic Simulation Plugin provides a graphical user interface for configuring scenario-based simulations.

Traffic Simulation Plugin

The Traffic Simulation Plugin provides a graphical user interface for configuring scenario-based simulations. For a complete configuration of a traffic simulation, the user needs to specify the experiment settings, the scenario configuration (based on an OpenSCENARIO file), the environment and the surrounding traffic. The outcome of the whole plugin is the slaveConfig XML file, whose structure defines the structure of the classes of this plugin.

The plugin is implemented using a model-presenter-view architectual pattern. The model classes define the basic objects for containing the values of the XML elements of the slaveConfig XML file. They also provide setter and getter methods for editing its content. In all cases, the model classes do not know about the presenters and views. The view classes define the appearence and and UI objects the user can interact with. In this implementation, the views are entirely passive, i.e. they contain no logic of the application and, especially, do not know about the model objects.

All user interfactions with the view lead to the emisson of signals which are noticed by the presenters. These presenter classes define the logic of the application, i.e. all signals emitted by views are connected to slots which edit the model using its setter and getter methods. Sometimes, models also send signals after they have been edited such that the views can be updated to display the new model values. This usually happens when the same model is presented to more than one view. All operations of the presenter on model data can be undone and redone. For this purpose, Qt's Undo Framework is applied, i.e. all commands are encapsulated into command objects whose classes re-implement the redo/undo methods of the base class QUndoCommand. These classes are usually declared in the same file which also contains the presenter class. The corresponding presenter object usually instantiates the command object and pushes it to the undo stack.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentDisplayPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
EnvironmentDisplayPresenter.h File Reference
Traffic Simulation Plugin

This class defines the presenter which controls the content to be displayed in the EnvironmentDisplayView widget. More...

Detailed Description

This class defines the presenter which controls the content to be displayed in the EnvironmentDisplayView widget.

Definition in file EnvironmentDisplayPresenter.h.

Go to the source code of this file.

Classes

class EnvironmentDisplayPresenter
This class defines the presenter which controls the content to be displayed in the EnvironmentDisplayView widget. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentDisplayPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
EnvironmentDisplayPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17
18 #ifndef ENVIRONMENTDISPLAYPRESENTER_H
19 #define ENVIRONMENTDISPLAYPRESENTER_H
20
21 #include "openPASS-TrafficSimulation/EnvironmentInterface.h"
22 //#include "Presenters/EnvironmentPresenter.h"
23 #include "Views/EnvironmentDisplayView.h"
24
25 #include <QObject>
26
27 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
31 class EnvironmentDisplayPresenter : public QObject
32 {
33 Q_OBJECT
34 public:
35 explicit EnvironmentDisplayPresenter(EnvironmentInterface * environment,
36 EnvironmentDisplayView * environmentDisplayView,
37 QObject *parent = nullptr);
38 ~EnvironmentDisplayPresenter() = default;
39
40 public Q_SLOTS:
41 //-----------------------------------------------------------------------------
44 //-----------------------------------------------------------------------------
45 void updateView();
46
47 private:
48 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
52 void setEnvironmentNameView();
53
54 //-----------------------------------------------------------------------------
57 //-----------------------------------------------------------------------------
58 void setTimeOfDayView();
59
60 //-----------------------------------------------------------------------------
63 //-----------------------------------------------------------------------------
64 void setVisibilityDistanceView();
65
66 //-----------------------------------------------------------------------------
69 //-----------------------------------------------------------------------------
70 void setFrictionView();
71
72 //-----------------------------------------------------------------------------
75 //-----------------------------------------------------------------------------
76 void setWeatherView();
77
78 //-----------------------------------------------------------------------------
85 //-----------------------------------------------------------------------------
86 bool checkProbabilities(QMap<EnvironmentInterface::ID, EnvironmentInterface::Item*> * const items);
87
88 public:
89 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 void setStatus();
98
99 private:
100 EnvironmentInterface * environment;
101 EnvironmentDisplayView * environmentDisplayView;
102 };
103
104 #endif // ENVIRONMENTDISPLAYPRESENTER_H
EnvironmentInterface.h
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
EnvironmentDisplayPresenter::updateView
void updateView()
Method which sets all displayed values according to the model data. Will be called after loading a co...
Definition: EnvironmentDisplayPresenter.cpp:63
EnvironmentDisplayView
This class provides a display for a quick overview of the environment configuration.
Definition: EnvironmentDisplayView.h:41
EnvironmentDisplayView.h
This class provides a display for a quick overview of the environment configuration.
EnvironmentDisplayPresenter::setVisibilityDistanceView
void setVisibilityDistanceView()
Slot which is called when the user edits the visibility distance map. Updates the displayed number of...
Definition: EnvironmentDisplayPresenter.cpp:42
EnvironmentDisplayPresenter::environmentDisplayView
EnvironmentDisplayView * environmentDisplayView
a pointer to the display view whose content is managed by this presenter
Definition: EnvironmentDisplayPresenter.h:101
EnvironmentDisplayPresenter::setStatus
void setStatus()
Method which determines the status of the environment settings. If all necessary configurations are m...
Definition: EnvironmentDisplayPresenter.cpp:75
EnvironmentDisplayPresenter::setEnvironmentNameView
void setEnvironmentNameView()
Slot which is called when the name of the environment configuration has changed in the model...
Definition: EnvironmentDisplayPresenter.cpp:28
EnvironmentDisplayPresenter::setWeatherView
void setWeatherView()
Slot which is called when the user edits the weather map. Updates the displayed number of map entries...
Definition: EnvironmentDisplayPresenter.cpp:56
EnvironmentDisplayPresenter::setFrictionView
void setFrictionView()
Slot which is called when the user edits the friction coefficient map. Updates the displayed number o...
Definition: EnvironmentDisplayPresenter.cpp:49
EnvironmentDisplayPresenter::environment
EnvironmentInterface * environment
a pointer to the environment model (interface) which is read by this presenter
Definition: EnvironmentDisplayPresenter.h:100
EnvironmentDisplayPresenter
This class defines the presenter which controls the content to be displayed in the EnvironmentDisplay...
Definition: EnvironmentDisplayPresenter.h:31
EnvironmentDisplayPresenter::setTimeOfDayView
void setTimeOfDayView()
Slot which is called when the user edits the time of day map. Updates the displayed number of map ent...
Definition: EnvironmentDisplayPresenter.cpp:35
EnvironmentDisplayPresenter::checkProbabilities
bool checkProbabilities(QMap< EnvironmentInterface::ID, EnvironmentInterface::Item *> *const items)
Method which checks whether the probabilities of the environment items registered in the given map su...
Definition: EnvironmentDisplayPresenter.cpp:104
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentDisplayView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
EnvironmentDisplayView.h File Reference
Traffic Simulation Plugin

This class provides a display for a quick overview of the environment configuration. More...

Detailed Description

This class provides a display for a quick overview of the environment configuration.

It contains an #ui object describing the views appearence (defined in EnvironmentDisplayView.ui). This ui object comprises a form layout with labels showing the configuration that has been edited by EnvironmentView. The frame of the view can be coloured in order to notify the user whether the configuration is complete or not.

Definition in file EnvironmentDisplayView.h.

Go to the source code of this file.

Classes

class EnvironmentDisplayView
This class provides a display for a quick overview of the environment configuration. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentDisplayView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
EnvironmentDisplayView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
21 #ifndef ENVIRONMENTDISPLAYVIEW_H
22 #define ENVIRONMENTDISPLAYVIEW_H
23
24 #include "WidgetView.h"
25
26 #include <QString>
27 #include <QMap>
28
29 namespace Ui {
30 class EnvironmentDisplayView;
31 }
32
33 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
41 class EnvironmentDisplayView : public WidgetView
42 {
43 Q_OBJECT
44
45 public:
46 enum class StatusType {
47 Error = 0,
48 OK = 1,
49 Warning = 2
50 };
51
52 public:
53 explicit EnvironmentDisplayView(QWidget *parent = 0);
54 ~EnvironmentDisplayView();
55
56 public:
57 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 void setEnvironmentName(QString name);
63
64 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 void setTimeOfDay(int number);
70
71
72 //-----------------------------------------------------------------------------
76 //-----------------------------------------------------------------------------
77 void setVisibilityDistance(int number);
78
79 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 void setFriction(int number);
85
86 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 void setWeather(int number);
92
93 //-----------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------
100 void setStatus(StatusType status, QString message);
101
102 private:
103 QMap<StatusType, QString> color;
104 Ui::EnvironmentDisplayView *ui;
105 };
106
107 #endif // ENVIRONMENTDISPLAYVIEW_H
EnvironmentDisplayView::color
QMap< StatusType, QString > color
a color map which determines the color code according to the status type
Definition: EnvironmentDisplayView.h:103
EnvironmentDisplayView::setVisibilityDistance
void setVisibilityDistance(int number)
Method for setting the displayed number of visibility distance map entries.
Definition: EnvironmentDisplayView.cpp:50
EnvironmentDisplayView::setStatus
void setStatus(StatusType status, QString message)
Method which determines the frame color according to the status type passed as a first argument...
Definition: EnvironmentDisplayView.cpp:65
EnvironmentDisplayView::StatusType
StatusType
Definition: EnvironmentDisplayView.h:46
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
EnvironmentDisplayView
This class provides a display for a quick overview of the environment configuration.
Definition: EnvironmentDisplayView.h:41
EnvironmentDisplayView::ui
Ui::EnvironmentDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: EnvironmentDisplayView.h:104
EnvironmentDisplayView::setFriction
void setFriction(int number)
Method for setting the displayed number of friction map entries.
Definition: EnvironmentDisplayView.cpp:55
EnvironmentDisplayView::setEnvironmentName
void setEnvironmentName(QString name)
Method for setting the name which should be displayed for the environment.
Definition: EnvironmentDisplayView.cpp:40
EnvironmentDisplayView::StatusType::Error
enum class for classifying the status (will be used to determine the color of the frame) ...
EnvironmentDisplayView::setWeather
void setWeather(int number)
Method for setting the displayed number of weather map entries.
Definition: EnvironmentDisplayView.cpp:60
EnvironmentDisplayView::setTimeOfDay
void setTimeOfDay(int number)
Method for setting the displayed number of time of day map entries.
Definition: EnvironmentDisplayView.cpp:45
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
Classes
EnvironmentInterface.h File Reference
Traffic Simulation Plugin

The EnvironmentInterface class provides setter and getter methods for the maps of environmental parameters, listed under <EnvironmentConfig> in the slaveConfig XML file. More...

Detailed Description

The EnvironmentInterface class provides setter and getter methods for the maps of environmental parameters, listed under <EnvironmentConfig> in the slaveConfig XML file.

These comprise the time of day, visibility distance, friction coefficient and the wheather. Different parameters of the same kind can be listed in the slaveConfig giving a probability to be selected in a simulation run. Environmental parameters are instances of the EnvironmentItemInterface class. The container class for storing environmental parameters is Qt't QMap class.

Definition in file EnvironmentInterface.h.

Go to the source code of this file.

Classes

class EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental parameters, listed under <EnvironmentConfig> in the slaveConfig XML file. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
EnvironmentInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
24
25 #ifndef ENVIRONMENTINTERFACE_H
26 #define ENVIRONMENTINTERFACE_H
27
28 #include "openPASS-TrafficSimulation/EnvironmentItemInterface.h"
29
30 #include <QObject>
31 #include <QString>
32 #include <QTime>
33 #include <QMap>
34
35 //-----------------------------------------------------------------------------
45 //-----------------------------------------------------------------------------
46 class EnvironmentInterface : public QObject
47 {
48 Q_OBJECT
49
50 public:
51 using Name = QString;
52
53 public:
54 using ID = unsigned int;
55 using Item = EnvironmentItemInterface;
56
57 using TimeOfDayMap = QMap<ID, Item *>;
58 using VisibilityDistanceMap = QMap<ID, Item *>;
59 using FrictionMap = QMap<ID, Item *>;
60 using WeatherMap = QMap<ID, Item *>;
61 using Status = bool;
62
63 public:
64 explicit EnvironmentInterface(QObject *parent = nullptr)
65 : QObject(parent) {}
66 virtual ~EnvironmentInterface() = default;
67
68 Q_SIGNALS:
69 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 void modifiedName();
75
76 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
81 void edited();
82
83 //-----------------------------------------------------------------------------
85 //-----------------------------------------------------------------------------
86 void modifiedStatus();
87
88 public:
89 //-----------------------------------------------------------------------------
94 //-----------------------------------------------------------------------------
95 virtual void setName(Name const & _name) = 0;
96
97 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
102 virtual Name getName() const = 0;
103
104 public:
105 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
110 virtual TimeOfDayMap * getTimeOfDayMap() const = 0;
111
112 //-----------------------------------------------------------------------------
116 //-----------------------------------------------------------------------------
117 virtual VisibilityDistanceMap * getVisibilityDistanceMap() const =0;
118
119 //-----------------------------------------------------------------------------
123 //-----------------------------------------------------------------------------
124 virtual FrictionMap * getFrictionMap() const =0;
125
126 //-----------------------------------------------------------------------------
130 //-----------------------------------------------------------------------------
131 virtual WeatherMap * getWeatherMap() const = 0;
132
133 public:
134 //-----------------------------------------------------------------------------
139 //-----------------------------------------------------------------------------
140 virtual void setStatus(Status const &_status) = 0;
141
142 //-----------------------------------------------------------------------------
146 //-----------------------------------------------------------------------------
147 virtual Status getStatus() const = 0;
148
149 public:
150 //-----------------------------------------------------------------------------
158 //-----------------------------------------------------------------------------
159 virtual Item * createItem(Item::Value const & value,
160 Item::Probability const & probability) = 0;
161
162 //-----------------------------------------------------------------------------
166 //-----------------------------------------------------------------------------
167 virtual void reset() = 0;
168 };
169
170 #endif // ENVIRONMENTINTERFACE_H
EnvironmentItemInterface.h
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
EnvironmentInterface::ID
unsigned int ID
A key identifier for the map of environment items.
Definition: EnvironmentInterface.h:54
EnvironmentInterface::TimeOfDayMap
QMap< ID, Item * > TimeOfDayMap
The container class for storing time of day parameters.
Definition: EnvironmentInterface.h:57
EnvironmentInterface::Status
bool Status
Type characterizing the status of the environment settings.
Definition: EnvironmentInterface.h:61
EnvironmentItemInterface::Probability
double Probability
the selection probability&#39;s datatype.
Definition: EnvironmentItemInterface.h:44
EnvironmentInterface::VisibilityDistanceMap
QMap< ID, Item * > VisibilityDistanceMap
The container class for storing visitbility distances.
Definition: EnvironmentInterface.h:58
EnvironmentInterface::Item
EnvironmentItemInterface Item
The class describing one environmental parameter.
Definition: EnvironmentInterface.h:55
EnvironmentInterface::getFrictionMap
virtual FrictionMap * getFrictionMap() const =0
Returns a pointer to the map of friction coefficients.
EnvironmentInterface::modifiedStatus
void modifiedStatus()
Signal, emitted when the environment&#39;s status has changed.
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentInterface::Name
QString Name
The name of the environment configuration.
Definition: EnvironmentInterface.h:51
EnvironmentInterface::getVisibilityDistanceMap
virtual VisibilityDistanceMap * getVisibilityDistanceMap() const =0
Returns a pointer to the map of visibility distances.
EnvironmentInterface::createItem
virtual Item * createItem(Item::Value const &value, Item::Probability const &probability)=0
Creates an environmental parameter (i.e. an instance of EnvironmentItemInterface) with the given valu...
EnvironmentInterface::modifiedName
void modifiedName()
Signal, emitted when the name of the environment setting has been changed using the setName method...
EnvironmentInterface::setStatus
virtual void setStatus(Status const &_status)=0
Method for setting the status of the environment configuration to the value passed as an argument...
EnvironmentInterface::getStatus
virtual Status getStatus() const =0
Method which returns the current status of the environment settings.
EnvironmentInterface::getWeatherMap
virtual WeatherMap * getWeatherMap() const =0
Returns a pointer to the map of whether parameters.
EnvironmentInterface::getTimeOfDayMap
virtual TimeOfDayMap * getTimeOfDayMap() const =0
Returns a pointer to the time of day parameter map.
EnvironmentInterface::FrictionMap
QMap< ID, Item * > FrictionMap
The container class for storing friction coefficients.
Definition: EnvironmentInterface.h:59
EnvironmentInterface::reset
virtual void reset()=0
Method which clears all maps and deletes the correponding environmental parameters. Further sets the name to an empty string and emits the edited signal to inform the EnvironmentDisplayPresenter instance about the changes.
EnvironmentInterface::setName
virtual void setName(Name const &_name)=0
Sets the name of the environment configuration to the one passed as an argument.
EnvironmentInterface::edited
void edited()
Signal, emitted when the environment settings have changed (e.g. specific parameters). Will be noticed by the EnvironmentDisplayPresenter to update the displayed info on the environment setting.
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
EnvironmentItemInterface::Value
QString Value
a general string datatype for the environment parameter&#39;s value.
Definition: EnvironmentItemInterface.h:43
EnvironmentInterface::getName
virtual Name getName() const =0
Returns the current name of the environment configuration.
EnvironmentInterface::WeatherMap
QMap< ID, Item * > WeatherMap
The container class for storing wheather parameters.
Definition: EnvironmentInterface.h:60
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
Classes
EnvironmentItemInterface.h File Reference
Traffic Simulation Plugin

The EnvironmentItemInterface class provides methods for reading and editing environment parameters. More...

Detailed Description

The EnvironmentItemInterface class provides methods for reading and editing environment parameters.

An environment parameter is generally described by a value and a selection probability. The latter defines the probability to be selected as an environment parameter in a simulation run. Environment parameters are stored in the slaveConfig XML file under the <EnvironmentConfig> element.

Definition in file EnvironmentItemInterface.h.

Go to the source code of this file.

Classes

class EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
EnvironmentItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
22 #ifndef ENVIRONMENTITEMINTERFACE_H
23 #define ENVIRONMENTITEMINTERFACE_H
24
25 #include <QObject>
26 #include <QString>
27
28 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
37 class EnvironmentItemInterface : public QObject
38 {
39
40 Q_OBJECT
41
42 public:
43 using Value = QString;
44 using Probability = double;
45
46 public:
47 explicit EnvironmentItemInterface(QObject *parent = nullptr)
48 : QObject(parent) {}
49
50 virtual ~EnvironmentItemInterface() = default;
51
52 Q_SIGNALS:
53 //-----------------------------------------------------------------------------
56 //-----------------------------------------------------------------------------
57 void edited();
58
59 public:
60 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
66 virtual void setValue(const Value & _value) = 0;
67
68 //-----------------------------------------------------------------------------
72 //-----------------------------------------------------------------------------
73 virtual Value getValue() const = 0;
74
75 public:
76 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 virtual void setProbability(const Probability & _probability) = 0;
83
84 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 virtual Probability getProbability() const = 0;
92
93 };
94
95
96 #endif // ENVIRONMENTITEMINTERFACE_H
EnvironmentItemInterface::setProbability
virtual void setProbability(const Probability &_probability)=0
Method which sets the selection probability of the environment parameter to the one passed as an argu...
EnvironmentItemInterface::Probability
double Probability
the selection probability&#39;s datatype.
Definition: EnvironmentItemInterface.h:44
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentItemInterface::edited
void edited()
Signal, which is emitted when the environment parameter&#39;s attributes have been modified. Will be forwarded by the EnvironmentInterface instance.
EnvironmentItemInterface::getProbability
virtual Probability getProbability() const =0
Method which returns the current selection probability of the environment parameter.
EnvironmentItemInterface::getValue
virtual Value getValue() const =0
Method which returns the current value of the environment parameter.
EnvironmentItemInterface::setValue
virtual void setValue(const Value &_value)=0
Method which sets the value of the environment parameter to the one passed as an argument.
EnvironmentItemInterface::Value
QString Value
a general string datatype for the environment parameter&#39;s value.
Definition: EnvironmentItemInterface.h:43
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentItemModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
Classes
EnvironmentItemModel.h File Reference
Traffic Simulation Plugin

The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class. More...

Detailed Description

The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class.

Definition in file EnvironmentItemModel.h.

Go to the source code of this file.

Classes

class EnvironmentItemModel
The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentItemModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
EnvironmentItemModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17
18 #ifndef ENVIRONMENTITEMMODEL_H
19 #define ENVIRONMENTITEMMODEL_H
20
21 #include "openPASS-TrafficSimulation/EnvironmentItemInterface.h"
22
23 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
27 class EnvironmentItemModel : public EnvironmentItemInterface
28 {
29
30 Q_OBJECT
31
32 public:
33 explicit EnvironmentItemModel(Value value,
34 Probability probability,
35 QObject *parent = nullptr);
36
37 ~EnvironmentItemModel() = default;
38
39 public:
40 virtual void setValue(const Value & _value) override;
41 virtual Value getValue() const override;
42
43 public:
44 virtual void setProbability(const Probability & _probability) override;
45 virtual Probability getProbability() const override;
46
47 private:
48 Probability probability;
49 Value value;
50
51 };
52
53 #endif // ENVIRONMENTITEMMODEL_H
EnvironmentItemInterface.h
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
EnvironmentItemModel::getProbability
virtual Probability getProbability() const override
Method which returns the current selection probability of the environment parameter.
Definition: EnvironmentItemModel.cpp:43
EnvironmentItemModel
The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class...
Definition: EnvironmentItemModel.h:27
EnvironmentItemModel::value
Value value
the current value
Definition: EnvironmentItemModel.h:49
EnvironmentItemInterface::Probability
double Probability
the selection probability&#39;s datatype.
Definition: EnvironmentItemInterface.h:44
EnvironmentItemModel::setValue
virtual void setValue(const Value &_value) override
Method which sets the value of the environment parameter to the one passed as an argument.
Definition: EnvironmentItemModel.cpp:23
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentItemModel::getValue
virtual Value getValue() const override
Method which returns the current value of the environment parameter.
Definition: EnvironmentItemModel.cpp:30
EnvironmentItemModel::probability
Probability probability
the current selection probability
Definition: EnvironmentItemModel.h:48
EnvironmentItemInterface::Value
QString Value
a general string datatype for the environment parameter&#39;s value.
Definition: EnvironmentItemInterface.h:43
EnvironmentItemModel::setProbability
virtual void setProbability(const Probability &_probability) override
Method which sets the selection probability of the environment parameter to the one passed as an argu...
Definition: EnvironmentItemModel.cpp:36
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentMapPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
EnvironmentMapPresenter.h File Reference
Traffic Simulation Plugin

This class describes the presenter objects of the environment parameter maps. More...

Detailed Description

This class describes the presenter objects of the environment parameter maps.

In the spirit of Qt's Model/View framework it constitutes the wrapper class connecting the model data (environment maps defined in EnvironmentInterface) with the interface defined in QAbstractTableModel. This interface can be then utilized by instances Qt's QTableView to display the map entries in a table format.

See https://doc.qt.io/qt-5/model-view-programming.html for Qt's model/view framework.

Definition in file EnvironmentMapPresenter.h.

Go to the source code of this file.

Classes

class EnvironmentMapPresenter
This class describes the presenter objects of the environment parameter maps. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentMapPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
EnvironmentMapPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
26
27 #ifndef ENVIRONMENTMAPPRESENTER_H
28 #define ENVIRONMENTMAPPRESENTER_H
29
30 #include "openPASS-TrafficSimulation/EnvironmentInterface.h"
31
32 #include <QMap>
33 #include <QAbstractTableModel>
34 #include <QUndoStack>
35
36 //-----------------------------------------------------------------------------
48 //-----------------------------------------------------------------------------
49 class EnvironmentMapPresenter : public QAbstractTableModel
50 {
51 Q_OBJECT
52
53 public:
54 using ID = EnvironmentInterface::ID;
55 using Item = EnvironmentInterface::Item;
56
57 public:
58 EnvironmentMapPresenter(EnvironmentInterface * const environment,
59 QMap<ID, Item *> *environmentMap,
60 QUndoStack * const undoStack,
61 QObject *parent = nullptr);
62 virtual ~EnvironmentMapPresenter() = default;
63
64
65 public:
66 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
76
77 //-----------------------------------------------------------------------------
85 //-----------------------------------------------------------------------------
86 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
87
88 //-----------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------
100 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
101
102 public:
103 //-----------------------------------------------------------------------------
111 //-----------------------------------------------------------------------------
112 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
113
114 //-----------------------------------------------------------------------------
123 //-----------------------------------------------------------------------------
124 virtual bool setData(const QModelIndex &index, const QVariant &value,
125 int role = Qt::EditRole) override;
126
127
128 //-----------------------------------------------------------------------------
135 //-----------------------------------------------------------------------------
136 virtual Qt::ItemFlags flags(const QModelIndex& index) const override;
137
138
139 public:
140 //-----------------------------------------------------------------------------
144 //-----------------------------------------------------------------------------
145 void addRow(const int &row, QString value, double probability);
146
147 //-----------------------------------------------------------------------------
155 //-----------------------------------------------------------------------------
156 bool removeRow(const int &row);
157
158 //-----------------------------------------------------------------------------
161 //-----------------------------------------------------------------------------
162 void update();
163
164 private:
165 EnvironmentInterface * const environment;
166 QMap<ID, Item*> * const environmentMap;
167 QUndoStack * const undoStack;
168
169 private:
170 QMap<int, ID> RowToID;
171 QStringList _columnHeaders;
172 };
173
174 #endif // ENVIRONMENTMAPPRESENTER_H
EnvironmentMapPresenter::environment
EnvironmentInterface *const environment
an instance of the environment model
Definition: EnvironmentMapPresenter.h:165
EnvironmentMapPresenter::_columnHeaders
QStringList _columnHeaders
the column header&#39;s info
Definition: EnvironmentMapPresenter.h:171
EnvironmentMapPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: EnvironmentMapPresenter.cpp:53
EnvironmentMapPresenter::removeRow
bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: EnvironmentMapPresenter.cpp:128
EnvironmentInterface::ID
unsigned int ID
A key identifier for the map of environment items.
Definition: EnvironmentInterface.h:54
EnvironmentInterface.h
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
EnvironmentMapPresenter::update
void update()
Method which updates the table according to the current entries of environmentMap.
Definition: EnvironmentMapPresenter.cpp:150
EnvironmentMapPresenter
This class describes the presenter objects of the environment parameter maps.
Definition: EnvironmentMapPresenter.h:49
EnvironmentMapPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: EnvironmentMapPresenter.cpp:26
EnvironmentMapPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: EnvironmentMapPresenter.h:167
EnvironmentMapPresenter::environmentMap
QMap< ID, Item * > *const environmentMap
an instance of the map listing the environment parameter (instances of EnvironmentItemInterface) ...
Definition: EnvironmentMapPresenter.h:166
EnvironmentInterface::Item
EnvironmentItemInterface Item
The class describing one environmental parameter.
Definition: EnvironmentInterface.h:55
EnvironmentMapPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: EnvironmentMapPresenter.cpp:40
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentMapPresenter::RowToID
QMap< int, ID > RowToID
a map translating row indices to IDs of environment parameters
Definition: EnvironmentMapPresenter.h:170
EnvironmentMapPresenter::addRow
void addRow(const int &row, QString value, double probability)
Method that adds a new row, i.e. a new environment item to the edited component.
Definition: EnvironmentMapPresenter.cpp:108
EnvironmentMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: EnvironmentMapPresenter.cpp:33
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
EnvironmentMapPresenter::setData
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: EnvironmentMapPresenter.cpp:76
EnvironmentMapPresenter::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! ...
Definition: EnvironmentMapPresenter.cpp:103
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
Classes
EnvironmentModel.h File Reference
Traffic Simulation Plugin

The Environment Model implements the functionality of the EnvironmentInterface class. More...

Detailed Description

The Environment Model implements the functionality of the EnvironmentInterface class.

Definition in file EnvironmentModel.h.

Go to the source code of this file.

Classes

class EnvironmentModel
The Environment Model implements the functionality of the EnvironmentInterface class. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
EnvironmentModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17
18 #ifndef ENVIRONMENTMODEL_H
19 #define ENVIRONMENTMODEL_H
20
21 #include "openPASS-TrafficSimulation/EnvironmentInterface.h"
22
23 #include "Models/EnvironmentItemModel.h"
24
25 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
29 class EnvironmentModel : public EnvironmentInterface
30 {
31
32 Q_OBJECT
33
34 public:
35 EnvironmentModel(QObject *parent = nullptr);
36 virtual ~EnvironmentModel() override;
37
38 public:
39 virtual void setName(Name const & _name) override;
40 virtual Name getName() const override;
41
42 public:
43 virtual TimeOfDayMap * getTimeOfDayMap() const override;
44 virtual VisibilityDistanceMap * getVisibilityDistanceMap() const override;
45 virtual FrictionMap * getFrictionMap() const override;
46 virtual WeatherMap * getWeatherMap() const override;
47
48 public:
49 virtual void setStatus(Status const &_status) override;
50 virtual Status getStatus() const override;
51
52 public:
53 virtual Item * createItem(Item::Value const & value, Item::Probability const & probability) override;
54 virtual void reset() override;
55
56 private:
57 Name name;
58 TimeOfDayMap * const timeOfDayMap;
59 VisibilityDistanceMap * const visibilityDistanceMap;
60 FrictionMap * const frictionMap;
61 WeatherMap * const weatherMap;
62 Status status;
63
64 };
65
66 #endif // ENVIRONMENTMODEL_H
EnvironmentModel::getTimeOfDayMap
virtual TimeOfDayMap * getTimeOfDayMap() const override
Returns a pointer to the time of day parameter map.
Definition: EnvironmentModel.cpp:45
EnvironmentInterface.h
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
EnvironmentInterface::TimeOfDayMap
QMap< ID, Item * > TimeOfDayMap
The container class for storing time of day parameters.
Definition: EnvironmentInterface.h:57
EnvironmentModel::frictionMap
FrictionMap *const frictionMap
the pointer to the map of friction coefficients
Definition: EnvironmentModel.h:60
EnvironmentInterface::Status
bool Status
Type characterizing the status of the environment settings.
Definition: EnvironmentInterface.h:61
EnvironmentModel::getVisibilityDistanceMap
virtual VisibilityDistanceMap * getVisibilityDistanceMap() const override
Returns a pointer to the map of visibility distances.
Definition: EnvironmentModel.cpp:50
EnvironmentModel::reset
virtual void reset() override
Method which clears all maps and deletes the correponding environmental parameters. Further sets the name to an empty string and emits the edited signal to inform the EnvironmentDisplayPresenter instance about the changes.
Definition: EnvironmentModel.cpp:74
EnvironmentModel::createItem
virtual Item * createItem(Item::Value const &value, Item::Probability const &probability) override
Creates an environmental parameter (i.e. an instance of EnvironmentItemInterface) with the given valu...
Definition: EnvironmentModel.cpp:65
EnvironmentItemInterface::Probability
double Probability
the selection probability&#39;s datatype.
Definition: EnvironmentItemInterface.h:44
EnvironmentInterface::VisibilityDistanceMap
QMap< ID, Item * > VisibilityDistanceMap
The container class for storing visitbility distances.
Definition: EnvironmentInterface.h:58
EnvironmentModel::timeOfDayMap
TimeOfDayMap *const timeOfDayMap
the pointer to the map of time of day parameters
Definition: EnvironmentModel.h:58
EnvironmentModel::setStatus
virtual void setStatus(Status const &_status) override
Method for setting the status of the environment configuration to the value passed as an argument...
Definition: EnvironmentModel.cpp:94
EnvironmentModel
The Environment Model implements the functionality of the EnvironmentInterface class.
Definition: EnvironmentModel.h:29
EnvironmentModel::getStatus
virtual Status getStatus() const override
Method which returns the current status of the environment settings.
Definition: EnvironmentModel.cpp:100
EnvironmentItemModel.h
The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class...
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentModel::weatherMap
WeatherMap *const weatherMap
the pointer to the map of wheather parameters
Definition: EnvironmentModel.h:61
EnvironmentInterface::Name
QString Name
The name of the environment configuration.
Definition: EnvironmentInterface.h:51
EnvironmentModel::getWeatherMap
virtual WeatherMap * getWeatherMap() const override
Returns a pointer to the map of whether parameters.
Definition: EnvironmentModel.cpp:60
EnvironmentModel::getFrictionMap
virtual FrictionMap * getFrictionMap() const override
Returns a pointer to the map of friction coefficients.
Definition: EnvironmentModel.cpp:55
EnvironmentInterface::FrictionMap
QMap< ID, Item * > FrictionMap
The container class for storing friction coefficients.
Definition: EnvironmentInterface.h:59
EnvironmentModel::name
Name name
the name of the environment configuration
Definition: EnvironmentModel.h:57
EnvironmentModel::getName
virtual Name getName() const override
Returns the current name of the environment configuration.
Definition: EnvironmentModel.cpp:25
EnvironmentModel::setName
virtual void setName(Name const &_name) override
Sets the name of the environment configuration to the one passed as an argument.
Definition: EnvironmentModel.cpp:30
EnvironmentModel::visibilityDistanceMap
VisibilityDistanceMap *const visibilityDistanceMap
the pointer to the visibility distance map
Definition: EnvironmentModel.h:59
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
EnvironmentItemInterface::Value
QString Value
a general string datatype for the environment parameter&#39;s value.
Definition: EnvironmentItemInterface.h:43
EnvironmentInterface::WeatherMap
QMap< ID, Item * > WeatherMap
The container class for storing wheather parameters.
Definition: EnvironmentInterface.h:60
EnvironmentModel::status
Status status
the current status of the settings. "true" means that the configuration is principally ready for simu...
Definition: EnvironmentModel.h:62
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
EnvironmentPresenter.h File Reference
Traffic Simulation Plugin

This class defines the presenter object which handles user events coming from the view (EnvironmentView) and edits the model accordingly (EnvironmentInterface). More...

Detailed Description

This class defines the presenter object which handles user events coming from the view (EnvironmentView) and edits the model accordingly (EnvironmentInterface).

Definition in file EnvironmentPresenter.h.

Go to the source code of this file.

Classes

class | AddEnvironmentItem
Command class for adding rows to the table of environment settings. More...
class | EditEnvironmentName
Command class editing the environment's name. More...
class | EnvironmentPresenter
This class defines the presenter object which handles user events coming from the view (EnvironmentView) and edits the model accordingly (EnvironmentInterface). More...
class | RemoveEnvironmentItem
Command class for removing rows from the table of environment settings. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
EnvironmentPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
17 //-----------------------------------------------------------------------------
18 #ifndef ENVIRONMENTPRESENTER_H
19 #define ENVIRONMENTPRESENTER_H
20
21 #include "openPASS-TrafficSimulation/EnvironmentInterface.h"
22 #include "Views/EnvironmentView.h"
23 #include "Presenters/EnvironmentMapPresenter.h"
24
25 #include <QObject>
26 #include <QUndoStack>
27
28 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
33 class EnvironmentPresenter : public QObject
34 {
35 Q_OBJECT
36
37 public:
38 explicit EnvironmentPresenter(EnvironmentInterface * const environment,
39 EnvironmentView * const environmentView,
40 QUndoStack * const undoStack,
41 QObject *parent = nullptr);
42
43 ~EnvironmentPresenter() = default;
44
45 private Q_SLOTS:
46 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
52 void setName(QString const & name);
53
54 private Q_SLOTS:
55 //-----------------------------------------------------------------------------
59 //-----------------------------------------------------------------------------
60 void addTimeOfDay();
61
62 //-----------------------------------------------------------------------------
69 //-----------------------------------------------------------------------------
70 void removeTimeOfDay(const int &row);
71
72 private Q_SLOTS:
73 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 void addVisibilityDistance();
79
80 //-----------------------------------------------------------------------------
87 //-----------------------------------------------------------------------------
88 void removeVisibilityDistance(const int &row);
89
90 private Q_SLOTS:
91 //-----------------------------------------------------------------------------
95 //-----------------------------------------------------------------------------
96 void addFriction();
97
98 //-----------------------------------------------------------------------------
105 //-----------------------------------------------------------------------------
106 void removeFriction(const int &row);
107
108 private Q_SLOTS:
109 //-----------------------------------------------------------------------------
113 //-----------------------------------------------------------------------------
114 void addWeather();
115
116 //-----------------------------------------------------------------------------
123 //-----------------------------------------------------------------------------
124 void removeWeather(const int &row);
125
126 private Q_SLOTS:
127 //-----------------------------------------------------------------------------
131 //-----------------------------------------------------------------------------
132 void checkProbabilities();
133
134 private:
135 //-----------------------------------------------------------------------------
140 //-----------------------------------------------------------------------------
141 void SetupTimeOfDay();
142
143 //-----------------------------------------------------------------------------
148 //-----------------------------------------------------------------------------
149 void SetupVisibilityDistance();
150
151 //-----------------------------------------------------------------------------
156 //-----------------------------------------------------------------------------
157 void SetupFriction();
158
159 //-----------------------------------------------------------------------------
164 //-----------------------------------------------------------------------------
165 void SetupWeather();
166
167 public:
168 //-----------------------------------------------------------------------------
171 //-----------------------------------------------------------------------------
172 void updateView();
173
174 private:
175 EnvironmentInterface * const environment;
176 EnvironmentView * const environmentView;
177 QUndoStack * const undoStack;
178
179 private:
180 EnvironmentMapPresenter * const timeOfDayPresenter;
181 EnvironmentMapPresenter * const visibilityDistancePresenter;
182 EnvironmentMapPresenter * const frictionPresenter;
183 EnvironmentMapPresenter * const weatherPresenter;
184
185 private:
186 static double const default_probability;
187 static QString const default_timeOfDay;
188 static QString const default_visibilityDistance;
189 static QString const default_friction;
190 static QString const default_weather;
191 static QStringList const weatherList;
192 };
193
194
195 //-----------------------------------------------------------------------------
197 //-----------------------------------------------------------------------------
198 class AddEnvironmentItem : public QUndoCommand
199 {
200
201 public:
202 AddEnvironmentItem(EnvironmentMapPresenter * const table,
203 QString const default_value,
204 const double default_probability,
205 QString tableName = "",
206 QUndoCommand * parent = nullptr);
207
208 public:
209 void redo() override;
210 void undo() override;
211
212 private:
213 EnvironmentMapPresenter * const table;
214 QString const default_value;
215 double const default_probability;
216
217 };
218
219 //-----------------------------------------------------------------------------
221 //-----------------------------------------------------------------------------
222 class RemoveEnvironmentItem : public QUndoCommand
223 {
224
225 public:
226 RemoveEnvironmentItem(EnvironmentMapPresenter * const table,
227 int const row,
228 QString tableName="",
229 QUndoCommand * parent = nullptr);
230
231 public:
232 void redo() override;
233 void undo() override;
234
235 private:
236 EnvironmentMapPresenter * const table;
237 int const row;
238 EnvironmentItemInterface::Value const value;
239 EnvironmentItemInterface::Probability const probability;
240 };
241
242 //-----------------------------------------------------------------------------
244 //-----------------------------------------------------------------------------
245 class EditEnvironmentName : public QUndoCommand
246 {
247
248 public:
249 EditEnvironmentName(EnvironmentInterface * const environment,
250 EnvironmentView * const environmentView,
251 EnvironmentInterface::Name const &newName,
252 QUndoCommand * parent = nullptr);
253
254 public:
255 void redo() override;
256 void undo() override;
257
258 private:
259 EnvironmentInterface * const environment;
260 EnvironmentView * const environmentView;
261 EnvironmentInterface::Name const newName;
262 EnvironmentInterface::Name const oldName;
263 };
264
265
266 #endif // ENVIRONMENTPRESENTER_H
EnvironmentPresenter::addFriction
void addFriction()
Slot which is connected to the EnvironmentView::addFriction signal. Calls the EnvironmentMapPresenter...
Definition: EnvironmentPresenter.cpp:189
EnvironmentPresenter::weatherList
static QStringList const weatherList
a list of availbale weather parameters (the user can choose from this list)
Definition: EnvironmentPresenter.h:191
AddEnvironmentItem
Command class for adding rows to the table of environment settings.
Definition: EnvironmentPresenter.h:198
EnvironmentPresenter::default_weather
static QString const default_weather
a default weather parameter
Definition: EnvironmentPresenter.h:190
EnvironmentPresenter::addTimeOfDay
void addTimeOfDay()
Slot which is connected to the EnvironmentView::addTimeOfDay signal. Calls the EnvironmentMapPresente...
Definition: EnvironmentPresenter.cpp:166
EnvironmentPresenter::removeWeather
void removeWeather(const int &row)
Slot which is connected to the EnvironmentView::removeWeather signal. Calls the EnvironmentMapPresent...
Definition: EnvironmentPresenter.cpp:206
EnvironmentPresenter::environment
EnvironmentInterface *const environment
a pointer to the model of the environment configuration
Definition: EnvironmentPresenter.h:175
EnvironmentInterface.h
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
EnvironmentPresenter::SetupWeather
void SetupWeather()
An initializer method which configures the table view of weather parameters. Creates the table&#39;s pres...
Definition: EnvironmentPresenter.cpp:151
EditEnvironmentName
Command class editing the environment&#39;s name.
Definition: EnvironmentPresenter.h:245
EnvironmentPresenter::weatherPresenter
EnvironmentMapPresenter *const weatherPresenter
a pointer to the presenter object connecting the weather map to its table view
Definition: EnvironmentPresenter.h:183
EnvironmentPresenter::timeOfDayPresenter
EnvironmentMapPresenter *const timeOfDayPresenter
a pointer to the presenter object connecting the time of day map to its table view ...
Definition: EnvironmentPresenter.h:180
EnvironmentView.h
This class provides an editor for configuring the environment setup, i.e. it is filled with the conte...
EnvironmentMapPresenter
This class describes the presenter objects of the environment parameter maps.
Definition: EnvironmentMapPresenter.h:49
EnvironmentItemInterface::Probability
double Probability
the selection probability&#39;s datatype.
Definition: EnvironmentItemInterface.h:44
EnvironmentPresenter::removeTimeOfDay
void removeTimeOfDay(const int &row)
Slot which is connected to the EnvironmentView::removeTimeOfDay signal. Calls the EnvironmentMapPrese...
Definition: EnvironmentPresenter.cpp:171
EnvironmentPresenter::SetupTimeOfDay
void SetupTimeOfDay()
An initializer method which configures the table view of the time of day parameters. Creates the table&#39;s presenter object (EnvironmentMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.
Definition: EnvironmentPresenter.cpp:108
EnvironmentPresenter::removeVisibilityDistance
void removeVisibilityDistance(const int &row)
Slot which is connected to the EnvironmentView::removeVisibilityDistance signal. Calls the Environmen...
Definition: EnvironmentPresenter.cpp:183
EnvironmentPresenter::default_probability
static double const default_probability
a default selection probability
Definition: EnvironmentPresenter.h:186
EnvironmentPresenter::default_visibilityDistance
static QString const default_visibilityDistance
a default visbility distance
Definition: EnvironmentPresenter.h:188
EnvironmentPresenter::removeFriction
void removeFriction(const int &row)
Slot which is connected to the EnvironmentView::removeFriction signal. Calls the EnvironmentMapPresen...
Definition: EnvironmentPresenter.cpp:194
EnvironmentMapPresenter.h
This class describes the presenter objects of the environment parameter maps.
EnvironmentPresenter::setName
void setName(QString const &name)
Slot which is connected to the EnvironmentView::modifiedName signal. Sets the model&#39;s value of the en...
Definition: EnvironmentPresenter.cpp:102
EnvironmentView
This class provides an editor for configuring the environment setup, i.e. it is filled with the conte...
Definition: EnvironmentView.h:43
EnvironmentInterface::Name
QString Name
The name of the environment configuration.
Definition: EnvironmentInterface.h:51
EnvironmentPresenter::SetupFriction
void SetupFriction()
An initializer method which configures the table view of friction coefficients. Creates the table&#39;s p...
Definition: EnvironmentPresenter.cpp:136
EnvironmentPresenter::default_friction
static QString const default_friction
a default friction coefficient
Definition: EnvironmentPresenter.h:189
RemoveEnvironmentItem
Command class for removing rows from the table of environment settings.
Definition: EnvironmentPresenter.h:222
EnvironmentPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undoStack
Definition: EnvironmentPresenter.h:177
EnvironmentPresenter::checkProbabilities
void checkProbabilities()
Slot which checks the probability sums of all environment parameters. If for a particular parameter m...
Definition: EnvironmentPresenter.cpp:71
EnvironmentPresenter::updateView
void updateView()
Method which updates the view (EnvironmentView) to the current state of the model (EnvironmentModel /...
Definition: EnvironmentPresenter.cpp:212
EnvironmentPresenter::visibilityDistancePresenter
EnvironmentMapPresenter *const visibilityDistancePresenter
a pointer to the presenter object connecting the visibility distance map to its table view ...
Definition: EnvironmentPresenter.h:181
EnvironmentPresenter::frictionPresenter
EnvironmentMapPresenter *const frictionPresenter
a pointer to the presenter object connecting the frition map to its table view
Definition: EnvironmentPresenter.h:182
EnvironmentPresenter::environmentView
EnvironmentView *const environmentView
a pointer to the view of the environment configuration
Definition: EnvironmentPresenter.h:176
EnvironmentPresenter::SetupVisibilityDistance
void SetupVisibilityDistance()
An initializer method which configures the table view of visibility distances Creates the table&#39;s pre...
Definition: EnvironmentPresenter.cpp:122
EnvironmentPresenter::default_timeOfDay
static QString const default_timeOfDay
a default time of day parameter
Definition: EnvironmentPresenter.h:187
EnvironmentPresenter
This class defines the presenter object which handles user events coming from the view (EnvironmentVi...
Definition: EnvironmentPresenter.h:33
EnvironmentPresenter::addWeather
void addWeather()
Slot which is connected to the EnvironmentView::addWeather signal. Calls the EnvironmentMapPresenter:...
Definition: EnvironmentPresenter.cpp:201
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
EnvironmentPresenter::addVisibilityDistance
void addVisibilityDistance()
Slot which is connected to the EnvironmentView::addVisibilityDistance signal. Calls the EnvironmentMa...
Definition: EnvironmentPresenter.cpp:178
EnvironmentItemInterface::Value
QString Value
a general string datatype for the environment parameter&#39;s value.
Definition: EnvironmentItemInterface.h:43
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
EnvironmentView.h File Reference
Traffic Simulation Plugin

This class provides an editor for configuring the environment setup, i.e. it is filled with the content stored in an EnvironmentInterface instance. More...

Detailed Description

This class provides an editor for configuring the environment setup, i.e. it is filled with the content stored in an EnvironmentInterface instance.

It contains an #ui object describing the views appearance (defined in EnvironmentView.ui) and GUI elements. Particularly, it comprises table views (see Qt's QTableView class) for editing and displaying the maps of environment parameters. User action will lead to signal emissions which are noticed and managed by the corresponding presenter class, i.e. EnvironmentPresenter.

Definition in file EnvironmentView.h.

Go to the source code of this file.

Classes

class EnvironmentView
This class provides an editor for configuring the environment setup, i.e. it is filled with the content stored in an EnvironmentInterface instance. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
EnvironmentView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
23 #ifndef ENVIRONMENTVIEW_H
24 #define ENVIRONMENTVIEW_H
25
26 #include <QWidget>
27 #include <QTableView>
28
29 namespace Ui {
30 class EnvironmentView;
31 }
32
33 //-----------------------------------------------------------------------------
42 //-----------------------------------------------------------------------------
43 class EnvironmentView : public QWidget
44 {
45 Q_OBJECT
46
47 public:
48 explicit EnvironmentView(QWidget *parent = nullptr);
49 ~EnvironmentView();
50
51 Q_SIGNALS:
52 //-----------------------------------------------------------------------------
57 //-----------------------------------------------------------------------------
58 void modifiedName(const QString & name);
59
60 //-----------------------------------------------------------------------------
62 //-----------------------------------------------------------------------------
63 void addTimeOfDay();
64
65 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 void removeTimeOfDay(const int &row);
73
74 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 void addVisibilityDistance();
79
80 //-----------------------------------------------------------------------------
87 //-----------------------------------------------------------------------------
88 void removeVisibilityDistance(const int &row);
89
90 //-----------------------------------------------------------------------------
93 //-----------------------------------------------------------------------------
94 void addFriction();
95
96 //-----------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
104 void removeFriction(const int &row);
105
106 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
110 void addWeather();
111
112 //-----------------------------------------------------------------------------
119 //-----------------------------------------------------------------------------
120 void removeWeather(const int &row);
121
122 public:
123 //-----------------------------------------------------------------------------
127 //-----------------------------------------------------------------------------
128 QTableView * getTimeOfDayView() const;
129
130 //-----------------------------------------------------------------------------
134 //-----------------------------------------------------------------------------
135 QTableView * getVisibilityDistanceView() const;
136
137 //-----------------------------------------------------------------------------
141 //-----------------------------------------------------------------------------
142 QTableView * getFrictionView() const;
143
144 //-----------------------------------------------------------------------------
148 //-----------------------------------------------------------------------------
149 QTableView * getWeatherView() const;
150
151 private Q_SLOTS:
152 //-----------------------------------------------------------------------------
155 //-----------------------------------------------------------------------------
156 void on_add_TimeOfDay_clicked();
157
158 //-----------------------------------------------------------------------------
161 //-----------------------------------------------------------------------------
162 void on_remove_TimeOfDay_clicked();
163
164 private Q_SLOTS:
165 //-----------------------------------------------------------------------------
168 //-----------------------------------------------------------------------------
169 void on_add_VisibilityDistance_clicked();
170
171 //-----------------------------------------------------------------------------
174 //-----------------------------------------------------------------------------
175 void on_remove_VisibilityDistance_clicked();
176
177 private Q_SLOTS:
178 //-----------------------------------------------------------------------------
181 //-----------------------------------------------------------------------------
182 void on_add_Friction_clicked();
183
184 //-----------------------------------------------------------------------------
187 //-----------------------------------------------------------------------------
188 void on_remove_Friction_clicked();
189
190 private Q_SLOTS:
191 //-----------------------------------------------------------------------------
194 //-----------------------------------------------------------------------------
195 void on_add_Weather_clicked();
196
197 //-----------------------------------------------------------------------------
200 //-----------------------------------------------------------------------------
201 void on_remove_Weather_clicked();
202
203 private Q_SLOTS:
204 //-----------------------------------------------------------------------------
207 //-----------------------------------------------------------------------------
208 void on_Name_editingFinished();
209
210 public:
211 //-----------------------------------------------------------------------------
215 //-----------------------------------------------------------------------------
216 void setName(QString const &name);
217
218 public:
219 //-----------------------------------------------------------------------------
225 //-----------------------------------------------------------------------------
226 void setTimeOfDay_ProbabilityError(bool error);
227
228 //-----------------------------------------------------------------------------
234 //-----------------------------------------------------------------------------
235 void setVisibilityDistance_ProbabilityError(bool error);
236
237 //-----------------------------------------------------------------------------
243 //-----------------------------------------------------------------------------
244 void setFriction_ProbabilityError(bool error);
245
246 //-----------------------------------------------------------------------------
252 //-----------------------------------------------------------------------------
253 void setWeather_ProbabilityError(bool error);
254
255 private:
256 //-----------------------------------------------------------------------------
267 //-----------------------------------------------------------------------------
268 bool eventFilter(QObject *watched, QEvent *event);
269
270 private:
271 Ui::EnvironmentView *ui;
272 };
273
274 #endif // ENVIRONMENTVIEW_H
EnvironmentView::removeVisibilityDistance
void removeVisibilityDistance(const int &row)
Signal, emitted when the user clicks the remove-button of the table of visibility distances...
EnvironmentView::on_add_Friction_clicked
void on_add_Friction_clicked()
Qt Designer-created slot which emits the addFriction signal when the user clicks the add_Friction but...
Definition: EnvironmentView.cpp:60
EnvironmentView::addWeather
void addWeather()
Signal, emitted when the user clicks the add-button of the table of weather parameters.
EnvironmentView::on_remove_Weather_clicked
void on_remove_Weather_clicked()
Qt Designer-created slot which emits the removeWeather signal when the user clicks the remove_Weather...
Definition: EnvironmentView.cpp:75
EnvironmentView::addVisibilityDistance
void addVisibilityDistance()
Signal, emitted when the user clicks the add-button of the table of visibility distances.
EnvironmentView::on_add_Weather_clicked
void on_add_Weather_clicked()
Qt Designer-created slot which emits the addWeather signal when the user clicks the add_Weather butto...
Definition: EnvironmentView.cpp:70
EnvironmentView::getFrictionView
QTableView * getFrictionView() const
Method which provides access to the table of friction coefficients.
Definition: EnvironmentView.cpp:91
EnvironmentView::on_add_VisibilityDistance_clicked
void on_add_VisibilityDistance_clicked()
Qt Designer-created slot which emits the addVisibilityDistance signal when the user clicks the add_Vi...
Definition: EnvironmentView.cpp:50
EnvironmentView::on_remove_Friction_clicked
void on_remove_Friction_clicked()
Qt Designer-created slot which emits the removeFriction signal when the user clicks the remove_Fricti...
Definition: EnvironmentView.cpp:65
Ui
Definition: EnvironmentDisplayView.h:29
EnvironmentView::removeWeather
void removeWeather(const int &row)
Signal, emitted when the user clicks the remove-button of the table of friction coefficients. Transmits the row index of the table cell being currently active.
EnvironmentView::ui
Ui::EnvironmentView * ui
the ui object which contains the GUI elements
Definition: EnvironmentView.h:271
EnvironmentView::removeFriction
void removeFriction(const int &row)
Signal, emitted when the user clicks the remove-button of the table of friction coefficients. Transmits the row index of the table cell being currently active.
EnvironmentView::setTimeOfDay_ProbabilityError
void setTimeOfDay_ProbabilityError(bool error)
Method which displays a probability error message for the table of time of day parameters if the bool...
Definition: EnvironmentView.cpp:124
EnvironmentView::getWeatherView
QTableView * getWeatherView() const
Method which provides access to the table of weather parameters.
Definition: EnvironmentView.cpp:86
EnvironmentView::setVisibilityDistance_ProbabilityError
void setVisibilityDistance_ProbabilityError(bool error)
Method which displays a probability error message for the table of visibility distances if the boolia...
Definition: EnvironmentView.cpp:132
EnvironmentView::on_remove_VisibilityDistance_clicked
void on_remove_VisibilityDistance_clicked()
Qt Designer-created slot which emits the removeVisibilityDistance signal when the user clicks the rem...
Definition: EnvironmentView.cpp:55
EnvironmentView::getVisibilityDistanceView
QTableView * getVisibilityDistanceView() const
Method which provides access to the table of visibility distances.
Definition: EnvironmentView.cpp:96
EnvironmentView::on_Name_editingFinished
void on_Name_editingFinished()
Qt Designer-created slot which emits the modifiedName signal when finishes editing the line edit for ...
Definition: EnvironmentView.cpp:101
EnvironmentView
This class provides an editor for configuring the environment setup, i.e. it is filled with the conte...
Definition: EnvironmentView.h:43
EnvironmentView::modifiedName
void modifiedName(const QString &name)
Signal, emitted when the user edits the name of the environment configuration. Transmits the new name...
EnvironmentView::removeTimeOfDay
void removeTimeOfDay(const int &row)
Signal, emitted when the user clicks the remove-button of the time of day table. Transmits the row in...
EnvironmentView::setName
void setName(QString const &name)
Method which sets the current text of the environment name&#39;s line edit.
Definition: EnvironmentView.cpp:106
EnvironmentView::on_remove_TimeOfDay_clicked
void on_remove_TimeOfDay_clicked()
Qt Designer-created slot which emits the removeTimeOfDay signal when the user clicks the remove_TimeO...
Definition: EnvironmentView.cpp:45
EnvironmentView::setWeather_ProbabilityError
void setWeather_ProbabilityError(bool error)
Method which displays a probability error message for the table of weather parameters if the boolian ...
Definition: EnvironmentView.cpp:148
EnvironmentView::addTimeOfDay
void addTimeOfDay()
Signal, emitted when the user clicks the add-button of the time of day table.
EnvironmentView::setFriction_ProbabilityError
void setFriction_ProbabilityError(bool error)
Method which displays a probability error message for the table of friction coefficients if the booli...
Definition: EnvironmentView.cpp:140
EnvironmentView::on_add_TimeOfDay_clicked
void on_add_TimeOfDay_clicked()
Qt Designer-created slot which emits the addTimeOfDay signal when the user clicks the add_TimeOfDay b...
Definition: EnvironmentView.cpp:40
EnvironmentView::getTimeOfDayView
QTableView * getTimeOfDayView() const
Method which provides access to the table of time of day parameters.
Definition: EnvironmentView.cpp:81
EnvironmentView::addFriction
void addFriction()
Signal, emitted when the user clicks the add-button of the table of friction coefficients.
EnvironmentView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter. This filter catches the resize events of the table views in ord...
Definition: EnvironmentView.cpp:111
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentBaseView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
ExperimentBaseView.h File Reference
Traffic Simulation Plugin

This class provides a resizable container widget for the content of the experiment tab's scroll area. More...

Detailed Description

This class provides a resizable container widget for the content of the experiment tab's scroll area.

The items inserted into this widget are the instances of ExperimentView, ScenarioDisplayView, EnvironmentDisplayView and TrafficDisplayView. Further, the paint event is reimplemented such that the display views are connected via lines to the experiment configuration widget. This will visualize the dependency of a working traffic simulation configuration to the traffic, scenario and environment configurations.

Definition in file ExperimentBaseView.h.

Go to the source code of this file.

Classes

class ExperimentBaseView
This class provides a resizable container widget for the content of the experiment tab. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentBaseView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
ExperimentBaseView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
24 #ifndef EXPERIMENTBASEVIEW_H
25 #define EXPERIMENTBASEVIEW_H
26
27 #include "Views/ExperimentView.h"
28 #include "Views/ScenarioDisplayView.h"
29 #include "Views/TrafficDisplayView.h"
30 #include "Views/EnvironmentDisplayView.h"
31
32 #include "WidgetView.h"
33
34 //-----------------------------------------------------------------------------
45 //-----------------------------------------------------------------------------
46 class ExperimentBaseView : public WidgetView
47 {
48
49 Q_OBJECT
50
51 public:
52 ExperimentBaseView(QWidget *parent = 0);
53 ~ExperimentBaseView() = default;
54
55 public:
56 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 ExperimentView * getExperimentView() const;
62
63 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 EnvironmentDisplayView * getEnvironmentDisplayView() const;
69
70 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 ScenarioDisplayView * getScenarioDisplayView() const;
76
77 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 TrafficDisplayView * getTrafficDisplayView() const;
83
84
85 public Q_SLOTS:
86 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 void updateSize();
92
93 public:
94 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
102 void adjustWidgets(QWidget *mainWindow);
103
104 protected:
105 //-----------------------------------------------------------------------------
111 //-----------------------------------------------------------------------------
112 void paintEvent(QPaintEvent * event) override;
113
114 public:
115 ExperimentView * experimentView;
116 ScenarioDisplayView * scenarioDisplayView;
117 TrafficDisplayView * trafficDisplayView;
118 EnvironmentDisplayView * environmentDisplayView;
119 };
120
121 #endif // EXPERIMENTBASEVIEW_H
ExperimentView.h
This class provides an editor for configuring the experiment setup, i.e. it is filled with the conten...
ExperimentBaseView::getExperimentView
ExperimentView * getExperimentView() const
Method which returns the experiment configuration editor widget.
Definition: ExperimentBaseView.cpp:30
ExperimentView
This class provides an editor for configuring the experiment setup, i.e. it is filled with the conten...
Definition: ExperimentView.h:47
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
EnvironmentDisplayView
This class provides a display for a quick overview of the environment configuration.
Definition: EnvironmentDisplayView.h:41
ExperimentBaseView::adjustWidgets
void adjustWidgets(QWidget *mainWindow)
Method which adjusts the positioning and size of the child widgets. The size of the child widgets is ...
Definition: ExperimentBaseView.cpp:60
ExperimentBaseView::getTrafficDisplayView
TrafficDisplayView * getTrafficDisplayView() const
Method which returns the widget displaying infos on the traffic configuration.
Definition: ExperimentBaseView.cpp:45
EnvironmentDisplayView.h
This class provides a display for a quick overview of the environment configuration.
ExperimentBaseView::getEnvironmentDisplayView
EnvironmentDisplayView * getEnvironmentDisplayView() const
Method which returns the widget displaying infos on the environment configuration.
Definition: ExperimentBaseView.cpp:40
ExperimentBaseView::trafficDisplayView
TrafficDisplayView * trafficDisplayView
A pointer to the display widget showing the traffic configuration.
Definition: ExperimentBaseView.h:117
TrafficDisplayView.h
This class provides a display for a quick overview of the traffic configuration.
ExperimentBaseView::getScenarioDisplayView
ScenarioDisplayView * getScenarioDisplayView() const
Method which returns the widget displaying infos on the scenario configuration.
Definition: ExperimentBaseView.cpp:35
ExperimentBaseView::scenarioDisplayView
ScenarioDisplayView * scenarioDisplayView
A pointer to the display widget showing the scenario configuration.
Definition: ExperimentBaseView.h:116
TrafficDisplayView
This class provides a display for a quick overview of the traffic configuration.
Definition: TrafficDisplayView.h:42
ExperimentBaseView::experimentView
ExperimentView * experimentView
A pointer to the experiment configuration widget.
Definition: ExperimentBaseView.h:115
ScenarioDisplayView.h
This class provides a display for a quick overview of the scenario configuration. ...
ExperimentBaseView::updateSize
void updateSize()
Slot which updates the size of this base view such that all child widgets (ExperimentView, ScenarioDisplayView, TrafficDisplayView and EnvironmentDisplayView) are visible.
Definition: ExperimentBaseView.cpp:50
ScenarioDisplayView
This class provides a display for a quick overview of the scenario configuration. ...
Definition: ScenarioDisplayView.h:40
ExperimentBaseView
This class provides a resizable container widget for the content of the experiment tab...
Definition: ExperimentBaseView.h:46
ExperimentBaseView::paintEvent
void paintEvent(QPaintEvent *event) override
Reimplementation of the paint event. Here, the painting of the connection lines between the experimen...
Definition: ExperimentBaseView.cpp:85
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
Classes
ExperimentInterface.h File Reference
Traffic Simulation Plugin

The Experiment Interface provides setter and getter methods for the XML elements listed under <ExperimentConfig> in the slaveConfig XML file. More...

Detailed Description

The Experiment Interface provides setter and getter methods for the XML elements listed under <ExperimentConfig> in the slaveConfig XML file.

These comprise the number of invocations, the random seed, the libraries required by the simulation slave and the logging groups. See the documentation of the simulation framework for the precise definition of these settings.

Definition in file ExperimentInterface.h.

Go to the source code of this file.

Classes

class ExperimentInterface
The Experiment Interface provides setter and getter methods for the XML elements listed under <ExperimentConfig> in the slaveConfig XML file. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
ExperimentInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
22
23 #ifndef EXPERIMENTINTERFACE_H
24 #define EXPERIMENTINTERFACE_H
25
26 #include <QObject>
27 #include <QMap>
28 #include <QStringList>
29
30 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
39 class ExperimentInterface : public QObject
40 {
41 Q_OBJECT
42
43 public:
44 using ID = unsigned int;
45 using NumberInvocations = int;
46 using Seed = int;
47 using Libraries = QMap <QString , QString>;
48 using LoggingGroups = QStringList;
49
50 public:
51 explicit ExperimentInterface(QObject *parent = nullptr)
52 : QObject(parent) {}
53 virtual ~ExperimentInterface()=default;
54
55 public:
56 //-----------------------------------------------------------------------------
62 //-----------------------------------------------------------------------------
63 virtual ID getID() const = 0;
64
65 public:
66 //-----------------------------------------------------------------------------
70 //-----------------------------------------------------------------------------
71 virtual void setNumberInvocations(NumberInvocations const & _numberInvocations) = 0;
72
73 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 virtual NumberInvocations getNumberInvocations() const = 0;
79
80
81 public:
82 //-----------------------------------------------------------------------------
86 //-----------------------------------------------------------------------------
87 virtual void setSeed(Seed const & _seed) = 0;
88
89 //-----------------------------------------------------------------------------
93 //-----------------------------------------------------------------------------
94 virtual Seed getSeed() const = 0;
95
96 public:
97 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
102 virtual Libraries * getLibraries() const = 0;
103
104 //-----------------------------------------------------------------------------
108 //-----------------------------------------------------------------------------
109 virtual LoggingGroups * getLoggingGroups() const = 0;
110
111 };
112
113
114 #endif // EXPERIMENTINTERFACE_H
ExperimentInterface::getLoggingGroups
virtual LoggingGroups * getLoggingGroups() const =0
Returns the pointer to the list of Logging Groups.
ExperimentInterface::Libraries
QMap< QString, QString > Libraries
The map of libraries needed by the simulation slave.
Definition: ExperimentInterface.h:47
ExperimentInterface::getLibraries
virtual Libraries * getLibraries() const =0
Returns the pointer to the Libraries map.
ExperimentInterface::NumberInvocations
int NumberInvocations
The number of invocations.
Definition: ExperimentInterface.h:45
ExperimentInterface::LoggingGroups
QStringList LoggingGroups
The list of logging groups.
Definition: ExperimentInterface.h:48
ExperimentInterface::getNumberInvocations
virtual NumberInvocations getNumberInvocations() const =0
Returns the current number of invocations.
ExperimentInterface::ID
unsigned int ID
The experiment&#39;s ID (not used so far)
Definition: ExperimentInterface.h:44
ExperimentInterface::getSeed
virtual Seed getSeed() const =0
Returns the current random number seed.
ExperimentInterface::Seed
int Seed
The random seed used for random number generation.
Definition: ExperimentInterface.h:46
ExperimentInterface::setNumberInvocations
virtual void setNumberInvocations(NumberInvocations const &_numberInvocations)=0
Sets the number of invocations of the experiment.
ExperimentInterface::setSeed
virtual void setSeed(Seed const &_seed)=0
Sets the seed used for random number generation.
ExperimentInterface
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
Definition: ExperimentInterface.h:39
ExperimentInterface::getID
virtual ID getID() const =0
Returns the ID of the experiment.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
Classes
ExperimentModel.h File Reference
Traffic Simulation Plugin

The ExperimentModel class implements the functionality of the ExperimentInterface class. More...

Detailed Description

The ExperimentModel class implements the functionality of the ExperimentInterface class.

Definition in file ExperimentModel.h.

Go to the source code of this file.

Classes

class ExperimentModel
The ExperimentModel class implements the functionality of the ExperimentInterface class. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
ExperimentModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17
18 #ifndef EXPERIMENTMODEL_H
19 #define EXPERIMENTMODEL_H
20
21 #include "openPASS-TrafficSimulation/ExperimentInterface.h"
22
23 #include <QObject>
24
25 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
29 class ExperimentModel : public ExperimentInterface
30 {
31 Q_OBJECT
32
33
34 public:
35 explicit ExperimentModel(QObject *parent = nullptr);
36 virtual ~ExperimentModel() override = default;
37
38 public:
39 virtual ID getID() const override;
40
41 public:
42 virtual void setNumberInvocations(NumberInvocations const & _numberInvocations) override;
43 virtual NumberInvocations getNumberInvocations() const override;
44
45
46 public:
47 virtual void setSeed(Seed const & _seed) override;
48 virtual Seed getSeed() const override;
49
50 public:
51 virtual Libraries * getLibraries() const override;
52 virtual LoggingGroups * getLoggingGroups() const override;
53
54 private:
55 ID id;
56 NumberInvocations numberInvocations;
57 Seed seed;
58 Libraries * const libraries;
59 LoggingGroups * const loggingGroups;
60
61 public:
62 static ID const id_default;
63 static NumberInvocations const numberInvocations_default;
64 static Seed const seed_default;
65
66 };
67
68 #endif // EXPERIMENTMODEL_H
ExperimentModel::setSeed
virtual void setSeed(Seed const &_seed) override
Sets the seed used for random number generation.
Definition: ExperimentModel.cpp:42
ExperimentInterface::Libraries
QMap< QString, QString > Libraries
The map of libraries needed by the simulation slave.
Definition: ExperimentInterface.h:47
ExperimentModel::setNumberInvocations
virtual void setNumberInvocations(NumberInvocations const &_numberInvocations) override
Sets the number of invocations of the experiment.
Definition: ExperimentModel.cpp:32
ExperimentModel::id
ID id
The ID of the experiment.
Definition: ExperimentModel.h:55
ExperimentModel::libraries
Libraries *const libraries
The pointer to the experiment&#39;s map of libraries.
Definition: ExperimentModel.h:58
ExperimentInterface::NumberInvocations
int NumberInvocations
The number of invocations.
Definition: ExperimentInterface.h:45
ExperimentInterface::LoggingGroups
QStringList LoggingGroups
The list of logging groups.
Definition: ExperimentInterface.h:48
ExperimentModel
The ExperimentModel class implements the functionality of the ExperimentInterface class...
Definition: ExperimentModel.h:29
ExperimentModel::getLibraries
virtual Libraries * getLibraries() const override
Returns the pointer to the Libraries map.
Definition: ExperimentModel.cpp:52
ExperimentInterface::ID
unsigned int ID
The experiment&#39;s ID (not used so far)
Definition: ExperimentInterface.h:44
ExperimentModel::numberInvocations_default
static NumberInvocations const numberInvocations_default
The default number of invocations.
Definition: ExperimentModel.h:63
ExperimentModel::getID
virtual ID getID() const override
Returns the ID of the experiment.
Definition: ExperimentModel.cpp:27
ExperimentModel::numberInvocations
NumberInvocations numberInvocations
The number of invocations of this experiment.
Definition: ExperimentModel.h:56
ExperimentModel::seed
Seed seed
The random seed.
Definition: ExperimentModel.h:57
ExperimentInterface::Seed
int Seed
The random seed used for random number generation.
Definition: ExperimentInterface.h:46
ExperimentModel::getSeed
virtual Seed getSeed() const override
Returns the current random number seed.
Definition: ExperimentModel.cpp:47
ExperimentInterface.h
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
ExperimentModel::getLoggingGroups
virtual LoggingGroups * getLoggingGroups() const override
Returns the pointer to the list of Logging Groups.
Definition: ExperimentModel.cpp:57
ExperimentModel::loggingGroups
LoggingGroups *const loggingGroups
The pointer to the experiment&#39;s list of logging groups.
Definition: ExperimentModel.h:59
ExperimentModel::seed_default
static Seed const seed_default
The default random seed.
Definition: ExperimentModel.h:64
ExperimentInterface
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
Definition: ExperimentInterface.h:39
ExperimentModel::getNumberInvocations
virtual NumberInvocations getNumberInvocations() const override
Returns the current number of invocations.
Definition: ExperimentModel.cpp:37
ExperimentModel::id_default
static ID const id_default
The default ID.
Definition: ExperimentModel.h:62
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
ExperimentPresenter.h File Reference
Traffic Simulation Plugin

This class defines the presenter object which handles user events coming from the view (ExperimentView) and edits the model accordingly (ExperimentInterface). More...

Detailed Description

This class defines the presenter object which handles user events coming from the view (ExperimentView) and edits the model accordingly (ExperimentInterface).

Definition in file ExperimentPresenter.h.

Go to the source code of this file.

Classes

class | AddLibrary
Command class for adding libraries to the libraries table. More...
class | AddLoggingGroup
Command class for adding logging groups to the logging groups list. More...
class | EditNumberInvocations
Command class editing the number of invocations. More...
class | EditRandomSeed
Command class editing the number of invocations. More...
class | ExperimentPresenter
This class defines the presenter object which handles user events coming from the view (ExperimentView) and edits the model accordingly (ExperimentInterface). More...
class | RemoveLibrary
Command class for removing libraries from the libraries table. More...
class | RemoveLoggingGroup
Command class for removing logging groups from the logging groups list. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
ExperimentPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17 #ifndef EXPERIMENTPRESENTER_H
18 #define EXPERIMENTPRESENTER_H
19
20 #include "openPASS-TrafficSimulation/ExperimentInterface.h"
21 #include "openPASS-Project/ProjectInterface.h"
22
23 #include "Presenters/LoggingGroupsPresenter.h"
24 #include "Presenters/LibrariesPresenter.h"
25
26 #include "Views/ExperimentView.h"
27
28 #include <QObject>
29 #include <QUndoStack>
30
31 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
35 class ExperimentPresenter : public QObject
36 {
37
38 Q_OBJECT
39
40 public:
41 explicit ExperimentPresenter(ExperimentInterface * const experiment,
42 ExperimentView * const experimentView,
43 ProjectInterface * const project,
44 QUndoStack * const undoStack,
45 QObject *parent = nullptr);
46
47 virtual ~ExperimentPresenter() = default;
48
49 Q_SIGNALS:
50 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 void startSimulation();
56
57 private Q_SLOTS:
58 //-----------------------------------------------------------------------------
64 //-----------------------------------------------------------------------------
65 void setNumberInvocations(ExperimentInterface::NumberInvocations _numberInvocations);
66
67 //-----------------------------------------------------------------------------
72 //-----------------------------------------------------------------------------
73 void setSeed(ExperimentInterface::Seed _seed);
74
75 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 void addLoggingGroup();
79
80 //-----------------------------------------------------------------------------
85 //-----------------------------------------------------------------------------
86 void removeLoggingGroup(int const &row);
87
88 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 void addLibrary();
92
93 //-----------------------------------------------------------------------------
98 //-----------------------------------------------------------------------------
99 void removeLibrary(int const &row);
100
101 private:
102 //-----------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------
108 void setupLibraries();
109
110 //-----------------------------------------------------------------------------
115 //-----------------------------------------------------------------------------
116 void setupLoggingGroups();
117
118 public:
119 //-----------------------------------------------------------------------------
123 //-----------------------------------------------------------------------------
124 void updateView();
125
126 private:
127 ExperimentInterface * const experiment;
128 ExperimentView * const experimentView;
129 ProjectInterface * const project;
130 QUndoStack * const undoStack;
131
132 private:
133 LibrariesPresenter * const librariesPresenter;
134 static QStringList libraryTypesList;
135
136 private:
137 LoggingGroupsPresenter * const loggingGroupsPresenter;
138 static QStringList loggingGroupsList;
139 };
140
141 //-----------------------------------------------------------------------------
143 //-----------------------------------------------------------------------------
144 class AddLibrary : public QUndoCommand
145 {
146 public:
147 AddLibrary(LibrariesPresenter * const table,
148 QString const &libType,
149 QUndoCommand *parent = nullptr);
150
151 public:
152 void redo() override;
153 void undo() override;
154
155 private:
156 LibrariesPresenter * const table;
157 QString const libType;
158 };
159
160 //-----------------------------------------------------------------------------
162 //-----------------------------------------------------------------------------
163 class RemoveLibrary : public QUndoCommand
164 {
165
166 public:
167 RemoveLibrary(LibrariesPresenter * const table,
168 int const &row,
169 QUndoCommand *parent = nullptr);
170
171 public:
172 void redo() override;
173 void undo() override;
174
175 private:
176 LibrariesPresenter * const table;
177 int const row;
178 QString const libType;
179 QString const lib;
180 };
181
182 //-----------------------------------------------------------------------------
184 //-----------------------------------------------------------------------------
185 class AddLoggingGroup : public QUndoCommand
186 {
187
188 public:
189 AddLoggingGroup(LoggingGroupsPresenter * const list,
190 QString const & name,
191 QUndoCommand *parent = nullptr);
192
193 public:
194 void redo() override;
195 void undo() override;
196
197 private:
198 LoggingGroupsPresenter * const list;
199 QString const name;
200 };
201
202 //-----------------------------------------------------------------------------
204 //-----------------------------------------------------------------------------
205 class RemoveLoggingGroup : public QUndoCommand
206 {
207
208 public:
209 RemoveLoggingGroup(LoggingGroupsPresenter * const list,
210 int const & row,
211 QUndoCommand *parent = nullptr);
212
213 public:
214 void redo() override;
215 void undo() override;
216
217 private:
218 LoggingGroupsPresenter * const list;
219 int const row;
220 QString const name;
221 };
222
223 //-----------------------------------------------------------------------------
225 //-----------------------------------------------------------------------------
226 class EditNumberInvocations : public QUndoCommand
227 {
228
229 public:
230 EditNumberInvocations(ExperimentInterface * const experiment,
231 ExperimentView * const experimentView,
232 ExperimentInterface::NumberInvocations const &newValue,
233 QUndoCommand *parent = nullptr);
234
235 public:
236 void redo() override;
237 void undo() override;
238
239 private:
240 ExperimentInterface * const experiment;
241 ExperimentView * const experimentView;
242 ExperimentInterface::NumberInvocations const newValue;
243 ExperimentInterface::NumberInvocations const oldValue;
244 };
245
246 //-----------------------------------------------------------------------------
248 //-----------------------------------------------------------------------------
249 class EditRandomSeed : public QUndoCommand
250 {
251
252 public:
253 EditRandomSeed(ExperimentInterface * const experiment,
254 ExperimentView * const experimentView,
255 ExperimentInterface::Seed const &newValue,
256 QUndoCommand *parent = nullptr);
257
258 public:
259 void redo() override;
260 void undo() override;
261
262 private:
263 ExperimentInterface * const experiment;
264 ExperimentView * const experimentView;
265 ExperimentInterface::Seed const newValue;
266 ExperimentInterface::Seed const oldValue;
267 };
268
269
270 #endif // EXPERIMENTPRESENTER_H
ExperimentView.h
This class provides an editor for configuring the experiment setup, i.e. it is filled with the conten...
EditNumberInvocations
Command class editing the number of invocations.
Definition: ExperimentPresenter.h:226
ExperimentPresenter::setNumberInvocations
void setNumberInvocations(ExperimentInterface::NumberInvocations _numberInvocations)
Slot which is connected to the ExperimentView::Invocations_valueChanged signal. It will set the model...
Definition: ExperimentPresenter.cpp:121
LoggingGroupsPresenter
This class describes the presenter object of the list of logging groups.
Definition: LoggingGroupsPresenter.h:47
ExperimentPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: ExperimentPresenter.h:130
AddLoggingGroup
Command class for adding logging groups to the logging groups list.
Definition: ExperimentPresenter.h:185
ExperimentView
This class provides an editor for configuring the experiment setup, i.e. it is filled with the conten...
Definition: ExperimentView.h:47
ExperimentInterface::NumberInvocations
int NumberInvocations
The number of invocations.
Definition: ExperimentInterface.h:45
ExperimentPresenter::addLibrary
void addLibrary()
Slot which adds a library to the libraries table.
Definition: ExperimentPresenter.cpp:103
ExperimentPresenter
This class defines the presenter object which handles user events coming from the view (ExperimentVie...
Definition: ExperimentPresenter.h:35
ExperimentPresenter::experiment
ExperimentInterface *const experiment
a pointer to the experiment model whose values are edited by this presenter
Definition: ExperimentPresenter.h:127
ExperimentPresenter::setSeed
void setSeed(ExperimentInterface::Seed _seed)
Slot which is connected to the ExperimentView::Seed_valueChanged signal. It will set the model&#39;s valu...
Definition: ExperimentPresenter.cpp:127
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
ExperimentPresenter::project
ProjectInterface *const project
a ponter to the project interface in order to access the filepath
Definition: ExperimentPresenter.h:129
LibrariesPresenter
This class describes the presenter object of the map of included libraries.
Definition: LibrariesPresenter.h:48
AddLibrary
Command class for adding libraries to the libraries table.
Definition: ExperimentPresenter.h:144
RemoveLoggingGroup
Command class for removing logging groups from the logging groups list.
Definition: ExperimentPresenter.h:205
LibrariesPresenter.h
This class describes the presenter object of the map of included libraries.
ExperimentPresenter::startSimulation
void startSimulation()
Signal, emitted when the start simulation button has been clicked. Will trigger a process (started in...
ExperimentPresenter::loggingGroupsPresenter
LoggingGroupsPresenter *const loggingGroupsPresenter
a pointer to the presenter object of the logging groups list
Definition: ExperimentPresenter.h:137
ExperimentPresenter::libraryTypesList
static QStringList libraryTypesList
a list of possible library types
Definition: ExperimentPresenter.h:134
RemoveLibrary
Command class for removing libraries from the libraries table.
Definition: ExperimentPresenter.h:163
ExperimentPresenter::experimentView
ExperimentView *const experimentView
a ponter to the experiment&#39;s view whose events are handled by this presenter
Definition: ExperimentPresenter.h:128
ExperimentPresenter::addLoggingGroup
void addLoggingGroup()
Slot which adds a logging group to the logging groups list.
Definition: ExperimentPresenter.cpp:72
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
ExperimentPresenter::removeLoggingGroup
void removeLoggingGroup(int const &row)
Slot which removes the logging groups placed in the given row of the logging groups list...
Definition: ExperimentPresenter.cpp:84
ExperimentPresenter::setupLibraries
void setupLibraries()
An initializer method which configures the table view of the libraries. Creates the table&#39;s presenter...
Definition: ExperimentPresenter.cpp:91
ExperimentPresenter::setupLoggingGroups
void setupLoggingGroups()
An initializer method which configures the list view of the logging groups. Creates the list&#39;s presen...
Definition: ExperimentPresenter.cpp:61
ExperimentInterface::Seed
int Seed
The random seed used for random number generation.
Definition: ExperimentInterface.h:46
ExperimentInterface.h
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
ExperimentPresenter::librariesPresenter
LibrariesPresenter *const librariesPresenter
a pointer to the presenter object of the libraries map
Definition: ExperimentPresenter.h:133
EditRandomSeed
Command class editing the number of invocations.
Definition: ExperimentPresenter.h:249
ExperimentPresenter::removeLibrary
void removeLibrary(int const &row)
Slot which removes the library placed in the given row of the libraries table.
Definition: ExperimentPresenter.cpp:115
ExperimentPresenter::loggingGroupsList
static QStringList loggingGroupsList
a selection list of possible logging groups
Definition: ExperimentPresenter.h:138
ExperimentInterface
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
Definition: ExperimentInterface.h:39
ExperimentPresenter::updateView
void updateView()
This method sets all display values of the view to the model values. This method is called after load...
Definition: ExperimentPresenter.cpp:133
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
ExperimentView.h File Reference
Traffic Simulation Plugin

This class provides an editor for configuring the experiment setup, i.e. it is filled with the content stored in an ExperimentInterface instance. More...

Detailed Description

This class provides an editor for configuring the experiment setup, i.e. it is filled with the content stored in an ExperimentInterface instance.

It contains an #ui object describing the views appearance (defined in ExperimentView.ui). This ui object comprises a form layout with labels and editing elements for the different attributes of the experiment configuration. User action will lead to signal emissions which are noticed and managed by the corresponding presenter class, i.e. ExperimentPresenter.

Definition in file ExperimentView.h.

Go to the source code of this file.

Classes

class ExperimentView
This class provides an editor for configuring the experiment setup, i.e. it is filled with the content stored in an ExperimentInterface instance. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
ExperimentView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
23
24 #ifndef EXPERIMENTVIEW_H
25 #define EXPERIMENTVIEW_H
26
27 #include "WidgetView.h"
28
29 #include <QWidget>
30 #include <QListView>
31 #include <QTableView>
32
33 namespace Ui {
34 class ExperimentView;
35 }
36
37 //-----------------------------------------------------------------------------
46 //-----------------------------------------------------------------------------
47 class ExperimentView : public WidgetView
48 {
49 Q_OBJECT
50
51 public:
52 explicit ExperimentView(QWidget *parent = nullptr);
53 ~ExperimentView();
54
55 Q_SIGNALS:
56 //-----------------------------------------------------------------------------
58 //-----------------------------------------------------------------------------
59 void Invocations_valueChanged(int value);
60
61 //-----------------------------------------------------------------------------
63 //-----------------------------------------------------------------------------
64 void Seed_valueChanged(int value);
65
66 //-----------------------------------------------------------------------------
69 //-----------------------------------------------------------------------------
70 void addLibrary();
71
72 //-----------------------------------------------------------------------------
75 //-----------------------------------------------------------------------------
76 void removeLibrary(int const & row);
77
78 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 void addLoggingGroup();
83
84 //-----------------------------------------------------------------------------
87 //-----------------------------------------------------------------------------
88 void removeLoggingGroup(int const & row);
89
90 //-----------------------------------------------------------------------------
94 //-----------------------------------------------------------------------------
95 void resized();
96
97 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
102 void startSimulation();
103
104 private Q_SLOTS:
105 //-----------------------------------------------------------------------------
108 //-----------------------------------------------------------------------------
109 void on_InvocationsValue_editingFinished();
110
111 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------
115 void on_SeedValue_editingFinished();
116
117 //-----------------------------------------------------------------------------
120 //-----------------------------------------------------------------------------
121 void on_Library_add_clicked();
122
123 //-----------------------------------------------------------------------------
126 //-----------------------------------------------------------------------------
127 void on_Library_remove_clicked();
128
129 //-----------------------------------------------------------------------------
132 //-----------------------------------------------------------------------------
133 void on_LoggingGroup_add_clicked();
134
135 //-----------------------------------------------------------------------------
138 //-----------------------------------------------------------------------------
139 void on_LoggingGroup_remove_clicked();
140
141 //-----------------------------------------------------------------------------
144 //-----------------------------------------------------------------------------
145 void on_StartSimulation_clicked();
146
147 public:
148 //-----------------------------------------------------------------------------
153 //-----------------------------------------------------------------------------
154 void setInvocationsValue(int value);
155
156 //-----------------------------------------------------------------------------
160 //-----------------------------------------------------------------------------
161 void setSeedValue(int value);
162
163 //-----------------------------------------------------------------------------
168 //-----------------------------------------------------------------------------
169 QListView * getLoggingGroupsView() const;
170
171 //-----------------------------------------------------------------------------
177 //-----------------------------------------------------------------------------
178 QTableView * getLibrariesView() const;
179
180 //-----------------------------------------------------------------------------
182 //-----------------------------------------------------------------------------
183 void enableSimulation(bool enable) ;
184
185 private:
186 //-----------------------------------------------------------------------------
191 //-----------------------------------------------------------------------------
192 void resizeEvent(QResizeEvent * event);
193
194 //-----------------------------------------------------------------------------
205 //-----------------------------------------------------------------------------
206 bool eventFilter(QObject *watched, QEvent *event) ;
207
208 private:
209 Ui::ExperimentView *ui;
210 };
211
212 #endif // EXPERIMENTVIEW_H
ExperimentView::on_Library_remove_clicked
void on_Library_remove_clicked()
Qt Desinger-created slot activated when the remove-button in the Library section has been pressed...
Definition: ExperimentView.cpp:56
ExperimentView
This class provides an editor for configuring the experiment setup, i.e. it is filled with the conten...
Definition: ExperimentView.h:47
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
ExperimentView::setInvocationsValue
void setInvocationsValue(int value)
Method for setting the spinbox value for the number of invocations to the value passed as an argument...
Definition: ExperimentView.cpp:41
ExperimentView::addLoggingGroup
void addLoggingGroup()
Signal, emitted when the add-button in the logging groups section has been pressed by the user...
ExperimentView::on_InvocationsValue_editingFinished
void on_InvocationsValue_editingFinished()
Qt Desinger-created slot activated when the spinbox for the number of invocations has been edited...
Definition: ExperimentView.cpp:36
ExperimentView::on_Library_add_clicked
void on_Library_add_clicked()
Qt Desinger-created slot activated when the add-button in the Library section has been pressed...
Definition: ExperimentView.cpp:51
ExperimentView::on_LoggingGroup_remove_clicked
void on_LoggingGroup_remove_clicked()
Qt Desinger-created slot activated when the remove-button in the logging groups section has been pres...
Definition: ExperimentView.cpp:66
ExperimentView::on_StartSimulation_clicked
void on_StartSimulation_clicked()
Qt Desinger-created slot activated when the Start SImulation button has been clicked. Emits the startSimulation signal.
Definition: ExperimentView.cpp:71
ExperimentView::Seed_valueChanged
void Seed_valueChanged(int value)
Signal, emitted when the random seed value has been modified by the user.
ExperimentView::resized
void resized()
Signal, emitted when this view has been resized. Will be connected to the slot ExperimentBaseView::up...
ExperimentView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter. This filter catches the resize events of the table view (librar...
Definition: ExperimentView.cpp:97
ExperimentView::startSimulation
void startSimulation()
Signal, emitted when the user clicks the Start Simulation Button. Will trigger a status check of the ...
ExperimentView::Invocations_valueChanged
void Invocations_valueChanged(int value)
Signal, emitted when the number of invocations has been modified by the user.
ExperimentView::removeLibrary
void removeLibrary(int const &row)
Signal, emitted when the remove-button in the library section has been pressed by the user...
ExperimentView::enableSimulation
void enableSimulation(bool enable)
Method which enables the start simulation button.
Definition: ExperimentView.cpp:110
ExperimentView::removeLoggingGroup
void removeLoggingGroup(int const &row)
Signal, emitted when the remove-button in the logging groups section has been pressed by the user...
ExperimentView::on_SeedValue_editingFinished
void on_SeedValue_editingFinished()
Qt Desinger-created slot activated when the spinbox value for the random seed has been edited...
Definition: ExperimentView.cpp:46
ExperimentView::getLibrariesView
QTableView * getLibrariesView() const
Method which gives access to the QTableView instance holding the entries of the libraries map...
Definition: ExperimentView.cpp:81
ExperimentView::getLoggingGroupsView
QListView * getLoggingGroupsView() const
Method which gives access to the QListView instance listing the logging groups. Will be used by the p...
Definition: ExperimentView.cpp:76
ExperimentView::ui
Ui::ExperimentView * ui
the ui object containing the GUI elements of this editor
Definition: ExperimentView.h:209
ExperimentView::setSeedValue
void setSeedValue(int value)
Method for setting the spinbox value for the random seed to the value passed as an argument...
Definition: ExperimentView.cpp:86
ExperimentView::on_LoggingGroup_add_clicked
void on_LoggingGroup_add_clicked()
Qt Desinger-created slot activated when the add-button in the logging groups section has been pressed...
Definition: ExperimentView.cpp:61
ExperimentView::resizeEvent
void resizeEvent(QResizeEvent *event)
Reimplementation of the resize event. Will emit the signal resized when this view is resized...
Definition: ExperimentView.cpp:91
ExperimentView::addLibrary
void addLibrary()
Signal, emitted when the add-button in the library section has been pressed by the user...
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: LibrariesPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
LibrariesPresenter.h File Reference
Traffic Simulation Plugin | Traffic Simulation Plugin

This class describes the presenter object of the map of included libraries. More...

Detailed Description

This class describes the presenter object of the map of included libraries.

This class describes the presenter object of the list of logging groups.

In the spirit of Qt's Model/View framework it constitutes the wrapper object connecting the model data (libraries map defined in ExperimentInterface) with the interface defined in QAbstractTableModel. This interface can be then utilized by an instance Qt's QTableView to display the map in a table format.

See https://doc.qt.io/qt-5/model-view-programming.html for Qt's model/view framework.

In the spirit of Qt's Model/View framework it constitutes the wrapper object connecting the model data (the logging groups list defined in ExperimentInterface) with the interface defined in QAbstractListModel. This interface can be then utilized by an instance Qt's QListView to display the list.

See https://doc.qt.io/qt-5/model-view-programming.html for Qt's model/view framework.

Definition in file LibrariesPresenter.h.

Go to the source code of this file.

Classes

class LibrariesPresenter
This class describes the presenter object of the map of included libraries. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: LibrariesPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
LibrariesPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
26
27 #ifndef LIBRARIESPRESENTER_H
28 #define LIBRARIESPRESENTER_H
29
30 #include "openPASS-TrafficSimulation/ExperimentInterface.h"
31 #include "openPASS-Project/ProjectInterface.h"
32
33 #include <QAbstractTableModel>
34
35 //-----------------------------------------------------------------------------
47 //-----------------------------------------------------------------------------
48 class LibrariesPresenter : public QAbstractTableModel
49 {
50 Q_OBJECT
51
52 public:
53 explicit LibrariesPresenter(ExperimentInterface::Libraries * const libraries,
54 ProjectInterface * const project,
55 QObject *parent = nullptr);
56
57 public:
58 //-----------------------------------------------------------------------------
69 //-----------------------------------------------------------------------------
70 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
71
72 public:
73 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
83
84 //-----------------------------------------------------------------------------
92 //-----------------------------------------------------------------------------
93 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
94
95 public:
96 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
105 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
106
107 //-----------------------------------------------------------------------------
116 //-----------------------------------------------------------------------------
117 virtual bool setData(const QModelIndex &index, const QVariant &value,
118 int role = Qt::EditRole) override;
119
120
121 //-----------------------------------------------------------------------------
128 //-----------------------------------------------------------------------------
129 virtual Qt::ItemFlags flags(const QModelIndex& index) const override;
130
131 public:
132 //-----------------------------------------------------------------------------
138 //-----------------------------------------------------------------------------
139 void addRow(const int &row, QString libType);
140
141 //-----------------------------------------------------------------------------
149 //-----------------------------------------------------------------------------
150 bool removeRow(const int &row);
151
152 //-----------------------------------------------------------------------------
155 //-----------------------------------------------------------------------------
156 void update();
157
158 private:
159 ExperimentInterface::Libraries * const libraries;
160 ProjectInterface * const project;
161 QMap<int, QString> RowToLibType;
162 QStringList _columnHeaders;
163 };
164
165 #endif // LIBRARIESPRESENTER_H
ExperimentInterface::Libraries
QMap< QString, QString > Libraries
The map of libraries needed by the simulation slave.
Definition: ExperimentInterface.h:47
LibrariesPresenter::setData
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: LibrariesPresenter.cpp:100
LibrariesPresenter::project
ProjectInterface *const project
a pointer to the project plugin (gives access to file system)
Definition: LibrariesPresenter.h:160
LibrariesPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: LibrariesPresenter.cpp:40
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
LibrariesPresenter::addRow
void addRow(const int &row, QString libType)
Method that adds a new row, i.e. a new library to of the given type.
Definition: LibrariesPresenter.cpp:132
LibrariesPresenter
This class describes the presenter object of the map of included libraries.
Definition: LibrariesPresenter.h:48
LibrariesPresenter::libraries
ExperimentInterface::Libraries *const libraries
the map of libraries
Definition: LibrariesPresenter.h:159
LibrariesPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: LibrariesPresenter.cpp:26
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
LibrariesPresenter::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable.
Definition: LibrariesPresenter.cpp:127
ExperimentInterface.h
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
LibrariesPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: LibrariesPresenter.cpp:33
LibrariesPresenter::_columnHeaders
QStringList _columnHeaders
a map translating row indices to library types
Definition: LibrariesPresenter.h:162
LibrariesPresenter::update
void update()
Method which updates the table according to the current entries of libraries.
Definition: LibrariesPresenter.cpp:164
LibrariesPresenter::removeRow
bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful range...
Definition: LibrariesPresenter.cpp:146
LibrariesPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: LibrariesPresenter.cpp:53
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioAgentsPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
ScenarioAgentsPresenter.h File Reference
Traffic Simulation Plugin

This class describes the presenter object of the scenario agents map. More...

Detailed Description

This class describes the presenter object of the scenario agents map.

In the spirit of Qt's Model/View framework it constitutes the wrapper object connecting the model data (scenario agents map defined in ScenarioInterface) with the interface defined in QAbstractTableModel. This interface can be then utilized by instances Qt's QTableView to display the map entries in a table format. Since the table should only display the scenario agents, there is no setData method implemented here.

See https://doc.qt.io/qt-5/model-view-programming.html for Qt's model/view framework.

Definition in file ScenarioAgentsPresenter.h.

Go to the source code of this file.

Classes

class ScenarioAgentsPresenter
This class describes the presenter object of the scenario agents map. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioAgentsPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
ScenarioAgentsPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
27
28 #ifndef SCENARIOAGENTSPRESENTER_H
29 #define SCENARIOAGENTSPRESENTER_H
30
31 #include "openPASS-TrafficSimulation/ScenarioInterface.h"
32
33 #include <QAbstractTableModel>
34
35 //-----------------------------------------------------------------------------
48 //-----------------------------------------------------------------------------
49 class ScenarioAgentsPresenter : public QAbstractTableModel
50 {
51 Q_OBJECT
52
53 public:
54 explicit ScenarioAgentsPresenter(ScenarioInterface::Entities * const entities,
55 QMap<QString, QList<QString>> const &scenarioAgentsList,
56 QObject *parent = nullptr);
57 ~ScenarioAgentsPresenter() = default;
58
59 public:
60 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
73
74
75 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
85
86 //-----------------------------------------------------------------------------
94 //-----------------------------------------------------------------------------
95 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
96
97 //-----------------------------------------------------------------------------
105 //-----------------------------------------------------------------------------
106 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
107
108 public:
109 //-----------------------------------------------------------------------------
112 //-----------------------------------------------------------------------------
113 void update();
114
115
116 private:
117 QMap<int, QString> RowToName;
118 ScenarioInterface::Entities * const entities;
119 QStringList _columnHeaders;
120 QMap<QString, QList<QString>> const & scenarioAgentsList;
121
122 };
123
124 #endif // SCENARIOAGENTSPRESENTER_H
ScenarioAgentsPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: ScenarioAgentsPresenter.cpp:36
ScenarioAgentsPresenter::_columnHeaders
QStringList _columnHeaders
the column header&#39;s info
Definition: ScenarioAgentsPresenter.h:119
ScenarioAgentsPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: ScenarioAgentsPresenter.cpp:43
ScenarioAgentsPresenter::entities
ScenarioInterface::Entities *const entities
a map translating row indices to scenario agent names
Definition: ScenarioAgentsPresenter.h:118
ScenarioAgentsPresenter::update
void update()
Method which updates the table model according to the current entries of #entitites.
Definition: ScenarioAgentsPresenter.cpp:125
ScenarioInterface.h
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
ScenarioAgentsPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: ScenarioAgentsPresenter.cpp:50
ScenarioAgentsPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: ScenarioAgentsPresenter.cpp:25
ScenarioInterface::Entities
QMap< Name, CatalogueRef > Entities
The mapping of a scenario agent to an agent profile (catalogue reference)
Definition: ScenarioInterface.h:46
ScenarioAgentsPresenter::scenarioAgentsList
QMap< QString, QList< QString > > const & scenarioAgentsList
a map which holds a list of scenario agents (values) for each profiles catalogue (keys) ...
Definition: ScenarioAgentsPresenter.h:120
ScenarioAgentsPresenter
This class describes the presenter object of the scenario agents map.
Definition: ScenarioAgentsPresenter.h:49
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioBaseView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
ScenarioBaseView.h File Reference
Traffic Simulation Plugin

This class provides a resizable container widget for the content of the scenario tab's scroll area. More...

Detailed Description

This class provides a resizable container widget for the content of the scenario tab's scroll area.

The item inserted into this widget is the instance of ScenarioView.

Definition in file ScenarioBaseView.h.

Go to the source code of this file.

Classes

class ScenarioBaseView
This class provides a resizable container widget for the content of the scenario tab. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioBaseView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
ScenarioBaseView.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
10 #ifndef SCENARIOBASEVIEW_H
11 #define SCENARIOBASEVIEW_H
12
13 #include "Views/ScenarioView.h"
14
15 #include "WidgetView.h"
16
17 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
24 class ScenarioBaseView : public WidgetView
25 {
26
27 Q_OBJECT
28
29 public:
30 ScenarioBaseView(QWidget *parent = 0);
31 ~ScenarioBaseView() = default;
32
33 public:
34 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
39 ScenarioView * getScenarioView() const;
40
41 public Q_SLOTS:
42 //-----------------------------------------------------------------------------
45 //-----------------------------------------------------------------------------
46 void updateSize();
47
48 public:
49 //-----------------------------------------------------------------------------
56 //-----------------------------------------------------------------------------
57 void adjustWidgets(QWidget *mainWindow);
58
59 public:
60 ScenarioView * scenarioView;
61 };
62
63 #endif // SCENARIOBASEVIEW_H
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
ScenarioBaseView::updateSize
void updateSize()
Slot which updates the size of this base view such that the child widget (ScenarioView) is visible...
Definition: ScenarioBaseView.cpp:18
ScenarioBaseView::getScenarioView
ScenarioView * getScenarioView() const
Method which returns the scenario configuration editor widget.
Definition: ScenarioBaseView.cpp:13
ScenarioBaseView::scenarioView
ScenarioView * scenarioView
A pointer to the scenario configuration widget.
Definition: ScenarioBaseView.h:60
ScenarioView.h
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content ...
ScenarioBaseView
This class provides a resizable container widget for the content of the scenario tab.
Definition: ScenarioBaseView.h:24
ScenarioBaseView::adjustWidgets
void adjustWidgets(QWidget *mainWindow)
Method which adjusts the positioning and size of the child widget. The size of the child widget is de...
Definition: ScenarioBaseView.cpp:28
ScenarioView
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content ...
Definition: ScenarioView.h:42
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioDisplayPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
ScenarioDisplayPresenter.h File Reference
Traffic Simulation Plugin

This class defines the presenter which controls the content to be displayed in the ScenarioDisplayView widget. More...

Detailed Description

This class defines the presenter which controls the content to be displayed in the ScenarioDisplayView widget.

Definition in file ScenarioDisplayPresenter.h.

Go to the source code of this file.

Classes

class ScenarioDisplayPresenter
This class defines the presenter which controls the content to be displayed in the ScenarioDisplayView widget. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioDisplayPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
ScenarioDisplayPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17 #ifndef SCENARIODISPLAYPRESENTER_H
18 #define SCENARIODISPLAYPRESENTER_H
19
20 #include "openPASS-TrafficSimulation/ScenarioInterface.h"
21 #include "openPASS-Project/ProjectInterface.h"
22 #include "Views/ScenarioDisplayView.h"
23
24 #include <QObject>
25
26 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
30 class ScenarioDisplayPresenter : public QObject
31 {
32 Q_OBJECT
33
34 public:
35 explicit ScenarioDisplayPresenter(ScenarioInterface *scenario,
36 ScenarioDisplayView *scenarioDisplayView,
37 ProjectInterface * const project,
38 QObject *parent = nullptr);
39
40 ~ScenarioDisplayPresenter() = default;
41
42 public Q_SLOTS:
43 //-----------------------------------------------------------------------------
46 //-----------------------------------------------------------------------------
47 void setScenarioNameView();
48
49 //-----------------------------------------------------------------------------
52 //-----------------------------------------------------------------------------
53 void setScenarioFileView();
54
55 //-----------------------------------------------------------------------------
58 //-----------------------------------------------------------------------------
59 void setScenarioAgentsView();
60
61 public:
62 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 void setStatus();
70
71 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 void updateView();
76
77 private:
78 void setScenarioAgentsList();
79 bool scenarioAgentsDefined();
80
81
82 private:
83 ScenarioInterface *scenario;
84 ScenarioDisplayView *scenarioDisplayView;
85 ProjectInterface * const project;
86
87 private:
88 QMap<QString , QList<QString>> scenarioAgentsList;
89 };
90
91 #endif // SCENARIODISPLAYPRESENTER_H
ScenarioDisplayPresenter::setStatus
void setStatus()
Method which determines the status of the scenario settings. If all necessary configurations are made...
Definition: ScenarioDisplayPresenter.cpp:67
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
ScenarioDisplayPresenter::scenario
ScenarioInterface * scenario
a pointer to the scenario model (interface) which is read by this presenter
Definition: ScenarioDisplayPresenter.h:83
ScenarioDisplayPresenter::project
ProjectInterface *const project
a pointer to the project interface in order to access the file system
Definition: ScenarioDisplayPresenter.h:85
ScenarioDisplayPresenter::setScenarioNameView
void setScenarioNameView()
Slot which is called when the name of the scenario has changed in the model. Updates the displayed na...
Definition: ScenarioDisplayPresenter.cpp:36
ScenarioDisplayPresenter::setScenarioFileView
void setScenarioFileView()
Slot which is called when the open scenario filename changed in the model. Updates the displayed scen...
Definition: ScenarioDisplayPresenter.cpp:44
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
ScenarioDisplayPresenter::setScenarioAgentsView
void setScenarioAgentsView()
Slot which is called when the map of scenario agents has been edited in the model. Updates the displayed number of scenario agents and triggers a status check.
Definition: ScenarioDisplayPresenter.cpp:58
ScenarioInterface.h
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
ScenarioDisplayPresenter::updateView
void updateView()
Method which sets all displayed values according to the model data. Will be called after loading a co...
Definition: ScenarioDisplayPresenter.cpp:96
ScenarioDisplayView.h
This class provides a display for a quick overview of the scenario configuration. ...
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
ScenarioDisplayView
This class provides a display for a quick overview of the scenario configuration. ...
Definition: ScenarioDisplayView.h:40
ScenarioDisplayPresenter::scenarioAgentsList
QMap< QString, QList< QString > > scenarioAgentsList
a map which holds a list of scenario agents (values) for each profiles catalogue (keys) ...
Definition: ScenarioDisplayPresenter.h:88
ScenarioDisplayPresenter
This class defines the presenter which controls the content to be displayed in the ScenarioDisplayVie...
Definition: ScenarioDisplayPresenter.h:30
ScenarioDisplayPresenter::scenarioDisplayView
ScenarioDisplayView * scenarioDisplayView
a pointer to the display view whose content is managed by this presenter
Definition: ScenarioDisplayPresenter.h:84
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioDisplayView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
ScenarioDisplayView.h File Reference
Traffic Simulation Plugin

This class provides a display for a quick overview of the scenario configuration. More...

Detailed Description

This class provides a display for a quick overview of the scenario configuration.

It contains an #ui object describing the views appearence (defined in ScenarioDisplayView.ui). This ui object comprises a form layout with labels showing the configuration that has been edited by ScenarioView. The frame of the view can be coloured in order to notify the user whether the configuration is complete or not.

Definition in file ScenarioDisplayView.h.

Go to the source code of this file.

Classes

class ScenarioDisplayView
This class provides a display for a quick overview of the scenario configuration. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioDisplayView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
ScenarioDisplayView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
21 #ifndef SCENARIODISPLAYVIEW_H
22 #define SCENARIODISPLAYVIEW_H
23
24 #include "WidgetView.h"
25
26 #include <QMap>
27
28 namespace Ui {
29 class ScenarioDisplayView;
30 }
31
32 //-----------------------------------------------------------------------------
39 //-----------------------------------------------------------------------------
40 class ScenarioDisplayView : public WidgetView
41 {
42 Q_OBJECT
43
44 public:
45 enum class StatusType {
46 Error = 0,
47 OK = 1,
48 Warning = 2
49 };
50
51 public:
52 explicit ScenarioDisplayView(QWidget *parent = nullptr);
53 ~ScenarioDisplayView();
54
55 public:
56 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 void setScenarioName(QString name);
62
63 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 void setScenarioFile(QString scenarioFile);
69
70 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 void setScenarioAgents(int scenarioAgents);
76
77 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 void setStatus(StatusType status, QString message);
85 // void setStatus(StatusType status);
86
87 private:
88 QMap<StatusType, QString> color;
89 Ui::ScenarioDisplayView *ui;
90 };
91
92 #endif // SCENARIODISPLAYVIEW_H
ScenarioDisplayView::setScenarioFile
void setScenarioFile(QString scenarioFile)
Method for setting the name which should be displayed for the open scenario file. ...
Definition: ScenarioDisplayView.cpp:44
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
ScenarioDisplayView::setScenarioName
void setScenarioName(QString name)
Method for setting the name which should be displayed for the scenario.
Definition: ScenarioDisplayView.cpp:39
ScenarioDisplayView::setScenarioAgents
void setScenarioAgents(int scenarioAgents)
Method for setting the number of scenario agents which should be displayed.
Definition: ScenarioDisplayView.cpp:49
ScenarioDisplayView::StatusType::Error
enum class for classifying the status (will be used to determine the color of the frame) ...
ScenarioDisplayView::ui
Ui::ScenarioDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: ScenarioDisplayView.h:89
ScenarioDisplayView::color
QMap< StatusType, QString > color
a color map which determines the color code according to the status type
Definition: ScenarioDisplayView.h:88
ScenarioDisplayView
This class provides a display for a quick overview of the scenario configuration. ...
Definition: ScenarioDisplayView.h:40
ScenarioDisplayView::setStatus
void setStatus(StatusType status, QString message)
Method which determines the frame color according to the status type passed as a first argument...
Definition: ScenarioDisplayView.cpp:54
ScenarioDisplayView::StatusType
StatusType
Definition: ScenarioDisplayView.h:45
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
Classes
ScenarioInterface.h File Reference
Traffic Simulation Plugin

The Scenario Interface provides setter and getter methods for the combination XML elements related to an Open Scenario File. More...

Detailed Description

The Scenario Interface provides setter and getter methods for the combination XML elements related to an Open Scenario File.

These comprise the selection of the scenario file itself as well as the selection of the ego agent and other scenario agents.

Definition in file ScenarioInterface.h.

Go to the source code of this file.

Classes

class ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to an Open Scenario File. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
ScenarioInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
19 //-----------------------------------------------------------------------------
20
21 #ifndef SCENARIOINTERFACE_H
22 #define SCENARIOINTERFACE_H
23
24 #include <QObject>
25 #include <QString>
26 #include <QPair>
27 #include <QMap>
28
29 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
36 class ScenarioInterface : public QObject
37 {
38 Q_OBJECT
39
40 public:
41 using ScenarioFile = QString;
42 using Name = QString;
43 using CatalogueName = QString;
44 using EntryName = QString;
45 using CatalogueRef = QPair<CatalogueName, EntryName>;
46 using Entities = QMap<Name, CatalogueRef>;
47 using Status = bool;
48
49
50 explicit ScenarioInterface(QObject * parent = nullptr)
51 : QObject(parent){}
52
53 virtual ~ScenarioInterface() = default;
54
55 Q_SIGNALS:
56 //-----------------------------------------------------------------------------
58 //-----------------------------------------------------------------------------
59 void modifiedName();
60
61 //-----------------------------------------------------------------------------
63 //-----------------------------------------------------------------------------
64 void modifiedScenarioFile();
65
66 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 void setEntities();
70
71 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 void modifiedStatus();
75
76 public:
77 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 virtual void setName(Name const & newName) =0;
83
84 //-----------------------------------------------------------------------------
88 //-----------------------------------------------------------------------------
89 virtual Name getName() const =0;
90
91 public:
92 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 virtual void setStatus(Status const &_status) = 0;
99
100 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
105 virtual Status getStatus() const = 0;
106
107 public:
108 //-----------------------------------------------------------------------------
113 //-----------------------------------------------------------------------------
114 virtual ScenarioFile getScenarioFile() const = 0;
115
116 //-----------------------------------------------------------------------------
120 //-----------------------------------------------------------------------------
121 virtual void setScenarioFile(ScenarioFile const & filename) = 0;
122
123 public:
124 //-----------------------------------------------------------------------------
130 //-----------------------------------------------------------------------------
131 virtual Entities * getEntities() const = 0;
132
133 };
134
135 #endif // SCENARIOINTERFACE_H
ScenarioInterface::getStatus
virtual Status getStatus() const =0
Method which returns the current status of the scenario settings.
ScenarioInterface::setEntities
void setEntities()
Signal, emitted when the entities map of the scenario setup has been set.
ScenarioInterface::getScenarioFile
virtual ScenarioFile getScenarioFile() const =0
Returns the current name of the open scenario file to which this scenario setup refers.
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
ScenarioInterface::Status
bool Status
Type characterizing the status of the scenario settings.
Definition: ScenarioInterface.h:47
ScenarioInterface::CatalogueRef
QPair< CatalogueName, EntryName > CatalogueRef
A catalogue reference, i.e. a reference to an entry (second) in an agent profiles catalogue (first) ...
Definition: ScenarioInterface.h:45
ScenarioInterface::CatalogueName
QString CatalogueName
The name of the catalogue in which an agent profile is defined.
Definition: ScenarioInterface.h:43
ScenarioInterface::setName
virtual void setName(Name const &newName)=0
Sets the name of the scenario to the given name.
ScenarioInterface::EntryName
QString EntryName
An entry in the catalogue of agent profiles.
Definition: ScenarioInterface.h:44
ScenarioInterface::modifiedName
void modifiedName()
Signal, emitted when the name of the scenario has been modified.
ScenarioInterface::Name
QString Name
The name of the scenario.
Definition: ScenarioInterface.h:42
ScenarioInterface::getEntities
virtual Entities * getEntities() const =0
Returns the map (= container class) in which all scenario agents information is registered. This comprises a name of the agent profile (key) and a catalogue reference (value).
ScenarioInterface::modifiedStatus
void modifiedStatus()
Signal, emitted when the scenario&#39;s status has changed.
ScenarioInterface::modifiedScenarioFile
void modifiedScenarioFile()
Signal, emitted when the open scenario filename has changed.
ScenarioInterface::ScenarioFile
QString ScenarioFile
The name of the open scenario file.
Definition: ScenarioInterface.h:41
ScenarioInterface::setScenarioFile
virtual void setScenarioFile(ScenarioFile const &filename)=0
Sets the filename of the open scenario file to the one passed as an argument.
ScenarioInterface::Entities
QMap< Name, CatalogueRef > Entities
The mapping of a scenario agent to an agent profile (catalogue reference)
Definition: ScenarioInterface.h:46
ScenarioInterface::setStatus
virtual void setStatus(Status const &_status)=0
Method for setting the status of the scenario configuration to the value passed as an argument...
ScenarioInterface::getName
virtual Name getName() const =0
Returns the current name of the scenario.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
Classes
ScenarioModel.h File Reference
Traffic Simulation Plugin

The Scenario Model class implements the functionality of the ScenarioItemInterface class. More...

Detailed Description

The Scenario Model class implements the functionality of the ScenarioItemInterface class.

Definition in file ScenarioModel.h.

Go to the source code of this file.

Classes

class ScenarioModel
The Scenario Model class implements the functionality of the ScenarioItemInterface class. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
ScenarioModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17
18 #ifndef SCENARIOMODEL_H
19 #define SCENARIOMODEL_H
20
21 #include "openPASS-TrafficSimulation/ScenarioInterface.h"
22
23 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
27 class ScenarioModel : public ScenarioInterface
28 {
29 public:
30 explicit ScenarioModel(QObject *parent = nullptr);
31
32 virtual ~ScenarioModel() override;
33
34 public:
35 virtual void setName(Name const & newName) override;
36 virtual Name getName() const override;
37
38 public:
39 virtual ScenarioFile getScenarioFile() const override;
40 virtual void setScenarioFile(ScenarioFile const & filename) override;
41
42 public:
43 virtual Entities * getEntities() const override;
44
45 public:
46 virtual void setStatus(Status const &_status) override;
47 virtual Status getStatus() const override;
48
49
50 private:
51 Name name;
52 ScenarioFile scenarioFile;
53 Entities * const entities;
54 Status status;
55
56 };
57
58 #endif // SCENARIOMODEL_H
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
ScenarioInterface::Status
bool Status
Type characterizing the status of the scenario settings.
Definition: ScenarioInterface.h:47
ScenarioModel::getEntities
virtual Entities * getEntities() const override
Returns the map (= container class) in which all scenario agents information is registered. This comprises a name of the agent profile (key) and a catalogue reference (value).
Definition: ScenarioModel.cpp:41
ScenarioModel::entities
Entities *const entities
the map of scenario agents (referred to as &#39;entities&#39; in the XOSC file standard). ...
Definition: ScenarioModel.h:53
ScenarioModel::getScenarioFile
virtual ScenarioFile getScenarioFile() const override
Returns the current name of the open scenario file to which this scenario setup refers.
Definition: ScenarioModel.cpp:46
ScenarioModel::getStatus
virtual Status getStatus() const override
Method which returns the current status of the scenario settings.
Definition: ScenarioModel.cpp:64
ScenarioInterface::Name
QString Name
The name of the scenario.
Definition: ScenarioInterface.h:42
ScenarioModel::name
Name name
the name of the scenario configuration
Definition: ScenarioModel.h:51
ScenarioModel
The Scenario Model class implements the functionality of the ScenarioItemInterface class...
Definition: ScenarioModel.h:27
ScenarioModel::scenarioFile
ScenarioFile scenarioFile
the path to the OpenScenario file
Definition: ScenarioModel.h:52
ScenarioInterface.h
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
ScenarioModel::setStatus
virtual void setStatus(Status const &_status) override
Method for setting the status of the scenario configuration to the value passed as an argument...
Definition: ScenarioModel.cpp:58
ScenarioModel::status
Status status
the status of the scenario configuration
Definition: ScenarioModel.h:54
ScenarioModel::setName
virtual void setName(Name const &newName) override
Sets the name of the scenario to the given name.
Definition: ScenarioModel.cpp:34
ScenarioInterface::ScenarioFile
QString ScenarioFile
The name of the open scenario file.
Definition: ScenarioInterface.h:41
ScenarioModel::getName
virtual Name getName() const override
Returns the current name of the scenario.
Definition: ScenarioModel.cpp:29
ScenarioModel::setScenarioFile
virtual void setScenarioFile(ScenarioFile const &filename) override
Sets the filename of the open scenario file to the one passed as an argument.
Definition: ScenarioModel.cpp:51
ScenarioInterface::Entities
QMap< Name, CatalogueRef > Entities
The mapping of a scenario agent to an agent profile (catalogue reference)
Definition: ScenarioInterface.h:46
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
ScenarioPresenter.h File Reference
Traffic Simulation Plugin

This class defines the presenter object which handles user events coming from the view (ScenarioView) and edits the model accordingly (ScenarioInterface). More...

Detailed Description

This class defines the presenter object which handles user events coming from the view (ScenarioView) and edits the model accordingly (ScenarioInterface).

Definition in file ScenarioPresenter.h.

Go to the source code of this file.

Classes

class | EditScenarioFile
Command class editing the OpenSCENARIO file. More...
class | EditScenarioName
Command class editing the scenario's name. More...
class | ScenarioPresenter
This class defines the presenter object which handles user events coming from the view (ScenarioView) and edits the model accordingly (ScenarioInterface). More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
ScenarioPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17 #ifndef SCENARIOPRESENTER_H
18 #define SCENARIOPRESENTER_H
19
20 #include "openPASS-TrafficSimulation/ScenarioInterface.h"
21 #include "openPASS-Project/ProjectInterface.h"
22
23 #include "Presenters/ScenarioAgentsPresenter.h"
24 #include "Views/ScenarioView.h"
25
26 #include <QObject>
27 #include <QMap>
28 #include <QList>
29 #include <QUndoStack>
30
31 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
35 class ScenarioPresenter : public QObject
36 {
37 Q_OBJECT
38 public:
39 explicit ScenarioPresenter(ScenarioInterface * scenario,
40 ScenarioView * scenarioView,
41 ProjectInterface * const project,
42 QUndoStack * const undoStack,
43 QObject *parent = nullptr);
44 virtual ~ScenarioPresenter() = default;
45
46 private Q_SLOTS:
47 //-----------------------------------------------------------------------------
52 //-----------------------------------------------------------------------------
53 void setName(QString const &name);
54
55 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 void setScenarioFile();
62
63 //-----------------------------------------------------------------------------
66 //-----------------------------------------------------------------------------
67 void refreshScenarioFile();
68
69 public:
70 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 void updateView();
76
77 private:
78 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 void setScenarioAgentsList();
83
84 private:
85 ScenarioAgentsPresenter * scenarioAgentsPresenter;
86 ScenarioInterface * scenario;
87 ScenarioView * scenarioView;
88 ProjectInterface * const project;
89 QUndoStack * const undoStack;
90
91 private:
92 QMap<QString , QList<QString>> scenarioAgentsList;
93 };
94
95 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 class EditScenarioName : public QUndoCommand
99 {
100
101 public:
102 EditScenarioName(ScenarioInterface * const scenario,
103 ScenarioView * const scenarioView,
104 ScenarioInterface::Name const &newName,
105 QUndoCommand * parent = nullptr);
106
107 public:
108 void redo() override;
109 void undo() override;
110
111 private:
112 ScenarioInterface * const scenario;
113 ScenarioView * const scenarioView;
114 ScenarioInterface::Name const newName;
115 ScenarioInterface::Name const oldName;
116 };
117
118 //-----------------------------------------------------------------------------
120 //-----------------------------------------------------------------------------
121 class EditScenarioFile : public QUndoCommand
122 {
123
124 public:
125 EditScenarioFile(ScenarioInterface * const scenario,
126 ScenarioView * const scenarioView,
127 ScenarioInterface::ScenarioFile const &newFile,
128 QUndoCommand * parent = nullptr);
129
130 public:
131 void redo() override;
132 void undo() override;
133
134 private:
135 ScenarioInterface * const scenario;
136 ScenarioView * const scenarioView;
137 ScenarioInterface::ScenarioFile const newFile;
138 ScenarioInterface::ScenarioFile const oldFile;
139 };
140
141
142 #endif // SCENARIOPRESENTER_H
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
EditScenarioName
Command class editing the scenario&#39;s name.
Definition: ScenarioPresenter.h:98
ScenarioPresenter::scenarioAgentsList
QMap< QString, QList< QString > > scenarioAgentsList
a map which holds a list of scenario agents (values) for each profiles catalogue (keys) ...
Definition: ScenarioPresenter.h:92
ScenarioPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: ScenarioPresenter.h:89
ScenarioPresenter::updateView
void updateView()
This method sets all display values of the view to the model values. This method is called after load...
Definition: ScenarioPresenter.cpp:87
ScenarioPresenter::scenarioAgentsPresenter
ScenarioAgentsPresenter * scenarioAgentsPresenter
a pointer to the presenter object of the scenario agent map
Definition: ScenarioPresenter.h:85
EditScenarioFile
Command class editing the OpenSCENARIO file.
Definition: ScenarioPresenter.h:121
ScenarioPresenter::setScenarioFile
void setScenarioFile()
Slot which is connected to the ScenarioView::modifiedScenarioFile signal. It will set the model&#39;s val...
Definition: ScenarioPresenter.cpp:45
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
ScenarioPresenter::setName
void setName(QString const &name)
Slot which is connected to the ScenarioView::modifiedName signal. It will set the model&#39;s value for t...
Definition: ScenarioPresenter.cpp:39
ScenarioPresenter::setScenarioAgentsList
void setScenarioAgentsList()
This method fills the scenarioAgentsList map with all agent profiles referenced in the currently sele...
Definition: ScenarioPresenter.cpp:95
ScenarioInterface::Name
QString Name
The name of the scenario.
Definition: ScenarioInterface.h:42
ScenarioPresenter::project
ProjectInterface *const project
a pointer to the project interface, needed for accessing the configs path
Definition: ScenarioPresenter.h:88
ScenarioPresenter
This class defines the presenter object which handles user events coming from the view (ScenarioView)...
Definition: ScenarioPresenter.h:35
ScenarioPresenter::scenario
ScenarioInterface * scenario
a pointer to the scenario model whose values are edited by this presenter
Definition: ScenarioPresenter.h:86
ScenarioAgentsPresenter.h
This class describes the presenter object of the scenario agents map.
ScenarioPresenter::refreshScenarioFile
void refreshScenarioFile()
Slot which refreshes the current scenario file. This means that it checks whether the file exists and...
Definition: ScenarioPresenter.cpp:64
ScenarioView.h
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content ...
ScenarioInterface.h
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
ScenarioInterface::ScenarioFile
QString ScenarioFile
The name of the open scenario file.
Definition: ScenarioInterface.h:41
ScenarioView
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content ...
Definition: ScenarioView.h:42
ScenarioPresenter::scenarioView
ScenarioView * scenarioView
a pointer to the scenario view whose events are handled by this presenter
Definition: ScenarioPresenter.h:87
ScenarioAgentsPresenter
This class describes the presenter object of the scenario agents map.
Definition: ScenarioAgentsPresenter.h:49
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
ScenarioView.h File Reference
Traffic Simulation Plugin

This class provides an editor for configuring the scenario setup, i.e. it is filled with the content stored in an ScenarioInterface instance. More...

Detailed Description

This class provides an editor for configuring the scenario setup, i.e. it is filled with the content stored in an ScenarioInterface instance.

It contains an #ui object describing the views appearance (defined in ScenarioView.ui). This ui object comprises a form layout with labels and editing elements for the different attributes of the scenario configuration. User action will lead to signal emissions which are noticed and managed by the corresponding presenter class.

Definition in file ScenarioView.h.

Go to the source code of this file.

Classes

class ScenarioView
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content stored in an ScenarioInterface instance. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
ScenarioView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
22
23 #ifndef SCENARIOVIEW_H
24 #define SCENARIOVIEW_H
25
26 #include <QWidget>
27 #include <QTableView>
28
29 namespace Ui {
30 class ScenarioView;
31 }
32
33 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
42 class ScenarioView : public QWidget
43 {
44 Q_OBJECT
45
46 public:
47 explicit ScenarioView(QWidget *parent = nullptr);
48 ~ScenarioView();
49
50 Q_SIGNALS:
51 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 void modifiedName(QString const &name);
56
57 //-----------------------------------------------------------------------------
59 //-----------------------------------------------------------------------------
60 void modifiedScenarioFile();
61
62 //-----------------------------------------------------------------------------
64 //-----------------------------------------------------------------------------
65 void refreshScenarioFile();
66
67 private Q_SLOTS:
68 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 void on_NameEdit_editingFinished();
73
74 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 void on_ScenarioFileBrowse_clicked();
79
80 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 void on_ScenarioFileRefresh_clicked();
85
86
87 public:
88 //-----------------------------------------------------------------------------
93 //-----------------------------------------------------------------------------
94 void setName(QString const &name);
95
96 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
102 void setScenarioFile(QString const &filename);
103
104 //-----------------------------------------------------------------------------
108 //-----------------------------------------------------------------------------
109 void setScenarioFileError(QString const &message);
110
111 //-----------------------------------------------------------------------------
116 //-----------------------------------------------------------------------------
117 QTableView * getScenarioAgentsView() const;
118
119 private:
120 //-----------------------------------------------------------------------------
131 //-----------------------------------------------------------------------------
132 bool eventFilter(QObject *watched, QEvent *event);
133
134 private:
135 Ui::ScenarioView *ui;
136 };
137
138 #endif // SCENARIOVIEW_H
ScenarioView::modifiedScenarioFile
void modifiedScenarioFile()
Signal emitted when the open scenario file shall be modified.
ScenarioView::on_ScenarioFileRefresh_clicked
void on_ScenarioFileRefresh_clicked()
Qt Desinger-created slot activated when the Scenario File Refresh button is clicked by the user...
Definition: ScenarioView.cpp:44
Ui
Definition: EnvironmentDisplayView.h:29
ScenarioView::on_NameEdit_editingFinished
void on_NameEdit_editingFinished()
Qt Desinger-created slot activated when the line edit for the scenario name has been edited...
Definition: ScenarioView.cpp:34
ScenarioView::getScenarioAgentsView
QTableView * getScenarioAgentsView() const
Method for returning the ui &#39;s table widget. Will be passed to the corresponding presenter object con...
Definition: ScenarioView.cpp:59
ScenarioView::setName
void setName(QString const &name)
Method which sets the line edit text for the scenario name to the name passed as an argument...
Definition: ScenarioView.cpp:49
ScenarioView::setScenarioFileError
void setScenarioFileError(QString const &message)
Method which sets an error message below the scenario file&#39;s line edit.
Definition: ScenarioView.cpp:78
ScenarioView::modifiedName
void modifiedName(QString const &name)
Signal emitted when the name of the scenario has been modified by the user. Transmits the new name to...
ScenarioView::on_ScenarioFileBrowse_clicked
void on_ScenarioFileBrowse_clicked()
Qt Desinger-created slot activated when the Scenario File Browse button is clicked by the user...
Definition: ScenarioView.cpp:39
ScenarioView::setScenarioFile
void setScenarioFile(QString const &filename)
Method which sets the line edit text for the open scenario file to the name passed as an argument...
Definition: ScenarioView.cpp:54
ScenarioView::ui
Ui::ScenarioView * ui
the ui object containing the GUI elements of the view
Definition: ScenarioView.h:135
ScenarioView
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content ...
Definition: ScenarioView.h:42
ScenarioView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter. This filter catches the resize events of the table view in orde...
Definition: ScenarioView.cpp:64
ScenarioView::refreshScenarioFile
void refreshScenarioFile()
Signal emitted when the open scenario file shall be refreshed.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: StatusBarView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
StatusBarView.h File Reference
Traffic Simulation Plugin

This class defines a status bar. More...

Detailed Description

This class defines a status bar.

It comprises a ui object (defined in StatusBarView.ui) which includes a Text Browser (QTextBrowser) for showing text and a button (QPushButton) for showing and hiding the status bar. The status bar can be used to show, for instance, information relevant for the simulation.

Definition in file StatusBarView.h.

Go to the source code of this file.

Classes

class StatusBarView
This class defines a status bar. More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: StatusBarView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
StatusBarView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
21
22 #ifndef STATUSBARVIEW_H
23 #define STATUSBARVIEW_H
24
25 #include <QWidget>
26
27 namespace Ui {
28 class StatusBarView;
29 }
30
31 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
39 class StatusBarView : public QWidget
40 {
41 Q_OBJECT
42
43 public:
44 explicit StatusBarView(QWidget *parent = 0);
45 ~StatusBarView();
46
47 enum class Color {
48 Error = 0,
49 Warning = 1,
50 Note = 2,
51 Message = 3
52 };
53
54 private Q_SLOTS:
55 //-----------------------------------------------------------------------------
58 //-----------------------------------------------------------------------------
59 void on_button_clicked();
60
61 public:
62 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 void showText(QString text, Color color);
69
70 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 virtual void show();
75
76 //-----------------------------------------------------------------------------
79 //-----------------------------------------------------------------------------
80 virtual void hide();
81
82
83
84 private:
85 static QMap<Color, QColor> colorMap;
86 Ui::StatusBarView *ui;
87 };
88
89 #endif // STATUSBARVIEW_H
StatusBarView::ui
Ui::StatusBarView * ui
The ui object defining the status bar&#39;s appearance. It contains a QTextBrowser and a QPushButton obje...
Definition: StatusBarView.h:86
Ui
Definition: EnvironmentDisplayView.h:29
StatusBarView::show
virtual void show()
Reimplementation of show. Sets the visible status of the text browser and the checked status of the b...
Definition: StatusBarView.cpp:45
StatusBarView::showText
void showText(QString text, Color color)
Method which displays the given text in the given color in the text browser.
Definition: StatusBarView.cpp:39
StatusBarView::colorMap
static QMap< Color, QColor > colorMap
the map containing the colors depending on the message type.
Definition: StatusBarView.h:85
StatusBarView::on_button_clicked
void on_button_clicked()
This slot is triggered when the hide/show button is clicked. Hides or shows the status bar...
Definition: StatusBarView.cpp:33
StatusBarView::hide
virtual void hide()
Reimplementation of hide. Sets the visible status of the text browser and the checked status of the b...
Definition: StatusBarView.cpp:51
StatusBarView
This class defines a status bar.
Definition: StatusBarView.h:39
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficBaseView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
TrafficBaseView.h File Reference
Traffic Simulation Plugin

This class provides a resizable container widget for the content of the traffic tab. More...

Detailed Description

This class provides a resizable container widget for the content of the traffic tab.

The items inserted into this widget are the instances of TrafficView, TrafficParametersView and TrafficLanesView. Further, the paint event is reimplemented such that the parameters and lanes views are connected via lines to the title widget (TrafficView). This visualizes that both configurations (parameters and lanes) are necessary for a complete traffic configuration.

Definition in file TrafficBaseView.h.

Go to the source code of this file.

Classes

class TrafficBaseView
This class provides a resizable container widget for the content of the traffic tab's scroll area. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficBaseView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficBaseView.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
13 //-----------------------------------------------------------------------------
14 #ifndef TRAFFICBASEVIEW_H
15 #define TRAFFICBASEVIEW_H
16
17 #include "Views/TrafficView.h"
18 #include "Views/TrafficLanesView.h"
19 #include "Views/TrafficParametersView.h"
20
21 #include "WidgetView.h"
22
23 #include <QPaintEvent>
24
25 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
36 class TrafficBaseView : public WidgetView
37 {
38 Q_OBJECT
39
40 public:
41 explicit TrafficBaseView(QWidget *parent = 0);
42 ~TrafficBaseView() =default;
43
44 public:
45 //-----------------------------------------------------------------------------
49 //-----------------------------------------------------------------------------
50 TrafficView * getTrafficView() const;
51
52 //-----------------------------------------------------------------------------
57 //-----------------------------------------------------------------------------
58 TrafficParametersView * getTrafficParametersView() const;
59
60 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
66 TrafficLanesView * getTrafficLanesView() const;
67
68 public Q_SLOTS:
69 //-----------------------------------------------------------------------------
72 //-----------------------------------------------------------------------------
73 void updateSize();
74
75 public:
76 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 void adjustWidgets(QWidget *mainWindow);
85
86 protected:
87 //-----------------------------------------------------------------------------
93 //-----------------------------------------------------------------------------
94 void paintEvent(QPaintEvent * event) override;
95
96 public:
97 TrafficView * trafficView ;
98 TrafficLanesView *trafficLanesView;
99 TrafficParametersView *trafficParametersView;
100 };
101
102 #endif // TRAFFICBASEVIEW_H
TrafficBaseView
This class provides a resizable container widget for the content of the traffic tab&#39;s scroll area...
Definition: TrafficBaseView.h:36
TrafficBaseView::getTrafficLanesView
TrafficLanesView * getTrafficLanesView() const
Method which returns the configuration widget for for assigning agent profiles to lanes (TrafficLanes...
Definition: TrafficBaseView.cpp:32
TrafficBaseView::trafficView
TrafficView * trafficView
A pointer to the traffic configuration&#39;s title view.
Definition: TrafficBaseView.h:97
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
TrafficLanesView
This class defines the editor widget for assigning agent profiles to regular and rightmost lanes...
Definition: TrafficLanesView.h:33
TrafficParametersView.h
This class defines the editor widget for traffic parameters and their probabilities.
TrafficBaseView::getTrafficView
TrafficView * getTrafficView() const
Method which returns the traffic title view (TrafficView).
Definition: TrafficBaseView.cpp:22
TrafficBaseView::adjustWidgets
void adjustWidgets(QWidget *mainWindow)
Method which adjusts the positioning and size of the child widgets. The size of the child widgets is ...
Definition: TrafficBaseView.cpp:47
TrafficBaseView::trafficParametersView
TrafficParametersView * trafficParametersView
A pointer to the widget for lane-agent assignement (TrafficLanesView)
Definition: TrafficBaseView.h:99
TrafficBaseView::getTrafficParametersView
TrafficParametersView * getTrafficParametersView() const
Method which returns the configuration widget for traffic parameters (TrafficParametersView).
Definition: TrafficBaseView.cpp:27
TrafficParametersView
This class defines the editor widget for traffic parameters and their probabilities.
Definition: TrafficParametersView.h:29
TrafficView
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content s...
Definition: TrafficView.h:43
TrafficView.h
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content s...
TrafficLanesView.h
This class defines the editor widget for assigning agent profiles to regular and rightmost lanes...
TrafficBaseView::paintEvent
void paintEvent(QPaintEvent *event) override
Reimplementation of the paint event. Here, the painting of the connection lines between the traffic&#39;s...
Definition: TrafficBaseView.cpp:72
TrafficBaseView::trafficLanesView
TrafficLanesView * trafficLanesView
A pointer to the traffic parameter configuration widget (TrafficParametersView)
Definition: TrafficBaseView.h:98
TrafficBaseView::updateSize
void updateSize()
Slot which updates the size of this base view such that all child widgets (TrafficView, TrafficParametersView and TrafficLanesView) are visible.
Definition: TrafficBaseView.cpp:37
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficDisplayPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
TrafficDisplayPresenter.h File Reference
Traffic Simulation Plugin

This class defines the presenter which controls the content to be displayed in the TrafficDisplayView widget. More...

Detailed Description

This class defines the presenter which controls the content to be displayed in the TrafficDisplayView widget.

Definition in file TrafficDisplayPresenter.h.

Go to the source code of this file.

Classes

class TrafficDisplayPresenter
This class defines the presenter which controls the content to be displayed in the TrafficDisplayView widget. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficDisplayPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
TrafficDisplayPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17
18 #ifndef TRAFFICDISPLAYPRESENTER_H
19 #define TRAFFICDISPLAYPRESENTER_H
20
21 #include "openPASS-TrafficSimulation/TrafficInterface.h"
22 #include "Presenters/TrafficPresenter.h"
23 #include "Views/TrafficDisplayView.h"
24
25 #include <QObject>
26
27 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
31 class TrafficDisplayPresenter : public QObject
32 {
33 Q_OBJECT
34 public:
35 explicit TrafficDisplayPresenter(TrafficInterface * traffic,
36 TrafficDisplayView * trafficDisplayView,
37 QList<QString> * const agentList,
38 QObject *parent = nullptr);
39
40 ~TrafficDisplayPresenter() = default;
41
42 public Q_SLOTS:
43 //-----------------------------------------------------------------------------
46 //-----------------------------------------------------------------------------
47 void updateView();
48
49 private:
50 //-----------------------------------------------------------------------------
53 //-----------------------------------------------------------------------------
54 void setTrafficNameView();
55
56 //-----------------------------------------------------------------------------
59 //-----------------------------------------------------------------------------
60 void setVolumesView();
61
62 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
66 void setPlatoonRatesView();
67
68 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 void setVelocitiesView();
73
74 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 void setHomogeneitiesView();
79
80 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
85 void setRegularLaneView();
86
87 //-----------------------------------------------------------------------------
91 //-----------------------------------------------------------------------------
92 void setRightmostLaneView();
93
94 private:
95 //-----------------------------------------------------------------------------
102 //-----------------------------------------------------------------------------
103 bool checkProbabilities(TrafficItemMapInterface * const items);
104
105 //-----------------------------------------------------------------------------
112 //-----------------------------------------------------------------------------
113 bool checkAgentProfiles();
114
115 public:
116 //-----------------------------------------------------------------------------
123 //-----------------------------------------------------------------------------
124 void setStatus();
125
126
127 private:
128 TrafficInterface * traffic;
129 TrafficDisplayView * trafficDisplayView;
130 QList<QString> * const agentList;
131
132 };
133
134 #endif // TRAFFICDISPLAYPRESENTER_H
TrafficDisplayPresenter::checkAgentProfiles
bool checkAgentProfiles()
Method which checks whether the agent profiles assigned to the lanes are defined in the profiles cata...
Definition: TrafficDisplayPresenter.cpp:141
TrafficDisplayPresenter::agentList
QList< QString > *const agentList
a pointer to the list of available agent profiles (defined in a ProfilesCatalog.xml) ...
Definition: TrafficDisplayPresenter.h:130
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficDisplayPresenter::setStatus
void setStatus()
Method which determines the status of the traffic settings. If all necessary configurations are made...
Definition: TrafficDisplayPresenter.cpp:92
TrafficDisplayPresenter::setHomogeneitiesView
void setHomogeneitiesView()
Slot which is called when the user edits the homogeneities map. Updates the displayed number of homog...
Definition: TrafficDisplayPresenter.cpp:58
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficDisplayPresenter
This class defines the presenter which controls the content to be displayed in the TrafficDisplayView...
Definition: TrafficDisplayPresenter.h:31
TrafficDisplayPresenter::checkProbabilities
bool checkProbabilities(TrafficItemMapInterface *const items)
Method which checks whether the given probabilities (stored in a list) sum up to 1.
Definition: TrafficDisplayPresenter.cpp:130
TrafficPresenter.h
This class defines the presenter object which handles user events coming from the view (TrafficView) ...
TrafficDisplayPresenter::setRightmostLaneView
void setRightmostLaneView()
Slot which is called when the user edits the rightmost lane agents map. Updates the displayed number ...
Definition: TrafficDisplayPresenter.cpp:70
TrafficInterface.h
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
TrafficDisplayView.h
This class provides a display for a quick overview of the traffic configuration.
TrafficDisplayPresenter::setRegularLaneView
void setRegularLaneView()
Slot which is called when the user edits the regular lane agents map. Updates the displayed number of...
Definition: TrafficDisplayPresenter.cpp:64
TrafficDisplayPresenter::setTrafficNameView
void setTrafficNameView()
Slot which is called when the name of the traffic configuration has changed in the model...
Definition: TrafficDisplayPresenter.cpp:31
TrafficDisplayView
This class provides a display for a quick overview of the traffic configuration.
Definition: TrafficDisplayView.h:42
TrafficDisplayPresenter::setVelocitiesView
void setVelocitiesView()
Slot which is called when the user edits the velocities map. Updates the displayed number of velociti...
Definition: TrafficDisplayPresenter.cpp:52
TrafficDisplayPresenter::setPlatoonRatesView
void setPlatoonRatesView()
Slot which is called when the user edits the platoon reates map. Updates the displayed number of plat...
Definition: TrafficDisplayPresenter.cpp:45
TrafficDisplayPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model (interface) which is read by this presenter
Definition: TrafficDisplayPresenter.h:128
TrafficDisplayPresenter::trafficDisplayView
TrafficDisplayView * trafficDisplayView
a pointer to the display view whose content is managed by this presenter
Definition: TrafficDisplayPresenter.h:129
TrafficDisplayPresenter::updateView
void updateView()
Method which sets all displayed values according to the model data. Will be called after loading a co...
Definition: TrafficDisplayPresenter.cpp:77
TrafficDisplayPresenter::setVolumesView
void setVolumesView()
Slot which is called when the user edits the traffic volumes map. Updates the displayed number of tra...
Definition: TrafficDisplayPresenter.cpp:39
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficDisplayView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
TrafficDisplayView.h File Reference
Traffic Simulation Plugin

This class provides a display for a quick overview of the traffic configuration. More...

Detailed Description

This class provides a display for a quick overview of the traffic configuration.

It contains an #ui object describing the views appearence (defined in TrafficDisplayView.ui). This ui object comprises a form layout with labels showing the configuration that has been edited by TrafficView, i.e. the number of traffic parameters and lane agent profiles. The frame of the view can be coloured in order to notify the user whether the configuration is complete or not.

Definition in file TrafficDisplayView.h.

Go to the source code of this file.

Classes

class TrafficDisplayView
This class provides a display for a quick overview of the traffic configuration. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficDisplayView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficDisplayView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
22 #ifndef TRAFFICDISPLAYVIEW_H
23 #define TRAFFICDISPLAYVIEW_H
24
25 #include <QMap>
26
27 #include "WidgetView.h"
28
29 namespace Ui {
30 class TrafficDisplayView;
31 }
32
33 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
42 class TrafficDisplayView : public WidgetView
43 {
44 Q_OBJECT
45
46 public:
47 enum class StatusType {
48 Error = 0,
49 OK = 1,
50 Warning = 2
51 };
52
53 public:
54 explicit TrafficDisplayView(QWidget *parent = 0);
55 ~TrafficDisplayView();
56
57 public:
58 //-----------------------------------------------------------------------------
62 //-----------------------------------------------------------------------------
63 void setTrafficName(QString name);
64
65 //-----------------------------------------------------------------------------
69 //-----------------------------------------------------------------------------
70 void setVolumes(int number);
71
72 //-----------------------------------------------------------------------------
76 //-----------------------------------------------------------------------------
77 void setPlatoonRates(int number);
78
79 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 void setVelocities(int number);
85
86 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 void setHomogeneities(int number);
92
93 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 void setRegularLaneAgents(int number);
99
100 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
105 void setRightmostLaneAgents(int number);
106
107 //-----------------------------------------------------------------------------
113 //-----------------------------------------------------------------------------
114 void setStatus(StatusType status, QString message);
115
116 private:
117 QMap<StatusType, QString> color;
118 Ui::TrafficDisplayView *ui;
119 };
120
121 #endif // TRAFFICDISPLAYVIEW_H
TrafficDisplayView::setHomogeneities
void setHomogeneities(int number)
Method for setting the displayed number of homogeneities.
Definition: TrafficDisplayView.cpp:61
TrafficDisplayView::color
QMap< StatusType, QString > color
a color map which determines the color code according to the status type
Definition: TrafficDisplayView.h:117
TrafficDisplayView::setPlatoonRates
void setPlatoonRates(int number)
Method for setting the displayed number of platoon rates.
Definition: TrafficDisplayView.cpp:51
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
TrafficDisplayView::setStatus
void setStatus(StatusType status, QString message)
Method which determines the frame color according to the status type passed as a first argument...
Definition: TrafficDisplayView.cpp:76
TrafficDisplayView::setRegularLaneAgents
void setRegularLaneAgents(int number)
Method for setting the displayed number of regular lane agents.
Definition: TrafficDisplayView.cpp:66
TrafficDisplayView::setVelocities
void setVelocities(int number)
Method for setting the displayed number of velocities.
Definition: TrafficDisplayView.cpp:56
TrafficDisplayView::StatusType
StatusType
Definition: TrafficDisplayView.h:47
TrafficDisplayView::StatusType::Error
enum class for classifying the status (will be used to determine the color of the frame) ...
TrafficDisplayView
This class provides a display for a quick overview of the traffic configuration.
Definition: TrafficDisplayView.h:42
TrafficDisplayView::setVolumes
void setVolumes(int number)
Method for setting the displayed number of traffic volumes.
Definition: TrafficDisplayView.cpp:46
TrafficDisplayView::ui
Ui::TrafficDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: TrafficDisplayView.h:118
TrafficDisplayView::setTrafficName
void setTrafficName(QString name)
Method for setting the name which should be displayed for the traffic configuration.
Definition: TrafficDisplayView.cpp:40
TrafficDisplayView::setRightmostLaneAgents
void setRightmostLaneAgents(int number)
Method for setting the displayed number of rightmost lane agents.
Definition: TrafficDisplayView.cpp:71
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
Classes
TrafficInterface.h File Reference
Traffic Simulation Plugin

The Traffic Interface provides setter and getter methods for the combination XML subelements listed under the <TrafficConfig> element. More...

Detailed Description

The Traffic Interface provides setter and getter methods for the combination XML subelements listed under the <TrafficConfig> element.

These comprise the maps for registering traffic volumes, platoon rates, velocities, homogeneities as well as for managing the distribution of agents on regular lanes and the rightmost lane. The corresponding maps are defined by the template class called TrafficItemMapInterface, whereas the aforementioned objects are defined in the class TrafficItemInterface.

Definition in file TrafficInterface.h.

Go to the source code of this file.

Classes

class TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed under the <TrafficConfig> element. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
TrafficInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
23
24 #ifndef TRAFFICINTERFACE_H
25 #define TRAFFICINTERFACE_H
26
27 #include "openPASS-TrafficSimulation/TrafficItemMapInterface.h"
28
29 #include <QObject>
30
31 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
41 class TrafficInterface : public QObject
42 {
43 Q_OBJECT
44
45 public:
46 using Name = QString;
47 using Volumes = TrafficItemMapInterface;
48 using PlatoonRates = TrafficItemMapInterface;
49 using Velocities = TrafficItemMapInterface;
50 using Homogeneities = TrafficItemMapInterface;
51 using TrafficAgents = TrafficItemMapInterface;
52 using Status = bool;
53
54
55 public:
56 explicit TrafficInterface(QObject *parent = nullptr)
57 : QObject(parent) {}
58 virtual ~TrafficInterface() = default;
59
60 Q_SIGNALS:
61 //-----------------------------------------------------------------------------
63 //-----------------------------------------------------------------------------
64 void modifiedName();
65
66 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 void edited();
70
71 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 void modifiedStatus();
75
76 public:
77 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 virtual void setName(Name const &_name) =0;
83
84 //-----------------------------------------------------------------------------
88 //-----------------------------------------------------------------------------
89 virtual Name getName() const =0;
90
91 public:
92 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 virtual Volumes * getVolumes() const =0;
98
99 //-----------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
104 virtual PlatoonRates * getPlatoonRates() const =0;
105
106 //-----------------------------------------------------------------------------
110 //-----------------------------------------------------------------------------
111 virtual Velocities * getVelocities() const =0;
112
113 //-----------------------------------------------------------------------------
117 //-----------------------------------------------------------------------------
118 virtual Homogeneities * getHomogeneities() const =0;
119
120 //-----------------------------------------------------------------------------
124 //-----------------------------------------------------------------------------
125 virtual TrafficAgents * getAgentsRegularLane() const =0;
126
127 //-----------------------------------------------------------------------------
131 //-----------------------------------------------------------------------------
132 virtual TrafficAgents * getAgentsRightMostLane() const =0;
133
134 public:
135 //-----------------------------------------------------------------------------
140 //-----------------------------------------------------------------------------
141 virtual void setStatus(Status const &_status) = 0;
142
143 //-----------------------------------------------------------------------------
147 //-----------------------------------------------------------------------------
148 virtual Status getStatus() const = 0;
149
150 };
151
152 #endif // TRAFFICINTERFACE_H
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficInterface::getVelocities
virtual Velocities * getVelocities() const =0
Returns the map for registering velocities.
TrafficInterface::Velocities
TrafficItemMapInterface Velocities
The map for registering velocities.
Definition: TrafficInterface.h:49
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficInterface::Name
QString Name
The name of the traffic configuration.
Definition: TrafficInterface.h:46
TrafficInterface::getVolumes
virtual Volumes * getVolumes() const =0
Returns the map for registering traffic volumes.
TrafficInterface::PlatoonRates
TrafficItemMapInterface PlatoonRates
The map for registering platoon rates.
Definition: TrafficInterface.h:48
TrafficInterface::setStatus
virtual void setStatus(Status const &_status)=0
Method for setting the status of the traffic configuration to the value passed as an argument...
TrafficInterface::edited
void edited()
Signal, emitted when the traffic configuration has been edited.
TrafficInterface::Status
bool Status
Type characterizing the status of the environment settings.
Definition: TrafficInterface.h:52
TrafficInterface::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const =0
Returns the map for registering platoon rates.
TrafficItemMapInterface.h
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
TrafficInterface::getHomogeneities
virtual Homogeneities * getHomogeneities() const =0
Returns the map for registering homogeneities.
TrafficInterface::Volumes
TrafficItemMapInterface Volumes
The map for registering traffic volumes.
Definition: TrafficInterface.h:47
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
TrafficInterface::setName
virtual void setName(Name const &_name)=0
Sets the name of the traffic setup to the one passed as an argument.
TrafficInterface::TrafficAgents
TrafficItemMapInterface TrafficAgents
The map for registering agent profiles.
Definition: TrafficInterface.h:51
TrafficInterface::getName
virtual Name getName() const =0
Returns the current name of the traffic setup.
TrafficInterface::getStatus
virtual Status getStatus() const =0
Method which returns the current status of the traffic settings.
TrafficInterface::modifiedStatus
void modifiedStatus()
Signal, emitted when the traffic&#39;s status has changed.
TrafficInterface::Homogeneities
TrafficItemMapInterface Homogeneities
The map for registering homogeneities.
Definition: TrafficInterface.h:50
TrafficInterface::modifiedName
void modifiedName()
Signal, emitted when the name of the traffic setup has been modified.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
Classes
TrafficItemInterface.h File Reference
Traffic Simulation Plugin

The Traffic Item Interface defines a general traffic parameter which can be incorporated into the traffic configuration setup. More...

Detailed Description

The Traffic Item Interface defines a general traffic parameter which can be incorporated into the traffic configuration setup.

A traffic parameter is defined by a value (generally a string) as well as a probability to be selected in a simulation run. This class provides setter and getter method for manipulating these properties.

Definition in file TrafficItemInterface.h.

Go to the source code of this file.

Classes

class TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the traffic configuration setup. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
TrafficItemInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
21
22 #ifndef TRAFFICITEMINTERFACE_H
23 #define TRAFFICITEMINTERFACE_H
24
25 #include <QObject>
26 #include <QString>
27
28 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
36 class TrafficItemInterface : public QObject
37 {
38
39 Q_OBJECT
40
41 public:
42 using Value = QString;
43 using Probability = double;
44
45 public:
46 explicit TrafficItemInterface(QObject *parent = 0)
47 : QObject(parent){}
48 virtual ~TrafficItemInterface() = default;
49
50 Q_SIGNALS:
51 //-----------------------------------------------------------------------------
53 //-----------------------------------------------------------------------------
54 void edited();
55
56 public:
57 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 virtual void setValue(Value const &_value) =0;
63
64 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 virtual Value getValue() const =0;
70
71 public:
72 //-----------------------------------------------------------------------------
76 //-----------------------------------------------------------------------------
77 virtual void setProbability(Probability const & _probability) =0;
78
79 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
85 virtual Probability getProbability() const =0;
86 };
87
88
89 #endif // TRAFFICITEMINTERFACE_H
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemInterface::Value
QString Value
the datatype for the traffic parameter&#39;s value (generally a string)
Definition: TrafficItemInterface.h:42
TrafficItemInterface::edited
void edited()
Signal emitted whenever an attribute of the traffic parameter has changed.
TrafficItemInterface::getProbability
virtual Probability getProbability() const =0
Returns the current probability of the traffic item&#39;s occurence.
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficItemInterface::getValue
virtual Value getValue() const =0
Returns the current value of the traffic item.
TrafficItemInterface::Probability
double Probability
the selection probability&#39;s datatype
Definition: TrafficItemInterface.h:43
TrafficItemInterface::setValue
virtual void setValue(Value const &_value)=0
Sets the traffic item&#39;s value to the value passed as an argument.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemMapInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
Classes
TrafficItemMapInterface.h File Reference
Traffic Simulation Plugin

The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be registered under a key identifier (ID). The traffic items are defined in the TrafficItemInterface class. More...

Detailed Description

The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be registered under a key identifier (ID). The traffic items are defined in the TrafficItemInterface class.

Definition in file TrafficItemMapInterface.h.

Go to the source code of this file.

Classes

class TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be registered under a key identifier (ID). The traffic items are defined in the TrafficItemInterface template class. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
TrafficItemMapInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19 #ifndef TRAFFICITEMMAPINTERFACE_H
20 #define TRAFFICITEMMAPINTERFACE_H
21
22 #include "TrafficItemInterface.h"
23
24 #include <QMap>
25 #include <QList>
26
27 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
33 class TrafficItemMapInterface : public QObject
34 {
35 Q_OBJECT
36
37 public:
38 using ID = unsigned int;
39 using Item = TrafficItemInterface;
40
41 public:
42 using Map = QMap<ID, Item *>;
43 using Iterator = Map::Iterator;
44 using ConstIterator = Map::ConstIterator;
45
46 public:
47 explicit TrafficItemMapInterface(QObject *parent = nullptr)
48 : QObject(parent){}
49 virtual ~TrafficItemMapInterface() = default;
50
51 Q_SIGNALS:
52 //-----------------------------------------------------------------------------
56 //-----------------------------------------------------------------------------
57 void edited();
58
59 public:
60 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
66 virtual TrafficItemMapInterface::Iterator begin() = 0;
67
68 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 virtual TrafficItemMapInterface::ConstIterator constBegin() const = 0;
76
77 public:
78 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 virtual TrafficItemMapInterface::Iterator end() = 0;
85
86 //-----------------------------------------------------------------------------
91 //-----------------------------------------------------------------------------
92 virtual TrafficItemMapInterface::ConstIterator constEnd() const = 0;
93
94 public:
95 //-----------------------------------------------------------------------------
106 //-----------------------------------------------------------------------------
107 virtual bool add(TrafficItemMapInterface::ID const & id,
108 TrafficItemInterface::Probability const & probability,
109 TrafficItemInterface::Value const & value) = 0;
110
111 //-----------------------------------------------------------------------------
119 //-----------------------------------------------------------------------------
120 virtual bool add(TrafficItemMapInterface::Item * const item) = 0;
121
122 public:
123 //-----------------------------------------------------------------------------
132 //-----------------------------------------------------------------------------
133 virtual bool remove(TrafficItemMapInterface::ID const & id) = 0;
134
135 //-----------------------------------------------------------------------------
144 //-----------------------------------------------------------------------------
145 virtual bool remove(TrafficItemMapInterface::Item * const item) = 0;
146
147 public:
148 //-----------------------------------------------------------------------------
156 //-----------------------------------------------------------------------------
157 virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const & id) const = 0;
158
159 //-----------------------------------------------------------------------------
167 //-----------------------------------------------------------------------------
168 virtual TrafficItemMapInterface::ID getID(TrafficItemMapInterface::Item * const item) const = 0;
169
170 public:
171 //-----------------------------------------------------------------------------
175 //-----------------------------------------------------------------------------
176 virtual TrafficItemMapInterface::ID generateID() const =0;
177
178 //-----------------------------------------------------------------------------
183 //-----------------------------------------------------------------------------
184 virtual bool contains (TrafficItemMapInterface::ID const & id) const =0;
185
186 //-----------------------------------------------------------------------------
190 //-----------------------------------------------------------------------------
191 virtual int count() const =0;
192
193 public:
194 //-----------------------------------------------------------------------------
196 //-----------------------------------------------------------------------------
197 virtual void clear() =0;
198
199 public:
200 //-----------------------------------------------------------------------------
205 //-----------------------------------------------------------------------------
206 virtual QList<ID> keys() const =0;
207
208 //-----------------------------------------------------------------------------
213 //-----------------------------------------------------------------------------
214 virtual QList<Item*> values() const =0;
215
216
217 };
218
219 #endif // TRAFFICITEMMAPINTERFACE_H
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapInterface::contains
virtual bool contains(TrafficItemMapInterface::ID const &id) const =0
Method tests whether the map contains an entry under the given ID.
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficItemMapInterface::getID
virtual TrafficItemMapInterface::ID getID(TrafficItemMapInterface::Item *const item) const =0
Method which returns the ID of the given traffic item, if contained in the map. Returns Qt&#39;s default-...
TrafficItemMapInterface::begin
virtual TrafficItemMapInterface::Iterator begin()=0
Gets an iterator pointing at the first traffic item in the map.
TrafficItemInterface::Value
QString Value
the datatype for the traffic parameter&#39;s value (generally a string)
Definition: TrafficItemInterface.h:42
TrafficItemMapInterface::Iterator
Map::Iterator Iterator
An iterator for searching within the map.
Definition: TrafficItemMapInterface.h:43
TrafficItemInterface.h
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
TrafficItemMapInterface::keys
virtual QList< ID > keys() const =0
Method which returns a list of all IDs used in the map. For the list, Qt&#39;s QList class is used...
TrafficItemMapInterface::count
virtual int count() const =0
Method which returns the number of items registered in the map.
TrafficItemInterface::Probability
double Probability
the selection probability&#39;s datatype
Definition: TrafficItemInterface.h:43
TrafficItemMapInterface::end
virtual TrafficItemMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last traffic item.
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficItemMapInterface::constEnd
virtual TrafficItemMapInterface::ConstIterator constEnd() const =0
Gets an iterator pointing at the end of the map after the last traffic item (use for read-only)...
TrafficItemMapInterface::generateID
virtual TrafficItemMapInterface::ID generateID() const =0
Method which returns the highest unoccupied ID of the map.
TrafficItemMapInterface::Map
QMap< ID, Item * > Map
The map for registering traffic items (using Qt&#39;s QMap class)
Definition: TrafficItemMapInterface.h:42
TrafficItemMapInterface::ConstIterator
Map::ConstIterator ConstIterator
A constant iterator (for reading only)
Definition: TrafficItemMapInterface.h:44
TrafficItemMapInterface::constBegin
virtual TrafficItemMapInterface::ConstIterator constBegin() const =0
Gets an iterator pointing at the first traffic item in the map (use for read-only since pointing at c...
TrafficItemMapInterface::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0
Method which creates a traffic item and registers it under the ID passed as a first argument...
TrafficItemMapInterface::clear
virtual void clear()=0
Method which clears the map and deletes all items.
TrafficItemMapInterface::edited
void edited()
Signal emitted when traffic items are added to or removed from this map. It is also connected to the ...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemMapModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
Classes
TrafficItemMapModel.h File Reference
Traffic Simulation Plugin

The TrafficItemMapModel class implements functionality of the TrafficItemMapInterface class. More...

Detailed Description

The TrafficItemMapModel class implements functionality of the TrafficItemMapInterface class.

Definition in file TrafficItemMapModel.h.

Go to the source code of this file.

Classes

class TrafficItemMapModel
The TrafficItemMapModel class implements functionality of the TrafficItemMapInterface class. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemMapModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficItemMapModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17
18 #ifndef TRAFFICITEMMAPMODEL_H
19 #define TRAFFICITEMMAPMODEL_H
20
21 #include "openPASS-TrafficSimulation/TrafficItemMapInterface.h"
22 #include "TrafficItemModel.h"
23
24 //-----------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------
28 class TrafficItemMapModel : public TrafficItemMapInterface
29 {
30 Q_OBJECT
31
32 public:
33 explicit TrafficItemMapModel(QObject *parent = 0);
34 ~TrafficItemMapModel() = default;
35
36
37 public:
38 virtual TrafficItemMapInterface::Iterator begin() override;
39 virtual TrafficItemMapInterface::ConstIterator constBegin() const override;
40
41 public:
42 virtual TrafficItemMapInterface::Iterator end() override;
43 virtual TrafficItemMapInterface::ConstIterator constEnd() const override;
44
45 public:
46 virtual bool add( TrafficItemMapInterface::ID const & id,
47 TrafficItemInterface::Probability const &probability,
48 TrafficItemInterface::Value const & value) override;
49
50 virtual bool add( TrafficItemMapInterface::Item * const item) override;
51
52 public:
53 virtual bool remove( TrafficItemMapInterface::ID const & id) override;
54 virtual bool remove( TrafficItemMapInterface::Item * const item) override;
55
56 public:
57 virtual TrafficItemMapInterface::Item * getItem( TrafficItemMapInterface::ID const & id) const override;
58 virtual TrafficItemMapInterface::ID getID( TrafficItemMapInterface::Item * const item) const override;
59
60 public:
61 virtual TrafficItemMapInterface::ID generateID() const;
62 virtual bool contains ( TrafficItemMapInterface::ID const & id) const override;
63 virtual int count() const override;
64
65 public:
66 virtual void clear() override;
67
68 public:
69 virtual QList< TrafficItemMapInterface::ID> keys() const override;
70 virtual QList< TrafficItemMapInterface::Item*> values() const override;
71
72 public:
73 TrafficItemMapInterface::Map map;
74
75 };
76
77 #endif // TRAFFICITEMMAPMODEL_H
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficItemMapModel::begin
virtual TrafficItemMapInterface::Iterator begin() override
Gets an iterator pointing at the first traffic item in the map.
Definition: TrafficItemMapModel.cpp:20
TrafficItemInterface::Value
QString Value
the datatype for the traffic parameter&#39;s value (generally a string)
Definition: TrafficItemInterface.h:42
TrafficItemMapModel::contains
virtual bool contains(TrafficItemMapInterface::ID const &id) const override
Method tests whether the map contains an entry under the given ID.
Definition: TrafficItemMapModel.cpp:130
TrafficItemMapModel::clear
virtual void clear() override
Method which clears the map and deletes all items.
Definition: TrafficItemMapModel.cpp:167
TrafficItemMapInterface::Iterator
Map::Iterator Iterator
An iterator for searching within the map.
Definition: TrafficItemMapInterface.h:43
TrafficItemMapModel::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value) override
Method which creates a traffic item and registers it under the ID passed as a first argument...
Definition: TrafficItemMapModel.cpp:44
TrafficItemMapModel::getID
virtual TrafficItemMapInterface::ID getID(TrafficItemMapInterface::Item *const item) const override
Method which returns the ID of the given traffic item, if contained in the map. Returns Qt&#39;s default-...
Definition: TrafficItemMapModel.cpp:124
TrafficItemMapModel::constEnd
virtual TrafficItemMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last traffic item (use for read-only)...
Definition: TrafficItemMapModel.cpp:38
TrafficItemMapModel::values
virtual QList< TrafficItemMapInterface::Item * > values() const override
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
Definition: TrafficItemMapModel.cpp:142
TrafficItemMapInterface.h
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
TrafficItemMapModel::generateID
virtual TrafficItemMapInterface::ID generateID() const
Method which returns the highest unoccupied ID of the map.
Definition: TrafficItemMapModel.cpp:147
TrafficItemMapModel::constBegin
virtual TrafficItemMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing at the first traffic item in the map (use for read-only since pointing at c...
Definition: TrafficItemMapModel.cpp:26
TrafficItemMapModel::count
virtual int count() const override
Method which returns the number of items registered in the map.
Definition: TrafficItemMapModel.cpp:161
TrafficItemMapModel::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const override
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
Definition: TrafficItemMapModel.cpp:113
TrafficItemInterface::Probability
double Probability
the selection probability&#39;s datatype
Definition: TrafficItemInterface.h:43
TrafficItemMapModel::keys
virtual QList< TrafficItemMapInterface::ID > keys() const override
Method which returns a list of all IDs used in the map. For the list, Qt&#39;s QList class is used...
Definition: TrafficItemMapModel.cpp:136
TrafficItemModel.h
The TrafficItemModel class implements functionality of the TrafficItemInterface class.
TrafficItemMapModel
The TrafficItemMapModel class implements functionality of the TrafficItemMapInterface class...
Definition: TrafficItemMapModel.h:28
TrafficItemMapInterface::Map
QMap< ID, Item * > Map
The map for registering traffic items (using Qt&#39;s QMap class)
Definition: TrafficItemMapInterface.h:42
TrafficItemMapInterface::ConstIterator
Map::ConstIterator ConstIterator
A constant iterator (for reading only)
Definition: TrafficItemMapInterface.h:44
TrafficItemMapModel::end
virtual TrafficItemMapInterface::Iterator end() override
Gets an iterator pointing at the end of the map after the last traffic item.
Definition: TrafficItemMapModel.cpp:32
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemMapPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
TrafficItemMapPresenter.h File Reference
Traffic Simulation Plugin

This class describes the presenter objects of the traffic parameter maps. More...

Detailed Description

This class describes the presenter objects of the traffic parameter maps.

In the spirit of Qt's Model/View framework it constitutes the wrapper class connecting the model data (TrafficItemMapInterface) to the interface defined in QAbstractTableModel. This interface can be utilized by instances of Qt's QTableView to display the map entries in a table format.

See https://doc.qt.io/qt-5/model-view-programming.html for Qt's model/view framework.

Definition in file TrafficItemMapPresenter.h.

Go to the source code of this file.

Classes

class TrafficItemMapPresenter
This class describes the presenter objects of the traffic parameter maps. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemMapPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
TrafficItemMapPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
26
27 #ifndef TRAFFICITEMMAPPRESENTER_H
28 #define TRAFFICITEMMAPPRESENTER_H
29
30 #include "openPASS-TrafficSimulation/TrafficItemMapInterface.h"
31
32 #include <QAbstractTableModel>
33 #include <QUndoCommand>
34
35 //-----------------------------------------------------------------------------
47 //-----------------------------------------------------------------------------
48 class TrafficItemMapPresenter : public QAbstractTableModel
49 {
50 Q_OBJECT
51
52 public:
53 explicit TrafficItemMapPresenter(TrafficItemMapInterface * const trafficItemMap,
54 QObject *parent = 0);
55
56 public:
57 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
70
71 //-----------------------------------------------------------------------------
79 //-----------------------------------------------------------------------------
80 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
81
82 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
92
93 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
102 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
103
104 //-----------------------------------------------------------------------------
113 //-----------------------------------------------------------------------------
114 virtual bool setData(const QModelIndex &index, const QVariant &value,
115 int role = Qt::EditRole) override;
116
117 //-----------------------------------------------------------------------------
124 //-----------------------------------------------------------------------------
125 virtual Qt::ItemFlags flags(const QModelIndex& index) const override;
126
127 public:
128 //-----------------------------------------------------------------------------
132 //-----------------------------------------------------------------------------
133 void addRow(const int &row, TrafficItemInterface::Value const & value, TrafficItemInterface::Probability const & probability);
134
135 //-----------------------------------------------------------------------------
143 //-----------------------------------------------------------------------------
144 bool removeRow(const int &row);
145
146 //-----------------------------------------------------------------------------
149 //-----------------------------------------------------------------------------
150 void update();
151
152 private:
153 TrafficItemMapInterface * const trafficItemMap;
154
155 private:
156 QMap<int, TrafficItemMapInterface::ID> RowToID;
157 QStringList _columnHeaders;
158
159 };
160
161 #endif // TRAFFICITEMMAPPRESENTER_H
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficItemMapPresenter::addRow
void addRow(const int &row, TrafficItemInterface::Value const &value, TrafficItemInterface::Probability const &probability)
Method that adds a new row, i.e. a new environment item to the edited component.
Definition: TrafficItemMapPresenter.cpp:108
TrafficItemMapPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: TrafficItemMapPresenter.cpp:47
TrafficItemInterface::Value
QString Value
the datatype for the traffic parameter&#39;s value (generally a string)
Definition: TrafficItemInterface.h:42
TrafficItemMapInterface.h
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
TrafficItemMapPresenter::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! ...
Definition: TrafficItemMapPresenter.cpp:102
TrafficItemInterface::Probability
double Probability
the selection probability&#39;s datatype
Definition: TrafficItemInterface.h:43
TrafficItemMapPresenter
This class describes the presenter objects of the traffic parameter maps.
Definition: TrafficItemMapPresenter.h:48
TrafficItemMapPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: TrafficItemMapPresenter.cpp:21
TrafficItemMapPresenter::removeRow
bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: TrafficItemMapPresenter.cpp:125
TrafficItemMapPresenter::setData
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: TrafficItemMapPresenter.cpp:71
TrafficItemMapPresenter::update
void update()
Method which updates the table according to the current entries of #environmentMap.
Definition: TrafficItemMapPresenter.cpp:145
TrafficItemMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: TrafficItemMapPresenter.cpp:32
TrafficItemMapPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: TrafficItemMapPresenter.cpp:40
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
Classes
TrafficItemModel.h File Reference
Traffic Simulation Plugin

The TrafficItemModel class implements functionality of the TrafficItemInterface class. More...

Detailed Description

The TrafficItemModel class implements functionality of the TrafficItemInterface class.

Definition in file TrafficItemModel.h.

Go to the source code of this file.

Classes

class TrafficItemModel
The TrafficItemModel class implements functionality of the TrafficItemInterface class. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficItemModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17 #ifndef TRAFFICITEMMODEL_H
18 #define TRAFFICITEMMODEL_H
19
20 #include "openPASS-TrafficSimulation/TrafficItemInterface.h"
21
22 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
26 class TrafficItemModel : public TrafficItemInterface
27 {
28
29 Q_OBJECT
30
31 public:
32 explicit TrafficItemModel(QObject *parent = 0);
33 ~TrafficItemModel() = default;
34
35
36 public:
37 virtual void setValue(Value const &_value) override;
38 virtual Value getValue() const override;
39
40 public:
41 virtual void setProbability(Probability const & _probability) override;
42 virtual Probability getProbability() const override;
43
44 public:
45 Value value;
46 Probability probability;
47 };
48
49 #endif // TRAFFICITEMMODEL_H
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemInterface::Value
QString Value
the datatype for the traffic parameter&#39;s value (generally a string)
Definition: TrafficItemInterface.h:42
TrafficItemInterface.h
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
TrafficItemModel
The TrafficItemModel class implements functionality of the TrafficItemInterface class.
Definition: TrafficItemModel.h:26
TrafficItemModel::value
Value value
the current value of the traffic parameter
Definition: TrafficItemModel.h:45
TrafficItemModel::getValue
virtual Value getValue() const override
Returns the current value of the traffic item.
Definition: TrafficItemModel.cpp:27
TrafficItemModel::setProbability
virtual void setProbability(Probability const &_probability) override
Sets the probability of the traffic item&#39;s occurence.
Definition: TrafficItemModel.cpp:33
TrafficItemInterface::Probability
double Probability
the selection probability&#39;s datatype
Definition: TrafficItemInterface.h:43
TrafficItemModel::getProbability
virtual Probability getProbability() const override
Returns the current probability of the traffic item&#39;s occurence.
Definition: TrafficItemModel.cpp:41
TrafficItemModel::setValue
virtual void setValue(Value const &_value) override
Sets the traffic item&#39;s value to the value passed as an argument.
Definition: TrafficItemModel.cpp:19
TrafficItemModel::probability
Probability probability
the selection probability of the traffic parameter
Definition: TrafficItemModel.h:46
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
TrafficItemView.h File Reference
Traffic Simulation Plugin

This class defines a general view for a traffic item, which can be a volume, platoon rate, velocity, homogeneity or an agent profile. More...

Detailed Description

This class defines a general view for a traffic item, which can be a volume, platoon rate, velocity, homogeneity or an agent profile.

A traffic item generally has a value (depending on the type) and a probability view. The latter is always a double spinbox, whereas the former constitutes a spinbox if the value is an integer or a double (volumes, platoon rates, velocites, homogeneities) or a label if the value is a string (agent profile).

Definition in file TrafficItemView.h.

Go to the source code of this file.

Classes

class TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate, velocity, homogeneity or an agent profile. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficItemView.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
11 //-----------------------------------------------------------------------------
12 #ifndef TRAFFICITEMVIEW_H
13 #define TRAFFICITEMVIEW_H
14
15 #include "WidgetView.h"
16
17 namespace Ui {
18 class TrafficItemView;
19 }
20
21 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
30 class TrafficItemView : public WidgetView
31 {
32 Q_OBJECT
33
34 public:
35 enum class Type{
36 Volume = 1,
37 PlatoonRate = 2,
38 Velocity = 3,
39 Homogeneity = 4,
40 Agent = 5,
41 };
42
43 public:
44 explicit TrafficItemView(Type type,
45 unsigned int ID,
46 int index,
47 QWidget *parent= 0);
48
49 ~TrafficItemView();
50
51 Q_SIGNALS:
52 //-----------------------------------------------------------------------------
55 //-----------------------------------------------------------------------------
56 void valueChanged(unsigned int ID, QString value, Type type);
57
58 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 void remove(unsigned int ID, Type type);
63
64 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 void probabilityChanged(unsigned int ID, double value, Type type);
69
70 protected Q_SLOTS:
71 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
75 void on_remove_clicked();
76
77 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
81 void on_probabilityValue_editingFinished();
82
83 //-----------------------------------------------------------------------------
88 //-----------------------------------------------------------------------------
89 void valueView_valueChanged(QString const & value);
90
91 public:
92 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 unsigned int getID() const;
98
99 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
105 int getIndex() const;
106
107 //-----------------------------------------------------------------------------
112 //-----------------------------------------------------------------------------
113 Type getType() const;
114
115 //-----------------------------------------------------------------------------
119 //-----------------------------------------------------------------------------
120 QString getValue() const;
121
122 //-----------------------------------------------------------------------------
126 //-----------------------------------------------------------------------------
127 double getProbability() const;
128
129 public:
130 //-----------------------------------------------------------------------------
135 //-----------------------------------------------------------------------------
136 void setValue(QString value);
137
138 //-----------------------------------------------------------------------------
143 //-----------------------------------------------------------------------------
144 void setProbability(double value);
145
146 //-----------------------------------------------------------------------------
151 //-----------------------------------------------------------------------------
152 void setIndex(int newIndex);
153
154
155 private:
156 unsigned int ID;
157 int index;
158 Type type;
159 Ui::TrafficItemView *ui;
160
161 };
162
163 #endif // TRAFFICITEMVIEW_H
TrafficItemView::setProbability
void setProbability(double value)
Method which sets the displayed probability of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:192
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
TrafficItemView::getValue
QString getValue() const
Method which returns the value of the traffic item.
Definition: TrafficItemView.cpp:214
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficItemView::getIndex
int getIndex() const
Method which returns the index of the traffic item. Items will be numerated in the order they appear ...
Definition: TrafficItemView.cpp:151
TrafficItemView::ui
Ui::TrafficItemView * ui
the ui object containing all visualization elements of the traffic item view
Definition: TrafficItemView.h:159
TrafficItemView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, Type type)
Signal, emitted when probability of the traffic item has been modified by the user. Transmits the ID, probability value and type of the item.
TrafficItemView::on_remove_clicked
void on_remove_clicked()
Qt Desinger-created slot activated when the remove button has been clicked. Emits the remove signal...
Definition: TrafficItemView.cpp:131
TrafficItemView::Type
Type
Definition: TrafficItemView.h:35
TrafficItemView::index
int index
the numeration index of the traffic item (changes, e.g., if traffic items in the list are removed) ...
Definition: TrafficItemView.h:157
TrafficItemView::getProbability
double getProbability() const
Method which returns the probability of the traffic item.
Definition: TrafficItemView.cpp:197
TrafficItemView::setValue
void setValue(QString value)
Method which sets the displayed value of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:158
TrafficItemView::getType
Type getType() const
Method which returns the type of the traffic item. The types are defined by the enum class Type...
Definition: TrafficItemView.cpp:209
TrafficItemView::ID
unsigned int ID
the ID of the traffic item
Definition: TrafficItemView.h:156
TrafficItemView::Type::Volume
An enum class defining the type of the traffic item.
TrafficItemView::getID
unsigned int getID() const
Method which returns the ID of the traffic item.
Definition: TrafficItemView.cpp:146
TrafficItemView::setIndex
void setIndex(int newIndex)
Method which sets the displayed index of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:202
TrafficItemView::valueChanged
void valueChanged(unsigned int ID, QString value, Type type)
Signal, emitted when the value of the traffic item has been changed. Transmits the ID...
TrafficItemView::valueView_valueChanged
void valueView_valueChanged(QString const &value)
A slot which is activated when the value of the traffic item has been edited by the user...
Definition: TrafficItemView.cpp:136
TrafficItemView::type
Type type
the type of the traffic item
Definition: TrafficItemView.h:158
TrafficItemView::on_probabilityValue_editingFinished
void on_probabilityValue_editingFinished()
Qt Desinger-created slot activated when the probability value of the double spinbox has been edited b...
Definition: TrafficItemView.cpp:141
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficLanesPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
TrafficLanesPresenter.h File Reference
Traffic Simulation Plugin

This class defines the presenter object which handles events coming from the view (TrafficLanesView) and edits the model accordingly (TrafficInterface). More...

Detailed Description

This class defines the presenter object which handles events coming from the view (TrafficLanesView) and edits the model accordingly (TrafficInterface).

More specifically, it manages the user interactions for the assignment of agent profiles to traffic lanes

Note
This presenter class emits signals after editing the model which are noticed by the TrafficDisplayPresenter class. Normally, these signals should be emitted by the model itself but since it invokes template class instances, for which Qt does not support the signal-slot mechanism, signals are exceptionally handled by this presenter class.

Definition in file TrafficLanesPresenter.h.

Go to the source code of this file.

Classes

class TrafficLanesPresenter
This class defines the presenter object which handles events coming from the view (TrafficLanesView) and edits the model accordingly (TrafficInterface). More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficLanesPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
TrafficLanesPresenter.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
14 //-----------------------------------------------------------------------------
15 #ifndef TRAFFICLANESPRESENTER_H
16 #define TRAFFICLANESPRESENTER_H
17
18 #include "openPASS-TrafficSimulation/TrafficInterface.h"
19
20 #include "Views/TrafficLanesView.h"
21
22 #include <QObject>
23
24 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
36 class TrafficLanesPresenter : public QObject
37 {
38 Q_OBJECT
39 public:
40 explicit TrafficLanesPresenter(QList<QString> * agentProfiles,
41 TrafficInterface *traffic,
42 TrafficLanesView *trafficLanesView,
43 QObject *parent = 0);
44 Q_SIGNALS:
45 //-----------------------------------------------------------------------------
48 //-----------------------------------------------------------------------------
49 void RegularLaneAgent_added();
50
51 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 void RegularLaneAgent_removed();
56
57 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 void RegularLaneAgent_probabilityChanged();
62
63 //-----------------------------------------------------------------------------
66 //-----------------------------------------------------------------------------
67 void RightmostLaneAgent_added();
68
69 //-----------------------------------------------------------------------------
72 //-----------------------------------------------------------------------------
73 void RightmostLaneAgent_removed();
74
75 //-----------------------------------------------------------------------------
78 //-----------------------------------------------------------------------------
79 void RightmostLaneAgent_probabilityChanged();
80
81 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
85 void cleared();
86
87 private Q_SLOTS:
88 //-----------------------------------------------------------------------------
95 //-----------------------------------------------------------------------------
96 void addRegularLaneAgent(QString const &name);
97
98 //-----------------------------------------------------------------------------
105 //-----------------------------------------------------------------------------
106 void addRightmostLaneAgent(QString const &name);
107
108 //-----------------------------------------------------------------------------
115 //-----------------------------------------------------------------------------
116 void removeRegularLaneAgent(unsigned int id);
117
118 //-----------------------------------------------------------------------------
125 //-----------------------------------------------------------------------------
126 void removeRightmostLaneAgent(unsigned int id);
127
128 private Q_SLOTS:
129 //-----------------------------------------------------------------------------
137 //-----------------------------------------------------------------------------
138 void setRegularLaneAgentProbability(unsigned int id, double value);
139
140 //-----------------------------------------------------------------------------
148 //-----------------------------------------------------------------------------
149 void setRightmostLaneAgentProbability(unsigned int id, double value);
150
151
152 public:
153 //-----------------------------------------------------------------------------
157 //-----------------------------------------------------------------------------
158 void clearAgentSelectionView();
159
160 void setAgentSelectionViews(const QStringList &names);
161
162 private Q_SLOTS:
163 //-----------------------------------------------------------------------------
169 //-----------------------------------------------------------------------------
170 void removeRightmostLaneAgentByName(QString name);
171
172 //-----------------------------------------------------------------------------
178 //-----------------------------------------------------------------------------
179 void removeRegularLaneAgentByName(QString name);
180
181
182 public:
183 //-----------------------------------------------------------------------------
187 //-----------------------------------------------------------------------------
188 void updateView();
189
190 private:
191 QList<QString> * agentProfiles;
192 TrafficInterface * traffic;
193 TrafficLanesView *trafficLanesView;
194 };
195
196 #endif // TRAFFICLANESPRESENTER_H
TrafficLanesPresenter
This class defines the presenter object which handles events coming from the view (TrafficLanesView) ...
Definition: TrafficLanesPresenter.h:36
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficLanesPresenter::RegularLaneAgent_added
void RegularLaneAgent_added()
Signal, emitted when an agent profile has been added to a regular lane in the model.
TrafficLanesPresenter::removeRegularLaneAgentByName
void removeRegularLaneAgentByName(QString name)
Slot which acts as removeRegularLaneAgent but uses a name instead of the ID. This slot is connected t...
Definition: TrafficLanesPresenter.cpp:111
TrafficLanesPresenter::removeRightmostLaneAgent
void removeRightmostLaneAgent(unsigned int id)
Slot which is triggered when the remove-button has been clicked for a rightmost lane agent view...
Definition: TrafficLanesPresenter.cpp:67
TrafficLanesPresenter::RightmostLaneAgent_removed
void RightmostLaneAgent_removed()
Signal, emitted when an agent profile has been removed from the rightmost lane in the model...
TrafficLanesView
This class defines the editor widget for assigning agent profiles to regular and rightmost lanes...
Definition: TrafficLanesView.h:33
TrafficLanesPresenter::clearAgentSelectionView
void clearAgentSelectionView()
Slot which is triggered when the map of available agent profiles (Agent Configuration Plugin) has bee...
Definition: TrafficLanesPresenter.cpp:102
TrafficLanesPresenter::removeRightmostLaneAgentByName
void removeRightmostLaneAgentByName(QString name)
Slot which acts as removeRightmostLaneAgent but uses a name instead of the ID. This slot is connected...
Definition: TrafficLanesPresenter.cpp:127
TrafficLanesPresenter::cleared
void cleared()
Signal, emitted when the whole configuration has been cleared, i.e. all agent profiles have been remo...
TrafficLanesPresenter::RegularLaneAgent_probabilityChanged
void RegularLaneAgent_probabilityChanged()
Signal, emitted when the probability of a regular lane agent&#39;s profile has been changed in the model...
TrafficLanesPresenter::setRegularLaneAgentProbability
void setRegularLaneAgentProbability(unsigned int id, double value)
Slot which is triggered when the displayed probability value of a regular lane agent has been edited ...
Definition: TrafficLanesPresenter.cpp:77
TrafficInterface.h
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
TrafficLanesPresenter::setRightmostLaneAgentProbability
void setRightmostLaneAgentProbability(unsigned int id, double value)
Slot which is triggered when the displayed probability value of a rightmost lane agent has been edite...
Definition: TrafficLanesPresenter.cpp:86
TrafficLanesPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model edited by this presenter
Definition: TrafficLanesPresenter.h:192
TrafficLanesPresenter::RightmostLaneAgent_added
void RightmostLaneAgent_added()
Signal, emitted when an agent profile has been added to the rightmost lane in the model...
TrafficLanesPresenter::RightmostLaneAgent_probabilityChanged
void RightmostLaneAgent_probabilityChanged()
Signal, emitted when the probability of a rightmost lane agent&#39;s profile has been changed in the mode...
TrafficLanesPresenter::addRightmostLaneAgent
void addRightmostLaneAgent(QString const &name)
Slot which is triggered when the add-button has been clicked in the rightmost lane section of Traffic...
Definition: TrafficLanesPresenter.cpp:40
TrafficLanesPresenter::removeRegularLaneAgent
void removeRegularLaneAgent(unsigned int id)
Slot which is triggered when the remove-button has been clicked for a regular lane agent view...
Definition: TrafficLanesPresenter.cpp:57
TrafficLanesPresenter::RegularLaneAgent_removed
void RegularLaneAgent_removed()
Signal, emitted when an agent profile has been removed from a regular lane in the model...
TrafficLanesView.h
This class defines the editor widget for assigning agent profiles to regular and rightmost lanes...
TrafficLanesPresenter::addRegularLaneAgent
void addRegularLaneAgent(QString const &name)
Slot which is triggered when the add-button has been clicked in the regular lanes section of TrafficL...
Definition: TrafficLanesPresenter.cpp:23
TrafficLanesPresenter::trafficLanesView
TrafficLanesView * trafficLanesView
a pointer to the editor view whose user events are managed by this presenter
Definition: TrafficLanesPresenter.h:193
TrafficLanesPresenter::updateView
void updateView()
Method which updates the whole TrafficLanesView widget to display the entire model configuration...
Definition: TrafficLanesPresenter.cpp:144
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficLanesView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
TrafficLanesView.h File Reference
Traffic Simulation Plugin

This class defines the editor widget for assigning agent profiles to regular and rightmost lanes. More...

Detailed Description

This class defines the editor widget for assigning agent profiles to regular and rightmost lanes.

It consists of an ui element (TrafficLanesView.ui) with two sections, one for listing agent profiles assigned to regular lanes and one for the rightmost lane. In these sections, the editor views for the agent profiles and their probabilities of occurence can be inserted upon pressing the corresponding add-buttons.

Definition in file TrafficLanesView.h.

Go to the source code of this file.

Classes

class TrafficLanesView
This class defines the editor widget for assigning agent profiles to regular and rightmost lanes. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficLanesView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficLanesView.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
12 //-----------------------------------------------------------------------------
13
14 #ifndef TRAFFICLANESVIEW_H
15 #define TRAFFICLANESVIEW_H
16
17 #include "WidgetView.h"
18
19 namespace Ui {
20 class TrafficLanesView;
21 }
22
23 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
33 class TrafficLanesView : public WidgetView
34 {
35 Q_OBJECT
36
37 public:
38 explicit TrafficLanesView(QWidget *parent = 0);
39 ~TrafficLanesView();
40
41 Q_SIGNALS:
42 //-----------------------------------------------------------------------------
44 //-----------------------------------------------------------------------------
45 void resized();
46
47 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
52 void addRightmostLaneAgent(QString const &name);
53
54 //-----------------------------------------------------------------------------
58 //-----------------------------------------------------------------------------
59 void addRegularLaneAgent(QString const &name);
60
61 //-----------------------------------------------------------------------------
64 //-----------------------------------------------------------------------------
65 void removeRightmostLaneAgent(unsigned int id);
66
67 //-----------------------------------------------------------------------------
70 //-----------------------------------------------------------------------------
71 void removeRegularLaneAgent(unsigned int id);
72
73 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 void RegularLaneAgent_probabilityChanged(unsigned int id, double value);
79
80 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
85 void RightmostLaneAgent_probabilityChanged(unsigned int id, double value);
86
87 private Q_SLOTS:
88 //-----------------------------------------------------------------------------
91 //-----------------------------------------------------------------------------
92 void on_addRightmostLaneAgent_clicked();
93
94 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 void on_addRegularLaneAgent_clicked();
99
100 public:
101 //-----------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------
108 void setAgentSelectionItems(const QStringList &items);
109
110 public:
111 //-----------------------------------------------------------------------------
121 //-----------------------------------------------------------------------------
122 void addRegularLaneAgentView(unsigned int id, QString name, double probability);
123
124 //-----------------------------------------------------------------------------
134 //-----------------------------------------------------------------------------
135 void addRightmostLaneAgentView(unsigned int id, QString name, double probability);
136
137 //-----------------------------------------------------------------------------
143 //-----------------------------------------------------------------------------
144 void removeRegularLaneAgentView(unsigned int id);
145
146 //-----------------------------------------------------------------------------
152 //-----------------------------------------------------------------------------
153 void removeRightmostLaneAgentView(unsigned int id);
154
155 //-----------------------------------------------------------------------------
158 //-----------------------------------------------------------------------------
159 void clearTrafficLanesView();
160
161 public:
162 //-----------------------------------------------------------------------------
169 //-----------------------------------------------------------------------------
170 void setRegularLaneAgentProbability(unsigned int id, double value);
171
172 //-----------------------------------------------------------------------------
179 //-----------------------------------------------------------------------------
180 void setRightmostLaneAgentProbability(unsigned int id, double value);
181
182 private:
183 //-----------------------------------------------------------------------------
186 //-----------------------------------------------------------------------------
187 void resizeEvent(QResizeEvent *event);
188
189
190 private:
191 Ui::TrafficLanesView *ui;
192 int initialHeight;
193 };
194
195 #endif // TRAFFICLANESVIEW_H
TrafficLanesView::setRegularLaneAgentProbability
void setRegularLaneAgentProbability(unsigned int id, double value)
Method which sets the display value of the probability for the regular lane agent profile specified b...
Definition: TrafficLanesView.cpp:117
TrafficLanesView::initialHeight
int initialHeight
The initial height (empty form) of this view.
Definition: TrafficLanesView.h:192
Ui
Definition: EnvironmentDisplayView.h:29
TrafficLanesView::addRegularLaneAgent
void addRegularLaneAgent(QString const &name)
Signal, emitted when the add button in the regula lane agents section is clicked. Transmits the name ...
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
TrafficLanesView
This class defines the editor widget for assigning agent profiles to regular and rightmost lanes...
Definition: TrafficLanesView.h:33
TrafficLanesView::RightmostLaneAgent_probabilityChanged
void RightmostLaneAgent_probabilityChanged(unsigned int id, double value)
Signal, emitted when the probability of a particular rightmost lane agent is modified by the user...
TrafficLanesView::addRegularLaneAgentView
void addRegularLaneAgentView(unsigned int id, QString name, double probability)
Method which creates an editor view for a regular lane agent profile and inserts it into the correspo...
Definition: TrafficLanesView.cpp:48
TrafficLanesView::addRightmostLaneAgent
void addRightmostLaneAgent(QString const &name)
Signal, emitted when the add button in the rightmost lane agents section is clicked. Transmits the name of the agent profile currently selected in the combobox.
TrafficLanesView::removeRegularLaneAgent
void removeRegularLaneAgent(unsigned int id)
Signal, emitted when the remove button of a particular regular lane agent profile is clicked...
TrafficLanesView::setAgentSelectionItems
void setAgentSelectionItems(const QStringList &items)
Method which fills the comboboxes for agent profile selections with the string list passed as an argu...
Definition: TrafficLanesView.cpp:100
TrafficLanesView::RegularLaneAgent_probabilityChanged
void RegularLaneAgent_probabilityChanged(unsigned int id, double value)
Signal, emitted when the probability of a particular regular lane agent is modified by the user...
TrafficLanesView::ui
Ui::TrafficLanesView * ui
The ui object containing all visualization elements.
Definition: TrafficLanesView.h:191
TrafficLanesView::on_addRightmostLaneAgent_clicked
void on_addRightmostLaneAgent_clicked()
Qt Desinger-created slot activated when the add-button in the rightmost lane section is clicked...
Definition: TrafficLanesView.cpp:22
TrafficLanesView::on_addRegularLaneAgent_clicked
void on_addRegularLaneAgent_clicked()
Qt Desinger-created slot activated when the add-button in the regula lanes section is clicked...
Definition: TrafficLanesView.cpp:27
TrafficLanesView::setRightmostLaneAgentProbability
void setRightmostLaneAgentProbability(unsigned int id, double value)
Method which sets the display value of the probability for the rightmost lane agent profile specified...
Definition: TrafficLanesView.cpp:126
TrafficLanesView::resized
void resized()
Signal, emitted when this view is resized.
TrafficLanesView::resizeEvent
void resizeEvent(QResizeEvent *event)
Reimplementation of the resize event. Emits the resized signal when this view is resized.
Definition: TrafficLanesView.cpp:109
TrafficLanesView::removeRightmostLaneAgent
void removeRightmostLaneAgent(unsigned int id)
Signal, emitted when the remove button of a particular rightmost lane agent profile is clicked...
TrafficLanesView::removeRightmostLaneAgentView
void removeRightmostLaneAgentView(unsigned int id)
Method which removes the editor view for a rightmost lane agent profile specified by the ID passed as...
Definition: TrafficLanesView.cpp:81
TrafficLanesView::removeRegularLaneAgentView
void removeRegularLaneAgentView(unsigned int id)
Method which removes the editor view for a regular lane agent profile specified by the ID passed as a...
Definition: TrafficLanesView.cpp:62
TrafficLanesView::addRightmostLaneAgentView
void addRightmostLaneAgentView(unsigned int id, QString name, double probability)
Method which creates an editor view for a rightmost lane agent profile and inserts it into the corres...
Definition: TrafficLanesView.cpp:32
TrafficLanesView::clearTrafficLanesView
void clearTrafficLanesView()
Method which deletes all existing editor views for both, regular and rightmost lanes. Resizes the entire view (this class) to its initial size.
Definition: TrafficLanesView.cpp:135
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
Classes
TrafficModel.h File Reference
Traffic Simulation Plugin

The TrafficModel class implements the functionality of the TrafficInterface class. More...

Detailed Description

The TrafficModel class implements the functionality of the TrafficInterface class.

Definition in file TrafficModel.h.

Go to the source code of this file.

Classes

class TrafficModel
The TrafficModel class implements the functionality of the TrafficInterface class. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17
18 #ifndef TRAFFICMODEL_H
19 #define TRAFFICMODEL_H
20
21 #include "openPASS-TrafficSimulation/TrafficInterface.h"
22
23 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
27 class TrafficModel : public TrafficInterface
28 {
29 Q_OBJECT
30
31
32 public:
33 TrafficModel(QObject *parent = nullptr);
34 virtual ~TrafficModel() override;
35
36 public:
37 virtual void setName(Name const &_name) override;
38 virtual Name getName() const override;
39
40 public:
41 virtual Volumes * getVolumes() const override;
42 virtual PlatoonRates * getPlatoonRates() const override;
43 virtual Velocities * getVelocities() const override;
44 virtual Homogeneities * getHomogeneities() const override;
45 virtual TrafficAgents * getAgentsRegularLane() const override;
46 virtual TrafficAgents * getAgentsRightMostLane() const override;
47
48 public:
49 virtual void setStatus(Status const &_status) override;
50 virtual Status getStatus() const override;
51
52 public:
53 Name name;
54 Volumes * const volumes;
55 PlatoonRates * const platoonRates;
56 Velocities * const velocities;
57 Homogeneities * const homogeneities;
58 TrafficAgents * const agentsRegularLane;
59 TrafficAgents * const agentsRightMostLane;
60 Status status;
61 };
62
63 #endif // TRAFFICMODEL_H
TrafficModel::getStatus
virtual Status getStatus() const override
Method which returns the current status of the traffic settings.
Definition: TrafficModel.cpp:92
TrafficModel::volumes
Volumes *const volumes
the map of traffic volumes
Definition: TrafficModel.h:54
TrafficModel::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const override
Returns the map for registering agent profiles for the rightmost lane.
Definition: TrafficModel.cpp:76
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficInterface::Velocities
TrafficItemMapInterface Velocities
The map for registering velocities.
Definition: TrafficInterface.h:49
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficModel::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const override
Returns the map for registering platoon rates.
Definition: TrafficModel.cpp:61
TrafficInterface::Name
QString Name
The name of the traffic configuration.
Definition: TrafficInterface.h:46
TrafficModel::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const override
Returns the map for registering agent profiles for regular lanes.
Definition: TrafficModel.cpp:81
TrafficModel::setStatus
virtual void setStatus(Status const &_status) override
Method for setting the status of the traffic configuration to the value passed as an argument...
Definition: TrafficModel.cpp:86
TrafficModel::name
Name name
the name of the traffic configuration
Definition: TrafficModel.h:53
TrafficModel
The TrafficModel class implements the functionality of the TrafficInterface class.
Definition: TrafficModel.h:27
TrafficInterface::Status
bool Status
Type characterizing the status of the environment settings.
Definition: TrafficInterface.h:52
TrafficModel::getVolumes
virtual Volumes * getVolumes() const override
Returns the map for registering traffic volumes.
Definition: TrafficModel.cpp:56
TrafficModel::status
Status status
the current status of the settings. "true" means that the configuration is principally ready for simu...
Definition: TrafficModel.h:60
TrafficModel::getName
virtual Name getName() const override
Returns the current name of the traffic setup.
Definition: TrafficModel.cpp:45
TrafficInterface::Volumes
TrafficItemMapInterface Volumes
The map for registering traffic volumes.
Definition: TrafficInterface.h:47
TrafficModel::setName
virtual void setName(Name const &_name) override
Sets the name of the traffic setup to the one passed as an argument.
Definition: TrafficModel.cpp:50
TrafficInterface.h
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
TrafficModel::agentsRightMostLane
TrafficAgents *const agentsRightMostLane
the map of traffic agents driving on the rightmost lane
Definition: TrafficModel.h:59
TrafficInterface::TrafficAgents
TrafficItemMapInterface TrafficAgents
The map for registering agent profiles.
Definition: TrafficInterface.h:51
TrafficModel::agentsRegularLane
TrafficAgents *const agentsRegularLane
the map of traffic agents driving on regular lanes
Definition: TrafficModel.h:58
TrafficModel::platoonRates
PlatoonRates *const platoonRates
the map of platoon rates
Definition: TrafficModel.h:55
TrafficModel::getHomogeneities
virtual Homogeneities * getHomogeneities() const override
Returns the map for registering homogeneities.
Definition: TrafficModel.cpp:71
TrafficModel::velocities
Velocities *const velocities
the map of velocities
Definition: TrafficModel.h:56
TrafficModel::homogeneities
Homogeneities *const homogeneities
the map of homogeneities
Definition: TrafficModel.h:57
TrafficModel::getVelocities
virtual Velocities * getVelocities() const override
Returns the map for registering velocities.
Definition: TrafficModel.cpp:66
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficParametersPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
TrafficParametersPresenter.h File Reference
Traffic Simulation Plugin

This class defines the presenter object which handles events coming from the view (TrafficParametersView) and edits the model accordingly (TrafficInterface), i.e. more specifically the parameters therein. More...

Detailed Description

This class defines the presenter object which handles events coming from the view (TrafficParametersView) and edits the model accordingly (TrafficInterface), i.e. more specifically the parameters therein.

Note
This presenter class emits signals after editing the model which are noticed by the TrafficDisplayPresenter class. Normally, these signals should be emitted by the model itself but since it invokes template class instances, for which Qt does not support the signal-slot mechanism, signals are exceptionally handled by this presenter class.

Definition in file TrafficParametersPresenter.h.

Go to the source code of this file.

Classes

class TrafficParametersPresenter
This class defines the presenter object which handles events coming from the view (TrafficParametersView) and edits the model accordingly (TrafficInterface), i.e. more specifically the parameters therein. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficParametersPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
TrafficParametersPresenter.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
12 //-----------------------------------------------------------------------------
13 #ifndef TRAFFICPARAMETERSPRESENTER_H
14 #define TRAFFICPARAMETERSPRESENTER_H
15
16 #include "openPASS-TrafficSimulation/TrafficInterface.h"
17 #include "Views/TrafficParametersView.h"
18
19
20 #include <QObject>
21
22 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
32 class TrafficParametersPresenter : public QObject
33 {
34 Q_OBJECT
35 public:
36 explicit TrafficParametersPresenter(TrafficInterface * traffic,
37 TrafficParametersView * trafficParametersView,
38 QObject *parent = 0);
39 virtual ~TrafficParametersPresenter() = default;
40
41 Q_SIGNALS:
42 //-----------------------------------------------------------------------------
44 //-----------------------------------------------------------------------------
45 void volume_added();
46 //-----------------------------------------------------------------------------
48 //-----------------------------------------------------------------------------
49 void volume_removed();
50 //-----------------------------------------------------------------------------
52 //-----------------------------------------------------------------------------
53 void volume_probabilityChanged();
54 //-----------------------------------------------------------------------------
56 //-----------------------------------------------------------------------------
57 void platoonRate_added();
58 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 void platoonRate_removed();
62 //-----------------------------------------------------------------------------
64 //-----------------------------------------------------------------------------
65 void platoonRate_probabilityChanged();
66 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 void velocity_added();
70 //-----------------------------------------------------------------------------
72 //-----------------------------------------------------------------------------
73 void velocity_removed();
74 //-----------------------------------------------------------------------------
76 //-----------------------------------------------------------------------------
77 void velocity_probabilityChanged();
78 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------
81 void homogeneity_added();
82 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
85 void homogeneity_removed();
86 //-----------------------------------------------------------------------------
88 //-----------------------------------------------------------------------------
89 void homogeneity_probabilityChanged();
90 //-----------------------------------------------------------------------------
92 //-----------------------------------------------------------------------------
93 void cleared();
94
95 private Q_SLOTS:
96 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
102 void addVolume();
103
104 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
110 void addPlatoonRate();
111
112 //-----------------------------------------------------------------------------
117 //-----------------------------------------------------------------------------
118 void addVelocity();
119
120 //-----------------------------------------------------------------------------
125 //-----------------------------------------------------------------------------
126 void addHomogeneity();
127
128 //-----------------------------------------------------------------------------
135 //-----------------------------------------------------------------------------
136 void removeTrafficItem(unsigned int id, TrafficItemView::Type type);
137
138 //-----------------------------------------------------------------------------
146 //-----------------------------------------------------------------------------
147 void setProbability(unsigned int id, double value, TrafficItemView::Type type);
148
149 //-----------------------------------------------------------------------------
157 //-----------------------------------------------------------------------------
158 void setValue(unsigned int id, QString value, TrafficItemView::Type type);
159
160 //-----------------------------------------------------------------------------
162 //-----------------------------------------------------------------------------
163 void clearTrafficParameters();
164
165 public:
166 //-----------------------------------------------------------------------------
170 //-----------------------------------------------------------------------------
171 void updateView();
172
173 private:
174 TrafficInterface *traffic;
175 TrafficParametersView * trafficParametersView;
176
177
178 private:
179 int const default_volume = 600;
180 double const default_platoonRate = 0.5;
181 double const default_velocity = 90.0;
182 double const default_homogeneity = 0.8;
183 double const default_probability = 0.5;
184 };
185
186 #endif // TRAFFICPARAMETERSPRESENTER_H
TrafficParametersPresenter::volume_removed
void volume_removed()
Signal, emitted when a traffic volume has been removed from the model.
TrafficParametersPresenter::velocity_added
void velocity_added()
Signal, emitted when a velocity has been added to the model.
TrafficParametersPresenter::trafficParametersView
TrafficParametersView * trafficParametersView
a pointer to the editor widget whose user events are managed by this presenter
Definition: TrafficParametersPresenter.h:175
TrafficParametersPresenter::platoonRate_removed
void platoonRate_removed()
Signal, emitted when a platoon rate has been removed from the model.
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficParametersPresenter::homogeneity_removed
void homogeneity_removed()
Signal, emitted when a homogeneity has been removed from the model.
TrafficParametersPresenter::addVelocity
void addVelocity()
Slot which is triggered when the add-button has been clicked in the velocities section of TrafficPara...
Definition: TrafficParametersPresenter.cpp:42
TrafficParametersPresenter::platoonRate_probabilityChanged
void platoonRate_probabilityChanged()
Signal, emitted when the probability of a platoon rate has been changed.
TrafficParametersPresenter::homogeneity_added
void homogeneity_added()
Signal, emitted when a homogeneity has been added to the model.
TrafficParametersPresenter::setValue
void setValue(unsigned int id, QString value, TrafficItemView::Type type)
Slot which is triggered when the displayed value of a traffic item has been modified by the user...
Definition: TrafficParametersPresenter.cpp:144
TrafficParametersPresenter::removeTrafficItem
void removeTrafficItem(unsigned int id, TrafficItemView::Type type)
Slot which is triggered when the remove-button of some traffic item has been clicked. Removes the traffic item of the transmitted ID and type from the model and destroys the corresponding view.
Definition: TrafficParametersPresenter.cpp:61
TrafficParametersPresenter
This class defines the presenter object which handles events coming from the view (TrafficParametersV...
Definition: TrafficParametersPresenter.h:32
TrafficParametersPresenter::addVolume
void addVolume()
Slot which is triggered when the add-button has been clicked in the volumes section of TrafficParamet...
Definition: TrafficParametersPresenter.cpp:23
TrafficItemView::Type
Type
Definition: TrafficItemView.h:35
TrafficParametersPresenter::addHomogeneity
void addHomogeneity()
Slot which is triggered when the add-button has been clicked in the homogeneities section of TrafficP...
Definition: TrafficParametersPresenter.cpp:51
TrafficParametersView.h
This class defines the editor widget for traffic parameters and their probabilities.
TrafficParametersPresenter::homogeneity_probabilityChanged
void homogeneity_probabilityChanged()
Signal, emitted when the probability of a homogeneity item has been changed.
TrafficInterface.h
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
TrafficParametersPresenter::velocity_probabilityChanged
void velocity_probabilityChanged()
Signal, emitted when the probability of a velocity item has been changed.
TrafficParametersPresenter::velocity_removed
void velocity_removed()
Signal, emitted when a velocity has been removed from the model.
TrafficParametersPresenter::cleared
void cleared()
Signal, emitted when a the entire configuration has been cleared in the model.
TrafficParametersPresenter::addPlatoonRate
void addPlatoonRate()
Slot which is triggered when the add-button has been clicked in the platoon rates section of TrafficP...
Definition: TrafficParametersPresenter.cpp:33
TrafficParametersPresenter::updateView
void updateView()
Method which updates the whole TrafficParametersView widget to display the entire model configuration...
Definition: TrafficParametersPresenter.cpp:173
TrafficParametersView
This class defines the editor widget for traffic parameters and their probabilities.
Definition: TrafficParametersView.h:29
TrafficParametersPresenter::volume_added
void volume_added()
Signal, emitted when a traffic volume has been added to the model.
TrafficParametersPresenter::platoonRate_added
void platoonRate_added()
Signal, emitted when a platoon rate has been added to the model.
TrafficParametersPresenter::clearTrafficParameters
void clearTrafficParameters()
Slot which deletes all traffic item views.
Definition: TrafficParametersPresenter.cpp:232
TrafficParametersPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model to be edited by this presenter
Definition: TrafficParametersPresenter.h:174
TrafficParametersPresenter::volume_probabilityChanged
void volume_probabilityChanged()
Signal, emitted when the probability of a traffic volume has been changed.
TrafficParametersPresenter::setProbability
void setProbability(unsigned int id, double value, TrafficItemView::Type type)
Slot which is triggered when the displayed probability value of a traffic item has been modified by t...
Definition: TrafficParametersPresenter.cpp:111
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficParametersView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
TrafficParametersView.h File Reference
Traffic Simulation Plugin

This class defines the editor widget for traffic parameters and their probabilities. More...

Detailed Description

This class defines the editor widget for traffic parameters and their probabilities.

It consists of an ui element (TrafficParametersView.ui) with four list sections for traffic volumes, platoon rates, velocities and homogeneities. In these list sections, the editor views for the particular traffic items (instances of TrafficItemView) can be inserted upon pressing the corresponding add buttons.

Definition in file TrafficParametersView.h.

Go to the source code of this file.

Classes

class TrafficParametersView
This class defines the editor widget for traffic parameters and their probabilities. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficParametersView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficParametersView.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
10 //-----------------------------------------------------------------------------
11 #ifndef TRAFFICPARAMETERSVIEW_H
12 #define TRAFFICPARAMETERSVIEW_H
13
14 #include "WidgetView.h"
15 #include "TrafficItemView.h"
16
17 namespace Ui {
18 class TrafficParametersView;
19 }
20
21 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
29 class TrafficParametersView : public WidgetView
30 {
31 Q_OBJECT
32
33 public:
34 explicit TrafficParametersView(QWidget *parent = 0);
35 ~TrafficParametersView();
36
37 Q_SIGNALS:
38 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
41 void resized();
42
43 //-----------------------------------------------------------------------------
46 //-----------------------------------------------------------------------------
47 void addVolume();
48
49 //-----------------------------------------------------------------------------
52 //-----------------------------------------------------------------------------
53 void addPlatoonRate();
54
55 //-----------------------------------------------------------------------------
58 //-----------------------------------------------------------------------------
59 void addVelocity();
60
61 //-----------------------------------------------------------------------------
64 //-----------------------------------------------------------------------------
65 void addHomogeneity();
66
67 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 void probabilityChanged(unsigned int ID, double value, TrafficItemView::Type type);
73
74 //-----------------------------------------------------------------------------
78 //-----------------------------------------------------------------------------
79 void valueChanged(unsigned int ID, QString value, TrafficItemView::Type type);
80
81 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
85 void remove(unsigned int ID, TrafficItemView::Type type);
86
87 private Q_SLOTS:
88 //-----------------------------------------------------------------------------
91 //-----------------------------------------------------------------------------
92 void on_addVolume_clicked();
93
94 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 void on_addPlatoonRate_clicked();
99
100 //-----------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
104 void on_addVelocity_clicked();
105
106 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
110 void on_addHomogeneity_clicked();
111
112 public:
113 //-----------------------------------------------------------------------------
124 //-----------------------------------------------------------------------------
125 void addVolumeView(unsigned int id, QString value, double probability);
126
127 //-----------------------------------------------------------------------------
138 //-----------------------------------------------------------------------------
139 void addPlatoonRateView(unsigned int id, QString value, double probability);
140
141 //-----------------------------------------------------------------------------
152 //-----------------------------------------------------------------------------
153 void addVelocityView(unsigned int id, QString value, double probability);
154
155 //-----------------------------------------------------------------------------
166 //-----------------------------------------------------------------------------
167 void addHomogeneityView(unsigned int id, QString value, double probability);
168
169 //-----------------------------------------------------------------------------
177 //-----------------------------------------------------------------------------
178 void removeTrafficItemView(unsigned int id, TrafficItemView::Type type);
179
180 //-----------------------------------------------------------------------------
183 //-----------------------------------------------------------------------------
184 void clearTrafficParametersView();
185
186 public:
187 //-----------------------------------------------------------------------------
194 //-----------------------------------------------------------------------------
195 void setProbability(unsigned int id, TrafficItemView::Type type, double value);
196
197 //-----------------------------------------------------------------------------
204 //-----------------------------------------------------------------------------
205 void setValue(unsigned int id, TrafficItemView::Type type, QString value);
206
207
208 private:
209 //-----------------------------------------------------------------------------
213 //-----------------------------------------------------------------------------
214 void resizeEvent(QResizeEvent * event);
215
216
217 private:
218 Ui::TrafficParametersView *ui;
219 int initialHeight;
220 };
221
222 #endif // TRAFFICPARAMETERSVIEW_H
TrafficParametersView::setValue
void setValue(unsigned int id, TrafficItemView::Type type, QString value)
Method which sets the displayed value of the traffic parameter with the given id and type to the valu...
Definition: TrafficParametersView.cpp:142
TrafficParametersView::on_addVolume_clicked
void on_addVolume_clicked()
Qt Desinger-created slot activated when the add-button in the traffic volumes section has been clicke...
Definition: TrafficParametersView.cpp:22
TrafficParametersView::setProbability
void setProbability(unsigned int id, TrafficItemView::Type type, double value)
Method which sets the displayed probability value of the traffic parameter with the given id and type...
Definition: TrafficParametersView.cpp:133
TrafficParametersView::addPlatoonRate
void addPlatoonRate()
Signal, emitted when the add-button in the platoon rates section has been pressed.
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
TrafficParametersView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, TrafficItemView::Type type)
Signal, emitted when the probability of a traffic item has been modified. Transmits the ID...
TrafficParametersView::ui
Ui::TrafficParametersView * ui
the ui object containing all visualization elements of this editor widget
Definition: TrafficParametersView.h:218
TrafficParametersView::valueChanged
void valueChanged(unsigned int ID, QString value, TrafficItemView::Type type)
Signal, emitted when the value of a traffic item has been modified. Transmits the ID...
TrafficParametersView::addHomogeneity
void addHomogeneity()
Signal, emitted when the add-button in the homogeneities section has been pressed.
TrafficParametersView::initialHeight
int initialHeight
the initial height of this editor widget
Definition: TrafficParametersView.h:219
TrafficItemView::Type
Type
Definition: TrafficItemView.h:35
TrafficItemView.h
This class defines a general view for a traffic item, which can be a volume, platoon rate...
TrafficParametersView::resized
void resized()
Signal, emitted when this view has been resized.
TrafficParametersView::on_addVelocity_clicked
void on_addVelocity_clicked()
Qt Desinger-created slot activated when the add-button in the velocities section has been clicked...
Definition: TrafficParametersView.cpp:32
TrafficParametersView::resizeEvent
void resizeEvent(QResizeEvent *event)
Reimplementation of the resize event. Emits the resized() signal.
Definition: TrafficParametersView.cpp:127
TrafficParametersView::addVelocityView
void addVelocityView(unsigned int id, QString value, double probability)
Method which creates a view of a velocity using the given ID and inserts the view into the Velocities...
Definition: TrafficParametersView.cpp:73
TrafficParametersView::on_addHomogeneity_clicked
void on_addHomogeneity_clicked()
Qt Desinger-created slot activated when the add-button in the homogeneities section has been clicked...
Definition: TrafficParametersView.cpp:37
TrafficParametersView::addPlatoonRateView
void addPlatoonRateView(unsigned int id, QString value, double probability)
Method which creates a view of a platoon rate using the given ID and inserts the view into the Platoo...
Definition: TrafficParametersView.cpp:58
TrafficParametersView::addVolume
void addVolume()
Signal, emitted when the add-button in the traffic volumes section has been pressed.
TrafficParametersView::clearTrafficParametersView
void clearTrafficParametersView()
Method which deletes all registered traffic parameter views and resizes the this editor widget to its...
Definition: TrafficParametersView.cpp:152
TrafficParametersView
This class defines the editor widget for traffic parameters and their probabilities.
Definition: TrafficParametersView.h:29
TrafficParametersView::addHomogeneityView
void addHomogeneityView(unsigned int id, QString value, double probability)
Method which creates a view of a homogeneity using the given ID and inserts the view into the Homogen...
Definition: TrafficParametersView.cpp:88
TrafficParametersView::on_addPlatoonRate_clicked
void on_addPlatoonRate_clicked()
Qt Desinger-created slot activated when the add-button in the platoon rates section has been clicked...
Definition: TrafficParametersView.cpp:27
TrafficParametersView::addVolumeView
void addVolumeView(unsigned int id, QString value, double probability)
Method which creates a view of a traffic volume using the given ID and inserts the view into the Volu...
Definition: TrafficParametersView.cpp:43
TrafficParametersView::addVelocity
void addVelocity()
Signal, emitted when the add-button in the velocities section has been pressed.
TrafficParametersView::removeTrafficItemView
void removeTrafficItemView(unsigned int id, TrafficItemView::Type type)
Method which removes the view of a traffic item with the given ID and type. All item views lying belo...
Definition: TrafficParametersView.cpp:105
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
TrafficPresenter.h File Reference
Traffic Simulation Plugin

This class defines the presenter object which handles user events coming from the view (TrafficView) and edits the model accordingly (TrafficInterface). More...

Detailed Description

This class defines the presenter object which handles user events coming from the view (TrafficView) and edits the model accordingly (TrafficInterface).

Definition in file TrafficPresenter.h.

Go to the source code of this file.

Classes

class | AddTrafficItem
Command class for adding rows to the table of traffic settings. More...
class | EditTrafficName
Command class for editing the traffic's name. More...
class | RemoveTrafficItem
Command class for removing rows from the table of traffic settings. More...
class | TrafficPresenter
This class defines the presenter object which handles user events coming from the view (TrafficView) and edits the model accordingly (TrafficInterface). More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
TrafficPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
17 //-----------------------------------------------------------------------------
18 #ifndef TRAFFICPRESENTER_H
19 #define TRAFFICPRESENTER_H
20
21 #include "openPASS-TrafficSimulation/TrafficInterface.h"
22 #include "Presenters/TrafficItemMapPresenter.h"
23 #include "Views/TrafficView.h"
24
25 #include <QObject>
26 #include <QUndoStack>
27
28 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
33 class TrafficPresenter : public QObject
34 {
35 Q_OBJECT
36 public:
37 explicit TrafficPresenter(TrafficInterface * const traffic,
38 TrafficView * const trafficView,
39 QList<QString> * const agentList,
40 QUndoStack * const undoStack,
41 QObject *parent = nullptr);
42
43 private Q_SLOTS:
44 //-----------------------------------------------------------------------------
49 //-----------------------------------------------------------------------------
50 void setName(QString const & name);
51
52 private Q_SLOTS:
53 //-----------------------------------------------------------------------------
57 //-----------------------------------------------------------------------------
58 void addVolume();
59
60 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 void removeVolume(const int &row);
70
71 private Q_SLOTS:
72 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 void addPlatoonRate();
79
80 //-----------------------------------------------------------------------------
88 //-----------------------------------------------------------------------------
89 void removePlatoonRate(const int &row);
90
91 private Q_SLOTS:
92 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 void addVelocity();
99
100 //-----------------------------------------------------------------------------
108 //-----------------------------------------------------------------------------
109 void removeVelocity(const int &row);
110
111 private Q_SLOTS:
112 //-----------------------------------------------------------------------------
117 //-----------------------------------------------------------------------------
118 void addHomogeneity();
119
120 //-----------------------------------------------------------------------------
128 //-----------------------------------------------------------------------------
129 void removeHomogeneity(const int &row);
130
131 private Q_SLOTS:
132 //-----------------------------------------------------------------------------
137 //-----------------------------------------------------------------------------
138 void addRegularLaneAgent();
139
140 //-----------------------------------------------------------------------------
148 //-----------------------------------------------------------------------------
149 void removeRegularLaneAgent(const int &row);
150
151 private Q_SLOTS:
152 //-----------------------------------------------------------------------------
157 //-----------------------------------------------------------------------------
158 void addRightmostLaneAgent();
159
160 //-----------------------------------------------------------------------------
168 //-----------------------------------------------------------------------------
169 void removeRightmostLaneAgent(const int &row);
170
171 public Q_SLOTS:
172 //-----------------------------------------------------------------------------
176 //-----------------------------------------------------------------------------
177 void checkProbabilities();
178
179 //-----------------------------------------------------------------------------
182 //-----------------------------------------------------------------------------
183 void checkAgents();
184
185 private:
186 //-----------------------------------------------------------------------------
191 //-----------------------------------------------------------------------------
192 void setupVolumes();
193
194 //-----------------------------------------------------------------------------
199 //-----------------------------------------------------------------------------
200 void setupPlatoonRates();
201
202 //-----------------------------------------------------------------------------
207 //-----------------------------------------------------------------------------
208 void setupVelocities();
209
210 //-----------------------------------------------------------------------------
215 //-----------------------------------------------------------------------------
216 void setupHomogeneities();
217
218 //-----------------------------------------------------------------------------
223 //-----------------------------------------------------------------------------
224 void setupRegularLaneAgents();
225
226 //-----------------------------------------------------------------------------
231 //-----------------------------------------------------------------------------
232 void setupRightmostLaneAgents();
233
234 public:
235 //-----------------------------------------------------------------------------
238 //-----------------------------------------------------------------------------
239 void updateView();
240
241
242 private:
243 TrafficInterface * const traffic;
244 TrafficView * const trafficView;
245
246 private:
247 TrafficItemMapPresenter * const volumes;
248 TrafficItemMapPresenter * const platoonRates;
249 TrafficItemMapPresenter * const velocities;
250 TrafficItemMapPresenter * const homogeneities;
251 TrafficItemMapPresenter * const regularLaneAgents;
252 TrafficItemMapPresenter * const rightmostLaneAgents;
253
254 private:
255 static QString const default_volume;
256 static QString const default_platoonRate;
257 static QString const default_velocity;
258 static QString const default_homogeneity;
259 static double const default_probability;
260
261 private:
262 QList<QString> * const agentList;
263
264 private:
265 QUndoStack * const undoStack;
266
267 };
268
269 //-----------------------------------------------------------------------------
271 //-----------------------------------------------------------------------------
272 class AddTrafficItem : public QUndoCommand
273 {
274
275 public:
276 AddTrafficItem(TrafficItemMapPresenter * const table,
277 QString const default_value,
278 const double default_probability,
279 QString tableName = "",
280 QUndoCommand * parent = nullptr);
281
282 public:
283 void redo() override;
284 void undo() override;
285
286 private:
287 TrafficItemMapPresenter * const table;
288 QString const default_value;
289 double const default_probability;
290
291 };
292
293 //-----------------------------------------------------------------------------
295 //-----------------------------------------------------------------------------
296 class RemoveTrafficItem : public QUndoCommand
297 {
298
299 public:
300 RemoveTrafficItem(TrafficItemMapPresenter * const table,
301 int const row,
302 QString tableName="",
303 QUndoCommand * parent = nullptr);
304
305 public:
306 void redo() override;
307 void undo() override;
308
309 private:
310 TrafficItemMapPresenter * const table;
311 int const row;
312 TrafficItemInterface::Value const value;
313 TrafficItemInterface::Probability const probability;
314
315 };
316
317
318 //-----------------------------------------------------------------------------
320 //-----------------------------------------------------------------------------
321 class EditTrafficName : public QUndoCommand
322 {
323
324 public:
325 EditTrafficName(TrafficInterface * const traffic,
326 TrafficView * const trafficView,
327 TrafficInterface::Name const &newName,
328 QUndoCommand * parent = nullptr);
329
330 public:
331 void redo() override;
332 void undo() override;
333
334 private:
335 TrafficInterface * const traffic;
336 TrafficView * const trafficView;
337 TrafficInterface::Name const newName;
338 TrafficInterface::Name const oldName;
339 };
340
341
342 #endif // TRAFFICPRESENTER_H
TrafficPresenter::addRegularLaneAgent
void addRegularLaneAgent()
Slot is connected to the TrafficView::addRegularLaneAgent signal. Calls the TrafficItemMapPresenter::...
Definition: TrafficPresenter.cpp:149
TrafficPresenter::default_homogeneity
static QString const default_homogeneity
a default value for the homogeneity
Definition: TrafficPresenter.h:258
TrafficPresenter::volumes
TrafficItemMapPresenter *const volumes
a pointer to the presenter object connecting the traffic volumes map to its table view ...
Definition: TrafficPresenter.h:247
TrafficPresenter::setName
void setName(QString const &name)
Slot which is connected to the TrafficView::modifiedName signal. Sets the traffic configuration&#39;s nam...
Definition: TrafficPresenter.cpp:99
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficPresenter::default_volume
static QString const default_volume
a default value for the traffic volume
Definition: TrafficPresenter.h:255
TrafficPresenter::homogeneities
TrafficItemMapPresenter *const homogeneities
a pointer to the presenter object connecting the homogeneities map to its table view ...
Definition: TrafficPresenter.h:250
TrafficItemMapPresenter.h
This class describes the presenter objects of the traffic parameter maps.
TrafficPresenter::addVelocity
void addVelocity()
Slot is connected to the TrafficView::addVelocity signal. Calls the TrafficItemMapPresenter::addRow m...
Definition: TrafficPresenter.cpp:127
TrafficInterface::Name
QString Name
The name of the traffic configuration.
Definition: TrafficInterface.h:46
TrafficPresenter::setupRightmostLaneAgents
void setupRightmostLaneAgents()
An initializer method which configures the table view of the rightmost lane agents map...
Definition: TrafficPresenter.cpp:233
TrafficPresenter::regularLaneAgents
TrafficItemMapPresenter *const regularLaneAgents
a pointer to the presenter object connecting the regular lane agents map to its table view ...
Definition: TrafficPresenter.h:251
TrafficPresenter::agentList
QList< QString > *const agentList
a pointer to the list of available agent profiles (defined in a ProfilesCatalog.xml) ...
Definition: TrafficPresenter.h:262
TrafficPresenter::platoonRates
TrafficItemMapPresenter *const platoonRates
a pointer to the presenter object connecting the platoon rates map to its table view ...
Definition: TrafficPresenter.h:248
TrafficItemInterface::Value
QString Value
the datatype for the traffic parameter&#39;s value (generally a string)
Definition: TrafficItemInterface.h:42
TrafficPresenter::traffic
TrafficInterface *const traffic
a pointer to the model of the traffic configuration
Definition: TrafficPresenter.h:243
TrafficPresenter::addPlatoonRate
void addPlatoonRate()
Slot is connected to the TrafficView::addPlatoonRate signal. Calls the TrafficItemMapPresenter::addRo...
Definition: TrafficPresenter.cpp:116
TrafficPresenter::setupVolumes
void setupVolumes()
An initializer method which configures the table view of the traffic volumes map. Creates the table&#39;s...
Definition: TrafficPresenter.cpp:173
TrafficPresenter::addRightmostLaneAgent
void addRightmostLaneAgent()
Slot is connected to the TrafficView::addRightmostLaneAgent signal. Calls the TrafficItemMapPresenter...
Definition: TrafficPresenter.cpp:161
TrafficPresenter::setupVelocities
void setupVelocities()
An initializer method which configures the table view of the velocities map. Creates the table&#39;s pres...
Definition: TrafficPresenter.cpp:197
TrafficPresenter::setupPlatoonRates
void setupPlatoonRates()
An initializer method which configures the table view of the platoon rates map. Creates the table&#39;s p...
Definition: TrafficPresenter.cpp:185
TrafficPresenter::setupRegularLaneAgents
void setupRegularLaneAgents()
An initializer method which configures the table view of the regular lane agents map. Creates the table&#39;s presenter object (TrafficItemMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.
Definition: TrafficPresenter.cpp:221
TrafficPresenter::default_velocity
static QString const default_velocity
a default value for the velocity
Definition: TrafficPresenter.h:257
TrafficPresenter::trafficView
TrafficView *const trafficView
a pointer to the view of the traffic configuration
Definition: TrafficPresenter.h:244
TrafficPresenter::rightmostLaneAgents
TrafficItemMapPresenter *const rightmostLaneAgents
a pointer to the presenter object connecting the rightmost lane agents map to its table view ...
Definition: TrafficPresenter.h:252
TrafficInterface.h
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
TrafficPresenter::default_probability
static double const default_probability
a default value for a selection probability
Definition: TrafficPresenter.h:259
TrafficPresenter::removePlatoonRate
void removePlatoonRate(const int &row)
Slot which is connected to the TrafficView::removePlatoonRate signal. Calls the EnvironmentMapPresent...
Definition: TrafficPresenter.cpp:121
TrafficPresenter::default_platoonRate
static QString const default_platoonRate
a default value for the platoon rate
Definition: TrafficPresenter.h:256
RemoveTrafficItem
Command class for removing rows from the table of traffic settings.
Definition: TrafficPresenter.h:296
TrafficPresenter::setupHomogeneities
void setupHomogeneities()
An initializer method which configures the table view of the homogeneities map. Creates the table&#39;s p...
Definition: TrafficPresenter.cpp:209
TrafficItemInterface::Probability
double Probability
the selection probability&#39;s datatype
Definition: TrafficItemInterface.h:43
AddTrafficItem
Command class for adding rows to the table of traffic settings.
Definition: TrafficPresenter.h:272
TrafficPresenter::removeRightmostLaneAgent
void removeRightmostLaneAgent(const int &row)
Slot which is connected to the TrafficView::removeRightmostLaneAgent signal. Calls the EnvironmentMap...
Definition: TrafficPresenter.cpp:167
TrafficItemMapPresenter
This class describes the presenter objects of the traffic parameter maps.
Definition: TrafficItemMapPresenter.h:48
TrafficPresenter::checkAgents
void checkAgents()
Slot which is connected, with the TrafficInterface::edited signal in order to check whether all selec...
Definition: TrafficPresenter.cpp:245
TrafficPresenter::updateView
void updateView()
Method which updates the view (TrafficView) to the current state of the model (TrafficModel / Traffic...
Definition: TrafficPresenter.cpp:266
TrafficPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficPresenter.h:265
TrafficPresenter::removeVolume
void removeVolume(const int &row)
Slot which is connected to the TrafficView::removeVolume signal. Calls the EnvironmentMapPresenter::r...
Definition: TrafficPresenter.cpp:110
EditTrafficName
Command class for editing the traffic&#39;s name.
Definition: TrafficPresenter.h:321
TrafficPresenter::addHomogeneity
void addHomogeneity()
Slot is connected to the TrafficView::addHomogeneity signal. Calls the TrafficItemMapPresenter::addRo...
Definition: TrafficPresenter.cpp:138
TrafficPresenter::removeHomogeneity
void removeHomogeneity(const int &row)
Slot which is connected to the TrafficView::removeHomogeneity signal. Calls the EnvironmentMapPresent...
Definition: TrafficPresenter.cpp:143
TrafficPresenter::removeVelocity
void removeVelocity(const int &row)
Slot which is connected to the TrafficView::removeVelocity signal. Calls the EnvironmentMapPresenter:...
Definition: TrafficPresenter.cpp:132
TrafficView
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content s...
Definition: TrafficView.h:43
TrafficView.h
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content s...
TrafficPresenter::removeRegularLaneAgent
void removeRegularLaneAgent(const int &row)
Slot which is connected to the TrafficView::removeRegularLaneAgent signal. Calls the EnvironmentMapPr...
Definition: TrafficPresenter.cpp:155
TrafficPresenter::velocities
TrafficItemMapPresenter *const velocities
a pointer to the presenter object connecting the velocities map to its table view ...
Definition: TrafficPresenter.h:249
TrafficPresenter::checkProbabilities
void checkProbabilities()
Slot which is connected, with the TrafficInterface::edited signal in order to check the probability s...
Definition: TrafficPresenter.cpp:52
TrafficPresenter::addVolume
void addVolume()
Slot is connected to the TrafficView::addVolume signal. Calls the TrafficItemMapPresenter::addRow met...
Definition: TrafficPresenter.cpp:105
TrafficPresenter
This class defines the presenter object which handles user events coming from the view (TrafficView) ...
Definition: TrafficPresenter.h:33
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
Classes
TrafficSimulationInterface.h File Reference
Traffic Simulation Plugin

The TrafficSimulationInterface class forms the body of a traffic simulation configuration. More...

Detailed Description

The TrafficSimulationInterface class forms the body of a traffic simulation configuration.

It references the experiment, scenario, traffic and environment configuration classes and, hence, corresponds to the root element of the combination XML file.

Definition in file TrafficSimulationInterface.h.

Go to the source code of this file.

Classes

class TrafficSimulationInterface
The TrafficSimulationInterface class forms the body of a traffic simulation configuration. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
TrafficSimulationInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
19 //-----------------------------------------------------------------------------
20 #ifndef TRAFFICSIMULATIONINTERFACE_H
21 #define TRAFFICSIMULATIONINTERFACE_H
22
23 #include "ExperimentInterface.h"
24 #include "EnvironmentInterface.h"
25 #include "ScenarioInterface.h"
26 #include "TrafficInterface.h"
27
28 #include <QObject>
29
30 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
37 class TrafficSimulationInterface : public QObject
38 {
39 Q_OBJECT
40
41 public:
42 using ProfilesCatalogue = QString;
43
44
45 public:
46 explicit TrafficSimulationInterface(QObject * const parent = nullptr)
47 : QObject(parent){}
48
49 virtual ~TrafficSimulationInterface() = default;
50
51 public:
52 //-----------------------------------------------------------------------------
57 //-----------------------------------------------------------------------------
58 virtual ExperimentInterface * getExperiment() const = 0;
59
60 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
66 virtual EnvironmentInterface *getEnvironment() const =0;
67
68 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 virtual ScenarioInterface *getScenario() const =0;
75
76 //-----------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------
82 virtual TrafficInterface * getTraffic() const = 0;
83
84 public:
85 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 virtual void setProfilesCatalogue(ProfilesCatalogue const & _profilesCatalogue) = 0;
91
92 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 virtual ProfilesCatalogue getProfilesCatalogue() const = 0;
98
99 };
100
101
102 #endif // TRAFFICSIMULATIONINTERFACE
TrafficSimulationInterface::getTraffic
virtual TrafficInterface * getTraffic() const =0
Returns the pointer to the traffic configuration object, i.e. an instance of the TrafficInterface cla...
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
EnvironmentInterface.h
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
TrafficSimulationInterface::getProfilesCatalogue
virtual ProfilesCatalogue getProfilesCatalogue() const =0
Returns the current profiles catalogue.
TrafficSimulationInterface
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
Definition: TrafficSimulationInterface.h:37
TrafficSimulationInterface::setProfilesCatalogue
virtual void setProfilesCatalogue(ProfilesCatalogue const &_profilesCatalogue)=0
Sets the current profiles catalogue to the one passed as an argument.
TrafficInterface.h
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
TrafficSimulationInterface::getEnvironment
virtual EnvironmentInterface * getEnvironment() const =0
Returns the pointer to the environment configuration object, i.e. an instance of the EnvironmentInter...
TrafficSimulationInterface::getExperiment
virtual ExperimentInterface * getExperiment() const =0
Returns the pointer to the experiment configuration object, i.e. an instance of the ExperimentInterfa...
ScenarioInterface.h
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
ExperimentInterface.h
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
ExperimentInterface
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
Definition: ExperimentInterface.h:39
TrafficSimulationInterface::getScenario
virtual ScenarioInterface * getScenario() const =0
Returns the pointer to the scenario configuration object, i.e. an instance of the ScenarioInterface c...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
Classes
TrafficSimulationModel.h File Reference
Traffic Simulation Plugin

The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class. More...

Detailed Description

The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class.

Definition in file TrafficSimulationModel.h.

Go to the source code of this file.

Classes

class TrafficSimulationModel
The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficSimulationModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17 #ifndef TRAFFICSIMULATIONMODEL_H
18 #define TRAFFICSIMULATIONMODEL_H
19
20 #include "openPASS-TrafficSimulation/TrafficSimulationInterface.h"
21
22 #include "Models/EnvironmentModel.h"
23 #include "Models/ExperimentModel.h"
24 #include "Models/ScenarioModel.h"
25 #include "Models/TrafficModel.h"
26
27 #include <QObject>
28
29 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
33 class TrafficSimulationModel : public TrafficSimulationInterface
34 {
35 Q_OBJECT
36 public:
37 explicit TrafficSimulationModel(QObject * const parent = nullptr);
38 virtual ~TrafficSimulationModel() = default;
39
40 public:
41 virtual ExperimentInterface *getExperiment() const override;
42 virtual EnvironmentInterface *getEnvironment() const override;
43 virtual ScenarioInterface *getScenario() const override;
44 virtual TrafficInterface * getTraffic() const override;
45
46
47 public:
48 virtual void setProfilesCatalogue(ProfilesCatalogue const & _profilesCatalogue) override;
49 virtual ProfilesCatalogue getProfilesCatalogue() const override;
50
51 private:
52 ExperimentModel * experiment;
53 EnvironmentModel * environment;
54 ScenarioModel * scenario;
55 TrafficModel * traffic;
56 ProfilesCatalogue profilesCatalogue;
57
58 };
59
60 #endif // TRAFFICSIMULATIONMODEL_H
ScenarioModel.h
The Scenario Model class implements the functionality of the ScenarioItemInterface class...
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficSimulationModel::getTraffic
virtual TrafficInterface * getTraffic() const override
Returns the pointer to the traffic configuration object, i.e. an instance of the TrafficInterface cla...
Definition: TrafficSimulationModel.cpp:39
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
ExperimentModel.h
The ExperimentModel class implements the functionality of the ExperimentInterface class...
TrafficSimulationModel::getScenario
virtual ScenarioInterface * getScenario() const override
Returns the pointer to the scenario configuration object, i.e. an instance of the ScenarioInterface c...
Definition: TrafficSimulationModel.cpp:34
TrafficSimulationModel::getEnvironment
virtual EnvironmentInterface * getEnvironment() const override
Returns the pointer to the environment configuration object, i.e. an instance of the EnvironmentInter...
Definition: TrafficSimulationModel.cpp:29
TrafficModel
The TrafficModel class implements the functionality of the TrafficInterface class.
Definition: TrafficModel.h:27
ExperimentModel
The ExperimentModel class implements the functionality of the ExperimentInterface class...
Definition: ExperimentModel.h:29
EnvironmentModel.h
The Environment Model implements the functionality of the EnvironmentInterface class.
TrafficSimulationModel::getProfilesCatalogue
virtual ProfilesCatalogue getProfilesCatalogue() const override
Returns the current profiles catalogue.
Definition: TrafficSimulationModel.cpp:44
TrafficSimulationInterface
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
Definition: TrafficSimulationInterface.h:37
EnvironmentModel
The Environment Model implements the functionality of the EnvironmentInterface class.
Definition: EnvironmentModel.h:29
ScenarioModel
The Scenario Model class implements the functionality of the ScenarioItemInterface class...
Definition: ScenarioModel.h:27
TrafficSimulationModel::setProfilesCatalogue
virtual void setProfilesCatalogue(ProfilesCatalogue const &_profilesCatalogue) override
Sets the current profiles catalogue to the one passed as an argument.
Definition: TrafficSimulationModel.cpp:49
TrafficSimulationInterface.h
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
TrafficSimulationModel::getExperiment
virtual ExperimentInterface * getExperiment() const override
Returns the pointer to the experiment configuration object, i.e. an instance of the ExperimentInterfa...
Definition: TrafficSimulationModel.cpp:24
TrafficSimulationModel
The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class...
Definition: TrafficSimulationModel.h:33
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
ExperimentInterface
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
Definition: ExperimentInterface.h:39
TrafficModel.h
The TrafficModel class implements the functionality of the TrafficInterface class.
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationPresenter.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Classes
TrafficSimulationPresenter.h File Reference
Traffic Simulation Plugin

This class defines the presenter object for the main view of the Traffic Simulation Plugin and instantiates all other presenters. More...

Detailed Description

This class defines the presenter object for the main view of the Traffic Simulation Plugin and instantiates all other presenters.

The major user events to be handled are those from the action menu bar, i.e. loading, saving and clearing the whole configuration.

Definition in file TrafficSimulationPresenter.h.

Go to the source code of this file.

Classes

class | EditProfilesCatalogue
Command class for editing the profiles catalogue. More...
class | TrafficSimulationPresenter
This class defines the presenter object for the main view of the Traffic Simulation Plugin and instantiates all other presenters. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
TrafficSimulationPresenter.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
19 //-----------------------------------------------------------------------------
20
21 #ifndef TRAFFICSIMULATIONPRESENTER_H
22 #define TRAFFICSIMULATIONPRESENTER_H
23
24 #include <QObject>
25 #include <QUndoStack>
26 #include <QShortcut>
27
28 #include "openPASS-Project/ProjectInterface.h"
29 #include "openPASS-TrafficSimulation/TrafficSimulationInterface.h"
30
31 #include "Views/TrafficSimulationView.h"
32
33 class ExperimentPresenter;
34 class EnvironmentPresenter;
35 class EnvironmentMapPresenter;
36 class EnvironmentDisplayPresenter;
37 class ScenarioPresenter;
38 class ScenarioDisplayPresenter;
39 class TrafficPresenter;
40 class TrafficDisplayPresenter;
41
42 //-----------------------------------------------------------------------------
48 //-----------------------------------------------------------------------------
49 class TrafficSimulationPresenter : public QObject
50 {
51 Q_OBJECT
52 public:
53 explicit TrafficSimulationPresenter(TrafficSimulationInterface * trafficSimulation,
54 TrafficSimulationView * trafficSimulationView,
55 ProjectInterface * const project,
56 QObject *parent = nullptr);
57
58 virtual ~TrafficSimulationPresenter() = default;
59
60 private Q_SLOTS:
61 //-----------------------------------------------------------------------------
67 //-----------------------------------------------------------------------------
68 void save();
69
70 //-----------------------------------------------------------------------------
75 //-----------------------------------------------------------------------------
76 void load();
77
78 //-----------------------------------------------------------------------------
82 //-----------------------------------------------------------------------------
83 void clear();
84
85 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 void updateStatusBar(int index);
92
93 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
105 void setProfileCatalogue();
106
107 //-----------------------------------------------------------------------------
111 //-----------------------------------------------------------------------------
112 void updateCatalogueView();
113
114 //-----------------------------------------------------------------------------
118 //-----------------------------------------------------------------------------
119 void checkStatus();
120
121 //-----------------------------------------------------------------------------
127 //-----------------------------------------------------------------------------
128 void startSimulation();
129
130 //-----------------------------------------------------------------------------
134 //-----------------------------------------------------------------------------
135 void simulationFinished(int exitCode);
136
137 private:
138 //-----------------------------------------------------------------------------
143 //-----------------------------------------------------------------------------
144 void copyExperimentConfig(TrafficSimulationInterface const * const from);
145
146 //-----------------------------------------------------------------------------
151 //-----------------------------------------------------------------------------
152 void copyEnvironmentConfig(TrafficSimulationInterface const * const from);
153
154 //-----------------------------------------------------------------------------
159 //-----------------------------------------------------------------------------
160 void copyScenarioConfig(TrafficSimulationInterface const * const from);
161
162 //-----------------------------------------------------------------------------
167 //-----------------------------------------------------------------------------
168 void copyTrafficConfig(TrafficSimulationInterface const * const from);
169
170 private:
171 //-----------------------------------------------------------------------------
174 //-----------------------------------------------------------------------------
175 void clearExperimentConfig();
176
177 //-----------------------------------------------------------------------------
180 //-----------------------------------------------------------------------------
181 void clearEnvironmentConfig();
182
183
184 //-----------------------------------------------------------------------------
187 //-----------------------------------------------------------------------------
188 void clearScenarioConfig();
189
190 //-----------------------------------------------------------------------------
193 //-----------------------------------------------------------------------------
194 void clearTrafficConfig();
195
196 private:
197 QList<QString> agentProfiles;
198
199 private:
200 TrafficSimulationInterface * const trafficSimulation;
201 TrafficSimulationView * const trafficSimulationView;
202 ProjectInterface * const project;
203 QUndoStack * const undoStack;
204
205 private:
206 ExperimentPresenter * const experimentPresenter;
207
208 EnvironmentPresenter * const environmentPresenter;
209 EnvironmentDisplayPresenter * const environmentDisplayPresenter;
210
211 ScenarioPresenter * const scenarioPresenter;
212 ScenarioDisplayPresenter * const scenarioDisplayPresenter;
213
214 TrafficPresenter * const trafficPresenter;
215 TrafficDisplayPresenter * const trafficDisplayPresenter;
216
217 private:
218 QShortcut * const redo;
219 QShortcut * const undo;
220
221 };
222
223 //-----------------------------------------------------------------------------
225 //-----------------------------------------------------------------------------
226 class EditProfilesCatalogue : public QUndoCommand
227 {
228
229 public:
230 EditProfilesCatalogue(TrafficSimulationInterface * const trafficSimulation,
231 TrafficSimulationView * const trafficSimulationView,
232 TrafficSimulationInterface::ProfilesCatalogue const &newCatalogue,
233 QUndoCommand *parent = nullptr);
234
235 public:
236 void redo() override;
237 void undo() override;
238
239 private:
240 TrafficSimulationInterface * const trafficSimulation;
241 TrafficSimulationView * const trafficSimulationView;
242 TrafficSimulationInterface::ProfilesCatalogue const newCatalogue;
243 TrafficSimulationInterface::ProfilesCatalogue const oldCatalogue;
244 // QList<QString> agentList;
245 };
246
247 #endif // TRAFFICSIMULATIONPRESENTER_H
TrafficSimulationPresenter::trafficSimulationView
TrafficSimulationView *const trafficSimulationView
a pointer to the editor view whose user events are handled by this presenter
Definition: TrafficSimulationPresenter.h:201
TrafficSimulationPresenter::save
void save()
Slot which is triggered after the user has clicked the save-button in the action menu. Will open file dialog to select a filepath for the slaveConfig xml file to be saved. It calls the TrafficSimulationXMLSaveModel::save routine for saving the momentary configuration to a slaveConfig XML file.
Definition: TrafficSimulationPresenter.cpp:187
TrafficSimulationView.h
This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other conf...
TrafficSimulationPresenter::clearEnvironmentConfig
void clearEnvironmentConfig()
Method, which resets all setting made in the environment config to the default and empties all tables...
Definition: TrafficSimulationPresenter.cpp:430
TrafficDisplayPresenter
This class defines the presenter which controls the content to be displayed in the TrafficDisplayView...
Definition: TrafficDisplayPresenter.h:31
TrafficSimulationPresenter::environmentPresenter
EnvironmentPresenter *const environmentPresenter
a pointer to the environment presenter instantiated here
Definition: TrafficSimulationPresenter.h:208
TrafficSimulationPresenter
This class defines the presenter object for the main view of the Traffic Simulation Plugin and instan...
Definition: TrafficSimulationPresenter.h:49
ExperimentPresenter
This class defines the presenter object which handles user events coming from the view (ExperimentVie...
Definition: ExperimentPresenter.h:35
TrafficSimulationPresenter::copyEnvironmentConfig
void copyEnvironmentConfig(TrafficSimulationInterface const *const from)
Method, which copies all environment settings from the given argument to trafficSimulation.
Definition: TrafficSimulationPresenter.cpp:311
TrafficSimulationPresenter::copyScenarioConfig
void copyScenarioConfig(TrafficSimulationInterface const *const from)
Method, which copies all scenario settings from the given argument to trafficSimulation.
Definition: TrafficSimulationPresenter.cpp:346
EnvironmentMapPresenter
This class describes the presenter objects of the environment parameter maps.
Definition: EnvironmentMapPresenter.h:49
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
TrafficSimulationPresenter::load
void load()
Slot which is triggered after the user has clicked the load-button in the action menu. Will open file dialog to select a filepath for the slaveConfig xml file to be loaded. It calls the TrafficSimulationXMLLoadModel::load routine for loading a slaveConfig XML file.
Definition: TrafficSimulationPresenter.cpp:240
TrafficSimulationPresenter::copyExperimentConfig
void copyExperimentConfig(TrafficSimulationInterface const *const from)
Method, which copies all experiment settings from the given argument to trafficSimulation.
Definition: TrafficSimulationPresenter.cpp:281
TrafficSimulationInterface
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
Definition: TrafficSimulationInterface.h:37
TrafficSimulationPresenter::clearExperimentConfig
void clearExperimentConfig()
Method, which resets all setting made in the experiment config to the default and empties all tables...
Definition: TrafficSimulationPresenter.cpp:406
TrafficSimulationPresenter::agentProfiles
QList< QString > agentProfiles
a list of agent profiles defined in the profile catalogue
Definition: TrafficSimulationPresenter.h:197
TrafficSimulationPresenter::undo
QShortcut *const undo
shortcut for undo
Definition: TrafficSimulationPresenter.h:219
TrafficSimulationPresenter::updateStatusBar
void updateStatusBar(int index)
Slot which displays information in the status bar depending on the current tab.
Definition: TrafficSimulationPresenter.cpp:197
TrafficSimulationPresenter::clearScenarioConfig
void clearScenarioConfig()
Method, which resets all setting made in the scenario config to the default and empties all tables...
Definition: TrafficSimulationPresenter.cpp:456
TrafficSimulationPresenter::updateCatalogueView
void updateCatalogueView()
Slot which displays the profile catalogues view. Further, it loads the agent list, defined in the profiles catalogue. If any errors occur, these will be displayed in the GUI as well.
Definition: TrafficSimulationPresenter.cpp:497
TrafficSimulationPresenter::simulationFinished
void simulationFinished(int exitCode)
Slot which is triggered when the simulation slave has terminated. It will pop up an info window with ...
Definition: TrafficSimulationPresenter.cpp:116
TrafficSimulationPresenter::clearTrafficConfig
void clearTrafficConfig()
Method, which resets all setting made in the traffic config to the default and empties all tables...
Definition: TrafficSimulationPresenter.cpp:443
ScenarioPresenter
This class defines the presenter object which handles user events coming from the view (ScenarioView)...
Definition: ScenarioPresenter.h:35
TrafficSimulationPresenter::setProfileCatalogue
void setProfileCatalogue()
Slot which opens the file dialog for the user to select a profiles catalouge XML file. Further, it scans the chosen profile catalogue for agent profiles and updates agentProfiles accordingly. If the profile catalogue is changed, all agent profiles included into the traffic settings (TrafficInterface) are deleted. Before, a dialog window with a warning is displayed requiring a user confirmation.
Definition: TrafficSimulationPresenter.cpp:485
TrafficSimulationInterface.h
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
TrafficSimulationPresenter::project
ProjectInterface *const project
a pointer to the project settings (provides access to the path settings
Definition: TrafficSimulationPresenter.h:202
EnvironmentDisplayPresenter
This class defines the presenter which controls the content to be displayed in the EnvironmentDisplay...
Definition: EnvironmentDisplayPresenter.h:31
TrafficSimulationPresenter::scenarioPresenter
ScenarioPresenter *const scenarioPresenter
a pointer to the scenario presenter instantiated here
Definition: TrafficSimulationPresenter.h:211
TrafficSimulationPresenter::copyTrafficConfig
void copyTrafficConfig(TrafficSimulationInterface const *const from)
Method, which copies all traffic settings from the given argument to trafficSimulation.
Definition: TrafficSimulationPresenter.cpp:359
TrafficSimulationPresenter::redo
QShortcut *const redo
shortcut for redo
Definition: TrafficSimulationPresenter.h:218
EditProfilesCatalogue
Command class for editing the profiles catalogue.
Definition: TrafficSimulationPresenter.h:226
ScenarioDisplayPresenter
This class defines the presenter which controls the content to be displayed in the ScenarioDisplayVie...
Definition: ScenarioDisplayPresenter.h:30
TrafficSimulationPresenter::trafficSimulation
TrafficSimulationInterface *const trafficSimulation
a pointer to the model class edited by this presenter
Definition: TrafficSimulationPresenter.h:200
EnvironmentPresenter
This class defines the presenter object which handles user events coming from the view (EnvironmentVi...
Definition: EnvironmentPresenter.h:33
TrafficSimulationPresenter::clear
void clear()
Slot which is triggered after the user has clicked the new-button in the action menu and confirmed th...
Definition: TrafficSimulationPresenter.cpp:469
TrafficSimulationPresenter::checkStatus
void checkStatus()
Slot which checks the status of the configuration for each tab, i.e. the experiment, environment, scenario and traffic tabs. If all configurations are complete and correct, the start button for the simulation will be enabled.
Definition: TrafficSimulationPresenter.cpp:106
TrafficSimulationPresenter::environmentDisplayPresenter
EnvironmentDisplayPresenter *const environmentDisplayPresenter
a pointer to the environment display presenter instantiated here
Definition: TrafficSimulationPresenter.h:209
TrafficSimulationPresenter::experimentPresenter
ExperimentPresenter *const experimentPresenter
a pointer to the experiment presenter instantiated here
Definition: TrafficSimulationPresenter.h:206
TrafficSimulationView
This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other conf...
Definition: TrafficSimulationView.h:56
TrafficSimulationPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficSimulationPresenter.h:203
TrafficSimulationPresenter::startSimulation
void startSimulation()
Slot which is triggered when the simulation button is pressed. It creates a process for executing the...
Definition: TrafficSimulationPresenter.cpp:137
TrafficPresenter
This class defines the presenter object which handles user events coming from the view (TrafficView) ...
Definition: TrafficPresenter.h:33
TrafficSimulationPresenter::trafficDisplayPresenter
TrafficDisplayPresenter *const trafficDisplayPresenter
a pointer to the traffic display presenter instantiated here
Definition: TrafficSimulationPresenter.h:215
TrafficSimulationPresenter::trafficPresenter
TrafficPresenter *const trafficPresenter
a pointer to the traffic presenter instantiated here
Definition: TrafficSimulationPresenter.h:214
TrafficSimulationPresenter::scenarioDisplayPresenter
ScenarioDisplayPresenter *const scenarioDisplayPresenter
a pointer to the scenario display presenter instantiated here
Definition: TrafficSimulationPresenter.h:212
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
TrafficSimulationView.h File Reference
Traffic Simulation Plugin

This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other configuration views as child widgets. More...

Detailed Description

This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other configuration views as child widgets.

It contains an #ui object describing the views appearence (defined in TrafficSimulation.ui). This ui object comprises a tab widget for the experiment, scenario, environments and traffic views. These tabs contain scroll areas in which a resizable container widget will be put for the particular configuration widget. Further, the action menu and info bar are instantiated.

Definition in file TrafficSimulationView.h.

Go to the source code of this file.

Classes

class TrafficSimulationView
This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other configuration views as child widgets. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficSimulationView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
22 #ifndef TRAFFICSIMULATIONVIEW_H
23 #define TRAFFICSIMULATIONVIEW_H
24
25 #include "openPASS-Window/WindowInterface.h"
26
27 #include "Views/ExperimentBaseView.h"
28 #include "Views/EnvironmentBaseView.h"
29 #include "Views/ScenarioBaseView.h"
30 #include "Views/StatusBarView.h"
31 #include "Views/TrafficBaseView.h"
32
33 #include <QWidget>
34 #include <QResizeEvent>
35 #include <QPaintEvent>
36 #include <QPainter>
37 #include <QPainterPath>
38 #include <QColor>
39 #include <QPoint>
40 #include <QTableView>
41 #include <QUndoView>
42
43 namespace Ui {
44 class TrafficSimulationView;
45 }
46
47 //-----------------------------------------------------------------------------
55 //-----------------------------------------------------------------------------
56 class TrafficSimulationView : public QWidget
57 {
58 Q_OBJECT
59
60 public:
61 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 explicit TrafficSimulationView(WindowInterface * const window,
70 QWidget *parent = nullptr);
71 ~TrafficSimulationView() override;
72
73 Q_SIGNALS:
74 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 void currentTabChanged(int index);
79
80 //-----------------------------------------------------------------------------
82 //-----------------------------------------------------------------------------
83 void NewSetup();
84
85 //-----------------------------------------------------------------------------
87 //-----------------------------------------------------------------------------
88 void SaveSetup();
89
90 //-----------------------------------------------------------------------------
92 //-----------------------------------------------------------------------------
93 void LoadSetup();
94
95 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 void Undo();
99
100 //-----------------------------------------------------------------------------
102 //-----------------------------------------------------------------------------
103 void Redo();
104
105 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
110 void profileCatalogueChanged();
111
112 //-----------------------------------------------------------------------------
116 //-----------------------------------------------------------------------------
117 void refreshCatalogue();
118
119
120 public Q_SLOTS:
121 //-----------------------------------------------------------------------------
126 //-----------------------------------------------------------------------------
127 void on_tabWidget_currentChanged(int index);
128
129 public:
130 //-----------------------------------------------------------------------------
133 //-----------------------------------------------------------------------------
134 void adjustWidgets();
135
136
137 public:
138 //-----------------------------------------------------------------------------
143 //-----------------------------------------------------------------------------
144 ExperimentView * getExperimentView();
145
146 //-----------------------------------------------------------------------------
151 //-----------------------------------------------------------------------------
152 EnvironmentView * getEnvironmentView();
153
154
155 //-----------------------------------------------------------------------------
160 //-----------------------------------------------------------------------------
161 ScenarioView * getScenarioView();
162
163 //-----------------------------------------------------------------------------
168 //-----------------------------------------------------------------------------
169 TrafficView * getTrafficView();
170
171 //-----------------------------------------------------------------------------
175 //-----------------------------------------------------------------------------
176 QUndoView * getUndoView();
177
178 public:
179 //-----------------------------------------------------------------------------
184 //-----------------------------------------------------------------------------
185 EnvironmentDisplayView * getEnvironmentDisplayView();
186
187 //-----------------------------------------------------------------------------
192 //-----------------------------------------------------------------------------
193 ScenarioDisplayView * getScenarioDisplayView();
194
195 //-----------------------------------------------------------------------------
200 //-----------------------------------------------------------------------------
201 TrafficDisplayView * getTrafficDisplayView();
202
203
204 protected:
205 //-----------------------------------------------------------------------------
210 //-----------------------------------------------------------------------------
211 virtual void resizeEvent(QResizeEvent * event) override;
212
213 private Q_SLOTS:
214 //-----------------------------------------------------------------------------
219 //-----------------------------------------------------------------------------
220 void actionNew();
221
222 //-----------------------------------------------------------------------------
226 //-----------------------------------------------------------------------------
227 void actionSave();
228
229 //-----------------------------------------------------------------------------
233 //-----------------------------------------------------------------------------
234 void actionLoad();
235
236 //-----------------------------------------------------------------------------
239 //-----------------------------------------------------------------------------
240 void actionUndo();
241
242 //-----------------------------------------------------------------------------
245 //-----------------------------------------------------------------------------
246 void actionRedo();
247
248 //-----------------------------------------------------------------------------
251 //-----------------------------------------------------------------------------
252 void actionHistory();
253
254 //-----------------------------------------------------------------------------
260 //-----------------------------------------------------------------------------
261 void on_CatalogueBrowse_clicked();
262
263 //-----------------------------------------------------------------------------
266 //-----------------------------------------------------------------------------
267 void on_CatalogueRefresh_clicked();
268
269
270 public:
271 //-----------------------------------------------------------------------------
274 //-----------------------------------------------------------------------------
275 void showStatusBarText(QString text, StatusBarView::Color color);
276
277 //-----------------------------------------------------------------------------
279 //-----------------------------------------------------------------------------
280 void hideStatusBar();
281
282 //-----------------------------------------------------------------------------
288 //-----------------------------------------------------------------------------
289 void setProfileCatalogueView(QString const & filename);
290
291 //-----------------------------------------------------------------------------
295 //-----------------------------------------------------------------------------
296 void setProfileCatalogueError(QString const &message);
297
298
299 private:
300 WindowInterface * const window;
301 static const WindowInterface::ID ViewID;
302 QUndoView * const undoView;
303
304 private:
305 WindowInterface::Action * const actionMenuNew;
306 WindowInterface::Action * const actionMenuLoad;
307 WindowInterface::Action * const actionMenuSave;
308 WindowInterface::Action * const actionMenuUndo;
309 WindowInterface::Action * const actionMenuRedo;
310 WindowInterface::Action * const actionMenuHistory;
311
312 private:
313 Ui::TrafficSimulationView *ui;
314 StatusBarView * statusbar;
315
316 private:
317 EnvironmentView * environmentView;
318 ScenarioView * scenarioView;
319 TrafficView * trafficView;
320
321 private:
322 ExperimentBaseView * experimentBaseView;
323 };
324
325 #endif // TRAFFICSIMULATIONVIEW_H
TrafficSimulationView::SaveSetup
void SaveSetup()
Signal, emitted after the save-button in the action menu has been clicked.
TrafficSimulationView::window
WindowInterface *const window
pointer to the window interface for registering this view
Definition: TrafficSimulationView.h:300
TrafficSimulationView::getUndoView
QUndoView * getUndoView()
Method that returns the undo view.
Definition: TrafficSimulationView.cpp:152
TrafficSimulationView::Redo
void Redo()
Signal, emitted after the redo-button in the action menu has been clicked.
TrafficSimulationView::actionMenuUndo
WindowInterface::Action *const actionMenuUndo
The action menu object for undoing actions.
Definition: TrafficSimulationView.h:308
TrafficSimulationView::hideStatusBar
void hideStatusBar()
Method which hides the info bar.
Definition: TrafficSimulationView.cpp:205
WindowInterface
This class manages the registration and deregistration of Window Views which include the menu bar wit...
Definition: WindowInterface.h:44
TrafficSimulationView::experimentBaseView
ExperimentBaseView * experimentBaseView
The container widget for the experiment configuration (to be put into the scroll area) ...
Definition: TrafficSimulationView.h:322
TrafficSimulationView::currentTabChanged
void currentTabChanged(int index)
Signal, emitted when the current tab has been changed. Transmits the index of the tab...
ExperimentView
This class provides an editor for configuring the experiment setup, i.e. it is filled with the conten...
Definition: ExperimentView.h:47
Ui
Definition: EnvironmentDisplayView.h:29
TrafficSimulationView::environmentView
EnvironmentView * environmentView
the view of the environment configuration
Definition: TrafficSimulationView.h:317
TrafficSimulationView::actionUndo
void actionUndo()
Slot which is triggered when the undo-button of the action menu has been clicked. Will trigger the un...
Definition: TrafficSimulationView.cpp:131
ExperimentBaseView.h
This class provides a resizable container widget for the content of the experiment tab&#39;s scroll area...
EnvironmentDisplayView
This class provides a display for a quick overview of the environment configuration.
Definition: EnvironmentDisplayView.h:41
TrafficSimulationView::getEnvironmentView
EnvironmentView * getEnvironmentView()
Method that returns the environment configuration widget (instance of EnvironmentView).
Definition: TrafficSimulationView.cpp:162
TrafficSimulationView::getTrafficView
TrafficView * getTrafficView()
Method that returns the traffic configuration widget (instance of TrafficView).
Definition: TrafficSimulationView.cpp:182
StatusBarView.h
This class defines a status bar.
TrafficSimulationView::adjustWidgets
void adjustWidgets()
Method for adjusting the geometry and positioning of child widgets according to the geometry of this ...
Definition: TrafficSimulationView.cpp:146
TrafficSimulationView::undoView
QUndoView *const undoView
the view of the undo stack
Definition: TrafficSimulationView.h:302
TrafficBaseView.h
This class provides a resizable container widget for the content of the traffic tab.
WindowInterface.h
The Window Interface (WI) contains the functions managing the Window View of openPASS application...
TrafficSimulationView::profileCatalogueChanged
void profileCatalogueChanged()
Signal, emitted when the profiles catalogue has been modified by the user.
TrafficSimulationView::actionMenuNew
WindowInterface::Action *const actionMenuNew
The action menu object for the creating a new worksheet.
Definition: TrafficSimulationView.h:305
TrafficSimulationView::setProfileCatalogueView
void setProfileCatalogueView(QString const &filename)
Method which sets the filename displayed in the profile catalogue&#39;s line edit to the one passed as an...
Definition: TrafficSimulationView.cpp:210
TrafficSimulationView::actionMenuRedo
WindowInterface::Action *const actionMenuRedo
The action menu object for redoing actions.
Definition: TrafficSimulationView.h:309
WindowInterface::Action
QPushButton Action
The button in the menu of the stacked widget.
Definition: WindowInterface.h:56
TrafficSimulationView::getTrafficDisplayView
TrafficDisplayView * getTrafficDisplayView()
Method that returns the traffic display widget (instance of TrafficDisplayView).
Definition: TrafficSimulationView.cpp:187
TrafficSimulationView::getExperimentView
ExperimentView * getExperimentView()
Method that returns the experiment configuration widget (instance of ExperimentView).
Definition: TrafficSimulationView.cpp:157
EnvironmentView
This class provides an editor for configuring the environment setup, i.e. it is filled with the conte...
Definition: EnvironmentView.h:43
TrafficSimulationView::ViewID
static const WindowInterface::ID ViewID
the view id under which this view is registered in the window interface
Definition: TrafficSimulationView.h:301
TrafficSimulationView::getScenarioView
ScenarioView * getScenarioView()
Method that returns the scenario configuration widget (instance of ScenarioView). ...
Definition: TrafficSimulationView.cpp:177
TrafficSimulationView::refreshCatalogue
void refreshCatalogue()
Signal, emitted when the refresh button of the profile catalogue has been clicked by the user...
TrafficSimulationView::trafficView
TrafficView * trafficView
the view of the traffic configuration
Definition: TrafficSimulationView.h:319
TrafficSimulationView::on_CatalogueBrowse_clicked
void on_CatalogueBrowse_clicked()
Slot which is triggered when Browse-button next to the profile catalogue&#39;s line edit is clicked...
Definition: TrafficSimulationView.cpp:215
TrafficSimulationView::ui
Ui::TrafficSimulationView * ui
The ui object defining the components of the view.
Definition: TrafficSimulationView.h:313
TrafficDisplayView
This class provides a display for a quick overview of the traffic configuration.
Definition: TrafficDisplayView.h:42
TrafficSimulationView::on_tabWidget_currentChanged
void on_tabWidget_currentChanged(int index)
Slot, activated when the current tab has changed. Will emit the currentTabChanged signal transmitting...
Definition: TrafficSimulationView.cpp:89
TrafficSimulationView::getScenarioDisplayView
ScenarioDisplayView * getScenarioDisplayView()
Method that returns the scenario display widget (instance of ScenarioDisplayView).
Definition: TrafficSimulationView.cpp:172
TrafficSimulationView::on_CatalogueRefresh_clicked
void on_CatalogueRefresh_clicked()
Slot which is triggered when the Refresh button of the profiles catalogue section is clicked...
Definition: TrafficSimulationView.cpp:220
TrafficSimulationView::actionRedo
void actionRedo()
Slot which is triggered when the redo-button of the action menu has been clicked. Will trigger the re...
Definition: TrafficSimulationView.cpp:126
TrafficSimulationView::LoadSetup
void LoadSetup()
Signal, emitted after the load-button in the action menu has been clicked.
TrafficSimulationView::getEnvironmentDisplayView
EnvironmentDisplayView * getEnvironmentDisplayView()
Method that returns the environment display widget (instance of EnvironmentDisplayView).
Definition: TrafficSimulationView.cpp:167
TrafficSimulationView::showStatusBarText
void showStatusBarText(QString text, StatusBarView::Color color)
Method which shows the text message passed as a first argument in the info bar in the color code spec...
Definition: TrafficSimulationView.cpp:200
TrafficSimulationView::actionMenuSave
WindowInterface::Action *const actionMenuSave
The action menu object for saving a slaveConfig file.
Definition: TrafficSimulationView.h:307
TrafficSimulationView::actionSave
void actionSave()
Slot which is triggered when the save-button of the action menu has been clicked. Prompts a file dial...
Definition: TrafficSimulationView.cpp:141
ScenarioDisplayView
This class provides a display for a quick overview of the scenario configuration. ...
Definition: ScenarioDisplayView.h:40
TrafficSimulationView::actionMenuHistory
WindowInterface::Action *const actionMenuHistory
The action menu object for showing the command history.
Definition: TrafficSimulationView.h:310
TrafficSimulationView::statusbar
StatusBarView * statusbar
the info bar object
Definition: TrafficSimulationView.h:314
ExperimentBaseView
This class provides a resizable container widget for the content of the experiment tab...
Definition: ExperimentBaseView.h:46
TrafficView
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content s...
Definition: TrafficView.h:43
TrafficSimulationView::actionHistory
void actionHistory()
Slot which is triggered when the command history button is clicked. Will show or hide the command his...
Definition: TrafficSimulationView.cpp:112
TrafficSimulationView::actionLoad
void actionLoad()
Slot which is triggered when the load-button of the action menu has been clicked. Prompts a file dial...
Definition: TrafficSimulationView.cpp:136
TrafficSimulationView::resizeEvent
virtual void resizeEvent(QResizeEvent *event) override
Reimplementation of the resize event. Triggers adjustWidgets in order to adjust the geometry of the c...
Definition: TrafficSimulationView.cpp:193
TrafficSimulationView::setProfileCatalogueError
void setProfileCatalogueError(QString const &message)
Method which sets an error message next the profile catalogue&#39;s line edit.
Definition: TrafficSimulationView.cpp:226
TrafficSimulationView::TrafficSimulationView
TrafficSimulationView(WindowInterface *const window, QWidget *parent=nullptr)
Constructor which initialises all attributes, creates the ui object as well as the actions for the ac...
Definition: TrafficSimulationView.cpp:22
ScenarioView
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content ...
Definition: ScenarioView.h:42
WindowInterface::ID
QString ID
The identifier of the stacked widget.
Definition: WindowInterface.h:50
ScenarioBaseView.h
This class provides a resizable container widget for the content of the scenario tab&#39;s scroll area...
TrafficSimulationView
This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other conf...
Definition: TrafficSimulationView.h:56
TrafficSimulationView::Undo
void Undo()
Signal, emitted after the undo-button in the action menu has been clicked.
StatusBarView
This class defines a status bar.
Definition: StatusBarView.h:39
TrafficSimulationView::scenarioView
ScenarioView * scenarioView
the view of the scenario settings
Definition: TrafficSimulationView.h:318
TrafficSimulationView::actionNew
void actionNew()
Slot which is triggered when the new-button of the action menu has been clicked. Shows a warning dial...
Definition: TrafficSimulationView.cpp:94
TrafficSimulationView::NewSetup
void NewSetup()
Signal, emitted when the new-button in the action menu is clicked.
TrafficSimulationView::actionMenuLoad
WindowInterface::Action *const actionMenuLoad
The action menu object for loading a slaveConfig file.
Definition: TrafficSimulationView.h:306
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationXMLBaseModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
Classes
TrafficSimulationXMLBaseModel.h File Reference
Traffic Simulation Plugin

This class defines the XML element names of the combination XML file. More...

Detailed Description

This class defines the XML element names of the combination XML file.

Further, it contains lists of subelements if an XML element has subelements. These lists are used to check that all required subelements are contained when loading a combination XML file.

Note
Since this class contains a variety QStrings with the XML element names, we refrain from a detailed documentation of the class attributes. Looking at the .cpp files, it should be immediately clear what the variables contains.

Definition in file TrafficSimulationXMLBaseModel.h.

Go to the source code of this file.

Classes

class TrafficSimulationXMLBaseModel
This class defines the XML element names of the combination XML file. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationXMLBaseModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficSimulationXMLBaseModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
23
24 #ifndef TRAFFICSIMULATIONXMLBASEMODEL_H
25 #define TRAFFICSIMULATIONXMLBASEMODEL_H
26
27 #include <QList>
28 #include <QString>
29
30 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
41 class TrafficSimulationXMLBaseModel
42 {
43 public:
44 explicit TrafficSimulationXMLBaseModel() = delete;
45 virtual ~TrafficSimulationXMLBaseModel() = default;
46
47 protected:
48 static QString const KeyRoot;
49 static QString const KeyProfilesCatalogue;
50
51 protected:
52 static QString const KeyExperiment;
53 static QString const KeyExperimentID;
54 static QString const KeyExperimentNumberInvocations;
55 static QString const KeyExperimentSeed;
56 static QString const KeyExperimentLibraries;
57 static QString const KeyExperimentLoggingGroups;
58 static QString const KeyExperimentLoggingGroup;
59 static QList<QString> const KeyListExperiment;
60
61 protected:
62 static QString const KeyEnvironment;
63 static QString const KeyTimeOfDayMap;
64 static QString const KeyVisibilityDistanceMap;
65 static QString const KeyFrictionMap;
66 static QString const KeyWeatherMap;
67 static QList<QString> const KeyListEnvironment;
68
69 protected:
70 static QString const KeyTimeOfDay;
71 static QString const KeyVisibilityDistance;
72 static QString const KeyFriction;
73 static QString const KeyWeather;
74
75 protected:
76 static QString const KeyEgo;
77 static QString const KeyEgoAgent;
78 static QList <QString> const KeyListEgo;
79
80 protected:
81 static QString const KeyScenario;
82 static QString const KeyScenarioFile;
83 static QString const KeyScenarioAgents;
84 static QString const KeyScenarioAgent;
85 static QList<QString> const KeyListScenario;
86
87 protected:
88 static QString const KeyTraffic;
89 static QString const KeyTrafficParameters;
90 static QString const KeyTrafficRegularLane;
91 static QString const KeyTrafficRightmostLane;
92
93 static QList<QString> const KeyListTraffic;
94 static QList<QString> const KeyListTrafficParameters;
95
96 static QString const KeyTrafficAgent;
97 static QString const KeyTrafficVolumes;
98 static QString const KeyTrafficVolume;
99 static QString const KeyTrafficPlatoonRates;
100 static QString const KeyTrafficPlatoonRate;
101 static QString const KeyTrafficVelocities;
102 static QString const KeyTrafficVelocity;
103 static QString const KeyTrafficHomogeneities;
104 static QString const KeyTrafficHomogeneity;
105
106 };
107
108 #endif // TRAFFICSIMULATIONXMLBASEMODEL_H
TrafficSimulationXMLBaseModel
This class defines the XML element names of the combination XML file.
Definition: TrafficSimulationXMLBaseModel.h:41
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationXMLLoadModel.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
Classes
TrafficSimulationXMLLoadModel.h File Reference
Traffic Simulation Plugin | Traffic Simulation Plugin

This class provides routines for loading the combination XML file and for storing all information in the corresponding instances of the model classes. More...

Detailed Description

This class provides routines for loading the combination XML file and for storing all information in the corresponding instances of the model classes.

This class provides routines for saving the slaveConfig XML file.

The loading and the corrsponding routines strictly follow the structure of the corresponding combination XML file. In the general structure of such a loading method, a loop over all xml subelements within the given xml element is incorporated During this loop, the loaded subelement names are compared to the keywords defined in TrafficSimulationXMLBaseModel. In case of a match, the corresponding element text is read and the information is stored in the proper attribute of the configuration object. Unknown xml elements are generally skipped. Further, it is checked whether all required elements are listed in the file. If not, the routine returns "false", otherwise "true". In order to check for xml rules, the QXmlStreamReader class is used for parsing.

The saving process and the corrsponding routines strictly follow the structure of the corresponding combination XML file. In the general structure of such a saving method, a loop over all xml subelements within the given xml element is incorporated and the values of the corresponding configuration object are written to the file using the xml names defined in TrafficSimulationXMLBaseModel. As an xml parser, Qt's QXmlStreamWriter class is used.

Definition in file TrafficSimulationXMLLoadModel.h.

Go to the source code of this file.

Classes

class TrafficSimulationXMLLoadModel
This class provides routines for loading the combination XML file and for storing all information in the corresponding instances of the model classes. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationXMLLoadModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficSimulationXMLLoadModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------
28 #ifndef TRAFFICSIMULATIONXMLLOADMODEL_H
29 #define TRAFFICSIMULATIONXMLLOADMODEL_H
30
31 #include "openPASS-TrafficSimulation/TrafficSimulationInterface.h"
32 #include "Models/TrafficSimulationXMLBaseModel.h"
33
34 #include <QFile>
35 #include <QXmlStreamReader>
36
37 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
52 class TrafficSimulationXMLLoadModel : public TrafficSimulationXMLBaseModel
53 {
54 public:
55 explicit TrafficSimulationXMLLoadModel()=delete;
56 virtual ~TrafficSimulationXMLLoadModel()=default;
57
58 public:
59 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 static bool load(const QString &filepath,
75 TrafficSimulationInterface * const trafficSimulation);
76
77 static bool loadAgentProfiles(TrafficSimulationInterface::ProfilesCatalogue catalogue,
78 QList<QString> &agents);
79
80 //-----------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 static bool loadExperiment(QXmlStreamReader &xml,
92 ExperimentInterface * experiment);
93
94 //-----------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
104 static bool loadLibraries(QXmlStreamReader &xml,
105 ExperimentInterface::Libraries * const libraries);
106
107 //-----------------------------------------------------------------------------
116 //-----------------------------------------------------------------------------
117 static bool loadLoggingGroups(QXmlStreamReader &xml,
118 ExperimentInterface::LoggingGroups * const loggingGroups);
119
120
121 //-----------------------------------------------------------------------------
131 //-----------------------------------------------------------------------------
132 static bool loadEnvironment(QXmlStreamReader &xml,
133 EnvironmentInterface * environment);
134
135
136 //-----------------------------------------------------------------------------
147 //-----------------------------------------------------------------------------
148 static bool loadTimeOfDayMap(QXmlStreamReader &xml,
149 EnvironmentInterface * environment);
150
151 //-----------------------------------------------------------------------------
162 //-----------------------------------------------------------------------------
163 static bool loadVisibilityDistanceMap(QXmlStreamReader &xml,
164 EnvironmentInterface * environment);
165
166 //-----------------------------------------------------------------------------
177 //-----------------------------------------------------------------------------
178 static bool loadFrictionMap(QXmlStreamReader &xml,
179 EnvironmentInterface * environment);
180
181 //-----------------------------------------------------------------------------
192 //-----------------------------------------------------------------------------
193 static bool loadWeatherMap(QXmlStreamReader &xml,
194 EnvironmentInterface * environment);
195 //-----------------------------------------------------------------------------
208 //-----------------------------------------------------------------------------
209 static bool loadScenarioConfig(QXmlStreamReader &xml,
210 ScenarioInterface * scenario);
211
212 static bool loadEntities(ScenarioInterface *scenario, const QString &scenarioFile);
213
214 static bool loadScenarioObjects(QXmlStreamReader &xml,
215 ScenarioInterface::Entities * entities);
216
217 //-----------------------------------------------------------------------------
229 //-----------------------------------------------------------------------------
230 static bool loadTraffic(QXmlStreamReader &xml,
231 TrafficInterface * traffic);
232
233 //-----------------------------------------------------------------------------
245 //-----------------------------------------------------------------------------
246 static bool loadTrafficParameters(QXmlStreamReader &xml,
247 TrafficInterface * traffic);
248
249 //-----------------------------------------------------------------------------
260 //-----------------------------------------------------------------------------
261 static bool loadTrafficVolumes(QXmlStreamReader &xml,
262 TrafficItemMapInterface *volumes);
263
264 //-----------------------------------------------------------------------------
275 //-----------------------------------------------------------------------------
276 static bool loadTrafficPlatoonRates(QXmlStreamReader &xml,
277 TrafficItemMapInterface *platoonRates);
278
279 //-----------------------------------------------------------------------------
290 //-----------------------------------------------------------------------------
291 static bool loadTrafficVelocities(QXmlStreamReader &xml,
292 TrafficItemMapInterface *velocities);
293
294 //-----------------------------------------------------------------------------
305 //-----------------------------------------------------------------------------
306 static bool loadTrafficHomogeneities(QXmlStreamReader &xml,
307 TrafficItemMapInterface *homogeneities);
308
309 //-----------------------------------------------------------------------------
321 //-----------------------------------------------------------------------------
322 static bool loadTrafficAgents(QXmlStreamReader & xml,
323 TrafficItemMapInterface *agents);
324
325
326 };
327
328 #endif // TRAFFICSIMULATIONXMLLOADMODEL_H
ExperimentInterface::Libraries
QMap< QString, QString > Libraries
The map of libraries needed by the simulation slave.
Definition: ExperimentInterface.h:47
TrafficSimulationXMLLoadModel::loadTrafficPlatoonRates
static bool loadTrafficPlatoonRates(QXmlStreamReader &xml, TrafficItemMapInterface *platoonRates)
This method reads all platoon rates, being subelements of <TrafficParameters>, from the combination x...
Definition: TrafficSimulationXMLLoadModel.cpp:477
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficSimulationXMLLoadModel::loadWeatherMap
static bool loadWeatherMap(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all weather entries from the combination xml file and stores their values and proba...
Definition: TrafficSimulationXMLLoadModel.cpp:288
TrafficSimulationXMLLoadModel::load
static bool load(const QString &filepath, TrafficSimulationInterface *const trafficSimulation)
This method manages the whole loading process and calls the subroutines for loading the particular se...
Definition: TrafficSimulationXMLLoadModel.cpp:13
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficSimulationXMLLoadModel::loadVisibilityDistanceMap
static bool loadVisibilityDistanceMap(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all visibility distances from the combination xml file and stores their values and ...
Definition: TrafficSimulationXMLLoadModel.cpp:232
ExperimentInterface::LoggingGroups
QStringList LoggingGroups
The list of logging groups.
Definition: ExperimentInterface.h:48
TrafficSimulationXMLLoadModel::loadTrafficParameters
static bool loadTrafficParameters(QXmlStreamReader &xml, TrafficInterface *traffic)
This method reads all xml elements connected to <TrafficParameters> from the combination xml file and...
Definition: TrafficSimulationXMLLoadModel.cpp:422
TrafficSimulationXMLLoadModel::loadTraffic
static bool loadTraffic(QXmlStreamReader &xml, TrafficInterface *traffic)
This method reads all xml elements connected to <TrafficConfig> from the combination xml file and sto...
Definition: TrafficSimulationXMLLoadModel.cpp:397
TrafficSimulationXMLLoadModel::loadExperiment
static bool loadExperiment(QXmlStreamReader &xml, ExperimentInterface *experiment)
This method reads all xml elements connected to <ExperimentConfig> from the slaveConfig xml file and ...
Definition: TrafficSimulationXMLLoadModel.cpp:110
TrafficSimulationXMLLoadModel::loadScenarioConfig
static bool loadScenarioConfig(QXmlStreamReader &xml, ScenarioInterface *scenario)
This method reads all xml elements connected to <ScenarioConfig> from the combination xml file...
Definition: TrafficSimulationXMLLoadModel.cpp:316
TrafficSimulationInterface
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
Definition: TrafficSimulationInterface.h:37
TrafficSimulationXMLLoadModel
This class provides routines for loading the combination XML file and for storing all information in ...
Definition: TrafficSimulationXMLLoadModel.h:52
TrafficSimulationXMLLoadModel::loadFrictionMap
static bool loadFrictionMap(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all friction coefficinets from the combination xml file and stores their values and...
Definition: TrafficSimulationXMLLoadModel.cpp:260
TrafficSimulationXMLBaseModel
This class defines the XML element names of the combination XML file.
Definition: TrafficSimulationXMLBaseModel.h:41
TrafficSimulationXMLLoadModel::loadTrafficHomogeneities
static bool loadTrafficHomogeneities(QXmlStreamReader &xml, TrafficItemMapInterface *homogeneities)
This method reads all homogeneities, being subelements of <TrafficParameters>, from the combination x...
Definition: TrafficSimulationXMLLoadModel.cpp:533
TrafficSimulationXMLBaseModel.h
This class defines the XML element names of the combination XML file.
TrafficSimulationInterface.h
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
TrafficSimulationXMLLoadModel::loadEnvironment
static bool loadEnvironment(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all xml elements connected to <EnvironmentConfig> from the combination xml file and...
Definition: TrafficSimulationXMLLoadModel.cpp:174
TrafficSimulationXMLLoadModel::loadLibraries
static bool loadLibraries(QXmlStreamReader &xml, ExperimentInterface::Libraries *const libraries)
This method reads all xml elements of <Libraries> within the <ExperimentConfig> element. These correspond to the libraries needed by the simulation slave.
Definition: TrafficSimulationXMLLoadModel.cpp:151
TrafficSimulationXMLLoadModel::loadTrafficAgents
static bool loadTrafficAgents(QXmlStreamReader &xml, TrafficItemMapInterface *agents)
This method reads all agent profiles from the combination xml file and stores their names and probabi...
Definition: TrafficSimulationXMLLoadModel.cpp:559
TrafficSimulationXMLLoadModel::loadLoggingGroups
static bool loadLoggingGroups(QXmlStreamReader &xml, ExperimentInterface::LoggingGroups *const loggingGroups)
This method reads all xml elements of <LoggingGroups> within the <ExperimentConfig> element...
Definition: TrafficSimulationXMLLoadModel.cpp:160
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
TrafficSimulationXMLLoadModel::loadTimeOfDayMap
static bool loadTimeOfDayMap(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all time of day entries from the combination xml file and stores their values and p...
Definition: TrafficSimulationXMLLoadModel.cpp:204
TrafficSimulationXMLLoadModel::loadTrafficVelocities
static bool loadTrafficVelocities(QXmlStreamReader &xml, TrafficItemMapInterface *velocities)
This method reads all velocities, being subelements of <TrafficParameters>, from the combination xml ...
Definition: TrafficSimulationXMLLoadModel.cpp:504
ExperimentInterface
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
Definition: ExperimentInterface.h:39
ScenarioInterface::Entities
QMap< Name, CatalogueRef > Entities
The mapping of a scenario agent to an agent profile (catalogue reference)
Definition: ScenarioInterface.h:46
TrafficSimulationXMLLoadModel::loadTrafficVolumes
static bool loadTrafficVolumes(QXmlStreamReader &xml, TrafficItemMapInterface *volumes)
This method reads all traffic volumes, being subelements of <TrafficParameters>, from the combination...
Definition: TrafficSimulationXMLLoadModel.cpp:450
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficView.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Classes
TrafficView.h File Reference
Traffic Simulation Plugin

This class provides an editor for configuring the traffic setup, i.e. it is filled with the content stored in an TrafficInterface instance. More...

Detailed Description

This class provides an editor for configuring the traffic setup, i.e. it is filled with the content stored in an TrafficInterface instance.

It contains an #ui object describing the views appearance (defined in TrafficView.ui) and GUI elements. Particularly, it comprises table views (see Qt's QTableView class) for editing and displaying the maps of traffic parameters. User action will lead to signal emissions which are noticed and managed by the corresponding presenter class, i.e. TrafficPresenter.

Definition in file TrafficView.h.

Go to the source code of this file.

Classes

class TrafficView
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content stored in an TrafficInterface instance. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficView.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
23 #ifndef TRAFFICVIEW_H
24 #define TRAFFICVIEW_H
25
26 #include <QWidget>
27 #include <QTableView>
28
29 namespace Ui {
30 class TrafficView;
31 }
32
33 //-----------------------------------------------------------------------------
42 //-----------------------------------------------------------------------------
43 class TrafficView : public QWidget
44 {
45 Q_OBJECT
46
47 public:
48 explicit TrafficView(QWidget *parent = nullptr);
49 ~TrafficView();
50
51 Q_SIGNALS:
52 //-----------------------------------------------------------------------------
55 //-----------------------------------------------------------------------------
56 void modifiedName(QString const &_name);
57
58 Q_SIGNALS:
59 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
62 void addVolume();
63
64 //-----------------------------------------------------------------------------
69 //-----------------------------------------------------------------------------
70 void removeVolume(const int &row);
71
72 Q_SIGNALS:
73 //-----------------------------------------------------------------------------
75 //-----------------------------------------------------------------------------
76 void addPlatoonRate();
77
78 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 void removePlatoonRate(const int &row);
85
86 Q_SIGNALS:
87 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 void addVelocity();
91
92 //-----------------------------------------------------------------------------
97 //-----------------------------------------------------------------------------
98 void removeVelocity(const int &row);
99
100 Q_SIGNALS:
101 //-----------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
104 void addHomogeneity();
105
106 //-----------------------------------------------------------------------------
111 //-----------------------------------------------------------------------------
112 void removeHomogeneity(const int &row);
113
114 Q_SIGNALS:
115 //-----------------------------------------------------------------------------
117 //-----------------------------------------------------------------------------
118 void addRegularLaneAgent();
119
120 //-----------------------------------------------------------------------------
125 //-----------------------------------------------------------------------------
126 void removeRegularLaneAgent(const int &row);
127
128 Q_SIGNALS:
129 //-----------------------------------------------------------------------------
132 //-----------------------------------------------------------------------------
133 void addRightmostLaneAgent();
134
135 //-----------------------------------------------------------------------------
141 //-----------------------------------------------------------------------------
142 void removeRightmostLaneAgent(const int &row);
143
144 public:
145 //-----------------------------------------------------------------------------
150 //-----------------------------------------------------------------------------
151 void setName(QString const &_name);
152
153 public:
154 //-----------------------------------------------------------------------------
158 //-----------------------------------------------------------------------------
159 QTableView * getVolumesView() const;
160
161 //-----------------------------------------------------------------------------
165 //-----------------------------------------------------------------------------
166 QTableView * getPlatoonRatesView() const;
167
168 //-----------------------------------------------------------------------------
172 //-----------------------------------------------------------------------------
173 QTableView * getVelocitiesView() const;
174
175 //-----------------------------------------------------------------------------
179 //-----------------------------------------------------------------------------
180 QTableView * getHomogeneitiesView() const;
181
182 public:
183 //-----------------------------------------------------------------------------
188 //-----------------------------------------------------------------------------
189 QTableView * getRegularLaneAgentsView() const;
190
191 //-----------------------------------------------------------------------------
196 //-----------------------------------------------------------------------------
197 QTableView * getRightmostLaneAgentsView() const;
198
199 private Q_SLOTS:
200 //-----------------------------------------------------------------------------
204 //-----------------------------------------------------------------------------
205 void on_NameEdit_editingFinished();
206
207 private Q_SLOTS:
208 //-----------------------------------------------------------------------------
211 //-----------------------------------------------------------------------------
212 void on_addVolume_clicked();
213
214 //-----------------------------------------------------------------------------
218 //-----------------------------------------------------------------------------
219 void on_removeVolume_clicked();
220
221 private Q_SLOTS:
222 //-----------------------------------------------------------------------------
225 //-----------------------------------------------------------------------------
226 void on_addPlatoonRate_clicked();
227
228 //-----------------------------------------------------------------------------
232 //-----------------------------------------------------------------------------
233 void on_removePlatoonRate_clicked();
234
235 private Q_SLOTS:
236 //-----------------------------------------------------------------------------
239 //-----------------------------------------------------------------------------
240 void on_addVelocity_clicked();
241
242 //-----------------------------------------------------------------------------
246 //-----------------------------------------------------------------------------
247 void on_removeVelocity_clicked();
248
249 private Q_SLOTS:
250 //-----------------------------------------------------------------------------
253 //-----------------------------------------------------------------------------
254 void on_addHomogeneity_clicked();
255
256 //-----------------------------------------------------------------------------
260 //-----------------------------------------------------------------------------
261 void on_removeHomogeneity_clicked();
262
263 private Q_SLOTS:
264 //-----------------------------------------------------------------------------
267 //-----------------------------------------------------------------------------
268 void on_addRegularLaneAgent_clicked();
269
270 //-----------------------------------------------------------------------------
274 //-----------------------------------------------------------------------------
275 void on_removeRegularLaneAgent_clicked();
276
277 private Q_SLOTS:
278 //-----------------------------------------------------------------------------
281 //-----------------------------------------------------------------------------
282 void on_addRightmostLaneAgent_clicked();
283
284 //-----------------------------------------------------------------------------
288 //-----------------------------------------------------------------------------
289 void on_removeRightmostLaneAgent_clicked();
290
291 public:
292 //-----------------------------------------------------------------------------
298 //-----------------------------------------------------------------------------
299 void setVolumes_ProbabilityError(bool error);
300
301 //-----------------------------------------------------------------------------
307 //-----------------------------------------------------------------------------
308 void setPlatoonRates_ProbabilityError(bool error);
309
310 //-----------------------------------------------------------------------------
316 //-----------------------------------------------------------------------------
317 void setVelocities_ProbabilityError(bool error);
318
319 //-----------------------------------------------------------------------------
325 //-----------------------------------------------------------------------------
326 void setHomogeneities_ProbabilityError(bool error);
327
328 public:
329 //-----------------------------------------------------------------------------
333 //-----------------------------------------------------------------------------
334 void setAgentProfilesError(QString const &message);
335
336 //-----------------------------------------------------------------------------
342 //-----------------------------------------------------------------------------
343 void setRegularLane_ProbabilityError(bool error);
344
345 //-----------------------------------------------------------------------------
351 //-----------------------------------------------------------------------------
352 void setRightmostLane_ProbabilityError(bool error);
353
354 private:
355 //-----------------------------------------------------------------------------
366 //-----------------------------------------------------------------------------
367 bool eventFilter(QObject *watched, QEvent *event);
368
369 private:
370 Ui::TrafficView *ui;
371 };
372
373 #endif // TRAFFICVIEW_H
TrafficView::on_addPlatoonRate_clicked
void on_addPlatoonRate_clicked()
Slot which is triggered when the user clicks on the add-button above the platoon rate table...
Definition: TrafficView.cpp:98
TrafficView::addPlatoonRate
void addPlatoonRate()
Signal emitted when add-button above the platoon rates table is clicked.
TrafficView::setVolumes_ProbabilityError
void setVolumes_ProbabilityError(bool error)
Method which displays a probability error message for the table of traffic volumes if the boolian arg...
Definition: TrafficView.cpp:170
TrafficView::on_removeRightmostLaneAgent_clicked
void on_removeRightmostLaneAgent_clicked()
Signal, emitted when the user clicks the remove-button of the rightmost lane agents table...
Definition: TrafficView.cpp:143
TrafficView::removeVolume
void removeVolume(const int &row)
Signal emitted when remove-button above the traffic volume table is clicked. Transmits the currently ...
Ui
Definition: EnvironmentDisplayView.h:29
TrafficView::removeRightmostLaneAgent
void removeRightmostLaneAgent(const int &row)
Signal emitted when remove-button above the rightmost lane agents table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter).
TrafficView::getVelocitiesView
QTableView * getVelocitiesView() const
Method which provides access to the table view displaying velocities.
Definition: TrafficView.cpp:63
TrafficView::on_addVolume_clicked
void on_addVolume_clicked()
Slot which is triggered when the user clicks on the add-button above the traffic volumes table...
Definition: TrafficView.cpp:88
TrafficView::removePlatoonRate
void removePlatoonRate(const int &row)
Signal emitted when remove-button above the platoon rates table is clicked. Transmits the currently s...
TrafficView::setRightmostLane_ProbabilityError
void setRightmostLane_ProbabilityError(bool error)
Method which displays a probability error message for the table of rightmost lane agents if the booli...
Definition: TrafficView.cpp:202
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370
TrafficView::on_removeHomogeneity_clicked
void on_removeHomogeneity_clicked()
Signal, emitted when the user clicks the remove-button of the homogeneities table. Will emit the removeHomogeneity signal transmitting the currently selected row index of the table.
Definition: TrafficView.cpp:123
TrafficView::addVolume
void addVolume()
Signal emitted when add-button above the traffic volume table is clicked.
TrafficView::on_addVelocity_clicked
void on_addVelocity_clicked()
Slot which is triggered when the user clicks on the add-button above the velocities table...
Definition: TrafficView.cpp:108
TrafficView::setVelocities_ProbabilityError
void setVelocities_ProbabilityError(bool error)
Method which displays a probability error message for the table of velocities if the boolian argument...
Definition: TrafficView.cpp:162
TrafficView::getRightmostLaneAgentsView
QTableView * getRightmostLaneAgentsView() const
Method which provides access to the table view displaying rightmost lane agents.
Definition: TrafficView.cpp:83
TrafficView::addRegularLaneAgent
void addRegularLaneAgent()
Signal emitted when add-button above the regular lane agents table is clicked.
TrafficView::setRegularLane_ProbabilityError
void setRegularLane_ProbabilityError(bool error)
Method which displays a probability error message for the table of regular lane agents if the boolian...
Definition: TrafficView.cpp:194
TrafficView::on_removePlatoonRate_clicked
void on_removePlatoonRate_clicked()
Signal, emitted when the user clicks the remove-button of the platoon rates table. Will emit the removePlatoonRate signal transmitting the currently selected row index of the table.
Definition: TrafficView.cpp:103
TrafficView::on_addRightmostLaneAgent_clicked
void on_addRightmostLaneAgent_clicked()
Slot which is triggered when the user clicks on the add-button above the rightmost lane agents table...
Definition: TrafficView.cpp:138
TrafficView::on_removeRegularLaneAgent_clicked
void on_removeRegularLaneAgent_clicked()
Signal, emitted when the user clicks the remove-button of the regular lane agents table...
Definition: TrafficView.cpp:133
TrafficView::getRegularLaneAgentsView
QTableView * getRegularLaneAgentsView() const
Method which provides access to the table view displaying regular lane agents.
Definition: TrafficView.cpp:78
TrafficView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter. This filter catches the resize events of the table views in ord...
Definition: TrafficView.cpp:148
TrafficView::on_removeVolume_clicked
void on_removeVolume_clicked()
Signal, emitted when the user clicks the remove-button of the traffic volumes table. Will emit the removeVolume signal transmitting the currently selected row index of the table.
Definition: TrafficView.cpp:93
TrafficView::removeHomogeneity
void removeHomogeneity(const int &row)
Signal emitted when remove-button above the homogeneities table is clicked. Transmits the currently s...
TrafficView::getPlatoonRatesView
QTableView * getPlatoonRatesView() const
Method which provides access to the table view displaying platoon rates.
Definition: TrafficView.cpp:68
TrafficView::getVolumesView
QTableView * getVolumesView() const
Method which provides access to the table view displaying traffic volumes.
Definition: TrafficView.cpp:58
TrafficView::setName
void setName(QString const &_name)
Method which sets the traffic configuration&#39;s name to the one passed as an argument.
Definition: TrafficView.cpp:47
TrafficView::setAgentProfilesError
void setAgentProfilesError(QString const &message)
Method which displays a an error message concerning agent profiles.
Definition: TrafficView.cpp:210
TrafficView::on_addRegularLaneAgent_clicked
void on_addRegularLaneAgent_clicked()
Slot which is triggered when the user clicks on the add-button above the regular lane agents table...
Definition: TrafficView.cpp:128
TrafficView::modifiedName
void modifiedName(QString const &_name)
Signal emitted when the name of the traffic has been modified by the user. Transmits the new name to ...
TrafficView::on_removeVelocity_clicked
void on_removeVelocity_clicked()
Signal, emitted when the user clicks the remove-button of the velocities table. Will emit the removeV...
Definition: TrafficView.cpp:113
TrafficView::setHomogeneities_ProbabilityError
void setHomogeneities_ProbabilityError(bool error)
Method which displays a probability error message for the table of homogeneities if the boolian argum...
Definition: TrafficView.cpp:186
TrafficView::getHomogeneitiesView
QTableView * getHomogeneitiesView() const
Method which provides access to the table view displaying homogeneities.
Definition: TrafficView.cpp:73
TrafficView
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content s...
Definition: TrafficView.h:43
TrafficView::removeVelocity
void removeVelocity(const int &row)
Signal emitted when remove-button above the velocities table is clicked. Transmits the currently sele...
TrafficView::removeRegularLaneAgent
void removeRegularLaneAgent(const int &row)
Signal emitted when remove-button above the regular lane agents table is clicked. Transmits the curre...
TrafficView::addVelocity
void addVelocity()
Signal emitted when add-button above the velocities table is clicked.
TrafficView::setPlatoonRates_ProbabilityError
void setPlatoonRates_ProbabilityError(bool error)
Method which displays a probability error message for the table of platoon rates if the boolian argum...
Definition: TrafficView.cpp:178
TrafficView::on_addHomogeneity_clicked
void on_addHomogeneity_clicked()
Slot which is triggered when the user clicks on the add-button above the homogeneities table...
Definition: TrafficView.cpp:118
TrafficView::addHomogeneity
void addHomogeneity()
Signal emitted when add-button above the homogeneities table is clicked.
TrafficView::addRightmostLaneAgent
void addRightmostLaneAgent()
Signal emitted when add-button above the rigthmost lane agents table is clicked.
TrafficView::on_NameEdit_editingFinished
void on_NameEdit_editingFinished()
Slot which is triggered when the user has finished editing the traffic configuration&#39;s name...
Definition: TrafficView.cpp:52
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Window Plugin

Files
Window Plugin

The Window Plugin (WP) is dedicated for managing the View of the application. More...

Files

file WindowInterface.h
The Window Interface (WI) contains the functions managing the Window View of openPASS application.

Detailed Description

The Window Plugin (WP) is dedicated for managing the View of the application.

Dependencies

plugin_window__inherit__graph.svg

Detailed description

Window Plugin

The Window Plugin (WP) is dedicated for managing the View of openPASS application. It defines the main window view which includes:

  • a left side bar,
  • a widget view that changes according to the selected button on the side bar

This structure enables creating different views for each plugin (if required). The window plugin registers the plugin view with its corresponding button placed on the side bar. It also registers the corresponding menu bar of the plugin view.
When creating a plugin with a view, it should systematically include the Window Interface of the Window Plugin in order to use its methods for registering and deregistering the View of the plugin and create a button on the side bar of the main window application (see Example Create_Plugin_wth_View).

Note
The design of the widget view and the menu bar of a plugin is set in the plugin itself.
Not necessary all plugins have views (e.g. Component Plugin).
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: WindowInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Window
  • Interfaces
  • openPASS-Window
Classes
WindowInterface.h File Reference
Window Plugin

The Window Interface (WI) contains the functions managing the Window View of openPASS application. More...

Detailed Description

The Window Interface (WI) contains the functions managing the Window View of openPASS application.

The Window Interface (WI) contains the functions managing the Window View of openPASS application.
This interface belongs to the Window Plugin (WP).

Definition in file WindowInterface.h.

Go to the source code of this file.

Classes

class WindowInterface
This class manages the registration and deregistration of Window Views which include the menu bar with its buttons and menu buttons. More...
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: WindowInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Window
  • Interfaces
  • openPASS-Window
WindowInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
23
24 #ifndef WINDOWINTERFACE_H
25 #define WINDOWINTERFACE_H
26
27 #include "openPASS/ServiceInterface.h"
28 #include <QList>
29 #include <QMenu>
30 #include <QObject>
31 #include <QPushButton>
32 #include <QString>
33 #include <QWidget>
34 #include <QLineEdit>
35 #include <QLabel>
36
37 static ServiceManagerInterface::ID const WindowInterfaceID =
38 ServiceManagerInterfaceID("openPASS.Window.WindowInterface");
39
44 class WindowInterface : public QObject,
45 public ServiceInterface<WindowInterface, WindowInterfaceID>
46 {
47 Q_OBJECT
48
49 public:
50 using ID = QString;
51 using Button = QPushButton;
52 using ButtonTitle = QString;
53 using ButtonType = unsigned short;
54 using ButtonOrder = unsigned short;
55 using Widget = QWidget;
56 using Action = QPushButton;
57 using ActionTitle = QString;
58 using ActionMenu = QMenu;
59 // using Menu = QList<WindowInterface::Action *>; //!< The list of buttons in the menu of the stacked widget
60 using Menu = QList<WindowInterface::Widget*>;
61
62 public:
63 explicit WindowInterface(QObject * const parent = nullptr)
64 : QObject(parent), ServiceInterface(this) {}
65 virtual ~WindowInterface() = default;
66
67 public:
68 //-----------------------------------------------------------------------------
76 //-----------------------------------------------------------------------------
77 virtual void add(WindowInterface::ID const & id,
78 WindowInterface::Button * const button,
79 WindowInterface::Widget * const widget = nullptr,
80 WindowInterface::Menu const & menu = {}) = 0;
81
82 //-----------------------------------------------------------------------------
87 //-----------------------------------------------------------------------------
88 virtual bool remove(WindowInterface::ID const & id) = 0;
89
90 //-----------------------------------------------------------------------------
95 //-----------------------------------------------------------------------------
96 virtual bool exists(WindowInterface::ID const & id) const = 0;
97
98 public:
99 //-----------------------------------------------------------------------------
108 //-----------------------------------------------------------------------------
109 static inline WindowInterface::Button * createButton(WindowInterface::ButtonTitle const & title,
110 WindowInterface::ButtonType const & type = 0,
111 WindowInterface::ButtonOrder const & order = -1)
112 {
113 WindowInterface::Button * const button = new WindowInterface::Button(title);
114 button->setProperty("type", type);
115 button->setProperty("order", order);
116 return button;
117 }
118
119 public:
120 //-----------------------------------------------------------------------------
128 //-----------------------------------------------------------------------------
129 template <typename Object, typename Function>
130 static inline WindowInterface::Action * createAction(WindowInterface::ActionTitle const & title,
131 Object object,
132 Function function)
133 {
134 WindowInterface::Action * const action = new WindowInterface::Action(title);
135 QObject::connect(action, &WindowInterface::Action::clicked, object, function);
136 return action;
137 }
138
139 //-----------------------------------------------------------------------------
146 //-----------------------------------------------------------------------------
147 static inline WindowInterface::Action * createAction(WindowInterface::ActionTitle const & title,
148 WindowInterface::ActionMenu * const menu)
149 {
150 WindowInterface::Action * const action = new WindowInterface::Action(title);
151 action->setMenu(menu);
152 return action;
153 }
154
155
156 //-----------------------------------------------------------------------------
158 //-----------------------------------------------------------------------------
159 static inline WindowInterface::Action * createSeparator()
160 {
161 return nullptr;
162 }
163 };
164
165 #endif // WINDOWINTERFACE_H
ServiceInterface.h
...
WindowInterface::ActionMenu
QMenu ActionMenu
The drop down menu of the button in the stacked widget&#39;s menu.
Definition: WindowInterface.h:58
WindowInterface
This class manages the registration and deregistration of Window Views which include the menu bar wit...
Definition: WindowInterface.h:44
WindowInterface::ActionTitle
QString ActionTitle
The title of the button in the stacked widget&#39;s menu.
Definition: WindowInterface.h:57
WindowInterface::add
virtual void add(WindowInterface::ID const &id, WindowInterface::Button *const button, WindowInterface::Widget *const widget=nullptr, WindowInterface::Menu const &menu={})=0
Registers the Window View with the identifier id, including its selecting button, and its correspondi...
WindowInterface::Button
QPushButton Button
The button in the side bar displaying the corresponding widget.
Definition: WindowInterface.h:51
WindowInterface::Action
QPushButton Action
The button in the menu of the stacked widget.
Definition: WindowInterface.h:56
WindowInterface::ButtonType
unsigned short ButtonType
The type of the widget related button.
Definition: WindowInterface.h:53
WindowInterface::createButton
static WindowInterface::Button * createButton(WindowInterface::ButtonTitle const &title, WindowInterface::ButtonType const &type=0, WindowInterface::ButtonOrder const &order=-1)
Creates button for a Window View selection with the title title, of type type and located on the side...
Definition: WindowInterface.h:109
WindowInterface::ButtonOrder
unsigned short ButtonOrder
The order of the widget related button in the side bar.
Definition: WindowInterface.h:54
WindowInterface::createAction
static WindowInterface::Action * createAction(WindowInterface::ActionTitle const &title, Object object, Function function)
Creates button in the menu bar of the Window View object with the title title and associated to a cal...
Definition: WindowInterface.h:130
WindowInterface::Widget
QWidget Widget
The stacked widget.
Definition: WindowInterface.h:55
WindowInterface::createAction
static WindowInterface::Action * createAction(WindowInterface::ActionTitle const &title, WindowInterface::ActionMenu *const menu)
Creates a menu button in the menu bar with the title title and associated to the menu widget menu...
Definition: WindowInterface.h:147
WindowInterface::ButtonTitle
QString ButtonTitle
The title of the widget related button.
Definition: WindowInterface.h:52
WindowInterface::ID
QString ID
The identifier of the stacked widget.
Definition: WindowInterface.h:50
WindowInterface::exists
virtual bool exists(WindowInterface::ID const &id) const =0
Verifies if the Window View with the identifier id is already registred.
WindowInterface::createSeparator
static WindowInterface::Action * createSeparator()
Creates a separator in the menu bar of a Window View.
Definition: WindowInterface.h:159
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Index

Class Index
a | c | d | e | l | p | r | s | t | v | w
a
DriverProfileItemModel LoggingGroupsPresenter SensorPosition TrafficLanesPresenter
DriverProfileMapInterface
p
SensorProfileItemInterface TrafficLanesView
AddEnvironmentItem DriverProfileMapModel SensorProfileItemModel TrafficModel
AddLibrary DriverProfilesMapPresenter ParameterItemInterface SensorProfileMapInterface TrafficParametersPresenter
AddLoggingGroup DriverProfilesPresenter ParameterItemModel SensorProfileMapModel TrafficParametersView
AddTrafficItem DriverProfilesView ParameterMapInterface StatusBarView TrafficPresenter
AgentConfigurationCombinationPresenter
e
ParameterMapModel SystemComponentInputItemInterface TrafficSimulationInterface
AgentConfigurationInterface ParameterMapPresenter SystemComponentItemInterface TrafficSimulationModel
AgentConfigurationModel | EditAgentModel (AgentProfileCommands) | ProjectInterface | SystemComponentManagerInterface | TrafficSimulationPresenter
AgentConfigurationPresenter EditAgentModelCatalogue (AgentProfileCommands)
r
SystemComponentMapInterface TrafficSimulationView
AgentConfigurationView | EditAgentProfile (AgentProfileCommands) | SystemComponentOutputItemInterface | TrafficSimulationXMLBaseModel
AgentItemInterface | EditAgentSystem (AgentProfileCommands) | RemoveAgentProfile (AgentProfileCommands) | SystemComponentOutputMapInterface | TrafficSimulationXMLLoadModel
AgentMapInterface | EditAgentSystemConfig (AgentProfileCommands) | RemoveDriverProfile (AgentProfileCommands) | SystemComponentParameterItemInterface | TrafficSimulationXMLSaveModel
AgentMapModel | EditAgentType (AgentProfileCommands) | RemoveVehicleProfile (AgentProfileCommands) | SystemComponentParameterMapInterface | TrafficView
AgentMapPresenter EditDriverProfile (DriverProfileCommands) RemoveDriverProfile (DriverProfileCommands) SystemComponentScheduleInterface
v
AgentMapView EditEnvironmentName RemoveEnvironmentItem SystemConnectionItemInterface
AddAgentProfile (AgentProfileCommands) | EditNumberInvocations | RemoveLibrary | SystemConnectionMapInterface | VehicleComponentItemInterface
AddDriverProfile (AgentProfileCommands) | EditProfilesCatalogue | RemoveLoggingGroup | SystemInterface | VehicleComponentItemModel
AddVehicleProfile (AgentProfileCommands) | EditRandomSeed | RemoveTrafficItem | SystemItemInterface | VehicleComponentMapInterface
AddDriverProfile (DriverProfileCommands) | EditScenarioFile | RemoveSystem (VehicleProfileCommands) | SystemMapInterface | VehicleComponentMapModel
AddSystem (VehicleProfileCommands) | EditScenarioName | RemoveSystemProfile (VehicleProfileCommands) | SystemProfilePresenter | VehicleComponentProfileItemInterface
AddSystemProfile (VehicleProfileCommands) | EditTrafficName | RemoveVehicleProfile (VehicleProfileCommands) | SystemProfileView | VehicleComponentProfileItemModel
AddVehicleProfile (VehicleProfileCommands) EnvironmentDisplayPresenter
s
SetCurrentVehicle (VehicleProfileCommands) VehicleComponentProfileMapInterface
c
EnvironmentDisplayView SetModel (VehicleProfileCommands) VehicleComponentProfileMapModel
EnvironmentInterface | SetCurrentAgent (AgentProfileCommands) | SetModelCatalogue (VehicleProfileCommands) | VehicleProfileItemInterface
ComponentInputItemInterface | EnvironmentItemInterface | SetCurrentDriver (DriverProfileCommands) | SetSystemConfig (VehicleProfileCommands) | VehicleProfileItemModel
ComponentInputMapInterface EnvironmentItemModel ScenarioAgentsPresenter
t
VehicleProfileMapInterface
ComponentInterface EnvironmentMapPresenter ScenarioBaseView VehicleProfileMapModel
ComponentItemInterface EnvironmentModel ScenarioDisplayPresenter TrafficBaseView VehicleProfilesMapPresenter
ComponentMapInterface EnvironmentPresenter ScenarioDisplayView TrafficDisplayPresenter VehicleProfilesPresenter
ComponentOutputItemInterface EnvironmentView ScenarioInterface TrafficDisplayView VehicleProfilesView
ComponentOutputMapInterface ExperimentBaseView ScenarioModel TrafficInterface
w
ComponentParameterItemInterface ExperimentInterface ScenarioPresenter TrafficItemInterface
ComponentParameterMapInterface ExperimentModel ScenarioView TrafficItemMapInterface WidgetView
ComponentScheduleInterface ExperimentPresenter SensorItemInterface TrafficItemMapModel WindowInterface
d
ExperimentView SensorItemModel TrafficItemMapPresenter
EditVehicleProfile (VehicleProfileCommands) | SensorMapInterface | TrafficItemModel
DriverProfileItemInterface
l
SensorMapModel TrafficItemView
LibrariesPresenter
a | c | d | e | l | p | r | s | t | v | w
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Examples

Examples
Here is a list of all examples:
  • Create_Basic_Plugin
  • Create_Plugin_with_View
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Create_Basic_Plugin

Create_Basic_Plugin

To create a new Plugin in openPASS GUI, the user needs to use Qt Creator 4.2.1 (32 bit) with MinGW 4.9 in order to compile it to a dynamic C++ library for windows (.dll file). This example shows how to create a basic Plugin with a Model structure. The name of this plugin is Introduction.

I. Create a project openPASS-Introduction.pro

In the menu of Qt Creator, the user have to go to File > New File or Project > Other Project > Empty qmake Project. The project should be named under the name of the Plugin and must be created in the folder containing the project openPASS.pro.

The user have to add the new Plugin project openPASS-Introduction.pro in the list of subdirectories of the the main project file demo_openPASS-GUI.pro

The Project file should always start with a brief description of the Plugin.

It has to include the name of the Plugin and to specify that the project is to build a dynamic-link library.

It has also to include the QT libraries used for this Plugin. It is advised to indicate in which directory the plugin will be build.

II. Include Project Include files (.pri) in the project

A plugin should systematically inherit at least the interfaces from the openPASS GUI framework openPASS.pri (which handle the plugins and services for the application). The Project Include file (.pri) is just gathering these interfaces. To create such file, the user needs to do the following two steps:
a. go to File > New File or Project > Other Project > Empty File and create a file Interfaces.pri in the folder openPASS-Introduction. Then, drag this file in a new created folder Interfaces located in the local directory.

b. remove the auto-generated line in the project file openPASS-Introduction.pro and replace it with the following line:

c. include in the file Interfaces.pri the dependencies of the Plugin with interfaces from other plugins of the project.

Note
The two steps (a) and (b) are repeated for any additional Project Include file added to the project. It could be files organised according to the architecture of the Plugin (the example have just a Model stucture and will require creating one project include file Models.pri).

III. Include C++ files in the project

The last step in creating this project file is to list all the C++ class files (headers and sources) needed to build the Plugin. There will be systematically files created in the Plugin project with , as a convention, a class name including the name of the Plugin and the word Plugin (IntroductionPlugin). In this example, there will be also files created for the Project include Models.pri and defining a QObject base class (to benefit from the signal/slot structure). This last class is named IntroductionModel (the convention here is to name the classes starting with the name of the plugin and ending with the object name such as View or Model).

The created files IntroductionPlugin.h and IntroductionPlugin.cpp are needed to be filled. The remaining files are irrelevent for this example. The header file of the plugin must include the Plugin Interface. The plugin have to inherit this interface and to declare its identifier using a string defined by the project name and the plugin names (openPASS.Introduction).

The class definition in the header must declare the macro Q_INTERFACES(PluginInterface) since it uses its own services (initialize() and deinitialize()).

Concerning the source file IntroductionPlugin.cpp, it just builds the objects requested at the initialization and the destruction of these objects at the deinitialization.

Note
This example is showing how to create a basic Plugin. If it includes a View, it will have a Model/View structure as illustrated in Example Create_Plugin_with_View.
Generated on Wed Feb 19 2020 14:58:09 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Create_Plugin_with_View

Create_Plugin_with_View

Once a basic plugin is created (see Example Create_Basic_Plugin), there is just few changes to do in the plugin project and additional files to include in order to create a plugin with a View.

I. Changes in the project file openPASS-Introduction.pro

To add a View to this plugin, it needs to include the Window Interface which manages the Views in the main window application. This include is done in the Project Include file Interfaces.pri.

The architecture of the plugin have to change also. It needs to be set to a Model/View structure in order to gather the files related to the view design in the new created Project Include file Views.pri located in the created folder Views (see how to create a Project Include file in Example Create_Basic_Plugin).

II. Create files for designing the view

In the Project Include file Views.pri, create a C++ class file with a class name IntroductionView and a ui file (xml containing qraphic object designing the view) through File > New File or Project > Files and Classes > Qt > Qt Designer Form Class.

Qt Creator 4.2.1. provides tools to design the widget view and automatically update the file ui.

Warning
The size of the widget must be set to 1200x600. It is the standard size chosen for the main window application.

In the header file IntroductionView.h, the Window Interface must be included and a variable ViewID needs to be declared.

Concerning the source file IntroductionView.cpp, a line is added creating an identifier ViewID for the widget in order to register the view in a map provided by the Window Interface.

In the constructor (initialization), the window innterface is passed as an argument in order to register the view after the creation of the view (ui). The registering function has as arguments the ViewID, a button for the side bar of the main window, the object in itself and an empty menu bar.

In the destructor (deinitialization), the View is deregistred from the map and then destroyed.

III. Changes in the plugin main files

Since the architecture of the plugin have changed to a Model/View structure, the header and source files IntroductionPlugin.h and IntroductionPlugin.cpp have to be updated.

In the header file, there is only a need of declaring a variable of type IntroductionView.

Concerning the cpp source file, it first needs to include the windowInterface and the created files structuring the plugin into a Modle/View architecture.

The variable declared in the header file should be initialized in the constructor IntroductionPlugin().

It is not in the constructor but in the function initialize() where it creates the instances of needed object classes. The requested interfaces (in this case the windowInterface) must be firstly instantiated. After verification of the first step, an instance of the object representing the Model is created followed by the one for the View. Such order is in most of the cases important (not for this example) because of the dependency of the View on the Model. As a reminder, the Model should always be independent from the UI and manages the data. However, the View is just displaying the data within the UI and transmits the user requests (events) to the Model.

For deinitialization, the corresponding function is destroying reversely the created instances starting with the View then the Model.

Generated on Wed Feb 19 2020 14:58:09 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationCombinationPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
AgentConfigurationCombinationPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "AgentConfigurationCombinationPresenter.h"
12
13 #include <QFileDialog>
14
15 AgentConfigurationCombinationPresenter::AgentConfigurationCombinationPresenter(AgentConfigurationInterface *agentConfiguration,
16 AgentConfigurationView * agentConfigurationView,
17 SystemInterface * system,
18 ProjectInterface * const project,
19 QObject *parent)
20 : QObject(parent)
21 , agentConfiguration(agentConfiguration)
22 , agentConfigurationView(agentConfigurationView)
23 , currentVehicleProfile(nullptr)
24 , vehicleProfiles(agentConfiguration->getVehicleProfiles())
25 , sensorProfiles(agentConfiguration->getSensorProfiles())
26 , componentProfiles(agentConfiguration->getVehicleComponentProfiles())
27 , system(system)
28 , project(project)
29 {
30 connect(agentConfigurationView, &AgentConfigurationView::ExportSetup, this, &AgentConfigurationCombinationPresenter::convert);
31 }
32
33 void AgentConfigurationCombinationPresenter::convert()
34 {
35 QString const filename = QFileDialog::getSaveFileName(
36 agentConfigurationView, QObject::tr("openPASS / Save setup"),
37 project->getConfigPath(), QStringLiteral("ProfilesCatalogue (*.xml)"));
38
39 if(!filename.isEmpty())
40 {
41
42 // Clear registered profiles
43 componentProfiles->clear();
44 sensorProfiles->clear();
45
46
47 // Go through all defined vehicle Profiles
48 for(auto profile : vehicleProfiles->values())
49 {
50 bool dynamicMode = true;
51 QString name = profile->getName();
52 currentVehicleProfile = profile;
53 currentVehicleProfile->getSensors()->clear();
54 currentVehicleProfile->getVehicleComponents()->clear();
55
56 // load all the XML structure within the system config
57 QString path = project->absoluteToConfigPath(currentVehicleProfile->getSystemConfig());
58 system->load(path, &dynamicMode);
59
60 // go through all systems incorporated into the profile and add it to the profile in the way
61 // needed for the combinationConfig
62 for(auto type : currentVehicleProfile->getSystemProfiles()->keys() )
63 for(auto system : currentVehicleProfile->getSystems(type)->keys())
64 addSystem(system.second);
65 }
66
67 // Save the Combination Config
68 AgentConfigurationCombinationXMLSaveModel::save(filename, agentConfiguration);
69
70 }
71 }
72
73 void AgentConfigurationCombinationPresenter::addSystem(const QString &systemTitle)
74 {
75 SystemItemInterface * currentSystem = nullptr;
76 SystemComponentItemInterface * currentAlgo = nullptr;
77 VehicleComponentItemInterface::Type type;
78 VehicleComponentProfileMapInterface::ID componentProfile_id;
79
80 // 1. Determine the system ID of system with given title
81 for( auto item : system->getSystems()->values() )
82 if(item->getTitle() == systemTitle)
83 {
84 currentSystem = item;
85 break;
86 }
87
88 if(currentSystem != nullptr)
89 {
90 // 2. Find the component of type "Algorithm". It will always take the first one it finds!
91 for( auto item : currentSystem->getComponents()->values())
92 if(item->getType() == SystemComponentItemInterface::Type::Algorithm)
93 {
94 currentAlgo = item;
95 break;
96 }
97
98 if(currentAlgo !=nullptr)
99 {
100 // 3. Find out, whether a VehicleComponent exists with given library
101 type = currentAlgo->getTitle();
102 // type = currentAlgo->getLibrary();
103 componentProfile_id = VehicleComponentProfileMapInterface::ID (currentSystem->getTitle(), type );
104
105 if( currentVehicleProfile->getVehicleComponents()->contains(type) )
106 {
107 // 3.a Is there already a vehicle component profiles corresponding to the system name?
108 addVehicleComponentProfile(componentProfile_id, currentAlgo->getParameters() );
109 }
110 else
111 {
112 // 3.b Create Vehicle component according to type
113 currentVehicleProfile->getVehicleComponents()->add(type);
114
115 // Add the vehicle component profile (the method checks whether it already exists
116 addVehicleComponentProfile( componentProfile_id, currentAlgo->getParameters() );
117 }
118
119 // 4. Link the vehicle component profile to the newly added component entry with a default probability assigned to the
120 // current system!
121 if(!currentVehicleProfile->getVehicleComponents()->getItem(type)
122 ->getProfiles()->contains(componentProfiles->getItem(componentProfile_id)))
123 {
124 double probability = currentVehicleProfile->getSystems(type)->value(QPair<unsigned int, QString>
125 (currentSystem->getID(), currentSystem->getTitle()));
126
127 currentVehicleProfile->getVehicleComponents()->getItem(type)
128 ->getProfiles()->insert(componentProfiles->getItem(componentProfile_id), probability);
129
130 }
131
132 // 5. Loop over all Sensors connected to the Algorithm
133 for( auto connection : currentSystem->getConnections()->values() )
134 {
135 if(connection->getTarget()->getComponent()->getID() == currentAlgo->getID() &&
136 connection->getSource()->getComponent()->getType() == SystemComponentItemInterface::Type::Sensor)
137 {
138 // add the sensor to combination XML
139 addSensor( connection->getSource()->getComponent(),
140 currentVehicleProfile->getVehicleComponents()->getItem(type),
141 connection->getTarget());
142 }
143 }
144
145 }}
146
147 }
148
149 void AgentConfigurationCombinationPresenter::addVehicleComponentProfile(VehicleComponentProfileMapInterface::ID id,
150 SystemComponentParameterMapInterface * parameters )
151 {
152 if(!componentProfiles->contains(id))
153 {
154 componentProfiles->add(id);
155 VehicleComponentProfileItemInterface * profile = componentProfiles->getItem(id);
156
157 for(auto parameter : parameters->values())
158 {
159 // generate ID of the parameters and add it to the profile parameters
160 ParameterMapInterface::ID param_id = profile->getParameters()->generateID();
161 profile->getParameters()->add(param_id);
162
163 // adopt all the values of the system component parameters
164 ParameterItemInterface *vehicleParameter = profile->getParameters()->getItem(param_id);
165 vehicleParameter->setKey(parameter->getTitle());
166 vehicleParameter->setType(parameter->getType());
167 vehicleParameter->setValue(parameter->getValue());
168 }
169 }
170 }
171
172
173 void AgentConfigurationCombinationPresenter::addSensor(SystemComponentItemInterface * sensor,
174 VehicleComponentItemInterface *component,
175 const SystemComponentInputItemInterface *AlgoInput)
176 {
177
178 SensorProfileItemInterface * profile = findSensorProfile(sensor);
179 SensorItemInterface * vehicleSensor = findVehicleSensor(sensor, profile);
180 component->getSensorLinks()->insert(vehicleSensor->getID(), AlgoInput->getTitle());
181 }
182
183
184 SensorProfileItemInterface * AgentConfigurationCombinationPresenter::findSensorProfile(SystemComponentItemInterface * sensor)
185 {
186
187 SensorProfileMapInterface::ID id;
188 SensorProfileMapInterface::Type type= sensor->getTitle();
189 //sensor->getLibrary();
190
191 // 1. Find sensor profile with given sensor parameters
192 for( auto sensorProfile : sensorProfiles->values())
193 {
194 if(sensorProfile->getType() == type &&
195 sensorParametersIdentical(sensorProfile->getParameters(), sensor->getParameters()) )
196 return sensorProfile;
197 }
198
199 // 2. no sensor profile has been found, so it is now created
200 id = SensorProfileMapInterface::ID(sensorProfiles->generateName(type), type);
201
202 sensorProfiles->add(id);
203
204 ParameterMapInterface * profileParameters = sensorProfiles->getItem(id)->getParameters();
205 for(auto parameter : sensor->getParameters()->values())
206 {
207 // exclude parameters with ID < 6, as these describe positions
208 if(parameter->getID() >= 6)
209 {
210 // generate parameter ID and add parameter to profile
211 ParameterMapInterface::ID param_id = profileParameters->generateID();
212 profileParameters->add( param_id );
213
214 // adopt the properties from the given sensor
215 ParameterItemInterface * profileParameter = profileParameters->getItem(param_id);
216 profileParameter->setKey(parameter->getTitle());
217 profileParameter->setType(parameter->getType());
218 profileParameter->setValue(parameter->getValue());
219 }
220 }
221
222 return sensorProfiles->getItem(id);
223 }
224
225
226 bool AgentConfigurationCombinationPresenter::sensorParametersIdentical(ParameterMapInterface* profileParameters,
227 SystemComponentParameterMapInterface * sensorParameters)
228 {
229 QStringList ProfileValues;
230 QStringList ParameterValues;
231
232 for( auto profileParameter : profileParameters->values())
233 ProfileValues << profileParameter->getValue();
234
235 for(auto parameter : sensorParameters->values())
236 {
237 if(parameter->getID() >= 6)
238 ParameterValues << parameter->getValue();
239 }
240
241 return (ProfileValues == ParameterValues);
242 }
243
244
245 SensorItemInterface * AgentConfigurationCombinationPresenter::findVehicleSensor(SystemComponentItemInterface * sensor,
246 SensorProfileItemInterface * profile)
247 {
248
249 for(auto vehicleSensor : currentVehicleProfile->getSensors()->values())
250 {
251 if( vehicleSensor->getSensorProfile()->getID() == profile->getID() &&
252 sensorPositionsIdentical(sensor, vehicleSensor) )
253 return vehicleSensor;
254 }
255
256 SensorItemInterface::ID vehicleSensor_ID = currentVehicleProfile->getSensors()->generateID();
257 currentVehicleProfile->getSensors()->add(vehicleSensor_ID);
258
259 SensorItemInterface * vehicleSensor = currentVehicleProfile->getSensors()->getItem(vehicleSensor_ID);
260 SensorPosition position;
261
262 // Note: The position parameters are assumed to be the first 6 component parameters of the sensor!
263 position.Name = QString("Default");
264
265
266 position.longitudinal = sensor->getParameters()->getItem(0)->getValue().toDouble();
267 position.lateral = sensor->getParameters()->getItem(1)->getValue().toDouble();
268 position.height = sensor->getParameters()->getItem(2)->getValue().toDouble();
269
270 position.pitch = sensor->getParameters()->getItem(3)->getValue().toDouble();
271 position.yaw = sensor->getParameters()->getItem(4)->getValue().toDouble();
272 position.roll = sensor->getParameters()->getItem(5)->getValue().toDouble();
273
274
275 vehicleSensor->setSensorPosition(position);
276 vehicleSensor->setSensorProfile(profile);
277
278 return vehicleSensor;
279 }
280
281 bool AgentConfigurationCombinationPresenter::sensorPositionsIdentical(SystemComponentItemInterface * sensor,
282 SensorItemInterface * vehicleSensor)
283 {
284 SensorPosition position = vehicleSensor->getSensorPosition();
285
286 QList<double> vehicleSensorCoordinates = {position.longitudinal, position.lateral, position.height,
287 position.pitch, position.yaw, position.roll};
288
289
290 QList<double> SensorCoordinates;
291
292 // NOTE: Positions of the sensor are assumed to correspond to the first 6 parameters!
293 for(unsigned int i= 0; i<6; i++)
294 SensorCoordinates << sensor->getParameters()->getItem(i)->getValue().toDouble();
295
296 return (SensorCoordinates == vehicleSensorCoordinates);
297
298 }
SystemItemInterface::getConnections
virtual SystemItemInterface::ConnectionMap * getConnections() const =0
Creates a map to register connections that link the components of the system.
VehicleComponentMapInterface::clear
virtual void clear()=0
Method which deletes all registered vehicle component data objects and clears the map...
VehicleProfileItemInterface::getSystemConfig
virtual SystemConfig getSystemConfig() const =0
Method which returns the name of the current system config XML file.
SensorProfileMapInterface::clear
virtual void clear()=0
Method which deletes all registered sensor profiles and clears the map.
SystemComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component registered in a s...
Definition: SystemComponentParameterMapInterface.h:22
SensorItemInterface::getSensorPosition
virtual SensorPosition getSensorPosition() const =0
Method which returns the position of the sensor.
SystemItemInterface::getTitle
virtual SystemItemInterface::Title getTitle() const =0
Gets the title of the current registered system.
AgentConfigurationView
This class constitutes the main view of the agent configuration plugin. It instantiates the action me...
Definition: AgentConfigurationView.h:50
VehicleComponentMapInterface::add
virtual bool add(VehicleComponentMapInterface::Type const &type)=0
Method which creates a new vehicle component data object (instance of VehicleComponentItemInterface) ...
SensorProfileMapInterface::add
virtual bool add(SensorProfileMapInterface::ID const &id)=0
Method which creates a new sensor profile (instance of SensorProfileItemInterface) and adds it to the...
SystemComponentParameterMapInterface::getItem
virtual SystemComponentParameterMapInterface::Item * getItem(SystemComponentParameterMapInterface::ID const &id) const =0
Gets the registered parameter related-object under the key identifier id.
SensorItemInterface
The SensorItemInterface class combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to a sensor data object.
Definition: SensorItemInterface.h:56
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
ParameterItemInterface::getValue
virtual Value getValue() const =0
Method which returns the value of this parameter.
ParameterItemInterface::setValue
virtual void setValue(Value const &value)=0
Method which sets the value of this parameter to the given one.
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
VehicleProfileItemInterface::getVehicleComponents
virtual VehicleComponents * getVehicleComponents() const =0
Method which returns the map of vehicle components, i.e. the container class for instances of the Veh...
AgentConfigurationCombinationPresenter.h
This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of t...
SensorProfileMapInterface::generateName
virtual Name generateName(Type type)=0
Method wich generates a default name of the pattern "Standard %1" for a sensor profile of the given t...
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SensorPosition
This structure gathers all variables which specify a sensor position. This includes three spatial coo...
Definition: SensorItemInterface.h:39
VehicleComponentProfileMapInterface::getItem
virtual VehicleComponentProfileMapInterface::Item * getItem(VehicleComponentProfileMapInterface::ID const &id) const =0
Method which returns a pointer to the vehicle component profile with the given Id. If the map does not contain a vehicle component profile with this Id, nullptr is returned.
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SensorMapInterface::clear
virtual void clear()=0
Method which deletes all sensor data objects and clears the map.
SystemComponentItemInterface::getTitle
virtual SystemComponentItemInterface::Title getTitle() const =0
Gets the title of the current registered component.
SensorProfileMapInterface::getItem
virtual SensorProfileMapInterface::Item * getItem(SensorProfileMapInterface::ID const &id) const =0
Method which returns a pointer to the sensor profile with the given Id. If the map does not contain a...
VehicleComponentProfileItemInterface
This class defines vehicle component profiles which contain the parameterization of a vehicle compone...
Definition: VehicleComponentProfileItemInterface.h:40
SensorMapInterface::getItem
virtual SensorMapInterface::Item * getItem(SensorMapInterface::ID const &id) const =0
Method which returns a pointer to the sensor data object specified by the given id. If the map does not contain an object with the given id, nullptr is returned.
VehicleComponentProfileMapInterface::contains
virtual bool contains(VehicleComponentProfileMapInterface::ID const &id) const =0
Method wich checks whether the map contains a vehicle component profile with the given Id...
ParameterItemInterface::setType
virtual void setType(Type const &type)=0
Method which sets the datatype of this parameter to the given type.
SensorItemInterface::getID
virtual ID getID() const =0
Method which returns the id of this sensor, if this sensor is registered in a map (SensorMapInterface...
SensorProfileItemInterface::getParameters
virtual Parameters * getParameters() const =0
Method which returns the parameter map of this sensor profile (instance of ParameterMapInterface).
VehicleComponentProfileMapInterface::add
virtual bool add(VehicleComponentProfileMapInterface::ID const &id)=0
Method which creates a new vehicle component profile (instance of VehicleComponentProfileItemInterfac...
SystemComponentItemInterface::getParameters
virtual SystemComponentItemInterface::ParameterMap * getParameters() const =0
Gets the parameters of the current registered component.
VehicleComponentProfileMapInterface::ID
QPair< Name, Type > ID
typedef for the pair of name and type used as an Id
Definition: VehicleComponentProfileMapInterface.h:49
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
VehicleProfileItemInterface::getSystemProfiles
virtual SystemProfiles * getSystemProfiles() const =0
Method which returns all mappings of systems to probabilities sorted by their algorithm type...
SensorItemInterface::getSensorProfile
virtual Profile * getSensorProfile() const =0
Method which returns the sensor profile which is currently used.
SensorMapInterface::add
virtual bool add(SensorMapInterface::ID const &id)=0
Method which creates a sensor data object (instance of SensorItemInterface) and adds it to the map un...
VehicleComponentItemInterface::getProfiles
virtual Profiles * getProfiles() const =0
Method which returns the map of profiles assigned to probabilites.
SensorItemInterface::setSensorProfile
virtual void setSensorProfile(Profile *const _profile)=0
Method which sets the sensor profile to the one passed as an argument.
SystemInterface::load
virtual bool load(QString const &filepath)=0
Loads a system from a file located in the given path filepath. (e.g. function called when users press...
SensorItemInterface::setSensorPosition
virtual void setSensorPosition(SensorPosition const &position)=0
Method which sets the position of the sensor to the one passed as an argument.
SystemInterface
This class manages creating new systems and also creating the tree of components loaded from a librar...
Definition: SystemInterface.h:27
VehicleProfileItemInterface::getSystems
virtual Systems * getSystems(AlgoType const &_type) const =0
Method which returns the mapping of all systems of the given algorithm type to their equipment probab...
SystemComponentItemInterface::getID
virtual SystemComponentItemInterface::ID getID() const =0
Gets the key identifier of the current component registered in the system.
SystemItemInterface::getComponents
virtual SystemItemInterface::ComponentMap * getComponents() const =0
Creates a map to register components that build the system.
SystemInterface::getSystems
virtual SystemMapInterface * getSystems() const =0
Creates a map (container) to register systems.
ParameterMapInterface::values
virtual QList< Item * > values() const =0
Method which returns the list of all parameters registered in this map.
SensorProfileMapInterface::Type
SensorProfileItemInterface::Type Type
typedef for the sensor type (i.e. its algorithm/implementation)
Definition: SensorProfileMapInterface.h:48
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
AgentConfigurationView::ExportSetup
void ExportSetup()
Signal, emitted after the export-button in the action menu has been clicked.
VehicleComponentMapInterface::contains
virtual bool contains(VehicleComponentMapInterface::Type const &type) const =0
Method wich checks whether the map contains a vehicle component data object with the given type...
VehicleComponentItemInterface::Type
QString Type
typedef for the component type (= algorithm)
Definition: VehicleComponentItemInterface.h:48
SensorProfileMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all sensor profiles in the map.
VehicleProfileItemInterface::getSensors
virtual Sensors * getSensors() const =0
Method which returns the map of sensors, i.e. the container class for instances of the SensorItemInte...
ParameterMapInterface::generateID
virtual ParameterMapInterface::ID generateID()=0
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
VehicleComponentItemInterface
The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a ...
Definition: VehicleComponentItemInterface.h:42
SensorProfileItemInterface
This class defines objects containing all relevant information on sensor profiles.
Definition: SensorProfileItemInterface.h:36
VehicleComponentMapInterface::getItem
virtual VehicleComponentMapInterface::Item * getItem(VehicleComponentMapInterface::Type const &type) const =0
Method which returns a pointer to the vehicle component data object of the given type. If the map does not contain a vehicle component data object of that type, nullptr is returned.
ParameterMapInterface::ID
ParameterItemInterface::ID ID
typedef for the id of a parameter
Definition: ParameterMapInterface.h:42
VehicleComponentProfileMapInterface::clear
virtual void clear()=0
Method which deletes all registered vehicle component profiles and clears the map.
SensorMapInterface::values
virtual QList< Item * > values() const =0
Method which returns the list of all sensor data objects registered in this map.
AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
Definition: AgentConfigurationInterface.h:52
SensorItemInterface::ID
unsigned int ID
typedef for the sensor&#39;s key identifier
Definition: SensorItemInterface.h:62
SystemItemInterface::getID
virtual SystemItemInterface::ID getID() const =0
Gets from the map (container) the key identifier of the current registered system.
SensorProfileItemInterface::getID
virtual ID getID() const =0
Method which returns the identifier of the sensor profile, i.e. the pair of name and type...
SensorMapInterface::generateID
virtual SensorMapInterface::ID generateID()=0
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
SensorProfileMapInterface::ID
QPair< Name, Type > ID
typedef for the pair of name and type used as an Id
Definition: SensorProfileMapInterface.h:49
SystemComponentInputItemInterface::getTitle
virtual SystemComponentInputItemInterface::Title getTitle() const =0
Gets the title of the current registered input.
ParameterItemInterface::setKey
virtual void setKey(Key const &key)=0
Method which sets the key description of this parameter to the given one.
SystemComponentParameterItemInterface::getValue
virtual SystemComponentParameterItemInterface::Value getValue() const =0
Gets the value of the current registered parameter.
VehicleComponentItemInterface::getSensorLinks
virtual SensorLinks * getSensorLinks() const =0
Method which returns the map of sensor links.
ParameterMapInterface::add
virtual bool add(ParameterMapInterface::ID const &id)=0
Method which creates a parameter (instance of ParameterItemInterface) and adds it to the map under th...
VehicleProfileMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all vehicle profiles in the map.
VehicleComponentProfileItemInterface::getParameters
virtual Parameters * getParameters() const =0
Method which returns the parameter map of the vehicle component profile.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationCombinationXMLBaseModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentConfigurationCombinationXMLBaseModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "AgentConfigurationCombinationXMLBaseModel.h"
12
13 QString const AgentConfigurationCombinationXMLBaseModel::KeyRoot = QStringLiteral("Profiles");
14
15 QString const AgentConfigurationCombinationXMLBaseModel::KeyVehicleProfiles = QStringLiteral("VehicleProfiles");
16 QString const AgentConfigurationCombinationXMLBaseModel::KeyVehicleProfile = QStringLiteral("VehicleProfile");
17 QString const AgentConfigurationCombinationXMLBaseModel::KeyModel = QStringLiteral("Model");
18 QString const AgentConfigurationCombinationXMLBaseModel::KeyComponents = QStringLiteral("Components");
19 QString const AgentConfigurationCombinationXMLBaseModel::KeyComponent = QStringLiteral("Component");
20 QString const AgentConfigurationCombinationXMLBaseModel::KeyProfiles = QStringLiteral("Profiles");
21 QString const AgentConfigurationCombinationXMLBaseModel::KeyProfile = QStringLiteral("Profile");
22 QString const AgentConfigurationCombinationXMLBaseModel::KeySensorLinks = QStringLiteral("SensorLinks");
23 QString const AgentConfigurationCombinationXMLBaseModel::KeySensorLink = QStringLiteral("SensorLink");
24 QString const AgentConfigurationCombinationXMLBaseModel::KeySensors= QStringLiteral("Sensors");
25 QString const AgentConfigurationCombinationXMLBaseModel::KeySensor= QStringLiteral("Sensor");
26 QString const AgentConfigurationCombinationXMLBaseModel::KeyPosition= QStringLiteral("Position");
27
28
29
30 QString const AgentConfigurationCombinationXMLBaseModel::KeyVehicleComponentProfiles= QStringLiteral("VehicleComponentProfiles");
31 QString const AgentConfigurationCombinationXMLBaseModel::KeyVehicleComponentProfile= QStringLiteral("VehicleComponentProfile");
32
33
34
35 QString const AgentConfigurationCombinationXMLBaseModel::KeySensorProfiles= QStringLiteral("SensorProfiles");
36 QString const AgentConfigurationCombinationXMLBaseModel::KeySensorProfile= QStringLiteral("SensorProfile");
37
38
39
40 QString const AgentConfigurationCombinationXMLBaseModel::KeyParameterDouble= QStringLiteral("Double");
41 QString const AgentConfigurationCombinationXMLBaseModel::KeyParameterBool= QStringLiteral("Bool");
42 QString const AgentConfigurationCombinationXMLBaseModel::KeyParameterInt= QStringLiteral("Int");
43 QString const AgentConfigurationCombinationXMLBaseModel::KeyParameterFloat= QStringLiteral("Float");
44 QString const AgentConfigurationCombinationXMLBaseModel::KeyParameterString= QStringLiteral("String");
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationCombinationXMLBaseModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentConfigurationCombinationXMLBaseModel.h
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #ifndef AGENTCONFIGURATIONCOMBINATIONXMLBASEMODEL_H
12 #define AGENTCONFIGURATIONCOMBINATIONXMLBASEMODEL_H
13
14 #include <QString>
15
16 class AgentConfigurationCombinationXMLBaseModel
17 {
18
19 public:
20 explicit AgentConfigurationCombinationXMLBaseModel() = delete;
21 ~AgentConfigurationCombinationXMLBaseModel() =default;
22
23 protected:
24 static QString const KeyRoot;
25
26 protected:
27 static QString const KeyVehicleProfiles;
28 static QString const KeyVehicleProfile;
29 static QString const KeyModel;
30 static QString const KeyComponents;
31 static QString const KeyComponent;
32 static QString const KeyProfiles;
33 static QString const KeyProfile;
34 static QString const KeySensorLinks;
35 static QString const KeySensorLink;
36 static QString const KeySensors;
37 static QString const KeySensor;
38 static QString const KeyPosition;
39
40 protected:
41 static QString const KeyVehicleComponentProfiles;
42 static QString const KeyVehicleComponentProfile;
43
44 protected:
45 static QString const KeySensorProfiles;
46 static QString const KeySensorProfile;
47
48 protected:
49 static QString const KeyParameterDouble;
50 static QString const KeyParameterBool;
51 static QString const KeyParameterInt;
52 static QString const KeyParameterFloat;
53 static QString const KeyParameterString;
54
55 };
56
57 #endif // AGENTCONFIGURATIONCOMBINATIONXMLBASEMODEL_H
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationCombinationXMLSaveModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentConfigurationCombinationXMLSaveModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "AgentConfigurationCombinationXMLSaveModel.h"
12 #include "AgentConfigurationXMLSaveModel.h"
13
14 #include <QRegularExpression>
15
16 bool AgentConfigurationCombinationXMLSaveModel::save(const QString &filepath,
17 const AgentConfigurationInterface * const agentConfiguration)
18 {
19 QFile file(filepath);
20
21 if(file.open(QIODevice::WriteOnly | QIODevice::Text))
22 {
23 QXmlStreamWriter xml(&file);
24
25 xml.setAutoFormatting(true);
26 xml.setAutoFormattingIndent(2);
27
28 // Start Document
29 xml.writeStartDocument();
30
31 // Write root tag
32 xml.writeStartElement(KeyRoot);
33 xml.writeAttribute("SchemaVersion", "0.2.1");
34
35 // Save agent profiles
36 AgentConfigurationXMLSaveModel::saveAgentProfiles(xml, agentConfiguration->getAgents());
37
38 // save driver profiles
39 AgentConfigurationXMLSaveModel::saveDriverProfiles(xml, agentConfiguration->getDriverProfiles());
40
41 // Save Vehicle Profiles
42 saveVehicleProfiles(xml, agentConfiguration->getVehicleProfiles());
43
44 // Save Vehicle Component Profiles
45 saveVehicleComponentProfiles(xml, agentConfiguration->getVehicleComponentProfiles());
46
47 // Save Sensor Profiles
48 saveSensorProfiles(xml, agentConfiguration->getSensorProfiles());
49
50 xml.writeEndElement();
51 xml.writeEndDocument();
52
53 return true;
54 }
55
56
57 return false;
58 }
59
60
61 void AgentConfigurationCombinationXMLSaveModel::saveVehicleProfiles(QXmlStreamWriter & xml,
62 VehicleProfileMapInterface *vehicleProfiles)
63 {
64 xml.writeStartElement(KeyVehicleProfiles);
65
66 for( auto profile : vehicleProfiles->values() )
67 {
68 xml.writeStartElement(KeyVehicleProfile);
69 xml.writeAttribute(QString("Name"), profile->getName());
70
71 xml.writeStartElement(KeyModel);
72 xml.writeAttribute(QString("Name"), profile->getModel());
73 xml.writeEndElement();
74
75 saveComponents(xml, profile->getVehicleComponents());
76
77 saveSensors(xml, profile->getSensors());
78
79 xml.writeEndElement();
80 }
81
82 xml.writeEndElement();
83 xml.writeComment("#############################################################################################");
84 }
85
86
87 void AgentConfigurationCombinationXMLSaveModel::saveComponents(QXmlStreamWriter &xml,
88 VehicleComponentMapInterface *components)
89 {
90 xml.writeStartElement(KeyComponents);
91
92 for(auto component : components->values())
93 {
94 xml.writeStartElement(KeyComponent);
95 xml.writeAttribute(QString("Type"), component->getType());
96
97 // 1. Save Profiles
98 saveIncludedComponentProfiles(xml, component->getProfiles());
99
100 // 2. Save Sensor Links
101 saveSensorLinks(xml, component->getSensorLinks());
102
103 xml.writeEndElement();
104 }
105
106 xml.writeEndElement();
107 }
108
109
110 void AgentConfigurationCombinationXMLSaveModel::saveIncludedComponentProfiles(QXmlStreamWriter &xml,
111 VehicleComponentItemInterface::Profiles * profiles)
112 {
113 xml.writeStartElement(KeyProfiles);
114
115 for(auto profile : profiles->keys() )
116 {
117 xml.writeStartElement(KeyProfile);
118
119 xml.writeAttribute(QString("Name"), profile->getName());
120 xml.writeAttribute(QString("Probability"), QString::number(profiles->value(profile)));
121
122 xml.writeEndElement();
123 }
124
125 xml.writeEndElement();
126 }
127
128
129 void AgentConfigurationCombinationXMLSaveModel::saveSensorLinks(QXmlStreamWriter &xml,
130 VehicleComponentItemInterface::SensorLinks * sensorLinks)
131 {
132 xml.writeStartElement(KeySensorLinks);
133
134 for(auto link : sensorLinks->keys())
135 {
136 xml.writeStartElement(KeySensorLink);
137
138 xml.writeAttribute(QString("SensorId"), QString::number(link));
139 xml.writeAttribute(QString("InputId"), sensorLinks->value(link) );
140
141 xml.writeEndElement();
142 }
143
144 xml.writeEndElement();
145 }
146
147
148 void AgentConfigurationCombinationXMLSaveModel::saveSensors(QXmlStreamWriter &xml,
149 SensorMapInterface *sensors)
150 {
151 xml.writeStartElement(KeySensors);
152
153 for(auto sensor : sensors->values())
154 {
155 xml.writeStartElement(KeySensor);
156 xml.writeAttribute(QString("Id"), QString::number(sensor->getID()));
157
158 saveSensorPosition(xml, sensor->getSensorPosition());
159
160 xml.writeStartElement(KeyProfile);
161 xml.writeAttribute(QString("Name"), sensor->getSensorProfile()->getName());
162 xml.writeAttribute(QString("Type"), sensor->getSensorProfile()->getType());
163 xml.writeEndElement();
164
165
166 xml.writeEndElement();
167 }
168
169 xml.writeEndElement();
170 }
171
172 void AgentConfigurationCombinationXMLSaveModel::saveSensorPosition(QXmlStreamWriter &xml,
173 SensorPosition position)
174 {
175 xml.writeStartElement(KeyPosition);
176 xml.writeAttribute(QString("Name"), position.Name);
177
178 xml.writeAttribute(QString("Longitudinal"), QString::number(position.longitudinal));
179 xml.writeAttribute(QString("Lateral"), QString::number(position.lateral));
180 xml.writeAttribute(QString("Height"), QString::number(position.height));
181
182 xml.writeAttribute(QString("Pitch"), QString::number(position.pitch));
183 xml.writeAttribute(QString("Yaw"), QString::number(position.yaw));
184 xml.writeAttribute(QString("Roll"), QString::number(position.roll));
185
186
187 xml.writeEndElement();
188 }
189
190
191 void AgentConfigurationCombinationXMLSaveModel::saveVehicleComponentProfiles(QXmlStreamWriter &xml,
192 VehicleComponentProfileMapInterface *componentProfiles)
193 {
194 xml.writeStartElement(KeyVehicleComponentProfiles);
195
196 for(auto profile : componentProfiles->values())
197 {
198 xml.writeStartElement(KeyVehicleComponentProfile);
199 xml.writeAttribute(QString("Name"), profile->getName());
200 xml.writeAttribute(QString("Type"), profile->getType());
201
202 saveVehicleComponentProfileParameters(xml, profile->getParameters());
203
204 xml.writeEndElement();
205 }
206
207 xml.writeEndElement();
208 xml.writeComment("#############################################################################################");
209 }
210
211
212 void AgentConfigurationCombinationXMLSaveModel::saveVehicleComponentProfileParameters(QXmlStreamWriter &xml,
213 ParameterMapInterface *parameters)
214 {
215 for(auto parameter : parameters->values())
216 {
217 QString Type = toLiteral(parameter->getType());
218 xml.writeStartElement(Type);
219 xml.writeAttribute(QString("Key"), parameter->getKey());
220
221 /* if(Type == "Bool")
222 {
223 QString value = parameter->getValue() == "1" ? "true" : "false";
224 xml.writeAttribute(QString("Value"), value);
225 }*/
226 if(Type == "NormalDistribution")
227 {
228 QString value = parameter->getValue();
229 xml.writeAttribute(QString("Mean"), value.section(",",0,0));
230 xml.writeAttribute(QString("SD"), value.section(",",1,1));
231 xml.writeAttribute(QString("Min"), value.section(",",2,2));
232 xml.writeAttribute(QString("Max"), value.section(",",3,3));
233 }
234 else
235 xml.writeAttribute(QString("Value"), parameter->getValue());
236
237 xml.writeEndElement();
238 }
239 }
240
241 void AgentConfigurationCombinationXMLSaveModel::saveSensorProfiles(QXmlStreamWriter &xml,
242 SensorProfileMapInterface *sensorProfiles)
243 {
244 xml.writeStartElement(KeySensorProfiles);
245
246 for(auto profile : sensorProfiles->values())
247 {
248 xml.writeStartElement(KeySensorProfile);
249 xml.writeAttribute(QString("Name"), profile->getName());
250 xml.writeAttribute(QString("Type"), profile->getType());
251
252 saveSensorProfileParameters(xml, profile->getParameters());
253
254 xml.writeEndElement();
255 }
256
257 xml.writeEndElement();
258 xml.writeComment("#############################################################################################");
259 }
260
261
262 void AgentConfigurationCombinationXMLSaveModel::saveSensorProfileParameters(QXmlStreamWriter &xml,
263 ParameterMapInterface *parameters)
264 {
265 for(auto parameter: parameters->values())
266 {
267 QString Type = toLiteral(parameter->getType());
268 xml.writeStartElement(Type);
269 xml.writeAttribute(QString("Key"), parameter->getKey());
270
271 if(Type == "NormalDistribution")
272 {
273 QString value = parameter->getValue();
274 xml.writeAttribute(QString("Mean"), value.section(",",0,0));
275 xml.writeAttribute(QString("SD"), value.section(",",1,1));
276 xml.writeAttribute(QString("Min"), value.section(",",2,2));
277 xml.writeAttribute(QString("Max"), value.section(",",3,3));
278 }
279 else
280 xml.writeAttribute(QString("Value"), parameter->getValue());
281
282 xml.writeEndElement();
283 }
284 }
285
286 QString AgentConfigurationCombinationXMLSaveModel::toLiteral(QString string)
287 {
288 // Replace Ã¤, Ã¶, Ã¼ with ae, oe, ue
289 string.replace(QStringLiteral("Ã¤"), QStringLiteral("ae"));
290 string.replace(QStringLiteral("Ã¶"), QStringLiteral("oe"));
291 string.replace(QStringLiteral("Ã¼"), QStringLiteral("ue"));
292
293 // Replace Ã, Ã, Ã with AE, OE, UE
294 string.replace(QStringLiteral("Ã"), QStringLiteral("AE"));
295 string.replace(QStringLiteral("Ã"), QStringLiteral("OE"));
296 string.replace(QStringLiteral("Ã"), QStringLiteral("UE"));
297
298 // Split string in single words
299 QStringList parts = string.split(
300 QRegularExpression(QStringLiteral("[\\W_]+")),
301 QString::SkipEmptyParts);
302
303 // Upper first character of each word
304 for (QString & part : parts)
305 {
306 part.replace(0, 1, part[0].toUpper());
307 }
308
309 // Join words to literal
310 return parts.join(QStringLiteral(""));
311 }
AgentConfigurationInterface::getDriverProfiles
virtual DriverProfileMapInterface * getDriverProfiles() const =0
Method which provides access to the map of driver profiles.
AgentConfigurationInterface::getVehicleProfiles
virtual VehicleProfileMapInterface * getVehicleProfiles() const =0
Method which provides access to the map of vehicle profiles.
VehicleComponentMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all vehicle component data objects in the map...
VehicleComponentProfileMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all vehicle component profiles in the map.
AgentConfigurationInterface::getSensorProfiles
virtual SensorProfileMapInterface * getSensorProfiles() const =0
Method which provides access to the map of sensor profiles.
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
SensorPosition
This structure gathers all variables which specify a sensor position. This includes three spatial coo...
Definition: SensorItemInterface.h:39
AgentConfigurationInterface::getVehicleComponentProfiles
virtual VehicleComponentProfileMapInterface * getVehicleComponentProfiles() const =0
Method which provides access to the map of vehicle component profiles (in fact, ADAS algorithms)...
SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
Definition: SensorProfileMapInterface.h:41
VehicleComponentMapInterface
This class constitutes a container class for vehicle component data (instances of VehicleComponentIte...
Definition: VehicleComponentMapInterface.h:38
ParameterMapInterface::values
virtual QList< Item * > values() const =0
Method which returns the list of all parameters registered in this map.
SensorProfileMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all sensor profiles in the map.
VehicleComponentItemInterface::Profiles
QMap< Profile *, Probability > Profiles
typedef for the map which assigns probabilities to profiles
Definition: VehicleComponentItemInterface.h:53
SensorMapInterface
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are ...
Definition: SensorMapInterface.h:36
VehicleComponentProfileMapInterface
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
Definition: VehicleComponentProfileMapInterface.h:41
SensorMapInterface::values
virtual QList< Item * > values() const =0
Method which returns the list of all sensor data objects registered in this map.
AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
Definition: AgentConfigurationInterface.h:52
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
VehicleComponentItemInterface::SensorLinks
QMap< unsigned int, QString > SensorLinks
typedef for the map describing sensor links
Definition: VehicleComponentItemInterface.h:54
AgentConfigurationInterface::getAgents
virtual AgentMapInterface * getAgents() const =0
Method which provides access to the map of agent profiles.
VehicleProfileMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all vehicle profiles in the map.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationCombinationXMLSaveModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentConfigurationCombinationXMLSaveModel.h
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #ifndef AGENTCONFIGURATIONCOMBINATIONXMLSAVEMODEL_H
12 #define AGENTCONFIGURATIONCOMBINATIONXMLSAVEMODEL_H
13
14 #include "openPASS-AgentConfiguration/AgentConfigurationInterface.h"
15
16 #include "AgentConfigurationCombinationXMLBaseModel.h"
17
18 #include <QFile>
19 #include <QXmlStreamWriter>
20 #include <QString>
21
22 class AgentConfigurationCombinationXMLSaveModel : public AgentConfigurationCombinationXMLBaseModel
23 {
24 public:
25 explicit AgentConfigurationCombinationXMLSaveModel() = delete;
26 ~AgentConfigurationCombinationXMLSaveModel() = default;
27
28 public:
29 static bool save(const QString &filepath,
30 const AgentConfigurationInterface * const agentConfiguration);
31
32 static void saveVehicleProfiles(QXmlStreamWriter & xml,
33 VehicleProfileMapInterface *vehicleProfiles);
34
35 static void saveComponents(QXmlStreamWriter & xml,
36 VehicleComponentMapInterface * components);
37
38 static void saveIncludedComponentProfiles(QXmlStreamWriter &xml,
39 VehicleComponentItemInterface::Profiles * profiles);
40
41 static void saveSensorLinks(QXmlStreamWriter &xml,
42 VehicleComponentItemInterface::SensorLinks * sensorLinks);
43
44 static void saveSensors(QXmlStreamWriter & xml,
45 SensorMapInterface * sensors);
46
47 static void saveSensorPosition(QXmlStreamWriter & xml,
48 SensorPosition position);
49
50
51 public:
52 static void saveVehicleComponentProfiles(QXmlStreamWriter & xml,
53 VehicleComponentProfileMapInterface * componentProfiles);
54
55 static void saveVehicleComponentProfileParameters(QXmlStreamWriter & xml,
56 ParameterMapInterface *parameters);
57
58 static void saveSensorProfiles(QXmlStreamWriter & xml,
59 SensorProfileMapInterface * sensorProfiles);
60
61 static void saveSensorProfileParameters(QXmlStreamWriter & xml,
62 ParameterMapInterface * parameters);
63
64 private:
65 static QString toLiteral(QString string);
66
67 };
68
69 #endif // AGENTCONFIGURATIONCOMBINATIONXMLSAVEMODEL_H
AgentConfigurationInterface.h
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
SensorPosition
This structure gathers all variables which specify a sensor position. This includes three spatial coo...
Definition: SensorItemInterface.h:39
SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
Definition: SensorProfileMapInterface.h:41
VehicleComponentMapInterface
This class constitutes a container class for vehicle component data (instances of VehicleComponentIte...
Definition: VehicleComponentMapInterface.h:38
VehicleComponentItemInterface::Profiles
QMap< Profile *, Probability > Profiles
typedef for the map which assigns probabilities to profiles
Definition: VehicleComponentItemInterface.h:53
SensorMapInterface
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are ...
Definition: SensorMapInterface.h:36
VehicleComponentProfileMapInterface
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
Definition: VehicleComponentProfileMapInterface.h:41
AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
Definition: AgentConfigurationInterface.h:52
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
VehicleComponentItemInterface::SensorLinks
QMap< unsigned int, QString > SensorLinks
typedef for the map describing sensor links
Definition: VehicleComponentItemInterface.h:54
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentConfigurationModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "Models/AgentConfigurationModel.h"
12
13 AgentConfigurationModel::AgentConfigurationModel(QObject *parent)
14 : AgentConfigurationInterface(parent)
15 , agents(new AgentMapModel(this))
16 , vehicleProfiles(new VehicleProfileMapModel(this))
17 , driverProfiles(new DriverProfileMapModel(this))
18 , componentProfiles(new VehicleComponentProfileMapModel(this))
19 , sensorProfiles(new SensorProfileMapModel(this))
20 {
21 }
22
23
24 AgentMapInterface * AgentConfigurationModel::getAgents() const
25 {
26 return agents;
27 }
28
29 VehicleProfileMapInterface * AgentConfigurationModel::getVehicleProfiles() const
30 {
31 return vehicleProfiles;
32 }
33
34 DriverProfileMapInterface * AgentConfigurationModel::getDriverProfiles() const
35 {
36 return driverProfiles;
37 }
38
39 VehicleComponentProfileMapInterface * AgentConfigurationModel::getVehicleComponentProfiles() const
40 {
41 return componentProfiles;
42 }
43
44 SensorProfileMapInterface * AgentConfigurationModel::getSensorProfiles() const
45 {
46 return sensorProfiles;
47 }
48
AgentConfigurationModel::agents
AgentMapModel *const agents
the pointer to the map of agent profiles
Definition: AgentConfigurationModel.h:46
AgentConfigurationModel::getVehicleComponentProfiles
virtual VehicleComponentProfileMapInterface * getVehicleComponentProfiles() const override
Method which provides access to the map of vehicle component profiles (in fact, ADAS algorithms)...
Definition: AgentConfigurationModel.cpp:39
AgentMapModel
This class implements the functionality of AgentMapInterface.
Definition: AgentMapModel.h:27
AgentConfigurationModel::driverProfiles
DriverProfileMapModel *const driverProfiles
the pointer to the map of driver profiles
Definition: AgentConfigurationModel.h:48
AgentConfigurationModel::getDriverProfiles
virtual DriverProfileMapInterface * getDriverProfiles() const override
Method which provides access to the map of driver profiles.
Definition: AgentConfigurationModel.cpp:34
AgentConfigurationModel::componentProfiles
VehicleComponentProfileMapModel *const componentProfiles
the pointer to the map of vehicle component profiles (corresponding to algorithms of an ADAS) ...
Definition: AgentConfigurationModel.h:49
DriverProfileMapModel
This class implements the functionality of DriverProfileMapInterface.
Definition: DriverProfileMapModel.h:25
AgentConfigurationModel::getAgents
virtual AgentMapInterface * getAgents() const override
Method which provides access to the map of agent profiles.
Definition: AgentConfigurationModel.cpp:24
AgentConfigurationModel.h
This class implements the functionality of AgentConfigurationInterface.
VehicleComponentProfileMapModel
This class implements the functionality of VehicleComponentProfileMapInterface.
Definition: VehicleComponentProfileMapModel.h:26
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
AgentConfigurationModel::getSensorProfiles
virtual SensorProfileMapInterface * getSensorProfiles() const override
Method which provides access to the map of sensor profiles.
Definition: AgentConfigurationModel.cpp:44
AgentConfigurationModel::sensorProfiles
SensorProfileMapModel *const sensorProfiles
the pointer to the map of sensor profiles
Definition: AgentConfigurationModel.h:50
VehicleProfileMapModel
This class implements the functionality of VehicleProfileMapInterface.
Definition: VehicleProfileMapModel.h:25
SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
Definition: SensorProfileMapInterface.h:41
AgentConfigurationModel::getVehicleProfiles
virtual VehicleProfileMapInterface * getVehicleProfiles() const override
Method which provides access to the map of vehicle profiles.
Definition: AgentConfigurationModel.cpp:29
AgentConfigurationModel::vehicleProfiles
VehicleProfileMapModel *const vehicleProfiles
the pointer to the map of vehicle profiles
Definition: AgentConfigurationModel.h:47
VehicleComponentProfileMapInterface
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
Definition: VehicleComponentProfileMapInterface.h:41
AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
Definition: AgentMapInterface.h:37
AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
Definition: AgentConfigurationInterface.h:52
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
SensorProfileMapModel
This class implements the functionality of SensorProfileMapInterface.
Definition: SensorProfileMapModel.h:25
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationPlugin.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
AgentConfigurationPlugin.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "AgentConfigurationPlugin.h"
12
13 #include "openPASS-Window/WindowInterface.h"
14 #include "openPASS-System/SystemInterface.h"
15
16 #include "Models/AgentConfigurationModel.h"
17 #include "Presenters/AgentConfigurationPresenter.h"
18 #include "Presenters/AgentConfigurationCombinationPresenter.h"
19 #include "Views/AgentConfigurationView.h"
20
21 AgentConfigurationPlugin::AgentConfigurationPlugin(QObject * const parent)
22 : QObject(parent)
23 , agentConfigurationModel(nullptr)
24 , agentConfigurationPresenter(nullptr)
25 , agentConfigurationView(nullptr)
26 {
27 }
28
29 bool AgentConfigurationPlugin::initialize()
30 {
31 WindowInterface * const window = WindowInterface::instance();
32 ProjectInterface * const project = ProjectInterface::instance();
33 SystemInterface * const system = SystemInterface::instance();
34
35 if (window && system && project)
36 {
37 SystemInterface * systemModel = system->createSystemModel();
38 agentConfigurationModel = new AgentConfigurationModel;
39 agentConfigurationView = new AgentConfigurationView(window);
40 agentConfigurationPresenter = new AgentConfigurationPresenter(agentConfigurationModel, agentConfigurationView, systemModel, project);
41 agentConfigurationCombinationPresenter = new AgentConfigurationCombinationPresenter(agentConfigurationModel, agentConfigurationView, systemModel, project);
42
43 return true;
44 }
45 return false;
46 }
47
48 bool AgentConfigurationPlugin::deinitialize()
49 {
50 delete agentConfigurationCombinationPresenter;
51 delete agentConfigurationPresenter;
52 delete agentConfigurationView;
53 delete agentConfigurationModel;
54
55 return true;
56 }
AgentConfigurationPlugin.h
AgentConfigurationPresenter
This class defines the presenter object which handles events from the view (AgentConfigurationView) a...
Definition: AgentConfigurationPresenter.h:41
AgentConfigurationCombinationPresenter
This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of t...
Definition: AgentConfigurationCombinationPresenter.h:63
WindowInterface
This class manages the registration and deregistration of Window Views which include the menu bar wit...
Definition: WindowInterface.h:44
AgentConfigurationView.h
This class constitutes the main view of the agent configuration plugin. It instantiates the action me...
AgentConfigurationView
This class constitutes the main view of the agent configuration plugin. It instantiates the action me...
Definition: AgentConfigurationView.h:50
AgentConfigurationPresenter.h
This class defines the presenter object which handles events from the view (AgentConfigurationView) a...
SystemInterface.h
The System Interface (SI) contains the functions creating systems and creating a tree listing the com...
WindowInterface.h
The Window Interface (WI) contains the functions managing the Window View of openPASS application...
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
AgentConfigurationCombinationPresenter.h
This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of t...
AgentConfigurationModel.h
This class implements the functionality of AgentConfigurationInterface.
AgentConfigurationModel
This class implements the functionality of AgentConfigurationInterface.
Definition: AgentConfigurationModel.h:30
SystemInterface
This class manages creating new systems and also creating the tree of components loaded from a librar...
Definition: SystemInterface.h:27
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationPlugin.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
AgentConfigurationPlugin.h File Reference

Go to the source code of this file.

Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationPlugin.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
AgentConfigurationPlugin.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
78 //-----------------------------------------------------------------------------
79
80
81 #ifndef AGENTCONFIGURATIONPLUGIN_H
82 #define AGENTCONFIGURATIONPLUGIN_H
83
84 #include "openPASS/PluginInterface.h"
85 #include <QObject>
86
87 class AgentConfigurationModel;
88 class AgentConfigurationPresenter;
89 class AgentConfigurationCombinationPresenter;
90 class AgentConfigurationView;
91
92 class AgentConfigurationPlugin : public QObject, public PluginInterface
93 {
94 Q_OBJECT
95 Q_PLUGIN_METADATA(IID "openPASS.AgentConfiguration")
96 Q_INTERFACES(PluginInterface)
97
98 public:
99 explicit AgentConfigurationPlugin(QObject * const parent = nullptr);
100 virtual ~AgentConfigurationPlugin() override = default;
101
102 public:
103 virtual bool initialize() override;
104 virtual bool deinitialize() override;
105
106 protected:
107 AgentConfigurationModel * agentConfigurationModel;
108 AgentConfigurationPresenter * agentConfigurationPresenter;
109 AgentConfigurationCombinationPresenter * agentConfigurationCombinationPresenter;
110 AgentConfigurationView * agentConfigurationView;
111 };
112
113 #endif // AGENTCONFIGURATIONPLUGIN_H
AgentConfigurationPresenter
This class defines the presenter object which handles events from the view (AgentConfigurationView) a...
Definition: AgentConfigurationPresenter.h:41
AgentConfigurationCombinationPresenter
This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of t...
Definition: AgentConfigurationCombinationPresenter.h:63
AgentConfigurationView
This class constitutes the main view of the agent configuration plugin. It instantiates the action me...
Definition: AgentConfigurationView.h:50
AgentConfigurationModel
This class implements the functionality of AgentConfigurationInterface.
Definition: AgentConfigurationModel.h:30
PluginInterface.h
...
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
AgentConfigurationPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "Presenters/AgentConfigurationPresenter.h"
12
13 #include "Models/AgentConfigurationXMLSaveModel.h"
14 #include "Models/AgentConfigurationXMLLoadModel.h"
15 #include "Models/AgentConfigurationModel.h"
16
17 #include <QFileDialog>
18
19 AgentConfigurationPresenter::AgentConfigurationPresenter(AgentConfigurationInterface * const agentConfiguration,
20 AgentConfigurationView * const agentConfigurationView,
21 SystemInterface * const system,
22 ProjectInterface * const project,
23 QObject *parent)
24 : QObject(parent)
25 , agentConfiguration(agentConfiguration)
26 , agentConfigurationView(agentConfigurationView)
27 , project(project)
28 , undoStack(new QUndoStack(this))
29 , redo(new QShortcut(QKeySequence(tr("Ctrl+Y", "redo")),agentConfigurationView))
30 , undo (new QShortcut(QKeySequence(tr("Ctrl+Z", "undo")),agentConfigurationView))
31 , agentsPresenter(new AgentMapPresenter(agentConfiguration->getAgents(),
32 agentConfiguration->getVehicleProfiles(),
33 agentConfiguration->getDriverProfiles(),
34 agentConfigurationView->getAgentsView(),
35 project,
36 undoStack,
37 this))
38 , vehicleProfilesPresenter(new VehicleProfilesPresenter(agentConfiguration->getVehicleProfiles(),
39 agentConfigurationView->getVehicleProfilesView(),
40 system,
41 project,
42 undoStack,
43 this ))
44 , driverProfilesPresenter( new DriverProfilesPresenter(agentConfiguration->getDriverProfiles(),
45 agentConfigurationView->getDriverProfilesView(),
46 undoStack,
47 this))
48 {
49 connect(agentConfigurationView, &AgentConfigurationView::SaveSetup, this, &AgentConfigurationPresenter::save);
50 connect(agentConfigurationView, &AgentConfigurationView::LoadSetup, this, &AgentConfigurationPresenter::load);
51 connect(agentConfigurationView, &AgentConfigurationView::ClearSetup, this, &AgentConfigurationPresenter::clear);
52
53 // configuration of undo view, undo shortcuts and undo buttons
54 agentConfigurationView->getUndoView()->setStack(undoStack);
55 connect(redo, &QShortcut::activated, undoStack, &QUndoStack::redo);
56 connect(undo, &QShortcut::activated, undoStack, &QUndoStack::undo);
57 connect(agentConfigurationView, &AgentConfigurationView::Undo, undoStack, &QUndoStack::undo);
58 connect(agentConfigurationView, &AgentConfigurationView::Redo, undoStack, &QUndoStack::redo);
59 }
60
61
62 void AgentConfigurationPresenter::save()
63 {
64 QString const filepath = QFileDialog::getSaveFileName(
65 agentConfigurationView, QObject::tr("openPASS / Save setup"),
66 project->getConfigPath(), QStringLiteral("ProfilesCatalogue (*.ui)"));
67
68 if(!filepath.isEmpty())
69 AgentConfigurationXMLSaveModel::save(filepath, agentConfiguration);
70 }
71
72 void AgentConfigurationPresenter::load()
73 {
74 bool success;
75 QString const filepath = QFileDialog::getOpenFileName(
76 agentConfigurationView, QObject::tr("openPASS / Load setup"),
77 project->getConfigPath(), QStringLiteral("ProfilesCatalogue (*.ui)"));
78
79 AgentConfigurationInterface * loadedXML = new AgentConfigurationModel;
80 success = AgentConfigurationXMLLoadModel::load(filepath, loadedXML);
81
82 if(success)
83 {
84 undoStack->beginMacro(QString("loaded GUI file (*.ui) %1").arg(filepath));
85
86 clearDriverProfiles();
87 clearVehicleProfiles();
88 clearAgentProfiles();
89
90 copyDriverProfiles(loadedXML);
91 copyVehicleProfiles(loadedXML);
92 copyAgentProfiles(loadedXML);
93
94 undoStack->endMacro();
95 }
96 }
97
98
99 void AgentConfigurationPresenter::clear()
100 {
101
102 undoStack->beginMacro("cleared worksheet");
103
104 clearDriverProfiles();
105 clearVehicleProfiles();
106 clearAgentProfiles();
107
108 undoStack->endMacro();
109 }
110
111 void AgentConfigurationPresenter::clearAgentProfiles()
112 {
113 QList<QString> agentList = agentConfiguration->getAgents()->keys();
114 while(!agentList.isEmpty())
115 {
116 QString name = agentsPresenter->currentAgent->getName();
117 agentList.removeAll(name);
118 agentsPresenter->removeAgent(name);
119 }
120 }
121
122 void AgentConfigurationPresenter::clearDriverProfiles()
123 {
124 QList<QString> driverList = agentConfiguration->getDriverProfiles()->keys();
125 while(!driverList.isEmpty())
126 {
127 QString name = driverProfilesPresenter->currentDriver->getName();
128 driverList.removeAll(name);
129 driverProfilesPresenter->removeDriver(name);
130 }
131 }
132
133 void AgentConfigurationPresenter::clearVehicleProfiles()
134 {
135 QList<QString> vehicleList = agentConfiguration->getVehicleProfiles()->keys();
136 while(!vehicleList.isEmpty())
137 {
138 QString name = vehicleProfilesPresenter->currentVehicleProfile->getName();
139 vehicleList.removeAll(name);
140 vehicleProfilesPresenter->removeVehicleProfile(name);
141 }
142 }
143
144 void AgentConfigurationPresenter::copyAgentProfiles(const AgentConfigurationInterface *const from)
145 {
146 for(auto name : from->getAgents()->keys())
147 {
148 // 1. add the new agent
149 agentsPresenter->addAgent(name);
150
151 // 2. set agent type
152 agentsPresenter->setType(from->getAgents()->getItem(name)->getType());
153
154 if(from->getAgents()->getItem(name)->getType() == "Dynamic")
155 {
156 // 3.a copy all driver profiles
157 auto loadedDrivers = from->getAgents()->getItem(name)->getDriverProfiles();
158 auto drivers = agentsPresenter->driverProfilesMap;
159
160 for(auto driver : loadedDrivers->keys())
161 {
162 undoStack->push(new AgentProfileCommands::AddDriverProfile(drivers, driver, loadedDrivers->value(driver)));
163 }
164
165 // 4.a copy all vehicle profiles
166 auto loadedVehicles = from->getAgents()->getItem(name)->getVehicleProfiles();
167 auto vehicles = agentsPresenter->vehicleProfilesMap;
168
169 for(auto vehicle : loadedVehicles->keys())
170 {
171 undoStack->push(new AgentProfileCommands::AddVehicleProfile(vehicles, vehicle, loadedVehicles->value(vehicle)));
172 }
173 }
174 else if(from->getAgents()->getItem(name)->getType() == "Static")
175 {
176 // 3.b set system config and system
177 undoStack->push(new AgentProfileCommands::EditAgentSystemConfig(agentConfiguration->getAgents(),
178 agentConfigurationView->getAgentsView(),
179 agentsPresenter,
180 name,
181 from->getAgents()->getItem(name)->getSystemConfig()));
182
183 undoStack->push(new AgentProfileCommands::EditAgentSystem(agentConfiguration->getAgents(),
184 agentConfigurationView->getAgentsView(), name,
185 from->getAgents()->getItem(name)->getSystemTitle(),
186 from->getAgents()->getItem(name)->getSystemID()));
187
188 // 4.b. set model catalogue and model
189 undoStack->push(new AgentProfileCommands::EditAgentModelCatalogue(agentConfiguration->getAgents(),
190 agentConfigurationView->getAgentsView(),
191 agentsPresenter,
192 name,
193 from->getAgents()->getItem(name)->getVehicleModelCatalogue()));
194 undoStack->push(new AgentProfileCommands::EditAgentModel(agentConfiguration->getAgents(),
195 agentConfigurationView->getAgentsView(),
196 name,
197 from->getAgents()->getItem(name)->getVehicleModel()));
198 }
199 }
200 }
201
202
203 void AgentConfigurationPresenter::copyDriverProfiles(const AgentConfigurationInterface *const from)
204 {
205 for(auto name : from->getDriverProfiles()->keys())
206 {
207 undoStack->push(new DriverProfileCommands::AddDriverProfile(agentConfiguration->getDriverProfiles(),
208 agentConfigurationView->getDriverProfilesView(),
209 name,
210 from->getDriverProfiles()->getItem(name)->getParameters()));
211
212 undoStack->push(new DriverProfileCommands::SetCurrentDriver(agentConfiguration->getDriverProfiles(),
213 &(driverProfilesPresenter->currentDriver),
214 name,
215 driverProfilesPresenter->parameters,
216 driverProfilesPresenter));
217 }
218 }
219
220
221 void AgentConfigurationPresenter::copyVehicleProfiles(const AgentConfigurationInterface *const from)
222 {
223 for(auto name : from->getVehicleProfiles()->keys())
224 {
225 // 1. add the vehicle profile
226 vehicleProfilesPresenter->addVehicleProfile(name);
227
228 // 2. adopt model catalouge and model
229 undoStack->push(new VehicleProfileCommands::SetModelCatalogue(agentConfiguration->getVehicleProfiles(),
230 agentConfigurationView->getVehicleProfilesView(),
231 name,
232 from->getVehicleProfiles()->getItem(name)->getModelCatalogue(),
233 vehicleProfilesPresenter));
234 vehicleProfilesPresenter->setModel(from->getVehicleProfiles()->getItem(name)->getModel());
235
236 // 3. adopt system config, system profiles and systems
237 undoStack->push(new VehicleProfileCommands::SetSystemConfig(agentConfiguration->getVehicleProfiles(),
238 agentConfigurationView->getVehicleProfilesView(),
239 name,
240 from->getVehicleProfiles()->getItem(name)->getSystemConfig(),
241 vehicleProfilesPresenter));
242
243 for(auto type : from->getVehicleProfiles()->getItem(name)->getSystemProfiles()->keys())
244 {
245 vehicleProfilesPresenter->addSystemProfile(type);
246
247 for(auto system : from->getVehicleProfiles()->getItem(name)->getSystems(type)->keys())
248 undoStack->push(new VehicleProfileCommands::AddSystem(vehicleProfilesPresenter->systemProfilePresenters.value(name)->value(type),
249 system, from->getVehicleProfiles()->getItem(name)->getSystems(type)->value(system)));
250 }
251
252 }
253 }
AgentItemInterface::getVehicleModelCatalogue
virtual VehicleModelCatalogue getVehicleModelCatalogue() const =0
Method which returns the current vehicle model catalogue (for static agent profiles).
AgentConfigurationPresenter::save
void save()
Slot triggered by the AgentConfigurationView::SaveSetup signal. Opens the filedialog to let the user ...
Definition: AgentConfigurationPresenter.cpp:62
AgentConfigurationInterface::getDriverProfiles
virtual DriverProfileMapInterface * getDriverProfiles() const =0
Method which provides access to the map of driver profiles.
AgentConfigurationInterface::getVehicleProfiles
virtual VehicleProfileMapInterface * getVehicleProfiles() const =0
Method which provides access to the map of vehicle profiles.
AgentMapPresenter::vehicleProfilesMap
VehicleProfilesMapPresenter * vehicleProfilesMap
the pointer to the presenter object of the table for assigning vehicle profiles to the current agent ...
Definition: AgentMapPresenter.h:352
DriverProfileMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all driver profile names in the map.
VehicleProfileItemInterface::getSystemConfig
virtual SystemConfig getSystemConfig() const =0
Method which returns the name of the current system config XML file.
AgentConfigurationPresenter::undoStack
QUndoStack *const undoStack
pointer to the undo stack
Definition: AgentConfigurationPresenter.h:130
VehicleProfilesPresenter::removeVehicleProfile
void removeVehicleProfile(QString const &name)
Slot triggered by the VehicleProfilesView::removeVehicleProfile signal. Performs an undoable remove-o...
Definition: VehicleProfilesPresenter.cpp:89
VehicleProfilesPresenter
This class defines the presenter object for vehicle profiles which handles user events from the view ...
Definition: VehicleProfilesPresenter.h:59
AgentItemInterface::getVehicleModel
virtual VehicleModel getVehicleModel() const =0
Method which returns the currently selected vehicle profile (for static agent profiles).
VehicleProfileCommands::AddSystem
This class defines the command for undoable add-operations on the map of systems of a specific algori...
Definition: VehicleProfilesPresenter.h:527
DriverProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this driver profile. In fact, this is the key identifier under which...
DriverProfileMapInterface::getItem
virtual DriverProfileMapInterface::Item * getItem(DriverProfileMapInterface::Name const &name) const =0
Method which returns a pointer to the driver profile with the given name. If the map does not contain...
VehicleProfilesPresenter::addSystemProfile
void addSystemProfile(QString const &type)
Slot, triggered by the VehicleProfilesView::addSystemProfile signal. Undoably adds a map for systems ...
Definition: VehicleProfilesPresenter.cpp:202
AgentConfigurationView::getVehicleProfilesView
VehicleProfilesView * getVehicleProfilesView() const
Method that returns the view for vehicle profies.
Definition: AgentConfigurationView.cpp:137
AgentConfigurationPresenter::project
ProjectInterface *const project
pointer to the project interface for accessing the file structure of openPASS
Definition: AgentConfigurationPresenter.h:127
AgentItemInterface::getType
virtual Type getType() const =0
Method which returns the type of this agent profile.
AgentConfigurationPresenter::clearVehicleProfiles
void clearVehicleProfiles()
Method which performs an undoable clear operation on all vehicle profiles currently created...
Definition: AgentConfigurationPresenter.cpp:133
AgentConfigurationPresenter::copyVehicleProfiles
void copyVehicleProfiles(AgentConfigurationInterface const *const from)
Method which performs an undoable copy of the vehicle profiles from the given instance of AgentConfig...
Definition: AgentConfigurationPresenter.cpp:221
VehicleProfilesPresenter::systemProfilePresenters
QMap< VehicleProfileItemInterface::Name, QMap< QString, SystemProfilePresenter * > * > systemProfilePresenters
a container for each vehicle profile that stores all table presenter objects for systems of a certain...
Definition: VehicleProfilesPresenter.h:265
AgentConfigurationPresenter::vehicleProfilesPresenter
VehicleProfilesPresenter *const vehicleProfilesPresenter
pointer to the presenter object of vehicle profiles
Definition: AgentConfigurationPresenter.h:136
DriverProfilesPresenter
This class defines the presenter object for driver profiles which handles user events from the view (...
Definition: DriverProfilesPresenter.h:50
AgentConfigurationPresenter::clear
void clear()
Slot triggered by the AgentConfigurationView::ClearSetup signal. Clears the whole model data (using t...
Definition: AgentConfigurationPresenter.cpp:99
AgentConfigurationView
This class constitutes the main view of the agent configuration plugin. It instantiates the action me...
Definition: AgentConfigurationView.h:50
AgentConfigurationPresenter::clearDriverProfiles
void clearDriverProfiles()
Method which performs an undoable clear operation on all driver profiles currently created...
Definition: AgentConfigurationPresenter.cpp:122
AgentConfigurationView::getUndoView
QUndoView * getUndoView() const
Method that returns the undo view.
Definition: AgentConfigurationView.cpp:148
VehicleProfileCommands::SetModelCatalogue
This class defines the command for undoable set-operations on the vehicle model catalogue of the curr...
Definition: VehicleProfilesPresenter.h:383
AgentConfigurationPresenter.h
This class defines the presenter object which handles events from the view (AgentConfigurationView) a...
AgentItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profi...
AgentConfigurationView::Redo
void Redo()
Signal, emitted after the redo-button in the action menu has been clicked.
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
DriverProfilesPresenter::removeDriver
void removeDriver(const QString &name)
Slot triggered by the DriverProfilesView::removeDriverProfile signal. Performs an undoable remove-ope...
Definition: DriverProfilesPresenter.cpp:61
VehicleProfileMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all vehicle profile names in the map.
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
DriverProfilesPresenter::currentDriver
DriverProfileItemInterface * currentDriver
a pointer to the currently edited driver profile
Definition: DriverProfilesPresenter.h:132
AgentItemInterface::getSystemTitle
virtual SystemTitle getSystemTitle() const =0
Method which returns the title of the currently selected system (for static agent profiles)...
AgentMapPresenter::setType
void setType(const QString &type)
Slot triggered by the AgentMapView::typeChanged signal. Performs an undoable set-operation on the typ...
Definition: AgentMapPresenter.cpp:113
AgentConfigurationView::ClearSetup
void ClearSetup()
Signal, emitted after the clear-button in the action menu has been clicked and the user warning has b...
AgentProfileCommands::AddDriverProfile
This class defines the command for undoable add-operations on the driver profiles table of the curren...
Definition: AgentMapPresenter.h:620
AgentConfigurationModel.h
This class implements the functionality of AgentConfigurationInterface.
VehicleProfilesPresenter::setModel
void setModel(QString const &modelName)
Slot triggered by the VehicleProfilesView::modifiedModel signal. Performs an undoable assignment of t...
Definition: VehicleProfilesPresenter.cpp:344
VehicleProfilesPresenter::currentVehicleProfile
VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
Definition: VehicleProfilesPresenter.h:257
AgentConfigurationModel
This class implements the functionality of AgentConfigurationInterface.
Definition: AgentConfigurationModel.h:30
AgentConfigurationPresenter::clearAgentProfiles
void clearAgentProfiles()
Method which performs an undoable clear operation on all agent profiles currently created...
Definition: AgentConfigurationPresenter.cpp:111
AgentConfigurationView::Undo
void Undo()
Signal, emitted after the undo-button in the action menu has been clicked.
DriverProfileCommands::SetCurrentDriver
This class defines the command for undoable set-operations on the currently selected driver profile...
Definition: DriverProfilesPresenter.h:150
AgentConfigurationPresenter::agentConfiguration
AgentConfigurationInterface *const agentConfiguration
pointer to the overall model interface of this plugin
Definition: AgentConfigurationPresenter.h:125
VehicleProfileItemInterface::getModelCatalogue
virtual ModelCatalogue getModelCatalogue() const =0
Method which returns the current vehicle model catalogue.
AgentItemInterface::getSystemID
virtual SystemID getSystemID() const =0
Method which returns the id of the currently selected system (for static agent profiles).
AgentConfigurationPresenter::agentsPresenter
AgentMapPresenter *const agentsPresenter
pointer to the presenter object of agent profiles
Definition: AgentConfigurationPresenter.h:135
AgentMapPresenter::removeAgent
void removeAgent(QString const &name)
Slot triggered by the AgentMapView::remove signal. Performs an undoable remove-operation on the agent...
Definition: AgentMapPresenter.cpp:129
AgentMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all agent profile names in the map.
VehicleProfileItemInterface::getSystemProfiles
virtual SystemProfiles * getSystemProfiles() const =0
Method which returns all mappings of systems to probabilities sorted by their algorithm type...
AgentConfigurationView::getAgentsView
AgentMapView * getAgentsView() const
Method that returns the view for agent profies.
Definition: AgentConfigurationView.cpp:132
AgentMapPresenter::driverProfilesMap
DriverProfilesMapPresenter * driverProfilesMap
the pointer to the presenter object of the table for assigning driver profiles to the current agent p...
Definition: AgentMapPresenter.h:353
AgentProfileCommands::EditAgentModelCatalogue
This class defines the command for undoable set-operations on the vehicle model catalogue of the curr...
Definition: AgentMapPresenter.h:566
AgentMapPresenter
The AgentMapPresenter class handles user events from the view (AgentMapView) and edits the model data...
Definition: AgentMapPresenter.h:54
AgentConfigurationPresenter::copyDriverProfiles
void copyDriverProfiles(AgentConfigurationInterface const *const from)
Method which performs an undoable copy of the driver profiles from the given instance of AgentConfigu...
Definition: AgentConfigurationPresenter.cpp:203
AgentConfigurationPresenter::copyAgentProfiles
void copyAgentProfiles(AgentConfigurationInterface const *const from)
Method which performs an undoable copy of the agent profiles from the given instance of AgentConfigur...
Definition: AgentConfigurationPresenter.cpp:144
AgentMapInterface::getItem
virtual AgentMapInterface::Item * getItem(AgentMapInterface::Name const &name) const =0
Method which returns a pointer to the agent profile with the given name. If the map does not contain ...
VehicleProfileMapInterface::getItem
virtual VehicleProfileMapInterface::Item * getItem(VehicleProfileMapInterface::Name const &name) const =0
Method which returns a pointer to the vehicle profile with the given name. If the map does not contai...
SystemInterface
This class manages creating new systems and also creating the tree of components loaded from a librar...
Definition: SystemInterface.h:27
AgentItemInterface::getSystemConfig
virtual SystemConfig getSystemConfig() const =0
Method which returns the current system config file (for static agent profiles).
AgentProfileCommands::EditAgentSystem
This class defines the command for undoable set-operations on the system of the currently edited agen...
Definition: AgentMapPresenter.h:535
VehicleProfileItemInterface::getSystems
virtual Systems * getSystems(AlgoType const &_type) const =0
Method which returns the mapping of all systems of the given algorithm type to their equipment probab...
AgentConfigurationPresenter::driverProfilesPresenter
DriverProfilesPresenter *const driverProfilesPresenter
pointer to the presenter object of driver profiles
Definition: AgentConfigurationPresenter.h:137
AgentItemInterface::getVehicleProfiles
virtual VehicleProfiles * getVehicleProfiles() const =0
Method which returns a pointer to the map of vehicle profiles, i.e. the mapping of vehicle profiles t...
DriverProfileCommands::AddDriverProfile
This class defines the command for undoable add-operations on the map of driver profiles (DriverProfi...
Definition: DriverProfilesPresenter.h:202
VehicleProfileCommands::SetSystemConfig
This class defines the command for undoable set-operations on the system config of the currently edit...
Definition: VehicleProfilesPresenter.h:436
VehicleProfileItemInterface::getModel
virtual Model getModel() const =0
Method which returns the currently selected vehicle model.
AgentConfigurationView::LoadSetup
void LoadSetup()
Signal, emitted after the load-button in the action menu has been clicked.
DriverProfilesPresenter::parameters
ParameterMapPresenter * parameters
a pointer to the presenter object for the parameters of a driver profile
Definition: DriverProfilesPresenter.h:135
AgentProfileCommands::EditAgentModel
This class defines the command for undoable set-operations on the vehicle model of the currently edit...
Definition: AgentMapPresenter.h:594
VehicleProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of the vehicle profile.
AgentProfileCommands::EditAgentSystemConfig
This class defines the command for undoable set-operations on the system config file of the currently...
Definition: AgentMapPresenter.h:506
DriverProfileItemInterface::getParameters
virtual Parameters * getParameters() const =0
Method which returns the parameter map (ParameterMapInterface) of this driver profile.
AgentConfigurationView::SaveSetup
void SaveSetup()
Signal, emitted after the save-button in the action menu has been clicked.
AgentConfigurationPresenter::agentConfigurationView
AgentConfigurationView *const agentConfigurationView
pointer to the overall view of this plugin
Definition: AgentConfigurationPresenter.h:126
AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
Definition: AgentConfigurationInterface.h:52
AgentConfigurationPresenter::load
void load()
Slot triggered by the AgentConfigurationView::LoadSetup signal. Loads the *.ui file selected by the u...
Definition: AgentConfigurationPresenter.cpp:72
AgentConfigurationInterface::getAgents
virtual AgentMapInterface * getAgents() const =0
Method which provides access to the map of agent profiles.
VehicleProfilesPresenter::addVehicleProfile
void addVehicleProfile(QString const &name)
Slot triggered by the VehicleProfilesView::addVehicleProfile signal. Performs an undoable add-operati...
Definition: VehicleProfilesPresenter.cpp:81
AgentItemInterface::getDriverProfiles
virtual DriverProfiles * getDriverProfiles() const =0
Method which returns a pointer to the map of driver profiles, i.e. the mapping of driver profiles to ...
AgentProfileCommands::AddVehicleProfile
This class defines the command for undoable add-operations on the vehicle profiles table of the curre...
Definition: AgentMapPresenter.h:670
AgentMapPresenter::addAgent
void addAgent(QString const &name)
Slot triggered by the AgentMapView::add signal. Performs an undoable add-operation on the agent profi...
Definition: AgentMapPresenter.cpp:118
AgentConfigurationView::getDriverProfilesView
DriverProfilesView * getDriverProfilesView() const
Method that returns the view for driver profies.
Definition: AgentConfigurationView.cpp:143
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
AgentConfigurationView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "AgentConfigurationView.h"
12 #include "ui_AgentConfigurationView.h"
13
14 #include <QCoreApplication>
15 #include <QDir>
16 #include <QFileDialog>
17 #include <QMessageBox>
18
19 const WindowInterface::ID AgentConfigurationView::ViewID = QStringLiteral("openPASS.AgentConfiguration");
20
21 AgentConfigurationView::AgentConfigurationView(WindowInterface * const window,
22 QWidget *parent)
23 : QWidget(parent)
24 , window(window)
25 , undoView(new QUndoView(this))
26 , actionMenuSave(WindowInterface::createAction(tr("Save"), this, &AgentConfigurationView::actionSave))
27 , actionMenuExport(WindowInterface::createAction(tr("Export"), this, &AgentConfigurationView::actionExport))
28 , actionMenuLoad(WindowInterface::createAction(tr("Load"), this, &AgentConfigurationView::actionLoad))
29 , actionMenuClear(WindowInterface::createAction(tr("Clear"), this, &AgentConfigurationView::actionClear))
30 , actionMenuUndo(WindowInterface::createAction(tr(""), this, &AgentConfigurationView::actionUndo))
31 , actionMenuRedo(WindowInterface::createAction(tr(""), this, &AgentConfigurationView::actionRedo))
32 , actionMenuHistory(WindowInterface::createAction(tr("Command History"),this, &AgentConfigurationView::actionHistory))
33 , ui(new Ui::AgentConfigurationView)
34 {
35 // Create UI
36 ui->setupUi(this);
37
38 delete ui->agentContents;
39 agentsView = new AgentMapView;
40 ui->agentScrollArea->setWidget(agentsView);
41
42 delete ui->vehicleContents;
43 vehicleProfilesView = new VehicleProfilesView;
44 ui->vehicleScrollArea->setWidget(vehicleProfilesView);
45
46 delete ui->driverContents;
47 driverProfilesView = new DriverProfilesView;
48 ui->driverScrollArea->setWidget(driverProfilesView);
49
50 // Register view
51 window->add(ViewID, WindowInterface::createButton(tr("Agent Configuration"), 0, 05000), this,
52 {actionMenuClear, actionMenuLoad, actionMenuSave, actionMenuExport, actionMenuUndo, actionMenuRedo, actionMenuHistory});
53
54 // prepare undo view and undo/redo buttons
55 actionMenuRedo->setIcon(style()->standardIcon(QStyle::StandardPixmap::SP_ArrowRight));
56 actionMenuUndo->setIcon(style()->standardIcon(QStyle::StandardPixmap::SP_ArrowLeft));
57 actionMenuRedo->setToolTip("redo previous action");
58 actionMenuUndo->setToolTip("undo last action");
59
60 undoView->raise();
61 undoView->hide();
62
63 }
64
65 AgentConfigurationView::~AgentConfigurationView()
66 {
67 // Deregister view
68 window->remove(ViewID);
69
70 // Destroy UI
71 delete ui;
72 }
73
74 void AgentConfigurationView::actionHistory()
75 {
76 if(undoView->isVisible())
77 {
78 undoView->hide();
79 }
80 else
81 {
82 undoView->show();
83 undoView->move(actionMenuHistory->x(),0);
84 undoView->resize(2*width()/5, 3*height()/5 );
85 }
86 }
87
88 void AgentConfigurationView::actionSave()
89 {
90 Q_EMIT SaveSetup();
91 }
92
93 void AgentConfigurationView::actionExport()
94 {
95
96 Q_EMIT ExportSetup();
97 }
98
99 void AgentConfigurationView::actionLoad()
100 {
101 Q_EMIT LoadSetup();
102 }
103
104 void AgentConfigurationView::actionRedo()
105 {
106 Q_EMIT Redo();
107 }
108
109 void AgentConfigurationView::actionUndo()
110 {
111 Q_EMIT Undo();
112 }
113
114 void AgentConfigurationView::actionClear()
115 {
116 QMessageBox warning;
117
118 int ret;
119
120 // spell out a warning that everything will be deleted
121 warning.setText("The whole worksheet will be deleted!");
122 warning.setInformativeText("Do you want to continue?");
123 warning.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
124 ret=warning.exec();
125
126 if(ret==QMessageBox::Yes)
127 {
128 Q_EMIT ClearSetup();
129 }
130 }
131
132 AgentMapView * AgentConfigurationView::getAgentsView() const
133 {
134 return agentsView;
135 }
136
137 VehicleProfilesView * AgentConfigurationView::getVehicleProfilesView() const
138 {
139 return vehicleProfilesView;
140 }
141
142
143 DriverProfilesView * AgentConfigurationView::getDriverProfilesView() const
144 {
145 return driverProfilesView;
146 }
147
148 QUndoView * AgentConfigurationView::getUndoView() const
149 {
150 return undoView;
151 }
AgentConfigurationView::ViewID
static WindowInterface::ID const ViewID
a static Id used to register the view of this plugin in the window plugin
Definition: AgentConfigurationView.h:168
AgentMapView
This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu ...
Definition: AgentMapView.h:56
WindowInterface
This class manages the registration and deregistration of Window Views which include the menu bar wit...
Definition: WindowInterface.h:44
AgentConfigurationView::getVehicleProfilesView
VehicleProfilesView * getVehicleProfilesView() const
Method that returns the view for vehicle profies.
Definition: AgentConfigurationView.cpp:137
AgentConfigurationView.h
This class constitutes the main view of the agent configuration plugin. It instantiates the action me...
AgentConfigurationView::vehicleProfilesView
VehicleProfilesView * vehicleProfilesView
the view for editing vehicle profiles
Definition: AgentConfigurationView.h:186
Ui
Definition: EnvironmentDisplayView.h:29
AgentConfigurationView::actionClear
void actionClear()
Slot which is triggered when the clear-button of the action menu has been clicked. Prompts a dialog box to inform the user that the whole worksheet is going to be cleared. If user confirms, the ClearSetup signal is emitted.
Definition: AgentConfigurationView.cpp:114
AgentConfigurationView::window
WindowInterface *const window
the pointer to the window plugin for registering and deregistering this view
Definition: AgentConfigurationView.h:171
AgentConfigurationView::actionSave
void actionSave()
Slot which is triggered when the save-button of the action menu has been clicked. Prompts a file dial...
Definition: AgentConfigurationView.cpp:88
AgentConfigurationView
This class constitutes the main view of the agent configuration plugin. It instantiates the action me...
Definition: AgentConfigurationView.h:50
AgentConfigurationView::getUndoView
QUndoView * getUndoView() const
Method that returns the undo view.
Definition: AgentConfigurationView.cpp:148
AgentConfigurationView::Redo
void Redo()
Signal, emitted after the redo-button in the action menu has been clicked.
AgentConfigurationView::actionHistory
void actionHistory()
Slot which is triggered when the command history button is clicked. Will show or hide the command his...
Definition: AgentConfigurationView.cpp:74
WindowInterface::add
virtual void add(WindowInterface::ID const &id, WindowInterface::Button *const button, WindowInterface::Widget *const widget=nullptr, WindowInterface::Menu const &menu={})=0
Registers the Window View with the identifier id, including its selecting button, and its correspondi...
AgentConfigurationView::ui
Ui::AgentConfigurationView * ui
the ui object defining the views appearance
Definition: AgentConfigurationView.h:184
AgentConfigurationView::undoView
QUndoView *const undoView
the view of the undo stack
Definition: AgentConfigurationView.h:172
AgentConfigurationView::ClearSetup
void ClearSetup()
Signal, emitted after the clear-button in the action menu has been clicked and the user warning has b...
WindowInterface::remove
virtual bool remove(WindowInterface::ID const &id)=0
Deregisters a Window View with the identifier id.
AgentConfigurationView::actionUndo
void actionUndo()
Slot which is triggered when the undo-button of the action menu has been clicked. Will trigger the un...
Definition: AgentConfigurationView.cpp:109
AgentConfigurationView::actionRedo
void actionRedo()
Slot which is triggered when the redo-button of the action menu has been clicked. Will trigger the re...
Definition: AgentConfigurationView.cpp:104
AgentConfigurationView::Undo
void Undo()
Signal, emitted after the undo-button in the action menu has been clicked.
WindowInterface::createButton
static WindowInterface::Button * createButton(WindowInterface::ButtonTitle const &title, WindowInterface::ButtonType const &type=0, WindowInterface::ButtonOrder const &order=-1)
Creates button for a Window View selection with the title title, of type type and located on the side...
Definition: WindowInterface.h:109
AgentConfigurationView::agentsView
AgentMapView * agentsView
the view for editing agent profiles
Definition: AgentConfigurationView.h:185
AgentConfigurationView::getAgentsView
AgentMapView * getAgentsView() const
Method that returns the view for agent profies.
Definition: AgentConfigurationView.cpp:132
AgentConfigurationView::driverProfilesView
DriverProfilesView * driverProfilesView
the view for editing driver profiles
Definition: AgentConfigurationView.h:187
AgentConfigurationView::actionExport
void actionExport()
Slot which is triggered when the export-button of the action menu has been clicked. Prompts a file dialog box to let the user select a filepath. Afterwards the signal ExportSetup is emitted transmitting the selected filepath.
Definition: AgentConfigurationView.cpp:93
AgentConfigurationView::actionMenuHistory
WindowInterface::Action *const actionMenuHistory
The action menu object for showing the command history.
Definition: AgentConfigurationView.h:181
AgentConfigurationView::ExportSetup
void ExportSetup()
Signal, emitted after the export-button in the action menu has been clicked.
VehicleProfilesView
This class defines the view for editing vehicle profiles. The view constitutes a combo box for select...
Definition: VehicleProfilesView.h:56
AgentConfigurationView::LoadSetup
void LoadSetup()
Signal, emitted after the load-button in the action menu has been clicked.
AgentConfigurationView::SaveSetup
void SaveSetup()
Signal, emitted after the save-button in the action menu has been clicked.
WindowInterface::ID
QString ID
The identifier of the stacked widget.
Definition: WindowInterface.h:50
DriverProfilesView
This class defines the view for editing driver profiles. The view constitutes a combo box for switchi...
Definition: DriverProfilesView.h:41
AgentConfigurationView::actionLoad
void actionLoad()
Slot which is triggered when the load-button of the action menu has been clicked. Prompts a file dial...
Definition: AgentConfigurationView.cpp:99
AgentConfigurationView::getDriverProfilesView
DriverProfilesView * getDriverProfilesView() const
Method that returns the view for driver profies.
Definition: AgentConfigurationView.cpp:143
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationXMLBaseModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentConfigurationXMLBaseModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "AgentConfigurationXMLBaseModel.h"
12
13
14 QString const AgentConfigurationXMLBaseModel::KeyRoot = QStringLiteral("Profiles");
15
16 QString const AgentConfigurationXMLBaseModel::KeyAgentProfiles = QStringLiteral("AgentProfiles");
17 QString const AgentConfigurationXMLBaseModel::KeyAgentProfile = QStringLiteral("AgentProfile");
18
19
20 QString const AgentConfigurationXMLBaseModel::KeyDriverProfiles = QStringLiteral("DriverProfiles");
21 QString const AgentConfigurationXMLBaseModel::KeyDriverProfile = QStringLiteral("DriverProfile");
22
23 QString const AgentConfigurationXMLBaseModel::KeyVehicleProfiles = QStringLiteral("VehicleProfiles");
24 QString const AgentConfigurationXMLBaseModel::KeyVehicleProfile = QStringLiteral("VehicleProfile");
25 QString const AgentConfigurationXMLBaseModel::KeySystemConfig = QStringLiteral("SystemConfig");
26 QString const AgentConfigurationXMLBaseModel::KeyModel = QStringLiteral("Model");
27 QString const AgentConfigurationXMLBaseModel::KeySystem = QStringLiteral("System");
28 QString const AgentConfigurationXMLBaseModel::KeySystemProfiles = QStringLiteral("SystemProfiles");
29 QString const AgentConfigurationXMLBaseModel::KeySystemProfile = QStringLiteral("SystemProfile");
30 QString const AgentConfigurationXMLBaseModel::KeySystemFile = QStringLiteral("File");
31 QString const AgentConfigurationXMLBaseModel::KeySystemID = QStringLiteral("Id");
32 QString const AgentConfigurationXMLBaseModel::KeyVehicleModel = QStringLiteral("VehicleModel");
33 QString const AgentConfigurationXMLBaseModel::KeyVehicleModelCatalogue = QStringLiteral("VehicleModelCatalogue");
34
35
36 QString const AgentConfigurationXMLBaseModel::KeyParameterDouble= QStringLiteral("Double");
37 QString const AgentConfigurationXMLBaseModel::KeyParameterBool= QStringLiteral("Bool");
38 QString const AgentConfigurationXMLBaseModel::KeyParameterInt= QStringLiteral("Int");
39 QString const AgentConfigurationXMLBaseModel::KeyParameterFloat= QStringLiteral("Float");
40 QString const AgentConfigurationXMLBaseModel::KeyParameterString= QStringLiteral("String");
41
42
43
44 QList<QString> const AgentConfigurationXMLBaseModel::KeyListProfiles =
45 {
46 AgentConfigurationXMLBaseModel::KeyAgentProfiles,
47 AgentConfigurationXMLBaseModel::KeyDriverProfiles,
48 AgentConfigurationXMLBaseModel::KeyVehicleProfiles,
49 };
50
51 QList<QString> const AgentConfigurationXMLBaseModel::KeyListDynamicAgentProfile =
52 {
53 AgentConfigurationXMLBaseModel::KeyDriverProfiles,
54 AgentConfigurationXMLBaseModel::KeyVehicleProfiles,
55 };
56
57 QList<QString> const AgentConfigurationXMLBaseModel::KeyListStaticAgentProfile =
58 {
59 AgentConfigurationXMLBaseModel::KeySystem,
60 AgentConfigurationXMLBaseModel::KeyVehicleModel,
61 };
62
63 QList<QString> const AgentConfigurationXMLBaseModel::KeyListSystem =
64 {
65 AgentConfigurationXMLBaseModel::KeySystemFile,
66 AgentConfigurationXMLBaseModel::KeySystemID,
67 };
68
69 QList<QString> const AgentConfigurationXMLBaseModel::KeyListVehicleProfile=
70 {
71 AgentConfigurationXMLBaseModel::KeySystemConfig,
72 AgentConfigurationXMLBaseModel::KeyModel,
73 AgentConfigurationXMLBaseModel::KeySystemProfiles,
74 };
75
76 QList<QString> const AgentConfigurationXMLBaseModel::KeyListVehicleModel=
77 {
78 AgentConfigurationXMLBaseModel::KeyVehicleModelCatalogue,
79 AgentConfigurationXMLBaseModel::KeyModel,
80 };
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationXMLBaseModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentConfigurationXMLBaseModel.h
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #ifndef AGENTCONFIGURATIONXMLBASEMODEL_H
12 #define AGENTCONFIGURATIONXMLBASEMODEL_H
13
14 #include <QString>
15 #include <QList>
16
17 class AgentConfigurationXMLBaseModel
18 {
19
20 public:
21 explicit AgentConfigurationXMLBaseModel() = delete;
22 virtual ~AgentConfigurationXMLBaseModel() = default;
23
24
25 protected:
26 static QString const KeyRoot;
27
28 protected:
29 static QString const KeyAgentProfiles;
30 static QString const KeyAgentProfile;
31
32 protected:
33 static QString const KeyDriverProfiles;
34 static QString const KeyDriverProfile;
35
36 protected:
37 static QString const KeyVehicleProfiles;
38 static QString const KeyVehicleProfile;
39 static QString const KeySystemConfig;
40 static QString const KeyModel;
41 static QString const KeySystems;
42 static QString const KeySystem;
43 static QString const KeySystemFile;
44 static QString const KeySystemID;
45 static QString const KeySystemProfiles;
46 static QString const KeySystemProfile;
47 static QString const KeyVehicleModel;
48 static QString const KeyVehicleModelCatalogue;
49
50 protected:
51 static QList<QString> const KeyListProfiles;
52 static QList<QString> const KeyListSystem;
53 static QList<QString> const KeyListDynamicAgentProfile;
54 static QList<QString> const KeyListStaticAgentProfile;
55 static QList <QString> const KeyListVehicleProfile;
56 static QList <QString> const KeyListVehicleModel;
57
58 protected:
59 static QString const KeyParameterDouble;
60 static QString const KeyParameterBool;
61 static QString const KeyParameterInt;
62 static QString const KeyParameterFloat;
63 static QString const KeyParameterString;
64
65 };
66
67 #endif // AGENTCONFIGURATIONXMLBASEMODEL_H
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationXMLLoadModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentConfigurationXMLLoadModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "openPASS-Project/ProjectInterface.h"
12
13 #include "AgentConfigurationXMLLoadModel.h"
14
15 #include <QFile>
16
17 bool AgentConfigurationXMLLoadModel::load(const QString &filepath,
18 const AgentConfigurationInterface * const agentConfiguration)
19 {
20 QFile file(filepath);
21 bool success = true;
22 QList<QString> keys = KeyListProfiles;
23
24 if(file.open(QIODevice::ReadOnly | QIODevice::Text))
25 {
26 QXmlStreamReader xml(&file);
27
28 //verify Root element
29 xml.readNextStartElement();
30
31 if(xml.name() != KeyRoot)
32 return false;
33
34 while( xml.readNextStartElement() )
35 {
36
37 keys.removeAll(xml.name().toString());
38
39 if( xml.name() == KeyAgentProfiles )
40 {
41 success = loadAgentProfiles(xml, agentConfiguration->getAgents()) && success;
42 }
43 else if (xml.name() == KeyDriverProfiles)
44 {
45 success = loadDriverProfiles(xml, agentConfiguration->getDriverProfiles()) && success;
46 }
47 else if (xml.name() == KeyVehicleProfiles)
48 {
49 success = loadVehicleProfiles(xml, agentConfiguration->getVehicleProfiles()) && success;
50 }
51 else
52 xml.skipCurrentElement();
53 }
54
55 return success & keys.isEmpty();
56 }
57
58 return false;
59 }
60
61
62 bool AgentConfigurationXMLLoadModel::loadAgentProfiles(QXmlStreamReader &xml, AgentMapInterface *agentProfiles)
63 {
64
65 bool success = true;
66
67 while(xml.readNextStartElement())
68 {
69 if(xml.name() == KeyAgentProfile )
70 success = loadAgentProfile(xml, agentProfiles) && success;
71
72 else
73 xml.skipCurrentElement();
74 }
75
76 return success;
77 }
78
79 bool AgentConfigurationXMLLoadModel::loadAgentProfile(QXmlStreamReader &xml, AgentMapInterface *agentProfiles)
80 {
81 QList<QString> keys;
82 bool success = true;
83
84 AgentItemInterface::Name name = xml.attributes().value("Name").toString();
85 agentProfiles->add(name);
86 AgentItemInterface * agent = agentProfiles->getItem(name);
87 AgentItemInterface::Type type = xml.attributes().value("Type").toString();
88 agent->setType(type);
89
90 if(type == "Dynamic")
91 {
92 keys = KeyListDynamicAgentProfile;
93
94 while(xml.readNextStartElement())
95 {
96 keys.removeAll(xml.name().toString());
97
98 if(xml.name() == KeyDriverProfiles)
99 success = loadAgentDriverProfiles(xml, agent->getDriverProfiles()) && success;
100
101 else if ( xml.name() == KeyVehicleProfiles )
102 success = loadAgentVehicleProfiles(xml, agent->getVehicleProfiles()) && success;
103
104 else
105 xml.skipCurrentElement();
106 }
107
108 return success && keys.isEmpty();
109 }
110 else if(type == "Static")
111 {
112 keys = KeyListStaticAgentProfile;
113
114 while(xml.readNextStartElement())
115 {
116 keys.removeAll(xml.name().toString());
117
118 if(xml.name() == KeySystem)
119 success = loadAgentSystem(xml, agent) && success;
120 else if (xml.name() == KeyVehicleModel)
121 success = loadAgentVehicleModel(xml, agent) && success;
122 else
123 xml.skipCurrentElement();
124
125 }
126
127 return success && keys.isEmpty();
128 }
129 else
130 return false;
131 }
132
133 bool AgentConfigurationXMLLoadModel::loadAgentDriverProfiles(QXmlStreamReader &xml,
134 AgentItemInterface::DriverProfiles *driverProfiles)
135 {
136 while(xml.readNextStartElement())
137 {
138 if(xml.name() == KeyDriverProfile)
139 {
140 AgentItemInterface::DriverProfile profile = xml.attributes().value("Name").toString();
141 AgentItemInterface::Probability prob = xml.attributes().value("Probability").toDouble();
142 driverProfiles->insert(profile,prob);
143 xml.skipCurrentElement();
144 }
145 else
146 xml.skipCurrentElement();
147 }
148
149 return true;
150 }
151
152 bool AgentConfigurationXMLLoadModel::loadAgentVehicleProfiles(QXmlStreamReader &xml,
153 AgentItemInterface::VehicleProfiles *vehicleProfiles)
154 {
155 while(xml.readNextStartElement())
156 {
157 if(xml.name() == KeyVehicleProfile)
158 {
159 AgentItemInterface::VehicleProfile profile = xml.attributes().value("Name").toString();
160 AgentItemInterface::Probability prob = xml.attributes().value("Probability").toDouble();
161 vehicleProfiles->insert(profile,prob);
162 xml.skipCurrentElement();
163 }
164 else
165 xml.skipCurrentElement();
166 }
167
168 return true;
169 }
170
171 bool AgentConfigurationXMLLoadModel::loadAgentVehicleModel(QXmlStreamReader &xml, AgentItemInterface *agent)
172 {
173 QList<QString> keys = KeyListVehicleModel;
174
175 while(xml.readNextStartElement())
176 {
177 keys.removeAll(xml.name().toString());
178
179 if(xml.name() == KeyVehicleModelCatalogue)
180 agent->setVehicleModelCatalogue(xml.readElementText());
181 else if (xml.name() == KeyModel)
182 agent->setVehicleModel(xml.readElementText());
183 else
184 xml.skipCurrentElement();
185 }
186
187 return keys.isEmpty();
188 }
189
190 bool AgentConfigurationXMLLoadModel::loadAgentSystem(QXmlStreamReader &xml, AgentItemInterface *agent)
191 {
192 QList <QString> keys = KeyListSystem;
193
194 QMap<AgentItemInterface::SystemID, AgentItemInterface::SystemTitle> Titles;
195 bool success = true;
196
197 // 1. determine system config
198 xml.readNextStartElement();
199 if(xml.name() == KeySystemFile)
200 {
201 agent->setSystemConfig(xml.readElementText());
202 keys.removeAll(KeySystemFile);
203 }
204 else
205 return false;
206
207 // 2. if successful, go through system config and load system titles
208 success = loadTitlesfromSystemConfig(agent->getSystemConfig(), Titles) && success;
209
210 // 3. get system specification from xml
211 xml.readNextStartElement();
212 if( xml.name() == KeySystemID )
213 {
214 AgentItemInterface::SystemID id = xml.readElementText().toUInt();
215 agent->getSystem()->first = id;
216 agent->getSystem()->second = Titles[id];
217 keys.removeAll(KeySystemID);
218 }
219 else
220 xml.skipCurrentElement();
221
222 xml.skipCurrentElement();
223 return success && keys.isEmpty();
224 }
225
226 bool AgentConfigurationXMLLoadModel::loadTitlesfromSystemConfig(AgentItemInterface::SystemConfig sysConfig,
227 QMap<AgentItemInterface::SystemID, AgentItemInterface::SystemTitle> &Titles)
228 {
229 QFile file(ProjectInterface::instance()->absoluteToConfigPath(sysConfig));
230 AgentItemInterface::SystemID id = 0;
231 AgentItemInterface::SystemTitle title;
232 if(file.open(QIODevice::ReadOnly | QIODevice::Text))
233 {
234 QXmlStreamReader xml(&file);
235 xml.readNextStartElement();
236 if(xml.name() == "systems")
237 {
238 // Search for systems
239 while(xml.readNextStartElement())
240 {
241
242 if(xml.name() == "system")
243 {
244 // Read id and title attributes if system was found
245 while(xml.readNextStartElement())
246 {
247 if( xml.name() == "id")
248 id = xml.readElementText().toUInt();
249 else if( xml.name() == "title")
250 title = xml.readElementText();
251 else
252 xml.skipCurrentElement();
253 }
254
255 // insert the id and titles found into the map
256 Titles.insert(id,title);
257
258 }
259 else
260 xml.skipCurrentElement();
261 }
262
263 return true;
264 }
265 else
266 return false;
267 }
268 else
269 return false;
270 }
271
272 bool AgentConfigurationXMLLoadModel::loadDriverProfiles(QXmlStreamReader &xml,
273 DriverProfileMapInterface *driverProfiles)
274 {
275 bool success = true;
276
277 while(xml.readNextStartElement())
278 {
279 if(xml.name() == KeyDriverProfile)
280 {
281 DriverProfileMapInterface::Name name = xml.attributes().value("Name").toString();
282 driverProfiles->add(name);
283 DriverProfileMapInterface::Item * profile = driverProfiles->getItem(name);
284 success = loadDriverProfileParameters(xml, profile->getParameters()) && success;
285 }
286 else
287 xml.skipCurrentElement();
288 }
289
290 return success;
291
292 }
293
294 bool AgentConfigurationXMLLoadModel::loadDriverProfileParameters(QXmlStreamReader &xml,
295 DriverProfileItemInterface::Parameters *parameters)
296 {
297
298 while( xml.readNextStartElement() )
299 {
300 DriverProfileItemInterface::Parameters::ID id = parameters->generateID();
301 parameters->add(id);
302 DriverProfileItemInterface::Parameters::Item * param = parameters->getItem(id);
303
304 ParameterItemInterface::Type type = xml.name().toString();
305 ParameterItemInterface::Key key = xml.attributes().value("Key").toString();
306 ParameterItemInterface::Value value = xml.attributes().value("Value").toString();
307 ParameterItemInterface::Unit unit = xml.attributes().value("Unit").toString();
308
309 param->setKey(key);
310 param->setType(type);
311 param->setUnit(unit);
312 param->setValue(value);
313
314 xml.skipCurrentElement();
315 }
316
317 return true;
318 }
319
320 bool AgentConfigurationXMLLoadModel::loadVehicleProfiles(QXmlStreamReader &xml,
321 VehicleProfileMapInterface *vehicleProfiles)
322 {
323 bool success = true;
324
325 while(xml.readNextStartElement())
326 {
327 if( xml.name() == KeyVehicleProfile )
328 {
329 VehicleProfileMapInterface::Name name = xml.attributes().value("Name").toString();
330 vehicleProfiles->add(name);
331 VehicleProfileItemInterface * profile = vehicleProfiles->getItem(name);
332
333 success = loadVehicleProfile(xml, profile) && success;
334 }
335 else
336 xml.skipCurrentElement();
337 }
338
339 return success;
340 }
341
342 bool AgentConfigurationXMLLoadModel::loadVehicleProfile(QXmlStreamReader &xml,
343 VehicleProfileItemInterface *profile)
344 {
345 bool success = true;
346 QList <QString> keys = KeyListVehicleProfile;
347
348 while(xml.readNextStartElement())
349 {
350 keys.removeAll(xml.name().toString());
351
352 if( xml.name() == KeySystemConfig)
353 {
354 profile->setSystemConfig( xml.attributes().value("Path").toString() );
355 xml.skipCurrentElement();
356 }
357
358 else if( xml.name() == KeyModel )
359 {
360 profile->setModelCatalogue(xml.attributes().value("Catalogue").toString());
361 profile->setModel( xml.attributes().value("Name").toString() );
362 xml.skipCurrentElement();
363 }
364
365 else if ( xml.name() == KeySystemProfiles )
366 {
367 success = loadSystemProfiles( xml, profile->getSystemProfiles());
368 }
369
370 else
371 xml.skipCurrentElement();
372 }
373
374 return success && keys.isEmpty();
375 }
376
377 bool AgentConfigurationXMLLoadModel::loadSystemProfiles(QXmlStreamReader &xml,
378 VehicleProfileItemInterface::SystemProfiles *systemProfiles)
379 {
380 bool success = true;
381
382 while(xml.readNextStartElement())
383 {
384 if(xml.name() == KeySystemProfile)
385 {
386 VehicleProfileItemInterface::AlgoType type = xml.attributes().value("Type").toString();
387 VehicleProfileItemInterface::Systems * systems = new VehicleProfileItemInterface::Systems;
388 systemProfiles->insert(type, systems);
389 success = loadSystemProfile(xml, systems) && success;
390 }
391 else
392 xml.skipCurrentElement();
393 }
394
395 return success;
396 }
397
398 bool AgentConfigurationXMLLoadModel::loadSystemProfile(QXmlStreamReader &xml,
399 VehicleProfileItemInterface::Systems *systems)
400 {
401
402 while( xml.readNextStartElement() )
403 {
404 if( xml.name() == KeySystem )
405 {
406 VehicleProfileItemInterface::System system;
407 VehicleProfileItemInterface::Probability prob = xml.attributes().value("Probability").toDouble();
408 system.first = xml.attributes().value("Id").toUInt();
409 system.second = xml.attributes().value("Title").toString();
410 systems->insert(system, prob);
411
412 xml.skipCurrentElement();
413 }
414 else
415 xml.skipCurrentElement();
416 }
417
418 return true;
419 }
420
AgentConfigurationInterface::getDriverProfiles
virtual DriverProfileMapInterface * getDriverProfiles() const =0
Method which provides access to the map of driver profiles.
AgentConfigurationInterface::getVehicleProfiles
virtual VehicleProfileMapInterface * getVehicleProfiles() const =0
Method which provides access to the map of vehicle profiles.
DriverProfileItemInterface
This class defines objects containing all relevant information on driver profiles.
Definition: DriverProfileItemInterface.h:43
AgentItemInterface::DriverProfile
QString DriverProfile
the nome of a driver profile
Definition: AgentItemInterface.h:60
VehicleProfileItemInterface::System
QPair< SystemID, SystemTitle > System
typedef for a system (here, the system Id and title are sufficient)
Definition: VehicleProfileItemInterface.h:87
ParameterItemInterface::Key
QString Key
typedef for the key description
Definition: ParameterItemInterface.h:47
AgentItemInterface::setVehicleModel
virtual void setVehicleModel(VehicleModel const &_vehicleModel)=0
Method which sets the currently selected vehicle profile to the one passed as an argument (for static...
AgentItemInterface::SystemID
unsigned int SystemID
the id of a system defined in a system config
Definition: AgentItemInterface.h:49
DriverProfileMapInterface::getItem
virtual DriverProfileMapInterface::Item * getItem(DriverProfileMapInterface::Name const &name) const =0
Method which returns a pointer to the driver profile with the given name. If the map does not contain...
AgentItemInterface::VehicleProfiles
QMap< VehicleProfile, Probability > VehicleProfiles
the mapping of a vehicle profile to the instantiation probability
Definition: AgentItemInterface.h:57
AgentItemInterface::SystemTitle
QString SystemTitle
the title of a system defined in a system config
Definition: AgentItemInterface.h:50
ParameterItemInterface::Value
QString Value
typedef for the parameter&#39;s value
Definition: ParameterItemInterface.h:48
AgentMapInterface::add
virtual bool add(AgentMapInterface::Name const &name)=0
Method which creates a new agent profile (instance of AgentItemInterface) and adds it to the map unde...
VehicleProfileItemInterface
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
Definition: VehicleProfileItemInterface.h:71
VehicleProfileItemInterface::Probability
double Probability
typedef for a probability
Definition: VehicleProfileItemInterface.h:77
ParameterItemInterface::setUnit
virtual void setUnit(Value const &unit)=0
Method which sets the unit of this parameter to the given one.
ParameterItemInterface::Unit
QString Unit
typedef for the parameter&#39;s unit
Definition: ParameterItemInterface.h:49
AgentItemInterface::Type
QString Type
the type of the agent profile (dynamic or static)
Definition: AgentItemInterface.h:44
VehicleProfileItemInterface::setModelCatalogue
virtual void setModelCatalogue(ModelCatalogue const &_modelCatalogue)=0
Method which sets the current vehicle model catalogue to the one passed as an argument.
VehicleProfileMapInterface::Name
VehicleProfileItemInterface::Name Name
typedef for vehicle profile names (= key identifiers of the map)
Definition: VehicleProfileMapInterface.h:44
ParameterItemInterface::setValue
virtual void setValue(Value const &value)=0
Method which sets the value of this parameter to the given one.
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
AgentItemInterface::getSystem
virtual System * getSystem()=0
Method which returns a pointer to the system (i.e. the pair of system id and title) currently selecte...
AgentItemInterface::Name
QString Name
the name of the agent profiles
Definition: AgentItemInterface.h:43
ParameterItemInterface::setType
virtual void setType(Type const &type)=0
Method which sets the datatype of this parameter to the given type.
VehicleProfileItemInterface::getSystemProfiles
virtual SystemProfiles * getSystemProfiles() const =0
Method which returns all mappings of systems to probabilities sorted by their algorithm type...
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
DriverProfileMapInterface::Name
DriverProfileItemInterface::Name Name
typedef for driver profile names (= key identifiers of the map)
Definition: DriverProfileMapInterface.h:42
ParameterItemInterface::Type
QString Type
typedef for the data type
Definition: ParameterItemInterface.h:46
VehicleProfileItemInterface::setModel
virtual void setModel(Model const &_model)=0
Method which sets the current vehicle model to the one passed as an argument.
AgentMapInterface::getItem
virtual AgentMapInterface::Item * getItem(AgentMapInterface::Name const &name) const =0
Method which returns a pointer to the agent profile with the given name. If the map does not contain ...
VehicleProfileMapInterface::getItem
virtual VehicleProfileMapInterface::Item * getItem(VehicleProfileMapInterface::Name const &name) const =0
Method which returns a pointer to the vehicle profile with the given name. If the map does not contai...
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
VehicleProfileMapInterface::add
virtual bool add(VehicleProfileMapInterface::Name const &name)=0
Method which creates a new vehicle profile (instance of VehicleProfileItemInterface) and adds it to t...
AgentItemInterface::getSystemConfig
virtual SystemConfig getSystemConfig() const =0
Method which returns the current system config file (for static agent profiles).
AgentItemInterface::setType
virtual void setType(const Type &_type)=0
Method which sets the type of this agent profile to the one passed as an argument.
AgentItemInterface::SystemConfig
QString SystemConfig
the system config file
Definition: AgentItemInterface.h:48
AgentItemInterface::VehicleProfile
QString VehicleProfile
the name of a vehicle profile
Definition: AgentItemInterface.h:56
AgentItemInterface::getVehicleProfiles
virtual VehicleProfiles * getVehicleProfiles() const =0
Method which returns a pointer to the map of vehicle profiles, i.e. the mapping of vehicle profiles t...
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
AgentItemInterface
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
Definition: AgentItemInterface.h:38
VehicleProfileItemInterface::Systems
QMap< System, Probability > Systems
typedef for the map assigning probabilities to systems
Definition: VehicleProfileItemInterface.h:88
AgentItemInterface::setSystemConfig
virtual void setSystemConfig(SystemConfig const &_systemConfig)=0
Method which sets the current system config file to the one passed as an argument (for static agent p...
AgentItemInterface::setVehicleModelCatalogue
virtual void setVehicleModelCatalogue(VehicleModelCatalogue const &_vehicleModelCatalogue)=0
Method which sets the current vehicle model catalogue to the one passed as an argument (for static ag...
ParameterMapInterface::generateID
virtual ParameterMapInterface::ID generateID()=0
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
VehicleProfileItemInterface::AlgoType
QString AlgoType
typedef for the algorithm type (in fact, the implementation of the algorithm)
Definition: VehicleProfileItemInterface.h:85
AgentItemInterface::DriverProfiles
QMap< DriverProfile, Probability > DriverProfiles
the mapping of a driver profile to the instantiation probability
Definition: AgentItemInterface.h:61
DriverProfileMapInterface::add
virtual bool add(DriverProfileMapInterface::Name const &name)=0
Method which creates a new driver profile (instance of DriverProfileItemInterface) and adds it to the...
DriverProfileItemInterface::getParameters
virtual Parameters * getParameters() const =0
Method which returns the parameter map (ParameterMapInterface) of this driver profile.
ParameterMapInterface::ID
ParameterItemInterface::ID ID
typedef for the id of a parameter
Definition: ParameterMapInterface.h:42
AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
Definition: AgentMapInterface.h:37
AgentItemInterface::Probability
double Probability
a probability value (e.g. of a driver or a vehicle profile)
Definition: AgentItemInterface.h:45
AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
Definition: AgentConfigurationInterface.h:52
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
VehicleProfileItemInterface::setSystemConfig
virtual void setSystemConfig(SystemConfig const &_systemConfig)=0
Method which sets the current system config XML file to the one passed as an argument.
AgentConfigurationInterface::getAgents
virtual AgentMapInterface * getAgents() const =0
Method which provides access to the map of agent profiles.
VehicleProfileItemInterface::SystemProfiles
QMap< AlgoType, Systems * > SystemProfiles
typedef for the map sorting the probability-assigned systems by the algorithm type ...
Definition: VehicleProfileItemInterface.h:89
AgentItemInterface::getDriverProfiles
virtual DriverProfiles * getDriverProfiles() const =0
Method which returns a pointer to the map of driver profiles, i.e. the mapping of driver profiles to ...
ParameterItemInterface::setKey
virtual void setKey(Key const &key)=0
Method which sets the key description of this parameter to the given one.
ParameterMapInterface::add
virtual bool add(ParameterMapInterface::ID const &id)=0
Method which creates a parameter (instance of ParameterItemInterface) and adds it to the map under th...
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationXMLLoadModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentConfigurationXMLLoadModel.h
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #ifndef AGENTCONFIGURATIONXMLLOADMODEL_H
12 #define AGENTCONFIGURATIONXMLLOADMODEL_H
13
14 #include "openPASS-AgentConfiguration/AgentConfigurationInterface.h"
15
16 #include "Models/AgentConfigurationXMLBaseModel.h"
17
18 #include <QXmlStreamReader>
19
20 class AgentConfigurationXMLLoadModel : public AgentConfigurationXMLBaseModel
21 {
22
23 public:
24 explicit AgentConfigurationXMLLoadModel() = delete;
25 ~AgentConfigurationXMLLoadModel() = default;
26
27 public:
28 static bool load(const QString &filepath,
29 const AgentConfigurationInterface * const agentConfiguration);
30
31 static bool loadAgentProfiles(QXmlStreamReader & xml,
32 AgentMapInterface * agentProfiles);
33
34 static bool loadAgentProfile(QXmlStreamReader & xml,
35 AgentMapInterface *agentProfiles);
36
37 static bool loadAgentVehicleProfiles(QXmlStreamReader & xml,
38 AgentItemInterface::VehicleProfiles *vehicleProfiles);
39
40 static bool loadAgentDriverProfiles(QXmlStreamReader & xml,
41 AgentItemInterface::DriverProfiles *driverProfiles);
42
43 static bool loadVehicleProfiles(QXmlStreamReader & xml,
44 VehicleProfileMapInterface *vehicleProfiles);
45
46 static bool loadVehicleProfile(QXmlStreamReader &xml,
47 VehicleProfileItemInterface *profile);
48
49 static bool loadDriverProfiles(QXmlStreamReader & xml,
50 DriverProfileMapInterface *driverProfiles);
51
52 static bool loadDriverProfileParameters(QXmlStreamReader &xml,
53 DriverProfileItemInterface::Parameters *parameters);
54
55 static bool loadAgentSystem(QXmlStreamReader & xml, AgentItemInterface *agent);
56
57 static bool loadAgentVehicleModel(QXmlStreamReader &xml, AgentItemInterface *agent);
58
59 static bool loadSystemProfiles(QXmlStreamReader & xml,
60 VehicleProfileItemInterface::SystemProfiles * systemProfiles);
61
62 static bool loadSystemProfile(QXmlStreamReader & xml,
63 VehicleProfileItemInterface::Systems * systems);
64
65 static bool loadTitlesfromSystemConfig(AgentItemInterface::SystemConfig,
66 QMap<AgentItemInterface::SystemID, AgentItemInterface::SystemTitle> &Titles);
67
68 };
69
70 #endif // AGENTCONFIGURATIONXMLLOADMODEL_H
AgentItemInterface::VehicleProfiles
QMap< VehicleProfile, Probability > VehicleProfiles
the mapping of a vehicle profile to the instantiation probability
Definition: AgentItemInterface.h:57
VehicleProfileItemInterface
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
Definition: VehicleProfileItemInterface.h:71
AgentConfigurationInterface.h
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
AgentItemInterface::SystemConfig
QString SystemConfig
the system config file
Definition: AgentItemInterface.h:48
AgentItemInterface
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
Definition: AgentItemInterface.h:38
VehicleProfileItemInterface::Systems
QMap< System, Probability > Systems
typedef for the map assigning probabilities to systems
Definition: VehicleProfileItemInterface.h:88
AgentItemInterface::DriverProfiles
QMap< DriverProfile, Probability > DriverProfiles
the mapping of a driver profile to the instantiation probability
Definition: AgentItemInterface.h:61
AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
Definition: AgentMapInterface.h:37
AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
Definition: AgentConfigurationInterface.h:52
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
VehicleProfileItemInterface::SystemProfiles
QMap< AlgoType, Systems * > SystemProfiles
typedef for the map sorting the probability-assigned systems by the algorithm type ...
Definition: VehicleProfileItemInterface.h:89
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationXMLSaveModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentConfigurationXMLSaveModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "AgentConfigurationXMLSaveModel.h"
12
13 #include <QFile>
14
15 bool AgentConfigurationXMLSaveModel::save(const QString &filepath,
16 const AgentConfigurationInterface * const agentConfiguration)
17 {
18 QFile file(filepath);
19
20 if(file.open(QIODevice::WriteOnly | QIODevice::Text))
21 {
22 QXmlStreamWriter xml(&file);
23
24 xml.setAutoFormatting(true);
25 xml.setAutoFormattingIndent(2);
26
27 // Start Document
28 xml.writeStartDocument();
29
30 // Write root element
31 xml.writeStartElement(KeyRoot);
32
33 // Save Agent Profiles
34 saveAgentProfiles(xml, agentConfiguration->getAgents());
35
36 // Save Driver profiles
37 saveDriverProfiles(xml, agentConfiguration->getDriverProfiles());
38
39 // Save Vehicle Profiles
40 saveVehicleProfiles(xml, agentConfiguration->getVehicleProfiles());
41
42 xml.writeEndElement();
43 xml.writeEndDocument();
44
45 return true;
46 }
47
48
49 return false;
50 }
51
52 void AgentConfigurationXMLSaveModel::saveAgentProfiles(QXmlStreamWriter &xml,
53 AgentMapInterface *agentProfiles)
54 {
55 xml.writeStartElement(KeyAgentProfiles);
56
57 // save vehicle profiles
58 for(auto profile : agentProfiles->values())
59 {
60 xml.writeStartElement(KeyAgentProfile);
61 xml.writeAttribute("Name", profile->getName());
62 xml.writeAttribute("Type", profile->getType());
63
64 if(profile->getType() == "Dynamic")
65 {
66 saveAgentDriverProfiles(xml, profile->getDriverProfiles());
67 saveAgentVehicleProfiles(xml, profile->getVehicleProfiles());
68 }
69 if(profile->getType() == "Static")
70 {
71 xml.writeStartElement(KeySystem);
72 xml.writeTextElement(KeySystemFile, profile->getSystemConfig());
73 xml.writeTextElement(KeySystemID, QString::number(profile->getSystemID()));
74 xml.writeEndElement();
75
76 xml.writeTextElement(KeyVehicleModel, profile->getVehicleModel());
77 }
78 xml.writeEndElement();
79 }
80
81 xml.writeEndElement();
82 xml.writeComment("#############################################################################################");
83 }
84
85 void AgentConfigurationXMLSaveModel::saveAgentVehicleProfiles(QXmlStreamWriter & xml, AgentItemInterface::VehicleProfiles *vehicleProfiles)
86 {
87 xml.writeStartElement(KeyVehicleProfiles);
88
89 for(auto profile : vehicleProfiles->keys())
90 {
91 xml.writeStartElement(KeyVehicleProfile);
92 xml.writeAttribute("Name", profile);
93 xml.writeAttribute("Probability", QString::number((*vehicleProfiles)[profile]));
94 xml.writeEndElement();
95 }
96
97 xml.writeEndElement();
98 }
99
100 void AgentConfigurationXMLSaveModel::saveAgentDriverProfiles(QXmlStreamWriter & xml, AgentItemInterface::DriverProfiles *driverProfiles)
101 {
102 xml.writeStartElement(KeyDriverProfiles);
103
104 for(auto profile : driverProfiles->keys())
105 {
106 xml.writeStartElement(KeyDriverProfile);
107 xml.writeAttribute("Name", profile);
108 xml.writeAttribute("Probability", QString::number((*driverProfiles)[profile]));
109 xml.writeEndElement();
110 }
111
112 xml.writeEndElement();
113 }
114
115 void AgentConfigurationXMLSaveModel::saveVehicleProfiles(QXmlStreamWriter & xml,
116 VehicleProfileMapInterface *vehicleProfiles)
117 {
118 xml.writeStartElement(KeyVehicleProfiles);
119
120 for( auto profile : vehicleProfiles->values() )
121 {
122 xml.writeStartElement(KeyVehicleProfile);
123 xml.writeAttribute(QString("Name"), profile->getName());
124
125 xml.writeStartElement(KeyModel);
126 xml.writeAttribute("Catalogue", profile->getModelCatalogue());
127 xml.writeAttribute(QString("Name"), profile->getModel());
128 xml.writeEndElement();
129
130 xml.writeStartElement(KeySystemConfig);
131 xml.writeAttribute(QString("Path"), profile->getSystemConfig());
132 xml.writeEndElement();
133
134 xml.writeStartElement(KeySystemProfiles);
135 for(auto systems : profile->getSystemProfiles()->values())
136 {
137 xml.writeStartElement(KeySystemProfile);
138 xml.writeAttribute(QString("Type"), profile->getSystemProfiles()->key(systems));
139 saveSystemProfile(xml, systems);
140 xml.writeEndElement();
141 }
142 xml.writeEndElement();
143
144 xml.writeEndElement();
145 }
146
147 xml.writeEndElement();
148 xml.writeComment("#############################################################################################");
149 }
150
151 void AgentConfigurationXMLSaveModel::saveSystemProfile(QXmlStreamWriter &xml,
152 VehicleProfileItemInterface::Systems *systems)
153 {
154 for(auto system : systems->keys())
155 {
156 xml.writeStartElement(KeySystem);
157 xml.writeAttribute(QString("Id"), QString::number(system.first));
158 xml.writeAttribute(QString("Title"), system.second);
159 xml.writeAttribute(QString("Probability"), QString::number(systems->value(system)));
160 xml.writeEndElement();
161 }
162 }
163
164 void AgentConfigurationXMLSaveModel::saveDriverProfiles(QXmlStreamWriter &xml, DriverProfileMapInterface *driverProfiles)
165 {
166 xml.writeStartElement(KeyDriverProfiles);
167
168 for(auto profile : driverProfiles->values())
169 {
170 xml.writeStartElement(KeyDriverProfile);
171 xml.writeAttribute("Name", profile->getName());
172 saveDriverProfileParameters(xml, profile->getParameters() );
173 xml.writeEndElement();
174 }
175 xml.writeEndElement();
176 xml.writeComment("#############################################################################################");
177 }
178
179 void AgentConfigurationXMLSaveModel::saveDriverProfileParameters(QXmlStreamWriter &xml,
180 DriverProfileItemInterface::Parameters *parameters)
181 {
182 // TODO: add units
183 for(auto parameter : parameters->values())
184 {
185 xml.writeStartElement(parameter->getType());
186 xml.writeAttribute("Key", parameter->getKey() );
187 xml.writeAttribute("Value", parameter->getValue());
188 xml.writeEndElement();
189 }
190 }
191
AgentConfigurationInterface::getDriverProfiles
virtual DriverProfileMapInterface * getDriverProfiles() const =0
Method which provides access to the map of driver profiles.
AgentConfigurationInterface::getVehicleProfiles
virtual VehicleProfileMapInterface * getVehicleProfiles() const =0
Method which provides access to the map of vehicle profiles.
DriverProfileMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all driver profiles in the map.
AgentItemInterface::VehicleProfiles
QMap< VehicleProfile, Probability > VehicleProfiles
the mapping of a vehicle profile to the instantiation probability
Definition: AgentItemInterface.h:57
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
AgentMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all agent profiles in the map.
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
ParameterMapInterface::values
virtual QList< Item * > values() const =0
Method which returns the list of all parameters registered in this map.
VehicleProfileItemInterface::Systems
QMap< System, Probability > Systems
typedef for the map assigning probabilities to systems
Definition: VehicleProfileItemInterface.h:88
AgentItemInterface::DriverProfiles
QMap< DriverProfile, Probability > DriverProfiles
the mapping of a driver profile to the instantiation probability
Definition: AgentItemInterface.h:61
AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
Definition: AgentMapInterface.h:37
AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
Definition: AgentConfigurationInterface.h:52
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
AgentConfigurationInterface::getAgents
virtual AgentMapInterface * getAgents() const =0
Method which provides access to the map of agent profiles.
VehicleProfileMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of pointers to all vehicle profiles in the map.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationXMLSaveModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentConfigurationXMLSaveModel.h
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #ifndef AGENTCONFIGURATIONXMLSAVEMODEL_H
12 #define AGENTCONFIGURATIONXMLSAVEMODEL_H
13
14 #include "openPASS-AgentConfiguration/AgentConfigurationInterface.h"
15
16 #include "AgentConfigurationXMLBaseModel.h"
17
18 #include <QXmlStreamWriter>
19
20 class AgentConfigurationXMLSaveModel : public AgentConfigurationXMLBaseModel
21 {
22 public:
23 explicit AgentConfigurationXMLSaveModel() = delete;
24 ~AgentConfigurationXMLSaveModel() = default;
25
26
27 public:
28 static bool save(const QString &filepath,
29 const AgentConfigurationInterface * const agentConfiguration);
30
31 static void saveAgentProfiles(QXmlStreamWriter & xml,
32 AgentMapInterface *agentProfiles);
33
34 static void saveAgentVehicleProfiles(QXmlStreamWriter & xml,
35 AgentItemInterface::VehicleProfiles *vehicleProfiles);
36
37 static void saveAgentDriverProfiles(QXmlStreamWriter & xml,
38 AgentItemInterface::DriverProfiles *driverProfiles);
39
40 static void saveVehicleProfiles(QXmlStreamWriter & xml,
41 VehicleProfileMapInterface *vehicleProfiles);
42
43 static void saveDriverProfiles(QXmlStreamWriter & xml,
44 DriverProfileMapInterface *driverProfiles);
45
46 static void saveDriverProfileParameters(QXmlStreamWriter &xml,
47 DriverProfileItemInterface::Parameters *parameters);
48
49 static void saveSystemProfile(QXmlStreamWriter & xml,
50 VehicleProfileItemInterface::Systems * systems);
51
52 };
53
54 #endif // AGENTCONFIGURATIONXMLSAVEMODEL_H
AgentItemInterface::VehicleProfiles
QMap< VehicleProfile, Probability > VehicleProfiles
the mapping of a vehicle profile to the instantiation probability
Definition: AgentItemInterface.h:57
AgentConfigurationInterface.h
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
VehicleProfileItemInterface::Systems
QMap< System, Probability > Systems
typedef for the map assigning probabilities to systems
Definition: VehicleProfileItemInterface.h:88
AgentItemInterface::DriverProfiles
QMap< DriverProfile, Probability > DriverProfiles
the mapping of a driver profile to the instantiation probability
Definition: AgentItemInterface.h:61
AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
Definition: AgentMapInterface.h:37
AgentConfigurationInterface
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-...
Definition: AgentConfigurationInterface.h:52
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentItemModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentItemModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "openPASS-AgentConfiguration/AgentMapInterface.h"
12
13 #include "AgentItemModel.h"
14
15 AgentItemModel::AgentItemModel(QObject *parent)
16 : AgentItemInterface(parent)
17 , vehicleProfiles(new VehicleProfiles)
18 , driverProfiles(new DriverProfiles)
19 , type("Dynamic")
20 , systemConfig("")
21 , system( System() )
22 , vehicleModelCatalogue("")
23 {
24 }
25
26 AgentItemModel::AgentItemModel(AgentItemInterface const * const agent, QObject *parent)
27 : AgentItemInterface (parent)
28 , vehicleProfiles(new VehicleProfiles)
29 , driverProfiles(new DriverProfiles)
30 , type(agent->getType())
31 , systemConfig(agent->getSystemConfig())
32 , system(System(agent->getSystemID(), agent->getSystemTitle()))
33 , vehicleModelCatalogue(agent->getVehicleModelCatalogue())
34 , vehicleModel(agent->getVehicleModel())
35 {
36 for(auto profile : agent->getVehicleProfiles()->keys())
37 vehicleProfiles->insert(profile, agent->getVehicleProfiles()->value(profile));
38
39 for(auto profile: agent->getDriverProfiles()->keys())
40 driverProfiles->insert(profile, agent->getDriverProfiles()->value(profile));
41 }
42
43 AgentItemModel::~AgentItemModel()
44 {
45 delete vehicleProfiles;
46 delete driverProfiles;
47 }
48
49
50 AgentItemInterface::Name AgentItemModel::getName() const
51 {
52 AgentMapInterface const * const agents = qobject_cast<AgentMapInterface const * const>( parent() );
53
54 return agents->getName( const_cast<AgentItemModel *>(this) );
55 }
56
57 AgentItemInterface::Type AgentItemModel::getType() const
58 {
59 return type;
60 }
61
62 void AgentItemModel::setType(const Type &_type)
63 {
64 type = _type;
65 }
66
67 AgentItemInterface::VehicleProfiles *AgentItemModel::getVehicleProfiles() const
68 {
69 return vehicleProfiles;
70 }
71
72 AgentItemInterface::DriverProfiles *AgentItemModel::getDriverProfiles() const
73 {
74 return driverProfiles;
75 }
76
77
78 AgentItemInterface::SystemID AgentItemModel::getSystemID() const
79 {
80 return system.first;
81 }
82
83 void AgentItemModel::setSystemID(SystemID const & _systemID)
84 {
85 system.first = _systemID;
86 }
87
88 void AgentItemModel::setSystemTitle(const SystemTitle &_systemTitle)
89 {
90 system.second = _systemTitle;
91 }
92
93 AgentItemInterface::SystemTitle AgentItemModel::getSystemTitle() const
94 {
95 return system.second;
96 }
97
98 AgentItemInterface::SystemConfig AgentItemModel::getSystemConfig() const
99 {
100 return systemConfig;
101 }
102
103 void AgentItemModel::setSystemConfig(SystemConfig const & _systemConfig)
104 {
105 systemConfig = _systemConfig;
106 }
107
108 AgentItemInterface::System * AgentItemModel::getSystem()
109 {
110 return &system;
111 }
112
113 AgentItemInterface::VehicleModelCatalogue AgentItemModel::getVehicleModelCatalogue() const
114 {
115 return vehicleModelCatalogue;
116 }
117
118 AgentItemInterface::VehicleModel AgentItemModel::getVehicleModel() const
119 {
120 return vehicleModel;
121 }
122
123 void AgentItemModel::setVehicleModelCatalogue(const VehicleModelCatalogue &_vehicleModelCatalogue)
124 {
125 vehicleModelCatalogue=_vehicleModelCatalogue;
126 }
127
128 void AgentItemModel::setVehicleModel(const VehicleModel &_vehicleModel)
129 {
130 vehicleModel=_vehicleModel;
131 }
AgentItemInterface::SystemID
unsigned int SystemID
the id of a system defined in a system config
Definition: AgentItemInterface.h:49
AgentItemInterface::VehicleProfiles
QMap< VehicleProfile, Probability > VehicleProfiles
the mapping of a vehicle profile to the instantiation probability
Definition: AgentItemInterface.h:57
AgentItemInterface::SystemTitle
QString SystemTitle
the title of a system defined in a system config
Definition: AgentItemInterface.h:50
AgentItemInterface::System
QPair< SystemID, SystemTitle > System
the pair of id and title of a system in system config (used as system reference)
Definition: AgentItemInterface.h:51
AgentItemInterface::Type
QString Type
the type of the agent profile (dynamic or static)
Definition: AgentItemInterface.h:44
AgentItemInterface::VehicleModel
QString VehicleModel
a vehicle model defined in a vehicle model catalogue file
Definition: AgentItemInterface.h:53
AgentItemInterface::VehicleModelCatalogue
QString VehicleModelCatalogue
the vehicle model catalogue file
Definition: AgentItemInterface.h:52
AgentItemInterface::Name
QString Name
the name of the agent profiles
Definition: AgentItemInterface.h:43
AgentMapInterface.h
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
AgentItemInterface::SystemConfig
QString SystemConfig
the system config file
Definition: AgentItemInterface.h:48
AgentItemInterface::getVehicleProfiles
virtual VehicleProfiles * getVehicleProfiles() const =0
Method which returns a pointer to the map of vehicle profiles, i.e. the mapping of vehicle profiles t...
AgentItemInterface
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
Definition: AgentItemInterface.h:38
AgentMapInterface::getName
virtual AgentMapInterface::Name getName(AgentMapInterface::Item *const item) const =0
Method wich returns the name of the given agent profile.
AgentItemInterface::DriverProfiles
QMap< DriverProfile, Probability > DriverProfiles
the mapping of a driver profile to the instantiation probability
Definition: AgentItemInterface.h:61
AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
Definition: AgentMapInterface.h:37
AgentItemInterface::getDriverProfiles
virtual DriverProfiles * getDriverProfiles() const =0
Method which returns a pointer to the map of driver profiles, i.e. the mapping of driver profiles to ...
AgentItemModel.h
This class implements the functionality of AgentItemInterface.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
AgentMapModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "AgentMapModel.h"
12
13 #include <QStringList>
14 #include <QMap>
15
16 AgentMapModel::AgentMapModel(QObject *parent)
17 : AgentMapInterface(parent)
18 {
19 }
20
21 AgentMapInterface::Iterator AgentMapModel::begin()
22 {
23 return agents.begin();
24 }
25
26 AgentMapInterface::ConstIterator AgentMapModel::constBegin() const
27 {
28 return agents.constBegin();
29 }
30
31 AgentMapInterface::Iterator AgentMapModel::end()
32 {
33 return agents.end();
34 }
35
36 AgentMapInterface::ConstIterator AgentMapModel::constEnd() const
37 {
38 return agents.constEnd();
39 }
40
41
42 bool AgentMapModel::add(const AgentMapInterface::Name &name)
43 {
44 if(!contains(name))
45 {
46 agents.insert(name, new AgentItemModel(this));
47 Q_EMIT added(name);
48 return true;
49 }
50
51 return false;
52 }
53
54
55 bool AgentMapModel::add(AgentMapInterface::Name const &name, AgentMapInterface::Item const * const item)
56 {
57 if(!contains(name))
58 {
59 agents.insert(name, new AgentItemModel(item, this));
60 Q_EMIT added(name);
61 return true;
62 }
63
64 return false;
65 }
66
67 bool AgentMapModel::remove(const AgentMapInterface::Name &name)
68 {
69 if(contains(name))
70 {
71 delete agents.take(name);
72 Q_EMIT removed(name);
73 return true;
74 }
75
76 return false;
77 }
78
79 AgentMapInterface::Item * AgentMapModel::getItem(AgentMapInterface::Name const & name) const
80 {
81 if(contains(name))
82 {
83 return agents.value(name);
84 }
85
86 return nullptr;
87 }
88
89
90 AgentMapInterface::Name AgentMapModel::getName(Item * const item) const
91 {
92 return agents.key(item);
93 }
94
95 void AgentMapModel::setName(Item * const item,
96 AgentMapInterface::Name const &name)
97 {
98
99 Name oldName = item->getName();
100
101 agents.take(oldName);
102 agents.insert(name, item);
103
104 Q_EMIT modifiedName(oldName, name);
105 }
106
107
108 bool AgentMapModel::contains(const AgentMapInterface::Name &name) const
109 {
110 return agents.contains(name);
111 }
112
113 QStringList AgentMapModel::keys() const
114 {
115 return QStringList( agents.keys() );
116 }
117
118 QList <AgentItemInterface*> AgentMapModel::values() const
119 {
120 return agents.values();
121 }
122
123 int AgentMapModel::count() const
124 {
125 return agents.count();
126 }
AgentMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a constant iterator for read-only operations
Definition: AgentMapInterface.h:48
AgentMapInterface::added
void added(Name name)
Signal emitted when an agent profile has been added to the map. Transmits the name of the correpondin...
AgentMapModel::add
virtual bool add(AgentMapInterface::Name const &name) override
Method which creates a new agent profile (instance of AgentItemInterface) and adds it to the map unde...
Definition: AgentMapModel.cpp:42
AgentMapModel::contains
virtual bool contains(AgentMapInterface::Name const &name) const override
Method wich checks whether the map contains an agent profile with the given name. ...
Definition: AgentMapModel.cpp:108
AgentMapModel::getItem
virtual AgentMapInterface::Item * getItem(AgentMapInterface::Name const &name) const override
Method which returns a pointer to the agent profile with the given name. If the map does not contain ...
Definition: AgentMapModel.cpp:79
AgentItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profi...
AgentMapInterface::modifiedName
void modifiedName(Name oldName, Name newName)
Signal emitted when the name of the agent profile has been changed. Transmits both, the new and old names of the profile.
AgentMapModel::values
virtual QList< Item * > values() const override
Method which returns a list of pointers to all agent profiles in the map.
Definition: AgentMapModel.cpp:118
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67
AgentMapInterface::Iterator
Map::Iterator Iterator
an iterator for searching within the map
Definition: AgentMapInterface.h:47
AgentMapModel::keys
virtual QStringList keys() const override
Method which returns the (string) list of all agent profile names in the map.
Definition: AgentMapModel.cpp:113
AgentMapInterface::Name
AgentItemInterface::Name Name
the name of the agent profile (key identifier)
Definition: AgentMapInterface.h:42
AgentMapModel::begin
virtual AgentMapInterface::Iterator begin() override
Gets an iterator pointing to the first agent profile in the map.
Definition: AgentMapModel.cpp:21
AgentMapModel.h
This class implements the functionality of AgentMapInterface.
AgentMapModel::setName
virtual void setName(AgentMapInterface::Item *const item, AgentMapInterface::Name const &name) override
Method wich changes the name of the given agent profile to the one passed as second argument...
Definition: AgentMapModel.cpp:95
AgentMapModel::end
virtual AgentMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last agent profile.
Definition: AgentMapModel.cpp:31
AgentMapModel::constEnd
virtual AgentMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last agent profile (use for read-only)...
Definition: AgentMapModel.cpp:36
AgentItemInterface
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
Definition: AgentItemInterface.h:38
AgentMapModel::constBegin
virtual AgentMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first agent profile in the map (use for read-only since pointing at ...
Definition: AgentMapModel.cpp:26
AgentMapModel::getName
virtual AgentMapInterface::Name getName(AgentMapInterface::Item *const item) const override
Method wich returns the name of the given agent profile.
Definition: AgentMapModel.cpp:90
AgentMapInterface::removed
void removed(Name name)
Signal emitted when an agent profile has been removed from the map. Transmits the name of the correpo...
AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
Definition: AgentMapInterface.h:37
AgentMapModel::remove
virtual bool remove(AgentMapInterface::Name const &name) override
Method which removes the agent profile with the given name from the map. The profile is deleted after...
Definition: AgentMapModel.cpp:67
AgentMapModel::count
virtual int count() const override
Method which returns the number of registered agent profiles.
Definition: AgentMapModel.cpp:123
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
AgentMapPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "Models/AgentMapModel.h"
12 #include "Presenters/AgentMapPresenter.h"
13
14 #include "DelegateComboBoxView.h"
15 #include "DelegateDoubleView.h"
16
17 #include <QFileDialog>
18 #include <QXmlStreamReader>
19 #include <QMessageBox>
20 #include <QFile>
21
22 double AgentMapPresenter::default_probability = 0.5;
23
24 AgentMapPresenter::AgentMapPresenter(AgentMapInterface *agents,
25 VehicleProfileMapInterface *vehicleProfiles,
26 DriverProfileMapInterface *driverProfiles,
27 AgentMapView *agentsView,
28 ProjectInterface * const project,
29 QUndoStack * const undoStack,
30 QObject *parent)
31 : QObject(parent)
32 , agents(agents)
33 , vehicleProfiles(vehicleProfiles)
34 , driverProfiles(driverProfiles)
35 , currentAgent(nullptr)
36 , agentsView(agentsView)
37 , project(project)
38 , undoStack(undoStack)
39 , vehicleProfilesList(new QList<QString>() )
40 , driverProfilesList(new QList<QString>() )
41 {
42 // Connections concerning the Agent Profiles
43 connect(agentsView, &AgentMapView::selectionChanged, this, &AgentMapPresenter::setCurrentAgent);
44 connect(agentsView,&AgentMapView::add, this, &AgentMapPresenter::addAgent);
45 connect(agentsView, &AgentMapView::remove, this, &AgentMapPresenter::removeAgent);
46 connect(agentsView, &AgentMapView::modifiedName, this, &AgentMapPresenter::editAgent);
47 connect(agentsView,&AgentMapView::typeChanged, this, &AgentMapPresenter::setType);
48
49 // Connections concerning vehicle profiles
50 connect(vehicleProfiles, &VehicleProfileMapInterface::added, this, &AgentMapPresenter::updateVehicleSelectionItems);
51 connect(vehicleProfiles, &VehicleProfileMapInterface::removed, this, &AgentMapPresenter::updateVehicleSelectionItems);
52 connect(vehicleProfiles, &VehicleProfileMapInterface::modifiedName, this, &AgentMapPresenter::updateVehicleSelectionItems);
53
54 // Connections concerning driver profiles
55 connect(driverProfiles, &DriverProfileMapInterface::added, this, &AgentMapPresenter::updateDriverSelectionItems);
56 connect(driverProfiles, &DriverProfileMapInterface::removed, this, &AgentMapPresenter::updateDriverSelectionItems);
57 connect(driverProfiles, &DriverProfileMapInterface::modifiedName, this, &AgentMapPresenter::updateDriverSelectionItems);
58
59
60 // Connections concerning the system Config
61 connect(agentsView, &AgentMapView::setSystemConfig, this, &AgentMapPresenter::setSystemConfig);
62 connect(agentsView, &AgentMapView::refreshSystemConfig, this, &AgentMapPresenter::refreshSystemConfig);
63 connect(agentsView, &AgentMapView::selectedSystem, this, &AgentMapPresenter::setSystem);
64
65 // connections concerning the model catalogue
66 connect(agentsView, &AgentMapView::setModel, this, &AgentMapPresenter::setModel);
67 connect(agentsView, &AgentMapView::setModelCatalogue, this, &AgentMapPresenter::setModelCatalogue);
68 connect(agentsView, &AgentMapView::refreshModelCatalogue, this, &AgentMapPresenter::refreshModelCatalogue);
69
70 // connections relevant for the communication with project plugin
71 connect(project, &ProjectInterface::update, this, &AgentMapPresenter::refreshSystemConfig);
72 connect(project, &ProjectInterface::update, this, &AgentMapPresenter::refreshModelCatalogue);
73
74 setupVehicleProfilesMap();
75 setupDriverProfilesMap();
76 }
77
78 void AgentMapPresenter::setupVehicleProfilesMap()
79 {
80 vehicleProfilesMap = new VehicleProfilesMapPresenter;
81
82 QTableView * vehicleProfilesMapView = agentsView->getVehicleProfilesView();
83 vehicleProfilesMapView->setItemDelegateForColumn(0, new DelegateComboBoxView( vehicleProfilesList,"vehicle profile", undoStack, this));
84 vehicleProfilesMapView->setItemDelegateForColumn(1, new DelegateDoubleView(0, 1, 0.1,2, "vehicle profile's probability", undoStack,this));
85 vehicleProfilesMapView->setModel(vehicleProfilesMap);
86
87 connect(agentsView, &AgentMapView::addVehicleProfile, this, &AgentMapPresenter::addVehicleProfile);
88 connect(agentsView, &AgentMapView::removeVehicleProfile, this, &AgentMapPresenter::removeVehicleProfile);
89 connect(vehicleProfilesMap, &VehicleProfilesMapPresenter::checkProbabilities, this, &AgentMapPresenter::checkVehicleProbabilities);
90 }
91
92 void AgentMapPresenter::setupDriverProfilesMap()
93 {
94 driverProfilesMap = new DriverProfilesMapPresenter;
95
96 QTableView * driverProfilesMapView = agentsView->getDriverProfilesView();
97 driverProfilesMapView->setItemDelegateForColumn(0, new DelegateComboBoxView( driverProfilesList, "dirver profile", undoStack, this));
98 driverProfilesMapView->setItemDelegateForColumn(1, new DelegateDoubleView(0, 1, 0.1,2,"driver profile's probability", undoStack, this));
99 driverProfilesMapView->setModel(driverProfilesMap);
100
101 connect(agentsView, &AgentMapView::addDriverProfile, this, &AgentMapPresenter::addDriverProfile);
102 connect(agentsView, &AgentMapView::removeDriverProfile, this, &AgentMapPresenter::removeDriverProfile);
103 connect(driverProfilesMap, &DriverProfilesMapPresenter::checkProbabilities, this, &AgentMapPresenter::checkDriverProbabilities);
104 }
105
106 void AgentMapPresenter::setCurrentAgent(const QString &name)
107 {
108
109 if(currentAgent && currentAgent->getName() != name)
110 undoStack->push(new AgentProfileCommands::SetCurrentAgent(agents, &currentAgent,name, vehicleProfilesMap, driverProfilesMap, this));
111 }
112
113 void AgentMapPresenter::setType(const QString &type)
114 {
115 undoStack->push(new AgentProfileCommands::EditAgentType(agents, currentAgent->getName(), type, this));
116 }
117
118 void AgentMapPresenter::addAgent(const QString &name)
119 {
120 undoStack->beginMacro(QString("added agent profile %1").arg(name));
121
122 undoStack->push(new AgentProfileCommands::AddAgentProfile(agents, agentsView, name));
123 undoStack->push(new AgentProfileCommands::SetCurrentAgent(agents, &currentAgent, name, vehicleProfilesMap, driverProfilesMap,this));
124
125 undoStack->endMacro();
126 }
127
128
129 void AgentMapPresenter::removeAgent(const QString &name)
130 {
131 if(currentAgent && currentAgent->getName() == name)
132 {
133 QList<AgentItemInterface::Name> agentList = agents->keys();
134 agentList.removeAll(name);
135 AgentItemInterface::Name agentName = agentList.isEmpty() ? "" : agentList.first();
136
137 undoStack->beginMacro(QString("removed agent profile %1").arg(name));
138 undoStack->push(new AgentProfileCommands::SetCurrentAgent(agents, &currentAgent,agentName , vehicleProfilesMap, driverProfilesMap, this));
139 undoStack->push(new AgentProfileCommands::RemoveAgentProfile(agents, agentsView, name));
140 undoStack->endMacro();
141 }
142 }
143
144
145 void AgentMapPresenter::editAgent(const QString &oldName, const QString &newName)
146 {
147 if(!agents->keys().contains(newName))
148 undoStack->push(new AgentProfileCommands::EditAgentProfile(agents, agentsView, oldName, newName));
149 }
150
151 void AgentMapPresenter::addVehicleProfile()
152 {
153 AgentItemInterface::VehicleProfile profile = findUnusedVehicleProfile();
154
155 if( !vehicleProfilesList->isEmpty() && !profile.isEmpty() )
156 undoStack->push(new AgentProfileCommands::AddVehicleProfile(vehicleProfilesMap, profile, default_probability));
157 }
158
159 AgentItemInterface::VehicleProfile AgentMapPresenter::findUnusedVehicleProfile()
160 {
161 for( auto profile : *vehicleProfilesList)
162 {
163 if ( !currentAgent->getVehicleProfiles()->contains(profile) )
164 return profile;
165 }
166
167 return AgentItemInterface::VehicleProfile();
168 }
169
170 AgentItemInterface::VehicleProfile AgentMapPresenter::findUnusedDriverProfile()
171 {
172 for( auto profile : *driverProfilesList)
173 {
174 if ( !currentAgent->getDriverProfiles()->contains(profile) )
175 return profile;
176 }
177
178 return AgentItemInterface::DriverProfile();
179 }
180
181 void AgentMapPresenter::removeVehicleProfile(const int &row)
182 {
183 if(vehicleProfilesMap->rowCount() !=0)
184 undoStack->push(new AgentProfileCommands::RemoveVehicleProfile(vehicleProfilesMap, row));
185 }
186
187 void AgentMapPresenter::updateVehicleSelectionItems()
188 {
189 vehicleProfilesList->clear();
190 vehicleProfilesList->append( vehicleProfiles->keys() );
191 }
192
193 void AgentMapPresenter::checkVehicleProbabilities()
194 {
195 if(currentAgent)
196 {
197 double sum = 0;
198 for(auto probability : currentAgent->getVehicleProfiles()->values())
199 sum += probability;
200
201 agentsView->setVehicleProbabilityError(sum!=1.0 && !currentAgent->getVehicleProfiles()->isEmpty());
202 }
203 }
204
205 void AgentMapPresenter::addDriverProfile()
206 {
207 AgentItemInterface::DriverProfile profile = findUnusedDriverProfile();
208
209 if( !driverProfilesList->isEmpty() && !profile.isEmpty() )
210 undoStack->push(new AgentProfileCommands::AddDriverProfile(driverProfilesMap, profile, default_probability));
211 }
212
213 void AgentMapPresenter::removeDriverProfile(const int &row)
214 {
215 if(driverProfilesMap->rowCount() !=0)
216 undoStack->push(new AgentProfileCommands::RemoveDriverProfile(driverProfilesMap, row));
217 }
218
219 void AgentMapPresenter::updateDriverSelectionItems()
220 {
221 driverProfilesList->clear();
222 driverProfilesList->append( driverProfiles->keys() );
223 }
224
225 void AgentMapPresenter::checkDriverProbabilities()
226 {
227 if(currentAgent)
228 {
229 double sum = 0;
230 for(auto probability : currentAgent->getDriverProfiles()->values())
231 sum += probability;
232
233 agentsView->setDriverProbabilityError(sum!=1.0 && !currentAgent->getDriverProfiles()->isEmpty());
234 }
235 }
236
237 void AgentMapPresenter::updateView()
238 {
239 // clear the whole view
240 agentsView->clear();
241
242 // enable configuration depending on current agent
243 agentsView->enableConfiguration( currentAgent != nullptr );
244
245 if(currentAgent)
246 {
247 agentsView->setCurrentAgent(currentAgent->getName());
248
249 // Set the Type property
250 agentsView->setCurrentType(currentAgent->getType());
251
252 if(currentAgent->getType() == "Dynamic")
253 {
254 vehicleProfilesMap->update();
255 updateVehicleSelectionItems();
256
257 driverProfilesMap->update();
258 updateDriverSelectionItems();
259 }
260 if(currentAgent->getType() == "Static")
261 {
262 // refresh system Config
263 refreshSystemConfig();
264 agentsView->setCurrentSystemConfig(currentAgent->getSystemConfig());
265
266 // refresh model catalogue & set current model
267 refreshModelCatalogue();
268 agentsView->setCurrentModelCatalogue(currentAgent->getVehicleModelCatalogue());
269 }
270 }
271
272 }
273
274
275 void AgentMapPresenter::updateAgentSelectionItems()
276 {
277 agentsView->setAgentSelectionItems( agents->keys() );
278 }
279
280 void AgentMapPresenter::setSystem(const QString &system)
281 {
282 // construct the system title
283 QString title = system.section(" (ID: ",0,0);
284
285 // construct the system ID
286 QString ID = system.section(" (ID: ",1,1);
287
288 // to remove the ")" at the end
289 ID.chop(1);
290
291 undoStack->push(new AgentProfileCommands::EditAgentSystem(agents, agentsView, currentAgent->getName(), title, ID.toUInt()));
292 }
293
294 void AgentMapPresenter::setSystemConfig()
295 {
296 QString const filepath = QFileDialog::getOpenFileName(agentsView, QObject::tr("openPASS / Choose system configuration file"),
297 project->getConfigPath(), QStringLiteral("systemConfig (*.xml)") );
298
299 AgentItemInterface::SystemConfig systemConfig = project->relativeToConfigPath(filepath);
300
301 if(currentAgent && !filepath.isEmpty())
302 {
303 AgentItemInterface::SystemConfig oldSystemConfig = currentAgent->getSystemConfig();
304
305 undoStack->beginMacro(QString("edited system config of agent profile %1").arg(currentAgent->getName()));
306
307 undoStack->push(new AgentProfileCommands::EditAgentSystemConfig(agents, agentsView, this, currentAgent->getName(), systemConfig));
308
309 if(systemConfig != oldSystemConfig && !systemList.isEmpty())
310 setSystem(systemList.last());
311
312 undoStack->endMacro();
313 }
314 }
315
316 void AgentMapPresenter::refreshSystemConfig()
317 {
318 if(currentAgent)
319 {
320 QString systemConfig = currentAgent->getSystemConfig();
321 setSystemItems(systemConfig);
322
323 agentsView->setSystemConfigError("");
324
325 if(systemConfig.isEmpty())
326 return;
327
328 if(!QFileInfo::exists(project->absoluteToConfigPath(systemConfig)))
329 {
330 agentsView->setSystemConfigError("System config not accessible! Check configuration path in Project plugin.");
331 agentsView->enableSystemView(false);
332 return;
333 }
334
335 QString currentSystem = currentAgent->getSystemTitle()
336 + QString(" (ID: %1)").arg(currentAgent->getSystemID());
337
338 if(systemList.contains(currentSystem))
339 {
340 agentsView->enableSystemView(true);
341 agentsView->setCurrentSystem(currentSystem);
342 }
343 else if(!currentAgent->getSystemTitle().isEmpty()){
344 agentsView->setSystemConfigError("System does not exist in system config!");
345 agentsView->enableSystemView(false);
346 }
347 }
348 }
349
350 void AgentMapPresenter::setSystemItems(const QString &systemConfig)
351 {
352 unsigned int id = 0;
353 QString title;
354 QString path = project->absoluteToConfigPath(systemConfig);
355 QFile filepath(path);
356
357 systemList.clear();
358
359 if( filepath.exists() && filepath.open(QIODevice::ReadOnly | QIODevice::Text))
360 {
361
362 QXmlStreamReader xml(&filepath);
363 xml.readNextStartElement();
364 if(xml.name() == "systems")
365 {
366 while(xml.readNextStartElement())
367 {
368 if(xml.name() == "system")
369 {
370 while(xml.readNextStartElement())
371 {
372 if(xml.name() == "id")
373 id = xml.readElementText().toUInt();
374 else if( xml.name() == "title")
375 title = xml.readElementText();
376 else
377 xml.skipCurrentElement();
378 }
379 systemList << QString("%1 (ID: %2)").arg(title).arg(id);
380 }
381 else
382 xml.skipCurrentElement();
383 }
384 }
385 }
386
387 agentsView->setSystemSelectionItems(systemList);
388 }
389
390 void AgentMapPresenter::setModel(const QString &model)
391 {
392 if(currentAgent)
393 undoStack->push(new AgentProfileCommands::EditAgentModel(agents, agentsView, currentAgent->getName(), model));
394 }
395
396 void AgentMapPresenter::setModelCatalogue()
397 {
398 QString const filepath = QFileDialog::getOpenFileName(
399 agentsView, QObject::tr("openPASS / Choose Vehicle Model Catalogue"),
400 project->getConfigPath(), QStringLiteral("VehicleModelCatalogue (*.xosc)"));
401
402 AgentItemInterface::VehicleModelCatalogue modelCatalogue = project->relativeToConfigPath(filepath);
403
404 if(currentAgent && !filepath.isEmpty())
405 {
406 AgentItemInterface::VehicleModelCatalogue oldModelCatalogue = currentAgent->getVehicleModelCatalogue();
407
408 undoStack->beginMacro(QString("edited vehicle model catalogue of agent profile %1").arg(currentAgent->getName()));
409
410 undoStack->push(new AgentProfileCommands::EditAgentModelCatalogue(agents, agentsView, this, currentAgent->getName(), modelCatalogue));
411
412 if(modelCatalogue!=oldModelCatalogue && !modelList.isEmpty())
413 undoStack->push(new AgentProfileCommands::EditAgentModel(agents, agentsView, currentAgent->getName(), modelList.last()));
414
415 undoStack->endMacro();
416 }
417
418 }
419
420 void AgentMapPresenter::refreshModelCatalogue()
421 {
422 if(currentAgent)
423 {
424 QString modelCatalogue = currentAgent->getVehicleModelCatalogue();
425 setModelItems(modelCatalogue);
426 agentsView->setModelCatalogueError("");
427
428 if(modelCatalogue.isEmpty())
429 return;
430
431 if(!QFileInfo::exists(project->absoluteToConfigPath(modelCatalogue)))
432 {
433 agentsView->setModelCatalogueError("Model catalogue not accessible! Check configuration path in Project plugin.");
434 agentsView->enableModelView(false);
435 return;
436 }
437
438 if(modelList.contains(currentAgent->getVehicleModel()))
439 {
440 agentsView->enableModelView(true);
441 agentsView->setCurrentModel(currentAgent->getVehicleModel());
442 }
443 else if(!currentAgent->getVehicleModel().isEmpty()){
444 agentsView->setModelCatalogueError("Model does not exist in model catalogue!");
445 agentsView->enableModelView(false);
446 }
447 }
448 }
449
450
451 void AgentMapPresenter::setModelItems(const QString &modelCatalogue)
452 {
453 QString path = project->absoluteToConfigPath(modelCatalogue);
454 QFile file(path);
455
456 modelList.clear();
457
458 if(file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text) )
459 {
460
461 QXmlStreamReader xml(&file);
462 xml.readNextStartElement();
463
464 while( xml.readNextStartElement() )
465 {
466 if(xml.name() == QString("Catalog"))
467 {
468 while( xml.readNextStartElement() )
469 {
470 if(xml.name() == QString("Vehicle"))
471 {
472 modelList << xml.attributes().value("name").toString();
473 xml.skipCurrentElement();
474 }
475 else
476 xml.skipCurrentElement();
477 }
478 }
479 else
480 xml.skipCurrentElement();
481 }
482 }
483 agentsView->setModelSelectionItems(modelList);
484 }
485
486 using namespace AgentProfileCommands;
487
488 SetCurrentAgent::SetCurrentAgent(AgentMapInterface const * const agents,
489 AgentItemInterface ** const currentAgent,
490 AgentItemInterface::Name const newAgent,
491 VehicleProfilesMapPresenter * const vehicleProfilesMap,
492 DriverProfilesMapPresenter * const driverProfilesMap,
493 AgentMapPresenter * const agentMap,
494 QUndoCommand * parent)
495 : QUndoCommand (parent)
496 , agents(agents)
497 , currentAgent(currentAgent)
498 , newAgent(newAgent)
499 , oldAgent(*currentAgent ? (*currentAgent)->getName() : "")
500 , agentsMap(agentMap)
501 , vehicleProfilesMap(vehicleProfilesMap)
502 , driverProfilesMap(driverProfilesMap)
503 {
504 setText(QString("changed agent profile: %1 -> %2").arg(oldAgent).arg(newAgent));
505 }
506
507 void SetCurrentAgent::redo()
508 {
509 // set the reference to the agent (model) item currently selected in combo box
510 *currentAgent = agents->getItem(newAgent);
511
512 if(*currentAgent)
513 {
514 // adjust vehicle profiles presenter for the table view
515 vehicleProfilesMap->setVehicleProfiles( (*currentAgent)->getVehicleProfiles() );
516
517 // adjust vehicle profiles presenter for the table view
518 driverProfilesMap->setDriverProfiles( (*currentAgent)->getDriverProfiles());
519 }
520 else
521 {
522 vehicleProfilesMap->setVehicleProfiles(nullptr);
523 driverProfilesMap->setDriverProfiles(nullptr);
524 }
525
526 agentsMap->updateView();
527 }
528
529
530 void SetCurrentAgent::undo()
531 {
532 // set the reference to the agent (model) item currently selected in combo box
533 *currentAgent = agents->getItem(oldAgent);
534
535 if(*currentAgent)
536 {
537 // adjust vehicle profiles presenter for the table view
538 vehicleProfilesMap->setVehicleProfiles((*currentAgent)->getVehicleProfiles() );
539
540 // adjust vehicle profiles presenter for the table view
541 driverProfilesMap->setDriverProfiles((*currentAgent)->getDriverProfiles());
542 }
543 else
544 {
545 vehicleProfilesMap->setVehicleProfiles(nullptr);
546 driverProfilesMap->setDriverProfiles(nullptr);
547 }
548
549 agentsMap->updateView();
550 }
551
552 AddAgentProfile::AddAgentProfile(AgentMapInterface * const agents,
553 AgentMapView * const agentsView,
554 AgentMapInterface::Name const &name,
555 QUndoCommand * parent)
556 : QUndoCommand(parent)
557 , agents(agents)
558 , agentsView(agentsView)
559 , name(name)
560 {
561 setText(QString("added agent profile %1").arg(name));
562 }
563
564 void AddAgentProfile::redo()
565 {
566 agents->add(name);
567 agentsView->addAgent(name);
568 }
569
570 void AddAgentProfile::undo()
571 {
572 agents->remove(name);
573 agentsView->removeAgent(name);
574 }
575
576 RemoveAgentProfile::RemoveAgentProfile(AgentMapInterface * const agents,
577 AgentMapView * const agentsView,
578 AgentMapInterface::Name const &name,
579 QUndoCommand * parent)
580 : QUndoCommand(parent)
581 , agents(agents)
582 , agentsView(agentsView)
583 , name(name)
584 , agent(new AgentItemModel(agents->getItem(name)))
585 {
586 setText(QString("removed agent profile %1").arg(name));
587 }
588
589 RemoveAgentProfile::~RemoveAgentProfile()
590 {
591 delete agent;
592 }
593
594 void RemoveAgentProfile::redo()
595 {
596 agents->remove(name);
597 agentsView->removeAgent(name);
598 }
599
600 void RemoveAgentProfile::undo()
601 {
602 agents->add(name, agent);
603 agentsView->addAgent(name);
604 }
605
606 AddDriverProfile::AddDriverProfile(DriverProfilesMapPresenter * const drivers,
607 AgentItemInterface::DriverProfile const &profile,
608 AgentItemInterface::Probability const &probability,
609 QUndoCommand *parent)
610 : QUndoCommand(parent)
611 , drivers(drivers)
612 , profile(profile)
613 , probability(probability)
614 {
615 setText(QString("included driver profile %1 into agent profile").arg(profile));
616 }
617
618 void AddDriverProfile::redo()
619 {
620 drivers->addRow(drivers->rowCount(), profile, probability);
621 }
622
623 void AddDriverProfile::undo()
624 {
625 drivers->removeRow(drivers->rowCount()-1);
626 }
627
628 RemoveDriverProfile::RemoveDriverProfile(DriverProfilesMapPresenter * const drivers,
629 int const &row,
630 QUndoCommand *parent)
631 : QUndoCommand (parent)
632 , drivers(drivers)
633 , row(row)
634 , profile(drivers->data(drivers->index(row,0)).toString())
635 , probability(drivers->data(drivers->index(row,1)).toDouble())
636 {
637 setText(QString("removed driver profile %1 from agent profile").arg(profile));
638 }
639
640 void RemoveDriverProfile::redo()
641 {
642 drivers->removeRow(row);
643 }
644
645 void RemoveDriverProfile::undo()
646 {
647 drivers->addRow(row, profile, probability);
648 }
649
650 EditAgentProfile::EditAgentProfile(AgentMapInterface * const agents,
651 AgentMapView * const agentsView,
652 AgentItemInterface::Name const &oldName,
653 AgentItemInterface::Name const &newName,
654 QUndoCommand *parent)
655 : QUndoCommand(parent)
656 , agents(agents)
657 , agentsView(agentsView)
658 , oldName(oldName)
659 , newName(newName)
660 {
661 setText(QString("edited agent profile's name %1 -> %2").arg(oldName).arg(newName));
662 }
663
664 void EditAgentProfile::redo()
665 {
666 AgentItemInterface * const agent = agents->getItem(oldName);
667 agents->setName(agent, newName);
668 agentsView->removeAgent(oldName);
669 agentsView->addAgent(newName);
670 }
671
672 void EditAgentProfile::undo()
673 {
674 AgentItemInterface * const agent = agents->getItem(newName);
675 agents->setName(agent, oldName);
676 agentsView->removeAgent(newName);
677 agentsView->addAgent(oldName);
678 }
679
680 EditAgentType::EditAgentType(AgentMapInterface * const agents,
681 AgentItemInterface::Name const &agentName,
682 AgentItemInterface::Type const &newType,
683 AgentMapPresenter * const agentsPresenter,
684 QUndoCommand *parent)
685 : QUndoCommand(parent)
686 , agents(agents)
687 , agentName(agentName)
688 , newType(newType)
689 , oldType(agents->getItem(agentName)->getType())
690 , agentsPresenter(agentsPresenter)
691 {
692 setText(QString("edited type of agent profile %1").arg(agentName));
693 }
694
695 void EditAgentType::redo()
696 {
697 agents->getItem(agentName)->setType(newType);
698 agentsPresenter->updateView();
699 }
700
701 void EditAgentType::undo()
702 {
703 agents->getItem(agentName)->setType(oldType);
704 agentsPresenter->updateView();
705 }
706
707 EditAgentSystemConfig::EditAgentSystemConfig(AgentMapInterface * const agents,
708 AgentMapView * const agentsView,
709 AgentMapPresenter * const agentsPresenter,
710 AgentItemInterface::Name const &agentName,
711 AgentItemInterface::SystemConfig const &newSystemConfig,
712 QUndoCommand *parent)
713 : QUndoCommand(parent)
714 , agents(agents)
715 , agentsView(agentsView)
716 , agentsPresenter(agentsPresenter)
717 , agentName(agentName)
718 , newSystemConfig(newSystemConfig)
719 , oldSystemConfig(agents->getItem(agentName)->getSystemConfig())
720 {
721 setText(QString("edited system config of agent profile %1").arg(agentName));
722 }
723
724 void EditAgentSystemConfig::redo()
725 {
726 agentsPresenter->setSystemItems(newSystemConfig);
727 agents->getItem(agentName)->setSystemConfig(newSystemConfig);
728 agentsView->setCurrentSystemConfig(newSystemConfig);
729 }
730
731 void EditAgentSystemConfig::undo()
732 {
733 agentsPresenter->setSystemItems(oldSystemConfig);
734 agents->getItem(agentName)->setSystemConfig(oldSystemConfig);
735 agentsView->setCurrentSystemConfig(oldSystemConfig);
736 }
737
738 EditAgentSystem::EditAgentSystem(AgentMapInterface * const agents,
739 AgentMapView * const agentsView,
740 AgentItemInterface::Name const &agentName,
741 AgentItemInterface::SystemTitle const &newTitle,
742 AgentItemInterface::SystemID const &newId,
743 QUndoCommand *parent)
744 : QUndoCommand(parent)
745 , agents(agents)
746 , agentsView(agentsView)
747 , agentName(agentName)
748 , newTitle(newTitle)
749 , newId(newId)
750 , oldTitle(agents->getItem(agentName)->getSystemTitle())
751 , oldId(agents->getItem(agentName)->getSystemID())
752 {
753 setText(QString("changed system of agent profile %1").arg(agentName));
754 }
755
756 void EditAgentSystem::redo()
757 {
758 agents->getItem(agentName)->setSystemTitle(newTitle);
759 agents->getItem(agentName)->setSystemID(newId);
760 agentsView->setCurrentSystem(QString("%1 (ID: %2)").arg(newTitle).arg(newId));
761 }
762
763 void EditAgentSystem::undo()
764 {
765 agents->getItem(agentName)->setSystemTitle(oldTitle);
766 agents->getItem(agentName)->setSystemID(oldId);
767 agentsView->setCurrentSystem(QString("%1 (ID: %2)").arg(oldTitle).arg(oldId));
768 }
769
770 EditAgentModelCatalogue::EditAgentModelCatalogue(AgentMapInterface * const agents,
771 AgentMapView * const agentsView,
772 AgentMapPresenter * const agentsPresenter,
773 AgentItemInterface::Name const &agentName,
774 AgentItemInterface::VehicleModelCatalogue const &newModelCatalogue,
775 QUndoCommand *parent)
776 : QUndoCommand(parent)
777 , agents(agents)
778 , agentsView(agentsView)
779 , agentsPresenter(agentsPresenter)
780 , agentName(agentName)
781 , newModelCatalogue(newModelCatalogue)
782 , oldModelCatalogue(agents->getItem(agentName)->getVehicleModelCatalogue())
783 {
784 setText(QString("edited vehicle model catalogue of agent profile %1").arg(agentName));
785 }
786
787 void EditAgentModelCatalogue::redo()
788 {
789 agentsPresenter->setModelItems(newModelCatalogue);
790 agents->getItem(agentName)->setVehicleModelCatalogue(newModelCatalogue);
791 agentsView->setCurrentModelCatalogue(newModelCatalogue);
792 agentsPresenter->refreshModelCatalogue();
793 }
794
795 void EditAgentModelCatalogue::undo()
796 {
797 agentsPresenter->setModelItems(oldModelCatalogue);
798 agents->getItem(agentName)->setVehicleModelCatalogue(oldModelCatalogue);
799 agentsView->setCurrentModelCatalogue(oldModelCatalogue);
800 agentsPresenter->refreshModelCatalogue();
801 }
802
803 EditAgentModel::EditAgentModel(AgentMapInterface * const agents,
804 AgentMapView * const agentsView,
805 AgentItemInterface::Name const &agentName,
806 AgentItemInterface::VehicleModel const &newModel,
807 QUndoCommand *parent)
808 : QUndoCommand(parent)
809 , agents(agents)
810 , agentsView(agentsView)
811 , agentName(agentName)
812 , newModel(newModel)
813 , oldModel(agents->getItem(agentName)->getVehicleModel())
814 {
815 setText(QString("edited vehicle model of agent profile %1").arg(agentName));
816 }
817
818 void EditAgentModel::redo()
819 {
820 agents->getItem(agentName)->setVehicleModel(newModel);
821 agentsView->setCurrentModel(newModel);
822 }
823
824 void EditAgentModel::undo()
825 {
826 agents->getItem(agentName)->setVehicleModel(oldModel);
827 agentsView->setCurrentModel(oldModel);
828 }
829
830 AddVehicleProfile::AddVehicleProfile(VehicleProfilesMapPresenter * const vehicles,
831 AgentItemInterface::VehicleProfile const &profile,
832 AgentItemInterface::Probability const &probability,
833 QUndoCommand *parent)
834 : QUndoCommand(parent)
835 , vehicles(vehicles)
836 , profile(profile)
837 , probability(probability)
838 {
839 setText(QString("included vehicle profile %1 into agent profile").arg(profile));
840 }
841
842 void AddVehicleProfile::redo()
843 {
844 vehicles->addRow(vehicles->rowCount(), profile, probability);
845 }
846
847 void AddVehicleProfile::undo()
848 {
849 vehicles->removeRow(vehicles->rowCount() - 1);
850 }
851
852 RemoveVehicleProfile::RemoveVehicleProfile(VehicleProfilesMapPresenter * const vehicles,
853 int const &row,
854 QUndoCommand *parent)
855 : QUndoCommand (parent)
856 , vehicles(vehicles)
857 , row(row)
858 , profile(vehicles->data(vehicles->index(row,0)).toString())
859 , probability(vehicles->data(vehicles->index(row,1)).toDouble())
860 {
861 setText(QString("removed vehicle profile %1 from agent profile").arg(profile));
862 }
863
864 void RemoveVehicleProfile::redo()
865 {
866 vehicles->removeRow(row);
867 }
868
869 void RemoveVehicleProfile::undo()
870 {
871 vehicles->addRow(row, profile, probability);
872 }
AgentItemInterface::getVehicleModelCatalogue
virtual VehicleModelCatalogue getVehicleModelCatalogue() const =0
Method which returns the current vehicle model catalogue (for static agent profiles).
AgentProfileCommands::EditAgentType
This class defines the command for undoable set-operations on the type (static or dynamic) of an agen...
Definition: AgentMapPresenter.h:480
AgentMapPresenter.h
This file contains the class AgentMapPresenter defining the presenter object for agent profiles as we...
AgentMapPresenter::vehicleProfilesMap
VehicleProfilesMapPresenter * vehicleProfilesMap
the pointer to the presenter object of the table for assigning vehicle profiles to the current agent ...
Definition: AgentMapPresenter.h:352
DriverProfileMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all driver profile names in the map.
AgentMapPresenter::setModelCatalogue
void setModelCatalogue()
Slot triggered by the AgentMapView::setModelCatalogue signal. Opens a file dialog for the user to sel...
Definition: AgentMapPresenter.cpp:396
DriverProfileMapInterface::modifiedName
void modifiedName(Name const &oldName, Name const &newName)
Signal emitted when the name of the driver profile has been changed. Transmits both, the new and old names of the profile.
AgentMapView
This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu ...
Definition: AgentMapView.h:56
AgentItemInterface::getVehicleModel
virtual VehicleModel getVehicleModel() const =0
Method which returns the currently selected vehicle profile (for static agent profiles).
AgentItemInterface::DriverProfile
QString DriverProfile
the nome of a driver profile
Definition: AgentItemInterface.h:60
AgentMapPresenter::checkDriverProbabilities
void checkDriverProbabilities()
Slot triggered by the DriverProfilesMapPresenter::checkProbabilities signal. Calculates the probabili...
Definition: AgentMapPresenter.cpp:225
AgentMapPresenter::setSystemConfig
void setSystemConfig()
Slot triggered by the AgentMapView::setSystemConfig signal. Opens a file dialog for the user to selec...
Definition: AgentMapPresenter.cpp:294
AgentMapView::modifiedName
void modifiedName(QString const &oldName, QString const &newName)
Signal, emitted after the rename-button has been pressed. Transmits the new name inserted by the user...
AgentItemInterface::setVehicleModel
virtual void setVehicleModel(VehicleModel const &_vehicleModel)=0
Method which sets the currently selected vehicle profile to the one passed as an argument (for static...
AgentItemInterface::SystemID
unsigned int SystemID
the id of a system defined in a system config
Definition: AgentItemInterface.h:49
AgentProfileCommands::AddAgentProfile
This class defines the command for undoable add-operations on the map of agent profiles (AgentMapInte...
Definition: AgentMapPresenter.h:408
AgentMapPresenter::modelList
QList< QString > modelList
a list of all vehicle models available in the currently selected vehicle model catalogue ...
Definition: AgentMapPresenter.h:363
AgentMapView::setSystemSelectionItems
void setSystemSelectionItems(const QStringList &systemItems)
Method which the sets the systems&#39; selection list (drop down menu) to the one passed as an argument...
Definition: AgentMapView.cpp:229
AgentProfileCommands::EditAgentProfile
This class defines the command for undoable renaming-operations on the map of agent profiles (AgentMa...
Definition: AgentMapPresenter.h:455
DriverProfilesMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: DriverProfilesMapPresenter.cpp:32
AgentMapView::setModelCatalogue
void setModelCatalogue()
Signal, emitted after the browse-button of the vehicle model catalogue has been pressed (only in "sta...
AgentItemInterface::SystemTitle
QString SystemTitle
the title of a system defined in a system config
Definition: AgentItemInterface.h:50
AgentItemInterface::getType
virtual Type getType() const =0
Method which returns the type of this agent profile.
DriverProfilesMapPresenter::checkProbabilities
void checkProbabilities()
Signal emitted whenever the probability sum of the driver profile table should be checked...
AgentMapView::clear
void clear()
Method which clears the current selection elements for static agent profiles and sets the type and mo...
Definition: AgentMapView.cpp:142
AgentProfileCommands::RemoveDriverProfile
This class defines the command for undoable remove-operations on the driver profiles table of the cur...
Definition: AgentMapPresenter.h:645
AgentItemInterface::setSystemTitle
virtual void setSystemTitle(SystemTitle const &_systemTitle)=0
Method which sets the currently selected system title to the one passed as an argument (for static ag...
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentMapPresenter::removeDriverProfile
void removeDriverProfile(const int &row)
Slot triggered by the AgentMapView::removeDriverProfile signal. Performs an undoable remove-operation...
Definition: AgentMapPresenter.cpp:213
AgentMapPresenter::refreshSystemConfig
void refreshSystemConfig()
Slot triggered by the AgentMapView::refreshSystemConfig and ProjectInterface::update signals...
Definition: AgentMapPresenter.cpp:316
AgentMapView::setCurrentModel
void setCurrentModel(const QString &model)
Method which the sets the vehicle model currently displayed by the vehicle models&#39; drop down menu to ...
Definition: AgentMapView.cpp:258
AgentMapPresenter::setupVehicleProfilesMap
void setupVehicleProfilesMap()
Method which is called by the constructor. Instantiates and sets up the presenter object (VehicleProf...
Definition: AgentMapPresenter.cpp:78
AgentMapPresenter::setCurrentAgent
void setCurrentAgent(const QString &name)
Slot triggered by the AgentMapView::selectionChanged signal. Performs an undoable set-operation on th...
Definition: AgentMapPresenter.cpp:106
AgentProfileCommands::SetCurrentAgent
This class defines the command for undoable set-operations on the currently selected agent profile...
Definition: AgentMapPresenter.h:375
AgentMapPresenter::setModelItems
void setModelItems(QString const &modelCatalogue)
Slot which is used to scan the model catalogue file for available vehicle models. Updates the selecti...
Definition: AgentMapPresenter.cpp:451
VehicleProfileMapInterface::added
void added(Name const &name)
Signal emitted when a vehicle profile has been added to the map. Transmits the name of the correpondi...
AgentMapInterface::add
virtual bool add(AgentMapInterface::Name const &name)=0
Method which creates a new agent profile (instance of AgentItemInterface) and adds it to the map unde...
AgentMapView::enableModelView
void enableModelView(bool enable)
Method which enables or disables the drop down menu for vehicle models (for static agent profiles)...
Definition: AgentMapView.cpp:41
VehicleProfilesMapPresenter::update
void update()
Method which updates the table according to the current entries of vehicleProfiles.
Definition: VehicleProfilesMapPresenter.cpp:149
AgentItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profi...
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentMapPresenter::agents
AgentMapInterface *const agents
the pointer to the map of agent profiles (edited by this presenter)
Definition: AgentMapPresenter.h:345
AgentMapView::setSystemConfig
void setSystemConfig()
Signal, emitted after the browse-button of the system config has been pressed (only in "static" mode)...
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentMapView::setModel
void setModel(QString const &model)
Signal, emitted after the current entry in the vehicle model selection box has been changed by the us...
AgentMapView::setCurrentModelCatalogue
void setCurrentModelCatalogue(const QString &modelCatalogue)
Method which the currently displayed vehicle model catalogue to the one passed as an argument...
Definition: AgentMapView.cpp:253
VehicleProfilesMapPresenter::removeRow
virtual bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: VehicleProfilesMapPresenter.cpp:122
AgentMapView::setModelSelectionItems
void setModelSelectionItems(const QStringList &modelItems)
Method which the sets the vehicle models&#39; selection list (drop down menu) to the one passed as an arg...
Definition: AgentMapView.cpp:264
AgentItemInterface::Type
QString Type
the type of the agent profile (dynamic or static)
Definition: AgentItemInterface.h:44
AgentProfileCommands::RemoveAgentProfile
This class defines the command for undoable remove-operations on the map of agent profiles (AgentMapI...
Definition: AgentMapPresenter.h:430
VehicleProfileMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all vehicle profile names in the map.
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
DriverProfilesMapPresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of driver prof...
Definition: DriverProfilesMapPresenter.h:33
AgentItemInterface::VehicleModel
QString VehicleModel
a vehicle model defined in a vehicle model catalogue file
Definition: AgentItemInterface.h:53
DriverProfilesMapPresenter::setDriverProfiles
void setDriverProfiles(AgentItemInterface::DriverProfiles *const _driverProfiles)
Method which sets the currently processed driver profiles map to the given argument.
Definition: DriverProfilesMapPresenter.cpp:144
DriverProfileMapInterface::removed
void removed(Name const &name)
Signal emitted when a driver profile has been removed from the map. Transmits the name of the correpo...
AgentMapInterface::Name
AgentItemInterface::Name Name
the name of the agent profile (key identifier)
Definition: AgentMapInterface.h:42
AgentItemInterface::getSystemTitle
virtual SystemTitle getSystemTitle() const =0
Method which returns the title of the currently selected system (for static agent profiles)...
AgentMapPresenter::setType
void setType(const QString &type)
Slot triggered by the AgentMapView::typeChanged signal. Performs an undoable set-operation on the typ...
Definition: AgentMapPresenter.cpp:113
AgentItemInterface::VehicleModelCatalogue
QString VehicleModelCatalogue
the vehicle model catalogue file
Definition: AgentItemInterface.h:52
AgentProfileCommands::AddDriverProfile
This class defines the command for undoable add-operations on the driver profiles table of the curren...
Definition: AgentMapPresenter.h:620
AgentMapView::refreshSystemConfig
void refreshSystemConfig()
Signal, emitted after the refresh-button of the system config has been pressed (only in "static" mode...
AgentMapPresenter::addVehicleProfile
void addVehicleProfile()
Slot triggered by the AgentMapView::addVehicleProfile signal. Performs an undoable add-operation on t...
Definition: AgentMapPresenter.cpp:151
VehicleProfilesMapPresenter::checkProbabilities
void checkProbabilities()
Signal emitted whenever the probability sum of the vehicle profile table should be checked...
AgentMapPresenter::checkVehicleProbabilities
void checkVehicleProbabilities()
Slot triggered by the VehicleProfilesMapPresenter::checkProbabilities signal. Calculates the probabil...
Definition: AgentMapPresenter.cpp:193
AgentMapPresenter::setSystemItems
void setSystemItems(QString const &systemConfig)
Slot which is used to scan the given system config for available systems. Updates the selection of th...
Definition: AgentMapPresenter.cpp:350
VehicleProfilesMapPresenter::addRow
virtual void addRow(int const &row, AgentItemInterface::VehicleProfile const &profile, AgentItemInterface::Probability const &probability)
Method that adds a new row, i.e. a vehicle profile with the given probability.
Definition: VehicleProfilesMapPresenter.cpp:103
AgentMapPresenter::setupDriverProfilesMap
void setupDriverProfilesMap()
Method which is called by the constructor. Instantiates and sets up the presenter object (DriverProfi...
Definition: AgentMapPresenter.cpp:92
AgentMapView::removeAgent
void removeAgent(QString const &name)
Method which removes the given agent profile name from the agent selection list (drop down menu for a...
Definition: AgentMapView.cpp:130
DriverProfileMapInterface::added
void added(Name const &name)
Signal emitted when a driver profile has been added to the map. Transmits the name of the correpondin...
AgentMapView::removeDriverProfile
void removeDriverProfile(const int &row)
Signal, emitted after the remove-button for driver profiles has been clicked by the user (only in "dy...
VehicleProfilesMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: VehicleProfilesMapPresenter.cpp:32
AgentMapInterface::remove
virtual bool remove(AgentMapInterface::Name const &name)=0
Method which removes the agent profile with the given name from the map. The profile is deleted after...
AgentMapView::setCurrentSystem
void setCurrentSystem(const QString &system)
Method which the sets the system currently displayed by the systems&#39; drop down menu to the one passed...
Definition: AgentMapView.cpp:223
AgentMapView::enableConfiguration
void enableConfiguration(bool enable)
Method which enables or disables the GUI elements of this view, apart from the add-button for adding ...
Definition: AgentMapView.cpp:51
AgentMapView::selectionChanged
void selectionChanged(QString const &name)
Signal, emitted after the current entry of the combo box for available agent profiles has been change...
AgentMapPresenter::findUnusedDriverProfile
AgentItemInterface::DriverProfile findUnusedDriverProfile()
Method which scans the driver profiles map (DriverProfileMapInterface) for the first entry which is n...
Definition: AgentMapPresenter.cpp:170
AgentMapView::setCurrentAgent
void setCurrentAgent(QString const &name)
Method which sets the agent profile name to be currently shown in the drop down menu for agent profil...
Definition: AgentMapView.cpp:113
AgentItemInterface::Name
QString Name
the name of the agent profiles
Definition: AgentItemInterface.h:43
AgentMapView::refreshModelCatalogue
void refreshModelCatalogue()
Signal, emitted after the refresh-button of the vehicle model catalogue has been pressed (only in "st...
AgentMapPresenter::removeVehicleProfile
void removeVehicleProfile(const int &row)
Slot triggered by the AgentMapView::removeVehicleProfile signal. Performs an undoable remove-operatio...
Definition: AgentMapPresenter.cpp:181
AgentMapModel.h
This class implements the functionality of AgentMapInterface.
AgentMapPresenter::updateDriverSelectionItems
void updateDriverSelectionItems()
Slot triggered by the DriverProfileMapInterface::added, DriverProfileMapInterface::removed and Driver...
Definition: AgentMapPresenter.cpp:219
AgentItemInterface::getSystemID
virtual SystemID getSystemID() const =0
Method which returns the id of the currently selected system (for static agent profiles).
AgentMapView::add
void add(QString const &name)
Signal, emitted after the add-button for agent profiles has been clicked and a name for a new profile...
AgentMapView::getVehicleProfilesView
QTableView * getVehicleProfilesView() const
Method which provides access to the table view for vehicle profiles.
Definition: AgentMapView.cpp:174
AgentMapPresenter::removeAgent
void removeAgent(QString const &name)
Slot triggered by the AgentMapView::remove signal. Performs an undoable remove-operation on the agent...
Definition: AgentMapPresenter.cpp:129
AgentMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all agent profile names in the map.
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
AgentMapPresenter::editAgent
void editAgent(QString const &oldName, QString const &newName)
Slot triggered by the AgentMapView::modifiedName signal. Performs an undoable rename-operation on the...
Definition: AgentMapPresenter.cpp:145
AgentMapView::addAgent
void addAgent(QString const &name)
Method which adds the given agent profile name to the agent selection list (drop down menu for agent ...
Definition: AgentMapView.cpp:119
AgentMapView::setVehicleProbabilityError
void setVehicleProbabilityError(bool error)
Method puts a probability error message above the vehicle profiles&#39; table if given error flag is "tru...
Definition: AgentMapView.cpp:302
VehicleProfileMapInterface::modifiedName
void modifiedName(Name const &oldName, Name const &newName)
Signal emitted when the name of the vehicle profile has been changed. Transmits both, the new and old names of the profile.
AgentMapPresenter::driverProfilesMap
DriverProfilesMapPresenter * driverProfilesMap
the pointer to the presenter object of the table for assigning driver profiles to the current agent p...
Definition: AgentMapPresenter.h:353
AgentProfileCommands::EditAgentModelCatalogue
This class defines the command for undoable set-operations on the vehicle model catalogue of the curr...
Definition: AgentMapPresenter.h:566
AgentMapPresenter
The AgentMapPresenter class handles user events from the view (AgentMapView) and edits the model data...
Definition: AgentMapPresenter.h:54
AgentMapPresenter::updateView
void updateView()
Method which updates the complete view (AgentMapView) according to the model data of the current agen...
Definition: AgentMapPresenter.cpp:237
AgentMapInterface::getItem
virtual AgentMapInterface::Item * getItem(AgentMapInterface::Name const &name) const =0
Method which returns a pointer to the agent profile with the given name. If the map does not contain ...
AgentMapView::setAgentSelectionItems
void setAgentSelectionItems(QStringList const &names)
Method which clears the selection list for agent profiles (drop down menu) and inserts the given list...
Definition: AgentMapView.cpp:124
AgentMapPresenter::driverProfiles
DriverProfileMapInterface *const driverProfiles
the pointer to the driver profiles&#39; map
Definition: AgentMapPresenter.h:347
AgentMapInterface::setName
virtual void setName(AgentMapInterface::Item *const item, AgentMapInterface::Name const &name)=0
Method wich changes the name of the given agent profile to the one passed as second argument...
AgentMapView::remove
void remove(QString const &name)
Signal, emitted after the remove-button for agent profiles has been clicked. Transmits the name of th...
VehicleProfilesMapPresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle pro...
Definition: VehicleProfilesMapPresenter.h:33
AgentItemInterface::getSystemConfig
virtual SystemConfig getSystemConfig() const =0
Method which returns the current system config file (for static agent profiles).
AgentMapPresenter::project
ProjectInterface *const project
the pointer to the project interface for accessing the path settings
Definition: AgentMapPresenter.h:356
AgentProfileCommands::EditAgentSystem
This class defines the command for undoable set-operations on the system of the currently edited agen...
Definition: AgentMapPresenter.h:535
AgentItemInterface::setType
virtual void setType(const Type &_type)=0
Method which sets the type of this agent profile to the one passed as an argument.
AgentMapView::getDriverProfilesView
QTableView * getDriverProfilesView() const
Method which provides access to the table view for driver profiles.
Definition: AgentMapView.cpp:179
AgentMapView::enableSystemView
void enableSystemView(bool enable)
Method which enables or disables the drop down menu for systems (for static agent profiles)...
Definition: AgentMapView.cpp:46
AgentMapView::setCurrentSystemConfig
void setCurrentSystemConfig(const QString &systemConfig)
Method which the currently displayed system config file to the one passed as an argument.
Definition: AgentMapView.cpp:218
AgentMapPresenter::setSystem
void setSystem(QString const &system)
Slot triggered by the AgentMapView::selectedSystem signal. First extracts Id and title of the given s...
Definition: AgentMapPresenter.cpp:280
AgentItemInterface::SystemConfig
QString SystemConfig
the system config file
Definition: AgentItemInterface.h:48
AgentMapPresenter::updateVehicleSelectionItems
void updateVehicleSelectionItems()
Slot triggered by the VehicleProfileMapInterface::added, VehicleProfileMapInterface::removed and Vehi...
Definition: AgentMapPresenter.cpp:187
AgentMapView::selectedSystem
void selectedSystem(QString const &system)
Signal, emitted after the current entry in the system selection box has been changed by the user...
AgentItemInterface::VehicleProfile
QString VehicleProfile
the name of a vehicle profile
Definition: AgentItemInterface.h:56
AgentMapPresenter::setModel
void setModel(QString const &model)
Slot triggered by the AgentMapView::setModel signal. Performs an undoable assignment of the given veh...
Definition: AgentMapPresenter.cpp:390
AgentItemInterface::getVehicleProfiles
virtual VehicleProfiles * getVehicleProfiles() const =0
Method which returns a pointer to the map of vehicle profiles, i.e. the mapping of vehicle profiles t...
DriverProfilesMapPresenter::removeRow
virtual bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: DriverProfilesMapPresenter.cpp:124
DriverProfilesMapPresenter::update
void update()
Method which updates the table according to the current entries of driverProfiles.
Definition: DriverProfilesMapPresenter.cpp:151
AgentMapView::typeChanged
void typeChanged(QString const &type)
Signal, emitted after the current entry of the combo box for the agent type (dynamic or static) has c...
AgentItemInterface
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-rele...
Definition: AgentItemInterface.h:38
AgentItemInterface::setSystemConfig
virtual void setSystemConfig(SystemConfig const &_systemConfig)=0
Method which sets the current system config file to the one passed as an argument (for static agent p...
AgentItemInterface::setVehicleModelCatalogue
virtual void setVehicleModelCatalogue(VehicleModelCatalogue const &_vehicleModelCatalogue)=0
Method which sets the current vehicle model catalogue to the one passed as an argument (for static ag...
AgentProfileCommands::RemoveVehicleProfile
This class defines the command for undoable remove-operations on the vehicle profiles table of the cu...
Definition: AgentMapPresenter.h:695
AgentMapView::addDriverProfile
void addDriverProfile()
Signal, emitted after add-button for driver profiles has been clicked by the user (only in "dynamic" ...
AgentMapPresenter::refreshModelCatalogue
void refreshModelCatalogue()
Slot triggered by the AgentMapView::refreshModelCatalogue and ProjectInterface::update signals...
Definition: AgentMapPresenter.cpp:420
AgentMapPresenter::addDriverProfile
void addDriverProfile()
Slot triggered by the AgentMapView::addDriverProfile signal. Performs an undoable add-operation on th...
Definition: AgentMapPresenter.cpp:205
VehicleProfileMapInterface::removed
void removed(Name const &name)
Signal emitted when a vehicle profile has been removed from the map. Transmits the name of the correp...
AgentProfileCommands::EditAgentModel
This class defines the command for undoable set-operations on the vehicle model of the currently edit...
Definition: AgentMapPresenter.h:594
AgentItemInterface::setSystemID
virtual void setSystemID(SystemID const &_systemID)=0
Method which sets the currently selected system id to the one passed as an argument (for static agent...
AgentMapView::setModelCatalogueError
void setModelCatalogueError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for editing the veh...
Definition: AgentMapView.cpp:288
ProjectInterface::update
void update()
Triggers signal to inform that an item from the project configuration has been modified.
VehicleProfilesMapPresenter::setVehicleProfiles
void setVehicleProfiles(AgentItemInterface::VehicleProfiles *const _vehicleProfiles)
Method which sets the currently processed vehicle profiles map to the given argument.
Definition: VehicleProfilesMapPresenter.cpp:142
AgentProfileCommands::EditAgentSystemConfig
This class defines the command for undoable set-operations on the system config file of the currently...
Definition: AgentMapPresenter.h:506
AgentMapPresenter::findUnusedVehicleProfile
AgentItemInterface::VehicleProfile findUnusedVehicleProfile()
Method which scans the vehicle profiles map (VehicleProfileMapInterface) for the first entry which is...
Definition: AgentMapPresenter.cpp:159
DriverProfilesMapPresenter::addRow
virtual void addRow(const int &row, AgentItemInterface::DriverProfile const &profile, AgentItemInterface::Probability const &probability)
Method that adds a new row, i.e. a driver profile with the given probability.
Definition: DriverProfilesMapPresenter.cpp:104
AgentMapInterface
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) ar...
Definition: AgentMapInterface.h:37
AgentItemInterface::Probability
double Probability
a probability value (e.g. of a driver or a vehicle profile)
Definition: AgentItemInterface.h:45
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
AgentMapView::addVehicleProfile
void addVehicleProfile()
Signal, emitted after add-button for vehicle profiles has been clicked by the user (only in "dynamic"...
AgentMapPresenter::driverProfilesList
QList< QString > * driverProfilesList
a pointer to a list of driver profiles containing all profiles registered in DriverProfileMapInterfac...
Definition: AgentMapPresenter.h:361
AgentMapPresenter::updateAgentSelectionItems
void updateAgentSelectionItems()
Method which updates the combo box list of available agent profiles to the ones currently defined in ...
Definition: AgentMapPresenter.cpp:275
AgentProfileCommands
Definition: AgentMapPresenter.h:368
AgentMapView::removeVehicleProfile
void removeVehicleProfile(const int &row)
Signal, emitted after the remove-button for vehicle profiles has been clicked by the user (only in "d...
AgentMapPresenter::vehicleProfiles
VehicleProfileMapInterface *const vehicleProfiles
the pointer to the vehicle profiles&#39; map
Definition: AgentMapPresenter.h:346
AgentMapView::setDriverProbabilityError
void setDriverProbabilityError(bool error)
Method puts a probability error message above the driver profiles&#39; table if given error flag is "true...
Definition: AgentMapView.cpp:293
AgentMapPresenter::systemList
QList< QString > systemList
a list of all systems available in the currently selected system config
Definition: AgentMapPresenter.h:362
AgentItemInterface::getDriverProfiles
virtual DriverProfiles * getDriverProfiles() const =0
Method which returns a pointer to the map of driver profiles, i.e. the mapping of driver profiles to ...
AgentMapView::setCurrentType
void setCurrentType(QString const &type)
Method which sets the agent profile type (dynamic or static) shown in the corresponding drop down men...
Definition: AgentMapView.cpp:184
AgentProfileCommands::AddVehicleProfile
This class defines the command for undoable add-operations on the vehicle profiles table of the curre...
Definition: AgentMapPresenter.h:670
AgentMapPresenter::addAgent
void addAgent(QString const &name)
Slot triggered by the AgentMapView::add signal. Performs an undoable add-operation on the agent profi...
Definition: AgentMapPresenter.cpp:118
AgentMapPresenter::vehicleProfilesList
QList< QString > * vehicleProfilesList
a pointer to a list of vehicle profiles containing all profiles registered in VehicleProfileMapInterf...
Definition: AgentMapPresenter.h:360
AgentMapPresenter::default_probability
static double default_probability
a default probability
Definition: AgentMapPresenter.h:364
AgentMapView::setSystemConfigError
void setSystemConfigError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for the system conf...
Definition: AgentMapView.cpp:283
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
AgentMapView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "AgentMapView.h"
12 #include "ui_AgentMapView.h"
13
14 #include <QInputDialog>
15 #include <QFileDialog>
16 #include <QMessageBox>
17
18 AgentMapView::AgentMapView(QWidget *parent) :
19 WidgetView(parent)
20 , ui(new Ui::AgentMapView)
21 {
22 ui->setupUi(this);
23
24 QFont headerFont;
25 headerFont.setBold(true);
26
27 enableConfiguration(false);
28
29 ui->VehicleView->installEventFilter(this);
30 ui->VehicleView->horizontalHeader()->setFont(headerFont);
31
32 ui->DriverView->installEventFilter(this);
33 ui->DriverView->horizontalHeader()->setFont(headerFont);
34 }
35
36 AgentMapView::~AgentMapView()
37 {
38 delete ui;
39 }
40
41 void AgentMapView::enableModelView(bool enable)
42 {
43 ui->Model->setEnabled(enable);
44 }
45
46 void AgentMapView::enableSystemView(bool enable)
47 {
48 ui->system->setEnabled(enable);
49 }
50
51 void AgentMapView::enableConfiguration(bool enable)
52 {
53 ui->remove->setEnabled(enable);
54 ui->edit->setEnabled(enable);
55 ui->Type->setEnabled(enable);
56
57 ui->addVehicle->setEnabled(enable);
58 ui->removeVehicle->setEnabled(enable);
59
60 ui->addDriver->setEnabled(enable);
61 ui->removeDriver->setEnabled(enable);
62
63 ui->system->setEnabled(enable);
64 ui->systemConfig->setEnabled(enable);
65 ui->systemConfigBrowse->setEnabled(enable);
66 ui->systemConfigRefresh->setEnabled(enable);
67
68 ui->Model->setEnabled(enable);
69 ui->ModelCatalogue->setEnabled(enable);
70 ui->ModelCatalogueBrowse->setEnabled(enable);
71 ui->ModelCatalogueRefresh->setEnabled(enable);
72 }
73
74 void AgentMapView::on_add_clicked()
75 {
76
77 QString newName = QInputDialog::getText (
78 this, tr ("Add Entry"),
79 tr ("Insert an agent profile name"),
80 QLineEdit::Normal);
81
82 if(!newName.isEmpty())
83 {
84 Q_EMIT add(newName);
85 }
86 }
87
88 void AgentMapView::on_remove_clicked()
89 {
90 QMessageBox warning;
91 int ret;
92
93 warning.setText(QString("The entry and corresponding data will be deleted!"));
94 warning.setInformativeText("Do you want to continue?");
95 warning.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
96 ret = warning.exec();
97
98 if(ret == QMessageBox::Yes)
99 Q_EMIT remove(ui->AgentProfileSelection->currentText());
100 }
101
102 void AgentMapView::on_edit_clicked()
103 {
104 QString newName = QInputDialog::getText (
105 this, tr ("Edit Entry"),
106 tr ("Insert a new name"),
107 QLineEdit::Normal);
108
109 if(!newName.isEmpty())
110 Q_EMIT modifiedName(ui->AgentProfileSelection->currentText(), newName);
111 }
112
113 void AgentMapView::setCurrentAgent(const QString &name)
114 {
115 if(ui->AgentProfileSelection->findText(name) != -1)
116 ui->AgentProfileSelection->setCurrentText(name);
117 }
118
119 void AgentMapView::addAgent(const QString &name)
120 {
121 ui->AgentProfileSelection->addItem(name);
122 }
123
124 void AgentMapView::setAgentSelectionItems(QStringList const &names)
125 {
126 ui->AgentProfileSelection->clear();
127 ui->AgentProfileSelection->addItems(names);
128 }
129
130 void AgentMapView::removeAgent(const QString &name)
131 {
132 int index = ui->AgentProfileSelection->findText(name);
133 ui->AgentProfileSelection->removeItem(index);
134 }
135
136
137 void AgentMapView::on_AgentProfileSelection_activated(const QString &name)
138 {
139 Q_EMIT selectionChanged(name);
140 }
141
142 void AgentMapView::clear()
143 {
144 ui->systemConfig->clear();
145 ui->system->clear();
146 ui->ModelCatalogue->clear();
147 ui->Model->clear();
148
149 ui->Type->setCurrentText("Dynamic");
150 ui->TypeSpecificElements->setCurrentIndex(0);
151 }
152
153
154 void AgentMapView::on_addVehicle_clicked()
155 {
156 Q_EMIT addVehicleProfile();
157 }
158
159 void AgentMapView::on_removeVehicle_clicked()
160 {
161 Q_EMIT removeVehicleProfile(ui->VehicleView->currentIndex().row());
162 }
163
164 void AgentMapView::on_addDriver_clicked()
165 {
166 Q_EMIT addDriverProfile();
167 }
168
169 void AgentMapView::on_removeDriver_clicked()
170 {
171 Q_EMIT removeDriverProfile(ui->DriverView->currentIndex().row());
172 }
173
174 QTableView * AgentMapView::getVehicleProfilesView() const
175 {
176 return ui->VehicleView;
177 }
178
179 QTableView * AgentMapView::getDriverProfilesView() const
180 {
181 return ui->DriverView;
182 }
183
184 void AgentMapView::setCurrentType(const QString &type)
185 {
186 if(type == "Dynamic")
187 {
188 ui->Type->setCurrentText(type);
189 ui->TypeSpecificElements->setCurrentWidget(ui->Dynamic);
190 }
191 if(type == "Static")
192 {
193 ui->Type->setCurrentText(type);
194 ui->TypeSpecificElements->setCurrentWidget(ui->Static);
195 }
196 }
197
198 void AgentMapView::on_Type_activated(const QString &type)
199 {
200 Q_EMIT typeChanged(type);
201 }
202
203 void AgentMapView::on_system_activated(const QString &system)
204 {
205 Q_EMIT selectedSystem(system);
206 }
207
208 void AgentMapView::on_systemConfigBrowse_clicked()
209 {
210 Q_EMIT setSystemConfig();
211 }
212
213 void AgentMapView::on_systemConfigRefresh_clicked()
214 {
215 Q_EMIT refreshSystemConfig();
216 }
217
218 void AgentMapView::setCurrentSystemConfig(const QString &systemConfig)
219 {
220 ui->systemConfig->setText(systemConfig);
221 }
222
223 void AgentMapView::setCurrentSystem(const QString &system)
224 {
225 if(ui->system->findText(system)!= -1)
226 ui->system->setCurrentText(system);
227 }
228
229 void AgentMapView::setSystemSelectionItems(const QStringList &systemItems)
230 {
231 ui->system->clear();
232
233 if(!systemItems.isEmpty())
234 ui->system->addItems(systemItems);
235 }
236
237
238 void AgentMapView::on_ModelCatalogueBrowse_clicked()
239 {
240 Q_EMIT setModelCatalogue();
241 }
242
243 void AgentMapView::on_ModelCatalogueRefresh_clicked()
244 {
245 Q_EMIT refreshModelCatalogue();
246 }
247
248 void AgentMapView::on_Model_activated(const QString &model)
249 {
250 Q_EMIT setModel(model);
251 }
252
253 void AgentMapView::setCurrentModelCatalogue(const QString &modelCatalogue)
254 {
255 ui->ModelCatalogue->setText(modelCatalogue);
256 }
257
258 void AgentMapView::setCurrentModel(const QString &model)
259 {
260 if(ui->Model->findText(model) != -1)
261 ui->Model->setCurrentText(model);
262 }
263
264 void AgentMapView::setModelSelectionItems(const QStringList &modelItems)
265 {
266 ui->Model->clear();
267 ui->Model->addItems(modelItems);
268 }
269
270 bool AgentMapView::eventFilter(QObject *watched, QEvent *event)
271 {
272 QTableView* table = qobject_cast<QTableView*> (watched);
273
274 if( table && event->type() == QEvent::Resize )
275 {
276 int cell = (table->width())/2;
277 table->setColumnWidth(0, cell);
278 }
279
280 return false;
281 }
282
283 void AgentMapView::setSystemConfigError(const QString &message)
284 {
285 ui->systemConfigError->setText(message);
286 }
287
288 void AgentMapView::setModelCatalogueError(const QString &message)
289 {
290 ui->modelCatalogueError->setText(message);
291 }
292
293 void AgentMapView::setDriverProbabilityError(bool error)
294 {
295 if(error)
296 ui->DriverProbabilityError->setText("probability sum invalid!");
297 else
298 ui->DriverProbabilityError->setText("");
299
300 }
301
302 void AgentMapView::setVehicleProbabilityError(bool error)
303 {
304 if(error)
305 ui->VehicleProbabilityError->setText("probability sum invalid!");
306 else
307 ui->VehicleProbabilityError->setText("");
308 }
AgentMapView
This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu ...
Definition: AgentMapView.h:56
AgentMapView::on_Type_activated
void on_Type_activated(const QString &type)
Slot which emits the typeChanged signal after changing the current selection of the type selection bo...
Definition: AgentMapView.cpp:198
AgentMapView::setSystemSelectionItems
void setSystemSelectionItems(const QStringList &systemItems)
Method which the sets the systems&#39; selection list (drop down menu) to the one passed as an argument...
Definition: AgentMapView.cpp:229
AgentMapView::clear
void clear()
Method which clears the current selection elements for static agent profiles and sets the type and mo...
Definition: AgentMapView.cpp:142
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
AgentMapView::setCurrentModel
void setCurrentModel(const QString &model)
Method which the sets the vehicle model currently displayed by the vehicle models&#39; drop down menu to ...
Definition: AgentMapView.cpp:258
AgentMapView.h
This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu ...
AgentMapView::on_AgentProfileSelection_activated
void on_AgentProfileSelection_activated(const QString &name)
Slot which emits the selectionChanged signal after changing the current selection of the agent profil...
Definition: AgentMapView.cpp:137
AgentMapView::on_system_activated
void on_system_activated(const QString &system)
Slot which emits the selectedSystem signal after the current entry of the system selection box is cha...
Definition: AgentMapView.cpp:203
AgentMapView::enableModelView
void enableModelView(bool enable)
Method which enables or disables the drop down menu for vehicle models (for static agent profiles)...
Definition: AgentMapView.cpp:41
AgentMapView::setCurrentModelCatalogue
void setCurrentModelCatalogue(const QString &modelCatalogue)
Method which the currently displayed vehicle model catalogue to the one passed as an argument...
Definition: AgentMapView.cpp:253
AgentMapView::on_removeVehicle_clicked
void on_removeVehicle_clicked()
Slot which emits the removeVehicleProfile signal after the remove-button for vehicle profiles has bee...
Definition: AgentMapView.cpp:159
AgentMapView::setModelSelectionItems
void setModelSelectionItems(const QStringList &modelItems)
Method which the sets the vehicle models&#39; selection list (drop down menu) to the one passed as an arg...
Definition: AgentMapView.cpp:264
AgentMapView::on_add_clicked
void on_add_clicked()
Slot which emits the add signal after the add-button for agent profiles has been added.
Definition: AgentMapView.cpp:74
AgentMapView::removeAgent
void removeAgent(QString const &name)
Method which removes the given agent profile name from the agent selection list (drop down menu for a...
Definition: AgentMapView.cpp:130
AgentMapView::setCurrentSystem
void setCurrentSystem(const QString &system)
Method which the sets the system currently displayed by the systems&#39; drop down menu to the one passed...
Definition: AgentMapView.cpp:223
AgentMapView::enableConfiguration
void enableConfiguration(bool enable)
Method which enables or disables the GUI elements of this view, apart from the add-button for adding ...
Definition: AgentMapView.cpp:51
AgentMapView::setCurrentAgent
void setCurrentAgent(QString const &name)
Method which sets the agent profile name to be currently shown in the drop down menu for agent profil...
Definition: AgentMapView.cpp:113
AgentMapView::getVehicleProfilesView
QTableView * getVehicleProfilesView() const
Method which provides access to the table view for vehicle profiles.
Definition: AgentMapView.cpp:174
AgentMapView::addAgent
void addAgent(QString const &name)
Method which adds the given agent profile name to the agent selection list (drop down menu for agent ...
Definition: AgentMapView.cpp:119
AgentMapView::setVehicleProbabilityError
void setVehicleProbabilityError(bool error)
Method puts a probability error message above the vehicle profiles&#39; table if given error flag is "tru...
Definition: AgentMapView.cpp:302
AgentMapView::on_addDriver_clicked
void on_addDriver_clicked()
Slot which emits the addDriverProfile signal after the add-button for driver profiles has been clicke...
Definition: AgentMapView.cpp:164
AgentMapView::setAgentSelectionItems
void setAgentSelectionItems(QStringList const &names)
Method which clears the selection list for agent profiles (drop down menu) and inserts the given list...
Definition: AgentMapView.cpp:124
AgentMapView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter for catching the resize-events of the driver and vehicle profile...
Definition: AgentMapView.cpp:270
AgentMapView::on_systemConfigBrowse_clicked
void on_systemConfigBrowse_clicked()
Slot which emits the setSystemConfig signal after the browse-button for the system config file has be...
Definition: AgentMapView.cpp:208
AgentMapView::getDriverProfilesView
QTableView * getDriverProfilesView() const
Method which provides access to the table view for driver profiles.
Definition: AgentMapView.cpp:179
AgentMapView::enableSystemView
void enableSystemView(bool enable)
Method which enables or disables the drop down menu for systems (for static agent profiles)...
Definition: AgentMapView.cpp:46
AgentMapView::setCurrentSystemConfig
void setCurrentSystemConfig(const QString &systemConfig)
Method which the currently displayed system config file to the one passed as an argument.
Definition: AgentMapView.cpp:218
AgentMapView::on_edit_clicked
void on_edit_clicked()
Slot which is triggered after the rename-button for the agent profile has been clicked. Opens a Dialog box asking the user to enter a new name for the currently selected agent profile.
Definition: AgentMapView.cpp:102
AgentMapView::on_remove_clicked
void on_remove_clicked()
Slot which emits the remove signal after the remove-button for agent profiles has been added...
Definition: AgentMapView.cpp:88
AgentMapView::on_ModelCatalogueBrowse_clicked
void on_ModelCatalogueBrowse_clicked()
Slot which emits the setModelCatalogue signal after the browse-button for the vehicle model catalogue...
Definition: AgentMapView.cpp:238
AgentMapView::on_removeDriver_clicked
void on_removeDriver_clicked()
Slot which emits the removeDriverProfile signal after the remove-button for driver profiles has been ...
Definition: AgentMapView.cpp:169
AgentMapView::setModelCatalogueError
void setModelCatalogueError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for editing the veh...
Definition: AgentMapView.cpp:288
AgentMapView::on_systemConfigRefresh_clicked
void on_systemConfigRefresh_clicked()
Slot which is triggered when the refresh-button for a system config file is clicked. Emits the refreshSystemConfig signal.
Definition: AgentMapView.cpp:213
AgentMapView::on_ModelCatalogueRefresh_clicked
void on_ModelCatalogueRefresh_clicked()
Slot which is triggered when the refresh-button for a vehicle model catalogue is clicked. Emits the refreshModelCatalogue signal.
Definition: AgentMapView.cpp:243
AgentMapView::on_Model_activated
void on_Model_activated(const QString &model)
Slot which emits the setModel signal after the current entry of the vehicle model selection box is ch...
Definition: AgentMapView.cpp:248
AgentMapView::setDriverProbabilityError
void setDriverProbabilityError(bool error)
Method puts a probability error message above the driver profiles&#39; table if given error flag is "true...
Definition: AgentMapView.cpp:293
AgentMapView::on_addVehicle_clicked
void on_addVehicle_clicked()
Slot which emits the addVehicleProfile signal after the add-button for vehicle profiles has been clic...
Definition: AgentMapView.cpp:154
AgentMapView::setCurrentType
void setCurrentType(QString const &type)
Method which sets the agent profile type (dynamic or static) shown in the corresponding drop down men...
Definition: AgentMapView.cpp:184
AgentMapView::setSystemConfigError
void setSystemConfigError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for the system conf...
Definition: AgentMapView.cpp:283
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DelegateComboBoxView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
DelegateComboBoxView.cpp
1 #include "DelegateComboBoxView.h"
2
3 #include <QLineEdit>
4
5 DelegateComboBoxView::DelegateComboBoxView(QList<QString> * const selectionList, QObject *parent)
6 : QStyledItemDelegate(parent)
7 , selectionList(selectionList)
8 {
9 }
10
11 QWidget * DelegateComboBoxView::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
12 {
13 Q_UNUSED(option);
14 Q_UNUSED(index);
15
16 QComboBox * combobox = new QComboBox(parent);
17 combobox->setEditable(true);
18 combobox->lineEdit()->setReadOnly(true);
19 combobox->lineEdit()->setAlignment(Qt::AlignCenter);
20
21 return combobox;
22 }
23
24
25 void DelegateComboBoxView::setEditorData(QWidget *editor, const QModelIndex &index) const
26 {
27 QComboBox *combobox = static_cast<QComboBox *>(editor);
28
29 if(combobox)
30 {
31
32 combobox->addItems(*selectionList);
33 QString currentText = index.data(Qt::EditRole).toString();
34 int currentIndex = combobox->findText(currentText);
35
36 if(currentIndex>=0)
37 combobox->setCurrentIndex(currentIndex);
38 }
39 else
40 QStyledItemDelegate::setEditorData(editor, index);
41 }
42
43 void DelegateComboBoxView::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
44 {
45 QComboBox *combobox = static_cast<QComboBox *>(editor);
46
47 if(combobox)
48 {
49 model->setData( index, combobox->currentText(), Qt::EditRole);
50 }
51 else
52 QStyledItemDelegate::setModelData(editor,model,index);
53 }
54
55
56 void DelegateComboBoxView::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
57 {
58 Q_UNUSED(index);
59
60 editor->setGeometry(option.rect);
61 }
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DelegateComboBoxView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
DelegateComboBoxView.h
1 #ifndef DELEGATECOMBOBOXVIEW_H
2 #define DELEGATECOMBOBOXVIEW_H
3
4 #include <QStyledItemDelegate>
5 #include <QComboBox>
6
7
8 class DelegateComboBoxView : public QStyledItemDelegate
9 {
10 Q_OBJECT
11
12 public:
13 DelegateComboBoxView(QList<QString> * const selectionList,
14 QObject *parent = nullptr);
15 ~DelegateComboBoxView() = default;
16
17 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
27 QWidget *createEditor(QWidget *parent,
28 QStyleOptionViewItem const &option,
29 QModelIndex const &index) const override;
30
31 //-----------------------------------------------------------------------------
39 //-----------------------------------------------------------------------------
40 void setEditorData(QWidget *editor,
41 QModelIndex const &index) const override;
42
43 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
52 void setModelData(QWidget *editor,
53 QAbstractItemModel *model,
54 QModelIndex const &index) const override;
55
56 //-----------------------------------------------------------------------------
64 //-----------------------------------------------------------------------------
65 void updateEditorGeometry(QWidget *editor,
66 QStyleOptionViewItem const &option,
67 QModelIndex const &index) const override;
68
69
70 private:
71 QList<QString> * const selectionList;
72
73 };
74
75 #endif // DELEGATECOMBOBOXVIEW_H
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DelegateDoubleView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
DelegateDoubleView.cpp
1 #include "DelegateDoubleView.h"
2
3 #include <QDoubleSpinBox>
4
5 DelegateDoubleView::DelegateDoubleView(double min, double max, double increment, int decimals, QObject *parent)
6 : QStyledItemDelegate(parent)
7 , min(min)
8 , max(max)
9 , increment(increment)
10 , decimals(decimals)
11 {
12
13 }
14
15 QWidget * DelegateDoubleView::createEditor(QWidget *parent, const QStyleOptionViewItem &/*option*/, const QModelIndex &/*index*/) const
16 {
17 QDoubleSpinBox * editor = new QDoubleSpinBox(parent);
18 editor->setMinimum(min);
19 editor->setMaximum(max);
20 editor->setDecimals(decimals);
21 editor->setSingleStep(increment);
22 editor->setFrame(false);
23 editor->setAlignment(Qt::AlignCenter);
24
25 editor->setKeyboardTracking(true);
26
27 return editor;
28 }
29
30 void DelegateDoubleView::setEditorData(QWidget *editor, const QModelIndex &index) const
31 {
32 double value = index.model()->data(index, Qt::DisplayRole).toDouble();
33 QDoubleSpinBox *doubleSpinBox = static_cast<QDoubleSpinBox*>(editor);
34 doubleSpinBox->setValue(value);
35 }
36
37 void DelegateDoubleView::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
38 {
39 QDoubleSpinBox *doubleSpinBox = static_cast<QDoubleSpinBox*>(editor);
40 model->setData(index, QString::number(doubleSpinBox->value(),'f',decimals), Qt::EditRole);
41 }
42
43 void DelegateDoubleView::updateEditorGeometry(QWidget *editor,
44 const QStyleOptionViewItem &option,
45 const QModelIndex &/* index */) const
46 {
47 editor->setGeometry(option.rect);
48 }
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DelegateDoubleView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
DelegateDoubleView.h
1 #ifndef DELEGATEDOUBLEVIEW_H
2 #define DELEGATEDOUBLEVIEW_H
3
4 #include <QStyledItemDelegate>
5
6 class DelegateDoubleView : public QStyledItemDelegate
7 {
8 Q_OBJECT
9
10 public:
11 explicit DelegateDoubleView(double min, double max, double increment, int decimals, QObject *parent =0);
12 virtual ~DelegateDoubleView()=default;
13
14 public:
15 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
26 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &) const override;
27
28 public:
29 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
37 void setEditorData(QWidget *editor, const QModelIndex &index) const override;
38
39 //-----------------------------------------------------------------------------
47 //-----------------------------------------------------------------------------
48 void setModelData(QWidget *editor, QAbstractItemModel *model,
49 const QModelIndex &index) const override;
50
51 public:
52 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 void updateEditorGeometry(QWidget *editor,
62 const QStyleOptionViewItem &option,
63 const QModelIndex &index) const override;
64
65 private:
66 double const min;
67 double const max;
68 double const increment;
69 int const decimals;
70 };
71
72 #endif // DELEGATEDOUBLEVIEW_H
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DelegateFileBrowseView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
DelegateFileBrowseView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "DelegateFileBrowseView.h"
12
13
14 DelegateFileBrowseView::DelegateFileBrowseView(const ProjectInterface * const project, const QString &variableName, QUndoStack * const undoStack, QObject *parent) :
15 QStyledItemDelegate (parent)
16 , project(project)
17 , variableName(variableName)
18 , undoStack(undoStack)
19 {
20 }
21
22
23 QWidget * DelegateFileBrowseView::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
24 {
25 Q_UNUSED(option);
26 Q_UNUSED(index);
27
28 FileBrowseView * filebrowse = new FileBrowseView(project, parent);
29 connect(filebrowse, &FileBrowseView::editingFinished, this, &DelegateFileBrowseView::editData);
30 return filebrowse;
31 }
32
33 void DelegateFileBrowseView::setEditorData(QWidget *editor, const QModelIndex &index) const
34 {
35 QString const filename = index.model()->data(index, Qt::DisplayRole).toString();
36 qobject_cast<FileBrowseView*>(editor)->setFile(filename);
37 }
38
39
40 void DelegateFileBrowseView::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
41 {
42 FileBrowseView * filebrowse = qobject_cast<FileBrowseView*>(editor);
43 undoStack->push(new EditData(model, index, filebrowse->getFile(), variableName));
44 }
45
46
47 void DelegateFileBrowseView::updateEditorGeometry(QWidget *editor,
48 const QStyleOptionViewItem &option,
49 const QModelIndex &/* index */) const
50 {
51 editor->setGeometry(option.rect);
52 }
53
54 void DelegateFileBrowseView::editData(QWidget *editor)
55 {
56 Q_EMIT commitData(editor);
57 Q_EMIT closeEditor(editor, QAbstractItemDelegate::EndEditHint::NoHint);
58 }
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DelegateFileBrowseView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
DelegateFileBrowseView.h
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #ifndef DELEGATEFILEBROWSEVIEW_H
12 #define DELEGATEFILEBROWSEVIEW_H
13
14
15 #include "openPASS-Project/ProjectInterface.h"
16 #include "FileBrowseView.h"
17
18 #include "EditDataCommand.h"
19
20 #include <QStyledItemDelegate>
21
22
23 class DelegateFileBrowseView : public QStyledItemDelegate
24 {
25 Q_OBJECT
26
27 public:
28 explicit DelegateFileBrowseView(ProjectInterface const * const project, QString const &variableName, QUndoStack * const undoStack, QObject *parent = nullptr);
29 virtual ~DelegateFileBrowseView() override = default;
30
31 public:
32 //-----------------------------------------------------------------------------
43 //-----------------------------------------------------------------------------
44 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &) const override;
45
46 public:
47 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 void setEditorData(QWidget *editor, const QModelIndex &index) const override;
56
57 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
66 void setModelData(QWidget *editor, QAbstractItemModel *model,
67 const QModelIndex &index) const override;
68
69 public:
70 //-----------------------------------------------------------------------------
78 //-----------------------------------------------------------------------------
79 void updateEditorGeometry(QWidget *editor,
80 const QStyleOptionViewItem &option,
81 const QModelIndex &index) const override;
82 private Q_SLOT:
83 void editData(QWidget *editor);
84
85 private:
86 ProjectInterface const * const project;
87 QString const variableName;
88 QUndoStack * const undoStack;
89 };
90
91 #endif // DELEGATEFILEBROWSEVIEW_H
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DoubleSpinBoxView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
DoubleSpinBoxView.cpp
1 #include "Views/DoubleSpinBoxView.h"
2
3 #include <QWheelEvent>
4
5 DoubleSpinBoxView::DoubleSpinBoxView(QWidget * const parent)
6 : QDoubleSpinBox(parent)
7 {
8 setFocusPolicy(Qt::StrongFocus);
9 }
10
11 void DoubleSpinBoxView::wheelEvent(QWheelEvent * event)
12 {
13 if (!hasFocus())
14 {
15 event->ignore();
16 }
17 else
18 {
19 QDoubleSpinBox::wheelEvent(event);
20 }
21 }
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DoubleSpinBoxView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
DoubleSpinBoxView.h
1 #ifndef DOUBLESPINBOXVIEW_H
2 #define DOUBLESPINBOXVIEW_H
3
4 #include <QDoubleSpinBox>
5
6 class DoubleSpinBoxView : public QDoubleSpinBox
7 {
8 Q_OBJECT
9
10 public:
11 explicit DoubleSpinBoxView(QWidget * const parent = nullptr);
12 virtual ~DoubleSpinBoxView() = default;
13
14 protected:
15 virtual void wheelEvent(QWheelEvent * event) override;
16 };
17
18 #endif // DOUBLESPINBOXVIEW_H
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileItemModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
DriverProfileItemModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "DriverProfileItemModel.h"
12 #include "ParameterMapModel.h"
13
14 #include "openPASS-AgentConfiguration/DriverProfileMapInterface.h"
15
16 DriverProfileItemModel::DriverProfileItemModel(QObject *parent)
17 : DriverProfileItemInterface(parent)
18 , parameters(new ParameterMapModel(this))
19 , driverConfig("")
20 {
21
22 }
23
24 DriverProfileItemModel::DriverProfileItemModel(DriverProfileItemInterface const * const driverProfile, QObject *parent)
25 : DriverProfileItemInterface (parent)
26 , parameters(new ParameterMapModel(this))
27 , driverConfig(driverProfile->getConfig())
28 {
29 for(auto parameter : driverProfile->getParameters()->values())
30 {
31 ParameterMapInterface::ID const Id = parameter->getID();
32 parameters->add(Id);
33 ParameterItemInterface * const newParameter = parameters->getItem(Id);
34
35 newParameter->setKey(parameter->getKey());
36 newParameter->setType(parameter->getType());
37 newParameter->setUnit(parameter->getUnit());
38 newParameter->setValue(parameter->getValue());
39 }
40 }
41
42 DriverProfileItemInterface::Name DriverProfileItemModel::getName() const
43 {
44 DriverProfileMapInterface const * const map = qobject_cast<DriverProfileMapInterface const * const > ( parent() );
45
46 return ( (map) ? map->getName( const_cast<DriverProfileItemModel *> (this) ) : DriverProfileItemInterface::Name() );
47 }
48
49 DriverProfileItemInterface::Parameters *DriverProfileItemModel::getParameters() const
50 {
51 return parameters;
52 }
53
54
55 DriverProfileItemInterface::DriverConfig DriverProfileItemModel::getConfig() const
56 {
57 return driverConfig;
58 }
59
60 void DriverProfileItemModel::setConfig(DriverConfig const &_driverConfig)
61 {
62 driverConfig = _driverConfig;
63 }
DriverProfileItemInterface
This class defines objects containing all relevant information on driver profiles.
Definition: DriverProfileItemInterface.h:43
ParameterMapModel.h
This class implements the functionality of ParameterMapInterface.
DriverProfileItemInterface::Name
QString Name
typedef for the driver profile&#39;s name
Definition: DriverProfileItemInterface.h:48
ParameterItemInterface::setUnit
virtual void setUnit(Value const &unit)=0
Method which sets the unit of this parameter to the given one.
DriverProfileMapInterface.h
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
ParameterItemInterface::setValue
virtual void setValue(Value const &value)=0
Method which sets the value of this parameter to the given one.
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
DriverProfileItemModel.h
This class implements the functionality of DriverProfileItemInterface.
DriverProfileItemInterface::DriverConfig
QString DriverConfig
typedef for the driver config file
Definition: DriverProfileItemInterface.h:49
DriverProfileMapInterface::getName
virtual DriverProfileMapInterface::Name getName(DriverProfileMapInterface::Item *const item) const =0
Method wich returns the name of the given driver profile.
DriverProfileItemModel::setConfig
virtual void setConfig(const DriverConfig &_driverConfig) override
Method which sets the driver configuration file containing XML metadata to the one passed as an argum...
Definition: DriverProfileItemModel.cpp:60
DriverProfileItemModel::parameters
Parameters *const parameters
instance of ParameterMapInterface for storing parameters
Definition: DriverProfileItemModel.h:46
ParameterItemInterface::setType
virtual void setType(Type const &type)=0
Method which sets the datatype of this parameter to the given type.
DriverProfileItemModel::driverConfig
DriverConfig driverConfig
string object for storing the driver configuration file (so far, not used!)
Definition: DriverProfileItemModel.h:47
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
DriverProfileItemModel::getParameters
virtual Parameters * getParameters() const override
Method which returns the parameter map (ParameterMapInterface) of this driver profile.
Definition: DriverProfileItemModel.cpp:49
ParameterMapModel
This class implements the functionality of ParameterMapInterface.
Definition: ParameterMapModel.h:25
ParameterMapInterface::values
virtual QList< Item * > values() const =0
Method which returns the list of all parameters registered in this map.
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
DriverProfileItemModel::getConfig
virtual DriverConfig getConfig() const override
Method which returns the driver configuration file containing XML metadata.
Definition: DriverProfileItemModel.cpp:55
DriverProfileItemInterface::getParameters
virtual Parameters * getParameters() const =0
Method which returns the parameter map (ParameterMapInterface) of this driver profile.
ParameterMapInterface::ID
ParameterItemInterface::ID ID
typedef for the id of a parameter
Definition: ParameterMapInterface.h:42
DriverProfileItemModel::getName
virtual Name getName() const override
Method which returns the name of this driver profile. In fact, this is the key identifier under which...
Definition: DriverProfileItemModel.cpp:42
ParameterItemInterface::setKey
virtual void setKey(Key const &key)=0
Method which sets the key description of this parameter to the given one.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileMapModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
DriverProfileMapModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "DriverProfileMapModel.h"
12 #include "DriverProfileItemModel.h"
13
14
15 DriverProfileMapModel::DriverProfileMapModel(QObject *parent)
16 : DriverProfileMapInterface(parent)
17 {
18
19 }
20
21 DriverProfileMapInterface::Iterator DriverProfileMapModel::begin()
22 {
23 return driverProfiles.begin();
24 }
25
26 DriverProfileMapInterface::ConstIterator DriverProfileMapModel::constBegin() const
27 {
28 return driverProfiles.constBegin();
29 }
30
31 DriverProfileMapInterface::Iterator DriverProfileMapModel::end()
32 {
33 return driverProfiles.end();
34 }
35
36 DriverProfileMapInterface::ConstIterator DriverProfileMapModel::constEnd() const
37 {
38 return driverProfiles.constEnd();
39 }
40
41
42 bool DriverProfileMapModel::add(const DriverProfileMapInterface::Name &name)
43 {
44 if(!contains(name))
45 {
46 driverProfiles.insert(name, new DriverProfileItemModel(this));
47 Q_EMIT added(name);
48
49 return true;
50 }
51
52 return false;
53 }
54
55 bool DriverProfileMapModel::add(const DriverProfileMapInterface::Name &name, const DriverProfileMapInterface::Item * const driver)
56 {
57 if(!contains(name))
58 {
59 driverProfiles.insert(name, new DriverProfileItemModel(driver, this));
60 Q_EMIT added(name);
61 return true;
62 }
63
64 return false;
65 }
66
67
68
69 bool DriverProfileMapModel::remove(const DriverProfileMapInterface::Name &name)
70 {
71 if(contains(name))
72 {
73 delete driverProfiles.take(name);
74 Q_EMIT removed(name);
75 return true;
76 }
77
78 return false;
79 }
80
81 DriverProfileMapInterface::Item * DriverProfileMapModel::getItem(DriverProfileMapInterface::Name const & name) const
82 {
83 if(contains(name))
84 return driverProfiles.value(name);
85
86 return nullptr;
87 }
88
89
90 DriverProfileMapInterface::Name DriverProfileMapModel::getName(Item * const item) const
91 {
92 return driverProfiles.key(item);
93 }
94
95 void DriverProfileMapModel::setName(Item * const item,
96 DriverProfileMapInterface::Name const &name)
97 {
98
99 Name oldName = getName(item);
100
101 driverProfiles.take(oldName);
102 driverProfiles.insert(name, item);
103
104 Q_EMIT modifiedName(oldName, name);
105 }
106
107
108 bool DriverProfileMapModel::contains(const DriverProfileMapInterface::Name &name) const
109 {
110 return driverProfiles.contains(name);
111 }
112
113 QStringList DriverProfileMapModel::keys() const
114 {
115 return QStringList(driverProfiles.keys());
116 }
117
118 QList <DriverProfileItemInterface*> DriverProfileMapModel::values() const
119 {
120 return driverProfiles.values();
121 }
122
123 int DriverProfileMapModel::count() const
124 {
125 return driverProfiles.count();
126 }
DriverProfileMapInterface::modifiedName
void modifiedName(Name const &oldName, Name const &newName)
Signal emitted when the name of the driver profile has been changed. Transmits both, the new and old names of the profile.
DriverProfileItemInterface
This class defines objects containing all relevant information on driver profiles.
Definition: DriverProfileItemInterface.h:43
DriverProfileMapModel.h
This class implements the functionality of DriverProfileMapInterface.
DriverProfileMapModel::getItem
virtual DriverProfileMapInterface::Item * getItem(DriverProfileMapInterface::Name const &name) const override
Method which returns a pointer to the driver profile with the given name. If the map does not contain...
Definition: DriverProfileMapModel.cpp:81
DriverProfileMapModel::constEnd
virtual DriverProfileMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last driver profile (use for read-only)...
Definition: DriverProfileMapModel.cpp:36
DriverProfileMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: DriverProfileMapInterface.h:47
DriverProfileMapModel::setName
virtual void setName(DriverProfileMapInterface::Item *const item, DriverProfileMapInterface::Name const &name) override
Method wich changes the name of the given driver profile to the one passed as second argument...
Definition: DriverProfileMapModel.cpp:95
DriverProfileMapModel::add
virtual bool add(DriverProfileMapInterface::Name const &name) override
Method which creates a new driver profile (instance of DriverProfileItemInterface) and adds it to the...
Definition: DriverProfileMapModel.cpp:42
DriverProfileMapInterface::removed
void removed(Name const &name)
Signal emitted when a driver profile has been removed from the map. Transmits the name of the correpo...
DriverProfileMapModel::count
virtual int count() const override
Method which returns the number of driver profiles in the map.
Definition: DriverProfileMapModel.cpp:123
DriverProfileMapModel::remove
virtual bool remove(DriverProfileMapInterface::Name const &name) override
Method which removes the driver profile with the given name from the map. The profile is deleted afte...
Definition: DriverProfileMapModel.cpp:69
DriverProfileItemModel.h
This class implements the functionality of DriverProfileItemInterface.
DriverProfileMapInterface::added
void added(Name const &name)
Signal emitted when a driver profile has been added to the map. Transmits the name of the correpondin...
DriverProfileMapModel::contains
virtual bool contains(DriverProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a driver profile with the given name. ...
Definition: DriverProfileMapModel.cpp:108
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
DriverProfileMapInterface::Name
DriverProfileItemInterface::Name Name
typedef for driver profile names (= key identifiers of the map)
Definition: DriverProfileMapInterface.h:42
DriverProfileMapModel::begin
virtual DriverProfileMapInterface::Iterator begin() override
Gets an iterator pointing to the first driver profile in the map.
Definition: DriverProfileMapModel.cpp:21
DriverProfileMapModel::end
virtual DriverProfileMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last driver profile.
Definition: DriverProfileMapModel.cpp:31
DriverProfileMapModel::constBegin
virtual DriverProfileMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first driver profile in the map (use for read-only since pointing at...
Definition: DriverProfileMapModel.cpp:26
DriverProfileMapModel::values
virtual QList< Item * > values() const override
Method which returns a list of pointers to all driver profiles in the map.
Definition: DriverProfileMapModel.cpp:118
DriverProfileMapModel::getName
virtual DriverProfileMapInterface::Name getName(DriverProfileMapInterface::Item *const item) const override
Method wich returns the name of the given driver profile.
Definition: DriverProfileMapModel.cpp:90
DriverProfileItemModel
This class implements the functionality of DriverProfileItemInterface.
Definition: DriverProfileItemModel.h:25
DriverProfileMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: DriverProfileMapInterface.h:48
DriverProfileMapModel::keys
virtual QStringList keys() const override
Method which returns the (string) list of all driver profile names in the map.
Definition: DriverProfileMapModel.cpp:113
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfilesMapPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
DriverProfilesMapPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "DriverProfilesMapPresenter.h"
12
13 DriverProfilesMapPresenter::DriverProfilesMapPresenter(AgentItemInterface::DriverProfiles * driverProfiles,
14 QObject *parent)
15 : QAbstractTableModel(parent)
16 , driverProfiles(driverProfiles)
17 {
18 _columnHeaders << "Driver Profile" << "Probability";
19 }
20
21 QVariant DriverProfilesMapPresenter::headerData(int section, Qt::Orientation orientation, int role) const
22 {
23 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
24 return _columnHeaders.value(section);
25
26 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
27 return section + 1;
28
29 return QVariant();
30 }
31
32 int DriverProfilesMapPresenter::rowCount(const QModelIndex &parent) const
33 {
34 Q_UNUSED(parent)
35
36 if(driverProfiles)
37 return driverProfiles->count();
38 else
39 return 0;
40 }
41
42 int DriverProfilesMapPresenter::columnCount(const QModelIndex &parent) const
43 {
44 Q_UNUSED(parent)
45
46 return _columnHeaders.count();
47 }
48
49 QVariant DriverProfilesMapPresenter::data(const QModelIndex &index, int role) const
50 {
51 int row = index.row();
52 int col = index.column();
53
54 if(!driverProfiles && row >= driverProfiles->count())
55 return QVariant::Invalid;
56
57 if( role == Qt::TextAlignmentRole)
58 return QVariant( Qt::AlignCenter );
59
60 if(role == Qt::DisplayRole || role == Qt::EditRole)
61 {
62 if(col == 0)
63 return QVariant(RowToProfile[row]);
64 else if(col == 1)
65 return QVariant(driverProfiles->value( RowToProfile[row] ));
66 }
67
68 return QVariant();
69 }
70
71 bool DriverProfilesMapPresenter::setData(const QModelIndex &index, const QVariant &value, int role)
72 {
73 int row = index.row();
74 int col = index.column();
75
76 if(driverProfiles && role == Qt::EditRole)
77 {
78 if(col == 0 && !driverProfiles->keys().contains(value.toString()))
79 {
80 driverProfiles->insert( value.toString(), driverProfiles->take(RowToProfile[row]) );
81 RowToProfile.take( row );
82 RowToProfile.insert( row, value.toString() );
83 Q_EMIT dataChanged(index, index);
84 return true;
85 }
86 else if ( col ==1 && driverProfiles->contains(RowToProfile[row]))
87 {
88 (*driverProfiles)[RowToProfile[row]] = value.toDouble();
89 Q_EMIT dataChanged(index, index);
90 Q_EMIT checkProbabilities();
91 return true;
92 }
93 }
94
95 return false;
96 }
97
98 Qt::ItemFlags DriverProfilesMapPresenter::flags(const QModelIndex &index) const
99 {
100
101 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
102 }
103
104 void DriverProfilesMapPresenter::addRow(int const &row,
105 const AgentItemInterface::DriverProfile &profile,
106 const AgentItemInterface::Probability &probability)
107 {
108 // shift all row indices up
109 for(auto _row = RowToProfile.size()-1 ; _row>= row; _row--)
110 RowToProfile.insert(_row + 1, RowToProfile.take(_row));
111
112 RowToProfile.insert( row, profile );
113
114 if(driverProfiles)
115 {
116 beginInsertRows(QModelIndex(), row, row );
117 driverProfiles->insert(profile, probability);
118 endInsertRows();
119 Q_EMIT checkProbabilities();
120 }
121
122 }
123
124 bool DriverProfilesMapPresenter::removeRow(const int &row)
125 {
126 if(driverProfiles && RowToProfile.contains(row) && driverProfiles->contains(RowToProfile[row]))
127 {
128 beginRemoveRows(QModelIndex(), row, row);
129
130 driverProfiles->take( RowToProfile[row] );
131 RowToProfile.take(row);
132
133 for( int i = row + 1; i<=RowToProfile.count() ; i++ )
134 RowToProfile.insert( i-1, RowToProfile.take(i));
135
136 endRemoveRows();
137 Q_EMIT checkProbabilities();
138 return true;
139 }
140 else
141 return false;
142 }
143
144 void DriverProfilesMapPresenter::setDriverProfiles(AgentItemInterface::DriverProfiles * const _driverProfiles)
145 {
146 driverProfiles=_driverProfiles;
147 update();
148 }
149
150
151 void DriverProfilesMapPresenter::update()
152 {
153 int rows = 0;
154 beginResetModel();
155 endResetModel();
156 RowToProfile.clear();
157
158 if(driverProfiles)
159 {
160 for( auto profile : driverProfiles->keys())
161 {
162 RowToProfile.insert(rows, profile);
163 rows++;
164 }
165 }
166 Q_EMIT checkProbabilities();
167 }
168
169
170 void DriverProfilesMapPresenter::editName(const AgentItemInterface::DriverProfile &oldName,
171 const AgentItemInterface::DriverProfile &newName)
172 {
173 if(driverProfiles && driverProfiles->contains(oldName))
174 {
175 driverProfiles->insert( newName, driverProfiles->take(oldName));
176
177 int row = RowToProfile.key(oldName);
178 RowToProfile.insert(row, newName);
179 }
180 }
181
182 void DriverProfilesMapPresenter::remove(const AgentItemInterface::DriverProfile &profile)
183 {
184 removeRow(RowToProfile.key(profile));
185 }
AgentItemInterface::DriverProfile
QString DriverProfile
the nome of a driver profile
Definition: AgentItemInterface.h:60
DriverProfilesMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: DriverProfilesMapPresenter.cpp:32
DriverProfilesMapPresenter::checkProbabilities
void checkProbabilities()
Signal emitted whenever the probability sum of the driver profile table should be checked...
DriverProfilesMapPresenter::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: DriverProfilesMapPresenter.cpp:71
DriverProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::DriverProfile > RowToProfile
a mapping of row indices to profile names
Definition: DriverProfilesMapPresenter.h:180
DriverProfilesMapPresenter::_columnHeaders
QStringList _columnHeaders
the list containing the header data for columns
Definition: DriverProfilesMapPresenter.h:179
DriverProfilesMapPresenter::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! ...
Definition: DriverProfilesMapPresenter.cpp:98
DriverProfilesMapPresenter::setDriverProfiles
void setDriverProfiles(AgentItemInterface::DriverProfiles *const _driverProfiles)
Method which sets the currently processed driver profiles map to the given argument.
Definition: DriverProfilesMapPresenter.cpp:144
DriverProfilesMapPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: DriverProfilesMapPresenter.cpp:42
DriverProfilesMapPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: DriverProfilesMapPresenter.cpp:49
DriverProfilesMapPresenter.h
This class constitutes the re-implementation of QAbstractTableModel for the table view of driver prof...
DriverProfilesMapPresenter::removeRow
virtual bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: DriverProfilesMapPresenter.cpp:124
DriverProfilesMapPresenter::update
void update()
Method which updates the table according to the current entries of driverProfiles.
Definition: DriverProfilesMapPresenter.cpp:151
DriverProfilesMapPresenter::editName
void editName(AgentItemInterface::DriverProfile const &oldName, AgentItemInterface::DriverProfile const &newName)
Slot which changes the name of the driver profile.
Definition: DriverProfilesMapPresenter.cpp:170
AgentItemInterface::DriverProfiles
QMap< DriverProfile, Probability > DriverProfiles
the mapping of a driver profile to the instantiation probability
Definition: AgentItemInterface.h:61
DriverProfilesMapPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: DriverProfilesMapPresenter.cpp:21
DriverProfilesMapPresenter::addRow
virtual void addRow(const int &row, AgentItemInterface::DriverProfile const &profile, AgentItemInterface::Probability const &probability)
Method that adds a new row, i.e. a driver profile with the given probability.
Definition: DriverProfilesMapPresenter.cpp:104
AgentItemInterface::Probability
double Probability
a probability value (e.g. of a driver or a vehicle profile)
Definition: AgentItemInterface.h:45
DriverProfilesMapPresenter::driverProfiles
AgentItemInterface::DriverProfiles * driverProfiles
the pointer to the map of driver profiles assigned to an agent profile
Definition: DriverProfilesMapPresenter.h:176
DriverProfilesMapPresenter::remove
void remove(AgentItemInterface::DriverProfile const &profile)
Slot removes the given driver profile if contained in the table.
Definition: DriverProfilesMapPresenter.cpp:182
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfilesPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
DriverProfilesPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "Presenters/DriverProfilesPresenter.h"
12
13 #include "Models/DriverProfileItemModel.h"
14 #include "Models/ParameterMapModel.h"
15
16 #include "DelegateDoubleView.h"
17 #include "DelegateComboBoxView.h"
18
19 #include <QFile>
20
21
22 DriverProfilesPresenter::DriverProfilesPresenter(DriverProfileMapInterface *drivers,
23 DriverProfilesView *driversView,
24 QUndoStack * const undoStack,
25 QObject *parent)
26 : QObject(parent)
27 , drivers(drivers)
28 , currentDriver(nullptr)
29 , driversView(driversView)
30 , undoStack(undoStack)
31 {
32
33 parameters = new ParameterMapPresenter;
34 driversView->getParameterView()->setModel(parameters);
35
36 connect(driversView, &DriverProfilesView::addDriverProfile, this, &DriverProfilesPresenter::addDriver);
37 connect(driversView, &DriverProfilesView::removeDriverProfile, this, &DriverProfilesPresenter::removeDriver);
38 connect(driversView, &DriverProfilesView::editedName, this, &DriverProfilesPresenter::editDriver);
39
40 connect(driversView, &DriverProfilesView::selectionChanged, this, &DriverProfilesPresenter::setCurrentDriver);
41 connect(driversView, &DriverProfilesView::selectedDriverConfig, this, &DriverProfilesPresenter::setDriverConfig);
42
43 driversView->enableConfiguration(false);
44 }
45
46 void DriverProfilesPresenter::setCurrentDriver(const QString &name)
47 {
48 if(currentDriver && currentDriver->getName() != name)
49 undoStack->push(new DriverProfileCommands::SetCurrentDriver(drivers, &currentDriver, name, parameters, this));
50 }
51
52 void DriverProfilesPresenter::addDriver(const QString &name)
53 {
54
55 undoStack->beginMacro(QString("added driver profile %1").arg(name));
56 undoStack->push(new DriverProfileCommands::AddDriverProfile(drivers, driversView, name));
57 undoStack->push(new DriverProfileCommands::SetCurrentDriver(drivers, &currentDriver, name, parameters, this));
58 undoStack->endMacro();
59 }
60
61 void DriverProfilesPresenter::removeDriver(const QString &name)
62 {
63 if(currentDriver && currentDriver->getName() == name)
64 {
65 QList<DriverProfileItemInterface::Name> driversList = drivers->keys();
66 driversList.removeAll(name);
67 DriverProfileItemInterface::Name driverName = driversList.isEmpty() ? "" : driversList.first();
68
69 undoStack->beginMacro(QString("removed driver profile %1").arg(name));
70 undoStack->push(new DriverProfileCommands::SetCurrentDriver(drivers, &currentDriver, driverName, parameters, this));
71 undoStack->push(new DriverProfileCommands::RemoveDriverProfile(drivers, driversView, name));
72 undoStack->endMacro();
73 }
74 }
75
76 void DriverProfilesPresenter::editDriver(const QString &oldName, const QString &newName)
77 {
78 if(drivers->contains(oldName) && !drivers->contains(newName))
79 {
80 undoStack->push(new DriverProfileCommands::EditDriverProfile(drivers, driversView, newName,oldName));
81 }
82
83 }
84
85 void DriverProfilesPresenter::setDriverConfig(QString const &filepath)
86 {
87 if(currentDriver)
88 {
89 if(filepath != currentDriver->getConfig())
90 {
91 currentDriver->setConfig(filepath);
92 updateView();
93 }
94 }
95 }
96
97 void DriverProfilesPresenter::updateView()
98 {
99
100 // delete parameter views and correponding presenters
101 driversView->setConfigView("");
102
103 if(currentDriver)
104 {
105 // display name
106 driversView->setCurrentDriver(currentDriver->getName());
107
108 // set the config file
109 driversView->setConfigView(currentDriver->getConfig());
110 parameters->setParameters(currentDriver->getParameters());
111 setParameterDelegates();
112 }
113
114 driversView->enableConfiguration(currentDriver != nullptr);
115 }
116
117 void DriverProfilesPresenter::updateDriverSelectionItems()
118 {
119 driversView->setDriverSelectionItems( drivers->keys() );
120 }
121
122 void DriverProfilesPresenter::setParameterDelegates()
123 {
124 int row;
125 int num_rows = parameters->rowCount();
126 QTableView * parametersView = driversView->getParameterView();
127
128 // remove existing delegates
129 qDeleteAll(findChildren<QStyledItemDelegate*>());
130
131 for( row=0 ; row< num_rows; row++)
132 {
133 QModelIndex index = parameters->index(row, 0);
134
135 QVariant type = parameters->data(index, Qt::DisplayRole);
136
137 if( type.toString() == "Double" )
138 parametersView->setItemDelegateForRow(row, new DelegateDoubleView(std::numeric_limits<double>::lowest(),
139 std::numeric_limits<double>::max(),
140 0.1,1, "driver model parameter's", undoStack, this));
141 else if (type.toString() == "Int")
142 parametersView->setItemDelegateForRow(row, new DelegateDoubleView(-255,255,1,0,"driver model parameter's", undoStack,this));
143
144 else if (type.toString() == "Bool")
145 parametersView->setItemDelegateForRow(row, new DelegateComboBoxView(&bool_list,"driver model parameter's", undoStack, this));
146
147 }
148 }
149
150 using namespace DriverProfileCommands;
151
152 SetCurrentDriver::SetCurrentDriver(DriverProfileMapInterface const * const drivers,
153 DriverProfileItemInterface ** const currentDriver,
154 DriverProfileItemInterface::Name const newDriver,
155 ParameterMapPresenter * const parameters,
156 DriverProfilesPresenter * const driversPresenter,
157 QUndoCommand *parent)
158 : QUndoCommand (parent)
159 , drivers(drivers)
160 , currentDriver(currentDriver)
161 , newDriver(newDriver)
162 , oldDriver(*currentDriver ? (*currentDriver)->getName() : "")
163 , parameters(parameters)
164 , driversPresenter(driversPresenter)
165 {
166 setText(QString("changed driver profile: %1 -> %2").arg(oldDriver).arg(newDriver));
167 }
168
169 void SetCurrentDriver::redo()
170 {
171 *currentDriver = drivers->getItem(newDriver);
172
173 if(*currentDriver)
174 parameters->setParameters((*currentDriver)->getParameters());
175 else
176 parameters->setParameters(nullptr);
177
178 driversPresenter->updateView();
179 }
180
181 void SetCurrentDriver::undo()
182 {
183 *currentDriver = drivers->getItem(oldDriver);
184
185 if(*currentDriver)
186 parameters->setParameters((*currentDriver)->getParameters());
187 else
188 parameters->setParameters(nullptr);
189
190 driversPresenter->updateView();
191 }
192
193 EditDriverProfile::EditDriverProfile(DriverProfileMapInterface * const drivers,
194 DriverProfilesView * const driversView,
195 DriverProfileMapInterface::Name const &newName,
196 DriverProfileMapInterface::Name const &oldName,
197 QUndoCommand *parent)
198 : QUndoCommand (parent)
199 , drivers(drivers)
200 , driversView(driversView)
201 , newName(newName)
202 , oldName(oldName)
203 {
204 setText(QString("edited driver profile's name %1 -> %2").arg(oldName).arg(newName));
205 }
206
207 void EditDriverProfile::redo()
208 {
209 drivers->setName(drivers->getItem(oldName), newName);
210 driversView->removeDriverView(oldName);
211 driversView->addDriverView(newName);
212 }
213
214 void EditDriverProfile::undo()
215 {
216 drivers->setName(drivers->getItem(newName), oldName);
217 driversView->removeDriverView(newName);
218 driversView->addDriverView(oldName);
219 }
220
221 AddDriverProfile::AddDriverProfile(DriverProfileMapInterface * const drivers,
222 DriverProfilesView * const driversView,
223 DriverProfileMapInterface::Name const &name,
224 QUndoCommand *parent)
225 : QUndoCommand(parent)
226 , drivers(drivers)
227 , driversView(driversView)
228 , name(name)
229 , parameters(new ParameterMapModel)
230 {
231 setText(QString("added driver profile %1").arg(name));
232 setParameters();
233 }
234
235 AddDriverProfile::AddDriverProfile(DriverProfileMapInterface * const drivers,
236 DriverProfilesView * const driversView,
237 DriverProfileMapInterface::Name const &name,
238 DriverProfileItemInterface::Parameters const * const parameterMap,
239 QUndoCommand *parent)
240 : QUndoCommand(parent)
241 , drivers(drivers)
242 , driversView(driversView)
243 , name(name)
244 , parameters(new ParameterMapModel)
245 {
246 setText(QString("added driver profile %1").arg(name));
247
248 for(auto parameter : parameterMap->values())
249 parameters->add(parameter->getID(), parameter);
250 }
251
252 AddDriverProfile::~AddDriverProfile()
253 {
254 delete parameters;
255 }
256
257 void AddDriverProfile::addParameter(DriverProfileItemInterface::Parameters * const parameterMap,
258 ParameterItemInterface::Key const & key,
259 ParameterItemInterface::Type const & type,
260 ParameterItemInterface::Unit const & unit,
261 ParameterItemInterface::Value const & value)
262 {
263 ParameterMapInterface::ID id = parameterMap->generateID();
264 parameterMap->add(id);
265 ParameterItemInterface * param = parameterMap->getItem(id);
266
267 param->setKey(key);
268 param->setType(type);
269 param->setUnit(unit);
270 param->setValue(value);
271 }
272
273 void AddDriverProfile::setParameters()
274 {
275 // NOTE: Momentarily, the one and only driver model is hard-coded
276 addParameter(parameters, "Type", "String", "", "AlgorithmAgentFollowingDriverModel");
277 addParameter(parameters, "AlgorithmLateralModule", "String", "", "Algorithm_LateralAfdm");
278 addParameter(parameters, "AlgorithmLongitudinalModule", "String", "", "Algorithm_LongitudinalAfdm");
279
280 addParameter(parameters, "VelocityWish", "Double", "m/s", "15.0");
281 addParameter(parameters, "Delta", "Double", "m", "4.0");
282 addParameter(parameters, "TGapWish", "Double", "s", "1.5");
283 addParameter(parameters, "MinDistance", "Double", "m", "2.0");
284 addParameter(parameters, "MaxAcceleration", "Double", "m/s^2", "2.0");
285 addParameter(parameters, "MaxDeceleration", "Double", "m/s^2", "2.0");
286 }
287
288 void AddDriverProfile::redo()
289 {
290 drivers->add(name);
291
292 for(auto parameter : parameters->values())
293 drivers->getItem(name)->getParameters()->add(parameter->getID(), parameter);
294
295 driversView->addDriverView(name);
296 }
297
298 void AddDriverProfile::undo()
299 {
300 drivers->remove(name);
301 driversView->removeDriverView(name);
302 }
303
304
305 RemoveDriverProfile::RemoveDriverProfile(DriverProfileMapInterface * const drivers,
306 DriverProfilesView * const driversView,
307 DriverProfileMapInterface::Name const &name,
308 QUndoCommand *parent)
309 : QUndoCommand(parent)
310 , drivers(drivers)
311 , driversView(driversView)
312 , name(name)
313 , driver(new DriverProfileItemModel(drivers->getItem(name)))
314 {
315 setText(QString("removed driver profile %1").arg(name));
316 }
317
318 RemoveDriverProfile::~RemoveDriverProfile()
319 {
320 delete driver;
321 }
322
323 void RemoveDriverProfile::redo()
324 {
325 drivers->remove(name);
326 driversView->removeDriverView(name);
327 }
328
329 void RemoveDriverProfile::undo()
330 {
331 drivers->add(name, driver);
332 driversView->addDriverView(name);
333 }
DriverProfilesPresenter::setCurrentDriver
void setCurrentDriver(const QString &name)
Slot triggered by the DriverProfilesView::selectionChanged signal. Performs an undoable set-operation...
Definition: DriverProfilesPresenter.cpp:46
DriverProfileItemInterface::getConfig
virtual DriverConfig getConfig() const =0
Method which returns the driver configuration file containing XML metadata.
DriverProfileMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all driver profile names in the map.
DriverProfilesPresenter::editDriver
void editDriver(const QString &oldName, const QString &newName)
Slot triggered by the DriverProfilesView::editedName signal. Performs an undoable rename-operation on...
Definition: DriverProfilesPresenter.cpp:76
DriverProfilesPresenter.h
This file contains the class DriverProfilesPresenter defining the presenter object for driver profile...
DriverProfileItemInterface
This class defines objects containing all relevant information on driver profiles.
Definition: DriverProfileItemInterface.h:43
DriverProfileMapInterface::contains
virtual bool contains(DriverProfileMapInterface::Name const &name) const =0
Method wich checks whether the map contains a driver profile with the given name. ...
DriverProfilesView::getParameterView
QTableView * getParameterView() const
Method which provides access to the table view for parameters.
Definition: DriverProfilesView.cpp:36
ParameterItemInterface::Key
QString Key
typedef for the key description
Definition: ParameterItemInterface.h:47
DriverProfilesView::removeDriverView
void removeDriverView(QString const &name)
Method which removes the given driver profile name from the driver selection list (drop down menu for...
Definition: DriverProfilesView.cpp:128
DriverProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this driver profile. In fact, this is the key identifier under which...
DriverProfileMapInterface::getItem
virtual DriverProfileMapInterface::Item * getItem(DriverProfileMapInterface::Name const &name) const =0
Method which returns a pointer to the driver profile with the given name. If the map does not contain...
DriverProfileMapInterface::setName
virtual void setName(DriverProfileMapInterface::Item *const item, DriverProfileMapInterface::Name const &name)=0
Method wich changes the name of the given driver profile to the one passed as second argument...
ParameterMapModel.h
This class implements the functionality of ParameterMapInterface.
ParameterItemInterface::Value
QString Value
typedef for the parameter&#39;s value
Definition: ParameterItemInterface.h:48
DriverProfilesView::setDriverSelectionItems
void setDriverSelectionItems(QStringList const &names)
Method which clears the selection list for driver profiles (drop down menu) and inserts the given lis...
Definition: DriverProfilesView.cpp:112
DriverProfilesPresenter
This class defines the presenter object for driver profiles which handles user events from the view (...
Definition: DriverProfilesPresenter.h:50
DriverProfilesView::removeDriverProfile
void removeDriverProfile(QString const &name)
Signal, emitted after the remove-button for driver profiles has been clicked. Transmits the name of t...
DriverProfileItemInterface::Name
QString Name
typedef for the driver profile&#39;s name
Definition: DriverProfileItemInterface.h:48
DriverProfilesView::editedName
void editedName(QString const &oldName, QString const &newName)
Signal, emitted after the rename-button has been pressed and a new name for the current profile has b...
ParameterItemInterface::setUnit
virtual void setUnit(Value const &unit)=0
Method which sets the unit of this parameter to the given one.
DriverProfilesView::selectedDriverConfig
void selectedDriverConfig(QString const &filepath)
Signal for transmitting the filepath of the driver conifg (so far, not in use).
ParameterItemInterface::Unit
QString Unit
typedef for the parameter&#39;s unit
Definition: ParameterItemInterface.h:49
DriverProfilesView::selectionChanged
void selectionChanged(QString const &name)
Signal, emitted after the current entry of the combo box for available driver profiles has been chang...
DriverProfileCommands
Definition: DriverProfilesPresenter.h:143
DriverProfilesPresenter::removeDriver
void removeDriver(const QString &name)
Slot triggered by the DriverProfilesView::removeDriverProfile signal. Performs an undoable remove-ope...
Definition: DriverProfilesPresenter.cpp:61
DriverProfilesPresenter::bool_list
QList< QString > bool_list
a combo box selection list for a parameter delegate representing a boolian variable ...
Definition: DriverProfilesPresenter.h:136
ParameterMapPresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters...
Definition: ParameterMapPresenter.h:33
DriverProfilesPresenter::currentDriver
DriverProfileItemInterface * currentDriver
a pointer to the currently edited driver profile
Definition: DriverProfilesPresenter.h:132
ParameterItemInterface::setValue
virtual void setValue(Value const &value)=0
Method which sets the value of this parameter to the given one.
DriverProfileItemInterface::setConfig
virtual void setConfig(DriverConfig const &_driverConfig)=0
Method which sets the driver configuration file containing XML metadata to the one passed as an argum...
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
ParameterMapPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: ParameterMapPresenter.cpp:49
DriverProfilesPresenter::setParameterDelegates
void setParameterDelegates()
Method which sets the delegates of the parameter table&#39;s cells according to the current model data...
Definition: DriverProfilesPresenter.cpp:122
DriverProfilesPresenter::addDriver
void addDriver(const QString &name)
Slot triggered by the DriverProfilesView::addDriverProfile signal. Performs an undoable add-operation...
Definition: DriverProfilesPresenter.cpp:52
DriverProfilesPresenter::updateView
void updateView()
Method which updates the complete view (DriverProfilesView) according to the model data of the curren...
Definition: DriverProfilesPresenter.cpp:97
DriverProfilesView::addDriverProfile
void addDriverProfile(QString const &name)
Signal, emitted after the add-button for driver profiles has been clicked and a name for a new profil...
DriverProfileItemModel.h
This class implements the functionality of DriverProfileItemInterface.
ParameterMapPresenter::setParameters
void setParameters(ParameterMapInterface *_parameters)
Method which sets the currently processed parameter map to the given argument.
Definition: ParameterMapPresenter.cpp:150
ParameterMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: ParameterMapPresenter.cpp:32
DriverProfileCommands::EditDriverProfile
This class defines the command for undoable renaming-operations on the map of driver profiles (Driver...
Definition: DriverProfilesPresenter.h:178
DriverProfileCommands::SetCurrentDriver
This class defines the command for undoable set-operations on the currently selected driver profile...
Definition: DriverProfilesPresenter.h:150
ParameterItemInterface::setType
virtual void setType(Type const &type)=0
Method which sets the datatype of this parameter to the given type.
DriverProfilesView::enableConfiguration
void enableConfiguration(bool enable)
Method which enables or disables the GUI elements of this view, apart from the add-button for adding ...
Definition: DriverProfilesView.cpp:135
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37
DriverProfileMapInterface::Name
DriverProfileItemInterface::Name Name
typedef for driver profile names (= key identifiers of the map)
Definition: DriverProfileMapInterface.h:42
ParameterItemInterface::Type
QString Type
typedef for the data type
Definition: ParameterItemInterface.h:46
ParameterMapModel
This class implements the functionality of ParameterMapInterface.
Definition: ParameterMapModel.h:25
DriverProfilesView::setCurrentDriver
void setCurrentDriver(QString const &name)
Method which sets the driver profile name to be currently shown in the drop down menu for driver prof...
Definition: DriverProfilesView.cpp:106
DriverProfilesPresenter::driversView
DriverProfilesView *const driversView
a pointer to the view for driver profiles
Definition: DriverProfilesPresenter.h:133
DriverProfilesPresenter::setDriverConfig
void setDriverConfig(const QString &filepath)
Slot for setting the driver configuration file.
Definition: DriverProfilesPresenter.cpp:85
DriverProfilesView::addDriverView
void addDriverView(QString const &name)
Method which adds the given driver profile name to the driver selection list (drop down menu for driv...
Definition: DriverProfilesView.cpp:123
ParameterMapInterface::values
virtual QList< Item * > values() const =0
Method which returns the list of all parameters registered in this map.
DriverProfileCommands::AddDriverProfile
This class defines the command for undoable add-operations on the map of driver profiles (DriverProfi...
Definition: DriverProfilesPresenter.h:202
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
DriverProfilesPresenter::updateDriverSelectionItems
void updateDriverSelectionItems()
Method which updates the combo box list of available driver profiles to the ones currently defined in...
Definition: DriverProfilesPresenter.cpp:117
DriverProfilesView::setConfigView
void setConfigView(QString const &filepath)
Method which sets the filepath shown displayed in the driver config view to the one passed as an argu...
Definition: DriverProfilesView.cpp:118
DriverProfileItemModel
This class implements the functionality of DriverProfileItemInterface.
Definition: DriverProfileItemModel.h:25
DriverProfileCommands::RemoveDriverProfile
This class defines the command for undoable remove-operations on the map of driver profiles (DriverPr...
Definition: DriverProfilesPresenter.h:241
DriverProfilesPresenter::parameters
ParameterMapPresenter * parameters
a pointer to the presenter object for the parameters of a driver profile
Definition: DriverProfilesPresenter.h:135
ParameterMapInterface::generateID
virtual ParameterMapInterface::ID generateID()=0
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
DriverProfileMapInterface::add
virtual bool add(DriverProfileMapInterface::Name const &name)=0
Method which creates a new driver profile (instance of DriverProfileItemInterface) and adds it to the...
DriverProfileItemInterface::getParameters
virtual Parameters * getParameters() const =0
Method which returns the parameter map (ParameterMapInterface) of this driver profile.
DriverProfilesPresenter::drivers
DriverProfileMapInterface *const drivers
the map of driver profiles
Definition: DriverProfilesPresenter.h:131
ParameterMapInterface::ID
ParameterItemInterface::ID ID
typedef for the id of a parameter
Definition: ParameterMapInterface.h:42
DriverProfilesView
This class defines the view for editing driver profiles. The view constitutes a combo box for switchi...
Definition: DriverProfilesView.h:41
DriverProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: DriverProfilesPresenter.h:134
ParameterItemInterface::setKey
virtual void setKey(Key const &key)=0
Method which sets the key description of this parameter to the given one.
ParameterMapInterface::add
virtual bool add(ParameterMapInterface::ID const &id)=0
Method which creates a parameter (instance of ParameterItemInterface) and adds it to the map under th...
DriverProfileMapInterface::remove
virtual bool remove(DriverProfileMapInterface::Name const &name)=0
Method which removes the driver profile with the given name from the map. The profile is deleted afte...
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfilesView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
DriverProfilesView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "DriverProfilesView.h"
12 #include "ui_DriverProfilesView.h"
13
14 #include <QInputDialog>
15 #include <QFileDialog>
16 #include <QMessageBox>
17
18 DriverProfilesView::DriverProfilesView(QWidget *parent) :
19 WidgetView(parent),
20 ui(new Ui::DriverProfilesView)
21 {
22 ui->setupUi(this);
23
24 QFont headerFont;
25 headerFont.setBold(true);
26
27 ui->ParametersView->installEventFilter(this);
28 ui->ParametersView->horizontalHeader()->setFont(headerFont);
29 }
30
31 DriverProfilesView::~DriverProfilesView()
32 {
33 delete ui;
34 }
35
36 QTableView * DriverProfilesView::getParameterView() const
37 {
38 return ui->ParametersView;
39 }
40
41 void DriverProfilesView::on_Name_activated(const QString &name)
42 {
43 Q_EMIT selectionChanged(name);
44 }
45
46
47 void DriverProfilesView::on_add_clicked()
48 {
49 QString newName = QInputDialog::getText (
50 this, tr ("Add Entry"),
51 tr ("Insert a Name"),
52 QLineEdit::Normal);
53
54 if(!newName.isEmpty())
55 {
56 Q_EMIT addDriverProfile(newName);
57 }
58 }
59
60 void DriverProfilesView::on_remove_clicked()
61 {
62 QMessageBox warning;
63 int ret;
64
65 // spell out a warning that everything will be deleted
66 warning.setText("The whole configuration of the driver profile will be deleted!");
67 warning.setInformativeText("Do you want to continue?");
68 warning.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
69 ret=warning.exec();
70
71 if(ret==QMessageBox::Yes)
72 {
73 Q_EMIT removeDriverProfile(ui->Name->currentText());
74 }
75 }
76
77 void DriverProfilesView::on_edit_clicked()
78 {
79 QString newName = QInputDialog::getText (
80 this, tr ("Edit Entry"),
81 tr ("Insert a new Name"),
82 QLineEdit::Normal);
83
84 if(!newName.isEmpty() )
85 {
86 Q_EMIT editedName(ui->Name->currentText(), newName);
87 ui->Name->setCurrentText(newName);
88 }
89 }
90
91
92 void DriverProfilesView::on_Browse_clicked()
93 {
94 // Prompt file dialog to load setup
95 QString const filepath = QFileDialog::getOpenFileName(
96 this, QObject::tr("openPASS / Choose DriverConfig"),
97 QCoreApplication::applicationDirPath(), QStringLiteral("DriverConfig (*.xml)"));
98
99 if(!filepath.isNull())
100 {
101 ui->driverConfig->setText(filepath);
102 Q_EMIT selectedDriverConfig(filepath);
103 }
104 }
105
106 void DriverProfilesView::setCurrentDriver(const QString &name)
107 {
108 if(ui->Name->findText(name) != -1)
109 ui->Name->setCurrentText(name);
110 }
111
112 void DriverProfilesView::setDriverSelectionItems(const QStringList &names)
113 {
114 ui->Name->clear();
115 ui->Name->addItems(names);
116 }
117
118 void DriverProfilesView::setConfigView(const QString &filepath)
119 {
120 ui->driverConfig->setText(filepath);
121 }
122
123 void DriverProfilesView::addDriverView(const QString &name)
124 {
125 ui->Name->addItem(name);
126 }
127
128 void DriverProfilesView::removeDriverView(const QString &name)
129 {
130 int index = ui->Name->findText(name);
131 ui->Name->removeItem(index);
132 }
133
134
135 void DriverProfilesView::enableConfiguration(bool enable)
136 {
137 ui->remove->setEnabled(enable);
138 ui->edit->setEnabled(enable);
139
140 // currently this is not utilised as there is only one fixed driver model
141 ui->Browse->setEnabled(false);
142 ui->driverConfig->setEnabled(false);
143 }
144
145 bool DriverProfilesView::eventFilter(QObject *watched, QEvent *event)
146 {
147 QTableView* table = qobject_cast<QTableView*> (watched);
148
149 if( table && event->type() == QEvent::Resize )
150 {
151 int cell = (table->width())/12;
152 table->setColumnWidth(0, 2*cell);
153 table->setColumnWidth(1, 4*cell);
154 table->setColumnWidth(2, cell);
155 }
156
157 return false;
158 }
DriverProfilesView::getParameterView
QTableView * getParameterView() const
Method which provides access to the table view for parameters.
Definition: DriverProfilesView.cpp:36
DriverProfilesView::removeDriverView
void removeDriverView(QString const &name)
Method which removes the given driver profile name from the driver selection list (drop down menu for...
Definition: DriverProfilesView.cpp:128
DriverProfilesView::on_Browse_clicked
void on_Browse_clicked()
Slot triggered by clicking the browse-button for the driver configuration file. Opens a file dialog a...
Definition: DriverProfilesView.cpp:92
DriverProfilesView::setDriverSelectionItems
void setDriverSelectionItems(QStringList const &names)
Method which clears the selection list for driver profiles (drop down menu) and inserts the given lis...
Definition: DriverProfilesView.cpp:112
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
DriverProfilesView::on_edit_clicked
void on_edit_clicked()
Slot triggered when the user clicks the rename-button for driver profiles. Opens a dialog asking the ...
Definition: DriverProfilesView.cpp:77
DriverProfilesView::enableConfiguration
void enableConfiguration(bool enable)
Method which enables or disables the GUI elements of this view, apart from the add-button for adding ...
Definition: DriverProfilesView.cpp:135
DriverProfilesView::on_remove_clicked
void on_remove_clicked()
Slot triggered when the user clicks the remove-button for driver profiles. Emits the removeDriverProf...
Definition: DriverProfilesView.cpp:60
DriverProfilesView::on_Name_activated
void on_Name_activated(const QString &name)
Slot which emits the selectionChanged signal after the user has made a selection in the drop down men...
Definition: DriverProfilesView.cpp:41
DriverProfilesView::setCurrentDriver
void setCurrentDriver(QString const &name)
Method which sets the driver profile name to be currently shown in the drop down menu for driver prof...
Definition: DriverProfilesView.cpp:106
DriverProfilesView.h
This class defines the view for editing driver profiles. The view constitutes a combo box for switchi...
DriverProfilesView::addDriverView
void addDriverView(QString const &name)
Method which adds the given driver profile name to the driver selection list (drop down menu for driv...
Definition: DriverProfilesView.cpp:123
DriverProfilesView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter for catching the resize-events of the parameter table&#39;s view...
Definition: DriverProfilesView.cpp:145
DriverProfilesView::setConfigView
void setConfigView(QString const &filepath)
Method which sets the filepath shown displayed in the driver config view to the one passed as an argu...
Definition: DriverProfilesView.cpp:118
DriverProfilesView
This class defines the view for editing driver profiles. The view constitutes a combo box for switchi...
Definition: DriverProfilesView.h:41
DriverProfilesView::on_add_clicked
void on_add_clicked()
Slot triggered when the user clicks the add-button for driver profiles. Opens a dialog asking the use...
Definition: DriverProfilesView.cpp:47
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentBaseView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
EnvironmentBaseView.cpp
1 #include "EnvironmentBaseView.h"
2
3 EnvironmentBaseView::EnvironmentBaseView(QWidget *parent)
4 : WidgetView(parent)
5 {
6
7 environmentView = new EnvironmentView(this);
8
9 connect(environmentView, &EnvironmentView::resized, this, &EnvironmentBaseView::updateSize);
10
11 adjustWidgets(parent);
12 }
13
14 EnvironmentView * EnvironmentBaseView::getEnvironmentView() const
15 {
16 return environmentView;
17 }
18
19 void EnvironmentBaseView::updateSize()
20 {
21 QRect frame(0,0,1,1);
22
23 for(auto child : findChildren<WidgetView*>())
24 frame = frame.united(child->geometry());
25
26 setGeometry(frame);
27 }
28
29 void EnvironmentBaseView::adjustWidgets(QWidget *mainWindow)
30 {
31 int x;
32
33 // adjust the position of Environment View:
34 x= (mainWindow->width() - environmentView->width() )/2;
35 environmentView->move(x,30);
36
37 updateSize();
38 }
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
EnvironmentView
This class provides an editor for configuring the environment setup, i.e. it is filled with the conte...
Definition: EnvironmentView.h:43
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentBaseView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
EnvironmentBaseView.h
1 #ifndef ENVIRONMENTBASEVIEW_H
2 #define ENVIRONMENTBASEVIEW_H
3
4 #include "WidgetView.h"
5 #include "EnvironmentView.h"
6
7 class EnvironmentBaseView : public WidgetView
8 {
9
10 public:
11 EnvironmentBaseView(QWidget *parent = 0);
12 ~EnvironmentBaseView() = default;
13
14 public Q_SLOTS:
15 void updateSize();
16 void adjustWidgets(QWidget * mainWindow);
17
18 public:
19 EnvironmentView * getEnvironmentView() const;
20
21 public:
22 EnvironmentView * environmentView;
23 };
24
25 #endif // ENVIRONMENTBASEVIEW_H
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
EnvironmentView.h
This class provides an editor for configuring the environment setup, i.e. it is filled with the conte...
EnvironmentView
This class provides an editor for configuring the environment setup, i.e. it is filled with the conte...
Definition: EnvironmentView.h:43
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentDisplayPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
EnvironmentDisplayPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "EnvironmentDisplayPresenter.h"
12
13 EnvironmentDisplayPresenter::EnvironmentDisplayPresenter(EnvironmentInterface * environment,
14 EnvironmentDisplayView * environmentDisplayView,
15 QObject *parent)
16 : QObject(parent)
17 , environment(environment)
18 , environmentDisplayView(environmentDisplayView)
19 {
20 connect(environment, &EnvironmentInterface::modifiedName, this, &EnvironmentDisplayPresenter::setEnvironmentNameView);
21 connect(environment, &EnvironmentInterface::edited, this,&EnvironmentDisplayPresenter::updateView );
22
23 updateView();
24 setStatus();
25 }
26
27
28 void EnvironmentDisplayPresenter::setEnvironmentNameView()
29 {
30 environmentDisplayView->setEnvironmentName(environment->getName());
31
32 setStatus();
33 }
34
35 void EnvironmentDisplayPresenter::setTimeOfDayView()
36 {
37 environmentDisplayView->setTimeOfDay(environment->getTimeOfDayMap()->count());
38
39 setStatus();
40 }
41
42 void EnvironmentDisplayPresenter::setVisibilityDistanceView()
43 {
44 environmentDisplayView->setVisibilityDistance(environment->getVisibilityDistanceMap()->count());
45
46 setStatus();
47 }
48
49 void EnvironmentDisplayPresenter::setFrictionView()
50 {
51 environmentDisplayView->setFriction(environment->getFrictionMap()->count());
52
53 setStatus();
54 }
55
56 void EnvironmentDisplayPresenter::setWeatherView()
57 {
58 environmentDisplayView->setWeather(environment->getWeatherMap()->count());
59
60 setStatus();
61 }
62
63 void EnvironmentDisplayPresenter::updateView()
64 {
65 setEnvironmentNameView();
66
67 setTimeOfDayView();
68 setVisibilityDistanceView();
69 setFrictionView();
70 setWeatherView();
71
72 setStatus();
73 }
74
75 void EnvironmentDisplayPresenter::setStatus()
76 {
77 bool ok = true;
78
79 if(environment->getTimeOfDayMap()->count() == 0 || !checkProbabilities(environment->getTimeOfDayMap()))
80 ok = false;
81
82 else if(environment->getVisibilityDistanceMap()->count() == 0 || !checkProbabilities(environment->getVisibilityDistanceMap()))
83 ok = false;
84
85 else if(environment->getFrictionMap()->count() == 0 || !checkProbabilities(environment->getFrictionMap()))
86 ok = false;
87
88 else if(environment->getWeatherMap()->count() == 0 || !checkProbabilities(environment->getWeatherMap()))
89 ok = false;
90
91
92 if( ok && environment->getName().isEmpty() )
93 environmentDisplayView->setStatus(EnvironmentDisplayView::StatusType::Warning, QString("No name specified"));
94
95 else if(ok)
96 environmentDisplayView->setStatus(EnvironmentDisplayView::StatusType::OK, QString("OK"));
97
98 else
99 environmentDisplayView->setStatus(EnvironmentDisplayView::StatusType::Error, QString("Error"));
100
101 environment->setStatus(ok);
102 }
103
104 bool EnvironmentDisplayPresenter::checkProbabilities(QMap<EnvironmentInterface::ID, EnvironmentInterface::Item*> * const items)
105 {
106 double sum=0.0;
107
108 for(auto item : items->values())
109 sum += item->getProbability();
110
111 return sum == 1.0;
112 }
EnvironmentDisplayView::setVisibilityDistance
void setVisibilityDistance(int number)
Method for setting the displayed number of visibility distance map entries.
Definition: EnvironmentDisplayView.cpp:50
EnvironmentDisplayView::setStatus
void setStatus(StatusType status, QString message)
Method which determines the frame color according to the status type passed as a first argument...
Definition: EnvironmentDisplayView.cpp:65
EnvironmentDisplayPresenter::updateView
void updateView()
Method which sets all displayed values according to the model data. Will be called after loading a co...
Definition: EnvironmentDisplayPresenter.cpp:63
EnvironmentDisplayView
This class provides a display for a quick overview of the environment configuration.
Definition: EnvironmentDisplayView.h:41
EnvironmentDisplayPresenter.h
This class defines the presenter which controls the content to be displayed in the EnvironmentDisplay...
EnvironmentDisplayPresenter::setVisibilityDistanceView
void setVisibilityDistanceView()
Slot which is called when the user edits the visibility distance map. Updates the displayed number of...
Definition: EnvironmentDisplayPresenter.cpp:42
EnvironmentDisplayPresenter::environmentDisplayView
EnvironmentDisplayView * environmentDisplayView
a pointer to the display view whose content is managed by this presenter
Definition: EnvironmentDisplayPresenter.h:101
EnvironmentDisplayPresenter::setStatus
void setStatus()
Method which determines the status of the environment settings. If all necessary configurations are m...
Definition: EnvironmentDisplayPresenter.cpp:75
EnvironmentDisplayPresenter::setEnvironmentNameView
void setEnvironmentNameView()
Slot which is called when the name of the environment configuration has changed in the model...
Definition: EnvironmentDisplayPresenter.cpp:28
EnvironmentInterface::getFrictionMap
virtual FrictionMap * getFrictionMap() const =0
Returns a pointer to the map of friction coefficients.
EnvironmentInterface::getVisibilityDistanceMap
virtual VisibilityDistanceMap * getVisibilityDistanceMap() const =0
Returns a pointer to the map of visibility distances.
EnvironmentDisplayPresenter::setWeatherView
void setWeatherView()
Slot which is called when the user edits the weather map. Updates the displayed number of map entries...
Definition: EnvironmentDisplayPresenter.cpp:56
EnvironmentDisplayView::setFriction
void setFriction(int number)
Method for setting the displayed number of friction map entries.
Definition: EnvironmentDisplayView.cpp:55
EnvironmentDisplayView::setEnvironmentName
void setEnvironmentName(QString name)
Method for setting the name which should be displayed for the environment.
Definition: EnvironmentDisplayView.cpp:40
EnvironmentInterface::modifiedName
void modifiedName()
Signal, emitted when the name of the environment setting has been changed using the setName method...
EnvironmentInterface::setStatus
virtual void setStatus(Status const &_status)=0
Method for setting the status of the environment configuration to the value passed as an argument...
EnvironmentDisplayPresenter::setFrictionView
void setFrictionView()
Slot which is called when the user edits the friction coefficient map. Updates the displayed number o...
Definition: EnvironmentDisplayPresenter.cpp:49
EnvironmentDisplayPresenter::environment
EnvironmentInterface * environment
a pointer to the environment model (interface) which is read by this presenter
Definition: EnvironmentDisplayPresenter.h:100
EnvironmentInterface::getWeatherMap
virtual WeatherMap * getWeatherMap() const =0
Returns a pointer to the map of whether parameters.
EnvironmentInterface::getTimeOfDayMap
virtual TimeOfDayMap * getTimeOfDayMap() const =0
Returns a pointer to the time of day parameter map.
EnvironmentDisplayPresenter::setTimeOfDayView
void setTimeOfDayView()
Slot which is called when the user edits the time of day map. Updates the displayed number of map ent...
Definition: EnvironmentDisplayPresenter.cpp:35
EnvironmentDisplayView::StatusType::Error
enum class for classifying the status (will be used to determine the color of the frame) ...
EnvironmentDisplayView::setWeather
void setWeather(int number)
Method for setting the displayed number of weather map entries.
Definition: EnvironmentDisplayView.cpp:60
EnvironmentInterface::edited
void edited()
Signal, emitted when the environment settings have changed (e.g. specific parameters). Will be noticed by the EnvironmentDisplayPresenter to update the displayed info on the environment setting.
EnvironmentDisplayPresenter::checkProbabilities
bool checkProbabilities(QMap< EnvironmentInterface::ID, EnvironmentInterface::Item *> *const items)
Method which checks whether the probabilities of the environment items registered in the given map su...
Definition: EnvironmentDisplayPresenter.cpp:104
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
EnvironmentInterface::getName
virtual Name getName() const =0
Returns the current name of the environment configuration.
EnvironmentDisplayView::setTimeOfDay
void setTimeOfDay(int number)
Method for setting the displayed number of time of day map entries.
Definition: EnvironmentDisplayView.cpp:45
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentDisplayView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
EnvironmentDisplayView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "EnvironmentDisplayView.h"
12 #include "ui_EnvironmentDisplayView.h"
13
14 EnvironmentDisplayView::EnvironmentDisplayView(QWidget *parent) :
15 WidgetView(parent),
16 ui(new Ui::EnvironmentDisplayView)
17 {
18 ui->setupUi(this);
19
20 color = { {StatusType::OK, QString("QGroupBox{border:2px solid green;"
21 "border-radius:5px;margin-top: 4ex;} "
22 "QGroupBox::title{subcontrol-origin: margin;"
23 "subcontrol-position:top center;padding:0 3px;}")},
24 {StatusType::Error, QString("QGroupBox{border:2px solid red;"
25 "border-radius:5px;margin-top: 4ex;} "
26 "QGroupBox::title{subcontrol-origin: margin;"
27 "subcontrol-position:top center;padding:0 3px;}")},
28 {StatusType::Warning, QString("QGroupBox{border:2px solid orange;border-radius:5px;margin-top: 4ex;} "
29 "QGroupBox::title{subcontrol-origin: margin;"
30 "subcontrol-position:top center;padding:0 3px;}")}
31 };
32
33 }
34
35 EnvironmentDisplayView::~EnvironmentDisplayView()
36 {
37 delete ui;
38 }
39
40 void EnvironmentDisplayView::setEnvironmentName(QString name)
41 {
42 ui->EnvironmentName->setText(name);
43 }
44
45 void EnvironmentDisplayView::setTimeOfDay(int number)
46 {
47 ui->TimeOfDay->setText(QString::number(number));
48 }
49
50 void EnvironmentDisplayView::setVisibilityDistance(int number)
51 {
52 ui->Visibility->setText(QString::number(number));
53 }
54
55 void EnvironmentDisplayView::setFriction(int number)
56 {
57 ui->Friction->setText(QString::number(number));
58 }
59
60 void EnvironmentDisplayView::setWeather(int number)
61 {
62 ui->Weather->setText(QString::number(number));
63 }
64
65 void EnvironmentDisplayView::setStatus(StatusType status, QString message)
66 {
67 ui->Status->setText(message);
68
69 setStyleSheet(color[status]);
70 }
EnvironmentDisplayView::color
QMap< StatusType, QString > color
a color map which determines the color code according to the status type
Definition: EnvironmentDisplayView.h:103
EnvironmentDisplayView::setVisibilityDistance
void setVisibilityDistance(int number)
Method for setting the displayed number of visibility distance map entries.
Definition: EnvironmentDisplayView.cpp:50
EnvironmentDisplayView::setStatus
void setStatus(StatusType status, QString message)
Method which determines the frame color according to the status type passed as a first argument...
Definition: EnvironmentDisplayView.cpp:65
EnvironmentDisplayView::StatusType
StatusType
Definition: EnvironmentDisplayView.h:46
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
EnvironmentDisplayView
This class provides a display for a quick overview of the environment configuration.
Definition: EnvironmentDisplayView.h:41
EnvironmentDisplayView.h
This class provides a display for a quick overview of the environment configuration.
EnvironmentDisplayView::ui
Ui::EnvironmentDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: EnvironmentDisplayView.h:104
EnvironmentDisplayView::setFriction
void setFriction(int number)
Method for setting the displayed number of friction map entries.
Definition: EnvironmentDisplayView.cpp:55
EnvironmentDisplayView::setEnvironmentName
void setEnvironmentName(QString name)
Method for setting the name which should be displayed for the environment.
Definition: EnvironmentDisplayView.cpp:40
EnvironmentDisplayView::setWeather
void setWeather(int number)
Method for setting the displayed number of weather map entries.
Definition: EnvironmentDisplayView.cpp:60
EnvironmentDisplayView::setTimeOfDay
void setTimeOfDay(int number)
Method for setting the displayed number of time of day map entries.
Definition: EnvironmentDisplayView.cpp:45
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentItemModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
EnvironmentItemModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "EnvironmentItemModel.h"
12
13 EnvironmentItemModel::EnvironmentItemModel(Value value,
14 Probability probability,
15 QObject *parent)
16 : EnvironmentItemInterface(parent)
17 , probability(probability)
18 , value(value)
19 {
20
21 }
22
23 void EnvironmentItemModel::setValue(const Value &_value)
24 {
25 value = _value;
26 Q_EMIT edited();
27 }
28
29
30 EnvironmentItemInterface::Value EnvironmentItemModel::getValue() const
31 {
32 return value;
33 }
34
35
36 void EnvironmentItemModel::setProbability(const Probability &_probability)
37 {
38 probability = _probability;
39 Q_EMIT edited();
40 }
41
42
43 EnvironmentItemInterface::Probability EnvironmentItemModel::getProbability() const
44 {
45 return probability;
46 }
EnvironmentItemModel::getProbability
virtual Probability getProbability() const override
Method which returns the current selection probability of the environment parameter.
Definition: EnvironmentItemModel.cpp:43
EnvironmentItemModel::value
Value value
the current value
Definition: EnvironmentItemModel.h:49
EnvironmentItemInterface::Probability
double Probability
the selection probability&#39;s datatype.
Definition: EnvironmentItemInterface.h:44
EnvironmentItemModel::setValue
virtual void setValue(const Value &_value) override
Method which sets the value of the environment parameter to the one passed as an argument.
Definition: EnvironmentItemModel.cpp:23
EnvironmentItemModel.h
The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class...
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentItemInterface::edited
void edited()
Signal, which is emitted when the environment parameter&#39;s attributes have been modified. Will be forwarded by the EnvironmentInterface instance.
EnvironmentItemModel::getValue
virtual Value getValue() const override
Method which returns the current value of the environment parameter.
Definition: EnvironmentItemModel.cpp:30
EnvironmentItemModel::probability
Probability probability
the current selection probability
Definition: EnvironmentItemModel.h:48
EnvironmentItemInterface::Value
QString Value
a general string datatype for the environment parameter&#39;s value.
Definition: EnvironmentItemInterface.h:43
EnvironmentItemModel::setProbability
virtual void setProbability(const Probability &_probability) override
Method which sets the selection probability of the environment parameter to the one passed as an argu...
Definition: EnvironmentItemModel.cpp:36
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentItemView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
EnvironmentItemView.cpp
1 #include "EnvironmentItemView.h"
2 #include "ui_EnvironmentItemView.h"
3
4 #include <QTimeEdit>
5 #include <QDoubleSpinBox>
6 #include <QComboBox>
7
8 EnvironmentItemView::EnvironmentItemView(Type type,
9 unsigned int ID,
10 int index,
11 QWidget *parent) :
12 WidgetView(parent)
13 , type(type)
14 , ID(ID)
15 , index(index)
16 , ui(new Ui::EnvironmentItemView)
17 {
18 ui->setupUi(this);
19
20 switch(type)
21 {
22
23 case Type::TimeOfDay:
24 {
25 QTimeEdit * valueView = new QTimeEdit(this);
26 valueView->setObjectName("valueView");
27
28 ui->Index->setText(QString("%1. ").arg(index));
29 ui->Unit->setText("");
30 ui->valueLayout->insertWidget(2, valueView);
31 connect(valueView, static_cast<void (QTimeEdit::*)(QTime const &)>(&QTimeEdit::timeChanged),
32 this, valueView_timeChanged);
33 break;
34 }
35 case Type::VisibilityDistance:
36 {
37 QDoubleSpinBox * valueView = new QDoubleSpinBox(this);
38 valueView->setObjectName("valueView");
39 valueView->setMinimumWidth(60);
40 valueView->setMaximumWidth(60);
41
42 valueView->setMinimum(0.0);
43 valueView->setMaximum(5000.0);
44 valueView->setDecimals(1);
45 valueView->setSingleStep(10);
46 valueView->setLocale(QLocale::C);
47 ui->Index->setText( QString("%1. ").arg(index) );
48 ui->Unit->setText("[m]");
49 ui->valueLayout->insertWidget(2,valueView);
50 connect(valueView, static_cast<void (QDoubleSpinBox::*)(QString const &)>(&QDoubleSpinBox::valueChanged),
51 this, valueView_valueChanged);
52 break;
53 }
54 case Type::Friction:
55 {
56 QDoubleSpinBox * valueView = new QDoubleSpinBox(this);
57 valueView->setObjectName("valueView");
58 valueView->setMinimumWidth(60);
59 valueView->setMaximumWidth(60);
60
61 valueView->setMinimum(0.0);
62 valueView->setMaximum(10.0);
63 valueView->setDecimals(2);
64 valueView->setSingleStep(0.1);
65 valueView->setLocale(QLocale::C);
66 ui->Index->setText( QString("%1. ").arg(index) );
67 ui->Unit->setText("");
68 ui->valueLayout->insertWidget(2,valueView);
69 connect(valueView, static_cast<void (QDoubleSpinBox::*)(QString const &)>(&QDoubleSpinBox::valueChanged),
70 this, valueView_valueChanged);
71 break;
72 }
73 case Type::Weather:
74 {
75 QComboBox * valueView = new QComboBox (this);
76 valueView->setMinimumWidth(60);
77 valueView->setMaximumWidth(60);
78
79 valueView->setObjectName("valueView");
80 valueView->insertItems(0, QStringList({"rainy", "sunny", "cloudy", "foggy", "snowy", "..."}));
81
82 ui->Index->setText(QString("%1. ").arg(index));
83 ui->Unit->setText("");
84 ui->valueLayout->insertWidget(2,valueView);
85
86 connect(valueView, static_cast<void (QComboBox::*)(QString const &)>(&QComboBox::currentTextChanged),
87 this, valueView_valueChanged);
88 break;
89
90 }
91 default:
92 break;
93
94 }
95 }
96
97 EnvironmentItemView::~EnvironmentItemView()
98 {
99 delete ui;
100 }
101
102 void EnvironmentItemView::on_remove_clicked()
103 {
104 Q_EMIT remove(ID, type);
105 }
106
107 void EnvironmentItemView::valueView_valueChanged(const QString &value)
108 {
109 Q_EMIT valueChanged(ID,value,type);
110 }
111
112 void EnvironmentItemView::valueView_timeChanged(const QTime &time)
113 {
114 Q_EMIT valueChanged(ID, time.toString(), type);
115 }
116
117 void EnvironmentItemView::on_probabilityValue_editingFinished()
118 {
119 Q_EMIT probabilityChanged(ID, ui->probabilityValue->value(), type);
120 }
121
122 void EnvironmentItemView::setValue(QString value)
123 {
124 switch(type)
125 {
126
127 case Type::TimeOfDay:
128 {
129 findChild<QTimeEdit*>("valueView")->setTime(QTime::fromString(value));
130 break;
131 }
132 case Type::VisibilityDistance:
133 {
134 findChild<QDoubleSpinBox*>("valueView")->setValue(value.toDouble());
135 break;
136 }
137 case Type::Friction:
138 {
139 findChild<QDoubleSpinBox*>("valueView")->setValue(value.toDouble());
140 break;
141 }
142 case Type::Weather:
143 {
144 findChild<QComboBox*>("valueView")->setCurrentText(value);
145 break;
146 }
147 default:
148 break;
149 }
150 }
151
152
153 void EnvironmentItemView::setProbability(double value)
154 {
155 ui->probabilityValue->setValue(value);
156 }
157
158 double EnvironmentItemView::getProbability() const
159 {
160 return ui->probabilityValue->value();
161 }
162
163 void EnvironmentItemView::setIndex(int newIndex)
164 {
165 index = newIndex;
166 ui->Index->setText(QString("%1. ").arg(index));
167 }
168
169 unsigned int EnvironmentItemView::getID() const
170 {
171 return ID;
172 }
173
174 int EnvironmentItemView::getIndex() const
175 {
176 return index;
177 }
178
179 EnvironmentItemView::Type EnvironmentItemView::getType() const
180 {
181 return type;
182 }
183
184 QString EnvironmentItemView::getValue() const
185 {
186 switch(type)
187 {
188
189 case Type::TimeOfDay:
190 return findChild<QTimeEdit*>("valueView")->time().toString();
191
192 case Type::VisibilityDistance:
193 return QString("%1").arg(findChild<QDoubleSpinBox*>("valueView")->value());
194
195 case Type::Friction:
196 return QString("%1").arg(findChild<QDoubleSpinBox*>("valueView")->value());
197
198 case Type::Weather:
199 return findChild<QComboBox*>("valueView")->currentText();
200
201 default:
202 return QString("");
203 }
204 }
205
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentItemView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
EnvironmentItemView.h
1 #ifndef ENVIRONMENTITEMVIEW_H
2 #define ENVIRONMENTITEMVIEW_H
3
4 #include "WidgetView.h"
5
6 namespace Ui {
7 class EnvironmentItemView;
8 }
9
10 class EnvironmentItemView : public WidgetView
11 {
12 Q_OBJECT
13
14
15 public:
16 enum class Type {
17 TimeOfDay = 1,
18 VisibilityDistance = 2,
19 Friction = 3,
20 Weather = 4,
21 };
22
23 public:
24 explicit EnvironmentItemView(Type type,
25 unsigned int ID,
26 int index,
27 QWidget *parent = 0);
28 ~EnvironmentItemView();
29
30
31 Q_SIGNALS:
32 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
36 void valueChanged(unsigned int ID, QString value, Type type);
37
38 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
42 void remove(unsigned int ID, Type type);
43
44 //-----------------------------------------------------------------------------
47 //-----------------------------------------------------------------------------
48 void probabilityChanged(unsigned int ID, double probability, Type type);
49
50 private Q_SLOTS:
51 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 void on_remove_clicked();
56
57 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 void on_probabilityValue_editingFinished();
62
63 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 void valueView_valueChanged(QString const & value);
70
71 //-----------------------------------------------------------------------------
76 //-----------------------------------------------------------------------------
77 void valueView_timeChanged(QTime const & time);
78
79 public:
80 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
85 unsigned int getID() const;
86
87 //-----------------------------------------------------------------------------
92 //-----------------------------------------------------------------------------
93 int getIndex() const;
94
95 //-----------------------------------------------------------------------------
100 //-----------------------------------------------------------------------------
101 Type getType() const;
102
103 //-----------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------
108 QString getValue() const;
109
110 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------
115 double getProbability() const;
116
117 public:
118 //-----------------------------------------------------------------------------
123 //-----------------------------------------------------------------------------
124 void setValue(QString value);
125
126 //-----------------------------------------------------------------------------
131 //-----------------------------------------------------------------------------
132 void setProbability(double value);
133
134 //-----------------------------------------------------------------------------
139 //-----------------------------------------------------------------------------
140 void setIndex(int newIndex);
141
142 private:
143 Type type;
144 QString value;
145 unsigned int ID;
146 int index;
147 Ui::EnvironmentItemView *ui;
148 };
149
150 #endif // ENVIRONMENTITEMVIEW_H
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentMapPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
EnvironmentMapPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "EnvironmentMapPresenter.h"
12
13 EnvironmentMapPresenter::EnvironmentMapPresenter(EnvironmentInterface * const environment,
14 QMap<ID, Item*> * environmentMap,
15 QUndoStack * const undoStack,
16 QObject *parent)
17 : QAbstractTableModel(parent)
18 , environment(environment)
19 , environmentMap(environmentMap)
20 , undoStack(undoStack)
21 {
22 _columnHeaders << "Value" << "Probability";
23 }
24
25
26 int EnvironmentMapPresenter::columnCount(const QModelIndex &parent) const
27 {
28 Q_UNUSED(parent);
29
30 return _columnHeaders.count();
31 }
32
33 int EnvironmentMapPresenter::rowCount(const QModelIndex &parent) const
34 {
35 Q_UNUSED(parent);
36
37 return environmentMap->count();
38 }
39
40 QVariant EnvironmentMapPresenter::headerData(int section,
41 Qt::Orientation orientation,
42 int role) const
43 {
44 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
45 return _columnHeaders.value(section);
46
47 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
48 return section + 1;
49
50 return QVariant();
51 }
52
53 QVariant EnvironmentMapPresenter::data(const QModelIndex &index, int role) const
54 {
55 int row = index.row();
56 int col = index.column();
57 EnvironmentInterface::Item * item = environmentMap->value(RowToID[row]);
58
59 if(row >= environmentMap->count())
60 return QVariant::Invalid;
61
62 if(role == Qt::TextAlignmentRole)
63 return QVariant(Qt::AlignCenter);
64
65 if(item && (role == Qt::DisplayRole || role == Qt::EditRole))
66 {
67 if( col == 0)
68 return QVariant(item->getValue());
69 else if(col == 1)
70 return QVariant(item->getProbability());
71 }
72
73 return QVariant();
74 }
75
76 bool EnvironmentMapPresenter::setData(const QModelIndex &index,
77 const QVariant &value,
78 int role)
79 {
80 int row = index.row();
81 int col = index.column();
82 EnvironmentInterface::Item * item = environmentMap->value(RowToID[row]);
83
84 if(role == Qt::EditRole)
85 {
86 if(col == 0)
87 {
88 item->setValue(value.toString());
89 Q_EMIT dataChanged(index, index);
90 return true;
91 }
92 else if(col == 1)
93 {
94 item->setProbability(value.toDouble());
95 Q_EMIT dataChanged(index, index);
96 return true;
97 }
98 }
99
100 return false;
101 }
102
103 Qt::ItemFlags EnvironmentMapPresenter::flags(const QModelIndex &index) const
104 {
105 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
106 }
107
108 void EnvironmentMapPresenter::addRow(const int &row, QString value, double probability)
109 {
110 EnvironmentInterface::ID Id = (environmentMap->isEmpty() ? 1 : environmentMap->lastKey() +1 );
111
112 // shift all row indices,starting from given row, up
113 for(auto _row= RowToID.size()-1; _row>=row; _row--)
114 RowToID.insert(_row + 1, RowToID.take(_row));
115
116 // insert row with new index
117 RowToID.insert(row , Id);
118
119 beginInsertRows(QModelIndex(), row, row);
120
121 EnvironmentInterface::Item * item = environment->createItem(value, probability);
122 environmentMap->insert(Id, item);
123 Q_EMIT environment->edited();
124
125 endInsertRows();
126 }
127
128 bool EnvironmentMapPresenter::removeRow(const int &row)
129 {
130 if( RowToID.contains(row) )
131 {
132 beginRemoveRows(QModelIndex(), row, row);
133 delete environmentMap->take(RowToID[row]);
134 RowToID.take(row);
135
136 // shift the ID to row map for everything below this Item
137 for( int i = row + 1; i<=RowToID.count() ; i++)
138 RowToID.insert( i-1, RowToID.take(i) );
139
140 Q_EMIT environment->edited();
141 endRemoveRows();
142
143 return true;
144 }
145 else
146 return false;
147 }
148
149
150 void EnvironmentMapPresenter::update()
151 {
152 int rows = 0;
153
154 beginResetModel();
155 endResetModel();
156 RowToID.clear();
157
158 for(auto key : environmentMap->keys())
159 {
160 RowToID.insert(rows, key);
161 rows++;
162 }
163
164 Q_EMIT environment->edited();
165 }
EnvironmentMapPresenter::environment
EnvironmentInterface *const environment
an instance of the environment model
Definition: EnvironmentMapPresenter.h:165
EnvironmentMapPresenter::_columnHeaders
QStringList _columnHeaders
the column header&#39;s info
Definition: EnvironmentMapPresenter.h:171
EnvironmentMapPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: EnvironmentMapPresenter.cpp:53
EnvironmentMapPresenter::removeRow
bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: EnvironmentMapPresenter.cpp:128
EnvironmentInterface::ID
unsigned int ID
A key identifier for the map of environment items.
Definition: EnvironmentInterface.h:54
EnvironmentItemInterface::setProbability
virtual void setProbability(const Probability &_probability)=0
Method which sets the selection probability of the environment parameter to the one passed as an argu...
EnvironmentMapPresenter::update
void update()
Method which updates the table according to the current entries of environmentMap.
Definition: EnvironmentMapPresenter.cpp:150
EnvironmentMapPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: EnvironmentMapPresenter.cpp:26
EnvironmentMapPresenter::environmentMap
QMap< ID, Item * > *const environmentMap
an instance of the map listing the environment parameter (instances of EnvironmentItemInterface) ...
Definition: EnvironmentMapPresenter.h:166
EnvironmentMapPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: EnvironmentMapPresenter.cpp:40
EnvironmentMapPresenter.h
This class describes the presenter objects of the environment parameter maps.
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentMapPresenter::RowToID
QMap< int, ID > RowToID
a map translating row indices to IDs of environment parameters
Definition: EnvironmentMapPresenter.h:170
EnvironmentInterface::createItem
virtual Item * createItem(Item::Value const &value, Item::Probability const &probability)=0
Creates an environmental parameter (i.e. an instance of EnvironmentItemInterface) with the given valu...
EnvironmentItemInterface::getProbability
virtual Probability getProbability() const =0
Method which returns the current selection probability of the environment parameter.
EnvironmentMapPresenter::addRow
void addRow(const int &row, QString value, double probability)
Method that adds a new row, i.e. a new environment item to the edited component.
Definition: EnvironmentMapPresenter.cpp:108
EnvironmentItemInterface::getValue
virtual Value getValue() const =0
Method which returns the current value of the environment parameter.
EnvironmentMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: EnvironmentMapPresenter.cpp:33
EnvironmentInterface::edited
void edited()
Signal, emitted when the environment settings have changed (e.g. specific parameters). Will be noticed by the EnvironmentDisplayPresenter to update the displayed info on the environment setting.
EnvironmentItemInterface::setValue
virtual void setValue(const Value &_value)=0
Method which sets the value of the environment parameter to the one passed as an argument.
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
EnvironmentMapPresenter::setData
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: EnvironmentMapPresenter.cpp:76
EnvironmentMapPresenter::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! ...
Definition: EnvironmentMapPresenter.cpp:103
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
EnvironmentModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "EnvironmentModel.h"
12
13
14 EnvironmentModel::EnvironmentModel(QObject *parent)
15 : EnvironmentInterface(parent)
16 , name("")
17 , timeOfDayMap(new TimeOfDayMap )
18 , visibilityDistanceMap( new VisibilityDistanceMap )
19 , frictionMap ( new FrictionMap )
20 , weatherMap ( new WeatherMap )
21 {
22
23 }
24
25 EnvironmentInterface::Name EnvironmentModel::getName() const
26 {
27 return name;
28 }
29
30 void EnvironmentModel::setName(const Name &_name)
31 {
32 name = _name;
33 Q_EMIT modifiedName();
34 }
35
36 EnvironmentModel::~EnvironmentModel()
37 {
38
39 delete timeOfDayMap;
40 delete visibilityDistanceMap;
41 delete frictionMap;
42 delete weatherMap;
43 }
44
45 EnvironmentInterface::TimeOfDayMap * EnvironmentModel::getTimeOfDayMap() const
46 {
47 return timeOfDayMap;
48 }
49
50 EnvironmentInterface::VisibilityDistanceMap * EnvironmentModel::getVisibilityDistanceMap() const
51 {
52 return visibilityDistanceMap;
53 }
54
55 EnvironmentInterface::FrictionMap * EnvironmentModel::getFrictionMap() const
56 {
57 return frictionMap;
58 }
59
60 EnvironmentInterface::WeatherMap * EnvironmentModel::getWeatherMap() const
61 {
62 return weatherMap;
63 }
64
65 EnvironmentInterface::Item * EnvironmentModel::createItem(const EnvironmentItemInterface::Value &value,
66 const EnvironmentItemInterface::Probability &probability)
67 {
68 EnvironmentItemInterface *item = new EnvironmentItemModel(value, probability, this);
69 connect(item, &EnvironmentItemInterface::edited, this, &EnvironmentInterface::edited);
70
71 return item;
72 }
73
74 void EnvironmentModel::reset()
75 {
76 name=QString("");
77
78 qDeleteAll(*timeOfDayMap);
79 timeOfDayMap->clear();
80
81 qDeleteAll(*visibilityDistanceMap);
82 visibilityDistanceMap->clear();
83
84 qDeleteAll(*frictionMap);
85 frictionMap->clear();
86
87 qDeleteAll(*weatherMap);
88 weatherMap->clear();
89
90 Q_EMIT edited();
91 }
92
93
94 void EnvironmentModel::setStatus(const Status &_status)
95 {
96 status = _status;
97 Q_EMIT modifiedStatus();
98 }
99
100 EnvironmentInterface::Status EnvironmentModel::getStatus() const
101 {
102 return status;
103 }
EnvironmentModel::getTimeOfDayMap
virtual TimeOfDayMap * getTimeOfDayMap() const override
Returns a pointer to the time of day parameter map.
Definition: EnvironmentModel.cpp:45
EnvironmentInterface::TimeOfDayMap
QMap< ID, Item * > TimeOfDayMap
The container class for storing time of day parameters.
Definition: EnvironmentInterface.h:57
EnvironmentModel::frictionMap
FrictionMap *const frictionMap
the pointer to the map of friction coefficients
Definition: EnvironmentModel.h:60
EnvironmentItemModel
The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class...
Definition: EnvironmentItemModel.h:27
EnvironmentInterface::Status
bool Status
Type characterizing the status of the environment settings.
Definition: EnvironmentInterface.h:61
EnvironmentModel.h
The Environment Model implements the functionality of the EnvironmentInterface class.
EnvironmentModel::getVisibilityDistanceMap
virtual VisibilityDistanceMap * getVisibilityDistanceMap() const override
Returns a pointer to the map of visibility distances.
Definition: EnvironmentModel.cpp:50
EnvironmentModel::reset
virtual void reset() override
Method which clears all maps and deletes the correponding environmental parameters. Further sets the name to an empty string and emits the edited signal to inform the EnvironmentDisplayPresenter instance about the changes.
Definition: EnvironmentModel.cpp:74
EnvironmentModel::createItem
virtual Item * createItem(Item::Value const &value, Item::Probability const &probability) override
Creates an environmental parameter (i.e. an instance of EnvironmentItemInterface) with the given valu...
Definition: EnvironmentModel.cpp:65
EnvironmentItemInterface::Probability
double Probability
the selection probability&#39;s datatype.
Definition: EnvironmentItemInterface.h:44
EnvironmentInterface::VisibilityDistanceMap
QMap< ID, Item * > VisibilityDistanceMap
The container class for storing visitbility distances.
Definition: EnvironmentInterface.h:58
EnvironmentModel::timeOfDayMap
TimeOfDayMap *const timeOfDayMap
the pointer to the map of time of day parameters
Definition: EnvironmentModel.h:58
EnvironmentModel::setStatus
virtual void setStatus(Status const &_status) override
Method for setting the status of the environment configuration to the value passed as an argument...
Definition: EnvironmentModel.cpp:94
EnvironmentInterface::modifiedStatus
void modifiedStatus()
Signal, emitted when the environment&#39;s status has changed.
EnvironmentModel::getStatus
virtual Status getStatus() const override
Method which returns the current status of the environment settings.
Definition: EnvironmentModel.cpp:100
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentItemInterface::edited
void edited()
Signal, which is emitted when the environment parameter&#39;s attributes have been modified. Will be forwarded by the EnvironmentInterface instance.
EnvironmentModel::weatherMap
WeatherMap *const weatherMap
the pointer to the map of wheather parameters
Definition: EnvironmentModel.h:61
EnvironmentInterface::Name
QString Name
The name of the environment configuration.
Definition: EnvironmentInterface.h:51
EnvironmentModel::getWeatherMap
virtual WeatherMap * getWeatherMap() const override
Returns a pointer to the map of whether parameters.
Definition: EnvironmentModel.cpp:60
EnvironmentInterface::modifiedName
void modifiedName()
Signal, emitted when the name of the environment setting has been changed using the setName method...
EnvironmentModel::getFrictionMap
virtual FrictionMap * getFrictionMap() const override
Returns a pointer to the map of friction coefficients.
Definition: EnvironmentModel.cpp:55
EnvironmentInterface::FrictionMap
QMap< ID, Item * > FrictionMap
The container class for storing friction coefficients.
Definition: EnvironmentInterface.h:59
EnvironmentModel::name
Name name
the name of the environment configuration
Definition: EnvironmentModel.h:57
EnvironmentModel::getName
virtual Name getName() const override
Returns the current name of the environment configuration.
Definition: EnvironmentModel.cpp:25
EnvironmentModel::setName
virtual void setName(Name const &_name) override
Sets the name of the environment configuration to the one passed as an argument.
Definition: EnvironmentModel.cpp:30
EnvironmentInterface::edited
void edited()
Signal, emitted when the environment settings have changed (e.g. specific parameters). Will be noticed by the EnvironmentDisplayPresenter to update the displayed info on the environment setting.
EnvironmentModel::visibilityDistanceMap
VisibilityDistanceMap *const visibilityDistanceMap
the pointer to the visibility distance map
Definition: EnvironmentModel.h:59
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
EnvironmentItemInterface::Value
QString Value
a general string datatype for the environment parameter&#39;s value.
Definition: EnvironmentItemInterface.h:43
EnvironmentInterface::WeatherMap
QMap< ID, Item * > WeatherMap
The container class for storing wheather parameters.
Definition: EnvironmentInterface.h:60
EnvironmentModel::status
Status status
the current status of the settings. "true" means that the configuration is principally ready for simu...
Definition: EnvironmentModel.h:62
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
EnvironmentPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "EnvironmentPresenter.h"
12
13 #include "Models/EnvironmentItemModel.h"
14
15 #include "DelegateDoubleView.h"
16 #include "DelegateComboBoxView.h"
17 #include "DelegateTimeView.h"
18
19 #include <QTableView>
20
21 double const EnvironmentPresenter::default_probability = 0.5;
22 QString const EnvironmentPresenter::default_timeOfDay = "15:00";
23 QString const EnvironmentPresenter::default_visibilityDistance = "1000.0";
24 QString const EnvironmentPresenter::default_friction = "1.00";
25 QString const EnvironmentPresenter::default_weather = "Sunny";
26 QStringList const EnvironmentPresenter::weatherList =
27 {
28 "Sunny",
29 "Rainy",
30 "Cloudy",
31 "Snowy",
32 "Foggy",
33 "Stormy"
34 };
35
36
37 EnvironmentPresenter::EnvironmentPresenter(EnvironmentInterface * const environment,
38 EnvironmentView * const environmentView,
39 QUndoStack * const undoStack,
40 QObject *parent)
41 : QObject(parent)
42 , environment(environment)
43 , environmentView(environmentView)
44 , undoStack(undoStack)
45 , timeOfDayPresenter( new EnvironmentMapPresenter(environment,
46 environment->getTimeOfDayMap(),
47 undoStack,
48 this))
49 , visibilityDistancePresenter( new EnvironmentMapPresenter(environment,
50 environment->getVisibilityDistanceMap(),
51 undoStack,
52 this))
53 , frictionPresenter( new EnvironmentMapPresenter(environment,
54 environment->getFrictionMap(),
55 undoStack,
56 this))
57 , weatherPresenter(new EnvironmentMapPresenter( environment,
58 environment->getWeatherMap(),
59 undoStack,
60 this))
61 {
62 SetupTimeOfDay();
63 SetupVisibilityDistance();
64 SetupFriction();
65 SetupWeather();
66
67 connect(environmentView, &EnvironmentView::modifiedName, this, &EnvironmentPresenter::setName);
68 connect(environment, &EnvironmentInterface::edited, this, &EnvironmentPresenter::checkProbabilities);
69 }
70
71 void EnvironmentPresenter::checkProbabilities()
72 {
73 // 1. Check probabilities for time of day map
74 double sum = 0;
75 for( auto item : environment->getTimeOfDayMap()->values() )
76 sum += item->getProbability();
77
78 environmentView->setTimeOfDay_ProbabilityError( sum!=1.0 && !environment->getTimeOfDayMap()->isEmpty() );
79
80 // 2. Check probabilities for visibility distance map
81 sum = 0;
82 for( auto item : environment->getVisibilityDistanceMap()->values() )
83 sum += item->getProbability();
84
85 environmentView->setVisibilityDistance_ProbabilityError( sum!=1.0 && !environment->getVisibilityDistanceMap()->isEmpty() );
86
87 // 3. Check probabilities for friction map
88 sum = 0;
89 for( auto item : environment->getFrictionMap()->values() )
90 sum += item->getProbability();
91
92 environmentView->setFriction_ProbabilityError(sum!=1.0 && !environment->getFrictionMap()->isEmpty() );
93
94 // 4. Check probabilities for weather map
95 sum = 0;
96 for( auto item : environment->getWeatherMap()->values() )
97 sum += item->getProbability();
98
99 environmentView->setWeather_ProbabilityError(sum!=1.0 && !environment->getWeatherMap()->isEmpty() );
100 }
101
102 void EnvironmentPresenter::setName(const QString &name)
103 {
104 if(environment->getName() != name)
105 undoStack->push(new EditEnvironmentName(environment,environmentView,name));
106 }
107
108 void EnvironmentPresenter::SetupTimeOfDay()
109 {
110 QTableView *timeOfDayView = environmentView->getTimeOfDayView();
111
112 timeOfDayView->setItemDelegateForColumn(1, new DelegateDoubleView(0,1,0.1,2, "time of day probability", undoStack, this));
113 timeOfDayView->setItemDelegateForColumn(0, new DelegateTimeView("time of day", undoStack, this));
114 timeOfDayView->setModel(timeOfDayPresenter);
115
116 timeOfDayPresenter->setObjectName("timeOfDayTable");
117
118 connect(environmentView, &EnvironmentView::addTimeOfDay, this, &EnvironmentPresenter::addTimeOfDay);
119 connect(environmentView, &EnvironmentView::removeTimeOfDay, this, &EnvironmentPresenter::removeTimeOfDay);
120 }
121
122 void EnvironmentPresenter::SetupVisibilityDistance()
123 {
124 QTableView *visibilityDistanceView = environmentView->getVisibilityDistanceView();
125
126 visibilityDistanceView->setItemDelegateForColumn(1, new DelegateDoubleView(0,1,0.1,2, "visibility distance's probability", undoStack, this));
127 visibilityDistanceView->setItemDelegateForColumn(0, new DelegateDoubleView(0, 5000.0, 10.0, 1, "visibility distance's", undoStack, this));
128 visibilityDistanceView->setModel(visibilityDistancePresenter);
129
130 visibilityDistancePresenter->setObjectName("visibilityDistanceTable");
131
132 connect(environmentView, &EnvironmentView::addVisibilityDistance, this, &EnvironmentPresenter::addVisibilityDistance);
133 connect(environmentView, &EnvironmentView::removeVisibilityDistance, this, &EnvironmentPresenter::removeVisibilityDistance);
134 }
135
136 void EnvironmentPresenter::SetupFriction()
137 {
138 QTableView *frictionView = environmentView->getFrictionView();
139
140 frictionView->setItemDelegateForColumn(1, new DelegateDoubleView(0,1,0.1, 2, "friction coefficient's probability", undoStack, this));
141 frictionView->setItemDelegateForColumn(0, new DelegateDoubleView(0, 10.0, 0.1, 2, "friction coefficient's", undoStack, this));
142 frictionView->setModel(frictionPresenter);
143
144 frictionPresenter->setObjectName("frictionTable");
145
146 connect(environmentView, &EnvironmentView::addFriction, this, &EnvironmentPresenter::addFriction);
147 connect(environmentView, &EnvironmentView::removeFriction, this, &EnvironmentPresenter::removeFriction);
148
149 }
150
151 void EnvironmentPresenter::SetupWeather()
152 {
153
154 QTableView *weatherView = environmentView->getWeatherView();
155
156 weatherView->setItemDelegateForColumn(1, new DelegateDoubleView(0,1,0.1, 2,"weather probability", undoStack, this));
157 weatherView->setItemDelegateForColumn(0, new DelegateComboBoxView(&weatherList,"weather", undoStack, this));
158 weatherView->setModel(weatherPresenter);
159
160 weatherPresenter->setObjectName("weatherTable");
161
162 connect(environmentView, &EnvironmentView::addWeather, this, &EnvironmentPresenter::addWeather);
163 connect(environmentView, &EnvironmentView::removeWeather, this, &EnvironmentPresenter::removeWeather);
164 }
165
166 void EnvironmentPresenter::addTimeOfDay()
167 {
168 undoStack->push(new AddEnvironmentItem(timeOfDayPresenter,default_timeOfDay, default_probability, "time of day table"));
169 }
170
171 void EnvironmentPresenter::removeTimeOfDay(const int &row)
172 {
173 if(timeOfDayPresenter->rowCount() != 0 )
174 undoStack->push(new RemoveEnvironmentItem(timeOfDayPresenter, row, "time of day table"));
175 }
176
177
178 void EnvironmentPresenter::addVisibilityDistance()
179 {
180 undoStack->push(new AddEnvironmentItem(visibilityDistancePresenter,default_visibilityDistance, default_probability, "visibility distances table"));
181 }
182
183 void EnvironmentPresenter::removeVisibilityDistance(const int &row)
184 {
185 if(visibilityDistancePresenter->rowCount() != 0 )
186 undoStack->push(new RemoveEnvironmentItem(visibilityDistancePresenter, row, "visibility distances table"));
187 }
188
189 void EnvironmentPresenter::addFriction()
190 {
191 undoStack->push(new AddEnvironmentItem(frictionPresenter,default_friction, default_probability, "friction coefficients table"));
192 }
193
194 void EnvironmentPresenter::removeFriction(const int &row)
195 {
196 if(frictionPresenter->rowCount() != 0 )
197 undoStack->push(new RemoveEnvironmentItem(frictionPresenter, row, "friction coefficients table"));
198 }
199
200
201 void EnvironmentPresenter::addWeather()
202 {
203 undoStack->push(new AddEnvironmentItem(weatherPresenter, default_weather, default_probability, "weather table"));
204 }
205
206 void EnvironmentPresenter::removeWeather(const int &row)
207 {
208 if(weatherPresenter->rowCount() != 0 )
209 undoStack->push(new RemoveEnvironmentItem(weatherPresenter,row, "weather table"));
210 }
211
212 void EnvironmentPresenter::updateView()
213 {
214 environmentView->setName(environment->getName());
215
216 timeOfDayPresenter->update();
217 visibilityDistancePresenter->update();
218 frictionPresenter->update();
219 weatherPresenter->update();
220 }
221
222
223 AddEnvironmentItem::AddEnvironmentItem(EnvironmentMapPresenter * const table,
224 const QString default_value,
225 const double default_probability,
226 QString tableName,
227 QUndoCommand * parent)
228 : QUndoCommand (parent)
229 , table(table)
230 , default_value(default_value)
231 , default_probability(default_probability)
232 {
233 setText(QString("added entry to %1").arg(tableName));
234 }
235
236 void AddEnvironmentItem::redo()
237 {
238 table->addRow(table->rowCount(), default_value, default_probability);
239 }
240
241 void AddEnvironmentItem::undo()
242 {
243 table->removeRow(table->rowCount()-1);
244 }
245
246 RemoveEnvironmentItem::RemoveEnvironmentItem(EnvironmentMapPresenter * const table,
247 int const row,
248 QString tableName,
249 QUndoCommand * parent)
250 : QUndoCommand (parent)
251 , table(table)
252 , row(row)
253 , value(table->data( table->index(row, 0) ).toString())
254 , probability(table->data( table->index(row, 1) ).toDouble())
255 {
256 setText(QString("removed entry from %1").arg(tableName));
257 }
258
259 void RemoveEnvironmentItem::redo()
260 {
261 table->removeRow(row);
262 }
263
264 void RemoveEnvironmentItem::undo()
265 {
266 table->addRow(row, value, probability);
267 }
268
269
270 EditEnvironmentName::EditEnvironmentName(EnvironmentInterface * const environment,
271 EnvironmentView * const environmentView,
272 EnvironmentInterface::Name const &newName,
273 QUndoCommand * parent)
274 : QUndoCommand (parent)
275 , environment(environment)
276 , environmentView(environmentView)
277 , newName(newName)
278 , oldName(environment->getName())
279 {
280 setText("edited environment name");
281 }
282
283 void EditEnvironmentName::redo()
284 {
285 environment->setName(newName);
286 environmentView->setName(newName);
287 }
288
289 void EditEnvironmentName::undo()
290 {
291 environment->setName(oldName);
292 environmentView->setName(oldName);
293 }
EnvironmentPresenter::addFriction
void addFriction()
Slot which is connected to the EnvironmentView::addFriction signal. Calls the EnvironmentMapPresenter...
Definition: EnvironmentPresenter.cpp:189
EnvironmentView::removeVisibilityDistance
void removeVisibilityDistance(const int &row)
Signal, emitted when the user clicks the remove-button of the table of visibility distances...
EnvironmentPresenter::weatherList
static QStringList const weatherList
a list of availbale weather parameters (the user can choose from this list)
Definition: EnvironmentPresenter.h:191
EnvironmentView::addWeather
void addWeather()
Signal, emitted when the user clicks the add-button of the table of weather parameters.
AddEnvironmentItem
Command class for adding rows to the table of environment settings.
Definition: EnvironmentPresenter.h:198
EnvironmentView::addVisibilityDistance
void addVisibilityDistance()
Signal, emitted when the user clicks the add-button of the table of visibility distances.
EnvironmentMapPresenter::removeRow
bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: EnvironmentMapPresenter.cpp:128
EnvironmentPresenter::default_weather
static QString const default_weather
a default weather parameter
Definition: EnvironmentPresenter.h:190
EnvironmentView::getFrictionView
QTableView * getFrictionView() const
Method which provides access to the table of friction coefficients.
Definition: EnvironmentView.cpp:91
EnvironmentPresenter::addTimeOfDay
void addTimeOfDay()
Slot which is connected to the EnvironmentView::addTimeOfDay signal. Calls the EnvironmentMapPresente...
Definition: EnvironmentPresenter.cpp:166
EnvironmentPresenter::removeWeather
void removeWeather(const int &row)
Slot which is connected to the EnvironmentView::removeWeather signal. Calls the EnvironmentMapPresent...
Definition: EnvironmentPresenter.cpp:206
EnvironmentPresenter::environment
EnvironmentInterface *const environment
a pointer to the model of the environment configuration
Definition: EnvironmentPresenter.h:175
EnvironmentPresenter::SetupWeather
void SetupWeather()
An initializer method which configures the table view of weather parameters. Creates the table&#39;s pres...
Definition: EnvironmentPresenter.cpp:151
EnvironmentMapPresenter::update
void update()
Method which updates the table according to the current entries of environmentMap.
Definition: EnvironmentMapPresenter.cpp:150
EnvironmentView::removeWeather
void removeWeather(const int &row)
Signal, emitted when the user clicks the remove-button of the table of friction coefficients. Transmits the row index of the table cell being currently active.
EditEnvironmentName
Command class editing the environment&#39;s name.
Definition: EnvironmentPresenter.h:245
EnvironmentPresenter::weatherPresenter
EnvironmentMapPresenter *const weatherPresenter
a pointer to the presenter object connecting the weather map to its table view
Definition: EnvironmentPresenter.h:183
EnvironmentPresenter::timeOfDayPresenter
EnvironmentMapPresenter *const timeOfDayPresenter
a pointer to the presenter object connecting the time of day map to its table view ...
Definition: EnvironmentPresenter.h:180
EnvironmentView::removeFriction
void removeFriction(const int &row)
Signal, emitted when the user clicks the remove-button of the table of friction coefficients. Transmits the row index of the table cell being currently active.
EnvironmentView::setTimeOfDay_ProbabilityError
void setTimeOfDay_ProbabilityError(bool error)
Method which displays a probability error message for the table of time of day parameters if the bool...
Definition: EnvironmentView.cpp:124
EnvironmentView::getWeatherView
QTableView * getWeatherView() const
Method which provides access to the table of weather parameters.
Definition: EnvironmentView.cpp:86
EnvironmentPresenter.h
This class defines the presenter object which handles user events coming from the view (EnvironmentVi...
EnvironmentMapPresenter
This class describes the presenter objects of the environment parameter maps.
Definition: EnvironmentMapPresenter.h:49
EnvironmentView::setVisibilityDistance_ProbabilityError
void setVisibilityDistance_ProbabilityError(bool error)
Method which displays a probability error message for the table of visibility distances if the boolia...
Definition: EnvironmentView.cpp:132
EnvironmentPresenter::removeTimeOfDay
void removeTimeOfDay(const int &row)
Slot which is connected to the EnvironmentView::removeTimeOfDay signal. Calls the EnvironmentMapPrese...
Definition: EnvironmentPresenter.cpp:171
EnvironmentPresenter::SetupTimeOfDay
void SetupTimeOfDay()
An initializer method which configures the table view of the time of day parameters. Creates the table&#39;s presenter object (EnvironmentMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.
Definition: EnvironmentPresenter.cpp:108
EnvironmentPresenter::removeVisibilityDistance
void removeVisibilityDistance(const int &row)
Slot which is connected to the EnvironmentView::removeVisibilityDistance signal. Calls the Environmen...
Definition: EnvironmentPresenter.cpp:183
EnvironmentPresenter::default_probability
static double const default_probability
a default selection probability
Definition: EnvironmentPresenter.h:186
EnvironmentInterface::getFrictionMap
virtual FrictionMap * getFrictionMap() const =0
Returns a pointer to the map of friction coefficients.
EnvironmentView::getVisibilityDistanceView
QTableView * getVisibilityDistanceView() const
Method which provides access to the table of visibility distances.
Definition: EnvironmentView.cpp:96
EnvironmentPresenter::default_visibilityDistance
static QString const default_visibilityDistance
a default visbility distance
Definition: EnvironmentPresenter.h:188
EnvironmentItemModel.h
The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class...
EnvironmentPresenter::removeFriction
void removeFriction(const int &row)
Slot which is connected to the EnvironmentView::removeFriction signal. Calls the EnvironmentMapPresen...
Definition: EnvironmentPresenter.cpp:194
EnvironmentPresenter::setName
void setName(QString const &name)
Slot which is connected to the EnvironmentView::modifiedName signal. Sets the model&#39;s value of the en...
Definition: EnvironmentPresenter.cpp:102
EnvironmentView
This class provides an editor for configuring the environment setup, i.e. it is filled with the conte...
Definition: EnvironmentView.h:43
EnvironmentInterface::Name
QString Name
The name of the environment configuration.
Definition: EnvironmentInterface.h:51
EnvironmentInterface::getVisibilityDistanceMap
virtual VisibilityDistanceMap * getVisibilityDistanceMap() const =0
Returns a pointer to the map of visibility distances.
EnvironmentPresenter::SetupFriction
void SetupFriction()
An initializer method which configures the table view of friction coefficients. Creates the table&#39;s p...
Definition: EnvironmentPresenter.cpp:136
EnvironmentPresenter::default_friction
static QString const default_friction
a default friction coefficient
Definition: EnvironmentPresenter.h:189
RemoveEnvironmentItem
Command class for removing rows from the table of environment settings.
Definition: EnvironmentPresenter.h:222
EnvironmentView::modifiedName
void modifiedName(const QString &name)
Signal, emitted when the user edits the name of the environment configuration. Transmits the new name...
EnvironmentPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undoStack
Definition: EnvironmentPresenter.h:177
EnvironmentPresenter::checkProbabilities
void checkProbabilities()
Slot which checks the probability sums of all environment parameters. If for a particular parameter m...
Definition: EnvironmentPresenter.cpp:71
EnvironmentView::removeTimeOfDay
void removeTimeOfDay(const int &row)
Signal, emitted when the user clicks the remove-button of the time of day table. Transmits the row in...
EnvironmentView::setName
void setName(QString const &name)
Method which sets the current text of the environment name&#39;s line edit.
Definition: EnvironmentView.cpp:106
EnvironmentInterface::getWeatherMap
virtual WeatherMap * getWeatherMap() const =0
Returns a pointer to the map of whether parameters.
EnvironmentPresenter::updateView
void updateView()
Method which updates the view (EnvironmentView) to the current state of the model (EnvironmentModel /...
Definition: EnvironmentPresenter.cpp:212
EnvironmentInterface::getTimeOfDayMap
virtual TimeOfDayMap * getTimeOfDayMap() const =0
Returns a pointer to the time of day parameter map.
EnvironmentMapPresenter::addRow
void addRow(const int &row, QString value, double probability)
Method that adds a new row, i.e. a new environment item to the edited component.
Definition: EnvironmentMapPresenter.cpp:108
EnvironmentPresenter::visibilityDistancePresenter
EnvironmentMapPresenter *const visibilityDistancePresenter
a pointer to the presenter object connecting the visibility distance map to its table view ...
Definition: EnvironmentPresenter.h:181
EnvironmentPresenter::frictionPresenter
EnvironmentMapPresenter *const frictionPresenter
a pointer to the presenter object connecting the frition map to its table view
Definition: EnvironmentPresenter.h:182
EnvironmentPresenter::environmentView
EnvironmentView *const environmentView
a pointer to the view of the environment configuration
Definition: EnvironmentPresenter.h:176
EnvironmentPresenter::SetupVisibilityDistance
void SetupVisibilityDistance()
An initializer method which configures the table view of visibility distances Creates the table&#39;s pre...
Definition: EnvironmentPresenter.cpp:122
EnvironmentView::setWeather_ProbabilityError
void setWeather_ProbabilityError(bool error)
Method which displays a probability error message for the table of weather parameters if the boolian ...
Definition: EnvironmentView.cpp:148
EnvironmentView::addTimeOfDay
void addTimeOfDay()
Signal, emitted when the user clicks the add-button of the time of day table.
EnvironmentPresenter::default_timeOfDay
static QString const default_timeOfDay
a default time of day parameter
Definition: EnvironmentPresenter.h:187
EnvironmentMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: EnvironmentMapPresenter.cpp:33
EnvironmentView::setFriction_ProbabilityError
void setFriction_ProbabilityError(bool error)
Method which displays a probability error message for the table of friction coefficients if the booli...
Definition: EnvironmentView.cpp:140
EnvironmentInterface::setName
virtual void setName(Name const &_name)=0
Sets the name of the environment configuration to the one passed as an argument.
EnvironmentInterface::edited
void edited()
Signal, emitted when the environment settings have changed (e.g. specific parameters). Will be noticed by the EnvironmentDisplayPresenter to update the displayed info on the environment setting.
EnvironmentPresenter::addWeather
void addWeather()
Slot which is connected to the EnvironmentView::addWeather signal. Calls the EnvironmentMapPresenter:...
Definition: EnvironmentPresenter.cpp:201
EnvironmentView::getTimeOfDayView
QTableView * getTimeOfDayView() const
Method which provides access to the table of time of day parameters.
Definition: EnvironmentView.cpp:81
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
EnvironmentPresenter::addVisibilityDistance
void addVisibilityDistance()
Slot which is connected to the EnvironmentView::addVisibilityDistance signal. Calls the EnvironmentMa...
Definition: EnvironmentPresenter.cpp:178
EnvironmentView::addFriction
void addFriction()
Signal, emitted when the user clicks the add-button of the table of friction coefficients.
EnvironmentInterface::getName
virtual Name getName() const =0
Returns the current name of the environment configuration.
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
EnvironmentView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "EnvironmentView.h"
12 #include "ui_EnvironmentView.h"
13
14 EnvironmentView::EnvironmentView(QWidget *parent) :
15 QWidget(parent),
16 ui(new Ui::EnvironmentView)
17 {
18 ui->setupUi(this);
19
20 QFont headerFont;
21 headerFont.setBold(true);
22
23 ui->TimeOfDay->horizontalHeader()->setFont(headerFont);
24 ui->VisibilityDistance->horizontalHeader()->setFont(headerFont);
25 ui->Friction->horizontalHeader()->setFont(headerFont);
26 ui->Weather->horizontalHeader()->setFont(headerFont);
27
28 // install event filters for proper sizing of table columns
29 ui->TimeOfDay->installEventFilter(this);
30 ui->VisibilityDistance->installEventFilter(this);
31 ui->Friction->installEventFilter(this);
32 ui->Weather->installEventFilter(this);
33 }
34
35 EnvironmentView::~EnvironmentView()
36 {
37 delete ui;
38 }
39
40 void EnvironmentView::on_add_TimeOfDay_clicked()
41 {
42 Q_EMIT addTimeOfDay();
43 }
44
45 void EnvironmentView::on_remove_TimeOfDay_clicked()
46 {
47 Q_EMIT removeTimeOfDay(ui->TimeOfDay->currentIndex().row());
48 }
49
50 void EnvironmentView::on_add_VisibilityDistance_clicked()
51 {
52 Q_EMIT addVisibilityDistance();
53 }
54
55 void EnvironmentView::on_remove_VisibilityDistance_clicked()
56 {
57 Q_EMIT removeVisibilityDistance(ui->VisibilityDistance->currentIndex().row());
58 }
59
60 void EnvironmentView::on_add_Friction_clicked()
61 {
62 Q_EMIT addFriction();
63 }
64
65 void EnvironmentView::on_remove_Friction_clicked()
66 {
67 Q_EMIT removeFriction(ui->Friction->currentIndex().row());
68 }
69
70 void EnvironmentView::on_add_Weather_clicked()
71 {
72 Q_EMIT addWeather();
73 }
74
75 void EnvironmentView::on_remove_Weather_clicked()
76 {
77 Q_EMIT removeWeather(ui->Weather->currentIndex().row());
78 }
79
80
81 QTableView * EnvironmentView::getTimeOfDayView() const
82 {
83 return ui->TimeOfDay;
84 }
85
86 QTableView * EnvironmentView::getWeatherView() const
87 {
88 return ui->Weather;
89 }
90
91 QTableView * EnvironmentView::getFrictionView() const
92 {
93 return ui->Friction;
94 }
95
96 QTableView * EnvironmentView::getVisibilityDistanceView() const
97 {
98 return ui->VisibilityDistance;
99 }
100
101 void EnvironmentView::on_Name_editingFinished()
102 {
103 Q_EMIT modifiedName(ui->Name->text());
104 }
105
106 void EnvironmentView::setName(const QString &name)
107 {
108 ui->Name->setText(name);
109 }
110
111 bool EnvironmentView::eventFilter(QObject *watched, QEvent *event)
112 {
113 QTableView* table = qobject_cast<QTableView*> (watched);
114
115 if( table && event->type() == QEvent::Resize )
116 {
117 int cell = (table->width())/2;
118 table->setColumnWidth(0, cell);
119 }
120
121 return false;
122 }
123
124 void EnvironmentView::setTimeOfDay_ProbabilityError(bool error)
125 {
126 if(error)
127 ui->TimeOfDay_ProbabilityError->setText("probability sum invalid!");
128 else
129 ui->TimeOfDay_ProbabilityError->setText("");
130 }
131
132 void EnvironmentView::setVisibilityDistance_ProbabilityError(bool error)
133 {
134 if(error)
135 ui->VisibilityDistance_ProbabilityError->setText("probability sum invalid!");
136 else
137 ui->VisibilityDistance_ProbabilityError->setText("");
138 }
139
140 void EnvironmentView::setFriction_ProbabilityError(bool error)
141 {
142 if(error)
143 ui->Friction_ProbabilityError->setText("probability sum invalid!");
144 else
145 ui->Friction_ProbabilityError->setText("");
146 }
147
148 void EnvironmentView::setWeather_ProbabilityError(bool error)
149 {
150 if(error)
151 ui->Weather_ProbabilityError->setText("probability sum invalid!");
152 else
153 ui->Weather_ProbabilityError->setText("");
154 }
EnvironmentView::removeVisibilityDistance
void removeVisibilityDistance(const int &row)
Signal, emitted when the user clicks the remove-button of the table of visibility distances...
EnvironmentView::on_add_Friction_clicked
void on_add_Friction_clicked()
Qt Designer-created slot which emits the addFriction signal when the user clicks the add_Friction but...
Definition: EnvironmentView.cpp:60
EnvironmentView::addWeather
void addWeather()
Signal, emitted when the user clicks the add-button of the table of weather parameters.
EnvironmentView::on_remove_Weather_clicked
void on_remove_Weather_clicked()
Qt Designer-created slot which emits the removeWeather signal when the user clicks the remove_Weather...
Definition: EnvironmentView.cpp:75
EnvironmentView::addVisibilityDistance
void addVisibilityDistance()
Signal, emitted when the user clicks the add-button of the table of visibility distances.
EnvironmentView::on_add_Weather_clicked
void on_add_Weather_clicked()
Qt Designer-created slot which emits the addWeather signal when the user clicks the add_Weather butto...
Definition: EnvironmentView.cpp:70
EnvironmentView::getFrictionView
QTableView * getFrictionView() const
Method which provides access to the table of friction coefficients.
Definition: EnvironmentView.cpp:91
EnvironmentView::on_add_VisibilityDistance_clicked
void on_add_VisibilityDistance_clicked()
Qt Designer-created slot which emits the addVisibilityDistance signal when the user clicks the add_Vi...
Definition: EnvironmentView.cpp:50
EnvironmentView::on_remove_Friction_clicked
void on_remove_Friction_clicked()
Qt Designer-created slot which emits the removeFriction signal when the user clicks the remove_Fricti...
Definition: EnvironmentView.cpp:65
Ui
Definition: EnvironmentDisplayView.h:29
EnvironmentView::removeWeather
void removeWeather(const int &row)
Signal, emitted when the user clicks the remove-button of the table of friction coefficients. Transmits the row index of the table cell being currently active.
EnvironmentView::ui
Ui::EnvironmentView * ui
the ui object which contains the GUI elements
Definition: EnvironmentView.h:271
EnvironmentView::removeFriction
void removeFriction(const int &row)
Signal, emitted when the user clicks the remove-button of the table of friction coefficients. Transmits the row index of the table cell being currently active.
EnvironmentView.h
This class provides an editor for configuring the environment setup, i.e. it is filled with the conte...
EnvironmentView::setTimeOfDay_ProbabilityError
void setTimeOfDay_ProbabilityError(bool error)
Method which displays a probability error message for the table of time of day parameters if the bool...
Definition: EnvironmentView.cpp:124
EnvironmentView::getWeatherView
QTableView * getWeatherView() const
Method which provides access to the table of weather parameters.
Definition: EnvironmentView.cpp:86
EnvironmentView::setVisibilityDistance_ProbabilityError
void setVisibilityDistance_ProbabilityError(bool error)
Method which displays a probability error message for the table of visibility distances if the boolia...
Definition: EnvironmentView.cpp:132
EnvironmentView::on_remove_VisibilityDistance_clicked
void on_remove_VisibilityDistance_clicked()
Qt Designer-created slot which emits the removeVisibilityDistance signal when the user clicks the rem...
Definition: EnvironmentView.cpp:55
EnvironmentView::getVisibilityDistanceView
QTableView * getVisibilityDistanceView() const
Method which provides access to the table of visibility distances.
Definition: EnvironmentView.cpp:96
EnvironmentView::on_Name_editingFinished
void on_Name_editingFinished()
Qt Designer-created slot which emits the modifiedName signal when finishes editing the line edit for ...
Definition: EnvironmentView.cpp:101
EnvironmentView
This class provides an editor for configuring the environment setup, i.e. it is filled with the conte...
Definition: EnvironmentView.h:43
EnvironmentView::modifiedName
void modifiedName(const QString &name)
Signal, emitted when the user edits the name of the environment configuration. Transmits the new name...
EnvironmentView::removeTimeOfDay
void removeTimeOfDay(const int &row)
Signal, emitted when the user clicks the remove-button of the time of day table. Transmits the row in...
EnvironmentView::setName
void setName(QString const &name)
Method which sets the current text of the environment name&#39;s line edit.
Definition: EnvironmentView.cpp:106
EnvironmentView::on_remove_TimeOfDay_clicked
void on_remove_TimeOfDay_clicked()
Qt Designer-created slot which emits the removeTimeOfDay signal when the user clicks the remove_TimeO...
Definition: EnvironmentView.cpp:45
EnvironmentView::setWeather_ProbabilityError
void setWeather_ProbabilityError(bool error)
Method which displays a probability error message for the table of weather parameters if the boolian ...
Definition: EnvironmentView.cpp:148
EnvironmentView::addTimeOfDay
void addTimeOfDay()
Signal, emitted when the user clicks the add-button of the time of day table.
EnvironmentView::setFriction_ProbabilityError
void setFriction_ProbabilityError(bool error)
Method which displays a probability error message for the table of friction coefficients if the booli...
Definition: EnvironmentView.cpp:140
EnvironmentView::on_add_TimeOfDay_clicked
void on_add_TimeOfDay_clicked()
Qt Designer-created slot which emits the addTimeOfDay signal when the user clicks the add_TimeOfDay b...
Definition: EnvironmentView.cpp:40
EnvironmentView::getTimeOfDayView
QTableView * getTimeOfDayView() const
Method which provides access to the table of time of day parameters.
Definition: EnvironmentView.cpp:81
EnvironmentView::addFriction
void addFriction()
Signal, emitted when the user clicks the add-button of the table of friction coefficients.
EnvironmentView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter. This filter catches the resize events of the table views in ord...
Definition: EnvironmentView.cpp:111
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentBaseView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
ExperimentBaseView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "ExperimentBaseView.h"
12
13 #include <QPaintEvent>
14 #include <QPainter>
15
16
17 ExperimentBaseView::ExperimentBaseView(QWidget *parent)
18 : WidgetView(parent)
19 {
20 experimentView = new ExperimentView(this);
21 scenarioDisplayView = new ScenarioDisplayView(this);
22 trafficDisplayView = new TrafficDisplayView(this);
23 environmentDisplayView = new EnvironmentDisplayView(this);
24
25 connect(experimentView, &ExperimentView::resized, this, &ExperimentBaseView::updateSize);
26
27 adjustWidgets(parent);
28 }
29
30 ExperimentView* ExperimentBaseView::getExperimentView() const
31 {
32 return experimentView;
33 }
34
35 ScenarioDisplayView * ExperimentBaseView::getScenarioDisplayView() const
36 {
37 return scenarioDisplayView;
38 }
39
40 EnvironmentDisplayView * ExperimentBaseView::getEnvironmentDisplayView() const
41 {
42 return environmentDisplayView;
43 }
44
45 TrafficDisplayView * ExperimentBaseView::getTrafficDisplayView() const
46 {
47 return trafficDisplayView;
48 }
49
50 void ExperimentBaseView::updateSize()
51 {
52 QRect frame(0,0,1,1);
53
54 for(auto child : findChildren<WidgetView*>())
55 frame = frame.united(child->geometry());
56
57 setGeometry(frame);
58 }
59
60 void ExperimentBaseView::adjustWidgets(QWidget *mainWindow)
61 {
62 int x,y;
63
64 // ajust the geometry of Experiment View:
65 x = ( mainWindow->width() - experimentView->width())/2;
66 experimentView->move(x,50);
67
68 // adjust the geometry of Environment Display View:
69 x = experimentView->x() - environmentDisplayView->width()/2 -130;
70 y = experimentView->y() + experimentView->height()+100;
71 environmentDisplayView->move(x,y);
72
73 // adjust the geometry of Scenario Display View:
74 x = experimentView->x() + experimentView->width()/2 - scenarioDisplayView->width()/2;
75 scenarioDisplayView->move(x,y);
76
77 // adjust the geometry of Traffic Display View:
78 x = experimentView->x() + experimentView->width() - trafficDisplayView->width()/2 +130;
79 trafficDisplayView->move(x,y);
80
81 updateSize();
82
83 }
84
85 void ExperimentBaseView::paintEvent(QPaintEvent *event)
86 {
87 event->ignore();
88 QPainter painter(this);
89
90 QPoint P1(experimentView->x() + experimentView->width()/2, experimentView->y() + experimentView->height()) ;
91 QPoint P2(scenarioDisplayView->x() + scenarioDisplayView->width()/2, scenarioDisplayView->y());
92 QPoint P3(trafficDisplayView->x() + trafficDisplayView->width()/2, trafficDisplayView->y());
93 QPoint P4( environmentDisplayView->x() + environmentDisplayView->width()/2, environmentDisplayView->y() );
94
95 painter.setPen(QColor(QStringLiteral("#777777")));
96 QPainterPath path(P1);
97
98 path.lineTo(P2);
99 painter.drawPath(path);
100
101 path.lineTo(P1);
102 path.lineTo(P3);
103
104 painter.drawPath(path);
105
106 path.lineTo(P1);
107 path.lineTo(P4);
108
109 painter.drawPath(path);
110
111 }
ExperimentBaseView::getExperimentView
ExperimentView * getExperimentView() const
Method which returns the experiment configuration editor widget.
Definition: ExperimentBaseView.cpp:30
ExperimentView
This class provides an editor for configuring the experiment setup, i.e. it is filled with the conten...
Definition: ExperimentView.h:47
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
ExperimentBaseView.h
This class provides a resizable container widget for the content of the experiment tab&#39;s scroll area...
EnvironmentDisplayView
This class provides a display for a quick overview of the environment configuration.
Definition: EnvironmentDisplayView.h:41
ExperimentBaseView::adjustWidgets
void adjustWidgets(QWidget *mainWindow)
Method which adjusts the positioning and size of the child widgets. The size of the child widgets is ...
Definition: ExperimentBaseView.cpp:60
ExperimentBaseView::getTrafficDisplayView
TrafficDisplayView * getTrafficDisplayView() const
Method which returns the widget displaying infos on the traffic configuration.
Definition: ExperimentBaseView.cpp:45
ExperimentBaseView::getEnvironmentDisplayView
EnvironmentDisplayView * getEnvironmentDisplayView() const
Method which returns the widget displaying infos on the environment configuration.
Definition: ExperimentBaseView.cpp:40
ExperimentBaseView::trafficDisplayView
TrafficDisplayView * trafficDisplayView
A pointer to the display widget showing the traffic configuration.
Definition: ExperimentBaseView.h:117
ExperimentView::resized
void resized()
Signal, emitted when this view has been resized. Will be connected to the slot ExperimentBaseView::up...
ExperimentBaseView::getScenarioDisplayView
ScenarioDisplayView * getScenarioDisplayView() const
Method which returns the widget displaying infos on the scenario configuration.
Definition: ExperimentBaseView.cpp:35
ExperimentBaseView::scenarioDisplayView
ScenarioDisplayView * scenarioDisplayView
A pointer to the display widget showing the scenario configuration.
Definition: ExperimentBaseView.h:116
TrafficDisplayView
This class provides a display for a quick overview of the traffic configuration.
Definition: TrafficDisplayView.h:42
ExperimentBaseView::experimentView
ExperimentView * experimentView
A pointer to the experiment configuration widget.
Definition: ExperimentBaseView.h:115
ExperimentBaseView::updateSize
void updateSize()
Slot which updates the size of this base view such that all child widgets (ExperimentView, ScenarioDisplayView, TrafficDisplayView and EnvironmentDisplayView) are visible.
Definition: ExperimentBaseView.cpp:50
ScenarioDisplayView
This class provides a display for a quick overview of the scenario configuration. ...
Definition: ScenarioDisplayView.h:40
ExperimentBaseView::paintEvent
void paintEvent(QPaintEvent *event) override
Reimplementation of the paint event. Here, the painting of the connection lines between the experimen...
Definition: ExperimentBaseView.cpp:85
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
ExperimentModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "ExperimentModel.h"
12
13 ExperimentInterface::ID const ExperimentModel::id_default = 0;
14 ExperimentInterface::NumberInvocations const ExperimentModel::numberInvocations_default = 1;
15 ExperimentInterface::Seed const ExperimentModel::seed_default = 0;
16
17 ExperimentModel::ExperimentModel(QObject *parent)
18 : ExperimentInterface(parent)
19 , id(id_default)
20 , numberInvocations(numberInvocations_default)
21 , seed(seed_default)
22 , libraries(new Libraries)
23 , loggingGroups(new LoggingGroups)
24 {
25 }
26
27 ExperimentInterface::ID ExperimentModel::getID() const
28 {
29 return id;
30 }
31
32 void ExperimentModel::setNumberInvocations(NumberInvocations const & _numberInvocations)
33 {
34 numberInvocations = _numberInvocations;
35 }
36
37 ExperimentInterface::NumberInvocations ExperimentModel::getNumberInvocations() const
38 {
39 return numberInvocations;
40 }
41
42 void ExperimentModel::setSeed(Seed const & _seed)
43 {
44 seed = _seed;
45 }
46
47 ExperimentInterface::Seed ExperimentModel::getSeed() const
48 {
49 return seed;
50 }
51
52 ExperimentInterface::Libraries * ExperimentModel::getLibraries() const
53 {
54 return libraries;
55 }
56
57 ExperimentInterface::LoggingGroups * ExperimentModel::getLoggingGroups() const
58 {
59 return loggingGroups;
60 }
ExperimentModel::setSeed
virtual void setSeed(Seed const &_seed) override
Sets the seed used for random number generation.
Definition: ExperimentModel.cpp:42
ExperimentInterface::Libraries
QMap< QString, QString > Libraries
The map of libraries needed by the simulation slave.
Definition: ExperimentInterface.h:47
ExperimentModel::setNumberInvocations
virtual void setNumberInvocations(NumberInvocations const &_numberInvocations) override
Sets the number of invocations of the experiment.
Definition: ExperimentModel.cpp:32
ExperimentModel::id
ID id
The ID of the experiment.
Definition: ExperimentModel.h:55
ExperimentModel::libraries
Libraries *const libraries
The pointer to the experiment&#39;s map of libraries.
Definition: ExperimentModel.h:58
ExperimentModel.h
The ExperimentModel class implements the functionality of the ExperimentInterface class...
ExperimentInterface::NumberInvocations
int NumberInvocations
The number of invocations.
Definition: ExperimentInterface.h:45
ExperimentInterface::LoggingGroups
QStringList LoggingGroups
The list of logging groups.
Definition: ExperimentInterface.h:48
ExperimentModel::getLibraries
virtual Libraries * getLibraries() const override
Returns the pointer to the Libraries map.
Definition: ExperimentModel.cpp:52
ExperimentInterface::ID
unsigned int ID
The experiment&#39;s ID (not used so far)
Definition: ExperimentInterface.h:44
ExperimentModel::numberInvocations_default
static NumberInvocations const numberInvocations_default
The default number of invocations.
Definition: ExperimentModel.h:63
ExperimentModel::getID
virtual ID getID() const override
Returns the ID of the experiment.
Definition: ExperimentModel.cpp:27
ExperimentModel::numberInvocations
NumberInvocations numberInvocations
The number of invocations of this experiment.
Definition: ExperimentModel.h:56
ExperimentModel::seed
Seed seed
The random seed.
Definition: ExperimentModel.h:57
ExperimentInterface::Seed
int Seed
The random seed used for random number generation.
Definition: ExperimentInterface.h:46
ExperimentModel::getSeed
virtual Seed getSeed() const override
Returns the current random number seed.
Definition: ExperimentModel.cpp:47
ExperimentModel::getLoggingGroups
virtual LoggingGroups * getLoggingGroups() const override
Returns the pointer to the list of Logging Groups.
Definition: ExperimentModel.cpp:57
ExperimentModel::loggingGroups
LoggingGroups *const loggingGroups
The pointer to the experiment&#39;s list of logging groups.
Definition: ExperimentModel.h:59
ExperimentModel::seed_default
static Seed const seed_default
The default random seed.
Definition: ExperimentModel.h:64
ExperimentInterface
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
Definition: ExperimentInterface.h:39
ExperimentModel::getNumberInvocations
virtual NumberInvocations getNumberInvocations() const override
Returns the current number of invocations.
Definition: ExperimentModel.cpp:37
ExperimentModel::id_default
static ID const id_default
The default ID.
Definition: ExperimentModel.h:62
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
ExperimentPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "Presenters/ExperimentPresenter.h"
12
13 #include "Views/DelegateFileBrowseView.h"
14
15 #include "DelegateComboBoxView.h"
16
17 QStringList ExperimentPresenter::loggingGroupsList =
18 {
19 "Trace",
20 "Visualization",
21 "RoadPosition",
22 "Sensor",
23 "Driver",
24 };
25
26 QStringList ExperimentPresenter::libraryTypesList =
27 {
28 "EventDetectorLibrary",
29 "ManipulatorLibrary",
30 "SpawnPointLibrary",
31 "StochasticsLibrary",
32 "WorldLibrary",
33 "ObservationLibrary",
34 };
35
36 ExperimentPresenter::ExperimentPresenter(ExperimentInterface * const experiment,
37 ExperimentView * const experimentView,
38 ProjectInterface * const project,
39 QUndoStack * const undoStack,
40 QObject *parent )
41 : QObject(parent)
42 , experiment(experiment)
43 , experimentView(experimentView)
44 , project(project)
45 , undoStack(undoStack)
46 , librariesPresenter( new LibrariesPresenter(experiment->getLibraries(), project,this))
47 , loggingGroupsPresenter( new LoggingGroupsPresenter(experiment->getLoggingGroups(), this) )
48 {
49 // Connect the signals
50 connect(experimentView, &ExperimentView::Invocations_valueChanged, this, &ExperimentPresenter::setNumberInvocations);
51 connect(experimentView, &ExperimentView::Seed_valueChanged, this, &ExperimentPresenter::setSeed);
52 connect(experimentView, &ExperimentView::startSimulation, this, &ExperimentPresenter::startSimulation);
53
54 // setup table of libraries and list of logging groups
55 setupLibraries();
56 setupLoggingGroups();
57
58 updateView();
59 }
60
61 void ExperimentPresenter::setupLoggingGroups()
62 {
63 QListView * const loggingGroupsView = experimentView->getLoggingGroupsView();
64 loggingGroupsView->setModel(loggingGroupsPresenter);
65
66 loggingGroupsView->setItemDelegate(new DelegateComboBoxView(&loggingGroupsList, "logging group", undoStack, this) );
67
68 connect(experimentView, &ExperimentView::addLoggingGroup, this, &ExperimentPresenter::addLoggingGroup);
69 connect(experimentView, &ExperimentView::removeLoggingGroup, this, &ExperimentPresenter::removeLoggingGroup);
70 }
71
72 void ExperimentPresenter::addLoggingGroup()
73 {
74 for(auto item : loggingGroupsList)
75 {
76 if(!experiment->getLoggingGroups()->contains(item))
77 {
78 undoStack->push(new AddLoggingGroup(loggingGroupsPresenter, item));
79 break;
80 }
81 }
82 }
83
84 void ExperimentPresenter::removeLoggingGroup(const int &row)
85 {
86
87 if(row >=0 && loggingGroupsPresenter->rowCount() != 0)
88 undoStack->push(new RemoveLoggingGroup(loggingGroupsPresenter, row));
89 }
90
91 void ExperimentPresenter::setupLibraries()
92 {
93 QTableView * const librariesView = experimentView->getLibrariesView();
94 librariesView->setModel(librariesPresenter);
95
96 librariesView->setItemDelegateForColumn(0, new DelegateComboBoxView(&libraryTypesList, "library type", undoStack, this) );
97 librariesView->setItemDelegateForColumn(1, new DelegateFileBrowseView(project, "library", undoStack, this));
98
99 connect(experimentView, &ExperimentView::addLibrary, this, &ExperimentPresenter::addLibrary);
100 connect(experimentView, &ExperimentView::removeLibrary, this, &ExperimentPresenter::removeLibrary);
101 }
102
103 void ExperimentPresenter::addLibrary()
104 {
105 for(auto libType : libraryTypesList)
106 {
107 if(!experiment->getLibraries()->keys().contains(libType))
108 {
109 undoStack->push(new AddLibrary(librariesPresenter, libType));
110 break;
111 }
112 }
113 }
114
115 void ExperimentPresenter::removeLibrary(const int &row)
116 {
117 if(librariesPresenter->rowCount() !=0)
118 undoStack->push(new RemoveLibrary(librariesPresenter, row));
119 }
120
121 void ExperimentPresenter::setNumberInvocations(ExperimentInterface::NumberInvocations _numberInvocations)
122 {
123 if(experiment->getNumberInvocations() != _numberInvocations)
124 undoStack->push(new EditNumberInvocations(experiment, experimentView, _numberInvocations));
125 }
126
127 void ExperimentPresenter::setSeed(ExperimentInterface::Seed _seed)
128 {
129 if(experiment->getSeed() != _seed)
130 undoStack->push(new EditRandomSeed(experiment, experimentView, _seed));
131 }
132
133 void ExperimentPresenter::updateView()
134 {
135
136 experimentView->setInvocationsValue(experiment->getNumberInvocations());
137 experimentView->setSeedValue(experiment->getSeed());
138
139 loggingGroupsPresenter->update();
140 librariesPresenter->update();
141 }
142
143
144 AddLibrary::AddLibrary(LibrariesPresenter * const table,
145 QString const &libType,
146 QUndoCommand *parent)
147 : QUndoCommand (parent)
148 , table(table)
149 , libType(libType)
150 {
151 setText("added entry to libraries table");
152 }
153
154 void AddLibrary::redo()
155 {
156 table->addRow(table->rowCount(), libType);
157 }
158
159 void AddLibrary::undo()
160 {
161 table->removeRow(table->rowCount()-1);
162 }
163
164 RemoveLibrary::RemoveLibrary(LibrariesPresenter * const table,
165 int const &row,
166 QUndoCommand *parent)
167 : QUndoCommand (parent)
168 , table(table)
169 , row(row)
170 , libType(table->data(table->index(row,0)).toString())
171 , lib(table->data(table->index(row,1)).toString())
172
173 {
174 setText("added entry to libraries table");
175 }
176
177 void RemoveLibrary::redo()
178 {
179 table->removeRow(row);
180 }
181
182 void RemoveLibrary::undo()
183 {
184 table->addRow(row, libType);
185 table->setData(table->index(row, 1), lib);
186 }
187
188 AddLoggingGroup::AddLoggingGroup(LoggingGroupsPresenter * const list,
189 QString const & name,
190 QUndoCommand *parent)
191 : QUndoCommand(parent)
192 , list(list)
193 , name(name)
194 {
195 setText("added entry to logging groups list");
196 }
197
198 void AddLoggingGroup::redo()
199 {
200 list->insertRow(list->rowCount(), name);
201 }
202
203 void AddLoggingGroup::undo()
204 {
205 list->removeRow(list->rowCount()-1);
206 }
207
208 RemoveLoggingGroup::RemoveLoggingGroup(LoggingGroupsPresenter * const list,
209 int const &row,
210 QUndoCommand *parent)
211 : QUndoCommand(parent)
212 , list(list)
213 , row(row)
214 , name(list->data(list->index(row)).toString())
215 {
216 setText("removed entry from logging groups list");
217 }
218
219 void RemoveLoggingGroup::redo()
220 {
221 list->removeRow(row);
222 }
223
224 void RemoveLoggingGroup::undo()
225 {
226 list->insertRow(row, name);
227 }
228
229
230 EditNumberInvocations::EditNumberInvocations(ExperimentInterface * const experiment,
231 ExperimentView * const experimentView,
232 const ExperimentInterface::NumberInvocations &newValue,
233 QUndoCommand *parent)
234 : QUndoCommand (parent)
235 , experiment(experiment)
236 , experimentView(experimentView)
237 , newValue(newValue)
238 , oldValue(experiment->getNumberInvocations())
239 {
240 setText("edited number of invocations");
241 }
242
243 void EditNumberInvocations::redo()
244 {
245 experiment->setNumberInvocations(newValue);
246 experimentView->setInvocationsValue(newValue);
247 }
248
249 void EditNumberInvocations::undo()
250 {
251 experiment->setNumberInvocations(oldValue);
252 experimentView->setInvocationsValue(oldValue);
253 }
254
255 EditRandomSeed::EditRandomSeed(ExperimentInterface * const experiment,
256 ExperimentView * const experimentView,
257 const ExperimentInterface::Seed &newValue,
258 QUndoCommand *parent)
259 : QUndoCommand (parent)
260 , experiment(experiment)
261 , experimentView(experimentView)
262 , newValue(newValue)
263 , oldValue(experiment->getSeed())
264 {
265 setText("edited random seed");
266 }
267
268 void EditRandomSeed::redo()
269 {
270 experiment->setSeed(newValue);
271 experimentView->setSeedValue(newValue);
272 }
273
274 void EditRandomSeed::undo()
275 {
276 experiment->setSeed(oldValue);
277 experimentView->setSeedValue(oldValue);
278 }
ExperimentInterface::getLoggingGroups
virtual LoggingGroups * getLoggingGroups() const =0
Returns the pointer to the list of Logging Groups.
EditNumberInvocations
Command class editing the number of invocations.
Definition: ExperimentPresenter.h:226
ExperimentPresenter::setNumberInvocations
void setNumberInvocations(ExperimentInterface::NumberInvocations _numberInvocations)
Slot which is connected to the ExperimentView::Invocations_valueChanged signal. It will set the model...
Definition: ExperimentPresenter.cpp:121
LoggingGroupsPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of items in the logging groups list...
Definition: LoggingGroupsPresenter.cpp:20
LoggingGroupsPresenter
This class describes the presenter object of the list of logging groups.
Definition: LoggingGroupsPresenter.h:47
ExperimentPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: ExperimentPresenter.h:130
ExperimentInterface::getLibraries
virtual Libraries * getLibraries() const =0
Returns the pointer to the Libraries map.
LibrariesPresenter::setData
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: LibrariesPresenter.cpp:100
AddLoggingGroup
Command class for adding logging groups to the logging groups list.
Definition: ExperimentPresenter.h:185
ExperimentView
This class provides an editor for configuring the experiment setup, i.e. it is filled with the conten...
Definition: ExperimentView.h:47
ExperimentInterface::NumberInvocations
int NumberInvocations
The number of invocations.
Definition: ExperimentInterface.h:45
ExperimentPresenter::addLibrary
void addLibrary()
Slot which adds a library to the libraries table.
Definition: ExperimentPresenter.cpp:103
ExperimentView::setInvocationsValue
void setInvocationsValue(int value)
Method for setting the spinbox value for the number of invocations to the value passed as an argument...
Definition: ExperimentView.cpp:41
ExperimentView::addLoggingGroup
void addLoggingGroup()
Signal, emitted when the add-button in the logging groups section has been pressed by the user...
ExperimentPresenter::experiment
ExperimentInterface *const experiment
a pointer to the experiment model whose values are edited by this presenter
Definition: ExperimentPresenter.h:127
ExperimentPresenter.h
This class defines the presenter object which handles user events coming from the view (ExperimentVie...
ExperimentPresenter::setSeed
void setSeed(ExperimentInterface::Seed _seed)
Slot which is connected to the ExperimentView::Seed_valueChanged signal. It will set the model&#39;s valu...
Definition: ExperimentPresenter.cpp:127
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
LibrariesPresenter::addRow
void addRow(const int &row, QString libType)
Method that adds a new row, i.e. a new library to of the given type.
Definition: LibrariesPresenter.cpp:132
ExperimentPresenter::project
ProjectInterface *const project
a ponter to the project interface in order to access the filepath
Definition: ExperimentPresenter.h:129
LibrariesPresenter
This class describes the presenter object of the map of included libraries.
Definition: LibrariesPresenter.h:48
AddLibrary
Command class for adding libraries to the libraries table.
Definition: ExperimentPresenter.h:144
RemoveLoggingGroup
Command class for removing logging groups from the logging groups list.
Definition: ExperimentPresenter.h:205
ExperimentView::Seed_valueChanged
void Seed_valueChanged(int value)
Signal, emitted when the random seed value has been modified by the user.
ExperimentInterface::getNumberInvocations
virtual NumberInvocations getNumberInvocations() const =0
Returns the current number of invocations.
LibrariesPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: LibrariesPresenter.cpp:26
LoggingGroupsPresenter::insertRow
virtual void insertRow(int row, QString item, const QModelIndex &parent=QModelIndex())
Method that adds a new logging group to the list at the given row index.
Definition: LoggingGroupsPresenter.cpp:62
ExperimentPresenter::startSimulation
void startSimulation()
Signal, emitted when the start simulation button has been clicked. Will trigger a process (started in...
ExperimentPresenter::loggingGroupsPresenter
LoggingGroupsPresenter *const loggingGroupsPresenter
a pointer to the presenter object of the logging groups list
Definition: ExperimentPresenter.h:137
ExperimentPresenter::libraryTypesList
static QStringList libraryTypesList
a list of possible library types
Definition: ExperimentPresenter.h:134
ExperimentView::startSimulation
void startSimulation()
Signal, emitted when the user clicks the Start Simulation Button. Will trigger a status check of the ...
ExperimentView::Invocations_valueChanged
void Invocations_valueChanged(int value)
Signal, emitted when the number of invocations has been modified by the user.
ExperimentView::removeLibrary
void removeLibrary(int const &row)
Signal, emitted when the remove-button in the library section has been pressed by the user...
ExperimentInterface::getSeed
virtual Seed getSeed() const =0
Returns the current random number seed.
RemoveLibrary
Command class for removing libraries from the libraries table.
Definition: ExperimentPresenter.h:163
ExperimentPresenter::experimentView
ExperimentView *const experimentView
a ponter to the experiment&#39;s view whose events are handled by this presenter
Definition: ExperimentPresenter.h:128
ExperimentPresenter::addLoggingGroup
void addLoggingGroup()
Slot which adds a logging group to the logging groups list.
Definition: ExperimentPresenter.cpp:72
ExperimentPresenter::removeLoggingGroup
void removeLoggingGroup(int const &row)
Slot which removes the logging groups placed in the given row of the logging groups list...
Definition: ExperimentPresenter.cpp:84
ExperimentPresenter::setupLibraries
void setupLibraries()
An initializer method which configures the table view of the libraries. Creates the table&#39;s presenter...
Definition: ExperimentPresenter.cpp:91
LoggingGroupsPresenter::removeRow
virtual void removeRow(int row, const QModelIndex &parent=QModelIndex())
Method that removes the logging group at the given index from the list.
Definition: LoggingGroupsPresenter.cpp:71
ExperimentPresenter::setupLoggingGroups
void setupLoggingGroups()
An initializer method which configures the list view of the logging groups. Creates the list&#39;s presen...
Definition: ExperimentPresenter.cpp:61
LoggingGroupsPresenter::update
void update()
Method which updates the list according to the current entries of loggingGroups.
Definition: LoggingGroupsPresenter.cpp:81
ExperimentInterface::Seed
int Seed
The random seed used for random number generation.
Definition: ExperimentInterface.h:46
ExperimentView::removeLoggingGroup
void removeLoggingGroup(int const &row)
Signal, emitted when the remove-button in the logging groups section has been pressed by the user...
ExperimentPresenter::librariesPresenter
LibrariesPresenter *const librariesPresenter
a pointer to the presenter object of the libraries map
Definition: ExperimentPresenter.h:133
ExperimentInterface::setNumberInvocations
virtual void setNumberInvocations(NumberInvocations const &_numberInvocations)=0
Sets the number of invocations of the experiment.
ExperimentView::getLibrariesView
QTableView * getLibrariesView() const
Method which gives access to the QTableView instance holding the entries of the libraries map...
Definition: ExperimentView.cpp:81
ExperimentView::getLoggingGroupsView
QListView * getLoggingGroupsView() const
Method which gives access to the QListView instance listing the logging groups. Will be used by the p...
Definition: ExperimentView.cpp:76
EditRandomSeed
Command class editing the number of invocations.
Definition: ExperimentPresenter.h:249
ExperimentPresenter::removeLibrary
void removeLibrary(int const &row)
Slot which removes the library placed in the given row of the libraries table.
Definition: ExperimentPresenter.cpp:115
ExperimentPresenter::loggingGroupsList
static QStringList loggingGroupsList
a selection list of possible logging groups
Definition: ExperimentPresenter.h:138
ExperimentInterface::setSeed
virtual void setSeed(Seed const &_seed)=0
Sets the seed used for random number generation.
ExperimentInterface
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
Definition: ExperimentInterface.h:39
LibrariesPresenter::update
void update()
Method which updates the table according to the current entries of libraries.
Definition: LibrariesPresenter.cpp:164
ExperimentPresenter::updateView
void updateView()
This method sets all display values of the view to the model values. This method is called after load...
Definition: ExperimentPresenter.cpp:133
ExperimentView::setSeedValue
void setSeedValue(int value)
Method for setting the spinbox value for the random seed to the value passed as an argument...
Definition: ExperimentView.cpp:86
LibrariesPresenter::removeRow
bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful range...
Definition: LibrariesPresenter.cpp:146
ExperimentView::addLibrary
void addLibrary()
Signal, emitted when the add-button in the library section has been pressed by the user...
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
ExperimentView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "ExperimentView.h"
12 #include "ui_ExperimentView.h"
13
14 #include <QResizeEvent>
15
16 ExperimentView::ExperimentView(QWidget *parent) :
17 WidgetView(parent),
18 ui(new Ui::ExperimentView)
19 {
20 ui->setupUi(this);
21
22 QFont headerFont;
23 headerFont.setBold(true);
24
25 ui->LibrariesView->horizontalHeader()->setFont(headerFont);
26 ui->LibrariesView->installEventFilter(this);
27
28 enableSimulation(false);
29 }
30
31 ExperimentView::~ExperimentView()
32 {
33 delete ui;
34 }
35
36 void ExperimentView::on_InvocationsValue_editingFinished()
37 {
38 Q_EMIT Invocations_valueChanged(ui->InvocationsValue->value());
39 }
40
41 void ExperimentView::setInvocationsValue(int value)
42 {
43 ui->InvocationsValue->setValue(value);
44 }
45
46 void ExperimentView::on_SeedValue_editingFinished()
47 {
48 Q_EMIT Seed_valueChanged(ui->SeedValue->value());
49 }
50
51 void ExperimentView::on_Library_add_clicked()
52 {
53 Q_EMIT addLibrary();
54 }
55
56 void ExperimentView::on_Library_remove_clicked()
57 {
58 Q_EMIT removeLibrary(ui->LibrariesView->currentIndex().row());
59 }
60
61 void ExperimentView::on_LoggingGroup_add_clicked()
62 {
63 Q_EMIT addLoggingGroup();
64 }
65
66 void ExperimentView::on_LoggingGroup_remove_clicked()
67 {
68 Q_EMIT removeLoggingGroup(ui->LoggingGroupsView->currentIndex().row());
69 }
70
71 void ExperimentView::on_StartSimulation_clicked()
72 {
73 Q_EMIT startSimulation();
74 }
75
76 QListView * ExperimentView::getLoggingGroupsView() const
77 {
78 return ui->LoggingGroupsView;
79 }
80
81 QTableView * ExperimentView::getLibrariesView() const
82 {
83 return ui->LibrariesView;
84 }
85
86 void ExperimentView::setSeedValue(int value)
87 {
88 ui->SeedValue->setValue(value);
89 }
90
91 void ExperimentView::resizeEvent(QResizeEvent *event)
92 {
93 event->ignore();
94 Q_EMIT resized();
95 }
96
97 bool ExperimentView::eventFilter(QObject *watched, QEvent *event)
98 {
99 QTableView* table = qobject_cast<QTableView*> (watched);
100
101 if( table && event->type() == QEvent::Resize )
102 {
103 int cell = (table->width())/2;
104 table->setColumnWidth(0, cell);
105 }
106
107 return false;
108 }
109
110 void ExperimentView::enableSimulation(bool enable)
111 {
112 ui->StartSimulation->setEnabled(enable);
113 }
ExperimentView.h
This class provides an editor for configuring the experiment setup, i.e. it is filled with the conten...
ExperimentView::on_Library_remove_clicked
void on_Library_remove_clicked()
Qt Desinger-created slot activated when the remove-button in the Library section has been pressed...
Definition: ExperimentView.cpp:56
ExperimentView
This class provides an editor for configuring the experiment setup, i.e. it is filled with the conten...
Definition: ExperimentView.h:47
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
ExperimentView::setInvocationsValue
void setInvocationsValue(int value)
Method for setting the spinbox value for the number of invocations to the value passed as an argument...
Definition: ExperimentView.cpp:41
ExperimentView::addLoggingGroup
void addLoggingGroup()
Signal, emitted when the add-button in the logging groups section has been pressed by the user...
ExperimentView::on_InvocationsValue_editingFinished
void on_InvocationsValue_editingFinished()
Qt Desinger-created slot activated when the spinbox for the number of invocations has been edited...
Definition: ExperimentView.cpp:36
ExperimentView::on_Library_add_clicked
void on_Library_add_clicked()
Qt Desinger-created slot activated when the add-button in the Library section has been pressed...
Definition: ExperimentView.cpp:51
ExperimentView::on_LoggingGroup_remove_clicked
void on_LoggingGroup_remove_clicked()
Qt Desinger-created slot activated when the remove-button in the logging groups section has been pres...
Definition: ExperimentView.cpp:66
ExperimentView::on_StartSimulation_clicked
void on_StartSimulation_clicked()
Qt Desinger-created slot activated when the Start SImulation button has been clicked. Emits the startSimulation signal.
Definition: ExperimentView.cpp:71
ExperimentView::Seed_valueChanged
void Seed_valueChanged(int value)
Signal, emitted when the random seed value has been modified by the user.
ExperimentView::resized
void resized()
Signal, emitted when this view has been resized. Will be connected to the slot ExperimentBaseView::up...
ExperimentView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter. This filter catches the resize events of the table view (librar...
Definition: ExperimentView.cpp:97
ExperimentView::startSimulation
void startSimulation()
Signal, emitted when the user clicks the Start Simulation Button. Will trigger a status check of the ...
ExperimentView::Invocations_valueChanged
void Invocations_valueChanged(int value)
Signal, emitted when the number of invocations has been modified by the user.
ExperimentView::removeLibrary
void removeLibrary(int const &row)
Signal, emitted when the remove-button in the library section has been pressed by the user...
ExperimentView::enableSimulation
void enableSimulation(bool enable)
Method which enables the start simulation button.
Definition: ExperimentView.cpp:110
ExperimentView::removeLoggingGroup
void removeLoggingGroup(int const &row)
Signal, emitted when the remove-button in the logging groups section has been pressed by the user...
ExperimentView::on_SeedValue_editingFinished
void on_SeedValue_editingFinished()
Qt Desinger-created slot activated when the spinbox value for the random seed has been edited...
Definition: ExperimentView.cpp:46
ExperimentView::getLibrariesView
QTableView * getLibrariesView() const
Method which gives access to the QTableView instance holding the entries of the libraries map...
Definition: ExperimentView.cpp:81
ExperimentView::getLoggingGroupsView
QListView * getLoggingGroupsView() const
Method which gives access to the QListView instance listing the logging groups. Will be used by the p...
Definition: ExperimentView.cpp:76
ExperimentView::ui
Ui::ExperimentView * ui
the ui object containing the GUI elements of this editor
Definition: ExperimentView.h:209
ExperimentView::setSeedValue
void setSeedValue(int value)
Method for setting the spinbox value for the random seed to the value passed as an argument...
Definition: ExperimentView.cpp:86
ExperimentView::on_LoggingGroup_add_clicked
void on_LoggingGroup_add_clicked()
Qt Desinger-created slot activated when the add-button in the logging groups section has been pressed...
Definition: ExperimentView.cpp:61
ExperimentView::resizeEvent
void resizeEvent(QResizeEvent *event)
Reimplementation of the resize event. Will emit the signal resized when this view is resized...
Definition: ExperimentView.cpp:91
ExperimentView::addLibrary
void addLibrary()
Signal, emitted when the add-button in the library section has been pressed by the user...
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: FileBrowseView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
FileBrowseView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "FileBrowseView.h"
12 #include "ui_FileBrowseView.h"
13
14 #include <QFileDialog>
15
16 FileBrowseView::FileBrowseView(const ProjectInterface * const project, QWidget *parent)
17 : QWidget(parent)
18 , ui(new Ui::FileBrowseView)
19 , project(project)
20 {
21 ui->setupUi(this);
22 }
23
24 FileBrowseView::~FileBrowseView()
25 {
26 delete ui;
27 }
28
29
30 void FileBrowseView::setFile(QString const &file)
31 {
32 ui->File->setText(file);
33 }
34
35 QString FileBrowseView::getFile() const
36 {
37 return ui->File->text();
38 }
39
40 void FileBrowseView::on_Browse_clicked()
41 {
42 QString filename = QFileDialog::getOpenFileName(
43 this, QObject::tr("openPASS / Choose a library file"),
44 project->getLibraryPath(), QStringLiteral("Dynamic library file(*.dll)"));
45
46 // chop the .dll suffix
47 filename.chop(4);
48 ui->File->setText(project->getLibrary().relativeFilePath(filename));
49
50 Q_EMIT editingFinished(this);
51 }
Ui
Definition: EnvironmentDisplayView.h:29
ProjectInterface::getLibraryPath
virtual ProjectInterface::Library getLibraryPath() const =0
Gets the path of the directory containing the components library.
ProjectInterface::getLibrary
virtual QDir getLibrary() const =0
Gets the directory containing the components library.
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
ExperimentView::ui
Ui::ExperimentView * ui
the ui object containing the GUI elements of this editor
Definition: ExperimentView.h:209
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: FileBrowseView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
FileBrowseView.h
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #ifndef FILEBROWSEVIEW_H
12 #define FILEBROWSEVIEW_H
13
14
15 #include "openPASS-Project/ProjectInterface.h"
16
17 #include <QWidget>
18 #include <QString>
19 #include <QStyledItemDelegate>
20
21 namespace Ui{
22 class FileBrowseView;
23 }
24
25 class FileBrowseView : public QWidget
26 {
27 Q_OBJECT
28
29 public:
30 explicit FileBrowseView(ProjectInterface const * const project, QWidget *parent = nullptr);
31 ~FileBrowseView();
32
33 Q_SIGNALS:
34 void editingFinished(QWidget * editor);
35
36 private Q_SLOTS:
37 void on_Browse_clicked();
38
39 public:
40 void setFile(QString const &file);
41 QString getFile() const;
42
43 private:
44 Ui::FileBrowseView *ui;
45 ProjectInterface const * const project;
46 };
47
48 #endif // FILEBROWSEVIEW_H
Ui
Definition: EnvironmentDisplayView.h:29
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: LibrariesPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
LibrariesPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "LibrariesPresenter.h"
12
13 #include <QFileInfo>
14 #include <QBrush>
15
16 LibrariesPresenter::LibrariesPresenter(ExperimentInterface::Libraries * const libraries,
17 ProjectInterface * const project,
18 QObject *parent)
19 : QAbstractTableModel(parent)
20 , libraries(libraries)
21 , project(project)
22 {
23 _columnHeaders << "Library Type" << "Library Name";
24 }
25
26 int LibrariesPresenter::rowCount(const QModelIndex &parent) const
27 {
28 Q_UNUSED(parent);
29
30 return libraries->count();
31 }
32
33 int LibrariesPresenter::columnCount(const QModelIndex &parent) const
34 {
35 Q_UNUSED(parent);
36
37 return _columnHeaders.count();
38 }
39
40 QVariant LibrariesPresenter::headerData(int section,
41 Qt::Orientation orientation,
42 int role) const
43 {
44 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
45 return _columnHeaders.value(section);
46
47 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
48 return section + 1;
49
50 return QVariant();
51 }
52
53 QVariant LibrariesPresenter::data(const QModelIndex &index, int role) const
54 {
55 int row = index.row();
56 int col = index.column();
57
58 if(row >= libraries->count())
59 return QVariant::Invalid;
60
61 if(role == Qt::TextAlignmentRole)
62 return QVariant(Qt::AlignCenter);
63
64
65 if(role == Qt::TextColorRole)
66 {
67 if(col ==1)
68 {
69 QString lib = libraries->value(RowToLibType[row]);
70
71 if(!QFileInfo::exists(project->getLibrary().absoluteFilePath(lib + QString(".dll"))) && !lib.isEmpty())
72 return QBrush(Qt::red);
73 else {
74 return QBrush(Qt::black);
75 }
76 }
77 }
78
79
80 if(role == Qt::DisplayRole || role == Qt::EditRole)
81 {
82 if( col == 0)
83 return QVariant(RowToLibType.value(row));
84 else if(col == 1)
85 {
86 QString lib = libraries->value(RowToLibType[row]);
87
88 if(!QFileInfo::exists(project->getLibrary().absoluteFilePath(lib + QString(".dll"))) && !lib.isEmpty())
89 return QString("%1 (not existing!)").arg(lib);
90
91 else
92 return lib;
93 }
94 }
95
96 return QVariant();
97 }
98
99
100 bool LibrariesPresenter::setData(const QModelIndex &index,
101 const QVariant &value,
102 int role)
103 {
104 int row = index.row();
105 int col = index.column();
106
107 if(role == Qt::EditRole)
108 {
109 if(col == 0 && !libraries->contains(value.toString()))
110 {
111 libraries->insert( value.toString(), libraries->take(RowToLibType[row]) );
112 RowToLibType[row] = value.toString();
113 Q_EMIT dataChanged(index, index);
114 return true;
115 }
116 else if(col == 1)
117 {
118 (*libraries)[RowToLibType[row]] = value.toString();
119 Q_EMIT dataChanged(index, index);
120 return true;
121 }
122 }
123
124 return false;
125 }
126
127 Qt::ItemFlags LibrariesPresenter::flags(const QModelIndex &index) const
128 {
129 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
130 }
131
132 void LibrariesPresenter::addRow(const int &row, QString libType)
133 {
134 // shift all row indices,starting from given row, up
135 for(auto _row= RowToLibType.size()-1; _row>=row; _row--)
136 RowToLibType.insert(_row + 1, RowToLibType.take(_row));
137
138 beginInsertRows(QModelIndex(), row, row);
139
140 RowToLibType.insert(row, libType);
141 libraries->insert(libType, "");
142
143 endInsertRows();
144 }
145
146 bool LibrariesPresenter::removeRow(const int &row)
147 {
148 if(RowToLibType.contains(row))
149 {
150 beginRemoveRows(QModelIndex(), row, row);
151 libraries->take(RowToLibType[row]);
152 RowToLibType.take(row);
153
154 for(int i =row+1; i<=RowToLibType.count() ; i++)
155 RowToLibType.insert(i-1, RowToLibType.take(i));
156
157 endRemoveRows();
158 return true;
159 }
160
161 return false;
162 }
163
164 void LibrariesPresenter::update()
165 {
166 int rows = 0;
167
168 beginResetModel();
169 endResetModel();
170 RowToLibType.clear();
171
172 for(auto key : libraries->keys())
173 {
174 RowToLibType.insert(rows, key);
175 rows++;
176 }
177 }
ExperimentInterface::Libraries
QMap< QString, QString > Libraries
The map of libraries needed by the simulation slave.
Definition: ExperimentInterface.h:47
LibrariesPresenter::setData
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: LibrariesPresenter.cpp:100
LibrariesPresenter::project
ProjectInterface *const project
a pointer to the project plugin (gives access to file system)
Definition: LibrariesPresenter.h:160
LibrariesPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: LibrariesPresenter.cpp:40
ProjectInterface::getLibrary
virtual QDir getLibrary() const =0
Gets the directory containing the components library.
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
LibrariesPresenter::addRow
void addRow(const int &row, QString libType)
Method that adds a new row, i.e. a new library to of the given type.
Definition: LibrariesPresenter.cpp:132
LibrariesPresenter.h
This class describes the presenter object of the map of included libraries.
LibrariesPresenter::libraries
ExperimentInterface::Libraries *const libraries
the map of libraries
Definition: LibrariesPresenter.h:159
LibrariesPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: LibrariesPresenter.cpp:26
LibrariesPresenter::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable.
Definition: LibrariesPresenter.cpp:127
LibrariesPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: LibrariesPresenter.cpp:33
LibrariesPresenter::_columnHeaders
QStringList _columnHeaders
a map translating row indices to library types
Definition: LibrariesPresenter.h:162
LibrariesPresenter::update
void update()
Method which updates the table according to the current entries of libraries.
Definition: LibrariesPresenter.cpp:164
LibrariesPresenter::removeRow
bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful range...
Definition: LibrariesPresenter.cpp:146
LibrariesPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: LibrariesPresenter.cpp:53
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: LoggingGroupsPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
LoggingGroupsPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "LoggingGroupsPresenter.h"
12
13 LoggingGroupsPresenter::LoggingGroupsPresenter(ExperimentInterface::LoggingGroups * const loggingGroups,
14 QObject *parent)
15 : QAbstractListModel(parent)
16 , loggingGroups(loggingGroups)
17 {
18 }
19
20 int LoggingGroupsPresenter::rowCount(const QModelIndex &parent) const
21 {
22 // For list models only the root node (an invalid parent) should return the list's size. For all
23 // other (valid) parents, rowCount() should return 0 so that it does not become a tree model.
24 if (parent.isValid())
25 return 0;
26
27 return loggingGroups->count();
28 }
29
30 QVariant LoggingGroupsPresenter::data(const QModelIndex &index, int role) const
31 {
32 if (!index.isValid())
33 return QVariant::Invalid;
34
35 if(role == Qt::TextAlignmentRole)
36 return QVariant(Qt::AlignCenter);
37
38 if( role == Qt::DisplayRole || role == Qt::EditRole )
39 return QVariant(loggingGroups->at(index.row()));
40
41 return QVariant();
42 }
43
44 bool LoggingGroupsPresenter::setData(const QModelIndex &index, const QVariant &value, int role)
45 {
46 if (data(index, role) != value && role == Qt::EditRole)
47 {
48 if(!loggingGroups->contains(value.toString()))
49 (*loggingGroups)[index.row()] = value.toString();
50
51 Q_EMIT dataChanged(index, index, QVector<int>() << role);
52 return true;
53 }
54 return false;
55 }
56
57 Qt::ItemFlags LoggingGroupsPresenter::flags(const QModelIndex &index) const
58 {
59 return Qt::ItemIsEditable | QAbstractListModel::flags(index);
60 }
61
62 void LoggingGroupsPresenter::insertRow(int row, QString item, const QModelIndex &parent)
63 {
64 beginInsertRows(parent, row, row );
65
66 loggingGroups->insert(row, item);
67
68 endInsertRows();
69 }
70
71 void LoggingGroupsPresenter::removeRow(int row, const QModelIndex &parent)
72 {
73 beginRemoveRows(parent, row, row);
74
75 loggingGroups->removeAt(row);
76
77 endRemoveRows();
78 }
79
80
81 void LoggingGroupsPresenter::update()
82 {
83 beginResetModel();
84 endResetModel();
85 }
LoggingGroupsPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the model referenced by the given ind...
Definition: LoggingGroupsPresenter.cpp:30
LoggingGroupsPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of items in the logging groups list...
Definition: LoggingGroupsPresenter.cpp:20
ExperimentInterface::LoggingGroups
QStringList LoggingGroups
The list of logging groups.
Definition: ExperimentInterface.h:48
LoggingGroupsPresenter::insertRow
virtual void insertRow(int row, QString item, const QModelIndex &parent=QModelIndex())
Method that adds a new logging group to the list at the given row index.
Definition: LoggingGroupsPresenter.cpp:62
LoggingGroupsPresenter::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable.
Definition: LoggingGroupsPresenter.cpp:57
LoggingGroupsPresenter::loggingGroups
ExperimentInterface::LoggingGroups *const loggingGroups
the string list of logging groups
Definition: LoggingGroupsPresenter.h:125
LoggingGroupsPresenter::removeRow
virtual void removeRow(int row, const QModelIndex &parent=QModelIndex())
Method that removes the logging group at the given index from the list.
Definition: LoggingGroupsPresenter.cpp:71
LoggingGroupsPresenter::update
void update()
Method which updates the list according to the current entries of loggingGroups.
Definition: LoggingGroupsPresenter.cpp:81
LoggingGroupsPresenter::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the row referenced by the given index...
Definition: LoggingGroupsPresenter.cpp:44
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: LoggingGroupsPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
LoggingGroupsPresenter.h
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
26
27 #ifndef LOGGINGGROUPSPRESENTER_H
28 #define LOGGINGGROUPSPRESENTER_H
29
30 #include "openPASS-TrafficSimulation/ExperimentInterface.h"
31
32 #include <QAbstractListModel>
33
34 //-----------------------------------------------------------------------------
46 //-----------------------------------------------------------------------------
47 class LoggingGroupsPresenter : public QAbstractListModel
48 {
49 Q_OBJECT
50
51 public:
52 explicit LoggingGroupsPresenter(ExperimentInterface::LoggingGroups * const loggingGroups,
53 QObject *parent = 0);
54
55 public:
56 //-----------------------------------------------------------------------------
64 //-----------------------------------------------------------------------------
65 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
66
67 public:
68 //-----------------------------------------------------------------------------
76 //-----------------------------------------------------------------------------
77 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
78
79 //-----------------------------------------------------------------------------
88 //-----------------------------------------------------------------------------
89 bool setData(const QModelIndex &index, const QVariant &value,
90 int role = Qt::EditRole) override;
91
92 //-----------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------
100 Qt::ItemFlags flags(const QModelIndex& index) const override;
101
102 public:
103 //-----------------------------------------------------------------------------
108 //-----------------------------------------------------------------------------
109 virtual void insertRow(int row, QString item, const QModelIndex &parent = QModelIndex()) ;
110
111 //-----------------------------------------------------------------------------
115 //-----------------------------------------------------------------------------
116 virtual void removeRow(int row, const QModelIndex &parent = QModelIndex()) ;
117
118 //-----------------------------------------------------------------------------
121 //-----------------------------------------------------------------------------
122 void update();
123
124 private:
125 ExperimentInterface::LoggingGroups * const loggingGroups;
126 };
127
128 #endif // LOGGINGGROUPSPRESENTER_H
LoggingGroupsPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the model referenced by the given ind...
Definition: LoggingGroupsPresenter.cpp:30
LoggingGroupsPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of items in the logging groups list...
Definition: LoggingGroupsPresenter.cpp:20
LoggingGroupsPresenter
This class describes the presenter object of the list of logging groups.
Definition: LoggingGroupsPresenter.h:47
ExperimentInterface::LoggingGroups
QStringList LoggingGroups
The list of logging groups.
Definition: ExperimentInterface.h:48
LoggingGroupsPresenter::insertRow
virtual void insertRow(int row, QString item, const QModelIndex &parent=QModelIndex())
Method that adds a new logging group to the list at the given row index.
Definition: LoggingGroupsPresenter.cpp:62
LoggingGroupsPresenter::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable.
Definition: LoggingGroupsPresenter.cpp:57
LoggingGroupsPresenter::loggingGroups
ExperimentInterface::LoggingGroups *const loggingGroups
the string list of logging groups
Definition: LoggingGroupsPresenter.h:125
LoggingGroupsPresenter::removeRow
virtual void removeRow(int row, const QModelIndex &parent=QModelIndex())
Method that removes the logging group at the given index from the list.
Definition: LoggingGroupsPresenter.cpp:71
LoggingGroupsPresenter::update
void update()
Method which updates the list according to the current entries of loggingGroups.
Definition: LoggingGroupsPresenter.cpp:81
ExperimentInterface.h
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
LoggingGroupsPresenter::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the row referenced by the given index...
Definition: LoggingGroupsPresenter.cpp:44
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: WidgetView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
OLD/openPASS-GUI/openPASS-System/Views/WidgetView.cpp
1 #include "Views/WidgetView.h"
2
3 #include <QPainter>
4 #include <QPaintEvent>
5 #include <QStyleOption>
6
7 WidgetView::WidgetView(QWidget * const parent)
8 : QWidget(parent)
9 {
10 }
11
12 void WidgetView::paintEvent(QPaintEvent *)
13 {
14 QStyleOption styleOption;
15 styleOption.init(this);
16 QPainter painter(this);
17 style()->drawPrimitive(QStyle::PE_Widget, &styleOption, &painter, this);
18 }
WidgetView::WidgetView
WidgetView(QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument.
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp:17
WidgetView::paintEvent
virtual void paintEvent(QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp:22
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: WidgetView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
OLD/openPASS-GUI/openPASS-System/Views/WidgetView.h
1 #ifndef WIDGETVIEW_H
2 #define WIDGETVIEW_H
3
4 #include <QWidget>
5
6 class QPaintEvent;
7
8 class WidgetView : public QWidget
9 {
10 Q_OBJECT
11
12 public:
13 explicit WidgetView(QWidget * const parent = nullptr);
14 virtual ~WidgetView() = default;
15
16 protected:
17 virtual void paintEvent(QPaintEvent * event) override;
18 };
19
20 #endif // WIDGETVIEW_H
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
WidgetView::WidgetView
WidgetView(QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument.
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp:17
WidgetView::paintEvent
virtual void paintEvent(QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp:22
WidgetView::~WidgetView
virtual ~WidgetView()=default
Default destructor.
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: WidgetView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
OpenPass_Source_Code/openPASS_GUI/openPASS-AgentConfiguration/Views/WidgetView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "Views/WidgetView.h"
12
13 #include <QPainter>
14 #include <QPaintEvent>
15 #include <QStyleOption>
16
17 WidgetView::WidgetView(QWidget * const parent)
18 : QWidget(parent)
19 {
20 }
21
22 void WidgetView::paintEvent(QPaintEvent *)
23 {
24 QStyleOption styleOption;
25 styleOption.init(this);
26 QPainter painter(this);
27 style()->drawPrimitive(QStyle::PE_Widget, &styleOption, &painter, this);
28 }
WidgetView::WidgetView
WidgetView(QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument.
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp:17
WidgetView::paintEvent
virtual void paintEvent(QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp:22
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: WidgetView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
OpenPass_Source_Code/openPASS_GUI/openPASS-AgentConfiguration/Views/WidgetView.h
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17
18 #ifndef WIDGETVIEW_H
19 #define WIDGETVIEW_H
20
21 #include <QWidget>
22
23 class QPaintEvent;
24
25 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
29 class WidgetView : public QWidget
30 {
31 Q_OBJECT
32
33 public:
34 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
39 explicit WidgetView(QWidget * const parent = nullptr);
40
41 //-----------------------------------------------------------------------------
43 //-----------------------------------------------------------------------------
44 virtual ~WidgetView() = default;
45
46 protected:
47 //-----------------------------------------------------------------------------
49 //-----------------------------------------------------------------------------
50 virtual void paintEvent(QPaintEvent * event) override;
51 };
52
53 #endif // WIDGETVIEW_H
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
WidgetView::WidgetView
WidgetView(QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument.
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp:17
WidgetView::paintEvent
virtual void paintEvent(QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp:22
WidgetView::~WidgetView
virtual ~WidgetView()=default
Default destructor.
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: WidgetView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "Views/WidgetView.h"
12
13 #include <QPainter>
14 #include <QPaintEvent>
15 #include <QStyleOption>
16
17 WidgetView::WidgetView(QWidget * const parent)
18 : QWidget(parent)
19 {
20 }
21
22 void WidgetView::paintEvent(QPaintEvent *)
23 {
24 QStyleOption styleOption;
25 styleOption.init(this);
26 QPainter painter(this);
27 style()->drawPrimitive(QStyle::PE_Widget, &styleOption, &painter, this);
28 }
WidgetView::WidgetView
WidgetView(QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument.
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp:17
WidgetView::paintEvent
virtual void paintEvent(QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp:22
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: WidgetView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17
18 #ifndef WIDGETVIEW_H
19 #define WIDGETVIEW_H
20
21 #include <QWidget>
22
23 class QPaintEvent;
24
25 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
29 class WidgetView : public QWidget
30 {
31 Q_OBJECT
32
33 public:
34 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
39 explicit WidgetView(QWidget * const parent = nullptr);
40
41 //-----------------------------------------------------------------------------
43 //-----------------------------------------------------------------------------
44 virtual ~WidgetView() = default;
45
46 protected:
47 //-----------------------------------------------------------------------------
49 //-----------------------------------------------------------------------------
50 virtual void paintEvent(QPaintEvent * event) override;
51 };
52
53 #endif // WIDGETVIEW_H
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
WidgetView::WidgetView
WidgetView(QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument.
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp:17
WidgetView::paintEvent
virtual void paintEvent(QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp:22
WidgetView::~WidgetView
virtual ~WidgetView()=default
Default destructor.
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterItemModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
ParameterItemModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "openPASS-AgentConfiguration/ParameterMapInterface.h"
12 #include "ParameterItemModel.h"
13
14 ParameterItemInterface::Type ParameterItemModel::default_type = QString("Double");
15 ParameterItemInterface::Key ParameterItemModel::default_key = QString("parameter");
16 ParameterItemInterface::Value ParameterItemModel::default_value = QString("0.0");
17 ParameterItemInterface::Value ParameterItemModel::default_unit = QString("");
18
19 ParameterItemModel::ParameterItemModel(QObject *parent)
20 : ParameterItemInterface(parent)
21 , type(default_type)
22 , key(default_key)
23 , value(default_value)
24 , unit(default_unit)
25 {
26
27 }
28
29 ParameterItemModel::ParameterItemModel(ParameterItemInterface const * const parameter, QObject *parent)
30 : ParameterItemInterface(parent)
31 , type(parameter->getType())
32 , key(parameter->getKey())
33 , value(parameter->getValue())
34 , unit(parameter->getUnit())
35 {
36
37 }
38
39 ParameterItemInterface::ID ParameterItemModel::getID() const
40 {
41 ParameterMapInterface const * const map = qobject_cast<ParameterMapInterface const * const > ( parent() );
42
43 return ( (map) ? map->getID( const_cast<ParameterItemModel *> (this) ) : ParameterItemInterface::ID() );
44 }
45
46 ParameterItemInterface::Type ParameterItemModel::getType() const
47 {
48 return type;
49 }
50
51 void ParameterItemModel::setType(ParameterItemInterface::Type const &_type)
52 {
53 type = _type;
54 }
55
56 ParameterItemInterface::Key ParameterItemModel::getKey() const
57 {
58 return key;
59 }
60
61 void ParameterItemModel::setKey(ParameterItemInterface::Key const &_key)
62 {
63 key = _key;
64 }
65
66 ParameterItemInterface::Value ParameterItemModel::getValue() const
67 {
68 return value;
69 }
70
71 void ParameterItemModel::setValue(ParameterItemInterface::Value const &_value)
72 {
73 value = _value;
74 }
75
76 ParameterItemInterface::Unit ParameterItemModel::getUnit() const
77 {
78 return unit;
79 }
80
81 void ParameterItemModel::setUnit(ParameterItemInterface::Value const &_unit)
82 {
83 unit = _unit;
84 }
ParameterItemModel::setUnit
virtual void setUnit(Value const &_unit) override
Method which sets the unit of this parameter to the given one.
Definition: ParameterItemModel.cpp:81
ParameterItemInterface::Key
QString Key
typedef for the key description
Definition: ParameterItemInterface.h:47
ParameterItemInterface::Value
QString Value
typedef for the parameter&#39;s value
Definition: ParameterItemInterface.h:48
ParameterMapInterface.h
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
ParameterItemModel::setValue
virtual void setValue(Value const &_value) override
Method which sets the value of this parameter to the given one.
Definition: ParameterItemModel.cpp:71
ParameterItemModel::getValue
virtual Value getValue() const override
Method which returns the value of this parameter.
Definition: ParameterItemModel.cpp:66
ParameterItemModel::unit
Unit unit
the string object for the parameter&#39;s unit
Definition: ParameterItemModel.h:59
ParameterItemModel::getUnit
virtual Unit getUnit() const override
Method which returns the unit of this parameter.
Definition: ParameterItemModel.cpp:76
ParameterItemModel::getType
virtual Type getType() const override
Method which returns the datatype of this parameter.
Definition: ParameterItemModel.cpp:46
ParameterItemModel::default_key
static Key default_key
the default key desription
Definition: ParameterItemModel.h:63
ParameterItemInterface::Unit
QString Unit
typedef for the parameter&#39;s unit
Definition: ParameterItemInterface.h:49
ParameterItemModel::default_type
static Type default_type
the default datatype
Definition: ParameterItemModel.h:62
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
ParameterItemInterface::ID
unsigned int ID
typedef for the parameters id (when registered in a map)
Definition: ParameterItemInterface.h:45
ParameterItemModel::key
Key key
the string object for the parameter&#39;s description
Definition: ParameterItemModel.h:57
ParameterItemModel::type
Type type
the string object for the parameter&#39;s datatype
Definition: ParameterItemModel.h:56
ParameterItemInterface::Type
QString Type
typedef for the data type
Definition: ParameterItemInterface.h:46
ParameterItemModel::getID
virtual ID getID() const override
Method which returns the Id of this parameter if this parameter is registered in a map (ParameterMapI...
Definition: ParameterItemModel.cpp:39
ParameterMapInterface::getID
virtual ParameterMapInterface::ID getID(ParameterMapInterface::Item *const item) const =0
Method wich returns the id of the given parameter, if contained in the map. Otherwise an empty id is ...
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
ParameterItemModel.h
This class implements the functionality of ParameterItemInterface.
ParameterItemModel::default_value
static Value default_value
the default value
Definition: ParameterItemModel.h:64
ParameterItemModel::getKey
virtual Key getKey() const override
Method which returns the key description of this parameter.
Definition: ParameterItemModel.cpp:56
ParameterItemModel::setKey
virtual void setKey(Key const &_key) override
Method which sets the key description of this parameter to the given one.
Definition: ParameterItemModel.cpp:61
ParameterItemModel::setType
virtual void setType(Type const &_type) override
Method which sets the datatype of this parameter to the given type.
Definition: ParameterItemModel.cpp:51
ParameterItemModel::default_unit
static Unit default_unit
the default unit
Definition: ParameterItemModel.h:65
ParameterItemModel::value
Value value
the parameter&#39;s value. Taken as a string in order to make it independent its datatype ...
Definition: ParameterItemModel.h:58
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterItemPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
ParameterItemPresenter.cpp
1 #include "ParameterItemPresenter.h"
2
3 ParameterItemPresenter::ParameterItemPresenter(ParameterItemInterface *parameter,
4 ParameterItemView *parameterView,
5 QObject *parent)
6 : QObject(parent)
7 , parameter(parameter)
8 , parameterView(parameterView)
9 {
10 connect(parameterView, &ParameterItemView::valueChanged, this, &ParameterItemPresenter::setValue);
11 }
12
13 void ParameterItemPresenter::setValue(const QString &value)
14 {
15 parameter->setValue(value);
16 }
17
18
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterItemPresenter.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
ParameterItemPresenter.h
1 #ifndef PARAMETERITEMPRESENTER_H
2 #define PARAMETERITEMPRESENTER_H
3
4 #include "openPASS-AgentConfiguration/ParameterItemInterface.h"
5 #include "Views/ParameterItemView.h"
6
7 #include <QObject>
8
9 class ParameterItemPresenter : public QObject
10 {
11 Q_OBJECT
12
13 public:
14 explicit ParameterItemPresenter(ParameterItemInterface * parameter,
15 ParameterItemView * parameterView,
16 QObject *parent = 0);
17
18 private Q_SLOTS:
19 void setValue(QString const & value);
20
21 private:
22 ParameterItemInterface * parameter;
23 ParameterItemView * parameterView;
24 };
25
26 #endif // PARAMETERITEMPRESENTER_H
ParameterItemInterface.h
This class defines parameters.
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterItemView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
ParameterItemView.cpp
1 #include "ParameterItemView.h"
2 #include "ui_ParameterItemView.h"
3
4 #include <QDoubleSpinBox>
5 #include <QSpinBox>
6 #include <QString>
7 #include <QCheckBox>
8 #include <QLineEdit>
9
10 #include <QtMath>
11
12 ParameterItemView::ParameterItemView(QString key,
13 QString type,
14 QString value,
15 QString unit,
16 QWidget *parent) :
17 QWidget(parent),
18 ui(new Ui::ParameterItemView)
19 {
20 ui->setupUi(this);
21
22 setLocale(QLocale::C);
23
24 // determine the visualisation depending on the given data type
25 if( type == "Double" )
26 {
27 QDoubleSpinBox * spinbox = new QDoubleSpinBox(this);
28 spinbox->setMinimumSize(0,20);
29 spinbox->setMaximumSize(64, 20);
30 spinbox->setDecimals(3);
31 spinbox->setSingleStep(pow(10,adjustStepSize(value.toDouble() )));
32 spinbox->setValue(value.toDouble());
33 ui->formLayout->setWidget(0, QFormLayout::FieldRole, spinbox);
34
35 connect(spinbox, static_cast<void (QDoubleSpinBox::*)(QString const &)>(&QDoubleSpinBox::valueChanged),
36 this, &ParameterItemView::valueChanged);
37 }
38 else if( type == "Float" )
39 {
40 QDoubleSpinBox * spinbox = new QDoubleSpinBox(this);
41 spinbox->setMinimumSize(0,20);
42 spinbox->setMaximumSize(64, 20);
43 spinbox->setDecimals(3);
44 spinbox->setSingleStep(pow(10,adjustStepSize(value.toFloat() )));
45 spinbox->setValue(value.toFloat());
46 ui->formLayout->setWidget(0, QFormLayout::FieldRole, spinbox);
47
48 connect(spinbox, static_cast<void (QDoubleSpinBox::*)(QString const &)>(&QDoubleSpinBox::valueChanged),
49 this, &ParameterItemView::valueChanged);
50 }
51
52 else if( type == "Bool")
53 {
54 QCheckBox *checkbox = new QCheckBox(this);
55 checkbox->setChecked( value=="true" ? true : false);
56 ui->formLayout->setWidget(0, QFormLayout::FieldRole, checkbox);
57
58 connect(checkbox, &QCheckBox::toggled, this, &ParameterItemView::toggled);
59
60 }
61 else if( type == "Int" )
62 {
63 QSpinBox *spinbox = new QSpinBox(this);
64 spinbox->setMinimumSize(0, 20);
65 spinbox->setMaximumSize(64, 20);
66 spinbox->setValue(value.toInt());
67 ui->formLayout->setWidget(0, QFormLayout::FieldRole, spinbox);
68
69 connect(spinbox, static_cast<void (QSpinBox::*)(QString const &)>(&QSpinBox::valueChanged),
70 this, &ParameterItemView::valueChanged);
71
72 }
73 else if(type == "String")
74 {
75 QLineEdit *lineedit = new QLineEdit(this);
76 lineedit->setMinimumSize(0, 20);
77 lineedit->setText(value);
78 ui->formLayout->setWidget(0, QFormLayout::FieldRole, lineedit);
79
80 // NOTE: this is only temporal. So far only one driver model exists with a fixed string parameter
81 lineedit->setReadOnly(true);
82
83 connect(lineedit, &QLineEdit::textChanged, this, &ParameterItemView::valueChanged);
84 }
85
86 if(!unit.isEmpty())
87 ui->Key->setText( QString("%1 [%2]:").arg(key).arg(unit) );
88 else
89 ui->Key->setText( QString("%1:").arg(key));
90
91 }
92
93 void ParameterItemView::toggled(bool checked)
94 {
95 Q_EMIT valueChanged( checked ? QString("true") : QString("false") );
96 }
97
98 int ParameterItemView::adjustStepSize(double value)
99 {
100 // Determine the number of decimals (with 3 max) in the value
101 int i= 0;
102 value = (value - qFloor(value)) * 10;
103 while (value != 0 && i>-3)
104 {
105 value = (value - qFloor(value)) * 10;
106 i -= 1;
107 }
108 return i;
109 }
110
111 ParameterItemView::~ParameterItemView()
112 {
113 delete ui;
114 }
Ui
Definition: EnvironmentDisplayView.h:29
ParameterItemModel::unit
Unit unit
the string object for the parameter&#39;s unit
Definition: ParameterItemModel.h:59
ParameterItemModel::key
Key key
the string object for the parameter&#39;s description
Definition: ParameterItemModel.h:57
ParameterItemModel::type
Type type
the string object for the parameter&#39;s datatype
Definition: ParameterItemModel.h:56
ParameterItemModel::value
Value value
the parameter&#39;s value. Taken as a string in order to make it independent its datatype ...
Definition: ParameterItemModel.h:58
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterItemView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
ParameterItemView.h
1 #ifndef PARAMETERITEMVIEW_H
2 #define PARAMETERITEMVIEW_H
3
4 #include <QWidget>
5
6 namespace Ui {
7 class ParameterItemView;
8 }
9
10 class ParameterItemView : public QWidget
11 {
12 Q_OBJECT
13
14 public:
15 explicit ParameterItemView(QString key,
16 QString type,
17 QString value,
18 QString unit,
19 QWidget *parent = 0);
20 ~ParameterItemView();
21
22 Q_SIGNALS:
23 void valueChanged(QString const &value);
24
25 private Q_SLOTS:
26 void toggled(bool checked);
27
28 private:
29 int adjustStepSize(double value);
30
31 private:
32 Ui::ParameterItemView *ui;
33 };
34
35 #endif // PARAMETERITEMVIEW_H
Ui
Definition: EnvironmentDisplayView.h:29
Generated on Wed Feb 19 2020 14:58:10 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterMapModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
ParameterMapModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "ParameterMapModel.h"
12
13 #include "ParameterItemModel.h"
14
15 ParameterMapModel::ParameterMapModel(QObject *parent)
16 : ParameterMapInterface(parent)
17 {
18
19 }
20
21 ParameterMapInterface::Iterator ParameterMapModel::begin()
22 {
23 return parameters.begin();
24 }
25
26 ParameterMapInterface::ConstIterator ParameterMapModel::constBegin() const
27 {
28 return parameters.constBegin();
29 }
30
31 ParameterMapInterface::Iterator ParameterMapModel::end()
32 {
33 return parameters.end();
34 }
35
36 ParameterMapInterface::ConstIterator ParameterMapModel::constEnd() const
37 {
38 return parameters.constEnd();
39 }
40
41
42 bool ParameterMapModel::add(const ParameterMapInterface::ID &id)
43 {
44 if(!contains(id))
45 {
46 parameters.insert(id, new ParameterItemModel(this));
47 return true;
48 }
49
50 return false;
51 }
52
53 bool ParameterMapModel::add(ParameterMapInterface::Item * const item)
54 {
55 ParameterMapInterface::ID id = generateID();
56
57 if(!contains(id))
58 {
59 parameters.insert(id, item);
60 item->setParent(this);
61 return true;
62 }
63
64 return false;
65 }
66
67 bool ParameterMapModel::add(const ParameterMapInterface::ID &id, ParameterMapInterface::Item const * const item)
68 {
69 if(!contains(id))
70 {
71 parameters.insert(id, new ParameterItemModel(item, this));
72 return true;
73 }
74
75 return false;
76 }
77
78 bool ParameterMapModel::remove(const ParameterMapInterface::ID &id)
79 {
80 if(contains(id))
81 {
82 delete parameters.take(id);
83 return true;
84 }
85
86 return false;
87 }
88
89
90 bool ParameterMapModel::remove(ParameterMapInterface::Item * const item)
91 {
92
93 if(parameters.values().contains(item) )
94 {
95 ParameterItemInterface::ID id = getID(item);
96 delete parameters.take(id);
97 return true;
98 }
99
100 return false;
101 }
102
103 ParameterMapInterface::Item * ParameterMapModel::getItem(ParameterMapInterface::ID const & id) const
104 {
105 if(contains(id))
106 return parameters.value(id);
107
108 return nullptr;
109 }
110
111
112 ParameterMapInterface::ID ParameterMapModel::getID(Item * const item) const
113 {
114 return parameters.key(item);
115 }
116
117 void ParameterMapModel::setID(Item * const item,
118 ParameterMapInterface::ID const &id)
119 {
120
121 ParameterMapInterface::ID oldID = getID(item);
122
123 parameters.take(oldID);
124 parameters.insert(id, item);
125 }
126
127 ParameterMapInterface::ID ParameterMapModel::generateID()
128 {
129 ParameterMapInterface::ID id = 1;
130 for (ParameterMapInterface::ID key : parameters.keys())
131 {
132 if (id <= key)
133 {
134 id = key + 1;
135 }
136 }
137 return id;
138 }
139
140 bool ParameterMapModel::contains(const ParameterMapInterface::ID &id) const
141 {
142 return parameters.contains(id);
143 }
144
145 QList<ParameterMapInterface::ID> ParameterMapModel::keys() const
146 {
147 return parameters.keys();
148 }
149
150 QList <ParameterItemInterface*> ParameterMapModel::values() const
151 {
152 return parameters.values();
153 }
154
155 int ParameterMapModel::count() const
156 {
157 return parameters.count();
158 }
159
160 void ParameterMapModel::clear()
161 {
162 qDeleteAll(parameters);
163 parameters.clear();
164 }
ParameterItemModel
This class implements the functionality of ParameterItemInterface.
Definition: ParameterItemModel.h:25
ParameterMapModel::constEnd
virtual ParameterMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last parameter (use for read-only)...
Definition: ParameterMapModel.cpp:36
ParameterMapModel::clear
virtual void clear() override
Method which deletes all registered parameters and clears the map.
Definition: ParameterMapModel.cpp:160
ParameterMapModel.h
This class implements the functionality of ParameterMapInterface.
ParameterMapModel::count
virtual int count() const override
Method which returns the number of parameter in the map.
Definition: ParameterMapModel.cpp:155
ParameterMapModel::contains
virtual bool contains(ParameterMapInterface::ID const &id) const override
Method wich checks whether the map contains a parameter of the given id.
Definition: ParameterMapModel.cpp:140
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
ParameterItemInterface::ID
unsigned int ID
typedef for the parameters id (when registered in a map)
Definition: ParameterItemInterface.h:45
ParameterMapInterface::ConstIterator
Map::ConstIterator ConstIterator
typedef for a constant iterator (read-only operations)
Definition: ParameterMapInterface.h:48
ParameterMapModel::end
virtual ParameterMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last parameter.
Definition: ParameterMapModel.cpp:31
ParameterMapModel::begin
virtual ParameterMapInterface::Iterator begin() override
Gets an iterator pointing to the first parameter in the map.
Definition: ParameterMapModel.cpp:21
ParameterMapInterface::Iterator
Map::Iterator Iterator
typedef for an iterator
Definition: ParameterMapInterface.h:47
ParameterMapModel::keys
virtual QList< ID > keys() const override
Method which returns the list of all ids used in the map.
Definition: ParameterMapModel.cpp:145
ParameterMapModel::generateID
virtual ParameterMapInterface::ID generateID() override
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
Definition: ParameterMapModel.cpp:127
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
ParameterItemModel.h
This class implements the functionality of ParameterItemInterface.
ParameterMapModel::getID
virtual ParameterMapInterface::ID getID(ParameterMapInterface::Item *const item) const override
Method wich returns the id of the given parameter, if contained in the map. Otherwise an empty id is ...
Definition: ParameterMapModel.cpp:112
ParameterMapModel::values
virtual QList< Item * > values() const override
Method which returns the list of all parameters registered in this map.
Definition: ParameterMapModel.cpp:150
ParameterMapModel::setID
virtual void setID(ParameterMapInterface::Item *const item, ParameterMapInterface::ID const &id) override
Method wich changes the id of the given parameter to the one passed as second argument.
Definition: ParameterMapModel.cpp:117
ParameterMapInterface::ID
ParameterItemInterface::ID ID
typedef for the id of a parameter
Definition: ParameterMapInterface.h:42
ParameterMapModel::add
virtual bool add(ParameterMapInterface::ID const &id) override
Method which creates a parameter (instance of ParameterItemInterface) and adds it to the map under th...
Definition: ParameterMapModel.cpp:42
ParameterMapModel::remove
virtual bool remove(ParameterMapInterface::ID const &id) override
Method which removes the parameter with the given id from the map. The parameter is deleted after rem...
Definition: ParameterMapModel.cpp:78
ParameterMapModel::constBegin
virtual ParameterMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first parameter in the map (use for read-only since pointing at cons...
Definition: ParameterMapModel.cpp:26
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterMapPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
ParameterMapPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "ParameterMapPresenter.h"
12
13 ParameterMapPresenter::ParameterMapPresenter(ParameterMapInterface *parameters,
14 QObject *parent)
15 : QAbstractTableModel(parent)
16 , parameters(parameters)
17 {
18 _columnHeaders << "Type" << "Key" << "Unit" << "Value";
19 }
20
21 QVariant ParameterMapPresenter::headerData(int section, Qt::Orientation orientation, int role) const
22 {
23 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
24 return _columnHeaders.value(section);
25
26 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
27 return section + 1;
28
29 return QVariant();
30 }
31
32 int ParameterMapPresenter::rowCount(const QModelIndex &parent) const
33 {
34 Q_UNUSED(parent)
35
36 if(parameters)
37 return parameters->count();
38 else
39 return 0;
40 }
41
42 int ParameterMapPresenter::columnCount(const QModelIndex &parent) const
43 {
44 Q_UNUSED(parent)
45
46 return _columnHeaders.count();
47 }
48
49 QVariant ParameterMapPresenter::data(const QModelIndex &index, int role) const
50 {
51 int row = index.row();
52 int col = index.column();
53 ParameterItemInterface * const param = parameters->getItem(RowToID[row]);
54
55 if(!param && row >= parameters->count())
56 return QVariant::Invalid;
57
58 if(role == Qt::TextAlignmentRole)
59 return QVariant(Qt::AlignCenter);
60
61 if(role == Qt::DisplayRole || role == Qt::EditRole)
62 {
63 if( col == 0 )
64 return QVariant(param->getType());
65 else if( col == 1)
66 return QVariant(param->getKey());
67 else if( col == 2)
68 return QVariant(param->getUnit());
69 else if ( col == 3)
70 return QVariant(param->getValue());
71 }
72
73 return QVariant();
74 }
75
76 bool ParameterMapPresenter::setData(const QModelIndex &index, const QVariant &value, int role)
77 {
78 int row = index.row();
79 int col = index.column();
80 ParameterItemInterface * const param = parameters->getItem(RowToID[row]);
81
82 if(!param && row >= parameters->count())
83 return false;
84
85 if( role == Qt::EditRole)
86 {
87 if( col == 3)
88 {
89 param->setValue(value.toString());
90 Q_EMIT dataChanged(index, index);
91 return true;
92 }
93 }
94
95 return false;
96 }
97
98 Qt::ItemFlags ParameterMapPresenter::flags(const QModelIndex &index) const
99 {
100 if (index.column() == 3)
101 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
102
103 return QAbstractTableModel::flags(index);
104 }
105
106 void ParameterMapPresenter::addRow(ParameterItemInterface::Type _type,
107 ParameterItemInterface::Key _key,
108 ParameterItemInterface::Unit _unit,
109 ParameterItemInterface::Value _value)
110 {
111 int row = rowCount();
112
113 if(parameters)
114 {
115 beginInsertRows(QModelIndex(), row , row);
116
117 ParameterMapInterface::ID id = parameters->generateID();
118 parameters->add(id);
119 RowToID.insert(row, id);
120
121 ParameterItemInterface * const param = parameters->getItem(id);
122 param->setType(_type);
123 param->setKey(_key);
124 param->setUnit(_unit);
125 param->setValue(_value);
126
127 endInsertRows();
128 }
129 }
130
131 bool ParameterMapPresenter::removeRow(const int &row)
132 {
133 if(parameters && RowToID.contains(row) && parameters->contains(RowToID[row]))
134 {
135 beginRemoveRows(QModelIndex(), row, row);
136
137 parameters->remove(RowToID[row]);
138 RowToID.remove(row);
139
140 for( int i=row+1; i<=RowToID.count() ; i++)
141 RowToID.insert( i-1, RowToID.take(i) );
142
143 endRemoveRows();
144 return true;
145 }
146
147 return false;
148 }
149
150 void ParameterMapPresenter::setParameters(ParameterMapInterface *_parameters)
151 {
152 parameters=_parameters;
153 update();
154 }
155
156 void ParameterMapPresenter::update()
157 {
158 int rows = 0;
159 beginResetModel();
160 endResetModel();
161 RowToID.clear();
162
163 if(parameters)
164 {
165 for( auto id : parameters->keys())
166 {
167 RowToID.insert(rows, id);
168 rows++;
169 }
170 }
171 }
172
ParameterMapPresenter::addRow
virtual void addRow(ParameterItemInterface::Type _type, ParameterItemInterface::Key _key, ParameterItemInterface::Unit _unit, ParameterItemInterface::Value _value)
Method that adds a new row, i.e. a new parameter with the given attributes.
Definition: ParameterMapPresenter.cpp:106
ParameterItemInterface::Key
QString Key
typedef for the key description
Definition: ParameterItemInterface.h:47
ParameterItemInterface::Value
QString Value
typedef for the parameter&#39;s value
Definition: ParameterItemInterface.h:48
ParameterItemInterface::setUnit
virtual void setUnit(Value const &unit)=0
Method which sets the unit of this parameter to the given one.
ParameterItemInterface::Unit
QString Unit
typedef for the parameter&#39;s unit
Definition: ParameterItemInterface.h:49
ParameterItemInterface::getUnit
virtual Unit getUnit() const =0
Method which returns the unit of this parameter.
ParameterMapPresenter::parameters
ParameterMapInterface * parameters
the pointer to the map of parameters edited by this table wrapper
Definition: ParameterMapPresenter.h:155
ParameterItemInterface::getValue
virtual Value getValue() const =0
Method which returns the value of this parameter.
ParameterMapPresenter::_columnHeaders
QStringList _columnHeaders
a string list containing the column header data of the table
Definition: ParameterMapPresenter.h:154
ParameterItemInterface::setValue
virtual void setValue(Value const &value)=0
Method which sets the value of this parameter to the given one.
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
ParameterMapPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: ParameterMapPresenter.cpp:49
ParameterItemInterface::getType
virtual Type getType() const =0
Method which returns the datatype of this parameter.
ParameterMapPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: ParameterMapPresenter.cpp:21
ParameterMapPresenter::setParameters
void setParameters(ParameterMapInterface *_parameters)
Method which sets the currently processed parameter map to the given argument.
Definition: ParameterMapPresenter.cpp:150
ParameterMapPresenter::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: ParameterMapPresenter.cpp:76
ParameterMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: ParameterMapPresenter.cpp:32
ParameterMapPresenter::update
void update()
Method which updates the table according to the current entries of parameters.
Definition: ParameterMapPresenter.cpp:156
ParameterMapPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: ParameterMapPresenter.cpp:42
ParameterItemInterface::getKey
virtual Key getKey() const =0
Method which returns the key description of this parameter.
ParameterItemInterface::setType
virtual void setType(Type const &type)=0
Method which sets the datatype of this parameter to the given type.
ParameterMapPresenter.h
This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters...
ParameterMapInterface::contains
virtual bool contains(ParameterMapInterface::ID const &id) const =0
Method wich checks whether the map contains a parameter of the given id.
ParameterItemInterface::Type
QString Type
typedef for the data type
Definition: ParameterItemInterface.h:46
ParameterMapInterface::count
virtual int count() const =0
Method which returns the number of parameter in the map.
ParameterMapPresenter::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! ...
Definition: ParameterMapPresenter.cpp:98
ParameterMapPresenter::RowToID
QMap< int, ParameterMapInterface::ID > RowToID
a map of row indices to parameter Ids
Definition: ParameterMapPresenter.h:153
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
ParameterMapPresenter::removeRow
virtual bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: ParameterMapPresenter.cpp:131
ParameterMapInterface::generateID
virtual ParameterMapInterface::ID generateID()=0
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
ParameterMapInterface::ID
ParameterItemInterface::ID ID
typedef for the id of a parameter
Definition: ParameterMapInterface.h:42
ParameterMapInterface::keys
virtual QList< ID > keys() const =0
Method which returns the list of all ids used in the map.
ParameterMapInterface::remove
virtual bool remove(ParameterMapInterface::ID const &id)=0
Method which removes the parameter with the given id from the map. The parameter is deleted after rem...
ParameterItemInterface::setKey
virtual void setKey(Key const &key)=0
Method which sets the key description of this parameter to the given one.
ParameterMapInterface::add
virtual bool add(ParameterMapInterface::ID const &id)=0
Method which creates a parameter (instance of ParameterItemInterface) and adds it to the map under th...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: PluginInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS
  • Interfaces
  • openPASS
PluginInterface.h File Reference

... More...

Detailed Description

...

Definition in file PluginInterface.h.

Go to the source code of this file.

Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: PluginInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS
  • Interfaces
  • openPASS
PluginInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef PLUGININTERFACE_H
18 #define PLUGININTERFACE_H
19
20 #include "openPASS/ServiceManagerInterface.h"
21 #include <QtPlugin>
22
23 class PluginInterface
24 {
25 public:
26 virtual ~PluginInterface() = default;
27
28 public:
29 virtual bool services(ServiceManagerInterface * const services)
30 {
31 ServiceManagerInterface::instance(services);
32 return true;
33 }
34
35 public:
36 virtual bool initialize()
37 {
38 return true;
39 }
40
41 virtual bool deinitialize()
42 {
43 return true;
44 }
45 };
46
47 Q_DECLARE_INTERFACE(PluginInterface, "openPASS.PluginInterface")
48
49 #endif // PLUGININTERFACE_H
ServiceManagerInterface.h
...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: PluginManagerInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS
  • Interfaces
  • openPASS
PluginManagerInterface.h File Reference

... More...

Detailed Description

...

Definition in file PluginManagerInterface.h.

Go to the source code of this file.

Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: PluginManagerInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS
  • Interfaces
  • openPASS
PluginManagerInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef PLUGINMANAGERINTERFACE_H
18 #define PLUGINMANAGERINTERFACE_H
19
20 #include "openPASS/ServiceInterface.h"
21 #include <QDir>
22 #include <QObject>
23 #include <QString>
24
25 static ServiceManagerInterface::ID const PluginManagerInterfaceID =
26 ServiceManagerInterfaceID("openPASS.PluginManagerInterface");
27
28 class PluginManagerInterface : public QObject,
29 public ServiceInterface<PluginManagerInterface, PluginManagerInterfaceID>
30 {
31 Q_OBJECT
32
33 public:
34 explicit PluginManagerInterface(QObject * const parent = nullptr)
35 : QObject(parent), ServiceInterface(this) {}
36 virtual ~PluginManagerInterface() = default;
37
38 Q_SIGNALS:
39 void started() const;
40
41 public:
42 virtual bool loadDirectory(QDir const & directory) = 0;
43 virtual bool isLoaded(QString const & iid) const = 0;
44 };
45
46 #endif // PLUGINMANAGERINTERFACE_H
ServiceInterface.h
...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ProfileItemView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
ProfileItemView.cpp
1 #include "ProfileItemView.h"
2 #include "ui_ProfileItemView.h"
3
4 ProfileItemView::ProfileItemView(QString const &label,
5 QString const &name,
6 double probability,
7 QWidget *parent) :
8 WidgetView(parent),
9 name(name),
10 ui(new Ui::ProfileItemView)
11 {
12 ui->setupUi(this);
13 ui->Label->setText(label);
14
15 ui->ItemTitle->setText(name);
16
17 ui->probability->setValue(probability);
18 }
19
20 ProfileItemView::~ProfileItemView()
21 {
22 delete ui;
23 }
24
25
26 void ProfileItemView::on_probability_editingFinished()
27 {
28 Q_EMIT probabilityChanged(name, ui->probability->value());
29 }
30
31 void ProfileItemView::on_remove_clicked()
32 {
33 Q_EMIT remove(name);
34 }
35
36
37 void ProfileItemView::setLabel(QString const &label)
38 {
39 ui->Label->setText(label);
40 }
41
42
43 void ProfileItemView::setName(const QString &_name)
44 {
45 name = _name;
46 ui->ItemTitle->setText(name);
47 }
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ProfileItemView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
ProfileItemView.h
1 #ifndef PROFILEITEMVIEW_H
2 #define PROFILEITEMVIEW_H
3
4 #include "WidgetView.h"
5
6 namespace Ui {
7 class ProfileItemView;
8 }
9
10 class ProfileItemView : public WidgetView
11 {
12 Q_OBJECT
13
14 public:
15 explicit ProfileItemView(const QString &label,
16 QString const &name,
17 double probability,
18 QWidget *parent = 0);
19 ~ProfileItemView();
20
21 Q_SIGNALS:
22 void probabilityChanged(QString const &name, double probability);
23 void remove(QString const &name);
24
25 private Q_SLOTS:
26 void on_probability_editingFinished();
27 void on_remove_clicked();
28
29 public:
30 void setLabel(QString const &label);
31 void setName(QString const &_name);
32
33 private:
34 QString name;
35 Ui::ProfileItemView *ui;
36 };
37
38 #endif // PROFILEITEMVIEW_H
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ProfileMapInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
ProfileMapInterface.h
1 #ifndef PROFILEMAPINTERFACE_H
2 #define PROFILEMAPINTERFACE_H
3
4 #endif // PROFILEMAPINTERFACE_H
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ProjectInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Project
  • Interfaces
  • openPASS-Project
Classes
ProjectInterface.h File Reference

The Project Interface (PI) contains the functions setters and getters of the items constituing the project configuration or framework configuration for the simulation. This interface belongs to the Project Plugin (PP). More...

Detailed Description

The Project Interface (PI) contains the functions setters and getters of the items constituing the project configuration or framework configuration for the simulation. This interface belongs to the Project Plugin (PP).

Definition in file ProjectInterface.h.

Go to the source code of this file.

Classes

class ProjectInterface
This class defines the items constituing the project configuration: More...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ProjectInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Project
  • Interfaces
  • openPASS-Project
ProjectInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
19
20 #ifndef PROJECTINTERFACE_H
21 #define PROJECTINTERFACE_H
22
23 #include "openPASS/ServiceInterface.h"
24
25 #include <QDir>
26 #include <QObject>
27 #include <QString>
28
29 static ServiceManagerInterface::ID const ProjectInterfaceID =
30 ServiceManagerInterfaceID("openPASS.Project.ProjectInterface");
31
46 class ProjectInterface : public QObject,
47 public ServiceInterface<ProjectInterface, ProjectInterfaceID>
48 {
49 Q_OBJECT
50
51 public:
52 using Config = QString;
53 using Library = QString;
54 using Result = QString;
55 using LogMaster = QString;
56 using LogSlave = QString;
57 using LogLevel = unsigned int;
58 using Slave = QString;
59
60 public:
61 explicit ProjectInterface(QObject * const parent = nullptr)
62 : QObject(parent), ServiceInterface(this) {}
63 virtual ~ProjectInterface() = default;
64
65 Q_SIGNALS: // update actions from the Menu-bar
66 //-----------------------------------------------------------------------------
68 //-----------------------------------------------------------------------------
69 void cleared() const;
70
71 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 void loaded() const;
75
76 //-----------------------------------------------------------------------------
78 //-----------------------------------------------------------------------------
79 void saved() const;
80
81 Q_SIGNALS: // update actions from the Browse Buttons
82 //-----------------------------------------------------------------------------
85 //-----------------------------------------------------------------------------
86 void update();
87
88 public:
89 //-----------------------------------------------------------------------------
93 //-----------------------------------------------------------------------------
94 virtual bool clear() = 0;
95
96 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
102 virtual bool load(QString const &filepath) = 0;
103
104 //-----------------------------------------------------------------------------
109 //-----------------------------------------------------------------------------
110 virtual bool save(QString const &filepath) const = 0;
111
112 public:
113 virtual bool setConfigPath(ProjectInterface::Config const &configs) = 0;
114 virtual ProjectInterface::Config getConfigPath() const = 0;
115 virtual QString relativeToConfigPath(QString const &filepath) const = 0;
116 virtual QString absoluteToConfigPath(QString const &filepath) const = 0;
117
118 public:
119 //-----------------------------------------------------------------------------
124 //-----------------------------------------------------------------------------
125 virtual bool setLibraryPath(ProjectInterface::Library const &library) = 0;
126
127 //-----------------------------------------------------------------------------
131 //-----------------------------------------------------------------------------
132 virtual ProjectInterface::Library getLibraryPath() const = 0;
133
134 //-----------------------------------------------------------------------------
138 //-----------------------------------------------------------------------------
139 virtual QDir getLibrary() const = 0;
140
141 public:
142 //-----------------------------------------------------------------------------
147 //-----------------------------------------------------------------------------
148 virtual bool setResultPath(ProjectInterface::Result const &result) = 0;
149
150 //-----------------------------------------------------------------------------
154 //-----------------------------------------------------------------------------
155 virtual ProjectInterface::Result getResultPath() const = 0;
156
157 public:
158 //-----------------------------------------------------------------------------
164 //-----------------------------------------------------------------------------
165 virtual bool setLogMaster(ProjectInterface::LogMaster const &logMaster) = 0;
166
167 //-----------------------------------------------------------------------------
171 //-----------------------------------------------------------------------------
172 virtual ProjectInterface::LogMaster getLogMaster() const = 0;
173
174 public:
175 //-----------------------------------------------------------------------------
181 //-----------------------------------------------------------------------------
182 virtual bool setLogSlave(ProjectInterface::LogSlave const &logSlave) = 0;
183
184 //-----------------------------------------------------------------------------
188 //-----------------------------------------------------------------------------
189 virtual ProjectInterface::LogSlave getLogSlave() const = 0;
190
191 public:
192 //-----------------------------------------------------------------------------
198 //-----------------------------------------------------------------------------
199 virtual bool setLogLevel(ProjectInterface::LogLevel const &logLevel) = 0;
200
201 //-----------------------------------------------------------------------------
205 //-----------------------------------------------------------------------------
206 virtual ProjectInterface::LogLevel getLogLevel() const = 0;
207
208 public:
209 //-----------------------------------------------------------------------------
213 //-----------------------------------------------------------------------------
214 virtual bool setSlaveExe(ProjectInterface::Slave const &slave) = 0;
215
216 //-----------------------------------------------------------------------------
220 //-----------------------------------------------------------------------------
221 virtual ProjectInterface::Slave getSlaveExe() const = 0;
222
223 public:
224 //-----------------------------------------------------------------------------
228 //-----------------------------------------------------------------------------
229 virtual bool getProjectStatus() const = 0;
230 };
231
232 #endif // PROJECTINTERFACE_H
ProjectInterface::save
virtual bool save(QString const &filepath) const =0
Saves a project to a file stored in the given path filepath.
ServiceInterface.h
...
ProjectInterface::getLogSlave
virtual ProjectInterface::LogSlave getLogSlave() const =0
Gets the path of the directory containing the log file of the openPASS Slave.
ProjectInterface::getLibraryPath
virtual ProjectInterface::Library getLibraryPath() const =0
Gets the path of the directory containing the components library.
ProjectInterface::getProjectStatus
virtual bool getProjectStatus() const =0
Verifies if the required entries for the simulation are given.
ProjectInterface::saved
void saved() const
Triggers signal to inform that a project has been saved successfully.
ProjectInterface::getLibrary
virtual QDir getLibrary() const =0
Gets the directory containing the components library.
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
ProjectInterface::getLogLevel
virtual ProjectInterface::LogLevel getLogLevel() const =0
Gets the level of information in the log files for the current project.
ProjectInterface::setLibraryPath
virtual bool setLibraryPath(ProjectInterface::Library const &library)=0
Sets the path of the directory containing the components library library.
ProjectInterface::cleared
void cleared() const
Triggers signal to inform that the project has been reset successfully.
ProjectInterface::setLogLevel
virtual bool setLogLevel(ProjectInterface::LogLevel const &logLevel)=0
Sets the level of information logLevel in the log files for the current project.
ProjectInterface::setResultPath
virtual bool setResultPath(ProjectInterface::Result const &result)=0
Sets the path of the directory containing the project results result.
ProjectInterface::getResultPath
virtual ProjectInterface::Result getResultPath() const =0
Gets the path of the directory containing the project results.
ProjectInterface::load
virtual bool load(QString const &filepath)=0
Loads a project from a file located in the given path filepath.
ProjectInterface::getSlaveExe
virtual ProjectInterface::Slave getSlaveExe() const =0
Gets the path of the executable openPASS slave.
ProjectInterface::setSlaveExe
virtual bool setSlaveExe(ProjectInterface::Slave const &slave)=0
Sets the path of the executable openPASS slave.
ProjectInterface::clear
virtual bool clear()=0
Resets the project configuration.
ProjectInterface::setLogSlave
virtual bool setLogSlave(ProjectInterface::LogSlave const &logSlave)=0
Sets the path of the directory containing the log file of the openPASS Slave (Log Slave) logSlave...
ProjectInterface::getLogMaster
virtual ProjectInterface::LogMaster getLogMaster() const =0
Gets the path of the directory containing the log file of the openPASS Master.
ProjectInterface::update
void update()
Triggers signal to inform that an item from the project configuration has been modified.
ProjectInterface::loaded
void loaded() const
Triggers signal to inform that a project has been loaded successfully.
ProjectInterface::setLogMaster
virtual bool setLogMaster(ProjectInterface::LogMaster const &logMaster)=0
Sets the path of the directory containing the log file of the openPASS Master (Log Master) logMaster...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: RandomInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS
  • Interfaces
  • openPASS
RandomInterface.h File Reference

... More...

Detailed Description

...

Definition in file RandomInterface.h.

Go to the source code of this file.

Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: RandomInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS
  • Interfaces
  • openPASS
RandomInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef RANDOMINTERFACE_H
18 #define RANDOMINTERFACE_H
19
20 #include <QtGlobal>
21 #include <QDateTime>
22
23 class RandomInterface
24 {
25 public:
26 explicit RandomInterface() = delete;
27 virtual ~RandomInterface() = default;
28
29 public:
30 static void initialize()
31 {
32 qsrand(QDateTime::currentMSecsSinceEpoch());
33 }
34
35 static double random(double const & minimum = 0.0,
36 double const & maximum = 1.0)
37 {
38 return (static_cast<double>(qrand()) / RAND_MAX * (maximum - minimum)) + minimum;
39 }
40 };
41
42 #endif // RANDOMINTERFACE_H
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioAgentsPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
ScenarioAgentsPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "ScenarioAgentsPresenter.h"
12
13 #include <QBrush>
14
15 ScenarioAgentsPresenter::ScenarioAgentsPresenter(ScenarioInterface::Entities * const entities,
16 const QMap<QString, QList<QString> > &scenarioAgentsList,
17 QObject *parent)
18 : QAbstractTableModel(parent)
19 , entities(entities)
20 , scenarioAgentsList(scenarioAgentsList)
21 {
22 _columnHeaders << "Agent" << "Profile Catalogue" << "Agent Profile";
23 }
24
25 QVariant ScenarioAgentsPresenter::headerData(int section, Qt::Orientation orientation, int role) const
26 {
27 if( (role == Qt::DisplayRole) && (orientation== Qt::Horizontal) )
28 return _columnHeaders.value(section);
29
30 if( (role == Qt::DisplayRole) && (orientation == Qt::Vertical) )
31 return section+1;
32
33 return QVariant();
34 }
35
36 int ScenarioAgentsPresenter::rowCount(const QModelIndex &parent) const
37 {
38 Q_UNUSED(parent);
39
40 return entities->count();
41 }
42
43 int ScenarioAgentsPresenter::columnCount(const QModelIndex &parent) const
44 {
45 Q_UNUSED(parent);
46
47 return _columnHeaders.count();
48 }
49
50 QVariant ScenarioAgentsPresenter::data(const QModelIndex &index, int role) const
51 {
52 int row = index.row();
53 int col = index.column();
54 QString name = RowToName.value(row);
55
56 if(row >= entities->count())
57 return QVariant::Invalid;
58
59 if(role == Qt::TextAlignmentRole)
60 return QVariant(Qt::AlignCenter);
61
62 if(role == Qt::TextColorRole)
63 {
64 QBrush color(Qt::red);
65
66 if(col == 1)
67 {
68 QString catalogue = entities->value(name).first;
69
70 if(!scenarioAgentsList.contains(catalogue))
71 return color;
72 }
73 else if (col == 2)
74 {
75 QString agentProfile = entities->value(name).second;
76 QString catalogue = entities->value(name).first;
77
78 if(!scenarioAgentsList.contains(catalogue))
79 return color;
80 else if(!scenarioAgentsList.value(catalogue).contains(agentProfile))
81 return color;
82
83 }
84
85 return QBrush(Qt::black);
86 }
87
88
89
90 if(role == Qt::DisplayRole)
91 {
92
93 if( col == 0 )
94 return name;
95 else if(col == 1)
96 {
97 QString catalogue = entities->value(name).first;
98
99 if(!scenarioAgentsList.contains(catalogue))
100 {
101 return QString ("%1 (inaccessible!)").arg(catalogue);
102 }
103 else
104 return catalogue;
105 }
106 else if (col == 2)
107 {
108 QString agentProfile = entities->value(name).second;
109 QString catalogue = entities->value(name).first;
110
111 if(!scenarioAgentsList.contains(catalogue) || !scenarioAgentsList.value(catalogue).contains(agentProfile))
112 {
113 return QString("%1 (not existing!)").arg(agentProfile);
114 }
115 else {
116 return agentProfile;
117 }
118 }
119 }
120
121 return QVariant();
122 }
123
124
125 void ScenarioAgentsPresenter::update()
126 {
127 int rows = 0;
128
129 beginResetModel();
130 endResetModel();
131 RowToName.clear();
132
133 for( auto name : entities->keys() )
134 {
135 RowToName.insert(rows, name);
136 rows++;
137 }
138 }
ScenarioAgentsPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: ScenarioAgentsPresenter.cpp:36
ScenarioAgentsPresenter::_columnHeaders
QStringList _columnHeaders
the column header&#39;s info
Definition: ScenarioAgentsPresenter.h:119
ScenarioAgentsPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: ScenarioAgentsPresenter.cpp:43
ScenarioAgentsPresenter::entities
ScenarioInterface::Entities *const entities
a map translating row indices to scenario agent names
Definition: ScenarioAgentsPresenter.h:118
ScenarioAgentsPresenter.h
This class describes the presenter object of the scenario agents map.
ScenarioAgentsPresenter::update
void update()
Method which updates the table model according to the current entries of #entitites.
Definition: ScenarioAgentsPresenter.cpp:125
ScenarioAgentsPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: ScenarioAgentsPresenter.cpp:50
ScenarioAgentsPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: ScenarioAgentsPresenter.cpp:25
ScenarioInterface::Entities
QMap< Name, CatalogueRef > Entities
The mapping of a scenario agent to an agent profile (catalogue reference)
Definition: ScenarioInterface.h:46
ScenarioAgentsPresenter::scenarioAgentsList
QMap< QString, QList< QString > > const & scenarioAgentsList
a map which holds a list of scenario agents (values) for each profiles catalogue (keys) ...
Definition: ScenarioAgentsPresenter.h:120
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioBaseView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
ScenarioBaseView.cpp
1 #include "ScenarioBaseView.h"
2
3 ScenarioBaseView::ScenarioBaseView(QWidget *parent)
4 : WidgetView(parent)
5 {
6 scenarioView = new ScenarioView(this);
7
8 connect(scenarioView, &ScenarioView::resized, this, &ScenarioBaseView::updateSize);
9
10 adjustWidgets(parent);
11 }
12
13 ScenarioView * ScenarioBaseView::getScenarioView() const
14 {
15 return scenarioView;
16 }
17
18 void ScenarioBaseView::updateSize()
19 {
20 QRect frame(0,0,1,1);
21
22 for(auto child : findChildren<WidgetView*>())
23 frame = frame.united(child->geometry());
24
25 setGeometry(frame);
26 }
27
28 void ScenarioBaseView::adjustWidgets(QWidget *mainWindow)
29 {
30 int x;
31
32 // ajust the position of Scenario View:
33 x= (mainWindow->width() - scenarioView->width() )/2;
34 scenarioView->move(x,30);
35
36 updateSize();
37 }
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
ScenarioBaseView::updateSize
void updateSize()
Slot which updates the size of this base view such that the child widget (ScenarioView) is visible...
Definition: ScenarioBaseView.cpp:18
ScenarioBaseView::getScenarioView
ScenarioView * getScenarioView() const
Method which returns the scenario configuration editor widget.
Definition: ScenarioBaseView.cpp:13
ScenarioBaseView::scenarioView
ScenarioView * scenarioView
A pointer to the scenario configuration widget.
Definition: ScenarioBaseView.h:60
ScenarioBaseView::adjustWidgets
void adjustWidgets(QWidget *mainWindow)
Method which adjusts the positioning and size of the child widget. The size of the child widget is de...
Definition: ScenarioBaseView.cpp:28
ScenarioView
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content ...
Definition: ScenarioView.h:42
ScenarioBaseView.h
This class provides a resizable container widget for the content of the scenario tab&#39;s scroll area...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioDisplayPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
ScenarioDisplayPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "ScenarioDisplayPresenter.h"
12
13 #include "Models/TrafficSimulationXMLLoadModel.h"
14 #include <QFile>
15
16 ScenarioDisplayPresenter::ScenarioDisplayPresenter(ScenarioInterface *scenario,
17 ScenarioDisplayView *scenarioDisplayView,
18 ProjectInterface * const project,
19 QObject *parent)
20 : QObject(parent)
21 , scenario(scenario)
22 , scenarioDisplayView(scenarioDisplayView)
23 , project(project)
24 {
25
26 connect(scenario, &ScenarioInterface::modifiedName, this, &ScenarioDisplayPresenter::setScenarioNameView);
27 connect(scenario, &ScenarioInterface::modifiedScenarioFile, this, &ScenarioDisplayPresenter::setScenarioFileView);
28 connect(scenario, &ScenarioInterface::setEntities, this, &ScenarioDisplayPresenter::setScenarioAgentsView);
29
30 connect(project, &ProjectInterface::update, this, &ScenarioDisplayPresenter::setScenarioFileView);
31
32 updateView();
33 }
34
35
36 void ScenarioDisplayPresenter::setScenarioNameView()
37 {
38 scenarioDisplayView->setScenarioName(scenario->getName());
39
40 setStatus();
41 }
42
43
44 void ScenarioDisplayPresenter::setScenarioFileView()
45 {
46 QFile file(project->absoluteToConfigPath(scenario->getScenarioFile()));
47
48 if(scenario->getScenarioFile().isEmpty())
49 scenarioDisplayView->setScenarioFile("-");
50 else if(file.exists())
51 scenarioDisplayView->setScenarioFile("existing");
52 else
53 scenarioDisplayView->setScenarioFile("not existing");
54
55 setStatus();
56 }
57
58 void ScenarioDisplayPresenter::setScenarioAgentsView()
59 {
60 int num_agents = scenario->getEntities()->count();
61
62 scenarioDisplayView->setScenarioAgents(num_agents);
63
64 setStatus();
65 }
66
67 void ScenarioDisplayPresenter::setStatus()
68 {
69 bool ok = true;
70
71 QFile scenarioFile(project->absoluteToConfigPath(scenario->getScenarioFile()));
72 if(scenario->getEntities()->count() == 0)
73 ok = false;
74
75 else if( !scenarioFile.exists())
76 ok = false;
77
78 else if( !scenarioAgentsDefined() )
79 ok = false;
80
81
82
83 if(ok && scenario->getName().isEmpty())
84 scenarioDisplayView->setStatus(ScenarioDisplayView::StatusType::Warning, QString("No name specified"));
85
86 else if(ok)
87 scenarioDisplayView->setStatus(ScenarioDisplayView::StatusType::OK, QString("OK"));
88
89 else
90 scenarioDisplayView->setStatus(ScenarioDisplayView::StatusType::Error, QString("Error"));
91
92 scenario->setStatus(ok);
93 }
94
95
96 void ScenarioDisplayPresenter::updateView()
97 {
98 setScenarioNameView();
99 setScenarioFileView();
100 setScenarioAgentsView();
101
102 setStatus();
103 }
104
105 void ScenarioDisplayPresenter::setScenarioAgentsList()
106 {
107 scenarioAgentsList.clear();
108
109 for(auto catalogRef : scenario->getEntities()->values())
110 {
111 if(!QFileInfo::exists(project->absoluteToConfigPath(catalogRef.first))
112 || scenarioAgentsList.contains(catalogRef.first))
113 break;
114
115 // load agents into list
116 TrafficSimulationXMLLoadModel::loadAgentProfiles(project->absoluteToConfigPath(catalogRef.first),
117 scenarioAgentsList[catalogRef.first]);
118 }
119 }
120
121
122 bool ScenarioDisplayPresenter::scenarioAgentsDefined()
123 {
124 setScenarioAgentsList();
125
126 for(auto entity : scenario->getEntities()->values())
127 {
128 QString agentProfile = entity.second;
129 QString catalogue = entity.first;
130
131 if( !scenarioAgentsList.contains(catalogue) )
132 return false;
133 else if( !scenarioAgentsList.value(catalogue).contains(agentProfile) )
134 return false;
135 }
136
137 return true;
138 }
ScenarioInterface::setEntities
void setEntities()
Signal, emitted when the entities map of the scenario setup has been set.
ScenarioDisplayView::setScenarioFile
void setScenarioFile(QString scenarioFile)
Method for setting the name which should be displayed for the open scenario file. ...
Definition: ScenarioDisplayView.cpp:44
ScenarioInterface::getScenarioFile
virtual ScenarioFile getScenarioFile() const =0
Returns the current name of the open scenario file to which this scenario setup refers.
ScenarioDisplayPresenter::setStatus
void setStatus()
Method which determines the status of the scenario settings. If all necessary configurations are made...
Definition: ScenarioDisplayPresenter.cpp:67
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
ScenarioDisplayPresenter::scenario
ScenarioInterface * scenario
a pointer to the scenario model (interface) which is read by this presenter
Definition: ScenarioDisplayPresenter.h:83
ScenarioDisplayView::setScenarioName
void setScenarioName(QString name)
Method for setting the name which should be displayed for the scenario.
Definition: ScenarioDisplayView.cpp:39
ScenarioDisplayView::setScenarioAgents
void setScenarioAgents(int scenarioAgents)
Method for setting the number of scenario agents which should be displayed.
Definition: ScenarioDisplayView.cpp:49
ScenarioDisplayView::StatusType::Error
enum class for classifying the status (will be used to determine the color of the frame) ...
ScenarioDisplayPresenter::project
ProjectInterface *const project
a pointer to the project interface in order to access the file system
Definition: ScenarioDisplayPresenter.h:85
ScenarioDisplayPresenter::setScenarioNameView
void setScenarioNameView()
Slot which is called when the name of the scenario has changed in the model. Updates the displayed na...
Definition: ScenarioDisplayPresenter.cpp:36
ScenarioDisplayPresenter::setScenarioFileView
void setScenarioFileView()
Slot which is called when the open scenario filename changed in the model. Updates the displayed scen...
Definition: ScenarioDisplayPresenter.cpp:44
ScenarioDisplayPresenter.h
This class defines the presenter which controls the content to be displayed in the ScenarioDisplayVie...
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
ScenarioInterface::modifiedName
void modifiedName()
Signal, emitted when the name of the scenario has been modified.
ScenarioInterface::getEntities
virtual Entities * getEntities() const =0
Returns the map (= container class) in which all scenario agents information is registered. This comprises a name of the agent profile (key) and a catalogue reference (value).
ScenarioDisplayPresenter::setScenarioAgentsView
void setScenarioAgentsView()
Slot which is called when the map of scenario agents has been edited in the model. Updates the displayed number of scenario agents and triggers a status check.
Definition: ScenarioDisplayPresenter.cpp:58
ScenarioDisplayPresenter::updateView
void updateView()
Method which sets all displayed values according to the model data. Will be called after loading a co...
Definition: ScenarioDisplayPresenter.cpp:96
ScenarioInterface::modifiedScenarioFile
void modifiedScenarioFile()
Signal, emitted when the open scenario filename has changed.
ScenarioDisplayView
This class provides a display for a quick overview of the scenario configuration. ...
Definition: ScenarioDisplayView.h:40
ScenarioDisplayPresenter::scenarioAgentsList
QMap< QString, QList< QString > > scenarioAgentsList
a map which holds a list of scenario agents (values) for each profiles catalogue (keys) ...
Definition: ScenarioDisplayPresenter.h:88
ProjectInterface::update
void update()
Triggers signal to inform that an item from the project configuration has been modified.
ScenarioDisplayPresenter::scenarioDisplayView
ScenarioDisplayView * scenarioDisplayView
a pointer to the display view whose content is managed by this presenter
Definition: ScenarioDisplayPresenter.h:84
ScenarioDisplayView::setStatus
void setStatus(StatusType status, QString message)
Method which determines the frame color according to the status type passed as a first argument...
Definition: ScenarioDisplayView.cpp:54
TrafficSimulationXMLLoadModel.h
This class provides routines for loading the combination XML file and for storing all information in ...
ScenarioInterface::setStatus
virtual void setStatus(Status const &_status)=0
Method for setting the status of the scenario configuration to the value passed as an argument...
ScenarioInterface::getName
virtual Name getName() const =0
Returns the current name of the scenario.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioDisplayView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
ScenarioDisplayView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "ScenarioDisplayView.h"
12 #include "ui_ScenarioDisplayView.h"
13
14 ScenarioDisplayView::ScenarioDisplayView(QWidget *parent) :
15 WidgetView(parent),
16 ui(new Ui::ScenarioDisplayView)
17 {
18 ui->setupUi(this);
19
20 color = { {StatusType::OK, QString("QGroupBox{border:2px solid green;"
21 "border-radius:5px;margin-top: 4ex;} "
22 "QGroupBox::title{subcontrol-origin: margin;"
23 "subcontrol-position:top center;padding:0 3px;}")},
24 {StatusType::Error, QString("QGroupBox{border:2px solid red;"
25 "border-radius:5px;margin-top: 4ex;} "
26 "QGroupBox::title{subcontrol-origin: margin;"
27 "subcontrol-position:top center;padding:0 3px;}")},
28 {StatusType::Warning, QString("QGroupBox{border:2px solid orange;border-radius:5px;margin-top: 4ex;} "
29 "QGroupBox::title{subcontrol-origin: margin;"
30 "subcontrol-position:top center;padding:0 3px;}")}
31 };
32 }
33
34 ScenarioDisplayView::~ScenarioDisplayView()
35 {
36 delete ui;
37 }
38
39 void ScenarioDisplayView::setScenarioName(QString name)
40 {
41 ui->ScenarioName->setText(name);
42 }
43
44 void ScenarioDisplayView::setScenarioFile(QString scenarioFile)
45 {
46 ui->ScenarioFile->setText(scenarioFile);
47 }
48
49 void ScenarioDisplayView::setScenarioAgents(int scenarioAgents)
50 {
51 ui->ScenarioAgents->setText(QString::number(scenarioAgents));
52 }
53
54 void ScenarioDisplayView::setStatus(StatusType status, QString message)
55 {
56 // display message on status
57 ui->Status->setText(message);
58
59 // coloring of the frame
60 setStyleSheet(color[status]);
61 }
ScenarioDisplayView::setScenarioFile
void setScenarioFile(QString scenarioFile)
Method for setting the name which should be displayed for the open scenario file. ...
Definition: ScenarioDisplayView.cpp:44
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
ScenarioDisplayView::setScenarioName
void setScenarioName(QString name)
Method for setting the name which should be displayed for the scenario.
Definition: ScenarioDisplayView.cpp:39
ScenarioDisplayView::setScenarioAgents
void setScenarioAgents(int scenarioAgents)
Method for setting the number of scenario agents which should be displayed.
Definition: ScenarioDisplayView.cpp:49
ScenarioDisplayView.h
This class provides a display for a quick overview of the scenario configuration. ...
ScenarioDisplayView::ui
Ui::ScenarioDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: ScenarioDisplayView.h:89
ScenarioDisplayView::color
QMap< StatusType, QString > color
a color map which determines the color code according to the status type
Definition: ScenarioDisplayView.h:88
ScenarioDisplayView
This class provides a display for a quick overview of the scenario configuration. ...
Definition: ScenarioDisplayView.h:40
ScenarioDisplayView::setStatus
void setStatus(StatusType status, QString message)
Method which determines the frame color according to the status type passed as a first argument...
Definition: ScenarioDisplayView.cpp:54
ScenarioDisplayView::StatusType
StatusType
Definition: ScenarioDisplayView.h:45
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
ScenarioModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "ScenarioModel.h"
12
13 #include <QString>
14 #include <QMap>
15
16 ScenarioModel::ScenarioModel(QObject *parent)
17 : ScenarioInterface(parent)
18 , name(QString(""))
19 , scenarioFile(QString(""))
20 , entities(new Entities)
21 {
22 }
23
24 ScenarioModel::~ScenarioModel()
25 {
26 delete entities;
27 }
28
29 ScenarioInterface::Name ScenarioModel::getName() const
30 {
31 return name;
32 }
33
34 void ScenarioModel::setName(const Name &newName)
35 {
36 name = newName;
37
38 Q_EMIT modifiedName();
39 }
40
41 ScenarioInterface::Entities * ScenarioModel::getEntities() const
42 {
43 return entities;
44 }
45
46 ScenarioInterface::ScenarioFile ScenarioModel::getScenarioFile() const
47 {
48 return scenarioFile;
49 }
50
51 void ScenarioModel::setScenarioFile(const ScenarioFile &filename)
52 {
53 scenarioFile=filename;
54 Q_EMIT modifiedScenarioFile();
55 }
56
57
58 void ScenarioModel::setStatus(const Status &_status)
59 {
60 status = _status;
61 Q_EMIT modifiedStatus();
62 }
63
64 ScenarioInterface::Status ScenarioModel::getStatus() const
65 {
66 return status;
67 }
ScenarioModel.h
The Scenario Model class implements the functionality of the ScenarioItemInterface class...
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
ScenarioInterface::Status
bool Status
Type characterizing the status of the scenario settings.
Definition: ScenarioInterface.h:47
ScenarioModel::getEntities
virtual Entities * getEntities() const override
Returns the map (= container class) in which all scenario agents information is registered. This comprises a name of the agent profile (key) and a catalogue reference (value).
Definition: ScenarioModel.cpp:41
ScenarioModel::entities
Entities *const entities
the map of scenario agents (referred to as &#39;entities&#39; in the XOSC file standard). ...
Definition: ScenarioModel.h:53
ScenarioModel::getScenarioFile
virtual ScenarioFile getScenarioFile() const override
Returns the current name of the open scenario file to which this scenario setup refers.
Definition: ScenarioModel.cpp:46
ScenarioModel::getStatus
virtual Status getStatus() const override
Method which returns the current status of the scenario settings.
Definition: ScenarioModel.cpp:64
ScenarioInterface::modifiedName
void modifiedName()
Signal, emitted when the name of the scenario has been modified.
ScenarioInterface::Name
QString Name
The name of the scenario.
Definition: ScenarioInterface.h:42
ScenarioModel::name
Name name
the name of the scenario configuration
Definition: ScenarioModel.h:51
ScenarioInterface::modifiedStatus
void modifiedStatus()
Signal, emitted when the scenario&#39;s status has changed.
ScenarioModel::scenarioFile
ScenarioFile scenarioFile
the path to the OpenScenario file
Definition: ScenarioModel.h:52
ScenarioModel::setStatus
virtual void setStatus(Status const &_status) override
Method for setting the status of the scenario configuration to the value passed as an argument...
Definition: ScenarioModel.cpp:58
ScenarioModel::status
Status status
the status of the scenario configuration
Definition: ScenarioModel.h:54
ScenarioInterface::modifiedScenarioFile
void modifiedScenarioFile()
Signal, emitted when the open scenario filename has changed.
ScenarioModel::setName
virtual void setName(Name const &newName) override
Sets the name of the scenario to the given name.
Definition: ScenarioModel.cpp:34
ScenarioInterface::ScenarioFile
QString ScenarioFile
The name of the open scenario file.
Definition: ScenarioInterface.h:41
ScenarioModel::getName
virtual Name getName() const override
Returns the current name of the scenario.
Definition: ScenarioModel.cpp:29
ScenarioModel::setScenarioFile
virtual void setScenarioFile(ScenarioFile const &filename) override
Sets the filename of the open scenario file to the one passed as an argument.
Definition: ScenarioModel.cpp:51
ScenarioInterface::Entities
QMap< Name, CatalogueRef > Entities
The mapping of a scenario agent to an agent profile (catalogue reference)
Definition: ScenarioInterface.h:46
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
ScenarioPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "ScenarioPresenter.h"
12 #include "Models/TrafficSimulationXMLLoadModel.h"
13
14 #include <QFileDialog>
15
16 ScenarioPresenter::ScenarioPresenter(ScenarioInterface *scenario,
17 ScenarioView *scenarioView,
18 ProjectInterface * const project,
19 QUndoStack * const undoStack,
20 QObject *parent)
21 : QObject(parent)
22 , scenario(scenario)
23 , scenarioView(scenarioView)
24 , project(project)
25 , undoStack(undoStack)
26 {
27
28 scenarioAgentsPresenter = new ScenarioAgentsPresenter(scenario->getEntities(), scenarioAgentsList, this);
29 scenarioView->getScenarioAgentsView()->setModel(scenarioAgentsPresenter);
30
31 connect(scenarioView, &ScenarioView::modifiedName, this, &ScenarioPresenter::setName);
32 connect(scenarioView, &ScenarioView::modifiedScenarioFile, this, &ScenarioPresenter::setScenarioFile);
33 connect(scenarioView, &ScenarioView::refreshScenarioFile, this, &ScenarioPresenter::refreshScenarioFile);
34
35 connect(project, &ProjectInterface::update, this, &ScenarioPresenter::refreshScenarioFile);
36 }
37
38
39 void ScenarioPresenter::setName(const QString &name)
40 {
41 if(scenario->getName()!= name)
42 undoStack->push(new EditScenarioName(scenario, scenarioView,name));
43 }
44
45 void ScenarioPresenter::setScenarioFile()
46 {
47 QString const filename = QFileDialog::getOpenFileName(
48 scenarioView, QObject::tr("openPASS / Choose OpenScenario File"),
49 project->getConfigPath(), QStringLiteral("OpenScenario File (*.xosc)"));
50
51 if(filename.isEmpty())
52 return;
53
54 else
55 {
56 QString relativePath = project->relativeToConfigPath(filename);
57
58 if(scenario->getScenarioFile()!= relativePath)
59 undoStack->push(new EditScenarioFile(scenario, scenarioView,relativePath));
60 }
61
62 }
63
64 void ScenarioPresenter::refreshScenarioFile()
65 {
66 QString filename = project->absoluteToConfigPath(scenario->getScenarioFile());
67
68 // load entities defined in the open scenario file
69 scenario->getEntities()->clear();
70 TrafficSimulationXMLLoadModel::loadEntities(scenario, filename);
71
72 setScenarioAgentsList();
73 scenarioAgentsPresenter->update();
74 scenarioView->setScenarioFileError("");
75
76 if(scenario->getScenarioFile().isEmpty())
77 return;
78
79
80 if(!QFileInfo::exists(project->absoluteToConfigPath(scenario->getScenarioFile())))
81 {
82 scenarioView->setScenarioFileError("Open Scenario File not accessible! Check configuration path in Project plugin.");
83 return;
84 }
85 }
86
87 void ScenarioPresenter::updateView()
88 {
89 scenarioView->setName(scenario->getName());
90 scenarioView->setScenarioFile(scenario->getScenarioFile());
91 refreshScenarioFile();
92 }
93
94
95 void ScenarioPresenter::setScenarioAgentsList()
96 {
97 scenarioAgentsList.clear();
98
99 for(auto catalogRef : scenario->getEntities()->values())
100 {
101 if(!QFileInfo::exists(project->absoluteToConfigPath(catalogRef.first))
102 || scenarioAgentsList.contains(catalogRef.first))
103 break;
104
105 // load agents into list
106 TrafficSimulationXMLLoadModel::loadAgentProfiles(project->absoluteToConfigPath(catalogRef.first),
107 scenarioAgentsList[catalogRef.first]);
108 }
109 }
110
111
112 EditScenarioName::EditScenarioName(ScenarioInterface * const scenario,
113 ScenarioView * const scenarioView,
114 ScenarioInterface::Name const &newName,
115 QUndoCommand * parent)
116 : QUndoCommand (parent)
117 , scenario(scenario)
118 , scenarioView(scenarioView)
119 , newName(newName)
120 , oldName(scenario->getName())
121 {
122 setText("edited scenario name");
123 }
124
125 void EditScenarioName::redo()
126 {
127 scenario->setName(newName);
128 scenarioView->setName(newName);
129 }
130
131 void EditScenarioName::undo()
132 {
133 scenario->setName(oldName);
134 scenarioView->setName(oldName);
135 }
136
137 EditScenarioFile::EditScenarioFile(ScenarioInterface * const scenario,
138 ScenarioView * const scenarioView,
139 ScenarioInterface::ScenarioFile const &newFile,
140 QUndoCommand * parent)
141 : QUndoCommand (parent)
142 , scenario(scenario)
143 , scenarioView(scenarioView)
144 , newFile(newFile)
145 , oldFile(scenario->getScenarioFile())
146 {
147 setText("edited OpenSCENARIO file");
148 }
149
150 void EditScenarioFile::redo()
151 {
152 scenario->setScenarioFile(newFile);
153 scenarioView->setScenarioFile(newFile);
154 Q_EMIT scenarioView->refreshScenarioFile();
155 }
156
157 void EditScenarioFile::undo()
158 {
159 scenario->setScenarioFile(oldFile);
160 scenarioView->setScenarioFile(oldFile);
161 Q_EMIT scenarioView->refreshScenarioFile();
162 }
ScenarioView::modifiedScenarioFile
void modifiedScenarioFile()
Signal emitted when the open scenario file shall be modified.
ScenarioInterface::getScenarioFile
virtual ScenarioFile getScenarioFile() const =0
Returns the current name of the open scenario file to which this scenario setup refers.
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
EditScenarioName
Command class editing the scenario&#39;s name.
Definition: ScenarioPresenter.h:98
ScenarioPresenter::scenarioAgentsList
QMap< QString, QList< QString > > scenarioAgentsList
a map which holds a list of scenario agents (values) for each profiles catalogue (keys) ...
Definition: ScenarioPresenter.h:92
ScenarioPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: ScenarioPresenter.h:89
ScenarioPresenter::updateView
void updateView()
This method sets all display values of the view to the model values. This method is called after load...
Definition: ScenarioPresenter.cpp:87
ScenarioPresenter::scenarioAgentsPresenter
ScenarioAgentsPresenter * scenarioAgentsPresenter
a pointer to the presenter object of the scenario agent map
Definition: ScenarioPresenter.h:85
EditScenarioFile
Command class editing the OpenSCENARIO file.
Definition: ScenarioPresenter.h:121
ScenarioPresenter::setScenarioFile
void setScenarioFile()
Slot which is connected to the ScenarioView::modifiedScenarioFile signal. It will set the model&#39;s val...
Definition: ScenarioPresenter.cpp:45
ScenarioInterface::setName
virtual void setName(Name const &newName)=0
Sets the name of the scenario to the given name.
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
ScenarioPresenter::setName
void setName(QString const &name)
Slot which is connected to the ScenarioView::modifiedName signal. It will set the model&#39;s value for t...
Definition: ScenarioPresenter.cpp:39
ScenarioPresenter::setScenarioAgentsList
void setScenarioAgentsList()
This method fills the scenarioAgentsList map with all agent profiles referenced in the currently sele...
Definition: ScenarioPresenter.cpp:95
ScenarioView::getScenarioAgentsView
QTableView * getScenarioAgentsView() const
Method for returning the ui &#39;s table widget. Will be passed to the corresponding presenter object con...
Definition: ScenarioView.cpp:59
ScenarioInterface::Name
QString Name
The name of the scenario.
Definition: ScenarioInterface.h:42
ScenarioPresenter::project
ProjectInterface *const project
a pointer to the project interface, needed for accessing the configs path
Definition: ScenarioPresenter.h:88
ScenarioInterface::getEntities
virtual Entities * getEntities() const =0
Returns the map (= container class) in which all scenario agents information is registered. This comprises a name of the agent profile (key) and a catalogue reference (value).
ScenarioView::setName
void setName(QString const &name)
Method which sets the line edit text for the scenario name to the name passed as an argument...
Definition: ScenarioView.cpp:49
ScenarioPresenter::scenario
ScenarioInterface * scenario
a pointer to the scenario model whose values are edited by this presenter
Definition: ScenarioPresenter.h:86
ScenarioAgentsPresenter::update
void update()
Method which updates the table model according to the current entries of #entitites.
Definition: ScenarioAgentsPresenter.cpp:125
ScenarioPresenter::refreshScenarioFile
void refreshScenarioFile()
Slot which refreshes the current scenario file. This means that it checks whether the file exists and...
Definition: ScenarioPresenter.cpp:64
ScenarioView::setScenarioFileError
void setScenarioFileError(QString const &message)
Method which sets an error message below the scenario file&#39;s line edit.
Definition: ScenarioView.cpp:78
ScenarioPresenter.h
This class defines the presenter object which handles user events coming from the view (ScenarioView)...
ScenarioInterface::ScenarioFile
QString ScenarioFile
The name of the open scenario file.
Definition: ScenarioInterface.h:41
ScenarioView::modifiedName
void modifiedName(QString const &name)
Signal emitted when the name of the scenario has been modified by the user. Transmits the new name to...
ScenarioInterface::setScenarioFile
virtual void setScenarioFile(ScenarioFile const &filename)=0
Sets the filename of the open scenario file to the one passed as an argument.
ScenarioView::setScenarioFile
void setScenarioFile(QString const &filename)
Method which sets the line edit text for the open scenario file to the name passed as an argument...
Definition: ScenarioView.cpp:54
ProjectInterface::update
void update()
Triggers signal to inform that an item from the project configuration has been modified.
ScenarioView
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content ...
Definition: ScenarioView.h:42
TrafficSimulationXMLLoadModel.h
This class provides routines for loading the combination XML file and for storing all information in ...
ScenarioPresenter::scenarioView
ScenarioView * scenarioView
a pointer to the scenario view whose events are handled by this presenter
Definition: ScenarioPresenter.h:87
ScenarioInterface::getName
virtual Name getName() const =0
Returns the current name of the scenario.
ScenarioAgentsPresenter
This class describes the presenter object of the scenario agents map.
Definition: ScenarioAgentsPresenter.h:49
ScenarioView::refreshScenarioFile
void refreshScenarioFile()
Signal emitted when the open scenario file shall be refreshed.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
ScenarioView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "ScenarioView.h"
12 #include "ui_ScenarioView.h"
13
14 #include <QDir>
15 #include <QFileDialog>
16
17 ScenarioView::ScenarioView(QWidget *parent) :
18 QWidget(parent),
19 ui(new Ui::ScenarioView)
20 {
21 ui->setupUi(this);
22
23 QFont headerFont;
24 headerFont.setBold(true);
25 ui->ScenarioAgentsView->horizontalHeader()->setFont(headerFont);
26 ui->ScenarioAgentsView->installEventFilter(this);
27 }
28
29 ScenarioView::~ScenarioView()
30 {
31 delete ui;
32 }
33
34 void ScenarioView::on_NameEdit_editingFinished()
35 {
36 Q_EMIT modifiedName(ui->NameEdit->text());
37 }
38
39 void ScenarioView::on_ScenarioFileBrowse_clicked()
40 {
41 Q_EMIT modifiedScenarioFile();
42 }
43
44 void ScenarioView::on_ScenarioFileRefresh_clicked()
45 {
46 Q_EMIT refreshScenarioFile();
47 }
48
49 void ScenarioView::setName(const QString &name)
50 {
51 ui->NameEdit->setText(name);
52 }
53
54 void ScenarioView::setScenarioFile(const QString &filename)
55 {
56 ui->ScenarioFileEdit->setText(filename);
57 }
58
59 QTableView * ScenarioView::getScenarioAgentsView() const
60 {
61 return ui->ScenarioAgentsView;
62 }
63
64 bool ScenarioView::eventFilter(QObject *watched, QEvent *event)
65 {
66 QTableView* table = qobject_cast<QTableView*> (watched);
67
68 if( table && event->type() == QEvent::Resize )
69 {
70 int cell = (table->width())/3;
71 table->setColumnWidth(0, cell);
72 table->setColumnWidth(1, cell);
73 }
74
75 return false;
76 }
77
78 void ScenarioView::setScenarioFileError(QString const &message)
79 {
80 ui->ScenarioFileError->setText(message);
81 }
ScenarioView::modifiedScenarioFile
void modifiedScenarioFile()
Signal emitted when the open scenario file shall be modified.
ScenarioView::on_ScenarioFileRefresh_clicked
void on_ScenarioFileRefresh_clicked()
Qt Desinger-created slot activated when the Scenario File Refresh button is clicked by the user...
Definition: ScenarioView.cpp:44
Ui
Definition: EnvironmentDisplayView.h:29
ScenarioView::on_NameEdit_editingFinished
void on_NameEdit_editingFinished()
Qt Desinger-created slot activated when the line edit for the scenario name has been edited...
Definition: ScenarioView.cpp:34
ScenarioView::getScenarioAgentsView
QTableView * getScenarioAgentsView() const
Method for returning the ui &#39;s table widget. Will be passed to the corresponding presenter object con...
Definition: ScenarioView.cpp:59
ScenarioView::setName
void setName(QString const &name)
Method which sets the line edit text for the scenario name to the name passed as an argument...
Definition: ScenarioView.cpp:49
ScenarioView.h
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content ...
ScenarioView::setScenarioFileError
void setScenarioFileError(QString const &message)
Method which sets an error message below the scenario file&#39;s line edit.
Definition: ScenarioView.cpp:78
ScenarioView::modifiedName
void modifiedName(QString const &name)
Signal emitted when the name of the scenario has been modified by the user. Transmits the new name to...
ScenarioView::on_ScenarioFileBrowse_clicked
void on_ScenarioFileBrowse_clicked()
Qt Desinger-created slot activated when the Scenario File Browse button is clicked by the user...
Definition: ScenarioView.cpp:39
ScenarioView::setScenarioFile
void setScenarioFile(QString const &filename)
Method which sets the line edit text for the open scenario file to the name passed as an argument...
Definition: ScenarioView.cpp:54
ScenarioView::ui
Ui::ScenarioView * ui
the ui object containing the GUI elements of the view
Definition: ScenarioView.h:135
ScenarioView
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content ...
Definition: ScenarioView.h:42
ScenarioView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter. This filter catches the resize events of the table view in orde...
Definition: ScenarioView.cpp:64
ScenarioView::refreshScenarioFile
void refreshScenarioFile()
Signal emitted when the open scenario file shall be refreshed.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SelectedSystemItemView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
SelectedSystemItemView.cpp
1 #include "SelectedSystemItemView.h"
2 #include "ui_SelectedSystemItemView.h"
3
4 SelectedSystemItemView::SelectedSystemItemView(double probability, QWidget *parent) :
5 WidgetView(parent),
6 ui(new Ui::SelectedSystemItemView)
7 {
8 ui->setupUi(this);
9 ui->probability->setValue(probability);
10 }
11
12 SelectedSystemItemView::~SelectedSystemItemView()
13 {
14 delete ui;
15 }
16
17 void SelectedSystemItemView::on_remove_clicked()
18 {
19 Q_EMIT removeSystem(ui->System->text());
20 }
21
22 void SelectedSystemItemView::setSystem(const QString &name)
23 {
24 ui->System->setText(name);
25 }
26
27 QString SelectedSystemItemView::getSystem() const
28 {
29 return ui->System->text();
30 }
31
32 void SelectedSystemItemView::setIndex(unsigned int _index)
33 {
34 index = _index;
35 ui->selection_label->setText(QString("System %1:").arg(index));
36 }
37
38 unsigned int SelectedSystemItemView::getIndex() const
39 {
40 return index;
41 }
42
43 void SelectedSystemItemView::on_probability_editingFinished()
44 {
45 Q_EMIT modifiedProbability(ui->System->text(), ui->probability->value());
46 }
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
ScenarioView::ui
Ui::ScenarioView * ui
the ui object containing the GUI elements of the view
Definition: ScenarioView.h:135
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SelectedSystemItemView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
SelectedSystemItemView.h
1 #ifndef SELECTEDSYSTEMITEMVIEW_H
2 #define SELECTEDSYSTEMITEMVIEW_H
3
4 #include "Views/WidgetView.h"
5
6 #include <QString>
7
8 namespace Ui {
9 class SelectedSystemItemView;
10 }
11
12 class SelectedSystemItemView : public WidgetView
13 {
14 Q_OBJECT
15
16 public:
17 explicit SelectedSystemItemView(double probability, QWidget *parent = 0);
18 ~SelectedSystemItemView();
19
20 Q_SIGNALS:
21 void removeSystem(QString const &systemTitle);
22 void modifiedProbability(QString const &systemTitle, double value);
23
24 public Q_SLOTS:
25 void on_remove_clicked();
26 void on_probability_editingFinished();
27
28 public:
29 void setSystem(QString const &name);
30 QString getSystem() const;
31
32 public:
33 unsigned int getIndex() const ;
34 void setIndex(unsigned int _index);
35
36 private:
37 unsigned int index;
38 Ui::SelectedSystemItemView *ui;
39 };
40
41 #endif // SELECTEDSYSTEMITEMVIEW_H
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorItemModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
SensorItemModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "SensorItemModel.h"
12
13 #include "openPASS-AgentConfiguration/SensorMapInterface.h"
14
15 SensorPosition SensorItemModel::default_position ={ QString("Default"), .0, 0.0, 0.0, 0.0, 0.0, 0.0};
16
17 SensorItemModel::SensorItemModel(QObject *parent)
18 : SensorItemInterface(parent)
19 , position(default_position)
20 , profile(nullptr)
21 {
22
23 }
24
25 SensorPosition SensorItemModel::getSensorPosition() const
26 {
27 return position;
28 }
29
30 void SensorItemModel::setSensorPosition(SensorPosition const & _position)
31 {
32 position = _position;
33 }
34
35 SensorItemInterface::Profile * SensorItemModel::getSensorProfile() const
36 {
37 return profile;
38 }
39
40 void SensorItemModel::setSensorProfile(Profile * const _profile)
41 {
42 profile=_profile;
43 }
44
45
46 SensorItemInterface::ID SensorItemModel::getID() const
47 {
48 SensorMapInterface const * const map = qobject_cast<SensorMapInterface const * const > ( parent() );
49
50 return ( (map) ? map->getID( const_cast<SensorItemModel *> (this) ) : SensorItemInterface::ID() );
51 }
SensorItemModel::setSensorProfile
virtual void setSensorProfile(Profile *const _profile) override
Method which sets the sensor profile to the one passed as an argument.
Definition: SensorItemModel.cpp:40
SensorItemModel::position
SensorPosition position
the structure for storing sensor positioning data
Definition: SensorItemModel.h:43
SensorItemModel::setSensorPosition
virtual void setSensorPosition(SensorPosition const &_position) override
Method which sets the position of the sensor to the one passed as an argument.
Definition: SensorItemModel.cpp:30
SensorItemInterface
The SensorItemInterface class combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to a sensor data object.
Definition: SensorItemInterface.h:56
SensorMapInterface.h
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are ...
SensorItemModel::getSensorPosition
virtual SensorPosition getSensorPosition() const override
Method which returns the position of the sensor.
Definition: SensorItemModel.cpp:25
SensorPosition
This structure gathers all variables which specify a sensor position. This includes three spatial coo...
Definition: SensorItemInterface.h:39
SensorItemModel::default_position
static SensorPosition default_position
the default position structure
Definition: SensorItemModel.h:45
SensorMapInterface::getID
virtual SensorMapInterface::ID getID(SensorMapInterface::Item *const item) const =0
Method wich returns the id of the given sensor data object, if contained in the map. Otherwise an empty id is returned.
SensorItemModel::getSensorProfile
virtual Profile * getSensorProfile() const override
Method which returns the sensor profile which is currently used.
Definition: SensorItemModel.cpp:35
SensorItemModel.h
This class implements the functionality of SensorItemInterface.
SensorItemModel::getID
virtual ID getID() const override
Method which returns the id of this sensor, if this sensor is registered in a map (SensorMapInterface...
Definition: SensorItemModel.cpp:46
SensorProfileItemInterface
This class defines objects containing all relevant information on sensor profiles.
Definition: SensorProfileItemInterface.h:36
SensorMapInterface
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are ...
Definition: SensorMapInterface.h:36
SensorItemModel::profile
Profile * profile
the pointer to the sensor&#39;s profile
Definition: SensorItemModel.h:44
SensorItemInterface::ID
unsigned int ID
typedef for the sensor&#39;s key identifier
Definition: SensorItemInterface.h:62
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorMapModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
SensorMapModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "SensorMapModel.h"
12
13 #include "SensorItemModel.h"
14
15 SensorMapModel::SensorMapModel(QObject *parent)
16 : SensorMapInterface(parent)
17 {
18
19 }
20
21 SensorMapInterface::Iterator SensorMapModel::begin()
22 {
23 return sensors.begin();
24 }
25
26 SensorMapInterface::ConstIterator SensorMapModel::constBegin() const
27 {
28 return sensors.constBegin();
29 }
30
31 SensorMapInterface::Iterator SensorMapModel::end()
32 {
33 return sensors.end();
34 }
35
36 SensorMapInterface::ConstIterator SensorMapModel::constEnd() const
37 {
38 return sensors.constEnd();
39 }
40
41
42 bool SensorMapModel::add(const SensorMapInterface::ID &id)
43 {
44 if(!contains(id))
45 {
46 sensors.insert(id, new SensorItemModel(this));
47 return true;
48 }
49
50 return false;
51 }
52
53 bool SensorMapModel::add(SensorMapInterface::Item * const item)
54 {
55 SensorMapInterface::ID id = generateID();
56
57 if(!contains(id))
58 {
59 sensors.insert(id, item);
60 item->setParent(this);
61 return true;
62 }
63
64 return false;
65 }
66
67 bool SensorMapModel::remove(const SensorMapInterface::ID &id)
68 {
69 if(contains(id))
70 {
71 delete sensors.take(id);
72 return true;
73 }
74
75 return false;
76 }
77
78
79 bool SensorMapModel::remove(SensorMapInterface::Item * const item)
80 {
81
82 if(sensors.values().contains(item) )
83 {
84 SensorItemInterface::ID id = getID(item);
85 delete sensors.take(id);
86 return true;
87 }
88
89 return false;
90 }
91
92 SensorMapInterface::Item * SensorMapModel::getItem(SensorMapInterface::ID const & id) const
93 {
94 if(contains(id))
95 return sensors.value(id);
96
97 return nullptr;
98 }
99
100
101 SensorMapInterface::ID SensorMapModel::getID(Item * const item) const
102 {
103 return sensors.key(item);
104 }
105
106 void SensorMapModel::setID(Item * const item,
107 SensorMapInterface::ID const &id)
108 {
109
110 SensorMapInterface::ID oldID = getID(item);
111
112 sensors.take(oldID);
113 sensors.insert(id, item);
114 }
115
116 SensorMapInterface::ID SensorMapModel::generateID()
117 {
118 SensorMapInterface::ID id = 1;
119 for (SensorMapInterface::ID key : sensors.keys())
120 {
121 if (id <= key)
122 {
123 id = key + 1;
124 }
125 }
126 return id;
127 }
128
129 bool SensorMapModel::contains(const SensorMapInterface::ID &id) const
130 {
131 return sensors.contains(id);
132 }
133
134 QList<SensorMapInterface::ID> SensorMapModel::keys() const
135 {
136 return sensors.keys();
137 }
138
139 QList <SensorItemInterface*> SensorMapModel::values() const
140 {
141 return sensors.values();
142 }
143
144 int SensorMapModel::count() const
145 {
146 return sensors.count();
147 }
148
149 void SensorMapModel::clear()
150 {
151 qDeleteAll(sensors);
152 sensors.clear();
153 }
SensorMapModel::setID
virtual void setID(SensorMapInterface::Item *const item, SensorMapInterface::ID const &id) override
Method wich changes the id of the given sensor data object to the one passed as second argument...
Definition: SensorMapModel.cpp:106
SensorMapModel::getID
virtual SensorMapInterface::ID getID(SensorMapInterface::Item *const item) const override
Method wich returns the id of the given sensor data object, if contained in the map. Otherwise an empty id is returned.
Definition: SensorMapModel.cpp:101
SensorMapModel.h
This class implements the functionality of SensorMapInterface.
SensorItemInterface
The SensorItemInterface class combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to a sensor data object.
Definition: SensorItemInterface.h:56
SensorMapModel::keys
virtual QList< ID > keys() const override
Method which returns the list of all ids used in the map.
Definition: SensorMapModel.cpp:134
SensorMapModel::add
virtual bool add(SensorMapInterface::ID const &id) override
Method which creates a sensor data object (instance of SensorItemInterface) and adds it to the map un...
Definition: SensorMapModel.cpp:42
SensorItemModel
This class implements the functionality of SensorItemInterface.
Definition: SensorItemModel.h:25
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73
SensorMapModel::constBegin
virtual SensorMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first sensor data object in the map (use for read-only since pointin...
Definition: SensorMapModel.cpp:26
SensorMapModel::begin
virtual SensorMapInterface::Iterator begin() override
Gets an iterator pointing to the first sensor data object in the map.
Definition: SensorMapModel.cpp:21
SensorMapInterface::Iterator
Map::Iterator Iterator
typedef for an iterator
Definition: SensorMapInterface.h:47
SensorMapModel::constEnd
virtual SensorMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last sensor data object (use for read-only)...
Definition: SensorMapModel.cpp:36
SensorMapModel::clear
virtual void clear() override
Method which deletes all sensor data objects and clears the map.
Definition: SensorMapModel.cpp:149
SensorMapModel::contains
virtual bool contains(SensorMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor data object of the given id. ...
Definition: SensorMapModel.cpp:129
SensorMapModel::remove
virtual bool remove(SensorMapInterface::ID const &id) override
Method which removes the sensor data object with the given id from the map. The object is deleted aft...
Definition: SensorMapModel.cpp:67
SensorMapModel::end
virtual SensorMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last dsensor data object.
Definition: SensorMapModel.cpp:31
SensorMapModel::values
virtual QList< Item * > values() const override
Method which returns the list of all sensor data objects registered in this map.
Definition: SensorMapModel.cpp:139
SensorItemModel.h
This class implements the functionality of SensorItemInterface.
SensorMapModel::generateID
virtual SensorMapInterface::ID generateID() override
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
Definition: SensorMapModel.cpp:116
SensorMapInterface
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are ...
Definition: SensorMapInterface.h:36
SensorItemInterface::ID
unsigned int ID
typedef for the sensor&#39;s key identifier
Definition: SensorItemInterface.h:62
SensorMapModel::count
virtual int count() const override
Method which returns the number of items in the map.
Definition: SensorMapModel.cpp:144
SensorMapModel::getItem
virtual SensorMapInterface::Item * getItem(SensorMapInterface::ID const &id) const override
Method which returns a pointer to the sensor data object specified by the given id. If the map does not contain an object with the given id, nullptr is returned.
Definition: SensorMapModel.cpp:92
SensorMapInterface::ID
SensorItemInterface::ID ID
typedef for the id of the sensor data object
Definition: SensorMapInterface.h:42
SensorMapInterface::ConstIterator
Map::ConstIterator ConstIterator
typedef for a constant iterator (read-only operations)
Definition: SensorMapInterface.h:48
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileItemModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
SensorProfileItemModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "SensorProfileItemModel.h"
12
13 #include "openPASS-AgentConfiguration/SensorProfileMapInterface.h"
14
15 #include "ParameterMapModel.h"
16
17 SensorProfileItemModel::SensorProfileItemModel(QObject *parent)
18 : SensorProfileItemInterface(parent)
19 , parameters(new ParameterMapModel(this))
20 {
21
22 }
23
24 SensorProfileItemInterface::Name SensorProfileItemModel::getName() const
25 {
26 SensorProfileMapInterface const * const map = qobject_cast<SensorProfileMapInterface const * const > ( parent() );
27
28 return ( (map) ? map->getID( const_cast<SensorProfileItemModel *> (this) ).first : SensorProfileItemInterface::Name() );
29 }
30
31
32 SensorProfileItemInterface::Type SensorProfileItemModel::getType() const
33 {
34 SensorProfileMapInterface const * const map = qobject_cast<SensorProfileMapInterface const * const > ( parent() );
35
36 return ( (map) ? map->getID( const_cast<SensorProfileItemModel *> (this) ).second : SensorProfileItemInterface::Type() );
37 }
38
39
40 SensorProfileItemInterface::Parameters * SensorProfileItemModel::getParameters() const
41 {
42 return parameters;
43 }
44
45 SensorProfileItemInterface::ID SensorProfileItemModel::getID() const
46 {
47 SensorProfileMapInterface const * const map = qobject_cast<SensorProfileMapInterface const * const > ( parent() );
48
49 return ( (map) ? map->getID(const_cast<SensorProfileItemModel *> (this)) : SensorProfileItemInterface::ID() );
50 }
ParameterMapModel.h
This class implements the functionality of ParameterMapInterface.
SensorProfileMapInterface.h
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
SensorProfileItemModel::getParameters
virtual Parameters * getParameters() const override
Method which returns the parameter map of this sensor profile (instance of ParameterMapInterface).
Definition: SensorProfileItemModel.cpp:40
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
SensorProfileItemModel::getType
virtual Type getType() const override
Method which returns the type (implementation) of the sensor adressed by this profile.
Definition: SensorProfileItemModel.cpp:32
SensorProfileItemModel::getID
virtual ID getID() const override
Method which returns the identifier of the sensor profile, i.e. the pair of name and type...
Definition: SensorProfileItemModel.cpp:45
ParameterMapModel
This class implements the functionality of ParameterMapInterface.
Definition: ParameterMapModel.h:25
SensorProfileItemModel::parameters
Parameters *const parameters
pointer to the parameter map of the sensor profile
Definition: SensorProfileItemModel.h:44
SensorProfileItemInterface::ID
QPair< Name, Type > ID
typedef for the identifier of a sensor profile, i.e. its name and type
Definition: SensorProfileItemInterface.h:44
SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
Definition: SensorProfileMapInterface.h:41
SensorProfileItemInterface::Name
QString Name
typedef for the sensor profile&#39;s name
Definition: SensorProfileItemInterface.h:42
SensorProfileMapInterface::getID
virtual SensorProfileMapInterface::ID getID(SensorProfileMapInterface::Item *const item) const =0
Method wich returns the Id of the given sensor profile.
SensorProfileItemModel::getName
virtual Name getName() const override
Method which returns the name of the sensor profile.
Definition: SensorProfileItemModel.cpp:24
SensorProfileItemInterface
This class defines objects containing all relevant information on sensor profiles.
Definition: SensorProfileItemInterface.h:36
SensorProfileItemModel.h
This class implements the functionality of SensorProfileItemInterface.
SensorProfileItemInterface::Type
QString Type
typedef for the sensor&#39;s type (implementation)
Definition: SensorProfileItemInterface.h:43
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileMapModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
SensorProfileMapModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "SensorProfileMapModel.h"
12
13 #include "SensorProfileItemModel.h"
14
15 SensorProfileMapModel::SensorProfileMapModel(QObject *parent)
16 : SensorProfileMapInterface(parent)
17 {
18
19 }
20
21 SensorProfileMapInterface::Iterator SensorProfileMapModel::begin()
22 {
23 return sensorProfiles.begin();
24 }
25
26 SensorProfileMapInterface::ConstIterator SensorProfileMapModel::constBegin() const
27 {
28 return sensorProfiles.constBegin();
29 }
30
31 SensorProfileMapInterface::Iterator SensorProfileMapModel::end()
32 {
33 return sensorProfiles.end();
34 }
35
36 SensorProfileMapInterface::ConstIterator SensorProfileMapModel::constEnd() const
37 {
38 return sensorProfiles.constEnd();
39 }
40
41
42 bool SensorProfileMapModel::add(const SensorProfileMapInterface::ID &id)
43 {
44 if(!contains(id))
45 {
46 sensorProfiles.insert(id, new SensorProfileItemModel(this));
47 return true;
48 }
49
50 return false;
51 }
52
53 bool SensorProfileMapModel::remove(const SensorProfileMapInterface::ID &id)
54 {
55 if(contains(id))
56 {
57 delete sensorProfiles.take(id);
58 return true;
59 }
60
61 return false;
62 }
63
64 SensorProfileMapInterface::Item * SensorProfileMapModel::getItem(SensorProfileMapInterface::ID const & id) const
65 {
66 if(contains(id))
67 return sensorProfiles.value(id);
68
69 return nullptr;
70 }
71
72
73 SensorProfileMapInterface::ID SensorProfileMapModel::getID(Item * const item) const
74 {
75 return sensorProfiles.key(item);
76 }
77
78 void SensorProfileMapModel::setID(Item * const item,
79 SensorProfileMapInterface::ID const &id)
80 {
81
82 SensorProfileMapInterface::ID oldID = getID(item);
83
84 sensorProfiles.take(oldID);
85 sensorProfiles.insert(id, item);
86 }
87
88 SensorProfileMapInterface::Name SensorProfileMapModel::generateName(SensorProfileMapInterface::Type type)
89 {
90 int index = 1;
91 QString name = QString("Standard %1").arg(index);
92 SensorProfileMapInterface::ID id;
93
94 id = SensorProfileMapInterface::ID(name, type);
95
96 while( contains(id) )
97 {
98 index++;
99 name = QString("Standard %1").arg(index);
100 id = SensorProfileMapInterface::ID(name, type);
101 }
102
103 return name;
104
105 }
106
107 bool SensorProfileMapModel::contains(const SensorProfileMapInterface::ID &id) const
108 {
109 return sensorProfiles.contains(id);
110 }
111
112 QList<SensorProfileMapInterface::ID> SensorProfileMapModel::keys() const
113 {
114 return sensorProfiles.keys();
115 }
116
117 QList <SensorProfileItemInterface*> SensorProfileMapModel::values() const
118 {
119 return sensorProfiles.values();
120 }
121
122 int SensorProfileMapModel::count() const
123 {
124 return sensorProfiles.count();
125 }
126
127 void SensorProfileMapModel::clear()
128 {
129 qDeleteAll(sensorProfiles);
130 sensorProfiles.clear();
131 }
SensorProfileMapModel::keys
virtual QList< ID > keys() const override
Method which returns the list of all sensor profile Ids in the map.
Definition: SensorProfileMapModel.cpp:112
SensorProfileMapModel::count
virtual int count() const override
Method which returns the number of sensor profiles in the map.
Definition: SensorProfileMapModel.cpp:122
SensorProfileMapModel::values
virtual QList< Item * > values() const override
Method which returns a list of pointers to all sensor profiles in the map.
Definition: SensorProfileMapModel.cpp:117
SensorProfileMapModel::generateName
virtual Name generateName(Type type) override
Method wich generates a default name of the pattern "Standard %1" for a sensor profile of the given t...
Definition: SensorProfileMapModel.cpp:88
SensorProfileMapModel::constEnd
virtual SensorProfileMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last sensor profile (use for read-only)...
Definition: SensorProfileMapModel.cpp:36
SensorProfileMapModel::getItem
virtual SensorProfileMapInterface::Item * getItem(SensorProfileMapInterface::ID const &id) const override
Method which returns a pointer to the sensor profile with the given Id. If the map does not contain a...
Definition: SensorProfileMapModel.cpp:64
SensorProfileMapModel::clear
virtual void clear() override
Method which deletes all registered sensor profiles and clears the map.
Definition: SensorProfileMapModel.cpp:127
SensorProfileMapModel::add
virtual bool add(SensorProfileMapInterface::ID const &id) override
Method which creates a new sensor profile (instance of SensorProfileItemInterface) and adds it to the...
Definition: SensorProfileMapModel.cpp:42
SensorProfileMapModel::constBegin
virtual SensorProfileMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first sensor profile in the map (use for read-only since pointing at...
Definition: SensorProfileMapModel.cpp:26
SensorProfileMapModel::begin
virtual SensorProfileMapInterface::Iterator begin() override
Gets an iterator pointing to the first sensor profile in the map.
Definition: SensorProfileMapModel.cpp:21
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72
SensorProfileItemModel
This class implements the functionality of SensorProfileItemInterface.
Definition: SensorProfileItemModel.h:25
SensorProfileMapModel::end
virtual SensorProfileMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last sensor profile.
Definition: SensorProfileMapModel.cpp:31
SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
Definition: SensorProfileMapInterface.h:41
SensorProfileMapModel::setID
virtual void setID(SensorProfileMapInterface::Item *const item, SensorProfileMapInterface::ID const &id) override
Method wich changes the Id of the given sensor profile to the one passed as second argument...
Definition: SensorProfileMapModel.cpp:78
SensorProfileMapModel::contains
virtual bool contains(SensorProfileMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor profile with the given Id.
Definition: SensorProfileMapModel.cpp:107
SensorProfileMapInterface::Type
SensorProfileItemInterface::Type Type
typedef for the sensor type (i.e. its algorithm/implementation)
Definition: SensorProfileMapInterface.h:48
SensorProfileMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: SensorProfileMapInterface.h:54
SensorProfileMapModel::remove
virtual bool remove(SensorProfileMapInterface::ID const &id) override
Method which removes the sensor profile with the given Id from the map. The profile is deleted after ...
Definition: SensorProfileMapModel.cpp:53
SensorProfileMapInterface::Name
SensorProfileItemInterface::Name Name
typedef for the sensor profiles name
Definition: SensorProfileMapInterface.h:47
SensorProfileItemInterface
This class defines objects containing all relevant information on sensor profiles.
Definition: SensorProfileItemInterface.h:36
SensorProfileMapModel::getID
virtual SensorProfileMapInterface::ID getID(SensorProfileMapInterface::Item *const item) const override
Method wich returns the Id of the given sensor profile.
Definition: SensorProfileMapModel.cpp:73
SensorProfileMapModel.h
This class implements the functionality of SensorProfileMapInterface.
SensorProfileMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: SensorProfileMapInterface.h:55
SensorProfileItemModel.h
This class implements the functionality of SensorProfileItemInterface.
SensorProfileMapInterface::ID
QPair< Name, Type > ID
typedef for the pair of name and type used as an Id
Definition: SensorProfileMapInterface.h:49
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ServiceInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS
  • Interfaces
  • openPASS
ServiceInterface.h File Reference

... More...

Detailed Description

...

Definition in file ServiceInterface.h.

Go to the source code of this file.

Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ServiceInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS
  • Interfaces
  • openPASS
ServiceInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef SERVICEINTERFACE_H
18 #define SERVICEINTERFACE_H
19
20 #include "openPASS/ServiceManagerInterface.h"
21
22 constexpr ServiceManagerInterface::ID ServiceManagerInterfaceID(
23 char const * string, unsigned int value = 0)
24 {
25 return *string ? ServiceManagerInterfaceID(
26 string + 1, value + *string * *string) : value;
27 }
28
29 template <typename Interface, ServiceManagerInterface::ID ID>
30 class ServiceInterface
31 {
32 public:
33 explicit ServiceInterface(ServiceManagerInterface::Service * const service)
34 {
35 ServiceManagerInterface::instance()->add(ID, service);
36 }
37
38 virtual ~ServiceInterface()
39 {
40 ServiceManagerInterface::instance()->remove(ID);
41 }
42
43 public:
44 static Interface * instance()
45 {
46 ServiceManagerInterface const * const services =
47 ServiceManagerInterface::instance();
48 return services ? dynamic_cast<Interface *>(services->get(ID)) : nullptr;
49 }
50 };
51
52 #endif // SERVICEINTERFACE_H
ServiceManagerInterface.h
...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ServiceManagerInterface.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS
  • Interfaces
  • openPASS
ServiceManagerInterface.h File Reference

... More...

Detailed Description

...

Definition in file ServiceManagerInterface.h.

Go to the source code of this file.

Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ServiceManagerInterface.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS
  • Interfaces
  • openPASS
ServiceManagerInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2017 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
16
17 #ifndef SERVICEMANAGERINTERFACE_H
18 #define SERVICEMANAGERINTERFACE_H
19
20 #include <QList>
21 #include <QObject>
22
23 class ServiceManagerInterface
24 {
25 public:
26 using ID = unsigned int;
27 using Service = QObject;
28
29 public:
30 using IDList = QList<ServiceManagerInterface::ID>;
31
32 public:
33 virtual ~ServiceManagerInterface() = default;
34
35 public:
36 virtual void add(ServiceManagerInterface::ID const & id,
37 ServiceManagerInterface::Service * const service) = 0;
38 virtual bool remove(ServiceManagerInterface::ID const & id) = 0;
39 virtual bool exists(ServiceManagerInterface::ID const & id) const = 0;
40 virtual ServiceManagerInterface::IDList list() const = 0;
41 virtual ServiceManagerInterface::Service * get(ServiceManagerInterface::ID const & id) const = 0;
42
43 public:
44 static ServiceManagerInterface * instance(ServiceManagerInterface * const _services = nullptr)
45 {
46 static ServiceManagerInterface * services = nullptr;
47 if (_services != nullptr)
48 {
49 services = _services;
50 }
51 return services;
52 }
53 };
54
55 #endif // SERVICEMANAGERINTERFACE_H
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SpinBoxView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SpinBoxView.cpp
1 #include "Views/SpinBoxView.h"
2
3 #include <QWheelEvent>
4
5 SpinBoxView::SpinBoxView(QWidget * const parent)
6 : QSpinBox(parent)
7 {
8 setFocusPolicy(Qt::StrongFocus);
9 }
10
11 void SpinBoxView::wheelEvent(QWheelEvent * event)
12 {
13 if (!hasFocus())
14 {
15 event->ignore();
16 }
17 else
18 {
19 QSpinBox::wheelEvent(event);
20 }
21 }
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SpinBoxView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SpinBoxView.h
1 #ifndef SPINBOXVIEW_H
2 #define SPINBOXVIEW_H
3
4 #include <QSpinBox>
5
6 class SpinBoxView : public QSpinBox
7 {
8 Q_OBJECT
9
10 public:
11 explicit SpinBoxView(QWidget * const parent = nullptr);
12 virtual ~SpinBoxView() = default;
13
14 protected:
15 virtual void wheelEvent(QWheelEvent * event) override;
16 };
17
18 #endif // SPINBOXVIEW_H
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: StatusBarView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
StatusBarView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "StatusBarView.h"
12 #include "ui_StatusBarView.h"
13
14 QMap<StatusBarView::Color, QColor> StatusBarView::colorMap = { {StatusBarView::Color::Error, QColor(189,79,79)},
15 {StatusBarView::Color::Note, QColor(116,189,79)},
16 {StatusBarView::Color::Warning, QColor(255, 204, 0)},
17 {StatusBarView::Color::Message, QColor("black")} };
18
19 StatusBarView::StatusBarView(QWidget *parent) :
20 QWidget(parent),
21 ui(new Ui::StatusBarView)
22 {
23 ui->setupUi(this);
24 ui->StatusText->setText("");
25 }
26
27 StatusBarView::~StatusBarView()
28 {
29 delete ui;
30 }
31
32
33 void StatusBarView::on_button_clicked()
34 {
35 ui->StatusText->setVisible(!ui->StatusText->isVisible());
36 }
37
38
39 void StatusBarView::showText(QString text, Color color)
40 {
41 ui->StatusText->setTextColor(colorMap[color]);
42 ui->StatusText->setText(text);
43 }
44
45 void StatusBarView::show()
46 {
47 ui->button->setChecked(true);
48 ui->StatusText->setVisible(true);
49 }
50
51 void StatusBarView::hide()
52 {
53 ui->button->setChecked(false);
54 ui->StatusText->setVisible(false);
55 }
StatusBarView::ui
Ui::StatusBarView * ui
The ui object defining the status bar&#39;s appearance. It contains a QTextBrowser and a QPushButton obje...
Definition: StatusBarView.h:86
Ui
Definition: EnvironmentDisplayView.h:29
StatusBarView.h
This class defines a status bar.
StatusBarView::show
virtual void show()
Reimplementation of show. Sets the visible status of the text browser and the checked status of the b...
Definition: StatusBarView.cpp:45
StatusBarView::showText
void showText(QString text, Color color)
Method which displays the given text in the given color in the text browser.
Definition: StatusBarView.cpp:39
StatusBarView::colorMap
static QMap< Color, QColor > colorMap
the map containing the colors depending on the message type.
Definition: StatusBarView.h:85
StatusBarView::on_button_clicked
void on_button_clicked()
This slot is triggered when the hide/show button is clicked. Hides or shows the status bar...
Definition: StatusBarView.cpp:33
StatusBarView::hide
virtual void hide()
Reimplementation of hide. Sets the visible status of the text browser and the checked status of the b...
Definition: StatusBarView.cpp:51
StatusBarView
This class defines a status bar.
Definition: StatusBarView.h:39
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemBaseView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemBaseView.cpp
1 #include "Views/SystemBaseView.h"
2
3 #include "openPASS-System/SystemComponentInputItemInterface.h"
4 #include "openPASS-System/SystemComponentOutputItemInterface.h"
5 #include "openPASS-System/SystemComponentItemInterface.h"
6 #include "openPASS-System/SystemItemInterface.h"
7 #include "Views/SystemComponentInputItemView.h"
8 #include "Views/SystemComponentOutputItemView.h"
9 #include "Views/SystemComponentItemView.h"
10 #include <QEvent>
11 #include <QPainter>
12 #include <QPainterPath>
13 #include <QPaintEvent>
14 #include <QSignalBlocker>
15
16 QPoint const SystemBaseView::FrameSize = QPoint(40, 20);
17 QMap<bool, QColor> const SystemBaseView::ConnectionsCurveColorMap = {
18 {false, QColor(QStringLiteral("#cdcdcd"))},
19 {true, QColor(QStringLiteral("#777777"))},
20 };
21
22 SystemBaseView::SystemBaseView(SystemItemInterface * const system,
23 QWidget * const parent)
24 : QWidget(parent)
25 , system(system)
26 , componentsModifyMode(false)
27 , connectionsModifyMode(false)
28 , inputActive(nullptr)
29 , inputConnection(nullptr)
30 , outputActive(nullptr)
31 , outputConnection(nullptr)
32 , internalConnectionsCurveMap({{false, {}}, {true, {}}})
33 {
34 // Connect SystemComponent*Interface with SystemBaseView
35 connect(system->getComponents(), &SystemComponentMapInterface::mode,
36 this, &SystemBaseView::componentsMode);
37 connect(system->getComponents(), &SystemComponentMapInterface::cleared,
38 this, &SystemBaseView::componentsClear);
39 connect(system->getComponents(), &SystemComponentMapInterface::added,
40 this, &SystemBaseView::componentsAdd);
41 connect(system->getComponents(), &SystemComponentMapInterface::removed,
42 this, &SystemBaseView::componentsRemove);
43 connect(system->getConnections(), &SystemConnectionMapInterface::mode,
44 this, &SystemBaseView::connectionsMode);
45 connect(system->getConnections(), &SystemConnectionMapInterface::modified,
46 this, &SystemBaseView::connectionsUpdate);
47
48 // Update size
49 updateSize();
50 }
51
52 void SystemBaseView::updateInternalComponents()
53 {
54 // Update SystemComponentItemInterface to SystemComponentItemView map
55 internalComponentsMap.clear();
56 for (SystemComponentItemView * const componentView : findChildren<SystemComponentItemView *>(
57 QString(), Qt::FindDirectChildrenOnly))
58 {
59 internalComponentsMap.insert(componentView->getInterface(), componentView);
60 }
61
62 // Update SystemComponentInputItemInterface to SystemComponentInputItemView map
63 internalComponentsInputMap.clear();
64 for (SystemComponentInputItemView * const inputView : findChildren<SystemComponentInputItemView *>())
65 {
66 internalComponentsInputMap.insert(inputView->getInterface(), inputView);
67 }
68
69 // Update SystemComponentOutputItemInterface to SystemComponentOutputItemView map
70 internalComponentsOutputMap.clear();
71 for (SystemComponentOutputItemView * const outputView : findChildren<SystemComponentOutputItemView *>())
72 {
73 internalComponentsOutputMap.insert(outputView->getInterface(), outputView);
74 }
75 }
76
77 void SystemBaseView::updateInternalConnections()
78 {
79 // Update SystemComponentInputItemView list and SystemComponentOutputItemView list with connections
80 internalConnectionsInputList.clear();
81 internalConnectionsOutputList.clear();
82 for (SystemConnectionItemInterface const * const relation : *system->getConnections())
83 {
84 if ((internalComponentsInputMap.contains(relation->getTarget())) &&
85 (!internalConnectionsInputList.contains(internalComponentsInputMap[relation->getTarget()])))
86 {
87 internalConnectionsInputList.append(internalComponentsInputMap[relation->getTarget()]);
88 }
89 if ((internalComponentsOutputMap.contains(relation->getSource())) &&
90 (!internalConnectionsOutputList.contains(internalComponentsOutputMap[relation->getSource()])))
91 {
92 internalConnectionsOutputList.append(internalComponentsOutputMap[relation->getSource()]);
93 }
94 }
95 }
96
97 void SystemBaseView::updateInternalConnectionsCurves()
98 {
99 // Update list of connection curves indexed by connection selection
100 internalConnectionsCurveMap[false].clear();
101 internalConnectionsCurveMap[true].clear();
102 for (SystemConnectionItemInterface const * const connection : *system->getConnections())
103 {
104 // Is connection valid?
105 if (internalComponentsOutputMap.contains(connection->getSource()) &&
106 internalComponentsMap.contains(connection->getSource()->getComponent()) &&
107 internalComponentsInputMap.contains(connection->getTarget()) &&
108 internalComponentsMap.contains(connection->getTarget()->getComponent()))
109 {
110 // Is connection selected?
111 bool const selected =
112 ((inputActive != nullptr) && (connection->getTarget() == inputActive->getInterface())) ||
113 ((outputActive != nullptr) && (connection->getSource() == outputActive->getInterface()));
114
115 // Calculate connection curve
116 QPoint point0 = internalComponentsMap[connection->getSource()->getComponent()]->pos();
117 QPoint point1 = internalComponentsMap[connection->getTarget()->getComponent()]->pos();
118 if (point0.x() - point1.x() > 0)
119 {
120 point0 += (internalComponentsOutputMap[connection->getSource()]->geometry().topLeft() + QPoint(0, 11));
121 point1 += (internalComponentsInputMap[connection->getTarget()]->geometry().topRight() + QPoint(0, 11));
122 }
123 else
124 {
125 point0 += (internalComponentsOutputMap[connection->getSource()]->geometry().topRight() + QPoint(0, 11));
126 point1 += (internalComponentsInputMap[connection->getTarget()]->geometry().topLeft() + QPoint(0, 11));
127 }
128
129 // Store connection curve
130 internalConnectionsCurveMap[selected].append({point0, point1});
131 }
132 }
133
134 // Update widget
135 update();
136 }
137
138 void SystemBaseView::updateSize()
139 {
140 // Initialize size
141 QSize size = QSize(0, 0);
142
143 // Calculate required space by components
144 QRect space;
145 for (SystemComponentItemView * const componentView : internalComponentsMap)
146 {
147 space = space.united(componentView->geometry());
148 }
149
150 // Is the component space valid?
151 if (space.isValid())
152 {
153 // Is the component space correctly framed?
154 if (space.topLeft() != FrameSize)
155 {
156 // Move all components to be correctly framed
157 QPoint const pointMoveBy = FrameSize - space.topLeft();
158 for (SystemComponentItemView * const componentView : internalComponentsMap)
159 {
160 // Block component view and move component interface
161 QSignalBlocker blocker(componentView);
162 componentView->getInterface()->setPosition(
163 componentView->getInterface()->getPosition() + pointMoveBy);
164 blocker.unblock();
165 }
166
167 // Move component space
168 space.moveTo(FrameSize);
169 }
170
171 // Set size to component space in frame
172 QPoint const pointBottomRight = space.bottomRight() + FrameSize;
173 size = QSize(pointBottomRight.x(), pointBottomRight.y());
174 }
175
176 // Update size
177 resize(size);
178
179 // Update connection curves internals
180 updateInternalConnectionsCurves();
181 }
182
183 void SystemBaseView::componentsMode(bool const & modify)
184 {
185 // Update component modify mode and components
186 componentsModifyMode = modify;
187 componentsUpdate();
188 }
189
190 void SystemBaseView::componentsUpdate()
191 {
192 // Is the component modify mode inactive?
193 if (!componentsModifyMode)
194 {
195 // Update component internals and size
196 updateInternalComponents();
197 updateSize();
198 }
199 }
200
201 void SystemBaseView::componentsClear()
202 {
203 // Destroy all internal stored component views
204 for (SystemComponentItemView * const componentView : internalComponentsMap)
205 {
206 // Destroy component view
207 delete componentView;
208 }
209
210 // Update components
211 componentsUpdate();
212 }
213
214 void SystemBaseView::componentsAdd(SystemComponentItemInterface * const component)
215 {
216 // Create component view
217 SystemComponentItemView * const componentView = new SystemComponentItemView(component, this);
218
219 // Connect SystemComponentItemView with SystemBaseView
220 connect(componentView, &SystemComponentItemView::moved,
221 this, &SystemBaseView::updateSize);
222 connect(componentView, &SystemComponentItemView::inputMouseEnter,
223 this, &SystemBaseView::inputMouseEnter);
224 connect(componentView, &SystemComponentItemView::inputMouseLeave,
225 this, &SystemBaseView::inputMouseLeave);
226 connect(componentView, &SystemComponentItemView::inputConnectionAdd,
227 this, &SystemBaseView::inputConnectionAdd);
228 connect(componentView, &SystemComponentItemView::inputConnectionRemove,
229 this, &SystemBaseView::inputConnectionRemove);
230 connect(componentView, &SystemComponentItemView::outputMouseEnter,
231 this, &SystemBaseView::outputMouseEnter);
232 connect(componentView, &SystemComponentItemView::outputMouseLeave,
233 this, &SystemBaseView::outputMouseLeave);
234 connect(componentView, &SystemComponentItemView::outputConnectionAdd,
235 this, &SystemBaseView::outputConnectionAdd);
236 connect(componentView, &SystemComponentItemView::outputConnectionRemove,
237 this, &SystemBaseView::outputConnectionRemove);
238 connect(componentView, &SystemComponentItemView::pressEscape,
239 this, &SystemBaseView::pressEscape);
240
241 // Update components
242 componentsUpdate();
243 }
244
245 void SystemBaseView::componentsRemove(SystemComponentItemInterface * const component)
246 {
247 // Does the component interface have a corresponding component view?
248 if (internalComponentsMap.contains(component))
249 {
250 // Destroy corresponding component view
251 delete internalComponentsMap[component];
252
253 // Update components
254 componentsUpdate();
255 }
256 }
257
258 void SystemBaseView::connectionsMode(bool const & modify)
259 {
260 // Update connection modify mode and connections
261 connectionsModifyMode = modify;
262 connectionsUpdate();
263 }
264
265 void SystemBaseView::connectionsUpdate()
266 {
267 // Is the connection modify mode inactive?
268 if (!connectionsModifyMode)
269 {
270 // Update connection internals
271 updateInternalConnections();
272 updateInternalConnectionsCurves();
273 }
274 }
275
276 void SystemBaseView::inputMouseEnter(SystemComponentInputItemView * const input)
277 {
278 // Update active input
279 inputActive = input;
280
281 // Does the active input have any connections?
282 if (internalConnectionsInputList.contains(input))
283 {
284 // Update connection curves internals
285 updateInternalConnectionsCurves();
286 }
287 }
288
289 void SystemBaseView::inputMouseLeave(SystemComponentInputItemView * const input)
290 {
291 // Has this event been emitted by the active input?
292 if (inputActive == input)
293 {
294 // Reset active input
295 inputActive = nullptr;
296
297 // Does the previous active input have any connections?
298 if (internalConnectionsInputList.contains(input))
299 {
300 // Update connection curves internals
301 updateInternalConnectionsCurves();
302 }
303 }
304 }
305
306 void SystemBaseView::inputConnectionAdd(SystemComponentInputItemView * const input)
307 {
308 // Have we already selected the input interface?
309 if (inputConnection == input)
310 {
311 // Reset input interface
312 inputConnection = nullptr;
313
314 // Enable all input widgets
315 for (SystemComponentInputItemView * const inputView : internalComponentsInputMap)
316 {
317 inputView->setAddEnabled(true);
318 }
319
320 // Uncheck input widget
321 input->setAddChecked(false);
322
323 // Enable all output widgets
324 for (SystemComponentOutputItemView * const outputView : internalComponentsOutputMap)
325 {
326 outputView->setAddEnabled(true);
327 }
328 }
329 // Have we selected an output interface?
330 else if (outputConnection)
331 {
332 // Add connection between output and input
333 system->getConnections()->add(outputConnection->getInterface(),
334 input->getInterface());
335
336 // Uncheck output widget
337 outputConnection->setAddChecked(false);
338
339 // Reset output interface
340 outputConnection = nullptr;
341
342 // Enable all output widgets
343 for (SystemComponentOutputItemView * const outputView : internalComponentsOutputMap)
344 {
345 outputView->setAddEnabled(true);
346 }
347
348 // Uncheck input widget
349 input->setAddChecked(false);
350
351 // Enable all input widgets
352 for (SystemComponentInputItemView * const inputView : internalComponentsInputMap)
353 {
354 inputView->setAddEnabled(true);
355 }
356 }
357 // No output interface nor input interface is selected
358 else
359 {
360 // Select input interface
361 inputConnection = input;
362
363 // Disable all input widgets
364 for (SystemComponentInputItemView * const inputView : internalComponentsInputMap)
365 {
366 inputView->setAddEnabled(false);
367 }
368
369 // Disable all output widgets
370 for (SystemComponentOutputItemView * const outputView : internalComponentsOutputMap)
371 {
372 outputView->setAddEnabled(false);
373 }
374
375 // Check and enable input widget
376 input->setAddChecked(true);
377 input->setAddEnabled(true);
378
379 // Enable compatible output widgets
380 for (SystemComponentOutputItemInterface const * const outputInterface :
381 system->getCompatibleSources(input->getInterface()))
382 {
383 if (internalComponentsOutputMap.contains(outputInterface))
384 {
385 internalComponentsOutputMap[outputInterface]->setAddEnabled(true);
386 }
387 }
388 }
389 }
390
391 void SystemBaseView::inputConnectionRemove(SystemComponentInputItemView * const input)
392 {
393 // Remove all connections connecting an output to the input
394 system->getConnections()->remove(input->getInterface());
395 }
396
397 void SystemBaseView::outputMouseEnter(SystemComponentOutputItemView * const output)
398 {
399 // Update active output
400 outputActive = output;
401
402 // Does the active output have any connections?
403 if (internalConnectionsOutputList.contains(output))
404 {
405 // Update connection curves internals
406 updateInternalConnectionsCurves();
407 }
408 }
409
410 void SystemBaseView::outputMouseLeave(SystemComponentOutputItemView * const output)
411 {
412 // Has this event been emitted by the active output?
413 if (outputActive == output)
414 {
415 // Reset active output
416 outputActive = nullptr;
417
418 // Does the previous active output have any connections?
419 if (internalConnectionsOutputList.contains(output))
420 {
421 // Update connection curves internals
422 updateInternalConnectionsCurves();
423 }
424 }
425 }
426
427 void SystemBaseView::outputConnectionAdd(SystemComponentOutputItemView * const output)
428 {
429 // Have we already selected the output interface?
430 if (outputConnection == output)
431 {
432 // Reset output interface
433 outputConnection = nullptr;
434
435 // Enable all output widgets
436 for (SystemComponentOutputItemView * const outputView : internalComponentsOutputMap)
437 {
438 outputView->setAddEnabled(true);
439 }
440
441 // Uncheck output widget
442 output->setAddChecked(false);
443
444 // Enable all input widgets
445 for (SystemComponentInputItemView * const inputView : internalComponentsInputMap)
446 {
447 inputView->setAddEnabled(true);
448 }
449 }
450 // Have we selected an input interface?
451 else if (inputConnection)
452 {
453 // Add connection between output and input
454 system->getConnections()->add(output->getInterface(),
455 inputConnection->getInterface());
456
457 // Uncheck input widget
458 inputConnection->setAddChecked(false);
459
460 // Reset input interface
461 inputConnection = nullptr;
462
463 // Enable all input widgets
464 for (SystemComponentInputItemView * const inputView : internalComponentsInputMap)
465 {
466 inputView->setAddEnabled(true);
467 }
468
469 // Uncheck output widget
470 output->setAddChecked(false);
471
472 // Enable all output widgets
473 for (SystemComponentOutputItemView * const outputView : internalComponentsOutputMap)
474 {
475 outputView->setAddEnabled(true);
476 }
477 }
478 // No output interface nor input interface is selected
479 else
480 {
481 // Select output interface
482 outputConnection = output;
483
484 // Disable all output widgets
485 for (SystemComponentOutputItemView * const outputView : internalComponentsOutputMap)
486 {
487 outputView->setAddEnabled(false);
488 }
489
490 // Disable all input widgets
491 for (SystemComponentInputItemView * const inputView : internalComponentsInputMap)
492 {
493 inputView->setAddEnabled(false);
494 }
495
496 // Check and enable output widget
497 output->setAddChecked(true);
498 output->setAddEnabled(true);
499
500 // Enable compatible input widgets
501 for (SystemComponentInputItemInterface const * const inputInterface :
502 system->getCompatibleTargets(output->getInterface()))
503 {
504 if (internalComponentsInputMap.contains(inputInterface))
505 {
506 internalComponentsInputMap[inputInterface]->setAddEnabled(true);
507 }
508 }
509 }
510 }
511
512 void SystemBaseView::outputConnectionRemove(SystemComponentOutputItemView * const output)
513 {
514 // Remove all connections connecting the output to an input
515 system->getConnections()->remove(output->getInterface());
516 }
517
518 /*
519 * Unchecking any activated input or output by pressing the Escape key.*/
520 void SystemBaseView::pressEscape()
521 {
522 if (outputConnection)
523 {
524 // Uncheck output widget
525 outputConnection->setAddChecked(false);
526
527 // Reset output interface
528 outputConnection = nullptr;
529 }
530
531 for (SystemComponentOutputItemView * const outputView : internalComponentsOutputMap)
532 {
533 // Enable all output widgets
534 outputView->setAddEnabled(true);
535 }
536
537 if (inputConnection)
538 {
539 // Uncheck input widget
540 inputConnection->setAddChecked(false);
541
542 // Reset input interface
543 inputConnection = nullptr;
544 }
545
546 for (SystemComponentInputItemView * const inputView : internalComponentsInputMap)
547 {
548 // Enable all input widgets
549 inputView->setAddEnabled(true);
550 }
551 }
552
553 void SystemBaseView::paintEvent(QPaintEvent *)
554 {
555 // Initialize painter
556 QPainter painter(this);
557
558 // Draw all precalculated connection curves between components
559 for (bool const & selected : {false, true})
560 {
561 painter.setPen(ConnectionsCurveColorMap[selected]);
562 for (QPair<QPoint, QPoint> const & curve : internalConnectionsCurveMap[selected])
563 {
564 // Draw cubic curve between first point and second point
565 QPainterPath path(curve.first);
566 path.cubicTo(curve.first.x() + .6 * (curve.second.x() - curve.first.x()), curve.first.y(),
567 curve.first.x() + .4 * (curve.second.x() - curve.first.x()), curve.second.y(),
568 curve.second.x(), curve.second.y());
569 painter.drawPath(path);
570 }
571 }
572 }
SystemConnectionMapInterface::modified
void modified() const
Triggers signal to inform that connections have been modified (Called to update the View in the Syste...
SystemComponentMapInterface::removed
void removed(SystemComponentMapInterface::Item *const component) const
Triggers signal to inform that the component component have been successfully removed from the map (s...
SystemConnectionMapInterface::mode
void mode(bool const &modify) const
Triggers signal to enable (when modify set to true) or disable (when set to false) the automatic repo...
SystemComponentMapInterface::cleared
void cleared() const
Triggers signal to inform that all components have been successfully removed from the map (system)...
SystemComponentInputItemInterface.h
The System Component Input Item Interface (SCIII) contains the functions getters of the items constit...
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentMapInterface::mode
void mode(bool const &modify) const
Triggers signal to enable (when modify set to true) or disable (when set to false) the automatic repo...
SystemComponentItemInterface.h
The System Component Item Interface (SCmII) contains the functions setters and getters of the items c...
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
SystemComponentOutputItemInterface.h
The System Component Output Item Interface (SCOII) contains the functions getters of the items consti...
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemComponentMapInterface::added
void added(SystemComponentMapInterface::Item *const component) const
Triggers signal to inform that the component component have been successfully added to the map (syste...
SystemItemInterface.h
The System Item Interface (SII) contains the functions setters and getters of the items constituing a...
SystemConnectionItemInterface
This class defines the items constituing the connection that is established between two components of...
Definition: SystemConnectionItemInterface.h:27
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemBaseView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemBaseView.h
1 #ifndef SYSTEMBASEVIEW_H
2 #define SYSTEMBASEVIEW_H
3
4 #include <QColor>
5 #include <QList>
6 #include <QMap>
7 #include <QPair>
8 #include <QPoint>
9 #include <QWidget>
10
11 class SystemComponentInputItemInterface;
12 class SystemComponentOutputItemInterface;
13 class SystemComponentItemInterface;
14 class SystemItemInterface;
15 class SystemComponentInputItemView;
16 class SystemComponentOutputItemView;
17 class SystemComponentItemView;
18 class QPaintEvent;
19
20 class SystemBaseView : public QWidget
21 {
22 Q_OBJECT
23
24 public:
25 explicit SystemBaseView(SystemItemInterface * const system,
26 QWidget * const parent = nullptr);
27 virtual ~SystemBaseView() = default;
28
29 public Q_SLOTS:
30 void updateInternalComponents();
31 void updateInternalConnections();
32 void updateInternalConnectionsCurves();
33 void updateSize();
34
35 public Q_SLOTS:
36 void componentsMode(bool const & modify);
37 void componentsUpdate();
38 void componentsClear();
39 void componentsAdd(SystemComponentItemInterface * const component);
40 void componentsRemove(SystemComponentItemInterface * const component);
41
42 public Q_SLOTS:
43 void connectionsMode(bool const & modify);
44 void connectionsUpdate();
45
46 public Q_SLOTS:
47 void inputMouseEnter(SystemComponentInputItemView * const input);
48 void inputMouseLeave(SystemComponentInputItemView * const input);
49 void inputConnectionAdd(SystemComponentInputItemView * const input);
50 void inputConnectionRemove(SystemComponentInputItemView * const input);
51
52 public Q_SLOTS:
53 void outputMouseEnter(SystemComponentOutputItemView * const output);
54 void outputMouseLeave(SystemComponentOutputItemView * const output);
55 void outputConnectionAdd(SystemComponentOutputItemView * const output);
56 void outputConnectionRemove(SystemComponentOutputItemView * const output);
57
58 public Q_SLOTS:
59 void pressEscape();
60
61 protected:
62 static QPoint const FrameSize;
63 static QMap<bool, QColor> const ConnectionsCurveColorMap;
64
65 protected:
66 virtual void paintEvent(QPaintEvent * event) override;
67
68 protected:
69 SystemItemInterface * const system;
70
71 protected:
72 bool componentsModifyMode;
73 bool connectionsModifyMode;
74
75 protected:
76 SystemComponentInputItemView * inputActive;
77 SystemComponentInputItemView * inputConnection;
78 SystemComponentOutputItemView * outputActive;
79 SystemComponentOutputItemView * outputConnection;
80
81 protected:
82 QMap<SystemComponentItemInterface *, SystemComponentItemView *> internalComponentsMap;
83 QMap<SystemComponentInputItemInterface const *, SystemComponentInputItemView *> internalComponentsInputMap;
84 QMap<SystemComponentOutputItemInterface const *, SystemComponentOutputItemView *> internalComponentsOutputMap;
85 QList<SystemComponentInputItemView const *> internalConnectionsInputList;
86 QList<SystemComponentOutputItemView const *> internalConnectionsOutputList;
87 QMap<bool, QList<QPair<QPoint, QPoint>>> internalConnectionsCurveMap;
88 };
89
90 #endif // SYSTEMBASEVIEW_H
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentInputItemModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentInputItemModel.cpp
1 #include "Models/SystemComponentInputItemModel.h"
2
3 #include "openPASS-System/SystemComponentItemInterface.h"
4 #include "Models/SystemComponentInputMapModel.h"
5
6 SystemComponentInputItemModel::SystemComponentInputItemModel(ComponentInputItemInterface const * const input,
7 QObject * const parent)
8 : SystemComponentInputItemInterface(parent)
9 , input(input)
10 , type(input->getType())
11 , title(input->getTitle())
12 , unit(input->getUnit())
13 , cardinality(input->getCardinality())
14 {
15 }
16
17 SystemComponentItemInterface * SystemComponentInputItemModel::getComponent() const
18 {
19 if ((parent()) && (parent()->parent()))
20 {
21 SystemComponentItemInterface * const item =
22 qobject_cast<SystemComponentItemInterface * const>(parent()->parent());
23 return ((item) ? item : nullptr);
24 }
25 return nullptr;
26 }
27
28 SystemComponentInputItemInterface::ID SystemComponentInputItemModel::getID() const
29 {
30 SystemComponentInputMapModel const * const inputs =
31 qobject_cast<SystemComponentInputMapModel const * const>(parent());
32 return ((inputs) ? inputs->getID(const_cast<SystemComponentInputItemModel *>(this))
33 : SystemComponentInputItemInterface::ID());
34 }
35
36 SystemComponentInputItemInterface::Type SystemComponentInputItemModel::getType() const
37 {
38 return type;
39 }
40
41 SystemComponentInputItemInterface::Title SystemComponentInputItemModel::getTitle() const
42 {
43 return title;
44 }
45
46 SystemComponentInputItemInterface::Unit SystemComponentInputItemModel::getUnit() const
47 {
48 return unit;
49 }
50
51 SystemComponentInputItemInterface::Cardinality SystemComponentInputItemModel::getCardinality() const
52 {
53 return cardinality;
54 }
SystemComponentInputItemInterface::Type
ComponentInputItemInterface::Type Type
The type of the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:40
SystemComponentInputItemInterface::ID
ComponentInputItemInterface::ID ID
The identifier of the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:39
ComponentInputItemInterface
This class defines the items constituing an input of a component:
Definition: ComponentInputItemInterface.h:34
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentInputItemInterface::Cardinality
ComponentInputItemInterface::Cardinality Cardinality
The cardinality of the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:43
SystemComponentItemInterface.h
The System Component Item Interface (SCmII) contains the functions setters and getters of the items c...
SystemComponentInputItemInterface::Unit
ComponentInputItemInterface::Unit Unit
The unit of the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:42
SystemComponentInputItemInterface::Title
ComponentInputItemInterface::Title Title
The title for the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:41
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentInputItemModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentInputItemModel.h
1 #ifndef SYSTEMCOMPONENTINPUTITEMMODEL_H
2 #define SYSTEMCOMPONENTINPUTITEMMODEL_H
3
4 #include "openPASS-System/SystemComponentInputItemInterface.h"
5
6 class SystemComponentInputItemModel : public SystemComponentInputItemInterface
7 {
8 Q_OBJECT
9
10 public:
11 explicit SystemComponentInputItemModel(ComponentInputItemInterface const * const input,
12 QObject * const parent = nullptr);
13 virtual ~SystemComponentInputItemModel() = default;
14
15 public:
16 virtual SystemComponentItemInterface * getComponent() const override;
17
18 public:
19 virtual SystemComponentInputItemInterface::ID getID() const override;
20 virtual SystemComponentInputItemInterface::Type getType() const override;
21 virtual SystemComponentInputItemInterface::Title getTitle() const override;
22 virtual SystemComponentInputItemInterface::Unit getUnit() const override;
23 virtual SystemComponentInputItemInterface::Cardinality getCardinality() const override;
24
25 protected:
26 ComponentInputItemInterface const * const input;
27
28 protected:
29 ComponentInputItemInterface::Type type;
30 ComponentInputItemInterface::Title title;
31 ComponentInputItemInterface::Unit unit;
32 ComponentInputItemInterface::Cardinality cardinality;
33 };
34
35 #endif // SYSTEMCOMPONENTINPUTITEMMODEL_H
SystemComponentInputItemInterface::getCardinality
virtual SystemComponentInputItemInterface::Cardinality getCardinality() const =0
Gets the cardinality of the current registered input.
SystemComponentInputItemInterface::Type
ComponentInputItemInterface::Type Type
The type of the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:40
SystemComponentInputItemInterface::ID
ComponentInputItemInterface::ID ID
The identifier of the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:39
ComponentInputItemInterface
This class defines the items constituing an input of a component:
Definition: ComponentInputItemInterface.h:34
SystemComponentInputItemInterface::getType
virtual SystemComponentInputItemInterface::Type getType() const =0
Gets the type of the current registered input.
SystemComponentInputItemInterface.h
The System Component Input Item Interface (SCIII) contains the functions getters of the items constit...
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentInputItemInterface::getUnit
virtual SystemComponentInputItemInterface::Unit getUnit() const =0
Gets the unit of the current registered input.
SystemComponentInputItemInterface::Cardinality
ComponentInputItemInterface::Cardinality Cardinality
The cardinality of the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:43
SystemComponentInputItemInterface::Unit
ComponentInputItemInterface::Unit Unit
The unit of the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:42
SystemComponentInputItemInterface::getID
virtual SystemComponentInputItemInterface::ID getID() const =0
Gets the key identifier of the current registered input.
SystemComponentInputItemInterface::Title
ComponentInputItemInterface::Title Title
The title for the component&#39;s input.
Definition: SystemComponentInputItemInterface.h:41
SystemComponentInputItemInterface::getComponent
virtual SystemComponentItemInterface * getComponent() const =0
Gets the parent component where the current input belongs to.
SystemComponentInputItemInterface::getTitle
virtual SystemComponentInputItemInterface::Title getTitle() const =0
Gets the title of the current registered input.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentInputItemView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentInputItemView.cpp
1 #include "Views/SystemComponentInputItemView.h"
2 #include "ui_SystemComponentInputItemView.h"
3
4 #include "openPASS-System/SystemComponentInputItemInterface.h"
5 #include <QEvent>
6
7 SystemComponentInputItemView::SystemComponentInputItemView(SystemComponentInputItemInterface * const input,
8 QWidget * const parent)
9 : WidgetView(parent)
10 , input(input)
11 , ui(new Ui::SystemComponentInputItemView)
12 {
13 ui->setupUi(this);
14 ui->title->setText((input->getUnit().isEmpty())
15 ? QString(QStringLiteral("%1")).
16 arg(input->getTitle())
17 : QString(QStringLiteral("%1 [%2]")).
18 arg(input->getTitle(), input->getUnit()));
19
20 // Inform the user about the type of the input
21 ui->title->setToolTip(QString(QStringLiteral("input type = %1")).arg(input->getType()));
22 }
23
24 SystemComponentInputItemView::~SystemComponentInputItemView()
25 {
26 delete ui;
27 }
28
29 SystemComponentInputItemInterface * SystemComponentInputItemView::getInterface() const
30 {
31 return input;
32 }
33
34 void SystemComponentInputItemView::setAddChecked(bool const & checked)
35 {
36 ui->add->setChecked(checked);
37 }
38
39 void SystemComponentInputItemView::setAddEnabled(bool const & enabled)
40 {
41 ui->add->setEnabled(enabled);
42 }
43
44 void SystemComponentInputItemView::enterEvent(QEvent * event)
45 {
46 Q_EMIT mouseEnter(this);
47 WidgetView::enterEvent(event);
48 }
49
50 void SystemComponentInputItemView::leaveEvent(QEvent * event)
51 {
52 Q_EMIT mouseLeave(this);
53 WidgetView::leaveEvent(event);
54 }
55
56 void SystemComponentInputItemView::on_add_clicked()
57 {
58 Q_EMIT connectionAdd(this);
59 }
60
61 void SystemComponentInputItemView::on_remove_clicked()
62 {
63 Q_EMIT connectionRemove(this);
64 }
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
SystemComponentInputItemInterface::getType
virtual SystemComponentInputItemInterface::Type getType() const =0
Gets the type of the current registered input.
SystemComponentInputItemInterface.h
The System Component Input Item Interface (SCIII) contains the functions getters of the items constit...
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemComponentInputItemInterface::getUnit
virtual SystemComponentInputItemInterface::Unit getUnit() const =0
Gets the unit of the current registered input.
SystemComponentInputItemInterface::getTitle
virtual SystemComponentInputItemInterface::Title getTitle() const =0
Gets the title of the current registered input.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentInputItemView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentInputItemView.h
1 #ifndef SYSTEMCOMPONENTINPUTITEMVIEW_H
2 #define SYSTEMCOMPONENTINPUTITEMVIEW_H
3
4 #include "Views/WidgetView.h"
5
6 class SystemComponentInputItemInterface;
7 class QEvent;
8
9 namespace Ui {
10 class SystemComponentInputItemView;
11 }
12
13 class SystemComponentInputItemView : public WidgetView
14 {
15 Q_OBJECT
16
17 public:
18 explicit SystemComponentInputItemView(SystemComponentInputItemInterface * const input,
19 QWidget * const parent = nullptr);
20 virtual ~SystemComponentInputItemView();
21
22 Q_SIGNALS:
23 void mouseEnter(SystemComponentInputItemView * const input);
24 void mouseLeave(SystemComponentInputItemView * const input);
25 void connectionAdd(SystemComponentInputItemView * const input);
26 void connectionRemove(SystemComponentInputItemView * const input);
27
28 public:
29 SystemComponentInputItemInterface * getInterface() const;
30
31 public:
32 void setAddChecked(bool const & checked);
33 void setAddEnabled(bool const & enabled);
34
35 protected:
36 virtual void enterEvent(QEvent * event) override;
37 virtual void leaveEvent(QEvent * event) override;
38
39 protected Q_SLOTS:
40 void on_add_clicked();
41 void on_remove_clicked();
42
43 protected:
44 SystemComponentInputItemInterface * const input;
45
46 protected:
47 Ui::SystemComponentInputItemView * const ui;
48 };
49
50 #endif // SYSTEMCOMPONENTINPUTITEMVIEW_H
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentInputMapModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentInputMapModel.cpp
1 #include "Models/SystemComponentInputMapModel.h"
2
3 #include "Models/SystemComponentInputItemModel.h"
4
5 SystemComponentInputMapModel::SystemComponentInputMapModel(ComponentInputMapInterface const * const _inputs,
6 QObject * const parent)
7 : SystemComponentInputMapInterface(parent)
8 {
9 for (ComponentInputItemInterface const * const input : *_inputs)
10 {
11 inputs.insert(input->getID(), new SystemComponentInputItemModel(input, this));
12 }
13 }
14
15 SystemComponentInputMapInterface::Iterator SystemComponentInputMapModel::begin()
16 {
17 return inputs.begin();
18 }
19
20 SystemComponentInputMapInterface::ConstIterator SystemComponentInputMapModel::begin() const
21 {
22 return inputs.begin();
23 }
24
25 bool SystemComponentInputMapModel::contains(SystemComponentInputMapInterface::ID const &id) const
26 {
27 return inputs.keys().contains(id);
28 }
29
30 SystemComponentInputMapInterface::Iterator SystemComponentInputMapModel::end()
31 {
32 return inputs.end();
33 }
34
35 SystemComponentInputMapInterface::ConstIterator SystemComponentInputMapModel::end() const
36 {
37 return inputs.end();
38 }
39
40 SystemComponentInputMapInterface::ID SystemComponentInputMapModel::getID(SystemComponentInputMapInterface::Item * const item) const
41 {
42 return inputs.key(item);
43 }
44
45 SystemComponentInputMapInterface::Item * SystemComponentInputMapModel::getItem(SystemComponentInputMapInterface::ID const & id) const
46 {
47 return inputs.value(id, nullptr);
48 }
ComponentInputItemInterface
This class defines the items constituing an input of a component:
Definition: ComponentInputItemInterface.h:34
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
ComponentInputMapInterface
This class manages the registration and deregistration of inputs of a component. It provides a map as...
Definition: ComponentInputMapInterface.h:32
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentInputMapModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentInputMapModel.h
1 #ifndef SYSTEMCOMPONENTINPUTMAPMODEL_H
2 #define SYSTEMCOMPONENTINPUTMAPMODEL_H
3
4 #include "openPASS-Component/ComponentInputMapInterface.h"
5 #include "openPASS-System/SystemComponentInputMapInterface.h"
6
7 class SystemComponentInputMapModel : public SystemComponentInputMapInterface
8 {
9 Q_OBJECT
10
11 public:
12 explicit SystemComponentInputMapModel(ComponentInputMapInterface const * const inputs,
13 QObject * const parent = nullptr);
14 virtual ~SystemComponentInputMapModel() = default;
15
16 public:
17 virtual SystemComponentInputMapInterface::Iterator begin() override;
18 virtual SystemComponentInputMapInterface::ConstIterator begin() const override;
19
20 public:
21 virtual bool contains(SystemComponentInputMapInterface::ID const & id) const override;
22
23 public:
24 virtual SystemComponentInputMapInterface::Iterator end() override;
25 virtual SystemComponentInputMapInterface::ConstIterator end() const override;
26
27 public:
28 virtual SystemComponentInputMapInterface::ID getID(SystemComponentInputMapInterface::Item * const item) const override;
29 virtual SystemComponentInputMapInterface::Item * getItem(SystemComponentInputMapInterface::ID const & id) const override;
30
31 protected:
32 SystemComponentInputMapInterface::Map inputs;
33 };
34
35 #endif // SYSTEMCOMPONENTINPUTMAPMODEL_H
ComponentInputMapInterface.h
The Component Input Map Interface (CIMI) contains the functions managing the registration and deregis...
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
ComponentInputMapInterface
This class manages the registration and deregistration of inputs of a component. It provides a map as...
Definition: ComponentInputMapInterface.h:32
SystemComponentInputMapInterface.h
The System Component Input Map Interface (SCIMI) contains the functions managing the registration and...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentItemModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentItemModel.cpp
1 #include "Models/SystemComponentItemModel.h"
2
3 #include "Models/SystemComponentInputMapModel.h"
4 #include "Models/SystemComponentMapModel.h"
5 #include "Models/SystemComponentOutputMapModel.h"
6 #include "Models/SystemComponentParameterMapModel.h"
7 #include "Models/SystemComponentScheduleModel.h"
8
9 SystemComponentItemModel::SystemComponentItemModel(ComponentItemInterface const * const component,
10 SystemComponentItemInterface::Position const & position,
11 QObject * const parent)
12 : SystemComponentItemInterface(parent)
13 , component(component)
14 , schedule(new SystemComponentScheduleModel(component->getSchedule(), this))
15 , parameters(new SystemComponentParameterMapModel(component->getParameters(), this))
16 , inputs(new SystemComponentInputMapModel(component->getInputs(), this))
17 , outputs(new SystemComponentOutputMapModel(component->getOutputs(), this))
18 , name(component->getName())
19 , type(component->getType())
20 , title(component->getTitle())
21 , position(position)
22 {
23 }
24
25 SystemComponentItemModel::SystemComponentItemModel(SystemComponentManagerInterface * const components,
26 SystemComponentItemModel const & component,
27 SystemComponentItemInterface::Position const & position,
28 QObject * const parent)
29 : SystemComponentItemModel(components->lookupItemByName(component.name), position, parent)
30 {
31 title = component.title;
32 schedule->setPriority(component.schedule->getPriority());
33 schedule->setOffset(component.schedule->getOffset());
34 schedule->setCycle(component.schedule->getCycle());
35 schedule->setResponse(component.schedule->getResponse());
36 for (SystemComponentParameterItemInterface const * const parameter : *component.parameters)
37 {
38 parameters->getItem(parameter->getID())->setValue(parameter->getValue());
39 }
40 }
41
42 bool SystemComponentItemModel::duplicate(SystemComponentItemInterface::Position const & position)
43 {
44 SystemComponentMapModel * const components = getComponents();
45 return ((components) ? components->duplicate(this, position) : false);
46 }
47
48 bool SystemComponentItemModel::remove()
49 {
50 SystemComponentMapModel * const components = getComponents();
51 return ((components) ? components->remove(components->getID(this)) : false);
52 }
53
54 SystemComponentItemInterface::ID SystemComponentItemModel::getID() const
55 {
56 SystemComponentMapModel const * const components = getComponents();
57 return ((components) ? components->getID(const_cast<SystemComponentItemModel *>(this))
58 : SystemComponentItemInterface::ID());
59 }
60
61 SystemComponentItemInterface::Library SystemComponentItemModel::getLibrary() const
62 {
63 return name;
64 }
65
66 SystemComponentItemInterface::Type SystemComponentItemModel::getType() const
67 {
68 return type;
69 }
70
71 bool SystemComponentItemModel::setTitle(SystemComponentItemInterface::Title const & _title)
72 {
73 title = _title;
74 Q_EMIT modifiedTitle();
75 return true;
76 }
77
78 SystemComponentItemInterface::Title SystemComponentItemModel::getTitle() const
79 {
80 return title;
81 }
82
83 SystemComponentItemInterface::Schedule * SystemComponentItemModel::getSchedule() const
84 {
85 return schedule;
86 }
87
88 SystemComponentItemInterface::ParameterMap * SystemComponentItemModel::getParameters() const
89 {
90 return parameters;
91 }
92
93 SystemComponentItemInterface::InputMap * SystemComponentItemModel::getInputs() const
94 {
95 return inputs;
96 }
97
98 SystemComponentItemInterface::OutputMap * SystemComponentItemModel::getOutputs() const
99 {
100 return outputs;
101 }
102
103 bool SystemComponentItemModel::setPosition(SystemComponentItemInterface::Position const & _position)
104 {
105 position = _position;
106 Q_EMIT modifiedPosition();
107 return true;
108 }
109
110 SystemComponentItemInterface::Position SystemComponentItemModel::getPosition() const
111 {
112 return position;
113 }
114
115 // Get access to the components contained in the parent map
116 SystemComponentMapModel * SystemComponentItemModel::getComponents() const
117 {
118 SystemComponentMapModel * components = nullptr;
119 if (parent())
120 {
121 components = qobject_cast<SystemComponentMapModel * const>(parent());
122 }
123 return components;
124 }
SystemComponentItemInterface::ID
unsigned int ID
The component&#39;s key identifier in the system.
Definition: SystemComponentItemInterface.h:40
SystemComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component registered in a s...
Definition: SystemComponentParameterMapInterface.h:22
ComponentItemInterface
This class defines the items constituing a component:
Definition: ComponentItemInterface.h:40
SystemComponentOutputMapInterface
This class manages the registration and deregistration of outputs of a component registered in a syst...
Definition: SystemComponentOutputMapInterface.h:22
SystemComponentItemInterface::Position
QPoint Position
The position of the component in the System Editor.
Definition: SystemComponentItemInterface.h:48
SystemComponentScheduleInterface
This class defines the simulation schedule related parameters of a component registered in a system: ...
Definition: SystemComponentScheduleInterface.h:25
SystemComponentParameterItemInterface::getID
virtual SystemComponentParameterItemInterface::ID getID() const =0
Gets the key identifier of the current registered parameter.
SystemComponentItemInterface::Title
ComponentItemInterface::Title Title
The Title of the component.
Definition: SystemComponentItemInterface.h:43
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
SystemComponentItemInterface::InputMap
SystemComponentInputMapInterface InputMap
The container registering the inputs of the component.
Definition: SystemComponentItemInterface.h:46
SystemComponentItemInterface::Library
ComponentItemInterface::Name Library
The component&#39;s key name (registered in the library)
Definition: SystemComponentItemInterface.h:41
SystemComponentParameterItemInterface::getValue
virtual SystemComponentParameterItemInterface::Value getValue() const =0
Gets the value of the current registered parameter.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentItemModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentItemModel.h
1 #ifndef SYSTEMCOMPONENTITEMMODEL_H
2 #define SYSTEMCOMPONENTITEMMODEL_H
3
4 #include "openPASS-System/SystemComponentItemInterface.h"
5 #include "openPASS-System/SystemComponentManagerInterface.h"
6 #include "Models/SystemComponentMapModel.h"
7
8 class SystemComponentItemModel : public SystemComponentItemInterface
9 {
10 Q_OBJECT
11
12 public:
13 explicit SystemComponentItemModel(ComponentItemInterface const * const component,
14 SystemComponentItemInterface::Position const & position
15 = SystemComponentItemInterface::Position(0, 0),
16 QObject * const parent = nullptr);
17 explicit SystemComponentItemModel(SystemComponentManagerInterface * const components,
18 SystemComponentItemModel const & component,
19 SystemComponentItemInterface::Position const & position
20 = SystemComponentItemInterface::Position(0, 0),
21 QObject * const parent = nullptr);
22 virtual ~SystemComponentItemModel() = default;
23
24 public:
25 virtual bool duplicate(SystemComponentItemInterface::Position const & position) override;
26 virtual bool remove() override;
27
28 public:
29 virtual SystemComponentItemInterface::ID getID() const override;
30 virtual SystemComponentItemInterface::Library getLibrary() const override;
31 virtual SystemComponentItemInterface::Type getType() const override;
32
33 public:
34 virtual bool setTitle(SystemComponentItemInterface::Title const & title) override;
35 virtual SystemComponentItemInterface::Title getTitle() const override;
36
37 public:
38 virtual SystemComponentItemInterface::Schedule * getSchedule() const override;
39 virtual SystemComponentItemInterface::ParameterMap * getParameters() const override;
40 virtual SystemComponentItemInterface::InputMap * getInputs() const override;
41 virtual SystemComponentItemInterface::OutputMap * getOutputs() const override;
42
43 public:
44 virtual bool setPosition(SystemComponentItemInterface::Position const & position) override;
45 virtual SystemComponentItemInterface::Position getPosition() const override;
46
47 public:
48 virtual SystemComponentMapModel *getComponents() const;
49
50 protected:
51 ComponentItemInterface const * const component;
52 SystemComponentItemInterface::Schedule * const schedule;
53 SystemComponentItemInterface::ParameterMap * const parameters;
54 SystemComponentItemInterface::InputMap * const inputs;
55 SystemComponentItemInterface::OutputMap * const outputs;
56
57 protected:
58 SystemComponentItemInterface::Library name;
59 SystemComponentItemInterface::Type type;
60 SystemComponentItemInterface::Title title;
61 SystemComponentItemInterface::Position position;
62 };
63
64 #endif // SYSTEMCOMPONENTITEMMODEL_H
SystemComponentItemInterface::getSchedule
virtual SystemComponentItemInterface::Schedule * getSchedule() const =0
Gets the simulation schedule related parameters of the current registered component.
SystemComponentItemInterface::ID
unsigned int ID
The component&#39;s key identifier in the system.
Definition: SystemComponentItemInterface.h:40
SystemComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component registered in a s...
Definition: SystemComponentParameterMapInterface.h:22
SystemComponentItemInterface::setPosition
virtual bool setPosition(SystemComponentItemInterface::Position const &position)=0
Sets the position of the current registered component in the System Editor.
ComponentItemInterface
This class defines the items constituing a component:
Definition: ComponentItemInterface.h:40
SystemComponentOutputMapInterface
This class manages the registration and deregistration of outputs of a component registered in a syst...
Definition: SystemComponentOutputMapInterface.h:22
SystemComponentItemInterface::Position
QPoint Position
The position of the component in the System Editor.
Definition: SystemComponentItemInterface.h:48
SystemComponentScheduleInterface
This class defines the simulation schedule related parameters of a component registered in a system: ...
Definition: SystemComponentScheduleInterface.h:25
SystemComponentManagerInterface.h
The System Component Manager Interface (SCMI) contains the functions loading components as a library ...
SystemComponentItemInterface::getLibrary
virtual SystemComponentItemInterface::Library getLibrary() const =0
Gets the key name of the current component as registered in the library.
SystemComponentItemInterface::getInputs
virtual SystemComponentItemInterface::InputMap * getInputs() const =0
Gets the inputs of the current registered component.
SystemComponentItemInterface::Title
ComponentItemInterface::Title Title
The Title of the component.
Definition: SystemComponentItemInterface.h:43
SystemComponentItemInterface::getOutputs
virtual SystemComponentItemInterface::OutputMap * getOutputs() const =0
Gets the outputs of the current registered component.
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentItemInterface::getTitle
virtual SystemComponentItemInterface::Title getTitle() const =0
Gets the title of the current registered component.
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemComponentItemInterface.h
The System Component Item Interface (SCmII) contains the functions setters and getters of the items c...
SystemComponentItemInterface::getParameters
virtual SystemComponentItemInterface::ParameterMap * getParameters() const =0
Gets the parameters of the current registered component.
SystemComponentItemInterface::setTitle
virtual bool setTitle(SystemComponentItemInterface::Title const &title)=0
Sets a title to the current registered component.
SystemComponentItemInterface::getID
virtual SystemComponentItemInterface::ID getID() const =0
Gets the key identifier of the current component registered in the system.
SystemComponentItemInterface::duplicate
virtual bool duplicate(SystemComponentItemInterface::Position const &position)=0
Duplicates the current component and registers it to the map with a new identifier and a position in ...
SystemComponentItemInterface::getType
virtual SystemComponentItemInterface::Type getType() const =0
Gets the type of the current registered component.
SystemComponentItemInterface::InputMap
SystemComponentInputMapInterface InputMap
The container registering the inputs of the component.
Definition: SystemComponentItemInterface.h:46
SystemComponentItemInterface::getPosition
virtual SystemComponentItemInterface::Position getPosition() const =0
Gets the position of the current registered component.
SystemComponentItemInterface::Library
ComponentItemInterface::Name Library
The component&#39;s key name (registered in the library)
Definition: SystemComponentItemInterface.h:41
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentItemView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentItemView.cpp
1 #include "Views/SystemComponentItemView.h"
2 #include "ui_SystemComponentItemView.h"
3
4 #include "Views/SystemComponentInputItemView.h"
5 #include "Views/SystemComponentOutputItemView.h"
6 #include "Views/SystemComponentParameterItemView.h"
7 #include "Views/SystemComponentScheduleView.h"
8 #include "Views/SystemComponentTitleView.h"
9 #include <QKeyEvent>
10 #include <QMouseEvent>
11
12 QMap<SystemComponentItemInterface::Type, QString> const SystemComponentItemView::TypeColorMap = {
13 {SystemComponentItemInterface::Type::Action, QStringLiteral("#74bd4f")},
14 {SystemComponentItemInterface::Type::Algorithm, QStringLiteral("#bd4f4f")},
15 {SystemComponentItemInterface::Type::Sensor, QStringLiteral("#4f81bd")},
16 };
17 QString const SystemComponentItemView::TypeColorDefault = QStringLiteral("#cdcdcd");
18
19 SystemComponentItemView::SystemComponentItemView(SystemComponentItemInterface * const component,
20 QWidget * const parent)
21 : WidgetView(parent)
22 , component(component)
23 , ui(new Ui::SystemComponentItemView)
24 {
25 // Setup UI
26 ui->setupUi(this);
27 ui->rename->hide();
28 ui->actionsLayout->insertWidget(0, new SystemComponentTitleView(component, this), 1);
29 ui->schedule->insertWidget(0, new SystemComponentScheduleView(component->getSchedule(), this), 1);
30
31 // Connect SystemComponentItemInterface with SystemComponentItemView
32 connect(component, &SystemComponentItemInterface::modifiedPosition,
33 this, &SystemComponentItemView::updatePosition);
34 updatePosition();
35
36 // Create SystemComponentParameterItemViews
37 for (SystemComponentParameterItemInterface * const parameterInterface : *component->getParameters())
38 {
39 ui->parameters->addWidget(new SystemComponentParameterItemView(parameterInterface, this));
40 }
41
42 // Create SystemComponentInputItemViews
43 for (SystemComponentInputItemInterface * const inputInterface : *component->getInputs())
44 {
45 SystemComponentInputItemView * const inputView = new SystemComponentInputItemView(inputInterface, this);
46 connect(inputView, &SystemComponentInputItemView::mouseEnter,
47 this, &SystemComponentItemView::inputMouseEnter);
48 connect(inputView, &SystemComponentInputItemView::mouseLeave,
49 this, &SystemComponentItemView::inputMouseLeave);
50 connect(inputView, &SystemComponentInputItemView::connectionAdd,
51 this, &SystemComponentItemView::inputConnectionAdd);
52 connect(inputView, &SystemComponentInputItemView::connectionRemove,
53 this, &SystemComponentItemView::inputConnectionRemove);
54 ui->inputs->addWidget(inputView);
55 }
56
57 // Create SystemComponentOutputItemViews
58 for (SystemComponentOutputItemInterface * const outputInterface : *component->getOutputs())
59 {
60 SystemComponentOutputItemView * const outputView = new SystemComponentOutputItemView(outputInterface, this);
61 connect(outputView, &SystemComponentOutputItemView::mouseEnter,
62 this, &SystemComponentItemView::outputMouseEnter);
63 connect(outputView, &SystemComponentOutputItemView::mouseLeave,
64 this, &SystemComponentItemView::outputMouseLeave);
65 connect(outputView, &SystemComponentOutputItemView::connectionAdd,
66 this, &SystemComponentItemView::outputConnectionAdd);
67 connect(outputView, &SystemComponentOutputItemView::connectionRemove,
68 this, &SystemComponentItemView::outputConnectionRemove);
69 ui->outputs->addWidget(outputView);
70 }
71
72 // Show UI
73 show();
74
75 // Update type
76 updateType();
77 }
78
79 SystemComponentItemView::~SystemComponentItemView()
80 {
81 // Destroy UI
82 delete ui;
83 }
84
85 SystemComponentItemInterface * SystemComponentItemView::getInterface() const
86 {
87 // Return interface
88 return component;
89 }
90
91 void SystemComponentItemView::keyPressEvent(QKeyEvent * event)
92 {
93 if (event->key() == Qt::Key_Escape)
94 {
95 Q_EMIT pressEscape();
96 WidgetView::keyPressEvent(event);
97 }
98 }
99
100 void SystemComponentItemView::updateType()
101 {
102 // Update type
103 setStyleSheet(styleSheet().replace(styleSheet().indexOf(objectName()) + 46, 7,
104 TypeColorMap.value(component->getType(), TypeColorDefault)));
105 }
106
107 void SystemComponentItemView::updatePosition()
108 {
109 // Update position
110 move(component->getPosition());
111 Q_EMIT moved();
112 }
113
114 void SystemComponentItemView::on_renameEdit_returnPressed()
115 {
116 // Save name and switch to actions widget
117 on_renameSave_clicked();
118 }
119
120 void SystemComponentItemView::on_renameCancel_clicked()
121 {
122 // Switch to actions widget
123 ui->rename->hide();
124 ui->actions->show();
125 }
126
127 void SystemComponentItemView::on_renameSave_clicked()
128 {
129 // Save title
130 component->setTitle(ui->renameEdit->text());
131
132 // Switch to actions widget
133 ui->rename->hide();
134 ui->actions->show();
135 }
136
137 void SystemComponentItemView::on_actionRename_clicked()
138 {
139 // Switch to rename widget
140 ui->actions->hide();
141 ui->renameEdit->setText(component->getTitle());
142 ui->rename->show();
143 ui->renameEdit->selectAll();
144 ui->renameEdit->setFocus();
145 }
146
147 void SystemComponentItemView::on_actionDuplicate_clicked()
148 {
149 // Duplicate component
150 component->duplicate(pos() + QPoint(width() + 20, 10));
151 }
152
153 void SystemComponentItemView::on_actionRemove_clicked()
154 {
155 // Remove component
156 component->remove();
157 }
SystemComponentItemInterface::getSchedule
virtual SystemComponentItemInterface::Schedule * getSchedule() const =0
Gets the simulation schedule related parameters of the current registered component.
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
SystemComponentItemInterface::getInputs
virtual SystemComponentItemInterface::InputMap * getInputs() const =0
Gets the inputs of the current registered component.
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemComponentItemInterface::getOutputs
virtual SystemComponentItemInterface::OutputMap * getOutputs() const =0
Gets the outputs of the current registered component.
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentItemInterface::getTitle
virtual SystemComponentItemInterface::Title getTitle() const =0
Gets the title of the current registered component.
SystemComponentItemInterface::getParameters
virtual SystemComponentItemInterface::ParameterMap * getParameters() const =0
Gets the parameters of the current registered component.
SystemComponentItemInterface::setTitle
virtual bool setTitle(SystemComponentItemInterface::Title const &title)=0
Sets a title to the current registered component.
SystemComponentItemInterface::modifiedPosition
void modifiedPosition() const
Triggers signal to inform that the position of a component has been modified in the System Editor...
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemComponentItemInterface::duplicate
virtual bool duplicate(SystemComponentItemInterface::Position const &position)=0
Duplicates the current component and registers it to the map with a new identifier and a position in ...
SystemComponentItemInterface::getType
virtual SystemComponentItemInterface::Type getType() const =0
Gets the type of the current registered component.
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
SystemComponentItemInterface::getPosition
virtual SystemComponentItemInterface::Position getPosition() const =0
Gets the position of the current registered component.
SystemComponentItemInterface::remove
virtual bool remove()=0
Deregisters the current component from the map (i.e. remove it from the system).
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentItemView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentItemView.h
1 #ifndef SYSTEMCOMPONENTITEMVIEW_H
2 #define SYSTEMCOMPONENTITEMVIEW_H
3
4 #include "openPASS-System/SystemComponentItemInterface.h"
5 #include "Views/WidgetView.h"
6 #include <QMap>
7 #include <QString>
8
9 class SystemComponentInputItemView;
10 class SystemComponentOutputItemView;
11 class QKeyEvent;
12
13 namespace Ui {
14 class SystemComponentItemView;
15 }
16
17 class SystemComponentItemView : public WidgetView
18 {
19 Q_OBJECT
20
21 public:
22 explicit SystemComponentItemView(SystemComponentItemInterface * const component,
23 QWidget * const parent = nullptr);
24 virtual ~SystemComponentItemView();
25
26 Q_SIGNALS:
27 void moved();
28
29 Q_SIGNALS:
30 void inputMouseEnter(SystemComponentInputItemView * const input);
31 void inputMouseLeave(SystemComponentInputItemView * const input);
32 void inputConnectionAdd(SystemComponentInputItemView * const input);
33 void inputConnectionRemove(SystemComponentInputItemView * const input);
34
35 Q_SIGNALS:
36 void outputMouseEnter(SystemComponentOutputItemView * const output);
37 void outputMouseLeave(SystemComponentOutputItemView * const output);
38 void outputConnectionAdd(SystemComponentOutputItemView * const output);
39 void outputConnectionRemove(SystemComponentOutputItemView * const output);
40
41 Q_SIGNALS:
42 void pressEscape();
43
44 public:
45 SystemComponentItemInterface * getInterface() const;
46
47 protected:
48 virtual void keyPressEvent(QKeyEvent * event) override;
49
50 public Q_SLOTS:
51 void updateType();
52 void updatePosition();
53
54 protected:
55 static QMap<SystemComponentItemInterface::Type, QString> const TypeColorMap;
56 static QString const TypeColorDefault;
57
58 protected Q_SLOTS:
59 void on_renameEdit_returnPressed();
60 void on_renameCancel_clicked();
61 void on_renameSave_clicked();
62
63 protected Q_SLOTS:
64 void on_actionRename_clicked();
65 void on_actionDuplicate_clicked();
66 void on_actionRemove_clicked();
67
68 protected:
69 SystemComponentItemInterface * const component;
70
71 protected:
72 Ui::SystemComponentItemView * const ui;
73 };
74
75 #endif // SYSTEMCOMPONENTITEMVIEW_H
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentItemInterface.h
The System Component Item Interface (SCmII) contains the functions setters and getters of the items c...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentManagerModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentManagerModel.cpp
1 #include "Models/SystemComponentManagerModel.h"
2
3 #include <QList>
4 #include <QString>
5
6 SystemComponentManagerModel::SystemComponentManagerModel(ComponentInterface * const component,
7 QObject * const parent)
8 : SystemComponentManagerInterface(parent)
9 , components(component->createComponentMap(this))
10 {
11 }
12
13 bool SystemComponentManagerModel::loadFromDirectory(QDir const & directory)
14 {
15 // Load the component file names and remove the xml extension
16 QList<QString> componentFiles = directory.entryList({"*.xml"},QDir::Files | QDir::Readable, QDir::Name);
17
18 // Clear the component Map and load the components from the new or updated library
19 components->clear();
20 for (QString filename : componentFiles)
21 {
22 components->add(filename.remove(filename.count() - 4, 4),
23 directory.absoluteFilePath(filename));
24 }
25
26 return true;
27 }
28
29 QList<ComponentItemInterface::Title> SystemComponentManagerModel::listTitlesByType(ComponentItemInterface::Type const & type) const
30 {
31 QList<ComponentItemInterface::Title> titles;
32 for (ComponentMapInterface::Item * const item : *components)
33 {
34 if (item->getType() == type)
35 {
36 titles << item->getTitle();
37 }
38 }
39 return titles;
40 }
41
42 ComponentItemInterface * SystemComponentManagerModel::lookupItemByName(ComponentItemInterface::Name const & name) const
43 {
44 for (ComponentMapInterface::Item * const item : *components)
45 {
46 if (item->getName() == name)
47 {
48 return item;
49 }
50 }
51 return nullptr;
52 }
53
54 ComponentItemInterface * SystemComponentManagerModel::lookupItemByTitle(ComponentItemInterface::Title const & title) const
55 {
56 for (ComponentMapInterface::Item * const item : *components)
57 {
58 if (item->getTitle() == title)
59 {
60 return item;
61 }
62 }
63 return nullptr;
64 }
ComponentItemInterface
This class defines the items constituing a component:
Definition: ComponentItemInterface.h:40
ComponentItemInterface::Title
QString Title
The Title of the component.
Definition: ComponentItemInterface.h:55
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
ComponentItemInterface::Name
QString Name
The component&#39;s key name.
Definition: ComponentItemInterface.h:45
ComponentInterface
This class manages creating new component and also creating the map which registers created component...
Definition: ComponentInterface.h:34
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentManagerModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentManagerModel.h
1 #ifndef SYSTEMCOMPONENTMANAGERMODEL_H
2 #define SYSTEMCOMPONENTMANAGERMODEL_H
3
4 #include "openPASS-Component/ComponentInterface.h"
5 #include "openPASS-Component/ComponentMapInterface.h"
6 #include "openPASS-System/SystemComponentManagerInterface.h"
7
8 class SystemComponentManagerModel : public SystemComponentManagerInterface
9 {
10 Q_OBJECT
11
12 public:
13 explicit SystemComponentManagerModel(ComponentInterface * const component,
14 QObject * const parent = nullptr);
15 virtual ~SystemComponentManagerModel() = default;
16
17 public:
18 virtual bool loadFromDirectory(QDir const & directory) override;
19 virtual QList<ComponentItemInterface::Title> listTitlesByType(ComponentItemInterface::Type const & type) const override;
20 virtual ComponentItemInterface * lookupItemByName(ComponentItemInterface::Name const & name) const override;
21 virtual ComponentItemInterface * lookupItemByTitle(ComponentItemInterface::Title const & title) const override;
22
23 protected:
24 ComponentMapInterface * const components;
25 };
26
27 #endif // SYSTEMCOMPONENTMANAGERMODEL_H
ComponentMapInterface.h
The Component Map Interface (CMI) contains the functions managing the registration and deregistration...
ComponentItemInterface
This class defines the items constituing a component:
Definition: ComponentItemInterface.h:40
ComponentItemInterface::Title
QString Title
The Title of the component.
Definition: ComponentItemInterface.h:55
SystemComponentManagerInterface::listTitlesByType
virtual QList< ComponentItemInterface::Title > listTitlesByType(ComponentItemInterface::Type const &type) const =0
Gets a list of titles of loaded components sorted according to the specified type type (Action...
ComponentMapInterface
This class manages the registration and deregistration of objects defining a component (component rel...
Definition: ComponentMapInterface.h:32
ComponentInterface.h
The Component Interface (CI) contains the functions creating components. This interface belongs to th...
SystemComponentManagerInterface.h
The System Component Manager Interface (SCMI) contains the functions loading components as a library ...
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemComponentManagerInterface::loadFromDirectory
virtual bool loadFromDirectory(QDir const &directory)=0
Loads XML files defining components from the selected directory directory. The filenames are register...
SystemComponentManagerInterface::lookupItemByTitle
virtual ComponentItemInterface * lookupItemByTitle(ComponentItemInterface::Title const &title) const =0
Gets a pointer to the component related-object with the specified title title. This function is calle...
SystemComponentManagerInterface::lookupItemByName
virtual ComponentItemInterface * lookupItemByName(ComponentItemInterface::Name const &name) const =0
Gets a pointer to the component related-object with the specified key name name. This function is cal...
ComponentItemInterface::Name
QString Name
The component&#39;s key name.
Definition: ComponentItemInterface.h:45
ComponentInterface
This class manages creating new component and also creating the map which registers created component...
Definition: ComponentInterface.h:34
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentManagerView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentManagerView.cpp
1 #include "Views/SystemComponentManagerView.h"
2 #include "ui_SystemComponentManagerView.h"
3
4 #include "openPASS-Project/ProjectInterface.h"
5 #include "openPASS-System/SystemComponentManagerInterface.h"
6
7 SystemComponentManagerView::SystemComponentManagerView(SystemComponentManagerInterface * const components,
8 ProjectInterface * const project,
9 QWidget * const parent)
10 : QWidget(parent)
11 , _components(components)
12 , _project(project)
13 , ui(new Ui::SystemComponentManagerView)
14 {
15 // Setup UI
16 ui->setupUi(this);
17
18 // Update the tree view
19 updateManagerView();
20 }
21
22 SystemComponentManagerView::~SystemComponentManagerView()
23 {
24 // Destroy UI
25 delete ui;
26 }
27
28 void SystemComponentManagerView::show()
29 {
30 // Maximize widget
31 ui->button->setChecked(true);
32 ui->tree->setVisible(true);
33 }
34
35 void SystemComponentManagerView::hide()
36 {
37 // Minimize widget
38 ui->button->setChecked(false);
39 ui->tree->setVisible(false);
40
41 // Update the components tree
42 updateManagerView();
43 }
44
45 void SystemComponentManagerView::updateManagerView()
46 {
47 // Clear the tree of components
48 for (unsigned char index = 0; index < ui->tree->topLevelItemCount(); ++index)
49 {
50 ui->tree->topLevelItem(index)->takeChildren();
51 }
52
53 // Load again the components
54 if (_components->loadFromDirectory(_project->getLibrary()))
55 {
56 for (unsigned char index = 0; index < ui->tree->topLevelItemCount(); ++index)
57 {
58 for (ComponentItemInterface::Title const & title : _components->
59 listTitlesByType(static_cast<ComponentItemInterface::Type>(index)))
60 {
61 new QTreeWidgetItem(ui->tree->topLevelItem(index), {title}, 0);
62 }
63 }
64 ui->tree->expandAll();
65 }
66 }
67
68 void SystemComponentManagerView::on_button_clicked()
69 {
70 // Toggle widget
71 ui->button->setChecked(ui->button->isChecked());
72 ui->tree->setVisible(!ui->tree->isVisible());
73
74 if (ui->button->isChecked())
75 {
76 updateManagerView();
77 }
78 }
Ui
Definition: EnvironmentDisplayView.h:29
ComponentItemInterface::Title
QString Title
The Title of the component.
Definition: ComponentItemInterface.h:55
SystemComponentManagerInterface.h
The System Component Manager Interface (SCMI) contains the functions loading components as a library ...
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentManagerView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentManagerView.h
1 #ifndef SYSTEMCOMPONENTMANAGERVIEW_H
2 #define SYSTEMCOMPONENTMANAGERVIEW_H
3
4 #include <QWidget>
5
6 class ProjectInterface;
7 class SystemComponentManagerInterface;
8
9 namespace Ui {
10 class SystemComponentManagerView;
11 }
12
13 class SystemComponentManagerView : public QWidget
14 {
15 Q_OBJECT
16
17 public:
18 explicit SystemComponentManagerView(SystemComponentManagerInterface * const components,
19 ProjectInterface * const project,
20 QWidget * const parent = nullptr);
21 virtual ~SystemComponentManagerView();
22
23 public Q_SLOTS:
24 virtual void show();
25 virtual void hide();
26 virtual void updateManagerView();
27
28 protected Q_SLOTS:
29 void on_button_clicked();
30
31 private:
32 SystemComponentManagerInterface * _components;
33 ProjectInterface * const _project;
34
35 protected:
36 Ui::SystemComponentManagerView * const ui;
37 };
38
39 #endif // SYSTEMCOMPONENTMANAGERVIEW_H
Ui
Definition: EnvironmentDisplayView.h:29
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentMapModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentMapModel.cpp
1 #include "Models/SystemComponentMapModel.h"
2
3 #include "Models/SystemComponentItemModel.h"
4 #include "Models/SystemConnectionMapModel.h"
5
6 SystemComponentMapModel::SystemComponentMapModel(SystemComponentManagerInterface * const components,
7 SystemConnectionMapInterface * const connections,
8 QObject * const parent)
9 : SystemComponentMapInterface(parent)
10 , componentsManager(components)
11 , connections(connections)
12 {
13 }
14
15 bool SystemComponentMapModel::add(SystemComponentMapInterface::ID const & id,
16 SystemComponentMapInterface::Item * const component)
17 {
18 if (!components.keys().contains(id))
19 {
20 component->setParent(this);
21 Q_EMIT added(*components.insert(id, component));
22 return true;
23 }
24 return false;
25 }
26
27 bool SystemComponentMapModel::add(ComponentItemInterface const * const component,
28 SystemComponentItemInterface::Position const & position)
29 {
30 Q_EMIT added(*components.insert(next(), new SystemComponentItemModel(
31 component, position, this)));
32 return true;
33 }
34
35 SystemComponentMapInterface::Iterator SystemComponentMapModel::begin()
36 {
37 return components.begin();
38 }
39
40 SystemComponentMapInterface::ConstIterator SystemComponentMapModel::begin() const
41 {
42 return components.begin();
43 }
44
45 bool SystemComponentMapModel::clear()
46 {
47 if (connections->clear())
48 {
49 qDeleteAll(components);
50 components.clear();
51 Q_EMIT cleared();
52 return true;
53 }
54 return false;
55 }
56
57 bool SystemComponentMapModel::contains(SystemComponentMapInterface::ID const &id) const
58 {
59 return components.keys().contains(id);
60 }
61
62 SystemComponentMapInterface::Iterator SystemComponentMapModel::end()
63 {
64 return components.end();
65 }
66
67 SystemComponentMapInterface::ConstIterator SystemComponentMapModel::end() const
68 {
69 return components.end();
70 }
71
72 SystemComponentMapInterface::ID SystemComponentMapModel::getID(SystemComponentMapInterface::Item * const item) const
73 {
74 return components.key(item);
75 }
76
77 SystemComponentMapInterface::Item * SystemComponentMapModel::getItem(SystemComponentMapInterface::ID const & id) const
78 {
79 return components.value(id, nullptr);
80 }
81
82 bool SystemComponentMapModel::remove(SystemComponentMapInterface::ID const & id)
83 {
84 if (components.contains(id))
85 {
86 SystemComponentMapInterface::Item * const component = components.take(id);
87 connections->remove(component);
88 Q_EMIT removed(component);
89 delete component;
90 return true;
91 }
92 return false;
93 }
94
95 bool SystemComponentMapModel::duplicate(SystemComponentItemModel const * const component,
96 SystemComponentItemInterface::Position const & position)
97 {
98 Q_EMIT added(*components.insert(next(), new SystemComponentItemModel(
99 componentsManager, *component, position, this)));
100 return true;
101 }
102
103 SystemComponentMapInterface::ID SystemComponentMapModel::next() const
104 {
105 SystemComponentMapInterface::ID id = 0;
106 for (SystemComponentMapInterface::ID key : components.keys())
107 {
108 if (id <= key)
109 {
110 id = key + 1;
111 }
112 }
113 return id;
114 }
ComponentItemInterface
This class defines the items constituing a component:
Definition: ComponentItemInterface.h:40
SystemComponentItemInterface::Position
QPoint Position
The position of the component in the System Editor.
Definition: SystemComponentItemInterface.h:48
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemConnectionMapInterface
This class manages the registration and deregistration of objects defining connections (connection re...
Definition: SystemConnectionMapInterface.h:25
SystemComponentMapInterface::ID
SystemComponentItemInterface::ID ID
The identifier of a component.
Definition: SystemComponentMapInterface.h:27
SystemComponentMapInterface
This class manages the registration and deregistration of objects defining components (component rela...
Definition: SystemComponentMapInterface.h:22
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentMapModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentMapModel.h
1 #ifndef SYSTEMCOMPONENTMAPMODEL_H
2 #define SYSTEMCOMPONENTMAPMODEL_H
3
4 #include "openPASS-System/SystemComponentMapInterface.h"
5 #include "openPASS-System/SystemComponentManagerInterface.h"
6
7 class SystemComponentItemModel;
8 class SystemConnectionMapInterface;
9
10 class SystemComponentMapModel : public SystemComponentMapInterface
11 {
12 Q_OBJECT
13
14 public:
15 explicit SystemComponentMapModel(SystemComponentManagerInterface * const components,
16 SystemConnectionMapInterface * const connections,
17 QObject * const parent = nullptr);
18 virtual ~SystemComponentMapModel() = default;
19
20 public:
21 virtual bool add(SystemComponentMapInterface::ID const & id,
22 SystemComponentMapInterface::Item * const component) override;
23 virtual bool add(ComponentItemInterface const * const component,
24 SystemComponentItemInterface::Position const & position) override;
25
26 public:
27 virtual SystemComponentMapInterface::Iterator begin() override;
28 virtual SystemComponentMapInterface::ConstIterator begin() const override;
29
30 public:
31 virtual bool clear() override;
32 virtual bool contains(SystemComponentMapInterface::ID const &id) const override;
33
34 public:
35 virtual SystemComponentMapInterface::Iterator end() override;
36 virtual SystemComponentMapInterface::ConstIterator end() const override;
37
38 public:
39 virtual SystemComponentMapInterface::ID getID(SystemComponentMapInterface::Item * const item) const override;
40 virtual SystemComponentMapInterface::Item * getItem(SystemComponentMapInterface::ID const & id) const override;
41
42 public:
43 virtual bool remove(SystemComponentMapInterface::ID const & id) override;
44
45 public:
46 virtual bool duplicate(SystemComponentItemModel const * const component,
47 SystemComponentItemInterface::Position const & position);
48
49 protected:
50 virtual SystemComponentMapInterface::ID next() const;
51
52 protected:
53 SystemComponentManagerInterface * const componentsManager;
54 SystemConnectionMapInterface * const connections;
55
56 protected:
57 SystemComponentMapInterface::Map components;
58 };
59
60 #endif // SYSTEMCOMPONENTMAPMODEL_H
SystemComponentMapInterface::clear
virtual bool clear()=0
Deregisters or remove all the components from the map (system).
ComponentItemInterface
This class defines the items constituing a component:
Definition: ComponentItemInterface.h:40
SystemComponentMapInterface::begin
virtual SystemComponentMapInterface::Iterator begin()=0
Gets an iterator pointing at the first component related-object in the map.
SystemComponentItemInterface::Position
QPoint Position
The position of the component in the System Editor.
Definition: SystemComponentItemInterface.h:48
SystemComponentMapInterface::contains
virtual bool contains(SystemComponentMapInterface::ID const &id) const =0
Verifies if the map contains the component related-object under the key identifier id...
SystemComponentManagerInterface.h
The System Component Manager Interface (SCMI) contains the functions loading components as a library ...
SystemComponentMapInterface::add
virtual bool add(SystemComponentMapInterface::ID const &id, SystemComponentMapInterface::Item *const component)=0
Registers to the map the component related-object component under the key identifier id ...
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemComponentMapInterface::Map
QMap< ID, Item * > Map
The container registering components belonging to a system.
Definition: SystemComponentMapInterface.h:31
SystemConnectionMapInterface
This class manages the registration and deregistration of objects defining connections (connection re...
Definition: SystemConnectionMapInterface.h:25
SystemComponentMapInterface.h
The System Component Map Interface (SCmMI) contains the functions managing the registration and dereg...
SystemComponentMapInterface::getItem
virtual SystemComponentMapInterface::Item * getItem(SystemComponentMapInterface::ID const &id) const =0
Gets the component related-object under the key identifier id that belongs to a system.
SystemComponentMapInterface::end
virtual SystemComponentMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last component related-object.
SystemComponentMapInterface::getID
virtual SystemComponentMapInterface::ID getID(SystemComponentMapInterface::Item *const item) const =0
Gets the key identifier of the component related-object item belonging to a system.
SystemComponentMapInterface::ID
SystemComponentItemInterface::ID ID
The identifier of a component.
Definition: SystemComponentMapInterface.h:27
SystemComponentMapInterface
This class manages the registration and deregistration of objects defining components (component rela...
Definition: SystemComponentMapInterface.h:22
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentOutputItemModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentOutputItemModel.cpp
1 #include "Models/SystemComponentOutputItemModel.h"
2
3 #include "openPASS-System/SystemComponentItemInterface.h"
4 #include "Models/SystemComponentOutputMapModel.h"
5
6 SystemComponentOutputItemModel::SystemComponentOutputItemModel(ComponentOutputItemInterface const * const output,
7 QObject * const parent)
8 : SystemComponentOutputItemInterface(parent)
9 , output(output)
10 , type(output->getType())
11 , title(output->getTitle())
12 , unit(output->getUnit())
13 {
14 }
15
16 SystemComponentItemInterface * SystemComponentOutputItemModel::getComponent() const
17 {
18 if ((parent()) && (parent()->parent()))
19 {
20 SystemComponentItemInterface * const item =
21 qobject_cast<SystemComponentItemInterface * const>(parent()->parent());
22 return ((item) ? item : nullptr);
23 }
24 return nullptr;
25 }
26
27 SystemComponentOutputItemInterface::ID SystemComponentOutputItemModel::getID() const
28 {
29 SystemComponentOutputMapModel const * const outputs =
30 qobject_cast<SystemComponentOutputMapModel const * const>(parent());
31 return ((outputs) ? outputs->getID(const_cast<SystemComponentOutputItemModel *>(this))
32 : SystemComponentOutputItemInterface::ID());
33 }
34
35 SystemComponentOutputItemInterface::Type SystemComponentOutputItemModel::getType() const
36 {
37 return type;
38 }
39
40 SystemComponentOutputItemInterface::Title SystemComponentOutputItemModel::getTitle() const
41 {
42 return title;
43 }
44
45 SystemComponentOutputItemInterface::Unit SystemComponentOutputItemModel::getUnit() const
46 {
47 return unit;
48 }
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentItemInterface.h
The System Component Item Interface (SCmII) contains the functions setters and getters of the items c...
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
ComponentOutputItemInterface
This class defines the items constituing an output of a component:
Definition: ComponentOutputItemInterface.h:33
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentOutputItemModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentOutputItemModel.h
1 #ifndef SYSTEMCOMPONENTOUTPUTITEMMODEL_H
2 #define SYSTEMCOMPONENTOUTPUTITEMMODEL_H
3
4 #include "openPASS-System/SystemComponentOutputItemInterface.h"
5
6 class SystemComponentOutputItemModel : public SystemComponentOutputItemInterface
7 {
8 Q_OBJECT
9
10 public:
11 explicit SystemComponentOutputItemModel(ComponentOutputItemInterface const * const output,
12 QObject * const parent = nullptr);
13 virtual ~SystemComponentOutputItemModel() = default;
14
15 public:
16 virtual SystemComponentItemInterface * getComponent() const override;
17
18 public:
19 virtual SystemComponentOutputItemInterface::ID getID() const override;
20 virtual SystemComponentOutputItemInterface::Type getType() const override;
21 virtual SystemComponentOutputItemInterface::Title getTitle() const override;
22 virtual SystemComponentOutputItemInterface::Unit getUnit() const override;
23
24 protected:
25 ComponentOutputItemInterface const * const output;
26
27 protected:
28 ComponentOutputItemInterface::Type type;
29 ComponentOutputItemInterface::Title title;
30 ComponentOutputItemInterface::Unit unit;
31 };
32
33 #endif // SYSTEMCOMPONENTOUTPUTITEMMODEL_H
SystemComponentOutputItemInterface::getID
virtual SystemComponentOutputItemInterface::ID getID() const =0
Gets the key identifier of the current registered output.
SystemComponentOutputItemInterface::getComponent
virtual SystemComponentItemInterface * getComponent() const =0
Gets the parent component where the current output belongs to.
SystemComponentOutputItemInterface::getType
virtual SystemComponentOutputItemInterface::Type getType() const =0
Gets the type of the current registered output.
SystemComponentOutputItemInterface::getUnit
virtual SystemComponentOutputItemInterface::Unit getUnit() const =0
Gets the unit of the current registered output.
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentOutputItemInterface::getTitle
virtual SystemComponentOutputItemInterface::Title getTitle() const =0
Gets the title of the current registered output.
SystemComponentOutputItemInterface.h
The System Component Output Item Interface (SCOII) contains the functions getters of the items consti...
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
ComponentOutputItemInterface
This class defines the items constituing an output of a component:
Definition: ComponentOutputItemInterface.h:33
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentOutputItemView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentOutputItemView.cpp
1 #include "Views/SystemComponentOutputItemView.h"
2 #include "ui_SystemComponentOutputItemView.h"
3
4 #include "openPASS-System/SystemComponentOutputItemInterface.h"
5 #include <QEvent>
6
7 SystemComponentOutputItemView::SystemComponentOutputItemView(SystemComponentOutputItemInterface * const output,
8 QWidget * const parent)
9 : WidgetView(parent)
10 , output(output)
11 , ui(new Ui::SystemComponentOutputItemView)
12 {
13 ui->setupUi(this);
14 ui->title->setText((output->getUnit().isEmpty())
15 ? QString(QStringLiteral("%1")).
16 arg(output->getTitle())
17 : QString(QStringLiteral("%1 [%2]")).
18 arg(output->getTitle(), output->getUnit()));
19
20 // Inform the user about the type of the output
21 ui->title->setToolTip(QString(QStringLiteral("output type = %1")).arg(output->getType()));
22 }
23
24 SystemComponentOutputItemView::~SystemComponentOutputItemView()
25 {
26 delete ui;
27 }
28
29 SystemComponentOutputItemInterface * SystemComponentOutputItemView::getInterface() const
30 {
31 return output;
32 }
33
34 void SystemComponentOutputItemView::setAddChecked(bool const & checked)
35 {
36 ui->add->setChecked(checked);
37 }
38
39 void SystemComponentOutputItemView::setAddEnabled(bool const & enabled)
40 {
41 ui->add->setEnabled(enabled);
42 }
43
44 void SystemComponentOutputItemView::enterEvent(QEvent * event)
45 {
46 Q_EMIT mouseEnter(this);
47 WidgetView::enterEvent(event);
48 }
49
50 void SystemComponentOutputItemView::leaveEvent(QEvent * event)
51 {
52 Q_EMIT mouseLeave(this);
53 WidgetView::leaveEvent(event);
54 }
55
56 void SystemComponentOutputItemView::on_add_clicked()
57 {
58 Q_EMIT connectionAdd(this);
59 }
60
61 void SystemComponentOutputItemView::on_remove_clicked()
62 {
63 Q_EMIT connectionRemove(this);
64 }
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
SystemComponentOutputItemInterface::getType
virtual SystemComponentOutputItemInterface::Type getType() const =0
Gets the type of the current registered output.
SystemComponentOutputItemInterface::getUnit
virtual SystemComponentOutputItemInterface::Unit getUnit() const =0
Gets the unit of the current registered output.
SystemComponentOutputItemInterface::getTitle
virtual SystemComponentOutputItemInterface::Title getTitle() const =0
Gets the title of the current registered output.
SystemComponentOutputItemInterface.h
The System Component Output Item Interface (SCOII) contains the functions getters of the items consti...
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentOutputItemView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentOutputItemView.h
1 #ifndef SYSTEMCOMPONENTOUTPUTITEMVIEW_H
2 #define SYSTEMCOMPONENTOUTPUTITEMVIEW_H
3
4 #include "Views/WidgetView.h"
5
6 class SystemComponentOutputItemInterface;
7 class QEvent;
8
9 namespace Ui {
10 class SystemComponentOutputItemView;
11 }
12
13 class SystemComponentOutputItemView : public WidgetView
14 {
15 Q_OBJECT
16
17 public:
18 explicit SystemComponentOutputItemView(SystemComponentOutputItemInterface * const output,
19 QWidget * const parent = nullptr);
20 virtual ~SystemComponentOutputItemView();
21
22 Q_SIGNALS:
23 void mouseEnter(SystemComponentOutputItemView * const output);
24 void mouseLeave(SystemComponentOutputItemView * const output);
25 void connectionAdd(SystemComponentOutputItemView * const output);
26 void connectionRemove(SystemComponentOutputItemView * const output);
27
28 public:
29 SystemComponentOutputItemInterface * getInterface() const;
30
31 public:
32 void setAddChecked(bool const & checked);
33 void setAddEnabled(bool const & enabled);
34
35 protected:
36 virtual void enterEvent(QEvent * event) override;
37 virtual void leaveEvent(QEvent * event) override;
38
39 protected Q_SLOTS:
40 void on_add_clicked();
41 void on_remove_clicked();
42
43 protected:
44 SystemComponentOutputItemInterface * const output;
45
46 protected:
47 Ui::SystemComponentOutputItemView * const ui;
48 };
49
50 #endif // SYSTEMCOMPONENTOUTPUTITEMVIEW_H
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentOutputMapModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentOutputMapModel.cpp
1 #include "Models/SystemComponentOutputMapModel.h"
2
3 #include "Models/SystemComponentOutputItemModel.h"
4
5 SystemComponentOutputMapModel::SystemComponentOutputMapModel(ComponentOutputMapInterface const * const _outputs,
6 QObject * const parent)
7 : SystemComponentOutputMapInterface(parent)
8 {
9 for (ComponentOutputItemInterface const * const output : *_outputs)
10 {
11 outputs.insert(output->getID(), new SystemComponentOutputItemModel(output, this));
12 }
13 }
14
15 SystemComponentOutputMapInterface::Iterator SystemComponentOutputMapModel::begin()
16 {
17 return outputs.begin();
18 }
19
20 SystemComponentOutputMapInterface::ConstIterator SystemComponentOutputMapModel::begin() const
21 {
22 return outputs.begin();
23 }
24
25 bool SystemComponentOutputMapModel::contains(SystemComponentOutputMapInterface::ID const &id) const
26 {
27 return outputs.keys().contains(id);
28 }
29
30 SystemComponentOutputMapInterface::Iterator SystemComponentOutputMapModel::end()
31 {
32 return outputs.end();
33 }
34
35 SystemComponentOutputMapInterface::ConstIterator SystemComponentOutputMapModel::end() const
36 {
37 return outputs.end();
38 }
39
40 SystemComponentOutputMapInterface::ID SystemComponentOutputMapModel::getID(SystemComponentOutputMapInterface::Item * const item) const
41 {
42 return outputs.key(item);
43 }
44
45 SystemComponentOutputMapInterface::Item * SystemComponentOutputMapModel::getItem(SystemComponentOutputMapInterface::ID const & id) const
46 {
47 return outputs.value(id, nullptr);
48 }
SystemComponentOutputMapInterface
This class manages the registration and deregistration of outputs of a component registered in a syst...
Definition: SystemComponentOutputMapInterface.h:22
ComponentOutputMapInterface
This class manages the registration and deregistration of outputs of a component. It provides a map a...
Definition: ComponentOutputMapInterface.h:32
SystemComponentOutputMapInterface::begin
virtual SystemComponentOutputMapInterface::Iterator begin()=0
Gets an iterator pointing at the first registered output in the map.
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemComponentOutputMapInterface::ID
SystemComponentOutputItemInterface::ID ID
The output&#39;s key identifier.
Definition: SystemComponentOutputMapInterface.h:27
ComponentOutputItemInterface
This class defines the items constituing an output of a component:
Definition: ComponentOutputItemInterface.h:33
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentOutputMapModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentOutputMapModel.h
1 #ifndef SYSTEMCOMPONENTOUTPUTMAPMODEL_H
2 #define SYSTEMCOMPONENTOUTPUTMAPMODEL_H
3
4 #include "openPASS-Component/ComponentOutputMapInterface.h"
5 #include "openPASS-System/SystemComponentOutputMapInterface.h"
6
7 class SystemComponentOutputMapModel : public SystemComponentOutputMapInterface
8 {
9 Q_OBJECT
10
11 public:
12 explicit SystemComponentOutputMapModel(ComponentOutputMapInterface const * const outputs,
13 QObject * const parent = nullptr);
14 virtual ~SystemComponentOutputMapModel() = default;
15
16 public:
17 virtual SystemComponentOutputMapInterface::Iterator begin() override;
18 virtual SystemComponentOutputMapInterface::ConstIterator begin() const override;
19
20 public:
21 virtual bool contains(SystemComponentOutputMapInterface::ID const & id) const override;
22
23 public:
24 virtual SystemComponentOutputMapInterface::Iterator end() override;
25 virtual SystemComponentOutputMapInterface::ConstIterator end() const override;
26
27 public:
28 virtual SystemComponentOutputMapInterface::ID getID(SystemComponentOutputMapInterface::Item * const item) const override;
29 virtual SystemComponentOutputMapInterface::Item * getItem(SystemComponentOutputMapInterface::ID const & id) const override;
30
31 protected:
32 SystemComponentOutputMapInterface::Map outputs;
33 };
34
35 #endif // SYSTEMCOMPONENTOUTPUTMAPMODEL_H
SystemComponentOutputMapInterface
This class manages the registration and deregistration of outputs of a component registered in a syst...
Definition: SystemComponentOutputMapInterface.h:22
ComponentOutputMapInterface
This class manages the registration and deregistration of outputs of a component. It provides a map a...
Definition: ComponentOutputMapInterface.h:32
ComponentOutputMapInterface.h
The Component Output Map Interface (COMI) contains the functions managing the registration and deregi...
SystemComponentOutputMapInterface::Map
QMap< ID, Item * > Map
The container registering outputs.
Definition: SystemComponentOutputMapInterface.h:31
SystemComponentOutputMapInterface::end
virtual SystemComponentOutputMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last registered output. ...
SystemComponentOutputMapInterface::getItem
virtual SystemComponentOutputMapInterface::Item * getItem(SystemComponentOutputMapInterface::ID const &id) const =0
Gets the registered output related-object under the key identifier id.
SystemComponentOutputMapInterface::getID
virtual SystemComponentOutputMapInterface::ID getID(SystemComponentOutputMapInterface::Item *const item) const =0
Gets the key identifier of the component output related-object item as registered in the map...
SystemComponentOutputMapInterface::begin
virtual SystemComponentOutputMapInterface::Iterator begin()=0
Gets an iterator pointing at the first registered output in the map.
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemComponentOutputMapInterface.h
The System Component Output Map Interface (SCOMI) contains the functions managing the registration an...
SystemComponentOutputMapInterface::ID
SystemComponentOutputItemInterface::ID ID
The output&#39;s key identifier.
Definition: SystemComponentOutputMapInterface.h:27
SystemComponentOutputMapInterface::contains
virtual bool contains(SystemComponentOutputMapInterface::ID const &id) const =0
Verifies if the map contains the output under the key identifier id.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterItemModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentParameterItemModel.cpp
1 #include "Models/SystemComponentParameterItemModel.h"
2
3 #include "Models/SystemComponentParameterMapModel.h"
4
5 SystemComponentParameterItemModel::SystemComponentParameterItemModel(ComponentParameterItemInterface const * const parameter,
6 QObject * const parent)
7 : SystemComponentParameterItemInterface(parent)
8 , parameter(parameter)
9 , type(parameter->getType())
10 , title(parameter->getTitle())
11 , unit(parameter->getUnit())
12 , value(parameter->getValue())
13 {
14 }
15
16 SystemComponentParameterItemInterface::ID SystemComponentParameterItemModel::getID() const
17 {
18 SystemComponentParameterMapModel const * const parameters =
19 qobject_cast<SystemComponentParameterMapModel const * const>(parent());
20 return ((parameters) ? parameters->getID(const_cast<SystemComponentParameterItemModel *>(this))
21 : SystemComponentParameterItemInterface::ID());
22 }
23
24 SystemComponentParameterItemInterface::Type SystemComponentParameterItemModel::getType() const
25 {
26 return type;
27 }
28
29 SystemComponentParameterItemInterface::Title SystemComponentParameterItemModel::getTitle() const
30 {
31 return title;
32 }
33
34 SystemComponentParameterItemInterface::Unit SystemComponentParameterItemModel::getUnit() const
35 {
36 return unit;
37 }
38
39 bool SystemComponentParameterItemModel::setValue(SystemComponentParameterItemInterface::Value const & _value)
40 {
41 value = _value;
42 Q_EMIT modifiedValue();
43 return true;
44 }
45
46 SystemComponentParameterItemInterface::Value SystemComponentParameterItemModel::getValue() const
47 {
48 return value;
49 }
ComponentParameterItemInterface
This class defines the items constituing a parameter of a component:
Definition: ComponentParameterItemInterface.h:34
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterItemModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentParameterItemModel.h
1 #ifndef SYSTEMCOMPONENTPARAMETERITEMMODEL_H
2 #define SYSTEMCOMPONENTPARAMETERITEMMODEL_H
3
4 #include "openPASS-System/SystemComponentParameterItemInterface.h"
5
6 class SystemComponentParameterItemModel : public SystemComponentParameterItemInterface
7 {
8 Q_OBJECT
9
10 public:
11 explicit SystemComponentParameterItemModel(ComponentParameterItemInterface const * const parameter,
12 QObject * const parent = nullptr);
13 virtual ~SystemComponentParameterItemModel() = default;
14
15 public:
16 virtual SystemComponentParameterItemInterface::ID getID() const override;
17 virtual SystemComponentParameterItemInterface::Type getType() const override;
18 virtual SystemComponentParameterItemInterface::Title getTitle() const override;
19 virtual SystemComponentParameterItemInterface::Unit getUnit() const override;
20
21 public:
22 virtual bool setValue(SystemComponentParameterItemInterface::Value const & value) override;
23 virtual SystemComponentParameterItemInterface::Value getValue() const override;
24
25 protected:
26 ComponentParameterItemInterface const * const parameter;
27
28 protected:
29 SystemComponentParameterItemInterface::Type type;
30 SystemComponentParameterItemInterface::Title title;
31 SystemComponentParameterItemInterface::Unit unit;
32 SystemComponentParameterItemInterface::Value value;
33 };
34
35 #endif // SYSTEMCOMPONENTPARAMETERITEMMODEL_H
SystemComponentParameterItemInterface::getType
virtual SystemComponentParameterItemInterface::Type getType() const =0
Gets the type of the current registered parameter.
SystemComponentParameterItemInterface::setValue
virtual bool setValue(SystemComponentParameterItemInterface::Value const &value)=0
Sets the value of the current registered parameter.
SystemComponentParameterItemInterface::getUnit
virtual SystemComponentParameterItemInterface::Unit getUnit() const =0
Gets the unit of the current registered parameter.
SystemComponentParameterItemInterface::getTitle
virtual SystemComponentParameterItemInterface::Title getTitle() const =0
Gets the title of the current registered parameter.
SystemComponentParameterItemInterface::getID
virtual SystemComponentParameterItemInterface::ID getID() const =0
Gets the key identifier of the current registered parameter.
ComponentParameterItemInterface
This class defines the items constituing a parameter of a component:
Definition: ComponentParameterItemInterface.h:34
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
SystemComponentParameterItemInterface.h
The System Component Parameter Item Interface (SCPII) contains the functions setters and getters of t...
SystemComponentParameterItemInterface::getValue
virtual SystemComponentParameterItemInterface::Value getValue() const =0
Gets the value of the current registered parameter.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterItemView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentParameterItemView.cpp
1 #include "Views/SystemComponentParameterItemView.h"
2 #include "ui_SystemComponentParameterItemView.h"
3
4 #include "openPASS-System/SystemComponentParameterItemInterface.h"
5 #include "Views/SystemComponentParameterValueBoolView.h"
6 #include "Views/SystemComponentParameterValueDoubleView.h"
7 #include "Views/SystemComponentParameterValueFloatView.h"
8 #include "Views/SystemComponentParameterValueIntView.h"
9 #include "Views/SystemComponentParameterValueStringView.h"
10
11 SystemComponentParameterItemView::SystemComponentParameterItemView(SystemComponentParameterItemInterface * const parameter,
12 QWidget * const parent)
13 : WidgetView(parent)
14 , parameter(parameter)
15 , ui(new Ui::SystemComponentParameterItemViews)
16 {
17 // Setup UI
18 ui->setupUi(this);
19 updateTitle();
20
21 // Setup value / bool
22 if (parameter->getType() == QStringLiteral("bool"))
23 ui->layout->addWidget(new SystemComponentParameterValueBoolView
24 (parameter, this), 0, Qt::AlignRight);
25
26 // Setup value / int
27 if (parameter->getType() == QStringLiteral("int"))
28 ui->layout->addWidget(new SystemComponentParameterValueIntView
29 (parameter, this), 0, Qt::AlignRight);
30
31 // Setup value / float
32 if (parameter->getType() == QStringLiteral("float"))
33 ui->layout->addWidget(new SystemComponentParameterValueFloatView
34 (parameter, this), 0, Qt::AlignRight);
35
36 // Setup value / double
37 if (parameter->getType() == QStringLiteral("double"))
38 ui->layout->addWidget(new SystemComponentParameterValueDoubleView
39 (parameter, this), 0, Qt::AlignRight);
40
41 // Setup value / string
42 if (parameter->getType() == QStringLiteral("string"))
43 ui->layout->addWidget(new SystemComponentParameterValueStringView
44 (parameter, this), 0, Qt::AlignRight);
45 }
46
47 SystemComponentParameterItemView::~SystemComponentParameterItemView()
48 {
49 // Destroy UI
50 delete ui;
51 }
52
53 void SystemComponentParameterItemView::updateTitle()
54 {
55 // Update title
56 ui->title->setText((parameter->getUnit().isEmpty())
57 ? QString(QStringLiteral("%1")).
58 arg(parameter->getTitle())
59 : QString(QStringLiteral("%1 [%2]")).
60 arg(parameter->getTitle(), parameter->getUnit()));
61 }
SystemComponentParameterItemInterface::getType
virtual SystemComponentParameterItemInterface::Type getType() const =0
Gets the type of the current registered parameter.
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
SystemComponentParameterItemInterface::getUnit
virtual SystemComponentParameterItemInterface::Unit getUnit() const =0
Gets the unit of the current registered parameter.
SystemComponentParameterItemInterface::getTitle
virtual SystemComponentParameterItemInterface::Title getTitle() const =0
Gets the title of the current registered parameter.
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
SystemComponentParameterItemInterface.h
The System Component Parameter Item Interface (SCPII) contains the functions setters and getters of t...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterItemView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentParameterItemView.h
1 #ifndef SYSTEMCOMPONENTPARAMETERITEMVIEW_H
2 #define SYSTEMCOMPONENTPARAMETERITEMVIEW_H
3
4 #include "Views/WidgetView.h"
5
6 class SystemComponentParameterItemInterface;
7
8 namespace Ui {
9 class SystemComponentParameterItemViews;
10 }
11
12 class SystemComponentParameterItemView : public WidgetView
13 {
14 Q_OBJECT
15
16 public:
17 explicit SystemComponentParameterItemView(SystemComponentParameterItemInterface * const parameter,
18 QWidget * const parent = nullptr);
19 virtual ~SystemComponentParameterItemView();
20
21 protected Q_SLOTS:
22 void updateTitle();
23
24 protected:
25 SystemComponentParameterItemInterface * const parameter;
26
27 protected:
28 Ui::SystemComponentParameterItemViews * const ui;
29 };
30
31 #endif // SYSTEMCOMPONENTPARAMETERITEMVIEW_H
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterMapModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentParameterMapModel.cpp
1 #include "Models/SystemComponentParameterMapModel.h"
2
3 #include "Models/SystemComponentParameterItemModel.h"
4
5 SystemComponentParameterMapModel::SystemComponentParameterMapModel(ComponentParameterMapInterface const * const _parameters,
6 QObject * const parent)
7 : SystemComponentParameterMapInterface(parent)
8 {
9 for (ComponentParameterItemInterface const * const parameter : *_parameters)
10 {
11 parameters.insert(parameter->getID(), new SystemComponentParameterItemModel(parameter, this));
12 }
13 }
14
15 int SystemComponentParameterMapModel::count() const
16 {
17 return parameters.count();
18 }
19
20 SystemComponentParameterMapInterface::Iterator SystemComponentParameterMapModel::begin()
21 {
22 return parameters.begin();
23 }
24
25 SystemComponentParameterMapInterface::ConstIterator SystemComponentParameterMapModel::begin() const
26 {
27 return parameters.begin();
28 }
29
30 SystemComponentParameterMapInterface::Iterator SystemComponentParameterMapModel::end()
31 {
32 return parameters.end();
33 }
34
35 SystemComponentParameterMapInterface::ConstIterator SystemComponentParameterMapModel::end() const
36 {
37 return parameters.end();
38 }
39
40 SystemComponentParameterMapInterface::ID SystemComponentParameterMapModel::getID(SystemComponentParameterMapInterface::Item * const item) const
41 {
42 return parameters.key(item);
43 }
44
45 SystemComponentParameterMapInterface::Item * SystemComponentParameterMapModel::getItem(SystemComponentParameterMapInterface::ID const & id) const
46 {
47 return parameters.value(id, nullptr);
48 }
SystemComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component registered in a s...
Definition: SystemComponentParameterMapInterface.h:22
SystemComponentParameterMapInterface::count
virtual int count() const =0
Counts the number of parameters registered for a component.
SystemComponentParameterMapInterface::ID
SystemComponentParameterItemInterface::ID ID
The parameter&#39;s key identifier.
Definition: SystemComponentParameterMapInterface.h:27
ComponentParameterItemInterface
This class defines the items constituing a parameter of a component:
Definition: ComponentParameterItemInterface.h:34
ComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component. It provides a map as container with unique identifiers as a keys to sort the parameters.
Definition: ComponentParameterMapInterface.h:33
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterMapModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentParameterMapModel.h
1 #ifndef SYSTEMCOMPONENTPARAMETERMAPMODEL_H
2 #define SYSTEMCOMPONENTPARAMETERMAPMODEL_H
3
4 #include "openPASS-Component/ComponentParameterMapInterface.h"
5 #include "openPASS-System/SystemComponentParameterMapInterface.h"
6
7 class SystemComponentParameterMapModel : public SystemComponentParameterMapInterface
8 {
9 Q_OBJECT
10
11 public:
12 explicit SystemComponentParameterMapModel(ComponentParameterMapInterface const * const parameters,
13 QObject * const parent = nullptr);
14 virtual ~SystemComponentParameterMapModel() = default;
15
16 public:
17 virtual int count() const override;
18
19 public:
20 virtual SystemComponentParameterMapInterface::Iterator begin() override;
21 virtual SystemComponentParameterMapInterface::ConstIterator begin() const override;
22
23 public:
24 virtual SystemComponentParameterMapInterface::Iterator end() override;
25 virtual SystemComponentParameterMapInterface::ConstIterator end() const override;
26
27 public:
28 virtual SystemComponentParameterMapInterface::ID getID(SystemComponentParameterMapInterface::Item * const item) const override;
29 virtual SystemComponentParameterMapInterface::Item * getItem(SystemComponentParameterMapInterface::ID const & id) const override;
30
31 protected:
32 SystemComponentParameterMapInterface::Map parameters;
33 };
34
35 #endif // SYSTEMCOMPONENTPARAMETERMAPMODEL_H
SystemComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component registered in a s...
Definition: SystemComponentParameterMapInterface.h:22
SystemComponentParameterMapInterface::count
virtual int count() const =0
Counts the number of parameters registered for a component.
SystemComponentParameterMapInterface.h
The System Component Parameter Map Interface (SCPMI) contains the functions managing the registration...
SystemComponentParameterMapInterface::getItem
virtual SystemComponentParameterMapInterface::Item * getItem(SystemComponentParameterMapInterface::ID const &id) const =0
Gets the registered parameter related-object under the key identifier id.
SystemComponentParameterMapInterface::ID
SystemComponentParameterItemInterface::ID ID
The parameter&#39;s key identifier.
Definition: SystemComponentParameterMapInterface.h:27
SystemComponentParameterMapInterface::end
virtual SystemComponentParameterMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last registered parameter.
SystemComponentParameterMapInterface::begin
virtual SystemComponentParameterMapInterface::Iterator begin()=0
Gets an iterator pointing at the first registered parameter in the map.
SystemComponentParameterMapInterface::getID
virtual SystemComponentParameterMapInterface::ID getID(SystemComponentParameterMapInterface::Item *const item) const =0
Gets the key identifier of the registered parameter related-object item in the map.
SystemComponentParameterMapInterface::Map
QMap< ID, Item * > Map
The container registering parameters.
Definition: SystemComponentParameterMapInterface.h:31
ComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component. It provides a map as container with unique identifiers as a keys to sort the parameters.
Definition: ComponentParameterMapInterface.h:33
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
ComponentParameterMapInterface.h
The Component Parameter Map Interface (CPMI) contains the functions managing the registration and der...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterValueBoolView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentParameterValueBoolView.cpp
1 #include "Views/SystemComponentParameterValueBoolView.h"
2
3 #include "openPASS-System/SystemComponentParameterItemInterface.h"
4
5 SystemComponentParameterValueBoolView::SystemComponentParameterValueBoolView(SystemComponentParameterItemInterface * const parameter,
6 QWidget * const parent)
7 : QCheckBox(parent)
8 , parameter(parameter)
9 {
10 connect(parameter, &SystemComponentParameterItemInterface::modifiedValue,
11 this, &SystemComponentParameterValueBoolView::updateView);
12 connect(this, &SystemComponentParameterValueBoolView::toggled,
13 this, &SystemComponentParameterValueBoolView::updateInterface);
14 updateView();
15 }
16
17 void SystemComponentParameterValueBoolView::updateInterface(bool checked)
18 {
19 parameter->setValue((checked) ? QStringLiteral("1") : QStringLiteral("0"));
20 }
21
22 void SystemComponentParameterValueBoolView::updateView()
23 {
24 setChecked(parameter->getValue() == QStringLiteral("1"));
25 }
SystemComponentParameterItemInterface::modifiedValue
void modifiedValue() const
Triggers signal to inform that the value of the registered parameter has been modified.
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
SystemComponentParameterItemInterface.h
The System Component Parameter Item Interface (SCPII) contains the functions setters and getters of t...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterValueBoolView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentParameterValueBoolView.h
1 #ifndef SYSTEMCOMPONENTPARAMETERVALUEBOOLVIEW_H
2 #define SYSTEMCOMPONENTPARAMETERVALUEBOOLVIEW_H
3
4 #include <QCheckBox>
5
6 class SystemComponentParameterItemInterface;
7
8 class SystemComponentParameterValueBoolView : public QCheckBox
9 {
10 Q_OBJECT
11
12 public:
13 explicit SystemComponentParameterValueBoolView(SystemComponentParameterItemInterface * const parameter,
14 QWidget * const parent = nullptr);
15 virtual ~SystemComponentParameterValueBoolView() = default;
16
17 protected Q_SLOTS:
18 void updateInterface(bool checked);
19 void updateView();
20
21 protected:
22 SystemComponentParameterItemInterface * const parameter;
23 };
24
25 #endif // SYSTEMCOMPONENTPARAMETERVALUEBOOLVIEW_H
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterValueDoubleView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentParameterValueDoubleView.cpp
1 #include "Views/SystemComponentParameterValueDoubleView.h"
2
3 #include "openPASS-System/SystemComponentParameterItemInterface.h"
4 #include <limits>
5 #include <QtMath>
6
7 SystemComponentParameterValueDoubleView::SystemComponentParameterValueDoubleView(SystemComponentParameterItemInterface * const parameter,
8 QWidget * const parent)
9 : DoubleSpinBoxView(parent)
10 , parameter(parameter)
11 {
12 setMinimumSize(0, 20);
13 setMaximumSize(64, 20);
14 setFrame(false);
15 setDecimals(3);
16 setSingleStep(pow(10,adjustStepSize(parameter->getValue().toDouble())));
17 setMinimum(std::numeric_limits<double>::lowest());
18 setMaximum(std::numeric_limits<double>::max());
19 setKeyboardTracking(false);
20 connect(parameter, &SystemComponentParameterItemInterface::modifiedValue,
21 this, &SystemComponentParameterValueDoubleView::updateView);
22 connect(this, static_cast<void (SystemComponentParameterValueDoubleView::*)(double)>(
23 &SystemComponentParameterValueDoubleView::valueChanged),
24 this, &SystemComponentParameterValueDoubleView::updateInterface);
25 updateView();
26 }
27
28 int SystemComponentParameterValueDoubleView::adjustStepSize(double value)
29 {
30 // Determine the number of decimals (with 3 max) in the value
31 int i= 0;
32 value = (value - qFloor(value)) * 10;
33 while (value != 0 && i>-3)
34 {
35 value = (value - qFloor(value)) * 10;
36 i -= 1;
37 }
38 return i;
39 }
40
41 void SystemComponentParameterValueDoubleView::updateInterface(double value)
42 {
43 parameter->setValue(QString::number(value));
44 }
45
46 void SystemComponentParameterValueDoubleView::updateView()
47 {
48 setValue(parameter->getValue().toDouble());
49 }
SystemComponentParameterItemInterface::setValue
virtual bool setValue(SystemComponentParameterItemInterface::Value const &value)=0
Sets the value of the current registered parameter.
SystemComponentParameterItemInterface::modifiedValue
void modifiedValue() const
Triggers signal to inform that the value of the registered parameter has been modified.
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
SystemComponentParameterItemInterface.h
The System Component Parameter Item Interface (SCPII) contains the functions setters and getters of t...
SystemComponentParameterItemInterface::getValue
virtual SystemComponentParameterItemInterface::Value getValue() const =0
Gets the value of the current registered parameter.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterValueDoubleView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentParameterValueDoubleView.h
1 #ifndef SYSTEMCOMPONENTPARAMETERVALUEDOUBLEVIEW_H
2 #define SYSTEMCOMPONENTPARAMETERVALUEDOUBLEVIEW_H
3
4 #include "Views/DoubleSpinBoxView.h"
5
6 class SystemComponentParameterItemInterface;
7
8 class SystemComponentParameterValueDoubleView : public DoubleSpinBoxView
9 {
10 Q_OBJECT
11
12 public:
13 explicit SystemComponentParameterValueDoubleView(SystemComponentParameterItemInterface * const parameter,
14 QWidget * const parent = nullptr);
15 virtual ~SystemComponentParameterValueDoubleView() = default;
16
17 public:
18 int adjustStepSize(double value);
19
20 protected Q_SLOTS:
21 void updateInterface(double value);
22 void updateView();
23
24 protected:
25 SystemComponentParameterItemInterface * const parameter;
26 };
27
28 #endif // SYSTEMCOMPONENTPARAMETERVALUEDOUBLEVIEW_H
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterValueFloatView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentParameterValueFloatView.cpp
1 #include "Views/SystemComponentParameterValueFloatView.h"
2
3 #include "openPASS-System/SystemComponentParameterItemInterface.h"
4 #include <limits>
5 #include <QtMath>
6
7 SystemComponentParameterValueFloatView::SystemComponentParameterValueFloatView(SystemComponentParameterItemInterface * const parameter,
8 QWidget * const parent)
9 : DoubleSpinBoxView(parent)
10 , parameter(parameter)
11 {
12 setMinimumSize(0, 20);
13 setMaximumSize(64, 20);
14 setFrame(false);
15 setDecimals(3);
16 setSingleStep(pow(10,adjustStepSize(parameter->getValue().toFloat())));
17 setMinimum(std::numeric_limits<float>::lowest());
18 setMaximum(std::numeric_limits<float>::max());
19 setKeyboardTracking(false);
20 connect(parameter, &SystemComponentParameterItemInterface::modifiedValue,
21 this, &SystemComponentParameterValueFloatView::updateView);
22 connect(this, static_cast<void (SystemComponentParameterValueFloatView::*)(double)>(
23 &SystemComponentParameterValueFloatView::valueChanged),
24 this, &SystemComponentParameterValueFloatView::updateInterface);
25 updateView();
26 }
27
28 int SystemComponentParameterValueFloatView::adjustStepSize(double value)
29 {
30 // Determine the number of decimals (with 3 max) in the value
31 int i= 0;
32 value = (value - qFloor(value)) * 10;
33 while (value != 0 && i>-3)
34 {
35 value = (value - qFloor(value)) * 10;
36 i -= 1;
37 }
38 return i;
39 }
40
41 void SystemComponentParameterValueFloatView::updateInterface(double value)
42 {
43 parameter->setValue(QString::number(static_cast<float>(value)));
44 }
45
46 void SystemComponentParameterValueFloatView::updateView()
47 {
48 setValue(static_cast<double>(parameter->getValue().toFloat()));
49 }
SystemComponentParameterItemInterface::setValue
virtual bool setValue(SystemComponentParameterItemInterface::Value const &value)=0
Sets the value of the current registered parameter.
SystemComponentParameterItemInterface::modifiedValue
void modifiedValue() const
Triggers signal to inform that the value of the registered parameter has been modified.
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
SystemComponentParameterItemInterface.h
The System Component Parameter Item Interface (SCPII) contains the functions setters and getters of t...
SystemComponentParameterItemInterface::getValue
virtual SystemComponentParameterItemInterface::Value getValue() const =0
Gets the value of the current registered parameter.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterValueFloatView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentParameterValueFloatView.h
1 #ifndef SYSTEMCOMPONENTPARAMETERVALUEFLOATVIEW_H
2 #define SYSTEMCOMPONENTPARAMETERVALUEFLOATVIEW_H
3
4 #include "Views/DoubleSpinBoxView.h"
5
6 class SystemComponentParameterItemInterface;
7
8 class SystemComponentParameterValueFloatView : public DoubleSpinBoxView
9 {
10 Q_OBJECT
11
12 public:
13 explicit SystemComponentParameterValueFloatView(SystemComponentParameterItemInterface * const parameter,
14 QWidget * const parent = nullptr);
15 virtual ~SystemComponentParameterValueFloatView() = default;
16
17 public:
18 int adjustStepSize(double value);
19
20 protected Q_SLOTS:
21 void updateInterface(double value);
22 void updateView();
23
24 protected:
25 SystemComponentParameterItemInterface * const parameter;
26 };
27
28 #endif // SYSTEMCOMPONENTPARAMETERVALUEFLOATVIEW_H
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterValueIntView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentParameterValueIntView.cpp
1 #include "Views/SystemComponentParameterValueIntView.h"
2
3 #include "openPASS-System/SystemComponentParameterItemInterface.h"
4 #include <limits>
5
6 SystemComponentParameterValueIntView::SystemComponentParameterValueIntView(SystemComponentParameterItemInterface * const parameter,
7 QWidget * const parent)
8 : SpinBoxView(parent)
9 , parameter(parameter)
10 {
11 setMinimumSize(0, 20);
12 setMaximumSize(64, 20);
13 setFrame(false);
14 setMinimum(std::numeric_limits<int>::lowest());
15 setMaximum(std::numeric_limits<int>::max());
16 setKeyboardTracking(false);
17 connect(parameter, &SystemComponentParameterItemInterface::modifiedValue,
18 this, &SystemComponentParameterValueIntView::updateView);
19 connect(this, static_cast<void (SystemComponentParameterValueIntView::*)(int)>(
20 &SystemComponentParameterValueIntView::valueChanged),
21 this, &SystemComponentParameterValueIntView::updateInterface);
22 updateView();
23 }
24
25 void SystemComponentParameterValueIntView::updateInterface(int value)
26 {
27 parameter->setValue(QString::number(value));
28 }
29
30 void SystemComponentParameterValueIntView::updateView()
31 {
32 setValue(parameter->getValue().toInt());
33 }
SystemComponentParameterItemInterface::setValue
virtual bool setValue(SystemComponentParameterItemInterface::Value const &value)=0
Sets the value of the current registered parameter.
SystemComponentParameterItemInterface::modifiedValue
void modifiedValue() const
Triggers signal to inform that the value of the registered parameter has been modified.
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
SystemComponentParameterItemInterface.h
The System Component Parameter Item Interface (SCPII) contains the functions setters and getters of t...
SystemComponentParameterItemInterface::getValue
virtual SystemComponentParameterItemInterface::Value getValue() const =0
Gets the value of the current registered parameter.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterValueIntView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentParameterValueIntView.h
1 #ifndef SYSTEMCOMPONENTPARAMETERVALUEINTVIEW_H
2 #define SYSTEMCOMPONENTPARAMETERVALUEINTVIEW_H
3
4 #include "Views/SpinBoxView.h"
5
6 class SystemComponentParameterItemInterface;
7
8 class SystemComponentParameterValueIntView : public SpinBoxView
9 {
10 Q_OBJECT
11
12 public:
13 explicit SystemComponentParameterValueIntView(SystemComponentParameterItemInterface * const parameter,
14 QWidget * const parent = nullptr);
15 virtual ~SystemComponentParameterValueIntView() = default;
16
17 protected Q_SLOTS:
18 void updateInterface(int value);
19 void updateView();
20
21 protected:
22 SystemComponentParameterItemInterface * const parameter;
23 };
24
25 #endif // SYSTEMCOMPONENTPARAMETERVALUEINTVIEW_H
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterValueStringView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentParameterValueStringView.cpp
1 #include "Views/SystemComponentParameterValueStringView.h"
2
3 #include "openPASS-System/SystemComponentParameterItemInterface.h"
4
5 SystemComponentParameterValueStringView::SystemComponentParameterValueStringView(SystemComponentParameterItemInterface * const parameter,
6 QWidget * const parent)
7 : QLineEdit(parent)
8 , parameter(parameter)
9 {
10 setMinimumSize(0, 20);
11 setMaximumSize(64, 20);
12 setFrame(false);
13 connect(parameter, &SystemComponentParameterItemInterface::modifiedValue,
14 this, &SystemComponentParameterValueStringView::updateView);
15 connect(this, &SystemComponentParameterValueStringView::textChanged,
16 this, &SystemComponentParameterValueStringView::updateInterface);
17 updateView();
18 }
19
20 void SystemComponentParameterValueStringView::updateInterface(QString const & text)
21 {
22 parameter->setValue(text);
23 }
24
25 void SystemComponentParameterValueStringView::updateView()
26 {
27 int const position = cursorPosition();
28 setText(parameter->getValue());
29 setCursorPosition(position);
30 }
SystemComponentParameterItemInterface::modifiedValue
void modifiedValue() const
Triggers signal to inform that the value of the registered parameter has been modified.
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
SystemComponentParameterItemInterface.h
The System Component Parameter Item Interface (SCPII) contains the functions setters and getters of t...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterValueStringView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentParameterValueStringView.h
1 #ifndef SYSTEMCOMPONENTPARAMETERVALUESTRINGVIEW_H
2 #define SYSTEMCOMPONENTPARAMETERVALUESTRINGVIEW_H
3
4 #include <QLineEdit>
5
6 class SystemComponentParameterItemInterface;
7
8 class SystemComponentParameterValueStringView : public QLineEdit
9 {
10 Q_OBJECT
11
12 public:
13 explicit SystemComponentParameterValueStringView(SystemComponentParameterItemInterface * const parameter,
14 QWidget * const parent = nullptr);
15 virtual ~SystemComponentParameterValueStringView() = default;
16
17 protected Q_SLOTS:
18 void updateInterface(QString const & text);
19 void updateView();
20
21 protected:
22 SystemComponentParameterItemInterface * const parameter;
23 };
24
25 #endif // SYSTEMCOMPONENTPARAMETERVALUESTRINGVIEW_H
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentScheduleModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentScheduleModel.cpp
1 #include "Models/SystemComponentScheduleModel.h"
2
3 #include "Models/SystemComponentItemModel.h"
4 #include "Models/SystemComponentMapModel.h"
5
6 SystemComponentScheduleModel::SystemComponentScheduleModel(ComponentScheduleInterface const * const schedule,
7 QObject * const parent)
8 : SystemComponentScheduleInterface(parent)
9 , priority(0)
10 , offset(schedule->getOffset())
11 , cycle(schedule->getCycle())
12 , response(schedule->getResponse())
13 {
14 }
15
16 bool SystemComponentScheduleModel::setPriority(SystemComponentScheduleInterface::Priority const & _priority)
17 {
18 if (checkValidPriority(_priority))
19 {
20 priority = _priority;
21 }
22 else
23 {
24 priority = 0;
25 }
26 Q_EMIT modifiedPriority();
27 return true;
28 }
29
30 bool SystemComponentScheduleModel::checkValidPriority(SystemComponentScheduleInterface::Priority const &priority)
31 {
32 // Bug fix cancelling the verification of the unicity of the value priority in the list of components modelling the system
33 Q_UNUSED(priority);
34 return true;
35 }
36
37 SystemComponentScheduleInterface::Priority SystemComponentScheduleModel::getPriority() const
38 {
39 return priority;
40 }
41
42 bool SystemComponentScheduleModel::setOffset(SystemComponentScheduleInterface::Offset const & _offset)
43 {
44 offset = _offset;
45 Q_EMIT modifiedOffset();
46 return true;
47 }
48
49 SystemComponentScheduleInterface::Offset SystemComponentScheduleModel::getOffset() const
50 {
51 return offset;
52 }
53
54 bool SystemComponentScheduleModel::setCycle(SystemComponentScheduleInterface::Cycle const & _cycle)
55 {
56 cycle = _cycle;
57 Q_EMIT modifiedCycle();
58 return true;
59 }
60
61 SystemComponentScheduleInterface::Cycle SystemComponentScheduleModel::getCycle() const
62 {
63 return cycle;
64 }
65
66 bool SystemComponentScheduleModel::setResponse(SystemComponentScheduleInterface::Response const & _response)
67 {
68 response = _response;
69 Q_EMIT modifiedResponse();
70 return true;
71 }
72
73 SystemComponentScheduleInterface::Response SystemComponentScheduleModel::getResponse() const
74 {
75 return response;
76 }
ComponentScheduleInterface
This class defines the schedule parameters of a component:
Definition: ComponentScheduleInterface.h:31
SystemComponentScheduleInterface
This class defines the simulation schedule related parameters of a component registered in a system: ...
Definition: SystemComponentScheduleInterface.h:25
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentScheduleModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemComponentScheduleModel.h
1 #ifndef SYSTEMCOMPONENTSCHEDULEMODEL_H
2 #define SYSTEMCOMPONENTSCHEDULEMODEL_H
3
4 #include "openPASS-System/SystemComponentScheduleInterface.h"
5
6 class SystemComponentScheduleModel : public SystemComponentScheduleInterface
7 {
8 Q_OBJECT
9
10 public:
11 explicit SystemComponentScheduleModel(ComponentScheduleInterface const * const schedule,
12 QObject * const parent = nullptr);
13 virtual ~SystemComponentScheduleModel() = default;
14
15 public:
16 virtual bool setPriority(SystemComponentScheduleInterface::Priority const & priority) override;
17 virtual bool checkValidPriority(SystemComponentScheduleInterface::Priority const & priority);
18 virtual SystemComponentScheduleInterface::Priority getPriority() const override;
19
20 public:
21 virtual bool setOffset(SystemComponentScheduleInterface::Offset const & offset) override;
22 virtual SystemComponentScheduleInterface::Offset getOffset() const override;
23
24 public:
25 virtual bool setCycle(SystemComponentScheduleInterface::Cycle const & cycle) override;
26 virtual SystemComponentScheduleInterface::Cycle getCycle() const override;
27
28 public:
29 virtual bool setResponse(SystemComponentScheduleInterface::Response const & response) override;
30 virtual SystemComponentScheduleInterface::Response getResponse() const override;
31
32 protected:
33 SystemComponentScheduleInterface::Priority priority;
34 SystemComponentScheduleInterface::Offset offset;
35 SystemComponentScheduleInterface::Cycle cycle;
36 SystemComponentScheduleInterface::Response response;
37 };
38
39 #endif // SYSTEMCOMPONENTSCHEDULEMODEL_H
SystemComponentScheduleInterface::setResponse
virtual bool setResponse(SystemComponentScheduleInterface::Response const &response)=0
Sets the Response Time for the current registered component.
SystemComponentScheduleInterface::getPriority
virtual SystemComponentScheduleInterface::Priority getPriority() const =0
Gets the Priority for the current registered component.
ComponentScheduleInterface
This class defines the schedule parameters of a component:
Definition: ComponentScheduleInterface.h:31
SystemComponentScheduleInterface::setCycle
virtual bool setCycle(SystemComponentScheduleInterface::Cycle const &cycle)=0
Sets the Cycle Time for the current registered component.
SystemComponentScheduleInterface
This class defines the simulation schedule related parameters of a component registered in a system: ...
Definition: SystemComponentScheduleInterface.h:25
SystemComponentScheduleInterface.h
The System Component Schedule Interface (SCSI) contains the functions setters and getters for the sim...
SystemComponentScheduleInterface::setPriority
virtual bool setPriority(SystemComponentScheduleInterface::Priority const &priority)=0
Sets the Priority for the current registered component.
SystemComponentScheduleInterface::getOffset
virtual SystemComponentScheduleInterface::Offset getOffset() const =0
Gets the Offset Time for the current registered component.
SystemComponentScheduleInterface::getResponse
virtual SystemComponentScheduleInterface::Response getResponse() const =0
Gets the Response Time for the current registered component.
SystemComponentScheduleInterface::setOffset
virtual bool setOffset(SystemComponentScheduleInterface::Offset const &offset)=0
Sets the Priority for the current registered component.
SystemComponentScheduleInterface::getCycle
virtual SystemComponentScheduleInterface::Cycle getCycle() const =0
Gets the Cycle Time for the current registered component.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentScheduleView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentScheduleView.cpp
1 #include "Views/SystemComponentScheduleView.h"
2 #include "ui_SystemComponentScheduleView.h"
3
4 #include "openPASS-System/SystemComponentScheduleInterface.h"
5 #include <limits>
6
7 SystemComponentScheduleView::SystemComponentScheduleView(SystemComponentScheduleInterface * const schedule,
8 QWidget * const parent)
9 : WidgetView(parent)
10 , schedule(schedule)
11 , ui(new Ui::SystemComponentScheduleView)
12 {
13 // Setup UI
14 ui->setupUi(this);
15 ui->priority->setMaximum(std::numeric_limits<int>::max());
16 ui->offset->setMaximum(std::numeric_limits<int>::max());
17 ui->cycle->setMaximum(std::numeric_limits<int>::max());
18 ui->response->setMaximum(std::numeric_limits<int>::max());
19
20 // Connect SystemComponentScheduleInterface with SystemComponentScheduleView
21 connect(schedule, &SystemComponentScheduleInterface::modifiedPriority,
22 this, &SystemComponentScheduleView::updatePriority);
23 connect(schedule, &SystemComponentScheduleInterface::modifiedOffset,
24 this, &SystemComponentScheduleView::updateOffset);
25 connect(schedule, &SystemComponentScheduleInterface::modifiedCycle,
26 this, &SystemComponentScheduleView::updateCycle);
27 connect(schedule, &SystemComponentScheduleInterface::modifiedResponse,
28 this, &SystemComponentScheduleView::updateResponse);
29
30 // Update UI
31 updatePriority();
32 updateOffset();
33 updateCycle();
34 updateResponse();
35 }
36
37 SystemComponentScheduleView::~SystemComponentScheduleView()
38 {
39 // Destroy UI
40 delete ui;
41 }
42
43 void SystemComponentScheduleView::updatePriority()
44 {
45 ui->priority->setValue(schedule->getPriority());
46 }
47
48 void SystemComponentScheduleView::updateOffset()
49 {
50 ui->offset->setValue(schedule->getOffset());
51 }
52
53 void SystemComponentScheduleView::updateCycle()
54 {
55 ui->cycle->setValue(schedule->getCycle());
56 }
57
58 void SystemComponentScheduleView::updateResponse()
59 {
60 ui->response->setValue(schedule->getResponse());
61 }
62
63 void SystemComponentScheduleView::on_priority_valueChanged(int arg1)
64 {
65 schedule->setPriority(arg1);
66 }
67
68 void SystemComponentScheduleView::on_offset_valueChanged(int arg1)
69 {
70 schedule->setOffset(arg1);
71 }
72
73 void SystemComponentScheduleView::on_cycle_valueChanged(int arg1)
74 {
75 schedule->setCycle(arg1);
76 }
77
78 void SystemComponentScheduleView::on_response_valueChanged(int arg1)
79 {
80 schedule->setResponse(arg1);
81 }
SystemComponentScheduleInterface::setResponse
virtual bool setResponse(SystemComponentScheduleInterface::Response const &response)=0
Sets the Response Time for the current registered component.
SystemComponentScheduleInterface::modifiedCycle
void modifiedCycle() const
Triggers signal to inform that the Cycle Time of the component has been modified. ...
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
SystemComponentScheduleInterface::getPriority
virtual SystemComponentScheduleInterface::Priority getPriority() const =0
Gets the Priority for the current registered component.
SystemComponentScheduleInterface::setCycle
virtual bool setCycle(SystemComponentScheduleInterface::Cycle const &cycle)=0
Sets the Cycle Time for the current registered component.
SystemComponentScheduleInterface
This class defines the simulation schedule related parameters of a component registered in a system: ...
Definition: SystemComponentScheduleInterface.h:25
SystemComponentScheduleInterface.h
The System Component Schedule Interface (SCSI) contains the functions setters and getters for the sim...
SystemComponentScheduleInterface::setPriority
virtual bool setPriority(SystemComponentScheduleInterface::Priority const &priority)=0
Sets the Priority for the current registered component.
SystemComponentScheduleInterface::getOffset
virtual SystemComponentScheduleInterface::Offset getOffset() const =0
Gets the Offset Time for the current registered component.
SystemComponentScheduleInterface::getResponse
virtual SystemComponentScheduleInterface::Response getResponse() const =0
Gets the Response Time for the current registered component.
SystemComponentScheduleInterface::modifiedResponse
void modifiedResponse() const
Triggers signal to inform that the Response Time of the component has been modified.
SystemComponentScheduleInterface::modifiedPriority
void modifiedPriority() const
Triggers signal to inform that the Priority of the component has been modified.
SystemComponentScheduleInterface::setOffset
virtual bool setOffset(SystemComponentScheduleInterface::Offset const &offset)=0
Sets the Priority for the current registered component.
SystemComponentScheduleInterface::modifiedOffset
void modifiedOffset() const
Triggers signal to inform that the Offset Time of the component has been modified.
SystemComponentScheduleInterface::getCycle
virtual SystemComponentScheduleInterface::Cycle getCycle() const =0
Gets the Cycle Time for the current registered component.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentScheduleView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentScheduleView.h
1 #ifndef SYSTEMCOMPONENTSCHEDULEVIEW_H
2 #define SYSTEMCOMPONENTSCHEDULEVIEW_H
3
4 #include "Views/WidgetView.h"
5
6 class SystemComponentScheduleInterface;
7
8 namespace Ui {
9 class SystemComponentScheduleView;
10 }
11
12 class SystemComponentScheduleView : public WidgetView
13 {
14 Q_OBJECT
15
16 public:
17 explicit SystemComponentScheduleView(SystemComponentScheduleInterface * const schedule,
18 QWidget * const parent = nullptr);
19 virtual ~SystemComponentScheduleView();
20
21 protected Q_SLOTS:
22 void updatePriority();
23 void updateOffset();
24 void updateCycle();
25 void updateResponse();
26
27 protected Q_SLOTS:
28 void on_priority_valueChanged(int arg1);
29 void on_offset_valueChanged(int arg1);
30 void on_cycle_valueChanged(int arg1);
31 void on_response_valueChanged(int arg1);
32
33 protected:
34 SystemComponentScheduleInterface * const schedule;
35
36 protected:
37 Ui::SystemComponentScheduleView * const ui;
38 };
39
40 #endif // SYSTEMCOMPONENTSCHEDULEVIEW_H
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
SystemComponentScheduleInterface
This class defines the simulation schedule related parameters of a component registered in a system: ...
Definition: SystemComponentScheduleInterface.h:25
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentTitleView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentTitleView.cpp
1 #include "Views/SystemComponentTitleView.h"
2 #include "ui_SystemComponentTitleView.h"
3
4 #include "openPASS-System/SystemComponentItemInterface.h"
5 #include <QMouseEvent>
6
7 QPoint const SystemComponentTitleView::MouseInvalidPosition = QPoint(-1, -1);
8
9 SystemComponentTitleView::SystemComponentTitleView(SystemComponentItemInterface * const component,
10 QWidget * const parent)
11 : WidgetView(parent)
12 , component(component)
13 , ui(new Ui::SystemComponentTitleView)
14 {
15 // Setup UI
16 ui->setupUi(this);
17
18 // Connect SystemComponentItemInterface with SystemComponentTitleView
19 connect(component, &SystemComponentItemInterface::modifiedTitle,
20 this, &SystemComponentTitleView::updateTitle);
21 updateTitle();
22
23 // Inform the user about the component name in the library
24 ui->name->setToolTip(component->getTitle());
25 }
26
27 SystemComponentTitleView::~SystemComponentTitleView()
28 {
29 // Destroy UI
30 delete ui;
31 }
32
33 void SystemComponentTitleView::updateTitle()
34 {
35 // Update name
36 ui->name->setText(component->getTitle());
37 }
38
39 void SystemComponentTitleView::mousePressEvent(QMouseEvent * event)
40 {
41 mouseGlobalPosition = MouseInvalidPosition;
42 if (event->button() == Qt::LeftButton)
43 {
44 mouseGlobalPosition = event->globalPos();
45 }
46 }
47
48 void SystemComponentTitleView::mouseMoveEvent(QMouseEvent * event)
49 {
50 if (mouseGlobalPosition != MouseInvalidPosition)
51 {
52 component->setPosition(qobject_cast<QWidget *>(parent()->parent())->pos() +
53 event->globalPos() - mouseGlobalPosition);
54 mouseGlobalPosition = event->globalPos();
55 }
56 }
SystemComponentItemInterface::setPosition
virtual bool setPosition(SystemComponentItemInterface::Position const &position)=0
Sets the position of the current registered component in the System Editor.
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
SystemComponentItemInterface::modifiedTitle
void modifiedTitle() const
Triggers signal to inform that the title of a component has been modified.
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentItemInterface::getTitle
virtual SystemComponentItemInterface::Title getTitle() const =0
Gets the title of the current registered component.
SystemComponentItemInterface.h
The System Component Item Interface (SCmII) contains the functions setters and getters of the items c...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentTitleView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemComponentTitleView.h
1 #ifndef SYSTEMCOMPONENTTITLEVIEW_H
2 #define SYSTEMCOMPONENTTITLEVIEW_H
3
4 #include "Views/WidgetView.h"
5 #include <QPoint>
6
7 class SystemComponentItemInterface;
8 class QMouseEvent;
9
10 namespace Ui {
11 class SystemComponentTitleView;
12 }
13
14 class SystemComponentTitleView : public WidgetView
15 {
16 Q_OBJECT
17
18 public:
19 explicit SystemComponentTitleView(SystemComponentItemInterface * const component,
20 QWidget * const parent = nullptr);
21 virtual ~SystemComponentTitleView();
22
23 public Q_SLOTS:
24 void updateTitle();
25
26 protected:
27 static QPoint const MouseInvalidPosition;
28
29 protected:
30 virtual void mousePressEvent(QMouseEvent * event) override;
31 virtual void mouseMoveEvent(QMouseEvent * event) override;
32
33 protected:
34 SystemComponentItemInterface * const component;
35
36 protected:
37 QPoint mouseGlobalPosition;
38
39 protected:
40 Ui::SystemComponentTitleView * const ui;
41 };
42
43 #endif // SYSTEMCOMPONENTTITLEVIEW_H
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemConnectionItemModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemConnectionItemModel.cpp
1 #include "Models/SystemConnectionItemModel.h"
2
3 #include "Models/SystemConnectionMapModel.h"
4
5 SystemConnectionItemModel::SystemConnectionItemModel(SystemConnectionItemInterface::Source const * const source,
6 SystemConnectionItemInterface::Target const * const target,
7 QObject * const parent)
8 : SystemConnectionItemInterface(parent)
9 , source(source)
10 , target(target)
11 {
12 }
13
14 SystemConnectionItemInterface::ID SystemConnectionItemModel::getID() const
15 {
16 SystemConnectionMapModel const * const connections =
17 qobject_cast<SystemConnectionMapModel const * const>(parent());
18 return ((connections) ? connections->getID(const_cast<SystemConnectionItemModel *>(this))
19 : SystemConnectionItemInterface::ID());
20 }
21
22 SystemConnectionItemInterface::Source const * SystemConnectionItemModel::getSource() const
23 {
24 return source;
25 }
26
27 SystemConnectionItemInterface::Target const * SystemConnectionItemModel::getTarget() const
28 {
29 return target;
30 }
31
32 bool SystemConnectionItemModel::isCompatible() const
33 {
34 return isCompatible(source, target);
35 }
36
37 bool SystemConnectionItemModel::isCompatible(SystemConnectionItemInterface::Source const * const source,
38 SystemConnectionItemInterface::Target const * const target)
39 {
40 return ((source->getComponent() != target->getComponent()) &&
41 (source->getType() == target->getType()) &&
42 ((source->getUnit() == target->getUnit()) ||
43 (source->getUnit() == QStringLiteral("")) ||
44 (target->getUnit() == QStringLiteral(""))));
45 }
SystemConnectionItemInterface::ID
unsigned int ID
The identifie of a connection between two components.
Definition: SystemConnectionItemInterface.h:32
SystemComponentOutputItemInterface::getComponent
virtual SystemComponentItemInterface * getComponent() const =0
Gets the parent component where the current output belongs to.
SystemComponentOutputItemInterface::getType
virtual SystemComponentOutputItemInterface::Type getType() const =0
Gets the type of the current registered output.
SystemComponentInputItemInterface::getType
virtual SystemComponentInputItemInterface::Type getType() const =0
Gets the type of the current registered input.
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemComponentOutputItemInterface::getUnit
virtual SystemComponentOutputItemInterface::Unit getUnit() const =0
Gets the unit of the current registered output.
SystemComponentInputItemInterface::getUnit
virtual SystemComponentInputItemInterface::Unit getUnit() const =0
Gets the unit of the current registered input.
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemConnectionItemInterface
This class defines the items constituing the connection that is established between two components of...
Definition: SystemConnectionItemInterface.h:27
SystemComponentInputItemInterface::getComponent
virtual SystemComponentItemInterface * getComponent() const =0
Gets the parent component where the current input belongs to.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemConnectionItemModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemConnectionItemModel.h
1 #ifndef SYSTEMCONNECTIONITEMMODEL_H
2 #define SYSTEMCONNECTIONITEMMODEL_H
3
4 #include "openPASS-System/SystemConnectionItemInterface.h"
5
6 class SystemConnectionItemModel : public SystemConnectionItemInterface
7 {
8 Q_OBJECT
9
10 public:
11 explicit SystemConnectionItemModel(SystemConnectionItemInterface::Source const * const source,
12 SystemConnectionItemInterface::Target const * const target,
13 QObject * const parent = nullptr);
14 virtual ~SystemConnectionItemModel() = default;
15
16 public:
17 virtual SystemConnectionItemInterface::ID getID() const override;
18 virtual SystemConnectionItemInterface::Source const * getSource() const override;
19 virtual SystemConnectionItemInterface::Target const * getTarget() const override;
20 virtual bool isCompatible() const override;
21
22 public:
23 static bool isCompatible(SystemConnectionItemInterface::Source const * const source,
24 SystemConnectionItemInterface::Target const * const target);
25
26 protected:
27 SystemConnectionItemInterface::Source const * const source;
28 SystemConnectionItemInterface::Target const * const target;
29 };
30
31 #endif // SYSTEMCONNECTIONITEMMODEL_H
SystemConnectionItemInterface::ID
unsigned int ID
The identifie of a connection between two components.
Definition: SystemConnectionItemInterface.h:32
SystemConnectionItemInterface::getID
virtual SystemConnectionItemInterface::ID getID() const =0
Gets the key identifier of this connection in accordance to the system.
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemConnectionItemInterface::getSource
virtual SystemConnectionItemInterface::Source const * getSource() const =0
Gets the starting of a connection which is the output of a component.
SystemConnectionItemInterface::isCompatible
virtual bool isCompatible() const =0
Verifies if the output source of a component is compatible with the input target of the component sel...
SystemConnectionItemInterface::getTarget
virtual SystemConnectionItemInterface::Target const * getTarget() const =0
Gets the ending of a connection which is the input of a component.
SystemConnectionItemInterface.h
The System Connection Item Interface (SCnII) contains the functions getters of the items constituing ...
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemConnectionItemInterface
This class defines the items constituing the connection that is established between two components of...
Definition: SystemConnectionItemInterface.h:27
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemConnectionMapModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemConnectionMapModel.cpp
1 #include "Models/SystemConnectionMapModel.h"
2
3 #include "Models/SystemConnectionItemModel.h"
4
5 SystemConnectionMapModel::SystemConnectionMapModel(QObject * const parent)
6 : SystemConnectionMapInterface(parent)
7 {
8 }
9
10 SystemConnectionMapInterface::Iterator SystemConnectionMapModel::begin()
11 {
12 return connections.begin();
13 }
14
15 SystemConnectionMapInterface::ConstIterator SystemConnectionMapModel::begin() const
16 {
17 return connections.begin();
18 }
19
20 SystemConnectionMapInterface::Iterator SystemConnectionMapModel::end()
21 {
22 return connections.end();
23 }
24
25 SystemConnectionMapInterface::ConstIterator SystemConnectionMapModel::end() const
26 {
27 return connections.end();
28 }
29
30 SystemConnectionMapInterface::ID SystemConnectionMapModel::getID(SystemConnectionMapInterface::Item * const item) const
31 {
32 return connections.key(item);
33 }
34
35 SystemConnectionMapInterface::Item * SystemConnectionMapModel::getItem(SystemConnectionMapInterface::ID const & id) const
36 {
37 return connections.value(id, nullptr);
38 }
39
40 bool SystemConnectionMapModel::clear()
41 {
42 qDeleteAll(connections);
43 connections.clear();
44 Q_EMIT modified();
45 return true;
46 }
47
48 bool SystemConnectionMapModel::add(SystemConnectionMapInterface::ID const & id,
49 SystemConnectionMapInterface::Source const * const source,
50 SystemConnectionMapInterface::Target const * const target)
51 {
52 if ((!connections.keys().contains(id)) && (!contains(source, target)) &&
53 (SystemConnectionItemModel::isCompatible(source, target)))
54 {
55 connections.insert(id, new SystemConnectionItemModel(source, target, this));
56 Q_EMIT modified();
57 return true;
58 }
59 return false;
60 }
61
62 bool SystemConnectionMapModel::add(SystemConnectionMapInterface::Source const * const source,
63 SystemConnectionMapInterface::Target const * const target)
64 {
65 return add(next(), source, target);
66 }
67
68 bool SystemConnectionMapModel::contains(SystemConnectionMapInterface::Source const * const source,
69 SystemConnectionMapInterface::Target const * const target) const
70 {
71 for (SystemConnectionMapInterface::Item const * const connection : connections)
72 {
73 if ((connection->getSource() == source) && (connection->getTarget() == target))
74 {
75 return true;
76 }
77 }
78 return false;
79 }
80
81 bool SystemConnectionMapModel::remove(SystemConnectionMapInterface::Component const * const component)
82 {
83 QList<SystemConnectionMapInterface::ID> ids;
84 for (SystemConnectionMapInterface::Item const * const connection : connections)
85 {
86 if ((connection->getSource()->getComponent() == component) ||
87 (connection->getTarget()->getComponent() == component))
88 {
89 ids << connection->getID();
90 }
91 }
92 return remove(ids);
93 }
94
95 bool SystemConnectionMapModel::remove(SystemConnectionMapInterface::Source const * const source)
96 {
97 QList<SystemConnectionMapInterface::ID> ids;
98 for (SystemConnectionMapInterface::Item const * const connection : connections)
99 {
100 if (connection->getSource() == source)
101 {
102 ids << connection->getID();
103 }
104 }
105 return remove(ids);
106 }
107
108 bool SystemConnectionMapModel::remove(SystemConnectionMapInterface::Target const * const target)
109 {
110 QList<SystemConnectionMapInterface::ID> ids;
111 for (SystemConnectionMapInterface::Item const * const connection : connections)
112 {
113 if (connection->getTarget() == target)
114 {
115 ids << connection->getID();
116 }
117 }
118 return remove(ids);
119 }
120
121 SystemConnectionMapInterface::ID SystemConnectionMapModel::next() const
122 {
123 SystemConnectionMapInterface::ID id = 0;
124 for (SystemConnectionMapInterface::ID key : connections.keys())
125 {
126 if (id <= key)
127 {
128 id = key + 1;
129 }
130 }
131 return id;
132 }
133
134 bool SystemConnectionMapModel::remove(QList<SystemConnectionMapInterface::ID> const & ids)
135 {
136 for (SystemConnectionMapInterface::ID const & id : ids)
137 {
138 delete connections.take(id);
139 }
140 if (ids.count() > 0)
141 {
142 Q_EMIT modified();
143 }
144 return true;
145 }
SystemConnectionMapInterface::ID
SystemConnectionItemInterface::ID ID
The identifier of a connection.
Definition: SystemConnectionMapInterface.h:30
SystemConnectionMapInterface::begin
virtual SystemConnectionMapInterface::Iterator begin()=0
Gets an iterator pointing at the first connection related-object in the map.
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemConnectionMapInterface
This class manages the registration and deregistration of objects defining connections (connection re...
Definition: SystemConnectionMapInterface.h:25
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemConnectionItemInterface
This class defines the items constituing the connection that is established between two components of...
Definition: SystemConnectionItemInterface.h:27
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemConnectionMapModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemConnectionMapModel.h
1 #ifndef SYSTEMCONNECTIONMAPMODEL_H
2 #define SYSTEMCONNECTIONMAPMODEL_H
3
4 #include "openPASS-System/SystemConnectionMapInterface.h"
5
6 class SystemConnectionMapModel : public SystemConnectionMapInterface
7 {
8 Q_OBJECT
9
10 public:
11 explicit SystemConnectionMapModel(QObject * const parent = nullptr);
12 virtual ~SystemConnectionMapModel() = default;
13
14 public:
15 virtual SystemConnectionMapInterface::Iterator begin() override;
16 virtual SystemConnectionMapInterface::ConstIterator begin() const override;
17
18 public:
19 virtual SystemConnectionMapInterface::Iterator end() override;
20 virtual SystemConnectionMapInterface::ConstIterator end() const override;
21
22 public:
23 virtual SystemConnectionMapInterface::ID getID(SystemConnectionMapInterface::Item * const item) const override;
24 virtual SystemConnectionMapInterface::Item * getItem(SystemConnectionMapInterface::ID const & id) const override;
25
26 public:
27 virtual bool clear() override;
28 virtual bool add(SystemConnectionMapInterface::ID const & id,
29 SystemConnectionMapInterface::Source const * const source,
30 SystemConnectionMapInterface::Target const * const target) override;
31 virtual bool add(SystemConnectionMapInterface::Source const * const source,
32 SystemConnectionMapInterface::Target const * const target) override;
33 virtual bool contains(SystemConnectionMapInterface::Source const * const source,
34 SystemConnectionMapInterface::Target const * const target) const override;
35 virtual bool remove(SystemConnectionMapInterface::Component const * const component) override;
36 virtual bool remove(SystemConnectionMapInterface::Source const * const source) override;
37 virtual bool remove(SystemConnectionMapInterface::Target const * const target) override;
38
39 protected:
40 virtual SystemConnectionMapInterface::ID next() const;
41 virtual bool remove(QList<SystemConnectionMapInterface::ID> const & ids);
42
43 protected:
44 SystemConnectionMapInterface::Map connections;
45 };
46
47 #endif // SYSTEMCONNECTIONMAPMODEL_H
SystemConnectionMapInterface::contains
virtual bool contains(SystemConnectionMapInterface::Source const *const source, SystemConnectionMapInterface::Target const *const target) const =0
Verifies if the map contains the connection related-object with the items source and target correspon...
SystemConnectionMapInterface::getItem
virtual SystemConnectionMapInterface::Item * getItem(SystemConnectionMapInterface::ID const &id) const =0
Gets the connection related-object under the key identifier id that belongs to a system.
SystemConnectionMapInterface::ID
SystemConnectionItemInterface::ID ID
The identifier of a connection.
Definition: SystemConnectionMapInterface.h:30
SystemConnectionMapInterface::begin
virtual SystemConnectionMapInterface::Iterator begin()=0
Gets an iterator pointing at the first connection related-object in the map.
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemConnectionMapInterface::add
virtual bool add(SystemConnectionMapInterface::ID const &id, SystemConnectionMapInterface::Source const *const source, SystemConnectionMapInterface::Target const *const target)=0
Registers to the map the connection related-object under the key identifier id and with the pair of i...
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemConnectionMapInterface::Map
QMap< ID, Item * > Map
The container registering the connections.
Definition: SystemConnectionMapInterface.h:34
SystemConnectionMapInterface::clear
virtual bool clear()=0
Deregisters or remove all the connections from the map (system).
SystemConnectionMapInterface
This class manages the registration and deregistration of objects defining connections (connection re...
Definition: SystemConnectionMapInterface.h:25
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemConnectionMapInterface::end
virtual SystemConnectionMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last connection related-object.
SystemConnectionItemInterface
This class defines the items constituing the connection that is established between two components of...
Definition: SystemConnectionItemInterface.h:27
SystemConnectionMapInterface::getID
virtual SystemConnectionMapInterface::ID getID(SystemConnectionMapInterface::Item *const item) const =0
Gets the key identifier of the connection related-object item belonging to a system.
SystemConnectionMapInterface.h
The System Connection Map Interface (SCnMI) contains the functions managing the registration and dere...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemItemModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemItemModel.cpp
1 #include "Models/SystemItemModel.h"
2
3 #include "openPASS-System/SystemComponentManagerInterface.h"
4
5 #include "Models/SystemComponentMapModel.h"
6 #include "Models/SystemConnectionItemModel.h"
7 #include "Models/SystemConnectionMapModel.h"
8 #include "Models/SystemMapModel.h"
9
10 SystemItemModel::SystemItemModel(SystemComponentManagerInterface * const components, QObject * const parent)
11 : SystemItemInterface(parent)
12 , title(SystemItemInterface::Title(QStringLiteral("")))
13 , priority(0)
14 , connections(new SystemConnectionMapModel(this))
15 , components(new SystemComponentMapModel(components, connections, this))
16 {
17 }
18
19 SystemItemInterface::ID SystemItemModel::getID() const
20 {
21 SystemMapModel const * const systems =
22 qobject_cast<SystemMapModel const * const>(parent());
23 return ((systems) ? systems->getID(const_cast<SystemItemModel *>(this))
24 : SystemItemInterface::ID());
25 }
26
27 bool SystemItemModel::setTitle(SystemItemInterface::Title const & _title)
28 {
29 title = _title;
30 Q_EMIT modifiedTitle();
31 return true;
32 }
33
34 SystemItemInterface::Title SystemItemModel::getTitle() const
35 {
36 return title;
37 }
38
39 bool SystemItemModel::setPriority(SystemItemInterface::Priority const & _priority)
40 {
41 priority = _priority;
42 Q_EMIT modifiedPriority();
43 return true;
44 }
45
46 SystemItemInterface::Priority SystemItemModel::getPriority() const
47 {
48 return priority;
49 }
50
51 SystemItemInterface::ComponentMap * SystemItemModel::getComponents() const
52 {
53 return components;
54 }
55
56 SystemItemInterface::ConnectionMap * SystemItemModel::getConnections() const
57 {
58 return connections;
59 }
60
61 QList<SystemConnectionMapInterface::Source const *> SystemItemModel::getCompatibleSources(
62 SystemConnectionMapInterface::Target const * const target)
63 {
64 QList<SystemConnectionMapInterface::Source const *> sources;
65 for (SystemComponentItemInterface const * const component : *components)
66 {
67 for (SystemComponentOutputItemInterface const * const output : *component->getOutputs())
68 {
69 if ((SystemConnectionItemModel::isCompatible(output, target)) &&
70 (!connections->contains(output, target)))
71 {
72 sources << output;
73 }
74 }
75 }
76 return sources;
77 }
78
79 QList<SystemConnectionMapInterface::Target const *> SystemItemModel::getCompatibleTargets(
80 SystemConnectionMapInterface::Source const * const source)
81 {
82 QList<SystemConnectionMapInterface::Target const *> targets;
83 for (SystemComponentItemInterface const * const component : *components)
84 {
85 for (SystemComponentInputItemInterface const * const input : *component->getInputs())
86 {
87 if ((SystemConnectionItemModel::isCompatible(source, input)) &&
88 (!connections->contains(source, input)))
89 {
90 targets << input;
91 }
92 }
93 }
94 return targets;
95 }
SystemComponentManagerInterface.h
The System Component Manager Interface (SCMI) contains the functions loading components as a library ...
SystemItemInterface::ID
unsigned int ID
The identifier of the system.
Definition: SystemItemInterface.h:31
SystemItemInterface::Title
QString Title
The title for the system.
Definition: SystemItemInterface.h:32
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
SystemItemInterface::Priority
unsigned int Priority
The parameter Priority for the system.
Definition: SystemItemInterface.h:33
SystemConnectionMapInterface
This class manages the registration and deregistration of objects defining connections (connection re...
Definition: SystemConnectionMapInterface.h:25
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemComponentMapInterface
This class manages the registration and deregistration of objects defining components (component rela...
Definition: SystemComponentMapInterface.h:22
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemItemModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemItemModel.h
1 #ifndef SYSTEMITEMMODEL_H
2 #define SYSTEMITEMMODEL_H
3
4 #include "openPASS-System/SystemItemInterface.h"
5
6 class SystemComponentManagerInterface;
7
8 class SystemItemModel : public SystemItemInterface
9 {
10 Q_OBJECT
11
12 public:
13 explicit SystemItemModel(SystemComponentManagerInterface * const components,
14 QObject * const parent = nullptr);
15 virtual ~SystemItemModel() = default;
16
17 public:
18 virtual SystemItemInterface::ID getID() const override;
19
20 public:
21 virtual bool setTitle(SystemItemInterface::Title const & title) override;
22 virtual SystemItemInterface::Title getTitle() const override;
23
24 public:
25 virtual bool setPriority(SystemItemInterface::Priority const & priority) override;
26 virtual SystemItemInterface::Priority getPriority() const override;
27
28 public:
29 virtual SystemItemInterface::ComponentMap * getComponents() const override;
30 virtual SystemItemInterface::ConnectionMap * getConnections() const override;
31
32 public:
33 virtual QList<SystemConnectionMapInterface::Source const *> getCompatibleSources(
34 SystemConnectionMapInterface::Target const * const target) override;
35 virtual QList<SystemConnectionMapInterface::Target const *> getCompatibleTargets(
36 SystemConnectionMapInterface::Source const * const source) override;
37
38 protected:
39 SystemItemInterface::Title title;
40 SystemItemInterface::Priority priority;
41 SystemItemInterface::ConnectionMap * const connections;
42 SystemItemInterface::ComponentMap * const components;
43 };
44
45 #endif // SYSTEMITEMMODEL_H
SystemItemInterface::getConnections
virtual SystemItemInterface::ConnectionMap * getConnections() const =0
Creates a map to register connections that link the components of the system.
SystemItemInterface::getCompatibleSources
virtual QList< SystemConnectionMapInterface::Source const * > getCompatibleSources(SystemConnectionMapInterface::Target const *const target)=0
Gets a list of outputs of components constituing the current system. These outputs are checked to be ...
SystemItemInterface::getTitle
virtual SystemItemInterface::Title getTitle() const =0
Gets the title of the current registered system.
SystemItemInterface::getCompatibleTargets
virtual QList< SystemConnectionMapInterface::Target const * > getCompatibleTargets(SystemConnectionMapInterface::Source const *const source)=0
Gets a list of inputs of components constituing the current system. These inputs are checked to be co...
SystemItemInterface::ID
unsigned int ID
The identifier of the system.
Definition: SystemItemInterface.h:31
SystemItemInterface::Title
QString Title
The title for the system.
Definition: SystemItemInterface.h:32
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
SystemItemInterface::Priority
unsigned int Priority
The parameter Priority for the system.
Definition: SystemItemInterface.h:33
SystemConnectionMapInterface
This class manages the registration and deregistration of objects defining connections (connection re...
Definition: SystemConnectionMapInterface.h:25
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemItemInterface::getComponents
virtual SystemItemInterface::ComponentMap * getComponents() const =0
Creates a map to register components that build the system.
SystemItemInterface::setPriority
virtual bool setPriority(SystemItemInterface::Priority const &priority)=0
Sets a priority to the current registered system.
SystemItemInterface.h
The System Item Interface (SII) contains the functions setters and getters of the items constituing a...
SystemItemInterface::getPriority
virtual SystemItemInterface::Priority getPriority() const =0
Gets the priority of the current registered system.
SystemItemInterface::getID
virtual SystemItemInterface::ID getID() const =0
Gets from the map (container) the key identifier of the current registered system.
SystemComponentMapInterface
This class manages the registration and deregistration of objects defining components (component rela...
Definition: SystemComponentMapInterface.h:22
SystemItemInterface::setTitle
virtual bool setTitle(SystemItemInterface::Title const &title)=0
Sets a title to the current registered system.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemItemView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemItemView.cpp
1 #include "Views/SystemItemView.h"
2
3 #include "openPASS-System/SystemComponentManagerInterface.h"
4 #include "openPASS-System/SystemItemInterface.h"
5 #include "Views/SystemBaseView.h"
6 #include <QDragEnterEvent>
7 #include <QDropEvent>
8 #include <QMimeData>
9 #include <QModelIndex>
10 #include <QMouseEvent>
11 #include <QScrollBar>
12 #include <QStandardItemModel>
13 #include <QVariant>
14 #include <QWheelEvent>
15
16 QString const SystemItemView::DragDropMimeDataFormat =
17 QStringLiteral("application/x-qabstractitemmodeldatalist");
18 QPoint const SystemItemView::MouseInvalidPosition = QPoint(-1, -1);
19
20 SystemItemView::SystemItemView(SystemItemInterface * const system,
21 SystemComponentManagerInterface const * const components,
22 QWidget * const parent)
23 : QScrollArea(parent)
24 , system(system)
25 , components(components)
26
27 {
28 setAcceptDrops(true);
29 setFrameShape(QFrame::NoFrame);
30 setWidget(new SystemBaseView(system, this));
31 }
32
33 void SystemItemView::dragEnterEvent(QDragEnterEvent * event)
34 {
35 if (event->mimeData()->hasFormat(DragDropMimeDataFormat))
36 {
37 event->acceptProposedAction();
38 }
39 }
40
41 void SystemItemView::dropEvent(QDropEvent * event)
42 {
43 if (event->mimeData()->hasFormat(DragDropMimeDataFormat))
44 {
45 QStandardItemModel * const item = new QStandardItemModel();
46 if (item->dropMimeData(event->mimeData(), Qt::CopyAction, 0, 0, QModelIndex()))
47 {
48 system->getComponents()->add(components->lookupItemByTitle(
49 item->data(item->index(0, 0)).toString()),
50 widget()->mapFromParent(event->pos()));
51 }
52 delete item;
53 event->accept();
54 }
55 }
56
57 void SystemItemView::mousePressEvent(QMouseEvent * event)
58 {
59 mouseGlobalPosition = MouseInvalidPosition;
60 if (event->button() == Qt::RightButton)
61 {
62 mouseGlobalPosition = event->globalPos();
63 }
64 }
65
66 void SystemItemView::mouseMoveEvent(QMouseEvent * event)
67 {
68 if (mouseGlobalPosition != MouseInvalidPosition)
69 {
70 QPoint const mouseDelta = (event->globalPos() - mouseGlobalPosition) * 2;
71 horizontalScrollBar()->setValue(horizontalScrollBar()->value() - mouseDelta.x());
72 verticalScrollBar()->setValue(verticalScrollBar()->value() - mouseDelta.y());
73 mouseGlobalPosition = event->globalPos();
74 }
75 }
76
77 void SystemItemView::wheelEvent(QWheelEvent * event)
78 {
79 event->ignore();
80 }
SystemComponentManagerInterface.h
The System Component Manager Interface (SCMI) contains the functions loading components as a library ...
SystemComponentMapInterface::add
virtual bool add(SystemComponentMapInterface::ID const &id, SystemComponentMapInterface::Item *const component)=0
Registers to the map the component related-object component under the key identifier id ...
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
SystemComponentManagerInterface::lookupItemByTitle
virtual ComponentItemInterface * lookupItemByTitle(ComponentItemInterface::Title const &title) const =0
Gets a pointer to the component related-object with the specified title title. This function is calle...
SystemItemInterface::getComponents
virtual SystemItemInterface::ComponentMap * getComponents() const =0
Creates a map to register components that build the system.
SystemItemInterface.h
The System Item Interface (SII) contains the functions setters and getters of the items constituing a...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemItemView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemItemView.h
1 #ifndef SYSTEMITEMVIEW_H
2 #define SYSTEMITEMVIEW_H
3
4 #include <QPoint>
5 #include <QScrollArea>
6 #include <QString>
7
8 class SystemComponentManagerInterface;
9 class SystemItemInterface;
10 class QDrawEnterEvent;
11 class QDropEvent;
12 class QMouseEvent;
13 class QWheelEvent;
14
15 class SystemItemView : public QScrollArea
16 {
17 Q_OBJECT
18
19 public:
20 explicit SystemItemView(SystemItemInterface * const system,
21 SystemComponentManagerInterface const * const components,
22 QWidget * const parent = nullptr);
23 virtual ~SystemItemView() = default;
24
25 protected:
26 virtual void dragEnterEvent(QDragEnterEvent * event) override;
27 virtual void dropEvent(QDropEvent * event) override;
28
29 protected:
30 virtual void mousePressEvent(QMouseEvent * event) override;
31 virtual void mouseMoveEvent(QMouseEvent * event) override;
32
33 protected:
34 virtual void wheelEvent(QWheelEvent * event) override;
35
36 protected:
37 static QString const DragDropMimeDataFormat;
38 static QPoint const MouseInvalidPosition;
39
40 protected:
41 SystemItemInterface * const system;
42 SystemComponentManagerInterface const * const components;
43
44 protected:
45 QPoint mouseGlobalPosition;
46 };
47
48 #endif // SYSTEMITEMVIEW_H
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemMapModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemMapModel.cpp
1 #include "Models/SystemMapModel.h"
2
3 #include "openPASS-System/SystemComponentManagerInterface.h"
4
5 #include "Models/SystemItemModel.h"
6
7 SystemMapModel::SystemMapModel(SystemComponentManagerInterface * const components, QObject * const parent)
8 : SystemMapInterface(parent)
9 {
10 // Create default system
11 systems.insert(0, new SystemItemModel(components, this));
12 }
13
14 SystemMapInterface::Iterator SystemMapModel::begin()
15 {
16 return systems.begin();
17 }
18
19 SystemMapInterface::ConstIterator SystemMapModel::begin() const
20 {
21 return systems.begin();
22 }
23
24 bool SystemMapModel::clear()
25 {
26 // Clear components (and connections) of first system
27 return systems.first()->getComponents()->clear();
28 }
29
30 SystemMapInterface::Iterator SystemMapModel::end()
31 {
32 return systems.end();
33 }
34
35 SystemMapInterface::ConstIterator SystemMapModel::end() const
36 {
37 return systems.end();
38 }
39
40 SystemMapInterface::ID SystemMapModel::getID(SystemMapInterface::Item * const item) const
41 {
42 return systems.key(item);
43 }
44
45 SystemMapInterface::Item * SystemMapModel::getItem(SystemMapInterface::ID const & id) const
46 {
47 return systems.value(id, nullptr);
48 }
SystemMapInterface::begin
virtual SystemMapInterface::Iterator begin()=0
Gets an iterator pointing at the first system related-object in the map.
SystemComponentManagerInterface.h
The System Component Manager Interface (SCMI) contains the functions loading components as a library ...
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
SystemMapInterface
This class manages the registration and deregistration of object defining a system (system related-ob...
Definition: SystemMapInterface.h:21
SystemMapInterface::ID
SystemItemInterface::ID ID
The identifier of a system.
Definition: SystemMapInterface.h:26
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemMapModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemMapModel.h
1 #ifndef SYSTEMMAPMODEL_H
2 #define SYSTEMMAPMODEL_H
3
4 #include "openPASS-System/SystemMapInterface.h"
5
6 class SystemComponentManagerInterface;
7
8 class SystemMapModel : public SystemMapInterface
9 {
10 Q_OBJECT
11
12 public:
13 explicit SystemMapModel(SystemComponentManagerInterface * const components,
14 QObject * const parent = nullptr);
15 virtual ~SystemMapModel() = default;
16
17 public:
18 virtual SystemMapInterface::Iterator begin() override;
19 virtual SystemMapInterface::ConstIterator begin() const override;
20
21 public:
22 virtual SystemMapInterface::Iterator end() override;
23 virtual SystemMapInterface::ConstIterator end() const override;
24
25 public:
26 virtual SystemMapInterface::ID getID(SystemMapInterface::Item * const item) const override;
27 virtual SystemMapInterface::Item * getItem(SystemMapInterface::ID const & id) const override;
28
29 public:
30 virtual bool clear() override;
31
32 protected:
33 SystemMapInterface::Map systems;
34 };
35
36 #endif // SYSTEMMAPMODEL_H
SystemMapInterface::Map
QMap< ID, Item * > Map
The container registering systems.
Definition: SystemMapInterface.h:30
SystemMapInterface::begin
virtual SystemMapInterface::Iterator begin()=0
Gets an iterator pointing at the first system related-object in the map.
SystemMapInterface.h
The System Map Interface (SMI) contains the functions managing the registration and deregistration of...
SystemMapInterface::getItem
virtual SystemMapInterface::Item * getItem(SystemMapInterface::ID const &id) const =0
Gets the system related-object under the key identifier id.
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemMapInterface::getID
virtual SystemMapInterface::ID getID(SystemMapInterface::Item *const item) const =0
Gets the key identifier of the system related-object item from the container (map).
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
SystemMapInterface
This class manages the registration and deregistration of object defining a system (system related-ob...
Definition: SystemMapInterface.h:21
SystemMapInterface::end
virtual SystemMapInterface::Iterator end()=0
Gets an iterator pointing at the end of the map after the last system related-object.
SystemMapInterface::clear
virtual bool clear()=0
Clears the items constituing the system. (e.g. function called when users pressing on <New> button in...
SystemMapInterface::ID
SystemItemInterface::ID ID
The identifier of a system.
Definition: SystemMapInterface.h:26
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemModel.cpp
1 #include "Models/SystemModel.h"
2
3 #include "openPASS-Project/ProjectInterface.h"
4 #include "Models/SystemComponentManagerModel.h"
5 #include "Models/SystemMapModel.h"
6 #include "Models/SystemXMLLoadModel.h"
7 #include "Models/SystemXMLSaveModel.h"
8
9 SystemModel::SystemModel(ComponentInterface * const component,
10 ProjectInterface * const project,
11 QObject * const parent)
12 : SystemInterface(parent)
13 , components(new SystemComponentManagerModel(component, this))
14 , _project(project)
15 , systems(new SystemMapModel(components, this))
16 {
17 // Load components
18 components->loadFromDirectory(_project->getLibrary());
19 }
20
21 bool SystemModel::clear()
22 {
23 if (systems->clear())
24 {
25 Q_EMIT cleared();
26 return true;
27 }
28 return false;
29 }
30
31 bool SystemModel::load(QString const & filepath)
32 {
33 clear();
34 if (SystemXMLLoadModel::load(filepath, *systems->begin(), components))
35 {
36 Q_EMIT loaded();
37 return true;
38 }
39 return false;
40 }
41
42 bool SystemModel::load(QIODevice * const device)
43 {
44 clear();
45 if (SystemXMLLoadModel::load(device, *systems->begin(), components))
46 {
47 Q_EMIT loaded();
48 return true;
49 }
50 return false;
51 }
52
53 bool SystemModel::save(QString const & filepath) const
54 {
55 if (SystemXMLSaveModel::save(filepath, systems))
56 {
57 Q_EMIT saved();
58 return true;
59 }
60 return false;
61 }
62
63 bool SystemModel::save(QIODevice * const device) const
64 {
65 if (SystemXMLSaveModel::save(device, systems))
66 {
67 Q_EMIT saved();
68 return true;
69 }
70 return false;
71 }
72
73 SystemComponentManagerInterface * SystemModel::getComponents() const
74 {
75 return components;
76 }
77
78 SystemMapInterface * SystemModel::getSystems() const
79 {
80 return systems;
81 }
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemMapInterface
This class manages the registration and deregistration of object defining a system (system related-ob...
Definition: SystemMapInterface.h:21
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
SystemInterface
This class manages creating new systems and also creating the tree of components loaded from a librar...
Definition: SystemInterface.h:27
ComponentInterface
This class manages creating new component and also creating the map which registers created component...
Definition: ComponentInterface.h:34
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemModel.h
1 #ifndef SYSTEMMODEL_H
2 #define SYSTEMMODEL_H
3
4 #include "openPASS-System/SystemInterface.h"
5
6 class ComponentInterface;
7 class ProjectInterface;
8 class SystemComponentManagerModel;
9
10 class SystemModel : public SystemInterface
11 {
12 Q_OBJECT
13
14 public:
15 explicit SystemModel(ComponentInterface * const component,
16 ProjectInterface * const project,
17 QObject * const parent = nullptr);
18 virtual ~SystemModel() = default;
19
20 public:
21 virtual bool clear() override;
22 virtual bool load(QString const & filepath) override;
23 virtual bool load(QIODevice * const device) override;
24 virtual bool save(QString const & filepath) const override;
25 virtual bool save(QIODevice * const device) const override;
26
27 public:
28 virtual SystemComponentManagerInterface * getComponents() const override;
29 virtual SystemMapInterface * getSystems() const override;
30
31 protected:
32 SystemComponentManagerInterface * const components;
33 ProjectInterface * const _project;
34 SystemMapInterface * const systems;
35 };
36
37 #endif // SYSTEMMODEL_H
SystemInterface::getComponents
virtual SystemComponentManagerInterface * getComponents() const =0
Creates an object managing the load and search of components.
SystemInterface.h
The System Interface (SI) contains the functions creating systems and creating a tree listing the com...
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemMapInterface
This class manages the registration and deregistration of object defining a system (system related-ob...
Definition: SystemMapInterface.h:21
SystemInterface::clear
virtual bool clear()=0
Resets the system (e.g. function called when users pressing on <New> button in the System Editor)...
SystemInterface::load
virtual bool load(QString const &filepath)=0
Loads a system from a file located in the given path filepath. (e.g. function called when users press...
SystemInterface
This class manages creating new systems and also creating the tree of components loaded from a librar...
Definition: SystemInterface.h:27
SystemInterface::getSystems
virtual SystemMapInterface * getSystems() const =0
Creates a map (container) to register systems.
SystemInterface::save
virtual bool save(QString const &filepath) const =0
Saves a system to a file stored in the given path filepath. (e.g. function called when users pressing...
ComponentInterface
This class manages creating new component and also creating the map which registers created component...
Definition: ComponentInterface.h:34
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemPlugin.cpp File Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
SystemPlugin.cpp File Reference

Go to the source code of this file.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemPlugin.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
SystemPlugin.cpp
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
45 //-----------------------------------------------------------------------------
46
47 #include "SystemPlugin.h"
48
49 #include "openPASS-Component/ComponentInterface.h"
50 #include "openPASS-Project/ProjectInterface.h"
51 #include "openPASS-Window/WindowInterface.h"
52
53 #include "Models/SystemModel.h"
54 #include "Views/SystemView.h"
55
56 SystemPlugin::SystemPlugin(QObject * const parent)
57 : QObject(parent)
58 , systemModel(nullptr)
59 , systemView(nullptr)
60 {
61 }
62
63 bool SystemPlugin::initialize()
64 {
65 ComponentInterface * const component = ComponentInterface::instance();
66 ProjectInterface * const project = ProjectInterface::instance();
67 WindowInterface * const window = WindowInterface::instance();
68 if (component && project && window)
69 {
70 systemModel = new SystemModel(component, project);
71 systemView = new SystemView(window, project, systemModel);
72 return true;
73 }
74 return false;
75 }
76
77 bool SystemPlugin::deinitialize()
78 {
79 delete systemView;
80 delete systemModel;
81 return true;
82 }
WindowInterface
This class manages the registration and deregistration of Window Views which include the menu bar wit...
Definition: WindowInterface.h:44
WindowInterface.h
The Window Interface (WI) contains the functions managing the Window View of openPASS application...
ComponentInterface.h
The Component Interface (CI) contains the functions creating components. This interface belongs to th...
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
ComponentInterface
This class manages creating new component and also creating the map which registers created component...
Definition: ComponentInterface.h:34
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemPlugin.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
SystemPlugin.h
1 #ifndef SYSTEMPLUGIN_H
2 #define SYSTEMPLUGIN_H
3
4 #include "openPASS/PluginInterface.h"
5 #include <QObject>
6
7 class SystemModel;
8 class SystemView;
9
10 class SystemPlugin : public QObject, public PluginInterface
11 {
12 Q_OBJECT
13 Q_PLUGIN_METADATA(IID "openPASS.System")
14 Q_INTERFACES(PluginInterface)
15
16 public:
17 explicit SystemPlugin(QObject * const parent = nullptr);
18 virtual ~SystemPlugin() = default;
19
20 public:
21 virtual bool initialize() override;
22 virtual bool deinitialize() override;
23
24 protected:
25 SystemModel * systemModel;
26 SystemView * systemView;
27 };
28
29 #endif // SYSTEMPLUGIN_H
PluginInterface.h
...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemProfilePresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
SystemProfilePresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "SystemProfilePresenter.h"
12
13 SystemProfilePresenter::SystemProfilePresenter(VehicleProfileItemInterface::Systems * const systems,
14 QObject *parent)
15 : QAbstractTableModel(parent)
16 , systems(systems)
17 {
18 _columnHeaders << "ID" << "Title" << "Probability";
19 }
20
21 QVariant SystemProfilePresenter::headerData(int section, Qt::Orientation orientation, int role) const
22 {
23 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
24 return _columnHeaders.value(section);
25
26 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
27 return section + 1;
28
29 return QVariant();
30 }
31
32 int SystemProfilePresenter::rowCount(const QModelIndex &parent) const
33 {
34 Q_UNUSED(parent);
35
36 return systems->count();
37 }
38
39 int SystemProfilePresenter::columnCount(const QModelIndex &parent) const
40 {
41 Q_UNUSED(parent);
42
43 return _columnHeaders.count();
44 }
45
46 QVariant SystemProfilePresenter::data(const QModelIndex &index, int role) const
47 {
48
49 int row = index.row();
50 int col = index.column();
51
52 if(row >= systems->count() )
53 return QVariant::Invalid;
54
55 if(role == Qt::TextAlignmentRole)
56 return QVariant(Qt::AlignCenter);
57
58 if( role == Qt::DisplayRole || role == Qt::EditRole )
59 {
60 if( col == 0)
61 return QVariant(RowToSystem[ row ].first);
62
63 else if (col == 1)
64 return QVariant(RowToSystem[ row ].second);
65
66 else if ( col == 2)
67 return QVariant( systems->value(RowToSystem[row]) );
68 }
69
70 return QVariant();
71 }
72
73 bool SystemProfilePresenter::setData(const QModelIndex &index, const QVariant &value, int role)
74 {
75 int row = index.row();
76 int col = index.column();
77
78 if( role == Qt::EditRole)
79 {
80 if( col == 2 )
81 {
82 (*systems)[ RowToSystem[ row ] ] = value.toDouble();
83 Q_EMIT dataChanged(index, index);
84 return true;
85 }
86 }
87
88 return false;
89 }
90
91 Qt::ItemFlags SystemProfilePresenter::flags(const QModelIndex &index) const
92 {
93 if (index.column() == 2)
94 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
95
96 return QAbstractTableModel::flags(index);
97 }
98
99 void SystemProfilePresenter::addRow(const int &row,
100 VehicleProfileItemInterface::System system,
101 VehicleProfileItemInterface::Probability probability)
102 {
103
104 if(!systems->contains(system))
105 {
106 for(auto _row = RowToSystem.size()-1; _row>=row; _row--)
107 RowToSystem.insert(_row +1 , RowToSystem.take(_row));
108
109 RowToSystem.insert(row, system);
110
111 beginInsertRows(QModelIndex(), row, row);
112 systems->insert(system, probability);
113 endInsertRows();
114 }
115 }
116
117 bool SystemProfilePresenter::removeRow(const int &row)
118 {
119 if( RowToSystem.contains(row) && systems->contains(RowToSystem[row]) )
120 {
121 beginRemoveRows(QModelIndex(), row, row);
122
123 systems->remove(RowToSystem[row]);
124 RowToSystem.remove(row);
125
126 for( int i=row+1; i<=RowToSystem.count() ; i++)
127 RowToSystem.insert( i-1, RowToSystem.take(i) );
128
129 endRemoveRows();
130 return true;
131 }
132
133 return false;
134 }
135
136 void SystemProfilePresenter::setSystems(VehicleProfileItemInterface::Systems * const _systems)
137 {
138 systems = _systems;
139
140 if(systems)
141 update();
142 }
143
144 void SystemProfilePresenter::update()
145 {
146 int rows = 0;
147 beginResetModel();
148 endResetModel();
149 RowToSystem.clear();
150
151 for(auto system : systems->keys() )
152 {
153 RowToSystem.insert( rows, system );
154 rows++;
155 }
156 }
VehicleProfileItemInterface::System
QPair< SystemID, SystemTitle > System
typedef for a system (here, the system Id and title are sufficient)
Definition: VehicleProfileItemInterface.h:87
SystemProfilePresenter::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: SystemProfilePresenter.cpp:73
SystemProfilePresenter::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! ...
Definition: SystemProfilePresenter.cpp:91
SystemProfilePresenter.h
This class constitutes the re-implementation of QAbstractTableModel for the table view of systems wit...
SystemProfilePresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: SystemProfilePresenter.cpp:39
VehicleProfileItemInterface::Probability
double Probability
typedef for a probability
Definition: VehicleProfileItemInterface.h:77
SystemProfilePresenter::setSystems
void setSystems(VehicleProfileItemInterface::Systems *const _systems)
Method which sets the currently processed systems map to the given argument.
Definition: SystemProfilePresenter.cpp:136
SystemProfilePresenter::RowToSystem
QMap< int, VehicleProfileItemInterface::System > RowToSystem
the mapping of row indices to systems
Definition: SystemProfilePresenter.h:160
SystemProfilePresenter::_columnHeaders
QStringList _columnHeaders
the string list of header data for columns
Definition: SystemProfilePresenter.h:159
SystemProfilePresenter::removeRow
virtual bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: SystemProfilePresenter.cpp:117
SystemProfilePresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: SystemProfilePresenter.cpp:21
SystemProfilePresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: SystemProfilePresenter.cpp:32
SystemProfilePresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: SystemProfilePresenter.cpp:46
SystemProfilePresenter::update
void update()
Method which updates the table according to the current entries of systems.
Definition: SystemProfilePresenter.cpp:144
VehicleProfileItemInterface::Systems
QMap< System, Probability > Systems
typedef for the map assigning probabilities to systems
Definition: VehicleProfileItemInterface.h:88
SystemProfilePresenter::systems
VehicleProfileItemInterface::Systems * systems
the map of systems to be edited by this presenter
Definition: SystemProfilePresenter.h:156
SystemProfilePresenter::addRow
virtual void addRow(int const &row, VehicleProfileItemInterface::System system, VehicleProfileItemInterface::Probability probability)
Method that adds a new row, i.e. a system with the given probability.
Definition: SystemProfilePresenter.cpp:99
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemProfileView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
SystemProfileView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "SystemProfileView.h"
12 #include "ui_SystemProfileView.h"
13
14 SystemProfileView::SystemProfileView(QString AlgoType, QWidget *parent) :
15 QWidget(parent),
16 ui(new Ui::SystemProfileView)
17 {
18 ui->setupUi(this);
19
20 QFont headerFont;
21 headerFont.setBold(true);
22
23 ui->AlgoType_label->setText(QString("%1:").arg(AlgoType));
24 ui->SystemView->installEventFilter(this);
25 ui->SystemView->horizontalHeader()->setFont(headerFont);
26
27 ui->gridLayout->setColumnStretch(1, 1);
28
29 setObjectName(AlgoType);
30 }
31
32 SystemProfileView::~SystemProfileView()
33 {
34 delete ui;
35 }
36
37
38 QTableView * SystemProfileView::getSystemView() const
39 {
40 return ui->SystemView;
41 }
42
43 void SystemProfileView::on_addSystem_clicked()
44 {
45 Q_EMIT addSystem(objectName(), ui->SystemSelection->currentText());
46 }
47
48 void SystemProfileView::on_removeSystem_clicked()
49 {
50 Q_EMIT removeSystem(objectName(), ui->SystemView->currentIndex().row());
51 }
52
53 void SystemProfileView::setSelectionItems(QList<QString> const & items)
54 {
55 ui->SystemSelection->clear();
56 ui->SystemSelection->addItems(items);
57 }
58
59 bool SystemProfileView::eventFilter(QObject *watched, QEvent *event)
60 {
61 QTableView* table = qobject_cast<QTableView*> (watched);
62
63 if( table && event->type() == QEvent::Resize )
64 {
65 int cell = (table->width())/5;
66 table->setColumnWidth(0, cell);
67 table->setColumnWidth(1, 2*cell);
68 }
69
70 return false;
71 }
SystemProfileView::on_removeSystem_clicked
void on_removeSystem_clicked()
Slot triggered when the remove-button for systems is clicked. Emits the removeSystem signal transmitt...
Definition: SystemProfileView.cpp:48
SystemProfileView::ui
Ui::SystemProfileView * ui
the ui object containing all GUI elements of this view
Definition: SystemProfileView.h:118
SystemProfileView::removeSystem
void removeSystem(QString AlgoType, const int &row)
Signal, emitted after the remove-button for systems has been clicked. Transmits the algorithm type an...
SystemProfileView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter for catching the resize-events of the systems&#39; table view...
Definition: SystemProfileView.cpp:59
Ui
Definition: EnvironmentDisplayView.h:29
SystemProfileView::on_addSystem_clicked
void on_addSystem_clicked()
Slot triggered when the add-button for systems is clicked. Emits the addSystem signal transmitting th...
Definition: SystemProfileView.cpp:43
SystemProfileView::addSystem
void addSystem(QString AlgoType, QString const &selectionItem)
Signal, emitted when the add-button for systems has been clicked. Transmits the algorithm type and th...
SystemProfileView::getSystemView
QTableView * getSystemView() const
Method which provides access to the table view for systems.
Definition: SystemProfileView.cpp:38
SystemProfileView
This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm ...
Definition: SystemProfileView.h:40
SystemProfileView.h
This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm ...
SystemProfileView::setSelectionItems
void setSelectionItems(const QList< QString > &items)
Method which clears the selection list for the systems&#39; combo box and inserts the given list...
Definition: SystemProfileView.cpp:53
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemView.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemView.cpp
1 #include "Views/SystemView.h"
2 #include "ui_SystemView.h"
3
4 #include "openPASS-Project/ProjectInterface.h"
5 #include "openPASS-System/SystemInterface.h"
6 #include "Views/SystemComponentManagerView.h"
7 #include "Views/SystemBaseView.h"
8 #include "Views/SystemItemView.h"
9 #include <QFileDialog>
10 #include <QFileInfo>
11
12 WindowInterface::ID const SystemView::ViewID = QStringLiteral("openPASS.System");
13
14 SystemView::SystemView(WindowInterface * const window,
15 ProjectInterface * const project,
16 SystemInterface * const system,
17 QWidget * const parent)
18 : WidgetView(parent)
19 , window(window)
20 , project(project)
21 , system(system)
22 , ui(new Ui::SystemView)
23 {
24 // Setup UI
25 ui->setupUi(this);
26 ui->layout->insertWidget(0, new SystemItemView(*system->getSystems()->begin(), system->getComponents(), this), 1);
27 ui->layout->insertWidget(1, new SystemComponentManagerView(system->getComponents(), project, this), 0);
28
29 // Create action menus
30 WindowInterface::Action * const actionSystem =
31 WindowInterface::createAction(tr("System"), new WindowInterface::ActionMenu());
32 actionSystem->menu()->addAction(tr("New"), this, SLOT(actionNewSystem_clicked()));
33 actionSystem->menu()->addAction(tr("Load"), this, SLOT(actionLoadSystem_clicked()));
34 actionSystem->menu()->addAction(tr("Save"), this, SLOT(actionSaveSystem_clicked()));
35 actionSystem->menu()->addSeparator();
36 actionSystem->menu()->addAction(tr("Screenshot"), this, SLOT(actionSaveScreenshot_clicked()));
37 WindowInterface::Action * const actionLibrary =
38 WindowInterface::createAction(tr("Library"), new WindowInterface::ActionMenu());
39 actionLibrary->menu()->addAction(tr("Import"), this, SLOT(actionImportLibrary_clicked()));
40 actionLibrary->menu()->addAction(tr("Update"), this, SLOT(actionUpdateLibrary_clicked()));
41
42 // Register view
43 window->add(ViewID, WindowInterface::createButton(tr("System"), 0, 04000),
44 this, {actionSystem, actionLibrary});
45 }
46
47 SystemView::~SystemView()
48 {
49 // Deregister view
50 window->remove(ViewID);
51
52 // Destroy UI
53 delete ui;
54 }
55
56 void SystemView::actionNewSystem_clicked()
57 {
58 // Clear system
59 system->clear();
60
61 // Show component list
62 findChild<SystemComponentManagerView *>(QString(), Qt::FindDirectChildrenOnly)->show();
63 }
64
65 void SystemView::actionLoadSystem_clicked()
66 {
67 // Prompt file dialog to load system
68 QString const filepath = QFileDialog::getOpenFileName(
69 this, QObject::tr("openPASS / Load System"),
70 project->getDirectory(), QStringLiteral("System (*.xml)"));
71 if (!filepath.isNull())
72 {
73 // Update project directory
74 project->setDirectory(QFileInfo(filepath).absolutePath());
75
76 // Load system from file
77 system->load(filepath);
78
79 // Hide component list
80 findChild<SystemComponentManagerView *>(QString(), Qt::FindDirectChildrenOnly)->hide();
81 }
82 }
83
84 void SystemView::actionSaveSystem_clicked()
85 {
86 // Prompt file dialog to save system
87 QString const filepath = QFileDialog::getSaveFileName(
88 this, QObject::tr("openPASS / Save System"),
89 project->getDirectory(), QStringLiteral("System (*.xml)"));
90 if (!filepath.isNull())
91 {
92 // Update project directory
93 project->setDirectory(QFileInfo(filepath).absolutePath());
94
95 // Save system to file
96 system->save(filepath);
97 }
98 }
99
100 void SystemView::actionSaveScreenshot_clicked()
101 {
102 // Prompt file dialog to save screenshot
103 QString const filepath = QFileDialog::getSaveFileName(
104 this, QObject::tr("openPASS / Save Screenshot"),
105 project->getDirectory(), QStringLiteral("Image (*.png)"));
106 if (!filepath.isNull())
107 {
108 // Update project directory
109 project->setDirectory(QFileInfo(filepath).absolutePath());
110
111 // Save screenshot to file
112 findChild<SystemBaseView *>()->grab().save(filepath);
113 }
114 }
115
116 void SystemView::actionImportLibrary_clicked()
117 {
118 QDir const root = QDir(QCoreApplication::applicationDirPath());
119 QString const filepath = QFileDialog::getExistingDirectory(
120 this, tr("rateEFFECT / Import Component Library"),
121 root.canonicalPath());
122 if (!filepath.isNull())
123 {
124 project->setLibraryPath(filepath);
125 }
126
127 findChild<SystemComponentManagerView *>(QString(), Qt::FindDirectChildrenOnly)->hide();
128 actionNewSystem_clicked();
129 }
130
131 void SystemView::actionUpdateLibrary_clicked()
132 {
133 findChild<SystemComponentManagerView *>(QString(), Qt::FindDirectChildrenOnly)->hide();
134 findChild<SystemComponentManagerView *>(QString(), Qt::FindDirectChildrenOnly)->show();
135 }
SystemProfileView::ui
Ui::SystemProfileView * ui
the ui object containing all GUI elements of this view
Definition: SystemProfileView.h:118
ProjectInterface::save
virtual bool save(QString const &filepath) const =0
Saves a project to a file stored in the given path filepath.
SystemMapInterface::begin
virtual SystemMapInterface::Iterator begin()=0
Gets an iterator pointing at the first system related-object in the map.
WindowInterface::ActionMenu
QMenu ActionMenu
The drop down menu of the button in the stacked widget&#39;s menu.
Definition: WindowInterface.h:58
WindowInterface
This class manages the registration and deregistration of Window Views which include the menu bar wit...
Definition: WindowInterface.h:44
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
SystemInterface::getComponents
virtual SystemComponentManagerInterface * getComponents() const =0
Creates an object managing the load and search of components.
SystemInterface.h
The System Interface (SI) contains the functions creating systems and creating a tree listing the com...
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
WindowInterface::add
virtual void add(WindowInterface::ID const &id, WindowInterface::Button *const button, WindowInterface::Widget *const widget=nullptr, WindowInterface::Menu const &menu={})=0
Registers the Window View with the identifier id, including its selecting button, and its correspondi...
WindowInterface::remove
virtual bool remove(WindowInterface::ID const &id)=0
Deregisters a Window View with the identifier id.
WindowInterface::Action
QPushButton Action
The button in the menu of the stacked widget.
Definition: WindowInterface.h:56
ProjectInterface::setLibraryPath
virtual bool setLibraryPath(ProjectInterface::Library const &library)=0
Sets the path of the directory containing the components library library.
WindowInterface::createButton
static WindowInterface::Button * createButton(WindowInterface::ButtonTitle const &title, WindowInterface::ButtonType const &type=0, WindowInterface::ButtonOrder const &order=-1)
Creates button for a Window View selection with the title title, of type type and located on the side...
Definition: WindowInterface.h:109
SystemInterface::clear
virtual bool clear()=0
Resets the system (e.g. function called when users pressing on <New> button in the System Editor)...
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
SystemInterface::load
virtual bool load(QString const &filepath)=0
Loads a system from a file located in the given path filepath. (e.g. function called when users press...
SystemInterface
This class manages creating new systems and also creating the tree of components loaded from a librar...
Definition: SystemInterface.h:27
WindowInterface::createAction
static WindowInterface::Action * createAction(WindowInterface::ActionTitle const &title, Object object, Function function)
Creates button in the menu bar of the Window View object with the title title and associated to a cal...
Definition: WindowInterface.h:130
SystemInterface::getSystems
virtual SystemMapInterface * getSystems() const =0
Creates a map (container) to register systems.
WindowInterface::ID
QString ID
The identifier of the stacked widget.
Definition: WindowInterface.h:50
SystemInterface::save
virtual bool save(QString const &filepath) const =0
Saves a system to a file stored in the given path filepath. (e.g. function called when users pressing...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemView.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
SystemView.h
1 #ifndef SYSTEMVIEW_H
2 #define SYSTEMVIEW_H
3
4 #include "openPASS-Window/WindowInterface.h"
5 #include "Views/WidgetView.h"
6
7 class ProjectInterface;
8 class SystemInterface;
9
10 namespace Ui {
11 class SystemView;
12 }
13
14 class SystemView : public WidgetView
15 {
16 Q_OBJECT
17
18 public:
19 explicit SystemView(WindowInterface * const window,
20 ProjectInterface * const project,
21 SystemInterface * const system,
22 QWidget * const parent = nullptr);
23 virtual ~SystemView();
24
25 protected:
26 static WindowInterface::ID const ViewID;
27
28 protected Q_SLOTS: // Set actions of the menu related to the System
29 void actionNewSystem_clicked();
30 void actionLoadSystem_clicked();
31 void actionSaveSystem_clicked();
32 void actionSaveScreenshot_clicked();
33
34 protected Q_SLOTS: // Set actions of the menu related to the Library
35 void actionImportLibrary_clicked();
36 void actionUpdateLibrary_clicked();
37
38 protected:
39 WindowInterface * const window;
40 ProjectInterface * const project;
41 SystemInterface * const system;
42
43 protected:
44 Ui::SystemView * const ui;
45 };
46
47 #endif // SYSTEMVIEW_H
WindowInterface
This class manages the registration and deregistration of Window Views which include the menu bar wit...
Definition: WindowInterface.h:44
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
WindowInterface.h
The Window Interface (WI) contains the functions managing the Window View of openPASS application...
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
SystemInterface
This class manages creating new systems and also creating the tree of components loaded from a librar...
Definition: SystemInterface.h:27
WindowInterface::ID
QString ID
The identifier of the stacked widget.
Definition: WindowInterface.h:50
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemXMLBaseModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemXMLBaseModel.cpp
1 #include "Models/SystemXMLBaseModel.h"
2
3 QString const SystemXMLBaseModel::KeySystems = QStringLiteral("systems");
4 QString const SystemXMLBaseModel::KeySystem = QStringLiteral("system");
5 QString const SystemXMLBaseModel::KeySystemID = QStringLiteral("id");
6 QString const SystemXMLBaseModel::KeySystemTitle = QStringLiteral("title");
7 QString const SystemXMLBaseModel::KeySystemPriority = QStringLiteral("priority");
8 QString const SystemXMLBaseModel::KeySystemComponents = QStringLiteral("components");
9 QString const SystemXMLBaseModel::KeySystemComponent = QStringLiteral("component");
10 QString const SystemXMLBaseModel::KeySystemComponentID = QStringLiteral("id");
11 QString const SystemXMLBaseModel::KeySystemComponentLibrary = QStringLiteral("library");
12 QString const SystemXMLBaseModel::KeySystemComponentTitle = QStringLiteral("title");
13 QString const SystemXMLBaseModel::KeySystemComponentPriority = QStringLiteral("priority");
14 QString const SystemXMLBaseModel::KeySystemComponentSchedule = QStringLiteral("schedule");
15 QString const SystemXMLBaseModel::KeySystemComponentSchedulePriority = QStringLiteral("priority");
16 QString const SystemXMLBaseModel::KeySystemComponentScheduleOffset = QStringLiteral("offset");
17 QString const SystemXMLBaseModel::KeySystemComponentScheduleCycle = QStringLiteral("cycle");
18 QString const SystemXMLBaseModel::KeySystemComponentScheduleResponse = QStringLiteral("response");
19 QString const SystemXMLBaseModel::KeySystemComponentParameters = QStringLiteral("parameters");
20 QString const SystemXMLBaseModel::KeySystemComponentParameter = QStringLiteral("parameter");
21 QString const SystemXMLBaseModel::KeySystemComponentParameterID = QStringLiteral("id");
22 QString const SystemXMLBaseModel::KeySystemComponentParameterType = QStringLiteral("type");
23 QString const SystemXMLBaseModel::KeySystemComponentParameterUnit = QStringLiteral("unit");
24 QString const SystemXMLBaseModel::KeySystemComponentParameterValue = QStringLiteral("value");
25 QString const SystemXMLBaseModel::KeySystemComponentPosition = QStringLiteral("position");
26 QString const SystemXMLBaseModel::KeySystemComponentPositionX = QStringLiteral("x");
27 QString const SystemXMLBaseModel::KeySystemComponentPositionY = QStringLiteral("y");
28 QString const SystemXMLBaseModel::KeySystemConnections = QStringLiteral("connections");
29 QString const SystemXMLBaseModel::KeySystemConnection = QStringLiteral("connection");
30 QString const SystemXMLBaseModel::KeySystemConnectionID = QStringLiteral("id");
31 QString const SystemXMLBaseModel::KeySystemConnectionSource = QStringLiteral("source");
32 QString const SystemXMLBaseModel::KeySystemConnectionSourceComponent = QStringLiteral("component");
33 QString const SystemXMLBaseModel::KeySystemConnectionSourceOutput = QStringLiteral("output");
34 QString const SystemXMLBaseModel::KeySystemConnectionTarget = QStringLiteral("target");
35 QString const SystemXMLBaseModel::KeySystemConnectionTargetComponent = QStringLiteral("component");
36 QString const SystemXMLBaseModel::KeySystemConnectionTargetInput = QStringLiteral("input");
37
38 QList<QString> const SystemXMLBaseModel::KeyListSystem = {
39 SystemXMLBaseModel::KeySystemID,
40 SystemXMLBaseModel::KeySystemTitle,
41 SystemXMLBaseModel::KeySystemPriority,
42 SystemXMLBaseModel::KeySystemComponents,
43 SystemXMLBaseModel::KeySystemConnections,
44 };
45 QList<QString> const SystemXMLBaseModel::KeyListSystemComponent = {
46 SystemXMLBaseModel::KeySystemComponentID,
47 SystemXMLBaseModel::KeySystemComponentLibrary,
48 SystemXMLBaseModel::KeySystemComponentTitle,
49 SystemXMLBaseModel::KeySystemComponentSchedule,
50 SystemXMLBaseModel::KeySystemComponentParameters,
51 };
52 QList<QString> const SystemXMLBaseModel::KeyListSystemComponentSchedule = {
53 SystemXMLBaseModel::KeySystemComponentScheduleOffset,
54 SystemXMLBaseModel::KeySystemComponentScheduleCycle,
55 SystemXMLBaseModel::KeySystemComponentScheduleResponse,
56 };
57 QList<QString> const SystemXMLBaseModel::KeyListSystemComponentParameter = {
58 SystemXMLBaseModel::KeySystemComponentParameterID,
59 SystemXMLBaseModel::KeySystemComponentParameterType,
60 SystemXMLBaseModel::KeySystemComponentParameterUnit,
61 SystemXMLBaseModel::KeySystemComponentParameterValue,
62 };
63 QList<QString> const SystemXMLBaseModel::KeyListSystemComponentPosition = {
64 SystemXMLBaseModel::KeySystemComponentPositionX,
65 SystemXMLBaseModel::KeySystemComponentPositionY,
66 };
67 QList<QString> const SystemXMLBaseModel::KeyListSystemConnection = {
68 SystemXMLBaseModel::KeySystemConnectionID,
69 SystemXMLBaseModel::KeySystemConnectionSource,
70 SystemXMLBaseModel::KeySystemConnectionTarget,
71 };
72 QList<QString> const SystemXMLBaseModel::KeyListSystemConnectionSource = {
73 SystemXMLBaseModel::KeySystemConnectionSourceComponent,
74 SystemXMLBaseModel::KeySystemConnectionSourceOutput,
75 };
76 QList<QString> const SystemXMLBaseModel::KeyListSystemConnectionTarget = {
77 SystemXMLBaseModel::KeySystemConnectionTargetComponent,
78 SystemXMLBaseModel::KeySystemConnectionTargetInput,
79 };
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemXMLBaseModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemXMLBaseModel.h
1 #ifndef SYSTEMXMLBASEMODEL_H
2 #define SYSTEMXMLBASEMODEL_H
3
4 #include <QList>
5 #include <QObject>
6 #include <QString>
7
8 class SystemXMLBaseModel
9 {
10 public:
11 explicit SystemXMLBaseModel() = delete;
12 virtual ~SystemXMLBaseModel() = default;
13
14 protected:
15 static QString const KeySystems;
16 static QString const KeySystem;
17 static QString const KeySystemID;
18 static QString const KeySystemTitle;
19 static QString const KeySystemPriority;
20 static QString const KeySystemComponents;
21 static QString const KeySystemComponent;
22 static QString const KeySystemComponentID;
23 static QString const KeySystemComponentLibrary;
24 static QString const KeySystemComponentTitle;
25 static QString const KeySystemComponentPriority;
26 static QString const KeySystemComponentSchedule;
27 static QString const KeySystemComponentSchedulePriority;
28 static QString const KeySystemComponentScheduleOffset;
29 static QString const KeySystemComponentScheduleCycle;
30 static QString const KeySystemComponentScheduleResponse;
31 static QString const KeySystemComponentParameters;
32 static QString const KeySystemComponentParameter;
33 static QString const KeySystemComponentParameterID;
34 static QString const KeySystemComponentParameterType;
35 static QString const KeySystemComponentParameterUnit;
36 static QString const KeySystemComponentParameterValue;
37 static QString const KeySystemComponentPosition;
38 static QString const KeySystemComponentPositionX;
39 static QString const KeySystemComponentPositionY;
40 static QString const KeySystemConnections;
41 static QString const KeySystemConnection;
42 static QString const KeySystemConnectionID;
43 static QString const KeySystemConnectionSource;
44 static QString const KeySystemConnectionSourceComponent;
45 static QString const KeySystemConnectionSourceOutput;
46 static QString const KeySystemConnectionTarget;
47 static QString const KeySystemConnectionTargetComponent;
48 static QString const KeySystemConnectionTargetInput;
49
50 protected:
51 static QList<QString> const KeyListSystem;
52 static QList<QString> const KeyListSystemComponent;
53 static QList<QString> const KeyListSystemComponentSchedule;
54 static QList<QString> const KeyListSystemComponentParameter;
55 static QList<QString> const KeyListSystemComponentPosition;
56 static QList<QString> const KeyListSystemConnection;
57 static QList<QString> const KeyListSystemConnectionSource;
58 static QList<QString> const KeyListSystemConnectionTarget;
59 };
60
61 #endif // SYSTEMXMLBASEMODEL_H
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemXMLLoadModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemXMLLoadModel.cpp
1 #include "Models/SystemXMLLoadModel.h"
2
3 #include "Models/SystemComponentItemModel.h"
4 #include <QIODevice>
5 #include <QFile>
6 #include <QXmlStreamReader>
7
8 bool SystemXMLLoadModel::load(QString const & filepath,
9 SystemItemInterface * const system,
10 SystemComponentManagerInterface const * const manager)
11 {
12 // Does the file exist and can we open it?
13 QFile file(filepath);
14 if ((file.exists()) && (file.open(QIODevice::ReadOnly | QIODevice::Text)))
15 {
16 // Load component from file
17 return load(&file, system, manager);
18 }
19 // Return failure
20 return false;
21 }
22
23 bool SystemXMLLoadModel::load(QIODevice * const device,
24 SystemItemInterface * const system,
25 SystemComponentManagerInterface const * const manager)
26 {
27 // Initialize xml stream reader
28 QXmlStreamReader xml(device);
29
30 // Verify xml header
31 if ((xml.readNext() == QXmlStreamReader::TokenType::StartDocument) &&
32 (xml.readNext() == QXmlStreamReader::TokenType::StartElement) &&
33 (xml.name() == KeySystems))
34 {
35 // Verify first system
36 xml.readNext();
37 if ((xml.readNext() == QXmlStreamReader::TokenType::StartElement) &&
38 (xml.name() == KeySystem))
39 {
40 // Load first system from xml stream
41 return loadSystemItem(xml, system, manager);
42 }
43 return false;
44 }
45 return false;
46 }
47
48 bool SystemXMLLoadModel::loadSystemItem(QXmlStreamReader & xml,
49 SystemItemInterface * const system,
50 SystemComponentManagerInterface const * const manager)
51 {
52 bool success = true;
53 QList<QString> keys = KeyListSystem;
54 while (xml.readNextStartElement())
55 {
56 keys.removeAll(xml.name().toString());
57 if (xml.name() == KeySystemTitle)
58 system->setTitle(xml.readElementText());
59 else if (xml.name() == KeySystemPriority)
60 system->setPriority(xml.readElementText().toUInt());
61 else if (xml.name() == KeySystemComponents)
62 {
63 // Enable component modify mode
64 Q_EMIT system->getComponents()->mode(true);
65 // Load components from xml stream
66 success = loadSystemComponentMap(
67 xml, system->getComponents(), manager) && success;
68 // Disable component modify mode
69 Q_EMIT system->getComponents()->mode(false);
70 }
71 else if (xml.name() == KeySystemConnections)
72 {
73 // Enable connection modify mode
74 Q_EMIT system->getComponents()->mode(true);
75 // Load connections from xml stream
76 success = loadSystemConnectionMap(
77 xml, system->getComponents(), system->getConnections()) && success;
78 // Disable connection modify mode
79 Q_EMIT system->getComponents()->mode(false);
80 }
81 else
82 xml.skipCurrentElement();
83 }
84 return success && keys.isEmpty();
85 }
86
87 bool SystemXMLLoadModel::loadSystemComponentMap(QXmlStreamReader & xml,
88 SystemComponentMapInterface * const components,
89 SystemComponentManagerInterface const * const manager)
90 {
91 bool success = true;
92 while (xml.readNextStartElement())
93 {
94 if (xml.name() == KeySystemComponent)
95 {
96 success = loadSystemComponentItem(xml, components, manager) && success;
97 }
98 else
99 {
100 xml.skipCurrentElement();
101 }
102 }
103 return success;
104 }
105
106 bool SystemXMLLoadModel::loadSystemComponentItem(QXmlStreamReader & xml,
107 SystemComponentMapInterface * const components,
108 SystemComponentManagerInterface const * const manager)
109 {
110 bool success = true;
111 QList<QString> keys = KeyListSystemComponent;
112
113 // Load ID from xml stream
114 xml.readNext();
115 if (!((xml.readNext() == QXmlStreamReader::TokenType::StartElement) &&
116 (xml.name() == KeySystemComponentID)))
117 return false;
118 SystemComponentMapInterface::ID const id = xml.readElementText().toUInt();
119 keys.removeAll(xml.name().toString());
120
121 // Load library from xml stream and lookup component
122 xml.readNext();
123 if (!((xml.readNext() == QXmlStreamReader::TokenType::StartElement) &&
124 (xml.name() == KeySystemComponentLibrary)))
125 return false;
126 ComponentItemInterface const * const base = manager->lookupItemByName(xml.readElementText());
127
128 // Create system component if existing in the library
129 keys.removeAll(xml.name().toString());
130 if (!base)
131 {
132 // Skip if the component is no longer existing
133 while (xml.readNextStartElement())
134 {
135 keys.removeAll(xml.name().toString());
136 xml.skipCurrentElement();
137 }
138 return false;
139 }
140 else
141 {
142 // Load system component from xml stream
143 SystemComponentMapInterface::Item * component = new SystemComponentItemModel(base);
144 while (xml.readNextStartElement())
145 {
146 keys.removeAll(xml.name().toString());
147 if (xml.name() == KeySystemComponentTitle)
148 component->setTitle(xml.readElementText());
149 else if (xml.name() == KeySystemComponentPriority)
150 component->getSchedule()->setPriority(xml.readElementText().toUInt());
151 else if (xml.name() == KeySystemComponentSchedule)
152 success = loadSystemComponentSchedule(xml, component->getSchedule()) && success;
153 else if (xml.name() == KeySystemComponentParameters)
154 success = loadSystemComponentParameterMap(xml, component->getParameters()) && success;
155 else if (xml.name() == KeySystemComponentPosition)
156 success = loadSystemComponentPosition(xml, component) && success;
157 else
158 xml.skipCurrentElement();
159 }
160
161 // Add system component to system
162 if (success && keys.isEmpty())
163 return components->add(id, component);
164 else
165 {
166 delete component;
167 return false;
168 }
169 }
170 }
171
172 bool SystemXMLLoadModel::loadSystemComponentSchedule(QXmlStreamReader & xml,
173 SystemComponentScheduleInterface * const schedule)
174 {
175 QList<QString> keys = KeyListSystemComponentSchedule;
176 while (xml.readNextStartElement())
177 {
178 keys.removeAll(xml.name().toString());
179 if (xml.name() == KeySystemComponentSchedulePriority)
180 schedule->setPriority(xml.readElementText().toUInt());
181 else if (xml.name() == KeySystemComponentScheduleOffset)
182 schedule->setOffset(xml.readElementText().toUInt());
183 else if (xml.name() == KeySystemComponentScheduleCycle)
184 schedule->setCycle(xml.readElementText().toUInt());
185 else if (xml.name() == KeySystemComponentScheduleResponse)
186 schedule->setResponse(xml.readElementText().toUInt());
187 else
188 xml.skipCurrentElement();
189 }
190 return keys.isEmpty();
191 }
192
193 bool SystemXMLLoadModel::loadSystemComponentParameterMap(QXmlStreamReader & xml,
194 SystemComponentParameterMapInterface * const parameters)
195 {
196 bool success = true;
197 while (xml.readNextStartElement())
198 {
199 if (xml.name() == KeySystemComponentParameter)
200 success = loadSystemComponentParameterItem(xml, parameters) && success;
201 else
202 xml.skipCurrentElement();
203 }
204 return success;
205 }
206
207 bool SystemXMLLoadModel::loadSystemComponentParameterItem(QXmlStreamReader & xml,
208 SystemComponentParameterMapInterface * const parameters)
209 {
210 QList<QString> keys = KeyListSystemComponentParameter;
211 SystemComponentParameterMapInterface::ID id = 0;
212 SystemComponentParameterItemInterface::Type type = SystemComponentParameterItemInterface::Type();
213 SystemComponentParameterItemInterface::Unit unit = SystemComponentParameterItemInterface::Unit();
214 SystemComponentParameterItemInterface::Value value = SystemComponentParameterItemInterface::Value();
215 while (xml.readNextStartElement())
216 {
217 keys.removeAll(xml.name().toString());
218 if (xml.name() == KeySystemComponentParameterID)
219 id = xml.readElementText().toUInt();
220 else if (xml.name() == KeySystemComponentParameterType)
221 type = xml.readElementText();
222 else if (xml.name() == KeySystemComponentParameterUnit)
223 unit = xml.readElementText();
224 else if (xml.name() == KeySystemComponentParameterValue)
225 value = xml.readElementText();
226 else
227 xml.skipCurrentElement();
228 }
229 if (keys.isEmpty())
230 {
231 SystemComponentParameterItemInterface * const parameter = parameters->getItem(id);
232 if ((parameter) && (parameter->getType() == type) && (parameter->getUnit() == unit))
233 {
234 parameter->setValue(value);
235 }
236 return true;
237 }
238 return false;
239 }
240
241 bool SystemXMLLoadModel::loadSystemComponentPosition(QXmlStreamReader & xml,
242 SystemComponentItemInterface * const component)
243 {
244 QList<QString> keys = KeyListSystemComponentPosition;
245 SystemComponentItemInterface::Position position = SystemComponentItemInterface::Position(0, 0);
246 while (xml.readNextStartElement())
247 {
248 keys.removeAll(xml.name().toString());
249 if (xml.name() == KeySystemComponentPositionX)
250 position.setX(xml.readElementText().toInt());
251 else if (xml.name() == KeySystemComponentPositionY)
252 position.setY(xml.readElementText().toInt());
253 else
254 xml.skipCurrentElement();
255 }
256 return component->setPosition(position) && keys.isEmpty();
257 }
258
259 bool SystemXMLLoadModel::loadSystemConnectionMap(QXmlStreamReader & xml,
260 SystemComponentMapInterface const * const components,
261 SystemConnectionMapInterface * const connections)
262 {
263 bool success = true;
264 while (xml.readNextStartElement())
265 {
266 if (xml.name() == KeySystemConnection)
267 success = loadSystemConnectionItem(xml, components, connections) && success;
268 else
269 xml.skipCurrentElement();
270 }
271 return success;
272 }
273
274 bool SystemXMLLoadModel::loadSystemConnectionItem(QXmlStreamReader & xml,
275 SystemComponentMapInterface const * const components,
276 SystemConnectionMapInterface * const connections)
277 {
278 bool success = true;
279 QList<QString> keys = KeyListSystemConnection;
280 SystemConnectionMapInterface::ID id = 0;
281 SystemComponentMapInterface::ID sourceComponentID = 0;
282 SystemComponentOutputMapInterface::ID sourceOutputID = 0;
283 SystemComponentMapInterface::ID targetComponentID = 0;
284 SystemComponentInputMapInterface::ID targetInputID = 0;
285 while (xml.readNextStartElement())
286 {
287 keys.removeAll(xml.name().toString());
288 if (xml.name() == KeySystemConnectionID)
289 id = xml.readElementText().toUInt();
290 else if (xml.name() == KeySystemConnectionSource)
291 success = loadSystemConnectionItemSource(
292 xml, sourceComponentID, sourceOutputID) && success;
293 else if (xml.name() == KeySystemConnectionTarget)
294 success = loadSystemConnectionItemTarget(
295 xml, targetComponentID, targetInputID) && success;
296 else
297 xml.skipCurrentElement();
298 }
299
300 if (success && keys.isEmpty())
301 {
302 if ((components->contains(sourceComponentID)) &&
303 (components->contains(targetComponentID)))
304 {
305 // Get the components Source and Target
306 SystemComponentMapInterface::Item const * const sourceComponent =
307 components->getItem(sourceComponentID);
308 SystemComponentMapInterface::Item const * const targetComponent =
309 components->getItem(targetComponentID);
310
311 if ((sourceComponent->getOutputs()->contains(sourceOutputID)) &&
312 (targetComponent->getInputs()->contains(targetInputID)))
313 {
314 // Get the Output Source and Input Target
315 SystemConnectionMapInterface::Source const * const source =
316 sourceComponent->getOutputs()->getItem(sourceOutputID);
317 SystemConnectionMapInterface::Target const * const target =
318 targetComponent->getInputs()->getItem(targetInputID);
319
320 // Add the current Source/Target with the corresponding id to the connection map
321 return connections->add(id, source, target);
322 }
323 else
324 {
325 return false;
326 }
327 }
328 }
329 return false;
330 }
331
332 bool SystemXMLLoadModel::loadSystemConnectionItemSource(QXmlStreamReader & xml,
333 SystemComponentMapInterface::ID & sourceComponentID,
334 SystemComponentOutputMapInterface::ID & sourceOutputID)
335 {
336 QList<QString> keys = KeyListSystemConnectionSource;
337 while (xml.readNextStartElement())
338 {
339 keys.removeAll(xml.name().toString());
340 if (xml.name() == KeySystemConnectionSourceComponent)
341 sourceComponentID = xml.readElementText().toUInt();
342 else if (xml.name() == KeySystemConnectionSourceOutput)
343 sourceOutputID = xml.readElementText().toUInt();
344 else
345 xml.skipCurrentElement();
346 }
347 return keys.isEmpty();
348 }
349
350 bool SystemXMLLoadModel::loadSystemConnectionItemTarget(QXmlStreamReader & xml,
351 SystemComponentMapInterface::ID & targetComponentID,
352 SystemComponentInputMapInterface::ID & targetInputID)
353 {
354 QList<QString> keys = KeyListSystemConnectionTarget;
355 while (xml.readNextStartElement())
356 {
357 keys.removeAll(xml.name().toString());
358 if (xml.name() == KeySystemConnectionTargetComponent)
359 targetComponentID = xml.readElementText().toUInt();
360 else if (xml.name() == KeySystemConnectionTargetInput)
361 targetInputID = xml.readElementText().toUInt();
362 else
363 xml.skipCurrentElement();
364 }
365 return keys.isEmpty();
366 }
SystemItemInterface::getConnections
virtual SystemItemInterface::ConnectionMap * getConnections() const =0
Creates a map to register connections that link the components of the system.
SystemComponentItemInterface::getSchedule
virtual SystemComponentItemInterface::Schedule * getSchedule() const =0
Gets the simulation schedule related parameters of the current registered component.
SystemComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component registered in a s...
Definition: SystemComponentParameterMapInterface.h:22
SystemComponentScheduleInterface::setResponse
virtual bool setResponse(SystemComponentScheduleInterface::Response const &response)=0
Sets the Response Time for the current registered component.
SystemComponentItemInterface::setPosition
virtual bool setPosition(SystemComponentItemInterface::Position const &position)=0
Sets the position of the current registered component in the System Editor.
SystemComponentParameterItemInterface::getType
virtual SystemComponentParameterItemInterface::Type getType() const =0
Gets the type of the current registered parameter.
ComponentItemInterface
This class defines the items constituing a component:
Definition: ComponentItemInterface.h:40
SystemComponentParameterItemInterface::setValue
virtual bool setValue(SystemComponentParameterItemInterface::Value const &value)=0
Sets the value of the current registered parameter.
SystemComponentItemInterface::Position
QPoint Position
The position of the component in the System Editor.
Definition: SystemComponentItemInterface.h:48
SystemComponentParameterItemInterface::getUnit
virtual SystemComponentParameterItemInterface::Unit getUnit() const =0
Gets the unit of the current registered parameter.
SystemComponentScheduleInterface::setCycle
virtual bool setCycle(SystemComponentScheduleInterface::Cycle const &cycle)=0
Sets the Cycle Time for the current registered component.
SystemComponentParameterMapInterface::getItem
virtual SystemComponentParameterMapInterface::Item * getItem(SystemComponentParameterMapInterface::ID const &id) const =0
Gets the registered parameter related-object under the key identifier id.
SystemComponentScheduleInterface
This class defines the simulation schedule related parameters of a component registered in a system: ...
Definition: SystemComponentScheduleInterface.h:25
SystemComponentMapInterface::contains
virtual bool contains(SystemComponentMapInterface::ID const &id) const =0
Verifies if the map contains the component related-object under the key identifier id...
SystemConnectionMapInterface::ID
SystemConnectionItemInterface::ID ID
The identifier of a connection.
Definition: SystemConnectionMapInterface.h:30
SystemComponentScheduleInterface::setPriority
virtual bool setPriority(SystemComponentScheduleInterface::Priority const &priority)=0
Sets the Priority for the current registered component.
SystemComponentMapInterface::add
virtual bool add(SystemComponentMapInterface::ID const &id, SystemComponentMapInterface::Item *const component)=0
Registers to the map the component related-object component under the key identifier id ...
SystemComponentParameterMapInterface::ID
SystemComponentParameterItemInterface::ID ID
The parameter&#39;s key identifier.
Definition: SystemComponentParameterMapInterface.h:27
SystemComponentItemInterface::getInputs
virtual SystemComponentItemInterface::InputMap * getInputs() const =0
Gets the inputs of the current registered component.
SystemComponentInputItemInterface
This class defines the items constituing an input of a component registered in a system.
Definition: SystemComponentInputItemInterface.h:34
SystemConnectionMapInterface::add
virtual bool add(SystemConnectionMapInterface::ID const &id, SystemConnectionMapInterface::Source const *const source, SystemConnectionMapInterface::Target const *const target)=0
Registers to the map the connection related-object under the key identifier id and with the pair of i...
SystemComponentItemInterface::getOutputs
virtual SystemComponentItemInterface::OutputMap * getOutputs() const =0
Gets the outputs of the current registered component.
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentMapInterface::mode
void mode(bool const &modify) const
Triggers signal to enable (when modify set to true) or disable (when set to false) the automatic repo...
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemComponentItemInterface::getParameters
virtual SystemComponentItemInterface::ParameterMap * getParameters() const =0
Gets the parameters of the current registered component.
SystemComponentItemInterface::setTitle
virtual bool setTitle(SystemComponentItemInterface::Title const &title)=0
Sets a title to the current registered component.
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
SystemComponentScheduleInterface::setOffset
virtual bool setOffset(SystemComponentScheduleInterface::Offset const &offset)=0
Sets the Priority for the current registered component.
SystemComponentOutputMapInterface::getItem
virtual SystemComponentOutputMapInterface::Item * getItem(SystemComponentOutputMapInterface::ID const &id) const =0
Gets the registered output related-object under the key identifier id.
SystemComponentManagerInterface::lookupItemByName
virtual ComponentItemInterface * lookupItemByName(ComponentItemInterface::Name const &name) const =0
Gets a pointer to the component related-object with the specified key name name. This function is cal...
SystemConnectionMapInterface
This class manages the registration and deregistration of objects defining connections (connection re...
Definition: SystemConnectionMapInterface.h:25
SystemComponentOutputItemInterface
This class defines the items constituing an output of a component registered in a system...
Definition: SystemComponentOutputItemInterface.h:26
SystemComponentMapInterface::getItem
virtual SystemComponentMapInterface::Item * getItem(SystemComponentMapInterface::ID const &id) const =0
Gets the component related-object under the key identifier id that belongs to a system.
SystemItemInterface::getComponents
virtual SystemItemInterface::ComponentMap * getComponents() const =0
Creates a map to register components that build the system.
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
SystemComponentOutputMapInterface::ID
SystemComponentOutputItemInterface::ID ID
The output&#39;s key identifier.
Definition: SystemComponentOutputMapInterface.h:27
SystemItemInterface::setPriority
virtual bool setPriority(SystemItemInterface::Priority const &priority)=0
Sets a priority to the current registered system.
SystemComponentOutputMapInterface::contains
virtual bool contains(SystemComponentOutputMapInterface::ID const &id) const =0
Verifies if the map contains the output under the key identifier id.
SystemComponentMapInterface::ID
SystemComponentItemInterface::ID ID
The identifier of a component.
Definition: SystemComponentMapInterface.h:27
SystemComponentMapInterface
This class manages the registration and deregistration of objects defining components (component rela...
Definition: SystemComponentMapInterface.h:22
SystemItemInterface::setTitle
virtual bool setTitle(SystemItemInterface::Title const &title)=0
Sets a title to the current registered system.
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemXMLLoadModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemXMLLoadModel.h
1 #ifndef SYSTEMXMLLOADMODEL_H
2 #define SYSTEMXMLLOADMODEL_H
3
4 #include "openPASS-System/SystemComponentInputMapInterface.h"
5 #include "openPASS-System/SystemComponentItemInterface.h"
6 #include "openPASS-System/SystemComponentManagerInterface.h"
7 #include "openPASS-System/SystemComponentMapInterface.h"
8 #include "openPASS-System/SystemComponentOutputMapInterface.h"
9 #include "openPASS-System/SystemComponentParameterMapInterface.h"
10 #include "openPASS-System/SystemComponentScheduleInterface.h"
11 #include "openPASS-System/SystemConnectionMapInterface.h"
12 #include "openPASS-System/SystemItemInterface.h"
13 #include "Models/SystemXMLBaseModel.h"
14
15 class QIODevice;
16 class QXmlStreamReader;
17
18 class SystemXMLLoadModel : public SystemXMLBaseModel
19 {
20 public:
21 explicit SystemXMLLoadModel() = delete;
22 virtual ~SystemXMLLoadModel() = default;
23
24 public:
25 static bool load(QString const & filepath,
26 SystemItemInterface * const system,
27 SystemComponentManagerInterface const * const manager);
28 static bool load(QIODevice * const device,
29 SystemItemInterface * const system,
30 SystemComponentManagerInterface const * const manager);
31
32 protected:
33 static bool loadSystemItem(QXmlStreamReader & xml,
34 SystemItemInterface * const system,
35 SystemComponentManagerInterface const * const manager);
36
37 protected:
38 static bool loadSystemComponentMap(QXmlStreamReader & xml,
39 SystemComponentMapInterface * const components,
40 SystemComponentManagerInterface const * const manager);
41 static bool loadSystemComponentItem(QXmlStreamReader & xml,
42 SystemComponentMapInterface * const components,
43 SystemComponentManagerInterface const * const manager);
44 static bool loadSystemComponentSchedule(QXmlStreamReader & xml,
45 SystemComponentScheduleInterface * const schedule);
46 static bool loadSystemComponentParameterMap(QXmlStreamReader & xml,
47 SystemComponentParameterMapInterface * const parameters);
48 static bool loadSystemComponentParameterItem(QXmlStreamReader & xml,
49 SystemComponentParameterMapInterface * const parameters);
50 static bool loadSystemComponentPosition(QXmlStreamReader & xml,
51 SystemComponentItemInterface * const component);
52
53 protected:
54 static bool loadSystemConnectionMap(QXmlStreamReader & xml,
55 SystemComponentMapInterface const * const components,
56 SystemConnectionMapInterface * const connections);
57 static bool loadSystemConnectionItem(QXmlStreamReader & xml,
58 SystemComponentMapInterface const * const components,
59 SystemConnectionMapInterface * const connections);
60 static bool loadSystemConnectionItemSource(QXmlStreamReader & xml,
61 SystemComponentMapInterface::ID & sourceComponentID,
62 SystemComponentOutputMapInterface::ID & sourceOutputID);
63 static bool loadSystemConnectionItemTarget(QXmlStreamReader & xml,
64 SystemComponentMapInterface::ID & targetComponentID,
65 SystemComponentInputMapInterface::ID & targetInputID);
66 };
67
68 #endif // SYSTEMXMLLOADMODEL_H
SystemComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component registered in a s...
Definition: SystemComponentParameterMapInterface.h:22
SystemComponentParameterMapInterface.h
The System Component Parameter Map Interface (SCPMI) contains the functions managing the registration...
SystemComponentScheduleInterface
This class defines the simulation schedule related parameters of a component registered in a system: ...
Definition: SystemComponentScheduleInterface.h:25
SystemComponentManagerInterface.h
The System Component Manager Interface (SCMI) contains the functions loading components as a library ...
SystemComponentScheduleInterface.h
The System Component Schedule Interface (SCSI) contains the functions setters and getters for the sim...
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemComponentManagerInterface
This class enables loading components as a library from a directory and provides a search functions f...
Definition: SystemComponentManagerInterface.h:22
SystemComponentItemInterface.h
The System Component Item Interface (SCmII) contains the functions setters and getters of the items c...
SystemComponentInputMapInterface.h
The System Component Input Map Interface (SCIMI) contains the functions managing the registration and...
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
SystemConnectionMapInterface
This class manages the registration and deregistration of objects defining connections (connection re...
Definition: SystemConnectionMapInterface.h:25
SystemComponentMapInterface.h
The System Component Map Interface (SCmMI) contains the functions managing the registration and dereg...
SystemComponentOutputMapInterface.h
The System Component Output Map Interface (SCOMI) contains the functions managing the registration an...
SystemComponentOutputMapInterface::ID
SystemComponentOutputItemInterface::ID ID
The output&#39;s key identifier.
Definition: SystemComponentOutputMapInterface.h:27
SystemItemInterface.h
The System Item Interface (SII) contains the functions setters and getters of the items constituing a...
SystemComponentMapInterface::ID
SystemComponentItemInterface::ID ID
The identifier of a component.
Definition: SystemComponentMapInterface.h:27
SystemComponentMapInterface
This class manages the registration and deregistration of objects defining components (component rela...
Definition: SystemComponentMapInterface.h:22
SystemConnectionMapInterface.h
The System Connection Map Interface (SCnMI) contains the functions managing the registration and dere...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemXMLSaveModel.cpp Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemXMLSaveModel.cpp
1 #include "Models/SystemXMLSaveModel.h"
2
3 #include <QFile>
4 #include <QIODevice>
5 #include <QXmlStreamWriter>
6 #include "openPASS-System/SystemComponentMapInterface.h"
7 #include "openPASS-System/SystemComponentParameterMapInterface.h"
8 #include "openPASS-System/SystemComponentScheduleInterface.h"
9 #include "openPASS-System/SystemConnectionMapInterface.h"
10 #include "openPASS-System/SystemItemInterface.h"
11 #include "openPASS-System/SystemMapInterface.h"
12
13 bool SystemXMLSaveModel::save(QString const & filepath,
14 SystemMapInterface const * const systems)
15 {
16 // Can we open the file in write only mode?
17 QFile file(filepath);
18 if (file.open(QIODevice::WriteOnly | QIODevice::Text))
19 {
20 // Save system to file
21 return save(&file, systems);
22 }
23 // Return failure
24 return false;
25 }
26
27 bool SystemXMLSaveModel::save(QIODevice * const device,
28 SystemMapInterface const * const systems)
29 {
30 // Initialize xml stream writer
31 QXmlStreamWriter xml(device);
32 xml.setAutoFormatting(true);
33 xml.setAutoFormattingIndent(2);
34
35 // Save system to xml stream
36 xml.writeStartDocument();
37 xml.writeStartElement(KeySystems);
38 for (SystemItemInterface const * const system : *systems)
39 {
40 saveSystem(xml, system);
41 }
42 xml.writeEndElement();
43 xml.writeEndDocument();
44 return true;
45 }
46
47 void SystemXMLSaveModel::saveSystem(QXmlStreamWriter & xml,
48 SystemItemInterface const * const system)
49 {
50 xml.writeStartElement(KeySystem);
51 xml.writeTextElement(KeySystemID, QString::number(system->getID()));
52 xml.writeTextElement(KeySystemTitle, system->getTitle());
53 xml.writeTextElement(KeySystemPriority, QString::number(system->getPriority()));
54 saveSystemComponent(xml, system->getComponents());
55 saveSystemConnection(xml, system->getConnections());
56 xml.writeEndElement();
57 }
58
59 void SystemXMLSaveModel::saveSystemComponent(QXmlStreamWriter &xml,
60 SystemComponentMapInterface const * const components)
61 {
62 xml.writeStartElement(KeySystemComponents);
63 for (SystemComponentMapInterface::Item const * const component: * components)
64 {
65 xml.writeStartElement(KeySystemComponent);
66 xml.writeTextElement(KeySystemComponentID, QString::number(component->getID()));
67 xml.writeTextElement(KeySystemComponentLibrary, component->getLibrary());
68 xml.writeTextElement(KeySystemComponentTitle, component->getTitle());
69 saveSystemComponentSchedule(xml, component->getSchedule());
70 saveSystemComponentParameters(xml, component->getParameters());
71 xml.writeStartElement(KeySystemComponentPosition);
72 xml.writeTextElement(KeySystemComponentPositionX, QString::number(component->getPosition().x()));
73 xml.writeTextElement(KeySystemComponentPositionY, QString::number(component->getPosition().y()));
74 xml.writeEndElement();
75 xml.writeEndElement();
76 }
77 xml.writeEndElement();
78 }
79
80 void SystemXMLSaveModel::saveSystemComponentSchedule(QXmlStreamWriter &xml,
81 SystemComponentScheduleInterface const * const schedule)
82 {
83 xml.writeStartElement(KeySystemComponentSchedule);
84 xml.writeTextElement(KeySystemComponentSchedulePriority, QString::number(schedule->getPriority()));
85 xml.writeTextElement(KeySystemComponentScheduleOffset, QString::number(schedule->getOffset()));
86 xml.writeTextElement(KeySystemComponentScheduleCycle, QString::number(schedule->getCycle()));
87 xml.writeTextElement(KeySystemComponentScheduleResponse, QString::number(schedule->getResponse()));
88 xml.writeEndElement();
89 }
90
91 void SystemXMLSaveModel::saveSystemComponentParameters(QXmlStreamWriter &xml,
92 SystemComponentParameterMapInterface const * const parameters)
93 {
94 if (!(parameters->count() > 0))
95 {
96 xml.writeEmptyElement(KeySystemComponentParameters);
97 return;
98 }
99 xml.writeStartElement(KeySystemComponentParameters);
100 for (SystemComponentParameterMapInterface::Item const * const parameter : *parameters)
101 {
102 xml.writeStartElement(KeySystemComponentParameter);
103 xml.writeTextElement(KeySystemComponentParameterID, QString::number(parameter->getID()));
104 xml.writeTextElement(KeySystemComponentParameterType, parameter->getType());
105 xml.writeTextElement(KeySystemComponentParameterUnit, parameter->getUnit());
106 xml.writeTextElement(KeySystemComponentParameterValue, parameter->getValue());
107 xml.writeEndElement();
108 }
109 xml.writeEndElement();
110 }
111
112 void SystemXMLSaveModel::saveSystemConnection(QXmlStreamWriter &xml,
113 SystemConnectionMapInterface const * const connections)
114 {
115 xml.writeStartElement(KeySystemConnections);
116 for (SystemConnectionMapInterface::Item const * const connection: *connections)
117 {
118 xml.writeStartElement(KeySystemConnection);
119 xml.writeTextElement(KeySystemConnectionID, QString::number(connection->getID()));
120 xml.writeStartElement(KeySystemConnectionSource);
121 xml.writeTextElement(KeySystemConnectionSourceComponent, QString::number(
122 connection->getSource()->getComponent()->getID()));
123 xml.writeTextElement(KeySystemConnectionSourceOutput, QString::number(
124 connection->getSource()->getID()));
125 xml.writeEndElement();
126 xml.writeStartElement(KeySystemConnectionTarget);
127 xml.writeTextElement(KeySystemConnectionTargetComponent, QString::number(
128 connection->getTarget()->getComponent()->getID()));
129 xml.writeTextElement(KeySystemConnectionTargetInput, QString::number(
130 connection->getTarget()->getID()));
131 xml.writeEndElement();
132 xml.writeEndElement();
133 }
134 xml.writeEndElement();
135 }
SystemItemInterface::getConnections
virtual SystemItemInterface::ConnectionMap * getConnections() const =0
Creates a map to register connections that link the components of the system.
SystemComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component registered in a s...
Definition: SystemComponentParameterMapInterface.h:22
SystemComponentParameterMapInterface::count
virtual int count() const =0
Counts the number of parameters registered for a component.
SystemMapInterface.h
The System Map Interface (SMI) contains the functions managing the registration and deregistration of...
SystemItemInterface::getTitle
virtual SystemItemInterface::Title getTitle() const =0
Gets the title of the current registered system.
SystemComponentScheduleInterface::getPriority
virtual SystemComponentScheduleInterface::Priority getPriority() const =0
Gets the Priority for the current registered component.
SystemComponentParameterMapInterface.h
The System Component Parameter Map Interface (SCPMI) contains the functions managing the registration...
SystemComponentScheduleInterface
This class defines the simulation schedule related parameters of a component registered in a system: ...
Definition: SystemComponentScheduleInterface.h:25
SystemComponentScheduleInterface.h
The System Component Schedule Interface (SCSI) contains the functions setters and getters for the sim...
SystemComponentScheduleInterface::getOffset
virtual SystemComponentScheduleInterface::Offset getOffset() const =0
Gets the Offset Time for the current registered component.
SystemComponentScheduleInterface::getResponse
virtual SystemComponentScheduleInterface::Response getResponse() const =0
Gets the Response Time for the current registered component.
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
SystemMapInterface
This class manages the registration and deregistration of object defining a system (system related-ob...
Definition: SystemMapInterface.h:21
SystemConnectionMapInterface
This class manages the registration and deregistration of objects defining connections (connection re...
Definition: SystemConnectionMapInterface.h:25
SystemComponentMapInterface.h
The System Component Map Interface (SCmMI) contains the functions managing the registration and dereg...
SystemItemInterface::getComponents
virtual SystemItemInterface::ComponentMap * getComponents() const =0
Creates a map to register components that build the system.
SystemComponentParameterItemInterface
This class defines the items constituing a parameter of a component registered in a system...
Definition: SystemComponentParameterItemInterface.h:23
SystemComponentScheduleInterface::getCycle
virtual SystemComponentScheduleInterface::Cycle getCycle() const =0
Gets the Cycle Time for the current registered component.
SystemItemInterface.h
The System Item Interface (SII) contains the functions setters and getters of the items constituing a...
SystemConnectionItemInterface
This class defines the items constituing the connection that is established between two components of...
Definition: SystemConnectionItemInterface.h:27
SystemItemInterface::getPriority
virtual SystemItemInterface::Priority getPriority() const =0
Gets the priority of the current registered system.
SystemItemInterface::getID
virtual SystemItemInterface::ID getID() const =0
Gets from the map (container) the key identifier of the current registered system.
SystemComponentMapInterface
This class manages the registration and deregistration of objects defining components (component rela...
Definition: SystemComponentMapInterface.h:22
SystemConnectionMapInterface.h
The System Connection Map Interface (SCnMI) contains the functions managing the registration and dere...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemXMLSaveModel.h Source File

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
SystemXMLSaveModel.h
1 #ifndef SYSTEMXMLSAVEMODEL_H
2 #define SYSTEMXMLSAVEMODEL_H
3
4 #include "Models/SystemXMLBaseModel.h"
5
6 class QIODevice;
7 class QXmlStreamWriter;
8 class SystemComponentMapInterface;
9 class SystemComponentParameterMapInterface;
10 class SystemComponentScheduleInterface;
11 class SystemConnectionMapInterface;
12 class SystemItemInterface;
13 class SystemMapInterface;
14
15 class SystemXMLSaveModel : public SystemXMLBaseModel
16 {
17 public:
18 explicit SystemXMLSaveModel() = delete;
19 virtual ~SystemXMLSaveModel() = default;
20
21 public:
22 static bool save(QString const & filepath,
23 SystemMapInterface const * const systems);
24 static bool save(QIODevice * const device,
25 SystemMapInterface const * const systems);
26
27 protected:
28 static void saveSystem(QXmlStreamWriter & xml,
29 SystemItemInterface const * const system);
30 static void saveSystemComponent(QXmlStreamWriter & xml,
31 SystemComponentMapInterface const * const components);
32 static void saveSystemComponentSchedule(QXmlStreamWriter & xml,
33 SystemComponentScheduleInterface const * const schedule);
34 static void saveSystemComponentParameters(QXmlStreamWriter & xml,
35 SystemComponentParameterMapInterface const * const parameters);
36 static void saveSystemConnection(QXmlStreamWriter & xml,
37 SystemConnectionMapInterface const * const connections);
38 };
39
40 #endif // SYSTEMXMLSAVEMODEL_H
SystemComponentParameterMapInterface
This class manages the registration and deregistration of parameters of a component registered in a s...
Definition: SystemComponentParameterMapInterface.h:22
SystemComponentScheduleInterface
This class defines the simulation schedule related parameters of a component registered in a system: ...
Definition: SystemComponentScheduleInterface.h:25
SystemItemInterface
This class defines the items constituing a system:
Definition: SystemItemInterface.h:26
SystemMapInterface
This class manages the registration and deregistration of object defining a system (system related-ob...
Definition: SystemMapInterface.h:21
SystemConnectionMapInterface
This class manages the registration and deregistration of objects defining connections (connection re...
Definition: SystemConnectionMapInterface.h:25
SystemComponentMapInterface
This class manages the registration and deregistration of objects defining components (component rela...
Definition: SystemComponentMapInterface.h:22
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficBaseView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficBaseView.cpp
1 #include "TrafficBaseView.h"
2
3 #include <iostream>
4
5 #include <QPainter>
6
7 TrafficBaseView::TrafficBaseView(QWidget *parent) :
8 WidgetView(parent)
9 {
10 trafficView = new TrafficView(this);
11 trafficLanesView = new TrafficLanesView(this);
12 trafficParametersView = new TrafficParametersView(this);
13
14 connect(trafficParametersView, &TrafficParametersView::resized, this, &TrafficBaseView::updateSize);
15 connect(trafficLanesView, &TrafficLanesView::resized, this, &TrafficBaseView::updateSize);
16
17 // adjustWidgets(parent);
18 }
19
20
21
22 TrafficView * TrafficBaseView::getTrafficView() const
23 {
24 return trafficView;
25 }
26
27 TrafficParametersView * TrafficBaseView::getTrafficParametersView() const
28 {
29 return trafficParametersView;
30 }
31
32 TrafficLanesView * TrafficBaseView::getTrafficLanesView() const
33 {
34 return trafficLanesView;
35 }
36
37 void TrafficBaseView::updateSize()
38 {
39 QRect frame(0,0,1,1);
40
41 for(auto child : findChildren<WidgetView*>())
42 frame = frame.united(child->geometry());
43
44 setGeometry(frame);
45 }
46
47 void TrafficBaseView::adjustWidgets(QWidget *mainWindow)
48 {
49 int x,y;
50
51 // adjust the geometry of the Traffic View:
52 x= (mainWindow->width() - trafficView->width() )/2;
53 trafficView->move(x,30);
54 // trafficView->setGeometry(x,30,mainWindow->width()/3,trafficView->height());
55
56 // adjust the geometry of Traffic Parameters View:
57 x = trafficView->x() - trafficParametersView->width()/2 - 30;
58 y = trafficView->height() + 130;
59 trafficParametersView->move(x,y);
60 // trafficParametersView->setGeometry(x,y, mainWindow->width()/3, trafficParametersView->height());
61
62 // adjust the geometry of Traffic Lanes View:
63 x = trafficView->x() + trafficView->width() - trafficLanesView->width()/2 + 30;
64 y = trafficView->height() + 130;
65 trafficLanesView->move(x,y);
66 // trafficLanesView->setGeometry(x,y, mainWindow->width()/3, trafficLanesView->height());
67
68 updateSize();
69
70 }
71
72 void TrafficBaseView::paintEvent(QPaintEvent *event)
73 {
74 event->ignore();
75 QPainter painter(this);
76
77 QPoint P1(trafficView->x() + trafficView->width()/2, trafficView->y() + trafficView->height()) ;
78 QPoint P2(trafficParametersView->x() + trafficParametersView->width()/2, trafficParametersView->y());
79 QPoint P3(trafficLanesView->x() + trafficLanesView->width()/2, trafficLanesView->y());
80
81 painter.setPen(QColor(QStringLiteral("#777777")));
82 QPainterPath path(P1);
83
84 path.lineTo(P2);
85 painter.drawPath(path);
86
87 path.lineTo(P1);
88
89 path.lineTo(P3);
90 painter.drawPath(path);
91 }
TrafficBaseView::getTrafficLanesView
TrafficLanesView * getTrafficLanesView() const
Method which returns the configuration widget for for assigning agent profiles to lanes (TrafficLanes...
Definition: TrafficBaseView.cpp:32
TrafficBaseView::trafficView
TrafficView * trafficView
A pointer to the traffic configuration&#39;s title view.
Definition: TrafficBaseView.h:97
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
TrafficLanesView
This class defines the editor widget for assigning agent profiles to regular and rightmost lanes...
Definition: TrafficLanesView.h:33
TrafficBaseView.h
This class provides a resizable container widget for the content of the traffic tab.
TrafficParametersView::resized
void resized()
Signal, emitted when this view has been resized.
TrafficBaseView::getTrafficView
TrafficView * getTrafficView() const
Method which returns the traffic title view (TrafficView).
Definition: TrafficBaseView.cpp:22
TrafficBaseView::adjustWidgets
void adjustWidgets(QWidget *mainWindow)
Method which adjusts the positioning and size of the child widgets. The size of the child widgets is ...
Definition: TrafficBaseView.cpp:47
TrafficLanesView::resized
void resized()
Signal, emitted when this view is resized.
TrafficBaseView::trafficParametersView
TrafficParametersView * trafficParametersView
A pointer to the widget for lane-agent assignement (TrafficLanesView)
Definition: TrafficBaseView.h:99
TrafficBaseView::getTrafficParametersView
TrafficParametersView * getTrafficParametersView() const
Method which returns the configuration widget for traffic parameters (TrafficParametersView).
Definition: TrafficBaseView.cpp:27
TrafficParametersView
This class defines the editor widget for traffic parameters and their probabilities.
Definition: TrafficParametersView.h:29
TrafficView
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content s...
Definition: TrafficView.h:43
TrafficBaseView::paintEvent
void paintEvent(QPaintEvent *event) override
Reimplementation of the paint event. Here, the painting of the connection lines between the traffic&#39;s...
Definition: TrafficBaseView.cpp:72
TrafficBaseView::trafficLanesView
TrafficLanesView * trafficLanesView
A pointer to the traffic parameter configuration widget (TrafficParametersView)
Definition: TrafficBaseView.h:98
TrafficBaseView::updateSize
void updateSize()
Slot which updates the size of this base view such that all child widgets (TrafficView, TrafficParametersView and TrafficLanesView) are visible.
Definition: TrafficBaseView.cpp:37
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficDisplayPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
TrafficDisplayPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficDisplayPresenter.h"
12
13 TrafficDisplayPresenter::TrafficDisplayPresenter(TrafficInterface *traffic,
14 TrafficDisplayView *trafficDisplayView,
15 QList<QString> * const agentList,
16 QObject *parent)
17 : QObject(parent)
18 , traffic(traffic)
19 , trafficDisplayView(trafficDisplayView)
20 , agentList(agentList)
21 {
22
23 connect(traffic, &TrafficInterface::modifiedName, this, &TrafficDisplayPresenter::setTrafficNameView);
24 connect(traffic, &TrafficInterface::edited, this, &TrafficDisplayPresenter::updateView);
25
26 updateView();
27 setStatus();
28 }
29
30
31 void TrafficDisplayPresenter::setTrafficNameView()
32 {
33 trafficDisplayView->setTrafficName(traffic->getName());
34
35 setStatus();
36 }
37
38
39 void TrafficDisplayPresenter::setVolumesView()
40 {
41 trafficDisplayView->setVolumes(traffic->getVolumes()->count());
42 setStatus();
43 }
44
45 void TrafficDisplayPresenter::setPlatoonRatesView()
46 {
47 trafficDisplayView->setPlatoonRates(traffic->getPlatoonRates()->count());
48 setStatus();
49 }
50
51
52 void TrafficDisplayPresenter::setVelocitiesView()
53 {
54 trafficDisplayView->setVelocities(traffic->getVelocities()->count());
55 setStatus();
56 }
57
58 void TrafficDisplayPresenter::setHomogeneitiesView()
59 {
60 trafficDisplayView->setHomogeneities(traffic->getHomogeneities()->count());
61 setStatus();
62 }
63
64 void TrafficDisplayPresenter::setRegularLaneView()
65 {
66 trafficDisplayView->setRegularLaneAgents(traffic->getAgentsRegularLane()->count());
67 setStatus();
68 }
69
70 void TrafficDisplayPresenter::setRightmostLaneView()
71 {
72 trafficDisplayView->setRightmostLaneAgents(traffic->getAgentsRightMostLane()->count());
73 setStatus();
74 }
75
76
77 void TrafficDisplayPresenter::updateView()
78 {
79 setTrafficNameView();
80
81 setVolumesView();
82 setPlatoonRatesView();
83 setVelocitiesView();
84 setHomogeneitiesView();
85
86 setRegularLaneView();
87 setRightmostLaneView();
88
89 setStatus();
90 }
91
92 void TrafficDisplayPresenter::setStatus()
93 {
94 bool ok = true;
95
96 if(traffic->getVolumes()->count() == 0 || !checkProbabilities(traffic->getVolumes()))
97 ok = false;
98
99 else if(traffic->getPlatoonRates()->count() == 0 || !checkProbabilities(traffic->getPlatoonRates()))
100 ok = false;
101
102 else if(traffic->getVelocities()->count() == 0 || !checkProbabilities(traffic->getVelocities()))
103 ok = false;
104
105 else if(traffic->getHomogeneities()->count() == 0 || !checkProbabilities(traffic->getHomogeneities()))
106 ok = false;
107
108 else if(traffic->getAgentsRegularLane()->count() == 0 || !checkProbabilities(traffic->getAgentsRegularLane()))
109 ok = false;
110
111 else if(traffic->getAgentsRightMostLane()->count() == 0 || !checkProbabilities(traffic->getAgentsRightMostLane()))
112 ok = false;
113
114 else if(!checkAgentProfiles())
115 ok = false;
116
117
118 if(ok && traffic->getName().isEmpty())
119 trafficDisplayView->setStatus(TrafficDisplayView::StatusType::Warning, "No name specified");
120
121 else if(ok)
122 trafficDisplayView->setStatus(TrafficDisplayView::StatusType::OK, "OK");
123
124 else
125 trafficDisplayView->setStatus(TrafficDisplayView::StatusType::Error, "Error");
126
127 traffic->setStatus(ok);
128 }
129
130 bool TrafficDisplayPresenter::checkProbabilities(TrafficItemMapInterface * const items)
131 {
132 double sum = 0.0;
133
134 for(auto item : items->values())
135 sum += item->getProbability();
136
137 return sum == 1.0;
138 }
139
140
141 bool TrafficDisplayPresenter::checkAgentProfiles()
142 {
143
144 // determine list of all used agent profiles
145 QList<TrafficItemInterface*> allAgents = traffic->getAgentsRegularLane()->values()
146 + traffic->getAgentsRightMostLane()->values();
147
148 // check whether used agent profiles are contained in the agentList!
149 // (agentList reflects all defined agent profiles in the profiles catalogue)
150 for(auto agent : allAgents)
151 {
152 TrafficItemInterface::Value name = agent->getValue();
153 if(!agentList->contains(name))
154 return false;
155 }
156
157 return true;
158 }
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
TrafficDisplayPresenter::checkAgentProfiles
bool checkAgentProfiles()
Method which checks whether the agent profiles assigned to the lanes are defined in the profiles cata...
Definition: TrafficDisplayPresenter.cpp:141
TrafficDisplayPresenter::agentList
QList< QString > *const agentList
a pointer to the list of available agent profiles (defined in a ProfilesCatalog.xml) ...
Definition: TrafficDisplayPresenter.h:130
TrafficDisplayView::setHomogeneities
void setHomogeneities(int number)
Method for setting the displayed number of homogeneities.
Definition: TrafficDisplayView.cpp:61
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficInterface::getVelocities
virtual Velocities * getVelocities() const =0
Returns the map for registering velocities.
TrafficDisplayPresenter::setStatus
void setStatus()
Method which determines the status of the traffic settings. If all necessary configurations are made...
Definition: TrafficDisplayPresenter.cpp:92
TrafficDisplayView::setPlatoonRates
void setPlatoonRates(int number)
Method for setting the displayed number of platoon rates.
Definition: TrafficDisplayView.cpp:51
TrafficDisplayPresenter::setHomogeneitiesView
void setHomogeneitiesView()
Slot which is called when the user edits the homogeneities map. Updates the displayed number of homog...
Definition: TrafficDisplayPresenter.cpp:58
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficInterface::getVolumes
virtual Volumes * getVolumes() const =0
Returns the map for registering traffic volumes.
TrafficInterface::setStatus
virtual void setStatus(Status const &_status)=0
Method for setting the status of the traffic configuration to the value passed as an argument...
TrafficItemInterface::Value
QString Value
the datatype for the traffic parameter&#39;s value (generally a string)
Definition: TrafficItemInterface.h:42
TrafficInterface::edited
void edited()
Signal, emitted when the traffic configuration has been edited.
TrafficDisplayView::setStatus
void setStatus(StatusType status, QString message)
Method which determines the frame color according to the status type passed as a first argument...
Definition: TrafficDisplayView.cpp:76
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
TrafficDisplayPresenter::checkProbabilities
bool checkProbabilities(TrafficItemMapInterface *const items)
Method which checks whether the given probabilities (stored in a list) sum up to 1.
Definition: TrafficDisplayPresenter.cpp:130
TrafficDisplayView::setRegularLaneAgents
void setRegularLaneAgents(int number)
Method for setting the displayed number of regular lane agents.
Definition: TrafficDisplayView.cpp:66
TrafficInterface::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const =0
Returns the map for registering platoon rates.
TrafficInterface::getHomogeneities
virtual Homogeneities * getHomogeneities() const =0
Returns the map for registering homogeneities.
TrafficDisplayView::setVelocities
void setVelocities(int number)
Method for setting the displayed number of velocities.
Definition: TrafficDisplayView.cpp:56
TrafficDisplayView::StatusType::Error
enum class for classifying the status (will be used to determine the color of the frame) ...
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
TrafficDisplayPresenter::setRightmostLaneView
void setRightmostLaneView()
Slot which is called when the user edits the rightmost lane agents map. Updates the displayed number ...
Definition: TrafficDisplayPresenter.cpp:70
TrafficItemMapInterface::count
virtual int count() const =0
Method which returns the number of items registered in the map.
TrafficDisplayPresenter::setRegularLaneView
void setRegularLaneView()
Slot which is called when the user edits the regular lane agents map. Updates the displayed number of...
Definition: TrafficDisplayPresenter.cpp:64
TrafficDisplayPresenter::setTrafficNameView
void setTrafficNameView()
Slot which is called when the name of the traffic configuration has changed in the model...
Definition: TrafficDisplayPresenter.cpp:31
TrafficDisplayView
This class provides a display for a quick overview of the traffic configuration.
Definition: TrafficDisplayView.h:42
TrafficInterface::getName
virtual Name getName() const =0
Returns the current name of the traffic setup.
TrafficDisplayPresenter.h
This class defines the presenter which controls the content to be displayed in the TrafficDisplayView...
TrafficDisplayPresenter::setVelocitiesView
void setVelocitiesView()
Slot which is called when the user edits the velocities map. Updates the displayed number of velociti...
Definition: TrafficDisplayPresenter.cpp:52
TrafficDisplayView::setVolumes
void setVolumes(int number)
Method for setting the displayed number of traffic volumes.
Definition: TrafficDisplayView.cpp:46
TrafficDisplayPresenter::setPlatoonRatesView
void setPlatoonRatesView()
Slot which is called when the user edits the platoon reates map. Updates the displayed number of plat...
Definition: TrafficDisplayPresenter.cpp:45
TrafficDisplayPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model (interface) which is read by this presenter
Definition: TrafficDisplayPresenter.h:128
TrafficDisplayView::setTrafficName
void setTrafficName(QString name)
Method for setting the name which should be displayed for the traffic configuration.
Definition: TrafficDisplayView.cpp:40
TrafficDisplayPresenter::trafficDisplayView
TrafficDisplayView * trafficDisplayView
a pointer to the display view whose content is managed by this presenter
Definition: TrafficDisplayPresenter.h:129
TrafficDisplayPresenter::updateView
void updateView()
Method which sets all displayed values according to the model data. Will be called after loading a co...
Definition: TrafficDisplayPresenter.cpp:77
TrafficInterface::modifiedName
void modifiedName()
Signal, emitted when the name of the traffic setup has been modified.
TrafficDisplayView::setRightmostLaneAgents
void setRightmostLaneAgents(int number)
Method for setting the displayed number of rightmost lane agents.
Definition: TrafficDisplayView.cpp:71
TrafficDisplayPresenter::setVolumesView
void setVolumesView()
Slot which is called when the user edits the traffic volumes map. Updates the displayed number of tra...
Definition: TrafficDisplayPresenter.cpp:39
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficDisplayView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficDisplayView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficDisplayView.h"
12 #include "ui_TrafficDisplayView.h"
13
14 TrafficDisplayView::TrafficDisplayView(QWidget *parent) :
15 WidgetView(parent),
16 ui(new Ui::TrafficDisplayView)
17 {
18 ui->setupUi(this);
19
20 color = { {StatusType::OK, QString("QGroupBox{border:2px solid green;"
21 "border-radius:5px;margin-top: 4ex;} "
22 "QGroupBox::title{subcontrol-origin: margin;"
23 "subcontrol-position:top center;padding:0 3px;}")},
24 {StatusType::Error, QString("QGroupBox{border:2px solid red;"
25 "border-radius:5px;margin-top: 4ex;} "
26 "QGroupBox::title{subcontrol-origin: margin;"
27 "subcontrol-position:top center;padding:0 3px;}")},
28 {StatusType::Warning, QString("QGroupBox{border:2px solid orange;border-radius:5px;margin-top: 4ex;} "
29 "QGroupBox::title{subcontrol-origin: margin;"
30 "subcontrol-position:top center;padding:0 3px;}")}
31 };
32 }
33
34 TrafficDisplayView::~TrafficDisplayView()
35 {
36 delete ui;
37 }
38
39
40 void TrafficDisplayView::setTrafficName(QString name)
41 {
42 ui->TrafficName->setText(name);
43 }
44
45
46 void TrafficDisplayView::setVolumes(int number)
47 {
48 ui->Volumes->setText(QString::number(number));
49 }
50
51 void TrafficDisplayView::setPlatoonRates(int number)
52 {
53 ui->PlatoonRates->setText(QString::number(number));
54 }
55
56 void TrafficDisplayView::setVelocities(int number)
57 {
58 ui->Velocities->setText(QString::number(number));
59 }
60
61 void TrafficDisplayView::setHomogeneities(int number)
62 {
63 ui->Homogeneities->setText(QString::number(number));
64 }
65
66 void TrafficDisplayView::setRegularLaneAgents(int number)
67 {
68 ui->RegularLane->setText(QString::number(number) );
69 }
70
71 void TrafficDisplayView::setRightmostLaneAgents(int number)
72 {
73 ui->RightmostLane->setText(QString::number(number));
74 }
75
76 void TrafficDisplayView::setStatus(StatusType status, QString message)
77 {
78 ui->Status->setText(message);
79
80 setStyleSheet(color[status]);
81 }
TrafficDisplayView::setHomogeneities
void setHomogeneities(int number)
Method for setting the displayed number of homogeneities.
Definition: TrafficDisplayView.cpp:61
TrafficDisplayView::color
QMap< StatusType, QString > color
a color map which determines the color code according to the status type
Definition: TrafficDisplayView.h:117
TrafficDisplayView::setPlatoonRates
void setPlatoonRates(int number)
Method for setting the displayed number of platoon rates.
Definition: TrafficDisplayView.cpp:51
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
TrafficDisplayView::setStatus
void setStatus(StatusType status, QString message)
Method which determines the frame color according to the status type passed as a first argument...
Definition: TrafficDisplayView.cpp:76
TrafficDisplayView::setRegularLaneAgents
void setRegularLaneAgents(int number)
Method for setting the displayed number of regular lane agents.
Definition: TrafficDisplayView.cpp:66
TrafficDisplayView::setVelocities
void setVelocities(int number)
Method for setting the displayed number of velocities.
Definition: TrafficDisplayView.cpp:56
TrafficDisplayView::StatusType
StatusType
Definition: TrafficDisplayView.h:47
TrafficDisplayView.h
This class provides a display for a quick overview of the traffic configuration.
TrafficDisplayView
This class provides a display for a quick overview of the traffic configuration.
Definition: TrafficDisplayView.h:42
TrafficDisplayView::setVolumes
void setVolumes(int number)
Method for setting the displayed number of traffic volumes.
Definition: TrafficDisplayView.cpp:46
TrafficDisplayView::ui
Ui::TrafficDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: TrafficDisplayView.h:118
TrafficDisplayView::setTrafficName
void setTrafficName(QString name)
Method for setting the name which should be displayed for the traffic configuration.
Definition: TrafficDisplayView.cpp:40
TrafficDisplayView::setRightmostLaneAgents
void setRightmostLaneAgents(int number)
Method for setting the displayed number of rightmost lane agents.
Definition: TrafficDisplayView.cpp:71
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemMapModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficItemMapModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficItemMapModel.h"
12 #include "TrafficItemModel.h"
13
14
15 TrafficItemMapModel::TrafficItemMapModel(QObject *parent)
16 :TrafficItemMapInterface(parent)
17 {
18 }
19
20 TrafficItemMapInterface::Iterator TrafficItemMapModel::begin()
21 {
22 return map.begin();
23 }
24
25
26 TrafficItemMapInterface::ConstIterator TrafficItemMapModel::constBegin() const
27 {
28 return map.constBegin();
29 }
30
31
32 TrafficItemMapInterface::Iterator TrafficItemMapModel::end()
33 {
34 return map.end();
35 }
36
37
38 TrafficItemMapInterface::ConstIterator TrafficItemMapModel::constEnd() const
39 {
40 return map.constEnd();
41 }
42
43
44 bool TrafficItemMapModel::add(const TrafficItemMapInterface::ID &id,
45 TrafficItemInterface::Probability const & probability,
46 TrafficItemInterface::Value const & value)
47 {
48 if(!contains(id))
49 {
50 TrafficItemInterface* item = new TrafficItemModel(this);
51 item->setValue(value);
52 item->setProbability(probability);
53 map.insert(id,item);
54
55 connect(item, &TrafficItemInterface::edited, this, &TrafficItemMapInterface::edited);
56
57 Q_EMIT edited();
58 return true;
59 }
60
61 return false;
62 }
63
64
65 bool TrafficItemMapModel::add( TrafficItemMapInterface::Item * const item)
66 {
67 TrafficItemMapInterface::ID id = generateID();
68
69 if(!contains(id) && !values().contains(item))
70 {
71 connect(item, &TrafficItemInterface::edited, this, &TrafficItemMapInterface::edited);
72 map.insert(id, item);
73 item->setParent(this);
74
75 Q_EMIT edited();
76 return true;
77 }
78
79 return false;
80 }
81
82
83 bool TrafficItemMapModel::remove(const TrafficItemMapInterface::ID &id)
84 {
85 if(contains(id))
86 {
87 delete map.take(id);
88
89 Q_EMIT edited();
90 return true;
91 }
92
93 return false;
94 }
95
96
97 bool TrafficItemMapModel::remove( TrafficItemMapInterface::Item * const item)
98 {
99
100 if( map.values().contains(item) )
101 {
102 TrafficItemMapInterface::ID id = getID(item);
103 delete map.take(id);
104
105 Q_EMIT edited();
106 return true;
107 }
108
109 return false;
110 }
111
112
113 TrafficItemMapInterface::Item * TrafficItemMapModel::getItem( TrafficItemMapInterface::ID const & id) const
114 {
115 if(contains(id))
116 {
117 return map.value(id);
118 }
119
120 return nullptr;
121 }
122
123
124 TrafficItemMapInterface::ID TrafficItemMapModel::getID( TrafficItemMapInterface::Item * const item) const
125 {
126 return map.key(item);
127 }
128
129
130 bool TrafficItemMapModel::contains(const TrafficItemMapInterface::ID &id) const
131 {
132 return map.contains(id);
133 }
134
135
136 QList< TrafficItemMapInterface::ID> TrafficItemMapModel::keys() const
137 {
138 return map.keys();
139 }
140
141
142 QList< TrafficItemMapInterface::Item*> TrafficItemMapModel::values() const
143 {
144 return map.values();
145 }
146
147 TrafficItemMapInterface::ID TrafficItemMapModel::generateID() const
148 {
149 TrafficItemMapInterface::ID id = 0;
150 for (auto key : map.keys())
151 {
152 if (id <= key)
153 {
154 id = key + 1;
155 }
156 }
157 return id;
158 }
159
160
161 int TrafficItemMapModel::count() const
162 {
163 return map.count();
164 }
165
166
167 void TrafficItemMapModel::clear()
168 {
169 qDeleteAll(map);
170 map.clear();
171 }
TrafficItemMapModel::remove
virtual bool remove(TrafficItemMapInterface::ID const &id) override
Method which removes the traffic item registered under the given ID from the map. Afterwards...
Definition: TrafficItemMapModel.cpp:83
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficItemMapModel::begin
virtual TrafficItemMapInterface::Iterator begin() override
Gets an iterator pointing at the first traffic item in the map.
Definition: TrafficItemMapModel.cpp:20
TrafficItemInterface::Value
QString Value
the datatype for the traffic parameter&#39;s value (generally a string)
Definition: TrafficItemInterface.h:42
TrafficItemMapModel::contains
virtual bool contains(TrafficItemMapInterface::ID const &id) const override
Method tests whether the map contains an entry under the given ID.
Definition: TrafficItemMapModel.cpp:130
TrafficItemInterface::edited
void edited()
Signal emitted whenever an attribute of the traffic parameter has changed.
TrafficItemMapModel::clear
virtual void clear() override
Method which clears the map and deletes all items.
Definition: TrafficItemMapModel.cpp:167
TrafficItemMapInterface::Iterator
Map::Iterator Iterator
An iterator for searching within the map.
Definition: TrafficItemMapInterface.h:43
TrafficItemMapModel::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value) override
Method which creates a traffic item and registers it under the ID passed as a first argument...
Definition: TrafficItemMapModel.cpp:44
TrafficItemMapModel::getID
virtual TrafficItemMapInterface::ID getID(TrafficItemMapInterface::Item *const item) const override
Method which returns the ID of the given traffic item, if contained in the map. Returns Qt&#39;s default-...
Definition: TrafficItemMapModel.cpp:124
TrafficItemMapModel::constEnd
virtual TrafficItemMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last traffic item (use for read-only)...
Definition: TrafficItemMapModel.cpp:38
TrafficItemModel
The TrafficItemModel class implements functionality of the TrafficItemInterface class.
Definition: TrafficItemModel.h:26
TrafficItemMapModel::values
virtual QList< TrafficItemMapInterface::Item * > values() const override
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
Definition: TrafficItemMapModel.cpp:142
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficItemMapModel::generateID
virtual TrafficItemMapInterface::ID generateID() const
Method which returns the highest unoccupied ID of the map.
Definition: TrafficItemMapModel.cpp:147
TrafficItemMapModel::constBegin
virtual TrafficItemMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing at the first traffic item in the map (use for read-only since pointing at c...
Definition: TrafficItemMapModel.cpp:26
TrafficItemMapModel::count
virtual int count() const override
Method which returns the number of items registered in the map.
Definition: TrafficItemMapModel.cpp:161
TrafficItemMapModel::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const override
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
Definition: TrafficItemMapModel.cpp:113
TrafficItemInterface::Probability
double Probability
the selection probability&#39;s datatype
Definition: TrafficItemInterface.h:43
TrafficItemMapModel::keys
virtual QList< TrafficItemMapInterface::ID > keys() const override
Method which returns a list of all IDs used in the map. For the list, Qt&#39;s QList class is used...
Definition: TrafficItemMapModel.cpp:136
TrafficItemModel.h
The TrafficItemModel class implements functionality of the TrafficItemInterface class.
TrafficItemMapModel.h
The TrafficItemMapModel class implements functionality of the TrafficItemMapInterface class...
TrafficItemMapInterface::ConstIterator
Map::ConstIterator ConstIterator
A constant iterator (for reading only)
Definition: TrafficItemMapInterface.h:44
TrafficItemMapModel::end
virtual TrafficItemMapInterface::Iterator end() override
Gets an iterator pointing at the end of the map after the last traffic item.
Definition: TrafficItemMapModel.cpp:32
TrafficItemInterface::setValue
virtual void setValue(Value const &_value)=0
Sets the traffic item&#39;s value to the value passed as an argument.
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73
TrafficItemMapInterface::edited
void edited()
Signal emitted when traffic items are added to or removed from this map. It is also connected to the ...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemMapPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
TrafficItemMapPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficItemMapPresenter.h"
12
13 TrafficItemMapPresenter::TrafficItemMapPresenter(TrafficItemMapInterface * const trafficItemMap,
14 QObject *parent)
15 : QAbstractTableModel(parent)
16 , trafficItemMap(trafficItemMap)
17 {
18 _columnHeaders << "Value" << "Probability";
19 }
20
21 QVariant TrafficItemMapPresenter::headerData(int section, Qt::Orientation orientation, int role) const
22 {
23 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
24 return _columnHeaders.value(section);
25
26 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
27 return section + 1;
28
29 return QVariant();
30 }
31
32 int TrafficItemMapPresenter::rowCount(const QModelIndex &parent) const
33 {
34 Q_UNUSED(parent);
35
36 return trafficItemMap->count();
37 }
38
39
40 int TrafficItemMapPresenter::columnCount(const QModelIndex &parent) const
41 {
42 Q_UNUSED(parent);
43
44 return _columnHeaders.count();
45 }
46
47 QVariant TrafficItemMapPresenter::data(const QModelIndex &index, int role) const
48 {
49 int row = index.row();
50 int col = index.column();
51 TrafficItemMapInterface::Item * item = trafficItemMap->getItem(RowToID[row]);
52
53 if(row >= trafficItemMap->count())
54 return QVariant::Invalid;
55
56 if(role == Qt::TextAlignmentRole)
57 return QVariant(Qt::AlignCenter);
58
59 if(item && (role == Qt::DisplayRole || role == Qt::EditRole))
60 {
61 if( col == 0)
62 return QVariant(item->getValue());
63
64 else if(col == 1)
65 return QVariant(item->getProbability());
66 }
67
68 return QVariant();
69 }
70
71 bool TrafficItemMapPresenter::setData(const QModelIndex &index,
72 const QVariant &value,
73 int role)
74 {
75 int row = index.row();
76 int col = index.column();
77 TrafficItemMapInterface::Item * item = trafficItemMap->getItem(RowToID[row]);
78
79 if(role == Qt::EditRole)
80 {
81
82 if(col == 0)
83 {
84 item->setValue(value.toString());
85 Q_EMIT dataChanged(index, index);
86 Q_EMIT trafficItemMap->edited();
87 return true;
88 }
89 else if(col ==1)
90 {
91 item->setProbability(value.toDouble());
92 Q_EMIT dataChanged(index, index);
93 Q_EMIT trafficItemMap->edited();
94 return true;
95 }
96 }
97
98 return false;
99 }
100
101
102 Qt::ItemFlags TrafficItemMapPresenter::flags(const QModelIndex &index) const
103 {
104 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
105 }
106
107
108 void TrafficItemMapPresenter::addRow(const int &row,
109 TrafficItemInterface::Value const & value,
110 TrafficItemInterface::Probability const & probability)
111 {
112 TrafficItemMapInterface::ID Id = trafficItemMap->generateID();
113
114 // shift all row indices, starting from given row, up
115 for(auto _row= RowToID.size()-1; _row>=row; _row--)
116 RowToID.insert(_row + 1, RowToID.take(_row));
117
118 RowToID.insert(row , Id);
119
120 beginInsertRows(QModelIndex(), row, row);
121 trafficItemMap->add(Id, probability, value);
122 endInsertRows();
123 }
124
125 bool TrafficItemMapPresenter::removeRow(const int &row)
126 {
127 if( RowToID.contains(row) )
128 {
129 beginRemoveRows(QModelIndex(), row, row);
130 trafficItemMap->remove(RowToID[row]);
131 RowToID.take(row);
132
133 // shift the ID to row map for everything below this Item
134 for( int i = row + 1; i<=RowToID.count() ; i++)
135 RowToID.insert( i-1, RowToID.take(i) );
136
137 endRemoveRows();
138
139 return true;
140 }
141 else
142 return false;
143 }
144
145 void TrafficItemMapPresenter::update()
146 {
147 int rows = 0;
148
149 beginResetModel();
150 endResetModel();
151 RowToID.clear();
152
153 for(auto item : trafficItemMap->values())
154 {
155 RowToID.insert( rows, trafficItemMap->getID(item) );
156 rows++;
157 }
158 }
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapPresenter.h
This class describes the presenter objects of the traffic parameter maps.
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficItemMapInterface::getID
virtual TrafficItemMapInterface::ID getID(TrafficItemMapInterface::Item *const item) const =0
Method which returns the ID of the given traffic item, if contained in the map. Returns Qt&#39;s default-...
TrafficItemMapPresenter::addRow
void addRow(const int &row, TrafficItemInterface::Value const &value, TrafficItemInterface::Probability const &probability)
Method that adds a new row, i.e. a new environment item to the edited component.
Definition: TrafficItemMapPresenter.cpp:108
TrafficItemMapPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: TrafficItemMapPresenter.cpp:47
TrafficItemInterface::Value
QString Value
the datatype for the traffic parameter&#39;s value (generally a string)
Definition: TrafficItemInterface.h:42
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
TrafficItemInterface::getProbability
virtual Probability getProbability() const =0
Returns the current probability of the traffic item&#39;s occurence.
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficItemInterface::getValue
virtual Value getValue() const =0
Returns the current value of the traffic item.
TrafficItemMapPresenter::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! ...
Definition: TrafficItemMapPresenter.cpp:102
TrafficItemMapInterface::count
virtual int count() const =0
Method which returns the number of items registered in the map.
TrafficItemInterface::Probability
double Probability
the selection probability&#39;s datatype
Definition: TrafficItemInterface.h:43
TrafficItemMapPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: TrafficItemMapPresenter.cpp:21
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficItemMapPresenter::removeRow
bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: TrafficItemMapPresenter.cpp:125
TrafficItemMapInterface::remove
virtual bool remove(TrafficItemMapInterface::ID const &id)=0
Method which removes the traffic item registered under the given ID from the map. Afterwards...
TrafficItemMapInterface::generateID
virtual TrafficItemMapInterface::ID generateID() const =0
Method which returns the highest unoccupied ID of the map.
TrafficItemMapPresenter::setData
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: TrafficItemMapPresenter.cpp:71
TrafficItemMapPresenter::update
void update()
Method which updates the table according to the current entries of #environmentMap.
Definition: TrafficItemMapPresenter.cpp:145
TrafficItemMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: TrafficItemMapPresenter.cpp:32
TrafficItemMapPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: TrafficItemMapPresenter.cpp:40
TrafficItemMapInterface::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0
Method which creates a traffic item and registers it under the ID passed as a first argument...
TrafficItemInterface::setValue
virtual void setValue(Value const &_value)=0
Sets the traffic item&#39;s value to the value passed as an argument.
TrafficItemMapInterface::edited
void edited()
Signal emitted when traffic items are added to or removed from this map. It is also connected to the ...
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficItemModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficItemModel.h"
12
13 TrafficItemModel::TrafficItemModel(QObject *parent)
14 : TrafficItemInterface(parent)
15 {
16 }
17
18
19 void TrafficItemModel::setValue(const Value &_value)
20 {
21 value = _value;
22
23 Q_EMIT edited();
24 }
25
26
27 TrafficItemInterface::Value TrafficItemModel::getValue() const
28 {
29 return value;
30 }
31
32
33 void TrafficItemModel::setProbability(const Probability &_probability)
34 {
35 probability=_probability;
36
37 Q_EMIT edited();
38 }
39
40
41 TrafficItemInterface::Probability TrafficItemModel::getProbability() const
42 {
43 return probability;
44 }
45
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemInterface::Value
QString Value
the datatype for the traffic parameter&#39;s value (generally a string)
Definition: TrafficItemInterface.h:42
TrafficItemInterface::edited
void edited()
Signal emitted whenever an attribute of the traffic parameter has changed.
TrafficItemModel::value
Value value
the current value of the traffic parameter
Definition: TrafficItemModel.h:45
TrafficItemModel::getValue
virtual Value getValue() const override
Returns the current value of the traffic item.
Definition: TrafficItemModel.cpp:27
TrafficItemModel::setProbability
virtual void setProbability(Probability const &_probability) override
Sets the probability of the traffic item&#39;s occurence.
Definition: TrafficItemModel.cpp:33
TrafficItemInterface::Probability
double Probability
the selection probability&#39;s datatype
Definition: TrafficItemInterface.h:43
TrafficItemModel::getProbability
virtual Probability getProbability() const override
Returns the current probability of the traffic item&#39;s occurence.
Definition: TrafficItemModel.cpp:41
TrafficItemModel.h
The TrafficItemModel class implements functionality of the TrafficItemInterface class.
TrafficItemModel::setValue
virtual void setValue(Value const &_value) override
Sets the traffic item&#39;s value to the value passed as an argument.
Definition: TrafficItemModel.cpp:19
TrafficItemModel::probability
Probability probability
the selection probability of the traffic parameter
Definition: TrafficItemModel.h:46
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficItemView.cpp
1 #include "TrafficItemView.h"
2 #include "ui_TrafficItemView.h"
3
4 #include <QString>
5 #include <QSpinBox>
6 #include <QDoubleSpinBox>
7 #include <QLabel>
8 #include <QFont>
9
10
11
12 TrafficItemView::TrafficItemView(Type type,
13 unsigned int ID,
14 int index,
15 QWidget *parent) :
16 WidgetView(parent)
17 , ID(ID)
18 , index(index)
19 , type(type)
20 , ui(new Ui::TrafficItemView)
21 {
22 ui->setupUi(this);
23
24 switch(type)
25 {
26 case Type::Volume:
27 {
28 QSpinBox * valueView = new QSpinBox(this);
29 valueView->setObjectName("valueView");
30 valueView->setMinimumWidth(50);
31 valueView->setMaximumWidth(50);
32
33 valueView->setMinimum(0);
34 valueView->setMaximum(3000);
35 valueView->setSingleStep(100);
36 ui->Title->setText( QString("%1. ").arg(index) );
37 ui->Unit->setText(" [1/h]");
38 setToolTip("Specifies the target rate of vehicles per hour and per lane.");
39 ui->valueLayout->insertWidget(1, valueView);
40 connect(valueView, static_cast<void (QSpinBox::*)(QString const &)>(&QSpinBox::valueChanged),
41 this, valueView_valueChanged);
42 break;
43 }
44 case Type::PlatoonRate:
45 {
46 QDoubleSpinBox * valueView = new QDoubleSpinBox(this);
47 valueView->setObjectName("valueView");
48 valueView->setMinimumWidth(50);
49 valueView->setMaximumWidth(50);
50
51 valueView->setMinimum(0.0);
52 valueView->setMaximum(1.0);
53 valueView->setDecimals(2);
54 valueView->setSingleStep(0.1);
55 valueView->setLocale(QLocale::C);
56 ui->Title->setText( QString("%1. ").arg(index) );
57 ui->Unit->setText("");
58 setToolTip("Specifies how strong agents are grouped together. A value of 0 corresponds to equally distributed traffic along the road.");
59 ui->valueLayout->insertWidget(1,valueView);
60 connect(valueView, static_cast<void (QDoubleSpinBox::*)(QString const &)>(&QDoubleSpinBox::valueChanged),
61 this, valueView_valueChanged);
62 break;
63 }
64 case Type::Velocity:
65 {
66 QDoubleSpinBox * valueView = new QDoubleSpinBox(this);
67 valueView->setObjectName("valueView");
68 valueView->setMinimumWidth(50);
69 valueView->setMaximumWidth(50);
70
71 valueView->setMinimum(0.0);
72 valueView->setMaximum(250.0);
73 valueView->setDecimals(0);
74 valueView->setSingleStep(10.0);
75 valueView->setLocale(QLocale::C);
76 ui->Title->setText( QString("%1. ").arg(index) );
77 ui->Unit->setText("[km/h]");
78 setToolTip("Specifies the average velocity on the rightmost lane.");
79 ui->valueLayout->insertWidget(1,valueView);
80 connect(valueView, static_cast<void (QDoubleSpinBox::*)(QString const &)>(&QDoubleSpinBox::valueChanged),
81 this, valueView_valueChanged);
82 break;
83 }
84 case Type::Homogeneity:
85 {
86 QDoubleSpinBox * valueView = new QDoubleSpinBox(this);
87 valueView->setObjectName("valueView");
88 valueView->setMinimumWidth(50);
89 valueView->setMaximumWidth(50);
90
91 valueView->setMinimum(0.0);
92 valueView->setMaximum(1.0);
93 valueView->setDecimals(2);
94 valueView->setSingleStep(0.1);
95 valueView->setLocale(QLocale::C);
96 ui->Title->setText( QString("%1. ").arg(index) );
97 ui->Unit->setText("");
98 setToolTip("Specifies how much the average velocity increases per lane with respect to its individual right lane. "
99 "A homogeneity of 1 results in equal velocities across all lanes. \n"
100 "A value of 0 results in doubled velocity on the left lane, compared to its individual right lane.");
101 ui->valueLayout->insertWidget(1,valueView);
102 connect(valueView, static_cast<void (QDoubleSpinBox::*)(QString const &)>(&QDoubleSpinBox::valueChanged),
103 this, valueView_valueChanged);
104 break;
105 }
106 case Type::Agent:
107 {
108 QLabel * valueView = new QLabel(this);
109 QFont font;
110
111 font.setPointSize(10);
112 valueView->setObjectName("valueView");
113 valueView->setFont(font);
114
115 ui->Title->setText(QString("%1. ").arg(index));
116 ui->Unit->setText("");
117 ui->value->setText("");
118 ui->valueLayout->insertWidget(1,valueView);
119 break;
120 }
121 default:
122 break;
123 }
124 }
125
126 TrafficItemView::~TrafficItemView()
127 {
128 delete ui;
129 }
130
131 void TrafficItemView::on_remove_clicked()
132 {
133 Q_EMIT remove(ID, type);
134 }
135
136 void TrafficItemView::valueView_valueChanged(const QString &value)
137 {
138 Q_EMIT valueChanged(ID,value,type);
139 }
140
141 void TrafficItemView::on_probabilityValue_editingFinished()
142 {
143 Q_EMIT probabilityChanged(ID, ui->probabilityValue->value(), type);
144 }
145
146 unsigned int TrafficItemView::getID() const
147 {
148 return ID;
149 }
150
151 int TrafficItemView::getIndex() const
152 {
153 return index;
154 }
155
156
157
158 void TrafficItemView::setValue(QString value)
159 {
160 switch(type)
161 {
162
163 case Type::Volume:
164 {
165 ui->ContentWidget->findChild<QSpinBox*>("valueView")->setValue(value.toInt());
166 break;
167 }
168 case Type::PlatoonRate:
169 {
170 ui->ContentWidget->findChild<QDoubleSpinBox*>("valueView")->setValue(value.toDouble());
171 break;
172 }
173 case Type::Velocity:
174 {
175 ui->ContentWidget->findChild<QDoubleSpinBox*>("valueView")->setValue(value.toDouble());
176 break;
177 }
178 case Type::Homogeneity:
179 {
180 ui->ContentWidget->findChild<QDoubleSpinBox*>("valueView")->setValue(value.toDouble());
181 break;
182 }
183 case Type::Agent:
184 {
185 ui->ContentWidget->findChild<QLabel*>("valueView")->setText(value);
186 break;
187 }
188 }
189 }
190
191
192 void TrafficItemView::setProbability(double value)
193 {
194 ui->probabilityValue->setValue(value);
195 }
196
197 double TrafficItemView::getProbability() const
198 {
199 return ui->probabilityValue->value();
200 }
201
202 void TrafficItemView::setIndex(int newIndex)
203 {
204 index = newIndex;
205 ui->Title->setText(QString("%1. ").arg(index));
206 }
207
208
209 TrafficItemView::Type TrafficItemView::getType() const
210 {
211 return type;
212 }
213
214 QString TrafficItemView::getValue() const
215 {
216 switch(type)
217 {
218
219 case Type::Volume:
220 return QString("%1").arg(findChild<QSpinBox*>("valueView")->value());
221
222 case Type::PlatoonRate:
223 return QString("%1").arg(findChild<QDoubleSpinBox*>("valueView")->value());
224
225 case Type::Velocity:
226 return QString("%1").arg(findChild<QDoubleSpinBox*>("valueView")->value());
227
228 case Type::Homogeneity:
229 return QString("%1").arg(findChild<QDoubleSpinBox*>("valueView")->value());
230
231 case Type::Agent:
232 return findChild<QLabel*>("valueView")->text();
233
234 default:
235 return QString("");
236 }
237 }
TrafficItemView::setProbability
void setProbability(double value)
Method which sets the displayed probability of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:192
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
TrafficItemView::getValue
QString getValue() const
Method which returns the value of the traffic item.
Definition: TrafficItemView.cpp:214
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficItemView::getIndex
int getIndex() const
Method which returns the index of the traffic item. Items will be numerated in the order they appear ...
Definition: TrafficItemView.cpp:151
TrafficItemView::ui
Ui::TrafficItemView * ui
the ui object containing all visualization elements of the traffic item view
Definition: TrafficItemView.h:159
TrafficItemView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, Type type)
Signal, emitted when probability of the traffic item has been modified by the user. Transmits the ID, probability value and type of the item.
TrafficItemView::on_remove_clicked
void on_remove_clicked()
Qt Desinger-created slot activated when the remove button has been clicked. Emits the remove signal...
Definition: TrafficItemView.cpp:131
TrafficItemView::Type
Type
Definition: TrafficItemView.h:35
TrafficItemView.h
This class defines a general view for a traffic item, which can be a volume, platoon rate...
TrafficItemView::index
int index
the numeration index of the traffic item (changes, e.g., if traffic items in the list are removed) ...
Definition: TrafficItemView.h:157
TrafficItemView::getProbability
double getProbability() const
Method which returns the probability of the traffic item.
Definition: TrafficItemView.cpp:197
TrafficItemView::setValue
void setValue(QString value)
Method which sets the displayed value of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:158
TrafficItemView::getType
Type getType() const
Method which returns the type of the traffic item. The types are defined by the enum class Type...
Definition: TrafficItemView.cpp:209
TrafficItemView::ID
unsigned int ID
the ID of the traffic item
Definition: TrafficItemView.h:156
TrafficItemView::Type::Volume
An enum class defining the type of the traffic item.
TrafficItemView::getID
unsigned int getID() const
Method which returns the ID of the traffic item.
Definition: TrafficItemView.cpp:146
TrafficItemView::setIndex
void setIndex(int newIndex)
Method which sets the displayed index of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:202
TrafficItemView::valueChanged
void valueChanged(unsigned int ID, QString value, Type type)
Signal, emitted when the value of the traffic item has been changed. Transmits the ID...
TrafficItemView::valueView_valueChanged
void valueView_valueChanged(QString const &value)
A slot which is activated when the value of the traffic item has been edited by the user...
Definition: TrafficItemView.cpp:136
TrafficItemView::type
Type type
the type of the traffic item
Definition: TrafficItemView.h:158
TrafficItemView::on_probabilityValue_editingFinished
void on_probabilityValue_editingFinished()
Qt Desinger-created slot activated when the probability value of the double spinbox has been edited b...
Definition: TrafficItemView.cpp:141
Generated on Wed Feb 19 2020 14:58:11 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficLanesPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
TrafficLanesPresenter.cpp
1 #include "TrafficLanesPresenter.h"
2
3 TrafficLanesPresenter::TrafficLanesPresenter(QList<QString> *agentProfiles,
4 TrafficInterface *traffic,
5 TrafficLanesView *trafficLanesView,
6 QObject *parent)
7 : QObject(parent)
8 , agentProfiles(agentProfiles)
9 , traffic(traffic)
10 , trafficLanesView(trafficLanesView)
11 {
12 connect(trafficLanesView, &TrafficLanesView::addRegularLaneAgent, this, &TrafficLanesPresenter::addRegularLaneAgent);
13 connect(trafficLanesView, &TrafficLanesView::addRightmostLaneAgent, this, &TrafficLanesPresenter::addRightmostLaneAgent);
14
15 connect(trafficLanesView, &TrafficLanesView::removeRegularLaneAgent, this, &TrafficLanesPresenter::removeRegularLaneAgent);
16 connect(trafficLanesView, &TrafficLanesView::removeRightmostLaneAgent, this, &TrafficLanesPresenter::removeRightmostLaneAgent);
17
18 connect(trafficLanesView, &TrafficLanesView::RegularLaneAgent_probabilityChanged, this, &TrafficLanesPresenter::setRegularLaneAgentProbability);
19 connect(trafficLanesView, &TrafficLanesView::RightmostLaneAgent_probabilityChanged, this, &TrafficLanesPresenter::setRightmostLaneAgentProbability);
20 }
21
22
23 void TrafficLanesPresenter::addRegularLaneAgent(const QString &name)
24 {
25 unsigned int id = traffic->getAgentsRegularLane()->generateID();
26 QList<QString> names;
27
28 for(TrafficItemInterface<QString>* agent : traffic->getAgentsRegularLane()->values())
29 names.append(agent->getValue());
30
31 if(agentProfiles->contains(name) && !names.contains(name))
32 {
33 traffic->getAgentsRegularLane()->add(id, name);
34 trafficLanesView->addRegularLaneAgentView(id,name, 0.5);
35 Q_EMIT RegularLaneAgent_added();
36 }
37 }
38
39
40 void TrafficLanesPresenter::addRightmostLaneAgent(const QString &name)
41 {
42 unsigned int id = traffic->getAgentsRightMostLane()->generateID();
43 QList<QString> names;
44
45 for(TrafficItemInterface<QString>* agent : traffic->getAgentsRightMostLane()->values())
46 names.append(agent->getValue());
47
48 if(agentProfiles->contains(name) && !names.contains(name))
49 {
50 traffic->getAgentsRightMostLane()->add(id, name);
51 trafficLanesView->addRightmostLaneAgentView(id,name, 0.5);
52 Q_EMIT RightmostLaneAgent_added();
53 }
54 }
55
56
57 void TrafficLanesPresenter::removeRegularLaneAgent(unsigned int id)
58 {
59 if(traffic->getAgentsRegularLane()->contains(id))
60 {
61 traffic->getAgentsRegularLane()->remove(id);
62 trafficLanesView->removeRegularLaneAgentView(id);
63 Q_EMIT RegularLaneAgent_removed();
64 }
65 }
66
67 void TrafficLanesPresenter::removeRightmostLaneAgent(unsigned int id)
68 {
69 if(traffic->getAgentsRightMostLane()->contains(id))
70 {
71 traffic->getAgentsRightMostLane()->remove(id);
72 trafficLanesView->removeRightmostLaneAgentView(id);
73 Q_EMIT RightmostLaneAgent_removed();
74 }
75 }
76
77 void TrafficLanesPresenter::setRegularLaneAgentProbability(unsigned int id, double value)
78 {
79 if(traffic->getAgentsRegularLane()->contains(id))
80 {
81 traffic->getAgentsRegularLane()->getItem(id)->setProbability(value);
82 Q_EMIT RegularLaneAgent_probabilityChanged();
83 }
84 }
85
86 void TrafficLanesPresenter::setRightmostLaneAgentProbability(unsigned int id, double value)
87 {
88 if(traffic->getAgentsRightMostLane()->contains(id))
89 {
90 traffic->getAgentsRightMostLane()->getItem(id)->setProbability(value);
91 Q_EMIT RightmostLaneAgent_probabilityChanged();
92 }
93 }
94
95
96 void TrafficLanesPresenter::setAgentSelectionViews(const QStringList &names)
97 {
98 trafficLanesView->setAgentSelectionItems(names);
99 }
100
101
102 void TrafficLanesPresenter::clearAgentSelectionView()
103 {
104
105 trafficLanesView->clearTrafficLanesView();
106 trafficLanesView->setAgentSelectionItems(QStringList());
107 Q_EMIT cleared();
108 }
109
110
111 void TrafficLanesPresenter::removeRegularLaneAgentByName(QString name)
112 {
113 QMap<QString, unsigned int> map;
114 TrafficItemMapInterface<QString>* agentMap = traffic->getAgentsRegularLane();
115
116 for(TrafficItemInterface<QString>* agent : agentMap->values())
117 map.insert(agent->getValue(), agentMap->getID(agent));
118
119 if(map.contains(name))
120 {
121 removeRegularLaneAgent(map[name]);
122 trafficLanesView->removeRegularLaneAgentView(map[name]);
123 Q_EMIT RegularLaneAgent_removed();
124 }
125 }
126
127 void TrafficLanesPresenter::removeRightmostLaneAgentByName(QString name)
128 {
129 QMap<QString, unsigned int> map;
130 TrafficItemMapInterface<QString>* agentMap = traffic->getAgentsRightMostLane();
131
132 for(TrafficItemInterface<QString>* agent : agentMap->values())
133 map.insert(agent->getValue(), agentMap->getID(agent));
134
135 if(map.contains(name))
136 {
137 removeRightmostLaneAgent(map[name]);
138 trafficLanesView->removeRightmostLaneAgentView(map[name]);
139 Q_EMIT RightmostLaneAgent_removed();
140 }
141 }
142
143
144 void TrafficLanesPresenter::updateView()
145 {
146 trafficLanesView->clearTrafficLanesView();
147 Q_EMIT cleared();
148
149 // Update selection lists of combo boxes
150 trafficLanesView->setAgentSelectionItems(*agentProfiles);
151
152 // Fill agents into regular lane
153 TrafficItemMapInterface<QString> * agentMap = traffic->getAgentsRegularLane();
154
155 for(TrafficItemInterface<QString>* agent: agentMap->values())
156 {
157 trafficLanesView->addRegularLaneAgentView(agentMap->getID(agent), agent->getValue(), agent->getProbability());
158 Q_EMIT RegularLaneAgent_added();
159
160 }
161
162 // Fill agents into rightmost lane
163 agentMap = traffic->getAgentsRightMostLane();
164
165 for(TrafficItemInterface<QString>* agent: agentMap->values())
166 {
167 trafficLanesView->addRightmostLaneAgentView(agentMap->getID(agent), agent->getValue(), agent->getProbability());
168 Q_EMIT RightmostLaneAgent_added();
169 }
170 }
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficLanesPresenter.h
This class defines the presenter object which handles events coming from the view (TrafficLanesView) ...
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficLanesPresenter::RegularLaneAgent_added
void RegularLaneAgent_added()
Signal, emitted when an agent profile has been added to a regular lane in the model.
TrafficLanesPresenter::removeRegularLaneAgentByName
void removeRegularLaneAgentByName(QString name)
Slot which acts as removeRegularLaneAgent but uses a name instead of the ID. This slot is connected t...
Definition: TrafficLanesPresenter.cpp:111
TrafficItemMapInterface::contains
virtual bool contains(TrafficItemMapInterface::ID const &id) const =0
Method tests whether the map contains an entry under the given ID.
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficItemMapInterface::getID
virtual TrafficItemMapInterface::ID getID(TrafficItemMapInterface::Item *const item) const =0
Method which returns the ID of the given traffic item, if contained in the map. Returns Qt&#39;s default-...
TrafficLanesPresenter::removeRightmostLaneAgent
void removeRightmostLaneAgent(unsigned int id)
Slot which is triggered when the remove-button has been clicked for a rightmost lane agent view...
Definition: TrafficLanesPresenter.cpp:67
TrafficLanesView::addRegularLaneAgent
void addRegularLaneAgent(QString const &name)
Signal, emitted when the add button in the regula lane agents section is clicked. Transmits the name ...
TrafficLanesPresenter::RightmostLaneAgent_removed
void RightmostLaneAgent_removed()
Signal, emitted when an agent profile has been removed from the rightmost lane in the model...
TrafficLanesView
This class defines the editor widget for assigning agent profiles to regular and rightmost lanes...
Definition: TrafficLanesView.h:33
TrafficLanesView::RightmostLaneAgent_probabilityChanged
void RightmostLaneAgent_probabilityChanged(unsigned int id, double value)
Signal, emitted when the probability of a particular rightmost lane agent is modified by the user...
TrafficLanesView::addRegularLaneAgentView
void addRegularLaneAgentView(unsigned int id, QString name, double probability)
Method which creates an editor view for a regular lane agent profile and inserts it into the correspo...
Definition: TrafficLanesView.cpp:48
TrafficLanesPresenter::clearAgentSelectionView
void clearAgentSelectionView()
Slot which is triggered when the map of available agent profiles (Agent Configuration Plugin) has bee...
Definition: TrafficLanesPresenter.cpp:102
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
TrafficLanesPresenter::removeRightmostLaneAgentByName
void removeRightmostLaneAgentByName(QString name)
Slot which acts as removeRightmostLaneAgent but uses a name instead of the ID. This slot is connected...
Definition: TrafficLanesPresenter.cpp:127
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficLanesView::addRightmostLaneAgent
void addRightmostLaneAgent(QString const &name)
Signal, emitted when the add button in the rightmost lane agents section is clicked. Transmits the name of the agent profile currently selected in the combobox.
TrafficLanesView::removeRegularLaneAgent
void removeRegularLaneAgent(unsigned int id)
Signal, emitted when the remove button of a particular regular lane agent profile is clicked...
TrafficLanesPresenter::cleared
void cleared()
Signal, emitted when the whole configuration has been cleared, i.e. all agent profiles have been remo...
TrafficLanesView::setAgentSelectionItems
void setAgentSelectionItems(const QStringList &items)
Method which fills the comboboxes for agent profile selections with the string list passed as an argu...
Definition: TrafficLanesView.cpp:100
TrafficLanesPresenter::RegularLaneAgent_probabilityChanged
void RegularLaneAgent_probabilityChanged()
Signal, emitted when the probability of a regular lane agent&#39;s profile has been changed in the model...
TrafficLanesView::RegularLaneAgent_probabilityChanged
void RegularLaneAgent_probabilityChanged(unsigned int id, double value)
Signal, emitted when the probability of a particular regular lane agent is modified by the user...
TrafficLanesPresenter::setRegularLaneAgentProbability
void setRegularLaneAgentProbability(unsigned int id, double value)
Slot which is triggered when the displayed probability value of a regular lane agent has been edited ...
Definition: TrafficLanesPresenter.cpp:77
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
TrafficLanesPresenter::setRightmostLaneAgentProbability
void setRightmostLaneAgentProbability(unsigned int id, double value)
Slot which is triggered when the displayed probability value of a rightmost lane agent has been edite...
Definition: TrafficLanesPresenter.cpp:86
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficLanesPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model edited by this presenter
Definition: TrafficLanesPresenter.h:192
TrafficLanesPresenter::RightmostLaneAgent_added
void RightmostLaneAgent_added()
Signal, emitted when an agent profile has been added to the rightmost lane in the model...
TrafficLanesPresenter::RightmostLaneAgent_probabilityChanged
void RightmostLaneAgent_probabilityChanged()
Signal, emitted when the probability of a rightmost lane agent&#39;s profile has been changed in the mode...
TrafficItemMapInterface::remove
virtual bool remove(TrafficItemMapInterface::ID const &id)=0
Method which removes the traffic item registered under the given ID from the map. Afterwards...
TrafficLanesView::removeRightmostLaneAgent
void removeRightmostLaneAgent(unsigned int id)
Signal, emitted when the remove button of a particular rightmost lane agent profile is clicked...
TrafficItemMapInterface::generateID
virtual TrafficItemMapInterface::ID generateID() const =0
Method which returns the highest unoccupied ID of the map.
TrafficLanesPresenter::addRightmostLaneAgent
void addRightmostLaneAgent(QString const &name)
Slot which is triggered when the add-button has been clicked in the rightmost lane section of Traffic...
Definition: TrafficLanesPresenter.cpp:40
TrafficLanesPresenter::removeRegularLaneAgent
void removeRegularLaneAgent(unsigned int id)
Slot which is triggered when the remove-button has been clicked for a regular lane agent view...
Definition: TrafficLanesPresenter.cpp:57
TrafficLanesView::removeRightmostLaneAgentView
void removeRightmostLaneAgentView(unsigned int id)
Method which removes the editor view for a rightmost lane agent profile specified by the ID passed as...
Definition: TrafficLanesView.cpp:81
TrafficLanesView::removeRegularLaneAgentView
void removeRegularLaneAgentView(unsigned int id)
Method which removes the editor view for a regular lane agent profile specified by the ID passed as a...
Definition: TrafficLanesView.cpp:62
TrafficLanesPresenter::RegularLaneAgent_removed
void RegularLaneAgent_removed()
Signal, emitted when an agent profile has been removed from a regular lane in the model...
TrafficLanesPresenter::addRegularLaneAgent
void addRegularLaneAgent(QString const &name)
Slot which is triggered when the add-button has been clicked in the regular lanes section of TrafficL...
Definition: TrafficLanesPresenter.cpp:23
TrafficItemMapInterface::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0
Method which creates a traffic item and registers it under the ID passed as a first argument...
TrafficLanesView::addRightmostLaneAgentView
void addRightmostLaneAgentView(unsigned int id, QString name, double probability)
Method which creates an editor view for a rightmost lane agent profile and inserts it into the corres...
Definition: TrafficLanesView.cpp:32
TrafficLanesPresenter::trafficLanesView
TrafficLanesView * trafficLanesView
a pointer to the editor view whose user events are managed by this presenter
Definition: TrafficLanesPresenter.h:193
TrafficLanesView::clearTrafficLanesView
void clearTrafficLanesView()
Method which deletes all existing editor views for both, regular and rightmost lanes. Resizes the entire view (this class) to its initial size.
Definition: TrafficLanesView.cpp:135
TrafficLanesPresenter::updateView
void updateView()
Method which updates the whole TrafficLanesView widget to display the entire model configuration...
Definition: TrafficLanesPresenter.cpp:144
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficLanesView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficLanesView.cpp
1 #include "TrafficLanesView.h"
2
3 #include "TrafficItemView.h"
4 #include "ui_TrafficLanesView.h"
5
6 #include <QResizeEvent>
7
8 TrafficLanesView::TrafficLanesView(QWidget *parent) :
9 WidgetView(parent),
10 ui(new Ui::TrafficLanesView)
11 {
12 ui->setupUi(this);
13 initialHeight=height();
14 }
15
16 TrafficLanesView::~TrafficLanesView()
17 {
18 delete ui;
19 }
20
21
22 void TrafficLanesView::on_addRightmostLaneAgent_clicked()
23 {
24 Q_EMIT addRightmostLaneAgent(ui->RightmostLaneAgent->currentText());
25 }
26
27 void TrafficLanesView::on_addRegularLaneAgent_clicked()
28 {
29 Q_EMIT addRegularLaneAgent(ui->RegularLaneAgent->currentText());
30 }
31
32 void TrafficLanesView::addRightmostLaneAgentView(unsigned int id, QString name, double probability)
33 {
34 int index = ui->RightmostLaneLayout->count() +1;
35
36 TrafficItemView * agentView = new TrafficItemView(TrafficItemView::Type::Agent, id, index, this);
37 agentView->setValue(name);
38 agentView->setProbability(probability);
39
40 connect(agentView, &TrafficItemView::remove, this, &TrafficLanesView::removeRightmostLaneAgent);
41 connect(agentView, &TrafficItemView::probabilityChanged, this, &TrafficLanesView::RightmostLaneAgent_probabilityChanged);
42
43
44 ui->RightmostLaneLayout->insertWidget(index-1, agentView);
45 resize(width(), height() + agentView->height());
46 }
47
48 void TrafficLanesView::addRegularLaneAgentView(unsigned int id, QString name, double probability)
49 {
50 int index = ui->RegularLaneLayout->count() +1 ;
51 TrafficItemView * agentView = new TrafficItemView(TrafficItemView::Type::Agent, id, index, this);
52 agentView->setValue(name);
53 agentView->setProbability(probability);
54
55 connect(agentView, &TrafficItemView::remove, this, &TrafficLanesView::removeRegularLaneAgent);
56 connect(agentView, &TrafficItemView::probabilityChanged, this, &TrafficLanesView::RegularLaneAgent_probabilityChanged);
57
58 ui->RegularLaneLayout->insertWidget(index-1, agentView);
59 resize(width(), height() + agentView->height());
60 }
61
62 void TrafficLanesView::removeRegularLaneAgentView(unsigned int id)
63 {
64 bool shift = false;
65
66 for(auto agentView : ui->RegularLaneWidget->findChildren<TrafficItemView*>())
67 {
68 if(shift)
69 agentView->setIndex(agentView->getIndex()-1);
70
71 if(agentView->getID() == id)
72 {
73 ui->RegularLaneLayout->removeWidget(agentView);
74 resize(width(), height() - agentView->height());
75 delete agentView;
76 shift = true;
77 }
78 }
79 }
80
81 void TrafficLanesView::removeRightmostLaneAgentView(unsigned int id)
82 {
83 bool shift = false;
84
85 for(auto agentView : ui->RightmostLaneWidget->findChildren<TrafficItemView*>())
86 {
87 if(shift)
88 agentView->setIndex(agentView->getIndex()-1);
89
90 if(agentView->getID() == id)
91 {
92 ui->RightmostLaneLayout->removeWidget(agentView);
93 resize(width(), height() - agentView->height());
94 delete agentView;
95 shift = true;
96 }
97 }
98 }
99
100 void TrafficLanesView::setAgentSelectionItems(const QStringList &items)
101 {
102 ui->RegularLaneAgent->clear();
103 ui->RegularLaneAgent->addItems(items);
104
105 ui->RightmostLaneAgent->clear();
106 ui->RightmostLaneAgent->addItems(items);
107 }
108
109 void TrafficLanesView::resizeEvent(QResizeEvent *event)
110 {
111 event->ignore();
112
113 Q_EMIT resized();
114 }
115
116
117 void TrafficLanesView::setRegularLaneAgentProbability(unsigned int id, double value)
118 {
119 for(auto agentView: ui->RegularLaneWidget->findChildren<TrafficItemView*>())
120 {
121 if(agentView->getID() == id)
122 agentView->setProbability(value);
123 }
124 }
125
126 void TrafficLanesView::setRightmostLaneAgentProbability(unsigned int id, double value)
127 {
128 for(auto agentView: ui->RightmostLaneWidget->findChildren<TrafficItemView*>())
129 {
130 if(agentView->getID() == id)
131 agentView->setProbability(value);
132 }
133 }
134
135 void TrafficLanesView::clearTrafficLanesView()
136 {
137 qDeleteAll(findChildren<TrafficItemView*>());
138 resize(width(), initialHeight);
139
140 }
TrafficLanesView::setRegularLaneAgentProbability
void setRegularLaneAgentProbability(unsigned int id, double value)
Method which sets the display value of the probability for the regular lane agent profile specified b...
Definition: TrafficLanesView.cpp:117
TrafficItemView::setProbability
void setProbability(double value)
Method which sets the displayed probability of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:192
TrafficLanesView::initialHeight
int initialHeight
The initial height (empty form) of this view.
Definition: TrafficLanesView.h:192
Ui
Definition: EnvironmentDisplayView.h:29
TrafficLanesView::addRegularLaneAgent
void addRegularLaneAgent(QString const &name)
Signal, emitted when the add button in the regula lane agents section is clicked. Transmits the name ...
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficLanesView
This class defines the editor widget for assigning agent profiles to regular and rightmost lanes...
Definition: TrafficLanesView.h:33
TrafficLanesView::RightmostLaneAgent_probabilityChanged
void RightmostLaneAgent_probabilityChanged(unsigned int id, double value)
Signal, emitted when the probability of a particular rightmost lane agent is modified by the user...
TrafficLanesView::addRegularLaneAgentView
void addRegularLaneAgentView(unsigned int id, QString name, double probability)
Method which creates an editor view for a regular lane agent profile and inserts it into the correspo...
Definition: TrafficLanesView.cpp:48
TrafficItemView::remove
void remove(unsigned int ID, Type type)
Signal, emitted when remove button has been clicked. Transmits the ID and type of the traffic item...
TrafficItemView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, Type type)
Signal, emitted when probability of the traffic item has been modified by the user. Transmits the ID, probability value and type of the item.
TrafficLanesView::addRightmostLaneAgent
void addRightmostLaneAgent(QString const &name)
Signal, emitted when the add button in the rightmost lane agents section is clicked. Transmits the name of the agent profile currently selected in the combobox.
TrafficLanesView::removeRegularLaneAgent
void removeRegularLaneAgent(unsigned int id)
Signal, emitted when the remove button of a particular regular lane agent profile is clicked...
TrafficLanesView::setAgentSelectionItems
void setAgentSelectionItems(const QStringList &items)
Method which fills the comboboxes for agent profile selections with the string list passed as an argu...
Definition: TrafficLanesView.cpp:100
TrafficLanesView::RegularLaneAgent_probabilityChanged
void RegularLaneAgent_probabilityChanged(unsigned int id, double value)
Signal, emitted when the probability of a particular regular lane agent is modified by the user...
TrafficLanesView::ui
Ui::TrafficLanesView * ui
The ui object containing all visualization elements.
Definition: TrafficLanesView.h:191
TrafficLanesView::on_addRightmostLaneAgent_clicked
void on_addRightmostLaneAgent_clicked()
Qt Desinger-created slot activated when the add-button in the rightmost lane section is clicked...
Definition: TrafficLanesView.cpp:22
TrafficLanesView::on_addRegularLaneAgent_clicked
void on_addRegularLaneAgent_clicked()
Qt Desinger-created slot activated when the add-button in the regula lanes section is clicked...
Definition: TrafficLanesView.cpp:27
TrafficItemView.h
This class defines a general view for a traffic item, which can be a volume, platoon rate...
TrafficLanesView::setRightmostLaneAgentProbability
void setRightmostLaneAgentProbability(unsigned int id, double value)
Method which sets the display value of the probability for the rightmost lane agent profile specified...
Definition: TrafficLanesView.cpp:126
TrafficItemView::setValue
void setValue(QString value)
Method which sets the displayed value of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:158
TrafficLanesView::resized
void resized()
Signal, emitted when this view is resized.
TrafficLanesView::resizeEvent
void resizeEvent(QResizeEvent *event)
Reimplementation of the resize event. Emits the resized signal when this view is resized.
Definition: TrafficLanesView.cpp:109
TrafficLanesView::removeRightmostLaneAgent
void removeRightmostLaneAgent(unsigned int id)
Signal, emitted when the remove button of a particular rightmost lane agent profile is clicked...
TrafficLanesView::removeRightmostLaneAgentView
void removeRightmostLaneAgentView(unsigned int id)
Method which removes the editor view for a rightmost lane agent profile specified by the ID passed as...
Definition: TrafficLanesView.cpp:81
TrafficLanesView::removeRegularLaneAgentView
void removeRegularLaneAgentView(unsigned int id)
Method which removes the editor view for a regular lane agent profile specified by the ID passed as a...
Definition: TrafficLanesView.cpp:62
TrafficLanesView.h
This class defines the editor widget for assigning agent profiles to regular and rightmost lanes...
TrafficLanesView::addRightmostLaneAgentView
void addRightmostLaneAgentView(unsigned int id, QString name, double probability)
Method which creates an editor view for a rightmost lane agent profile and inserts it into the corres...
Definition: TrafficLanesView.cpp:32
TrafficLanesView::clearTrafficLanesView
void clearTrafficLanesView()
Method which deletes all existing editor views for both, regular and rightmost lanes. Resizes the entire view (this class) to its initial size.
Definition: TrafficLanesView.cpp:135
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficModel.h"
12
13 #include "TrafficItemMapModel.h"
14
15 TrafficModel::TrafficModel(QObject *parent)
16 : TrafficInterface(parent)
17 , name(QString(""))
18 , volumes(new TrafficItemMapModel(this))
19 , platoonRates(new TrafficItemMapModel(this))
20 , velocities(new TrafficItemMapModel(this))
21 , homogeneities(new TrafficItemMapModel(this))
22 , agentsRegularLane(new TrafficItemMapModel(this))
23 , agentsRightMostLane(new TrafficItemMapModel(this))
24 {
25
26 connect(volumes, &TrafficItemMapInterface::edited, this, &TrafficInterface::edited);
27 connect(platoonRates, &TrafficItemMapInterface::edited, this, &TrafficInterface::edited);
28 connect(velocities, &TrafficItemMapInterface::edited, this, &TrafficInterface::edited);
29 connect(homogeneities, &TrafficItemMapInterface::edited, this, &TrafficInterface::edited);
30 connect(agentsRegularLane, &TrafficItemMapInterface::edited, this, &TrafficInterface::edited);
31 connect(agentsRightMostLane, &TrafficItemMapInterface::edited, this, &TrafficInterface::edited);
32 }
33
34 TrafficModel::~TrafficModel()
35 {
36 delete volumes;
37 delete platoonRates;
38 delete velocities;
39 delete homogeneities;
40 delete agentsRegularLane;
41 delete agentsRightMostLane;
42 }
43
44
45 TrafficInterface::Name TrafficModel::getName() const
46 {
47 return name;
48 }
49
50 void TrafficModel::setName(Name const &_name)
51 {
52 name = _name;
53 Q_EMIT modifiedName();
54 }
55
56 TrafficInterface::Volumes * TrafficModel::getVolumes() const
57 {
58 return volumes;
59 }
60
61 TrafficInterface::PlatoonRates * TrafficModel::getPlatoonRates() const
62 {
63 return platoonRates;
64 }
65
66 TrafficInterface::Velocities * TrafficModel::getVelocities() const
67 {
68 return velocities;
69 }
70
71 TrafficInterface::Homogeneities * TrafficModel::getHomogeneities() const
72 {
73 return homogeneities;
74 }
75
76 TrafficInterface::TrafficAgents * TrafficModel::getAgentsRightMostLane() const
77 {
78 return agentsRightMostLane;
79 }
80
81 TrafficInterface::TrafficAgents * TrafficModel::getAgentsRegularLane() const
82 {
83 return agentsRegularLane;
84 }
85
86 void TrafficModel::setStatus(const Status &_status)
87 {
88 status = _status;
89 Q_EMIT modifiedStatus();
90 }
91
92 TrafficInterface::Status TrafficModel::getStatus() const
93 {
94 return status;
95 }
TrafficModel::getStatus
virtual Status getStatus() const override
Method which returns the current status of the traffic settings.
Definition: TrafficModel.cpp:92
TrafficModel::volumes
Volumes *const volumes
the map of traffic volumes
Definition: TrafficModel.h:54
TrafficModel::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const override
Returns the map for registering agent profiles for the rightmost lane.
Definition: TrafficModel.cpp:76
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficModel::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const override
Returns the map for registering platoon rates.
Definition: TrafficModel.cpp:61
TrafficInterface::Name
QString Name
The name of the traffic configuration.
Definition: TrafficInterface.h:46
TrafficModel::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const override
Returns the map for registering agent profiles for regular lanes.
Definition: TrafficModel.cpp:81
TrafficModel::setStatus
virtual void setStatus(Status const &_status) override
Method for setting the status of the traffic configuration to the value passed as an argument...
Definition: TrafficModel.cpp:86
TrafficModel::name
Name name
the name of the traffic configuration
Definition: TrafficModel.h:53
TrafficInterface::edited
void edited()
Signal, emitted when the traffic configuration has been edited.
TrafficInterface::Status
bool Status
Type characterizing the status of the environment settings.
Definition: TrafficInterface.h:52
TrafficModel::getVolumes
virtual Volumes * getVolumes() const override
Returns the map for registering traffic volumes.
Definition: TrafficModel.cpp:56
TrafficModel::status
Status status
the current status of the settings. "true" means that the configuration is principally ready for simu...
Definition: TrafficModel.h:60
TrafficModel::getName
virtual Name getName() const override
Returns the current name of the traffic setup.
Definition: TrafficModel.cpp:45
TrafficModel::setName
virtual void setName(Name const &_name) override
Sets the name of the traffic setup to the one passed as an argument.
Definition: TrafficModel.cpp:50
TrafficModel::agentsRightMostLane
TrafficAgents *const agentsRightMostLane
the map of traffic agents driving on the rightmost lane
Definition: TrafficModel.h:59
TrafficModel::agentsRegularLane
TrafficAgents *const agentsRegularLane
the map of traffic agents driving on regular lanes
Definition: TrafficModel.h:58
TrafficInterface::modifiedStatus
void modifiedStatus()
Signal, emitted when the traffic&#39;s status has changed.
TrafficItemMapModel
The TrafficItemMapModel class implements functionality of the TrafficItemMapInterface class...
Definition: TrafficItemMapModel.h:28
TrafficModel::platoonRates
PlatoonRates *const platoonRates
the map of platoon rates
Definition: TrafficModel.h:55
TrafficItemMapModel.h
The TrafficItemMapModel class implements functionality of the TrafficItemMapInterface class...
TrafficModel::getHomogeneities
virtual Homogeneities * getHomogeneities() const override
Returns the map for registering homogeneities.
Definition: TrafficModel.cpp:71
TrafficModel::velocities
Velocities *const velocities
the map of velocities
Definition: TrafficModel.h:56
TrafficInterface::modifiedName
void modifiedName()
Signal, emitted when the name of the traffic setup has been modified.
TrafficModel::homogeneities
Homogeneities *const homogeneities
the map of homogeneities
Definition: TrafficModel.h:57
TrafficModel::getVelocities
virtual Velocities * getVelocities() const override
Returns the map for registering velocities.
Definition: TrafficModel.cpp:66
TrafficModel.h
The TrafficModel class implements the functionality of the TrafficInterface class.
TrafficItemMapInterface::edited
void edited()
Signal emitted when traffic items are added to or removed from this map. It is also connected to the ...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficParametersPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
TrafficParametersPresenter.cpp
1 #include "TrafficParametersPresenter.h"
2
3 #include <iostream>
4
5 TrafficParametersPresenter::TrafficParametersPresenter(TrafficInterface * traffic,
6 TrafficParametersView * trafficParametersView,
7 QObject *parent)
8 : QObject(parent)
9 , traffic(traffic)
10 , trafficParametersView(trafficParametersView)
11 {
12 connect(trafficParametersView, &TrafficParametersView::addVolume, this, &TrafficParametersPresenter::addVolume);
13 connect(trafficParametersView, &TrafficParametersView::addPlatoonRate, this, &TrafficParametersPresenter::addPlatoonRate);
14 connect(trafficParametersView, &TrafficParametersView::addVelocity, this, &TrafficParametersPresenter::addVelocity);
15 connect(trafficParametersView, &TrafficParametersView::addHomogeneity, this, &TrafficParametersPresenter::addHomogeneity);
16
17 connect(trafficParametersView,&TrafficParametersView::remove, this, &TrafficParametersPresenter::removeTrafficItem);
18 connect(trafficParametersView,&TrafficParametersView::probabilityChanged, this, &TrafficParametersPresenter::setProbability);
19 connect(trafficParametersView,&TrafficParametersView::valueChanged, this, &TrafficParametersPresenter::setValue);
20 }
21
22
23 void TrafficParametersPresenter::addVolume()
24 {
25 unsigned int id = traffic->getVolumes()->generateID();
26 traffic->getVolumes()->add(id, default_volume);
27 trafficParametersView->addVolumeView(id, QString("%1").arg(default_volume), default_probability);
28
29 Q_EMIT volume_added();
30 }
31
32
33 void TrafficParametersPresenter::addPlatoonRate()
34 {
35 unsigned int id = traffic->getPlatoonRates()->generateID();
36 traffic->getPlatoonRates()->add(id, default_platoonRate);
37 trafficParametersView->addPlatoonRateView(id, QString("%1").arg(default_platoonRate), default_probability);
38
39 Q_EMIT platoonRate_added();
40 }
41
42 void TrafficParametersPresenter::addVelocity()
43 {
44 unsigned int id = traffic->getVelocities()->generateID();
45 traffic->getVelocities()->add(id, default_velocity);
46 trafficParametersView->addVelocityView(id, QString("%1").arg(default_velocity), default_probability);
47
48 Q_EMIT velocity_added();
49 }
50
51 void TrafficParametersPresenter::addHomogeneity()
52 {
53 unsigned int id = traffic->getHomogeneities()->generateID();
54 traffic->getHomogeneities()->add(id, default_homogeneity);
55 trafficParametersView->addHomogeneityView(id, QString("%1").arg(default_homogeneity), default_probability);
56
57 Q_EMIT homogeneity_added();
58 }
59
60
61 void TrafficParametersPresenter::removeTrafficItem(unsigned int id, TrafficItemView::Type type)
62 {
63 switch(type)
64 {
65 case TrafficItemView::Type::Volume:
66 {
67 if(traffic->getVolumes()->remove(id))
68 {
69 trafficParametersView->removeTrafficItemView(id, type);
70 Q_EMIT volume_removed();
71 }
72
73 break;
74 }
75 case TrafficItemView::Type::PlatoonRate:
76 {
77 if(traffic->getPlatoonRates()->remove(id))
78 {
79 trafficParametersView->removeTrafficItemView(id, type);
80 Q_EMIT platoonRate_removed();
81 }
82
83 break;
84 }
85 case TrafficItemView::Type::Velocity:
86 {
87 if(traffic->getVelocities()->remove(id))
88 {
89 trafficParametersView->removeTrafficItemView(id, type);
90 Q_EMIT velocity_removed();
91 }
92
93 break;
94 }
95 case TrafficItemView::Type::Homogeneity:
96 {
97 if(traffic->getHomogeneities()->remove(id))
98 {
99 trafficParametersView->removeTrafficItemView(id, type);
100 Q_EMIT homogeneity_removed();
101 }
102
103 break;
104 }
105 default:
106 break;
107 }
108 }
109
110
111 void TrafficParametersPresenter::setProbability(unsigned int id, double value, TrafficItemView::Type type)
112 {
113 switch(type)
114 {
115 case TrafficItemView::Type::Volume:
116 {
117 traffic->getVolumes()->getItem(id)->setProbability(value);
118 Q_EMIT volume_probabilityChanged();
119 break;
120 }
121 case TrafficItemView::Type::PlatoonRate:
122 {
123 traffic->getPlatoonRates()->getItem(id)->setProbability(value);
124 Q_EMIT platoonRate_probabilityChanged();
125 break;
126 }
127 case TrafficItemView::Type::Velocity:
128 {
129 traffic->getVelocities()->getItem(id)->setProbability(value);
130 Q_EMIT velocity_probabilityChanged();
131 break;
132 }
133 case TrafficItemView::Type::Homogeneity:
134 {
135 traffic->getHomogeneities()->getItem(id)->setProbability(value);
136 Q_EMIT homogeneity_probabilityChanged();
137 break;
138 }
139 default:
140 break;
141 }
142 }
143
144 void TrafficParametersPresenter::setValue(unsigned int id, QString value, TrafficItemView::Type type)
145 {
146 switch(type)
147 {
148 case TrafficItemView::Type::Volume:
149 {
150 traffic->getVolumes()->getItem(id)->setValue(value.toInt());
151 break;
152 }
153 case TrafficItemView::Type::PlatoonRate:
154 {
155 traffic->getPlatoonRates()->getItem(id)->setValue(value.toDouble());
156 break;
157 }
158 case TrafficItemView::Type::Velocity:
159 {
160 traffic->getVelocities()->getItem(id)->setValue(value.toDouble());
161 break;
162 }
163 case TrafficItemView::Type::Homogeneity:
164 {
165 traffic->getHomogeneities()->getItem(id)->setValue(value.toDouble());
166 break;
167 }
168 default:
169 break;
170 }
171 }
172
173 void TrafficParametersPresenter::updateView()
174 {
175 trafficParametersView->clearTrafficParametersView();
176 Q_EMIT cleared();
177
178 // Setup all volumes
179 TrafficItemMapInterface<int> * volumes = traffic->getVolumes();
180
181 for( TrafficItemInterface<int>* volume : volumes->values() )
182 {
183 TrafficItemMapInterface<int>::ID id = volumes->getID(volume);
184 int value = volume->getValue();
185 double probability = volume->getProbability();
186
187 trafficParametersView->addVolumeView(id, QString("%1").arg(value), probability);
188 Q_EMIT volume_added();
189 }
190
191 // Setup all platoon rates
192 TrafficItemMapInterface<double> * platoonRates = traffic->getPlatoonRates();
193
194 for( TrafficItemInterface<double>* platoonRate : platoonRates->values() )
195 {
196 TrafficItemMapInterface<double>::ID id = platoonRates->getID(platoonRate);
197 double value = platoonRate->getValue();
198 double probability = platoonRate->getProbability();
199
200 trafficParametersView->addPlatoonRateView(id, QString("%1").arg(value), probability);
201 Q_EMIT platoonRate_added();
202 }
203
204
205 // Setup all velocities
206 TrafficItemMapInterface<double> * velocities = traffic->getVelocities();
207
208 for( TrafficItemInterface<double>* velocity : velocities->values() )
209 {
210 TrafficItemMapInterface<double>::ID id = velocities->getID(velocity);
211 double value = velocity->getValue();
212 double probability = velocity->getProbability();
213
214 trafficParametersView->addVelocityView(id, QString("%1").arg(value), probability);
215 Q_EMIT velocity_added();
216 }
217
218 // Setup all homogeneities
219 TrafficItemMapInterface<double> * homogeneities = traffic->getHomogeneities();
220
221 for( TrafficItemInterface<double>* homogeneity : homogeneities->values() )
222 {
223 TrafficItemMapInterface<double>::ID id = homogeneities->getID(homogeneity);
224 double value = homogeneity->getValue();
225 double probability = homogeneity->getProbability();
226
227 trafficParametersView->addHomogeneityView(id, QString("%1").arg(value), probability);
228 Q_EMIT homogeneity_added();
229 }
230 }
231
232 void TrafficParametersPresenter::clearTrafficParameters()
233 {
234 trafficParametersView->clearTrafficParametersView();
235 Q_EMIT cleared();
236 }
TrafficParametersPresenter::volume_removed
void volume_removed()
Signal, emitted when a traffic volume has been removed from the model.
TrafficParametersPresenter::velocity_added
void velocity_added()
Signal, emitted when a velocity has been added to the model.
TrafficParametersPresenter::trafficParametersView
TrafficParametersView * trafficParametersView
a pointer to the editor widget whose user events are managed by this presenter
Definition: TrafficParametersPresenter.h:175
TrafficParametersView::addPlatoonRate
void addPlatoonRate()
Signal, emitted when the add-button in the platoon rates section has been pressed.
TrafficParametersPresenter::platoonRate_removed
void platoonRate_removed()
Signal, emitted when a platoon rate has been removed from the model.
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficInterface::getVelocities
virtual Velocities * getVelocities() const =0
Returns the map for registering velocities.
TrafficParametersPresenter::homogeneity_removed
void homogeneity_removed()
Signal, emitted when a homogeneity has been removed from the model.
TrafficParametersPresenter::addVelocity
void addVelocity()
Slot which is triggered when the add-button has been clicked in the velocities section of TrafficPara...
Definition: TrafficParametersPresenter.cpp:42
TrafficParametersPresenter::platoonRate_probabilityChanged
void platoonRate_probabilityChanged()
Signal, emitted when the probability of a platoon rate has been changed.
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficItemMapInterface::getID
virtual TrafficItemMapInterface::ID getID(TrafficItemMapInterface::Item *const item) const =0
Method which returns the ID of the given traffic item, if contained in the map. Returns Qt&#39;s default-...
TrafficParametersPresenter::homogeneity_added
void homogeneity_added()
Signal, emitted when a homogeneity has been added to the model.
TrafficParametersPresenter::setValue
void setValue(unsigned int id, QString value, TrafficItemView::Type type)
Slot which is triggered when the displayed value of a traffic item has been modified by the user...
Definition: TrafficParametersPresenter.cpp:144
TrafficParametersPresenter::removeTrafficItem
void removeTrafficItem(unsigned int id, TrafficItemView::Type type)
Slot which is triggered when the remove-button of some traffic item has been clicked. Removes the traffic item of the transmitted ID and type from the model and destroys the corresponding view.
Definition: TrafficParametersPresenter.cpp:61
TrafficParametersView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, TrafficItemView::Type type)
Signal, emitted when the probability of a traffic item has been modified. Transmits the ID...
TrafficInterface::getVolumes
virtual Volumes * getVolumes() const =0
Returns the map for registering traffic volumes.
TrafficParametersPresenter.h
This class defines the presenter object which handles events coming from the view (TrafficParametersV...
TrafficParametersView::valueChanged
void valueChanged(unsigned int ID, QString value, TrafficItemView::Type type)
Signal, emitted when the value of a traffic item has been modified. Transmits the ID...
TrafficParametersView::addHomogeneity
void addHomogeneity()
Signal, emitted when the add-button in the homogeneities section has been pressed.
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
TrafficParametersPresenter::addVolume
void addVolume()
Slot which is triggered when the add-button has been clicked in the volumes section of TrafficParamet...
Definition: TrafficParametersPresenter.cpp:23
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficItemView::Type
Type
Definition: TrafficItemView.h:35
TrafficInterface::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const =0
Returns the map for registering platoon rates.
TrafficParametersPresenter::addHomogeneity
void addHomogeneity()
Slot which is triggered when the add-button has been clicked in the homogeneities section of TrafficP...
Definition: TrafficParametersPresenter.cpp:51
TrafficInterface::getHomogeneities
virtual Homogeneities * getHomogeneities() const =0
Returns the map for registering homogeneities.
TrafficParametersPresenter::homogeneity_probabilityChanged
void homogeneity_probabilityChanged()
Signal, emitted when the probability of a homogeneity item has been changed.
TrafficParametersPresenter::velocity_probabilityChanged
void velocity_probabilityChanged()
Signal, emitted when the probability of a velocity item has been changed.
TrafficParametersPresenter::velocity_removed
void velocity_removed()
Signal, emitted when a velocity has been removed from the model.
TrafficParametersView::addVelocityView
void addVelocityView(unsigned int id, QString value, double probability)
Method which creates a view of a velocity using the given ID and inserts the view into the Velocities...
Definition: TrafficParametersView.cpp:73
TrafficParametersPresenter::cleared
void cleared()
Signal, emitted when a the entire configuration has been cleared in the model.
TrafficItemView::Type::Volume
An enum class defining the type of the traffic item.
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficParametersPresenter::addPlatoonRate
void addPlatoonRate()
Slot which is triggered when the add-button has been clicked in the platoon rates section of TrafficP...
Definition: TrafficParametersPresenter.cpp:33
TrafficParametersView::remove
void remove(unsigned int ID, TrafficItemView::Type type)
Signal, emitted when the remove button of a traffic parameter has been clicked. Transmits the ID and ...
TrafficItemMapInterface::remove
virtual bool remove(TrafficItemMapInterface::ID const &id)=0
Method which removes the traffic item registered under the given ID from the map. Afterwards...
TrafficParametersPresenter::updateView
void updateView()
Method which updates the whole TrafficParametersView widget to display the entire model configuration...
Definition: TrafficParametersPresenter.cpp:173
TrafficParametersView::addPlatoonRateView
void addPlatoonRateView(unsigned int id, QString value, double probability)
Method which creates a view of a platoon rate using the given ID and inserts the view into the Platoo...
Definition: TrafficParametersView.cpp:58
TrafficItemMapInterface::generateID
virtual TrafficItemMapInterface::ID generateID() const =0
Method which returns the highest unoccupied ID of the map.
TrafficParametersView::addVolume
void addVolume()
Signal, emitted when the add-button in the traffic volumes section has been pressed.
TrafficParametersView::clearTrafficParametersView
void clearTrafficParametersView()
Method which deletes all registered traffic parameter views and resizes the this editor widget to its...
Definition: TrafficParametersView.cpp:152
TrafficParametersView
This class defines the editor widget for traffic parameters and their probabilities.
Definition: TrafficParametersView.h:29
TrafficParametersView::addHomogeneityView
void addHomogeneityView(unsigned int id, QString value, double probability)
Method which creates a view of a homogeneity using the given ID and inserts the view into the Homogen...
Definition: TrafficParametersView.cpp:88
TrafficParametersPresenter::volume_added
void volume_added()
Signal, emitted when a traffic volume has been added to the model.
TrafficParametersView::addVolumeView
void addVolumeView(unsigned int id, QString value, double probability)
Method which creates a view of a traffic volume using the given ID and inserts the view into the Volu...
Definition: TrafficParametersView.cpp:43
TrafficParametersPresenter::platoonRate_added
void platoonRate_added()
Signal, emitted when a platoon rate has been added to the model.
TrafficItemMapInterface::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0
Method which creates a traffic item and registers it under the ID passed as a first argument...
TrafficParametersView::addVelocity
void addVelocity()
Signal, emitted when the add-button in the velocities section has been pressed.
TrafficItemInterface::setValue
virtual void setValue(Value const &_value)=0
Sets the traffic item&#39;s value to the value passed as an argument.
TrafficParametersPresenter::clearTrafficParameters
void clearTrafficParameters()
Slot which deletes all traffic item views.
Definition: TrafficParametersPresenter.cpp:232
TrafficParametersView::removeTrafficItemView
void removeTrafficItemView(unsigned int id, TrafficItemView::Type type)
Method which removes the view of a traffic item with the given ID and type. All item views lying belo...
Definition: TrafficParametersView.cpp:105
TrafficParametersPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model to be edited by this presenter
Definition: TrafficParametersPresenter.h:174
TrafficParametersPresenter::volume_probabilityChanged
void volume_probabilityChanged()
Signal, emitted when the probability of a traffic volume has been changed.
TrafficParametersPresenter::setProbability
void setProbability(unsigned int id, double value, TrafficItemView::Type type)
Slot which is triggered when the displayed probability value of a traffic item has been modified by t...
Definition: TrafficParametersPresenter.cpp:111
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficParametersView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficParametersView.cpp
1 #include "TrafficParametersView.h"
2
3 #include "ui_TrafficParametersView.h"
4
5 #include <QResizeEvent>
6 #include <QDoubleSpinBox>
7 #include <iostream>
8
9 TrafficParametersView::TrafficParametersView(QWidget *parent) :
10 WidgetView(parent),
11 ui(new Ui::TrafficParametersView)
12 {
13 ui->setupUi(this);
14 initialHeight = height();
15 }
16
17 TrafficParametersView::~TrafficParametersView()
18 {
19 delete ui;
20 }
21
22 void TrafficParametersView::on_addVolume_clicked()
23 {
24 Q_EMIT addVolume();
25 }
26
27 void TrafficParametersView::on_addPlatoonRate_clicked()
28 {
29 Q_EMIT addPlatoonRate();
30 }
31
32 void TrafficParametersView::on_addVelocity_clicked()
33 {
34 Q_EMIT addVelocity();
35 }
36
37 void TrafficParametersView::on_addHomogeneity_clicked()
38 {
39 Q_EMIT addHomogeneity();
40 }
41
42
43 void TrafficParametersView::addVolumeView(unsigned int id, QString value, double probability)
44 {
45 int index = ui->volumesLayout->count()+1;
46 TrafficItemView * volumeView = new TrafficItemView(TrafficItemView::Type::Volume, id, index, this);
47 volumeView->setValue(value);
48 volumeView->setProbability(probability);
49
50 connect(volumeView, &TrafficItemView::remove, this, &TrafficParametersView::remove);
51 connect(volumeView, &TrafficItemView::valueChanged, this, &TrafficParametersView::valueChanged);
52 connect(volumeView, &TrafficItemView::probabilityChanged, this, &TrafficParametersView::probabilityChanged);
53
54 resize(width(), height() + volumeView->height());
55 ui->volumesLayout->insertWidget(index-1, volumeView);
56 }
57
58 void TrafficParametersView::addPlatoonRateView(unsigned int id, QString value, double probability)
59 {
60 int index = ui->platoonRatesLayout->count()+1;
61 TrafficItemView * platoonRateView = new TrafficItemView(TrafficItemView::Type::PlatoonRate, id, index , this);
62 platoonRateView->setValue(value);
63 platoonRateView->setProbability(probability);
64
65 connect(platoonRateView, &TrafficItemView::remove, this, &TrafficParametersView::remove);
66 connect(platoonRateView, &TrafficItemView::valueChanged, this, &TrafficParametersView::valueChanged);
67 connect(platoonRateView, &TrafficItemView::probabilityChanged, this, &TrafficParametersView::probabilityChanged);
68
69 resize(width(), height() + platoonRateView->height());
70 ui->platoonRatesLayout->insertWidget(index, platoonRateView);
71 }
72
73 void TrafficParametersView::addVelocityView(unsigned int id, QString value, double probability)
74 {
75 int index = ui->velocitiesLayout->count()+1;
76 TrafficItemView * velocityView = new TrafficItemView(TrafficItemView::Type::Velocity, id, index, this);
77 velocityView->setValue(value);
78 velocityView->setProbability(probability);
79
80 connect(velocityView, &TrafficItemView::remove, this, &TrafficParametersView::remove);
81 connect(velocityView, &TrafficItemView::valueChanged, this, &TrafficParametersView::valueChanged);
82 connect(velocityView, &TrafficItemView::probabilityChanged, this, &TrafficParametersView::probabilityChanged);
83
84 ui->velocitiesLayout->insertWidget(index, velocityView);
85 resize(width(), height() + velocityView->height());
86 }
87
88 void TrafficParametersView::addHomogeneityView(unsigned int id, QString value, double probability)
89 {
90
91 int index = ui->homogeneitiesLayout->count()+1;
92 TrafficItemView * homogeneityView = new TrafficItemView(TrafficItemView::Type::Homogeneity, id, index, this);
93 homogeneityView->setValue(value);
94 homogeneityView->setProbability(probability);
95
96 connect(homogeneityView, &TrafficItemView::remove, this, &TrafficParametersView::remove);
97 connect(homogeneityView, &TrafficItemView::valueChanged, this, &TrafficParametersView::valueChanged);
98 connect(homogeneityView, &TrafficItemView::probabilityChanged, this, &TrafficParametersView::probabilityChanged);
99
100 ui->homogeneitiesLayout->insertWidget(index, homogeneityView);
101 resize(width(), height() + homogeneityView->height());
102 }
103
104
105 void TrafficParametersView::removeTrafficItemView(unsigned int id, TrafficItemView::Type type)
106 {
107 bool shift = false;
108
109 for(auto trafficItemView : findChildren<TrafficItemView*>())
110 {
111 if(trafficItemView->getType() == type )
112 {
113 if(shift)
114 trafficItemView->setIndex(trafficItemView->getIndex()-1);
115
116 if(trafficItemView->getID() == id )
117 {
118 resize(width(), height() - trafficItemView->height());
119 delete trafficItemView;
120 shift = true;
121 }
122 }
123 }
124 }
125
126
127 void TrafficParametersView::resizeEvent(QResizeEvent *event)
128 {
129 event->ignore();
130 Q_EMIT resized();
131 }
132
133 void TrafficParametersView::setProbability(unsigned int id, TrafficItemView::Type type, double value)
134 {
135 for(auto trafficItemView : findChildren<TrafficItemView*>())
136 {
137 if( trafficItemView->getType() == type && trafficItemView->getID() == id )
138 trafficItemView->setProbability(value);
139 }
140 }
141
142 void TrafficParametersView::setValue(unsigned int id, TrafficItemView::Type type, QString value)
143 {
144 for(auto trafficItemView : findChildren<TrafficItemView*>())
145 {
146 if( trafficItemView->getType() == type && trafficItemView->getID() == id )
147 trafficItemView->setValue(value);
148 }
149 }
150
151
152 void TrafficParametersView::clearTrafficParametersView()
153 {
154
155 qDeleteAll(findChildren<TrafficItemView*>());
156 resize(width(), initialHeight);
157 }
TrafficParametersView::setValue
void setValue(unsigned int id, TrafficItemView::Type type, QString value)
Method which sets the displayed value of the traffic parameter with the given id and type to the valu...
Definition: TrafficParametersView.cpp:142
TrafficParametersView::on_addVolume_clicked
void on_addVolume_clicked()
Qt Desinger-created slot activated when the add-button in the traffic volumes section has been clicke...
Definition: TrafficParametersView.cpp:22
TrafficParametersView::setProbability
void setProbability(unsigned int id, TrafficItemView::Type type, double value)
Method which sets the displayed probability value of the traffic parameter with the given id and type...
Definition: TrafficParametersView.cpp:133
TrafficParametersView::addPlatoonRate
void addPlatoonRate()
Signal, emitted when the add-button in the platoon rates section has been pressed.
TrafficItemView::setProbability
void setProbability(double value)
Method which sets the displayed probability of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:192
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
TrafficParametersView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, TrafficItemView::Type type)
Signal, emitted when the probability of a traffic item has been modified. Transmits the ID...
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficParametersView::ui
Ui::TrafficParametersView * ui
the ui object containing all visualization elements of this editor widget
Definition: TrafficParametersView.h:218
TrafficParametersView::valueChanged
void valueChanged(unsigned int ID, QString value, TrafficItemView::Type type)
Signal, emitted when the value of a traffic item has been modified. Transmits the ID...
TrafficItemView::remove
void remove(unsigned int ID, Type type)
Signal, emitted when remove button has been clicked. Transmits the ID and type of the traffic item...
TrafficParametersView::addHomogeneity
void addHomogeneity()
Signal, emitted when the add-button in the homogeneities section has been pressed.
TrafficItemView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, Type type)
Signal, emitted when probability of the traffic item has been modified by the user. Transmits the ID, probability value and type of the item.
TrafficParametersView::initialHeight
int initialHeight
the initial height of this editor widget
Definition: TrafficParametersView.h:219
TrafficItemView::Type
Type
Definition: TrafficItemView.h:35
TrafficParametersView.h
This class defines the editor widget for traffic parameters and their probabilities.
TrafficParametersView::resized
void resized()
Signal, emitted when this view has been resized.
TrafficParametersView::on_addVelocity_clicked
void on_addVelocity_clicked()
Qt Desinger-created slot activated when the add-button in the velocities section has been clicked...
Definition: TrafficParametersView.cpp:32
TrafficItemView::setValue
void setValue(QString value)
Method which sets the displayed value of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:158
TrafficParametersView::resizeEvent
void resizeEvent(QResizeEvent *event)
Reimplementation of the resize event. Emits the resized() signal.
Definition: TrafficParametersView.cpp:127
TrafficParametersView::addVelocityView
void addVelocityView(unsigned int id, QString value, double probability)
Method which creates a view of a velocity using the given ID and inserts the view into the Velocities...
Definition: TrafficParametersView.cpp:73
TrafficItemView::Type::Volume
An enum class defining the type of the traffic item.
TrafficParametersView::on_addHomogeneity_clicked
void on_addHomogeneity_clicked()
Qt Desinger-created slot activated when the add-button in the homogeneities section has been clicked...
Definition: TrafficParametersView.cpp:37
TrafficParametersView::remove
void remove(unsigned int ID, TrafficItemView::Type type)
Signal, emitted when the remove button of a traffic parameter has been clicked. Transmits the ID and ...
TrafficParametersView::addPlatoonRateView
void addPlatoonRateView(unsigned int id, QString value, double probability)
Method which creates a view of a platoon rate using the given ID and inserts the view into the Platoo...
Definition: TrafficParametersView.cpp:58
TrafficParametersView::addVolume
void addVolume()
Signal, emitted when the add-button in the traffic volumes section has been pressed.
TrafficParametersView::clearTrafficParametersView
void clearTrafficParametersView()
Method which deletes all registered traffic parameter views and resizes the this editor widget to its...
Definition: TrafficParametersView.cpp:152
TrafficParametersView
This class defines the editor widget for traffic parameters and their probabilities.
Definition: TrafficParametersView.h:29
TrafficParametersView::addHomogeneityView
void addHomogeneityView(unsigned int id, QString value, double probability)
Method which creates a view of a homogeneity using the given ID and inserts the view into the Homogen...
Definition: TrafficParametersView.cpp:88
TrafficItemView::valueChanged
void valueChanged(unsigned int ID, QString value, Type type)
Signal, emitted when the value of the traffic item has been changed. Transmits the ID...
TrafficParametersView::on_addPlatoonRate_clicked
void on_addPlatoonRate_clicked()
Qt Desinger-created slot activated when the add-button in the platoon rates section has been clicked...
Definition: TrafficParametersView.cpp:27
TrafficParametersView::addVolumeView
void addVolumeView(unsigned int id, QString value, double probability)
Method which creates a view of a traffic volume using the given ID and inserts the view into the Volu...
Definition: TrafficParametersView.cpp:43
TrafficParametersView::addVelocity
void addVelocity()
Signal, emitted when the add-button in the velocities section has been pressed.
TrafficParametersView::removeTrafficItemView
void removeTrafficItemView(unsigned int id, TrafficItemView::Type type)
Method which removes the view of a traffic item with the given ID and type. All item views lying belo...
Definition: TrafficParametersView.cpp:105
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
TrafficPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficPresenter.h"
12
13 #include "DelegateComboBoxView.h"
14 #include "DelegateDoubleView.h"
15
16 QString const TrafficPresenter::default_volume = "600";
17 QString const TrafficPresenter::default_platoonRate = "0.50";
18 QString const TrafficPresenter::default_velocity = "90";
19 QString const TrafficPresenter::default_homogeneity = "0.80";
20 double const TrafficPresenter::default_probability = 0.5;
21
22 TrafficPresenter::TrafficPresenter(TrafficInterface * const traffic,
23 TrafficView * const trafficView,
24 QList<QString> * const agentList,
25 QUndoStack * const undoStack,
26 QObject *parent)
27 : QObject(parent)
28 , traffic(traffic)
29 , trafficView(trafficView)
30 , volumes(new TrafficItemMapPresenter(traffic->getVolumes(),this))
31 , platoonRates(new TrafficItemMapPresenter(traffic->getPlatoonRates(),this))
32 , velocities(new TrafficItemMapPresenter(traffic->getVelocities(),this))
33 , homogeneities(new TrafficItemMapPresenter(traffic->getHomogeneities(),this))
34 , regularLaneAgents(new TrafficItemMapPresenter(traffic->getAgentsRegularLane(),this))
35 , rightmostLaneAgents(new TrafficItemMapPresenter(traffic->getAgentsRightMostLane(),this))
36 , agentList(agentList)
37 , undoStack(undoStack)
38 {
39 setupVolumes();
40 setupPlatoonRates();
41 setupVelocities();
42 setupHomogeneities();
43
44 setupRegularLaneAgents();
45 setupRightmostLaneAgents();
46
47 connect(trafficView, &TrafficView::modifiedName, this, &TrafficPresenter::setName);
48 connect(traffic, &TrafficInterface::edited, this, &TrafficPresenter::checkProbabilities);
49 connect(traffic, &TrafficInterface::edited, this, &TrafficPresenter::checkAgents);
50 }
51
52 void TrafficPresenter::checkProbabilities()
53 {
54 // 1. Check probabilities for volumes
55 double sum = 0;
56 for( auto item : traffic->getVolumes()->values() )
57 sum += item->getProbability();
58
59 trafficView->setVolumes_ProbabilityError( sum!=1.0 && traffic->getVolumes()->count()!= 0 );
60
61 // 2. Check probabilities for platoon rates
62 sum = 0;
63 for( auto item : traffic->getPlatoonRates()->values() )
64 sum += item->getProbability();
65
66 trafficView->setPlatoonRates_ProbabilityError(sum!=1.0 && traffic->getPlatoonRates()->count()!= 0 );
67
68 // 3. Check probabilities for velocities
69 sum = 0;
70 for( auto item : traffic->getVelocities()->values() )
71 sum += item->getProbability();
72
73 trafficView->setVelocities_ProbabilityError(sum!=1.0 && traffic->getVelocities()->count()!= 0 );
74
75 // 4. Check probabilities for homogeneities
76 sum = 0;
77 for( auto item : traffic->getHomogeneities()->values() )
78 sum += item->getProbability();
79
80 trafficView->setHomogeneities_ProbabilityError(sum!=1.0 && traffic->getHomogeneities()->count()!= 0 );
81
82
83 // 5. Check probabilities for regular lane agents
84 sum = 0;
85 for( auto item : traffic->getAgentsRegularLane()->values() )
86 sum += item->getProbability();
87
88 trafficView->setRegularLane_ProbabilityError(sum!=1.0 && traffic->getAgentsRegularLane()->count()!= 0 );
89
90 // 6. Check probabilities for rightmost lane agents
91 sum = 0;
92 for( auto item : traffic->getAgentsRightMostLane()->values() )
93 sum += item->getProbability();
94
95 trafficView->setRightmostLane_ProbabilityError(sum!=1.0 && traffic->getAgentsRightMostLane()->count()!= 0 );
96 }
97
98
99 void TrafficPresenter::setName(const QString &name)
100 {
101 if(traffic->getName() != name)
102 undoStack->push(new EditTrafficName(traffic, trafficView, name));
103 }
104
105 void TrafficPresenter::addVolume()
106 {
107 undoStack->push(new AddTrafficItem(volumes, default_volume, default_probability, "traffic volumes table"));
108 }
109
110 void TrafficPresenter::removeVolume(const int &row)
111 {
112 if(volumes->rowCount() != 0)
113 undoStack->push(new RemoveTrafficItem(volumes, row, "traffic volumes table"));
114 }
115
116 void TrafficPresenter::addPlatoonRate()
117 {
118 undoStack->push(new AddTrafficItem(platoonRates, default_platoonRate, default_probability, "platoon rates table"));
119 }
120
121 void TrafficPresenter::removePlatoonRate(const int &row)
122 {
123 if(platoonRates->rowCount() != 0)
124 undoStack->push(new RemoveTrafficItem(platoonRates, row, "platoon rates table"));
125 }
126
127 void TrafficPresenter::addVelocity()
128 {
129 undoStack->push(new AddTrafficItem(velocities, default_velocity, default_probability, "velocities table"));
130 }
131
132 void TrafficPresenter::removeVelocity(const int &row)
133 {
134 if(velocities->rowCount() != 0)
135 undoStack->push(new RemoveTrafficItem(velocities, row, "velocities table"));
136 }
137
138 void TrafficPresenter::addHomogeneity()
139 {
140 undoStack->push(new AddTrafficItem(homogeneities, default_homogeneity, default_probability, "homogeneities table"));
141 }
142
143 void TrafficPresenter::removeHomogeneity(const int &row)
144 {
145 if(homogeneities->rowCount() != 0)
146 undoStack->push(new RemoveTrafficItem(homogeneities, row, "homogeneities table"));
147 }
148
149 void TrafficPresenter::addRegularLaneAgent()
150 {
151 if( !agentList->isEmpty() )
152 undoStack->push(new AddTrafficItem(regularLaneAgents, agentList->first(), default_probability, "regular lane agents table"));
153 }
154
155 void TrafficPresenter::removeRegularLaneAgent(const int &row)
156 {
157 if(regularLaneAgents->rowCount() != 0)
158 undoStack->push(new RemoveTrafficItem(regularLaneAgents, row, "regular lane agents table"));
159 }
160
161 void TrafficPresenter::addRightmostLaneAgent()
162 {
163 if( !agentList->isEmpty() )
164 undoStack->push(new AddTrafficItem(rightmostLaneAgents, agentList->first(), default_probability, "rightmost lane agents table"));
165 }
166
167 void TrafficPresenter::removeRightmostLaneAgent(const int &row)
168 {
169 if(rightmostLaneAgents->rowCount() != 0)
170 undoStack->push(new RemoveTrafficItem(rightmostLaneAgents, row, "rightmost lane agents table"));
171 }
172
173 void TrafficPresenter::setupVolumes()
174 {
175 QTableView *volumesView = trafficView->getVolumesView();
176 volumesView->setModel(volumes);
177 volumes->setObjectName("volumesTable");
178 volumesView->setItemDelegateForColumn(0, new DelegateDoubleView(0, 3000, 100, 0,"traffic volume's", undoStack, this));
179 volumesView->setItemDelegateForColumn(1, new DelegateDoubleView(0, 1, 0.1, 2, "traffic volume's probability",undoStack, this));
180
181 connect(trafficView, &TrafficView::addVolume, this, &TrafficPresenter::addVolume);
182 connect(trafficView, &TrafficView::removeVolume, this, &TrafficPresenter::removeVolume);
183 }
184
185 void TrafficPresenter::setupPlatoonRates()
186 {
187 QTableView *platoonRatesView = trafficView->getPlatoonRatesView();
188 platoonRatesView->setModel(platoonRates);
189 platoonRates->setObjectName("platoonRatesTable");
190 platoonRatesView->setItemDelegateForColumn(0, new DelegateDoubleView(0, 1, 0.1, 2,"platoon rate's", undoStack, this));
191 platoonRatesView->setItemDelegateForColumn(1, new DelegateDoubleView(0, 1, 0.1, 2, "platoon rate's probability", undoStack, this));
192
193 connect(trafficView, &TrafficView::addPlatoonRate, this, &TrafficPresenter::addPlatoonRate);
194 connect(trafficView, &TrafficView::removePlatoonRate, this, &TrafficPresenter::removePlatoonRate);
195 }
196
197 void TrafficPresenter::setupVelocities()
198 {
199 QTableView *velicitiesView = trafficView->getVelocitiesView();
200 velicitiesView->setModel(velocities);
201 velocities->setObjectName("velocitiesTable");
202 velicitiesView->setItemDelegateForColumn(0, new DelegateDoubleView(0, 250, 10, 0,"velocity's", undoStack, this));
203 velicitiesView->setItemDelegateForColumn(1, new DelegateDoubleView(0, 1, 0.1, 2, "velocity's probability", undoStack, this));
204
205 connect(trafficView, &TrafficView::addVelocity, this, &TrafficPresenter::addVelocity);
206 connect(trafficView, &TrafficView::removeVelocity, this, &TrafficPresenter::removeVelocity);
207 }
208
209 void TrafficPresenter::setupHomogeneities()
210 {
211 QTableView *homogeneitiesView = trafficView->getHomogeneitiesView();
212 homogeneitiesView->setModel(homogeneities);
213 homogeneities->setObjectName("homogeneitiesTable");
214 homogeneitiesView->setItemDelegateForColumn(0, new DelegateDoubleView(0, 1, 0.1, 2, "homogeneity's", undoStack,this));
215 homogeneitiesView->setItemDelegateForColumn(1, new DelegateDoubleView(0, 1, 0.1, 2, "homogeneity's probability", undoStack, this));
216
217 connect(trafficView, &TrafficView::addHomogeneity, this, &TrafficPresenter::addHomogeneity);
218 connect(trafficView, &TrafficView::removeHomogeneity, this, &TrafficPresenter::removeHomogeneity);
219 }
220
221 void TrafficPresenter::setupRegularLaneAgents()
222 {
223 QTableView *regularLaneAgentsView = trafficView->getRegularLaneAgentsView();
224 regularLaneAgentsView->setModel(regularLaneAgents);
225 regularLaneAgents->setObjectName("regularLaneAgentsTable");
226 regularLaneAgentsView->setItemDelegateForColumn(0, new DelegateComboBoxView(agentList, "regular lane agent's", undoStack, this) );
227 regularLaneAgentsView->setItemDelegateForColumn(1, new DelegateDoubleView(0, 1, 0.1, 2, "regular lane agent's probability", undoStack, this));
228
229 connect(trafficView, &TrafficView::addRegularLaneAgent, this, &TrafficPresenter::addRegularLaneAgent);
230 connect(trafficView, &TrafficView::removeRegularLaneAgent, this, &TrafficPresenter::removeRegularLaneAgent);
231 }
232
233 void TrafficPresenter::setupRightmostLaneAgents()
234 {
235 QTableView *rightmostLaneAgentsView = trafficView->getRightmostLaneAgentsView();
236 rightmostLaneAgentsView->setModel(rightmostLaneAgents);
237 rightmostLaneAgents->setObjectName("rightmostLaneAgentsTable");
238 rightmostLaneAgentsView->setItemDelegateForColumn(0, new DelegateComboBoxView(agentList, "rightmost lane agent's", undoStack, this) );
239 rightmostLaneAgentsView->setItemDelegateForColumn(1, new DelegateDoubleView(0, 1, 0.1, 2, "rightmost lane agent's probability", undoStack, this));
240
241 connect(trafficView, &TrafficView::addRightmostLaneAgent, this, &TrafficPresenter::addRightmostLaneAgent);
242 connect(trafficView, &TrafficView::removeRightmostLaneAgent, this, &TrafficPresenter::removeRightmostLaneAgent);
243 }
244
245 void TrafficPresenter::checkAgents()
246 {
247 // determine list of all used agent profiles
248 QList<TrafficItemInterface*> allAgents = traffic->getAgentsRegularLane()->values()
249 + traffic->getAgentsRightMostLane()->values();
250
251 trafficView->setAgentProfilesError("");
252
253 // check whether used agent profiles are contained in the agentList!
254 // (agentList contains all defined agent profiles in the profiles catalogue)
255 for(auto agent : allAgents)
256 {
257 TrafficItemInterface::Value name = agent->getValue();
258 if(!agentList->contains(name))
259 {
260 trafficView->setAgentProfilesError("Agent Profiles inconsistent with Profiles Catalogue!");
261 break;
262 }
263 }
264 }
265
266 void TrafficPresenter::updateView()
267 {
268 trafficView->setName(traffic->getName());
269 volumes->update();
270 platoonRates->update();
271 velocities->update();
272 homogeneities->update();
273
274 regularLaneAgents->update();
275 rightmostLaneAgents->update();
276
277 checkAgents();
278 }
279
280 AddTrafficItem::AddTrafficItem(TrafficItemMapPresenter * const table,
281 QString const default_value,
282 const double default_probability,
283 QString tableName,
284 QUndoCommand * parent)
285 : QUndoCommand (parent)
286 , table(table)
287 , default_value(default_value)
288 , default_probability(default_probability)
289 {
290 setText(QString("added entry to %1").arg(tableName));
291 }
292
293
294 void AddTrafficItem::redo()
295 {
296 table->addRow(table->rowCount(), default_value, default_probability);
297 }
298
299 void AddTrafficItem::undo()
300 {
301 table->removeRow(table->rowCount()-1);
302 }
303
304 RemoveTrafficItem::RemoveTrafficItem(TrafficItemMapPresenter * const table,
305 int const row,
306 QString tableName,
307 QUndoCommand * parent)
308 : QUndoCommand (parent)
309 , table(table)
310 , row(row)
311 , value(table->data( table->index(row, 0) ).toString())
312 , probability(table->data( table->index(row, 1) ).toDouble())
313 {
314 setText(QString("removed entry from %1").arg(tableName));
315 }
316
317 void RemoveTrafficItem::redo()
318 {
319 table->removeRow(row);
320 }
321
322 void RemoveTrafficItem::undo()
323 {
324 table->addRow(row, value, probability);
325 }
326
327 EditTrafficName::EditTrafficName(TrafficInterface * const traffic,
328 TrafficView * const trafficView,
329 TrafficInterface::Name const &newName,
330 QUndoCommand * parent)
331 : QUndoCommand (parent)
332 , traffic(traffic)
333 , trafficView(trafficView)
334 , newName(newName)
335 , oldName(traffic->getName())
336 {
337 setText("edited environment name");
338 }
339
340 void EditTrafficName::redo()
341 {
342 traffic->setName(newName);
343 trafficView->setName(newName);
344 }
345
346 void EditTrafficName::undo()
347 {
348 traffic->setName(oldName);
349 trafficView->setName(oldName);
350 }
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
TrafficPresenter::addRegularLaneAgent
void addRegularLaneAgent()
Slot is connected to the TrafficView::addRegularLaneAgent signal. Calls the TrafficItemMapPresenter::...
Definition: TrafficPresenter.cpp:149
TrafficPresenter::default_homogeneity
static QString const default_homogeneity
a default value for the homogeneity
Definition: TrafficPresenter.h:258
TrafficPresenter::volumes
TrafficItemMapPresenter *const volumes
a pointer to the presenter object connecting the traffic volumes map to its table view ...
Definition: TrafficPresenter.h:247
TrafficPresenter::setName
void setName(QString const &name)
Slot which is connected to the TrafficView::modifiedName signal. Sets the traffic configuration&#39;s nam...
Definition: TrafficPresenter.cpp:99
TrafficView::addPlatoonRate
void addPlatoonRate()
Signal emitted when add-button above the platoon rates table is clicked.
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficInterface::getVelocities
virtual Velocities * getVelocities() const =0
Returns the map for registering velocities.
TrafficPresenter::default_volume
static QString const default_volume
a default value for the traffic volume
Definition: TrafficPresenter.h:255
TrafficPresenter::homogeneities
TrafficItemMapPresenter *const homogeneities
a pointer to the presenter object connecting the homogeneities map to its table view ...
Definition: TrafficPresenter.h:250
TrafficView::setVolumes_ProbabilityError
void setVolumes_ProbabilityError(bool error)
Method which displays a probability error message for the table of traffic volumes if the boolian arg...
Definition: TrafficView.cpp:170
TrafficPresenter::addVelocity
void addVelocity()
Slot is connected to the TrafficView::addVelocity signal. Calls the TrafficItemMapPresenter::addRow m...
Definition: TrafficPresenter.cpp:127
TrafficView::removeVolume
void removeVolume(const int &row)
Signal emitted when remove-button above the traffic volume table is clicked. Transmits the currently ...
TrafficItemMapPresenter::addRow
void addRow(const int &row, TrafficItemInterface::Value const &value, TrafficItemInterface::Probability const &probability)
Method that adds a new row, i.e. a new environment item to the edited component.
Definition: TrafficItemMapPresenter.cpp:108
TrafficInterface::Name
QString Name
The name of the traffic configuration.
Definition: TrafficInterface.h:46
TrafficPresenter::setupRightmostLaneAgents
void setupRightmostLaneAgents()
An initializer method which configures the table view of the rightmost lane agents map...
Definition: TrafficPresenter.cpp:233
TrafficInterface::getVolumes
virtual Volumes * getVolumes() const =0
Returns the map for registering traffic volumes.
TrafficPresenter::regularLaneAgents
TrafficItemMapPresenter *const regularLaneAgents
a pointer to the presenter object connecting the regular lane agents map to its table view ...
Definition: TrafficPresenter.h:251
TrafficPresenter::agentList
QList< QString > *const agentList
a pointer to the list of available agent profiles (defined in a ProfilesCatalog.xml) ...
Definition: TrafficPresenter.h:262
TrafficView::removeRightmostLaneAgent
void removeRightmostLaneAgent(const int &row)
Signal emitted when remove-button above the rightmost lane agents table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter).
TrafficPresenter::platoonRates
TrafficItemMapPresenter *const platoonRates
a pointer to the presenter object connecting the platoon rates map to its table view ...
Definition: TrafficPresenter.h:248
TrafficItemInterface::Value
QString Value
the datatype for the traffic parameter&#39;s value (generally a string)
Definition: TrafficItemInterface.h:42
TrafficInterface::edited
void edited()
Signal, emitted when the traffic configuration has been edited.
TrafficView::getVelocitiesView
QTableView * getVelocitiesView() const
Method which provides access to the table view displaying velocities.
Definition: TrafficView.cpp:63
TrafficPresenter::traffic
TrafficInterface *const traffic
a pointer to the model of the traffic configuration
Definition: TrafficPresenter.h:243
TrafficPresenter::addPlatoonRate
void addPlatoonRate()
Slot is connected to the TrafficView::addPlatoonRate signal. Calls the TrafficItemMapPresenter::addRo...
Definition: TrafficPresenter.cpp:116
TrafficPresenter::setupVolumes
void setupVolumes()
An initializer method which configures the table view of the traffic volumes map. Creates the table&#39;s...
Definition: TrafficPresenter.cpp:173
TrafficView::removePlatoonRate
void removePlatoonRate(const int &row)
Signal emitted when remove-button above the platoon rates table is clicked. Transmits the currently s...
TrafficPresenter::addRightmostLaneAgent
void addRightmostLaneAgent()
Slot is connected to the TrafficView::addRightmostLaneAgent signal. Calls the TrafficItemMapPresenter...
Definition: TrafficPresenter.cpp:161
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
TrafficPresenter::setupVelocities
void setupVelocities()
An initializer method which configures the table view of the velocities map. Creates the table&#39;s pres...
Definition: TrafficPresenter.cpp:197
TrafficView::setRightmostLane_ProbabilityError
void setRightmostLane_ProbabilityError(bool error)
Method which displays a probability error message for the table of rightmost lane agents if the booli...
Definition: TrafficView.cpp:202
TrafficView::addVolume
void addVolume()
Signal emitted when add-button above the traffic volume table is clicked.
TrafficInterface::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const =0
Returns the map for registering platoon rates.
TrafficView::setVelocities_ProbabilityError
void setVelocities_ProbabilityError(bool error)
Method which displays a probability error message for the table of velocities if the boolian argument...
Definition: TrafficView.cpp:162
TrafficPresenter::setupPlatoonRates
void setupPlatoonRates()
An initializer method which configures the table view of the platoon rates map. Creates the table&#39;s p...
Definition: TrafficPresenter.cpp:185
TrafficPresenter::setupRegularLaneAgents
void setupRegularLaneAgents()
An initializer method which configures the table view of the regular lane agents map. Creates the table&#39;s presenter object (TrafficItemMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.
Definition: TrafficPresenter.cpp:221
TrafficPresenter::default_velocity
static QString const default_velocity
a default value for the velocity
Definition: TrafficPresenter.h:257
TrafficPresenter::trafficView
TrafficView *const trafficView
a pointer to the view of the traffic configuration
Definition: TrafficPresenter.h:244
TrafficView::getRightmostLaneAgentsView
QTableView * getRightmostLaneAgentsView() const
Method which provides access to the table view displaying rightmost lane agents.
Definition: TrafficView.cpp:83
TrafficInterface::getHomogeneities
virtual Homogeneities * getHomogeneities() const =0
Returns the map for registering homogeneities.
TrafficView::addRegularLaneAgent
void addRegularLaneAgent()
Signal emitted when add-button above the regular lane agents table is clicked.
TrafficPresenter::rightmostLaneAgents
TrafficItemMapPresenter *const rightmostLaneAgents
a pointer to the presenter object connecting the rightmost lane agents map to its table view ...
Definition: TrafficPresenter.h:252
TrafficView::setRegularLane_ProbabilityError
void setRegularLane_ProbabilityError(bool error)
Method which displays a probability error message for the table of regular lane agents if the boolian...
Definition: TrafficView.cpp:194
TrafficPresenter.h
This class defines the presenter object which handles user events coming from the view (TrafficView) ...
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
TrafficItemMapInterface::count
virtual int count() const =0
Method which returns the number of items registered in the map.
TrafficInterface::setName
virtual void setName(Name const &_name)=0
Sets the name of the traffic setup to the one passed as an argument.
TrafficPresenter::default_probability
static double const default_probability
a default value for a selection probability
Definition: TrafficPresenter.h:259
TrafficPresenter::removePlatoonRate
void removePlatoonRate(const int &row)
Slot which is connected to the TrafficView::removePlatoonRate signal. Calls the EnvironmentMapPresent...
Definition: TrafficPresenter.cpp:121
TrafficPresenter::default_platoonRate
static QString const default_platoonRate
a default value for the platoon rate
Definition: TrafficPresenter.h:256
RemoveTrafficItem
Command class for removing rows from the table of traffic settings.
Definition: TrafficPresenter.h:296
TrafficPresenter::setupHomogeneities
void setupHomogeneities()
An initializer method which configures the table view of the homogeneities map. Creates the table&#39;s p...
Definition: TrafficPresenter.cpp:209
AddTrafficItem
Command class for adding rows to the table of traffic settings.
Definition: TrafficPresenter.h:272
TrafficPresenter::removeRightmostLaneAgent
void removeRightmostLaneAgent(const int &row)
Slot which is connected to the TrafficView::removeRightmostLaneAgent signal. Calls the EnvironmentMap...
Definition: TrafficPresenter.cpp:167
TrafficInterface::getName
virtual Name getName() const =0
Returns the current name of the traffic setup.
TrafficItemMapPresenter
This class describes the presenter objects of the traffic parameter maps.
Definition: TrafficItemMapPresenter.h:48
TrafficPresenter::checkAgents
void checkAgents()
Slot which is connected, with the TrafficInterface::edited signal in order to check whether all selec...
Definition: TrafficPresenter.cpp:245
TrafficView::getRegularLaneAgentsView
QTableView * getRegularLaneAgentsView() const
Method which provides access to the table view displaying regular lane agents.
Definition: TrafficView.cpp:78
TrafficPresenter::updateView
void updateView()
Method which updates the view (TrafficView) to the current state of the model (TrafficModel / Traffic...
Definition: TrafficPresenter.cpp:266
TrafficPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficPresenter.h:265
TrafficItemMapPresenter::removeRow
bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: TrafficItemMapPresenter.cpp:125
TrafficPresenter::removeVolume
void removeVolume(const int &row)
Slot which is connected to the TrafficView::removeVolume signal. Calls the EnvironmentMapPresenter::r...
Definition: TrafficPresenter.cpp:110
EditTrafficName
Command class for editing the traffic&#39;s name.
Definition: TrafficPresenter.h:321
TrafficView::removeHomogeneity
void removeHomogeneity(const int &row)
Signal emitted when remove-button above the homogeneities table is clicked. Transmits the currently s...
TrafficPresenter::addHomogeneity
void addHomogeneity()
Slot is connected to the TrafficView::addHomogeneity signal. Calls the TrafficItemMapPresenter::addRo...
Definition: TrafficPresenter.cpp:138
TrafficView::getPlatoonRatesView
QTableView * getPlatoonRatesView() const
Method which provides access to the table view displaying platoon rates.
Definition: TrafficView.cpp:68
TrafficView::getVolumesView
QTableView * getVolumesView() const
Method which provides access to the table view displaying traffic volumes.
Definition: TrafficView.cpp:58
TrafficView::setName
void setName(QString const &_name)
Method which sets the traffic configuration&#39;s name to the one passed as an argument.
Definition: TrafficView.cpp:47
TrafficView::setAgentProfilesError
void setAgentProfilesError(QString const &message)
Method which displays a an error message concerning agent profiles.
Definition: TrafficView.cpp:210
TrafficView::modifiedName
void modifiedName(QString const &_name)
Signal emitted when the name of the traffic has been modified by the user. Transmits the new name to ...
TrafficPresenter::removeHomogeneity
void removeHomogeneity(const int &row)
Slot which is connected to the TrafficView::removeHomogeneity signal. Calls the EnvironmentMapPresent...
Definition: TrafficPresenter.cpp:143
TrafficView::setHomogeneities_ProbabilityError
void setHomogeneities_ProbabilityError(bool error)
Method which displays a probability error message for the table of homogeneities if the boolian argum...
Definition: TrafficView.cpp:186
TrafficPresenter::removeVelocity
void removeVelocity(const int &row)
Slot which is connected to the TrafficView::removeVelocity signal. Calls the EnvironmentMapPresenter:...
Definition: TrafficPresenter.cpp:132
TrafficView::getHomogeneitiesView
QTableView * getHomogeneitiesView() const
Method which provides access to the table view displaying homogeneities.
Definition: TrafficView.cpp:73
TrafficView
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content s...
Definition: TrafficView.h:43
TrafficView::removeVelocity
void removeVelocity(const int &row)
Signal emitted when remove-button above the velocities table is clicked. Transmits the currently sele...
TrafficView::removeRegularLaneAgent
void removeRegularLaneAgent(const int &row)
Signal emitted when remove-button above the regular lane agents table is clicked. Transmits the curre...
TrafficPresenter::removeRegularLaneAgent
void removeRegularLaneAgent(const int &row)
Slot which is connected to the TrafficView::removeRegularLaneAgent signal. Calls the EnvironmentMapPr...
Definition: TrafficPresenter.cpp:155
TrafficView::addVelocity
void addVelocity()
Signal emitted when add-button above the velocities table is clicked.
TrafficItemMapPresenter::update
void update()
Method which updates the table according to the current entries of #environmentMap.
Definition: TrafficItemMapPresenter.cpp:145
TrafficPresenter::velocities
TrafficItemMapPresenter *const velocities
a pointer to the presenter object connecting the velocities map to its table view ...
Definition: TrafficPresenter.h:249
TrafficPresenter::checkProbabilities
void checkProbabilities()
Slot which is connected, with the TrafficInterface::edited signal in order to check the probability s...
Definition: TrafficPresenter.cpp:52
TrafficPresenter::addVolume
void addVolume()
Slot is connected to the TrafficView::addVolume signal. Calls the TrafficItemMapPresenter::addRow met...
Definition: TrafficPresenter.cpp:105
TrafficView::setPlatoonRates_ProbabilityError
void setPlatoonRates_ProbabilityError(bool error)
Method which displays a probability error message for the table of platoon rates if the boolian argum...
Definition: TrafficView.cpp:178
TrafficItemMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: TrafficItemMapPresenter.cpp:32
TrafficView::addHomogeneity
void addHomogeneity()
Signal emitted when add-button above the homogeneities table is clicked.
TrafficView::addRightmostLaneAgent
void addRightmostLaneAgent()
Signal emitted when add-button above the rigthmost lane agents table is clicked.
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficSimulationModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficSimulationModel.h"
12
13 TrafficSimulationModel::TrafficSimulationModel(QObject * const parent)
14 : TrafficSimulationInterface(parent)
15 , experiment(new ExperimentModel(this))
16 , environment( new EnvironmentModel(this))
17 , scenario(new ScenarioModel(this))
18 , traffic( new TrafficModel(this))
19 , profilesCatalogue("")
20 {
21 }
22
23
24 ExperimentInterface * TrafficSimulationModel::getExperiment() const
25 {
26 return experiment;
27 }
28
29 EnvironmentInterface * TrafficSimulationModel::getEnvironment() const
30 {
31 return environment;
32 }
33
34 ScenarioInterface * TrafficSimulationModel::getScenario() const
35 {
36 return scenario;
37 }
38
39 TrafficInterface * TrafficSimulationModel::getTraffic() const
40 {
41 return traffic;
42 }
43
44 TrafficSimulationInterface::ProfilesCatalogue TrafficSimulationModel::getProfilesCatalogue() const
45 {
46 return profilesCatalogue;
47 }
48
49 void TrafficSimulationModel::setProfilesCatalogue(const ProfilesCatalogue &_profilesCatalogue)
50 {
51 profilesCatalogue = _profilesCatalogue;
52 }
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficSimulationModel::getTraffic
virtual TrafficInterface * getTraffic() const override
Returns the pointer to the traffic configuration object, i.e. an instance of the TrafficInterface cla...
Definition: TrafficSimulationModel.cpp:39
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
TrafficSimulationModel::getScenario
virtual ScenarioInterface * getScenario() const override
Returns the pointer to the scenario configuration object, i.e. an instance of the ScenarioInterface c...
Definition: TrafficSimulationModel.cpp:34
TrafficSimulationModel::getEnvironment
virtual EnvironmentInterface * getEnvironment() const override
Returns the pointer to the environment configuration object, i.e. an instance of the EnvironmentInter...
Definition: TrafficSimulationModel.cpp:29
TrafficModel
The TrafficModel class implements the functionality of the TrafficInterface class.
Definition: TrafficModel.h:27
ExperimentModel
The ExperimentModel class implements the functionality of the ExperimentInterface class...
Definition: ExperimentModel.h:29
TrafficSimulationModel::getProfilesCatalogue
virtual ProfilesCatalogue getProfilesCatalogue() const override
Returns the current profiles catalogue.
Definition: TrafficSimulationModel.cpp:44
TrafficSimulationInterface
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
Definition: TrafficSimulationInterface.h:37
TrafficSimulationModel.h
The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class...
EnvironmentModel
The Environment Model implements the functionality of the EnvironmentInterface class.
Definition: EnvironmentModel.h:29
ScenarioModel
The Scenario Model class implements the functionality of the ScenarioItemInterface class...
Definition: ScenarioModel.h:27
TrafficSimulationModel::setProfilesCatalogue
virtual void setProfilesCatalogue(ProfilesCatalogue const &_profilesCatalogue) override
Sets the current profiles catalogue to the one passed as an argument.
Definition: TrafficSimulationModel.cpp:49
TrafficSimulationModel::getExperiment
virtual ExperimentInterface * getExperiment() const override
Returns the pointer to the experiment configuration object, i.e. an instance of the ExperimentInterfa...
Definition: TrafficSimulationModel.cpp:24
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
ExperimentInterface
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
Definition: ExperimentInterface.h:39
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationPlugin.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
TrafficSimulationPlugin.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficSimulationPlugin.h"
12
13 #include "openPASS-Window/WindowInterface.h"
14 #include "openPASS-Project/ProjectInterface.h"
15
16 TrafficSimulationPlugin::TrafficSimulationPlugin(QObject * const parent)
17 : QObject(parent)
18 , trafficSimulationModel(nullptr)
19 , trafficSimulationPresenter(nullptr)
20 , trafficSimulationView(nullptr)
21 {
22
23 }
24
25 bool TrafficSimulationPlugin::initialize()
26 {
27 WindowInterface * const window = WindowInterface::instance();
28 ProjectInterface * const project = ProjectInterface::instance();
29
30 if(window && project)
31 {
32 // allocate pointers to models, presenters and views
33 trafficSimulationModel = new TrafficSimulationModel;
34 trafficSimulationView = new TrafficSimulationView(window);
35 trafficSimulationPresenter = new TrafficSimulationPresenter(trafficSimulationModel, trafficSimulationView, project);
36
37 return true;
38 }
39
40 return false;
41 }
42
43 bool TrafficSimulationPlugin::deinitialize()
44 {
45 // delete models, presenters and views
46 delete trafficSimulationPresenter;
47 delete trafficSimulationView;
48 delete trafficSimulationModel;
49 return true;
50 }
WindowInterface
This class manages the registration and deregistration of Window Views which include the menu bar wit...
Definition: WindowInterface.h:44
TrafficSimulationPlugin.h
TrafficSimulationPresenter
This class defines the presenter object for the main view of the Traffic Simulation Plugin and instan...
Definition: TrafficSimulationPresenter.h:49
WindowInterface.h
The Window Interface (WI) contains the functions managing the Window View of openPASS application...
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
ProjectInterface.h
The Project Interface (PI) contains the functions setters and getters of the items constituing the pr...
TrafficSimulationModel
The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class...
Definition: TrafficSimulationModel.h:33
TrafficSimulationView
This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other conf...
Definition: TrafficSimulationView.h:56
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationPlugin.h File Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
TrafficSimulationPlugin.h File Reference

Go to the source code of this file.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationPlugin.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
TrafficSimulationPlugin.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
49 //-----------------------------------------------------------------------------
50
51 #ifndef TRAFFICSIMULATIONPLUGIN_H
52 #define TRAFFICSIMULATIONPLUGIN_H
53
54 #include "openPASS/PluginInterface.h"
55
56 #include "Models/TrafficSimulationModel.h"
57 #include "Presenters/TrafficSimulationPresenter.h"
58 #include "Views/TrafficSimulationView.h"
59
60 #include <QObject>
61
62 class TrafficSimulationPlugin : public QObject, public PluginInterface
63 {
64 Q_OBJECT
65 Q_PLUGIN_METADATA(IID "openPASS.TrafficSimulation")
66 Q_INTERFACES(PluginInterface)
67
68 public:
69 explicit TrafficSimulationPlugin(QObject * const parent = nullptr);
70 virtual ~TrafficSimulationPlugin() = default;
71
72 public:
73 virtual bool initialize() override;
74 virtual bool deinitialize() override;
75
76 protected:
77 TrafficSimulationModel * trafficSimulationModel;
78 TrafficSimulationPresenter * trafficSimulationPresenter;
79 TrafficSimulationView * trafficSimulationView;
80
81 };
82
83 #endif // TRAFFICSIMULATIONPLUGIN_H
TrafficSimulationView.h
This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other conf...
TrafficSimulationPresenter
This class defines the presenter object for the main view of the Traffic Simulation Plugin and instan...
Definition: TrafficSimulationPresenter.h:49
TrafficSimulationModel.h
The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class...
TrafficSimulationPresenter.h
This class defines the presenter object for the main view of the Traffic Simulation Plugin and instan...
TrafficSimulationModel
The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class...
Definition: TrafficSimulationModel.h:33
PluginInterface.h
...
TrafficSimulationView
This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other conf...
Definition: TrafficSimulationView.h:56
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
TrafficSimulationPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficSimulationPresenter.h"
12 #include "ExperimentPresenter.h"
13 #include "EnvironmentPresenter.h"
14 #include "EnvironmentDisplayPresenter.h"
15 #include "ScenarioPresenter.h"
16 #include "ScenarioDisplayPresenter.h"
17 #include "TrafficPresenter.h"
18 #include "TrafficDisplayPresenter.h"
19
20 #include "EnvironmentMapPresenter.h"
21
22 #include "Models/TrafficSimulationModel.h"
23 #include "Models/TrafficSimulationXMLSaveModel.h"
24 #include "Models/TrafficSimulationXMLLoadModel.h"
25
26 #include "Views/TrafficSimulationView.h"
27
28
29 #include "DelegateDoubleView.h"
30 #include "DelegateTimeView.h"
31
32 #include <QMessageBox>
33 #include <QFileDialog>
34 #include <QProcess>
35 #include <QFileSystemWatcher>
36
37 TrafficSimulationPresenter::TrafficSimulationPresenter(TrafficSimulationInterface *trafficSimulation,
38 TrafficSimulationView *trafficSimulationView,
39 ProjectInterface * const project,
40 QObject *parent)
41 : QObject(parent)
42 , trafficSimulation(trafficSimulation)
43 , trafficSimulationView(trafficSimulationView)
44 , project(project)
45 , undoStack(new QUndoStack(this))
46 , experimentPresenter(new ExperimentPresenter(trafficSimulation->getExperiment(),
47 trafficSimulationView->getExperimentView(),
48 project,
49 undoStack,
50 this))
51 , environmentPresenter(new EnvironmentPresenter(trafficSimulation->getEnvironment(),
52 trafficSimulationView->getEnvironmentView(),
53 undoStack,
54 this))
55 , environmentDisplayPresenter(new EnvironmentDisplayPresenter(trafficSimulation->getEnvironment(),
56 trafficSimulationView->getEnvironmentDisplayView(),
57 this))
58 , scenarioPresenter(new ScenarioPresenter(trafficSimulation->getScenario(),
59 trafficSimulationView->getScenarioView(),
60 project,
61 undoStack,
62 this))
63 , scenarioDisplayPresenter(new ScenarioDisplayPresenter(trafficSimulation->getScenario(),
64 trafficSimulationView->getScenarioDisplayView(),
65 project,
66 this))
67 , trafficPresenter(new TrafficPresenter(trafficSimulation->getTraffic(),
68 trafficSimulationView->getTrafficView(),
69 &agentProfiles,
70 undoStack,
71 this))
72 , trafficDisplayPresenter( new TrafficDisplayPresenter(trafficSimulation->getTraffic(),
73 trafficSimulationView->getTrafficDisplayView(),
74 &agentProfiles,
75 this))
76 , redo(new QShortcut(QKeySequence(tr("Ctrl+Y", "redo")),trafficSimulationView))
77 , undo (new QShortcut(QKeySequence(tr("Ctrl+Z", "undo")),trafficSimulationView))
78 {
79
80 connect(trafficSimulationView, &TrafficSimulationView::SaveSetup, this, &TrafficSimulationPresenter::save);
81 connect(trafficSimulationView, &TrafficSimulationView::LoadSetup, this, &TrafficSimulationPresenter::load);
82 connect(trafficSimulationView,&TrafficSimulationView::NewSetup,this,&TrafficSimulationPresenter::clear);
83 connect(trafficSimulationView, &TrafficSimulationView::currentTabChanged, this, &TrafficSimulationPresenter::updateStatusBar);
84
85 connect(experimentPresenter, &ExperimentPresenter::startSimulation, this, &TrafficSimulationPresenter::startSimulation);
86
87 connect(trafficSimulationView, &TrafficSimulationView::profileCatalogueChanged, this, &TrafficSimulationPresenter::setProfileCatalogue);
88 connect(trafficSimulationView, &TrafficSimulationView::refreshCatalogue, this, &TrafficSimulationPresenter::updateCatalogueView);
89
90 connect(trafficSimulation->getEnvironment(), &EnvironmentInterface::modifiedStatus, this, &TrafficSimulationPresenter::checkStatus);
91 connect(trafficSimulation->getScenario(), &ScenarioInterface::modifiedStatus, this, &TrafficSimulationPresenter::checkStatus);
92 connect(trafficSimulation->getTraffic(), &TrafficInterface::modifiedStatus, this, &TrafficSimulationPresenter::checkStatus);
93
94 connect(project, &ProjectInterface::update, this, &TrafficSimulationPresenter::updateCatalogueView);
95
96 connect(redo, &QShortcut::activated, undoStack, &QUndoStack::redo);
97 connect(undo, &QShortcut::activated, undoStack, &QUndoStack::undo);
98 connect(trafficSimulationView, &TrafficSimulationView::Redo, undoStack, &QUndoStack::redo);
99 connect(trafficSimulationView, &TrafficSimulationView::Undo, undoStack, &QUndoStack::undo);
100
101 // connect undoStack to undoView
102 trafficSimulationView->getUndoView()->setStack(undoStack);
103 updateStatusBar(0);
104 }
105
106 void TrafficSimulationPresenter::checkStatus()
107 {
108 bool status = trafficSimulation->getEnvironment()->getStatus() &&
109 trafficSimulation->getTraffic()->getStatus() &&
110 trafficSimulation->getScenario()->getStatus() &&
111 !trafficSimulation->getProfilesCatalogue().isEmpty();
112
113 trafficSimulationView->getExperimentView()->enableSimulation(status);
114 }
115
116 void TrafficSimulationPresenter::simulationFinished(int exitCode)
117 {
118 QMessageBox message;
119 QString text;
120
121 if(exitCode == 0)
122 text = QString("Simulation slave has finished successfully! Results have been stored in %1").arg(project->getResultPath());
123 else
124 text = QString("Simulation slave has finished with exit code %1! See log file %2 for details.").arg(exitCode).arg(project->getLogSlave());
125
126
127 message.setText(text);
128 message.exec();
129
130 QProcess * slave = qobject_cast<QProcess*>(sender());
131 if(slave)
132 delete slave;
133
134 checkStatus();
135 }
136
137 void TrafficSimulationPresenter::startSimulation()
138 {
139 QMessageBox warning;
140 int ret;
141 QString slaveConfig (project->absoluteToConfigPath("slaveConfig.xml"));
142
143 // save the slaveConfig explicitly under the name "slave config"
144 if(QFileInfo::exists(slaveConfig))
145 {
146 // spell out a warning that everything will be deleted
147 warning.setText("There already exists a file named 'slaveConfig.xml' in the current configuration directory (see Master Configuration)!");
148 warning.setInformativeText("Do you want to overwrite it with the current settings?");
149 warning.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
150 ret=warning.exec();
151
152 if(ret == QMessageBox::No)
153 return;
154 }
155
156 TrafficSimulationXMLSaveModel::save(slaveConfig, trafficSimulation);
157
158 // Prepare slave arguments
159 QStringList arguments;
160
161 arguments << QString("--logLevel") << QString::number(project->getLogLevel())
162 << QString("--logFile") << project->getLogSlave()
163 << QString("--lib") << project->getLibraryPath()
164 << QString("--configs") << project->getConfigPath()
165 << QString("--results") << project->getResultPath();
166
167 QProcess *slave = new QProcess;
168 connect(slave, static_cast<void (QProcess::*)(int)>(&QProcess::finished) , this, &TrafficSimulationPresenter::simulationFinished);
169
170 if(QFileInfo::exists(project->getSlaveExe()))
171 {
172 slave->setProgram(project->getSlaveExe());
173 slave->setArguments(arguments);
174 slave->start();
175 trafficSimulationView->getExperimentView()->enableSimulation(false);
176 }
177 else
178 {
179 // tell user that slave exe does not exist
180 warning.setText("Slave exe not found! Check slave path settings in Master Configuration!");
181 warning.setInformativeText("");
182 warning.setStandardButtons(QMessageBox::Ok);
183 ret=warning.exec();
184 }
185 }
186
187 void TrafficSimulationPresenter::save()
188 {
189
190 QString const filepath = QFileDialog::getSaveFileName(
191 trafficSimulationView, QObject::tr("openPASS / Save slave config"),
192 project->getConfigPath(), QStringLiteral("slaveConfig (*.xml)"));
193
194 TrafficSimulationXMLSaveModel::save(filepath,trafficSimulation);
195 }
196
197 void TrafficSimulationPresenter::updateStatusBar(int index)
198 {
199 QString info;
200
201 switch(index)
202 {
203
204 // Experiment Configuration
205 case 0:
206 {
207 info = QString("This tab contains the overall experiment setup. Experiments can be configured and started here.");
208 trafficSimulationView->showStatusBarText(info, StatusBarView::Color::Message);
209 break;
210 }
211 // Environment Configuration
212 case 1:
213 {
214 info = QString("This tab contains information about the world and the general environment inside the simulation. "
215 "Every invocation re-rolls the environment parameters. Probabilities need to add up to 1.0 for each parameter. Note that, in "
216 "the current implementation, the environment parameters 'time of day' as well as 'weather' are not used yet.");
217 trafficSimulationView->showStatusBarText(info, StatusBarView::Color::Message);
218 break;
219 }
220 case 2:
221 {
222 info = QString("This tab contains information about the scenario and scenery setup for the experiment. This information does not change between invocations. "
223 "Here the scenario and scenery files as well as the AgentProfiles for all agents are specified. For every agent listed in the scenario file one AgentProfile is required");
224 trafficSimulationView->showStatusBarText(info, StatusBarView::Color::Message);
225 break;
226 }
227 case 3:
228 {
229 info = QString("This tab contains parameters regarding the traffic and distribution of agent profiles for all surrounding vehicles. "
230 "Every invocation re-rolls the traffic parameters and agents. Probabilities need to add up to 1.0 for each parameter.");
231 trafficSimulationView->showStatusBarText(info, StatusBarView::Color::Message);
232 break;
233 }
234 default:
235 break;
236
237 }
238 }
239
240 void TrafficSimulationPresenter::load()
241 {
242 bool success;
243 QString const filepath = QFileDialog::getOpenFileName(
244 trafficSimulationView, QObject::tr("openPASS / Load slave config"),
245 project->getConfigPath(), QStringLiteral("slaveConfig (*.xml)"));
246
247 TrafficSimulationInterface * loadedXML = new TrafficSimulationModel;
248 success = TrafficSimulationXMLLoadModel::load(filepath, loadedXML);
249
250 if(success)
251 {
252 undoStack->beginMacro(QString("loaded slaveConfig %1").arg(filepath));
253
254 // 0. clear everything first
255 clearExperimentConfig();
256 clearEnvironmentConfig();
257 clearScenarioConfig();
258 clearTrafficConfig();
259
260 // 1. set the profiles catalogue
261 undoStack->push(new EditProfilesCatalogue(trafficSimulation, trafficSimulationView, loadedXML->getProfilesCatalogue()));
262
263 //2. Experiment Settings
264 copyExperimentConfig(loadedXML);
265
266 //3. Environment Settings
267 copyEnvironmentConfig(loadedXML);
268
269 //4. Scenario Settings
270 copyScenarioConfig(loadedXML);
271
272 //5. Traffic Settings
273 copyTrafficConfig(loadedXML);
274
275 undoStack->endMacro();
276 }
277
278 delete loadedXML;
279 }
280
281 void TrafficSimulationPresenter::copyExperimentConfig(TrafficSimulationInterface const * const from)
282 {
283 int row;
284
285 undoStack->push(new EditNumberInvocations(trafficSimulation->getExperiment(),
286 trafficSimulationView->getExperimentView(),
287 from->getExperiment()->getNumberInvocations()));
288
289 undoStack->push(new EditRandomSeed(trafficSimulation->getExperiment(),
290 trafficSimulationView->getExperimentView(),
291 from->getExperiment()->getSeed()));
292
293 LibrariesPresenter * const libPresenter = findChild<LibrariesPresenter * const>();
294 ExperimentInterface::Libraries * const loadedLibs = from->getExperiment()->getLibraries();
295 row = 0;
296 for(auto libType : loadedLibs->keys())
297 {
298 undoStack->push(new AddLibrary(libPresenter, libType));
299 undoStack->push(new EditData(libPresenter, libPresenter->index(row,1), loadedLibs->value(libType), ""));
300 ++row;
301 }
302
303 LoggingGroupsPresenter * const loggingGroupsPresenter = findChild<LoggingGroupsPresenter * const>();
304 ExperimentInterface::LoggingGroups * const loadedLoggingGroups = from->getExperiment()->getLoggingGroups();
305 for(auto loggingGroup : *loadedLoggingGroups)
306 {
307 undoStack->push(new AddLoggingGroup(loggingGroupsPresenter, loggingGroup));
308 }
309 }
310
311 void TrafficSimulationPresenter::copyEnvironmentConfig(const TrafficSimulationInterface *const from)
312 {
313 EnvironmentMapPresenter * table;
314 QMap<EnvironmentInterface::ID, EnvironmentInterface::Item *> * map;
315
316 // 0. edit name
317 undoStack->push(new EditEnvironmentName(trafficSimulation->getEnvironment(),
318 trafficSimulationView->getEnvironmentView(),
319 from->getEnvironment()->getName()));
320
321 // 1. copy time of day table
322 table = findChild<EnvironmentMapPresenter *>("timeOfDayTable");
323 map = from->getEnvironment()->getTimeOfDayMap();
324 for(auto item : *map)
325 undoStack->push(new AddEnvironmentItem(table, item->getValue(), item->getProbability()));
326
327 // 2. copy visibility distance table
328 table = findChild<EnvironmentMapPresenter *>("visibilityDistanceTable");
329 map = from->getEnvironment()->getVisibilityDistanceMap();
330 for(auto item : *map)
331 undoStack->push(new AddEnvironmentItem(table, item->getValue(), item->getProbability()));
332
333 // 3. copy friction table
334 table = findChild<EnvironmentMapPresenter *>("frictionTable");
335 map = from->getEnvironment()->getFrictionMap();
336 for(auto item : *map)
337 undoStack->push(new AddEnvironmentItem(table, item->getValue(), item->getProbability()));
338
339 // 4. copy weather table
340 table = findChild<EnvironmentMapPresenter *>("weatherTable");
341 map = from->getEnvironment()->getWeatherMap();
342 for(auto item : *map)
343 undoStack->push(new AddEnvironmentItem(table, item->getValue(), item->getProbability()));
344 }
345
346 void TrafficSimulationPresenter::copyScenarioConfig(const TrafficSimulationInterface *const from)
347 {
348 // 0. edit name
349 undoStack->push(new EditScenarioName(trafficSimulation->getScenario(),
350 trafficSimulationView->getScenarioView(),
351 from->getScenario()->getName()));
352
353 // 1. edit scenario file
354 undoStack->push(new EditScenarioFile(trafficSimulation->getScenario(),
355 trafficSimulationView->getScenarioView(),
356 from->getScenario()->getScenarioFile()));
357 }
358
359 void TrafficSimulationPresenter::copyTrafficConfig(const TrafficSimulationInterface *const from)
360 {
361 TrafficItemMapPresenter * table;
362 TrafficItemMapInterface * map;
363
364 // 0. edit name
365 undoStack->push(new EditTrafficName(trafficSimulation->getTraffic(),
366 trafficSimulationView->getTrafficView(),
367 from->getTraffic()->getName()));
368
369 // 1. copy traffic volume table
370 table = findChild<TrafficItemMapPresenter *>("volumesTable");
371 map = from->getTraffic()->getVolumes();
372 for(auto item: *map)
373 undoStack->push(new AddTrafficItem(table, item->getValue(), item->getProbability()));
374
375 // 2. copy velocities table
376 table = findChild<TrafficItemMapPresenter *>("velocitiesTable");
377 map = from->getTraffic()->getVelocities();
378 for(auto item: *map)
379 undoStack->push(new AddTrafficItem(table, item->getValue(), item->getProbability()));
380
381 // 3. copy platoon Rates table
382 table = findChild<TrafficItemMapPresenter *>("platoonRatesTable");
383 map = from->getTraffic()->getPlatoonRates();
384 for(auto item: *map)
385 undoStack->push(new AddTrafficItem(table, item->getValue(), item->getProbability()));
386
387 // 4. copy homogeneities table
388 table = findChild<TrafficItemMapPresenter *>("homogeneitiesTable");
389 map = from->getTraffic()->getHomogeneities();
390 for(auto item: *map)
391 undoStack->push(new AddTrafficItem(table, item->getValue(), item->getProbability()));
392
393 // 5. copy regular lange agents table
394 table = findChild<TrafficItemMapPresenter *>("regularLaneAgentsTable");
395 map = from->getTraffic()->getAgentsRegularLane();
396 for(auto item: *map)
397 undoStack->push(new AddTrafficItem(table, item->getValue(), item->getProbability()));
398
399 // 6. copy rightmost lange agents table
400 table = findChild<TrafficItemMapPresenter *>("rightmostLaneAgentsTable");
401 map = from->getTraffic()->getAgentsRightMostLane();
402 for(auto item: *map)
403 undoStack->push(new AddTrafficItem(table, item->getValue(), item->getProbability()));
404 }
405
406 void TrafficSimulationPresenter::clearExperimentConfig()
407 {
408
409 // reset number of invocations
410 undoStack->push(new EditNumberInvocations(trafficSimulation->getExperiment(),
411 trafficSimulationView->getExperimentView(),
412 ExperimentModel::numberInvocations_default));
413 // reset randomn seed
414 undoStack->push(new EditRandomSeed(trafficSimulation->getExperiment(),
415 trafficSimulationView->getExperimentView(),
416 ExperimentModel::seed_default));
417
418 // empty libraries table
419 LibrariesPresenter * const libPresenter = findChild<LibrariesPresenter * const>();
420 while(libPresenter->rowCount() > 0)
421 undoStack->push(new RemoveLibrary(libPresenter, 0));
422
423 // empty logging groups list
424 LoggingGroupsPresenter * const loggingGroupsPresenter = findChild<LoggingGroupsPresenter * const>();
425 while(loggingGroupsPresenter->rowCount() > 0)
426 undoStack->push(new RemoveLoggingGroup(loggingGroupsPresenter, 0));
427
428 }
429
430 void TrafficSimulationPresenter::clearEnvironmentConfig()
431 {
432 // reset name
433 undoStack->push(new EditEnvironmentName(trafficSimulation->getEnvironment(),
434 trafficSimulationView->getEnvironmentView(),
435 ""));
436
437 // remove all table entries
438 for(auto table : findChildren<EnvironmentMapPresenter*>())
439 while(table->rowCount()>0)
440 undoStack->push(new RemoveEnvironmentItem(table,0));
441 }
442
443 void TrafficSimulationPresenter::clearTrafficConfig()
444 {
445 // reset name
446 undoStack->push(new EditTrafficName(trafficSimulation->getTraffic(),
447 trafficSimulationView->getTrafficView(),
448 ""));
449
450 // remove all table entries
451 for(auto table : findChildren<TrafficItemMapPresenter*>())
452 while(table->rowCount()>0)
453 undoStack->push(new RemoveTrafficItem(table,0));
454 }
455
456 void TrafficSimulationPresenter::clearScenarioConfig()
457 {
458 // reset name
459 undoStack->push(new EditScenarioName(trafficSimulation->getScenario(),
460 trafficSimulationView->getScenarioView(),
461 ""));
462
463 // reset scenario file
464 undoStack->push(new EditScenarioFile(trafficSimulation->getScenario(),
465 trafficSimulationView->getScenarioView(),
466 ""));
467 }
468
469 void TrafficSimulationPresenter::clear()
470 {
471
472 undoStack->beginMacro("cleared worksheet");
473
474 undoStack->push(new EditProfilesCatalogue(trafficSimulation, trafficSimulationView,""));
475
476 clearExperimentConfig();
477 clearEnvironmentConfig();
478 clearScenarioConfig();
479 clearTrafficConfig();
480
481 undoStack->endMacro();
482 }
483
484
485 void TrafficSimulationPresenter::setProfileCatalogue()
486 {
487 QString const filename = QFileDialog::getOpenFileName(
488 trafficSimulationView, QObject::tr("openPASS / Select profiles catalogue"),
489 project->getConfigPath(), QStringLiteral("ProfilesCatalog (*.xml)"));
490
491 QString Catalogue= project->relativeToConfigPath(filename);
492
493 if(trafficSimulation->getProfilesCatalogue()!= Catalogue)
494 undoStack->push(new EditProfilesCatalogue(trafficSimulation, trafficSimulationView,Catalogue));
495 }
496
497 void TrafficSimulationPresenter::updateCatalogueView()
498 {
499 QString profilesCatalogue = trafficSimulation->getProfilesCatalogue();
500 TrafficSimulationXMLLoadModel::loadAgentProfiles(project->absoluteToConfigPath(profilesCatalogue),
501 agentProfiles);
502
503 trafficSimulationView->setProfileCatalogueView(profilesCatalogue);
504 trafficSimulationView->setProfileCatalogueError("");
505 trafficPresenter->checkAgents();
506
507 if(profilesCatalogue.isEmpty())
508 return;
509
510 if(!QFileInfo::exists(project->absoluteToConfigPath(profilesCatalogue)))
511 {
512 trafficSimulationView->setProfileCatalogueError("Profiles Catalogue not accessible! Check configuration path in Project plugin!");
513 }
514
515 trafficDisplayPresenter->setStatus();
516 }
517
518 EditProfilesCatalogue::EditProfilesCatalogue(TrafficSimulationInterface * const trafficSimulation,
519 TrafficSimulationView * const trafficSimulationView,
520 TrafficSimulationInterface::ProfilesCatalogue const &newCatalogue,
521 QUndoCommand *parent)
522 : QUndoCommand (parent)
523 , trafficSimulation(trafficSimulation)
524 , trafficSimulationView(trafficSimulationView)
525 , newCatalogue(newCatalogue)
526 , oldCatalogue(trafficSimulation->getProfilesCatalogue())
527 {
528 setText("edited profiles catalogue");
529 }
530
531 void EditProfilesCatalogue::redo()
532 {
533 trafficSimulation->setProfilesCatalogue(newCatalogue);
534 trafficSimulationView->setProfileCatalogueView(newCatalogue);
535 Q_EMIT trafficSimulationView->refreshCatalogue();
536 }
537
538 void EditProfilesCatalogue::undo()
539 {
540 trafficSimulation->setProfilesCatalogue(oldCatalogue);
541 trafficSimulationView->setProfileCatalogueView(oldCatalogue);
542 Q_EMIT trafficSimulationView->refreshCatalogue();
543 }
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
TrafficSimulationView::SaveSetup
void SaveSetup()
Signal, emitted after the save-button in the action menu has been clicked.
ScenarioInterface::getStatus
virtual Status getStatus() const =0
Method which returns the current status of the scenario settings.
TrafficSimulationView::getUndoView
QUndoView * getUndoView()
Method that returns the undo view.
Definition: TrafficSimulationView.cpp:152
ExperimentInterface::getLoggingGroups
virtual LoggingGroups * getLoggingGroups() const =0
Returns the pointer to the list of Logging Groups.
EditNumberInvocations
Command class editing the number of invocations.
Definition: ExperimentPresenter.h:226
LoggingGroupsPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of items in the logging groups list...
Definition: LoggingGroupsPresenter.cpp:20
TrafficSimulationView::Redo
void Redo()
Signal, emitted after the redo-button in the action menu has been clicked.
AddEnvironmentItem
Command class for adding rows to the table of environment settings.
Definition: EnvironmentPresenter.h:198
ExperimentInterface::Libraries
QMap< QString, QString > Libraries
The map of libraries needed by the simulation slave.
Definition: ExperimentInterface.h:47
TrafficSimulationPresenter::trafficSimulationView
TrafficSimulationView *const trafficSimulationView
a pointer to the editor view whose user events are handled by this presenter
Definition: TrafficSimulationPresenter.h:201
LoggingGroupsPresenter
This class describes the presenter object of the list of logging groups.
Definition: LoggingGroupsPresenter.h:47
TrafficSimulationInterface::getTraffic
virtual TrafficInterface * getTraffic() const =0
Returns the pointer to the traffic configuration object, i.e. an instance of the TrafficInterface cla...
TrafficSimulationPresenter::save
void save()
Slot which is triggered after the user has clicked the save-button in the action menu. Will open file dialog to select a filepath for the slaveConfig xml file to be saved. It calls the TrafficSimulationXMLSaveModel::save routine for saving the momentary configuration to a slaveConfig XML file.
Definition: TrafficSimulationPresenter.cpp:187
ExperimentInterface::getLibraries
virtual Libraries * getLibraries() const =0
Returns the pointer to the Libraries map.
TrafficSimulationView.h
This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other conf...
TrafficInterface::getVelocities
virtual Velocities * getVelocities() const =0
Returns the map for registering velocities.
ScenarioInterface::getScenarioFile
virtual ScenarioFile getScenarioFile() const =0
Returns the current name of the open scenario file to which this scenario setup refers.
TrafficSimulationPresenter::clearEnvironmentConfig
void clearEnvironmentConfig()
Method, which resets all setting made in the environment config to the default and empties all tables...
Definition: TrafficSimulationPresenter.cpp:430
TrafficSimulationXMLLoadModel::load
static bool load(const QString &filepath, TrafficSimulationInterface *const trafficSimulation)
This method manages the whole loading process and calls the subroutines for loading the particular se...
Definition: TrafficSimulationXMLLoadModel.cpp:13
ProjectInterface::getLogSlave
virtual ProjectInterface::LogSlave getLogSlave() const =0
Gets the path of the directory containing the log file of the openPASS Slave.
TrafficDisplayPresenter::setStatus
void setStatus()
Method which determines the status of the traffic settings. If all necessary configurations are made...
Definition: TrafficDisplayPresenter.cpp:92
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficSimulationView::currentTabChanged
void currentTabChanged(int index)
Signal, emitted when the current tab has been changed. Transmits the index of the tab...
AddLoggingGroup
Command class for adding logging groups to the logging groups list.
Definition: ExperimentPresenter.h:185
EditScenarioName
Command class editing the scenario&#39;s name.
Definition: ScenarioPresenter.h:98
ProjectInterface::getLibraryPath
virtual ProjectInterface::Library getLibraryPath() const =0
Gets the path of the directory containing the components library.
TrafficDisplayPresenter
This class defines the presenter which controls the content to be displayed in the TrafficDisplayView...
Definition: TrafficDisplayPresenter.h:31
ExperimentInterface::LoggingGroups
QStringList LoggingGroups
The list of logging groups.
Definition: ExperimentInterface.h:48
TrafficInterface::getVolumes
virtual Volumes * getVolumes() const =0
Returns the map for registering traffic volumes.
ExperimentPresenter
This class defines the presenter object which handles user events coming from the view (ExperimentVie...
Definition: ExperimentPresenter.h:35
TrafficSimulationPresenter::copyEnvironmentConfig
void copyEnvironmentConfig(TrafficSimulationInterface const *const from)
Method, which copies all environment settings from the given argument to trafficSimulation.
Definition: TrafficSimulationPresenter.cpp:311
EditEnvironmentName
Command class editing the environment&#39;s name.
Definition: EnvironmentPresenter.h:245
TrafficSimulationView::getEnvironmentView
EnvironmentView * getEnvironmentView()
Method that returns the environment configuration widget (instance of EnvironmentView).
Definition: TrafficSimulationView.cpp:162
TrafficSimulationView::getTrafficView
TrafficView * getTrafficView()
Method that returns the traffic configuration widget (instance of TrafficView).
Definition: TrafficSimulationView.cpp:182
ExperimentPresenter.h
This class defines the presenter object which handles user events coming from the view (ExperimentVie...
TrafficSimulationPresenter::copyScenarioConfig
void copyScenarioConfig(TrafficSimulationInterface const *const from)
Method, which copies all scenario settings from the given argument to trafficSimulation.
Definition: TrafficSimulationPresenter.cpp:346
TrafficSimulationView::profileCatalogueChanged
void profileCatalogueChanged()
Signal, emitted when the profiles catalogue has been modified by the user.
EnvironmentPresenter.h
This class defines the presenter object which handles user events coming from the view (EnvironmentVi...
EnvironmentMapPresenter
This class describes the presenter objects of the environment parameter maps.
Definition: EnvironmentMapPresenter.h:49
EditScenarioFile
Command class editing the OpenSCENARIO file.
Definition: ScenarioPresenter.h:121
EnvironmentDisplayPresenter.h
This class defines the presenter which controls the content to be displayed in the EnvironmentDisplay...
ScenarioDisplayPresenter.h
This class defines the presenter which controls the content to be displayed in the ScenarioDisplayVie...
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
TrafficSimulationPresenter::load
void load()
Slot which is triggered after the user has clicked the load-button in the action menu. Will open file dialog to select a filepath for the slaveConfig xml file to be loaded. It calls the TrafficSimulationXMLLoadModel::load routine for loading a slaveConfig XML file.
Definition: TrafficSimulationPresenter.cpp:240
TrafficSimulationPresenter::copyExperimentConfig
void copyExperimentConfig(TrafficSimulationInterface const *const from)
Method, which copies all experiment settings from the given argument to trafficSimulation.
Definition: TrafficSimulationPresenter.cpp:281
LibrariesPresenter
This class describes the presenter object of the map of included libraries.
Definition: LibrariesPresenter.h:48
AddLibrary
Command class for adding libraries to the libraries table.
Definition: ExperimentPresenter.h:144
TrafficSimulationView::setProfileCatalogueView
void setProfileCatalogueView(QString const &filename)
Method which sets the filename displayed in the profile catalogue&#39;s line edit to the one passed as an...
Definition: TrafficSimulationView.cpp:210
TrafficSimulationInterface::getProfilesCatalogue
virtual ProfilesCatalogue getProfilesCatalogue() const =0
Returns the current profiles catalogue.
RemoveLoggingGroup
Command class for removing logging groups from the logging groups list.
Definition: ExperimentPresenter.h:205
TrafficSimulationInterface
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
Definition: TrafficSimulationInterface.h:37
TrafficSimulationModel.h
The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class...
TrafficInterface::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const =0
Returns the map for registering platoon rates.
EnvironmentInterface::getFrictionMap
virtual FrictionMap * getFrictionMap() const =0
Returns a pointer to the map of friction coefficients.
EnvironmentInterface::modifiedStatus
void modifiedStatus()
Signal, emitted when the environment&#39;s status has changed.
TrafficSimulationInterface::setProfilesCatalogue
virtual void setProfilesCatalogue(ProfilesCatalogue const &_profilesCatalogue)=0
Sets the current profiles catalogue to the one passed as an argument.
ProjectInterface::getLogLevel
virtual ProjectInterface::LogLevel getLogLevel() const =0
Gets the level of information in the log files for the current project.
EnvironmentMapPresenter.h
This class describes the presenter objects of the environment parameter maps.
ExperimentInterface::getNumberInvocations
virtual NumberInvocations getNumberInvocations() const =0
Returns the current number of invocations.
TrafficInterface::getHomogeneities
virtual Homogeneities * getHomogeneities() const =0
Returns the map for registering homogeneities.
TrafficSimulationPresenter::clearExperimentConfig
void clearExperimentConfig()
Method, which resets all setting made in the experiment config to the default and empties all tables...
Definition: TrafficSimulationPresenter.cpp:406
TrafficSimulationView::getExperimentView
ExperimentView * getExperimentView()
Method that returns the experiment configuration widget (instance of ExperimentView).
Definition: TrafficSimulationView.cpp:157
LibrariesPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: LibrariesPresenter.cpp:26
TrafficSimulationPresenter::agentProfiles
QList< QString > agentProfiles
a list of agent profiles defined in the profile catalogue
Definition: TrafficSimulationPresenter.h:197
TrafficPresenter.h
This class defines the presenter object which handles user events coming from the view (TrafficView) ...
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
ExperimentPresenter::startSimulation
void startSimulation()
Signal, emitted when the start simulation button has been clicked. Will trigger a process (started in...
ScenarioInterface::modifiedStatus
void modifiedStatus()
Signal, emitted when the scenario&#39;s status has changed.
TrafficSimulationPresenter::updateStatusBar
void updateStatusBar(int index)
Slot which displays information in the status bar depending on the current tab.
Definition: TrafficSimulationPresenter.cpp:197
TrafficSimulationPresenter::clearScenarioConfig
void clearScenarioConfig()
Method, which resets all setting made in the scenario config to the default and empties all tables...
Definition: TrafficSimulationPresenter.cpp:456
ProjectInterface::getResultPath
virtual ProjectInterface::Result getResultPath() const =0
Gets the path of the directory containing the project results.
TrafficSimulationView::getScenarioView
ScenarioView * getScenarioView()
Method that returns the scenario configuration widget (instance of ScenarioView). ...
Definition: TrafficSimulationView.cpp:177
TrafficSimulationPresenter::updateCatalogueView
void updateCatalogueView()
Slot which displays the profile catalogues view. Further, it loads the agent list, defined in the profiles catalogue. If any errors occur, these will be displayed in the GUI as well.
Definition: TrafficSimulationPresenter.cpp:497
TrafficSimulationPresenter::simulationFinished
void simulationFinished(int exitCode)
Slot which is triggered when the simulation slave has terminated. It will pop up an info window with ...
Definition: TrafficSimulationPresenter.cpp:116
TrafficSimulationView::refreshCatalogue
void refreshCatalogue()
Signal, emitted when the refresh button of the profile catalogue has been clicked by the user...
TrafficSimulationPresenter::clearTrafficConfig
void clearTrafficConfig()
Method, which resets all setting made in the traffic config to the default and empties all tables...
Definition: TrafficSimulationPresenter.cpp:443
EnvironmentInterface::getVisibilityDistanceMap
virtual VisibilityDistanceMap * getVisibilityDistanceMap() const =0
Returns a pointer to the map of visibility distances.
ExperimentModel::numberInvocations_default
static NumberInvocations const numberInvocations_default
The default number of invocations.
Definition: ExperimentModel.h:63
ScenarioPresenter
This class defines the presenter object which handles user events coming from the view (ScenarioView)...
Definition: ScenarioPresenter.h:35
TrafficSimulationInterface::getEnvironment
virtual EnvironmentInterface * getEnvironment() const =0
Returns the pointer to the environment configuration object, i.e. an instance of the EnvironmentInter...
RemoveTrafficItem
Command class for removing rows from the table of traffic settings.
Definition: TrafficPresenter.h:296
RemoveEnvironmentItem
Command class for removing rows from the table of environment settings.
Definition: EnvironmentPresenter.h:222
AddTrafficItem
Command class for adding rows to the table of traffic settings.
Definition: TrafficPresenter.h:272
TrafficSimulationInterface::getExperiment
virtual ExperimentInterface * getExperiment() const =0
Returns the pointer to the experiment configuration object, i.e. an instance of the ExperimentInterfa...
TrafficInterface::getName
virtual Name getName() const =0
Returns the current name of the traffic setup.
ExperimentInterface::getSeed
virtual Seed getSeed() const =0
Returns the current random number seed.
TrafficInterface::getStatus
virtual Status getStatus() const =0
Method which returns the current status of the traffic settings.
TrafficItemMapPresenter
This class describes the presenter objects of the traffic parameter maps.
Definition: TrafficItemMapPresenter.h:48
TrafficPresenter::checkAgents
void checkAgents()
Slot which is connected, with the TrafficInterface::edited signal in order to check whether all selec...
Definition: TrafficPresenter.cpp:245
RemoveLibrary
Command class for removing libraries from the libraries table.
Definition: ExperimentPresenter.h:163
TrafficSimulationPresenter::setProfileCatalogue
void setProfileCatalogue()
Slot which opens the file dialog for the user to select a profiles catalouge XML file. Further, it scans the chosen profile catalogue for agent profiles and updates agentProfiles accordingly. If the profile catalogue is changed, all agent profiles included into the traffic settings (TrafficInterface) are deleted. Before, a dialog window with a warning is displayed requiring a user confirmation.
Definition: TrafficSimulationPresenter.cpp:485
ProjectInterface::getSlaveExe
virtual ProjectInterface::Slave getSlaveExe() const =0
Gets the path of the executable openPASS slave.
TrafficInterface::modifiedStatus
void modifiedStatus()
Signal, emitted when the traffic&#39;s status has changed.
EnvironmentInterface::getStatus
virtual Status getStatus() const =0
Method which returns the current status of the environment settings.
EnvironmentInterface::getWeatherMap
virtual WeatherMap * getWeatherMap() const =0
Returns a pointer to the map of whether parameters.
TrafficSimulationView::LoadSetup
void LoadSetup()
Signal, emitted after the load-button in the action menu has been clicked.
TrafficSimulationPresenter::project
ProjectInterface *const project
a pointer to the project settings (provides access to the path settings
Definition: TrafficSimulationPresenter.h:202
EnvironmentDisplayPresenter
This class defines the presenter which controls the content to be displayed in the EnvironmentDisplay...
Definition: EnvironmentDisplayPresenter.h:31
TrafficDisplayPresenter.h
This class defines the presenter which controls the content to be displayed in the TrafficDisplayView...
TrafficSimulationView::showStatusBarText
void showStatusBarText(QString text, StatusBarView::Color color)
Method which shows the text message passed as a first argument in the info bar in the color code spec...
Definition: TrafficSimulationView.cpp:200
TrafficSimulationXMLSaveModel::save
static bool save(const QString &filepath, const TrafficSimulationInterface *const trafficSimulation)
This method manages the whole saving process. It opens the given filepath and, on success...
Definition: TrafficSimulationXMLSaveModel.cpp:13
ExperimentView::enableSimulation
void enableSimulation(bool enable)
Method which enables the start simulation button.
Definition: ExperimentView.cpp:110
EditTrafficName
Command class for editing the traffic&#39;s name.
Definition: TrafficPresenter.h:321
TrafficSimulationPresenter.h
This class defines the presenter object for the main view of the Traffic Simulation Plugin and instan...
EnvironmentInterface::getTimeOfDayMap
virtual TimeOfDayMap * getTimeOfDayMap() const =0
Returns a pointer to the time of day parameter map.
ScenarioPresenter.h
This class defines the presenter object which handles user events coming from the view (ScenarioView)...
TrafficSimulationModel
The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class...
Definition: TrafficSimulationModel.h:33
TrafficSimulationPresenter::copyTrafficConfig
void copyTrafficConfig(TrafficSimulationInterface const *const from)
Method, which copies all traffic settings from the given argument to trafficSimulation.
Definition: TrafficSimulationPresenter.cpp:359
EditRandomSeed
Command class editing the number of invocations.
Definition: ExperimentPresenter.h:249
EditProfilesCatalogue
Command class for editing the profiles catalogue.
Definition: TrafficSimulationPresenter.h:226
ScenarioDisplayPresenter
This class defines the presenter which controls the content to be displayed in the ScenarioDisplayVie...
Definition: ScenarioDisplayPresenter.h:30
TrafficSimulationPresenter::trafficSimulation
TrafficSimulationInterface *const trafficSimulation
a pointer to the model class edited by this presenter
Definition: TrafficSimulationPresenter.h:200
TrafficSimulationView::setProfileCatalogueError
void setProfileCatalogueError(QString const &message)
Method which sets an error message next the profile catalogue&#39;s line edit.
Definition: TrafficSimulationView.cpp:226
EnvironmentPresenter
This class defines the presenter object which handles user events coming from the view (EnvironmentVi...
Definition: EnvironmentPresenter.h:33
ProjectInterface::update
void update()
Triggers signal to inform that an item from the project configuration has been modified.
TrafficSimulationPresenter::clear
void clear()
Slot which is triggered after the user has clicked the new-button in the action menu and confirmed th...
Definition: TrafficSimulationPresenter.cpp:469
ExperimentModel::seed_default
static Seed const seed_default
The default random seed.
Definition: ExperimentModel.h:64
TrafficSimulationXMLLoadModel.h
This class provides routines for loading the combination XML file and for storing all information in ...
TrafficSimulationPresenter::checkStatus
void checkStatus()
Slot which checks the status of the configuration for each tab, i.e. the experiment, environment, scenario and traffic tabs. If all configurations are complete and correct, the start button for the simulation will be enabled.
Definition: TrafficSimulationPresenter.cpp:106
TrafficSimulationView
This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other conf...
Definition: TrafficSimulationView.h:56
TrafficSimulationPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficSimulationPresenter.h:203
TrafficSimulationPresenter::startSimulation
void startSimulation()
Slot which is triggered when the simulation button is pressed. It creates a process for executing the...
Definition: TrafficSimulationPresenter.cpp:137
TrafficSimulationView::Undo
void Undo()
Signal, emitted after the undo-button in the action menu has been clicked.
TrafficPresenter
This class defines the presenter object which handles user events coming from the view (TrafficView) ...
Definition: TrafficPresenter.h:33
EnvironmentInterface::getName
virtual Name getName() const =0
Returns the current name of the environment configuration.
TrafficSimulationInterface::getScenario
virtual ScenarioInterface * getScenario() const =0
Returns the pointer to the scenario configuration object, i.e. an instance of the ScenarioInterface c...
TrafficSimulationPresenter::trafficDisplayPresenter
TrafficDisplayPresenter *const trafficDisplayPresenter
a pointer to the traffic display presenter instantiated here
Definition: TrafficSimulationPresenter.h:215
TrafficSimulationPresenter::trafficPresenter
TrafficPresenter *const trafficPresenter
a pointer to the traffic presenter instantiated here
Definition: TrafficSimulationPresenter.h:214
ScenarioInterface::getName
virtual Name getName() const =0
Returns the current name of the scenario.
TrafficSimulationView::NewSetup
void NewSetup()
Signal, emitted when the new-button in the action menu is clicked.
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficSimulationView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficSimulationView.h"
12 #include "ui_TrafficSimulationView.h"
13
14 #include <QCoreApplication>
15 #include <QFileDialog>
16 #include <QMessageBox>
17
18 #include <iostream>
19
20 const WindowInterface::ID TrafficSimulationView::ViewID = QStringLiteral("openPASS.TrafficSimulation");
21
22 TrafficSimulationView::TrafficSimulationView(WindowInterface * const window,
23 QWidget *parent)
24 : QWidget(parent)
25 , window(window)
26 , undoView(new QUndoView(this))
27 , actionMenuNew(WindowInterface::createAction(tr("Clear"), this, &TrafficSimulationView::actionNew))
28 , actionMenuLoad(WindowInterface::createAction(tr("Load"), this, &TrafficSimulationView::actionLoad))
29 , actionMenuSave(WindowInterface::createAction(tr("Save"), this, &TrafficSimulationView::actionSave))
30 , actionMenuUndo(WindowInterface::createAction(tr(""), this, &TrafficSimulationView::actionUndo))
31 , actionMenuRedo(WindowInterface::createAction(tr(""), this, &TrafficSimulationView::actionRedo))
32 , actionMenuHistory(WindowInterface::createAction(tr("Command History"),this, &TrafficSimulationView::actionHistory))
33 , ui(new Ui::TrafficSimulationView)
34 , statusbar(new StatusBarView(this))
35 {
36 ui->setupUi(this);
37
38 // Create the views
39
40 // 1. Experiment Base View
41 experimentBaseView = new ExperimentBaseView(this);
42 delete ui->experimentScrollArea->widget();
43 ui->experimentScrollArea->setWidget(experimentBaseView);
44
45 // 2. Environment View
46 environmentView = new EnvironmentView(this);
47 delete ui->environmentScrollArea->widget();
48 ui->environmentScrollArea->setWidget( environmentView );
49
50 // 3. Scenario View
51 scenarioView = new ScenarioView(this);
52 delete ui->scenarioScrollArea->widget();
53 ui->scenarioScrollArea->setWidget(scenarioView);
54
55 // 4. Traffic View
56 trafficView = new TrafficView(this);
57 delete ui->trafficScrollArea->widget();
58 ui->trafficScrollArea->setWidget(trafficView);
59
60 // 5. Insert status bar and hide it
61 ui->layout->insertWidget(2, statusbar,0);
62 statusbar->hide();
63
64 // Register view in window interface
65 window->add(ViewID,WindowInterface::createButton(tr("Scenario-based\nSimulation"), 0, 06000),this,{actionMenuNew, actionMenuLoad,actionMenuSave,
66 actionMenuUndo, actionMenuRedo, actionMenuHistory} );
67
68 // prepare undo view and undo/redo buttons
69 actionMenuRedo->setIcon(style()->standardIcon(QStyle::StandardPixmap::SP_ArrowRight));
70 actionMenuUndo->setIcon(style()->standardIcon(QStyle::StandardPixmap::SP_ArrowLeft));
71 actionMenuRedo->setToolTip("redo previous action");
72 actionMenuUndo->setToolTip("undo last action");
73 undoView->raise();
74 undoView->hide();
75
76
77 // adjust the positioning of the widgets according to the size of this view
78 adjustWidgets();
79 }
80
81 TrafficSimulationView::~TrafficSimulationView()
82 {
83 //Deregister view from window interface
84 window->remove(ViewID);
85
86 delete ui;
87 }
88
89 void TrafficSimulationView::on_tabWidget_currentChanged(int index)
90 {
91 Q_EMIT currentTabChanged(index);
92 }
93
94 void TrafficSimulationView::actionNew()
95 {
96 QMessageBox warning;
97
98 int ret;
99
100 // spell out a warning that everything will be deleted
101 warning.setText("The whole worksheet will be deleted!");
102 warning.setInformativeText("Do you want to continue?");
103 warning.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
104 ret=warning.exec();
105
106 if(ret==QMessageBox::Yes)
107 {
108 Q_EMIT NewSetup();
109 }
110 }
111
112 void TrafficSimulationView::actionHistory()
113 {
114 if(undoView->isVisible())
115 {
116 undoView->hide();
117 }
118 else
119 {
120 undoView->show();
121 undoView->move(actionMenuHistory->x(),0);
122 undoView->resize(2*width()/5, 3*height()/5 );
123 }
124 }
125
126 void TrafficSimulationView::actionRedo()
127 {
128 Q_EMIT Redo();
129 }
130
131 void TrafficSimulationView::actionUndo()
132 {
133 Q_EMIT Undo();
134 }
135
136 void TrafficSimulationView::actionLoad()
137 {
138 Q_EMIT LoadSetup();
139 }
140
141 void TrafficSimulationView::actionSave()
142 {
143 Q_EMIT SaveSetup();
144 }
145
146 void TrafficSimulationView::adjustWidgets()
147 {
148 experimentBaseView->adjustWidgets(this);
149
150 }
151
152 QUndoView * TrafficSimulationView::getUndoView()
153 {
154 return undoView;
155 }
156
157 ExperimentView * TrafficSimulationView::getExperimentView()
158 {
159 return experimentBaseView->getExperimentView();
160 }
161
162 EnvironmentView * TrafficSimulationView::getEnvironmentView()
163 {
164 return environmentView;
165 }
166
167 EnvironmentDisplayView * TrafficSimulationView::getEnvironmentDisplayView()
168 {
169 return experimentBaseView->getEnvironmentDisplayView();
170 }
171
172 ScenarioDisplayView * TrafficSimulationView::getScenarioDisplayView()
173 {
174 return experimentBaseView->getScenarioDisplayView();
175 }
176
177 ScenarioView * TrafficSimulationView::getScenarioView()
178 {
179 return scenarioView;
180 }
181
182 TrafficView * TrafficSimulationView::getTrafficView()
183 {
184 return trafficView;
185 }
186
187 TrafficDisplayView * TrafficSimulationView::getTrafficDisplayView()
188 {
189 return experimentBaseView->getTrafficDisplayView();
190 }
191
192
193 void TrafficSimulationView::resizeEvent(QResizeEvent * event)
194 {
195 event->ignore();
196 adjustWidgets();
197 }
198
199
200 void TrafficSimulationView::showStatusBarText(QString text, StatusBarView::Color color)
201 {
202 statusbar->showText(text,color);
203 }
204
205 void TrafficSimulationView::hideStatusBar()
206 {
207 statusbar->hide();
208 }
209
210 void TrafficSimulationView::setProfileCatalogueView(QString const & filename)
211 {
212 ui->ProfileCatalogue->setText(filename);
213 }
214
215 void TrafficSimulationView::on_CatalogueBrowse_clicked()
216 {
217 Q_EMIT profileCatalogueChanged();
218 }
219
220 void TrafficSimulationView::on_CatalogueRefresh_clicked()
221 {
222 Q_EMIT refreshCatalogue();
223 }
224
225
226 void TrafficSimulationView::setProfileCatalogueError(const QString &message)
227 {
228 ui->CatalogueError->setText(message);
229 }
TrafficSimulationView::SaveSetup
void SaveSetup()
Signal, emitted after the save-button in the action menu has been clicked.
TrafficSimulationView::window
WindowInterface *const window
pointer to the window interface for registering this view
Definition: TrafficSimulationView.h:300
TrafficSimulationView::getUndoView
QUndoView * getUndoView()
Method that returns the undo view.
Definition: TrafficSimulationView.cpp:152
TrafficSimulationView::Redo
void Redo()
Signal, emitted after the redo-button in the action menu has been clicked.
ExperimentBaseView::getExperimentView
ExperimentView * getExperimentView() const
Method which returns the experiment configuration editor widget.
Definition: ExperimentBaseView.cpp:30
TrafficSimulationView::actionMenuUndo
WindowInterface::Action *const actionMenuUndo
The action menu object for undoing actions.
Definition: TrafficSimulationView.h:308
TrafficSimulationView::hideStatusBar
void hideStatusBar()
Method which hides the info bar.
Definition: TrafficSimulationView.cpp:205
TrafficSimulationView.h
This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other conf...
WindowInterface
This class manages the registration and deregistration of Window Views which include the menu bar wit...
Definition: WindowInterface.h:44
TrafficSimulationView::experimentBaseView
ExperimentBaseView * experimentBaseView
The container widget for the experiment configuration (to be put into the scroll area) ...
Definition: TrafficSimulationView.h:322
TrafficSimulationView::currentTabChanged
void currentTabChanged(int index)
Signal, emitted when the current tab has been changed. Transmits the index of the tab...
ExperimentView
This class provides an editor for configuring the experiment setup, i.e. it is filled with the conten...
Definition: ExperimentView.h:47
Ui
Definition: EnvironmentDisplayView.h:29
TrafficSimulationView::environmentView
EnvironmentView * environmentView
the view of the environment configuration
Definition: TrafficSimulationView.h:317
TrafficSimulationView::actionUndo
void actionUndo()
Slot which is triggered when the undo-button of the action menu has been clicked. Will trigger the un...
Definition: TrafficSimulationView.cpp:131
EnvironmentDisplayView
This class provides a display for a quick overview of the environment configuration.
Definition: EnvironmentDisplayView.h:41
TrafficSimulationView::getEnvironmentView
EnvironmentView * getEnvironmentView()
Method that returns the environment configuration widget (instance of EnvironmentView).
Definition: TrafficSimulationView.cpp:162
TrafficSimulationView::getTrafficView
TrafficView * getTrafficView()
Method that returns the traffic configuration widget (instance of TrafficView).
Definition: TrafficSimulationView.cpp:182
TrafficSimulationView::adjustWidgets
void adjustWidgets()
Method for adjusting the geometry and positioning of child widgets according to the geometry of this ...
Definition: TrafficSimulationView.cpp:146
TrafficSimulationView::undoView
QUndoView *const undoView
the view of the undo stack
Definition: TrafficSimulationView.h:302
TrafficSimulationView::profileCatalogueChanged
void profileCatalogueChanged()
Signal, emitted when the profiles catalogue has been modified by the user.
TrafficSimulationView::actionMenuNew
WindowInterface::Action *const actionMenuNew
The action menu object for the creating a new worksheet.
Definition: TrafficSimulationView.h:305
ExperimentBaseView::adjustWidgets
void adjustWidgets(QWidget *mainWindow)
Method which adjusts the positioning and size of the child widgets. The size of the child widgets is ...
Definition: ExperimentBaseView.cpp:60
ExperimentBaseView::getTrafficDisplayView
TrafficDisplayView * getTrafficDisplayView() const
Method which returns the widget displaying infos on the traffic configuration.
Definition: ExperimentBaseView.cpp:45
WindowInterface::add
virtual void add(WindowInterface::ID const &id, WindowInterface::Button *const button, WindowInterface::Widget *const widget=nullptr, WindowInterface::Menu const &menu={})=0
Registers the Window View with the identifier id, including its selecting button, and its correspondi...
TrafficSimulationView::setProfileCatalogueView
void setProfileCatalogueView(QString const &filename)
Method which sets the filename displayed in the profile catalogue&#39;s line edit to the one passed as an...
Definition: TrafficSimulationView.cpp:210
WindowInterface::remove
virtual bool remove(WindowInterface::ID const &id)=0
Deregisters a Window View with the identifier id.
TrafficSimulationView::actionMenuRedo
WindowInterface::Action *const actionMenuRedo
The action menu object for redoing actions.
Definition: TrafficSimulationView.h:309
ExperimentBaseView::getEnvironmentDisplayView
EnvironmentDisplayView * getEnvironmentDisplayView() const
Method which returns the widget displaying infos on the environment configuration.
Definition: ExperimentBaseView.cpp:40
TrafficSimulationView::getTrafficDisplayView
TrafficDisplayView * getTrafficDisplayView()
Method that returns the traffic display widget (instance of TrafficDisplayView).
Definition: TrafficSimulationView.cpp:187
TrafficSimulationView::getExperimentView
ExperimentView * getExperimentView()
Method that returns the experiment configuration widget (instance of ExperimentView).
Definition: TrafficSimulationView.cpp:157
EnvironmentView
This class provides an editor for configuring the environment setup, i.e. it is filled with the conte...
Definition: EnvironmentView.h:43
TrafficSimulationView::ViewID
static const WindowInterface::ID ViewID
the view id under which this view is registered in the window interface
Definition: TrafficSimulationView.h:301
TrafficSimulationView::getScenarioView
ScenarioView * getScenarioView()
Method that returns the scenario configuration widget (instance of ScenarioView). ...
Definition: TrafficSimulationView.cpp:177
TrafficSimulationView::refreshCatalogue
void refreshCatalogue()
Signal, emitted when the refresh button of the profile catalogue has been clicked by the user...
ExperimentBaseView::getScenarioDisplayView
ScenarioDisplayView * getScenarioDisplayView() const
Method which returns the widget displaying infos on the scenario configuration.
Definition: ExperimentBaseView.cpp:35
TrafficSimulationView::trafficView
TrafficView * trafficView
the view of the traffic configuration
Definition: TrafficSimulationView.h:319
WindowInterface::createButton
static WindowInterface::Button * createButton(WindowInterface::ButtonTitle const &title, WindowInterface::ButtonType const &type=0, WindowInterface::ButtonOrder const &order=-1)
Creates button for a Window View selection with the title title, of type type and located on the side...
Definition: WindowInterface.h:109
TrafficSimulationView::on_CatalogueBrowse_clicked
void on_CatalogueBrowse_clicked()
Slot which is triggered when Browse-button next to the profile catalogue&#39;s line edit is clicked...
Definition: TrafficSimulationView.cpp:215
TrafficSimulationView::ui
Ui::TrafficSimulationView * ui
The ui object defining the components of the view.
Definition: TrafficSimulationView.h:313
TrafficDisplayView
This class provides a display for a quick overview of the traffic configuration.
Definition: TrafficDisplayView.h:42
TrafficSimulationView::on_tabWidget_currentChanged
void on_tabWidget_currentChanged(int index)
Slot, activated when the current tab has changed. Will emit the currentTabChanged signal transmitting...
Definition: TrafficSimulationView.cpp:89
StatusBarView::showText
void showText(QString text, Color color)
Method which displays the given text in the given color in the text browser.
Definition: StatusBarView.cpp:39
TrafficSimulationView::getScenarioDisplayView
ScenarioDisplayView * getScenarioDisplayView()
Method that returns the scenario display widget (instance of ScenarioDisplayView).
Definition: TrafficSimulationView.cpp:172
TrafficSimulationView::on_CatalogueRefresh_clicked
void on_CatalogueRefresh_clicked()
Slot which is triggered when the Refresh button of the profiles catalogue section is clicked...
Definition: TrafficSimulationView.cpp:220
TrafficSimulationView::actionRedo
void actionRedo()
Slot which is triggered when the redo-button of the action menu has been clicked. Will trigger the re...
Definition: TrafficSimulationView.cpp:126
TrafficSimulationView::LoadSetup
void LoadSetup()
Signal, emitted after the load-button in the action menu has been clicked.
TrafficSimulationView::getEnvironmentDisplayView
EnvironmentDisplayView * getEnvironmentDisplayView()
Method that returns the environment display widget (instance of EnvironmentDisplayView).
Definition: TrafficSimulationView.cpp:167
TrafficSimulationView::showStatusBarText
void showStatusBarText(QString text, StatusBarView::Color color)
Method which shows the text message passed as a first argument in the info bar in the color code spec...
Definition: TrafficSimulationView.cpp:200
TrafficSimulationView::actionMenuSave
WindowInterface::Action *const actionMenuSave
The action menu object for saving a slaveConfig file.
Definition: TrafficSimulationView.h:307
TrafficSimulationView::actionSave
void actionSave()
Slot which is triggered when the save-button of the action menu has been clicked. Prompts a file dial...
Definition: TrafficSimulationView.cpp:141
ScenarioDisplayView
This class provides a display for a quick overview of the scenario configuration. ...
Definition: ScenarioDisplayView.h:40
TrafficSimulationView::actionMenuHistory
WindowInterface::Action *const actionMenuHistory
The action menu object for showing the command history.
Definition: TrafficSimulationView.h:310
TrafficSimulationView::statusbar
StatusBarView * statusbar
the info bar object
Definition: TrafficSimulationView.h:314
ExperimentBaseView
This class provides a resizable container widget for the content of the experiment tab...
Definition: ExperimentBaseView.h:46
TrafficView
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content s...
Definition: TrafficView.h:43
TrafficSimulationView::actionHistory
void actionHistory()
Slot which is triggered when the command history button is clicked. Will show or hide the command his...
Definition: TrafficSimulationView.cpp:112
TrafficSimulationView::actionLoad
void actionLoad()
Slot which is triggered when the load-button of the action menu has been clicked. Prompts a file dial...
Definition: TrafficSimulationView.cpp:136
TrafficSimulationView::resizeEvent
virtual void resizeEvent(QResizeEvent *event) override
Reimplementation of the resize event. Triggers adjustWidgets in order to adjust the geometry of the c...
Definition: TrafficSimulationView.cpp:193
StatusBarView::hide
virtual void hide()
Reimplementation of hide. Sets the visible status of the text browser and the checked status of the b...
Definition: StatusBarView.cpp:51
TrafficSimulationView::setProfileCatalogueError
void setProfileCatalogueError(QString const &message)
Method which sets an error message next the profile catalogue&#39;s line edit.
Definition: TrafficSimulationView.cpp:226
TrafficSimulationView::TrafficSimulationView
TrafficSimulationView(WindowInterface *const window, QWidget *parent=nullptr)
Constructor which initialises all attributes, creates the ui object as well as the actions for the ac...
Definition: TrafficSimulationView.cpp:22
ScenarioView
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content ...
Definition: ScenarioView.h:42
WindowInterface::ID
QString ID
The identifier of the stacked widget.
Definition: WindowInterface.h:50
TrafficSimulationView
This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other conf...
Definition: TrafficSimulationView.h:56
TrafficSimulationView::Undo
void Undo()
Signal, emitted after the undo-button in the action menu has been clicked.
StatusBarView
This class defines a status bar.
Definition: StatusBarView.h:39
TrafficSimulationView::scenarioView
ScenarioView * scenarioView
the view of the scenario settings
Definition: TrafficSimulationView.h:318
TrafficSimulationView::actionNew
void actionNew()
Slot which is triggered when the new-button of the action menu has been clicked. Shows a warning dial...
Definition: TrafficSimulationView.cpp:94
TrafficSimulationView::NewSetup
void NewSetup()
Signal, emitted when the new-button in the action menu is clicked.
TrafficSimulationView::actionMenuLoad
WindowInterface::Action *const actionMenuLoad
The action menu object for loading a slaveConfig file.
Definition: TrafficSimulationView.h:306
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationXMLBaseModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficSimulationXMLBaseModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficSimulationXMLBaseModel.h"
12
13 QString const TrafficSimulationXMLBaseModel::KeyRoot = QStringLiteral("slaveConfig");
14 QString const TrafficSimulationXMLBaseModel::KeyProfilesCatalogue = QStringLiteral("ProfilesCatalog");
15
16 QString const TrafficSimulationXMLBaseModel::KeyExperiment = QStringLiteral("ExperimentConfig");
17 QString const TrafficSimulationXMLBaseModel::KeyExperimentID = QStringLiteral("ExperimentID");
18 QString const TrafficSimulationXMLBaseModel::KeyExperimentNumberInvocations = QStringLiteral("NumberOfInvocations");
19 QString const TrafficSimulationXMLBaseModel::KeyExperimentSeed = QStringLiteral("RandomSeed");
20 QString const TrafficSimulationXMLBaseModel::KeyExperimentLibraries = QStringLiteral("Libraries");
21 QString const TrafficSimulationXMLBaseModel::KeyExperimentLoggingGroups = QStringLiteral("LoggingGroups");
22 QString const TrafficSimulationXMLBaseModel::KeyExperimentLoggingGroup = QStringLiteral("LoggingGroup");
23
24 QList<QString> const TrafficSimulationXMLBaseModel::KeyListExperiment =
25 {
26 TrafficSimulationXMLBaseModel::KeyExperimentID,
27 TrafficSimulationXMLBaseModel::KeyExperimentNumberInvocations,
28 TrafficSimulationXMLBaseModel::KeyExperimentSeed,
29 TrafficSimulationXMLBaseModel::KeyExperimentLibraries,
30 TrafficSimulationXMLBaseModel::KeyExperimentLoggingGroups,
31 };
32
33
34
35
36
37 QString const TrafficSimulationXMLBaseModel::KeyEnvironment = QStringLiteral("EnvironmentConfig");
38 QString const TrafficSimulationXMLBaseModel::KeyTimeOfDayMap = QStringLiteral("TimeOfDays");
39 QString const TrafficSimulationXMLBaseModel::KeyTimeOfDay = QStringLiteral("TimeOfDay");
40 QString const TrafficSimulationXMLBaseModel::KeyVisibilityDistanceMap = QStringLiteral("VisibilityDistances");
41 QString const TrafficSimulationXMLBaseModel::KeyVisibilityDistance = QStringLiteral("VisibilityDistance");
42 QString const TrafficSimulationXMLBaseModel::KeyFrictionMap = QStringLiteral("Frictions");
43 QString const TrafficSimulationXMLBaseModel::KeyFriction = QStringLiteral("Friction");
44 QString const TrafficSimulationXMLBaseModel::KeyWeatherMap = QStringLiteral("Weathers");
45 QString const TrafficSimulationXMLBaseModel::KeyWeather = QStringLiteral("Weather");
46
47 QList<QString> const TrafficSimulationXMLBaseModel::KeyListEnvironment =
48 {
49 TrafficSimulationXMLBaseModel::KeyTimeOfDayMap,
50 TrafficSimulationXMLBaseModel::KeyVisibilityDistanceMap,
51 TrafficSimulationXMLBaseModel::KeyFrictionMap,
52 TrafficSimulationXMLBaseModel::KeyWeatherMap,
53 };
54
55
56
57
58
59 QString const TrafficSimulationXMLBaseModel::KeyEgo = QStringLiteral("EgoConfig");
60 QString const TrafficSimulationXMLBaseModel::KeyEgoAgent = QStringLiteral("EgoAgentProfile");
61
62 QList<QString> const TrafficSimulationXMLBaseModel::KeyListEgo =
63 {
64 TrafficSimulationXMLBaseModel::KeyEgoAgent,
65 };
66
67
68
69 QString const TrafficSimulationXMLBaseModel::KeyScenario = QStringLiteral("ScenarioConfig");
70 QString const TrafficSimulationXMLBaseModel::KeyScenarioFile = QStringLiteral("OpenScenarioFile");
71 QString const TrafficSimulationXMLBaseModel::KeyScenarioAgents = QStringLiteral("ScenarioAgentProfiles");
72 QString const TrafficSimulationXMLBaseModel::KeyScenarioAgent = QStringLiteral("ScenarioAgentProfile");
73
74
75 QList<QString> const TrafficSimulationXMLBaseModel::KeyListScenario =
76 {
77 TrafficSimulationXMLBaseModel::KeyScenarioFile,
78 };
79
80
81
82 QString const TrafficSimulationXMLBaseModel::KeyTraffic= QStringLiteral("TrafficConfig");
83 QString const TrafficSimulationXMLBaseModel::KeyTrafficParameters= QStringLiteral("TrafficParameter");
84 QString const TrafficSimulationXMLBaseModel::KeyTrafficRegularLane= QStringLiteral("RegularLane");
85 QString const TrafficSimulationXMLBaseModel::KeyTrafficRightmostLane= QStringLiteral("RightMostLane");
86
87 QString const TrafficSimulationXMLBaseModel::KeyTrafficAgent= QStringLiteral("AgentProfile");
88 QString const TrafficSimulationXMLBaseModel::KeyTrafficVolumes= QStringLiteral("TrafficVolumes");
89 QString const TrafficSimulationXMLBaseModel::KeyTrafficVolume= QStringLiteral("TrafficVolume");
90 QString const TrafficSimulationXMLBaseModel::KeyTrafficPlatoonRates= QStringLiteral("PlatoonRates");
91 QString const TrafficSimulationXMLBaseModel::KeyTrafficPlatoonRate= QStringLiteral("PlatoonRate");
92 QString const TrafficSimulationXMLBaseModel::KeyTrafficVelocities= QStringLiteral("Velocities");
93 QString const TrafficSimulationXMLBaseModel::KeyTrafficVelocity= QStringLiteral("Velocity");
94 QString const TrafficSimulationXMLBaseModel::KeyTrafficHomogeneities= QStringLiteral("Homogenities");
95 QString const TrafficSimulationXMLBaseModel::KeyTrafficHomogeneity= QStringLiteral("Homogenity");
96
97
98 QList<QString> const TrafficSimulationXMLBaseModel::KeyListTraffic =
99 {
100 TrafficSimulationXMLBaseModel::KeyTrafficParameters,
101 TrafficSimulationXMLBaseModel::KeyTrafficRegularLane,
102 TrafficSimulationXMLBaseModel::KeyTrafficRightmostLane,
103 };
104
105
106 QList<QString> const TrafficSimulationXMLBaseModel::KeyListTrafficParameters =
107 {
108 TrafficSimulationXMLBaseModel::KeyTrafficVolumes,
109 TrafficSimulationXMLBaseModel::KeyTrafficPlatoonRates,
110 TrafficSimulationXMLBaseModel::KeyTrafficVelocities,
111 TrafficSimulationXMLBaseModel::KeyTrafficHomogeneities,
112 };
113
TrafficSimulationXMLBaseModel.h
This class defines the XML element names of the combination XML file.
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationXMLLoadModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficSimulationXMLLoadModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficSimulationXMLLoadModel.h"
12
13 bool TrafficSimulationXMLLoadModel::load(const QString &filepath,
14 TrafficSimulationInterface * const trafficSimulation)
15 {
16
17 QFile file(filepath);
18 bool success = true;
19
20 if(file.open(QIODevice::ReadOnly | QIODevice::Text))
21 {
22 QXmlStreamReader xml(&file);
23
24 //verify Root element
25 xml.readNextStartElement();
26
27 if(xml.name() != KeyRoot)
28 return false;
29
30 // set the Profiles catalogue and generate agents list
31 xml.readNextStartElement();
32 if(xml.name() == KeyProfilesCatalogue)
33 {
34 TrafficSimulationInterface::ProfilesCatalogue catalogue = xml.readElementText();
35 trafficSimulation->setProfilesCatalogue(catalogue);
36 }
37 else
38 return false;
39
40 while(xml.readNextStartElement())
41 {
42 if(xml.name() == KeyExperiment)
43 success = loadExperiment(xml,trafficSimulation->getExperiment()) && success;
44 else if (xml.name() == KeyEnvironment )
45 {
46 trafficSimulation->getEnvironment()->setName(xml.attributes().value("Name").toString());
47 success = loadEnvironment(xml, trafficSimulation->getEnvironment()) && success;
48 }
49 else if(xml.name() == KeyScenario)
50 {
51 trafficSimulation->getScenario()->setName(xml.attributes().value("Name").toString());
52 success = loadScenarioConfig(xml, trafficSimulation->getScenario()) && success;
53 }
54 else if(xml.name() == KeyTraffic)
55 {
56 trafficSimulation->getTraffic()->setName(xml.attributes().value("Name").toString());
57 success = loadTraffic(xml, trafficSimulation->getTraffic());
58 }
59 else
60 xml.skipCurrentElement();
61 }
62
63 return success;
64 }
65
66 return false;
67 }
68
69 bool TrafficSimulationXMLLoadModel::loadAgentProfiles(TrafficSimulationInterface::ProfilesCatalogue catalogue,
70 QList<QString> &agents)
71 {
72
73 agents.clear();
74 QFile file(catalogue);
75
76 if(!catalogue.isEmpty() && file.open(QIODevice::ReadOnly | QIODevice::Text))
77 {
78 QXmlStreamReader xml(&file);
79
80 // verify header
81 xml.readNextStartElement();
82 if(xml.name() != "Profiles")
83 return false;
84
85 while(xml.readNextStartElement())
86 {
87 if(xml.name() == "AgentProfiles")
88 {
89 while(xml.readNextStartElement())
90 {
91 if(xml.name() == "AgentProfile")
92 {
93 agents << xml.attributes().value("Name").toString() ;
94 xml.skipCurrentElement();
95 }
96
97 else
98 xml.skipCurrentElement();
99 }
100 }
101 else
102 xml.skipCurrentElement();
103 }
104 }
105
106 return true;
107 }
108
109
110 bool TrafficSimulationXMLLoadModel::loadExperiment(QXmlStreamReader &xml,
111 ExperimentInterface *experiment)
112 {
113 bool success = true;
114 QList <QString> elements = KeyListExperiment;
115
116 while(xml.readNextStartElement())
117 {
118 if(xml.name() == KeyExperimentID)
119 {
120 xml.skipCurrentElement();
121 elements.removeAll(KeyExperimentID);
122 }
123 else if(xml.name()==KeyExperimentNumberInvocations)
124 {
125 experiment->setNumberInvocations(xml.readElementText().toInt());
126 elements.removeAll(KeyExperimentNumberInvocations);
127 }
128 else if(xml.name()==KeyExperimentSeed)
129 {
130 experiment->setSeed(xml.readElementText().toInt());
131 elements.removeAll(KeyExperimentSeed);
132 }
133 else if(xml.name() == KeyExperimentLibraries)
134 {
135 success = loadLibraries(xml, experiment->getLibraries()) && success;
136 elements.removeAll(KeyExperimentLibraries);
137 }
138 else if(xml.name() == KeyExperimentLoggingGroups)
139 {
140 success = loadLoggingGroups(xml, experiment->getLoggingGroups()) && success;
141 elements.removeAll(KeyExperimentLoggingGroups);
142 }
143 else
144 xml.skipCurrentElement();
145 }
146
147 return elements.isEmpty() && success;
148
149 }
150
151 bool TrafficSimulationXMLLoadModel::loadLibraries(QXmlStreamReader &xml,
152 ExperimentInterface::Libraries * const libraries)
153 {
154 while (xml.readNextStartElement())
155 libraries->insert(xml.name().toString(), xml.readElementText());
156
157 return true;
158 }
159
160 bool TrafficSimulationXMLLoadModel::loadLoggingGroups(QXmlStreamReader &xml,
161 ExperimentInterface::LoggingGroups * const loggingGroups)
162 {
163 while(xml.readNextStartElement())
164 {
165 if(xml.name() == KeyExperimentLoggingGroup)
166 loggingGroups->append(xml.readElementText());
167 else
168 return false;
169 }
170
171 return true;
172 }
173
174 bool TrafficSimulationXMLLoadModel::loadEnvironment(QXmlStreamReader &xml,
175 EnvironmentInterface *environment)
176 {
177 bool success = true;
178 QList<QString> keys = KeyListEnvironment;
179
180 while(xml.readNextStartElement())
181 {
182
183 keys.removeAll(xml.name().toString());
184
185 if(xml.name() == KeyTimeOfDayMap)
186 success = loadTimeOfDayMap(xml, environment) && success;
187
188 else if(xml.name() == KeyVisibilityDistanceMap)
189 success = loadVisibilityDistanceMap(xml,environment) && success;
190
191 else if(xml.name() == KeyFrictionMap)
192 success = loadFrictionMap(xml, environment) && success;
193
194 else if(xml.name() == KeyWeatherMap)
195 success = loadWeatherMap(xml, environment) && success;
196
197 else
198 xml.skipCurrentElement();
199 }
200
201 return success && keys.isEmpty();
202 }
203
204 bool TrafficSimulationXMLLoadModel::loadTimeOfDayMap(QXmlStreamReader &xml, EnvironmentInterface * environment)
205 {
206
207 while(xml.readNextStartElement())
208 {
209
210 if(xml.name() == KeyTimeOfDay )
211 {
212 EnvironmentItemInterface * item = environment->createItem(xml.attributes().value("Value").toString(),
213 xml.attributes().value("Probability").toDouble());
214
215 EnvironmentInterface::ID id = (environment->getTimeOfDayMap()->isEmpty()) ?
216 1 : environment->getTimeOfDayMap()->lastKey() + 1;
217
218 environment->getTimeOfDayMap()->insert(id, item);
219
220 xml.readElementText();
221 }
222 else
223 {
224 xml.skipCurrentElement();
225 return false;
226 }
227 }
228
229 return true;
230 }
231
232 bool TrafficSimulationXMLLoadModel::loadVisibilityDistanceMap(QXmlStreamReader &xml, EnvironmentInterface * environment)
233 {
234
235 while(xml.readNextStartElement())
236 {
237
238 if(xml.name() == KeyVisibilityDistance )
239 {
240 EnvironmentItemInterface * item = environment->createItem(xml.attributes().value("Value").toString(),
241 xml.attributes().value("Probability").toDouble());
242
243 EnvironmentInterface::ID id = (environment->getVisibilityDistanceMap()->isEmpty()) ?
244 1 : environment->getVisibilityDistanceMap()->lastKey() + 1;
245
246 environment->getVisibilityDistanceMap()->insert(id, item);
247
248 xml.readElementText();
249 }
250 else
251 {
252 xml.skipCurrentElement();
253 return false;
254 }
255 }
256
257 return true;
258 }
259
260 bool TrafficSimulationXMLLoadModel::loadFrictionMap(QXmlStreamReader &xml, EnvironmentInterface * environment)
261 {
262
263 while(xml.readNextStartElement())
264 {
265
266 if(xml.name() == KeyFriction )
267 {
268 EnvironmentItemInterface * item = environment->createItem(xml.attributes().value("Value").toString(),
269 xml.attributes().value("Probability").toDouble());
270
271 EnvironmentInterface::ID id = (environment->getFrictionMap()->isEmpty()) ?
272 1 : environment->getFrictionMap()->lastKey() + 1;
273
274 environment->getFrictionMap()->insert(id, item);
275
276 xml.readElementText();
277 }
278 else
279 {
280 xml.skipCurrentElement();
281 return false;
282 }
283 }
284
285 return true;
286 }
287
288 bool TrafficSimulationXMLLoadModel::loadWeatherMap(QXmlStreamReader &xml, EnvironmentInterface * environment)
289 {
290
291 while(xml.readNextStartElement())
292 {
293
294 if(xml.name() == KeyWeather )
295 {
296 EnvironmentItemInterface * item = environment->createItem(xml.attributes().value("Value").toString(),
297 xml.attributes().value("Probability").toDouble());
298
299 EnvironmentInterface::ID id = (environment->getWeatherMap()->isEmpty()) ?
300 1 : environment->getWeatherMap()->lastKey() + 1;
301
302 environment->getWeatherMap()->insert(id, item);
303
304 xml.readElementText();
305 }
306 else
307 {
308 xml.skipCurrentElement();
309 return false;
310 }
311 }
312
313 return true;
314 }
315
316 bool TrafficSimulationXMLLoadModel::loadScenarioConfig(QXmlStreamReader &xml, ScenarioInterface *scenario)
317 {
318
319 bool success = true;
320 QList<QString> keys = KeyListScenario;
321
322 while(xml.readNextStartElement())
323 {
324 if(xml.name() == KeyScenarioFile)
325 {
326 scenario->setScenarioFile(xml.readElementText());
327 keys.removeAll(KeyScenarioFile);
328 }
329 }
330
331 return keys.isEmpty() && success;
332 }
333
334 bool TrafficSimulationXMLLoadModel::loadEntities(ScenarioInterface * scenario, QString const &scenarioFile)
335 {
336 bool success = true;
337 QFile file(scenarioFile);
338
339 // Read the scenario file and get Entities
340 if(file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text) )
341 {
342 QXmlStreamReader xml(&file);
343 xml.readNextStartElement();
344
345 // verify openScenario Header
346 if(xml.name() != "OpenSCENARIO")
347 return false;
348
349 // scan the scenario file for <entities>
350 while( xml.readNextStartElement() )
351 {
352 if(xml.name() == "Entities")
353 success = loadScenarioObjects(xml, scenario->getEntities()) && success;
354
355 else
356 xml.skipCurrentElement();
357 }
358 }
359
360
361 Q_EMIT scenario->setEntities();
362
363 return success;
364 }
365
366 bool TrafficSimulationXMLLoadModel::loadScenarioObjects(QXmlStreamReader & xml, ScenarioInterface::Entities *entities)
367 {
368 while(xml.readNextStartElement())
369 {
370 if(xml.name() == "Object")
371 {
372 ScenarioInterface::Name name = xml.attributes().value("name").toString();
373
374 while(xml.readNextStartElement())
375 {
376
377 if( xml.name() == "CatalogReference" )
378 {
379 ScenarioInterface::CatalogueName catalogName = xml.attributes().value("catalogName").toString();
380 ScenarioInterface::EntryName entryName = xml.attributes().value("entryName").toString();
381 entities->insert(name, ScenarioInterface::CatalogueRef(catalogName,entryName));
382 xml.skipCurrentElement();
383 }
384 else
385 xml.skipCurrentElement();
386 }
387 }
388 else
389 {
390 return false;
391 }
392 }
393
394 return true;
395 }
396
397 bool TrafficSimulationXMLLoadModel::loadTraffic(QXmlStreamReader &xml, TrafficInterface *traffic)
398 {
399 bool success = true;
400 QList<QString> keys = KeyListTraffic;
401
402 while(xml.readNextStartElement())
403 {
404
405 keys.removeAll(xml.name().toString());
406
407 if(xml.name() == KeyTrafficParameters)
408 success = loadTrafficParameters(xml, traffic) && success;
409
410 else if(xml.name() == KeyTrafficRegularLane)
411 success = loadTrafficAgents(xml, traffic->getAgentsRegularLane()) && success;
412
413 else if(xml.name() == KeyTrafficRightmostLane)
414 success = loadTrafficAgents(xml, traffic->getAgentsRightMostLane()) && success;
415 else
416 xml.skipCurrentElement();
417 }
418
419 return success && keys.isEmpty();
420 }
421
422 bool TrafficSimulationXMLLoadModel::loadTrafficParameters(QXmlStreamReader &xml, TrafficInterface *traffic)
423 {
424 bool success = true;
425 QList<QString> keys = KeyListTrafficParameters;
426
427 while(xml.readNextStartElement())
428 {
429 keys.removeAll(xml.name().toString());
430
431 if(xml.name() == KeyTrafficVolumes)
432 success = loadTrafficVolumes(xml, traffic->getVolumes()) && success;
433
434 else if (xml.name() == KeyTrafficPlatoonRates)
435 success = loadTrafficPlatoonRates(xml, traffic->getPlatoonRates()) && success;
436
437 else if (xml.name() == KeyTrafficVelocities)
438 success = loadTrafficVelocities(xml, traffic->getVelocities()) && success;
439
440 else if (xml.name() == KeyTrafficHomogeneities)
441 success = loadTrafficHomogeneities(xml, traffic->getHomogeneities()) && success;
442
443 else
444 xml.skipCurrentElement();
445 }
446
447 return success && keys.isEmpty();
448 }
449
450 bool TrafficSimulationXMLLoadModel::loadTrafficVolumes(QXmlStreamReader &xml, TrafficItemMapInterface*volumes)
451 {
452
453 while(xml.readNextStartElement())
454 {
455
456 if(xml.name() == KeyTrafficVolume )
457 {
458 TrafficItemMapInterface::ID id = volumes->generateID();
459 volumes->add(id,0.0, "");
460 TrafficItemInterface* volume = volumes->getItem(id);
461
462 volume->setValue(xml.attributes().value("Value").toString());
463 volume->setProbability(xml.attributes().value("Probability").toDouble());
464
465 xml.readElementText();
466 }
467 else
468 {
469 xml.skipCurrentElement();
470 return false;
471 }
472 }
473
474 return true;
475 }
476
477 bool TrafficSimulationXMLLoadModel::loadTrafficPlatoonRates(QXmlStreamReader &xml, TrafficItemMapInterface *platoonRates)
478 {
479
480 while(xml.readNextStartElement())
481 {
482 if(xml.name() == KeyTrafficPlatoonRate )
483 {
484 TrafficItemMapInterface::ID id = platoonRates->generateID();
485 platoonRates->add(id,0, "");
486 TrafficItemInterface * platoonRate = platoonRates->getItem(id);
487
488 platoonRate->setValue(xml.attributes().value("Value").toString());
489 platoonRate->setProbability(xml.attributes().value("Probability").toDouble());
490
491 xml.readElementText();
492 }
493 else
494 {
495 xml.skipCurrentElement();
496 return false;
497 }
498 }
499
500 return true;
501
502 }
503
504 bool TrafficSimulationXMLLoadModel::loadTrafficVelocities(QXmlStreamReader &xml, TrafficItemMapInterface *velocities)
505 {
506
507 while(xml.readNextStartElement())
508 {
509
510 if(xml.name() == KeyTrafficVelocity )
511 {
512 TrafficItemMapInterface::ID id = velocities->generateID();
513 velocities->add(id,0, "");
514 TrafficItemInterface* velocity = velocities->getItem(id);
515
516 velocity->setValue(xml.attributes().value("Value").toString());
517 velocity->setProbability(xml.attributes().value("Probability").toDouble());
518
519 xml.readElementText();
520 }
521 else
522 {
523 xml.skipCurrentElement();
524 return false;
525 }
526 }
527 return true;
528
529 }
530
531
532
533 bool TrafficSimulationXMLLoadModel::loadTrafficHomogeneities(QXmlStreamReader &xml, TrafficItemMapInterface *homogeneities)
534 {
535
536 while(xml.readNextStartElement())
537 {
538 if(xml.name() == KeyTrafficHomogeneity )
539 {
540 TrafficItemMapInterface::ID id = homogeneities->generateID();
541 homogeneities->add(id,0, "");
542 TrafficItemInterface* homogeneity = homogeneities->getItem(id);
543
544 homogeneity->setValue(xml.attributes().value("Value").toString());
545 homogeneity->setProbability(xml.attributes().value("Probability").toDouble());
546
547 xml.readElementText();
548 }
549 else
550 {
551 xml.skipCurrentElement();
552 return false;
553 }
554 }
555 return true;
556 }
557
558
559 bool TrafficSimulationXMLLoadModel::loadTrafficAgents(QXmlStreamReader &xml, TrafficItemMapInterface *agents)
560 {
561 while(xml.readNextStartElement())
562 {
563 if(xml.name()==KeyTrafficAgent)
564 {
565 TrafficItemMapInterface::ID id = agents->generateID();
566 agents->add(id, 0, "");
567 TrafficItemInterface* agent = agents->getItem(id);
568
569
570 agent->setValue(xml.attributes().value("Name").toString());
571 agent->setProbability(xml.attributes().value("Probability").toDouble());
572
573 xml.readElementText();
574 }
575 else
576 {
577 xml.skipCurrentElement();
578 return false;
579 }
580 }
581
582 return true;
583 }
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
ExperimentInterface::getLoggingGroups
virtual LoggingGroups * getLoggingGroups() const =0
Returns the pointer to the list of Logging Groups.
ScenarioInterface::setEntities
void setEntities()
Signal, emitted when the entities map of the scenario setup has been set.
ExperimentInterface::Libraries
QMap< QString, QString > Libraries
The map of libraries needed by the simulation slave.
Definition: ExperimentInterface.h:47
TrafficSimulationXMLLoadModel::loadTrafficPlatoonRates
static bool loadTrafficPlatoonRates(QXmlStreamReader &xml, TrafficItemMapInterface *platoonRates)
This method reads all platoon rates, being subelements of <TrafficParameters>, from the combination x...
Definition: TrafficSimulationXMLLoadModel.cpp:477
TrafficSimulationInterface::getTraffic
virtual TrafficInterface * getTraffic() const =0
Returns the pointer to the traffic configuration object, i.e. an instance of the TrafficInterface cla...
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficSimulationXMLLoadModel::loadWeatherMap
static bool loadWeatherMap(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all weather entries from the combination xml file and stores their values and proba...
Definition: TrafficSimulationXMLLoadModel.cpp:288
ExperimentInterface::getLibraries
virtual Libraries * getLibraries() const =0
Returns the pointer to the Libraries map.
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficInterface::getVelocities
virtual Velocities * getVelocities() const =0
Returns the map for registering velocities.
TrafficSimulationXMLLoadModel::load
static bool load(const QString &filepath, TrafficSimulationInterface *const trafficSimulation)
This method manages the whole loading process and calls the subroutines for loading the particular se...
Definition: TrafficSimulationXMLLoadModel.cpp:13
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
EnvironmentInterface::ID
unsigned int ID
A key identifier for the map of environment items.
Definition: EnvironmentInterface.h:54
TrafficSimulationXMLLoadModel::loadVisibilityDistanceMap
static bool loadVisibilityDistanceMap(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all visibility distances from the combination xml file and stores their values and ...
Definition: TrafficSimulationXMLLoadModel.cpp:232
ExperimentInterface::LoggingGroups
QStringList LoggingGroups
The list of logging groups.
Definition: ExperimentInterface.h:48
TrafficInterface::getVolumes
virtual Volumes * getVolumes() const =0
Returns the map for registering traffic volumes.
TrafficSimulationXMLLoadModel::loadTrafficParameters
static bool loadTrafficParameters(QXmlStreamReader &xml, TrafficInterface *traffic)
This method reads all xml elements connected to <TrafficParameters> from the combination xml file and...
Definition: TrafficSimulationXMLLoadModel.cpp:422
ScenarioInterface::CatalogueRef
QPair< CatalogueName, EntryName > CatalogueRef
A catalogue reference, i.e. a reference to an entry (second) in an agent profiles catalogue (first) ...
Definition: ScenarioInterface.h:45
ScenarioInterface::CatalogueName
QString CatalogueName
The name of the catalogue in which an agent profile is defined.
Definition: ScenarioInterface.h:43
ScenarioInterface::setName
virtual void setName(Name const &newName)=0
Sets the name of the scenario to the given name.
TrafficSimulationXMLLoadModel::loadTraffic
static bool loadTraffic(QXmlStreamReader &xml, TrafficInterface *traffic)
This method reads all xml elements connected to <TrafficConfig> from the combination xml file and sto...
Definition: TrafficSimulationXMLLoadModel.cpp:397
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
ScenarioInterface::EntryName
QString EntryName
An entry in the catalogue of agent profiles.
Definition: ScenarioInterface.h:44
TrafficSimulationXMLLoadModel::loadExperiment
static bool loadExperiment(QXmlStreamReader &xml, ExperimentInterface *experiment)
This method reads all xml elements connected to <ExperimentConfig> from the slaveConfig xml file and ...
Definition: TrafficSimulationXMLLoadModel.cpp:110
TrafficSimulationXMLLoadModel::loadScenarioConfig
static bool loadScenarioConfig(QXmlStreamReader &xml, ScenarioInterface *scenario)
This method reads all xml elements connected to <ScenarioConfig> from the combination xml file...
Definition: TrafficSimulationXMLLoadModel.cpp:316
TrafficSimulationInterface
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
Definition: TrafficSimulationInterface.h:37
TrafficInterface::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const =0
Returns the map for registering platoon rates.
EnvironmentInterface::getFrictionMap
virtual FrictionMap * getFrictionMap() const =0
Returns a pointer to the map of friction coefficients.
TrafficSimulationInterface::setProfilesCatalogue
virtual void setProfilesCatalogue(ProfilesCatalogue const &_profilesCatalogue)=0
Sets the current profiles catalogue to the one passed as an argument.
TrafficSimulationXMLLoadModel::loadFrictionMap
static bool loadFrictionMap(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all friction coefficinets from the combination xml file and stores their values and...
Definition: TrafficSimulationXMLLoadModel.cpp:260
TrafficInterface::getHomogeneities
virtual Homogeneities * getHomogeneities() const =0
Returns the map for registering homogeneities.
ScenarioInterface::Name
QString Name
The name of the scenario.
Definition: ScenarioInterface.h:42
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
ScenarioInterface::getEntities
virtual Entities * getEntities() const =0
Returns the map (= container class) in which all scenario agents information is registered. This comprises a name of the agent profile (key) and a catalogue reference (value).
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
TrafficSimulationXMLLoadModel::loadTrafficHomogeneities
static bool loadTrafficHomogeneities(QXmlStreamReader &xml, TrafficItemMapInterface *homogeneities)
This method reads all homogeneities, being subelements of <TrafficParameters>, from the combination x...
Definition: TrafficSimulationXMLLoadModel.cpp:533
TrafficInterface::setName
virtual void setName(Name const &_name)=0
Sets the name of the traffic setup to the one passed as an argument.
EnvironmentInterface::getVisibilityDistanceMap
virtual VisibilityDistanceMap * getVisibilityDistanceMap() const =0
Returns a pointer to the map of visibility distances.
EnvironmentInterface::createItem
virtual Item * createItem(Item::Value const &value, Item::Probability const &probability)=0
Creates an environmental parameter (i.e. an instance of EnvironmentItemInterface) with the given valu...
TrafficSimulationInterface::getEnvironment
virtual EnvironmentInterface * getEnvironment() const =0
Returns the pointer to the environment configuration object, i.e. an instance of the EnvironmentInter...
TrafficSimulationInterface::getExperiment
virtual ExperimentInterface * getExperiment() const =0
Returns the pointer to the experiment configuration object, i.e. an instance of the ExperimentInterfa...
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
EnvironmentInterface::getWeatherMap
virtual WeatherMap * getWeatherMap() const =0
Returns a pointer to the map of whether parameters.
TrafficSimulationXMLLoadModel::loadEnvironment
static bool loadEnvironment(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all xml elements connected to <EnvironmentConfig> from the combination xml file and...
Definition: TrafficSimulationXMLLoadModel.cpp:174
TrafficSimulationXMLLoadModel::loadLibraries
static bool loadLibraries(QXmlStreamReader &xml, ExperimentInterface::Libraries *const libraries)
This method reads all xml elements of <Libraries> within the <ExperimentConfig> element. These correspond to the libraries needed by the simulation slave.
Definition: TrafficSimulationXMLLoadModel.cpp:151
EnvironmentInterface::getTimeOfDayMap
virtual TimeOfDayMap * getTimeOfDayMap() const =0
Returns a pointer to the time of day parameter map.
TrafficSimulationXMLLoadModel::loadTrafficAgents
static bool loadTrafficAgents(QXmlStreamReader &xml, TrafficItemMapInterface *agents)
This method reads all agent profiles from the combination xml file and stores their names and probabi...
Definition: TrafficSimulationXMLLoadModel.cpp:559
TrafficItemMapInterface::generateID
virtual TrafficItemMapInterface::ID generateID() const =0
Method which returns the highest unoccupied ID of the map.
ExperimentInterface::setNumberInvocations
virtual void setNumberInvocations(NumberInvocations const &_numberInvocations)=0
Sets the number of invocations of the experiment.
ScenarioInterface::setScenarioFile
virtual void setScenarioFile(ScenarioFile const &filename)=0
Sets the filename of the open scenario file to the one passed as an argument.
EnvironmentInterface::setName
virtual void setName(Name const &_name)=0
Sets the name of the environment configuration to the one passed as an argument.
TrafficSimulationXMLLoadModel::loadLoggingGroups
static bool loadLoggingGroups(QXmlStreamReader &xml, ExperimentInterface::LoggingGroups *const loggingGroups)
This method reads all xml elements of <LoggingGroups> within the <ExperimentConfig> element...
Definition: TrafficSimulationXMLLoadModel.cpp:160
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
TrafficSimulationXMLLoadModel::loadTimeOfDayMap
static bool loadTimeOfDayMap(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all time of day entries from the combination xml file and stores their values and p...
Definition: TrafficSimulationXMLLoadModel.cpp:204
TrafficSimulationXMLLoadModel::loadTrafficVelocities
static bool loadTrafficVelocities(QXmlStreamReader &xml, TrafficItemMapInterface *velocities)
This method reads all velocities, being subelements of <TrafficParameters>, from the combination xml ...
Definition: TrafficSimulationXMLLoadModel.cpp:504
TrafficSimulationXMLLoadModel.h
This class provides routines for loading the combination XML file and for storing all information in ...
ExperimentInterface::setSeed
virtual void setSeed(Seed const &_seed)=0
Sets the seed used for random number generation.
ExperimentInterface
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
Definition: ExperimentInterface.h:39
TrafficItemMapInterface::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0
Method which creates a traffic item and registers it under the ID passed as a first argument...
TrafficItemInterface::setValue
virtual void setValue(Value const &_value)=0
Sets the traffic item&#39;s value to the value passed as an argument.
ScenarioInterface::Entities
QMap< Name, CatalogueRef > Entities
The mapping of a scenario agent to an agent profile (catalogue reference)
Definition: ScenarioInterface.h:46
TrafficSimulationXMLLoadModel::loadTrafficVolumes
static bool loadTrafficVolumes(QXmlStreamReader &xml, TrafficItemMapInterface *volumes)
This method reads all traffic volumes, being subelements of <TrafficParameters>, from the combination...
Definition: TrafficSimulationXMLLoadModel.cpp:450
TrafficSimulationInterface::getScenario
virtual ScenarioInterface * getScenario() const =0
Returns the pointer to the scenario configuration object, i.e. an instance of the ScenarioInterface c...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationXMLSaveModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficSimulationXMLSaveModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficSimulationXMLSaveModel.h"
12
13 bool TrafficSimulationXMLSaveModel::save(QString const & filepath,
14 TrafficSimulationInterface const * const trafficSimulation)
15 {
16 QFile file(filepath);
17
18 if(file.open(QIODevice::WriteOnly | QIODevice::Text))
19 {
20 QXmlStreamWriter xml(&file);
21
22 xml.setAutoFormatting(true);
23 xml.setAutoFormattingIndent(2);
24
25 // Start Document
26 xml.writeStartDocument();
27
28 // Root Element
29 xml.writeStartElement(KeyRoot);
30 xml.writeAttribute("SchemaVersion", "0.6.1");
31
32 // Save Profiles catalogue
33 xml.writeTextElement(KeyProfilesCatalogue, trafficSimulation->getProfilesCatalogue());
34
35 // Save Experiment
36 saveExperiment(xml, trafficSimulation->getExperiment());
37
38 // Save Environment
39 saveEnvironment(xml, trafficSimulation->getEnvironment());
40
41 // Save Scenario
42 saveScenario(xml,trafficSimulation->getScenario());
43
44 // Save Traffic
45 saveTraffic(xml, trafficSimulation->getTraffic());
46
47 xml.writeEndElement();
48 // End Document
49 xml.writeEndDocument();
50
51 return true;
52 }
53
54 return false;
55 }
56
57 void TrafficSimulationXMLSaveModel::saveExperiment(QXmlStreamWriter & xml,
58 ExperimentInterface * experiment)
59 {
60 xml.writeStartElement(KeyExperiment);
61
62 xml.writeTextElement(KeyExperimentID, QString::number(experiment->getID()));
63 xml.writeTextElement(KeyExperimentNumberInvocations, QString::number(experiment->getNumberInvocations()));
64 xml.writeTextElement(KeyExperimentSeed, QString::number(experiment->getSeed()));
65
66 saveLibraries(xml, experiment->getLibraries());
67 saveLoggingGroups(xml, experiment->getLoggingGroups());
68
69 xml.writeEndElement();
70 xml.writeComment("#############################################################################################");
71
72 }
73
74 void TrafficSimulationXMLSaveModel::saveLibraries(QXmlStreamWriter &xml,
75 ExperimentInterface::Libraries * const libraries)
76 {
77 xml.writeStartElement(KeyExperimentLibraries);
78
79 for(auto type : libraries->keys())
80 xml.writeTextElement(type, libraries->value(type));
81
82 xml.writeEndElement();
83 }
84
85 void TrafficSimulationXMLSaveModel::saveLoggingGroups(QXmlStreamWriter &xml,
86 ExperimentInterface::LoggingGroups * const loggingGroups)
87 {
88 xml.writeStartElement(KeyExperimentLoggingGroups);
89
90 for (auto loggingGroup : *loggingGroups)
91 xml.writeTextElement(KeyExperimentLoggingGroup, loggingGroup);
92
93 xml.writeEndElement();
94 }
95
96 void TrafficSimulationXMLSaveModel::saveEnvironment(QXmlStreamWriter &xml,
97 EnvironmentInterface *environment)
98 {
99 // Save Environment
100 xml.writeStartElement(KeyEnvironment);
101 xml.writeAttribute(QString("Name"), environment->getName());
102
103 saveTimeOfDayMap(xml, environment->getTimeOfDayMap());
104
105 saveVisibilityDistanceMap(xml, environment->getVisibilityDistanceMap());
106
107 saveFrictionMap(xml, environment->getFrictionMap());
108
109 saveWeatherMap(xml, environment->getWeatherMap());
110
111 xml.writeEndElement();
112 xml.writeComment("#############################################################################################");
113 }
114
115 void TrafficSimulationXMLSaveModel::saveTimeOfDayMap(QXmlStreamWriter & xml,
116 EnvironmentInterface::TimeOfDayMap * map)
117 {
118
119 xml.writeStartElement(KeyTimeOfDayMap);
120 for(auto item : map->values())
121 {
122 xml.writeStartElement(KeyTimeOfDay);
123 xml.writeAttribute(QString("Value"), item->getValue());
124 xml.writeAttribute(QString("Probability"), QString::number(item->getProbability()));
125 xml.writeEndElement();
126 }
127
128 xml.writeEndElement();
129 }
130
131 void TrafficSimulationXMLSaveModel::saveVisibilityDistanceMap(QXmlStreamWriter & xml,
132 EnvironmentInterface::VisibilityDistanceMap * map)
133 {
134
135 xml.writeStartElement(KeyVisibilityDistanceMap);
136 for(auto item : map->values())
137 {
138 xml.writeStartElement(KeyVisibilityDistance);
139 xml.writeAttribute(QString("Value"), item->getValue());
140 xml.writeAttribute(QString("Probability"), QString::number(item->getProbability()));
141 xml.writeEndElement();
142 }
143
144 xml.writeEndElement();
145 }
146
147 void TrafficSimulationXMLSaveModel::saveFrictionMap(QXmlStreamWriter & xml,
148 EnvironmentInterface::FrictionMap * map)
149 {
150
151 xml.writeStartElement(KeyFrictionMap);
152 for(auto item : map->values())
153 {
154 xml.writeStartElement(KeyFriction);
155 xml.writeAttribute(QString("Value"), item->getValue());
156 xml.writeAttribute(QString("Probability"), QString::number(item->getProbability()));
157 xml.writeEndElement();
158 }
159
160 xml.writeEndElement();
161 }
162
163 void TrafficSimulationXMLSaveModel::saveWeatherMap(QXmlStreamWriter & xml,
164 EnvironmentInterface::WeatherMap * map)
165 {
166
167 xml.writeStartElement(KeyWeatherMap);
168 for(auto item : map->values())
169 {
170 xml.writeStartElement(KeyWeather);
171 xml.writeAttribute(QString("Value"), item->getValue());
172 xml.writeAttribute(QString("Probability"), QString::number(item->getProbability()));
173 xml.writeEndElement();
174 }
175
176 xml.writeEndElement();
177 }
178
179 void TrafficSimulationXMLSaveModel::saveScenario(QXmlStreamWriter &xml,
180 ScenarioInterface *scenario)
181 {
182 // Save Scenario Configs
183 xml.writeStartElement(KeyScenario);
184 xml.writeAttribute(QString("Name"),scenario->getName());
185
186 xml.writeTextElement(KeyScenarioFile, scenario->getScenarioFile());
187
188 xml.writeEndElement();
189 xml.writeComment("#############################################################################################");
190
191 }
192
193
194 void TrafficSimulationXMLSaveModel::saveTraffic(QXmlStreamWriter &xml,
195 TrafficInterface *traffic)
196 {
197 xml.writeStartElement(KeyTraffic);
198 xml.writeAttribute(QString("Name"), traffic->getName());
199
200 saveTrafficParameters(xml, traffic);
201 saveTrafficRegularLane(xml, traffic->getAgentsRegularLane());
202 saveTrafficRightmostLane(xml, traffic->getAgentsRightMostLane());
203
204 xml.writeEndElement();
205 xml.writeComment("#############################################################################################");
206
207 }
208
209 void TrafficSimulationXMLSaveModel::saveTrafficParameters(QXmlStreamWriter &xml,
210 TrafficInterface *traffic)
211 {
212 xml.writeStartElement(KeyTrafficParameters);
213
214 saveTrafficVolumes(xml, traffic->getVolumes());
215 saveTrafficPlatoonRates(xml, traffic->getPlatoonRates());
216 saveTrafficVelocities(xml, traffic->getVelocities());
217 saveTrafficHomogeneities(xml, traffic->getHomogeneities());
218
219 xml.writeEndElement();
220 }
221
222 void TrafficSimulationXMLSaveModel::saveTrafficVolumes(QXmlStreamWriter &xml,
223 TrafficItemMapInterface *volumes)
224 {
225 xml.writeStartElement(KeyTrafficVolumes);
226
227 for(TrafficItemInterface* volume : volumes->values())
228 {
229 xml.writeStartElement(KeyTrafficVolume);
230 xml.writeAttribute("Value", volume->getValue());
231 xml.writeAttribute("Probability", QString("%1").arg(volume->getProbability()));
232 xml.writeEndElement();
233 }
234
235 xml.writeEndElement();
236 }
237
238 void TrafficSimulationXMLSaveModel::saveTrafficPlatoonRates(QXmlStreamWriter &xml,
239 TrafficItemMapInterface *platoonRates)
240 {
241 xml.writeStartElement(KeyTrafficPlatoonRates);
242
243 for(TrafficItemInterface * platoonRate : platoonRates->values())
244 {
245 xml.writeStartElement(KeyTrafficPlatoonRate);
246 xml.writeAttribute("Value", platoonRate->getValue());
247 xml.writeAttribute("Probability", QString("%1").arg(platoonRate->getProbability()));
248 xml.writeEndElement();
249 }
250
251 xml.writeEndElement();
252 }
253
254 void TrafficSimulationXMLSaveModel::saveTrafficVelocities(QXmlStreamWriter &xml,
255 TrafficItemMapInterface *velocities)
256 {
257 xml.writeStartElement(KeyTrafficVelocities);
258
259 for(TrafficItemInterface * velocity : velocities->values())
260 {
261 xml.writeStartElement(KeyTrafficVelocity);
262 xml.writeAttribute("Value", velocity->getValue());
263 xml.writeAttribute("Probability", QString("%1").arg(velocity->getProbability()));
264 xml.writeEndElement();
265 }
266
267 xml.writeEndElement();
268 }
269
270 void TrafficSimulationXMLSaveModel::saveTrafficHomogeneities(QXmlStreamWriter &xml,
271 TrafficItemMapInterface *homogeneities)
272 {
273 xml.writeStartElement(KeyTrafficHomogeneities);
274
275 for(TrafficItemInterface * homogeneity : homogeneities->values())
276 {
277 xml.writeStartElement(KeyTrafficHomogeneity);
278 xml.writeAttribute("Value", homogeneity->getValue());
279 xml.writeAttribute("Probability", QString("%1").arg(homogeneity->getProbability()));
280 xml.writeEndElement();
281 }
282
283 xml.writeEndElement();
284 }
285
286
287 void TrafficSimulationXMLSaveModel::saveTrafficRegularLane(QXmlStreamWriter & xml,
288 TrafficItemMapInterface*agents)
289 {
290 xml.writeStartElement(KeyTrafficRegularLane);
291
292 for(TrafficItemInterface * agent : agents->values())
293 {
294 xml.writeStartElement(KeyTrafficAgent);
295 xml.writeAttribute("Name", agent->getValue());
296 xml.writeAttribute("Probability", QString("%1").arg(agent->getProbability()));
297 xml.writeEndElement();
298 }
299
300 xml.writeEndElement();
301 }
302
303 void TrafficSimulationXMLSaveModel::saveTrafficRightmostLane(QXmlStreamWriter & xml,
304 TrafficItemMapInterface *agents)
305 {
306 xml.writeStartElement(KeyTrafficRightmostLane);
307
308 for(TrafficItemInterface* agent : agents->values())
309 {
310 xml.writeStartElement(KeyTrafficAgent);
311 xml.writeAttribute("Name", agent->getValue());
312 xml.writeAttribute("Probability", QString("%1").arg(agent->getProbability()));
313 xml.writeEndElement();
314 }
315
316 xml.writeEndElement();
317 }
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
ExperimentInterface::getLoggingGroups
virtual LoggingGroups * getLoggingGroups() const =0
Returns the pointer to the list of Logging Groups.
TrafficSimulationXMLSaveModel::saveWeatherMap
static void saveWeatherMap(QXmlStreamWriter &xml, EnvironmentInterface::WeatherMap *map)
This method saves all weather entries and corresponding probabilities stored in the given map...
Definition: TrafficSimulationXMLSaveModel.cpp:163
ExperimentInterface::Libraries
QMap< QString, QString > Libraries
The map of libraries needed by the simulation slave.
Definition: ExperimentInterface.h:47
TrafficSimulationInterface::getTraffic
virtual TrafficInterface * getTraffic() const =0
Returns the pointer to the traffic configuration object, i.e. an instance of the TrafficInterface cla...
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
ExperimentInterface::getLibraries
virtual Libraries * getLibraries() const =0
Returns the pointer to the Libraries map.
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficInterface::getVelocities
virtual Velocities * getVelocities() const =0
Returns the map for registering velocities.
ScenarioInterface::getScenarioFile
virtual ScenarioFile getScenarioFile() const =0
Returns the current name of the open scenario file to which this scenario setup refers.
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficSimulationXMLSaveModel::saveTrafficParameters
static void saveTrafficParameters(QXmlStreamWriter &xml, TrafficInterface *traffic)
This method saves all traffic parameter values and probabilities, i.e. all xml subelements of <Traffi...
Definition: TrafficSimulationXMLSaveModel.cpp:209
ExperimentInterface::LoggingGroups
QStringList LoggingGroups
The list of logging groups.
Definition: ExperimentInterface.h:48
TrafficInterface::getVolumes
virtual Volumes * getVolumes() const =0
Returns the map for registering traffic volumes.
EnvironmentInterface::TimeOfDayMap
QMap< ID, Item * > TimeOfDayMap
The container class for storing time of day parameters.
Definition: EnvironmentInterface.h:57
TrafficSimulationXMLSaveModel::saveTrafficVolumes
static void saveTrafficVolumes(QXmlStreamWriter &xml, TrafficItemMapInterface *volumes)
This method saves all traffic volumes and corresponding probabilities stored in the given volumes map...
Definition: TrafficSimulationXMLSaveModel.cpp:222
TrafficSimulationXMLSaveModel::saveTrafficVelocities
static void saveTrafficVelocities(QXmlStreamWriter &xml, TrafficItemMapInterface *velocities)
This method saves all velocities and corresponding probabilities stored in the given velocities map...
Definition: TrafficSimulationXMLSaveModel.cpp:254
TrafficSimulationXMLSaveModel::saveTimeOfDayMap
static void saveTimeOfDayMap(QXmlStreamWriter &xml, EnvironmentInterface::TimeOfDayMap *map)
This method saves all time of day entries and corresponding probabilities stored in the given map...
Definition: TrafficSimulationXMLSaveModel.cpp:115
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
TrafficSimulationXMLSaveModel::saveScenario
static void saveScenario(QXmlStreamWriter &xml, ScenarioInterface *scenario)
This method writes all xml subelements of <EgoConfig> and <ScenarioConfig> stored in the given instan...
Definition: TrafficSimulationXMLSaveModel.cpp:179
TrafficSimulationXMLSaveModel::saveLoggingGroups
static void saveLoggingGroups(QXmlStreamWriter &xml, ExperimentInterface::LoggingGroups *const loggingGroups)
This method writes all logging groups, i.e. all XML elements of <LoggingGroups> occuring in <Experime...
Definition: TrafficSimulationXMLSaveModel.cpp:85
EnvironmentInterface::VisibilityDistanceMap
QMap< ID, Item * > VisibilityDistanceMap
The container class for storing visitbility distances.
Definition: EnvironmentInterface.h:58
TrafficSimulationInterface::getProfilesCatalogue
virtual ProfilesCatalogue getProfilesCatalogue() const =0
Returns the current profiles catalogue.
TrafficSimulationInterface
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
Definition: TrafficSimulationInterface.h:37
TrafficInterface::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const =0
Returns the map for registering platoon rates.
EnvironmentInterface::getFrictionMap
virtual FrictionMap * getFrictionMap() const =0
Returns a pointer to the map of friction coefficients.
ExperimentInterface::getNumberInvocations
virtual NumberInvocations getNumberInvocations() const =0
Returns the current number of invocations.
TrafficInterface::getHomogeneities
virtual Homogeneities * getHomogeneities() const =0
Returns the map for registering homogeneities.
TrafficSimulationXMLSaveModel::saveExperiment
static void saveExperiment(QXmlStreamWriter &xml, ExperimentInterface *experiment)
This method writes all xml subelements of <ExperimentConfig> stored in the given instance of Experime...
Definition: TrafficSimulationXMLSaveModel.cpp:57
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
TrafficSimulationXMLSaveModel::saveLibraries
static void saveLibraries(QXmlStreamWriter &xml, ExperimentInterface::Libraries *const libraries)
This method writes all Libraries needed by the simulation slave, i.e. all XML elements of <Libraries>...
Definition: TrafficSimulationXMLSaveModel.cpp:74
TrafficSimulationXMLSaveModel::saveVisibilityDistanceMap
static void saveVisibilityDistanceMap(QXmlStreamWriter &xml, EnvironmentInterface::VisibilityDistanceMap *map)
This method saves all vistibility distance entries and corresponding probabilities stored in the give...
Definition: TrafficSimulationXMLSaveModel.cpp:131
EnvironmentInterface::getVisibilityDistanceMap
virtual VisibilityDistanceMap * getVisibilityDistanceMap() const =0
Returns a pointer to the map of visibility distances.
TrafficSimulationInterface::getEnvironment
virtual EnvironmentInterface * getEnvironment() const =0
Returns the pointer to the environment configuration object, i.e. an instance of the EnvironmentInter...
TrafficSimulationXMLSaveModel::saveTrafficRightmostLane
static void saveTrafficRightmostLane(QXmlStreamWriter &xml, TrafficItemMapInterface *agents)
This method saves all rightmost lane agent profiles and corresponding probabilities stored in the giv...
Definition: TrafficSimulationXMLSaveModel.cpp:303
TrafficSimulationInterface::getExperiment
virtual ExperimentInterface * getExperiment() const =0
Returns the pointer to the experiment configuration object, i.e. an instance of the ExperimentInterfa...
TrafficSimulationXMLSaveModel::saveEnvironment
static void saveEnvironment(QXmlStreamWriter &xml, EnvironmentInterface *environment)
This method writes all xml subelements of <EnvironmentConfig> stored in the given instance of Environ...
Definition: TrafficSimulationXMLSaveModel.cpp:96
TrafficSimulationXMLSaveModel::saveFrictionMap
static void saveFrictionMap(QXmlStreamWriter &xml, EnvironmentInterface::FrictionMap *map)
This method saves all friction coefficients and corresponding probabilities stored in the given map...
Definition: TrafficSimulationXMLSaveModel.cpp:147
TrafficInterface::getName
virtual Name getName() const =0
Returns the current name of the traffic setup.
ExperimentInterface::getSeed
virtual Seed getSeed() const =0
Returns the current random number seed.
TrafficSimulationXMLSaveModel::saveTrafficHomogeneities
static void saveTrafficHomogeneities(QXmlStreamWriter &xml, TrafficItemMapInterface *homogeneities)
This method saves all homogeneities and corresponding probabilities stored in the given homogeneities...
Definition: TrafficSimulationXMLSaveModel.cpp:270
EnvironmentInterface::getWeatherMap
virtual WeatherMap * getWeatherMap() const =0
Returns a pointer to the map of whether parameters.
TrafficSimulationXMLSaveModel::save
static bool save(const QString &filepath, const TrafficSimulationInterface *const trafficSimulation)
This method manages the whole saving process. It opens the given filepath and, on success...
Definition: TrafficSimulationXMLSaveModel.cpp:13
EnvironmentInterface::getTimeOfDayMap
virtual TimeOfDayMap * getTimeOfDayMap() const =0
Returns a pointer to the time of day parameter map.
EnvironmentInterface::FrictionMap
QMap< ID, Item * > FrictionMap
The container class for storing friction coefficients.
Definition: EnvironmentInterface.h:59
TrafficSimulationXMLSaveModel::saveTrafficPlatoonRates
static void saveTrafficPlatoonRates(QXmlStreamWriter &xml, TrafficItemMapInterface *platoonRates)
This method saves all platoon rates and corresponding probabilities stored in the given platoon rates...
Definition: TrafficSimulationXMLSaveModel.cpp:238
TrafficSimulationXMLSaveModel::saveTrafficRegularLane
static void saveTrafficRegularLane(QXmlStreamWriter &xml, TrafficItemMapInterface *agents)
This method saves all regular lane agent profiles and corresponding probabilities stored in the given...
Definition: TrafficSimulationXMLSaveModel.cpp:287
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
ExperimentInterface
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
Definition: ExperimentInterface.h:39
ExperimentInterface::getID
virtual ID getID() const =0
Returns the ID of the experiment.
TrafficSimulationXMLSaveModel::saveTraffic
static void saveTraffic(QXmlStreamWriter &xml, TrafficInterface *traffic)
This method writes all xml subelements of <TrafficConfig> stored in the given instance of TrafficInte...
Definition: TrafficSimulationXMLSaveModel.cpp:194
EnvironmentInterface::getName
virtual Name getName() const =0
Returns the current name of the environment configuration.
TrafficSimulationInterface::getScenario
virtual ScenarioInterface * getScenario() const =0
Returns the pointer to the scenario configuration object, i.e. an instance of the ScenarioInterface c...
ScenarioInterface::getName
virtual Name getName() const =0
Returns the current name of the scenario.
EnvironmentInterface::WeatherMap
QMap< ID, Item * > WeatherMap
The container class for storing wheather parameters.
Definition: EnvironmentInterface.h:60
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationXMLSaveModel.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
TrafficSimulationXMLSaveModel.h
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
23
24 #ifndef TRAFFICSIMULATIONXMLSAVEMODEL_H
25 #define TRAFFICSIMULATIONXMLSAVEMODEL_H
26
27 #include "openPASS-TrafficSimulation/TrafficSimulationInterface.h"
28 #include "TrafficSimulationXMLBaseModel.h"
29
30 #include <QFile>
31 #include <QXmlStreamWriter>
32
33 //-----------------------------------------------------------------------------
42 //-----------------------------------------------------------------------------
43 class TrafficSimulationXMLSaveModel : public TrafficSimulationXMLBaseModel
44 {
45
46 public:
47 explicit TrafficSimulationXMLSaveModel() = delete;
48 virtual ~TrafficSimulationXMLSaveModel() = default;
49
50 public:
51 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
61 static bool save(const QString &filepath,
62 const TrafficSimulationInterface * const trafficSimulation);
63
64 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
72 static void saveExperiment(QXmlStreamWriter & xml,
73 ExperimentInterface * experiment);
74
75 //-----------------------------------------------------------------------------
82 //-----------------------------------------------------------------------------
83 static void saveLibraries(QXmlStreamWriter & xml,
84 ExperimentInterface::Libraries * const libraries);
85
86 //-----------------------------------------------------------------------------
93 //-----------------------------------------------------------------------------
94 static void saveLoggingGroups(QXmlStreamWriter & xml,
95 ExperimentInterface::LoggingGroups * const loggingGroups);
96
97 //-----------------------------------------------------------------------------
104 //-----------------------------------------------------------------------------
105 static void saveEnvironment(QXmlStreamWriter & xml,
106 EnvironmentInterface * environment);
107
108 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------
115 static void saveTimeOfDayMap(QXmlStreamWriter & xml,
116 EnvironmentInterface::TimeOfDayMap * map);
117
118 //-----------------------------------------------------------------------------
125 //-----------------------------------------------------------------------------
126 static void saveVisibilityDistanceMap(QXmlStreamWriter & xml,
127 EnvironmentInterface::VisibilityDistanceMap * map);
128
129 //-----------------------------------------------------------------------------
136 //-----------------------------------------------------------------------------
137 static void saveFrictionMap(QXmlStreamWriter & xml,
138 EnvironmentInterface::FrictionMap * map);
139
140 //-----------------------------------------------------------------------------
147 //-----------------------------------------------------------------------------
148 static void saveWeatherMap(QXmlStreamWriter & xml,
149 EnvironmentInterface::WeatherMap * map);
150
151 //-----------------------------------------------------------------------------
158 //-----------------------------------------------------------------------------
159 static void saveScenario(QXmlStreamWriter & xml,
160 ScenarioInterface * scenario);
161
162 //-----------------------------------------------------------------------------
169 //-----------------------------------------------------------------------------
170 static void saveTraffic(QXmlStreamWriter & xml,
171 TrafficInterface * traffic);
172
173 //-----------------------------------------------------------------------------
180 //-----------------------------------------------------------------------------
181 static void saveTrafficParameters(QXmlStreamWriter &xml,
182 TrafficInterface *traffic);
183
184 //-----------------------------------------------------------------------------
191 //-----------------------------------------------------------------------------
192 static void saveTrafficVolumes(QXmlStreamWriter &xml,
193 TrafficItemMapInterface*volumes);
194
195 //-----------------------------------------------------------------------------
202 //-----------------------------------------------------------------------------
203 static void saveTrafficPlatoonRates(QXmlStreamWriter &xml,
204 TrafficItemMapInterface*platoonRates);
205
206 //-----------------------------------------------------------------------------
213 //-----------------------------------------------------------------------------
214 static void saveTrafficVelocities(QXmlStreamWriter &xml,
215 TrafficItemMapInterface *velocities);
216
217 //-----------------------------------------------------------------------------
224 //-----------------------------------------------------------------------------
225 static void saveTrafficHomogeneities(QXmlStreamWriter &xml,
226 TrafficItemMapInterface*homogeneities);
227
228 //-----------------------------------------------------------------------------
235 //-----------------------------------------------------------------------------
236 static void saveTrafficRegularLane(QXmlStreamWriter & xml,
237 TrafficItemMapInterface*agents);
238
239 //-----------------------------------------------------------------------------
246 //-----------------------------------------------------------------------------
247 static void saveTrafficRightmostLane(QXmlStreamWriter & xml,
248 TrafficItemMapInterface*agents);
249
250 };
251
252 #endif // TRAFFICSIMULATIONXMLSAVEMODEL_H
TrafficSimulationXMLSaveModel::saveWeatherMap
static void saveWeatherMap(QXmlStreamWriter &xml, EnvironmentInterface::WeatherMap *map)
This method saves all weather entries and corresponding probabilities stored in the given map...
Definition: TrafficSimulationXMLSaveModel.cpp:163
ExperimentInterface::Libraries
QMap< QString, QString > Libraries
The map of libraries needed by the simulation slave.
Definition: ExperimentInterface.h:47
TrafficInterface
The Traffic Interface provides setter and getter methods for the combination XML subelements listed u...
Definition: TrafficInterface.h:41
ScenarioInterface
The Scenario Interface provides setter and getter methods for the combination XML elements related to...
Definition: ScenarioInterface.h:36
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficSimulationXMLSaveModel::saveTrafficParameters
static void saveTrafficParameters(QXmlStreamWriter &xml, TrafficInterface *traffic)
This method saves all traffic parameter values and probabilities, i.e. all xml subelements of <Traffi...
Definition: TrafficSimulationXMLSaveModel.cpp:209
ExperimentInterface::LoggingGroups
QStringList LoggingGroups
The list of logging groups.
Definition: ExperimentInterface.h:48
EnvironmentInterface::TimeOfDayMap
QMap< ID, Item * > TimeOfDayMap
The container class for storing time of day parameters.
Definition: EnvironmentInterface.h:57
TrafficSimulationXMLSaveModel::saveTrafficVolumes
static void saveTrafficVolumes(QXmlStreamWriter &xml, TrafficItemMapInterface *volumes)
This method saves all traffic volumes and corresponding probabilities stored in the given volumes map...
Definition: TrafficSimulationXMLSaveModel.cpp:222
TrafficSimulationXMLSaveModel::saveTrafficVelocities
static void saveTrafficVelocities(QXmlStreamWriter &xml, TrafficItemMapInterface *velocities)
This method saves all velocities and corresponding probabilities stored in the given velocities map...
Definition: TrafficSimulationXMLSaveModel.cpp:254
TrafficSimulationXMLSaveModel::saveTimeOfDayMap
static void saveTimeOfDayMap(QXmlStreamWriter &xml, EnvironmentInterface::TimeOfDayMap *map)
This method saves all time of day entries and corresponding probabilities stored in the given map...
Definition: TrafficSimulationXMLSaveModel.cpp:115
TrafficSimulationXMLSaveModel::saveScenario
static void saveScenario(QXmlStreamWriter &xml, ScenarioInterface *scenario)
This method writes all xml subelements of <EgoConfig> and <ScenarioConfig> stored in the given instan...
Definition: TrafficSimulationXMLSaveModel.cpp:179
TrafficSimulationXMLSaveModel::saveLoggingGroups
static void saveLoggingGroups(QXmlStreamWriter &xml, ExperimentInterface::LoggingGroups *const loggingGroups)
This method writes all logging groups, i.e. all XML elements of <LoggingGroups> occuring in <Experime...
Definition: TrafficSimulationXMLSaveModel.cpp:85
EnvironmentInterface::VisibilityDistanceMap
QMap< ID, Item * > VisibilityDistanceMap
The container class for storing visitbility distances.
Definition: EnvironmentInterface.h:58
TrafficSimulationInterface
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
Definition: TrafficSimulationInterface.h:37
TrafficSimulationXMLSaveModel::saveExperiment
static void saveExperiment(QXmlStreamWriter &xml, ExperimentInterface *experiment)
This method writes all xml subelements of <ExperimentConfig> stored in the given instance of Experime...
Definition: TrafficSimulationXMLSaveModel.cpp:57
TrafficSimulationXMLBaseModel
This class defines the XML element names of the combination XML file.
Definition: TrafficSimulationXMLBaseModel.h:41
TrafficSimulationXMLSaveModel
This class provides routines for saving the slaveConfig XML file.
Definition: TrafficSimulationXMLSaveModel.h:43
TrafficSimulationXMLSaveModel::saveLibraries
static void saveLibraries(QXmlStreamWriter &xml, ExperimentInterface::Libraries *const libraries)
This method writes all Libraries needed by the simulation slave, i.e. all XML elements of <Libraries>...
Definition: TrafficSimulationXMLSaveModel.cpp:74
TrafficSimulationXMLSaveModel::saveVisibilityDistanceMap
static void saveVisibilityDistanceMap(QXmlStreamWriter &xml, EnvironmentInterface::VisibilityDistanceMap *map)
This method saves all vistibility distance entries and corresponding probabilities stored in the give...
Definition: TrafficSimulationXMLSaveModel.cpp:131
TrafficSimulationXMLSaveModel::saveTrafficRightmostLane
static void saveTrafficRightmostLane(QXmlStreamWriter &xml, TrafficItemMapInterface *agents)
This method saves all rightmost lane agent profiles and corresponding probabilities stored in the giv...
Definition: TrafficSimulationXMLSaveModel.cpp:303
TrafficSimulationXMLBaseModel.h
This class defines the XML element names of the combination XML file.
TrafficSimulationXMLSaveModel::saveEnvironment
static void saveEnvironment(QXmlStreamWriter &xml, EnvironmentInterface *environment)
This method writes all xml subelements of <EnvironmentConfig> stored in the given instance of Environ...
Definition: TrafficSimulationXMLSaveModel.cpp:96
TrafficSimulationXMLSaveModel::saveFrictionMap
static void saveFrictionMap(QXmlStreamWriter &xml, EnvironmentInterface::FrictionMap *map)
This method saves all friction coefficients and corresponding probabilities stored in the given map...
Definition: TrafficSimulationXMLSaveModel.cpp:147
TrafficSimulationInterface.h
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
TrafficSimulationXMLSaveModel::saveTrafficHomogeneities
static void saveTrafficHomogeneities(QXmlStreamWriter &xml, TrafficItemMapInterface *homogeneities)
This method saves all homogeneities and corresponding probabilities stored in the given homogeneities...
Definition: TrafficSimulationXMLSaveModel.cpp:270
TrafficSimulationXMLSaveModel::save
static bool save(const QString &filepath, const TrafficSimulationInterface *const trafficSimulation)
This method manages the whole saving process. It opens the given filepath and, on success...
Definition: TrafficSimulationXMLSaveModel.cpp:13
EnvironmentInterface::FrictionMap
QMap< ID, Item * > FrictionMap
The container class for storing friction coefficients.
Definition: EnvironmentInterface.h:59
TrafficSimulationXMLSaveModel::saveTrafficPlatoonRates
static void saveTrafficPlatoonRates(QXmlStreamWriter &xml, TrafficItemMapInterface *platoonRates)
This method saves all platoon rates and corresponding probabilities stored in the given platoon rates...
Definition: TrafficSimulationXMLSaveModel.cpp:238
TrafficSimulationXMLSaveModel::saveTrafficRegularLane
static void saveTrafficRegularLane(QXmlStreamWriter &xml, TrafficItemMapInterface *agents)
This method saves all regular lane agent profiles and corresponding probabilities stored in the given...
Definition: TrafficSimulationXMLSaveModel.cpp:287
EnvironmentInterface
The EnvironmentInterface class provides setter and getter methods for the maps of environmental param...
Definition: EnvironmentInterface.h:46
ExperimentInterface
The Experiment Interface provides setter and getter methods for the XML elements listed under <Experi...
Definition: ExperimentInterface.h:39
TrafficSimulationXMLSaveModel::saveTraffic
static void saveTraffic(QXmlStreamWriter &xml, TrafficInterface *traffic)
This method writes all xml subelements of <TrafficConfig> stored in the given instance of TrafficInte...
Definition: TrafficSimulationXMLSaveModel.cpp:194
EnvironmentInterface::WeatherMap
QMap< ID, Item * > WeatherMap
The container class for storing wheather parameters.
Definition: EnvironmentInterface.h:60
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "TrafficView.h"
12 #include "ui_TrafficView.h"
13
14 TrafficView::TrafficView(QWidget *parent) :
15 QWidget(parent),
16 ui(new Ui::TrafficView)
17 {
18 ui->setupUi(this);
19
20 QFont headerFont;
21 headerFont.setBold(true);
22
23 ui->VolumesView->horizontalHeader()->setFont(headerFont);
24 ui->PlatoonRatesView->horizontalHeader()->setFont(headerFont);
25 ui->VelocitiesView->horizontalHeader()->setFont(headerFont);
26 ui->HomogeneitiesView->horizontalHeader()->setFont(headerFont);
27
28 ui->RegularLaneAgentsView->horizontalHeader()->setFont(headerFont);
29 ui->RightmostLaneAgentsView->horizontalHeader()->setFont(headerFont);
30
31 // Event filters for resizing the table columns
32 ui->VolumesView->installEventFilter(this);
33 ui->PlatoonRatesView->installEventFilter(this);
34 ui->VelocitiesView->installEventFilter(this);
35 ui->HomogeneitiesView->installEventFilter(this);
36
37 ui->RegularLaneAgentsView->installEventFilter(this);
38 ui->RightmostLaneAgentsView->installEventFilter(this);
39
40 }
41
42 TrafficView::~TrafficView()
43 {
44 delete ui;
45 }
46
47 void TrafficView::setName(const QString &_name)
48 {
49 ui->NameEdit->setText(_name);
50 }
51
52 void TrafficView::on_NameEdit_editingFinished()
53 {
54 Q_EMIT modifiedName(ui->NameEdit->text());
55 }
56
57
58 QTableView * TrafficView::getVolumesView() const
59 {
60 return ui->VolumesView;
61 }
62
63 QTableView * TrafficView::getVelocitiesView() const
64 {
65 return ui->VelocitiesView;
66 }
67
68 QTableView * TrafficView::getPlatoonRatesView() const
69 {
70 return ui->PlatoonRatesView;
71 }
72
73 QTableView * TrafficView::getHomogeneitiesView() const
74 {
75 return ui->HomogeneitiesView;
76 }
77
78 QTableView * TrafficView::getRegularLaneAgentsView() const
79 {
80 return ui->RegularLaneAgentsView;
81 }
82
83 QTableView * TrafficView::getRightmostLaneAgentsView() const
84 {
85 return ui->RightmostLaneAgentsView;
86 }
87
88 void TrafficView::on_addVolume_clicked()
89 {
90 Q_EMIT addVolume();
91 }
92
93 void TrafficView::on_removeVolume_clicked()
94 {
95 Q_EMIT removeVolume(ui->VolumesView->currentIndex().row());
96 }
97
98 void TrafficView::on_addPlatoonRate_clicked()
99 {
100 Q_EMIT addPlatoonRate();
101 }
102
103 void TrafficView::on_removePlatoonRate_clicked()
104 {
105 Q_EMIT removePlatoonRate(ui->PlatoonRatesView->currentIndex().row());
106 }
107
108 void TrafficView::on_addVelocity_clicked()
109 {
110 Q_EMIT addVelocity();
111 }
112
113 void TrafficView::on_removeVelocity_clicked()
114 {
115 Q_EMIT removeVelocity(ui->VelocitiesView->currentIndex().row());
116 }
117
118 void TrafficView::on_addHomogeneity_clicked()
119 {
120 Q_EMIT addHomogeneity();
121 }
122
123 void TrafficView::on_removeHomogeneity_clicked()
124 {
125 Q_EMIT removeHomogeneity(ui->HomogeneitiesView->currentIndex().row());
126 }
127
128 void TrafficView::on_addRegularLaneAgent_clicked()
129 {
130 Q_EMIT addRegularLaneAgent();
131 }
132
133 void TrafficView::on_removeRegularLaneAgent_clicked()
134 {
135 Q_EMIT removeRegularLaneAgent(ui->RegularLaneAgentsView->currentIndex().row());
136 }
137
138 void TrafficView::on_addRightmostLaneAgent_clicked()
139 {
140 Q_EMIT addRightmostLaneAgent();
141 }
142
143 void TrafficView::on_removeRightmostLaneAgent_clicked()
144 {
145 Q_EMIT removeRightmostLaneAgent(ui->RightmostLaneAgentsView->currentIndex().row());
146 }
147
148 bool TrafficView::eventFilter(QObject *watched, QEvent *event)
149 {
150 QTableView* table = qobject_cast<QTableView*> (watched);
151
152 if( table && event->type() == QEvent::Resize )
153 {
154 int cell = (table->width())/2;
155 table->setColumnWidth(0, cell);
156 }
157
158 return false;
159 }
160
161
162 void TrafficView::setVelocities_ProbabilityError(bool error)
163 {
164 if(error)
165 ui->Velocity_ProbabilityError->setText("probability sum invalid!");
166 else
167 ui->Velocity_ProbabilityError->setText("");
168 }
169
170 void TrafficView::setVolumes_ProbabilityError(bool error)
171 {
172 if(error)
173 ui->Volume_ProbabilityError->setText("probability sum invalid!");
174 else
175 ui->Volume_ProbabilityError->setText("");
176 }
177
178 void TrafficView::setPlatoonRates_ProbabilityError(bool error)
179 {
180 if(error)
181 ui->PlatoonRate_ProbabilityError->setText("probability sum invalid!");
182 else
183 ui->PlatoonRate_ProbabilityError->setText("");
184 }
185
186 void TrafficView::setHomogeneities_ProbabilityError(bool error)
187 {
188 if(error)
189 ui->Homogeneity_ProbabilityError->setText("probability sum invalid!");
190 else
191 ui->Homogeneity_ProbabilityError->setText("");
192 }
193
194 void TrafficView::setRegularLane_ProbabilityError(bool error)
195 {
196 if(error)
197 ui->RegularLane_ProbabilityError->setText("probability sum invalid!");
198 else
199 ui->RegularLane_ProbabilityError->setText("");
200 }
201
202 void TrafficView::setRightmostLane_ProbabilityError(bool error)
203 {
204 if(error)
205 ui->RightmostLane_ProbabilityError->setText("probability sum invalid!");
206 else
207 ui->RightmostLane_ProbabilityError->setText("");
208 }
209
210 void TrafficView::setAgentProfilesError(const QString &message)
211 {
212 ui->agentProfilesError->setText(message);
213 }
TrafficView::on_addPlatoonRate_clicked
void on_addPlatoonRate_clicked()
Slot which is triggered when the user clicks on the add-button above the platoon rate table...
Definition: TrafficView.cpp:98
TrafficView::addPlatoonRate
void addPlatoonRate()
Signal emitted when add-button above the platoon rates table is clicked.
TrafficView::setVolumes_ProbabilityError
void setVolumes_ProbabilityError(bool error)
Method which displays a probability error message for the table of traffic volumes if the boolian arg...
Definition: TrafficView.cpp:170
TrafficView::on_removeRightmostLaneAgent_clicked
void on_removeRightmostLaneAgent_clicked()
Signal, emitted when the user clicks the remove-button of the rightmost lane agents table...
Definition: TrafficView.cpp:143
TrafficView::removeVolume
void removeVolume(const int &row)
Signal emitted when remove-button above the traffic volume table is clicked. Transmits the currently ...
Ui
Definition: EnvironmentDisplayView.h:29
TrafficView::removeRightmostLaneAgent
void removeRightmostLaneAgent(const int &row)
Signal emitted when remove-button above the rightmost lane agents table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter).
TrafficView::getVelocitiesView
QTableView * getVelocitiesView() const
Method which provides access to the table view displaying velocities.
Definition: TrafficView.cpp:63
TrafficView::on_addVolume_clicked
void on_addVolume_clicked()
Slot which is triggered when the user clicks on the add-button above the traffic volumes table...
Definition: TrafficView.cpp:88
TrafficView::removePlatoonRate
void removePlatoonRate(const int &row)
Signal emitted when remove-button above the platoon rates table is clicked. Transmits the currently s...
TrafficView::setRightmostLane_ProbabilityError
void setRightmostLane_ProbabilityError(bool error)
Method which displays a probability error message for the table of rightmost lane agents if the booli...
Definition: TrafficView.cpp:202
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370
TrafficView::on_removeHomogeneity_clicked
void on_removeHomogeneity_clicked()
Signal, emitted when the user clicks the remove-button of the homogeneities table. Will emit the removeHomogeneity signal transmitting the currently selected row index of the table.
Definition: TrafficView.cpp:123
TrafficView::addVolume
void addVolume()
Signal emitted when add-button above the traffic volume table is clicked.
TrafficView::on_addVelocity_clicked
void on_addVelocity_clicked()
Slot which is triggered when the user clicks on the add-button above the velocities table...
Definition: TrafficView.cpp:108
TrafficView::setVelocities_ProbabilityError
void setVelocities_ProbabilityError(bool error)
Method which displays a probability error message for the table of velocities if the boolian argument...
Definition: TrafficView.cpp:162
TrafficView::getRightmostLaneAgentsView
QTableView * getRightmostLaneAgentsView() const
Method which provides access to the table view displaying rightmost lane agents.
Definition: TrafficView.cpp:83
TrafficView::addRegularLaneAgent
void addRegularLaneAgent()
Signal emitted when add-button above the regular lane agents table is clicked.
TrafficView::setRegularLane_ProbabilityError
void setRegularLane_ProbabilityError(bool error)
Method which displays a probability error message for the table of regular lane agents if the boolian...
Definition: TrafficView.cpp:194
TrafficView::on_removePlatoonRate_clicked
void on_removePlatoonRate_clicked()
Signal, emitted when the user clicks the remove-button of the platoon rates table. Will emit the removePlatoonRate signal transmitting the currently selected row index of the table.
Definition: TrafficView.cpp:103
TrafficView::on_addRightmostLaneAgent_clicked
void on_addRightmostLaneAgent_clicked()
Slot which is triggered when the user clicks on the add-button above the rightmost lane agents table...
Definition: TrafficView.cpp:138
TrafficView::on_removeRegularLaneAgent_clicked
void on_removeRegularLaneAgent_clicked()
Signal, emitted when the user clicks the remove-button of the regular lane agents table...
Definition: TrafficView.cpp:133
TrafficView::getRegularLaneAgentsView
QTableView * getRegularLaneAgentsView() const
Method which provides access to the table view displaying regular lane agents.
Definition: TrafficView.cpp:78
TrafficView::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Reimplementation of the event filter. This filter catches the resize events of the table views in ord...
Definition: TrafficView.cpp:148
TrafficView::on_removeVolume_clicked
void on_removeVolume_clicked()
Signal, emitted when the user clicks the remove-button of the traffic volumes table. Will emit the removeVolume signal transmitting the currently selected row index of the table.
Definition: TrafficView.cpp:93
TrafficView::removeHomogeneity
void removeHomogeneity(const int &row)
Signal emitted when remove-button above the homogeneities table is clicked. Transmits the currently s...
TrafficView::getPlatoonRatesView
QTableView * getPlatoonRatesView() const
Method which provides access to the table view displaying platoon rates.
Definition: TrafficView.cpp:68
TrafficView::getVolumesView
QTableView * getVolumesView() const
Method which provides access to the table view displaying traffic volumes.
Definition: TrafficView.cpp:58
TrafficView::setName
void setName(QString const &_name)
Method which sets the traffic configuration&#39;s name to the one passed as an argument.
Definition: TrafficView.cpp:47
TrafficView::setAgentProfilesError
void setAgentProfilesError(QString const &message)
Method which displays a an error message concerning agent profiles.
Definition: TrafficView.cpp:210
TrafficView::on_addRegularLaneAgent_clicked
void on_addRegularLaneAgent_clicked()
Slot which is triggered when the user clicks on the add-button above the regular lane agents table...
Definition: TrafficView.cpp:128
TrafficView::modifiedName
void modifiedName(QString const &_name)
Signal emitted when the name of the traffic has been modified by the user. Transmits the new name to ...
TrafficView::on_removeVelocity_clicked
void on_removeVelocity_clicked()
Signal, emitted when the user clicks the remove-button of the velocities table. Will emit the removeV...
Definition: TrafficView.cpp:113
TrafficView::setHomogeneities_ProbabilityError
void setHomogeneities_ProbabilityError(bool error)
Method which displays a probability error message for the table of homogeneities if the boolian argum...
Definition: TrafficView.cpp:186
TrafficView::getHomogeneitiesView
QTableView * getHomogeneitiesView() const
Method which provides access to the table view displaying homogeneities.
Definition: TrafficView.cpp:73
TrafficView
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content s...
Definition: TrafficView.h:43
TrafficView.h
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content s...
TrafficView::removeVelocity
void removeVelocity(const int &row)
Signal emitted when remove-button above the velocities table is clicked. Transmits the currently sele...
TrafficView::removeRegularLaneAgent
void removeRegularLaneAgent(const int &row)
Signal emitted when remove-button above the regular lane agents table is clicked. Transmits the curre...
TrafficView::addVelocity
void addVelocity()
Signal emitted when add-button above the velocities table is clicked.
TrafficView::setPlatoonRates_ProbabilityError
void setPlatoonRates_ProbabilityError(bool error)
Method which displays a probability error message for the table of platoon rates if the boolian argum...
Definition: TrafficView.cpp:178
TrafficView::on_addHomogeneity_clicked
void on_addHomogeneity_clicked()
Slot which is triggered when the user clicks on the add-button above the homogeneities table...
Definition: TrafficView.cpp:118
TrafficView::addHomogeneity
void addHomogeneity()
Signal emitted when add-button above the homogeneities table is clicked.
TrafficView::addRightmostLaneAgent
void addRightmostLaneAgent()
Signal emitted when add-button above the rigthmost lane agents table is clicked.
TrafficView::on_NameEdit_editingFinished
void on_NameEdit_editingFinished()
Slot which is triggered when the user has finished editing the traffic configuration&#39;s name...
Definition: TrafficView.cpp:52
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficVolumeView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficVolumeView.cpp
1 #include "TrafficVolumeView.h"
2 #include "ui_TrafficVolumeView.h"
3
4 TrafficVolumeView::TrafficVolumeView(unsigned int ID,
5 int index,
6 QWidget *parent) :
7 QWidget(parent),
8 ID(ID),
9 index(index),
10 ui(new Ui::TrafficVolumeView)
11 {
12 ui->setupUi(this);
13
14
15 }
16
17 TrafficVolumeView::~TrafficVolumeView()
18 {
19 delete ui;
20 }
21
22
23 void TrafficVolumeView::on_remove_clicked()
24 {
25 Q_EMIT remove(ID);
26 }
27
28 void TrafficVolumeView::on_probabilityValue_editingFinished()
29 {
30 Q_EMIT probabilityChanged(ID, ui->probabilityValue->value());
31 }
32
33 void TrafficVolumeView::on_VolumeValue_editingFinished()
34 {
35 Q_EMIT valueChanged(ID, ui->VolumeValue->value());
36 }
37
38 unsigned int TrafficVolumeView::getID() const
39 {
40
41 }
Ui
Definition: EnvironmentDisplayView.h:29
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficVolumeView.h Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
TrafficVolumeView.h
1 #ifndef TRAFFICVOLUMEVIEW_H
2 #define TRAFFICVOLUMEVIEW_H
3
4 #include <QWidget>
5
6 namespace Ui {
7 class TrafficVolumeView;
8 }
9
10 class TrafficVolumeView : public QWidget
11 {
12 Q_OBJECT
13
14 public:
15 explicit TrafficVolumeView(unsigned int ID,
16 int index,
17 QWidget *parent = 0);
18 ~TrafficVolumeView();
19
20 Q_SIGNALS:
21 void valueChanged(unsigned int ID, int value);
22 void probabilityChanged(unsigned int ID, double value);
23 void remove(unsigned int ID);
24
25 private Q_SLOTS:
26 void on_remove_clicked();
27 void on_probabilityValue_editingFinished();
28 void on_VolumeValue_editingFinished();
29
30 public:
31 unsigned int getID() const;
32 int getIndex() const;
33
34 public:
35 void setValue(int value);
36 void setProbability(double value);
37 void setIndex(int newIndex);
38
39 private:
40 int index;
41 unsigned int ID;
42 Ui::TrafficVolumeView *ui;
43 };
44
45 #endif // TRAFFICVOLUMEVIEW_H
Ui
Definition: EnvironmentDisplayView.h:29
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentItemModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
VehicleComponentItemModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "VehicleComponentItemModel.h"
12 #include "openPASS-AgentConfiguration/VehicleComponentMapInterface.h"
13
14 VehicleComponentItemModel::VehicleComponentItemModel(QObject *parent)
15 : VehicleComponentItemInterface(parent)
16 , profiles(new Profiles())
17 , sensorLinks(new SensorLinks())
18 {
19 }
20
21 VehicleComponentItemModel::~VehicleComponentItemModel()
22 {
23 delete profiles;
24 delete sensorLinks;
25 }
26
27 VehicleComponentItemInterface::Type VehicleComponentItemModel::getType() const
28 {
29 VehicleComponentMapInterface const * const map = qobject_cast<VehicleComponentMapInterface const * const > ( parent() );
30
31 return ( (map) ? map->getType( const_cast<VehicleComponentItemModel *> (this) ) : VehicleComponentItemInterface::Type() );
32 }
33
34 VehicleComponentItemInterface::Profiles * VehicleComponentItemModel::getProfiles() const
35 {
36 return profiles;
37 }
38
39 VehicleComponentItemInterface::SensorLinks * VehicleComponentItemModel::getSensorLinks() const
40 {
41 return sensorLinks;
42 }
VehicleComponentItemModel::sensorLinks
SensorLinks *const sensorLinks
the pointer to the map defining sensor links
Definition: VehicleComponentItemModel.h:42
VehicleComponentItemModel::getSensorLinks
virtual SensorLinks * getSensorLinks() const override
Method which returns the map of sensor links.
Definition: VehicleComponentItemModel.cpp:39
VehicleComponentItemModel::getProfiles
virtual Profiles * getProfiles() const override
Method which returns the map of profiles assigned to probabilites.
Definition: VehicleComponentItemModel.cpp:34
VehicleComponentItemModel::profiles
Profiles *const profiles
the pointer to the vehicle component profiles
Definition: VehicleComponentItemModel.h:41
VehicleComponentItemModel::getType
virtual Type getType() const override
Method which returns type (algorithm) of the vehicle component.
Definition: VehicleComponentItemModel.cpp:27
VehicleComponentMapInterface.h
This class constitutes a container class for vehicle component data (instances of VehicleComponentIte...
VehicleComponentMapInterface
This class constitutes a container class for vehicle component data (instances of VehicleComponentIte...
Definition: VehicleComponentMapInterface.h:38
VehicleComponentItemInterface::Type
QString Type
typedef for the component type (= algorithm)
Definition: VehicleComponentItemInterface.h:48
VehicleComponentItemInterface
The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a ...
Definition: VehicleComponentItemInterface.h:42
VehicleComponentItemInterface::Profiles
QMap< Profile *, Probability > Profiles
typedef for the map which assigns probabilities to profiles
Definition: VehicleComponentItemInterface.h:53
VehicleComponentItemModel.h
This class implements the functionality of VehicleComponentItemInterface.
VehicleComponentItemInterface::SensorLinks
QMap< unsigned int, QString > SensorLinks
typedef for the map describing sensor links
Definition: VehicleComponentItemInterface.h:54
VehicleComponentMapInterface::getType
virtual VehicleComponentMapInterface::Type getType(VehicleComponentMapInterface::Item *const item) const =0
Method wich returns the type of the given vehicle component data object.
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentMapModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
VehicleComponentMapModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "VehicleComponentMapModel.h"
12
13 #include "Models/VehicleComponentItemModel.h"
14
15 VehicleComponentMapModel::VehicleComponentMapModel(QObject *parent)
16 :VehicleComponentMapInterface(parent)
17 {
18
19 }
20
21
22 VehicleComponentMapInterface::Iterator VehicleComponentMapModel::begin()
23 {
24 return components.begin();
25 }
26
27 VehicleComponentMapInterface::ConstIterator VehicleComponentMapModel::constBegin() const
28 {
29 return components.constBegin();
30 }
31
32 VehicleComponentMapInterface::Iterator VehicleComponentMapModel::end()
33 {
34 return components.end();
35 }
36
37 VehicleComponentMapInterface::ConstIterator VehicleComponentMapModel::constEnd() const
38 {
39 return components.constEnd();
40 }
41
42
43 bool VehicleComponentMapModel::add(const VehicleComponentMapInterface::Type &type)
44 {
45 if(!contains(type))
46 {
47 components.insert(type, new VehicleComponentItemModel(this));
48 return true;
49 }
50
51 return false;
52 }
53
54 bool VehicleComponentMapModel::remove(const VehicleComponentMapInterface::Type &type)
55 {
56 if(contains(type))
57 {
58 delete components.take(type);
59 return true;
60 }
61
62 return false;
63 }
64
65 VehicleComponentMapInterface::Item * VehicleComponentMapModel::getItem(VehicleComponentMapInterface::Type const & type) const
66 {
67 if(contains(type))
68 return components.value(type);
69
70 return nullptr;
71 }
72
73
74 VehicleComponentMapInterface::Type VehicleComponentMapModel::getType(Item * const item) const
75 {
76 return components.key(item);
77 }
78
79 void VehicleComponentMapModel::setType(Item * const item,
80 VehicleComponentMapInterface::Type const &type)
81 {
82
83 Type oldType = item->getType();
84
85 components.take(oldType);
86 components.insert(type, item);
87 }
88
89
90 bool VehicleComponentMapModel::contains(const VehicleComponentMapInterface::Type &type) const
91 {
92 return components.contains(type);
93 }
94
95 QStringList VehicleComponentMapModel::keys() const
96 {
97 return QStringList(components.keys() );
98 }
99
100 QList <VehicleComponentItemInterface*> VehicleComponentMapModel::values() const
101 {
102 return components.values();
103 }
104
105 int VehicleComponentMapModel::count() const
106 {
107 return components.count();
108 }
109
110 void VehicleComponentMapModel::clear()
111 {
112 qDeleteAll(components);
113 components.clear();
114 }
VehicleComponentMapModel::keys
virtual QStringList keys() const override
Method which returns the list of all vehicle component types in the map.
Definition: VehicleComponentMapModel.cpp:95
VehicleComponentMapModel::values
virtual QList< Item * > values() const override
Method which returns a list of pointers to all vehicle component data objects in the map...
Definition: VehicleComponentMapModel.cpp:100
VehicleComponentMapModel::count
virtual int count() const override
Method which returns the number of vehicle component data objects in the map.
Definition: VehicleComponentMapModel.cpp:105
VehicleComponentMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: VehicleComponentMapInterface.h:48
VehicleComponentMapModel::getType
virtual VehicleComponentMapInterface::Type getType(VehicleComponentMapInterface::Item *const item) const override
Method wich returns the type of the given vehicle component data object.
Definition: VehicleComponentMapModel.cpp:74
VehicleComponentMapModel::begin
virtual VehicleComponentMapInterface::Iterator begin() override
Gets an iterator pointing to the first vehicle component data in the map.
Definition: VehicleComponentMapModel.cpp:22
VehicleComponentMapModel::clear
virtual void clear() override
Method which deletes all registered vehicle component data objects and clears the map...
Definition: VehicleComponentMapModel.cpp:110
VehicleComponentMapModel::add
virtual bool add(VehicleComponentMapInterface::Type const &type) override
Method which creates a new vehicle component data object (instance of VehicleComponentItemInterface) ...
Definition: VehicleComponentMapModel.cpp:43
VehicleComponentItemModel
This class implements the functionality of VehicleComponentItemInterface.
Definition: VehicleComponentItemModel.h:25
VehicleComponentItemInterface::getType
virtual Type getType() const =0
Method which returns type (algorithm) of the vehicle component.
VehicleComponentMapModel::getItem
virtual VehicleComponentMapInterface::Item * getItem(VehicleComponentMapInterface::Type const &type) const override
Method which returns a pointer to the vehicle component data object of the given type. If the map does not contain a vehicle component data object of that type, nullptr is returned.
Definition: VehicleComponentMapModel.cpp:65
VehicleComponentMapModel::constBegin
virtual VehicleComponentMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first vehicle component data object in the map (use for read-only si...
Definition: VehicleComponentMapModel.cpp:27
VehicleComponentMapModel::remove
virtual bool remove(VehicleComponentMapInterface::Type const &type) override
Method which removes the vehicle component data object with the given type from the map...
Definition: VehicleComponentMapModel.cpp:54
VehicleComponentMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: VehicleComponentMapInterface.h:49
VehicleComponentMapInterface
This class constitutes a container class for vehicle component data (instances of VehicleComponentIte...
Definition: VehicleComponentMapInterface.h:38
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68
VehicleComponentMapModel::setType
virtual void setType(VehicleComponentMapInterface::Item *const item, VehicleComponentMapInterface::Type const &type) override
Method wich changes the type of the given vehicle component data object to the one passed as second a...
Definition: VehicleComponentMapModel.cpp:79
VehicleComponentItemInterface
The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a ...
Definition: VehicleComponentItemInterface.h:42
VehicleComponentMapModel::contains
virtual bool contains(VehicleComponentMapInterface::Type const &type) const override
Method wich checks whether the map contains a vehicle component data object with the given type...
Definition: VehicleComponentMapModel.cpp:90
VehicleComponentMapModel::constEnd
virtual VehicleComponentMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last vehicle component data object (use for...
Definition: VehicleComponentMapModel.cpp:37
VehicleComponentMapInterface::Type
VehicleComponentItemInterface::Type Type
typedef for the vehicle component&#39;s type
Definition: VehicleComponentMapInterface.h:43
VehicleComponentItemModel.h
This class implements the functionality of VehicleComponentItemInterface.
VehicleComponentMapModel.h
This class implements the functionality of VehicleComponentMapInterface.
VehicleComponentMapModel::end
virtual VehicleComponentMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last vehicle component data object...
Definition: VehicleComponentMapModel.cpp:32
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileItemModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
VehicleComponentProfileItemModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "VehicleComponentProfileItemModel.h"
12 #include "ParameterItemModel.h"
13
14 #include "openPASS-AgentConfiguration/VehicleComponentProfileMapInterface.h"
15
16 #include "ParameterMapModel.h"
17
18
19 VehicleComponentProfileItemModel::VehicleComponentProfileItemModel(QObject *parent)
20 : VehicleComponentProfileItemInterface(parent)
21 , parameters(new ParameterMapModel(this))
22 {
23
24 }
25
26 VehicleComponentProfileItemInterface::Name VehicleComponentProfileItemModel::getName() const
27 {
28 VehicleComponentProfileMapInterface const * const map = qobject_cast<VehicleComponentProfileMapInterface const * const > ( parent() );
29
30 return ( (map) ? map->getID( const_cast<VehicleComponentProfileItemModel *> (this) ).first : VehicleComponentProfileItemInterface::Name() );
31 }
32
33
34 VehicleComponentProfileItemInterface::Type VehicleComponentProfileItemModel::getType() const
35 {
36 VehicleComponentProfileMapInterface const * const map = qobject_cast<VehicleComponentProfileMapInterface const * const > ( parent() );
37
38 return ( (map) ? map->getID( const_cast<VehicleComponentProfileItemModel *> (this) ).second : VehicleComponentProfileItemInterface::Type() );
39 }
40
41
42 VehicleComponentProfileItemInterface::Parameters * VehicleComponentProfileItemModel::getParameters() const
43 {
44 return parameters;
45 }
VehicleComponentProfileItemModel::getName
virtual Name getName() const override
Method which returns the name of the vehicle component profile.
Definition: VehicleComponentProfileItemModel.cpp:26
ParameterMapModel.h
This class implements the functionality of ParameterMapInterface.
VehicleComponentProfileMapInterface.h
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
VehicleComponentProfileItemInterface::Type
QString Type
typedef for the type (algorithm) of the corresponding vehicle component
Definition: VehicleComponentProfileItemInterface.h:47
VehicleComponentProfileItemInterface
This class defines vehicle component profiles which contain the parameterization of a vehicle compone...
Definition: VehicleComponentProfileItemInterface.h:40
VehicleComponentProfileItemModel::getType
virtual Type getType() const override
Method which returns the type of the corresponding vehicle component.
Definition: VehicleComponentProfileItemModel.cpp:34
VehicleComponentProfileMapInterface::getID
virtual VehicleComponentProfileMapInterface::ID getID(VehicleComponentProfileMapInterface::Item *const item) const =0
Method wich returns the Id of the given vehicle component profile.
VehicleComponentProfileItemModel::parameters
Parameters *const parameters
the pointer to the parameter map of this profile
Definition: VehicleComponentProfileItemModel.h:42
ParameterMapModel
This class implements the functionality of ParameterMapInterface.
Definition: ParameterMapModel.h:25
VehicleComponentProfileItemModel::getParameters
virtual Parameters * getParameters() const override
Method which returns the parameter map of the vehicle component profile.
Definition: VehicleComponentProfileItemModel.cpp:42
VehicleComponentProfileItemModel.h
This class implements the functionality of VehicleComponentProfileItemInterface.
VehicleComponentProfileItemInterface::Name
QString Name
typedef for the name of the profile
Definition: VehicleComponentProfileItemInterface.h:46
ParameterItemModel.h
This class implements the functionality of ParameterItemInterface.
VehicleComponentProfileMapInterface
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
Definition: VehicleComponentProfileMapInterface.h:41
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileMapModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
VehicleComponentProfileMapModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "VehicleComponentProfileMapModel.h"
12
13 #include "VehicleComponentProfileItemModel.h"
14
15 VehicleComponentProfileMapModel::VehicleComponentProfileMapModel(QObject *parent)
16 : VehicleComponentProfileMapInterface(parent)
17 {
18
19 }
20
21
22 VehicleComponentProfileMapInterface::Iterator VehicleComponentProfileMapModel::begin()
23 {
24 return componentProfiles.begin();
25 }
26
27 VehicleComponentProfileMapInterface::ConstIterator VehicleComponentProfileMapModel::constBegin() const
28 {
29 return componentProfiles.constBegin();
30 }
31
32 VehicleComponentProfileMapInterface::Iterator VehicleComponentProfileMapModel::end()
33 {
34 return componentProfiles.end();
35 }
36
37 VehicleComponentProfileMapInterface::ConstIterator VehicleComponentProfileMapModel::constEnd() const
38 {
39 return componentProfiles.constEnd();
40 }
41
42
43 bool VehicleComponentProfileMapModel::add(const VehicleComponentProfileMapInterface::ID &id)
44 {
45 if(!contains(id))
46 {
47 componentProfiles.insert(id, new VehicleComponentProfileItemModel(this));
48 return true;
49 }
50
51 return false;
52 }
53
54 bool VehicleComponentProfileMapModel::remove(const VehicleComponentProfileMapInterface::ID &id)
55 {
56 if(contains(id))
57 {
58 delete componentProfiles.take(id);
59 return true;
60 }
61
62 return false;
63 }
64
65 VehicleComponentProfileMapInterface::Item * VehicleComponentProfileMapModel::getItem(VehicleComponentProfileMapInterface::ID const & id) const
66 {
67 if(contains(id))
68 return componentProfiles.value(id);
69
70 return nullptr;
71 }
72
73
74 VehicleComponentProfileMapInterface::ID VehicleComponentProfileMapModel::getID(Item * const item) const
75 {
76 return componentProfiles.key(item);
77 }
78
79 void VehicleComponentProfileMapModel::setID(Item * const item,
80 VehicleComponentProfileMapInterface::ID const &id)
81 {
82
83 VehicleComponentProfileMapInterface::ID oldID = getID(item);
84
85 componentProfiles.take(oldID);
86 componentProfiles.insert(id, item);
87 }
88
89
90 bool VehicleComponentProfileMapModel::contains(const VehicleComponentProfileMapInterface::ID &id) const
91 {
92 return componentProfiles.contains(id);
93 }
94
95 QList<VehicleComponentProfileMapInterface::ID> VehicleComponentProfileMapModel::keys() const
96 {
97 return componentProfiles.keys();
98 }
99
100 QList <VehicleComponentProfileItemInterface*> VehicleComponentProfileMapModel::values() const
101 {
102 return componentProfiles.values();
103 }
104
105 int VehicleComponentProfileMapModel::count() const
106 {
107 return componentProfiles.count();
108 }
109
110 void VehicleComponentProfileMapModel::clear()
111 {
112 qDeleteAll(componentProfiles);
113 componentProfiles.clear();
114 }
VehicleComponentProfileMapModel::clear
virtual void clear() override
Method which deletes all registered vehicle component profiles and clears the map.
Definition: VehicleComponentProfileMapModel.cpp:110
VehicleComponentProfileMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: VehicleComponentProfileMapInterface.h:54
VehicleComponentProfileMapModel::end
virtual VehicleComponentProfileMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last vehicle component profile.
Definition: VehicleComponentProfileMapModel.cpp:32
VehicleComponentProfileMapModel::getItem
virtual VehicleComponentProfileMapInterface::Item * getItem(VehicleComponentProfileMapInterface::ID const &id) const override
Method which returns a pointer to the vehicle component profile with the given Id. If the map does not contain a vehicle component profile with this Id, nullptr is returned.
Definition: VehicleComponentProfileMapModel.cpp:65
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70
VehicleComponentProfileMapModel::remove
virtual bool remove(VehicleComponentProfileMapInterface::ID const &id) override
Method which removes the vehicle component profile with the given Id from the map. The profile is deleted after removing. Nothing will be done if there is no such profile.
Definition: VehicleComponentProfileMapModel.cpp:54
VehicleComponentProfileMapModel::constEnd
virtual VehicleComponentProfileMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last vehicle component profile (use for rea...
Definition: VehicleComponentProfileMapModel.cpp:37
VehicleComponentProfileMapModel.h
This class implements the functionality of VehicleComponentProfileMapInterface.
VehicleComponentProfileMapModel::values
virtual QList< Item * > values() const override
Method which returns a list of pointers to all vehicle component profiles in the map.
Definition: VehicleComponentProfileMapModel.cpp:100
VehicleComponentProfileMapModel::constBegin
virtual VehicleComponentProfileMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first vehicle component profile in the map (use for read-only since ...
Definition: VehicleComponentProfileMapModel.cpp:27
VehicleComponentProfileMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: VehicleComponentProfileMapInterface.h:55
VehicleComponentProfileMapModel::setID
virtual void setID(VehicleComponentProfileMapInterface::Item *const item, VehicleComponentProfileMapInterface::ID const &id) override
Method wich changes the Id of the given vehicle component profile to the one passed as second argumen...
Definition: VehicleComponentProfileMapModel.cpp:79
VehicleComponentProfileMapModel::contains
virtual bool contains(VehicleComponentProfileMapInterface::ID const &id) const override
Method wich checks whether the map contains a vehicle component profile with the given Id...
Definition: VehicleComponentProfileMapModel.cpp:90
VehicleComponentProfileItemInterface
This class defines vehicle component profiles which contain the parameterization of a vehicle compone...
Definition: VehicleComponentProfileItemInterface.h:40
VehicleComponentProfileMapInterface::ID
QPair< Name, Type > ID
typedef for the pair of name and type used as an Id
Definition: VehicleComponentProfileMapInterface.h:49
VehicleComponentProfileMapModel::begin
virtual VehicleComponentProfileMapInterface::Iterator begin() override
Gets an iterator pointing to the first vehicle component profile in the map.
Definition: VehicleComponentProfileMapModel.cpp:22
VehicleComponentProfileItemModel.h
This class implements the functionality of VehicleComponentProfileItemInterface.
VehicleComponentProfileMapModel::keys
virtual QList< ID > keys() const override
Method which returns the list of all vehicle component profile Ids in the map.
Definition: VehicleComponentProfileMapModel.cpp:95
VehicleComponentProfileMapModel::count
virtual int count() const override
Method which returns the number of vehicle component profiles in the map.
Definition: VehicleComponentProfileMapModel.cpp:105
VehicleComponentProfileMapInterface
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
Definition: VehicleComponentProfileMapInterface.h:41
VehicleComponentProfileMapModel::add
virtual bool add(VehicleComponentProfileMapInterface::ID const &id) override
Method which creates a new vehicle component profile (instance of VehicleComponentProfileItemInterfac...
Definition: VehicleComponentProfileMapModel.cpp:43
VehicleComponentProfileItemModel
This class implements the functionality of VehicleComponentProfileItemInterface.
Definition: VehicleComponentProfileItemModel.h:25
VehicleComponentProfileMapModel::getID
virtual VehicleComponentProfileMapInterface::ID getID(VehicleComponentProfileMapInterface::Item *const item) const override
Method wich returns the Id of the given vehicle component profile.
Definition: VehicleComponentProfileMapModel.cpp:74
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileItemModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
VehicleProfileItemModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "VehicleProfileItemModel.h"
12 #include "openPASS-AgentConfiguration/VehicleProfileMapInterface.h"
13
14 #include "Models/VehicleComponentMapModel.h"
15 #include "Models/SensorMapModel.h"
16
17 VehicleProfileItemModel::VehicleProfileItemModel(QObject *parent)
18 : VehicleProfileItemInterface(parent)
19 , modelCatalogue("")
20 , model("")
21 , systemConfig("")
22 , systemProfiles(new SystemProfiles)
23 , components(new VehicleComponentMapModel(this))
24 , sensors( new SensorMapModel(this))
25 {
26 }
27
28 VehicleProfileItemModel::VehicleProfileItemModel(VehicleProfileItemInterface const * const vehicle, QObject *parent)
29 : VehicleProfileItemInterface(parent)
30 , modelCatalogue(vehicle->getModelCatalogue())
31 , model(vehicle->getModel())
32 , systemConfig(vehicle->getSystemConfig())
33 , systemProfiles(new SystemProfiles)
34 , components(new VehicleComponentMapModel(this))
35 , sensors( new SensorMapModel(this))
36 {
37 // copy all properties from vehicle
38 for(auto algoType : vehicle->getSystemProfiles()->keys())
39 {
40 Systems * systems = new Systems;
41 for(auto system : vehicle->getSystems(algoType)->keys())
42 systems->insert(system, vehicle->getSystems(algoType)->value(system));
43
44 systemProfiles->insert(algoType, systems);
45 }
46
47 // Note: components and sensors do not need to be copied because they are not edited by the GUI. They are automatically
48 // constructed from the objects attributes when the GUI's configuration is exported to a Profiles Catalogue.
49 }
50
51 VehicleProfileItemModel::~VehicleProfileItemModel()
52 {
53 qDeleteAll(systemProfiles->values());
54 delete systemProfiles;
55 }
56
57 VehicleProfileItemInterface::Name VehicleProfileItemModel::getName() const
58 {
59 VehicleProfileMapInterface const * const map = qobject_cast<VehicleProfileMapInterface const * const > ( parent() );
60
61 return ( (map) ? map->getName( const_cast<VehicleProfileItemModel *> (this) ) : VehicleProfileItemInterface::Name() );
62 }
63
64 VehicleProfileItemInterface::Model VehicleProfileItemModel::getModel() const
65 {
66 return model;
67 }
68
69 void VehicleProfileItemModel::setModel(Model const & _model)
70 {
71 model = _model;
72 }
73
74 VehicleProfileItemInterface::ModelCatalogue VehicleProfileItemModel::getModelCatalogue() const
75 {
76 return modelCatalogue;
77 }
78
79 void VehicleProfileItemModel::setModelCatalogue(ModelCatalogue const & _modelCatalogue)
80 {
81 modelCatalogue = _modelCatalogue;
82 }
83
84 VehicleProfileItemModel::SystemConfig VehicleProfileItemModel::getSystemConfig() const
85 {
86 return systemConfig;
87 }
88
89 void VehicleProfileItemModel::setSystemConfig(const SystemConfig &_systemConfig)
90 {
91 systemConfig = _systemConfig;
92 }
93
94 VehicleProfileItemModel::SystemProfiles * VehicleProfileItemModel::getSystemProfiles() const
95 {
96 return systemProfiles;
97 }
98
99 VehicleProfileItemModel::Systems * VehicleProfileItemModel::getSystems(const AlgoType &_type) const
100 {
101 return systemProfiles->value(_type);
102 }
103
104 /************************************ Interferes with SystemConfig *******************************************/
105
106 VehicleProfileItemInterface::VehicleComponents * VehicleProfileItemModel::getVehicleComponents() const
107 {
108 return components;
109 }
110
111 VehicleProfileItemInterface::Sensors * VehicleProfileItemModel::getSensors() const
112 {
113 return sensors;
114 }
VehicleProfileItemModel.h
This class implements the functionality of VehicleProfileItemInterface.
VehicleProfileItemModel::setModelCatalogue
virtual void setModelCatalogue(ModelCatalogue const &_modelCatalogue) override
Method which sets the current vehicle model catalogue to the one passed as an argument.
Definition: VehicleProfileItemModel.cpp:79
VehicleProfileItemModel::getModelCatalogue
virtual ModelCatalogue getModelCatalogue() const override
Method which returns the current vehicle model catalogue.
Definition: VehicleProfileItemModel.cpp:74
VehicleProfileItemInterface::Name
QString Name
typedef for the name of the vehicle profile
Definition: VehicleProfileItemInterface.h:76
VehicleProfileItemInterface::ModelCatalogue
QString ModelCatalogue
typedef for the vehicle model catalogue
Definition: VehicleProfileItemInterface.h:80
VehicleProfileItemInterface::SystemConfig
QString SystemConfig
typedef for the system config XML file
Definition: VehicleProfileItemInterface.h:82
VehicleProfileItemModel::setModel
virtual void setModel(Model const &_model) override
Method which sets the current vehicle model to the one passed as an argument.
Definition: VehicleProfileItemModel.cpp:69
VehicleProfileItemModel::getSystems
virtual Systems * getSystems(AlgoType const &_type) const override
Method which returns the mapping of all systems of the given algorithm type to their equipment probab...
Definition: VehicleProfileItemModel.cpp:99
VehicleProfileItemModel::getSystemConfig
virtual SystemConfig getSystemConfig() const override
Method which returns the name of the current system config XML file.
Definition: VehicleProfileItemModel.cpp:84
SensorMapModel.h
This class implements the functionality of SensorMapInterface.
VehicleProfileItemModel::systemConfig
SystemConfig systemConfig
the string object storing the selected system config file
Definition: VehicleProfileItemModel.h:65
VehicleProfileItemInterface
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
Definition: VehicleProfileItemInterface.h:71
VehicleProfileItemInterface::Model
QString Model
typedef for the vehicle model
Definition: VehicleProfileItemInterface.h:79
VehicleProfileItemModel::getSystemProfiles
virtual SystemProfiles * getSystemProfiles() const override
Method which returns all mappings of systems to probabilities sorted by their algorithm type...
Definition: VehicleProfileItemModel.cpp:94
VehicleProfileItemModel::setSystemConfig
virtual void setSystemConfig(SystemConfig const &_systemConfig) override
Method which sets the current system config XML file to the one passed as an argument.
Definition: VehicleProfileItemModel.cpp:89
VehicleProfileItemModel::getName
virtual Name getName() const override
Method which returns the name of the vehicle profile.
Definition: VehicleProfileItemModel.cpp:57
SensorMapModel
This class implements the functionality of SensorMapInterface.
Definition: SensorMapModel.h:25
VehicleProfileItemModel::getSensors
virtual Sensors * getSensors() const override
Method which returns the map of sensors, i.e. the container class for instances of the SensorItemInte...
Definition: VehicleProfileItemModel.cpp:111
VehicleProfileItemInterface::getSystemProfiles
virtual SystemProfiles * getSystemProfiles() const =0
Method which returns all mappings of systems to probabilities sorted by their algorithm type...
VehicleProfileItemModel::sensors
Sensors *const sensors
the map containing all sensor data
Definition: VehicleProfileItemModel.h:70
VehicleComponentMapModel
This class implements the functionality of VehicleComponentMapInterface.
Definition: VehicleComponentMapModel.h:25
VehicleComponentMapInterface
This class constitutes a container class for vehicle component data (instances of VehicleComponentIte...
Definition: VehicleComponentMapInterface.h:38
VehicleProfileItemModel::getVehicleComponents
virtual VehicleComponents * getVehicleComponents() const override
Method which returns the map of vehicle components, i.e. the container class for instances of the Veh...
Definition: VehicleProfileItemModel.cpp:106
VehicleProfileItemInterface::getSystems
virtual Systems * getSystems(AlgoType const &_type) const =0
Method which returns the mapping of all systems of the given algorithm type to their equipment probab...
VehicleProfileItemModel::getModel
virtual Model getModel() const override
Method which returns the currently selected vehicle model.
Definition: VehicleProfileItemModel.cpp:64
VehicleProfileItemInterface::Systems
QMap< System, Probability > Systems
typedef for the map assigning probabilities to systems
Definition: VehicleProfileItemInterface.h:88
VehicleProfileMapInterface.h
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
VehicleProfileItemModel::components
VehicleComponents *const components
the map containing all vehicle component data
Definition: VehicleProfileItemModel.h:69
VehicleProfileItemModel::model
Model model
the string object storing the current vehicle model
Definition: VehicleProfileItemModel.h:64
VehicleProfileItemInterface::AlgoType
QString AlgoType
typedef for the algorithm type (in fact, the implementation of the algorithm)
Definition: VehicleProfileItemInterface.h:85
VehicleProfileItemModel::modelCatalogue
ModelCatalogue modelCatalogue
the string object storing the selected vehicle model catalogue
Definition: VehicleProfileItemModel.h:63
SensorMapInterface
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are ...
Definition: SensorMapInterface.h:36
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
VehicleProfileMapInterface::getName
virtual VehicleProfileMapInterface::Name getName(VehicleProfileMapInterface::Item *const item) const =0
Method wich returns the name of the given vehicle profile.
VehicleComponentMapModel.h
This class implements the functionality of VehicleComponentMapInterface.
VehicleProfileItemInterface::SystemProfiles
QMap< AlgoType, Systems * > SystemProfiles
typedef for the map sorting the probability-assigned systems by the algorithm type ...
Definition: VehicleProfileItemInterface.h:89
VehicleProfileItemModel::systemProfiles
SystemProfiles * systemProfiles
the map registering mappings of systems onto probabilities using the algorithm type as a key identifi...
Definition: VehicleProfileItemModel.h:66
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileMapModel.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
VehicleProfileMapModel.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "VehicleProfileMapModel.h"
12
13 #include "Models/VehicleProfileItemModel.h"
14
15 VehicleProfileMapModel::VehicleProfileMapModel(QObject *parent)
16 : VehicleProfileMapInterface(parent)
17 {
18
19 }
20
21 VehicleProfileMapInterface::Iterator VehicleProfileMapModel::begin()
22 {
23 return profiles.begin();
24 }
25
26 VehicleProfileMapInterface::ConstIterator VehicleProfileMapModel::constBegin() const
27 {
28 return profiles.constBegin();
29 }
30
31 VehicleProfileMapInterface::Iterator VehicleProfileMapModel::end()
32 {
33 return profiles.end();
34 }
35
36 VehicleProfileMapInterface::ConstIterator VehicleProfileMapModel::constEnd() const
37 {
38 return profiles.constEnd();
39 }
40
41
42 bool VehicleProfileMapModel::add(const VehicleProfileMapInterface::Name &name)
43 {
44 if(!contains(name))
45 {
46 profiles.insert(name, new VehicleProfileItemModel(this));
47 Q_EMIT added(name);
48 return true;
49 }
50
51 return false;
52 }
53
54 bool VehicleProfileMapModel::add(const VehicleProfileMapInterface::Name &name, VehicleProfileMapInterface::Item const * const item)
55 {
56
57 if(!contains(name))
58 {
59 profiles.insert(name, new VehicleProfileItemModel(item, this));
60 Q_EMIT added(name);
61 return true;
62 }
63
64 return false;
65 }
66
67 bool VehicleProfileMapModel::remove(const VehicleProfileMapInterface::Name &name)
68 {
69 if(contains(name))
70 {
71 delete profiles.take(name);
72 Q_EMIT removed(name);
73 return true;
74 }
75
76 return false;
77 }
78
79 VehicleProfileMapInterface::Item * VehicleProfileMapModel::getItem(VehicleProfileMapInterface::Name const & name) const
80 {
81 if(contains(name))
82 {
83 return profiles.value(name);
84 }
85
86 return nullptr;
87 }
88
89
90 VehicleProfileMapInterface::Name VehicleProfileMapModel::getName(Item * const item) const
91 {
92 return profiles.key(item);
93 }
94
95 void VehicleProfileMapModel::setName(Item * const item,
96 VehicleProfileMapInterface::Name const &name)
97 {
98
99 Name oldName = getName(item);
100
101 profiles.take(oldName);
102 profiles.insert(name, item);
103
104 Q_EMIT modifiedName(oldName, name);
105 }
106
107
108 bool VehicleProfileMapModel::contains(const VehicleProfileMapInterface::Name &name) const
109 {
110 return profiles.contains(name);
111 }
112
113 QStringList VehicleProfileMapModel::keys() const
114 {
115 return QStringList( profiles.keys() );
116 }
117
118 QList <VehicleProfileItemInterface*> VehicleProfileMapModel::values() const
119 {
120 return profiles.values();
121 }
122
123 int VehicleProfileMapModel::count() const
124 {
125 return profiles.count();
126 }
VehicleProfileItemModel.h
This class implements the functionality of VehicleProfileItemInterface.
VehicleProfileMapModel::constEnd
virtual VehicleProfileMapInterface::ConstIterator constEnd() const override
Gets an iterator pointing at the end of the map after the last vehicle profile (use for read-only)...
Definition: VehicleProfileMapModel.cpp:36
VehicleProfileMapModel::remove
virtual bool remove(VehicleProfileMapInterface::Name const &name) override
Method which removes the vehicle profile with the given name from the map. The profile is deleted aft...
Definition: VehicleProfileMapModel.cpp:67
VehicleProfileMapModel::count
virtual int count() const override
Method which returns the number of vehicle profiles in the map.
Definition: VehicleProfileMapModel.cpp:123
VehicleProfileMapInterface::added
void added(Name const &name)
Signal emitted when a vehicle profile has been added to the map. Transmits the name of the correpondi...
VehicleProfileMapModel::getItem
virtual VehicleProfileMapInterface::Item * getItem(VehicleProfileMapInterface::Name const &name) const override
Method which returns a pointer to the vehicle profile with the given name. If the map does not contai...
Definition: VehicleProfileMapModel.cpp:79
VehicleProfileMapModel::values
virtual QList< Item * > values() const override
Method which returns a list of pointers to all vehicle profiles in the map.
Definition: VehicleProfileMapModel.cpp:118
VehicleProfileItemInterface
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
Definition: VehicleProfileItemInterface.h:71
VehicleProfileMapModel::getName
virtual VehicleProfileMapInterface::Name getName(VehicleProfileMapInterface::Item *const item) const override
Method wich returns the name of the given vehicle profile.
Definition: VehicleProfileMapModel.cpp:90
VehicleProfileMapInterface::ConstIterator
Map::ConstIterator ConstIterator
a const iterator of the map (for read-only operations)
Definition: VehicleProfileMapInterface.h:50
VehicleProfileMapModel::keys
virtual QStringList keys() const override
Method which returns the (string) list of all vehicle profile names in the map.
Definition: VehicleProfileMapModel.cpp:113
VehicleProfileMapModel.h
This class implements the functionality of VehicleProfileMapInterface.
VehicleProfileMapInterface::Name
VehicleProfileItemInterface::Name Name
typedef for vehicle profile names (= key identifiers of the map)
Definition: VehicleProfileMapInterface.h:44
VehicleProfileMapModel::contains
virtual bool contains(VehicleProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a vehicle profile with the given name.
Definition: VehicleProfileMapModel.cpp:108
VehicleProfileMapModel::add
virtual bool add(VehicleProfileMapInterface::Name const &name) override
Method which creates a new vehicle profile (instance of VehicleProfileItemInterface) and adds it to t...
Definition: VehicleProfileMapModel.cpp:42
VehicleProfileMapInterface::modifiedName
void modifiedName(Name const &oldName, Name const &newName)
Signal emitted when the name of the vehicle profile has been changed. Transmits both, the new and old names of the profile.
VehicleProfileMapModel::constBegin
virtual VehicleProfileMapInterface::ConstIterator constBegin() const override
Gets an iterator pointing to the first vehicle profile in the map (use for read-only since pointing a...
Definition: VehicleProfileMapModel.cpp:26
VehicleProfileMapModel::begin
virtual VehicleProfileMapInterface::Iterator begin() override
Gets an iterator pointing to the first vehicle profile in the map.
Definition: VehicleProfileMapModel.cpp:21
VehicleProfileMapInterface::removed
void removed(Name const &name)
Signal emitted when a vehicle profile has been removed from the map. Transmits the name of the correp...
VehicleProfileItemModel
This class implements the functionality of VehicleProfileItemInterface.
Definition: VehicleProfileItemModel.h:25
VehicleProfileMapModel::setName
virtual void setName(VehicleProfileMapInterface::Item *const item, VehicleProfileMapInterface::Name const &name) override
Method wich changes the name of the given vehicle profile to the one passed as second argument...
Definition: VehicleProfileMapModel.cpp:95
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
VehicleProfileMapModel::end
virtual VehicleProfileMapInterface::Iterator end() override
Gets an iterator pointing to the end of the map after the last vehicle profile.
Definition: VehicleProfileMapModel.cpp:31
VehicleProfileMapInterface::Iterator
Map::Iterator Iterator
an iterator of the map
Definition: VehicleProfileMapInterface.h:49
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfilesMapPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
VehicleProfilesMapPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "VehicleProfilesMapPresenter.h"
12
13 VehicleProfilesMapPresenter::VehicleProfilesMapPresenter(AgentItemInterface::VehicleProfiles *vehicleProfiles,
14 QObject *parent)
15 : QAbstractTableModel(parent)
16 , vehicleProfiles(vehicleProfiles)
17 {
18 _columnHeaders << "Vehicle Profile" << "Probability";
19 }
20
21 QVariant VehicleProfilesMapPresenter::headerData(int section, Qt::Orientation orientation, int role) const
22 {
23 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
24 return _columnHeaders.value(section);
25
26 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
27 return section + 1;
28
29 return QVariant();
30 }
31
32 int VehicleProfilesMapPresenter::rowCount(const QModelIndex &parent) const
33 {
34 Q_UNUSED(parent)
35
36 if(vehicleProfiles)
37 return vehicleProfiles->count();
38 else
39 return 0;
40 }
41
42 int VehicleProfilesMapPresenter::columnCount(const QModelIndex &parent) const
43 {
44 Q_UNUSED(parent)
45
46 return _columnHeaders.count();
47 }
48
49 QVariant VehicleProfilesMapPresenter::data(const QModelIndex &index, int role) const
50 {
51 int row = index.row();
52 int col = index.column();
53
54 if(!vehicleProfiles && row >= vehicleProfiles->count())
55 return QVariant::Invalid;
56
57 if( role == Qt::TextAlignmentRole)
58 return QVariant( Qt::AlignCenter );
59
60 if(role == Qt::DisplayRole || role == Qt::EditRole)
61 {
62 if(col == 0)
63 return QVariant(RowToProfile[row]);
64 else if(col == 1)
65 return QVariant(vehicleProfiles->value( RowToProfile[row] ));
66 }
67
68 return QVariant();
69 }
70
71 bool VehicleProfilesMapPresenter::setData(const QModelIndex &index, const QVariant &value, int role)
72 {
73 int row = index.row();
74 int col = index.column();
75
76 if(vehicleProfiles && role == Qt::EditRole)
77 {
78 if(col == 0 && !vehicleProfiles->keys().contains(value.toString()))
79 {
80 vehicleProfiles->insert( value.toString(), vehicleProfiles->take(RowToProfile[row]) );
81 RowToProfile.take( row );
82 RowToProfile.insert( row, value.toString() );
83 Q_EMIT dataChanged(index, index);
84 return true;
85 }
86 else if ( col ==1 && vehicleProfiles->contains(RowToProfile[row]))
87 {
88 (*vehicleProfiles)[RowToProfile[row]] = value.toDouble();
89 Q_EMIT dataChanged(index, index);
90 Q_EMIT checkProbabilities();
91 return true;
92 }
93 }
94
95 return false;
96 }
97
98 Qt::ItemFlags VehicleProfilesMapPresenter::flags(const QModelIndex &index) const
99 {
100 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
101 }
102
103 void VehicleProfilesMapPresenter::addRow(const int &row,
104 const AgentItemInterface::VehicleProfile &profile,
105 const AgentItemInterface::Probability &probability)
106 {
107 if(vehicleProfiles)
108 {
109 for(auto _row= RowToProfile.size()-1; _row>=row; _row--)
110 RowToProfile.insert(_row + 1, RowToProfile.take(_row));
111
112 RowToProfile.insert( row, profile );
113
114 beginInsertRows(QModelIndex(), row, row );
115 vehicleProfiles->insert(profile, probability);
116 endInsertRows();
117 Q_EMIT checkProbabilities();
118 }
119
120 }
121
122 bool VehicleProfilesMapPresenter::removeRow(const int &row)
123 {
124 if(vehicleProfiles && RowToProfile.contains(row) && vehicleProfiles->contains(RowToProfile[row]))
125 {
126 beginRemoveRows(QModelIndex(), row, row);
127
128 vehicleProfiles->take( RowToProfile[row] );
129 RowToProfile.take(row);
130
131 for( int i = row + 1; i<=RowToProfile.count() ; i++ )
132 RowToProfile.insert( i-1, RowToProfile.take(i));
133
134 endRemoveRows();
135 Q_EMIT checkProbabilities();
136 return true;
137 }
138 else
139 return false;
140 }
141
142 void VehicleProfilesMapPresenter::setVehicleProfiles(AgentItemInterface::VehicleProfiles * const _vehicleProfiles)
143 {
144 vehicleProfiles=_vehicleProfiles;
145 update();
146 }
147
148
149 void VehicleProfilesMapPresenter::update()
150 {
151 int rows = 0;
152 beginResetModel();
153 endResetModel();
154 RowToProfile.clear();
155
156 if(vehicleProfiles)
157 {
158 for( auto profile : vehicleProfiles->keys())
159 {
160 RowToProfile.insert(rows, profile);
161 rows++;
162 }
163 }
164 Q_EMIT checkProbabilities();
165 }
166
167 void VehicleProfilesMapPresenter::editName(const AgentItemInterface::VehicleProfile &oldName,
168 const AgentItemInterface::VehicleProfile &newName)
169 {
170 if(vehicleProfiles && vehicleProfiles->contains(oldName))
171 {
172 vehicleProfiles->insert( newName, vehicleProfiles->take(oldName));
173
174 int row = RowToProfile.key(oldName);
175 RowToProfile.insert(row, newName);
176 }
177 }
178
179 void VehicleProfilesMapPresenter::remove(const AgentItemInterface::VehicleProfile &profile)
180 {
181 removeRow(RowToProfile.key(profile));
182 }
VehicleProfilesMapPresenter::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! ...
Definition: VehicleProfilesMapPresenter.cpp:98
AgentItemInterface::VehicleProfiles
QMap< VehicleProfile, Probability > VehicleProfiles
the mapping of a vehicle profile to the instantiation probability
Definition: AgentItemInterface.h:57
VehicleProfilesMapPresenter::remove
void remove(AgentItemInterface::VehicleProfile const &profile)
Slot removes the given vehicle profile if contained in the table.
Definition: VehicleProfilesMapPresenter.cpp:179
VehicleProfilesMapPresenter::update
void update()
Method which updates the table according to the current entries of vehicleProfiles.
Definition: VehicleProfilesMapPresenter.cpp:149
VehicleProfilesMapPresenter::vehicleProfiles
AgentItemInterface::VehicleProfiles * vehicleProfiles
the pointer to the map of vehicle profiles assigned to an agent profile
Definition: VehicleProfilesMapPresenter.h:177
VehicleProfilesMapPresenter::removeRow
virtual bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: VehicleProfilesMapPresenter.cpp:122
VehicleProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::VehicleProfile > RowToProfile
a mapping of row indices to profile names
Definition: VehicleProfilesMapPresenter.h:181
VehicleProfilesMapPresenter::checkProbabilities
void checkProbabilities()
Signal emitted whenever the probability sum of the vehicle profile table should be checked...
VehicleProfilesMapPresenter::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table&#39;s header in the table sectio...
Definition: VehicleProfilesMapPresenter.cpp:21
VehicleProfilesMapPresenter::editName
void editName(AgentItemInterface::VehicleProfile const &oldName, AgentItemInterface::VehicleProfile const &newName)
Slot which changes the name of the vehicle profile.
Definition: VehicleProfilesMapPresenter.cpp:167
VehicleProfilesMapPresenter::addRow
virtual void addRow(int const &row, AgentItemInterface::VehicleProfile const &profile, AgentItemInterface::Probability const &probability)
Method that adds a new row, i.e. a vehicle profile with the given probability.
Definition: VehicleProfilesMapPresenter.cpp:103
VehicleProfilesMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: VehicleProfilesMapPresenter.cpp:32
VehicleProfilesMapPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the give...
Definition: VehicleProfilesMapPresenter.cpp:49
VehicleProfilesMapPresenter::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the give...
Definition: VehicleProfilesMapPresenter.cpp:71
VehicleProfilesMapPresenter::_columnHeaders
QStringList _columnHeaders
the list containing the header data for columns
Definition: VehicleProfilesMapPresenter.h:180
AgentItemInterface::VehicleProfile
QString VehicleProfile
the name of a vehicle profile
Definition: AgentItemInterface.h:56
VehicleProfilesMapPresenter.h
This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle pro...
VehicleProfilesMapPresenter::setVehicleProfiles
void setVehicleProfiles(AgentItemInterface::VehicleProfiles *const _vehicleProfiles)
Method which sets the currently processed vehicle profiles map to the given argument.
Definition: VehicleProfilesMapPresenter.cpp:142
AgentItemInterface::Probability
double Probability
a probability value (e.g. of a driver or a vehicle profile)
Definition: AgentItemInterface.h:45
VehicleProfilesMapPresenter::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list...
Definition: VehicleProfilesMapPresenter.cpp:42
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfilesPresenter.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
VehicleProfilesPresenter.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "openPASS-System/SystemInterface.h"
12
13 #include "Models/VehicleProfileItemModel.h"
14
15 #include "Presenters/SystemProfilePresenter.h"
16 #include "Presenters/VehicleProfilesPresenter.h"
17
18 #include "DelegateComboBoxView.h"
19 #include "DelegateDoubleView.h"
20
21 #include <QPair>
22 #include <QStringList>
23 #include <QFile>
24 #include <QXmlStreamReader>
25 #include <QFileDialog>
26 #include <QFileInfo>
27
28
29 double VehicleProfilesPresenter::default_probability = 0.5;
30
31 VehicleProfilesPresenter::VehicleProfilesPresenter(VehicleProfileMapInterface *vehicleProfiles,
32 VehicleProfilesView *vehicleProfilesView,
33 SystemInterface * systemInterface,
34 ProjectInterface * const project,
35 QUndoStack * const undoStack,
36 QObject *parent)
37 : QObject(parent)
38 , currentVehicleProfile(nullptr)
39 , vehicleProfiles(vehicleProfiles)
40 , vehicleProfilesView(vehicleProfilesView)
41 , systemInterface(systemInterface)
42 , project(project)
43 , undoStack(undoStack)
44 {
45 connect(vehicleProfilesView, &VehicleProfilesView::selectedVehicleProfile, this, &VehicleProfilesPresenter::setCurrentVehicleProfile);
46
47 connect(vehicleProfilesView, &VehicleProfilesView::addVehicleProfile, this, &VehicleProfilesPresenter::addVehicleProfile);
48 connect(vehicleProfilesView, &VehicleProfilesView::removeVehicleProfile, this, &VehicleProfilesPresenter::removeVehicleProfile);
49 connect(vehicleProfilesView, &VehicleProfilesView::modifiedName, this, &VehicleProfilesPresenter::editVehicleProfileName);
50
51 connect(vehicleProfilesView, &VehicleProfilesView::changeSystemConfig, this, &VehicleProfilesPresenter::setSystemConfig);
52 connect(vehicleProfilesView, &VehicleProfilesView::refreshSystemConfig, this, &VehicleProfilesPresenter::refreshSystemConfig);
53
54 connect(vehicleProfilesView, &VehicleProfilesView::refreshModelCatalogue, this, &VehicleProfilesPresenter::refreshModelCatalogue);
55 connect(vehicleProfilesView, &VehicleProfilesView::changeModelCatalogue, this, &VehicleProfilesPresenter::setModelCatalogue);
56 connect(vehicleProfilesView, &VehicleProfilesView::modifiedModel, this, &VehicleProfilesPresenter::setModel);
57
58 connect(vehicleProfilesView, &VehicleProfilesView::addSystemProfile, this, &VehicleProfilesPresenter::addSystemProfile);
59 connect(vehicleProfilesView, &VehicleProfilesView::removeSystemProfile, this, &VehicleProfilesPresenter::removeSystemProfile);
60
61 connect(project, &ProjectInterface::update, this, &VehicleProfilesPresenter::refreshSystemConfig);
62 connect(project, &ProjectInterface::update, this, &VehicleProfilesPresenter::refreshModelCatalogue);
63 }
64
65 VehicleProfilesPresenter::~VehicleProfilesPresenter()
66 {
67 for(auto key : systemProfilePresenters.keys())
68 {
69 qDeleteAll(systemProfilePresenters.value(key)->values());
70 delete systemProfilePresenters.value(key);
71 }
72 }
73
74 void VehicleProfilesPresenter::setCurrentVehicleProfile(const QString &name)
75 {
76 if(currentVehicleProfile && currentVehicleProfile->getName() != name)
77 undoStack->push(new VehicleProfileCommands::SetCurrentVehicle(vehicleProfiles, &currentVehicleProfile, name, this));
78 }
79
80
81 void VehicleProfilesPresenter::addVehicleProfile(const QString &name)
82 {
83 undoStack->beginMacro(QString("added vehicle profile %1").arg(name));
84 undoStack->push(new VehicleProfileCommands::AddVehicleProfile(vehicleProfiles, vehicleProfilesView, name,&systemProfilePresenters));
85 undoStack->push(new VehicleProfileCommands::SetCurrentVehicle(vehicleProfiles, &currentVehicleProfile, name, this));
86 undoStack->endMacro();
87 }
88
89 void VehicleProfilesPresenter::removeVehicleProfile(const QString &name)
90 {
91 if(currentVehicleProfile && currentVehicleProfile->getName() == name)
92 {
93 QList<VehicleProfileItemInterface::Name> vehicleList = vehicleProfiles->keys();
94 vehicleList.removeAll(name);
95 VehicleProfileItemInterface::Name vehicleName = vehicleList.isEmpty() ? "" : vehicleList.first();
96
97 undoStack->beginMacro(QString("removed vehicle profile %1").arg(name));
98 undoStack->push(new VehicleProfileCommands::SetCurrentVehicle(vehicleProfiles, &currentVehicleProfile, vehicleName, this));
99 undoStack->push(new VehicleProfileCommands::RemoveVehicleProfile(vehicleProfiles, vehicleProfilesView, name, &systemProfilePresenters));
100 undoStack->endMacro();
101 }
102 }
103
104 void VehicleProfilesPresenter::editVehicleProfileName(const QString &oldName, const QString &newName)
105 {
106 if(vehicleProfiles->contains(oldName) && !vehicleProfiles->contains(newName))
107 {
108 undoStack->push(new VehicleProfileCommands::EditVehicleProfile(vehicleProfiles, vehicleProfilesView, oldName, newName));
109 }
110
111 }
112
113 void VehicleProfilesPresenter::setSystemConfig()
114 {
115 QString const filepath = QFileDialog::getOpenFileName(
116 vehicleProfilesView, QObject::tr("openPASS / Choose system configuration"),
117 project->getConfigPath(), QStringLiteral("systemConfig (*.xml)"));
118
119 QString systemConfig = project->relativeToConfigPath(filepath);
120
121 if(currentVehicleProfile && (systemConfig!=currentVehicleProfile->getSystemConfig()) && !systemConfig.isEmpty() )
122 {
123
124 undoStack->push(new VehicleProfileCommands::SetSystemConfig(vehicleProfiles, vehicleProfilesView, currentVehicleProfile->getName(), systemConfig, this));
125 }
126 }
127
128 void VehicleProfilesPresenter::refreshSystemConfig()
129 {
130 if(currentVehicleProfile)
131 {
132 QString filepath = currentVehicleProfile->getSystemConfig();
133 vehicleProfilesView->setSystemConfigError("");
134 vehicleProfilesView->setSystemProfilesError("");
135
136 if(filepath.isEmpty())
137 {
138 vehicleProfilesView->setSystemProfileSelection(QStringList());
139 return;
140 }
141
142 bool dynamicMode = true;
143 QString path = project->absoluteToConfigPath(filepath);
144
145 if(systemInterface->load(path, &dynamicMode))
146 updateSystemList();
147 else
148 {
149 vehicleProfilesView->setSystemConfigError("System Config is invalid!");
150 return;
151 }
152
153 // update the list of available systems and system profiles.
154 vehicleProfilesView->setSystemProfileSelection(systemList.keys());
155
156 if(!QFileInfo::exists(project->absoluteToConfigPath(filepath)))
157 vehicleProfilesView->setSystemConfigError("System Config not accessible! Check configuration path in Master Configuration.");
158
159
160 // check whether systems in current profile exist in systemConfig (systemList)
161 if(!systemsConsistent())
162 {
163 vehicleProfilesView->setSystemProfilesError("Systems below are undefined!");
164 }
165 }
166 }
167
168 void VehicleProfilesPresenter::updateSystemList()
169 {
170
171 systemList.clear();
172
173 // Go through all systems and register ID and Title
174 for(auto system : systemInterface->getSystems()->values())
175 {
176 SystemComponentItemInterface * currentAlgo = nullptr;
177 QString systemListItem = system->getTitle() + QString(" (ID=%1)").arg(system->getID());
178
179 // find the component of type "Algorithm"
180 for ( auto component : system->getComponents()->values())
181 if(component->getType() == SystemComponentItemInterface::Type::Algorithm)
182 {
183 currentAlgo = component;
184 break;
185 }
186
187 if(currentAlgo)
188 {
189 // determine the library of the algo (which is the type in Profiles Catalogue)
190 QString type = currentAlgo->getTitle();
191
192 // add the system ID and Title to the list under the determined type
193 if(systemList.contains(type))
194 systemList[type].append(systemListItem);
195 else
196 systemList.insert(type, QList<QString>({systemListItem}));
197 }
198 }
199 }
200
201
202 void VehicleProfilesPresenter::addSystemProfile(const QString &type)
203 {
204 if(currentVehicleProfile && !currentVehicleProfile->getSystemProfiles()->keys().contains(type) && !type.isEmpty())
205 {
206 undoStack->push(new VehicleProfileCommands::AddSystemProfile(vehicleProfiles,
207 currentVehicleProfile->getName(),
208 type,
209 systemProfilePresenters.value(currentVehicleProfile->getName()),
210 this));
211 }
212 }
213
214 void VehicleProfilesPresenter::removeSystemProfile(const QString &type)
215 {
216 if(currentVehicleProfile && systemList.keys().contains(type))
217 {
218 undoStack->push(new VehicleProfileCommands::RemoveSystemProfile(vehicleProfiles,
219 currentVehicleProfile->getName(),
220 type,
221 systemProfilePresenters[currentVehicleProfile->getName()],
222 this));
223 }
224 }
225
226
227 void VehicleProfilesPresenter::addSystem(QString const &type, const QString &selectionItem)
228 {
229 // find the system profile presenter
230 if(currentVehicleProfile)
231 {
232 SystemProfilePresenter * systemProfilePresenter = systemProfilePresenters.value(currentVehicleProfile->getName())->value(type);
233
234 if(systemProfilePresenter)
235 {
236 VehicleProfileItemInterface::System system;
237
238 // string has pattern "Title (ID=0)"
239 system.second = selectionItem.section( " (ID=", 0, 0);
240 QString ID = selectionItem.section( " (ID=", 1, 1);
241 ID.chop(1);
242 system.first = ID.toUInt();
243
244 undoStack->push(new VehicleProfileCommands::AddSystem(systemProfilePresenter, system, default_probability));
245 }
246 }
247 }
248
249 void VehicleProfilesPresenter::removeSystem(const QString &type, const int &row)
250 {
251 SystemProfilePresenter * systemProfilePresenter = systemProfilePresenters.value(currentVehicleProfile->getName())->value(type);
252
253 if(systemProfilePresenter && systemProfilePresenter->rowCount()!=0)
254 undoStack->push(new VehicleProfileCommands::RemoveSystem(systemProfilePresenter, row));
255 }
256
257 void VehicleProfilesPresenter::setModelCatalogue()
258 {
259 QString const filepath = QFileDialog::getOpenFileName(
260 vehicleProfilesView, QObject::tr("openPASS / Choose Vehicle Models Catalogue"),
261 project->getConfigPath(), QStringLiteral("VehicleModelsCatalogue (*.xosc)"));
262
263 QString modelCatalogue = project->relativeToConfigPath(filepath);
264
265 if(currentVehicleProfile && !filepath.isEmpty())
266 {
267
268 VehicleProfileItemInterface::ModelCatalogue oldModelCatalogue = currentVehicleProfile->getModelCatalogue();
269
270 undoStack->beginMacro(QString("edited vehicle model catalogue of vehicle profile %1").arg(currentVehicleProfile->getName()));
271
272 undoStack->push(new VehicleProfileCommands::SetModelCatalogue(vehicleProfiles, vehicleProfilesView, currentVehicleProfile->getName(), modelCatalogue, this));
273
274 if(modelCatalogue!=oldModelCatalogue && !modelList.isEmpty())
275 undoStack->push(new VehicleProfileCommands::SetModel(vehicleProfiles, vehicleProfilesView, currentVehicleProfile->getName(), modelList.last()));
276
277 undoStack->endMacro();
278 }
279 }
280
281 void VehicleProfilesPresenter::refreshModelCatalogue()
282 {
283 if(currentVehicleProfile)
284 {
285 QString modelCatalogue = currentVehicleProfile->getModelCatalogue();
286 loadModelCatalogue(modelCatalogue);
287 vehicleProfilesView->setModelCatalogueError("");
288
289 if(modelCatalogue.isEmpty())
290 return;
291
292 if(!QFileInfo::exists(project->absoluteToConfigPath(modelCatalogue)))
293 {
294 vehicleProfilesView->setModelCatalogueError("Model catalogue not accessible! Check configuration path in Master Configuration.");
295 vehicleProfilesView->enableModelView(false);
296 return;
297 }
298
299 if(modelList.contains(currentVehicleProfile->getModel()))
300 {
301 vehicleProfilesView->enableModelView(true);
302 vehicleProfilesView->setModel(currentVehicleProfile->getModel());
303 }
304 else if (!currentVehicleProfile->getModel().isEmpty()){
305 vehicleProfilesView->setModelCatalogueError("Model does not exist in model catalogue!");
306 vehicleProfilesView->enableModelView(false);
307 }
308 }
309 }
310
311 void VehicleProfilesPresenter::loadModelCatalogue(const QString &filepath)
312 {
313 QString path = project->absoluteToConfigPath(filepath);
314 QFile file(path);
315
316 modelList.clear();
317 if(currentVehicleProfile && file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text) )
318 {
319 QXmlStreamReader xml(&file);
320 xml.readNextStartElement();
321
322 while( xml.readNextStartElement() )
323 {
324 if(xml.name() == QString("Catalog"))
325 {
326 while( xml.readNextStartElement() )
327 {
328 if(xml.name() == QString("Vehicle"))
329 {
330 modelList << xml.attributes().value("name").toString();
331 xml.skipCurrentElement();
332 }
333 else
334 xml.skipCurrentElement();
335 }
336 }
337 else
338 xml.skipCurrentElement();
339 }
340 }
341 vehicleProfilesView->setModelSelectionItems(modelList);
342 }
343
344 void VehicleProfilesPresenter::setModel(const QString &modelName)
345 {
346 if(currentVehicleProfile)
347 undoStack->push(new VehicleProfileCommands::SetModel(vehicleProfiles, vehicleProfilesView, currentVehicleProfile->getName(), modelName));
348 }
349
350
351 void VehicleProfilesPresenter::updateView()
352 {
353
354 if(currentVehicleProfile)
355 {
356
357 vehicleProfilesView->setCurrentVehicle(currentVehicleProfile->getName());
358
359 vehicleProfilesView->enableConfiguration(true);
360
361 // update system views
362 updateSystemsView();
363
364 // update model catalogue view
365 refreshModelCatalogue();
366 vehicleProfilesView->setModelCatalogue(currentVehicleProfile->getModelCatalogue());
367
368 }
369 else
370 {
371 vehicleProfilesView->clearSystemProfileViews();
372
373 vehicleProfilesView->enableConfiguration(false);
374 vehicleProfilesView->setSystemConfig("");
375 vehicleProfilesView->setSystemProfileSelection(QList<QString>());
376 vehicleProfilesView->setModelCatalogue("");
377 vehicleProfilesView->setModelSelectionItems(QStringList());
378 vehicleProfilesView->setModel("");
379
380 vehicleProfilesView->setSystemConfigError("");
381 vehicleProfilesView->setSystemProfilesError("");
382 vehicleProfilesView->setModelCatalogueError("");
383 }
384 }
385
386 void VehicleProfilesPresenter::updateSystemsView()
387 {
388 vehicleProfilesView->setSystemConfig(currentVehicleProfile->getSystemConfig());
389 refreshSystemConfig();
390
391 vehicleProfilesView->clearSystemProfileViews();
392 if(systemProfilePresenters.value(currentVehicleProfile->getName()))
393 {
394 for(auto type : systemProfilePresenters.value(currentVehicleProfile->getName())->keys())
395 {
396 // create the view and connect it to the presenter
397 SystemProfileView * systemProfileView = vehicleProfilesView->addSystemProfileView(type);
398 SystemProfilePresenter * systemProfilePresenter = systemProfilePresenters.value(currentVehicleProfile->getName())->value(type);
399
400 systemProfileView->getSystemView()->setModel(systemProfilePresenter);
401 systemProfileView->getSystemView()->setItemDelegateForColumn(2, new DelegateDoubleView(0, 1, 0.1, 2, "system's probability", undoStack, this) );
402 systemProfileView->setSelectionItems( systemList.value(type) );
403
404 connect(systemProfileView, &SystemProfileView::addSystem, this, &VehicleProfilesPresenter::addSystem);
405 connect(systemProfileView, &SystemProfileView::removeSystem, this, &VehicleProfilesPresenter::removeSystem);
406
407 if(systemProfilePresenter)
408 systemProfilePresenter->update();
409 }
410 }
411 }
412
413 // checks whether the registered systems is consistent with systemList (e.g. system Config)
414 bool VehicleProfilesPresenter::systemsConsistent()
415 {
416 for(auto type : currentVehicleProfile->getSystemProfiles()->keys())
417 {
418 if(!systemList.contains(type))
419 return false;
420
421 for(auto system : currentVehicleProfile->getSystems(type)->keys())
422 {
423 QString listItem = QString("%1 (ID=%2)").arg(system.second).arg(system.first);
424 if( !systemList.value(type).contains(listItem) )
425 return false;
426 }
427 }
428
429 return true;
430 }
431
432 void VehicleProfilesPresenter::updateVehicleSelectionItems()
433 {
434 vehicleProfilesView->setVehicleProfileSelectionItems(vehicleProfiles->keys());
435 }
436
437 using namespace VehicleProfileCommands;
438
439 SetCurrentVehicle::SetCurrentVehicle(VehicleProfileMapInterface const * const vehicles,
440 VehicleProfileItemInterface ** const currentVehicle,
441 VehicleProfileItemInterface::Name const newVehicle,
442 VehicleProfilesPresenter * const vehiclesPresenter,
443 QUndoCommand *parent)
444 : QUndoCommand (parent)
445 , vehicles(vehicles)
446 , currentVehicle(currentVehicle)
447 , newVehicle(newVehicle)
448 , oldVehicle(*currentVehicle ? (*currentVehicle)->getName() : "")
449 , vehiclesPresenter(vehiclesPresenter)
450 {
451 setText(QString("changed vehicle profile: %1 -> %2").arg(oldVehicle).arg(newVehicle));
452 }
453
454 void SetCurrentVehicle::redo()
455 {
456 *currentVehicle = vehicles->getItem(newVehicle);
457 vehiclesPresenter->updateView();
458 }
459
460 void SetCurrentVehicle::undo()
461 {
462 *currentVehicle = vehicles->getItem(oldVehicle);
463 vehiclesPresenter->updateView();
464 }
465
466 AddVehicleProfile::AddVehicleProfile(VehicleProfileMapInterface * const vehicles,
467 VehicleProfilesView * const vehiclesView,
468 VehicleProfileMapInterface::Name const &name,
469 QMap <VehicleProfileItemInterface::Name , QMap<QString, SystemProfilePresenter*> * > * const systemProfilePresenters,
470 QUndoCommand * parent)
471 : QUndoCommand (parent)
472 , vehicles(vehicles)
473 , vehiclesView(vehiclesView)
474 , name(name)
475 , systemProfilePresenters(systemProfilePresenters)
476 , addedSystemProfiles(new QMap<QString, SystemProfilePresenter*>)
477 {
478 setText(QString("added vehicle profile %1").arg(name));
479 }
480
481 AddVehicleProfile::~AddVehicleProfile()
482 {
483 if(addedSystemProfiles)
484 {
485 qDeleteAll(addedSystemProfiles->values());
486 delete addedSystemProfiles;
487 }
488 }
489
490 void AddVehicleProfile::redo()
491 {
492 vehicles->add(name);
493 vehiclesView->addVehicleProfileSelectionItem(name);
494 systemProfilePresenters->insert(name, addedSystemProfiles);
495 addedSystemProfiles = nullptr;
496 }
497
498 void AddVehicleProfile::undo()
499 {
500 addedSystemProfiles = systemProfilePresenters->take(name);
501 vehicles->remove(name);
502 vehiclesView->removeVehicleProfileSelectionItem(name);
503 }
504
505 RemoveVehicleProfile::RemoveVehicleProfile(VehicleProfileMapInterface * const vehicles,
506 VehicleProfilesView * const vehiclesView,
507 VehicleProfileMapInterface::Name const &name,
508 QMap<VehicleProfileItemInterface::Name, QMap<QString, SystemProfilePresenter *> *> * const systemProfilePresenters,
509 QUndoCommand * parent)
510 : QUndoCommand(parent)
511 , vehicles(vehicles)
512 , vehiclesView(vehiclesView)
513 , name(name)
514 , vehicle(new VehicleProfileItemModel(vehicles->getItem(name)))
515 , systemProfilePresenters(systemProfilePresenters)
516 {
517 setText(QString("removed vehicle profile %1").arg(name));
518 }
519
520 RemoveVehicleProfile::~RemoveVehicleProfile()
521 {
522 if(removedSystemProfiles)
523 qDeleteAll(removedSystemProfiles->values());
524
525 delete vehicle;
526 }
527
528 void RemoveVehicleProfile::redo()
529 {
530 removedSystemProfiles = systemProfilePresenters->take(name);
531 for(auto presenter : removedSystemProfiles->values())
532 presenter->setSystems(nullptr);
533
534 vehicles->remove(name);
535 vehiclesView->removeVehicleProfileSelectionItem(name);
536 }
537
538 void RemoveVehicleProfile::undo()
539 {
540 vehicles->add(name, vehicle);
541 vehiclesView->addVehicleProfileSelectionItem(name);
542
543 for(auto type : vehicles->getItem(name)->getSystemProfiles()->keys())
544 removedSystemProfiles->value(type)->setSystems(vehicles->getItem(name)->getSystems(type));
545
546 systemProfilePresenters->insert(name, removedSystemProfiles);
547 removedSystemProfiles = nullptr;
548 }
549
550 EditVehicleProfile::EditVehicleProfile(VehicleProfileMapInterface * const vehicles,
551 VehicleProfilesView * const vehiclesView,
552 VehicleProfileMapInterface::Name const &oldName,
553 VehicleProfileMapInterface::Name const &newName,
554 QUndoCommand *parent)
555 : QUndoCommand (parent)
556 , vehicles(vehicles)
557 , vehiclesView(vehiclesView)
558 , oldName(oldName)
559 , newName(newName)
560 {
561 setText(QString("edited vehicle profile's name %1 -> %2").arg(oldName).arg(newName));
562 }
563
564 void EditVehicleProfile::redo()
565 {
566 VehicleProfileItemInterface * const vehicle = vehicles->getItem(oldName);
567 vehicles->setName(vehicle, newName);
568 vehiclesView->removeVehicleProfileSelectionItem(oldName);
569 vehiclesView->addVehicleProfileSelectionItem(newName);
570 }
571
572 void EditVehicleProfile::undo()
573 {
574 VehicleProfileItemInterface * const vehicle = vehicles->getItem(newName);
575 vehicles->setName(vehicle, oldName);
576 vehiclesView->removeVehicleProfileSelectionItem(newName);
577 vehiclesView->addVehicleProfileSelectionItem(oldName);
578 }
579
580 SetModelCatalogue::SetModelCatalogue(VehicleProfileMapInterface * const vehicles,
581 VehicleProfilesView * const vehicleProfilesView,
582 VehicleProfileItemInterface::Name const &vehicleName,
583 VehicleProfileItemInterface::ModelCatalogue const &newModelCatalogue,
584 VehicleProfilesPresenter * const vehicleProfilesPresenter,
585 QUndoCommand *parent)
586 : QUndoCommand(parent)
587 , vehicles(vehicles)
588 , vehicleProfilesView(vehicleProfilesView)
589 , vehicleName(vehicleName)
590 , newModelCatalogue(newModelCatalogue)
591 , oldModelCatalogue(vehicles->getItem(vehicleName)->getModelCatalogue())
592 , vehicleProfilesPresenter(vehicleProfilesPresenter)
593 {
594 setText(QString("set system config of vehicle profile %1 to %2").arg(vehicleName).arg(newModelCatalogue));
595 }
596
597 void SetModelCatalogue::redo()
598 {
599 vehicles->getItem(vehicleName)->setModelCatalogue(newModelCatalogue);
600 vehicleProfilesView->setModelCatalogue(newModelCatalogue);
601 vehicleProfilesPresenter->refreshModelCatalogue();
602 }
603
604 void SetModelCatalogue::undo()
605 {
606 vehicles->getItem(vehicleName)->setModelCatalogue(oldModelCatalogue);
607 vehicleProfilesView->setModelCatalogue(oldModelCatalogue);
608 vehicleProfilesPresenter->refreshModelCatalogue();
609 }
610
611 SetModel::SetModel(VehicleProfileMapInterface * const vehicles,
612 VehicleProfilesView * const vehicleProfilesView,
613 VehicleProfileItemInterface::Name const &vehicleName,
614 VehicleProfileItemInterface::Model const &newModel,
615 QUndoCommand *parent)
616 : QUndoCommand(parent)
617 , vehicles(vehicles)
618 , vehicleProfilesView(vehicleProfilesView)
619 , vehicleName(vehicleName)
620 , newModel(newModel)
621 , oldModel(vehicles->getItem(vehicleName)->getModel())
622 {
623 setText(QString("edited vehicle model of vehicle profile %1").arg(vehicleName));
624 }
625
626 void SetModel::redo()
627 {
628 vehicles->getItem(vehicleName)->setModel(newModel);
629 vehicleProfilesView->setModel(newModel);
630 }
631
632 void SetModel::undo()
633 {
634 vehicles->getItem(vehicleName)->setModel(oldModel);
635 vehicleProfilesView->setModel(oldModel);
636 }
637
638 SetSystemConfig::SetSystemConfig(VehicleProfileMapInterface * const vehicles,
639 VehicleProfilesView * const vehicleProfilesView,
640 VehicleProfileItemInterface::Name const &vehicleName,
641 VehicleProfileItemInterface::SystemConfig const &newSystemConfig,
642 VehicleProfilesPresenter * const vehicleProfilesPresenter,
643 QUndoCommand *parent)
644 : QUndoCommand(parent)
645 , vehicles(vehicles)
646 , vehicleProfilesView(vehicleProfilesView)
647 , vehicleName(vehicleName)
648 , newSystemConfig(newSystemConfig)
649 , oldSystemConfig(vehicles->getItem(vehicleName)->getSystemConfig())
650 , vehicleProfilesPresenter(vehicleProfilesPresenter)
651 {
652 setText(QString("set system config of vehicle profile %1 to %2").arg(vehicleName).arg(newSystemConfig));
653 }
654
655 void SetSystemConfig::redo()
656 {
657 vehicles->getItem(vehicleName)->setSystemConfig(newSystemConfig);
658 vehicleProfilesView->setSystemConfig(newSystemConfig);
659 vehicleProfilesPresenter->refreshSystemConfig();
660 }
661
662 void SetSystemConfig::undo()
663 {
664 vehicles->getItem(vehicleName)->setSystemConfig(oldSystemConfig);
665 vehicleProfilesView->setSystemConfig(oldSystemConfig);
666 vehicleProfilesPresenter->refreshSystemConfig();
667 }
668
669 AddSystemProfile::AddSystemProfile(VehicleProfileMapInterface * const vehicles,
670 VehicleProfileItemInterface::Name const &vehicleName,
671 QString const &type,
672 QMap<QString, SystemProfilePresenter*> * const systemProfilePresenters,
673 VehicleProfilesPresenter * const vehicleProfilesPresenter,
674 QUndoCommand *parent)
675 : QUndoCommand(parent)
676 , vehicles(vehicles)
677 , vehicleName(vehicleName)
678 , type(type)
679 , vehicleProfilesPresenter(vehicleProfilesPresenter)
680 , systemProfilePresenters(systemProfilePresenters)
681 , systemProfilePresenter(new SystemProfilePresenter(nullptr))
682 {
683 setText(QString("added system profile of type %1 to vehicle profile %2").arg(type).arg(vehicleName));
684 }
685
686 AddSystemProfile::~AddSystemProfile()
687 {
688 if(deletable && !systemProfilePresenters->values().contains(systemProfilePresenter) )
689 {
690 delete systemProfilePresenter;
691 }
692 }
693
694 void AddSystemProfile::redo()
695 {
696 VehicleProfileItemInterface::Systems * const systems = new VehicleProfileItemInterface::Systems;
697 vehicles->getItem(vehicleName)->getSystemProfiles()->insert(type, systems);
698 systemProfilePresenter->setSystems(systems);
699 systemProfilePresenters->insert(type, systemProfilePresenter);
700
701 vehicleProfilesPresenter->updateView();
702
703 deletable = false;
704 }
705
706 void AddSystemProfile::undo()
707 {
708 systemProfilePresenters->remove(type);
709 delete vehicles->getItem(vehicleName)->getSystemProfiles()->take(type);
710 systemProfilePresenter->setSystems(nullptr);
711
712 vehicleProfilesPresenter->updateView();
713
714 deletable = true;
715 }
716
717 RemoveSystemProfile::RemoveSystemProfile(VehicleProfileMapInterface * const vehicles,
718 VehicleProfileItemInterface::Name const &vehicleName,
719 QString const &type,
720 QMap<QString, SystemProfilePresenter*> * const systemProfilePresenters,
721 VehicleProfilesPresenter * const vehicleProfilesPresenter,
722 QUndoCommand *parent)
723 : QUndoCommand(parent)
724 , vehicles(vehicles)
725 , vehicleName(vehicleName)
726 , type(type)
727 , vehicleProfilesPresenter(vehicleProfilesPresenter)
728 , systemProfilePresenters(systemProfilePresenters)
729 , systemProfilePresenter(systemProfilePresenters->value(type))
730 {
731 setText(QString("removed system profile of type %1 from vehicle profile %2").arg(type).arg(vehicleName));
732 }
733
734 RemoveSystemProfile::~RemoveSystemProfile()
735 {
736 if(deletable && !systemProfilePresenters->values().contains(systemProfilePresenter))
737 {
738 delete systemProfilePresenter;
739 }
740 }
741
742 void RemoveSystemProfile::redo()
743 {
744 systemProfilePresenters->remove(type);
745 delete vehicles->getItem(vehicleName)->getSystemProfiles()->take(type);
746 systemProfilePresenter->setSystems(nullptr);
747
748 vehicleProfilesPresenter->updateView();
749
750 deletable = true;
751 }
752
753 void RemoveSystemProfile::undo()
754 {
755 VehicleProfileItemInterface::Systems * const systems = new VehicleProfileItemInterface::Systems;
756 vehicles->getItem(vehicleName)->getSystemProfiles()->insert(type, systems);
757 systemProfilePresenter->setSystems(systems);
758 systemProfilePresenters->insert(type, systemProfilePresenter);
759
760 vehicleProfilesPresenter->updateView();
761
762 deletable = false;
763 }
764
765
766 AddSystem::AddSystem(SystemProfilePresenter * const systems,
767 VehicleProfileItemInterface::System const &system,
768 VehicleProfileItemInterface::Probability const &probability,
769 QUndoCommand * parent)
770 : QUndoCommand (parent)
771 , systems(systems)
772 , system(system)
773 , probability(probability)
774 {
775 setText(QString("added system of type %1").arg(systems->objectName()));
776 }
777
778 void AddSystem::redo()
779 {
780 systems->addRow(systems->rowCount(), system, probability);
781 }
782
783 void AddSystem::undo()
784 {
785 systems->removeRow(systems->rowCount()-1);
786 }
787
788 RemoveSystem::RemoveSystem(SystemProfilePresenter * const systems,
789 int const &row,
790 QUndoCommand * parent)
791 : QUndoCommand(parent)
792 , systems(systems)
793 , row(row)
794 , system( systems->data(systems->index(row,0)).toUInt(),
795 systems->data(systems->index(row,1)).toString())
796 , probability(systems->data(systems->index(row, 2)).toDouble())
797 {
798 setText(QString("removed system of type %1").arg(systems->objectName()));
799 }
800
801 void RemoveSystem::redo()
802 {
803 systems->removeRow(row);
804 }
805
806 void RemoveSystem::undo()
807 {
808 systems->addRow(row, system, probability);
809 }
VehicleProfileItemModel.h
This class implements the functionality of VehicleProfileItemInterface.
VehicleProfilesPresenter::removeSystemProfile
void removeSystemProfile(QString const &type)
Slot, triggered by the VehicleProfilesView::removeSystemProfile signal. Undoably removes the map for ...
Definition: VehicleProfilesPresenter.cpp:214
VehicleProfileItemInterface::getSystemConfig
virtual SystemConfig getSystemConfig() const =0
Method which returns the name of the current system config XML file.
VehicleProfilesView::refreshSystemConfig
void refreshSystemConfig()
Signal, emitted after the refresh-button of the system config file has been pressed.
SystemProfileView::removeSystem
void removeSystem(QString AlgoType, const int &row)
Signal, emitted after the remove-button for systems has been clicked. Transmits the algorithm type an...
VehicleProfilesPresenter::removeVehicleProfile
void removeVehicleProfile(QString const &name)
Slot triggered by the VehicleProfilesView::removeVehicleProfile signal. Performs an undoable remove-o...
Definition: VehicleProfilesPresenter.cpp:89
VehicleProfilesPresenter
This class defines the presenter object for vehicle profiles which handles user events from the view ...
Definition: VehicleProfilesPresenter.h:59
VehicleProfilesView::refreshModelCatalogue
void refreshModelCatalogue()
Signal, emitted after the refresh-button of the vehicle model catalogue has been pressed.
VehicleProfileMapInterface::remove
virtual bool remove(VehicleProfileMapInterface::Name const &name)=0
Method which removes the vehicle profile with the given name from the map. The profile is deleted aft...
VehicleProfileItemInterface::System
QPair< SystemID, SystemTitle > System
typedef for a system (here, the system Id and title are sufficient)
Definition: VehicleProfileItemInterface.h:87
VehicleProfilesPresenter::loadModelCatalogue
void loadModelCatalogue(QString const &filepath)
Method which scans the vehicle model catalogue specified by the given filepath and stores the vehicle...
Definition: VehicleProfilesPresenter.cpp:311
VehicleProfilesPresenter::updateVehicleSelectionItems
void updateVehicleSelectionItems()
Method which updates the combo box list of available vehicle profiles to the ones currently defined i...
Definition: VehicleProfilesPresenter.cpp:432
VehicleProfilesView::setSystemProfileSelection
void setSystemProfileSelection(QList< QString > profiles)
Method which the sets the selection list of algorithm types (referred to as system profiles in the co...
Definition: VehicleProfilesView.cpp:212
VehicleProfileCommands::AddSystem
This class defines the command for undoable add-operations on the map of systems of a specific algori...
Definition: VehicleProfilesPresenter.h:527
VehicleProfilesView::addSystemProfileView
SystemProfileView * addSystemProfileView(QString const &type)
Method which creates an instance of SystemProfileView, i.e. a table for assigning systems of the give...
Definition: VehicleProfilesView.cpp:190
VehicleProfileMapInterface::setName
virtual void setName(VehicleProfileMapInterface::Item *const item, VehicleProfileMapInterface::Name const &name)=0
Method wich changes the name of the given vehicle profile to the one passed as second argument...
VehicleProfilesView::setSystemConfigError
void setSystemConfigError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for the system conf...
Definition: VehicleProfilesView.cpp:227
VehicleProfilesView::removeSystemProfile
void removeSystemProfile(QString const &type)
Signal, emitted after the remove-button of an algorithm type has been clicked. Transmits the algorith...
VehicleProfilesPresenter::addSystemProfile
void addSystemProfile(QString const &type)
Slot, triggered by the VehicleProfilesView::addSystemProfile signal. Undoably adds a map for systems ...
Definition: VehicleProfilesPresenter.cpp:202
VehicleProfilesView::setModelCatalogue
void setModelCatalogue(QString const &filepath)
Method which sets the currently displayed vehicle model catalogue to the one passed as an argument...
Definition: VehicleProfilesView.cpp:185
VehicleProfileCommands
Definition: VehicleProfilesPresenter.h:271
VehicleProfileItemInterface::Name
QString Name
typedef for the name of the vehicle profile
Definition: VehicleProfileItemInterface.h:76
VehicleProfileItemInterface::ModelCatalogue
QString ModelCatalogue
typedef for the vehicle model catalogue
Definition: VehicleProfileItemInterface.h:80
VehicleProfilesPresenter::systemProfilePresenters
QMap< VehicleProfileItemInterface::Name, QMap< QString, SystemProfilePresenter * > * > systemProfilePresenters
a container for each vehicle profile that stores all table presenter objects for systems of a certain...
Definition: VehicleProfilesPresenter.h:265
VehicleProfileItemInterface::SystemConfig
QString SystemConfig
typedef for the system config XML file
Definition: VehicleProfileItemInterface.h:82
VehicleProfileMapInterface::contains
virtual bool contains(VehicleProfileMapInterface::Name const &name) const =0
Method wich checks whether the map contains a vehicle profile with the given name.
SystemProfilePresenter.h
This class constitutes the re-implementation of QAbstractTableModel for the table view of systems wit...
VehicleProfilesPresenter::modelList
QList< QString > modelList
the list of all models in the current vehicle model catalogue
Definition: VehicleProfilesPresenter.h:267
VehicleProfilesPresenter::setSystemConfig
void setSystemConfig()
Slot triggered by the VehicleProfilesView::changeSystemConfig signal. Opens a file dialog for the use...
Definition: VehicleProfilesPresenter.cpp:113
VehicleProfileItemInterface
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the...
Definition: VehicleProfileItemInterface.h:71
VehicleProfileCommands::SetModelCatalogue
This class defines the command for undoable set-operations on the vehicle model catalogue of the curr...
Definition: VehicleProfilesPresenter.h:383
VehicleProfileItemInterface::Probability
double Probability
typedef for a probability
Definition: VehicleProfileItemInterface.h:77
SystemProfilePresenter::setSystems
void setSystems(VehicleProfileItemInterface::Systems *const _systems)
Method which sets the currently processed systems map to the given argument.
Definition: SystemProfilePresenter.cpp:136
VehicleProfileItemInterface::Model
QString Model
typedef for the vehicle model
Definition: VehicleProfileItemInterface.h:79
SystemInterface.h
The System Interface (SI) contains the functions creating systems and creating a tree listing the com...
VehicleProfilesPresenter::systemInterface
SystemInterface *const systemInterface
a pointer to the system interface of the System editor. Serves as a container into which the system c...
Definition: VehicleProfilesPresenter.h:260
VehicleProfilesPresenter::setCurrentVehicleProfile
void setCurrentVehicleProfile(QString const &name)
Slot triggered by the VehicleProfilesView::selectedVehicleProfile signal. Performs an undoable set-op...
Definition: VehicleProfilesPresenter.cpp:74
VehicleProfilesPresenter::updateSystemList
void updateSystemList()
Method which updates the list of all available systems in the currently selected system config...
Definition: VehicleProfilesPresenter.cpp:168
VehicleProfilesView::setModelCatalogueError
void setModelCatalogueError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for editing the veh...
Definition: VehicleProfilesView.cpp:232
VehicleProfilesView::modifiedName
void modifiedName(QString const &oldName, QString const &newName)
Signal, emitted after the rename-button has been pressed and a new name for the current profile has b...
VehicleProfilesView::changeSystemConfig
void changeSystemConfig()
Signal, emitted after the browse-button of the system config file has been pressed.
VehicleProfilesPresenter::vehicleProfiles
VehicleProfileMapInterface *const vehicleProfiles
the pointer to the map of vehicle profiles
Definition: VehicleProfilesPresenter.h:258
SystemProfilePresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of systems wit...
Definition: SystemProfilePresenter.h:35
VehicleProfileMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all vehicle profile names in the map.
ProjectInterface
This class defines the items constituing the project configuration:
Definition: ProjectInterface.h:46
VehicleProfileItemInterface::setModelCatalogue
virtual void setModelCatalogue(ModelCatalogue const &_modelCatalogue)=0
Method which sets the current vehicle model catalogue to the one passed as an argument.
VehicleProfileMapInterface::Name
VehicleProfileItemInterface::Name Name
typedef for vehicle profile names (= key identifiers of the map)
Definition: VehicleProfileMapInterface.h:44
VehicleProfileCommands::RemoveSystem
This class defines the command for undoable remove-operations on the map of systems of a specific alg...
Definition: VehicleProfilesPresenter.h:550
VehicleProfileCommands::EditVehicleProfile
This class defines the command for undoable renaming-operations on the map of vehicle profiles (Vehic...
Definition: VehicleProfilesPresenter.h:357
VehicleProfilesPresenter::editVehicleProfileName
void editVehicleProfileName(QString const &oldName, QString const &newName)
Slot triggered by the VehicleProfilesView::modifiedName signal. Performs an undoable rename-operation...
Definition: VehicleProfilesPresenter.cpp:104
VehicleProfilesPresenter::setModel
void setModel(QString const &modelName)
Slot triggered by the VehicleProfilesView::modifiedModel signal. Performs an undoable assignment of t...
Definition: VehicleProfilesPresenter.cpp:344
VehicleProfilesView::setSystemConfig
void setSystemConfig(QString const &systemConfig)
Method which sets the currently displayed system config file to the one passed as an argument...
Definition: VehicleProfilesView.cpp:175
SystemProfilePresenter::removeRow
virtual bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: SystemProfilePresenter.cpp:117
VehicleProfilesView::clearSystemProfileViews
void clearSystemProfileViews()
Method which deletes all instances of SystemProfileView, i.e. the table for assigning systems to prob...
Definition: VehicleProfilesView.cpp:218
VehicleProfilesView::selectedVehicleProfile
void selectedVehicleProfile(QString const &name)
Signal, emitted after the current entry of the combo box for available vehicle profiles has been chan...
VehicleProfilesPresenter::currentVehicleProfile
VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
Definition: VehicleProfilesPresenter.h:257
VehicleProfilesView::addVehicleProfileSelectionItem
void addVehicleProfileSelectionItem(QString const &name)
Method which adds the given vehicle profile name to the selection list in the combo box for vehicle p...
Definition: VehicleProfilesView.cpp:99
SystemComponentItemInterface
This class defines the items constituing the ccomponent registered in a system:
Definition: SystemComponentItemInterface.h:35
VehicleProfilesPresenter::systemsConsistent
bool systemsConsistent()
Method which checks whether all assigned systems are consistent with the currently selected system co...
Definition: VehicleProfilesPresenter.cpp:414
SystemComponentItemInterface::getTitle
virtual SystemComponentItemInterface::Title getTitle() const =0
Gets the title of the current registered component.
VehicleProfilesPresenter::vehicleProfilesView
VehicleProfilesView *const vehicleProfilesView
the pointer to the view displaying the currently edited profile
Definition: VehicleProfilesPresenter.h:259
VehicleProfilesView::setModel
void setModel(QString const &model)
Method which the sets the vehicle model currently displayed by the vehicle models&#39; combo box to the o...
Definition: VehicleProfilesView.cpp:180
VehicleProfileCommands::SetCurrentVehicle
This class defines the command for undoable set-operations on the currently selected vehicle profile...
Definition: VehicleProfilesPresenter.h:277
VehicleProfilesView::addSystemProfile
void addSystemProfile(QString const &type)
Signal, emitted after the add-button of an algorithm type has been clicked. Transmits the algorithm t...
SystemProfilePresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: SystemProfilePresenter.cpp:32
VehicleProfilesPresenter::setModelCatalogue
void setModelCatalogue()
Slot triggered by the VehicleProfilesView::changeModelCatalogue signal. Opens a file dialog for the u...
Definition: VehicleProfilesPresenter.cpp:257
VehicleProfilesPresenter::default_probability
static double default_probability
a default probability
Definition: VehicleProfilesPresenter.h:268
VehicleProfileCommands::RemoveVehicleProfile
This class defines the command for undoable remove-operations on the map of vehicle profiles (Vehicle...
Definition: VehicleProfilesPresenter.h:329
VehicleProfileItemInterface::getModelCatalogue
virtual ModelCatalogue getModelCatalogue() const =0
Method which returns the current vehicle model catalogue.
VehicleProfilesPresenter::refreshSystemConfig
void refreshSystemConfig()
Slot triggered by the VehicleProfilesView::refreshSystemConfig and ProjectInterface::update signals...
Definition: VehicleProfilesPresenter.cpp:128
VehicleProfileItemInterface::getSystemProfiles
virtual SystemProfiles * getSystemProfiles() const =0
Method which returns all mappings of systems to probabilities sorted by their algorithm type...
VehicleProfileItemInterface::setModel
virtual void setModel(Model const &_model)=0
Method which sets the current vehicle model to the one passed as an argument.
VehicleProfilesView::setCurrentVehicle
void setCurrentVehicle(QString const &name)
Method which sets the vehicle profile name to be currently shown in the combo box for vehicle profile...
Definition: VehicleProfilesView.cpp:93
VehicleProfilesView::changeModelCatalogue
void changeModelCatalogue()
Signal, emitted after the browse-button of the vehicle model catalogue has been pressed.
VehicleProfilesPresenter::updateSystemsView
void updateSystemsView()
Method which completely re-builds the view of all system tables which are included into the currently...
Definition: VehicleProfilesPresenter.cpp:386
VehicleProfileMapInterface::getItem
virtual VehicleProfileMapInterface::Item * getItem(VehicleProfileMapInterface::Name const &name) const =0
Method which returns a pointer to the vehicle profile with the given name. If the map does not contai...
VehicleProfileMapInterface::add
virtual bool add(VehicleProfileMapInterface::Name const &name)=0
Method which creates a new vehicle profile (instance of VehicleProfileItemInterface) and adds it to t...
SystemInterface::load
virtual bool load(QString const &filepath)=0
Loads a system from a file located in the given path filepath. (e.g. function called when users press...
SystemInterface
This class manages creating new systems and also creating the tree of components loaded from a librar...
Definition: SystemInterface.h:27
SystemProfileView::addSystem
void addSystem(QString AlgoType, QString const &selectionItem)
Signal, emitted when the add-button for systems has been clicked. Transmits the algorithm type and th...
VehicleProfileItemInterface::getSystems
virtual Systems * getSystems(AlgoType const &_type) const =0
Method which returns the mapping of all systems of the given algorithm type to their equipment probab...
VehicleProfilesView::removeVehicleProfileSelectionItem
void removeVehicleProfileSelectionItem(QString const &name)
Method which removes the given vehicle profile name from the selection list in the combo box for vehi...
Definition: VehicleProfilesView.cpp:106
SystemInterface::getSystems
virtual SystemMapInterface * getSystems() const =0
Creates a map (container) to register systems.
VehicleProfilesView::enableModelView
void enableModelView(bool enable)
Method which enables or disables the combo box for vehicle models. Disabling the menu usually happens...
Definition: VehicleProfilesView.cpp:154
SystemProfilePresenter::update
void update()
Method which updates the table according to the current entries of systems.
Definition: SystemProfilePresenter.cpp:144
VehicleProfileCommands::SetSystemConfig
This class defines the command for undoable set-operations on the system config of the currently edit...
Definition: VehicleProfilesPresenter.h:436
VehicleProfilesPresenter::refreshModelCatalogue
void refreshModelCatalogue()
Slot triggered by the VehicleProfilesView::refreshModelCatalogue and ProjectInterface::update signals...
Definition: VehicleProfilesPresenter.cpp:281
VehicleProfilesView::setModelSelectionItems
void setModelSelectionItems(QStringList const &models)
Method which the sets the vehicle models&#39; selection list (combo box) to the one passed as an argument...
Definition: VehicleProfilesView.cpp:148
SystemProfileView::getSystemView
QTableView * getSystemView() const
Method which provides access to the table view for systems.
Definition: SystemProfileView.cpp:38
VehicleProfileItemInterface::getModel
virtual Model getModel() const =0
Method which returns the currently selected vehicle model.
VehicleProfileCommands::RemoveSystemProfile
This class defines the command for undoably removing the map for systems of a specific algorithm type...
Definition: VehicleProfilesPresenter.h:496
VehicleProfileItemInterface::Systems
QMap< System, Probability > Systems
typedef for the map assigning probabilities to systems
Definition: VehicleProfileItemInterface.h:88
VehicleProfilesView
This class defines the view for editing vehicle profiles. The view constitutes a combo box for select...
Definition: VehicleProfilesView.h:56
VehicleProfilesView::setSystemProfilesError
void setSystemProfilesError(QString const &message)
Method which displays the given error message (red color) above the tables in which systems of a cert...
Definition: VehicleProfilesView.cpp:237
VehicleProfilesView::enableConfiguration
void enableConfiguration(bool enable)
Method which enables or disables the GUI elements of this view, apart from the add-button for adding ...
Definition: VehicleProfilesView.cpp:159
VehicleProfilesPresenter::systemList
QMap< QString, QList< QString > > systemList
the list of all systems in the current system config sorted by the algorithm type ...
Definition: VehicleProfilesPresenter.h:266
VehicleProfileItemModel
This class implements the functionality of VehicleProfileItemInterface.
Definition: VehicleProfileItemModel.h:25
ProjectInterface::update
void update()
Triggers signal to inform that an item from the project configuration has been modified.
VehicleProfileCommands::AddVehicleProfile
This class defines the command for undoable add-operations on the map of vehicle profiles (VehiclePro...
Definition: VehicleProfilesPresenter.h:302
VehicleProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of the vehicle profile.
SystemProfileView
This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm ...
Definition: SystemProfileView.h:40
VehicleProfilesPresenter.h
This file contains the class VehicleProfilesPresenter defining the presenter object for vehicle profi...
VehicleProfileCommands::SetModel
This class defines the command for undoable set-operations on the vehicle model of the currently edit...
Definition: VehicleProfilesPresenter.h:410
VehicleProfilesView::modifiedModel
void modifiedModel(QString const &ModelName)
Signal, emitted after the current entry in the vehicle models&#39; combo box has been changed by the user...
SystemProfilePresenter::addRow
virtual void addRow(int const &row, VehicleProfileItemInterface::System system, VehicleProfileItemInterface::Probability probability)
Method that adds a new row, i.e. a system with the given probability.
Definition: SystemProfilePresenter.cpp:99
VehicleProfilesPresenter::addSystem
void addSystem(QString const &type, QString const &selectionItem)
Slot, triggered by the SystemProfileView::addSystem signal. Undoably adds the given system selection ...
Definition: VehicleProfilesPresenter.cpp:227
SystemProfileView::setSelectionItems
void setSelectionItems(const QList< QString > &items)
Method which clears the selection list for the systems&#39; combo box and inserts the given list...
Definition: SystemProfileView.cpp:53
VehicleProfilesPresenter::updateView
void updateView()
Method which completely re-builds the view according to the model data of the currently selected vehi...
Definition: VehicleProfilesPresenter.cpp:351
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
VehicleProfileItemInterface::setSystemConfig
virtual void setSystemConfig(SystemConfig const &_systemConfig)=0
Method which sets the current system config XML file to the one passed as an argument.
VehicleProfilesView::setVehicleProfileSelectionItems
void setVehicleProfileSelectionItems(QStringList const &names)
Method which clears the selection list for vehicle profiles (combo box) and inserts the given list...
Definition: VehicleProfilesView.cpp:112
VehicleProfilesPresenter::project
ProjectInterface *const project
a pointer to the project interface for accessing the config file structure
Definition: VehicleProfilesPresenter.h:261
VehicleProfilesPresenter::addVehicleProfile
void addVehicleProfile(QString const &name)
Slot triggered by the VehicleProfilesView::addVehicleProfile signal. Performs an undoable add-operati...
Definition: VehicleProfilesPresenter.cpp:81
VehicleProfilesPresenter::removeSystem
void removeSystem(QString const &type, int const &row)
Slot, triggered by the SystemProfileView::removeSystem signal. Undoably removes the specified row fro...
Definition: VehicleProfilesPresenter.cpp:249
VehicleProfileCommands::AddSystemProfile
This class defines the command for undoably creating a new map for systems of a specific algorithm ty...
Definition: VehicleProfilesPresenter.h:464
VehicleProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: VehicleProfilesPresenter.h:262
VehicleProfilesView::removeVehicleProfile
void removeVehicleProfile(QString const &name)
Signal, emitted after the remove-button for vehicle profiles has been clicked. Transmits the name of ...
VehicleProfilesView::addVehicleProfile
void addVehicleProfile(QString const &name)
Signal, emitted after the add-button for vehicle profiles has been clicked and a name for a new profi...
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfilesView.cpp Source File

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
VehicleProfilesView.cpp
1 /******************************************************************************
2 * Copyright (c) 2019 Volkswagen Group of America.
3 *
4 * This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License 2.0
6 * which is available at https://www.eclipse.org/legal/epl-2.0/
7 *
8 * SPDX-License-Identifier: EPL-2.0
9 ******************************************************************************/
10
11 #include "VehicleProfilesView.h"
12 #include "ui_VehicleProfilesView.h"
13
14 #include <QInputDialog>
15 #include <QFileDialog>
16 #include <QMessageBox>
17
18 VehicleProfilesView::VehicleProfilesView(QWidget *parent) :
19 WidgetView(parent),
20 ui(new Ui::VehicleProfilesView)
21 {
22 QFont font;
23
24 ui->setupUi(this);
25 enableConfiguration(false);
26
27 font.setBold(true);
28 ui->systemConfigError->setFont(font);
29 ui->modelCatalogueError->setFont(font);
30 ui->systemProfilesError->setFont(font);
31 }
32
33 VehicleProfilesView::~VehicleProfilesView()
34 {
35 delete ui;
36 }
37
38 void VehicleProfilesView::on_add_clicked()
39 {
40 QString newName = QInputDialog::getText (
41 this, tr ("Add Entry"),
42 tr ("Insert a Name"),
43 QLineEdit::Normal);
44
45 if(!newName.isEmpty())
46 {
47 Q_EMIT addVehicleProfile(newName);
48 }
49 }
50
51 void VehicleProfilesView::on_remove_clicked()
52 {
53 QMessageBox warning;
54 int ret;
55
56 // spell out a warning that everything will be deleted
57 warning.setText("The whole configuration of the vehicle profile will be deleted!");
58 warning.setInformativeText("Do you want to continue?");
59 warning.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
60 ret=warning.exec();
61
62 if(ret==QMessageBox::Yes)
63 {
64 Q_EMIT removeVehicleProfile(ui->Name->currentText());
65 }
66 }
67
68 void VehicleProfilesView::on_edit_clicked()
69 {
70 QString newName = QInputDialog::getText (
71 this, tr ("Edit Entry"),
72 tr ("Insert a new Name"),
73 QLineEdit::Normal);
74
75 if(!newName.isEmpty() )
76 {
77 Q_EMIT modifiedName(ui->Name->currentText(), newName);
78 ui->Name->setCurrentText(newName);
79 }
80
81 }
82
83 void VehicleProfilesView::on_systemConfigBrowse_clicked()
84 {
85 Q_EMIT changeSystemConfig();
86 }
87
88 void VehicleProfilesView::on_systemConfigRefresh_clicked()
89 {
90 Q_EMIT refreshSystemConfig();
91 }
92
93 void VehicleProfilesView::setCurrentVehicle(const QString &name)
94 {
95 if(ui->Name->findText(name) != -1)
96 ui->Name->setCurrentText(name);
97 }
98
99 void VehicleProfilesView::addVehicleProfileSelectionItem(QString const &name)
100 {
101 ui->Name->addItem(name);
102
103 enableConfiguration(true);
104 }
105
106 void VehicleProfilesView::removeVehicleProfileSelectionItem(QString const &name)
107 {
108 int index = ui->Name->findText(name);
109 ui->Name->removeItem(index);
110 }
111
112 void VehicleProfilesView::setVehicleProfileSelectionItems(const QStringList &names)
113 {
114 ui->Name->clear();
115 ui->Name->addItems(names);
116 }
117
118 void VehicleProfilesView::on_removeSystemProfile_clicked()
119 {
120 Q_EMIT removeSystemProfile(ui->SystemProfiles->currentText());
121 }
122
123 void VehicleProfilesView::on_addSystemProfile_clicked()
124 {
125 Q_EMIT addSystemProfile(ui->SystemProfiles->currentText());
126 }
127
128 void VehicleProfilesView::on_Name_activated(const QString &name)
129 {
130 Q_EMIT selectedVehicleProfile(name);
131 }
132
133 void VehicleProfilesView::on_modelCatalogue_Browse_clicked()
134 {
135 Q_EMIT changeModelCatalogue();
136 }
137
138 void VehicleProfilesView::on_modelCatalogue_Refresh_clicked()
139 {
140 Q_EMIT refreshModelCatalogue();
141 }
142
143 void VehicleProfilesView::on_Model_activated(const QString &model)
144 {
145 Q_EMIT modifiedModel(model);
146 }
147
148 void VehicleProfilesView::setModelSelectionItems(const QStringList &models)
149 {
150 ui->Model->clear();
151 ui->Model->addItems(models);
152 }
153
154 void VehicleProfilesView::enableModelView(bool enable)
155 {
156 ui->Model->setEnabled(enable);
157 }
158
159 void VehicleProfilesView::enableConfiguration(bool enable)
160 {
161 ui->remove->setEnabled(enable);
162 ui->edit->setEnabled(enable);
163 ui->systemConfigBrowse->setEnabled(enable);
164 ui->systemConfigRefresh->setEnabled(enable);
165 ui->systemConfig->setEnabled(enable);
166 ui->modelCatalogue->setEnabled(enable);
167 ui->modelCatalogue_Browse->setEnabled(enable);
168 ui->modelCatalogue_Refresh->setEnabled(enable);
169 ui->Model->setEnabled(enable);
170 ui->SystemProfiles->setEnabled(enable);
171 ui->addSystemProfile->setEnabled(enable);
172 ui->removeSystemProfile->setEnabled(enable);
173 }
174
175 void VehicleProfilesView::setSystemConfig(const QString &systemConfig)
176 {
177 ui->systemConfig->setText(systemConfig);
178 }
179
180 void VehicleProfilesView::setModel(const QString &model)
181 {
182 ui->Model->setCurrentText(model);
183 }
184
185 void VehicleProfilesView::setModelCatalogue(const QString &filepath)
186 {
187 ui->modelCatalogue->setText(filepath);
188 }
189
190 SystemProfileView * VehicleProfilesView::addSystemProfileView(const QString &type)
191 {
192 int rows = ui->vehicleProfilesLayout->rowCount();
193 int columns = ui->vehicleProfilesLayout->columnCount();
194 SystemProfileView * systemProfileView = new SystemProfileView(type, this);
195
196 ui->vehicleProfilesLayout->addWidget(systemProfileView, rows, 0, 1, columns );
197
198 return systemProfileView;
199 }
200
201 void VehicleProfilesView::removeSystemProfileView(const QString &type)
202 {
203 SystemProfileView * systemProfileView = findChild<SystemProfileView*>(type);
204
205 if(!type.isEmpty() && systemProfileView)
206 {
207 ui->vehicleProfilesLayout->removeWidget(systemProfileView);
208 delete systemProfileView;
209 }
210 }
211
212 void VehicleProfilesView::setSystemProfileSelection(QList<QString> profiles)
213 {
214 ui->SystemProfiles->clear();
215 ui->SystemProfiles->addItems(profiles);
216 }
217
218 void VehicleProfilesView::clearSystemProfileViews()
219 {
220 for(auto view : findChildren<SystemProfileView*>())
221 {
222 ui->vehicleProfilesLayout->removeWidget(view);
223 delete view;
224 }
225 }
226
227 void VehicleProfilesView::setSystemConfigError(QString const &message)
228 {
229 ui->systemConfigError->setText(message);
230 }
231
232 void VehicleProfilesView::setModelCatalogueError(QString const &message)
233 {
234 ui->modelCatalogueError->setText(message);
235 }
236
237 void VehicleProfilesView::setSystemProfilesError(QString const &message)
238 {
239 ui->systemProfilesError->setText(message);
240 }
VehicleProfilesView::on_systemConfigRefresh_clicked
void on_systemConfigRefresh_clicked()
Slot triggered when the user clicks the refresh-button for the system config file. Emits the refreshSystemConfig signal.
Definition: VehicleProfilesView.cpp:88
VehicleProfilesView::on_edit_clicked
void on_edit_clicked()
Slot triggered when the user clicks the rename-button for vehicle profiles. Opens a dialog box asking...
Definition: VehicleProfilesView.cpp:68
VehicleProfilesView::setSystemProfileSelection
void setSystemProfileSelection(QList< QString > profiles)
Method which the sets the selection list of algorithm types (referred to as system profiles in the co...
Definition: VehicleProfilesView.cpp:212
VehicleProfilesView::addSystemProfileView
SystemProfileView * addSystemProfileView(QString const &type)
Method which creates an instance of SystemProfileView, i.e. a table for assigning systems of the give...
Definition: VehicleProfilesView.cpp:190
VehicleProfilesView::setSystemConfigError
void setSystemConfigError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for the system conf...
Definition: VehicleProfilesView.cpp:227
VehicleProfilesView::setModelCatalogue
void setModelCatalogue(QString const &filepath)
Method which sets the currently displayed vehicle model catalogue to the one passed as an argument...
Definition: VehicleProfilesView.cpp:185
Ui
Definition: EnvironmentDisplayView.h:29
WidgetView
A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable ...
Definition: OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h:29
VehicleProfilesView::on_addSystemProfile_clicked
void on_addSystemProfile_clicked()
Slot triggered when the user clicks the add-button next to the algorithm type combo box...
Definition: VehicleProfilesView.cpp:123
VehicleProfilesView::on_systemConfigBrowse_clicked
void on_systemConfigBrowse_clicked()
Slot triggered when the user clicks the browse-button for the system config file. Emits the changeSys...
Definition: VehicleProfilesView.cpp:83
VehicleProfilesView::on_add_clicked
void on_add_clicked()
Slot triggered when the user clicks the add-button for vehicle profiles and has typed in a valid name...
Definition: VehicleProfilesView.cpp:38
VehicleProfilesView::setModelCatalogueError
void setModelCatalogueError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for editing the veh...
Definition: VehicleProfilesView.cpp:232
VehicleProfilesView::on_Name_activated
void on_Name_activated(const QString &name)
Slot triggered when the user changes the vehicle profile displayed by the corresponding combo box...
Definition: VehicleProfilesView.cpp:128
VehicleProfilesView::setSystemConfig
void setSystemConfig(QString const &systemConfig)
Method which sets the currently displayed system config file to the one passed as an argument...
Definition: VehicleProfilesView.cpp:175
VehicleProfilesView::clearSystemProfileViews
void clearSystemProfileViews()
Method which deletes all instances of SystemProfileView, i.e. the table for assigning systems to prob...
Definition: VehicleProfilesView.cpp:218
VehicleProfilesView::addVehicleProfileSelectionItem
void addVehicleProfileSelectionItem(QString const &name)
Method which adds the given vehicle profile name to the selection list in the combo box for vehicle p...
Definition: VehicleProfilesView.cpp:99
VehicleProfilesView::on_modelCatalogue_Browse_clicked
void on_modelCatalogue_Browse_clicked()
Slot triggered when the user clicks the browse-button for the vehicle model catalogue. Emits the changeModelCatalogue signal.
Definition: VehicleProfilesView.cpp:133
VehicleProfilesView::setModel
void setModel(QString const &model)
Method which the sets the vehicle model currently displayed by the vehicle models&#39; combo box to the o...
Definition: VehicleProfilesView.cpp:180
VehicleProfilesView::on_Model_activated
void on_Model_activated(const QString &model)
Slot triggered when the user changes the current entry of the vehicle model&#39;s combo box...
Definition: VehicleProfilesView.cpp:143
VehicleProfilesView::on_remove_clicked
void on_remove_clicked()
Slot triggered when the user clicks the remove-button for vehicle profiles. Emits the removeVehiclePr...
Definition: VehicleProfilesView.cpp:51
VehicleProfilesView::setCurrentVehicle
void setCurrentVehicle(QString const &name)
Method which sets the vehicle profile name to be currently shown in the combo box for vehicle profile...
Definition: VehicleProfilesView.cpp:93
VehicleProfilesView.h
This class defines the view for editing vehicle profiles. The view constitutes a combo box for select...
VehicleProfilesView::removeVehicleProfileSelectionItem
void removeVehicleProfileSelectionItem(QString const &name)
Method which removes the given vehicle profile name from the selection list in the combo box for vehi...
Definition: VehicleProfilesView.cpp:106
VehicleProfilesView::enableModelView
void enableModelView(bool enable)
Method which enables or disables the combo box for vehicle models. Disabling the menu usually happens...
Definition: VehicleProfilesView.cpp:154
VehicleProfilesView::setModelSelectionItems
void setModelSelectionItems(QStringList const &models)
Method which the sets the vehicle models&#39; selection list (combo box) to the one passed as an argument...
Definition: VehicleProfilesView.cpp:148
VehicleProfilesView
This class defines the view for editing vehicle profiles. The view constitutes a combo box for select...
Definition: VehicleProfilesView.h:56
VehicleProfilesView::setSystemProfilesError
void setSystemProfilesError(QString const &message)
Method which displays the given error message (red color) above the tables in which systems of a cert...
Definition: VehicleProfilesView.cpp:237
VehicleProfilesView::enableConfiguration
void enableConfiguration(bool enable)
Method which enables or disables the GUI elements of this view, apart from the add-button for adding ...
Definition: VehicleProfilesView.cpp:159
VehicleProfilesView::on_removeSystemProfile_clicked
void on_removeSystemProfile_clicked()
Slot triggered when the user clicks the remove-button next to the algorithm type combo box...
Definition: VehicleProfilesView.cpp:118
SystemProfileView
This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm ...
Definition: SystemProfileView.h:40
VehicleProfilesView::on_modelCatalogue_Refresh_clicked
void on_modelCatalogue_Refresh_clicked()
Slot triggered when the user clicks the refresh-button for the vehicle model catalogue. Emits the refreshModelCatalogue signal.
Definition: VehicleProfilesView.cpp:138
VehicleProfilesView::setVehicleProfileSelectionItems
void setVehicleProfileSelectionItems(QStringList const &names)
Method which clears the selection list for vehicle profiles (combo box) and inserts the given list...
Definition: VehicleProfilesView.cpp:112
VehicleProfilesView::removeSystemProfileView
void removeSystemProfileView(QString const &type)
Method which deletes the instance of SystemProfileView, i.e. the table for assigning systems of the g...
Definition: VehicleProfilesView.cpp:201
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class List

Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
[detail level 12]
▶N AgentProfileCommands |
C AddAgentProfile | This class defines the command for undoable add-operations on the map of agent profiles (AgentMapInterface)
C AddDriverProfile | This class defines the command for undoable add-operations on the driver profiles table of the currently edited agent profile (for dynamic agent profiles only)
C AddVehicleProfile | This class defines the command for undoable add-operations on the vehicle profiles table of the currently edited agent profile (for dynamic agent profiles only)
C EditAgentModel | This class defines the command for undoable set-operations on the vehicle model of the currently edited agent profile (for static profiles only)
C EditAgentModelCatalogue | This class defines the command for undoable set-operations on the vehicle model catalogue of the currently edited agent profile (for static profiles only)
C EditAgentProfile | This class defines the command for undoable renaming-operations on the map of agent profiles (AgentMapInterface)
C EditAgentSystem | This class defines the command for undoable set-operations on the system of the currently edited agent profile (for static profiles only)
C EditAgentSystemConfig | This class defines the command for undoable set-operations on the system config file of the currently edited agent profile (for static profiles only)
C EditAgentType | This class defines the command for undoable set-operations on the type (static or dynamic) of an agent profile
C RemoveAgentProfile | This class defines the command for undoable remove-operations on the map of agent profiles (AgentMapInterface)
C RemoveDriverProfile | This class defines the command for undoable remove-operations on the driver profiles table of the currently edited agent profile (for dynamic agent profiles only)
C RemoveVehicleProfile | This class defines the command for undoable remove-operations on the vehicle profiles table of the currently edited agent profile (for dynamic agent profiles only)
C SetCurrentAgent | This class defines the command for undoable set-operations on the currently selected agent profile
▶N DriverProfileCommands |
C AddDriverProfile | This class defines the command for undoable add-operations on the map of driver profiles (DriverProfileMapInterface)
C EditDriverProfile | This class defines the command for undoable renaming-operations on the map of driver profiles (DriverProfileMapInterface)
C RemoveDriverProfile | This class defines the command for undoable remove-operations on the map of driver profiles (DriverProfileMapInterface)
C SetCurrentDriver | This class defines the command for undoable set-operations on the currently selected driver profile
▶N VehicleProfileCommands |
C AddSystem | This class defines the command for undoable add-operations on the map of systems of a specific algorithm type
C AddSystemProfile | This class defines the command for undoably creating a new map for systems of a specific algorithm type to be assigned to the current vehicle profile
C AddVehicleProfile | This class defines the command for undoable add-operations on the map of vehicle profiles (VehicleProfileMapInterface)
C EditVehicleProfile | This class defines the command for undoable renaming-operations on the map of vehicle profiles (VehicleProfileMapInterface)
C RemoveSystem | This class defines the command for undoable remove-operations on the map of systems of a specific algorithm type
C RemoveSystemProfile | This class defines the command for undoably removing the map for systems of a specific algorithm type assigned to the current vehicle profile
C RemoveVehicleProfile | This class defines the command for undoable remove-operations on the map of vehicle profiles (VehicleProfileMapInterface)
C SetCurrentVehicle | This class defines the command for undoable set-operations on the currently selected vehicle profile
C SetModel | This class defines the command for undoable set-operations on the vehicle model of the currently edited vehicle profile
C SetModelCatalogue | This class defines the command for undoable set-operations on the vehicle model catalogue of the currently edited vehicle profile
C SetSystemConfig | This class defines the command for undoable set-operations on the system config of the currently edited vehicle profile
C AddEnvironmentItem | Command class for adding rows to the table of environment settings
C AddLibrary | Command class for adding libraries to the libraries table
C AddLoggingGroup | Command class for adding logging groups to the logging groups list
C AddTrafficItem | Command class for adding rows to the table of traffic settings
C AgentConfigurationCombinationPresenter | This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of this plugin to the profiles catalogue XML file needed by the simulation slave
C AgentConfigurationInterface | This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-relevant ProfilesCatalog.xml files
C AgentConfigurationModel | This class implements the functionality of AgentConfigurationInterface
C AgentConfigurationPresenter | This class defines the presenter object which handles events from the view (AgentConfigurationView) and edits the model data (AgentConfigurationInterface) accordingly
C AgentConfigurationView | This class constitutes the main view of the agent configuration plugin. It instantiates the action menu as well as a tab widget as a container widget for views of agent, driver and vehicle profiles as well as the undo stack. The main task of this view is to emit signals upon user actions on the action menu which are handled in the corresponding prestenter object (AgentConfigurationPresenter)
C AgentItemInterface | This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-relevant profiles cataloge (*.xml) under <AgentProfiles>
C AgentMapInterface | This class constitutes a container class in which agent profiles (instances of AgentItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map
C AgentMapModel | This class implements the functionality of AgentMapInterface
C AgentMapPresenter | Handles user events from the view (AgentMapView) and edits the model data (AgentMapInterface) accordingly. Since all actions performed on the model data (i.e. the *.ui file) should be undoable, the presenter instantiates the corresponding undo-commands and pushes them onto the undo stack. The actual operation on the model is then performed in these command object using the re-implementations of the undo/redo methods. See Qt's undo framework for further details
C AgentMapView | This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu for selecting a profile to be edited as well as buttons for removing and adding agent profiles. Further, a menu for editing the type ("dynamic" or "static") is provided whose selection switches between two different views. If the type "dynamic" is selected, two tables for assigning driver and vehicle profiles with probabilities appear. If type "static" is selected, the view is reduced to a selection menu for a system config + system as well as a vehicle model catalogue + model. The switching between the two modes is realized via a stacked widget whose pages contain the GUI elements being exclusive for the selected mode. Further information on how to use this view can be found in the GUI tutorial
C ComponentInputItemInterface | This class defines the items constituing an input of a component:
C ComponentInputMapInterface | This class manages the registration and deregistration of inputs of a component. It provides a map as container with unique identifiers as a keys to sort the inputs
C ComponentInterface | This class manages creating new component and also creating the map which registers created components
C ComponentItemInterface | This class defines the items constituing a component:
C ComponentMapInterface | This class manages the registration and deregistration of objects defining a component (component related-objects) using as identifier a key name
C ComponentOutputItemInterface | This class defines the items constituing an output of a component:
C ComponentOutputMapInterface | This class manages the registration and deregistration of outputs of a component. It provides a map as container with unique identifiers as a keys to sort the outputs
C ComponentParameterItemInterface | This class defines the items constituing a parameter of a component:
C ComponentParameterMapInterface | This class manages the registration and deregistration of parameters of a component. It provides a map as container with unique identifiers as a keys to sort the parameters
C ComponentScheduleInterface | This class defines the schedule parameters of a component:
C DriverProfileItemInterface | This class defines objects containing all relevant information on driver profiles
C DriverProfileItemModel | This class implements the functionality of DriverProfileItemInterface
C DriverProfileMapInterface | This class constitutes a container class in which driver profiles (instances of DriverProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map
C DriverProfileMapModel | This class implements the functionality of DriverProfileMapInterface
C DriverProfilesMapPresenter | This class constitutes the re-implementation of QAbstractTableModel for the table view of driver profiles. In fact, this class implements a wrapper for the map of driver profiles (DriverProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework
C DriverProfilesPresenter | This class defines the presenter object for driver profiles which handles user events from the view (DriverProfilesView) and edits the model data (DriverProfileMapInterface) accordingly
C DriverProfilesView | This class defines the view for editing driver profiles. The view constitutes a combo box for switching between different driver profiles, add-, remove- and rename buttons and a table view for editing the parameters of the driver profile. Further information on how to use this view can be found in the GUI tutorial
C EditEnvironmentName | Command class editing the environment's name
C EditNumberInvocations | Command class editing the number of invocations
C EditProfilesCatalogue | Command class for editing the profiles catalogue
C EditRandomSeed | Command class editing the number of invocations
C EditScenarioFile | Command class editing the OpenSCENARIO file
C EditScenarioName | Command class editing the scenario's name
C EditTrafficName | Command class for editing the traffic's name
C EnvironmentDisplayPresenter | This class defines the presenter which controls the content to be displayed in the EnvironmentDisplayView widget
C EnvironmentDisplayView | This class provides a display for a quick overview of the environment configuration
C EnvironmentInterface | Setter and getter methods for the maps of environmental parameters, listed under <EnvironmentConfig> in the slaveConfig XML file
C EnvironmentItemInterface | Methods for reading and editing environment parameters
C EnvironmentItemModel | Implements the functionality of the EnvironmentItemInterface class
C EnvironmentMapPresenter | This class describes the presenter objects of the environment parameter maps
C EnvironmentModel | The Environment Model implements the functionality of the EnvironmentInterface class
C EnvironmentPresenter | This class defines the presenter object which handles user events coming from the view (EnvironmentView) and edits the model accordingly (EnvironmentInterface)
C EnvironmentView | This class provides an editor for configuring the environment setup, i.e. it is filled with the content stored in an EnvironmentInterface instance
C ExperimentBaseView | This class provides a resizable container widget for the content of the experiment tab
C ExperimentInterface | The Experiment Interface provides setter and getter methods for the XML elements listed under <ExperimentConfig> in the slaveConfig XML file
C ExperimentModel | Implements the functionality of the ExperimentInterface class
C ExperimentPresenter | This class defines the presenter object which handles user events coming from the view (ExperimentView) and edits the model accordingly (ExperimentInterface)
C ExperimentView | This class provides an editor for configuring the experiment setup, i.e. it is filled with the content stored in an ExperimentInterface instance
C LibrariesPresenter | This class describes the presenter object of the map of included libraries
C LoggingGroupsPresenter | This class describes the presenter object of the list of logging groups
C ParameterItemInterface | This class defines parameters
C ParameterItemModel | This class implements the functionality of ParameterItemInterface
C ParameterMapInterface | This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
C ParameterMapModel | This class implements the functionality of ParameterMapInterface
C ParameterMapPresenter | This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters. In fact, this class implements a wrapper for the map of parameters (ParameterMapInterface) to be editable by QTableView objects within Qt's Model/View framework
C ProjectInterface | This class defines the items constituing the project configuration:
C RemoveEnvironmentItem | Command class for removing rows from the table of environment settings
C RemoveLibrary | Command class for removing libraries from the libraries table
C RemoveLoggingGroup | Command class for removing logging groups from the logging groups list
C RemoveTrafficItem | Command class for removing rows from the table of traffic settings
C ScenarioAgentsPresenter | This class describes the presenter object of the scenario agents map
C ScenarioBaseView | This class provides a resizable container widget for the content of the scenario tab
C ScenarioDisplayPresenter | This class defines the presenter which controls the content to be displayed in the ScenarioDisplayView widget
C ScenarioDisplayView | This class provides a display for a quick overview of the scenario configuration
C ScenarioInterface | The Scenario Interface provides setter and getter methods for the combination XML elements related to an Open Scenario File
C ScenarioModel | The Scenario Model class implements the functionality of the ScenarioItemInterface class
C ScenarioPresenter | This class defines the presenter object which handles user events coming from the view (ScenarioView) and edits the model accordingly (ScenarioInterface)
C ScenarioView | This class provides an editor for configuring the scenario setup, i.e. it is filled with the content stored in an ScenarioInterface instance
C SensorItemInterface | Combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to a sensor data object
C SensorItemModel | This class implements the functionality of SensorItemInterface
C SensorMapInterface | This class constitutes a container class in which sensor data (instances of SensorItemInterface) are registered. It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
C SensorMapModel | This class implements the functionality of SensorMapInterface
C SensorPosition | This structure gathers all variables which specify a sensor position. This includes three spatial coordinates (vehicle reference frame) as well as three angles (Euler angles) for the orientation. Additionally, a name for identifying/characterizing the sensor position is provided
C SensorProfileItemInterface | This class defines objects containing all relevant information on sensor profiles
C SensorProfileItemModel | This class implements the functionality of SensorProfileItemInterface
C SensorProfileMapInterface | This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInterface) are registered. As a key identifier the pair of sensor name and type (corrsponding to its implementation) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
C SensorProfileMapModel | This class implements the functionality of SensorProfileMapInterface
C StatusBarView | This class defines a status bar
C SystemComponentInputItemInterface | This class defines the items constituing an input of a component registered in a system
C SystemComponentItemInterface | This class defines the items constituing the ccomponent registered in a system:
C SystemComponentManagerInterface | This class enables loading components as a library from a directory and provides a search functions for these components
C SystemComponentMapInterface | This class manages the registration and deregistration of objects defining components (component related-objects) belonging to a system
C SystemComponentOutputItemInterface | This class defines the items constituing an output of a component registered in a system. These items are provided from the class defined in the Component Output Item Interface. This current class also provides access to the parent component where the output belongs to. This access allows retracing the connections by getting the output with its relative component (parent)
C SystemComponentOutputMapInterface | This class manages the registration and deregistration of outputs of a component registered in a system
C SystemComponentParameterItemInterface | This class defines the items constituing a parameter of a component registered in a system. These items are provided from the class defined in the Component Parameter Item Interface. They are not modifiable in this class except the Value through callbacks defined for the System Editor
C SystemComponentParameterMapInterface | This class manages the registration and deregistration of parameters of a component registered in a system
C SystemComponentScheduleInterface | This class defines the simulation schedule related parameters of a component registered in a system:
C SystemConnectionItemInterface | This class defines the items constituing the connection that is established between two components of a system:
C SystemConnectionMapInterface | This class manages the registration and deregistration of objects defining connections (connection related-objects) that model the data flow between the components constituing a system
C SystemInterface | This class manages creating new systems and also creating the tree of components loaded from a library and used to build systems
C SystemItemInterface | This class defines the items constituing a system:
C SystemMapInterface | This class manages the registration and deregistration of object defining a system (system related-objects) using as identifier a key id
C SystemProfilePresenter | This class constitutes the re-implementation of QAbstractTableModel for the table view of systems with a given algorithm type. The corresponding model data object is referred to as "system profile". In fact, this class implements a wrapper for these system profiles to be editable by QTableView objects within Qt's Model/View framework
C SystemProfileView | This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm type onto probabilities
C TrafficBaseView | This class provides a resizable container widget for the content of the traffic tab's scroll area
C TrafficDisplayPresenter | This class defines the presenter which controls the content to be displayed in the TrafficDisplayView widget
C TrafficDisplayView | This class provides a display for a quick overview of the traffic configuration
C TrafficInterface | The Traffic Interface provides setter and getter methods for the combination XML subelements listed under the <TrafficConfig> element
C TrafficItemInterface | The Traffic Item Interface defines a general traffic parameter which can be incorporated into the traffic configuration setup
C TrafficItemMapInterface | The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be registered under a key identifier (ID). The traffic items are defined in the TrafficItemInterface template class
C TrafficItemMapModel | Implements functionality of the TrafficItemMapInterface class
C TrafficItemMapPresenter | This class describes the presenter objects of the traffic parameter maps
C TrafficItemModel | Implements functionality of the TrafficItemInterface class
C TrafficItemView | This class defines a general view for a traffic item, which can be a volume, platoon rate, velocity, homogeneity or an agent profile
C TrafficLanesPresenter | This class defines the presenter object which handles events coming from the view (TrafficLanesView) and edits the model accordingly (TrafficInterface)
C TrafficLanesView | This class defines the editor widget for assigning agent profiles to regular and rightmost lanes
C TrafficModel | Implements the functionality of the TrafficInterface class
C TrafficParametersPresenter | This class defines the presenter object which handles events coming from the view (TrafficParametersView) and edits the model accordingly (TrafficInterface), i.e. more specifically the parameters therein
C TrafficParametersView | This class defines the editor widget for traffic parameters and their probabilities
C TrafficPresenter | This class defines the presenter object which handles user events coming from the view (TrafficView) and edits the model accordingly (TrafficInterface)
C TrafficSimulationInterface | Forms the body of a traffic simulation configuration
C TrafficSimulationModel | Implements functionality of the TrafficSimulationInterface class
C TrafficSimulationPresenter | This class defines the presenter object for the main view of the Traffic Simulation Plugin and instantiates all other presenters
C TrafficSimulationView | This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other configuration views as child widgets
C TrafficSimulationXMLBaseModel | This class defines the XML element names of the combination XML file
C TrafficSimulationXMLLoadModel | This class provides routines for loading the combination XML file and for storing all information in the corresponding instances of the model classes
C TrafficSimulationXMLSaveModel | This class provides routines for saving the slaveConfig XML file
C TrafficView | This class provides an editor for configuring the traffic setup, i.e. it is filled with the content stored in an TrafficInterface instance
C VehicleComponentItemInterface | Defines data on vehicle components which can be thought of a algorithms that will be built into a vehicle with a certain probability
C VehicleComponentItemModel | This class implements the functionality of VehicleComponentItemInterface
C VehicleComponentMapInterface | This class constitutes a container class for vehicle component data (instances of VehicleComponentItemInterface) using the vehicle component's type (i.e. the algorithm it represents) as a key identifier. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
C VehicleComponentMapModel | This class implements the functionality of VehicleComponentMapInterface
C VehicleComponentProfileItemInterface | This class defines vehicle component profiles which contain the parameterization of a vehicle component, i.e. an instance of the VehicleComponentItemInterface class
C VehicleComponentProfileItemModel | This class implements the functionality of VehicleComponentProfileItemInterface
C VehicleComponentProfileMapInterface | This class constitutes a container class for vehicle component profiles (instances of VehicleComponentProfileItemInterface). As a key identifier the pair of the profile's name and type (corrsponding to to the implementation/algorithm of the vehicle component) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
C VehicleComponentProfileMapModel | This class implements the functionality of VehicleComponentProfileMapInterface
C VehicleProfileItemInterface | This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the simulation
C VehicleProfileItemModel | This class implements the functionality of VehicleProfileItemInterface
C VehicleProfileMapInterface | This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map
C VehicleProfileMapModel | This class implements the functionality of VehicleProfileMapInterface
C VehicleProfilesMapPresenter | This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle profiles. In fact, this class implements a wrapper for the map of vehicle profiles (VehicleProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework
C VehicleProfilesPresenter | This class defines the presenter object for vehicle profiles which handles user events from the view (VehicleProfilesView) and edits the model data (VehicleProfileMapInterface) accordingly
C VehicleProfilesView | This class defines the view for editing vehicle profiles. The view constitutes a combo box for selecting and buttons for adding, removing and renaming vehicle profiles. Further, GUI elements for vehicle model catalogue and vehicle model as well as for the system config are provided. Systems defined in a system config are sorted by the algorithm type used therein. For the corresponding selection of an algorithm type, a combo box including add- and remove- buttons is set up. The dynamic instantiation of the table views for systems of a certain algorithm type (SystemProfileView) is performed in the presenter object (VehicleProfilesPresenter). This object calls public methods of this class in order to instantiate the table views and and lay them out in this widget
C WidgetView | A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable proper processing of style sheets
C WindowInterface | This class manages the registration and deregistration of Window Views which include the menu bar with its buttons and menu buttons
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AddEnvironmentItem Class Reference

List of all members
AddEnvironmentItem Class Reference

Command class for adding rows to the table of environment settings. More...

Inherits QUndoCommand.

Detailed Description

Command class for adding rows to the table of environment settings.

Definition at line 198 of file EnvironmentPresenter.h.

The documentation for this class was generated from the following files:
  • EnvironmentPresenter.h
  • EnvironmentPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AddEnvironmentItem Member List

This is the complete list of members for AddEnvironmentItem, including all inherited members.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AddLibrary Class Reference

List of all members
AddLibrary Class Reference

Command class for adding libraries to the libraries table. More...

Inherits QUndoCommand.

Detailed Description

Command class for adding libraries to the libraries table.

Definition at line 144 of file ExperimentPresenter.h.

The documentation for this class was generated from the following files:
  • ExperimentPresenter.h
  • ExperimentPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AddLibrary Member List

This is the complete list of members for AddLibrary, including all inherited members.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AddLoggingGroup Class Reference

List of all members
AddLoggingGroup Class Reference

Command class for adding logging groups to the logging groups list. More...

Inherits QUndoCommand.

Detailed Description

Command class for adding logging groups to the logging groups list.

Definition at line 185 of file ExperimentPresenter.h.

The documentation for this class was generated from the following files:
  • ExperimentPresenter.h
  • ExperimentPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AddLoggingGroup Member List

This is the complete list of members for AddLoggingGroup, including all inherited members.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AddTrafficItem Class Reference

List of all members
AddTrafficItem Class Reference

Command class for adding rows to the table of traffic settings. More...

Inherits QUndoCommand.

Detailed Description

Command class for adding rows to the table of traffic settings.

Definition at line 272 of file TrafficPresenter.h.

The documentation for this class was generated from the following files:
  • TrafficPresenter.h
  • TrafficPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AddTrafficItem Member List

This is the complete list of members for AddTrafficItem, including all inherited members.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationCombinationPresenter Class Reference

List of all members
AgentConfigurationCombinationPresenter Class Reference

This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of this plugin to the profiles catalogue XML file needed by the simulation slave. More...

Inherits QObject.

Detailed Description

This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of this plugin to the profiles catalogue XML file needed by the simulation slave.

The only reason why this class exists is because, for a dynamic agent profile, the profiles catalogue partly repeats information already contained in a system config file. In order to maintain a consistent way of defining systems using the system config, this presenter object gathers the required information from the system config and exports it into the format needed by the profiles catalogue.

Note
In future releases, the way of defining dynamic and static agent will be unified in order to avoid such a doubling of information in two different files. Hence, this class is only temporary and we refrain from giving a detailed documentation here.

Definition at line 63 of file AgentConfigurationCombinationPresenter.h.

The documentation for this class was generated from the following files:
  • AgentConfigurationCombinationPresenter.h
  • AgentConfigurationCombinationPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AgentConfigurationCombinationPresenter Member List

This is the complete list of members for AgentConfigurationCombinationPresenter, including all inherited members.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationInterface Class Reference

Public Member Functions | List of all members
AgentConfigurationInterface Class Referenceabstract

This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-relevant ProfilesCatalog.xml files. More...

Inheritance diagram for AgentConfigurationInterface:
AgentConfigurationModel

Public Member Functions

virtual AgentMapInterface * | getAgents () const =0
Method which provides access to the map of agent profiles. More...
virtual DriverProfileMapInterface * | getDriverProfiles () const =0
Method which provides access to the map of driver profiles. More...
virtual SensorProfileMapInterface * | getSensorProfiles () const =0
Method which provides access to the map of sensor profiles. More...
virtual VehicleComponentProfileMapInterface * | getVehicleComponentProfiles () const =0
Method which provides access to the map of vehicle component profiles (in fact, ADAS algorithms). More...
virtual VehicleProfileMapInterface * | getVehicleProfiles () const =0
Method which provides access to the map of vehicle profiles. More...

Detailed Description

This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-relevant ProfilesCatalog.xml files.

It provides access to the maps (container classes) of agent profiles, vehicle profiles and driver profiles. Additionally, in the ProfilesCatalog.xml vehicle component profiles (representing algorithms of ADAS) and sensor profiles occur which are also referenced by this class.

Definition at line 52 of file AgentConfigurationInterface.h.

Member Function Documentation

◆ getAgents()

virtual AgentMapInterface* AgentConfigurationInterface::getAgents ( ) const
pure virtual

Method which provides access to the map of agent profiles.

Returns
the pointer to the map of agent profiles

Implemented in AgentConfigurationModel.

◆ getDriverProfiles()

virtual DriverProfileMapInterface* AgentConfigurationInterface::getDriverProfiles ( ) const
pure virtual

Method which provides access to the map of driver profiles.

Returns
the pointer to the map of driver profiles

Implemented in AgentConfigurationModel.

◆ getSensorProfiles()

virtual SensorProfileMapInterface* AgentConfigurationInterface::getSensorProfiles ( ) const
pure virtual

Method which provides access to the map of sensor profiles.

Returns
the pointer to the map of sensor profiles

Implemented in AgentConfigurationModel.

◆ getVehicleComponentProfiles()

virtual VehicleComponentProfileMapInterface* AgentConfigurationInterface::getVehicleComponentProfiles ( ) const
pure virtual

Method which provides access to the map of vehicle component profiles (in fact, ADAS algorithms).

Returns
the pointer to the map of vehicle component profiles

Implemented in AgentConfigurationModel.

◆ getVehicleProfiles()

virtual VehicleProfileMapInterface* AgentConfigurationInterface::getVehicleProfiles ( ) const
pure virtual

Method which provides access to the map of vehicle profiles.

Returns
the pointer to the map of vehicle profiles

Implemented in AgentConfigurationModel.

The documentation for this class was generated from the following file:
  • AgentConfigurationInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AgentConfigurationInterface Member List

This is the complete list of members for AgentConfigurationInterface, including all inherited members.

getAgents() const =0 | AgentConfigurationInterface | pure virtual
getDriverProfiles() const =0 | AgentConfigurationInterface | pure virtual
getSensorProfiles() const =0 | AgentConfigurationInterface | pure virtual
getVehicleComponentProfiles() const =0 | AgentConfigurationInterface | pure virtual
getVehicleProfiles() const =0 | AgentConfigurationInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationModel Class Reference

Public Member Functions | Public Attributes | List of all members
AgentConfigurationModel Class Reference

This class implements the functionality of AgentConfigurationInterface. More...

Inheritance diagram for AgentConfigurationModel:
AgentConfigurationInterface

Public Member Functions

virtual AgentMapInterface * | getAgents () const override
Method which provides access to the map of agent profiles. More...
virtual DriverProfileMapInterface * | getDriverProfiles () const override
Method which provides access to the map of driver profiles. More...
virtual SensorProfileMapInterface * | getSensorProfiles () const override
Method which provides access to the map of sensor profiles. More...
virtual VehicleComponentProfileMapInterface * | getVehicleComponentProfiles () const override
Method which provides access to the map of vehicle component profiles (in fact, ADAS algorithms). More...
virtual VehicleProfileMapInterface * | getVehicleProfiles () const override
Method which provides access to the map of vehicle profiles. More...

Public Attributes

AgentMapModel *const | agents
the pointer to the map of agent profiles
VehicleComponentProfileMapModel *const | componentProfiles
the pointer to the map of vehicle component profiles (corresponding to algorithms of an ADAS)
DriverProfileMapModel *const | driverProfiles
the pointer to the map of driver profiles
SensorProfileMapModel *const | sensorProfiles
the pointer to the map of sensor profiles
VehicleProfileMapModel *const | vehicleProfiles
the pointer to the map of vehicle profiles

Detailed Description

This class implements the functionality of AgentConfigurationInterface.

Definition at line 30 of file AgentConfigurationModel.h.

Member Function Documentation

◆ getAgents()

AgentMapInterface * AgentConfigurationModel::getAgents ( ) const
overridevirtual

Method which provides access to the map of agent profiles.

Returns
the pointer to the map of agent profiles

Implements AgentConfigurationInterface.

Definition at line 24 of file AgentConfigurationModel.cpp.

25 {
26 return agents;
27 }
AgentConfigurationModel::agents
AgentMapModel *const agents
the pointer to the map of agent profiles
Definition: AgentConfigurationModel.h:46

◆ getDriverProfiles()

DriverProfileMapInterface * AgentConfigurationModel::getDriverProfiles ( ) const
overridevirtual

Method which provides access to the map of driver profiles.

Returns
the pointer to the map of driver profiles

Implements AgentConfigurationInterface.

Definition at line 34 of file AgentConfigurationModel.cpp.

35 {
36 return driverProfiles;
37 }
AgentConfigurationModel::driverProfiles
DriverProfileMapModel *const driverProfiles
the pointer to the map of driver profiles
Definition: AgentConfigurationModel.h:48

◆ getSensorProfiles()

SensorProfileMapInterface * AgentConfigurationModel::getSensorProfiles ( ) const
overridevirtual

Method which provides access to the map of sensor profiles.

Returns
the pointer to the map of sensor profiles

Implements AgentConfigurationInterface.

Definition at line 44 of file AgentConfigurationModel.cpp.

45 {
46 return sensorProfiles;
47 }
AgentConfigurationModel::sensorProfiles
SensorProfileMapModel *const sensorProfiles
the pointer to the map of sensor profiles
Definition: AgentConfigurationModel.h:50

◆ getVehicleComponentProfiles()

VehicleComponentProfileMapInterface * AgentConfigurationModel::getVehicleComponentProfiles ( ) const
overridevirtual

Method which provides access to the map of vehicle component profiles (in fact, ADAS algorithms).

Returns
the pointer to the map of vehicle component profiles

Implements AgentConfigurationInterface.

Definition at line 39 of file AgentConfigurationModel.cpp.

40 {
41 return componentProfiles;
42 }
AgentConfigurationModel::componentProfiles
VehicleComponentProfileMapModel *const componentProfiles
the pointer to the map of vehicle component profiles (corresponding to algorithms of an ADAS) ...
Definition: AgentConfigurationModel.h:49

◆ getVehicleProfiles()

VehicleProfileMapInterface * AgentConfigurationModel::getVehicleProfiles ( ) const
overridevirtual

Method which provides access to the map of vehicle profiles.

Returns
the pointer to the map of vehicle profiles

Implements AgentConfigurationInterface.

Definition at line 29 of file AgentConfigurationModel.cpp.

30 {
31 return vehicleProfiles;
32 }
AgentConfigurationModel::vehicleProfiles
VehicleProfileMapModel *const vehicleProfiles
the pointer to the map of vehicle profiles
Definition: AgentConfigurationModel.h:47
The documentation for this class was generated from the following files:
  • AgentConfigurationModel.h
  • AgentConfigurationModel.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AgentConfigurationModel Member List

This is the complete list of members for AgentConfigurationModel, including all inherited members.

agents | AgentConfigurationModel |
componentProfiles | AgentConfigurationModel |
driverProfiles | AgentConfigurationModel |
getAgents() const override | AgentConfigurationModel | virtual
getDriverProfiles() const override | AgentConfigurationModel | virtual
getSensorProfiles() const override | AgentConfigurationModel | virtual
getVehicleComponentProfiles() const override | AgentConfigurationModel | virtual
getVehicleProfiles() const override | AgentConfigurationModel | virtual
sensorProfiles | AgentConfigurationModel |
vehicleProfiles | AgentConfigurationModel |
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationPresenter Class Reference

Private Slots | Private Member Functions | Private Attributes | List of all members
AgentConfigurationPresenter Class Reference

This class defines the presenter object which handles events from the view (AgentConfigurationView) and edits the model data (AgentConfigurationInterface) accordingly. More...

Inherits QObject.

Private Slots

void | clear ()
Slot triggered by the AgentConfigurationView::ClearSetup signal. Clears the whole model data (using the clear-methods of this class) and also empties the views accordingly.
void | load ()
Slot triggered by the AgentConfigurationView::LoadSetup signal. Loads the *.ui file selected by the user. First, clears the whole model (clear-methods of this class) and, then, copies the data to the model (copy-methods of this class). The views are also updated accordingly.
void | save ()
Slot triggered by the AgentConfigurationView::SaveSetup signal. Opens the filedialog to let the user select a file and calls AgentConfigurationXMLSaveModel::save in order to save the Profiles Catalogue's *.ui file.

Private Member Functions

void | clearAgentProfiles ()
Method which performs an undoable clear operation on all agent profiles currently created.
void | clearDriverProfiles ()
Method which performs an undoable clear operation on all driver profiles currently created.
void | clearVehicleProfiles ()
Method which performs an undoable clear operation on all vehicle profiles currently created.
void | copyAgentProfiles (AgentConfigurationInterface const *const from)
Method which performs an undoable copy of the agent profiles from the given instance of AgentConfigurationInterface. The copied profiles are appended and the views are updated accordingly. More...
void | copyDriverProfiles (AgentConfigurationInterface const *const from)
Method which performs an undoable copy of the driver profiles from the given instance of AgentConfigurationInterface. The copied profiles are appended and the views are updated accordingly. More...
void | copyVehicleProfiles (AgentConfigurationInterface const *const from)
Method which performs an undoable copy of the vehicle profiles from the given instance of AgentConfigurationInterface. The copied profiles are appended and the views are updated accordingly. More...

Private Attributes

AgentConfigurationInterface *const | agentConfiguration
pointer to the overall model interface of this plugin
AgentConfigurationView *const | agentConfigurationView
pointer to the overall view of this plugin
AgentMapPresenter *const | agentsPresenter
pointer to the presenter object of agent profiles
DriverProfilesPresenter *const | driverProfilesPresenter
pointer to the presenter object of driver profiles
ProjectInterface *const | project
pointer to the project interface for accessing the file structure of openPASS
QShortcut *const | redo
shortcut for performing a redo action
QShortcut *const | undo
shortcut for performing an undo action
QUndoStack *const | undoStack
pointer to the undo stack
VehicleProfilesPresenter *const | vehicleProfilesPresenter
pointer to the presenter object of vehicle profiles

Detailed Description

This class defines the presenter object which handles events from the view (AgentConfigurationView) and edits the model data (AgentConfigurationInterface) accordingly.

Definition at line 41 of file AgentConfigurationPresenter.h.

Member Function Documentation

◆ copyAgentProfiles()

void AgentConfigurationPresenter::copyAgentProfiles ( AgentConfigurationInterface const *const from )
private

Method which performs an undoable copy of the agent profiles from the given instance of AgentConfigurationInterface. The copied profiles are appended and the views are updated accordingly.

Parameters
[in] from the pointer to the model data to copy from

Definition at line 144 of file AgentConfigurationPresenter.cpp.

145 {
146 for(auto name : from->getAgents()->keys())
147 {
148 // 1. add the new agent
149 agentsPresenter->addAgent(name);
150
151 // 2. set agent type
152 agentsPresenter->setType(from->getAgents()->getItem(name)->getType());
153
154 if(from->getAgents()->getItem(name)->getType() == "Dynamic")
155 {
156 // 3.a copy all driver profiles
157 auto loadedDrivers = from->getAgents()->getItem(name)->getDriverProfiles();
158 auto drivers = agentsPresenter->driverProfilesMap;
159
160 for(auto driver : loadedDrivers->keys())
161 {
162 undoStack->push(new AgentProfileCommands::AddDriverProfile(drivers, driver, loadedDrivers->value(driver)));
163 }
164
165 // 4.a copy all vehicle profiles
166 auto loadedVehicles = from->getAgents()->getItem(name)->getVehicleProfiles();
167 auto vehicles = agentsPresenter->vehicleProfilesMap;
168
169 for(auto vehicle : loadedVehicles->keys())
170 {
171 undoStack->push(new AgentProfileCommands::AddVehicleProfile(vehicles, vehicle, loadedVehicles->value(vehicle)));
172 }
173 }
174 else if(from->getAgents()->getItem(name)->getType() == "Static")
175 {
176 // 3.b set system config and system
177 undoStack->push(new AgentProfileCommands::EditAgentSystemConfig(agentConfiguration->getAgents(),
178 agentConfigurationView->getAgentsView(),
179 agentsPresenter,
180 name,
181 from->getAgents()->getItem(name)->getSystemConfig()));
182
183 undoStack->push(new AgentProfileCommands::EditAgentSystem(agentConfiguration->getAgents(),
184 agentConfigurationView->getAgentsView(), name,
185 from->getAgents()->getItem(name)->getSystemTitle(),
186 from->getAgents()->getItem(name)->getSystemID()));
187
188 // 4.b. set model catalogue and model
189 undoStack->push(new AgentProfileCommands::EditAgentModelCatalogue(agentConfiguration->getAgents(),
190 agentConfigurationView->getAgentsView(),
191 agentsPresenter,
192 name,
193 from->getAgents()->getItem(name)->getVehicleModelCatalogue()));
194 undoStack->push(new AgentProfileCommands::EditAgentModel(agentConfiguration->getAgents(),
195 agentConfigurationView->getAgentsView(),
196 name,
197 from->getAgents()->getItem(name)->getVehicleModel()));
198 }
199 }
200 }
AgentMapPresenter::vehicleProfilesMap
VehicleProfilesMapPresenter * vehicleProfilesMap
the pointer to the presenter object of the table for assigning vehicle profiles to the current agent ...
Definition: AgentMapPresenter.h:352
AgentConfigurationPresenter::undoStack
QUndoStack *const undoStack
pointer to the undo stack
Definition: AgentConfigurationPresenter.h:130
AgentMapPresenter::setType
void setType(const QString &type)
Slot triggered by the AgentMapView::typeChanged signal. Performs an undoable set-operation on the typ...
Definition: AgentMapPresenter.cpp:113
AgentProfileCommands::AddDriverProfile
This class defines the command for undoable add-operations on the driver profiles table of the curren...
Definition: AgentMapPresenter.h:620
AgentConfigurationPresenter::agentConfiguration
AgentConfigurationInterface *const agentConfiguration
pointer to the overall model interface of this plugin
Definition: AgentConfigurationPresenter.h:125
AgentConfigurationPresenter::agentsPresenter
AgentMapPresenter *const agentsPresenter
pointer to the presenter object of agent profiles
Definition: AgentConfigurationPresenter.h:135
AgentConfigurationView::getAgentsView
AgentMapView * getAgentsView() const
Method that returns the view for agent profies.
Definition: AgentConfigurationView.cpp:132
AgentMapPresenter::driverProfilesMap
DriverProfilesMapPresenter * driverProfilesMap
the pointer to the presenter object of the table for assigning driver profiles to the current agent p...
Definition: AgentMapPresenter.h:353
AgentProfileCommands::EditAgentModelCatalogue
This class defines the command for undoable set-operations on the vehicle model catalogue of the curr...
Definition: AgentMapPresenter.h:566
AgentProfileCommands::EditAgentSystem
This class defines the command for undoable set-operations on the system of the currently edited agen...
Definition: AgentMapPresenter.h:535
AgentProfileCommands::EditAgentModel
This class defines the command for undoable set-operations on the vehicle model of the currently edit...
Definition: AgentMapPresenter.h:594
AgentProfileCommands::EditAgentSystemConfig
This class defines the command for undoable set-operations on the system config file of the currently...
Definition: AgentMapPresenter.h:506
AgentConfigurationPresenter::agentConfigurationView
AgentConfigurationView *const agentConfigurationView
pointer to the overall view of this plugin
Definition: AgentConfigurationPresenter.h:126
AgentConfigurationInterface::getAgents
virtual AgentMapInterface * getAgents() const =0
Method which provides access to the map of agent profiles.
AgentProfileCommands::AddVehicleProfile
This class defines the command for undoable add-operations on the vehicle profiles table of the curre...
Definition: AgentMapPresenter.h:670
AgentMapPresenter::addAgent
void addAgent(QString const &name)
Slot triggered by the AgentMapView::add signal. Performs an undoable add-operation on the agent profi...
Definition: AgentMapPresenter.cpp:118

◆ copyDriverProfiles()

void AgentConfigurationPresenter::copyDriverProfiles ( AgentConfigurationInterface const *const from )
private

Method which performs an undoable copy of the driver profiles from the given instance of AgentConfigurationInterface. The copied profiles are appended and the views are updated accordingly.

Parameters
[in] from the pointer to the model data to copy from

Definition at line 203 of file AgentConfigurationPresenter.cpp.

204 {
205 for(auto name : from->getDriverProfiles()->keys())
206 {
207 undoStack->push(new DriverProfileCommands::AddDriverProfile(agentConfiguration->getDriverProfiles(),
208 agentConfigurationView->getDriverProfilesView(),
209 name,
210 from->getDriverProfiles()->getItem(name)->getParameters()));
211
212 undoStack->push(new DriverProfileCommands::SetCurrentDriver(agentConfiguration->getDriverProfiles(),
213 &(driverProfilesPresenter->currentDriver),
214 name,
215 driverProfilesPresenter->parameters,
216 driverProfilesPresenter));
217 }
218 }
AgentConfigurationInterface::getDriverProfiles
virtual DriverProfileMapInterface * getDriverProfiles() const =0
Method which provides access to the map of driver profiles.
AgentConfigurationPresenter::undoStack
QUndoStack *const undoStack
pointer to the undo stack
Definition: AgentConfigurationPresenter.h:130
DriverProfilesPresenter::currentDriver
DriverProfileItemInterface * currentDriver
a pointer to the currently edited driver profile
Definition: DriverProfilesPresenter.h:132
DriverProfileCommands::SetCurrentDriver
This class defines the command for undoable set-operations on the currently selected driver profile...
Definition: DriverProfilesPresenter.h:150
AgentConfigurationPresenter::agentConfiguration
AgentConfigurationInterface *const agentConfiguration
pointer to the overall model interface of this plugin
Definition: AgentConfigurationPresenter.h:125
AgentConfigurationPresenter::driverProfilesPresenter
DriverProfilesPresenter *const driverProfilesPresenter
pointer to the presenter object of driver profiles
Definition: AgentConfigurationPresenter.h:137
DriverProfileCommands::AddDriverProfile
This class defines the command for undoable add-operations on the map of driver profiles (DriverProfi...
Definition: DriverProfilesPresenter.h:202
DriverProfilesPresenter::parameters
ParameterMapPresenter * parameters
a pointer to the presenter object for the parameters of a driver profile
Definition: DriverProfilesPresenter.h:135
AgentConfigurationPresenter::agentConfigurationView
AgentConfigurationView *const agentConfigurationView
pointer to the overall view of this plugin
Definition: AgentConfigurationPresenter.h:126
AgentConfigurationView::getDriverProfilesView
DriverProfilesView * getDriverProfilesView() const
Method that returns the view for driver profies.
Definition: AgentConfigurationView.cpp:143

◆ copyVehicleProfiles()

void AgentConfigurationPresenter::copyVehicleProfiles ( AgentConfigurationInterface const *const from )
private

Method which performs an undoable copy of the vehicle profiles from the given instance of AgentConfigurationInterface. The copied profiles are appended and the views are updated accordingly.

Parameters
[in] from the pointer to the model data to copy from

Definition at line 221 of file AgentConfigurationPresenter.cpp.

222 {
223 for(auto name : from->getVehicleProfiles()->keys())
224 {
225 // 1. add the vehicle profile
226 vehicleProfilesPresenter->addVehicleProfile(name);
227
228 // 2. adopt model catalouge and model
229 undoStack->push(new VehicleProfileCommands::SetModelCatalogue(agentConfiguration->getVehicleProfiles(),
230 agentConfigurationView->getVehicleProfilesView(),
231 name,
232 from->getVehicleProfiles()->getItem(name)->getModelCatalogue(),
233 vehicleProfilesPresenter));
234 vehicleProfilesPresenter->setModel(from->getVehicleProfiles()->getItem(name)->getModel());
235
236 // 3. adopt system config, system profiles and systems
237 undoStack->push(new VehicleProfileCommands::SetSystemConfig(agentConfiguration->getVehicleProfiles(),
238 agentConfigurationView->getVehicleProfilesView(),
239 name,
240 from->getVehicleProfiles()->getItem(name)->getSystemConfig(),
241 vehicleProfilesPresenter));
242
243 for(auto type : from->getVehicleProfiles()->getItem(name)->getSystemProfiles()->keys())
244 {
245 vehicleProfilesPresenter->addSystemProfile(type);
246
247 for(auto system : from->getVehicleProfiles()->getItem(name)->getSystems(type)->keys())
248 undoStack->push(new VehicleProfileCommands::AddSystem(vehicleProfilesPresenter->systemProfilePresenters.value(name)->value(type),
249 system, from->getVehicleProfiles()->getItem(name)->getSystems(type)->value(system)));
250 }
251
252 }
253 }
AgentConfigurationInterface::getVehicleProfiles
virtual VehicleProfileMapInterface * getVehicleProfiles() const =0
Method which provides access to the map of vehicle profiles.
AgentConfigurationPresenter::undoStack
QUndoStack *const undoStack
pointer to the undo stack
Definition: AgentConfigurationPresenter.h:130
VehicleProfileCommands::AddSystem
This class defines the command for undoable add-operations on the map of systems of a specific algori...
Definition: VehicleProfilesPresenter.h:527
VehicleProfilesPresenter::addSystemProfile
void addSystemProfile(QString const &type)
Slot, triggered by the VehicleProfilesView::addSystemProfile signal. Undoably adds a map for systems ...
Definition: VehicleProfilesPresenter.cpp:202
AgentConfigurationView::getVehicleProfilesView
VehicleProfilesView * getVehicleProfilesView() const
Method that returns the view for vehicle profies.
Definition: AgentConfigurationView.cpp:137
VehicleProfilesPresenter::systemProfilePresenters
QMap< VehicleProfileItemInterface::Name, QMap< QString, SystemProfilePresenter * > * > systemProfilePresenters
a container for each vehicle profile that stores all table presenter objects for systems of a certain...
Definition: VehicleProfilesPresenter.h:265
AgentConfigurationPresenter::vehicleProfilesPresenter
VehicleProfilesPresenter *const vehicleProfilesPresenter
pointer to the presenter object of vehicle profiles
Definition: AgentConfigurationPresenter.h:136
VehicleProfileCommands::SetModelCatalogue
This class defines the command for undoable set-operations on the vehicle model catalogue of the curr...
Definition: VehicleProfilesPresenter.h:383
VehicleProfilesPresenter::setModel
void setModel(QString const &modelName)
Slot triggered by the VehicleProfilesView::modifiedModel signal. Performs an undoable assignment of t...
Definition: VehicleProfilesPresenter.cpp:344
AgentConfigurationPresenter::agentConfiguration
AgentConfigurationInterface *const agentConfiguration
pointer to the overall model interface of this plugin
Definition: AgentConfigurationPresenter.h:125
VehicleProfileCommands::SetSystemConfig
This class defines the command for undoable set-operations on the system config of the currently edit...
Definition: VehicleProfilesPresenter.h:436
AgentConfigurationPresenter::agentConfigurationView
AgentConfigurationView *const agentConfigurationView
pointer to the overall view of this plugin
Definition: AgentConfigurationPresenter.h:126
VehicleProfilesPresenter::addVehicleProfile
void addVehicleProfile(QString const &name)
Slot triggered by the VehicleProfilesView::addVehicleProfile signal. Performs an undoable add-operati...
Definition: VehicleProfilesPresenter.cpp:81
The documentation for this class was generated from the following files:
  • AgentConfigurationPresenter.h
  • AgentConfigurationPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AgentConfigurationPresenter Member List

This is the complete list of members for AgentConfigurationPresenter, including all inherited members.

agentConfiguration | AgentConfigurationPresenter | private
agentConfigurationView | AgentConfigurationPresenter | private
agentsPresenter | AgentConfigurationPresenter | private
clear() | AgentConfigurationPresenter | privateslot
clearAgentProfiles() | AgentConfigurationPresenter | private
clearDriverProfiles() | AgentConfigurationPresenter | private
clearVehicleProfiles() | AgentConfigurationPresenter | private
copyAgentProfiles(AgentConfigurationInterface const *const from) | AgentConfigurationPresenter | private
copyDriverProfiles(AgentConfigurationInterface const *const from) | AgentConfigurationPresenter | private
copyVehicleProfiles(AgentConfigurationInterface const *const from) | AgentConfigurationPresenter | private
driverProfilesPresenter | AgentConfigurationPresenter | private
load() | AgentConfigurationPresenter | privateslot
project | AgentConfigurationPresenter | private
redo | AgentConfigurationPresenter | private
save() | AgentConfigurationPresenter | privateslot
undo | AgentConfigurationPresenter | private
undoStack | AgentConfigurationPresenter | private
vehicleProfilesPresenter | AgentConfigurationPresenter | private
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentConfigurationView Class Reference

Signals | Public Member Functions | Private Slots | Private Attributes | Static Private Attributes | List of all members
AgentConfigurationView Class Reference

This class constitutes the main view of the agent configuration plugin. It instantiates the action menu as well as a tab widget as a container widget for views of agent, driver and vehicle profiles as well as the undo stack. The main task of this view is to emit signals upon user actions on the action menu which are handled in the corresponding prestenter object (AgentConfigurationPresenter). More...

Inherits QWidget.

Signals

void | ClearSetup ()
Signal, emitted after the clear-button in the action menu has been clicked and the user warning has been confirmed.
void | ExportSetup ()
Signal, emitted after the export-button in the action menu has been clicked.
void | LoadSetup ()
Signal, emitted after the load-button in the action menu has been clicked.
void | Redo ()
Signal, emitted after the redo-button in the action menu has been clicked.
void | SaveSetup ()
Signal, emitted after the save-button in the action menu has been clicked.
void | Undo ()
Signal, emitted after the undo-button in the action menu has been clicked.

Public Member Functions

AgentMapView * | getAgentsView () const
Method that returns the view for agent profies. More...
DriverProfilesView * | getDriverProfilesView () const
Method that returns the view for driver profies. More...
QUndoView * | getUndoView () const
Method that returns the undo view. More...
VehicleProfilesView * | getVehicleProfilesView () const
Method that returns the view for vehicle profies. More...

Private Slots

void | actionClear ()
Slot which is triggered when the clear-button of the action menu has been clicked. Prompts a dialog box to inform the user that the whole worksheet is going to be cleared. If user confirms, the ClearSetup signal is emitted.
void | actionExport ()
Slot which is triggered when the export-button of the action menu has been clicked. Prompts a file dialog box to let the user select a filepath. Afterwards the signal ExportSetup is emitted transmitting the selected filepath.
void | actionHistory ()
Slot which is triggered when the command history button is clicked. Will show or hide the command history.
void | actionLoad ()
Slot which is triggered when the load-button of the action menu has been clicked. Prompts a file dialog box to let the user select a filepath. Afterwards the signal LoadSetup is emitted transmitting the selected filepath.
void | actionRedo ()
Slot which is triggered when the redo-button of the action menu has been clicked. Will trigger the redo of the previously undone action.
void | actionSave ()
Slot which is triggered when the save-button of the action menu has been clicked. Prompts a file dialog box to let the user select a filepath. Afterwards the signal SaveSetup is emitted transmitting the selected filepath.
void | actionUndo ()
Slot which is triggered when the undo-button of the action menu has been clicked. Will trigger the undo of the previous action.

Private Attributes

WindowInterface::Action *const | actionMenuClear
The action menu object for clearing the entire worksheet.
WindowInterface::Action *const | actionMenuExport
The action menu object for exporting an old profiles catalogue file.
WindowInterface::Action *const | actionMenuHistory
The action menu object for showing the command history.
WindowInterface::Action *const | actionMenuLoad
The action menu object for loading a profiles catalogue file.
WindowInterface::Action *const | actionMenuRedo
The action menu object for redoing actions.
WindowInterface::Action *const | actionMenuSave
The action menu object for saving a profiles catalogue file.
WindowInterface::Action *const | actionMenuUndo
The action menu object for undoing actions.
AgentMapView * agentsView
the view for editing agent profiles
DriverProfilesView * driverProfilesView
the view for editing driver profiles
Ui::AgentConfigurationView * | ui
the ui object defining the views appearance
QUndoView *const | undoView
the view of the undo stack
VehicleProfilesView * vehicleProfilesView
the view for editing vehicle profiles
WindowInterface *const | window
the pointer to the window plugin for registering and deregistering this view

Static Private Attributes

static WindowInterface::ID const ViewID = QStringLiteral("openPASS.AgentConfiguration")
a static Id used to register the view of this plugin in the window plugin

Detailed Description

This class constitutes the main view of the agent configuration plugin. It instantiates the action menu as well as a tab widget as a container widget for views of agent, driver and vehicle profiles as well as the undo stack. The main task of this view is to emit signals upon user actions on the action menu which are handled in the corresponding prestenter object (AgentConfigurationPresenter).

Definition at line 50 of file AgentConfigurationView.h.

Member Function Documentation

◆ getAgentsView()

AgentMapView * AgentConfigurationView::getAgentsView ( ) const

Method that returns the view for agent profies.

Returns
the agent profiles' view

Definition at line 132 of file AgentConfigurationView.cpp.

133 {
134 return agentsView;
135 }
AgentConfigurationView::agentsView
AgentMapView * agentsView
the view for editing agent profiles
Definition: AgentConfigurationView.h:185

◆ getDriverProfilesView()

DriverProfilesView * AgentConfigurationView::getDriverProfilesView ( ) const

Method that returns the view for driver profies.

Returns
the driver profiles' view

Definition at line 143 of file AgentConfigurationView.cpp.

144 {
145 return driverProfilesView;
146 }
AgentConfigurationView::driverProfilesView
DriverProfilesView * driverProfilesView
the view for editing driver profiles
Definition: AgentConfigurationView.h:187

◆ getUndoView()

QUndoView * AgentConfigurationView::getUndoView ( ) const

Method that returns the undo view.

Returns
the undo view

Definition at line 148 of file AgentConfigurationView.cpp.

149 {
150 return undoView;
151 }
AgentConfigurationView::undoView
QUndoView *const undoView
the view of the undo stack
Definition: AgentConfigurationView.h:172

◆ getVehicleProfilesView()

VehicleProfilesView * AgentConfigurationView::getVehicleProfilesView ( ) const

Method that returns the view for vehicle profies.

Returns
the vehicle profiles' view

Definition at line 137 of file AgentConfigurationView.cpp.

138 {
139 return vehicleProfilesView;
140 }
AgentConfigurationView::vehicleProfilesView
VehicleProfilesView * vehicleProfilesView
the view for editing vehicle profiles
Definition: AgentConfigurationView.h:186
The documentation for this class was generated from the following files:
  • AgentConfigurationView.h
  • AgentConfigurationView.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AgentConfigurationView Member List

This is the complete list of members for AgentConfigurationView, including all inherited members.

actionClear() | AgentConfigurationView | privateslot
actionExport() | AgentConfigurationView | privateslot
actionHistory() | AgentConfigurationView | privateslot
actionLoad() | AgentConfigurationView | privateslot
actionMenuClear | AgentConfigurationView | private
actionMenuExport | AgentConfigurationView | private
actionMenuHistory | AgentConfigurationView | private
actionMenuLoad | AgentConfigurationView | private
actionMenuRedo | AgentConfigurationView | private
actionMenuSave | AgentConfigurationView | private
actionMenuUndo | AgentConfigurationView | private
actionRedo() | AgentConfigurationView | privateslot
actionSave() | AgentConfigurationView | privateslot
actionUndo() | AgentConfigurationView | privateslot
agentsView | AgentConfigurationView | private
ClearSetup() | AgentConfigurationView | signal
driverProfilesView | AgentConfigurationView | private
ExportSetup() | AgentConfigurationView | signal
getAgentsView() const | AgentConfigurationView |
getDriverProfilesView() const | AgentConfigurationView |
getUndoView() const | AgentConfigurationView |
getVehicleProfilesView() const | AgentConfigurationView |
LoadSetup() | AgentConfigurationView | signal
Redo() | AgentConfigurationView | signal
SaveSetup() | AgentConfigurationView | signal
ui | AgentConfigurationView | private
Undo() | AgentConfigurationView | signal
undoView | AgentConfigurationView | private
vehicleProfilesView | AgentConfigurationView | private
ViewID | AgentConfigurationView | privatestatic
window | AgentConfigurationView | private
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentItemInterface Class Reference

Public Types | Public Member Functions | List of all members
AgentItemInterface Class Referenceabstract

This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-relevant profiles cataloge (*.xml) under <AgentProfiles>. More...

Inherits QObject.

Inherited by AgentItemModel.

Public Types

using | DriverProfile = QString
the nome of a driver profile
using | DriverProfiles = QMap< DriverProfile, Probability >
the mapping of a driver profile to the instantiation probability
using | Name = QString
the name of the agent profiles
using | Probability = double
a probability value (e.g. of a driver or a vehicle profile)
using | System = QPair< SystemID, SystemTitle >
the pair of id and title of a system in system config (used as system reference)
using | SystemConfig = QString
the system config file
using | SystemID = unsigned int
the id of a system defined in a system config
using | SystemTitle = QString
the title of a system defined in a system config
using | Type = QString
the type of the agent profile (dynamic or static)
using | VehicleModel = QString
a vehicle model defined in a vehicle model catalogue file
using | VehicleModelCatalogue = QString
the vehicle model catalogue file
using | VehicleProfile = QString
the name of a vehicle profile
using | VehicleProfiles = QMap< VehicleProfile, Probability >
the mapping of a vehicle profile to the instantiation probability

Public Member Functions

virtual DriverProfiles * | getDriverProfiles () const =0
Method which returns a pointer to the map of driver profiles, i.e. the mapping of driver profiles to instantiation probabilities (for dynamic agent profiles). More...
virtual Name | getName () const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profile if registered in a map (AgentMapInterface). More...
virtual System * | getSystem ()=0
Method which returns a pointer to the system (i.e. the pair of system id and title) currently selected in this agent profile (for static agent profiles only). More...
virtual SystemConfig | getSystemConfig () const =0
Method which returns the current system config file (for static agent profiles). More...
virtual SystemID | getSystemID () const =0
Method which returns the id of the currently selected system (for static agent profiles). More...
virtual SystemTitle | getSystemTitle () const =0
Method which returns the title of the currently selected system (for static agent profiles). More...
virtual Type | getType () const =0
Method which returns the type of this agent profile. More...
virtual VehicleModel | getVehicleModel () const =0
Method which returns the currently selected vehicle profile (for static agent profiles). More...
virtual VehicleModelCatalogue | getVehicleModelCatalogue () const =0
Method which returns the current vehicle model catalogue (for static agent profiles). More...
virtual VehicleProfiles * | getVehicleProfiles () const =0
Method which returns a pointer to the map of vehicle profiles, i.e. the mapping of vehicle profiles to instantiation probabilities (for dynamic agent profiles). More...
virtual void | setSystemConfig (SystemConfig const &_systemConfig)=0
Method which sets the current system config file to the one passed as an argument (for static agent profiles). More...
virtual void | setSystemID (SystemID const &_systemID)=0
Method which sets the currently selected system id to the one passed as an argument (for static agent profiles). More...
virtual void | setSystemTitle (SystemTitle const &_systemTitle)=0
Method which sets the currently selected system title to the one passed as an argument (for static agent profiles). More...
virtual void | setType (const Type &_type)=0
Method which sets the type of this agent profile to the one passed as an argument. More...
virtual void | setVehicleModel (VehicleModel const &_vehicleModel)=0
Method which sets the currently selected vehicle profile to the one passed as an argument (for static agent profiles). More...
virtual void | setVehicleModelCatalogue (VehicleModelCatalogue const &_vehicleModelCatalogue)=0
Method which sets the current vehicle model catalogue to the one passed as an argument (for static agent profiles). More...

Detailed Description

This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-relevant profiles cataloge (*.xml) under <AgentProfiles>.

In particular, this class gains accesss to the maps of vehicle and driver profiles for dynamic agent profiles. For static agent profiles, this class defines setter and getter methods for vehicle model catalogue and system config as well as models and systems defined therein.

Definition at line 38 of file AgentItemInterface.h.

Member Function Documentation

◆ getDriverProfiles()

virtual DriverProfiles* AgentItemInterface::getDriverProfiles ( ) const
pure virtual

Method which returns a pointer to the map of driver profiles, i.e. the mapping of driver profiles to instantiation probabilities (for dynamic agent profiles).

Returns
the pointer to the map of driver profiles

◆ getName()

virtual Name AgentItemInterface::getName ( ) const
pure virtual

Method which returns the name of this agent profile, i.e. the key identifier name of this agent profile if registered in a map (AgentMapInterface).

Returns
the name of this agent profile

◆ getSystem()

virtual System* AgentItemInterface::getSystem ( )
pure virtual

Method which returns a pointer to the system (i.e. the pair of system id and title) currently selected in this agent profile (for static agent profiles only).

Returns
a pointer to the pair of system id and title

◆ getSystemConfig()

virtual SystemConfig AgentItemInterface::getSystemConfig ( ) const
pure virtual

Method which returns the current system config file (for static agent profiles).

Returns
the current system config file

◆ getSystemID()

virtual SystemID AgentItemInterface::getSystemID ( ) const
pure virtual

Method which returns the id of the currently selected system (for static agent profiles).

Returns
the id of the currently selected system

◆ getSystemTitle()

virtual SystemTitle AgentItemInterface::getSystemTitle ( ) const
pure virtual

Method which returns the title of the currently selected system (for static agent profiles).

Returns
the title of the currently selected system

◆ getType()

virtual Type AgentItemInterface::getType ( ) const
pure virtual

Method which returns the type of this agent profile.

Returns
the type of this agent profile

◆ getVehicleModel()

virtual VehicleModel AgentItemInterface::getVehicleModel ( ) const
pure virtual

Method which returns the currently selected vehicle profile (for static agent profiles).

Returns
the currently selected vehicle model

◆ getVehicleModelCatalogue()

virtual VehicleModelCatalogue AgentItemInterface::getVehicleModelCatalogue ( ) const
pure virtual

Method which returns the current vehicle model catalogue (for static agent profiles).

Returns
the currently selected vehicle model

◆ getVehicleProfiles()

virtual VehicleProfiles* AgentItemInterface::getVehicleProfiles ( ) const
pure virtual

Method which returns a pointer to the map of vehicle profiles, i.e. the mapping of vehicle profiles to instantiation probabilities (for dynamic agent profiles).

Returns
the pointer to the map of vehicle profiles

◆ setSystemConfig()

virtual void AgentItemInterface::setSystemConfig ( SystemConfig const & _systemConfig )
pure virtual

Method which sets the current system config file to the one passed as an argument (for static agent profiles).

Parameters
[in] _systemConfig the new system config file

◆ setSystemID()

virtual void AgentItemInterface::setSystemID ( SystemID const & _systemID )
pure virtual

Method which sets the currently selected system id to the one passed as an argument (for static agent profiles).

Parameters
[in] _systemID the new system id

◆ setSystemTitle()

virtual void AgentItemInterface::setSystemTitle ( SystemTitle const & _systemTitle )
pure virtual

Method which sets the currently selected system title to the one passed as an argument (for static agent profiles).

Parameters
[in] _systemTitle the new system title

◆ setType()

virtual void AgentItemInterface::setType ( const Type & _type )
pure virtual

Method which sets the type of this agent profile to the one passed as an argument.

Parameters
[in] _type the new type of this agent profile

◆ setVehicleModel()

virtual void AgentItemInterface::setVehicleModel ( VehicleModel const & _vehicleModel )
pure virtual

Method which sets the currently selected vehicle profile to the one passed as an argument (for static agent profiles).

Parameters
[in] _vehicleModel the new vehicle model

◆ setVehicleModelCatalogue()

virtual void AgentItemInterface::setVehicleModelCatalogue ( VehicleModelCatalogue const & _vehicleModelCatalogue )
pure virtual

Method which sets the current vehicle model catalogue to the one passed as an argument (for static agent profiles).

Parameters
[in] _vehicleModelCatalogue the new vehicle model catalogue
The documentation for this class was generated from the following file:
  • AgentItemInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AgentItemInterface Member List

This is the complete list of members for AgentItemInterface, including all inherited members.

DriverProfile typedef | AgentItemInterface |
DriverProfiles typedef | AgentItemInterface |
getDriverProfiles() const =0 | AgentItemInterface | pure virtual
getName() const =0 | AgentItemInterface | pure virtual
getSystem()=0 | AgentItemInterface | pure virtual
getSystemConfig() const =0 | AgentItemInterface | pure virtual
getSystemID() const =0 | AgentItemInterface | pure virtual
getSystemTitle() const =0 | AgentItemInterface | pure virtual
getType() const =0 | AgentItemInterface | pure virtual
getVehicleModel() const =0 | AgentItemInterface | pure virtual
getVehicleModelCatalogue() const =0 | AgentItemInterface | pure virtual
getVehicleProfiles() const =0 | AgentItemInterface | pure virtual
Name typedef | AgentItemInterface |
Probability typedef | AgentItemInterface |
setSystemConfig(SystemConfig const &_systemConfig)=0 | AgentItemInterface | pure virtual
setSystemID(SystemID const &_systemID)=0 | AgentItemInterface | pure virtual
setSystemTitle(SystemTitle const &_systemTitle)=0 | AgentItemInterface | pure virtual
setType(const Type &_type)=0 | AgentItemInterface | pure virtual
setVehicleModel(VehicleModel const &_vehicleModel)=0 | AgentItemInterface | pure virtual
setVehicleModelCatalogue(VehicleModelCatalogue const &_vehicleModelCatalogue)=0 | AgentItemInterface | pure virtual
System typedef | AgentItemInterface |
SystemConfig typedef | AgentItemInterface |
SystemID typedef | AgentItemInterface |
SystemTitle typedef | AgentItemInterface |
Type typedef | AgentItemInterface |
VehicleModel typedef | AgentItemInterface |
VehicleModelCatalogue typedef | AgentItemInterface |
VehicleProfile typedef | AgentItemInterface |
VehicleProfiles typedef | AgentItemInterface |
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
AgentMapInterface Class Referenceabstract

This class constitutes a container class in which agent profiles (instances of AgentItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map. More...

Inheritance diagram for AgentMapInterface:
AgentMapModel

Public Types

using | ConstIterator = Map::ConstIterator
a constant iterator for read-only operations
using | Item = AgentItemInterface
the interface to the agent profiles
using | Iterator = Map::Iterator
an iterator for searching within the map
using | Map = QMap< Name, Item * >
the map (container class) for registering agent profiles
using | Name = AgentItemInterface::Name
the name of the agent profile (key identifier)

Signals

void | added (Name name)
Signal emitted when an agent profile has been added to the map. Transmits the name of the correponding agent profile. More...
void | cleared ()
Signal emitted when the map has been cleared.
void | modifiedName (Name oldName, Name newName)
Signal emitted when the name of the agent profile has been changed. Transmits both, the new and old names of the profile. More...
void | removed (Name name)
Signal emitted when an agent profile has been removed from the map. Transmits the name of the correponding agent profile. More...

Public Member Functions

virtual bool | add (AgentMapInterface::Name const &name)=0
Method which creates a new agent profile (instance of AgentItemInterface) and adds it to the map under the given name. More...
virtual bool | add (AgentMapInterface::Name const &name, AgentMapInterface::Item const *const item)=0
Method which creates a copy of the given agent profile and adds it to the map using the given name. More...
virtual AgentMapInterface::Iterator | begin ()=0
Gets an iterator pointing to the first agent profile in the map. More...
virtual AgentMapInterface::ConstIterator | constBegin () const =0
Gets an iterator pointing to the first agent profile in the map (use for read-only since pointing at constant values). More...
virtual AgentMapInterface::ConstIterator | constEnd () const =0
Gets an iterator pointing at the end of the map after the last agent profile (use for read-only). More...
virtual bool | contains (AgentMapInterface::Name const &name) const =0
Method wich checks whether the map contains an agent profile with the given name. More...
virtual int | count () const =0
Method which returns the number of registered agent profiles. More...
virtual AgentMapInterface::Iterator | end ()=0
Gets an iterator pointing to the end of the map after the last agent profile. More...
virtual AgentMapInterface::Item * | getItem (AgentMapInterface::Name const &name) const =0
Method which returns a pointer to the agent profile with the given name. If the map does not contain an agent profile with the given name, nullptr is returned. More...
virtual AgentMapInterface::Name | getName (AgentMapInterface::Item *const item) const =0
Method wich returns the name of the given agent profile. More...
virtual QStringList | keys () const =0
Method which returns the (string) list of all agent profile names in the map. More...
virtual bool | remove (AgentMapInterface::Name const &name)=0
Method which removes the agent profile with the given name from the map. The profile is deleted after removing. Nothing will be done if there is no such profile. More...
virtual void | setName (AgentMapInterface::Item *const item, AgentMapInterface::Name const &name)=0
Method wich changes the name of the given agent profile to the one passed as second argument. More...
virtual QList< Item * > | values () const =0
Method which returns a list of pointers to all agent profiles in the map. More...

Detailed Description

This class constitutes a container class in which agent profiles (instances of AgentItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map.

Definition at line 37 of file AgentMapInterface.h.

Member Function Documentation

◆ add() [1/2]

virtual bool AgentMapInterface::add ( AgentMapInterface::Name const & name )
pure virtual

Method which creates a new agent profile (instance of AgentItemInterface) and adds it to the map under the given name.

Parameters
[in] name the name under which the newly created item is registered
Returns
"true", if name is not used already, otherwise "false"

Implemented in AgentMapModel.

◆ add() [2/2]

virtual bool AgentMapInterface::add | ( | AgentMapInterface::Name const & | name,
 |  | AgentMapInterface::Item const *const | item
 | ) |  |
pure virtual

Method which creates a copy of the given agent profile and adds it to the map using the given name.

Parameters
[in] | name | the name under which the copied item is registered
[in] | item | the agent pofile to be copied
Returns
"true", if name is not used already, otherwise "false"

Implemented in AgentMapModel.

◆ added

void AgentMapInterface::added ( Name name )
signal

Signal emitted when an agent profile has been added to the map. Transmits the name of the correponding agent profile.

Parameters
[in] name the name of the added agent profile

◆ begin()

virtual AgentMapInterface::Iterator AgentMapInterface::begin ( )
pure virtual

Gets an iterator pointing to the first agent profile in the map.

Returns
The iterator pointing at the first object in the map.

Implemented in AgentMapModel.

◆ constBegin()

virtual AgentMapInterface::ConstIterator AgentMapInterface::constBegin ( ) const
pure virtual

Gets an iterator pointing to the first agent profile in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implemented in AgentMapModel.

◆ constEnd()

virtual AgentMapInterface::ConstIterator AgentMapInterface::constEnd ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last agent profile (use for read-only).

Returns
The iterator pointing at the end of the map.

Implemented in AgentMapModel.

◆ contains()

virtual bool AgentMapInterface::contains ( AgentMapInterface::Name const & name ) const
pure virtual

Method wich checks whether the map contains an agent profile with the given name.

Parameters
[in] name the name to be searched for
Returns
true, if profile with given name exists, otherwise false.

Implemented in AgentMapModel.

◆ count()

virtual int AgentMapInterface::count ( ) const
pure virtual

Method which returns the number of registered agent profiles.

Returns
the number of registered agent profiles

Implemented in AgentMapModel.

◆ end()

virtual AgentMapInterface::Iterator AgentMapInterface::end ( )
pure virtual

Gets an iterator pointing to the end of the map after the last agent profile.

Returns
The iterator pointing at the end of the map.

Implemented in AgentMapModel.

◆ getItem()

virtual AgentMapInterface::Item* AgentMapInterface::getItem ( AgentMapInterface::Name const & name ) const
pure virtual

Method which returns a pointer to the agent profile with the given name. If the map does not contain an agent profile with the given name, nullptr is returned.

Parameters
[in] name the name of the agent profile to be returned
Returns
the pointer to an agent profile with given name, nullptr if given name does not exist in the map

Implemented in AgentMapModel.

◆ getName()

virtual AgentMapInterface::Name AgentMapInterface::getName ( AgentMapInterface::Item *const item ) const
pure virtual

Method wich returns the name of the given agent profile.

Parameters
[in] item the pointer to the agent profile in question
Returns
the name of the given agent profile

Implemented in AgentMapModel.

◆ keys()

virtual QStringList AgentMapInterface::keys ( ) const
pure virtual

Method which returns the (string) list of all agent profile names in the map.

Returns
the (string) list of all agent profile names

Implemented in AgentMapModel.

◆ modifiedName

void AgentMapInterface::modifiedName | ( | Name | oldName,
 |  | Name | newName
 | ) |  |
signal

Signal emitted when the name of the agent profile has been changed. Transmits both, the new and old names of the profile.

Parameters
[in] | oldName | the old name of the agent profile
[in] | newName | the new name of the agent profile

◆ remove()

virtual bool AgentMapInterface::remove ( AgentMapInterface::Name const & name )
pure virtual

Method which removes the agent profile with the given name from the map. The profile is deleted after removing. Nothing will be done if there is no such profile.

Parameters
[in] name the name of the agent profile to be removed
Returns
"true", if name exists in the map, otherwise "false"

Implemented in AgentMapModel.

◆ removed

void AgentMapInterface::removed ( Name name )
signal

Signal emitted when an agent profile has been removed from the map. Transmits the name of the correponding agent profile.

Parameters
[in] name the name of the removed agent profile

◆ setName()

virtual void AgentMapInterface::setName | ( | AgentMapInterface::Item *const | item,
 |  | AgentMapInterface::Name const & | name
 | ) |  |
pure virtual

Method wich changes the name of the given agent profile to the one passed as second argument.

Parameters
[in] | item | the pointer to the agent profile to be renamed
[in] | name | the new name of the agent profile

Implemented in AgentMapModel.

◆ values()

virtual QList<Item*> AgentMapInterface::values ( ) const
pure virtual

Method which returns a list of pointers to all agent profiles in the map.

Returns
the list of pointers to all agent profiles

Implemented in AgentMapModel.

The documentation for this class was generated from the following file:
  • AgentMapInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AgentMapInterface Member List

This is the complete list of members for AgentMapInterface, including all inherited members.

add(AgentMapInterface::Name const &name)=0 | AgentMapInterface | pure virtual
add(AgentMapInterface::Name const &name, AgentMapInterface::Item const *const item)=0 | AgentMapInterface | pure virtual
added(Name name) | AgentMapInterface | signal
begin()=0 | AgentMapInterface | pure virtual
cleared() | AgentMapInterface | signal
constBegin() const =0 | AgentMapInterface | pure virtual
constEnd() const =0 | AgentMapInterface | pure virtual
ConstIterator typedef | AgentMapInterface |
contains(AgentMapInterface::Name const &name) const =0 | AgentMapInterface | pure virtual
count() const =0 | AgentMapInterface | pure virtual
end()=0 | AgentMapInterface | pure virtual
getItem(AgentMapInterface::Name const &name) const =0 | AgentMapInterface | pure virtual
getName(AgentMapInterface::Item *const item) const =0 | AgentMapInterface | pure virtual
Item typedef | AgentMapInterface |
Iterator typedef | AgentMapInterface |
keys() const =0 | AgentMapInterface | pure virtual
Map typedef | AgentMapInterface |
modifiedName(Name oldName, Name newName) | AgentMapInterface | signal
Name typedef | AgentMapInterface |
remove(AgentMapInterface::Name const &name)=0 | AgentMapInterface | pure virtual
removed(Name name) | AgentMapInterface | signal
setName(AgentMapInterface::Item *const item, AgentMapInterface::Name const &name)=0 | AgentMapInterface | pure virtual
values() const =0 | AgentMapInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapModel Class Reference

Public Member Functions | Protected Attributes | List of all members
AgentMapModel Class Reference

This class implements the functionality of AgentMapInterface. More...

Inheritance diagram for AgentMapModel:
AgentMapInterface

Public Member Functions

virtual bool | add (AgentMapInterface::Name const &name) override
Method which creates a new agent profile (instance of AgentItemInterface) and adds it to the map under the given name. More...
virtual bool | add (const AgentMapInterface::Name &name, const Item *const item) override
Method which creates a copy of the given agent profile and adds it to the map using the given name. More...
virtual AgentMapInterface::Iterator | begin () override
Gets an iterator pointing to the first agent profile in the map. More...
virtual AgentMapInterface::ConstIterator | constBegin () const override
Gets an iterator pointing to the first agent profile in the map (use for read-only since pointing at constant values). More...
virtual AgentMapInterface::ConstIterator | constEnd () const override
Gets an iterator pointing at the end of the map after the last agent profile (use for read-only). More...
virtual bool | contains (AgentMapInterface::Name const &name) const override
Method wich checks whether the map contains an agent profile with the given name. More...
virtual int | count () const override
Method which returns the number of registered agent profiles. More...
virtual AgentMapInterface::Iterator | end () override
Gets an iterator pointing to the end of the map after the last agent profile. More...
virtual AgentMapInterface::Item * | getItem (AgentMapInterface::Name const &name) const override
Method which returns a pointer to the agent profile with the given name. If the map does not contain an agent profile with the given name, nullptr is returned. More...
virtual AgentMapInterface::Name | getName (AgentMapInterface::Item *const item) const override
Method wich returns the name of the given agent profile. More...
virtual QStringList | keys () const override
Method which returns the (string) list of all agent profile names in the map. More...
virtual bool | remove (AgentMapInterface::Name const &name) override
Method which removes the agent profile with the given name from the map. The profile is deleted after removing. Nothing will be done if there is no such profile. More...
virtual void | setName (AgentMapInterface::Item *const item, AgentMapInterface::Name const &name) override
Method wich changes the name of the given agent profile to the one passed as second argument. More...
virtual QList< Item * > | values () const override
Method which returns a list of pointers to all agent profiles in the map. More...

Protected Attributes

AgentMapInterface::Map agents
the map (container) object for agent profiles

Additional Inherited Members

- Public Types inherited from AgentMapInterface
using | ConstIterator = Map::ConstIterator
a constant iterator for read-only operations
using | Item = AgentItemInterface
the interface to the agent profiles
using | Iterator = Map::Iterator
an iterator for searching within the map
using | Map = QMap< Name, Item * >
the map (container class) for registering agent profiles
using | Name = AgentItemInterface::Name
the name of the agent profile (key identifier)
- Signals inherited from AgentMapInterface
void | added (Name name)
Signal emitted when an agent profile has been added to the map. Transmits the name of the correponding agent profile. More...
void | cleared ()
Signal emitted when the map has been cleared.
void | modifiedName (Name oldName, Name newName)
Signal emitted when the name of the agent profile has been changed. Transmits both, the new and old names of the profile. More...
void | removed (Name name)
Signal emitted when an agent profile has been removed from the map. Transmits the name of the correponding agent profile. More...

Detailed Description

This class implements the functionality of AgentMapInterface.

Definition at line 27 of file AgentMapModel.h.

Member Function Documentation

◆ add() [1/2]

bool AgentMapModel::add ( AgentMapInterface::Name const & name )
overridevirtual

Method which creates a new agent profile (instance of AgentItemInterface) and adds it to the map under the given name.

Parameters
[in] name the name under which the newly created item is registered
Returns
"true", if name is not used already, otherwise "false"

Implements AgentMapInterface.

Definition at line 42 of file AgentMapModel.cpp.

43 {
44 if(!contains(name))
45 {
46 agents.insert(name, new AgentItemModel(this));
47 Q_EMIT added(name);
48 return true;
49 }
50
51 return false;
52 }
AgentMapInterface::added
void added(Name name)
Signal emitted when an agent profile has been added to the map. Transmits the name of the correpondin...
AgentMapModel::contains
virtual bool contains(AgentMapInterface::Name const &name) const override
Method wich checks whether the map contains an agent profile with the given name. ...
Definition: AgentMapModel.cpp:108
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67

◆ add() [2/2]

bool AgentMapModel::add | ( | const AgentMapInterface::Name & | name,
 |  | const Item *const | item
 | ) |  |
overridevirtual

Method which creates a copy of the given agent profile and adds it to the map using the given name.

Parameters
[in] | name | the name under which the copied item is registered
[in] | item | the agent pofile to be copied
Returns
"true", if name is not used already, otherwise "false"

Implements AgentMapInterface.

Definition at line 55 of file AgentMapModel.cpp.

56 {
57 if(!contains(name))
58 {
59 agents.insert(name, new AgentItemModel(item, this));
60 Q_EMIT added(name);
61 return true;
62 }
63
64 return false;
65 }
AgentMapInterface::added
void added(Name name)
Signal emitted when an agent profile has been added to the map. Transmits the name of the correpondin...
AgentMapModel::contains
virtual bool contains(AgentMapInterface::Name const &name) const override
Method wich checks whether the map contains an agent profile with the given name. ...
Definition: AgentMapModel.cpp:108
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67

◆ begin()

AgentMapInterface::Iterator AgentMapModel::begin ( )
overridevirtual

Gets an iterator pointing to the first agent profile in the map.

Returns
The iterator pointing at the first object in the map.

Implements AgentMapInterface.

Definition at line 21 of file AgentMapModel.cpp.

22 {
23 return agents.begin();
24 }
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67

◆ constBegin()

AgentMapInterface::ConstIterator AgentMapModel::constBegin ( ) const
overridevirtual

Gets an iterator pointing to the first agent profile in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implements AgentMapInterface.

Definition at line 26 of file AgentMapModel.cpp.

27 {
28 return agents.constBegin();
29 }
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67

◆ constEnd()

AgentMapInterface::ConstIterator AgentMapModel::constEnd ( ) const
overridevirtual

Gets an iterator pointing at the end of the map after the last agent profile (use for read-only).

Returns
The iterator pointing at the end of the map.

Implements AgentMapInterface.

Definition at line 36 of file AgentMapModel.cpp.

37 {
38 return agents.constEnd();
39 }
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67

◆ contains()

bool AgentMapModel::contains ( AgentMapInterface::Name const & name ) const
overridevirtual

Method wich checks whether the map contains an agent profile with the given name.

Parameters
[in] name the name to be searched for
Returns
true, if profile with given name exists, otherwise false.

Implements AgentMapInterface.

Definition at line 108 of file AgentMapModel.cpp.

109 {
110 return agents.contains(name);
111 }
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67

◆ count()

int AgentMapModel::count ( ) const
overridevirtual

Method which returns the number of registered agent profiles.

Returns
the number of registered agent profiles

Implements AgentMapInterface.

Definition at line 123 of file AgentMapModel.cpp.

124 {
125 return agents.count();
126 }
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67

◆ end()

AgentMapInterface::Iterator AgentMapModel::end ( )
overridevirtual

Gets an iterator pointing to the end of the map after the last agent profile.

Returns
The iterator pointing at the end of the map.

Implements AgentMapInterface.

Definition at line 31 of file AgentMapModel.cpp.

32 {
33 return agents.end();
34 }
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67

◆ getItem()

AgentMapInterface::Item * AgentMapModel::getItem ( AgentMapInterface::Name const & name ) const
overridevirtual

Method which returns a pointer to the agent profile with the given name. If the map does not contain an agent profile with the given name, nullptr is returned.

Parameters
[in] name the name of the agent profile to be returned
Returns
the pointer to an agent profile with given name, nullptr if given name does not exist in the map

Implements AgentMapInterface.

Definition at line 79 of file AgentMapModel.cpp.

80 {
81 if(contains(name))
82 {
83 return agents.value(name);
84 }
85
86 return nullptr;
87 }
AgentMapModel::contains
virtual bool contains(AgentMapInterface::Name const &name) const override
Method wich checks whether the map contains an agent profile with the given name. ...
Definition: AgentMapModel.cpp:108
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67

◆ getName()

AgentMapInterface::Name AgentMapModel::getName ( AgentMapInterface::Item *const item ) const
overridevirtual

Method wich returns the name of the given agent profile.

Parameters
[in] item the pointer to the agent profile in question
Returns
the name of the given agent profile

Implements AgentMapInterface.

Definition at line 90 of file AgentMapModel.cpp.

91 {
92 return agents.key(item);
93 }
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67

◆ keys()

QStringList AgentMapModel::keys ( ) const
overridevirtual

Method which returns the (string) list of all agent profile names in the map.

Returns
the (string) list of all agent profile names

Implements AgentMapInterface.

Definition at line 113 of file AgentMapModel.cpp.

114 {
115 return QStringList( agents.keys() );
116 }
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67

◆ remove()

bool AgentMapModel::remove ( AgentMapInterface::Name const & name )
overridevirtual

Method which removes the agent profile with the given name from the map. The profile is deleted after removing. Nothing will be done if there is no such profile.

Parameters
[in] name the name of the agent profile to be removed
Returns
"true", if name exists in the map, otherwise "false"

Implements AgentMapInterface.

Definition at line 67 of file AgentMapModel.cpp.

68 {
69 if(contains(name))
70 {
71 delete agents.take(name);
72 Q_EMIT removed(name);
73 return true;
74 }
75
76 return false;
77 }
AgentMapModel::contains
virtual bool contains(AgentMapInterface::Name const &name) const override
Method wich checks whether the map contains an agent profile with the given name. ...
Definition: AgentMapModel.cpp:108
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67
AgentMapInterface::removed
void removed(Name name)
Signal emitted when an agent profile has been removed from the map. Transmits the name of the correpo...

◆ setName()

void AgentMapModel::setName | ( | AgentMapInterface::Item *const | item,
 |  | AgentMapInterface::Name const & | name
 | ) |  |
overridevirtual

Method wich changes the name of the given agent profile to the one passed as second argument.

Parameters
[in] | item | the pointer to the agent profile to be renamed
[in] | name | the new name of the agent profile

Implements AgentMapInterface.

Definition at line 95 of file AgentMapModel.cpp.

97 {
98
99 Name oldName = item->getName();
100
101 agents.take(oldName);
102 agents.insert(name, item);
103
104 Q_EMIT modifiedName(oldName, name);
105 }
AgentItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profi...
AgentMapInterface::modifiedName
void modifiedName(Name oldName, Name newName)
Signal emitted when the name of the agent profile has been changed. Transmits both, the new and old names of the profile.
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67
AgentMapInterface::Name
AgentItemInterface::Name Name
the name of the agent profile (key identifier)
Definition: AgentMapInterface.h:42

◆ values()

QList< AgentItemInterface * > AgentMapModel::values ( ) const
overridevirtual

Method which returns a list of pointers to all agent profiles in the map.

Returns
the list of pointers to all agent profiles

Implements AgentMapInterface.

Definition at line 118 of file AgentMapModel.cpp.

119 {
120 return agents.values();
121 }
AgentMapModel::agents
AgentMapInterface::Map agents
the map (container) object for agent profiles
Definition: AgentMapModel.h:67
The documentation for this class was generated from the following files:
  • AgentMapModel.h
  • AgentMapModel.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AgentMapModel Member List

This is the complete list of members for AgentMapModel, including all inherited members.

add(AgentMapInterface::Name const &name) override | AgentMapModel | virtual
add(const AgentMapInterface::Name &name, const Item *const item) override | AgentMapModel | virtual
added(Name name) | AgentMapInterface | signal
agents | AgentMapModel | protected
begin() override | AgentMapModel | virtual
cleared() | AgentMapInterface | signal
constBegin() const override | AgentMapModel | virtual
constEnd() const override | AgentMapModel | virtual
ConstIterator typedef | AgentMapInterface |
contains(AgentMapInterface::Name const &name) const override | AgentMapModel | virtual
count() const override | AgentMapModel | virtual
end() override | AgentMapModel | virtual
getItem(AgentMapInterface::Name const &name) const override | AgentMapModel | virtual
getName(AgentMapInterface::Item *const item) const override | AgentMapModel | virtual
Item typedef | AgentMapInterface |
Iterator typedef | AgentMapInterface |
keys() const override | AgentMapModel | virtual
Map typedef | AgentMapInterface |
modifiedName(Name oldName, Name newName) | AgentMapInterface | signal
Name typedef | AgentMapInterface |
remove(AgentMapInterface::Name const &name) override | AgentMapModel | virtual
removed(Name name) | AgentMapInterface | signal
setName(AgentMapInterface::Item *const item, AgentMapInterface::Name const &name) override | AgentMapModel | virtual
values() const override | AgentMapModel | virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapPresenter Class Reference

Public Slots | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
AgentMapPresenter Class Reference

The AgentMapPresenter class handles user events from the view (AgentMapView) and edits the model data (AgentMapInterface) accordingly. Since all actions performed on the model data (i.e. the *.ui file) should be undoable, the presenter instantiates the corresponding undo-commands and pushes them onto the undo stack. The actual operation on the model is then performed in these command object using the re-implementations of the undo/redo methods. See Qt's undo framework for further details. More...

Inherits QObject.

Public Slots

void | refreshModelCatalogue ()
Slot triggered by the AgentMapView::refreshModelCatalogue and ProjectInterface::update signals. Re-loads the currently selected vehicle model catalogue and updates the view accordingly. In particular, this method can be used to update GUI error messages after the file(path) has been edited by the user. More...
void | refreshSystemConfig ()
Slot triggered by the AgentMapView::refreshSystemConfig and ProjectInterface::update signals. Re-loads the currently selected system config XML file and updates the view accordingly. In particular, this method can be used to update GUI error messages after the file(path) has been edited by the user. More...
void | setModel (QString const &model)
Slot triggered by the AgentMapView::setModel signal. Performs an undoable assignment of the given vehicle model to the currently edited agent profile. More...
void | setModelCatalogue ()
Slot triggered by the AgentMapView::setModelCatalogue signal. Opens a file dialog for the user to select a vehicle model catalogue file. After a non-empty selection has been made, an undoable set-operation for the model catalogue of the currently edited agent profile ist performed. The model catalogue is thereby set to the one selected by the user and the view is updated accordingly. More...
void | setModelItems (QString const &modelCatalogue)
Slot which is used to scan the model catalogue file for available vehicle models. Updates the selection of the corresponding combo box (in AgentMapView). More...
void | setSystem (QString const &system)
Slot triggered by the AgentMapView::selectedSystem signal. First extracts Id and title of the given system list entry. Then, performs an undoable assignment of the system to the currently edited agent profile. More...
void | setSystemConfig ()
Slot triggered by the AgentMapView::setSystemConfig signal. Opens a file dialog for the user to select a system config XML file. After a non-empty selection has been made, an undoable set-operation on the system config of the currently edited agent profile ist performed. The system config is thereby set to the one selected by the user and the view is updated accordingly. More...
void | setSystemItems (QString const &systemConfig)
Slot which is used to scan the given system config for available systems. Updates the selection of the corresponding combo box (in AgentMapView). More...

Public Member Functions

void | updateAgentSelectionItems ()
Method which updates the combo box list of available agent profiles to the ones currently defined in the model data (AgentMapInterface).
void | updateView ()
Method which updates the complete view (AgentMapView) according to the model data of the current agent profile.

Private Slots

void | addAgent (QString const &name)
Slot triggered by the AgentMapView::add signal. Performs an undoable add-operation on the agent profiles map. Sets the newly created agent profile as the currently edited agent profile and updates the view accordingly. More...
void | addDriverProfile ()
Slot triggered by the AgentMapView::addDriverProfile signal. Performs an undoable add-operation on the table of driver profiles (DriverProfilesMapPresenter) of the current agent profile. The default selection of the driver profile is the first profile that has not been already added to the current agent profile. More...
void | addVehicleProfile ()
Slot triggered by the AgentMapView::addVehicleProfile signal. Performs an undoable add-operation on the table of vehicle profiles (VehicleProfilesMapPresenter) of the current agent profile. The default selection of the vehicle profile is the first profile that has not been already added to the current agent profile. More...
void | checkDriverProbabilities ()
Slot triggered by the DriverProfilesMapPresenter::checkProbabilities signal. Calculates the probability sum of the driver profiles' assigned to the currently edited agent profile. Displays an error message if probability sum unequals 1. More...
void | checkVehicleProbabilities ()
Slot triggered by the VehicleProfilesMapPresenter::checkProbabilities signal. Calculates the probability sum of the vehicle profiles' assigned to the currently edited agent profile. Displays an error message if probability sum unequals 1. More...
void | editAgent (QString const &oldName, QString const &newName)
Slot triggered by the AgentMapView::modifiedName signal. Performs an undoable rename-operation on the name of the currently edited agent profile. More...
void | removeAgent (QString const &name)
Slot triggered by the AgentMapView::remove signal. Performs an undoable remove-operation on the agent profiles map removing the currently selected agent profile. If the list of available profiles is not empty, it sets the currently edited profile to the first entry of the list. More...
void | removeDriverProfile (const int &row)
Slot triggered by the AgentMapView::removeDriverProfile signal. Performs an undoable remove-operation on given row of the driver profiles' table (DriverProfilesMapPresenter) of the current agent profile. More...
void | removeVehicleProfile (const int &row)
Slot triggered by the AgentMapView::removeVehicleProfile signal. Performs an undoable remove-operation on given row of the vehicle profiles' table (VehicleProfilesMapPresenter) of the current agent profile. More...
void | setCurrentAgent (const QString &name)
Slot triggered by the AgentMapView::selectionChanged signal. Performs an undoable set-operation on the currently edited agent profile setting it to the transmitted profile. Updates the view accordingly. More...
void | setType (const QString &type)
Slot triggered by the AgentMapView::typeChanged signal. Performs an undoable set-operation on the type ("static" or "dynamic") of the currently edited agent profile and updates the view accordingly. More...
void | updateDriverSelectionItems ()
Slot triggered by the DriverProfileMapInterface::added, DriverProfileMapInterface::removed and DriverProfileMapInterface::modifiedName signals. Updates the list of the driver profiles' combo box (in AgentMapView) according to changes made in the corresponding driver profile model data. More...
void | updateVehicleSelectionItems ()
Slot triggered by the VehicleProfileMapInterface::added, VehicleProfileMapInterface::removed and VehicleProfileMapInterface::modifiedName signals. Updates the list of the vehicle profiles' combo box (in AgentMapView) according to changes made in the corresponding vehicle profile model data. More...

Private Member Functions

AgentItemInterface::DriverProfile findUnusedDriverProfile ()
Method which scans the driver profiles map (DriverProfileMapInterface) for the first entry which is not already assigned to the currently edited agent profile yet. This method is used in addDriverProfile for the default selection after a driver profile has been added. Returns an empty name, if no unused driver profile could be found. More...
AgentItemInterface::VehicleProfile findUnusedVehicleProfile ()
Method which scans the vehicle profiles map (VehicleProfileMapInterface) for the first entry which is not already assigned to the currently edited agent profile yet. This method is used in addVehicleProfile for the default selection after a vehicle profile has been added. Returns an empty name, if no unused vehicle profile could be found. More...
void | setupDriverProfilesMap ()
Method which is called by the constructor. Instantiates and sets up the presenter object (DriverProfilesMapPresenter) of the table view for the driver profiles assigned to the current agent profile. Follows the concept of Qt's Model/View concept, in particular for implementing tables.
void | setupVehicleProfilesMap ()
Method which is called by the constructor. Instantiates and sets up the presenter object (VehicleProfilesMapPresenter) of the table view for the vehicle profiles assigned to the current agent profile. Follows the concept of Qt's Model/View concept, in particular for implementing tables.

Private Attributes

AgentMapInterface *const | agents
the pointer to the map of agent profiles (edited by this presenter)
AgentMapView *const | agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles' map
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
DriverProfileMapInterface *const | driverProfiles
the pointer to the driver profiles' map
QList< QString > * | driverProfilesList
a pointer to a list of driver profiles containing all profiles registered in DriverProfileMapInterface
DriverProfilesMapPresenter * driverProfilesMap
the pointer to the presenter object of the table for assigning driver profiles to the current agent profile
QList< QString > | modelList
a list of all vehicle models available in the currently selected vehicle model catalogue
ProjectInterface *const | project
the pointer to the project interface for accessing the path settings
QList< QString > | systemList
a list of all systems available in the currently selected system config
QUndoStack *const | undoStack
the pointer to the undo stack
VehicleProfileMapInterface *const | vehicleProfiles
the pointer to the vehicle profiles' map
QList< QString > * | vehicleProfilesList
a pointer to a list of vehicle profiles containing all profiles registered in VehicleProfileMapInterface
VehicleProfilesMapPresenter * vehicleProfilesMap
the pointer to the presenter object of the table for assigning vehicle profiles to the current agent profile

Static Private Attributes

static double default_probability = 0.5
a default probability

Friends

class AgentConfigurationPresenter

Detailed Description

The AgentMapPresenter class handles user events from the view (AgentMapView) and edits the model data (AgentMapInterface) accordingly. Since all actions performed on the model data (i.e. the *.ui file) should be undoable, the presenter instantiates the corresponding undo-commands and pushes them onto the undo stack. The actual operation on the model is then performed in these command object using the re-implementations of the undo/redo methods. See Qt's undo framework for further details.

Definition at line 54 of file AgentMapPresenter.h.

Member Function Documentation

◆ addAgent

void AgentMapPresenter::addAgent ( QString const & name )
privateslot

Slot triggered by the AgentMapView::add signal. Performs an undoable add-operation on the agent profiles map. Sets the newly created agent profile as the currently edited agent profile and updates the view accordingly.

Parameters
[in] name the name of the new agent profile

Definition at line 118 of file AgentMapPresenter.cpp.

119 {
120 undoStack->beginMacro(QString("added agent profile %1").arg(name));
121
122 undoStack->push(new AgentProfileCommands::AddAgentProfile(agents, agentsView, name));
123 undoStack->push(new AgentProfileCommands::SetCurrentAgent(agents, &currentAgent, name, vehicleProfilesMap, driverProfilesMap,this));
124
125 undoStack->endMacro();
126 }
AgentMapPresenter::vehicleProfilesMap
VehicleProfilesMapPresenter * vehicleProfilesMap
the pointer to the presenter object of the table for assigning vehicle profiles to the current agent ...
Definition: AgentMapPresenter.h:352
AgentProfileCommands::AddAgentProfile
This class defines the command for undoable add-operations on the map of agent profiles (AgentMapInte...
Definition: AgentMapPresenter.h:408
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentProfileCommands::SetCurrentAgent
This class defines the command for undoable set-operations on the currently selected agent profile...
Definition: AgentMapPresenter.h:375
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentMapPresenter::agents
AgentMapInterface *const agents
the pointer to the map of agent profiles (edited by this presenter)
Definition: AgentMapPresenter.h:345
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentMapPresenter::driverProfilesMap
DriverProfilesMapPresenter * driverProfilesMap
the pointer to the presenter object of the table for assigning driver profiles to the current agent p...
Definition: AgentMapPresenter.h:353

◆ addDriverProfile

void AgentMapPresenter::addDriverProfile ( )
privateslot

Slot triggered by the AgentMapView::addDriverProfile signal. Performs an undoable add-operation on the table of driver profiles (DriverProfilesMapPresenter) of the current agent profile. The default selection of the driver profile is the first profile that has not been already added to the current agent profile.

Note
this slot is only used for dynamic agent profiles

Definition at line 205 of file AgentMapPresenter.cpp.

206 {
207 AgentItemInterface::DriverProfile profile = findUnusedDriverProfile();
208
209 if( !driverProfilesList->isEmpty() && !profile.isEmpty() )
210 undoStack->push(new AgentProfileCommands::AddDriverProfile(driverProfilesMap, profile, default_probability));
211 }
AgentItemInterface::DriverProfile
QString DriverProfile
the nome of a driver profile
Definition: AgentItemInterface.h:60
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentProfileCommands::AddDriverProfile
This class defines the command for undoable add-operations on the driver profiles table of the curren...
Definition: AgentMapPresenter.h:620
AgentMapPresenter::findUnusedDriverProfile
AgentItemInterface::DriverProfile findUnusedDriverProfile()
Method which scans the driver profiles map (DriverProfileMapInterface) for the first entry which is n...
Definition: AgentMapPresenter.cpp:170
AgentMapPresenter::driverProfilesMap
DriverProfilesMapPresenter * driverProfilesMap
the pointer to the presenter object of the table for assigning driver profiles to the current agent p...
Definition: AgentMapPresenter.h:353
AgentMapPresenter::driverProfilesList
QList< QString > * driverProfilesList
a pointer to a list of driver profiles containing all profiles registered in DriverProfileMapInterfac...
Definition: AgentMapPresenter.h:361
AgentMapPresenter::default_probability
static double default_probability
a default probability
Definition: AgentMapPresenter.h:364

◆ addVehicleProfile

void AgentMapPresenter::addVehicleProfile ( )
privateslot

Slot triggered by the AgentMapView::addVehicleProfile signal. Performs an undoable add-operation on the table of vehicle profiles (VehicleProfilesMapPresenter) of the current agent profile. The default selection of the vehicle profile is the first profile that has not been already added to the current agent profile.

Note
this slot is only used for dynamic agent profiles

Definition at line 151 of file AgentMapPresenter.cpp.

152 {
153 AgentItemInterface::VehicleProfile profile = findUnusedVehicleProfile();
154
155 if( !vehicleProfilesList->isEmpty() && !profile.isEmpty() )
156 undoStack->push(new AgentProfileCommands::AddVehicleProfile(vehicleProfilesMap, profile, default_probability));
157 }
AgentMapPresenter::vehicleProfilesMap
VehicleProfilesMapPresenter * vehicleProfilesMap
the pointer to the presenter object of the table for assigning vehicle profiles to the current agent ...
Definition: AgentMapPresenter.h:352
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentItemInterface::VehicleProfile
QString VehicleProfile
the name of a vehicle profile
Definition: AgentItemInterface.h:56
AgentMapPresenter::findUnusedVehicleProfile
AgentItemInterface::VehicleProfile findUnusedVehicleProfile()
Method which scans the vehicle profiles map (VehicleProfileMapInterface) for the first entry which is...
Definition: AgentMapPresenter.cpp:159
AgentProfileCommands::AddVehicleProfile
This class defines the command for undoable add-operations on the vehicle profiles table of the curre...
Definition: AgentMapPresenter.h:670
AgentMapPresenter::vehicleProfilesList
QList< QString > * vehicleProfilesList
a pointer to a list of vehicle profiles containing all profiles registered in VehicleProfileMapInterf...
Definition: AgentMapPresenter.h:360
AgentMapPresenter::default_probability
static double default_probability
a default probability
Definition: AgentMapPresenter.h:364

◆ checkDriverProbabilities

void AgentMapPresenter::checkDriverProbabilities ( )
privateslot

Slot triggered by the DriverProfilesMapPresenter::checkProbabilities signal. Calculates the probability sum of the driver profiles' assigned to the currently edited agent profile. Displays an error message if probability sum unequals 1.

Note
this slot is only used for dynamic agent profiles

Definition at line 225 of file AgentMapPresenter.cpp.

226 {
227 if(currentAgent)
228 {
229 double sum = 0;
230 for(auto probability : currentAgent->getDriverProfiles()->values())
231 sum += probability;
232
233 agentsView->setDriverProbabilityError(sum!=1.0 && !currentAgent->getDriverProfiles()->isEmpty());
234 }
235 }
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentMapView::setDriverProbabilityError
void setDriverProbabilityError(bool error)
Method puts a probability error message above the driver profiles&#39; table if given error flag is "true...
Definition: AgentMapView.cpp:293
AgentItemInterface::getDriverProfiles
virtual DriverProfiles * getDriverProfiles() const =0
Method which returns a pointer to the map of driver profiles, i.e. the mapping of driver profiles to ...

◆ checkVehicleProbabilities

void AgentMapPresenter::checkVehicleProbabilities ( )
privateslot

Slot triggered by the VehicleProfilesMapPresenter::checkProbabilities signal. Calculates the probability sum of the vehicle profiles' assigned to the currently edited agent profile. Displays an error message if probability sum unequals 1.

Note
this slot is only used for dynamic agent profiles

Definition at line 193 of file AgentMapPresenter.cpp.

194 {
195 if(currentAgent)
196 {
197 double sum = 0;
198 for(auto probability : currentAgent->getVehicleProfiles()->values())
199 sum += probability;
200
201 agentsView->setVehicleProbabilityError(sum!=1.0 && !currentAgent->getVehicleProfiles()->isEmpty());
202 }
203 }
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentMapView::setVehicleProbabilityError
void setVehicleProbabilityError(bool error)
Method puts a probability error message above the vehicle profiles&#39; table if given error flag is "tru...
Definition: AgentMapView.cpp:302
AgentItemInterface::getVehicleProfiles
virtual VehicleProfiles * getVehicleProfiles() const =0
Method which returns a pointer to the map of vehicle profiles, i.e. the mapping of vehicle profiles t...

◆ editAgent

void AgentMapPresenter::editAgent | ( | QString const & | oldName,
 |  | QString const & | newName
 | ) |  |
privateslot

Slot triggered by the AgentMapView::modifiedName signal. Performs an undoable rename-operation on the name of the currently edited agent profile.

Parameters
[in] | oldName | the old name of the agent profile
[in] | newName | the new name of the agent profile

Definition at line 145 of file AgentMapPresenter.cpp.

146 {
147 if(!agents->keys().contains(newName))
148 undoStack->push(new AgentProfileCommands::EditAgentProfile(agents, agentsView, oldName, newName));
149 }
AgentProfileCommands::EditAgentProfile
This class defines the command for undoable renaming-operations on the map of agent profiles (AgentMa...
Definition: AgentMapPresenter.h:455
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentMapPresenter::agents
AgentMapInterface *const agents
the pointer to the map of agent profiles (edited by this presenter)
Definition: AgentMapPresenter.h:345
AgentMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all agent profile names in the map.

◆ findUnusedDriverProfile()

AgentItemInterface::VehicleProfile AgentMapPresenter::findUnusedDriverProfile ( )
private

Method which scans the driver profiles map (DriverProfileMapInterface) for the first entry which is not already assigned to the currently edited agent profile yet. This method is used in addDriverProfile for the default selection after a driver profile has been added. Returns an empty name, if no unused driver profile could be found.

Returns
the first driver profile being not assigned to the current agent profile

Definition at line 170 of file AgentMapPresenter.cpp.

171 {
172 for( auto profile : *driverProfilesList)
173 {
174 if ( !currentAgent->getDriverProfiles()->contains(profile) )
175 return profile;
176 }
177
178 return AgentItemInterface::DriverProfile();
179 }
AgentItemInterface::DriverProfile
QString DriverProfile
the nome of a driver profile
Definition: AgentItemInterface.h:60
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentMapPresenter::driverProfilesList
QList< QString > * driverProfilesList
a pointer to a list of driver profiles containing all profiles registered in DriverProfileMapInterfac...
Definition: AgentMapPresenter.h:361
AgentItemInterface::getDriverProfiles
virtual DriverProfiles * getDriverProfiles() const =0
Method which returns a pointer to the map of driver profiles, i.e. the mapping of driver profiles to ...

◆ findUnusedVehicleProfile()

AgentItemInterface::VehicleProfile AgentMapPresenter::findUnusedVehicleProfile ( )
private

Method which scans the vehicle profiles map (VehicleProfileMapInterface) for the first entry which is not already assigned to the currently edited agent profile yet. This method is used in addVehicleProfile for the default selection after a vehicle profile has been added. Returns an empty name, if no unused vehicle profile could be found.

Returns
the first vehicle profile being not assigned to the current agent profile

Definition at line 159 of file AgentMapPresenter.cpp.

160 {
161 for( auto profile : *vehicleProfilesList)
162 {
163 if ( !currentAgent->getVehicleProfiles()->contains(profile) )
164 return profile;
165 }
166
167 return AgentItemInterface::VehicleProfile();
168 }
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentItemInterface::VehicleProfile
QString VehicleProfile
the name of a vehicle profile
Definition: AgentItemInterface.h:56
AgentItemInterface::getVehicleProfiles
virtual VehicleProfiles * getVehicleProfiles() const =0
Method which returns a pointer to the map of vehicle profiles, i.e. the mapping of vehicle profiles t...
AgentMapPresenter::vehicleProfilesList
QList< QString > * vehicleProfilesList
a pointer to a list of vehicle profiles containing all profiles registered in VehicleProfileMapInterf...
Definition: AgentMapPresenter.h:360

◆ refreshModelCatalogue

void AgentMapPresenter::refreshModelCatalogue ( )
slot

Slot triggered by the AgentMapView::refreshModelCatalogue and ProjectInterface::update signals. Re-loads the currently selected vehicle model catalogue and updates the view accordingly. In particular, this method can be used to update GUI error messages after the file(path) has been edited by the user.

Note
this slot is only used for static agent profiles

Definition at line 420 of file AgentMapPresenter.cpp.

421 {
422 if(currentAgent)
423 {
424 QString modelCatalogue = currentAgent->getVehicleModelCatalogue();
425 setModelItems(modelCatalogue);
426 agentsView->setModelCatalogueError("");
427
428 if(modelCatalogue.isEmpty())
429 return;
430
431 if(!QFileInfo::exists(project->absoluteToConfigPath(modelCatalogue)))
432 {
433 agentsView->setModelCatalogueError("Model catalogue not accessible! Check configuration path in Project plugin.");
434 agentsView->enableModelView(false);
435 return;
436 }
437
438 if(modelList.contains(currentAgent->getVehicleModel()))
439 {
440 agentsView->enableModelView(true);
441 agentsView->setCurrentModel(currentAgent->getVehicleModel());
442 }
443 else if(!currentAgent->getVehicleModel().isEmpty()){
444 agentsView->setModelCatalogueError("Model does not exist in model catalogue!");
445 agentsView->enableModelView(false);
446 }
447 }
448 }
AgentItemInterface::getVehicleModelCatalogue
virtual VehicleModelCatalogue getVehicleModelCatalogue() const =0
Method which returns the current vehicle model catalogue (for static agent profiles).
AgentItemInterface::getVehicleModel
virtual VehicleModel getVehicleModel() const =0
Method which returns the currently selected vehicle profile (for static agent profiles).
AgentMapPresenter::modelList
QList< QString > modelList
a list of all vehicle models available in the currently selected vehicle model catalogue ...
Definition: AgentMapPresenter.h:363
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentMapView::setCurrentModel
void setCurrentModel(const QString &model)
Method which the sets the vehicle model currently displayed by the vehicle models&#39; drop down menu to ...
Definition: AgentMapView.cpp:258
AgentMapPresenter::setModelItems
void setModelItems(QString const &modelCatalogue)
Slot which is used to scan the model catalogue file for available vehicle models. Updates the selecti...
Definition: AgentMapPresenter.cpp:451
AgentMapView::enableModelView
void enableModelView(bool enable)
Method which enables or disables the drop down menu for vehicle models (for static agent profiles)...
Definition: AgentMapView.cpp:41
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentMapPresenter::project
ProjectInterface *const project
the pointer to the project interface for accessing the path settings
Definition: AgentMapPresenter.h:356
AgentMapView::setModelCatalogueError
void setModelCatalogueError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for editing the veh...
Definition: AgentMapView.cpp:288

◆ refreshSystemConfig

void AgentMapPresenter::refreshSystemConfig ( )
slot

Slot triggered by the AgentMapView::refreshSystemConfig and ProjectInterface::update signals. Re-loads the currently selected system config XML file and updates the view accordingly. In particular, this method can be used to update GUI error messages after the file(path) has been edited by the user.

Note
this slot is only used for static agent profiles

Definition at line 316 of file AgentMapPresenter.cpp.

317 {
318 if(currentAgent)
319 {
320 QString systemConfig = currentAgent->getSystemConfig();
321 setSystemItems(systemConfig);
322
323 agentsView->setSystemConfigError("");
324
325 if(systemConfig.isEmpty())
326 return;
327
328 if(!QFileInfo::exists(project->absoluteToConfigPath(systemConfig)))
329 {
330 agentsView->setSystemConfigError("System config not accessible! Check configuration path in Project plugin.");
331 agentsView->enableSystemView(false);
332 return;
333 }
334
335 QString currentSystem = currentAgent->getSystemTitle()
336 + QString(" (ID: %1)").arg(currentAgent->getSystemID());
337
338 if(systemList.contains(currentSystem))
339 {
340 agentsView->enableSystemView(true);
341 agentsView->setCurrentSystem(currentSystem);
342 }
343 else if(!currentAgent->getSystemTitle().isEmpty()){
344 agentsView->setSystemConfigError("System does not exist in system config!");
345 agentsView->enableSystemView(false);
346 }
347 }
348 }
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentItemInterface::getSystemTitle
virtual SystemTitle getSystemTitle() const =0
Method which returns the title of the currently selected system (for static agent profiles)...
AgentMapPresenter::setSystemItems
void setSystemItems(QString const &systemConfig)
Slot which is used to scan the given system config for available systems. Updates the selection of th...
Definition: AgentMapPresenter.cpp:350
AgentMapView::setCurrentSystem
void setCurrentSystem(const QString &system)
Method which the sets the system currently displayed by the systems&#39; drop down menu to the one passed...
Definition: AgentMapView.cpp:223
AgentItemInterface::getSystemID
virtual SystemID getSystemID() const =0
Method which returns the id of the currently selected system (for static agent profiles).
AgentItemInterface::getSystemConfig
virtual SystemConfig getSystemConfig() const =0
Method which returns the current system config file (for static agent profiles).
AgentMapPresenter::project
ProjectInterface *const project
the pointer to the project interface for accessing the path settings
Definition: AgentMapPresenter.h:356
AgentMapView::enableSystemView
void enableSystemView(bool enable)
Method which enables or disables the drop down menu for systems (for static agent profiles)...
Definition: AgentMapView.cpp:46
AgentMapPresenter::systemList
QList< QString > systemList
a list of all systems available in the currently selected system config
Definition: AgentMapPresenter.h:362
AgentMapView::setSystemConfigError
void setSystemConfigError(QString const &message)
Method which displays the given error message (red color) next to the GUI element for the system conf...
Definition: AgentMapView.cpp:283

◆ removeAgent

void AgentMapPresenter::removeAgent ( QString const & name )
privateslot

Slot triggered by the AgentMapView::remove signal. Performs an undoable remove-operation on the agent profiles map removing the currently selected agent profile. If the list of available profiles is not empty, it sets the currently edited profile to the first entry of the list.

Parameters
[in] name the name of the agent profile to be removed

Definition at line 129 of file AgentMapPresenter.cpp.

130 {
131 if(currentAgent && currentAgent->getName() == name)
132 {
133 QList<AgentItemInterface::Name> agentList = agents->keys();
134 agentList.removeAll(name);
135 AgentItemInterface::Name agentName = agentList.isEmpty() ? "" : agentList.first();
136
137 undoStack->beginMacro(QString("removed agent profile %1").arg(name));
138 undoStack->push(new AgentProfileCommands::SetCurrentAgent(agents, &currentAgent,agentName , vehicleProfilesMap, driverProfilesMap, this));
139 undoStack->push(new AgentProfileCommands::RemoveAgentProfile(agents, agentsView, name));
140 undoStack->endMacro();
141 }
142 }
AgentMapPresenter::vehicleProfilesMap
VehicleProfilesMapPresenter * vehicleProfilesMap
the pointer to the presenter object of the table for assigning vehicle profiles to the current agent ...
Definition: AgentMapPresenter.h:352
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentProfileCommands::SetCurrentAgent
This class defines the command for undoable set-operations on the currently selected agent profile...
Definition: AgentMapPresenter.h:375
AgentItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profi...
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentMapPresenter::agents
AgentMapInterface *const agents
the pointer to the map of agent profiles (edited by this presenter)
Definition: AgentMapPresenter.h:345
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentProfileCommands::RemoveAgentProfile
This class defines the command for undoable remove-operations on the map of agent profiles (AgentMapI...
Definition: AgentMapPresenter.h:430
AgentItemInterface::Name
QString Name
the name of the agent profiles
Definition: AgentItemInterface.h:43
AgentMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all agent profile names in the map.
AgentMapPresenter::driverProfilesMap
DriverProfilesMapPresenter * driverProfilesMap
the pointer to the presenter object of the table for assigning driver profiles to the current agent p...
Definition: AgentMapPresenter.h:353

◆ removeDriverProfile

void AgentMapPresenter::removeDriverProfile ( const int & row )
privateslot

Slot triggered by the AgentMapView::removeDriverProfile signal. Performs an undoable remove-operation on given row of the driver profiles' table (DriverProfilesMapPresenter) of the current agent profile.

Note
this slot is only used for dynamic agent profiles
Parameters
[in] row the row to be removed from the driver profiles' table

Definition at line 213 of file AgentMapPresenter.cpp.

214 {
215 if(driverProfilesMap->rowCount() !=0)
216 undoStack->push(new AgentProfileCommands::RemoveDriverProfile(driverProfilesMap, row));
217 }
DriverProfilesMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: DriverProfilesMapPresenter.cpp:32
AgentProfileCommands::RemoveDriverProfile
This class defines the command for undoable remove-operations on the driver profiles table of the cur...
Definition: AgentMapPresenter.h:645
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentMapPresenter::driverProfilesMap
DriverProfilesMapPresenter * driverProfilesMap
the pointer to the presenter object of the table for assigning driver profiles to the current agent p...
Definition: AgentMapPresenter.h:353

◆ removeVehicleProfile

void AgentMapPresenter::removeVehicleProfile ( const int & row )
privateslot

Slot triggered by the AgentMapView::removeVehicleProfile signal. Performs an undoable remove-operation on given row of the vehicle profiles' table (VehicleProfilesMapPresenter) of the current agent profile.

Note
this slot is only used for dynamic agent profiles
Parameters
[in] row the row to be removed from the vehicle profiles' table

Definition at line 181 of file AgentMapPresenter.cpp.

182 {
183 if(vehicleProfilesMap->rowCount() !=0)
184 undoStack->push(new AgentProfileCommands::RemoveVehicleProfile(vehicleProfilesMap, row));
185 }
AgentMapPresenter::vehicleProfilesMap
VehicleProfilesMapPresenter * vehicleProfilesMap
the pointer to the presenter object of the table for assigning vehicle profiles to the current agent ...
Definition: AgentMapPresenter.h:352
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
VehicleProfilesMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: VehicleProfilesMapPresenter.cpp:32
AgentProfileCommands::RemoveVehicleProfile
This class defines the command for undoable remove-operations on the vehicle profiles table of the cu...
Definition: AgentMapPresenter.h:695

◆ setCurrentAgent

void AgentMapPresenter::setCurrentAgent ( const QString & name )
privateslot

Slot triggered by the AgentMapView::selectionChanged signal. Performs an undoable set-operation on the currently edited agent profile setting it to the transmitted profile. Updates the view accordingly.

Parameters
[in] name the agent profile which should be currently edited

Definition at line 106 of file AgentMapPresenter.cpp.

107 {
108
109 if(currentAgent && currentAgent->getName() != name)
110 undoStack->push(new AgentProfileCommands::SetCurrentAgent(agents, &currentAgent,name, vehicleProfilesMap, driverProfilesMap, this));
111 }
AgentMapPresenter::vehicleProfilesMap
VehicleProfilesMapPresenter * vehicleProfilesMap
the pointer to the presenter object of the table for assigning vehicle profiles to the current agent ...
Definition: AgentMapPresenter.h:352
AgentProfileCommands::SetCurrentAgent
This class defines the command for undoable set-operations on the currently selected agent profile...
Definition: AgentMapPresenter.h:375
AgentItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profi...
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentMapPresenter::agents
AgentMapInterface *const agents
the pointer to the map of agent profiles (edited by this presenter)
Definition: AgentMapPresenter.h:345
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentMapPresenter::driverProfilesMap
DriverProfilesMapPresenter * driverProfilesMap
the pointer to the presenter object of the table for assigning driver profiles to the current agent p...
Definition: AgentMapPresenter.h:353

◆ setModel

void AgentMapPresenter::setModel ( QString const & model )
slot

Slot triggered by the AgentMapView::setModel signal. Performs an undoable assignment of the given vehicle model to the currently edited agent profile.

Note
this slot is only used for static agent profiles
Parameters
[in] model the vehicle model to be assigned

Definition at line 390 of file AgentMapPresenter.cpp.

391 {
392 if(currentAgent)
393 undoStack->push(new AgentProfileCommands::EditAgentModel(agents, agentsView, currentAgent->getName(), model));
394 }
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profi...
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentMapPresenter::agents
AgentMapInterface *const agents
the pointer to the map of agent profiles (edited by this presenter)
Definition: AgentMapPresenter.h:345
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentProfileCommands::EditAgentModel
This class defines the command for undoable set-operations on the vehicle model of the currently edit...
Definition: AgentMapPresenter.h:594

◆ setModelCatalogue

void AgentMapPresenter::setModelCatalogue ( )
slot

Slot triggered by the AgentMapView::setModelCatalogue signal. Opens a file dialog for the user to select a vehicle model catalogue file. After a non-empty selection has been made, an undoable set-operation for the model catalogue of the currently edited agent profile ist performed. The model catalogue is thereby set to the one selected by the user and the view is updated accordingly.

Note
this slot is only used for static agent profiles

Definition at line 396 of file AgentMapPresenter.cpp.

397 {
398 QString const filepath = QFileDialog::getOpenFileName(
399 agentsView, QObject::tr("openPASS / Choose Vehicle Model Catalogue"),
400 project->getConfigPath(), QStringLiteral("VehicleModelCatalogue (*.xosc)"));
401
402 AgentItemInterface::VehicleModelCatalogue modelCatalogue = project->relativeToConfigPath(filepath);
403
404 if(currentAgent && !filepath.isEmpty())
405 {
406 AgentItemInterface::VehicleModelCatalogue oldModelCatalogue = currentAgent->getVehicleModelCatalogue();
407
408 undoStack->beginMacro(QString("edited vehicle model catalogue of agent profile %1").arg(currentAgent->getName()));
409
410 undoStack->push(new AgentProfileCommands::EditAgentModelCatalogue(agents, agentsView, this, currentAgent->getName(), modelCatalogue));
411
412 if(modelCatalogue!=oldModelCatalogue && !modelList.isEmpty())
413 undoStack->push(new AgentProfileCommands::EditAgentModel(agents, agentsView, currentAgent->getName(), modelList.last()));
414
415 undoStack->endMacro();
416 }
417
418 }
AgentItemInterface::getVehicleModelCatalogue
virtual VehicleModelCatalogue getVehicleModelCatalogue() const =0
Method which returns the current vehicle model catalogue (for static agent profiles).
AgentMapPresenter::modelList
QList< QString > modelList
a list of all vehicle models available in the currently selected vehicle model catalogue ...
Definition: AgentMapPresenter.h:363
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profi...
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentMapPresenter::agents
AgentMapInterface *const agents
the pointer to the map of agent profiles (edited by this presenter)
Definition: AgentMapPresenter.h:345
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentItemInterface::VehicleModelCatalogue
QString VehicleModelCatalogue
the vehicle model catalogue file
Definition: AgentItemInterface.h:52
AgentProfileCommands::EditAgentModelCatalogue
This class defines the command for undoable set-operations on the vehicle model catalogue of the curr...
Definition: AgentMapPresenter.h:566
AgentMapPresenter::project
ProjectInterface *const project
the pointer to the project interface for accessing the path settings
Definition: AgentMapPresenter.h:356
AgentProfileCommands::EditAgentModel
This class defines the command for undoable set-operations on the vehicle model of the currently edit...
Definition: AgentMapPresenter.h:594

◆ setModelItems

void AgentMapPresenter::setModelItems ( QString const & modelCatalogue )
slot

Slot which is used to scan the model catalogue file for available vehicle models. Updates the selection of the corresponding combo box (in AgentMapView).

Note
this slot is only used for static agent profiles
Parameters
[in] modelCatalogue the model catalogue to be parsed

Definition at line 451 of file AgentMapPresenter.cpp.

452 {
453 QString path = project->absoluteToConfigPath(modelCatalogue);
454 QFile file(path);
455
456 modelList.clear();
457
458 if(file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text) )
459 {
460
461 QXmlStreamReader xml(&file);
462 xml.readNextStartElement();
463
464 while( xml.readNextStartElement() )
465 {
466 if(xml.name() == QString("Catalog"))
467 {
468 while( xml.readNextStartElement() )
469 {
470 if(xml.name() == QString("Vehicle"))
471 {
472 modelList << xml.attributes().value("name").toString();
473 xml.skipCurrentElement();
474 }
475 else
476 xml.skipCurrentElement();
477 }
478 }
479 else
480 xml.skipCurrentElement();
481 }
482 }
483 agentsView->setModelSelectionItems(modelList);
484 }
AgentMapPresenter::modelList
QList< QString > modelList
a list of all vehicle models available in the currently selected vehicle model catalogue ...
Definition: AgentMapPresenter.h:363
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentMapView::setModelSelectionItems
void setModelSelectionItems(const QStringList &modelItems)
Method which the sets the vehicle models&#39; selection list (drop down menu) to the one passed as an arg...
Definition: AgentMapView.cpp:264
AgentMapPresenter::project
ProjectInterface *const project
the pointer to the project interface for accessing the path settings
Definition: AgentMapPresenter.h:356

◆ setSystem

void AgentMapPresenter::setSystem ( QString const & system )
slot

Slot triggered by the AgentMapView::selectedSystem signal. First extracts Id and title of the given system list entry. Then, performs an undoable assignment of the system to the currently edited agent profile.

Note
this slot is only used for static agent profiles
Parameters
[in] system the list description of the system to be assigned to the current agent profile

Definition at line 280 of file AgentMapPresenter.cpp.

281 {
282 // construct the system title
283 QString title = system.section(" (ID: ",0,0);
284
285 // construct the system ID
286 QString ID = system.section(" (ID: ",1,1);
287
288 // to remove the ")" at the end
289 ID.chop(1);
290
291 undoStack->push(new AgentProfileCommands::EditAgentSystem(agents, agentsView, currentAgent->getName(), title, ID.toUInt()));
292 }
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profi...
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentMapPresenter::agents
AgentMapInterface *const agents
the pointer to the map of agent profiles (edited by this presenter)
Definition: AgentMapPresenter.h:345
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentProfileCommands::EditAgentSystem
This class defines the command for undoable set-operations on the system of the currently edited agen...
Definition: AgentMapPresenter.h:535

◆ setSystemConfig

void AgentMapPresenter::setSystemConfig ( )
slot

Slot triggered by the AgentMapView::setSystemConfig signal. Opens a file dialog for the user to select a system config XML file. After a non-empty selection has been made, an undoable set-operation on the system config of the currently edited agent profile ist performed. The system config is thereby set to the one selected by the user and the view is updated accordingly.

Note
this slot is only used for static agent profiles

Definition at line 294 of file AgentMapPresenter.cpp.

295 {
296 QString const filepath = QFileDialog::getOpenFileName(agentsView, QObject::tr("openPASS / Choose system configuration file"),
297 project->getConfigPath(), QStringLiteral("systemConfig (*.xml)") );
298
299 AgentItemInterface::SystemConfig systemConfig = project->relativeToConfigPath(filepath);
300
301 if(currentAgent && !filepath.isEmpty())
302 {
303 AgentItemInterface::SystemConfig oldSystemConfig = currentAgent->getSystemConfig();
304
305 undoStack->beginMacro(QString("edited system config of agent profile %1").arg(currentAgent->getName()));
306
307 undoStack->push(new AgentProfileCommands::EditAgentSystemConfig(agents, agentsView, this, currentAgent->getName(), systemConfig));
308
309 if(systemConfig != oldSystemConfig && !systemList.isEmpty())
310 setSystem(systemList.last());
311
312 undoStack->endMacro();
313 }
314 }
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profi...
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentMapPresenter::agents
AgentMapInterface *const agents
the pointer to the map of agent profiles (edited by this presenter)
Definition: AgentMapPresenter.h:345
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348
AgentItemInterface::getSystemConfig
virtual SystemConfig getSystemConfig() const =0
Method which returns the current system config file (for static agent profiles).
AgentMapPresenter::project
ProjectInterface *const project
the pointer to the project interface for accessing the path settings
Definition: AgentMapPresenter.h:356
AgentMapPresenter::setSystem
void setSystem(QString const &system)
Slot triggered by the AgentMapView::selectedSystem signal. First extracts Id and title of the given s...
Definition: AgentMapPresenter.cpp:280
AgentItemInterface::SystemConfig
QString SystemConfig
the system config file
Definition: AgentItemInterface.h:48
AgentProfileCommands::EditAgentSystemConfig
This class defines the command for undoable set-operations on the system config file of the currently...
Definition: AgentMapPresenter.h:506
AgentMapPresenter::systemList
QList< QString > systemList
a list of all systems available in the currently selected system config
Definition: AgentMapPresenter.h:362

◆ setSystemItems

void AgentMapPresenter::setSystemItems ( QString const & systemConfig )
slot

Slot which is used to scan the given system config for available systems. Updates the selection of the corresponding combo box (in AgentMapView).

Note
this slot is only used for static agent profiles
Parameters
[in] systemConfig the system config to be parsed

Definition at line 350 of file AgentMapPresenter.cpp.

351 {
352 unsigned int id = 0;
353 QString title;
354 QString path = project->absoluteToConfigPath(systemConfig);
355 QFile filepath(path);
356
357 systemList.clear();
358
359 if( filepath.exists() && filepath.open(QIODevice::ReadOnly | QIODevice::Text))
360 {
361
362 QXmlStreamReader xml(&filepath);
363 xml.readNextStartElement();
364 if(xml.name() == "systems")
365 {
366 while(xml.readNextStartElement())
367 {
368 if(xml.name() == "system")
369 {
370 while(xml.readNextStartElement())
371 {
372 if(xml.name() == "id")
373 id = xml.readElementText().toUInt();
374 else if( xml.name() == "title")
375 title = xml.readElementText();
376 else
377 xml.skipCurrentElement();
378 }
379 systemList << QString("%1 (ID: %2)").arg(title).arg(id);
380 }
381 else
382 xml.skipCurrentElement();
383 }
384 }
385 }
386
387 agentsView->setSystemSelectionItems(systemList);
388 }
AgentMapView::setSystemSelectionItems
void setSystemSelectionItems(const QStringList &systemItems)
Method which the sets the systems&#39; selection list (drop down menu) to the one passed as an argument...
Definition: AgentMapView.cpp:229
AgentMapPresenter::agentsView
AgentMapView *const agentsView
the pointer to the view handled by this presenter, i.e. the view of the agent profiles&#39; map ...
Definition: AgentMapPresenter.h:351
AgentMapPresenter::project
ProjectInterface *const project
the pointer to the project interface for accessing the path settings
Definition: AgentMapPresenter.h:356
AgentMapPresenter::systemList
QList< QString > systemList
a list of all systems available in the currently selected system config
Definition: AgentMapPresenter.h:362

◆ setType

void AgentMapPresenter::setType ( const QString & type )
privateslot

Slot triggered by the AgentMapView::typeChanged signal. Performs an undoable set-operation on the type ("static" or "dynamic") of the currently edited agent profile and updates the view accordingly.

Parameters
[in] type the new type of the currently edited profile

Definition at line 113 of file AgentMapPresenter.cpp.

114 {
115 undoStack->push(new AgentProfileCommands::EditAgentType(agents, currentAgent->getName(), type, this));
116 }
AgentProfileCommands::EditAgentType
This class defines the command for undoable set-operations on the type (static or dynamic) of an agen...
Definition: AgentMapPresenter.h:480
AgentItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this agent profile, i.e. the key identifier name of this agent profi...
AgentMapPresenter::undoStack
QUndoStack *const undoStack
the pointer to the undo stack
Definition: AgentMapPresenter.h:357
AgentMapPresenter::agents
AgentMapInterface *const agents
the pointer to the map of agent profiles (edited by this presenter)
Definition: AgentMapPresenter.h:345
AgentMapPresenter::currentAgent
AgentItemInterface * currentAgent
a pointer to the agent profile currently edited
Definition: AgentMapPresenter.h:348

◆ updateDriverSelectionItems

void AgentMapPresenter::updateDriverSelectionItems ( )
privateslot

Slot triggered by the DriverProfileMapInterface::added, DriverProfileMapInterface::removed and DriverProfileMapInterface::modifiedName signals. Updates the list of the driver profiles' combo box (in AgentMapView) according to changes made in the corresponding driver profile model data.

Note
this slot is only used for dynamic agent profiles

Definition at line 219 of file AgentMapPresenter.cpp.

220 {
221 driverProfilesList->clear();
222 driverProfilesList->append( driverProfiles->keys() );
223 }
DriverProfileMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all driver profile names in the map.
AgentMapPresenter::driverProfiles
DriverProfileMapInterface *const driverProfiles
the pointer to the driver profiles&#39; map
Definition: AgentMapPresenter.h:347
AgentMapPresenter::driverProfilesList
QList< QString > * driverProfilesList
a pointer to a list of driver profiles containing all profiles registered in DriverProfileMapInterfac...
Definition: AgentMapPresenter.h:361

◆ updateVehicleSelectionItems

void AgentMapPresenter::updateVehicleSelectionItems ( )
privateslot

Slot triggered by the VehicleProfileMapInterface::added, VehicleProfileMapInterface::removed and VehicleProfileMapInterface::modifiedName signals. Updates the list of the vehicle profiles' combo box (in AgentMapView) according to changes made in the corresponding vehicle profile model data.

Note
this slot is only used for dynamic agent profiles

Definition at line 187 of file AgentMapPresenter.cpp.

188 {
189 vehicleProfilesList->clear();
190 vehicleProfilesList->append( vehicleProfiles->keys() );
191 }
VehicleProfileMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all vehicle profile names in the map.
AgentMapPresenter::vehicleProfiles
VehicleProfileMapInterface *const vehicleProfiles
the pointer to the vehicle profiles&#39; map
Definition: AgentMapPresenter.h:346
AgentMapPresenter::vehicleProfilesList
QList< QString > * vehicleProfilesList
a pointer to a list of vehicle profiles containing all profiles registered in VehicleProfileMapInterf...
Definition: AgentMapPresenter.h:360
The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AgentMapPresenter Member List

This is the complete list of members for AgentMapPresenter, including all inherited members.

addAgent(QString const &name) | AgentMapPresenter | privateslot
addDriverProfile() | AgentMapPresenter | privateslot
addVehicleProfile() | AgentMapPresenter | privateslot
agents | AgentMapPresenter | private
agentsView | AgentMapPresenter | private
checkDriverProbabilities() | AgentMapPresenter | privateslot
checkVehicleProbabilities() | AgentMapPresenter | privateslot
currentAgent | AgentMapPresenter | private
default_probability | AgentMapPresenter | privatestatic
driverProfiles | AgentMapPresenter | private
driverProfilesList | AgentMapPresenter | private
driverProfilesMap | AgentMapPresenter | private
editAgent(QString const &oldName, QString const &newName) | AgentMapPresenter | privateslot
findUnusedDriverProfile() | AgentMapPresenter | private
findUnusedVehicleProfile() | AgentMapPresenter | private
modelList | AgentMapPresenter | private
project | AgentMapPresenter | private
refreshModelCatalogue() | AgentMapPresenter | slot
refreshSystemConfig() | AgentMapPresenter | slot
removeAgent(QString const &name) | AgentMapPresenter | privateslot
removeDriverProfile(const int &row) | AgentMapPresenter | privateslot
removeVehicleProfile(const int &row) | AgentMapPresenter | privateslot
setCurrentAgent(const QString &name) | AgentMapPresenter | privateslot
setModel(QString const &model) | AgentMapPresenter | slot
setModelCatalogue() | AgentMapPresenter | slot
setModelItems(QString const &modelCatalogue) | AgentMapPresenter | slot
setSystem(QString const &system) | AgentMapPresenter | slot
setSystemConfig() | AgentMapPresenter | slot
setSystemItems(QString const &systemConfig) | AgentMapPresenter | slot
setType(const QString &type) | AgentMapPresenter | privateslot
setupDriverProfilesMap() | AgentMapPresenter | private
setupVehicleProfilesMap() | AgentMapPresenter | private
systemList | AgentMapPresenter | private
undoStack | AgentMapPresenter | private
updateAgentSelectionItems() | AgentMapPresenter |
updateDriverSelectionItems() | AgentMapPresenter | privateslot
updateVehicleSelectionItems() | AgentMapPresenter | privateslot
updateView() | AgentMapPresenter |
vehicleProfiles | AgentMapPresenter | private
vehicleProfilesList | AgentMapPresenter | private
vehicleProfilesMap | AgentMapPresenter | private
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentMapView Class Reference

Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
AgentMapView Class Reference

This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu for selecting a profile to be edited as well as buttons for removing and adding agent profiles. Further, a menu for editing the type ("dynamic" or "static") is provided whose selection switches between two different views. If the type "dynamic" is selected, two tables for assigning driver and vehicle profiles with probabilities appear. If type "static" is selected, the view is reduced to a selection menu for a system config + system as well as a vehicle model catalogue + model. The switching between the two modes is realized via a stacked widget whose pages contain the GUI elements being exclusive for the selected mode. Further information on how to use this view can be found in the GUI tutorial. More...

Inheritance diagram for AgentMapView:
WidgetView

Signals

void | add (QString const &name)
Signal, emitted after the add-button for agent profiles has been clicked and a name for a new profile has been typed in. Transmits the name of the new agent profile. More...
void | addDriverProfile ()
Signal, emitted after add-button for driver profiles has been clicked by the user (only in "dynamic" mode).
void | addVehicleProfile ()
Signal, emitted after add-button for vehicle profiles has been clicked by the user (only in "dynamic" mode).
void | modifiedName (QString const &oldName, QString const &newName)
Signal, emitted after the rename-button has been pressed. Transmits the new name inserted by the user as well as the old name of the currently selected agent profile. More...
void | refreshModelCatalogue ()
Signal, emitted after the refresh-button of the vehicle model catalogue has been pressed (only in "static" mode).
void | refreshSystemConfig ()
Signal, emitted after the refresh-button of the system config has been pressed (only in "static" mode).
void | remove (QString const &name)
Signal, emitted after the remove-button for agent profiles has been clicked. Transmits the name of the agent profile currently selected in the combo box, which is the one to be removed. More...
void | removeDriverProfile (const int &row)
Signal, emitted after the remove-button for driver profiles has been clicked by the user (only in "dynamic" mode). Transmits the row index of the profile to be removed (i.e. the one having keyboard focus). More...
void | removeVehicleProfile (const int &row)
Signal, emitted after the remove-button for vehicle profiles has been clicked by the user (only in "dynamic" mode). Transmits the row index of the profile to be removed (i.e. the one having keyboard focus). More...
void | selectedSystem (QString const &system)
Signal, emitted after the current entry in the system selection box has been changed by the user. Transmits the current selection. More...
void | selectionChanged (QString const &name)
Signal, emitted after the current entry of the combo box for available agent profiles has been changed by the user. Transmit the newly selected agent profile. More...
void | setModel (QString const &model)
Signal, emitted after the current entry in the vehicle model selection box has been changed by the user. Transmits the current selection. More...
void | setModelCatalogue ()
Signal, emitted after the browse-button of the vehicle model catalogue has been pressed (only in "static" mode).
void | setSystemConfig ()
Signal, emitted after the browse-button of the system config has been pressed (only in "static" mode).
void | typeChanged (QString const &type)
Signal, emitted after the current entry of the combo box for the agent type (dynamic or static) has changed. Transmits the newly selected type. More...

Public Member Functions

void | addAgent (QString const &name)
Method which adds the given agent profile name to the agent selection list (drop down menu for agent profiles). More...
void | clear ()
Method which clears the current selection elements for static agent profiles and sets the type and mode back to default "dynamic". Note, that clearing the table views for vehicle and driver profiles (in dynamic mode) is done elsewhere using the corresponding reimplementation of QAbstractTableModel.
void | enableConfiguration (bool enable)
Method which enables or disables the GUI elements of this view, apart from the add-button for adding agent profiles. Disabling usually happens when there is no agent profile configured. More...
void | enableModelView (bool enable)
Method which enables or disables the drop down menu for vehicle models (for static agent profiles). Disabling the menu usually happens when there is no vehicle model catalogue loaded. More...
void | enableSystemView (bool enable)
Method which enables or disables the drop down menu for systems (for static agent profiles). Disabling the menu usually happens when there is no system config XML file loaded. More...
QTableView * | getDriverProfilesView () const
Method which provides access to the table view for driver profiles. More...
QTableView * | getVehicleProfilesView () const
Method which provides access to the table view for vehicle profiles. More...
void | removeAgent (QString const &name)
Method which removes the given agent profile name from the agent selection list (drop down menu for agent profiles). More...
void | setAgentSelectionItems (QStringList const &names)
Method which clears the selection list for agent profiles (drop down menu) and inserts the given list. More...
void | setCurrentAgent (QString const &name)
Method which sets the agent profile name to be currently shown in the drop down menu for agent profiles. More...
void | setCurrentModel (const QString &model)
Method which the sets the vehicle model currently displayed by the vehicle models' drop down menu to the one passed as an argument. More...
void | setCurrentModelCatalogue (const QString &modelCatalogue)
Method which the currently displayed vehicle model catalogue to the one passed as an argument. More...
void | setCurrentSystem (const QString &system)
Method which the sets the system currently displayed by the systems' drop down menu to the one passed as an argument. More...
void | setCurrentSystemConfig (const QString &systemConfig)
Method which the currently displayed system config file to the one passed as an argument. More...
void | setCurrentType (QString const &type)
Method which sets the agent profile type (dynamic or static) shown in the corresponding drop down menu to the one passed as an argument. More...
void | setDriverProbabilityError (bool error)
Method puts a probability error message above the driver profiles' table if given error flag is "true". More...
void | setModelCatalogueError (QString const &message)
Method which displays the given error message (red color) next to the GUI element for editing the vehicle model catalogue (for static agent profiles). More...
void | setModelSelectionItems (const QStringList &modelItems)
Method which the sets the vehicle models' selection list (drop down menu) to the one passed as an argument. More...
void | setSystemConfigError (QString const &message)
Method which displays the given error message (red color) next to the GUI element for the system config (for static agent profiles). More...
void | setSystemSelectionItems (const QStringList &systemItems)
Method which the sets the systems' selection list (drop down menu) to the one passed as an argument. More...
void | setVehicleProbabilityError (bool error)
Method puts a probability error message above the vehicle profiles' table if given error flag is "true". More...
- Public Member Functions inherited from WidgetView
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Private Slots

void | on_add_clicked ()
Slot which emits the add signal after the add-button for agent profiles has been added.
void | on_addDriver_clicked ()
Slot which emits the addDriverProfile signal after the add-button for driver profiles has been clicked (for dynamic mode only).
void | on_addVehicle_clicked ()
Slot which emits the addVehicleProfile signal after the add-button for vehicle profiles has been clicked (for dynamic mode only).
void | on_AgentProfileSelection_activated (const QString &name)
Slot which emits the selectionChanged signal after changing the current selection of the agent profile selection box. More...
void | on_edit_clicked ()
Slot which is triggered after the rename-button for the agent profile has been clicked. Opens a Dialog box asking the user to enter a new name for the currently selected agent profile.
void | on_Model_activated (const QString &model)
Slot which emits the setModel signal after the current entry of the vehicle model selection box is changed by the user (for static mode only). More...
void | on_ModelCatalogueBrowse_clicked ()
Slot which emits the setModelCatalogue signal after the browse-button for the vehicle model catalogue has been clicked.
void | on_ModelCatalogueRefresh_clicked ()
Slot which is triggered when the refresh-button for a vehicle model catalogue is clicked. Emits the refreshModelCatalogue signal.
void | on_remove_clicked ()
Slot which emits the remove signal after the remove-button for agent profiles has been added.
void | on_removeDriver_clicked ()
Slot which emits the removeDriverProfile signal after the remove-button for driver profiles has been clicked (for dynamic mode only).
void | on_removeVehicle_clicked ()
Slot which emits the removeVehicleProfile signal after the remove-button for vehicle profiles has been clicked (for dynamic mode only).
void | on_system_activated (const QString &system)
Slot which emits the selectedSystem signal after the current entry of the system selection box is changed by the user (for static mode only). More...
void | on_systemConfigBrowse_clicked ()
Slot which emits the setSystemConfig signal after the browse-button for the system config file has been clicked.
void | on_systemConfigRefresh_clicked ()
Slot which is triggered when the refresh-button for a system config file is clicked. Emits the refreshSystemConfig signal.
void | on_Type_activated (const QString &type)
Slot which emits the typeChanged signal after changing the current selection of the type selection box. More...

Private Member Functions

bool eventFilter (QObject *watched, QEvent *event)
Reimplementation of the event filter for catching the resize-events of the driver and vehicle profiles' table view. It takes care of the proper column width ratio after resizing. More...

Private Attributes

Ui::AgentMapView * ui
the ui object containing all GUI elements of this view

Additional Inherited Members

- Protected Member Functions inherited from WidgetView
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.

Detailed Description

This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu for selecting a profile to be edited as well as buttons for removing and adding agent profiles. Further, a menu for editing the type ("dynamic" or "static") is provided whose selection switches between two different views. If the type "dynamic" is selected, two tables for assigning driver and vehicle profiles with probabilities appear. If type "static" is selected, the view is reduced to a selection menu for a system config + system as well as a vehicle model catalogue + model. The switching between the two modes is realized via a stacked widget whose pages contain the GUI elements being exclusive for the selected mode. Further information on how to use this view can be found in the GUI tutorial.

Definition at line 56 of file AgentMapView.h.

Member Function Documentation

◆ add

void AgentMapView::add ( QString const & name )
signal

Signal, emitted after the add-button for agent profiles has been clicked and a name for a new profile has been typed in. Transmits the name of the new agent profile.

Parameters
[in] name the name of the new agent profile

◆ addAgent()

void AgentMapView::addAgent ( QString const & name )

Method which adds the given agent profile name to the agent selection list (drop down menu for agent profiles).

Parameters
[in] name the agent profile's name to be added to the selection list

Definition at line 119 of file AgentMapView.cpp.

120 {
121 ui->AgentProfileSelection->addItem(name);
122 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ enableConfiguration()

void AgentMapView::enableConfiguration ( bool enable )

Method which enables or disables the GUI elements of this view, apart from the add-button for adding agent profiles. Disabling usually happens when there is no agent profile configured.

Parameters
[in] enable the flag for enabling (true) or disabling (false) the GUI elements

Definition at line 51 of file AgentMapView.cpp.

52 {
53 ui->remove->setEnabled(enable);
54 ui->edit->setEnabled(enable);
55 ui->Type->setEnabled(enable);
56
57 ui->addVehicle->setEnabled(enable);
58 ui->removeVehicle->setEnabled(enable);
59
60 ui->addDriver->setEnabled(enable);
61 ui->removeDriver->setEnabled(enable);
62
63 ui->system->setEnabled(enable);
64 ui->systemConfig->setEnabled(enable);
65 ui->systemConfigBrowse->setEnabled(enable);
66 ui->systemConfigRefresh->setEnabled(enable);
67
68 ui->Model->setEnabled(enable);
69 ui->ModelCatalogue->setEnabled(enable);
70 ui->ModelCatalogueBrowse->setEnabled(enable);
71 ui->ModelCatalogueRefresh->setEnabled(enable);
72 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ enableModelView()

void AgentMapView::enableModelView ( bool enable )

Method which enables or disables the drop down menu for vehicle models (for static agent profiles). Disabling the menu usually happens when there is no vehicle model catalogue loaded.

Parameters
[in] enable the flag for enabling (true) or disabling (false) the vehicle models' menu

Definition at line 41 of file AgentMapView.cpp.

42 {
43 ui->Model->setEnabled(enable);
44 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ enableSystemView()

void AgentMapView::enableSystemView ( bool enable )

Method which enables or disables the drop down menu for systems (for static agent profiles). Disabling the menu usually happens when there is no system config XML file loaded.

Parameters
[in] enable the flag for enabling (true) or disabling (false) the systems' menu

Definition at line 46 of file AgentMapView.cpp.

47 {
48 ui->system->setEnabled(enable);
49 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ eventFilter()

bool AgentMapView::eventFilter | ( | QObject * | watched,
 |  | QEvent * | event
 | ) |  |
private

Reimplementation of the event filter for catching the resize-events of the driver and vehicle profiles' table view. It takes care of the proper column width ratio after resizing.

Parameters
[in] | watched | the watched object
[in] | event | the event to be catched
Returns
always "false" as the event should be catched but not filtered

Definition at line 270 of file AgentMapView.cpp.

271 {
272 QTableView* table = qobject_cast<QTableView*> (watched);
273
274 if( table && event->type() == QEvent::Resize )
275 {
276 int cell = (table->width())/2;
277 table->setColumnWidth(0, cell);
278 }
279
280 return false;
281 }

◆ getDriverProfilesView()

QTableView * AgentMapView::getDriverProfilesView ( ) const

Method which provides access to the table view for driver profiles.

Returns
the table view (QTableView) for driver profiles

Definition at line 179 of file AgentMapView.cpp.

180 {
181 return ui->DriverView;
182 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ getVehicleProfilesView()

QTableView * AgentMapView::getVehicleProfilesView ( ) const

Method which provides access to the table view for vehicle profiles.

Returns
the table view (QTableView) for vehicle profiles

Definition at line 174 of file AgentMapView.cpp.

175 {
176 return ui->VehicleView;
177 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ modifiedName

void AgentMapView::modifiedName | ( | QString const & | oldName,
 |  | QString const & | newName
 | ) |  |
signal

Signal, emitted after the rename-button has been pressed. Transmits the new name inserted by the user as well as the old name of the currently selected agent profile.

Parameters
[in] | oldName | the old name of the renamed agent profile
[in] | newName | the new name of the agent profile

◆ on_AgentProfileSelection_activated

void AgentMapView::on_AgentProfileSelection_activated ( const QString & name )
privateslot

Slot which emits the selectionChanged signal after changing the current selection of the agent profile selection box.

Parameters
[in] name the new agent profile of the selection box

Definition at line 137 of file AgentMapView.cpp.

138 {
139 Q_EMIT selectionChanged(name);
140 }
AgentMapView::selectionChanged
void selectionChanged(QString const &name)
Signal, emitted after the current entry of the combo box for available agent profiles has been change...

◆ on_Model_activated

void AgentMapView::on_Model_activated ( const QString & model )
privateslot

Slot which emits the setModel signal after the current entry of the vehicle model selection box is changed by the user (for static mode only).

Parameters
[in] model the new entry of the vehicle model selection box

Definition at line 248 of file AgentMapView.cpp.

249 {
250 Q_EMIT setModel(model);
251 }
AgentMapView::setModel
void setModel(QString const &model)
Signal, emitted after the current entry in the vehicle model selection box has been changed by the us...

◆ on_system_activated

void AgentMapView::on_system_activated ( const QString & system )
privateslot

Slot which emits the selectedSystem signal after the current entry of the system selection box is changed by the user (for static mode only).

Parameters
[in] system the new entry of the system selection box

Definition at line 203 of file AgentMapView.cpp.

204 {
205 Q_EMIT selectedSystem(system);
206 }
AgentMapView::selectedSystem
void selectedSystem(QString const &system)
Signal, emitted after the current entry in the system selection box has been changed by the user...

◆ on_Type_activated

void AgentMapView::on_Type_activated ( const QString & type )
privateslot

Slot which emits the typeChanged signal after changing the current selection of the type selection box.

Parameters
[in] type the new type of the selection box

Definition at line 198 of file AgentMapView.cpp.

199 {
200 Q_EMIT typeChanged(type);
201 }
AgentMapView::typeChanged
void typeChanged(QString const &type)
Signal, emitted after the current entry of the combo box for the agent type (dynamic or static) has c...

◆ remove

void AgentMapView::remove ( QString const & name )
signal

Signal, emitted after the remove-button for agent profiles has been clicked. Transmits the name of the agent profile currently selected in the combo box, which is the one to be removed.

Parameters
[in] name the name of the agent profile to be removed

◆ removeAgent()

void AgentMapView::removeAgent ( QString const & name )

Method which removes the given agent profile name from the agent selection list (drop down menu for agent profiles).

Parameters
[in] name the agent profile's name to be removed from the selection list

Definition at line 130 of file AgentMapView.cpp.

131 {
132 int index = ui->AgentProfileSelection->findText(name);
133 ui->AgentProfileSelection->removeItem(index);
134 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ removeDriverProfile

void AgentMapView::removeDriverProfile ( const int & row )
signal

Signal, emitted after the remove-button for driver profiles has been clicked by the user (only in "dynamic" mode). Transmits the row index of the profile to be removed (i.e. the one having keyboard focus).

Parameters
[in] row the row index of the profile to be removed

◆ removeVehicleProfile

void AgentMapView::removeVehicleProfile ( const int & row )
signal

Signal, emitted after the remove-button for vehicle profiles has been clicked by the user (only in "dynamic" mode). Transmits the row index of the profile to be removed (i.e. the one having keyboard focus).

Parameters
[in] row the row index of the profile to be removed

◆ selectedSystem

void AgentMapView::selectedSystem ( QString const & system )
signal

Signal, emitted after the current entry in the system selection box has been changed by the user. Transmits the current selection.

Parameters
[in] system the current system selection

◆ selectionChanged

void AgentMapView::selectionChanged ( QString const & name )
signal

Signal, emitted after the current entry of the combo box for available agent profiles has been changed by the user. Transmit the newly selected agent profile.

Parameters
[in] name the name of the new agent profile selected

◆ setAgentSelectionItems()

void AgentMapView::setAgentSelectionItems ( QStringList const & names )

Method which clears the selection list for agent profiles (drop down menu) and inserts the given list.

Parameters
[in] names the list of agent profile names to be listed in the corresponding drop down menu

Definition at line 124 of file AgentMapView.cpp.

125 {
126 ui->AgentProfileSelection->clear();
127 ui->AgentProfileSelection->addItems(names);
128 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ setCurrentAgent()

void AgentMapView::setCurrentAgent ( QString const & name )

Method which sets the agent profile name to be currently shown in the drop down menu for agent profiles.

Parameters
[in] name the agent profile to be currently shown in the corresponding drop down menu

Definition at line 113 of file AgentMapView.cpp.

114 {
115 if(ui->AgentProfileSelection->findText(name) != -1)
116 ui->AgentProfileSelection->setCurrentText(name);
117 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ setCurrentModel()

void AgentMapView::setCurrentModel ( const QString & model )

Method which the sets the vehicle model currently displayed by the vehicle models' drop down menu to the one passed as an argument.

Parameters
[in] model the vehicle model to be displayed

Definition at line 258 of file AgentMapView.cpp.

259 {
260 if(ui->Model->findText(model) != -1)
261 ui->Model->setCurrentText(model);
262 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ setCurrentModelCatalogue()

void AgentMapView::setCurrentModelCatalogue ( const QString & modelCatalogue )

Method which the currently displayed vehicle model catalogue to the one passed as an argument.

Parameters
[in] modelCatalogue the vehicle model catalogue to be displayed

Definition at line 253 of file AgentMapView.cpp.

254 {
255 ui->ModelCatalogue->setText(modelCatalogue);
256 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ setCurrentSystem()

void AgentMapView::setCurrentSystem ( const QString & system )

Method which the sets the system currently displayed by the systems' drop down menu to the one passed as an argument.

Parameters
[in] system the list of systems

Definition at line 223 of file AgentMapView.cpp.

224 {
225 if(ui->system->findText(system)!= -1)
226 ui->system->setCurrentText(system);
227 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ setCurrentSystemConfig()

void AgentMapView::setCurrentSystemConfig ( const QString & systemConfig )

Method which the currently displayed system config file to the one passed as an argument.

Parameters
[in] systemConfig the system config to be displayed

Definition at line 218 of file AgentMapView.cpp.

219 {
220 ui->systemConfig->setText(systemConfig);
221 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ setCurrentType()

void AgentMapView::setCurrentType ( QString const & type )

Method which sets the agent profile type (dynamic or static) shown in the corresponding drop down menu to the one passed as an argument.

Parameters
[in] type the agent profile type to be shown in the corresponding drop down menu

Definition at line 184 of file AgentMapView.cpp.

185 {
186 if(type == "Dynamic")
187 {
188 ui->Type->setCurrentText(type);
189 ui->TypeSpecificElements->setCurrentWidget(ui->Dynamic);
190 }
191 if(type == "Static")
192 {
193 ui->Type->setCurrentText(type);
194 ui->TypeSpecificElements->setCurrentWidget(ui->Static);
195 }
196 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ setDriverProbabilityError()

void AgentMapView::setDriverProbabilityError ( bool error )

Method puts a probability error message above the driver profiles' table if given error flag is "true".

Parameters
[in] error the error flag

Definition at line 293 of file AgentMapView.cpp.

294 {
295 if(error)
296 ui->DriverProbabilityError->setText("probability sum invalid!");
297 else
298 ui->DriverProbabilityError->setText("");
299
300 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ setModel

void AgentMapView::setModel ( QString const & model )
signal

Signal, emitted after the current entry in the vehicle model selection box has been changed by the user. Transmits the current selection.

Parameters
[in] model the current vehicle model selection

◆ setModelCatalogueError()

void AgentMapView::setModelCatalogueError ( QString const & message )

Method which displays the given error message (red color) next to the GUI element for editing the vehicle model catalogue (for static agent profiles).

Parameters
[in] message the error message to be displayed

Definition at line 288 of file AgentMapView.cpp.

289 {
290 ui->modelCatalogueError->setText(message);
291 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ setModelSelectionItems()

void AgentMapView::setModelSelectionItems ( const QStringList & modelItems )

Method which the sets the vehicle models' selection list (drop down menu) to the one passed as an argument.

Parameters
[in] modelItems the list of vehicle models to be offered by the menu

Definition at line 264 of file AgentMapView.cpp.

265 {
266 ui->Model->clear();
267 ui->Model->addItems(modelItems);
268 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ setSystemConfigError()

void AgentMapView::setSystemConfigError ( QString const & message )

Method which displays the given error message (red color) next to the GUI element for the system config (for static agent profiles).

Parameters
[in] message the error message to be displayed

Definition at line 283 of file AgentMapView.cpp.

284 {
285 ui->systemConfigError->setText(message);
286 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ setSystemSelectionItems()

void AgentMapView::setSystemSelectionItems ( const QStringList & systemItems )

Method which the sets the systems' selection list (drop down menu) to the one passed as an argument.

Parameters
[in] systemItems the list of systems to be offered by the menu

Definition at line 229 of file AgentMapView.cpp.

230 {
231 ui->system->clear();
232
233 if(!systemItems.isEmpty())
234 ui->system->addItems(systemItems);
235 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ setVehicleProbabilityError()

void AgentMapView::setVehicleProbabilityError ( bool error )

Method puts a probability error message above the vehicle profiles' table if given error flag is "true".

Parameters
[in] error the error flag

Definition at line 302 of file AgentMapView.cpp.

303 {
304 if(error)
305 ui->VehicleProbabilityError->setText("probability sum invalid!");
306 else
307 ui->VehicleProbabilityError->setText("");
308 }
AgentMapView::ui
Ui::AgentMapView * ui
the ui object containing all GUI elements of this view
Definition: AgentMapView.h:488

◆ typeChanged

void AgentMapView::typeChanged ( QString const & type )
signal

Signal, emitted after the current entry of the combo box for the agent type (dynamic or static) has changed. Transmits the newly selected type.

Parameters
[in] type the newly selected type of the agent profile
The documentation for this class was generated from the following files:
  • AgentMapView.h
  • AgentMapView.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

AgentMapView Member List

This is the complete list of members for AgentMapView, including all inherited members.

add(QString const &name) | AgentMapView | signal
addAgent(QString const &name) | AgentMapView |
addDriverProfile() | AgentMapView | signal
addVehicleProfile() | AgentMapView | signal
clear() | AgentMapView |
enableConfiguration(bool enable) | AgentMapView |
enableModelView(bool enable) | AgentMapView |
enableSystemView(bool enable) | AgentMapView |
eventFilter(QObject *watched, QEvent *event) | AgentMapView | private
getDriverProfilesView() const | AgentMapView |
getVehicleProfilesView() const | AgentMapView |
modifiedName(QString const &oldName, QString const &newName) | AgentMapView | signal
on_add_clicked() | AgentMapView | privateslot
on_addDriver_clicked() | AgentMapView | privateslot
on_addVehicle_clicked() | AgentMapView | privateslot
on_AgentProfileSelection_activated(const QString &name) | AgentMapView | privateslot
on_edit_clicked() | AgentMapView | privateslot
on_Model_activated(const QString &model) | AgentMapView | privateslot
on_ModelCatalogueBrowse_clicked() | AgentMapView | privateslot
on_ModelCatalogueRefresh_clicked() | AgentMapView | privateslot
on_remove_clicked() | AgentMapView | privateslot
on_removeDriver_clicked() | AgentMapView | privateslot
on_removeVehicle_clicked() | AgentMapView | privateslot
on_system_activated(const QString &system) | AgentMapView | privateslot
on_systemConfigBrowse_clicked() | AgentMapView | privateslot
on_systemConfigRefresh_clicked() | AgentMapView | privateslot
on_Type_activated(const QString &type) | AgentMapView | privateslot
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
refreshModelCatalogue() | AgentMapView | signal
refreshSystemConfig() | AgentMapView | signal
remove(QString const &name) | AgentMapView | signal
removeAgent(QString const &name) | AgentMapView |
removeDriverProfile(const int &row) | AgentMapView | signal
removeVehicleProfile(const int &row) | AgentMapView | signal
selectedSystem(QString const &system) | AgentMapView | signal
selectionChanged(QString const &name) | AgentMapView | signal
setAgentSelectionItems(QStringList const &names) | AgentMapView |
setCurrentAgent(QString const &name) | AgentMapView |
setCurrentModel(const QString &model) | AgentMapView |
setCurrentModelCatalogue(const QString &modelCatalogue) | AgentMapView |
setCurrentSystem(const QString &system) | AgentMapView |
setCurrentSystemConfig(const QString &systemConfig) | AgentMapView |
setCurrentType(QString const &type) | AgentMapView |
setDriverProbabilityError(bool error) | AgentMapView |
setModel(QString const &model) | AgentMapView | signal
setModelCatalogue() | AgentMapView | signal
setModelCatalogueError(QString const &message) | AgentMapView |
setModelSelectionItems(const QStringList &modelItems) | AgentMapView |
setSystemConfig() | AgentMapView | signal
setSystemConfigError(QString const &message) | AgentMapView |
setSystemSelectionItems(const QStringList &systemItems) | AgentMapView |
setVehicleProbabilityError(bool error) | AgentMapView |
typeChanged(QString const &type) | AgentMapView | signal
ui | AgentMapView | private
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentProfileCommands::AddAgentProfile Class Reference

  • AgentProfileCommands
  • AddAgentProfile
List of all members
AgentProfileCommands::AddAgentProfile Class Reference

This class defines the command for undoable add-operations on the map of agent profiles (AgentMapInterface). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable add-operations on the map of agent profiles (AgentMapInterface).

Definition at line 408 of file AgentMapPresenter.h.

The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • AgentProfileCommands
  • AddAgentProfile
AgentProfileCommands::AddAgentProfile Member List

This is the complete list of members for AgentProfileCommands::AddAgentProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentProfileCommands::AddDriverProfile Class Reference

  • AgentProfileCommands
  • AddDriverProfile
List of all members
AgentProfileCommands::AddDriverProfile Class Reference

This class defines the command for undoable add-operations on the driver profiles table of the currently edited agent profile (for dynamic agent profiles only). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable add-operations on the driver profiles table of the currently edited agent profile (for dynamic agent profiles only).

Definition at line 620 of file AgentMapPresenter.h.

The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • AgentProfileCommands
  • AddDriverProfile
AgentProfileCommands::AddDriverProfile Member List

This is the complete list of members for AgentProfileCommands::AddDriverProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentProfileCommands::AddVehicleProfile Class Reference

  • AgentProfileCommands
  • AddVehicleProfile
List of all members
AgentProfileCommands::AddVehicleProfile Class Reference

This class defines the command for undoable add-operations on the vehicle profiles table of the currently edited agent profile (for dynamic agent profiles only). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable add-operations on the vehicle profiles table of the currently edited agent profile (for dynamic agent profiles only).

Definition at line 670 of file AgentMapPresenter.h.

The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • AgentProfileCommands
  • AddVehicleProfile
AgentProfileCommands::AddVehicleProfile Member List

This is the complete list of members for AgentProfileCommands::AddVehicleProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentProfileCommands::EditAgentModel Class Reference

  • AgentProfileCommands
  • EditAgentModel
List of all members
AgentProfileCommands::EditAgentModel Class Reference

This class defines the command for undoable set-operations on the vehicle model of the currently edited agent profile (for static profiles only). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable set-operations on the vehicle model of the currently edited agent profile (for static profiles only).

Definition at line 594 of file AgentMapPresenter.h.

The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • AgentProfileCommands
  • EditAgentModel
AgentProfileCommands::EditAgentModel Member List

This is the complete list of members for AgentProfileCommands::EditAgentModel, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentProfileCommands::EditAgentModelCatalogue Class Reference

  • AgentProfileCommands
  • EditAgentModelCatalogue
List of all members
AgentProfileCommands::EditAgentModelCatalogue Class Reference

This class defines the command for undoable set-operations on the vehicle model catalogue of the currently edited agent profile (for static profiles only). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable set-operations on the vehicle model catalogue of the currently edited agent profile (for static profiles only).

Definition at line 566 of file AgentMapPresenter.h.

The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • AgentProfileCommands
  • EditAgentModelCatalogue
AgentProfileCommands::EditAgentModelCatalogue Member List

This is the complete list of members for AgentProfileCommands::EditAgentModelCatalogue, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentProfileCommands::EditAgentProfile Class Reference

  • AgentProfileCommands
  • EditAgentProfile
List of all members
AgentProfileCommands::EditAgentProfile Class Reference

This class defines the command for undoable renaming-operations on the map of agent profiles (AgentMapInterface). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable renaming-operations on the map of agent profiles (AgentMapInterface).

Definition at line 455 of file AgentMapPresenter.h.

The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • AgentProfileCommands
  • EditAgentProfile
AgentProfileCommands::EditAgentProfile Member List

This is the complete list of members for AgentProfileCommands::EditAgentProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentProfileCommands::EditAgentSystem Class Reference

  • AgentProfileCommands
  • EditAgentSystem
List of all members
AgentProfileCommands::EditAgentSystem Class Reference

This class defines the command for undoable set-operations on the system of the currently edited agent profile (for static profiles only). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable set-operations on the system of the currently edited agent profile (for static profiles only).

Definition at line 535 of file AgentMapPresenter.h.

The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • AgentProfileCommands
  • EditAgentSystem
AgentProfileCommands::EditAgentSystem Member List

This is the complete list of members for AgentProfileCommands::EditAgentSystem, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentProfileCommands::EditAgentSystemConfig Class Reference

  • AgentProfileCommands
  • EditAgentSystemConfig
List of all members
AgentProfileCommands::EditAgentSystemConfig Class Reference

This class defines the command for undoable set-operations on the system config file of the currently edited agent profile (for static profiles only). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable set-operations on the system config file of the currently edited agent profile (for static profiles only).

Definition at line 506 of file AgentMapPresenter.h.

The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • AgentProfileCommands
  • EditAgentSystemConfig
AgentProfileCommands::EditAgentSystemConfig Member List

This is the complete list of members for AgentProfileCommands::EditAgentSystemConfig, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentProfileCommands::EditAgentType Class Reference

  • AgentProfileCommands
  • EditAgentType
List of all members
AgentProfileCommands::EditAgentType Class Reference

This class defines the command for undoable set-operations on the type (static or dynamic) of an agent profile. More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable set-operations on the type (static or dynamic) of an agent profile.

Definition at line 480 of file AgentMapPresenter.h.

The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • AgentProfileCommands
  • EditAgentType
AgentProfileCommands::EditAgentType Member List

This is the complete list of members for AgentProfileCommands::EditAgentType, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentProfileCommands::RemoveAgentProfile Class Reference

  • AgentProfileCommands
  • RemoveAgentProfile
List of all members
AgentProfileCommands::RemoveAgentProfile Class Reference

This class defines the command for undoable remove-operations on the map of agent profiles (AgentMapInterface). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable remove-operations on the map of agent profiles (AgentMapInterface).

Definition at line 430 of file AgentMapPresenter.h.

The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • AgentProfileCommands
  • RemoveAgentProfile
AgentProfileCommands::RemoveAgentProfile Member List

This is the complete list of members for AgentProfileCommands::RemoveAgentProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentProfileCommands::RemoveDriverProfile Class Reference

  • AgentProfileCommands
  • RemoveDriverProfile
List of all members
AgentProfileCommands::RemoveDriverProfile Class Reference

This class defines the command for undoable remove-operations on the driver profiles table of the currently edited agent profile (for dynamic agent profiles only). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable remove-operations on the driver profiles table of the currently edited agent profile (for dynamic agent profiles only).

Definition at line 645 of file AgentMapPresenter.h.

The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • AgentProfileCommands
  • RemoveDriverProfile
AgentProfileCommands::RemoveDriverProfile Member List

This is the complete list of members for AgentProfileCommands::RemoveDriverProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentProfileCommands::RemoveVehicleProfile Class Reference

  • AgentProfileCommands
  • RemoveVehicleProfile
List of all members
AgentProfileCommands::RemoveVehicleProfile Class Reference

This class defines the command for undoable remove-operations on the vehicle profiles table of the currently edited agent profile (for dynamic agent profiles only). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable remove-operations on the vehicle profiles table of the currently edited agent profile (for dynamic agent profiles only).

Definition at line 695 of file AgentMapPresenter.h.

The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • AgentProfileCommands
  • RemoveVehicleProfile
AgentProfileCommands::RemoveVehicleProfile Member List

This is the complete list of members for AgentProfileCommands::RemoveVehicleProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: AgentProfileCommands::SetCurrentAgent Class Reference

  • AgentProfileCommands
  • SetCurrentAgent
List of all members
AgentProfileCommands::SetCurrentAgent Class Reference

This class defines the command for undoable set-operations on the currently selected agent profile. More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable set-operations on the currently selected agent profile.

Definition at line 375 of file AgentMapPresenter.h.

The documentation for this class was generated from the following files:
  • AgentMapPresenter.h
  • AgentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • AgentProfileCommands
  • SetCurrentAgent
AgentProfileCommands::SetCurrentAgent Member List

This is the complete list of members for AgentProfileCommands::SetCurrentAgent, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentInputItemInterface Class Reference

Signals | Public Member Functions | List of all members
ComponentInputItemInterface Class Referenceabstract

This class defines the items constituing an input of a component: More...

Inherits QObject.

Signals

void | cleared () const
Triggers signal to inform that a component input has been successfully removed (used to update the table of inputs in the Window View of the Component Generator when users pressing on Delete button).
void | modifiedCardinality () const
Triggers signal to inform that the cadinality of a component input has been modified.
void | modifiedTitle () const
Triggers signal to inform that the title of a component input has been modified.
void | modifiedType () const
Triggers signal to inform that the type of a component input has been modified.
void | modifiedUnit () const
Triggers signal to inform that the unit of a component input has been modified.

Public Member Functions

virtual bool | clear ()=0
Resets the items constituing the input of the component. (e.g. function called when users pressing on Delete button of the table of inputs in the Window View of the Component Generator). More...
virtual ComponentInputItemInterface::Cardinality | getCardinality () const =0
Gets the cardinality of the current registered input. More...
virtual ComponentInputItemInterface::ID | getID () const =0
Gets the key identifier of the current registered input. More...
virtual ComponentInputItemInterface::Title | getTitle () const =0
Gets the title of the current registered input. More...
virtual ComponentInputItemInterface::Type | getType () const =0
Gets the type of the current registered input. More...
virtual ComponentInputItemInterface::Unit | getUnit () const =0
Gets the unit of the current registered input. More...
virtual bool | setCardinality (ComponentInputItemInterface::Cardinality const &cardinality)=0
Sets the cardinality of the current registered input. More...
virtual bool | setID (ComponentInputItemInterface::ID const &id)=0
Sets a key identifier id for the current registered input. More...
virtual bool | setTitle (ComponentInputItemInterface::Title const &title)=0
Sets the title of the current registered input. More...
virtual bool | setType (ComponentInputItemInterface::Type const &type)=0
Sets the type of the current registered input. More...
virtual bool | setUnit (ComponentInputItemInterface::Unit const &unit)=0
Sets the unit of the current registered input. More...

Detailed Description

This class defines the items constituing an input of a component:

  • the key identifier (must be UNIQUE)
  • the type: Boolean or Integer or Float or Double or String
  • the title (modifiable)
  • the unit (should be SI unit)
  • the cardinality (number of inputs accepted)

Definition at line 34 of file ComponentInputItemInterface.h.

Member Function Documentation

◆ clear()

virtual bool ComponentInputItemInterface::clear ( )
pure virtual

Resets the items constituing the input of the component. (e.g. function called when users pressing on Delete button of the table of inputs in the Window View of the Component Generator).

Returns
True if input items successfully cleared.

◆ getCardinality()

virtual ComponentInputItemInterface::Cardinality ComponentInputItemInterface::getCardinality ( ) const
pure virtual

Gets the cardinality of the current registered input.

Returns
The cardinality for the input.

◆ getID()

virtual ComponentInputItemInterface::ID ComponentInputItemInterface::getID ( ) const
pure virtual

Gets the key identifier of the current registered input.

Returns
The key identifier of the input.

◆ getTitle()

virtual ComponentInputItemInterface::Title ComponentInputItemInterface::getTitle ( ) const
pure virtual

Gets the title of the current registered input.

Returns
The title of the input.

◆ getType()

virtual ComponentInputItemInterface::Type ComponentInputItemInterface::getType ( ) const
pure virtual

Gets the type of the current registered input.

Returns
The type of the input.

◆ getUnit()

virtual ComponentInputItemInterface::Unit ComponentInputItemInterface::getUnit ( ) const
pure virtual

Gets the unit of the current registered input.

Returns
The unit of the input.

◆ setCardinality()

virtual bool ComponentInputItemInterface::setCardinality ( ComponentInputItemInterface::Cardinality const & cardinality )
pure virtual

Sets the cardinality of the current registered input.

Parameters
[in] cardinality The cardinality for the input.
Returns
True if the cardinality successfully modified.

◆ setID()

virtual bool ComponentInputItemInterface::setID ( ComponentInputItemInterface::ID const & id )
pure virtual

Sets a key identifier id for the current registered input.

Parameters
[in] id The input key identifier.
Returns
True if the input id successfully modified.

◆ setTitle()

virtual bool ComponentInputItemInterface::setTitle ( ComponentInputItemInterface::Title const & title )
pure virtual

Sets the title of the current registered input.

Parameters
[in] title The title of the input.
Returns
True if the input title successfully modified.

◆ setType()

virtual bool ComponentInputItemInterface::setType ( ComponentInputItemInterface::Type const & type )
pure virtual

Sets the type of the current registered input.

Parameters
[in] type The type of the input.
Returns
True if the input type successfully modified.

◆ setUnit()

virtual bool ComponentInputItemInterface::setUnit ( ComponentInputItemInterface::Unit const & unit )
pure virtual

Sets the unit of the current registered input.

Parameters
[in] unit The unit of the input.
Returns
True if the input unit successfully modified.
The documentation for this class was generated from the following file:
  • ComponentInputItemInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ComponentInputItemInterface Member List

This is the complete list of members for ComponentInputItemInterface, including all inherited members.

clear()=0 | ComponentInputItemInterface | pure virtual
cleared() const | ComponentInputItemInterface | signal
getCardinality() const =0 | ComponentInputItemInterface | pure virtual
getID() const =0 | ComponentInputItemInterface | pure virtual
getTitle() const =0 | ComponentInputItemInterface | pure virtual
getType() const =0 | ComponentInputItemInterface | pure virtual
getUnit() const =0 | ComponentInputItemInterface | pure virtual
modifiedCardinality() const | ComponentInputItemInterface | signal
modifiedTitle() const | ComponentInputItemInterface | signal
modifiedType() const | ComponentInputItemInterface | signal
modifiedUnit() const | ComponentInputItemInterface | signal
setCardinality(ComponentInputItemInterface::Cardinality const &cardinality)=0 | ComponentInputItemInterface | pure virtual
setID(ComponentInputItemInterface::ID const &id)=0 | ComponentInputItemInterface | pure virtual
setTitle(ComponentInputItemInterface::Title const &title)=0 | ComponentInputItemInterface | pure virtual
setType(ComponentInputItemInterface::Type const &type)=0 | ComponentInputItemInterface | pure virtual
setUnit(ComponentInputItemInterface::Unit const &unit)=0 | ComponentInputItemInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentInputMapInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
ComponentInputMapInterface Class Referenceabstract

This class manages the registration and deregistration of inputs of a component. It provides a map as container with unique identifiers as a keys to sort the inputs. More...

Inherits QObject.

Public Types

using | ID = ComponentInputItemInterface::ID
The input's key.
using | Item = ComponentInputItemInterface
The object defining input.
using | Map = QMap< ID, Item * >
The container registering inputs.

Signals

void | added (Item *item) const
Triggers signal to inform that a component input has been registered.
void | cleared () const
Triggers signal to inform that all inputs have been successfully removed from the container (map).
void | modifiedID () const
Triggers signal to inform that a key id of a component input has been modified.
void | removed (Item *item) const
Triggers signal to inform that a component input has been deregistered.

Public Member Functions

virtual bool | add (ComponentInputMapInterface::ID const &id)=0
Registers a new input related-object under the key identifier id. More...
virtual bool | add (ComponentInputMapInterface::ID const &id, ComponentInputMapInterface::Item *const item)=0
Registers a given input related-object item with the key identifier id. More...
virtual bool | add (ComponentInputMapInterface::Item *const item)=0
Registers a given input related-object item with an automatically generated id. More...
virtual ComponentInputMapInterface::Iterator | begin ()=0
Gets an iterator pointing at the first component input related-object in the map. More...
virtual ComponentInputMapInterface::ConstIterator | begin () const =0
Gets an iterator pointing at the first component input related-object in the map (use for read-only since pointing at constant values). More...
virtual bool | clear ()=0
Removes all the input related-objects registered (clear the container). More...
virtual bool | contains (ComponentInputMapInterface::ID const &id) const =0
Verifies if the container (map) contains the component input related-object under the key identifier id. More...
virtual bool | contains (ComponentInputMapInterface::Item *const item) const =0
Verifies if the container (map) contains the component input related-object item. More...
virtual bool | contains (ComponentInputMapInterface::Index const &index) const =0
Verifies if there is a component input related-object at the index position index in the container (map). More...
virtual int | count () const =0
Counts the number of component input related-objects registered. More...
virtual Item * | createInput () const =0
Creates a new component input item and returns a pointer to it. More...
virtual ComponentInputMapInterface::Iterator | end ()=0
Gets an iterator pointing at the end of the map after the last component input related-object. More...
virtual ComponentInputMapInterface::ConstIterator | end () const =0
Gets an iterator pointing at the end of the map after the last component input related-object (use for read-only). More...
virtual ComponentInputMapInterface::ID | generateID () const =0
Generates a unique key identifier for the new input registered in the map. More...
virtual ComponentInputMapInterface::ID | getID (ComponentInputMapInterface::Item *const item) const =0
Gets the key identifier of the component input related-object item from the container (map). More...
virtual ComponentInputMapInterface::ID | getID (ComponentInputMapInterface::Index const &index) const =0
Gets the key identifier of the component input related-object in the index position index of the container (map). More...
virtual ComponentInputMapInterface::Index | getIndex (ComponentInputMapInterface::ID const &id) const =0
Gets the index position in the container (map) of the input related-object with the key identifier id. More...
virtual ComponentInputMapInterface::Index | getIndex (ComponentInputMapInterface::Item *const item) const =0
Gets the index position of the component input related-object item in the container (map). More...
virtual ComponentInputMapInterface::Item * | getItem (ComponentInputMapInterface::ID const &id) const =0
Gets the input related-object under the key identifier id. More...
virtual ComponentInputMapInterface::Item * | getItem (ComponentInputMapInterface::Index const &index) const =0
Gets the input related-object at the index position index in the map. More...
virtual bool | remove (ComponentInputMapInterface::ID const &id)=0
Deregisters a input related-object under the key identifier id. More...
virtual bool | remove (ComponentInputMapInterface::Item *const item)=0
Deregisters the input related-object item. More...
virtual bool | remove (ComponentInputMapInterface::Index const &index)=0
Deregisters the input related-object at the index position index in the container (map). More...
virtual bool | setID (ComponentInputMapInterface::Item *const item, ComponentInputMapInterface::ID const &id)=0
Sets a key identifier id for the component input related-object item registered in the container (map). More...

Detailed Description

This class manages the registration and deregistration of inputs of a component. It provides a map as container with unique identifiers as a keys to sort the inputs.

Definition at line 32 of file ComponentInputMapInterface.h.

Member Function Documentation

◆ add() [1/3]

virtual bool ComponentInputMapInterface::add ( ComponentInputMapInterface::ID const & id )
pure virtual

Registers a new input related-object under the key identifier id.

Parameters
[in] id The key id of the new input.
Returns
True if input successfully registered.

◆ add() [2/3]

virtual bool ComponentInputMapInterface::add | ( | ComponentInputMapInterface::ID const & | id,
 |  | ComponentInputMapInterface::Item *const | item
 | ) |  |
pure virtual

Registers a given input related-object item with the key identifier id.

Parameters
[in] | id | The key id of the new input.
[in] | item | The object defining the input.
Returns
True if input successfully registered.

◆ add() [3/3]

virtual bool ComponentInputMapInterface::add ( ComponentInputMapInterface::Item *const item )
pure virtual

Registers a given input related-object item with an automatically generated id.

Parameters
[in] item The object defining the input.
Returns
True if input successfully registered.

◆ begin() [1/2]

virtual ComponentInputMapInterface::Iterator ComponentInputMapInterface::begin ( )
pure virtual

Gets an iterator pointing at the first component input related-object in the map.

Returns
The iterator pointing at the first input in the map.

◆ begin() [2/2]

virtual ComponentInputMapInterface::ConstIterator ComponentInputMapInterface::begin ( ) const
pure virtual

Gets an iterator pointing at the first component input related-object in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first input in the map.

◆ clear()

virtual bool ComponentInputMapInterface::clear ( )
pure virtual

Removes all the input related-objects registered (clear the container).

Returns
True if all inputs successfully removed.

◆ contains() [1/3]

virtual bool ComponentInputMapInterface::contains ( ComponentInputMapInterface::ID const & id ) const
pure virtual

Verifies if the container (map) contains the component input related-object under the key identifier id.

Parameters
[in] id The key id of the new input.
Returns
True if input already registered.

◆ contains() [2/3]

virtual bool ComponentInputMapInterface::contains ( ComponentInputMapInterface::Item *const item ) const
pure virtual

Verifies if the container (map) contains the component input related-object item.

Parameters
[in] item The object defining the input.
Returns
True if input already registered.

◆ contains() [3/3]

virtual bool ComponentInputMapInterface::contains ( ComponentInputMapInterface::Index const & index ) const
pure virtual

Verifies if there is a component input related-object at the index position index in the container (map).

Parameters
[in] index The index position in the map.
Returns
True if input already registered.

◆ count()

virtual int ComponentInputMapInterface::count ( ) const
pure virtual

Counts the number of component input related-objects registered.

Returns
The number of inputs registered.

◆ createInput()

virtual Item* ComponentInputMapInterface::createInput ( ) const
pure virtual

Creates a new component input item and returns a pointer to it.

Note
The item is not registered in this map!
Returns
a pointer to the newly created input item

◆ end() [1/2]

virtual ComponentInputMapInterface::Iterator ComponentInputMapInterface::end ( )
pure virtual

Gets an iterator pointing at the end of the map after the last component input related-object.

Returns
The iterator pointing at the end of the map.

◆ end() [2/2]

virtual ComponentInputMapInterface::ConstIterator ComponentInputMapInterface::end ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last component input related-object (use for read-only).

Returns
The iterator pointing at the end of the map.

◆ generateID()

virtual ComponentInputMapInterface::ID ComponentInputMapInterface::generateID ( ) const
pure virtual

Generates a unique key identifier for the new input registered in the map.

Returns
The key identifier of the input.

◆ getID() [1/2]

virtual ComponentInputMapInterface::ID ComponentInputMapInterface::getID ( ComponentInputMapInterface::Item *const item ) const
pure virtual

Gets the key identifier of the component input related-object item from the container (map).

Parameters
[in] item The object defining the input.
Returns
The key identifier of the input.

◆ getID() [2/2]

virtual ComponentInputMapInterface::ID ComponentInputMapInterface::getID ( ComponentInputMapInterface::Index const & index ) const
pure virtual

Gets the key identifier of the component input related-object in the index position index of the container (map).

Parameters
[in] index The index position in the map.
Returns
The key identifier of the input.

◆ getIndex() [1/2]

virtual ComponentInputMapInterface::Index ComponentInputMapInterface::getIndex ( ComponentInputMapInterface::ID const & id ) const
pure virtual

Gets the index position in the container (map) of the input related-object with the key identifier id.

Parameters
[in] id The key id of the input.
Returns
The index position of the input in the map.

◆ getIndex() [2/2]

virtual ComponentInputMapInterface::Index ComponentInputMapInterface::getIndex ( ComponentInputMapInterface::Item *const item ) const
pure virtual

Gets the index position of the component input related-object item in the container (map).

Parameters
[in] item The object defining the input.
Returns
The index position of the input in the map.

◆ getItem() [1/2]

virtual ComponentInputMapInterface::Item* ComponentInputMapInterface::getItem ( ComponentInputMapInterface::ID const & id ) const
pure virtual

Gets the input related-object under the key identifier id.

Parameters
[in] id The key identifier of the input.
Returns
The object defining the input.

◆ getItem() [2/2]

virtual ComponentInputMapInterface::Item* ComponentInputMapInterface::getItem ( ComponentInputMapInterface::Index const & index ) const
pure virtual

Gets the input related-object at the index position index in the map.

Parameters
[in] index The index position in the map.
Returns
The object defining the input.

◆ remove() [1/3]

virtual bool ComponentInputMapInterface::remove ( ComponentInputMapInterface::ID const & id )
pure virtual

Deregisters a input related-object under the key identifier id.

Parameters
[in] id The key identifier of the input.
Returns
True if input successfully deregistered.

◆ remove() [2/3]

virtual bool ComponentInputMapInterface::remove ( ComponentInputMapInterface::Item *const item )
pure virtual

Deregisters the input related-object item.

Parameters
[in] item The object defining the input.
Returns
True if input successfully deregistered.

◆ remove() [3/3]

virtual bool ComponentInputMapInterface::remove ( ComponentInputMapInterface::Index const & index )
pure virtual

Deregisters the input related-object at the index position index in the container (map).

Parameters
[in] index The index position in the map.
Returns
True if input successfully deregistered.

◆ setID()

virtual bool ComponentInputMapInterface::setID | ( | ComponentInputMapInterface::Item *const | item,
 |  | ComponentInputMapInterface::ID const & | id
 | ) |  |
pure virtual

Sets a key identifier id for the component input related-object item registered in the container (map).

Parameters
[in] | item | The object defining the input.
[in] | id | The key id of the input.
Returns
True if the key identifier successfully modified.
The documentation for this class was generated from the following file:
  • ComponentInputMapInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ComponentInputMapInterface Member List

This is the complete list of members for ComponentInputMapInterface, including all inherited members.

add(ComponentInputMapInterface::ID const &id)=0 | ComponentInputMapInterface | pure virtual
add(ComponentInputMapInterface::ID const &id, ComponentInputMapInterface::Item *const item)=0 | ComponentInputMapInterface | pure virtual
add(ComponentInputMapInterface::Item *const item)=0 | ComponentInputMapInterface | pure virtual
added(Item *item) const | ComponentInputMapInterface | signal
begin()=0 | ComponentInputMapInterface | pure virtual
begin() const =0 | ComponentInputMapInterface | pure virtual
clear()=0 | ComponentInputMapInterface | pure virtual
cleared() const | ComponentInputMapInterface | signal
contains(ComponentInputMapInterface::ID const &id) const =0 | ComponentInputMapInterface | pure virtual
contains(ComponentInputMapInterface::Item *const item) const =0 | ComponentInputMapInterface | pure virtual
contains(ComponentInputMapInterface::Index const &index) const =0 | ComponentInputMapInterface | pure virtual
count() const =0 | ComponentInputMapInterface | pure virtual
createInput() const =0 | ComponentInputMapInterface | pure virtual
end()=0 | ComponentInputMapInterface | pure virtual
end() const =0 | ComponentInputMapInterface | pure virtual
generateID() const =0 | ComponentInputMapInterface | pure virtual
getID(ComponentInputMapInterface::Item *const item) const =0 | ComponentInputMapInterface | pure virtual
getID(ComponentInputMapInterface::Index const &index) const =0 | ComponentInputMapInterface | pure virtual
getIndex(ComponentInputMapInterface::ID const &id) const =0 | ComponentInputMapInterface | pure virtual
getIndex(ComponentInputMapInterface::Item *const item) const =0 | ComponentInputMapInterface | pure virtual
getItem(ComponentInputMapInterface::ID const &id) const =0 | ComponentInputMapInterface | pure virtual
getItem(ComponentInputMapInterface::Index const &index) const =0 | ComponentInputMapInterface | pure virtual
ID typedef | ComponentInputMapInterface |
Item typedef | ComponentInputMapInterface |
Map typedef | ComponentInputMapInterface |
modifiedID() const | ComponentInputMapInterface | signal
remove(ComponentInputMapInterface::ID const &id)=0 | ComponentInputMapInterface | pure virtual
remove(ComponentInputMapInterface::Item *const item)=0 | ComponentInputMapInterface | pure virtual
remove(ComponentInputMapInterface::Index const &index)=0 | ComponentInputMapInterface | pure virtual
removed(Item *item) const | ComponentInputMapInterface | signal
setID(ComponentInputMapInterface::Item *const item, ComponentInputMapInterface::ID const &id)=0 | ComponentInputMapInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentInterface Class Reference

Public Types | Public Member Functions | List of all members
ComponentInterface Class Referenceabstract

This class manages creating new component and also creating the map which registers created components. More...

Inherits QObject, and ServiceInterface< Interface, ID >.

Public Types

using | Item = ComponentItemInterface
The component.
using | Map = ComponentMapInterface
The map for registering components.

Public Member Functions

virtual ComponentInterface::Item * | createComponentItem (QObject *const parent) const =0
Creates the object defining a component with as parent object parent. More...
virtual ComponentInterface::Map * | createComponentMap (QObject *const parent) const =0
Creates a map to register components which is owned by the parent object parent. More...

Detailed Description

This class manages creating new component and also creating the map which registers created components.

Definition at line 34 of file ComponentInterface.h.

Member Function Documentation

◆ createComponentItem()

virtual ComponentInterface::Item* ComponentInterface::createComponentItem ( QObject *const parent ) const
pure virtual

Creates the object defining a component with as parent object parent.

Parameters
[in] parent The object parent (e.g. Component Generator).
Returns
The new component created.

◆ createComponentMap()

virtual ComponentInterface::Map* ComponentInterface::createComponentMap ( QObject *const parent ) const
pure virtual

Creates a map to register components which is owned by the parent object parent.

Parameters
[in] parent The object parent (e.g. Manager of components library).
Returns
The map registering components.
The documentation for this class was generated from the following file:
  • ComponentInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ComponentInterface Member List

This is the complete list of members for ComponentInterface, including all inherited members.

createComponentItem(QObject *const parent) const =0 | ComponentInterface | pure virtual
createComponentMap(QObject *const parent) const =0 | ComponentInterface | pure virtual
Item typedef | ComponentInterface |
Map typedef | ComponentInterface |
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentItemInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
ComponentItemInterface Class Referenceabstract

This class defines the items constituing a component: More...

Inherits QObject.

Public Types

using | InputMap = ComponentInputMapInterface
The container registering the inputs of the component.
using | Name = QString
The component's key name.
using | OutputMap = ComponentOutputMapInterface
The container registering the outputs of the component.
using | ParameterMap = ComponentParameterMapInterface
The container registering the parameters of the component.
using | Schedule = ComponentScheduleInterface
The object registering the parameters related to simulation schedule.
using | Title = QString
The Title of the component.

Signals

void | cleared () const
Triggers signal to inform that a component has been reset successfully (used to update the Window View of the Component Generator when users pressing on <New component>=""> button).
void | loaded () const
Triggers signal to inform that a component has been loaded successfully (e.g. used to update the Window View of the Component Generator when users pressing on <Load component>=""> button).
void | modifiedName ()
Triggers signal to inform that the name (library) of a component has been modified.
void | modifiedTitle () const
Triggers signal to inform that the title of a component has been modified.
void | modifiedType () const
Triggers signal to inform that the type of a component has been modified.
void | saved () const
Triggers signal to inform that a component has been saved successfully.

Public Member Functions

virtual bool | clear ()=0
Clears the items constituing the component. (e.g. function called when users pressing on <New component>=""> button in the Window View of the Component Generator). More...
virtual ComponentItemInterface::InputMap * | getInputs () const =0
Gets the inputs of the current registered component. More...
virtual ComponentItemInterface::Name | getName () const =0
Gets the key name of the current component registered in the container (map). More...
virtual ComponentItemInterface::OutputMap * | getOutputs () const =0
Gets the outputs of the current registered component. More...
virtual ComponentItemInterface::ParameterMap * | getParameters () const =0
Gets the parameters of the current registered component. More...
virtual ComponentItemInterface::Schedule * | getSchedule () const =0
Gets the simulation schedule related parameters of the current registered component. More...
virtual ComponentItemInterface::Title | getTitle () const =0
Gets the title of the current registered component. More...
virtual ComponentItemInterface::Type | getType () const =0
Gets the type of the current registered component. More...
virtual bool | load (QString const &filepath)=0
Loads a component from a file located in the given path filepath. (e.g. function called when users pressing on <Load component>=""> button in the Window View of the Component Generator). More...
virtual bool | save (QString const &filepath) const =0
Saves a component to a file stored in the given path filepath. (e.g. function called when users pressing on <Save component>=""> button in the Window View of the Component Generator). More...
virtual bool | setTitle (ComponentItemInterface::Title const &title)=0
Sets a title to the current registered component. More...
virtual bool | setType (ComponentItemInterface::Type const &type)=0
Sets the type of the current registered component. More...

Detailed Description

This class defines the items constituing a component:

  • the key name (must be UNIQUE)
  • the type: Action or Algorithm or Sensor
  • the title (modifiable)
  • the schedule: Priority, Offset, Cycle Time, Response Time
  • the parameters
  • the inputs
  • the outputs

Definition at line 40 of file ComponentItemInterface.h.

Member Function Documentation

◆ clear()

virtual bool ComponentItemInterface::clear ( )
pure virtual

Clears the items constituing the component. (e.g. function called when users pressing on <New component>=""> button in the Window View of the Component Generator).

Returns
True if component items successfully cleared.

◆ getInputs()

virtual ComponentItemInterface::InputMap* ComponentItemInterface::getInputs ( ) const
pure virtual

Gets the inputs of the current registered component.

Returns
The inputs of the component.

◆ getName()

virtual ComponentItemInterface::Name ComponentItemInterface::getName ( ) const
pure virtual

Gets the key name of the current component registered in the container (map).

Returns
The key name of the component.

◆ getOutputs()

virtual ComponentItemInterface::OutputMap* ComponentItemInterface::getOutputs ( ) const
pure virtual

Gets the outputs of the current registered component.

Returns
The outputs of the component.

◆ getParameters()

virtual ComponentItemInterface::ParameterMap* ComponentItemInterface::getParameters ( ) const
pure virtual

Gets the parameters of the current registered component.

Returns
The parameters of the component.

◆ getSchedule()

virtual ComponentItemInterface::Schedule* ComponentItemInterface::getSchedule ( ) const
pure virtual

Gets the simulation schedule related parameters of the current registered component.

Returns
The schedule of the component.

◆ getTitle()

virtual ComponentItemInterface::Title ComponentItemInterface::getTitle ( ) const
pure virtual

Gets the title of the current registered component.

Returns
The title of the component.

◆ getType()

virtual ComponentItemInterface::Type ComponentItemInterface::getType ( ) const
pure virtual

Gets the type of the current registered component.

Returns
The type of the component.

◆ load()

virtual bool ComponentItemInterface::load ( QString const & filepath )
pure virtual

Loads a component from a file located in the given path filepath. (e.g. function called when users pressing on <Load component>=""> button in the Window View of the Component Generator).

Parameters
[in] filepath The path locating the file defining the component.
Returns
True if component successfully loaded.

◆ save()

virtual bool ComponentItemInterface::save ( QString const & filepath ) const
pure virtual

Saves a component to a file stored in the given path filepath. (e.g. function called when users pressing on <Save component>=""> button in the Window View of the Component Generator).

Parameters
[in] filepath The path for storing the file defining the component.
Returns
True if component successfully saved.

◆ setTitle()

virtual bool ComponentItemInterface::setTitle ( ComponentItemInterface::Title const & title )
pure virtual

Sets a title to the current registered component.

Returns
True if the title successfully modified.

◆ setType()

virtual bool ComponentItemInterface::setType ( ComponentItemInterface::Type const & type )
pure virtual

Sets the type of the current registered component.

Returns
True if the component type successfully modified.
The documentation for this class was generated from the following file:
  • ComponentItemInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ComponentItemInterface Member List

This is the complete list of members for ComponentItemInterface, including all inherited members.

clear()=0 | ComponentItemInterface | pure virtual
cleared() const | ComponentItemInterface | signal
getInputs() const =0 | ComponentItemInterface | pure virtual
getName() const =0 | ComponentItemInterface | pure virtual
getOutputs() const =0 | ComponentItemInterface | pure virtual
getParameters() const =0 | ComponentItemInterface | pure virtual
getSchedule() const =0 | ComponentItemInterface | pure virtual
getTitle() const =0 | ComponentItemInterface | pure virtual
getType() const =0 | ComponentItemInterface | pure virtual
InputMap typedef | ComponentItemInterface |
load(QString const &filepath)=0 | ComponentItemInterface | pure virtual
loaded() const | ComponentItemInterface | signal
modifiedName() | ComponentItemInterface | signal
modifiedTitle() const | ComponentItemInterface | signal
modifiedType() const | ComponentItemInterface | signal
Name typedef | ComponentItemInterface |
OutputMap typedef | ComponentItemInterface |
ParameterMap typedef | ComponentItemInterface |
save(QString const &filepath) const =0 | ComponentItemInterface | pure virtual
saved() const | ComponentItemInterface | signal
Schedule typedef | ComponentItemInterface |
setTitle(ComponentItemInterface::Title const &title)=0 | ComponentItemInterface | pure virtual
setType(ComponentItemInterface::Type const &type)=0 | ComponentItemInterface | pure virtual
Title typedef | ComponentItemInterface |
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentMapInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
ComponentMapInterface Class Referenceabstract

This class manages the registration and deregistration of objects defining a component (component related-objects) using as identifier a key name. More...

Inherits QObject.

Public Types

using | Item = ComponentItemInterface
The object defining the component.
using | Map = QMap< Name, Item * >
The container registering components.
using | Name = ComponentItemInterface::Name
The component's key name.

Signals

void | added () const
Triggers signal to inform that a component has been registered.
void | modifiedName () const
Triggers signal to inform that a key name of a registered component has been modified.
void | removed () const
Triggers signal to inform that a component has been deregistered.

Public Member Functions

virtual bool | add (ComponentMapInterface::Name const &name)=0
Registers a new component related-object under the key name name. More...
virtual bool | add (ComponentMapInterface::Name const &name, ComponentMapInterface::Item *const item)=0
Registers a given component related-object item with the key name name. More...
virtual bool | add (ComponentMapInterface::Name const &name, QString const &filepath)=0
Registers a component related-object item with the key name name from a file located in the given path filepath (e.g. function called for loading a library of components). More...
virtual ComponentMapInterface::Iterator | begin ()=0
Gets an iterator pointing at the first component related-object in the map. More...
virtual ComponentMapInterface::ConstIterator | begin () const =0
Gets an iterator pointing at the first component related-object in the map (use for read-only since pointing at constant values). More...
virtual bool | clear ()=0
Removes all the component related-objects registered (clear the container). More...
virtual bool | contains (ComponentMapInterface::Name const &name) const =0
Verifies if the container (map) contains the component related-object under the key name name. More...
virtual bool | contains (ComponentMapInterface::Item *const item) const =0
Verifies if the container (map) contains the component related-object item. More...
virtual bool | contains (ComponentMapInterface::Index const &index) const =0
Verifies if there is a component related-object at the index position index in the container (map). More...
virtual int | count () const =0
Counts the number of component related-objects registered. More...
virtual ComponentMapInterface::Iterator | end ()=0
Gets an iterator pointing at the end of the map after the last component related-object. More...
virtual ComponentMapInterface::ConstIterator | end () const =0
Gets an iterator pointing at the end of the map after the last component related-object (use for read-only). More...
virtual ComponentMapInterface::Index | getIndex (ComponentMapInterface::Name const &name) const =0
Gets the index position in the container (map) of the component related-object with the key name name. More...
virtual ComponentMapInterface::Index | getIndex (ComponentMapInterface::Item *const item) const =0
Gets the index position of the component related-object item in the container (map). More...
virtual ComponentMapInterface::Item * | getItem (ComponentMapInterface::Name const &name) const =0
Gets the component related-object under the key name name. More...
virtual ComponentMapInterface::Item * | getItem (ComponentMapInterface::Index const &index) const =0
Gets the component related-object at the index position index in the container (map). More...
virtual ComponentMapInterface::Name | getName (ComponentMapInterface::Item *const item) const =0
Gets the key name of the component related-object item from the container (map). More...
virtual ComponentMapInterface::Name | getName (ComponentMapInterface::Index const &index) const =0
Gets the key name of the component related-object in the index position index of the container (map). More...
virtual bool | remove (ComponentMapInterface::Name const &name)=0
Deregisters a component related-object under the key name name. More...
virtual bool | remove (ComponentMapInterface::Item *const item)=0
Deregisters the component related-object item. More...
virtual bool | remove (ComponentMapInterface::Index const &index)=0
Deregisters the component related-object at the index position index in the container (map). More...
virtual bool | setName (ComponentMapInterface::Item *const item, ComponentMapInterface::Name const &name)=0
Sets a key name name for the component related-object item registered in the container (map). More...

Detailed Description

This class manages the registration and deregistration of objects defining a component (component related-objects) using as identifier a key name.

Definition at line 32 of file ComponentMapInterface.h.

Member Function Documentation

◆ add() [1/3]

virtual bool ComponentMapInterface::add ( ComponentMapInterface::Name const & name )
pure virtual

Registers a new component related-object under the key name name.

Parameters
[in] name The key name of the new component.
Returns
True if object successfully registered.

◆ add() [2/3]

virtual bool ComponentMapInterface::add | ( | ComponentMapInterface::Name const & | name,
 |  | ComponentMapInterface::Item *const | item
 | ) |  |
pure virtual

Registers a given component related-object item with the key name name.

Parameters
[in] | name | The key name of the new component.
[in] | item | The object defining the component.
Returns
True if object successfully registered.

◆ add() [3/3]

virtual bool ComponentMapInterface::add | ( | ComponentMapInterface::Name const & | name,
 |  | QString const & | filepath
 | ) |  |
pure virtual

Registers a component related-object item with the key name name from a file located in the given path filepath (e.g. function called for loading a library of components).

Parameters
[in] | name | The key name of the new component.
[in] | filepath | The path locating the file defining the component.
Returns
True if object successfully registered.

◆ begin() [1/2]

virtual ComponentMapInterface::Iterator ComponentMapInterface::begin ( )
pure virtual

Gets an iterator pointing at the first component related-object in the map.

Returns
The iterator pointing at the first object in the map.

◆ begin() [2/2]

virtual ComponentMapInterface::ConstIterator ComponentMapInterface::begin ( ) const
pure virtual

Gets an iterator pointing at the first component related-object in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

◆ clear()

virtual bool ComponentMapInterface::clear ( )
pure virtual

Removes all the component related-objects registered (clear the container).

Returns
True if all objects successfully removed.

◆ contains() [1/3]

virtual bool ComponentMapInterface::contains ( ComponentMapInterface::Name const & name ) const
pure virtual

Verifies if the container (map) contains the component related-object under the key name name.

Parameters
[in] name The key name of the component.
Returns
True if component already registered.

◆ contains() [2/3]

virtual bool ComponentMapInterface::contains ( ComponentMapInterface::Item *const item ) const
pure virtual

Verifies if the container (map) contains the component related-object item.

Parameters
[in] item The object defining the component.
Returns
True if component already registered.

◆ contains() [3/3]

virtual bool ComponentMapInterface::contains ( ComponentMapInterface::Index const & index ) const
pure virtual

Verifies if there is a component related-object at the index position index in the container (map).

Parameters
[in] index The index position in the map.
Returns
True if component already registered.

◆ count()

virtual int ComponentMapInterface::count ( ) const
pure virtual

Counts the number of component related-objects registered.

Returns
The number of objects registered.

◆ end() [1/2]

virtual ComponentMapInterface::Iterator ComponentMapInterface::end ( )
pure virtual

Gets an iterator pointing at the end of the map after the last component related-object.

Returns
The iterator pointing at the end of the map.

◆ end() [2/2]

virtual ComponentMapInterface::ConstIterator ComponentMapInterface::end ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last component related-object (use for read-only).

Returns
The iterator pointing at the end of the map.

◆ getIndex() [1/2]

virtual ComponentMapInterface::Index ComponentMapInterface::getIndex ( ComponentMapInterface::Name const & name ) const
pure virtual

Gets the index position in the container (map) of the component related-object with the key name name.

Parameters
[in] name The key name of the component.
Returns
The index position of the object in the map.

◆ getIndex() [2/2]

virtual ComponentMapInterface::Index ComponentMapInterface::getIndex ( ComponentMapInterface::Item *const item ) const
pure virtual

Gets the index position of the component related-object item in the container (map).

Parameters
[in] item The object defining the component.
Returns
The index position of the object in the map.

◆ getItem() [1/2]

virtual ComponentMapInterface::Item* ComponentMapInterface::getItem ( ComponentMapInterface::Name const & name ) const
pure virtual

Gets the component related-object under the key name name.

Parameters
[in] name The key name of the component.
Returns
The object defining the component.

◆ getItem() [2/2]

virtual ComponentMapInterface::Item* ComponentMapInterface::getItem ( ComponentMapInterface::Index const & index ) const
pure virtual

Gets the component related-object at the index position index in the container (map).

Parameters
[in] index The index position in the map.
Returns
The object defining the component.

◆ getName() [1/2]

virtual ComponentMapInterface::Name ComponentMapInterface::getName ( ComponentMapInterface::Item *const item ) const
pure virtual

Gets the key name of the component related-object item from the container (map).

Parameters
[in] item The object defining the component.
Returns
The key name of the component.

◆ getName() [2/2]

virtual ComponentMapInterface::Name ComponentMapInterface::getName ( ComponentMapInterface::Index const & index ) const
pure virtual

Gets the key name of the component related-object in the index position index of the container (map).

Parameters
[in] index The index position in the map.
Returns
The key name of the component.

◆ remove() [1/3]

virtual bool ComponentMapInterface::remove ( ComponentMapInterface::Name const & name )
pure virtual

Deregisters a component related-object under the key name name.

Parameters
[in] name The key name of the component.
Returns
True if object successfully deregistered.

◆ remove() [2/3]

virtual bool ComponentMapInterface::remove ( ComponentMapInterface::Item *const item )
pure virtual

Deregisters the component related-object item.

Parameters
[in] item The object defining the component.
Returns
True if object successfully deregistered.

◆ remove() [3/3]

virtual bool ComponentMapInterface::remove ( ComponentMapInterface::Index const & index )
pure virtual

Deregisters the component related-object at the index position index in the container (map).

Parameters
[in] index The index position in the map.
Returns
True if object successfully deregistered.

◆ setName()

virtual bool ComponentMapInterface::setName | ( | ComponentMapInterface::Item *const | item,
 |  | ComponentMapInterface::Name const & | name
 | ) |  |
pure virtual

Sets a key name name for the component related-object item registered in the container (map).

Parameters
[in] | item | The object defining the component.
[in] | name | The key name of the component.
Returns
True if the key name successfully modified.
The documentation for this class was generated from the following file:
  • ComponentMapInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ComponentMapInterface Member List

This is the complete list of members for ComponentMapInterface, including all inherited members.

add(ComponentMapInterface::Name const &name)=0 | ComponentMapInterface | pure virtual
add(ComponentMapInterface::Name const &name, ComponentMapInterface::Item *const item)=0 | ComponentMapInterface | pure virtual
add(ComponentMapInterface::Name const &name, QString const &filepath)=0 | ComponentMapInterface | pure virtual
added() const | ComponentMapInterface | signal
begin()=0 | ComponentMapInterface | pure virtual
begin() const =0 | ComponentMapInterface | pure virtual
clear()=0 | ComponentMapInterface | pure virtual
contains(ComponentMapInterface::Name const &name) const =0 | ComponentMapInterface | pure virtual
contains(ComponentMapInterface::Item *const item) const =0 | ComponentMapInterface | pure virtual
contains(ComponentMapInterface::Index const &index) const =0 | ComponentMapInterface | pure virtual
count() const =0 | ComponentMapInterface | pure virtual
end()=0 | ComponentMapInterface | pure virtual
end() const =0 | ComponentMapInterface | pure virtual
getIndex(ComponentMapInterface::Name const &name) const =0 | ComponentMapInterface | pure virtual
getIndex(ComponentMapInterface::Item *const item) const =0 | ComponentMapInterface | pure virtual
getItem(ComponentMapInterface::Name const &name) const =0 | ComponentMapInterface | pure virtual
getItem(ComponentMapInterface::Index const &index) const =0 | ComponentMapInterface | pure virtual
getName(ComponentMapInterface::Item *const item) const =0 | ComponentMapInterface | pure virtual
getName(ComponentMapInterface::Index const &index) const =0 | ComponentMapInterface | pure virtual
Item typedef | ComponentMapInterface |
Map typedef | ComponentMapInterface |
modifiedName() const | ComponentMapInterface | signal
Name typedef | ComponentMapInterface |
remove(ComponentMapInterface::Name const &name)=0 | ComponentMapInterface | pure virtual
remove(ComponentMapInterface::Item *const item)=0 | ComponentMapInterface | pure virtual
remove(ComponentMapInterface::Index const &index)=0 | ComponentMapInterface | pure virtual
removed() const | ComponentMapInterface | signal
setName(ComponentMapInterface::Item *const item, ComponentMapInterface::Name const &name)=0 | ComponentMapInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentOutputItemInterface Class Reference

Signals | Public Member Functions | List of all members
ComponentOutputItemInterface Class Referenceabstract

This class defines the items constituing an output of a component: More...

Inherits QObject.

Signals

void | cleared () const
Triggers signal to inform that a component output has been successfully removed (used to update the table of outputs in the Window View of the Component Generator when users pressing on Delete button).
void | modifiedTitle () const
Triggers signal to inform that the title of a component output has been modified.
void | modifiedType () const
Triggers signal to inform that the type of a component output has been modified.
void | modifiedUnit () const
Triggers signal to inform that the unit of a component output has been modified.

Public Member Functions

virtual bool | clear ()=0
Resets the items constituing the output of the component. (e.g. function called when users pressing on Delete button of the table of outputs in the Window View of the Component Generator). More...
virtual ComponentOutputItemInterface::ID | getID () const =0
Gets the key identifier of the current registered output. More...
virtual ComponentOutputItemInterface::Title | getTitle () const =0
Gets the title of the current registered output. More...
virtual ComponentOutputItemInterface::Type | getType () const =0
Gets the type of the current registered output. More...
virtual ComponentOutputItemInterface::Unit | getUnit () const =0
Gets the unit of the current registered output. More...
virtual bool | setID (ComponentOutputItemInterface::ID const &id)=0
Sets a key identifier id for the current registered output. More...
virtual bool | setTitle (ComponentOutputItemInterface::Title const &title)=0
Sets the title of the current registered output. More...
virtual bool | setType (ComponentOutputItemInterface::Type const &type)=0
Sets the type of the current registered output. More...
virtual bool | setUnit (ComponentOutputItemInterface::Unit const &unit)=0
Sets the unit of the current registered output. More...

Detailed Description

This class defines the items constituing an output of a component:

  • the key identifier (must be UNIQUE)
  • the type: Boolean or Integer or Float or Double or String
  • the title (modifiable)
  • the unit (should be SI unit)

Definition at line 33 of file ComponentOutputItemInterface.h.

Member Function Documentation

◆ clear()

virtual bool ComponentOutputItemInterface::clear ( )
pure virtual

Resets the items constituing the output of the component. (e.g. function called when users pressing on Delete button of the table of outputs in the Window View of the Component Generator).

Returns
True if output items successfully cleared.

◆ getID()

virtual ComponentOutputItemInterface::ID ComponentOutputItemInterface::getID ( ) const
pure virtual

Gets the key identifier of the current registered output.

Returns
The key identifier of the output.

◆ getTitle()

virtual ComponentOutputItemInterface::Title ComponentOutputItemInterface::getTitle ( ) const
pure virtual

Gets the title of the current registered output.

Returns
The title of the output.

◆ getType()

virtual ComponentOutputItemInterface::Type ComponentOutputItemInterface::getType ( ) const
pure virtual

Gets the type of the current registered output.

Returns
The type of the output.

◆ getUnit()

virtual ComponentOutputItemInterface::Unit ComponentOutputItemInterface::getUnit ( ) const
pure virtual

Gets the unit of the current registered output.

Returns
The unit of the output.

◆ setID()

virtual bool ComponentOutputItemInterface::setID ( ComponentOutputItemInterface::ID const & id )
pure virtual

Sets a key identifier id for the current registered output.

Parameters
[in] id The key identifier of the output.
Returns
True if the output id successfully modified.

◆ setTitle()

virtual bool ComponentOutputItemInterface::setTitle ( ComponentOutputItemInterface::Title const & title )
pure virtual

Sets the title of the current registered output.

Parameters
[in] title The title of the output.
Returns
True if the output title successfully modified.

◆ setType()

virtual bool ComponentOutputItemInterface::setType ( ComponentOutputItemInterface::Type const & type )
pure virtual

Sets the type of the current registered output.

Parameters
[in] type The type of the output.
Returns
True if the output type successfully modified.

◆ setUnit()

virtual bool ComponentOutputItemInterface::setUnit ( ComponentOutputItemInterface::Unit const & unit )
pure virtual

Sets the unit of the current registered output.

Parameters
[in] unit The unit of the output.
Returns
True if the output unit successfully modified.
The documentation for this class was generated from the following file:
  • ComponentOutputItemInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ComponentOutputItemInterface Member List

This is the complete list of members for ComponentOutputItemInterface, including all inherited members.

clear()=0 | ComponentOutputItemInterface | pure virtual
cleared() const | ComponentOutputItemInterface | signal
getID() const =0 | ComponentOutputItemInterface | pure virtual
getTitle() const =0 | ComponentOutputItemInterface | pure virtual
getType() const =0 | ComponentOutputItemInterface | pure virtual
getUnit() const =0 | ComponentOutputItemInterface | pure virtual
modifiedTitle() const | ComponentOutputItemInterface | signal
modifiedType() const | ComponentOutputItemInterface | signal
modifiedUnit() const | ComponentOutputItemInterface | signal
setID(ComponentOutputItemInterface::ID const &id)=0 | ComponentOutputItemInterface | pure virtual
setTitle(ComponentOutputItemInterface::Title const &title)=0 | ComponentOutputItemInterface | pure virtual
setType(ComponentOutputItemInterface::Type const &type)=0 | ComponentOutputItemInterface | pure virtual
setUnit(ComponentOutputItemInterface::Unit const &unit)=0 | ComponentOutputItemInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentOutputMapInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
ComponentOutputMapInterface Class Referenceabstract

This class manages the registration and deregistration of outputs of a component. It provides a map as container with unique identifiers as a keys to sort the outputs. More...

Inherits QObject.

Public Types

using | ID = ComponentOutputItemInterface::ID
The output's key.
using | Item = ComponentOutputItemInterface
The object defining output.
using | Map = QMap< ID, Item * >
The container registering outputs.

Signals

void | added (Item *item) const
Triggers signal to inform that a component output has been registered.
void | cleared () const
Triggers signal to inform that all outputs have been successfully removed from the container (map).
void | modifiedID () const
Triggers signal to inform that a key id of a component output has been modified.
void | removed (Item *item) const
Triggers signal to inform that a component output has been deregistered.

Public Member Functions

virtual bool | add (ComponentOutputMapInterface::ID const &id)=0
Registers a new output related-object under the key identifier id. More...
virtual bool | add (ComponentOutputMapInterface::ID const &id, ComponentOutputMapInterface::Item *const item)=0
Registers a given output related-object item with the key identifier id. More...
virtual bool | add (ComponentOutputMapInterface::Item *const item)=0
Registers a given output related-object item with an automatically generated id. More...
virtual ComponentOutputMapInterface::Iterator | begin ()=0
Gets an iterator pointing at the first component output related-object in the map. More...
virtual ComponentOutputMapInterface::ConstIterator | begin () const =0
Gets an iterator pointing at the first component output related-object in the map (use for read-only since pointing at constant values). More...
virtual bool | clear ()=0
Removes all the output related-objects registered (clear the container). More...
virtual bool | contains (ComponentOutputMapInterface::ID const &id) const =0
Verifies if the container (map) contains the component output related-object under the key identifier id. More...
virtual bool | contains (ComponentOutputMapInterface::Item *const item) const =0
Verifies if the container (map) contains the component output related-object item. More...
virtual bool | contains (ComponentOutputMapInterface::Index const &index) const =0
Verifies if there is a component output related-object at the index position index in the container (map). More...
virtual int | count () const =0
Counts the number of component output related-objects registered. More...
virtual Item * | createOutput () const =0
Creates a component output item and returns a pointer to it. More...
virtual ComponentOutputMapInterface::Iterator | end ()=0
Gets an iterator pointing at the end of the map after the last component output related-object. More...
virtual ComponentOutputMapInterface::ConstIterator | end () const =0
Gets an iterator pointing at the end of the map after the last component output related-object (use for read-only). More...
virtual ComponentOutputMapInterface::ID | generateID () const =0
Generates a unique key identifier for the new output registered in the map. More...
virtual ComponentOutputMapInterface::ID | getID (ComponentOutputMapInterface::Item *const item) const =0
Gets the key identifier of the component output related-object item from the container (map). More...
virtual ComponentOutputMapInterface::ID | getID (ComponentOutputMapInterface::Index const &index) const =0
Gets the key identifier of the component output related-object in the index position index of the container (map). More...
virtual ComponentOutputMapInterface::Index | getIndex (ComponentOutputMapInterface::ID const &id) const =0
Gets the index position in the container (map) of the output related-object with the key identifier id. More...
virtual ComponentOutputMapInterface::Index | getIndex (ComponentOutputMapInterface::Item *const item) const =0
Gets the index position of the component output related-object item in the container (map). More...
virtual ComponentOutputMapInterface::Item * | getItem (ComponentOutputMapInterface::ID const &id) const =0
Gets the output related-object under the key identifier id. More...
virtual ComponentOutputMapInterface::Item * | getItem (ComponentOutputMapInterface::Index const &index) const =0
Gets the output related-object at the index position index in the map. More...
virtual bool | remove (ComponentOutputMapInterface::ID const &id)=0
Deregisters a output related-object under the key identifier id. More...
virtual bool | remove (ComponentOutputMapInterface::Item *const item)=0
Deregisters the output related-object item. More...
virtual bool | remove (ComponentOutputMapInterface::Index const &index)=0
Deregisters the output related-object at the index position index in the container (map). More...
virtual bool | setID (ComponentOutputMapInterface::Item *const item, ComponentOutputMapInterface::ID const &id)=0
Sets a key identifier id for the component output related-object item registered in the container (map). More...

Detailed Description

This class manages the registration and deregistration of outputs of a component. It provides a map as container with unique identifiers as a keys to sort the outputs.

Definition at line 32 of file ComponentOutputMapInterface.h.

Member Function Documentation

◆ add() [1/3]

virtual bool ComponentOutputMapInterface::add ( ComponentOutputMapInterface::ID const & id )
pure virtual

Registers a new output related-object under the key identifier id.

Parameters
[in] id The key id of the new output.
Returns
True if output successfully registered.

◆ add() [2/3]

virtual bool ComponentOutputMapInterface::add | ( | ComponentOutputMapInterface::ID const & | id,
 |  | ComponentOutputMapInterface::Item *const | item
 | ) |  |
pure virtual

Registers a given output related-object item with the key identifier id.

Parameters
[in] | id | The key id of the new output.
[in] | item | The object defining the output.
Returns
True if output successfully registered.

◆ add() [3/3]

virtual bool ComponentOutputMapInterface::add ( ComponentOutputMapInterface::Item *const item )
pure virtual

Registers a given output related-object item with an automatically generated id.

Parameters
[in] item The object defining the output.
Returns
True if input successfully registered.

◆ begin() [1/2]

virtual ComponentOutputMapInterface::Iterator ComponentOutputMapInterface::begin ( )
pure virtual

Gets an iterator pointing at the first component output related-object in the map.

Returns
The iterator pointing at the first output in the map.

◆ begin() [2/2]

virtual ComponentOutputMapInterface::ConstIterator ComponentOutputMapInterface::begin ( ) const
pure virtual

Gets an iterator pointing at the first component output related-object in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first output in the map.

◆ clear()

virtual bool ComponentOutputMapInterface::clear ( )
pure virtual

Removes all the output related-objects registered (clear the container).

Returns
True if all outputs successfully removed.

◆ contains() [1/3]

virtual bool ComponentOutputMapInterface::contains ( ComponentOutputMapInterface::ID const & id ) const
pure virtual

Verifies if the container (map) contains the component output related-object under the key identifier id.

Parameters
[in] id The key id of the new output.
Returns
True if output already registered.

◆ contains() [2/3]

virtual bool ComponentOutputMapInterface::contains ( ComponentOutputMapInterface::Item *const item ) const
pure virtual

Verifies if the container (map) contains the component output related-object item.

Parameters
[in] item The object defining the output.
Returns
True if output already registered.

◆ contains() [3/3]

virtual bool ComponentOutputMapInterface::contains ( ComponentOutputMapInterface::Index const & index ) const
pure virtual

Verifies if there is a component output related-object at the index position index in the container (map).

Parameters
[in] index The index position in the map.
Returns
True if output already registered.

◆ count()

virtual int ComponentOutputMapInterface::count ( ) const
pure virtual

Counts the number of component output related-objects registered.

Returns
The number of outputs registered.

◆ createOutput()

virtual Item* ComponentOutputMapInterface::createOutput ( ) const
pure virtual

Creates a component output item and returns a pointer to it.

Note
The item is not registered in this map!
Returns
a pointer to the newly created output item

◆ end() [1/2]

virtual ComponentOutputMapInterface::Iterator ComponentOutputMapInterface::end ( )
pure virtual

Gets an iterator pointing at the end of the map after the last component output related-object.

Returns
The iterator pointing at the end of the map.

◆ end() [2/2]

virtual ComponentOutputMapInterface::ConstIterator ComponentOutputMapInterface::end ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last component output related-object (use for read-only).

Returns
The iterator pointing at the end of the map.

◆ generateID()

virtual ComponentOutputMapInterface::ID ComponentOutputMapInterface::generateID ( ) const
pure virtual

Generates a unique key identifier for the new output registered in the map.

Returns
The key identifier of the output.

◆ getID() [1/2]

virtual ComponentOutputMapInterface::ID ComponentOutputMapInterface::getID ( ComponentOutputMapInterface::Item *const item ) const
pure virtual

Gets the key identifier of the component output related-object item from the container (map).

Parameters
[in] item The object defining the output.
Returns
The key identifier of the output.

◆ getID() [2/2]

virtual ComponentOutputMapInterface::ID ComponentOutputMapInterface::getID ( ComponentOutputMapInterface::Index const & index ) const
pure virtual

Gets the key identifier of the component output related-object in the index position index of the container (map).

Parameters
[in] index The index position in the map.
Returns
The key identifier of the output.

◆ getIndex() [1/2]

virtual ComponentOutputMapInterface::Index ComponentOutputMapInterface::getIndex ( ComponentOutputMapInterface::ID const & id ) const
pure virtual

Gets the index position in the container (map) of the output related-object with the key identifier id.

Parameters
[in] id The key id of the output.
Returns
The index position of the output in the map.

◆ getIndex() [2/2]

virtual ComponentOutputMapInterface::Index ComponentOutputMapInterface::getIndex ( ComponentOutputMapInterface::Item *const item ) const
pure virtual

Gets the index position of the component output related-object item in the container (map).

Parameters
[in] item The object defining the output.
Returns
The index position of the output in the map.

◆ getItem() [1/2]

virtual ComponentOutputMapInterface::Item* ComponentOutputMapInterface::getItem ( ComponentOutputMapInterface::ID const & id ) const
pure virtual

Gets the output related-object under the key identifier id.

Parameters
[in] id The key identifier of the output.
Returns
The object defining the output.

◆ getItem() [2/2]

virtual ComponentOutputMapInterface::Item* ComponentOutputMapInterface::getItem ( ComponentOutputMapInterface::Index const & index ) const
pure virtual

Gets the output related-object at the index position index in the map.

Parameters
[in] index The index position in the map.
Returns
The object defining the output.

◆ remove() [1/3]

virtual bool ComponentOutputMapInterface::remove ( ComponentOutputMapInterface::ID const & id )
pure virtual

Deregisters a output related-object under the key identifier id.

Parameters
[in] id The key identifier of the output.
Returns
True if output successfully deregistered.

◆ remove() [2/3]

virtual bool ComponentOutputMapInterface::remove ( ComponentOutputMapInterface::Item *const item )
pure virtual

Deregisters the output related-object item.

Parameters
[in] item The object defining the output.
Returns
True if output successfully deregistered.

◆ remove() [3/3]

virtual bool ComponentOutputMapInterface::remove ( ComponentOutputMapInterface::Index const & index )
pure virtual

Deregisters the output related-object at the index position index in the container (map).

Parameters
[in] index The index position in the map.
Returns
True if output successfully deregistered.

◆ setID()

virtual bool ComponentOutputMapInterface::setID | ( | ComponentOutputMapInterface::Item *const | item,
 |  | ComponentOutputMapInterface::ID const & | id
 | ) |  |
pure virtual

Sets a key identifier id for the component output related-object item registered in the container (map).

Parameters
[in] | item | The object defining the output.
[in] | id | The key id of the output.
Returns
True if the key identifier successfully modified.
The documentation for this class was generated from the following file:
  • ComponentOutputMapInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ComponentOutputMapInterface Member List

This is the complete list of members for ComponentOutputMapInterface, including all inherited members.

add(ComponentOutputMapInterface::ID const &id)=0 | ComponentOutputMapInterface | pure virtual
add(ComponentOutputMapInterface::ID const &id, ComponentOutputMapInterface::Item *const item)=0 | ComponentOutputMapInterface | pure virtual
add(ComponentOutputMapInterface::Item *const item)=0 | ComponentOutputMapInterface | pure virtual
added(Item *item) const | ComponentOutputMapInterface | signal
begin()=0 | ComponentOutputMapInterface | pure virtual
begin() const =0 | ComponentOutputMapInterface | pure virtual
clear()=0 | ComponentOutputMapInterface | pure virtual
cleared() const | ComponentOutputMapInterface | signal
contains(ComponentOutputMapInterface::ID const &id) const =0 | ComponentOutputMapInterface | pure virtual
contains(ComponentOutputMapInterface::Item *const item) const =0 | ComponentOutputMapInterface | pure virtual
contains(ComponentOutputMapInterface::Index const &index) const =0 | ComponentOutputMapInterface | pure virtual
count() const =0 | ComponentOutputMapInterface | pure virtual
createOutput() const =0 | ComponentOutputMapInterface | pure virtual
end()=0 | ComponentOutputMapInterface | pure virtual
end() const =0 | ComponentOutputMapInterface | pure virtual
generateID() const =0 | ComponentOutputMapInterface | pure virtual
getID(ComponentOutputMapInterface::Item *const item) const =0 | ComponentOutputMapInterface | pure virtual
getID(ComponentOutputMapInterface::Index const &index) const =0 | ComponentOutputMapInterface | pure virtual
getIndex(ComponentOutputMapInterface::ID const &id) const =0 | ComponentOutputMapInterface | pure virtual
getIndex(ComponentOutputMapInterface::Item *const item) const =0 | ComponentOutputMapInterface | pure virtual
getItem(ComponentOutputMapInterface::ID const &id) const =0 | ComponentOutputMapInterface | pure virtual
getItem(ComponentOutputMapInterface::Index const &index) const =0 | ComponentOutputMapInterface | pure virtual
ID typedef | ComponentOutputMapInterface |
Item typedef | ComponentOutputMapInterface |
Map typedef | ComponentOutputMapInterface |
modifiedID() const | ComponentOutputMapInterface | signal
remove(ComponentOutputMapInterface::ID const &id)=0 | ComponentOutputMapInterface | pure virtual
remove(ComponentOutputMapInterface::Item *const item)=0 | ComponentOutputMapInterface | pure virtual
remove(ComponentOutputMapInterface::Index const &index)=0 | ComponentOutputMapInterface | pure virtual
removed(Item *item) const | ComponentOutputMapInterface | signal
setID(ComponentOutputMapInterface::Item *const item, ComponentOutputMapInterface::ID const &id)=0 | ComponentOutputMapInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentParameterItemInterface Class Reference

Signals | Public Member Functions | List of all members
ComponentParameterItemInterface Class Referenceabstract

This class defines the items constituing a parameter of a component: More...

Inherits QObject.

Signals

void | cleared () const
Triggers signal to inform that a component parameter has been successfully removed (used to update the table of parameters in the Window View of the Component Generator when users pressing on Delete button).
void | modifiedTitle () const
Triggers signal to inform that the title of a component parameter has been modified.
void | modifiedType () const
Triggers signal to inform that the type of a component parameter has been modified.
void | modifiedUnit () const
Triggers signal to inform that the unit of a component parameter has been modified.
void | modifiedValue () const
Triggers signal to inform that the value of a component parameter has been modified.

Public Member Functions

virtual bool | clear ()=0
Resets the items constituing the parameter of the component. (e.g. function called when users pressing on Delete button of the table of parameters in the Window View of the Component Generator). More...
virtual ComponentParameterItemInterface::ID | getID () const =0
Gets the key identifier of the current registered parameter. More...
virtual ComponentParameterItemInterface::Title | getTitle () const =0
Gets the title of the current registered parameter. More...
virtual ComponentParameterItemInterface::Type | getType () const =0
Gets the type of the current registered parameter. More...
virtual ComponentParameterItemInterface::Unit | getUnit () const =0
Gets the unit of the current registered parameter. More...
virtual ComponentParameterItemInterface::Value | getValue () const =0
Gets the value of the current registered parameter. More...
virtual bool | setID (ComponentParameterItemInterface::ID const &id)=0
Sets a key identifier id for the current registered parameter. More...
virtual bool | setTitle (ComponentParameterItemInterface::Title const &title)=0
Sets the title of the current registered parameter. More...
virtual bool | setType (ComponentParameterItemInterface::Type const &type)=0
Sets the type of the current registered parameter. More...
virtual bool | setUnit (ComponentParameterItemInterface::Unit const &unit)=0
Sets the unit of the current registered parameter. More...
virtual bool | setValue (ComponentParameterItemInterface::Value const &value)=0
Sets the value of the current registered parameter. More...

Detailed Description

This class defines the items constituing a parameter of a component:

  • the key identifier (must be UNIQUE)
  • the type: Boolean or Integer or Float or Double or String
  • the title (modifiable)
  • the unit (should be SI unit)
  • the value

Definition at line 34 of file ComponentParameterItemInterface.h.

Member Function Documentation

◆ clear()

virtual bool ComponentParameterItemInterface::clear ( )
pure virtual

Resets the items constituing the parameter of the component. (e.g. function called when users pressing on Delete button of the table of parameters in the Window View of the Component Generator).

Returns
True if parameter items successfully cleared.

◆ getID()

virtual ComponentParameterItemInterface::ID ComponentParameterItemInterface::getID ( ) const
pure virtual

Gets the key identifier of the current registered parameter.

Returns
The key identifier of the parameter.

◆ getTitle()

virtual ComponentParameterItemInterface::Title ComponentParameterItemInterface::getTitle ( ) const
pure virtual

Gets the title of the current registered parameter.

Returns
The title of the parameter.

◆ getType()

virtual ComponentParameterItemInterface::Type ComponentParameterItemInterface::getType ( ) const
pure virtual

Gets the type of the current registered parameter.

Returns
The type of the parameter.

◆ getUnit()

virtual ComponentParameterItemInterface::Unit ComponentParameterItemInterface::getUnit ( ) const
pure virtual

Gets the unit of the current registered parameter.

Returns
The unit of the parameter.

◆ getValue()

virtual ComponentParameterItemInterface::Value ComponentParameterItemInterface::getValue ( ) const
pure virtual

Gets the value of the current registered parameter.

Returns
The value of the parameter.

◆ setID()

virtual bool ComponentParameterItemInterface::setID ( ComponentParameterItemInterface::ID const & id )
pure virtual

Sets a key identifier id for the current registered parameter.

Parameters
[in] id The key identifier of the parameter.
Returns
True if the parameter id successfully modified.

◆ setTitle()

virtual bool ComponentParameterItemInterface::setTitle ( ComponentParameterItemInterface::Title const & title )
pure virtual

Sets the title of the current registered parameter.

Parameters
[in] title The title of the parameter.
Returns
True if the parameter title successfully modified.

◆ setType()

virtual bool ComponentParameterItemInterface::setType ( ComponentParameterItemInterface::Type const & type )
pure virtual

Sets the type of the current registered parameter.

Parameters
[in] type The type of the parameter.
Returns
True if the parameter type successfully modified.

◆ setUnit()

virtual bool ComponentParameterItemInterface::setUnit ( ComponentParameterItemInterface::Unit const & unit )
pure virtual

Sets the unit of the current registered parameter.

Parameters
[in] unit The unit of the parameter.
Returns
True if the parameter unit successfully modified.

◆ setValue()

virtual bool ComponentParameterItemInterface::setValue ( ComponentParameterItemInterface::Value const & value )
pure virtual

Sets the value of the current registered parameter.

Parameters
[in] value The value of the parameter.
Returns
True if the parameter value successfully modified.
The documentation for this class was generated from the following file:
  • ComponentParameterItemInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ComponentParameterItemInterface Member List

This is the complete list of members for ComponentParameterItemInterface, including all inherited members.

clear()=0 | ComponentParameterItemInterface | pure virtual
cleared() const | ComponentParameterItemInterface | signal
getID() const =0 | ComponentParameterItemInterface | pure virtual
getTitle() const =0 | ComponentParameterItemInterface | pure virtual
getType() const =0 | ComponentParameterItemInterface | pure virtual
getUnit() const =0 | ComponentParameterItemInterface | pure virtual
getValue() const =0 | ComponentParameterItemInterface | pure virtual
modifiedTitle() const | ComponentParameterItemInterface | signal
modifiedType() const | ComponentParameterItemInterface | signal
modifiedUnit() const | ComponentParameterItemInterface | signal
modifiedValue() const | ComponentParameterItemInterface | signal
setID(ComponentParameterItemInterface::ID const &id)=0 | ComponentParameterItemInterface | pure virtual
setTitle(ComponentParameterItemInterface::Title const &title)=0 | ComponentParameterItemInterface | pure virtual
setType(ComponentParameterItemInterface::Type const &type)=0 | ComponentParameterItemInterface | pure virtual
setUnit(ComponentParameterItemInterface::Unit const &unit)=0 | ComponentParameterItemInterface | pure virtual
setValue(ComponentParameterItemInterface::Value const &value)=0 | ComponentParameterItemInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentParameterMapInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
ComponentParameterMapInterface Class Referenceabstract

This class manages the registration and deregistration of parameters of a component. It provides a map as container with unique identifiers as a keys to sort the parameters. More...

Inherits QObject.

Public Types

using | ID = ComponentParameterItemInterface::ID
The parameter's key.
using | Item = ComponentParameterItemInterface
The object defining the parameter.
using | Map = QMap< ID, Item * >
The container registering parameters.

Signals

void | added (Item *item) const
Triggers signal to inform that a component parameter has been registered.
void | cleared () const
Triggers signal to inform that all parameters have been successfully removed from the container (map).
void | modifiedID () const
Triggers signal to inform that a key id of a component parameter has been modified.
void | removed (Item *item) const
Triggers signal to inform that a component parameter has been deregistered.

Public Member Functions

virtual bool | add (ComponentParameterMapInterface::Item *const item)=0
Registers the given parameter under an automatically generated key. More...
virtual bool | add (ComponentParameterMapInterface::ID const &id)=0
Registers a new paramter related-object under the key identifier id. More...
virtual bool | add (ComponentParameterMapInterface::ID const &id, ComponentParameterMapInterface::Item *const item)=0
Registers a given parameter related-object item with the key identifier id. More...
virtual ComponentParameterMapInterface::Iterator | begin ()=0
Gets an iterator pointing at the first component parameter related-object in the map. More...
virtual ComponentParameterMapInterface::ConstIterator | begin () const =0
Gets an iterator pointing at the first component parameter related-object in the map (use for read-only since pointing at constant values). More...
virtual bool | clear ()=0
Removes all the paramter related-objects registered (clear the container). More...
virtual bool | contains (ComponentParameterMapInterface::ID const &id) const =0
Verifies if the container (map) contains the component parameter related-object under the key identifier id. More...
virtual bool | contains (ComponentParameterMapInterface::Item *const item) const =0
Verifies if the container (map) contains the component parameter related-object item. More...
virtual bool | contains (ComponentParameterMapInterface::Index const &index) const =0
Verifies if there is a component parameter related-object at the index position index in the container (map). More...
virtual int | count () const =0
Counts the number of component parameter related-objects registered. More...
virtual ComponentParameterMapInterface::Item * | createParameter () const =0
Creates a new parameter object and returns a pointer to it. The parameter is not added to this map. More...
virtual ComponentParameterMapInterface::Iterator | end ()=0
Gets an iterator pointing at the end of the map after the last component parameter related-object. More...
virtual ComponentParameterMapInterface::ConstIterator | end () const =0
Gets an iterator pointing at the end of the map after the last component parameter related-object (use for read-only). More...
virtual ComponentParameterMapInterface::ID | generateID () const =0
Generates a unique key identifier for the new parameter registered in the container (map). More...
virtual ComponentParameterMapInterface::ID | getID (ComponentParameterMapInterface::Item *const item) const =0
Gets the key identifier of the component parameter related-object item from the container (map). More...
virtual ComponentParameterMapInterface::ID | getID (ComponentParameterMapInterface::Index const &index) const =0
Gets the key identifier of the component parameter related-object in the index position index of the container (map). More...
virtual ComponentParameterMapInterface::Index | getIndex (ComponentParameterMapInterface::ID const &id) const =0
Gets the index position in the container (map) of the component parameter related-object with the key identifier id. More...
virtual ComponentParameterMapInterface::Index | getIndex (ComponentParameterMapInterface::Item *const item) const =0
Gets the index position of the component parameter related-object item in the container (map). More...
virtual ComponentParameterMapInterface::Item * | getItem (ComponentParameterMapInterface::ID const &id) const =0
Gets the parameter related-object under the key identifier id. More...
virtual ComponentParameterMapInterface::Item * | getItem (ComponentParameterMapInterface::Index const &index) const =0
Gets the parameter related-object at the index position index in the container (map). More...
virtual bool | remove (ComponentParameterMapInterface::ID const &id)=0
Deregisters a parameter related-object under the key identifier id. More...
virtual bool | remove (ComponentParameterMapInterface::Item *const item)=0
Deregisters the parameter related-object item. More...
virtual bool | remove (ComponentParameterMapInterface::Index const &index)=0
Deregisters the parameter related-object at the index position index in the container (map). More...
virtual bool | setID (ComponentParameterMapInterface::Item *const item, ComponentParameterMapInterface::ID const &id)=0
Sets a key identifier id for the component parameter related-object item registered in the container (map). More...

Detailed Description

This class manages the registration and deregistration of parameters of a component. It provides a map as container with unique identifiers as a keys to sort the parameters.

Definition at line 33 of file ComponentParameterMapInterface.h.

Member Function Documentation

◆ add() [1/3]

virtual bool ComponentParameterMapInterface::add ( ComponentParameterMapInterface::Item *const item )
pure virtual

Registers the given parameter under an automatically generated key.

Parameters
[in] item The key id of the new parameter.
Returns
True if parameter successfully registered.

◆ add() [2/3]

virtual bool ComponentParameterMapInterface::add ( ComponentParameterMapInterface::ID const & id )
pure virtual

Registers a new paramter related-object under the key identifier id.

Parameters
[in] id The key id of the new parameter.
Returns
True if parameter successfully registered.

◆ add() [3/3]

virtual bool ComponentParameterMapInterface::add | ( | ComponentParameterMapInterface::ID const & | id,
 |  | ComponentParameterMapInterface::Item *const | item
 | ) |  |
pure virtual

Registers a given parameter related-object item with the key identifier id.

Parameters
[in] | id | The key id of the new parameter.
[in] | item | The object defining the parameter.
Returns
True if parameter successfully registered.

◆ begin() [1/2]

virtual ComponentParameterMapInterface::Iterator ComponentParameterMapInterface::begin ( )
pure virtual

Gets an iterator pointing at the first component parameter related-object in the map.

Returns
The iterator pointing at the first parameter in the map.

◆ begin() [2/2]

virtual ComponentParameterMapInterface::ConstIterator ComponentParameterMapInterface::begin ( ) const
pure virtual

Gets an iterator pointing at the first component parameter related-object in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first parameter in the map.

◆ clear()

virtual bool ComponentParameterMapInterface::clear ( )
pure virtual

Removes all the paramter related-objects registered (clear the container).

Returns
True if all parameters successfully removed.

◆ contains() [1/3]

virtual bool ComponentParameterMapInterface::contains ( ComponentParameterMapInterface::ID const & id ) const
pure virtual

Verifies if the container (map) contains the component parameter related-object under the key identifier id.

Parameters
[in] id The key id of the new parameter.
Returns
True if parameter already registered.

◆ contains() [2/3]

virtual bool ComponentParameterMapInterface::contains ( ComponentParameterMapInterface::Item *const item ) const
pure virtual

Verifies if the container (map) contains the component parameter related-object item.

Parameters
[in] item The object defining the parameter.
Returns
True if parameter already registered.

◆ contains() [3/3]

virtual bool ComponentParameterMapInterface::contains ( ComponentParameterMapInterface::Index const & index ) const
pure virtual

Verifies if there is a component parameter related-object at the index position index in the container (map).

Parameters
[in] index The index position in the map.
Returns
True if parameter already registered.

◆ count()

virtual int ComponentParameterMapInterface::count ( ) const
pure virtual

Counts the number of component parameter related-objects registered.

Returns
The number of parameters registered.

◆ createParameter()

virtual ComponentParameterMapInterface::Item* ComponentParameterMapInterface::createParameter ( ) const
pure virtual

Creates a new parameter object and returns a pointer to it. The parameter is not added to this map.

Returns
a pointer to the newly created parameter

◆ end() [1/2]

virtual ComponentParameterMapInterface::Iterator ComponentParameterMapInterface::end ( )
pure virtual

Gets an iterator pointing at the end of the map after the last component parameter related-object.

Returns
The iterator pointing at the end of the map.

◆ end() [2/2]

virtual ComponentParameterMapInterface::ConstIterator ComponentParameterMapInterface::end ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last component parameter related-object (use for read-only).

Returns
The iterator pointing at the end of the map.

◆ generateID()

virtual ComponentParameterMapInterface::ID ComponentParameterMapInterface::generateID ( ) const
pure virtual

Generates a unique key identifier for the new parameter registered in the container (map).

Returns
The key identifier of the parameter.

◆ getID() [1/2]

virtual ComponentParameterMapInterface::ID ComponentParameterMapInterface::getID ( ComponentParameterMapInterface::Item *const item ) const
pure virtual

Gets the key identifier of the component parameter related-object item from the container (map).

Parameters
[in] item The object defining the parameter.
Returns
The key identifier of the parameter.

◆ getID() [2/2]

virtual ComponentParameterMapInterface::ID ComponentParameterMapInterface::getID ( ComponentParameterMapInterface::Index const & index ) const
pure virtual

Gets the key identifier of the component parameter related-object in the index position index of the container (map).

Parameters
[in] index The index position in the map.
Returns
The key identifier of the parameter.

◆ getIndex() [1/2]

virtual ComponentParameterMapInterface::Index ComponentParameterMapInterface::getIndex ( ComponentParameterMapInterface::ID const & id ) const
pure virtual

Gets the index position in the container (map) of the component parameter related-object with the key identifier id.

Parameters
[in] id The key id of the parameter.
Returns
The index position of the parameter in the map.

◆ getIndex() [2/2]

virtual ComponentParameterMapInterface::Index ComponentParameterMapInterface::getIndex ( ComponentParameterMapInterface::Item *const item ) const
pure virtual

Gets the index position of the component parameter related-object item in the container (map).

Parameters
[in] item The object defining the parameter.
Returns
The index position of the parameter in the map.

◆ getItem() [1/2]

virtual ComponentParameterMapInterface::Item* ComponentParameterMapInterface::getItem ( ComponentParameterMapInterface::ID const & id ) const
pure virtual

Gets the parameter related-object under the key identifier id.

Parameters
[in] id The key identifier of the parameter.
Returns
The object defining the parameter.

◆ getItem() [2/2]

virtual ComponentParameterMapInterface::Item* ComponentParameterMapInterface::getItem ( ComponentParameterMapInterface::Index const & index ) const
pure virtual

Gets the parameter related-object at the index position index in the container (map).

Parameters
[in] index The index position in the map.
Returns
The object defining the parameter.

◆ remove() [1/3]

virtual bool ComponentParameterMapInterface::remove ( ComponentParameterMapInterface::ID const & id )
pure virtual

Deregisters a parameter related-object under the key identifier id.

Parameters
[in] id The key identifier of the parameter.
Returns
True if parameter successfully deregistered.

◆ remove() [2/3]

virtual bool ComponentParameterMapInterface::remove ( ComponentParameterMapInterface::Item *const item )
pure virtual

Deregisters the parameter related-object item.

Parameters
[in] item The object defining the parameter.
Returns
True if parameter successfully deregistered.

◆ remove() [3/3]

virtual bool ComponentParameterMapInterface::remove ( ComponentParameterMapInterface::Index const & index )
pure virtual

Deregisters the parameter related-object at the index position index in the container (map).

Parameters
[in] index The index position in the map.
Returns
True if parameter successfully deregistered.

◆ setID()

virtual bool ComponentParameterMapInterface::setID | ( | ComponentParameterMapInterface::Item *const | item,
 |  | ComponentParameterMapInterface::ID const & | id
 | ) |  |
pure virtual

Sets a key identifier id for the component parameter related-object item registered in the container (map).

Parameters
[in] | item | The object defining the parameter.
[in] | id | The key id of the parameter.
Returns
True if the key identifier successfully modified.
The documentation for this class was generated from the following file:
  • ComponentParameterMapInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ComponentParameterMapInterface Member List

This is the complete list of members for ComponentParameterMapInterface, including all inherited members.

add(ComponentParameterMapInterface::Item *const item)=0 | ComponentParameterMapInterface | pure virtual
add(ComponentParameterMapInterface::ID const &id)=0 | ComponentParameterMapInterface | pure virtual
add(ComponentParameterMapInterface::ID const &id, ComponentParameterMapInterface::Item *const item)=0 | ComponentParameterMapInterface | pure virtual
added(Item *item) const | ComponentParameterMapInterface | signal
begin()=0 | ComponentParameterMapInterface | pure virtual
begin() const =0 | ComponentParameterMapInterface | pure virtual
clear()=0 | ComponentParameterMapInterface | pure virtual
cleared() const | ComponentParameterMapInterface | signal
contains(ComponentParameterMapInterface::ID const &id) const =0 | ComponentParameterMapInterface | pure virtual
contains(ComponentParameterMapInterface::Item *const item) const =0 | ComponentParameterMapInterface | pure virtual
contains(ComponentParameterMapInterface::Index const &index) const =0 | ComponentParameterMapInterface | pure virtual
count() const =0 | ComponentParameterMapInterface | pure virtual
createParameter() const =0 | ComponentParameterMapInterface | pure virtual
end()=0 | ComponentParameterMapInterface | pure virtual
end() const =0 | ComponentParameterMapInterface | pure virtual
generateID() const =0 | ComponentParameterMapInterface | pure virtual
getID(ComponentParameterMapInterface::Item *const item) const =0 | ComponentParameterMapInterface | pure virtual
getID(ComponentParameterMapInterface::Index const &index) const =0 | ComponentParameterMapInterface | pure virtual
getIndex(ComponentParameterMapInterface::ID const &id) const =0 | ComponentParameterMapInterface | pure virtual
getIndex(ComponentParameterMapInterface::Item *const item) const =0 | ComponentParameterMapInterface | pure virtual
getItem(ComponentParameterMapInterface::ID const &id) const =0 | ComponentParameterMapInterface | pure virtual
getItem(ComponentParameterMapInterface::Index const &index) const =0 | ComponentParameterMapInterface | pure virtual
ID typedef | ComponentParameterMapInterface |
Item typedef | ComponentParameterMapInterface |
Map typedef | ComponentParameterMapInterface |
modifiedID() const | ComponentParameterMapInterface | signal
remove(ComponentParameterMapInterface::ID const &id)=0 | ComponentParameterMapInterface | pure virtual
remove(ComponentParameterMapInterface::Item *const item)=0 | ComponentParameterMapInterface | pure virtual
remove(ComponentParameterMapInterface::Index const &index)=0 | ComponentParameterMapInterface | pure virtual
removed(Item *item) const | ComponentParameterMapInterface | signal
setID(ComponentParameterMapInterface::Item *const item, ComponentParameterMapInterface::ID const &id)=0 | ComponentParameterMapInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ComponentScheduleInterface Class Reference

Signals | Public Member Functions | List of all members
ComponentScheduleInterface Class Referenceabstract

This class defines the schedule parameters of a component: More...

Inherits QObject.

Signals

void | cleared () const
Triggers signal to inform that the schedule parameters of the current component has been reset successfully.
void | modifiedCycle () const
Triggers signal to inform that the Cycle Time of a component has been modified.
void | modifiedOffset () const
Triggers signal to inform that the Offset Time of a component has been modified.
void | modifiedResponse () const
Triggers signal to inform that the Response Time of a component has been modified.

Public Member Functions

virtual bool | clear ()=0
Clears the items constituing the schedule parameters of the current component. More...
virtual ComponentScheduleInterface::Cycle | getCycle () const =0
Gets the Cycle Time for the current registered component. More...
virtual ComponentScheduleInterface::Offset | getOffset () const =0
Gets the Offset Time for the current registered component. More...
virtual ComponentScheduleInterface::Response | getResponse () const =0
Gets the Response Time for the current registered component. More...
virtual bool | setCycle (ComponentScheduleInterface::Cycle const &cycle)=0
Sets the Cycle Time for the current registered component. More...
virtual bool | setOffset (ComponentScheduleInterface::Offset const &offset)=0
Sets the Offset Time for the current registered component. More...
virtual bool | setResponse (ComponentScheduleInterface::Response const &response)=0
Sets the Response Time for the current registered component. More...

Detailed Description

This class defines the schedule parameters of a component:

  • Offset Time
  • Cycle Time
  • Response Time

Definition at line 31 of file ComponentScheduleInterface.h.

Member Function Documentation

◆ clear()

virtual bool ComponentScheduleInterface::clear ( )
pure virtual

Clears the items constituing the schedule parameters of the current component.

Returns
True if schedule items successfully cleared.

◆ getCycle()

virtual ComponentScheduleInterface::Cycle ComponentScheduleInterface::getCycle ( ) const
pure virtual

Gets the Cycle Time for the current registered component.

Returns
The Cycle Time.

◆ getOffset()

virtual ComponentScheduleInterface::Offset ComponentScheduleInterface::getOffset ( ) const
pure virtual

Gets the Offset Time for the current registered component.

Returns
The Offset Time.

◆ getResponse()

virtual ComponentScheduleInterface::Response ComponentScheduleInterface::getResponse ( ) const
pure virtual

Gets the Response Time for the current registered component.

Returns
The Response Time.

◆ setCycle()

virtual bool ComponentScheduleInterface::setCycle ( ComponentScheduleInterface::Cycle const & cycle )
pure virtual

Sets the Cycle Time for the current registered component.

Parameters
[in] cycle The Cycle Time for the component.
Returns
True if the Cycle Time successfully modified.

◆ setOffset()

virtual bool ComponentScheduleInterface::setOffset ( ComponentScheduleInterface::Offset const & offset )
pure virtual

Sets the Offset Time for the current registered component.

Parameters
[in] offset The Offset Time for the component.
Returns
True if the Offset Time successfully modified.

◆ setResponse()

virtual bool ComponentScheduleInterface::setResponse ( ComponentScheduleInterface::Response const & response )
pure virtual

Sets the Response Time for the current registered component.

Parameters
[in] response The Response Time for the component.
Returns
True if the Response Time successfully modified.
The documentation for this class was generated from the following file:
  • ComponentScheduleInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ComponentScheduleInterface Member List

This is the complete list of members for ComponentScheduleInterface, including all inherited members.

clear()=0 | ComponentScheduleInterface | pure virtual
cleared() const | ComponentScheduleInterface | signal
getCycle() const =0 | ComponentScheduleInterface | pure virtual
getOffset() const =0 | ComponentScheduleInterface | pure virtual
getResponse() const =0 | ComponentScheduleInterface | pure virtual
modifiedCycle() const | ComponentScheduleInterface | signal
modifiedOffset() const | ComponentScheduleInterface | signal
modifiedResponse() const | ComponentScheduleInterface | signal
setCycle(ComponentScheduleInterface::Cycle const &cycle)=0 | ComponentScheduleInterface | pure virtual
setOffset(ComponentScheduleInterface::Offset const &offset)=0 | ComponentScheduleInterface | pure virtual
setResponse(ComponentScheduleInterface::Response const &response)=0 | ComponentScheduleInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileCommands::AddDriverProfile Class Reference

  • DriverProfileCommands
  • AddDriverProfile
List of all members
DriverProfileCommands::AddDriverProfile Class Reference

This class defines the command for undoable add-operations on the map of driver profiles (DriverProfileMapInterface). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable add-operations on the map of driver profiles (DriverProfileMapInterface).

Definition at line 202 of file DriverProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • DriverProfilesPresenter.h
  • DriverProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • DriverProfileCommands
  • AddDriverProfile
DriverProfileCommands::AddDriverProfile Member List

This is the complete list of members for DriverProfileCommands::AddDriverProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileCommands::EditDriverProfile Class Reference

  • DriverProfileCommands
  • EditDriverProfile
List of all members
DriverProfileCommands::EditDriverProfile Class Reference

This class defines the command for undoable renaming-operations on the map of driver profiles (DriverProfileMapInterface). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable renaming-operations on the map of driver profiles (DriverProfileMapInterface).

Definition at line 178 of file DriverProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • DriverProfilesPresenter.h
  • DriverProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • DriverProfileCommands
  • EditDriverProfile
DriverProfileCommands::EditDriverProfile Member List

This is the complete list of members for DriverProfileCommands::EditDriverProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileCommands::RemoveDriverProfile Class Reference

  • DriverProfileCommands
  • RemoveDriverProfile
List of all members
DriverProfileCommands::RemoveDriverProfile Class Reference

This class defines the command for undoable remove-operations on the map of driver profiles (DriverProfileMapInterface). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable remove-operations on the map of driver profiles (DriverProfileMapInterface).

Definition at line 241 of file DriverProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • DriverProfilesPresenter.h
  • DriverProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • DriverProfileCommands
  • RemoveDriverProfile
DriverProfileCommands::RemoveDriverProfile Member List

This is the complete list of members for DriverProfileCommands::RemoveDriverProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileCommands::SetCurrentDriver Class Reference

  • DriverProfileCommands
  • SetCurrentDriver
List of all members
DriverProfileCommands::SetCurrentDriver Class Reference

This class defines the command for undoable set-operations on the currently selected driver profile. More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable set-operations on the currently selected driver profile.

Definition at line 150 of file DriverProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • DriverProfilesPresenter.h
  • DriverProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • DriverProfileCommands
  • SetCurrentDriver
DriverProfileCommands::SetCurrentDriver Member List

This is the complete list of members for DriverProfileCommands::SetCurrentDriver, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileItemInterface Class Reference

Public Types | Public Member Functions | List of all members
DriverProfileItemInterface Class Referenceabstract

This class defines objects containing all relevant information on driver profiles. More...

Inheritance diagram for DriverProfileItemInterface:
DriverProfileItemModel

Public Types

using | DriverConfig = QString
typedef for the driver config file
using | Name = QString
typedef for the driver profile's name
using | Parameters = ParameterMapInterface
typedef for the parameters of the driver profile

Public Member Functions

virtual DriverConfig | getConfig () const =0
Method which returns the driver configuration file containing XML metadata. More...
virtual Name | getName () const =0
Method which returns the name of this driver profile. In fact, this is the key identifier under which the profile is registered in the map, i.e. an instance of DriverProfileMapInterface / DriverProfileMapModel. More...
virtual Parameters * | getParameters () const =0
Method which returns the parameter map (ParameterMapInterface) of this driver profile. More...
virtual void | setConfig (DriverConfig const &_driverConfig)=0
Method which sets the driver configuration file containing XML metadata to the one passed as an argument. More...

Detailed Description

This class defines objects containing all relevant information on driver profiles.

In particular, the name, some config file and all parameters are part of driver profiles. The driver config refers to some XML metadata describing a driver model algorithm. Note that such an XML file has not been developed for driver models yet and, thus, driver configs are not yet in use.

Definition at line 43 of file DriverProfileItemInterface.h.

Member Function Documentation

◆ getConfig()

virtual DriverConfig DriverProfileItemInterface::getConfig ( ) const
pure virtual

Method which returns the driver configuration file containing XML metadata.

Note
This method is not yet in use as the XML metadata file needs to be still developed.
Returns
the driver configuration file

Implemented in DriverProfileItemModel.

◆ getName()

virtual Name DriverProfileItemInterface::getName ( ) const
pure virtual

Method which returns the name of this driver profile. In fact, this is the key identifier under which the profile is registered in the map, i.e. an instance of DriverProfileMapInterface / DriverProfileMapModel.

Returns
the name of this driver profile

Implemented in DriverProfileItemModel.

◆ getParameters()

virtual Parameters* DriverProfileItemInterface::getParameters ( ) const
pure virtual

Method which returns the parameter map (ParameterMapInterface) of this driver profile.

Returns
the parameter map of this driver profile

Implemented in DriverProfileItemModel.

◆ setConfig()

virtual void DriverProfileItemInterface::setConfig ( DriverConfig const & _driverConfig )
pure virtual

Method which sets the driver configuration file containing XML metadata to the one passed as an argument.

Note
This method is not yet in use as the XML metadata file needs to be still developed.
Parameters
[in] the driver configuration file to be used for this profile

Implemented in DriverProfileItemModel.

The documentation for this class was generated from the following file:
  • DriverProfileItemInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

DriverProfileItemInterface Member List

This is the complete list of members for DriverProfileItemInterface, including all inherited members.

DriverConfig typedef | DriverProfileItemInterface |
getConfig() const =0 | DriverProfileItemInterface | pure virtual
getName() const =0 | DriverProfileItemInterface | pure virtual
getParameters() const =0 | DriverProfileItemInterface | pure virtual
Name typedef | DriverProfileItemInterface |
Parameters typedef | DriverProfileItemInterface |
setConfig(DriverConfig const &_driverConfig)=0 | DriverProfileItemInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileItemModel Class Reference

Public Member Functions | Private Attributes | List of all members
DriverProfileItemModel Class Reference

This class implements the functionality of DriverProfileItemInterface. More...

Inheritance diagram for DriverProfileItemModel:
DriverProfileItemInterface

Public Member Functions

virtual DriverConfig | getConfig () const override
Method which returns the driver configuration file containing XML metadata. More...
virtual Name | getName () const override
Method which returns the name of this driver profile. In fact, this is the key identifier under which the profile is registered in the map, i.e. an instance of DriverProfileMapInterface / DriverProfileMapModel. More...
virtual Parameters * | getParameters () const override
Method which returns the parameter map (ParameterMapInterface) of this driver profile. More...
virtual void | setConfig (const DriverConfig &_driverConfig) override
Method which sets the driver configuration file containing XML metadata to the one passed as an argument. More...

Private Attributes

DriverConfig driverConfig
string object for storing the driver configuration file (so far, not used!)
Parameters *const parameters
instance of ParameterMapInterface for storing parameters

Additional Inherited Members

- Public Types inherited from DriverProfileItemInterface
using | DriverConfig = QString
typedef for the driver config file
using | Name = QString
typedef for the driver profile's name
using | Parameters = ParameterMapInterface
typedef for the parameters of the driver profile

Detailed Description

This class implements the functionality of DriverProfileItemInterface.

Definition at line 25 of file DriverProfileItemModel.h.

Member Function Documentation

◆ getConfig()

DriverProfileItemInterface::DriverConfig DriverProfileItemModel::getConfig ( ) const
overridevirtual

Method which returns the driver configuration file containing XML metadata.

Note
This method is not yet in use as the XML metadata file needs to be still developed.
Returns
the driver configuration file

Implements DriverProfileItemInterface.

Definition at line 55 of file DriverProfileItemModel.cpp.

56 {
57 return driverConfig;
58 }
DriverProfileItemModel::driverConfig
DriverConfig driverConfig
string object for storing the driver configuration file (so far, not used!)
Definition: DriverProfileItemModel.h:47

◆ getName()

DriverProfileItemInterface::Name DriverProfileItemModel::getName ( ) const
overridevirtual

Method which returns the name of this driver profile. In fact, this is the key identifier under which the profile is registered in the map, i.e. an instance of DriverProfileMapInterface / DriverProfileMapModel.

Returns
the name of this driver profile

Implements DriverProfileItemInterface.

Definition at line 42 of file DriverProfileItemModel.cpp.

43 {
44 DriverProfileMapInterface const * const map = qobject_cast<DriverProfileMapInterface const * const > ( parent() );
45
46 return ( (map) ? map->getName( const_cast<DriverProfileItemModel *> (this) ) : DriverProfileItemInterface::Name() );
47 }
DriverProfileItemInterface::Name
QString Name
typedef for the driver profile&#39;s name
Definition: DriverProfileItemInterface.h:48
DriverProfileMapInterface::getName
virtual DriverProfileMapInterface::Name getName(DriverProfileMapInterface::Item *const item) const =0
Method wich returns the name of the given driver profile.
DriverProfileMapInterface
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInte...
Definition: DriverProfileMapInterface.h:37

◆ getParameters()

DriverProfileItemInterface::Parameters * DriverProfileItemModel::getParameters ( ) const
overridevirtual

Method which returns the parameter map (ParameterMapInterface) of this driver profile.

Returns
the parameter map of this driver profile

Implements DriverProfileItemInterface.

Definition at line 49 of file DriverProfileItemModel.cpp.

50 {
51 return parameters;
52 }
DriverProfileItemModel::parameters
Parameters *const parameters
instance of ParameterMapInterface for storing parameters
Definition: DriverProfileItemModel.h:46

◆ setConfig()

void DriverProfileItemModel::setConfig ( const DriverConfig & _driverConfig )
overridevirtual

Method which sets the driver configuration file containing XML metadata to the one passed as an argument.

Note
This method is not yet in use as the XML metadata file needs to be still developed.
Parameters
[in] the driver configuration file to be used for this profile

Implements DriverProfileItemInterface.

Definition at line 60 of file DriverProfileItemModel.cpp.

61 {
62 driverConfig = _driverConfig;
63 }
DriverProfileItemModel::driverConfig
DriverConfig driverConfig
string object for storing the driver configuration file (so far, not used!)
Definition: DriverProfileItemModel.h:47
The documentation for this class was generated from the following files:
  • DriverProfileItemModel.h
  • DriverProfileItemModel.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

DriverProfileItemModel Member List

This is the complete list of members for DriverProfileItemModel, including all inherited members.

driverConfig | DriverProfileItemModel | private
DriverConfig typedef | DriverProfileItemInterface |
getConfig() const override | DriverProfileItemModel | virtual
getName() const override | DriverProfileItemModel | virtual
getParameters() const override | DriverProfileItemModel | virtual
Name typedef | DriverProfileItemInterface |
parameters | DriverProfileItemModel | private
Parameters typedef | DriverProfileItemInterface |
setConfig(const DriverConfig &_driverConfig) override | DriverProfileItemModel | virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileMapInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
DriverProfileMapInterface Class Referenceabstract

This class constitutes a container class in which driver profiles (instances of DriverProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map. More...

Inheritance diagram for DriverProfileMapInterface:
DriverProfileMapModel

Public Types

using | ConstIterator = Map::ConstIterator
a const iterator of the map (for read-only operations)
using | Item = DriverProfileItemInterface
typedef for driver profiles (items registered in the map)
using | Iterator = Map::Iterator
an iterator of the map
using | Map = QMap< Name, Item * >
typedef for the map, i.e. the container object of driver profiles
using | Name = DriverProfileItemInterface::Name
typedef for driver profile names (= key identifiers of the map)

Signals

void | added (Name const &name)
Signal emitted when a driver profile has been added to the map. Transmits the name of the correponding driver profile. More...
void | modifiedName (Name const &oldName, Name const &newName)
Signal emitted when the name of the driver profile has been changed. Transmits both, the new and old names of the profile. More...
void | removed (Name const &name)
Signal emitted when a driver profile has been removed from the map. Transmits the name of the correponding driver profile. More...

Public Member Functions

virtual bool | add (DriverProfileMapInterface::Name const &name)=0
Method which creates a new driver profile (instance of DriverProfileItemInterface) and adds it to the map under the given name. More...
virtual bool | add (DriverProfileMapInterface::Name const &name, DriverProfileMapInterface::Item const *const driver)=0
Method which creates a copy of the given driver profile (seond argument) and adds it to the map using the given name. More...
virtual DriverProfileMapInterface::Iterator | begin ()=0
Gets an iterator pointing to the first driver profile in the map. More...
virtual DriverProfileMapInterface::ConstIterator | constBegin () const =0
Gets an iterator pointing to the first driver profile in the map (use for read-only since pointing at constant values). More...
virtual DriverProfileMapInterface::ConstIterator | constEnd () const =0
Gets an iterator pointing at the end of the map after the last driver profile (use for read-only). More...
virtual bool | contains (DriverProfileMapInterface::Name const &name) const =0
Method wich checks whether the map contains a driver profile with the given name. More...
virtual int | count () const =0
Method which returns the number of driver profiles in the map. More...
virtual DriverProfileMapInterface::Iterator | end ()=0
Gets an iterator pointing to the end of the map after the last driver profile. More...
virtual DriverProfileMapInterface::Item * | getItem (DriverProfileMapInterface::Name const &name) const =0
Method which returns a pointer to the driver profile with the given name. If the map does not contain a driver profile with this name, nullptr is returned. More...
virtual DriverProfileMapInterface::Name | getName (DriverProfileMapInterface::Item *const item) const =0
Method wich returns the name of the given driver profile. More...
virtual QStringList | keys () const =0
Method which returns the (string) list of all driver profile names in the map. More...
virtual bool | remove (DriverProfileMapInterface::Name const &name)=0
Method which removes the driver profile with the given name from the map. The profile is deleted after removing. Nothing will be done if there is no such profile. More...
virtual void | setName (DriverProfileMapInterface::Item *const item, DriverProfileMapInterface::Name const &name)=0
Method wich changes the name of the given driver profile to the one passed as second argument. More...
virtual QList< Item * > | values () const =0
Method which returns a list of pointers to all driver profiles in the map. More...

Detailed Description

This class constitutes a container class in which driver profiles (instances of DriverProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map.

Definition at line 37 of file DriverProfileMapInterface.h.

Member Function Documentation

◆ add() [1/2]

virtual bool DriverProfileMapInterface::add ( DriverProfileMapInterface::Name const & name )
pure virtual

Method which creates a new driver profile (instance of DriverProfileItemInterface) and adds it to the map under the given name.

Parameters
[in] name the name under which the newly created item is registered
Returns
"true", if name is not used already, otherwise "false"

Implemented in DriverProfileMapModel.

◆ add() [2/2]

virtual bool DriverProfileMapInterface::add | ( | DriverProfileMapInterface::Name const & | name,
 |  | DriverProfileMapInterface::Item const *const | driver
 | ) |  |
pure virtual

Method which creates a copy of the given driver profile (seond argument) and adds it to the map using the given name.

Parameters
[in] | name | the name under which the copied item is registered
[in] | item | the driver pofile to be copied
Returns
"true", if name is not used already, otherwise "false"

Implemented in DriverProfileMapModel.

◆ added

void DriverProfileMapInterface::added ( Name const & name )
signal

Signal emitted when a driver profile has been added to the map. Transmits the name of the correponding driver profile.

Parameters
[in] name the name of the added driver profile

◆ begin()

virtual DriverProfileMapInterface::Iterator DriverProfileMapInterface::begin ( )
pure virtual

Gets an iterator pointing to the first driver profile in the map.

Returns
The iterator pointing at the first object in the map.

Implemented in DriverProfileMapModel.

◆ constBegin()

virtual DriverProfileMapInterface::ConstIterator DriverProfileMapInterface::constBegin ( ) const
pure virtual

Gets an iterator pointing to the first driver profile in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implemented in DriverProfileMapModel.

◆ constEnd()

virtual DriverProfileMapInterface::ConstIterator DriverProfileMapInterface::constEnd ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last driver profile (use for read-only).

Returns
The iterator pointing at the end of the map.

Implemented in DriverProfileMapModel.

◆ contains()

virtual bool DriverProfileMapInterface::contains ( DriverProfileMapInterface::Name const & name ) const
pure virtual

Method wich checks whether the map contains a driver profile with the given name.

Parameters
[in] name the name to be searched for
Returns
true, if profile with given name exists, otherwise false.

Implemented in DriverProfileMapModel.

◆ count()

virtual int DriverProfileMapInterface::count ( ) const
pure virtual

Method which returns the number of driver profiles in the map.

Returns
the number of driver profiles in the map

Implemented in DriverProfileMapModel.

◆ end()

virtual DriverProfileMapInterface::Iterator DriverProfileMapInterface::end ( )
pure virtual

Gets an iterator pointing to the end of the map after the last driver profile.

Returns
The iterator pointing at the end of the map.

Implemented in DriverProfileMapModel.

◆ getItem()

virtual DriverProfileMapInterface::Item* DriverProfileMapInterface::getItem ( DriverProfileMapInterface::Name const & name ) const
pure virtual

Method which returns a pointer to the driver profile with the given name. If the map does not contain a driver profile with this name, nullptr is returned.

Parameters
[in] name the name of the driver profile to be returned
Returns
the pointer to a driver profile of given name, nullptr if given name does not exist in the map

Implemented in DriverProfileMapModel.

◆ getName()

virtual DriverProfileMapInterface::Name DriverProfileMapInterface::getName ( DriverProfileMapInterface::Item *const item ) const
pure virtual

Method wich returns the name of the given driver profile.

Parameters
[in] item the pointer to the driver profile in question
Returns
the name of the given driver profile

Implemented in DriverProfileMapModel.

◆ keys()

virtual QStringList DriverProfileMapInterface::keys ( ) const
pure virtual

Method which returns the (string) list of all driver profile names in the map.

Returns
the (string) list of all driver profile names

Implemented in DriverProfileMapModel.

◆ modifiedName

void DriverProfileMapInterface::modifiedName | ( | Name const & | oldName,
 |  | Name const & | newName
 | ) |  |
signal

Signal emitted when the name of the driver profile has been changed. Transmits both, the new and old names of the profile.

Parameters
[in] | oldName | the old name of the driver profile
[in] | newName | the new name of the driver profile

◆ remove()

virtual bool DriverProfileMapInterface::remove ( DriverProfileMapInterface::Name const & name )
pure virtual

Method which removes the driver profile with the given name from the map. The profile is deleted after removing. Nothing will be done if there is no such profile.

Parameters
[in] name the name of the driver profile to be removed
Returns
"true", if name exists in the map, otherwise "false"

Implemented in DriverProfileMapModel.

◆ removed

void DriverProfileMapInterface::removed ( Name const & name )
signal

Signal emitted when a driver profile has been removed from the map. Transmits the name of the correponding driver profile.

Parameters
[in] name the name of the removed driver profile

◆ setName()

virtual void DriverProfileMapInterface::setName | ( | DriverProfileMapInterface::Item *const | item,
 |  | DriverProfileMapInterface::Name const & | name
 | ) |  |
pure virtual

Method wich changes the name of the given driver profile to the one passed as second argument.

Parameters
[in] | item | the pointer to the driver profile to be renamed
[in] | name | the new name of the agent profile

Implemented in DriverProfileMapModel.

◆ values()

virtual QList<Item*> DriverProfileMapInterface::values ( ) const
pure virtual

Method which returns a list of pointers to all driver profiles in the map.

Returns
the list of pointers to all driver profiles

Implemented in DriverProfileMapModel.

The documentation for this class was generated from the following file:
  • DriverProfileMapInterface.h
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

DriverProfileMapInterface Member List

This is the complete list of members for DriverProfileMapInterface, including all inherited members.

add(DriverProfileMapInterface::Name const &name)=0 | DriverProfileMapInterface | pure virtual
add(DriverProfileMapInterface::Name const &name, DriverProfileMapInterface::Item const *const driver)=0 | DriverProfileMapInterface | pure virtual
added(Name const &name) | DriverProfileMapInterface | signal
begin()=0 | DriverProfileMapInterface | pure virtual
constBegin() const =0 | DriverProfileMapInterface | pure virtual
constEnd() const =0 | DriverProfileMapInterface | pure virtual
ConstIterator typedef | DriverProfileMapInterface |
contains(DriverProfileMapInterface::Name const &name) const =0 | DriverProfileMapInterface | pure virtual
count() const =0 | DriverProfileMapInterface | pure virtual
end()=0 | DriverProfileMapInterface | pure virtual
getItem(DriverProfileMapInterface::Name const &name) const =0 | DriverProfileMapInterface | pure virtual
getName(DriverProfileMapInterface::Item *const item) const =0 | DriverProfileMapInterface | pure virtual
Item typedef | DriverProfileMapInterface |
Iterator typedef | DriverProfileMapInterface |
keys() const =0 | DriverProfileMapInterface | pure virtual
Map typedef | DriverProfileMapInterface |
modifiedName(Name const &oldName, Name const &newName) | DriverProfileMapInterface | signal
Name typedef | DriverProfileMapInterface |
remove(DriverProfileMapInterface::Name const &name)=0 | DriverProfileMapInterface | pure virtual
removed(Name const &name) | DriverProfileMapInterface | signal
setName(DriverProfileMapInterface::Item *const item, DriverProfileMapInterface::Name const &name)=0 | DriverProfileMapInterface | pure virtual
values() const =0 | DriverProfileMapInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfileMapModel Class Reference

Public Member Functions | Private Attributes | List of all members
DriverProfileMapModel Class Reference

This class implements the functionality of DriverProfileMapInterface. More...

Inheritance diagram for DriverProfileMapModel:
DriverProfileMapInterface

Public Member Functions

virtual bool | add (DriverProfileMapInterface::Name const &name) override
Method which creates a new driver profile (instance of DriverProfileItemInterface) and adds it to the map under the given name. More...
virtual bool | add (DriverProfileMapInterface::Name const &name, DriverProfileMapInterface::Item const *const driver) override
Method which creates a copy of the given driver profile (seond argument) and adds it to the map using the given name. More...
virtual DriverProfileMapInterface::Iterator | begin () override
Gets an iterator pointing to the first driver profile in the map. More...
virtual DriverProfileMapInterface::ConstIterator | constBegin () const override
Gets an iterator pointing to the first driver profile in the map (use for read-only since pointing at constant values). More...
virtual DriverProfileMapInterface::ConstIterator | constEnd () const override
Gets an iterator pointing at the end of the map after the last driver profile (use for read-only). More...
virtual bool | contains (DriverProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a driver profile with the given name. More...
virtual int | count () const override
Method which returns the number of driver profiles in the map. More...
virtual DriverProfileMapInterface::Iterator | end () override
Gets an iterator pointing to the end of the map after the last driver profile. More...
virtual DriverProfileMapInterface::Item * | getItem (DriverProfileMapInterface::Name const &name) const override
Method which returns a pointer to the driver profile with the given name. If the map does not contain a driver profile with this name, nullptr is returned. More...
virtual DriverProfileMapInterface::Name | getName (DriverProfileMapInterface::Item *const item) const override
Method wich returns the name of the given driver profile. More...
virtual QStringList | keys () const override
Method which returns the (string) list of all driver profile names in the map. More...
virtual bool | remove (DriverProfileMapInterface::Name const &name) override
Method which removes the driver profile with the given name from the map. The profile is deleted after removing. Nothing will be done if there is no such profile. More...
virtual void | setName (DriverProfileMapInterface::Item *const item, DriverProfileMapInterface::Name const &name) override
Method wich changes the name of the given driver profile to the one passed as second argument. More...
virtual QList< Item * > | values () const override
Method which returns a list of pointers to all driver profiles in the map. More...

Private Attributes

Map driverProfiles
the map (container) for registering driver profiles

Additional Inherited Members

- Public Types inherited from DriverProfileMapInterface
using | ConstIterator = Map::ConstIterator
a const iterator of the map (for read-only operations)
using | Item = DriverProfileItemInterface
typedef for driver profiles (items registered in the map)
using | Iterator = Map::Iterator
an iterator of the map
using | Map = QMap< Name, Item * >
typedef for the map, i.e. the container object of driver profiles
using | Name = DriverProfileItemInterface::Name
typedef for driver profile names (= key identifiers of the map)
- Signals inherited from DriverProfileMapInterface
void | added (Name const &name)
Signal emitted when a driver profile has been added to the map. Transmits the name of the correponding driver profile. More...
void | modifiedName (Name const &oldName, Name const &newName)
Signal emitted when the name of the driver profile has been changed. Transmits both, the new and old names of the profile. More...
void | removed (Name const &name)
Signal emitted when a driver profile has been removed from the map. Transmits the name of the correponding driver profile. More...

Detailed Description

This class implements the functionality of DriverProfileMapInterface.

Definition at line 25 of file DriverProfileMapModel.h.

Member Function Documentation

◆ add() [1/2]

bool DriverProfileMapModel::add ( DriverProfileMapInterface::Name const & name )
overridevirtual

Method which creates a new driver profile (instance of DriverProfileItemInterface) and adds it to the map under the given name.

Parameters
[in] name the name under which the newly created item is registered
Returns
"true", if name is not used already, otherwise "false"

Implements DriverProfileMapInterface.

Definition at line 42 of file DriverProfileMapModel.cpp.

43 {
44 if(!contains(name))
45 {
46 driverProfiles.insert(name, new DriverProfileItemModel(this));
47 Q_EMIT added(name);
48
49 return true;
50 }
51
52 return false;
53 }
DriverProfileMapInterface::added
void added(Name const &name)
Signal emitted when a driver profile has been added to the map. Transmits the name of the correpondin...
DriverProfileMapModel::contains
virtual bool contains(DriverProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a driver profile with the given name. ...
Definition: DriverProfileMapModel.cpp:108
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69
DriverProfileItemModel
This class implements the functionality of DriverProfileItemInterface.
Definition: DriverProfileItemModel.h:25

◆ add() [2/2]

bool DriverProfileMapModel::add | ( | DriverProfileMapInterface::Name const & | name,
 |  | DriverProfileMapInterface::Item const *const | driver
 | ) |  |
overridevirtual

Method which creates a copy of the given driver profile (seond argument) and adds it to the map using the given name.

Parameters
[in] | name | the name under which the copied item is registered
[in] | item | the driver pofile to be copied
Returns
"true", if name is not used already, otherwise "false"

Implements DriverProfileMapInterface.

Definition at line 55 of file DriverProfileMapModel.cpp.

56 {
57 if(!contains(name))
58 {
59 driverProfiles.insert(name, new DriverProfileItemModel(driver, this));
60 Q_EMIT added(name);
61 return true;
62 }
63
64 return false;
65 }
DriverProfileMapInterface::added
void added(Name const &name)
Signal emitted when a driver profile has been added to the map. Transmits the name of the correpondin...
DriverProfileMapModel::contains
virtual bool contains(DriverProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a driver profile with the given name. ...
Definition: DriverProfileMapModel.cpp:108
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69
DriverProfileItemModel
This class implements the functionality of DriverProfileItemInterface.
Definition: DriverProfileItemModel.h:25

◆ begin()

DriverProfileMapInterface::Iterator DriverProfileMapModel::begin ( )
overridevirtual

Gets an iterator pointing to the first driver profile in the map.

Returns
The iterator pointing at the first object in the map.

Implements DriverProfileMapInterface.

Definition at line 21 of file DriverProfileMapModel.cpp.

22 {
23 return driverProfiles.begin();
24 }
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69

◆ constBegin()

DriverProfileMapInterface::ConstIterator DriverProfileMapModel::constBegin ( ) const
overridevirtual

Gets an iterator pointing to the first driver profile in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implements DriverProfileMapInterface.

Definition at line 26 of file DriverProfileMapModel.cpp.

27 {
28 return driverProfiles.constBegin();
29 }
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69

◆ constEnd()

DriverProfileMapInterface::ConstIterator DriverProfileMapModel::constEnd ( ) const
overridevirtual

Gets an iterator pointing at the end of the map after the last driver profile (use for read-only).

Returns
The iterator pointing at the end of the map.

Implements DriverProfileMapInterface.

Definition at line 36 of file DriverProfileMapModel.cpp.

37 {
38 return driverProfiles.constEnd();
39 }
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69

◆ contains()

bool DriverProfileMapModel::contains ( DriverProfileMapInterface::Name const & name ) const
overridevirtual

Method wich checks whether the map contains a driver profile with the given name.

Parameters
[in] name the name to be searched for
Returns
true, if profile with given name exists, otherwise false.

Implements DriverProfileMapInterface.

Definition at line 108 of file DriverProfileMapModel.cpp.

109 {
110 return driverProfiles.contains(name);
111 }
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69

◆ count()

int DriverProfileMapModel::count ( ) const
overridevirtual

Method which returns the number of driver profiles in the map.

Returns
the number of driver profiles in the map

Implements DriverProfileMapInterface.

Definition at line 123 of file DriverProfileMapModel.cpp.

124 {
125 return driverProfiles.count();
126 }
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69

◆ end()

DriverProfileMapInterface::Iterator DriverProfileMapModel::end ( )
overridevirtual

Gets an iterator pointing to the end of the map after the last driver profile.

Returns
The iterator pointing at the end of the map.

Implements DriverProfileMapInterface.

Definition at line 31 of file DriverProfileMapModel.cpp.

32 {
33 return driverProfiles.end();
34 }
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69

◆ getItem()

DriverProfileMapInterface::Item * DriverProfileMapModel::getItem ( DriverProfileMapInterface::Name const & name ) const
overridevirtual

Method which returns a pointer to the driver profile with the given name. If the map does not contain a driver profile with this name, nullptr is returned.

Parameters
[in] name the name of the driver profile to be returned
Returns
the pointer to a driver profile of given name, nullptr if given name does not exist in the map

Implements DriverProfileMapInterface.

Definition at line 81 of file DriverProfileMapModel.cpp.

82 {
83 if(contains(name))
84 return driverProfiles.value(name);
85
86 return nullptr;
87 }
DriverProfileMapModel::contains
virtual bool contains(DriverProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a driver profile with the given name. ...
Definition: DriverProfileMapModel.cpp:108
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69

◆ getName()

DriverProfileMapInterface::Name DriverProfileMapModel::getName ( DriverProfileMapInterface::Item *const item ) const
overridevirtual

Method wich returns the name of the given driver profile.

Parameters
[in] item the pointer to the driver profile in question
Returns
the name of the given driver profile

Implements DriverProfileMapInterface.

Definition at line 90 of file DriverProfileMapModel.cpp.

91 {
92 return driverProfiles.key(item);
93 }
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69

◆ keys()

QStringList DriverProfileMapModel::keys ( ) const
overridevirtual

Method which returns the (string) list of all driver profile names in the map.

Returns
the (string) list of all driver profile names

Implements DriverProfileMapInterface.

Definition at line 113 of file DriverProfileMapModel.cpp.

114 {
115 return QStringList(driverProfiles.keys());
116 }
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69

◆ remove()

bool DriverProfileMapModel::remove ( DriverProfileMapInterface::Name const & name )
overridevirtual

Method which removes the driver profile with the given name from the map. The profile is deleted after removing. Nothing will be done if there is no such profile.

Parameters
[in] name the name of the driver profile to be removed
Returns
"true", if name exists in the map, otherwise "false"

Implements DriverProfileMapInterface.

Definition at line 69 of file DriverProfileMapModel.cpp.

70 {
71 if(contains(name))
72 {
73 delete driverProfiles.take(name);
74 Q_EMIT removed(name);
75 return true;
76 }
77
78 return false;
79 }
DriverProfileMapInterface::removed
void removed(Name const &name)
Signal emitted when a driver profile has been removed from the map. Transmits the name of the correpo...
DriverProfileMapModel::contains
virtual bool contains(DriverProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a driver profile with the given name. ...
Definition: DriverProfileMapModel.cpp:108
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69

◆ setName()

void DriverProfileMapModel::setName | ( | DriverProfileMapInterface::Item *const | item,
 |  | DriverProfileMapInterface::Name const & | name
 | ) |  |
overridevirtual

Method wich changes the name of the given driver profile to the one passed as second argument.

Parameters
[in] | item | the pointer to the driver profile to be renamed
[in] | name | the new name of the agent profile

Implements DriverProfileMapInterface.

Definition at line 95 of file DriverProfileMapModel.cpp.

97 {
98
99 Name oldName = getName(item);
100
101 driverProfiles.take(oldName);
102 driverProfiles.insert(name, item);
103
104 Q_EMIT modifiedName(oldName, name);
105 }
DriverProfileMapInterface::modifiedName
void modifiedName(Name const &oldName, Name const &newName)
Signal emitted when the name of the driver profile has been changed. Transmits both, the new and old names of the profile.
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69
DriverProfileMapInterface::Name
DriverProfileItemInterface::Name Name
typedef for driver profile names (= key identifiers of the map)
Definition: DriverProfileMapInterface.h:42
DriverProfileMapModel::getName
virtual DriverProfileMapInterface::Name getName(DriverProfileMapInterface::Item *const item) const override
Method wich returns the name of the given driver profile.
Definition: DriverProfileMapModel.cpp:90

◆ values()

QList< DriverProfileItemInterface * > DriverProfileMapModel::values ( ) const
overridevirtual

Method which returns a list of pointers to all driver profiles in the map.

Returns
the list of pointers to all driver profiles

Implements DriverProfileMapInterface.

Definition at line 118 of file DriverProfileMapModel.cpp.

119 {
120 return driverProfiles.values();
121 }
DriverProfileMapModel::driverProfiles
Map driverProfiles
the map (container) for registering driver profiles
Definition: DriverProfileMapModel.h:69
The documentation for this class was generated from the following files:
  • DriverProfileMapModel.h
  • DriverProfileMapModel.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

DriverProfileMapModel Member List

This is the complete list of members for DriverProfileMapModel, including all inherited members.

add(DriverProfileMapInterface::Name const &name) override | DriverProfileMapModel | virtual
add(DriverProfileMapInterface::Name const &name, DriverProfileMapInterface::Item const *const driver) override | DriverProfileMapModel | virtual
added(Name const &name) | DriverProfileMapInterface | signal
begin() override | DriverProfileMapModel | virtual
constBegin() const override | DriverProfileMapModel | virtual
constEnd() const override | DriverProfileMapModel | virtual
ConstIterator typedef | DriverProfileMapInterface |
contains(DriverProfileMapInterface::Name const &name) const override | DriverProfileMapModel | virtual
count() const override | DriverProfileMapModel | virtual
driverProfiles | DriverProfileMapModel | private
end() override | DriverProfileMapModel | virtual
getItem(DriverProfileMapInterface::Name const &name) const override | DriverProfileMapModel | virtual
getName(DriverProfileMapInterface::Item *const item) const override | DriverProfileMapModel | virtual
Item typedef | DriverProfileMapInterface |
Iterator typedef | DriverProfileMapInterface |
keys() const override | DriverProfileMapModel | virtual
Map typedef | DriverProfileMapInterface |
modifiedName(Name const &oldName, Name const &newName) | DriverProfileMapInterface | signal
Name typedef | DriverProfileMapInterface |
remove(DriverProfileMapInterface::Name const &name) override | DriverProfileMapModel | virtual
removed(Name const &name) | DriverProfileMapInterface | signal
setName(DriverProfileMapInterface::Item *const item, DriverProfileMapInterface::Name const &name) override | DriverProfileMapModel | virtual
values() const override | DriverProfileMapModel | virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfilesMapPresenter Class Reference

Public Slots | Signals | Public Member Functions | Private Attributes | List of all members
DriverProfilesMapPresenter Class Reference

This class constitutes the re-implementation of QAbstractTableModel for the table view of driver profiles. In fact, this class implements a wrapper for the map of driver profiles (DriverProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework. More...

Inherits QAbstractTableModel.

Public Slots

void | editName (AgentItemInterface::DriverProfile const &oldName, AgentItemInterface::DriverProfile const &newName)
Slot which changes the name of the driver profile. More...
void | remove (AgentItemInterface::DriverProfile const &profile)
Slot removes the given driver profile if contained in the table. More...

Signals

void checkProbabilities ()
Signal emitted whenever the probability sum of the driver profile table should be checked. This usually happens whenever driver profiles are added or removed or if probability values are edited.

Public Member Functions

virtual void | addRow (const int &row, AgentItemInterface::DriverProfile const &profile, AgentItemInterface::Probability const &probability)
Method that adds a new row, i.e. a driver profile with the given probability. More...
int | columnCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders. More...
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex). More...
Qt::ItemFlags | flags (const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! More...
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format. More...
virtual bool | removeRow (const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval. More...
int | rowCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of driver profiles. More...
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value. More...
void | setDriverProfiles (AgentItemInterface::DriverProfiles *const _driverProfiles)
Method which sets the currently processed driver profiles map to the given argument. More...
void | update ()
Method which updates the table according to the current entries of driverProfiles.

Private Attributes

QStringList | _columnHeaders
the list containing the header data for columns
AgentItemInterface::DriverProfiles * driverProfiles
the pointer to the map of driver profiles assigned to an agent profile
QMap< int, AgentItemInterface::DriverProfile > | RowToProfile
a mapping of row indices to profile names

Detailed Description

This class constitutes the re-implementation of QAbstractTableModel for the table view of driver profiles. In fact, this class implements a wrapper for the map of driver profiles (DriverProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework.

Definition at line 33 of file DriverProfilesMapPresenter.h.

Member Function Documentation

◆ addRow()

void DriverProfilesMapPresenter::addRow | ( | const int & | row,
 |  | AgentItemInterface::DriverProfile const & | profile,
 |  | AgentItemInterface::Probability const & | probability
 | ) |  |
virtual

Method that adds a new row, i.e. a driver profile with the given probability.

Parameters
[in] | row | the index of the row to be added
[in] | profile | the name of the profile to be added
[in] | probability | the probability of the profile

Definition at line 104 of file DriverProfilesMapPresenter.cpp.

107 {
108 // shift all row indices up
109 for(auto _row = RowToProfile.size()-1 ; _row>= row; _row--)
110 RowToProfile.insert(_row + 1, RowToProfile.take(_row));
111
112 RowToProfile.insert( row, profile );
113
114 if(driverProfiles)
115 {
116 beginInsertRows(QModelIndex(), row, row );
117 driverProfiles->insert(profile, probability);
118 endInsertRows();
119 Q_EMIT checkProbabilities();
120 }
121
122 }
DriverProfilesMapPresenter::checkProbabilities
void checkProbabilities()
Signal emitted whenever the probability sum of the driver profile table should be checked...
DriverProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::DriverProfile > RowToProfile
a mapping of row indices to profile names
Definition: DriverProfilesMapPresenter.h:180
DriverProfilesMapPresenter::driverProfiles
AgentItemInterface::DriverProfiles * driverProfiles
the pointer to the map of driver profiles assigned to an agent profile
Definition: DriverProfilesMapPresenter.h:176

◆ columnCount()

int DriverProfilesMapPresenter::columnCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table columns

Definition at line 42 of file DriverProfilesMapPresenter.cpp.

43 {
44 Q_UNUSED(parent)
45
46 return _columnHeaders.count();
47 }
DriverProfilesMapPresenter::_columnHeaders
QStringList _columnHeaders
the list containing the header data for columns
Definition: DriverProfilesMapPresenter.h:179

◆ data()

QVariant DriverProfilesMapPresenter::data | ( | const QModelIndex & | index,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex).

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::DisplayRole or Qt::EditRole)
Returns
The data stored in the table cell (as a QVariant)

Definition at line 49 of file DriverProfilesMapPresenter.cpp.

50 {
51 int row = index.row();
52 int col = index.column();
53
54 if(!driverProfiles && row >= driverProfiles->count())
55 return QVariant::Invalid;
56
57 if( role == Qt::TextAlignmentRole)
58 return QVariant( Qt::AlignCenter );
59
60 if(role == Qt::DisplayRole || role == Qt::EditRole)
61 {
62 if(col == 0)
63 return QVariant(RowToProfile[row]);
64 else if(col == 1)
65 return QVariant(driverProfiles->value( RowToProfile[row] ));
66 }
67
68 return QVariant();
69 }
DriverProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::DriverProfile > RowToProfile
a mapping of row indices to profile names
Definition: DriverProfilesMapPresenter.h:180
DriverProfilesMapPresenter::driverProfiles
AgentItemInterface::DriverProfiles * driverProfiles
the pointer to the map of driver profiles assigned to an agent profile
Definition: DriverProfilesMapPresenter.h:176

◆ editName

void DriverProfilesMapPresenter::editName | ( | AgentItemInterface::DriverProfile const & | oldName,
 |  | AgentItemInterface::DriverProfile const & | newName
 | ) |  |
slot

Slot which changes the name of the driver profile.

Parameters
[in] | oldName | the old name of the driver profile
[in] | newName | the new name of the driver profile

Definition at line 170 of file DriverProfilesMapPresenter.cpp.

172 {
173 if(driverProfiles && driverProfiles->contains(oldName))
174 {
175 driverProfiles->insert( newName, driverProfiles->take(oldName));
176
177 int row = RowToProfile.key(oldName);
178 RowToProfile.insert(row, newName);
179 }
180 }
DriverProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::DriverProfile > RowToProfile
a mapping of row indices to profile names
Definition: DriverProfilesMapPresenter.h:180
DriverProfilesMapPresenter::driverProfiles
AgentItemInterface::DriverProfiles * driverProfiles
the pointer to the map of driver profiles assigned to an agent profile
Definition: DriverProfilesMapPresenter.h:176

◆ flags()

Qt::ItemFlags DriverProfilesMapPresenter::flags ( const QModelIndex & index ) const
override

Reimplementation of the flags method. This will make the items of the model editable!

Parameters
[in] index An index identifying the cell of the table
Returns
An item flag

Definition at line 98 of file DriverProfilesMapPresenter.cpp.

99 {
100
101 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
102 }

◆ headerData()

QVariant DriverProfilesMapPresenter::headerData | ( | int | section,
 |  | Qt::Orientation | orientation,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format.

Parameters
[in] | section | A table section
[in] | role | A Qt role
[in] | orientation | A table orientation
Returns
The content of the table's header at the given section

Definition at line 21 of file DriverProfilesMapPresenter.cpp.

22 {
23 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
24 return _columnHeaders.value(section);
25
26 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
27 return section + 1;
28
29 return QVariant();
30 }
DriverProfilesMapPresenter::_columnHeaders
QStringList _columnHeaders
the list containing the header data for columns
Definition: DriverProfilesMapPresenter.h:179

◆ remove

void DriverProfilesMapPresenter::remove ( AgentItemInterface::DriverProfile const & profile )
slot

Slot removes the given driver profile if contained in the table.

Parameters
[in] profile the profile to be removed

Definition at line 182 of file DriverProfilesMapPresenter.cpp.

183 {
184 removeRow(RowToProfile.key(profile));
185 }
DriverProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::DriverProfile > RowToProfile
a mapping of row indices to profile names
Definition: DriverProfilesMapPresenter.h:180
DriverProfilesMapPresenter::removeRow
virtual bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: DriverProfilesMapPresenter.cpp:124

◆ removeRow()

bool DriverProfilesMapPresenter::removeRow ( const int & row )
virtual

Method that removes the row specified by the given row-index, if this is in a meaningful interval.

Parameters
[in] row the row-index
Returns
"True", if row is between 0 and the number of profiles, "false", otherwise

Definition at line 124 of file DriverProfilesMapPresenter.cpp.

125 {
126 if(driverProfiles && RowToProfile.contains(row) && driverProfiles->contains(RowToProfile[row]))
127 {
128 beginRemoveRows(QModelIndex(), row, row);
129
130 driverProfiles->take( RowToProfile[row] );
131 RowToProfile.take(row);
132
133 for( int i = row + 1; i<=RowToProfile.count() ; i++ )
134 RowToProfile.insert( i-1, RowToProfile.take(i));
135
136 endRemoveRows();
137 Q_EMIT checkProbabilities();
138 return true;
139 }
140 else
141 return false;
142 }
DriverProfilesMapPresenter::checkProbabilities
void checkProbabilities()
Signal emitted whenever the probability sum of the driver profile table should be checked...
DriverProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::DriverProfile > RowToProfile
a mapping of row indices to profile names
Definition: DriverProfilesMapPresenter.h:180
DriverProfilesMapPresenter::driverProfiles
AgentItemInterface::DriverProfiles * driverProfiles
the pointer to the map of driver profiles assigned to an agent profile
Definition: DriverProfilesMapPresenter.h:176

◆ rowCount()

int DriverProfilesMapPresenter::rowCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of driver profiles.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table rows

Definition at line 32 of file DriverProfilesMapPresenter.cpp.

33 {
34 Q_UNUSED(parent)
35
36 if(driverProfiles)
37 return driverProfiles->count();
38 else
39 return 0;
40 }
DriverProfilesMapPresenter::driverProfiles
AgentItemInterface::DriverProfiles * driverProfiles
the pointer to the map of driver profiles assigned to an agent profile
Definition: DriverProfilesMapPresenter.h:176

◆ setData()

bool DriverProfilesMapPresenter::setData | ( | const QModelIndex & | index,
 |  | const QVariant & | value,
 |  | int | role = Qt::EditRole
 | ) |  |
override

Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value.

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::EditRole)
Returns
"True" if the index corresponds to an existing cell in the table, otherwise "false"

Definition at line 71 of file DriverProfilesMapPresenter.cpp.

72 {
73 int row = index.row();
74 int col = index.column();
75
76 if(driverProfiles && role == Qt::EditRole)
77 {
78 if(col == 0 && !driverProfiles->keys().contains(value.toString()))
79 {
80 driverProfiles->insert( value.toString(), driverProfiles->take(RowToProfile[row]) );
81 RowToProfile.take( row );
82 RowToProfile.insert( row, value.toString() );
83 Q_EMIT dataChanged(index, index);
84 return true;
85 }
86 else if ( col ==1 && driverProfiles->contains(RowToProfile[row]))
87 {
88 (*driverProfiles)[RowToProfile[row]] = value.toDouble();
89 Q_EMIT dataChanged(index, index);
90 Q_EMIT checkProbabilities();
91 return true;
92 }
93 }
94
95 return false;
96 }
DriverProfilesMapPresenter::checkProbabilities
void checkProbabilities()
Signal emitted whenever the probability sum of the driver profile table should be checked...
DriverProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::DriverProfile > RowToProfile
a mapping of row indices to profile names
Definition: DriverProfilesMapPresenter.h:180
DriverProfilesMapPresenter::driverProfiles
AgentItemInterface::DriverProfiles * driverProfiles
the pointer to the map of driver profiles assigned to an agent profile
Definition: DriverProfilesMapPresenter.h:176

◆ setDriverProfiles()

void DriverProfilesMapPresenter::setDriverProfiles ( AgentItemInterface::DriverProfiles *const _driverProfiles )

Method which sets the currently processed driver profiles map to the given argument.

Parameters
[in] _driverProfiles the driver profiles map to be processed

Definition at line 144 of file DriverProfilesMapPresenter.cpp.

145 {
146 driverProfiles=_driverProfiles;
147 update();
148 }
DriverProfilesMapPresenter::update
void update()
Method which updates the table according to the current entries of driverProfiles.
Definition: DriverProfilesMapPresenter.cpp:151
DriverProfilesMapPresenter::driverProfiles
AgentItemInterface::DriverProfiles * driverProfiles
the pointer to the map of driver profiles assigned to an agent profile
Definition: DriverProfilesMapPresenter.h:176
The documentation for this class was generated from the following files:
  • DriverProfilesMapPresenter.h
  • DriverProfilesMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

DriverProfilesMapPresenter Member List

This is the complete list of members for DriverProfilesMapPresenter, including all inherited members.

_columnHeaders | DriverProfilesMapPresenter | private
addRow(const int &row, AgentItemInterface::DriverProfile const &profile, AgentItemInterface::Probability const &probability) | DriverProfilesMapPresenter | virtual
checkProbabilities() | DriverProfilesMapPresenter | signal
columnCount(const QModelIndex &parent=QModelIndex()) const override | DriverProfilesMapPresenter |
data(const QModelIndex &index, int role=Qt::DisplayRole) const override | DriverProfilesMapPresenter |
driverProfiles | DriverProfilesMapPresenter | private
editName(AgentItemInterface::DriverProfile const &oldName, AgentItemInterface::DriverProfile const &newName) | DriverProfilesMapPresenter | slot
flags(const QModelIndex &index) const override | DriverProfilesMapPresenter |
headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override | DriverProfilesMapPresenter |
remove(AgentItemInterface::DriverProfile const &profile) | DriverProfilesMapPresenter | slot
removeRow(const int &row) | DriverProfilesMapPresenter | virtual
rowCount(const QModelIndex &parent=QModelIndex()) const override | DriverProfilesMapPresenter |
RowToProfile | DriverProfilesMapPresenter | private
setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override | DriverProfilesMapPresenter |
setDriverProfiles(AgentItemInterface::DriverProfiles *const _driverProfiles) | DriverProfilesMapPresenter |
update() | DriverProfilesMapPresenter |
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfilesPresenter Class Reference

Public Member Functions | Private Slots | Private Member Functions | Private Attributes | Friends | List of all members
DriverProfilesPresenter Class Reference

This class defines the presenter object for driver profiles which handles user events from the view (DriverProfilesView) and edits the model data (DriverProfileMapInterface) accordingly. More...

Inherits QObject.

Public Member Functions

void | updateDriverSelectionItems ()
Method which updates the combo box list of available driver profiles to the ones currently defined in the model data (DriverProfileMapInterface).
void | updateView ()
Method which updates the complete view (DriverProfilesView) according to the model data of the current driver profile.

Private Slots

void | addDriver (const QString &name)
Slot triggered by the DriverProfilesView::addDriverProfile signal. Performs an undoable add-operation on the driver profiles map. Sets the newly created driver profile as the currently edited profile and updates the view accordingly. More...
void | editDriver (const QString &oldName, const QString &newName)
Slot triggered by the DriverProfilesView::editedName signal. Performs an undoable rename-operation on the name of the currently edited driver profile. More...
void | removeDriver (const QString &name)
Slot triggered by the DriverProfilesView::removeDriverProfile signal. Performs an undoable remove-operation on the driver profiles map removing the currently selected profile. If the list of available profiles is not empty, it sets the currently edited profile to the first entry of the list. More...
void | setCurrentDriver (const QString &name)
Slot triggered by the DriverProfilesView::selectionChanged signal. Performs an undoable set-operation on the currently edited driver profile setting it to the transmitted profile. Updates the view accordingly. More...
void | setDriverConfig (const QString &filepath)
Slot for setting the driver configuration file. More...

Private Member Functions

void setParameterDelegates ()
Method which sets the delegates of the parameter table's cells according to the current model data. The delegates depend on the datatype of the parameters. This method is called in updateView.

Private Attributes

QList< QString > | bool_list = {"true","false"}
a combo box selection list for a parameter delegate representing a boolian variable
DriverProfileItemInterface * currentDriver
a pointer to the currently edited driver profile
DriverProfileMapInterface *const | drivers
the map of driver profiles
DriverProfilesView *const | driversView
a pointer to the view for driver profiles
ParameterMapPresenter * parameters
a pointer to the presenter object for the parameters of a driver profile
QUndoStack *const | undoStack
a pointer to the undo stack

Friends

class AgentConfigurationPresenter

Detailed Description

This class defines the presenter object for driver profiles which handles user events from the view (DriverProfilesView) and edits the model data (DriverProfileMapInterface) accordingly.

Since all actions performed on the model data (i.e. the *.ui file) should be undoable, the presenter instantiates the corresponding undo-commands and pushes them onto the undo stack. The actual operation on the model is then performed in these command object using the re-implementations of the undo/redo methods. See Qt's undo framework for further details.

Definition at line 50 of file DriverProfilesPresenter.h.

Member Function Documentation

◆ addDriver

void DriverProfilesPresenter::addDriver ( const QString & name )
privateslot

Slot triggered by the DriverProfilesView::addDriverProfile signal. Performs an undoable add-operation on the driver profiles map. Sets the newly created driver profile as the currently edited profile and updates the view accordingly.

Parameters
[in] name the name of the new driver profile

Definition at line 52 of file DriverProfilesPresenter.cpp.

53 {
54
55 undoStack->beginMacro(QString("added driver profile %1").arg(name));
56 undoStack->push(new DriverProfileCommands::AddDriverProfile(drivers, driversView, name));
57 undoStack->push(new DriverProfileCommands::SetCurrentDriver(drivers, &currentDriver, name, parameters, this));
58 undoStack->endMacro();
59 }
DriverProfilesPresenter::currentDriver
DriverProfileItemInterface * currentDriver
a pointer to the currently edited driver profile
Definition: DriverProfilesPresenter.h:132
DriverProfileCommands::SetCurrentDriver
This class defines the command for undoable set-operations on the currently selected driver profile...
Definition: DriverProfilesPresenter.h:150
DriverProfilesPresenter::driversView
DriverProfilesView *const driversView
a pointer to the view for driver profiles
Definition: DriverProfilesPresenter.h:133
DriverProfileCommands::AddDriverProfile
This class defines the command for undoable add-operations on the map of driver profiles (DriverProfi...
Definition: DriverProfilesPresenter.h:202
DriverProfilesPresenter::parameters
ParameterMapPresenter * parameters
a pointer to the presenter object for the parameters of a driver profile
Definition: DriverProfilesPresenter.h:135
DriverProfilesPresenter::drivers
DriverProfileMapInterface *const drivers
the map of driver profiles
Definition: DriverProfilesPresenter.h:131
DriverProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: DriverProfilesPresenter.h:134

◆ editDriver

void DriverProfilesPresenter::editDriver | ( | const QString & | oldName,
 |  | const QString & | newName
 | ) |  |
privateslot

Slot triggered by the DriverProfilesView::editedName signal. Performs an undoable rename-operation on the name of the currently edited driver profile.

Parameters
[in] | oldName | the old name of the driver profile
[in] | newName | the new name of the driver profile

Definition at line 76 of file DriverProfilesPresenter.cpp.

77 {
78 if(drivers->contains(oldName) && !drivers->contains(newName))
79 {
80 undoStack->push(new DriverProfileCommands::EditDriverProfile(drivers, driversView, newName,oldName));
81 }
82
83 }
DriverProfileMapInterface::contains
virtual bool contains(DriverProfileMapInterface::Name const &name) const =0
Method wich checks whether the map contains a driver profile with the given name. ...
DriverProfileCommands::EditDriverProfile
This class defines the command for undoable renaming-operations on the map of driver profiles (Driver...
Definition: DriverProfilesPresenter.h:178
DriverProfilesPresenter::driversView
DriverProfilesView *const driversView
a pointer to the view for driver profiles
Definition: DriverProfilesPresenter.h:133
DriverProfilesPresenter::drivers
DriverProfileMapInterface *const drivers
the map of driver profiles
Definition: DriverProfilesPresenter.h:131
DriverProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: DriverProfilesPresenter.h:134

◆ removeDriver

void DriverProfilesPresenter::removeDriver ( const QString & name )
privateslot

Slot triggered by the DriverProfilesView::removeDriverProfile signal. Performs an undoable remove-operation on the driver profiles map removing the currently selected profile. If the list of available profiles is not empty, it sets the currently edited profile to the first entry of the list.

Parameters
[in] name the name of the driver profile to be removed

Definition at line 61 of file DriverProfilesPresenter.cpp.

62 {
63 if(currentDriver && currentDriver->getName() == name)
64 {
65 QList<DriverProfileItemInterface::Name> driversList = drivers->keys();
66 driversList.removeAll(name);
67 DriverProfileItemInterface::Name driverName = driversList.isEmpty() ? "" : driversList.first();
68
69 undoStack->beginMacro(QString("removed driver profile %1").arg(name));
70 undoStack->push(new DriverProfileCommands::SetCurrentDriver(drivers, &currentDriver, driverName, parameters, this));
71 undoStack->push(new DriverProfileCommands::RemoveDriverProfile(drivers, driversView, name));
72 undoStack->endMacro();
73 }
74 }
DriverProfileMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all driver profile names in the map.
DriverProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this driver profile. In fact, this is the key identifier under which...
DriverProfileItemInterface::Name
QString Name
typedef for the driver profile&#39;s name
Definition: DriverProfileItemInterface.h:48
DriverProfilesPresenter::currentDriver
DriverProfileItemInterface * currentDriver
a pointer to the currently edited driver profile
Definition: DriverProfilesPresenter.h:132
DriverProfileCommands::SetCurrentDriver
This class defines the command for undoable set-operations on the currently selected driver profile...
Definition: DriverProfilesPresenter.h:150
DriverProfilesPresenter::driversView
DriverProfilesView *const driversView
a pointer to the view for driver profiles
Definition: DriverProfilesPresenter.h:133
DriverProfileCommands::RemoveDriverProfile
This class defines the command for undoable remove-operations on the map of driver profiles (DriverPr...
Definition: DriverProfilesPresenter.h:241
DriverProfilesPresenter::parameters
ParameterMapPresenter * parameters
a pointer to the presenter object for the parameters of a driver profile
Definition: DriverProfilesPresenter.h:135
DriverProfilesPresenter::drivers
DriverProfileMapInterface *const drivers
the map of driver profiles
Definition: DriverProfilesPresenter.h:131
DriverProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: DriverProfilesPresenter.h:134

◆ setCurrentDriver

void DriverProfilesPresenter::setCurrentDriver ( const QString & name )
privateslot

Slot triggered by the DriverProfilesView::selectionChanged signal. Performs an undoable set-operation on the currently edited driver profile setting it to the transmitted profile. Updates the view accordingly.

Parameters
[in] name the driver profile which should be currently edited

Definition at line 46 of file DriverProfilesPresenter.cpp.

47 {
48 if(currentDriver && currentDriver->getName() != name)
49 undoStack->push(new DriverProfileCommands::SetCurrentDriver(drivers, &currentDriver, name, parameters, this));
50 }
DriverProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of this driver profile. In fact, this is the key identifier under which...
DriverProfilesPresenter::currentDriver
DriverProfileItemInterface * currentDriver
a pointer to the currently edited driver profile
Definition: DriverProfilesPresenter.h:132
DriverProfileCommands::SetCurrentDriver
This class defines the command for undoable set-operations on the currently selected driver profile...
Definition: DriverProfilesPresenter.h:150
DriverProfilesPresenter::parameters
ParameterMapPresenter * parameters
a pointer to the presenter object for the parameters of a driver profile
Definition: DriverProfilesPresenter.h:135
DriverProfilesPresenter::drivers
DriverProfileMapInterface *const drivers
the map of driver profiles
Definition: DriverProfilesPresenter.h:131
DriverProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: DriverProfilesPresenter.h:134

◆ setDriverConfig

void DriverProfilesPresenter::setDriverConfig ( const QString & filepath )
privateslot

Slot for setting the driver configuration file.

Note
this slot is not yet in use as no driver configuration file has been developed yet.
Parameters
[in] filepath the file path of the driver configuration file

Definition at line 85 of file DriverProfilesPresenter.cpp.

86 {
87 if(currentDriver)
88 {
89 if(filepath != currentDriver->getConfig())
90 {
91 currentDriver->setConfig(filepath);
92 updateView();
93 }
94 }
95 }
DriverProfileItemInterface::getConfig
virtual DriverConfig getConfig() const =0
Method which returns the driver configuration file containing XML metadata.
DriverProfilesPresenter::currentDriver
DriverProfileItemInterface * currentDriver
a pointer to the currently edited driver profile
Definition: DriverProfilesPresenter.h:132
DriverProfileItemInterface::setConfig
virtual void setConfig(DriverConfig const &_driverConfig)=0
Method which sets the driver configuration file containing XML metadata to the one passed as an argum...
DriverProfilesPresenter::updateView
void updateView()
Method which updates the complete view (DriverProfilesView) according to the model data of the curren...
Definition: DriverProfilesPresenter.cpp:97
The documentation for this class was generated from the following files:
  • DriverProfilesPresenter.h
  • DriverProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

DriverProfilesPresenter Member List

This is the complete list of members for DriverProfilesPresenter, including all inherited members.

addDriver(const QString &name) | DriverProfilesPresenter | privateslot
bool_list | DriverProfilesPresenter | private
currentDriver | DriverProfilesPresenter | private
drivers | DriverProfilesPresenter | private
driversView | DriverProfilesPresenter | private
editDriver(const QString &oldName, const QString &newName) | DriverProfilesPresenter | privateslot
parameters | DriverProfilesPresenter | private
removeDriver(const QString &name) | DriverProfilesPresenter | privateslot
setCurrentDriver(const QString &name) | DriverProfilesPresenter | privateslot
setDriverConfig(const QString &filepath) | DriverProfilesPresenter | privateslot
setParameterDelegates() | DriverProfilesPresenter | private
undoStack | DriverProfilesPresenter | private
updateDriverSelectionItems() | DriverProfilesPresenter |
updateView() | DriverProfilesPresenter |
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: DriverProfilesView Class Reference

Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
DriverProfilesView Class Reference

This class defines the view for editing driver profiles. The view constitutes a combo box for switching between different driver profiles, add-, remove- and rename buttons and a table view for editing the parameters of the driver profile. Further information on how to use this view can be found in the GUI tutorial. More...

Inheritance diagram for DriverProfilesView:
WidgetView

Signals

void | addDriverProfile (QString const &name)
Signal, emitted after the add-button for driver profiles has been clicked and a name for a new profile has been typed in. Transmits the name of the new driver profile. More...
void | editedName (QString const &oldName, QString const &newName)
Signal, emitted after the rename-button has been pressed and a new name for the current profile has been typed into the dialog box. Transmits the new and old name. More...
void | removeDriverProfile (QString const &name)
Signal, emitted after the remove-button for driver profiles has been clicked. Transmits the name of the driver profile currently selected in the combo box, which is the one to be removed. More...
void | selectedDriverConfig (QString const &filepath)
Signal for transmitting the filepath of the driver conifg (so far, not in use). More...
void | selectionChanged (QString const &name)
Signal, emitted after the current entry of the combo box for available driver profiles has been changed by the user. Transmit the newly selected driver profile. More...

Public Member Functions

void | addDriverView (QString const &name)
Method which adds the given driver profile name to the driver selection list (drop down menu for driver profiles). More...
void | enableConfiguration (bool enable)
Method which enables or disables the GUI elements of this view, apart from the add-button for adding driver profiles. Disabling usually happens when there is no driver profile configured. Note that since the driver configuration file has not been developed so far, the corresponding GUI elements will be always disabled. More...
QTableView * | getParameterView () const
Method which provides access to the table view for parameters.
void | removeDriverView (QString const &name)
Method which removes the given driver profile name from the driver selection list (drop down menu for driver profiles). More...
void | setConfigView (QString const &filepath)
Method which sets the filepath shown displayed in the driver config view to the one passed as an argument. More...
void | setCurrentDriver (QString const &name)
Method which sets the driver profile name to be currently shown in the drop down menu for driver profiles. More...
void | setDriverSelectionItems (QStringList const &names)
Method which clears the selection list for driver profiles (drop down menu) and inserts the given list. More...
- Public Member Functions inherited from WidgetView
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Private Slots

void | on_add_clicked ()
Slot triggered when the user clicks the add-button for driver profiles. Opens a dialog asking the user to type in a name of the driver profile. After the user has typed in a valid name, it is transmitted by the addDriverProfile signal.
void | on_Browse_clicked ()
Slot triggered by clicking the browse-button for the driver configuration file. Opens a file dialog asking the user to select a file name. After a valid file has been selected, the filename is transmitted using the selectedDriverConfig signal. Note, that currently no driver config is defined and, hence, this GUI element is temporarily disabled.
void | on_edit_clicked ()
Slot triggered when the user clicks the rename-button for driver profiles. Opens a dialog asking the user to type in a new name for the currently selected driver profile. After the user has typed in a valid name, the editedName signal is emitted.
void | on_Name_activated (const QString &name)
Slot which emits the selectionChanged signal after the user has made a selection in the drop down menu of available driver profiles. More...
void | on_remove_clicked ()
Slot triggered when the user clicks the remove-button for driver profiles. Emits the removeDriverProfile signal transmitting the profile currently displayed in the drop down menu (i.e. the one to be removed).

Private Member Functions

bool eventFilter (QObject *watched, QEvent *event)
Reimplementation of the event filter for catching the resize-events of the parameter table's view. It takes care of the proper column width ratio after resizing. More...

Private Attributes

Ui::DriverProfilesView * ui
the ui object containing all GUI elements of this view

Additional Inherited Members

- Protected Member Functions inherited from WidgetView
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.

Detailed Description

This class defines the view for editing driver profiles. The view constitutes a combo box for switching between different driver profiles, add-, remove- and rename buttons and a table view for editing the parameters of the driver profile. Further information on how to use this view can be found in the GUI tutorial.

Definition at line 41 of file DriverProfilesView.h.

Member Function Documentation

◆ addDriverProfile

void DriverProfilesView::addDriverProfile ( QString const & name )
signal

Signal, emitted after the add-button for driver profiles has been clicked and a name for a new profile has been typed in. Transmits the name of the new driver profile.

Parameters
[in] name the name of the new driver profile

◆ addDriverView()

void DriverProfilesView::addDriverView ( QString const & name )

Method which adds the given driver profile name to the driver selection list (drop down menu for driver profiles).

Parameters
[in] name the driver profile's name to be added to the selection list

Definition at line 123 of file DriverProfilesView.cpp.

124 {
125 ui->Name->addItem(name);
126 }
DriverProfilesView::ui
Ui::DriverProfilesView * ui
the ui object containing all GUI elements of this view
Definition: DriverProfilesView.h:218

◆ editedName

void DriverProfilesView::editedName | ( | QString const & | oldName,
 |  | QString const & | newName
 | ) |  |
signal

Signal, emitted after the rename-button has been pressed and a new name for the current profile has been typed into the dialog box. Transmits the new and old name.

Parameters
[in] | oldName | the old name of the renamed driver profile
[in] | newName | the new name of the driver profile

◆ enableConfiguration()

void DriverProfilesView::enableConfiguration ( bool enable )

Method which enables or disables the GUI elements of this view, apart from the add-button for adding driver profiles. Disabling usually happens when there is no driver profile configured. Note that since the driver configuration file has not been developed so far, the corresponding GUI elements will be always disabled.

Parameters
[in] enable the flag for enabling (true) or disabling (false) the GUI elements

Definition at line 135 of file DriverProfilesView.cpp.

136 {
137 ui->remove->setEnabled(enable);
138 ui->edit->setEnabled(enable);
139
140 // currently this is not utilised as there is only one fixed driver model
141 ui->Browse->setEnabled(false);
142 ui->driverConfig->setEnabled(false);
143 }
DriverProfilesView::ui
Ui::DriverProfilesView * ui
the ui object containing all GUI elements of this view
Definition: DriverProfilesView.h:218

◆ eventFilter()

bool DriverProfilesView::eventFilter | ( | QObject * | watched,
 |  | QEvent * | event
 | ) |  |
private

Reimplementation of the event filter for catching the resize-events of the parameter table's view. It takes care of the proper column width ratio after resizing.

Parameters
[in] | watched | the watched object
[in] | event | the event to be catched
Returns
always "false" as the event should be catched but not filtered

Definition at line 145 of file DriverProfilesView.cpp.

146 {
147 QTableView* table = qobject_cast<QTableView*> (watched);
148
149 if( table && event->type() == QEvent::Resize )
150 {
151 int cell = (table->width())/12;
152 table->setColumnWidth(0, 2*cell);
153 table->setColumnWidth(1, 4*cell);
154 table->setColumnWidth(2, cell);
155 }
156
157 return false;
158 }

◆ on_Name_activated

void DriverProfilesView::on_Name_activated ( const QString & name )
privateslot

Slot which emits the selectionChanged signal after the user has made a selection in the drop down menu of available driver profiles.

Parameters
[in] name the name of the newly selected profile

Definition at line 41 of file DriverProfilesView.cpp.

42 {
43 Q_EMIT selectionChanged(name);
44 }
DriverProfilesView::selectionChanged
void selectionChanged(QString const &name)
Signal, emitted after the current entry of the combo box for available driver profiles has been chang...

◆ removeDriverProfile

void DriverProfilesView::removeDriverProfile ( QString const & name )
signal

Signal, emitted after the remove-button for driver profiles has been clicked. Transmits the name of the driver profile currently selected in the combo box, which is the one to be removed.

Parameters
[in] name the name of the driver profile to be removed

◆ removeDriverView()

void DriverProfilesView::removeDriverView ( QString const & name )

Method which removes the given driver profile name from the driver selection list (drop down menu for driver profiles).

Parameters
[in] name the driver profile's name to be removed from the selection list

Definition at line 128 of file DriverProfilesView.cpp.

129 {
130 int index = ui->Name->findText(name);
131 ui->Name->removeItem(index);
132 }
DriverProfilesView::ui
Ui::DriverProfilesView * ui
the ui object containing all GUI elements of this view
Definition: DriverProfilesView.h:218

◆ selectedDriverConfig

void DriverProfilesView::selectedDriverConfig ( QString const & filepath )
signal

Signal for transmitting the filepath of the driver conifg (so far, not in use).

Parameters
[in] filepath the new filepath of the driver config

◆ selectionChanged

void DriverProfilesView::selectionChanged ( QString const & name )
signal

Signal, emitted after the current entry of the combo box for available driver profiles has been changed by the user. Transmit the newly selected driver profile.

Parameters
[in] name the name of the selected driver profile

◆ setConfigView()

void DriverProfilesView::setConfigView ( QString const & filepath )

Method which sets the filepath shown displayed in the driver config view to the one passed as an argument.

Parameters
[in] filepath the filepath to be shown by the driver config view

Definition at line 118 of file DriverProfilesView.cpp.

119 {
120 ui->driverConfig->setText(filepath);
121 }
DriverProfilesView::ui
Ui::DriverProfilesView * ui
the ui object containing all GUI elements of this view
Definition: DriverProfilesView.h:218

◆ setCurrentDriver()

void DriverProfilesView::setCurrentDriver ( QString const & name )

Method which sets the driver profile name to be currently shown in the drop down menu for driver profiles.

Parameters
[in] name the driver profile to be currently shown in the corresponding drop down menu

Definition at line 106 of file DriverProfilesView.cpp.

107 {
108 if(ui->Name->findText(name) != -1)
109 ui->Name->setCurrentText(name);
110 }
DriverProfilesView::ui
Ui::DriverProfilesView * ui
the ui object containing all GUI elements of this view
Definition: DriverProfilesView.h:218

◆ setDriverSelectionItems()

void DriverProfilesView::setDriverSelectionItems ( QStringList const & names )

Method which clears the selection list for driver profiles (drop down menu) and inserts the given list.

Parameters
[in] names the list of driver profile names to be listed in the corresponding drop down menu

Definition at line 112 of file DriverProfilesView.cpp.

113 {
114 ui->Name->clear();
115 ui->Name->addItems(names);
116 }
DriverProfilesView::ui
Ui::DriverProfilesView * ui
the ui object containing all GUI elements of this view
Definition: DriverProfilesView.h:218
The documentation for this class was generated from the following files:
  • DriverProfilesView.h
  • DriverProfilesView.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

DriverProfilesView Member List

This is the complete list of members for DriverProfilesView, including all inherited members.

addDriverProfile(QString const &name) | DriverProfilesView | signal
addDriverView(QString const &name) | DriverProfilesView |
editedName(QString const &oldName, QString const &newName) | DriverProfilesView | signal
enableConfiguration(bool enable) | DriverProfilesView |
eventFilter(QObject *watched, QEvent *event) | DriverProfilesView | private
getParameterView() const | DriverProfilesView |
on_add_clicked() | DriverProfilesView | privateslot
on_Browse_clicked() | DriverProfilesView | privateslot
on_edit_clicked() | DriverProfilesView | privateslot
on_Name_activated(const QString &name) | DriverProfilesView | privateslot
on_remove_clicked() | DriverProfilesView | privateslot
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
removeDriverProfile(QString const &name) | DriverProfilesView | signal
removeDriverView(QString const &name) | DriverProfilesView |
selectedDriverConfig(QString const &filepath) | DriverProfilesView | signal
selectionChanged(QString const &name) | DriverProfilesView | signal
setConfigView(QString const &filepath) | DriverProfilesView |
setCurrentDriver(QString const &name) | DriverProfilesView |
setDriverSelectionItems(QStringList const &names) | DriverProfilesView |
ui | DriverProfilesView | private
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EditEnvironmentName Class Reference

List of all members
EditEnvironmentName Class Reference

Command class editing the environment's name. More...

Inherits QUndoCommand.

Detailed Description

Command class editing the environment's name.

Definition at line 245 of file EnvironmentPresenter.h.

The documentation for this class was generated from the following files:
  • EnvironmentPresenter.h
  • EnvironmentPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EditEnvironmentName Member List

This is the complete list of members for EditEnvironmentName, including all inherited members.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EditNumberInvocations Class Reference

List of all members
EditNumberInvocations Class Reference

Command class editing the number of invocations. More...

Inherits QUndoCommand.

Detailed Description

Command class editing the number of invocations.

Definition at line 226 of file ExperimentPresenter.h.

The documentation for this class was generated from the following files:
  • ExperimentPresenter.h
  • ExperimentPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EditNumberInvocations Member List

This is the complete list of members for EditNumberInvocations, including all inherited members.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EditProfilesCatalogue Class Reference

List of all members
EditProfilesCatalogue Class Reference

Command class for editing the profiles catalogue. More...

Inherits QUndoCommand.

Detailed Description

Command class for editing the profiles catalogue.

Definition at line 226 of file TrafficSimulationPresenter.h.

The documentation for this class was generated from the following files:
  • TrafficSimulationPresenter.h
  • TrafficSimulationPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EditProfilesCatalogue Member List

This is the complete list of members for EditProfilesCatalogue, including all inherited members.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EditRandomSeed Class Reference

List of all members
EditRandomSeed Class Reference

Command class editing the number of invocations. More...

Inherits QUndoCommand.

Detailed Description

Command class editing the number of invocations.

Definition at line 249 of file ExperimentPresenter.h.

The documentation for this class was generated from the following files:
  • ExperimentPresenter.h
  • ExperimentPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EditRandomSeed Member List

This is the complete list of members for EditRandomSeed, including all inherited members.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EditScenarioFile Class Reference

List of all members
EditScenarioFile Class Reference

Command class editing the OpenSCENARIO file. More...

Inherits QUndoCommand.

Detailed Description

Command class editing the OpenSCENARIO file.

Definition at line 121 of file ScenarioPresenter.h.

The documentation for this class was generated from the following files:
  • ScenarioPresenter.h
  • ScenarioPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EditScenarioFile Member List

This is the complete list of members for EditScenarioFile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EditScenarioName Class Reference

List of all members
EditScenarioName Class Reference

Command class editing the scenario's name. More...

Inherits QUndoCommand.

Detailed Description

Command class editing the scenario's name.

Definition at line 98 of file ScenarioPresenter.h.

The documentation for this class was generated from the following files:
  • ScenarioPresenter.h
  • ScenarioPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EditScenarioName Member List

This is the complete list of members for EditScenarioName, including all inherited members.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EditTrafficName Class Reference

List of all members
EditTrafficName Class Reference

Command class for editing the traffic's name. More...

Inherits QUndoCommand.

Detailed Description

Command class for editing the traffic's name.

Definition at line 321 of file TrafficPresenter.h.

The documentation for this class was generated from the following files:
  • TrafficPresenter.h
  • TrafficPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EditTrafficName Member List

This is the complete list of members for EditTrafficName, including all inherited members.

Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentDisplayPresenter Class Reference

Public Slots | Public Member Functions | Private Member Functions | Private Attributes | List of all members
EnvironmentDisplayPresenter Class Reference

This class defines the presenter which controls the content to be displayed in the EnvironmentDisplayView widget. More...

Inherits QObject.

Public Slots

void updateView ()
Method which sets all displayed values according to the model data. Will be called after loading a combination xml file.

Public Member Functions

void setStatus ()
Method which determines the status of the environment settings. If all necessary configurations are made, the method displays the status "complete" and sets the frame of the display widget to green color. If "incomplete", the frame will be set to red color. Momentarily, the criterion for a complete configuration is that there is at least one item for the time of day, visibility distance, friction and weather.

Private Member Functions

bool | checkProbabilities (QMap< EnvironmentInterface::ID, EnvironmentInterface::Item *> *const items)
Method which checks whether the probabilities of the environment items registered in the given map sum up to 1. More...
void | setEnvironmentNameView ()
Slot which is called when the name of the environment configuration has changed in the model. Updates the displayed name and triggers a status check.
void | setFrictionView ()
Slot which is called when the user edits the friction coefficient map. Updates the displayed number of map entries accordingly and triggers a status check.
void | setTimeOfDayView ()
Slot which is called when the user edits the time of day map. Updates the displayed number of map entries accordingly and triggers a status check.
void | setVisibilityDistanceView ()
Slot which is called when the user edits the visibility distance map. Updates the displayed number of map entries accordingly and triggers a status check.
void | setWeatherView ()
Slot which is called when the user edits the weather map. Updates the displayed number of map entries accordingly and triggers a status check.

Private Attributes

EnvironmentInterface * environment
a pointer to the environment model (interface) which is read by this presenter
EnvironmentDisplayView * environmentDisplayView
a pointer to the display view whose content is managed by this presenter

Detailed Description

This class defines the presenter which controls the content to be displayed in the EnvironmentDisplayView widget.

Definition at line 31 of file EnvironmentDisplayPresenter.h.

Member Function Documentation

◆ checkProbabilities()

bool EnvironmentDisplayPresenter::checkProbabilities ( QMap< EnvironmentInterface::ID, EnvironmentInterface::Item *> *const items )
private

Method which checks whether the probabilities of the environment items registered in the given map sum up to 1.

Parameters
[in] items the map of environment items to be checked
Returns
"true" if probabilities sum up to 1, otherwise "false"

Definition at line 104 of file EnvironmentDisplayPresenter.cpp.

105 {
106 double sum=0.0;
107
108 for(auto item : items->values())
109 sum += item->getProbability();
110
111 return sum == 1.0;
112 }
The documentation for this class was generated from the following files:
  • EnvironmentDisplayPresenter.h
  • EnvironmentDisplayPresenter.cpp
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EnvironmentDisplayPresenter Member List

This is the complete list of members for EnvironmentDisplayPresenter, including all inherited members.

checkProbabilities(QMap< EnvironmentInterface::ID, EnvironmentInterface::Item *> *const items) | EnvironmentDisplayPresenter | private
environment | EnvironmentDisplayPresenter | private
environmentDisplayView | EnvironmentDisplayPresenter | private
setEnvironmentNameView() | EnvironmentDisplayPresenter | private
setFrictionView() | EnvironmentDisplayPresenter | private
setStatus() | EnvironmentDisplayPresenter |
setTimeOfDayView() | EnvironmentDisplayPresenter | private
setVisibilityDistanceView() | EnvironmentDisplayPresenter | private
setWeatherView() | EnvironmentDisplayPresenter | private
updateView() | EnvironmentDisplayPresenter | slot
Generated on Wed Feb 19 2020 14:58:13 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentDisplayView Class Reference

Public Types | Public Member Functions | Private Attributes | List of all members
EnvironmentDisplayView Class Reference

This class provides a display for a quick overview of the environment configuration. More...

Inheritance diagram for EnvironmentDisplayView:
WidgetView

Public Types

enum StatusType { StatusType::Error = 0 }

Public Member Functions

void | setEnvironmentName (QString name)
Method for setting the name which should be displayed for the environment. More...
void | setFriction (int number)
Method for setting the displayed number of friction map entries. More...
void | setStatus (StatusType status, QString message)
Method which determines the frame color according to the status type passed as a first argument. Further, sets the status message to the second argument. More...
void | setTimeOfDay (int number)
Method for setting the displayed number of time of day map entries. More...
void | setVisibilityDistance (int number)
Method for setting the displayed number of visibility distance map entries. More...
void | setWeather (int number)
Method for setting the displayed number of weather map entries. More...
- Public Member Functions inherited from WidgetView
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Private Attributes

QMap< StatusType, QString > | color
a color map which determines the color code according to the status type
Ui::EnvironmentDisplayView * | ui
the ui object containing the visualization elements of this display view

Additional Inherited Members

- Protected Member Functions inherited from WidgetView
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.

Detailed Description

This class provides a display for a quick overview of the environment configuration.

It contains an ui object describing the views appearence (defined in EnvironmentDisplayView.ui). This ui object comprises a form layout with labels showing the configuration that has been edited by EnvironmentView. The frame of the view can be coloured in order to notify the user whether the configuration is complete or not.

Definition at line 41 of file EnvironmentDisplayView.h.

Member Enumeration Documentation

◆ StatusType

enum EnvironmentDisplayView::StatusType
strong
Enumerator
Error

enum class for classifying the status (will be used to determine the color of the frame)

Definition at line 46 of file EnvironmentDisplayView.h.

46 {
47 Error = 0,
48 OK = 1,
49 Warning = 2
50 };

Member Function Documentation

◆ setEnvironmentName()

void EnvironmentDisplayView::setEnvironmentName ( QString name )

Method for setting the name which should be displayed for the environment.

Parameters
[in] name the name to be displayed for the environment

Definition at line 40 of file EnvironmentDisplayView.cpp.

41 {
42 ui->EnvironmentName->setText(name);
43 }
EnvironmentDisplayView::ui
Ui::EnvironmentDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: EnvironmentDisplayView.h:104

◆ setFriction()

void EnvironmentDisplayView::setFriction ( int number )

Method for setting the displayed number of friction map entries.

Parameters
[in] number the number of friction map entries

Definition at line 55 of file EnvironmentDisplayView.cpp.

56 {
57 ui->Friction->setText(QString::number(number));
58 }
EnvironmentDisplayView::ui
Ui::EnvironmentDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: EnvironmentDisplayView.h:104

◆ setStatus()

void EnvironmentDisplayView::setStatus | ( | StatusType | status,
 |  | QString | message
 | ) |  |

Method which determines the frame color according to the status type passed as a first argument. Further, sets the status message to the second argument.

Parameters
[in] | status | the status type (defined in enum class StatusType)
[in] | message | the message to be displayed as a status.

Definition at line 65 of file EnvironmentDisplayView.cpp.

66 {
67 ui->Status->setText(message);
68
69 setStyleSheet(color[status]);
70 }
EnvironmentDisplayView::color
QMap< StatusType, QString > color
a color map which determines the color code according to the status type
Definition: EnvironmentDisplayView.h:103
EnvironmentDisplayView::ui
Ui::EnvironmentDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: EnvironmentDisplayView.h:104

◆ setTimeOfDay()

void EnvironmentDisplayView::setTimeOfDay ( int number )

Method for setting the displayed number of time of day map entries.

Parameters
[in] number the number of time of day map entries

Definition at line 45 of file EnvironmentDisplayView.cpp.

46 {
47 ui->TimeOfDay->setText(QString::number(number));
48 }
EnvironmentDisplayView::ui
Ui::EnvironmentDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: EnvironmentDisplayView.h:104

◆ setVisibilityDistance()

void EnvironmentDisplayView::setVisibilityDistance ( int number )

Method for setting the displayed number of visibility distance map entries.

Parameters
[in] number the number of visibility distance map entries

Definition at line 50 of file EnvironmentDisplayView.cpp.

51 {
52 ui->Visibility->setText(QString::number(number));
53 }
EnvironmentDisplayView::ui
Ui::EnvironmentDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: EnvironmentDisplayView.h:104

◆ setWeather()

void EnvironmentDisplayView::setWeather ( int number )

Method for setting the displayed number of weather map entries.

Parameters
[in] number the number of weather map entries

Definition at line 60 of file EnvironmentDisplayView.cpp.

61 {
62 ui->Weather->setText(QString::number(number));
63 }
EnvironmentDisplayView::ui
Ui::EnvironmentDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: EnvironmentDisplayView.h:104
The documentation for this class was generated from the following files:
  • EnvironmentDisplayView.h
  • EnvironmentDisplayView.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EnvironmentDisplayView Member List

This is the complete list of members for EnvironmentDisplayView, including all inherited members.

color | EnvironmentDisplayView | private
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
setEnvironmentName(QString name) | EnvironmentDisplayView |
setFriction(int number) | EnvironmentDisplayView |
setStatus(StatusType status, QString message) | EnvironmentDisplayView |
setTimeOfDay(int number) | EnvironmentDisplayView |
setVisibilityDistance(int number) | EnvironmentDisplayView |
setWeather(int number) | EnvironmentDisplayView |
StatusType enum name | EnvironmentDisplayView |
ui | EnvironmentDisplayView | private
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
EnvironmentInterface Class Referenceabstract

The EnvironmentInterface class provides setter and getter methods for the maps of environmental parameters, listed under <EnvironmentConfig> in the slaveConfig XML file. More...

Inheritance diagram for EnvironmentInterface:
EnvironmentModel

Public Types

using | FrictionMap = QMap< ID, Item * >
The container class for storing friction coefficients.
using | ID = unsigned int
A key identifier for the map of environment items.
using | Item = EnvironmentItemInterface
The class describing one environmental parameter.
using | Name = QString
The name of the environment configuration.
using | Status = bool
Type characterizing the status of the environment settings.
using | TimeOfDayMap = QMap< ID, Item * >
The container class for storing time of day parameters.
using | VisibilityDistanceMap = QMap< ID, Item * >
The container class for storing visitbility distances.
using | WeatherMap = QMap< ID, Item * >
The container class for storing wheather parameters.

Signals

void | edited ()
Signal, emitted when the environment settings have changed (e.g. specific parameters). Will be noticed by the EnvironmentDisplayPresenter to update the displayed info on the environment setting.
void | modifiedName ()
Signal, emitted when the name of the environment setting has been changed using the setName method. Will inform EnvironmentDisplayPresenter to display the new name.
void | modifiedStatus ()
Signal, emitted when the environment's status has changed.

Public Member Functions

virtual Item * | createItem (Item::Value const &value, Item::Probability const &probability)=0
Creates an environmental parameter (i.e. an instance of EnvironmentItemInterface) with the given value and probability and returns a pointer to it. More...
virtual FrictionMap * | getFrictionMap () const =0
Returns a pointer to the map of friction coefficients. More...
virtual Name | getName () const =0
Returns the current name of the environment configuration. More...
virtual Status | getStatus () const =0
Method which returns the current status of the environment settings. More...
virtual TimeOfDayMap * | getTimeOfDayMap () const =0
Returns a pointer to the time of day parameter map. More...
virtual VisibilityDistanceMap * | getVisibilityDistanceMap () const =0
Returns a pointer to the map of visibility distances. More...
virtual WeatherMap * | getWeatherMap () const =0
Returns a pointer to the map of whether parameters. More...
virtual void | reset ()=0
Method which clears all maps and deletes the correponding environmental parameters. Further sets the name to an empty string and emits the edited signal to inform the EnvironmentDisplayPresenter instance about the changes.
virtual void | setName (Name const &_name)=0
Sets the name of the environment configuration to the one passed as an argument. More...
virtual void | setStatus (Status const &_status)=0
Method for setting the status of the environment configuration to the value passed as an argument. More...

Detailed Description

The EnvironmentInterface class provides setter and getter methods for the maps of environmental parameters, listed under <EnvironmentConfig> in the slaveConfig XML file.

These comprise the time of day, visibility distance, friction coefficient and the wheather. Different parameters of the same kind can be listed in the slaveConfig giving a probability to be selected in a simulation run. Environmental parameters are instances of the EnvironmentItemInterface class. The container class for storing environmental parameters is Qt't QMap class.

Definition at line 46 of file EnvironmentInterface.h.

Member Function Documentation

◆ createItem()

virtual Item* EnvironmentInterface::createItem | ( | Item::Value const & | value,
 |  | Item::Probability const & | probability
 | ) |  |
pure virtual

Creates an environmental parameter (i.e. an instance of EnvironmentItemInterface) with the given value and probability and returns a pointer to it.

Parameters
[in] | value | the value of the new parameter
[in] | probability | the selection probability of the new parameter
Returns
a pointer to the newly created environment parameter

Implemented in EnvironmentModel.

◆ getFrictionMap()

virtual FrictionMap* EnvironmentInterface::getFrictionMap ( ) const
pure virtual

Returns a pointer to the map of friction coefficients.

Returns
the map of friction coefficients

Implemented in EnvironmentModel.

◆ getName()

virtual Name EnvironmentInterface::getName ( ) const
pure virtual

Returns the current name of the environment configuration.

Returns
the current name

Implemented in EnvironmentModel.

◆ getStatus()

virtual Status EnvironmentInterface::getStatus ( ) const
pure virtual

Method which returns the current status of the environment settings.

Returns
the current status of the environment configuration

Implemented in EnvironmentModel.

◆ getTimeOfDayMap()

virtual TimeOfDayMap* EnvironmentInterface::getTimeOfDayMap ( ) const
pure virtual

Returns a pointer to the time of day parameter map.

Returns
the time of day parameter map.

Implemented in EnvironmentModel.

◆ getVisibilityDistanceMap()

virtual VisibilityDistanceMap* EnvironmentInterface::getVisibilityDistanceMap ( ) const
pure virtual

Returns a pointer to the map of visibility distances.

Returns
the map of visibility distances

Implemented in EnvironmentModel.

◆ getWeatherMap()

virtual WeatherMap* EnvironmentInterface::getWeatherMap ( ) const
pure virtual

Returns a pointer to the map of whether parameters.

Returns
the map of whether parameters

Implemented in EnvironmentModel.

◆ setName()

virtual void EnvironmentInterface::setName ( Name const & _name )
pure virtual

Sets the name of the environment configuration to the one passed as an argument.

Parameters
[in] _name the new name

Implemented in EnvironmentModel.

◆ setStatus()

virtual void EnvironmentInterface::setStatus ( Status const & _status )
pure virtual

Method for setting the status of the environment configuration to the value passed as an argument.

Parameters
[in] _status the status

Implemented in EnvironmentModel.

The documentation for this class was generated from the following file:
  • EnvironmentInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EnvironmentInterface Member List

This is the complete list of members for EnvironmentInterface, including all inherited members.

createItem(Item::Value const &value, Item::Probability const &probability)=0 | EnvironmentInterface | pure virtual
edited() | EnvironmentInterface | signal
FrictionMap typedef | EnvironmentInterface |
getFrictionMap() const =0 | EnvironmentInterface | pure virtual
getName() const =0 | EnvironmentInterface | pure virtual
getStatus() const =0 | EnvironmentInterface | pure virtual
getTimeOfDayMap() const =0 | EnvironmentInterface | pure virtual
getVisibilityDistanceMap() const =0 | EnvironmentInterface | pure virtual
getWeatherMap() const =0 | EnvironmentInterface | pure virtual
ID typedef | EnvironmentInterface |
Item typedef | EnvironmentInterface |
modifiedName() | EnvironmentInterface | signal
modifiedStatus() | EnvironmentInterface | signal
Name typedef | EnvironmentInterface |
reset()=0 | EnvironmentInterface | pure virtual
setName(Name const &_name)=0 | EnvironmentInterface | pure virtual
setStatus(Status const &_status)=0 | EnvironmentInterface | pure virtual
Status typedef | EnvironmentInterface |
TimeOfDayMap typedef | EnvironmentInterface |
VisibilityDistanceMap typedef | EnvironmentInterface |
WeatherMap typedef | EnvironmentInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentItemInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
EnvironmentItemInterface Class Referenceabstract

The EnvironmentItemInterface class provides methods for reading and editing environment parameters. More...

Inheritance diagram for EnvironmentItemInterface:
EnvironmentItemModel

Public Types

using | Probability = double
the selection probability's datatype.
using | Value = QString
a general string datatype for the environment parameter's value.

Signals

void edited ()
Signal, which is emitted when the environment parameter's attributes have been modified. Will be forwarded by the EnvironmentInterface instance.

Public Member Functions

virtual Probability | getProbability () const =0
Method which returns the current selection probability of the environment parameter. More...
virtual Value | getValue () const =0
Method which returns the current value of the environment parameter. More...
virtual void | setProbability (const Probability &_probability)=0
Method which sets the selection probability of the environment parameter to the one passed as an argument. More...
virtual void | setValue (const Value &_value)=0
Method which sets the value of the environment parameter to the one passed as an argument. More...

Detailed Description

The EnvironmentItemInterface class provides methods for reading and editing environment parameters.

An environment parameter is generally described by a value and a selection probability. The latter defines the probability to be selected as an environment parameter in a simulation run. Environment parameters are stored in the slaveConfig XML file under the <EnvironmentConfig> element.

Definition at line 37 of file EnvironmentItemInterface.h.

Member Function Documentation

◆ getProbability()

virtual Probability EnvironmentItemInterface::getProbability ( ) const
pure virtual

Method which returns the current selection probability of the environment parameter.

Returns
the current selection probability of the environment parameter

Implemented in EnvironmentItemModel.

◆ getValue()

virtual Value EnvironmentItemInterface::getValue ( ) const
pure virtual

Method which returns the current value of the environment parameter.

Returns
the current value of the environment parameter

Implemented in EnvironmentItemModel.

◆ setProbability()

virtual void EnvironmentItemInterface::setProbability ( const Probability & _probability )
pure virtual

Method which sets the selection probability of the environment parameter to the one passed as an argument.

Parameters
[in] _value the new probability to be adopted

Implemented in EnvironmentItemModel.

◆ setValue()

virtual void EnvironmentItemInterface::setValue ( const Value & _value )
pure virtual

Method which sets the value of the environment parameter to the one passed as an argument.

Parameters
[in] _value the new value to be adopted

Implemented in EnvironmentItemModel.

The documentation for this class was generated from the following file:
  • EnvironmentItemInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EnvironmentItemInterface Member List

This is the complete list of members for EnvironmentItemInterface, including all inherited members.

edited() | EnvironmentItemInterface | signal
getProbability() const =0 | EnvironmentItemInterface | pure virtual
getValue() const =0 | EnvironmentItemInterface | pure virtual
Probability typedef | EnvironmentItemInterface |
setProbability(const Probability &_probability)=0 | EnvironmentItemInterface | pure virtual
setValue(const Value &_value)=0 | EnvironmentItemInterface | pure virtual
Value typedef | EnvironmentItemInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentItemModel Class Reference

Public Member Functions | Private Attributes | List of all members
EnvironmentItemModel Class Reference

The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class. More...

Inheritance diagram for EnvironmentItemModel:
EnvironmentItemInterface

Public Member Functions

virtual Probability | getProbability () const override
Method which returns the current selection probability of the environment parameter. More...
virtual Value | getValue () const override
Method which returns the current value of the environment parameter. More...
virtual void | setProbability (const Probability &_probability) override
Method which sets the selection probability of the environment parameter to the one passed as an argument. More...
virtual void | setValue (const Value &_value) override
Method which sets the value of the environment parameter to the one passed as an argument. More...

Private Attributes

Probability probability
the current selection probability
Value value
the current value

Additional Inherited Members

- Public Types inherited from EnvironmentItemInterface
using | Probability = double
the selection probability's datatype.
using | Value = QString
a general string datatype for the environment parameter's value.
- Signals inherited from EnvironmentItemInterface
void | edited ()
Signal, which is emitted when the environment parameter's attributes have been modified. Will be forwarded by the EnvironmentInterface instance.

Detailed Description

The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class.

Definition at line 27 of file EnvironmentItemModel.h.

Member Function Documentation

◆ getProbability()

EnvironmentItemInterface::Probability EnvironmentItemModel::getProbability ( ) const
overridevirtual

Method which returns the current selection probability of the environment parameter.

Returns
the current selection probability of the environment parameter

Implements EnvironmentItemInterface.

Definition at line 43 of file EnvironmentItemModel.cpp.

44 {
45 return probability;
46 }
EnvironmentItemModel::probability
Probability probability
the current selection probability
Definition: EnvironmentItemModel.h:48

◆ getValue()

EnvironmentItemInterface::Value EnvironmentItemModel::getValue ( ) const
overridevirtual

Method which returns the current value of the environment parameter.

Returns
the current value of the environment parameter

Implements EnvironmentItemInterface.

Definition at line 30 of file EnvironmentItemModel.cpp.

31 {
32 return value;
33 }
EnvironmentItemModel::value
Value value
the current value
Definition: EnvironmentItemModel.h:49

◆ setProbability()

void EnvironmentItemModel::setProbability ( const Probability & _probability )
overridevirtual

Method which sets the selection probability of the environment parameter to the one passed as an argument.

Parameters
[in] _value the new probability to be adopted

Implements EnvironmentItemInterface.

Definition at line 36 of file EnvironmentItemModel.cpp.

37 {
38 probability = _probability;
39 Q_EMIT edited();
40 }
EnvironmentItemInterface::edited
void edited()
Signal, which is emitted when the environment parameter&#39;s attributes have been modified. Will be forwarded by the EnvironmentInterface instance.
EnvironmentItemModel::probability
Probability probability
the current selection probability
Definition: EnvironmentItemModel.h:48

◆ setValue()

void EnvironmentItemModel::setValue ( const Value & _value )
overridevirtual

Method which sets the value of the environment parameter to the one passed as an argument.

Parameters
[in] _value the new value to be adopted

Implements EnvironmentItemInterface.

Definition at line 23 of file EnvironmentItemModel.cpp.

24 {
25 value = _value;
26 Q_EMIT edited();
27 }
EnvironmentItemModel::value
Value value
the current value
Definition: EnvironmentItemModel.h:49
EnvironmentItemInterface::edited
void edited()
Signal, which is emitted when the environment parameter&#39;s attributes have been modified. Will be forwarded by the EnvironmentInterface instance.
The documentation for this class was generated from the following files:
  • EnvironmentItemModel.h
  • EnvironmentItemModel.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EnvironmentItemModel Member List

This is the complete list of members for EnvironmentItemModel, including all inherited members.

edited() | EnvironmentItemInterface | signal
getProbability() const override | EnvironmentItemModel | virtual
getValue() const override | EnvironmentItemModel | virtual
Probability typedef | EnvironmentItemInterface |
probability | EnvironmentItemModel | private
setProbability(const Probability &_probability) override | EnvironmentItemModel | virtual
setValue(const Value &_value) override | EnvironmentItemModel | virtual
value | EnvironmentItemModel | private
Value typedef | EnvironmentItemInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentMapPresenter Class Reference

Public Member Functions | Private Attributes | List of all members
EnvironmentMapPresenter Class Reference

This class describes the presenter objects of the environment parameter maps. More...

Inherits QAbstractTableModel.

Public Member Functions

void | addRow (const int &row, QString value, double probability)
Method that adds a new row, i.e. a new environment item to the edited component.
int | columnCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders. More...
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex). More...
virtual Qt::ItemFlags | flags (const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! More...
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format. More...
bool | removeRow (const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval. More...
int | rowCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of environment parameters. More...
virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value. More...
void | update ()
Method which updates the table according to the current entries of environmentMap.

Private Attributes

QStringList | _columnHeaders
the column header's info
EnvironmentInterface *const | environment
an instance of the environment model
QMap< ID, Item * > *const | environmentMap
an instance of the map listing the environment parameter (instances of EnvironmentItemInterface)
QMap< int, ID > | RowToID
a map translating row indices to IDs of environment parameters
QUndoStack *const | undoStack
a pointer to the undo stack

Detailed Description

This class describes the presenter objects of the environment parameter maps.

In the spirit of Qt's Model/View framework it constitutes the wrapper class connecting the model data (environment maps defined in EnvironmentInterface) with the interface defined in QAbstractTableModel. This interface can be then utilized by instances Qt's QTableView to display the map entries in a table format.

See https://doc.qt.io/qt-5/model-view-programming.html for Qt's model/view framework.

Definition at line 49 of file EnvironmentMapPresenter.h.

Member Function Documentation

◆ columnCount()

int EnvironmentMapPresenter::columnCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table columns

Definition at line 26 of file EnvironmentMapPresenter.cpp.

27 {
28 Q_UNUSED(parent);
29
30 return _columnHeaders.count();
31 }
EnvironmentMapPresenter::_columnHeaders
QStringList _columnHeaders
the column header&#39;s info
Definition: EnvironmentMapPresenter.h:171

◆ data()

QVariant EnvironmentMapPresenter::data | ( | const QModelIndex & | index,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex).

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::DisplayRole or Qt::EditRole)
Returns
The data stored in the table cell (as a QVariant)

Definition at line 53 of file EnvironmentMapPresenter.cpp.

54 {
55 int row = index.row();
56 int col = index.column();
57 EnvironmentInterface::Item * item = environmentMap->value(RowToID[row]);
58
59 if(row >= environmentMap->count())
60 return QVariant::Invalid;
61
62 if(role == Qt::TextAlignmentRole)
63 return QVariant(Qt::AlignCenter);
64
65 if(item && (role == Qt::DisplayRole || role == Qt::EditRole))
66 {
67 if( col == 0)
68 return QVariant(item->getValue());
69 else if(col == 1)
70 return QVariant(item->getProbability());
71 }
72
73 return QVariant();
74 }
EnvironmentMapPresenter::environmentMap
QMap< ID, Item * > *const environmentMap
an instance of the map listing the environment parameter (instances of EnvironmentItemInterface) ...
Definition: EnvironmentMapPresenter.h:166
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentMapPresenter::RowToID
QMap< int, ID > RowToID
a map translating row indices to IDs of environment parameters
Definition: EnvironmentMapPresenter.h:170
EnvironmentItemInterface::getProbability
virtual Probability getProbability() const =0
Method which returns the current selection probability of the environment parameter.
EnvironmentItemInterface::getValue
virtual Value getValue() const =0
Method which returns the current value of the environment parameter.

◆ flags()

Qt::ItemFlags EnvironmentMapPresenter::flags ( const QModelIndex & index ) const
overridevirtual

Reimplementation of the flags method. This will make the items of the model editable!

Parameters
[in] index An index identifying the cell of the table
Returns
An item flag

Definition at line 103 of file EnvironmentMapPresenter.cpp.

104 {
105 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
106 }

◆ headerData()

QVariant EnvironmentMapPresenter::headerData | ( | int | section,
 |  | Qt::Orientation | orientation,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format.

Parameters
[in] | section | A table section
[in] | role | A Qt role
[in] | orientation | A table orientation
Returns
The content of the table's header at the given section

Definition at line 40 of file EnvironmentMapPresenter.cpp.

43 {
44 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
45 return _columnHeaders.value(section);
46
47 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
48 return section + 1;
49
50 return QVariant();
51 }
EnvironmentMapPresenter::_columnHeaders
QStringList _columnHeaders
the column header&#39;s info
Definition: EnvironmentMapPresenter.h:171

◆ removeRow()

bool EnvironmentMapPresenter::removeRow ( const int & row )

Method that removes the row specified by the given row-index, if this is in a meaningful interval.

Parameters
[in] row the row-index
Returns
"True", if row is between 0 and the number of inputs, "false", otherwise

Definition at line 128 of file EnvironmentMapPresenter.cpp.

129 {
130 if( RowToID.contains(row) )
131 {
132 beginRemoveRows(QModelIndex(), row, row);
133 delete environmentMap->take(RowToID[row]);
134 RowToID.take(row);
135
136 // shift the ID to row map for everything below this Item
137 for( int i = row + 1; i<=RowToID.count() ; i++)
138 RowToID.insert( i-1, RowToID.take(i) );
139
140 Q_EMIT environment->edited();
141 endRemoveRows();
142
143 return true;
144 }
145 else
146 return false;
147 }
EnvironmentMapPresenter::environment
EnvironmentInterface *const environment
an instance of the environment model
Definition: EnvironmentMapPresenter.h:165
EnvironmentMapPresenter::environmentMap
QMap< ID, Item * > *const environmentMap
an instance of the map listing the environment parameter (instances of EnvironmentItemInterface) ...
Definition: EnvironmentMapPresenter.h:166
EnvironmentMapPresenter::RowToID
QMap< int, ID > RowToID
a map translating row indices to IDs of environment parameters
Definition: EnvironmentMapPresenter.h:170
EnvironmentInterface::edited
void edited()
Signal, emitted when the environment settings have changed (e.g. specific parameters). Will be noticed by the EnvironmentDisplayPresenter to update the displayed info on the environment setting.

◆ rowCount()

int EnvironmentMapPresenter::rowCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of environment parameters.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table rows

Definition at line 33 of file EnvironmentMapPresenter.cpp.

34 {
35 Q_UNUSED(parent);
36
37 return environmentMap->count();
38 }
EnvironmentMapPresenter::environmentMap
QMap< ID, Item * > *const environmentMap
an instance of the map listing the environment parameter (instances of EnvironmentItemInterface) ...
Definition: EnvironmentMapPresenter.h:166

◆ setData()

bool EnvironmentMapPresenter::setData | ( | const QModelIndex & | index,
 |  | const QVariant & | value,
 |  | int | role = Qt::EditRole
 | ) |  |
overridevirtual

Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value.

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::EditRole)
Returns
"True" if the index corresponds to an existing cell in the table, otherwise "false"

Definition at line 76 of file EnvironmentMapPresenter.cpp.

79 {
80 int row = index.row();
81 int col = index.column();
82 EnvironmentInterface::Item * item = environmentMap->value(RowToID[row]);
83
84 if(role == Qt::EditRole)
85 {
86 if(col == 0)
87 {
88 item->setValue(value.toString());
89 Q_EMIT dataChanged(index, index);
90 return true;
91 }
92 else if(col == 1)
93 {
94 item->setProbability(value.toDouble());
95 Q_EMIT dataChanged(index, index);
96 return true;
97 }
98 }
99
100 return false;
101 }
EnvironmentItemInterface::setProbability
virtual void setProbability(const Probability &_probability)=0
Method which sets the selection probability of the environment parameter to the one passed as an argu...
EnvironmentMapPresenter::environmentMap
QMap< ID, Item * > *const environmentMap
an instance of the map listing the environment parameter (instances of EnvironmentItemInterface) ...
Definition: EnvironmentMapPresenter.h:166
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentMapPresenter::RowToID
QMap< int, ID > RowToID
a map translating row indices to IDs of environment parameters
Definition: EnvironmentMapPresenter.h:170
EnvironmentItemInterface::setValue
virtual void setValue(const Value &_value)=0
Method which sets the value of the environment parameter to the one passed as an argument.
The documentation for this class was generated from the following files:
  • EnvironmentMapPresenter.h
  • EnvironmentMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EnvironmentMapPresenter Member List

This is the complete list of members for EnvironmentMapPresenter, including all inherited members.

_columnHeaders | EnvironmentMapPresenter | private
addRow(const int &row, QString value, double probability) | EnvironmentMapPresenter |
columnCount(const QModelIndex &parent=QModelIndex()) const override | EnvironmentMapPresenter |
data(const QModelIndex &index, int role=Qt::DisplayRole) const override | EnvironmentMapPresenter |
environment | EnvironmentMapPresenter | private
environmentMap | EnvironmentMapPresenter | private
flags(const QModelIndex &index) const override | EnvironmentMapPresenter | virtual
headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override | EnvironmentMapPresenter |
removeRow(const int &row) | EnvironmentMapPresenter |
rowCount(const QModelIndex &parent=QModelIndex()) const override | EnvironmentMapPresenter |
RowToID | EnvironmentMapPresenter | private
setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override | EnvironmentMapPresenter | virtual
undoStack | EnvironmentMapPresenter | private
update() | EnvironmentMapPresenter |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentModel Class Reference

Public Member Functions | Private Attributes | List of all members
EnvironmentModel Class Reference

The Environment Model implements the functionality of the EnvironmentInterface class. More...

Inheritance diagram for EnvironmentModel:
EnvironmentInterface

Public Member Functions

virtual Item * | createItem (Item::Value const &value, Item::Probability const &probability) override
Creates an environmental parameter (i.e. an instance of EnvironmentItemInterface) with the given value and probability and returns a pointer to it. More...
virtual FrictionMap * | getFrictionMap () const override
Returns a pointer to the map of friction coefficients. More...
virtual Name | getName () const override
Returns the current name of the environment configuration. More...
virtual Status | getStatus () const override
Method which returns the current status of the environment settings. More...
virtual TimeOfDayMap * | getTimeOfDayMap () const override
Returns a pointer to the time of day parameter map. More...
virtual VisibilityDistanceMap * | getVisibilityDistanceMap () const override
Returns a pointer to the map of visibility distances. More...
virtual WeatherMap * | getWeatherMap () const override
Returns a pointer to the map of whether parameters. More...
virtual void | reset () override
Method which clears all maps and deletes the correponding environmental parameters. Further sets the name to an empty string and emits the edited signal to inform the EnvironmentDisplayPresenter instance about the changes.
virtual void | setName (Name const &_name) override
Sets the name of the environment configuration to the one passed as an argument. More...
virtual void | setStatus (Status const &_status) override
Method for setting the status of the environment configuration to the value passed as an argument. More...

Private Attributes

FrictionMap *const | frictionMap
the pointer to the map of friction coefficients
Name name
the name of the environment configuration
Status status
the current status of the settings. "true" means that the configuration is principally ready for simulation
TimeOfDayMap *const | timeOfDayMap
the pointer to the map of time of day parameters
VisibilityDistanceMap *const | visibilityDistanceMap
the pointer to the visibility distance map
WeatherMap *const | weatherMap
the pointer to the map of wheather parameters

Additional Inherited Members

- Public Types inherited from EnvironmentInterface
using | FrictionMap = QMap< ID, Item * >
The container class for storing friction coefficients.
using | ID = unsigned int
A key identifier for the map of environment items.
using | Item = EnvironmentItemInterface
The class describing one environmental parameter.
using | Name = QString
The name of the environment configuration.
using | Status = bool
Type characterizing the status of the environment settings.
using | TimeOfDayMap = QMap< ID, Item * >
The container class for storing time of day parameters.
using | VisibilityDistanceMap = QMap< ID, Item * >
The container class for storing visitbility distances.
using | WeatherMap = QMap< ID, Item * >
The container class for storing wheather parameters.
- Signals inherited from EnvironmentInterface
void | edited ()
Signal, emitted when the environment settings have changed (e.g. specific parameters). Will be noticed by the EnvironmentDisplayPresenter to update the displayed info on the environment setting.
void | modifiedName ()
Signal, emitted when the name of the environment setting has been changed using the setName method. Will inform EnvironmentDisplayPresenter to display the new name.
void | modifiedStatus ()
Signal, emitted when the environment's status has changed.

Detailed Description

The Environment Model implements the functionality of the EnvironmentInterface class.

Definition at line 29 of file EnvironmentModel.h.

Member Function Documentation

◆ createItem()

EnvironmentInterface::Item * EnvironmentModel::createItem | ( | Item::Value const & | value,
 |  | Item::Probability const & | probability
 | ) |  |
overridevirtual

Creates an environmental parameter (i.e. an instance of EnvironmentItemInterface) with the given value and probability and returns a pointer to it.

Parameters
[in] | value | the value of the new parameter
[in] | probability | the selection probability of the new parameter
Returns
a pointer to the newly created environment parameter

Implements EnvironmentInterface.

Definition at line 65 of file EnvironmentModel.cpp.

67 {
68 EnvironmentItemInterface *item = new EnvironmentItemModel(value, probability, this);
69 connect(item, &EnvironmentItemInterface::edited, this, &EnvironmentInterface::edited);
70
71 return item;
72 }
EnvironmentItemModel
The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class...
Definition: EnvironmentItemModel.h:27
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentItemInterface::edited
void edited()
Signal, which is emitted when the environment parameter&#39;s attributes have been modified. Will be forwarded by the EnvironmentInterface instance.
EnvironmentInterface::edited
void edited()
Signal, emitted when the environment settings have changed (e.g. specific parameters). Will be noticed by the EnvironmentDisplayPresenter to update the displayed info on the environment setting.

◆ getFrictionMap()

EnvironmentInterface::FrictionMap * EnvironmentModel::getFrictionMap ( ) const
overridevirtual

Returns a pointer to the map of friction coefficients.

Returns
the map of friction coefficients

Implements EnvironmentInterface.

Definition at line 55 of file EnvironmentModel.cpp.

56 {
57 return frictionMap;
58 }
EnvironmentModel::frictionMap
FrictionMap *const frictionMap
the pointer to the map of friction coefficients
Definition: EnvironmentModel.h:60

◆ getName()

EnvironmentInterface::Name EnvironmentModel::getName ( ) const
overridevirtual

Returns the current name of the environment configuration.

Returns
the current name

Implements EnvironmentInterface.

Definition at line 25 of file EnvironmentModel.cpp.

26 {
27 return name;
28 }
EnvironmentModel::name
Name name
the name of the environment configuration
Definition: EnvironmentModel.h:57

◆ getStatus()

EnvironmentInterface::Status EnvironmentModel::getStatus ( ) const
overridevirtual

Method which returns the current status of the environment settings.

Returns
the current status of the environment configuration

Implements EnvironmentInterface.

Definition at line 100 of file EnvironmentModel.cpp.

101 {
102 return status;
103 }
EnvironmentModel::status
Status status
the current status of the settings. "true" means that the configuration is principally ready for simu...
Definition: EnvironmentModel.h:62

◆ getTimeOfDayMap()

EnvironmentInterface::TimeOfDayMap * EnvironmentModel::getTimeOfDayMap ( ) const
overridevirtual

Returns a pointer to the time of day parameter map.

Returns
the time of day parameter map.

Implements EnvironmentInterface.

Definition at line 45 of file EnvironmentModel.cpp.

46 {
47 return timeOfDayMap;
48 }
EnvironmentModel::timeOfDayMap
TimeOfDayMap *const timeOfDayMap
the pointer to the map of time of day parameters
Definition: EnvironmentModel.h:58

◆ getVisibilityDistanceMap()

EnvironmentInterface::VisibilityDistanceMap * EnvironmentModel::getVisibilityDistanceMap ( ) const
overridevirtual

Returns a pointer to the map of visibility distances.

Returns
the map of visibility distances

Implements EnvironmentInterface.

Definition at line 50 of file EnvironmentModel.cpp.

51 {
52 return visibilityDistanceMap;
53 }
EnvironmentModel::visibilityDistanceMap
VisibilityDistanceMap *const visibilityDistanceMap
the pointer to the visibility distance map
Definition: EnvironmentModel.h:59

◆ getWeatherMap()

EnvironmentInterface::WeatherMap * EnvironmentModel::getWeatherMap ( ) const
overridevirtual

Returns a pointer to the map of whether parameters.

Returns
the map of whether parameters

Implements EnvironmentInterface.

Definition at line 60 of file EnvironmentModel.cpp.

61 {
62 return weatherMap;
63 }
EnvironmentModel::weatherMap
WeatherMap *const weatherMap
the pointer to the map of wheather parameters
Definition: EnvironmentModel.h:61

◆ setName()

void EnvironmentModel::setName ( Name const & _name )
overridevirtual

Sets the name of the environment configuration to the one passed as an argument.

Parameters
[in] _name the new name

Implements EnvironmentInterface.

Definition at line 30 of file EnvironmentModel.cpp.

31 {
32 name = _name;
33 Q_EMIT modifiedName();
34 }
EnvironmentInterface::modifiedName
void modifiedName()
Signal, emitted when the name of the environment setting has been changed using the setName method...
EnvironmentModel::name
Name name
the name of the environment configuration
Definition: EnvironmentModel.h:57

◆ setStatus()

void EnvironmentModel::setStatus ( Status const & _status )
overridevirtual

Method for setting the status of the environment configuration to the value passed as an argument.

Parameters
[in] _status the status

Implements EnvironmentInterface.

Definition at line 94 of file EnvironmentModel.cpp.

95 {
96 status = _status;
97 Q_EMIT modifiedStatus();
98 }
EnvironmentInterface::modifiedStatus
void modifiedStatus()
Signal, emitted when the environment&#39;s status has changed.
EnvironmentModel::status
Status status
the current status of the settings. "true" means that the configuration is principally ready for simu...
Definition: EnvironmentModel.h:62
The documentation for this class was generated from the following files:
  • EnvironmentModel.h
  • EnvironmentModel.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EnvironmentModel Member List

This is the complete list of members for EnvironmentModel, including all inherited members.

createItem(Item::Value const &value, Item::Probability const &probability) override | EnvironmentModel | virtual
edited() | EnvironmentInterface | signal
frictionMap | EnvironmentModel | private
FrictionMap typedef | EnvironmentInterface |
getFrictionMap() const override | EnvironmentModel | virtual
getName() const override | EnvironmentModel | virtual
getStatus() const override | EnvironmentModel | virtual
getTimeOfDayMap() const override | EnvironmentModel | virtual
getVisibilityDistanceMap() const override | EnvironmentModel | virtual
getWeatherMap() const override | EnvironmentModel | virtual
ID typedef | EnvironmentInterface |
Item typedef | EnvironmentInterface |
modifiedName() | EnvironmentInterface | signal
modifiedStatus() | EnvironmentInterface | signal
Name typedef | EnvironmentInterface |
name | EnvironmentModel | private
reset() override | EnvironmentModel | virtual
setName(Name const &_name) override | EnvironmentModel | virtual
setStatus(Status const &_status) override | EnvironmentModel | virtual
Status typedef | EnvironmentInterface |
status | EnvironmentModel | private
timeOfDayMap | EnvironmentModel | private
TimeOfDayMap typedef | EnvironmentInterface |
VisibilityDistanceMap typedef | EnvironmentInterface |
visibilityDistanceMap | EnvironmentModel | private
WeatherMap typedef | EnvironmentInterface |
weatherMap | EnvironmentModel | private
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentPresenter Class Reference

Public Member Functions | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
EnvironmentPresenter Class Reference

This class defines the presenter object which handles user events coming from the view (EnvironmentView) and edits the model accordingly (EnvironmentInterface). More...

Inherits QObject.

Public Member Functions

void updateView ()
Method which updates the view (EnvironmentView) to the current state of the model (EnvironmentModel / EnvironmentInterface).

Private Slots

void | addFriction ()
Slot which is connected to the EnvironmentView::addFriction signal. Calls the EnvironmentMapPresenter::addRow method of the presenter object of the map of friction coefficients.
void | addTimeOfDay ()
Slot which is connected to the EnvironmentView::addTimeOfDay signal. Calls the EnvironmentMapPresenter::addRow method of the presenter object of the time of day map.
void | addVisibilityDistance ()
Slot which is connected to the EnvironmentView::addVisibilityDistance signal. Calls the EnvironmentMapPresenter::addRow method of the presenter object of the map of visibility distances.
void | addWeather ()
Slot which is connected to the EnvironmentView::addWeather signal. Calls the EnvironmentMapPresenter::addRow method of the presenter object of the map of weather parameters.
void | checkProbabilities ()
Slot which checks the probability sums of all environment parameters. If for a particular parameter map the probabilitiy sum deviates from 1, a hint will be displayed in the corresponding view.
void | removeFriction (const int &row)
Slot which is connected to the EnvironmentView::removeFriction signal. Calls the EnvironmentMapPresenter::removeRow method of the presenter object of the map of friction. More...
void | removeTimeOfDay (const int &row)
Slot which is connected to the EnvironmentView::removeTimeOfDay signal. Calls the EnvironmentMapPresenter::removeRow method of the presenter object of the time of day map. More...
void | removeVisibilityDistance (const int &row)
Slot which is connected to the EnvironmentView::removeVisibilityDistance signal. Calls the EnvironmentMapPresenter::removeRow method of the presenter object of the map of vistibility distances. More...
void | removeWeather (const int &row)
Slot which is connected to the EnvironmentView::removeWeather signal. Calls the EnvironmentMapPresenter::removeRow method of the presenter object of the map of weather parameters. More...
void | setName (QString const &name)
Slot which is connected to the EnvironmentView::modifiedName signal. Sets the model's value of the environment name to the one transmitted by the view. More...

Private Member Functions

void | SetupFriction ()
An initializer method which configures the table view of friction coefficients. Creates the table's presenter object (EnvironmentMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.
void | SetupTimeOfDay ()
An initializer method which configures the table view of the time of day parameters. Creates the table's presenter object (EnvironmentMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.
void | SetupVisibilityDistance ()
An initializer method which configures the table view of visibility distances Creates the table's presenter object (EnvironmentMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.
void | SetupWeather ()
An initializer method which configures the table view of weather parameters. Creates the table's presenter object (EnvironmentMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.

Private Attributes

EnvironmentInterface *const | environment
a pointer to the model of the environment configuration
EnvironmentView *const | environmentView
a pointer to the view of the environment configuration
EnvironmentMapPresenter *const | frictionPresenter
a pointer to the presenter object connecting the frition map to its table view
EnvironmentMapPresenter *const | timeOfDayPresenter
a pointer to the presenter object connecting the time of day map to its table view
QUndoStack *const | undoStack
a pointer to the undoStack
EnvironmentMapPresenter *const | visibilityDistancePresenter
a pointer to the presenter object connecting the visibility distance map to its table view
EnvironmentMapPresenter *const | weatherPresenter
a pointer to the presenter object connecting the weather map to its table view

Static Private Attributes

static QString const | default_friction = "1.00"
a default friction coefficient
static double const | default_probability = 0.5
a default selection probability
static QString const | default_timeOfDay = "15:00"
a default time of day parameter
static QString const | default_visibilityDistance = "1000.0"
a default visbility distance
static QString const | default_weather = "Sunny"
a default weather parameter
static QStringList const | weatherList
a list of availbale weather parameters (the user can choose from this list)

Detailed Description

This class defines the presenter object which handles user events coming from the view (EnvironmentView) and edits the model accordingly (EnvironmentInterface).

Definition at line 33 of file EnvironmentPresenter.h.

Member Function Documentation

◆ removeFriction

void EnvironmentPresenter::removeFriction ( const int & row )
privateslot

Slot which is connected to the EnvironmentView::removeFriction signal. Calls the EnvironmentMapPresenter::removeRow method of the presenter object of the map of friction.

Parameters
[in] row the row of the table whose environment parameter should be deleted

Definition at line 194 of file EnvironmentPresenter.cpp.

195 {
196 if(frictionPresenter->rowCount() != 0 )
197 undoStack->push(new RemoveEnvironmentItem(frictionPresenter, row, "friction coefficients table"));
198 }
RemoveEnvironmentItem
Command class for removing rows from the table of environment settings.
Definition: EnvironmentPresenter.h:222
EnvironmentPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undoStack
Definition: EnvironmentPresenter.h:177
EnvironmentPresenter::frictionPresenter
EnvironmentMapPresenter *const frictionPresenter
a pointer to the presenter object connecting the frition map to its table view
Definition: EnvironmentPresenter.h:182
EnvironmentMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: EnvironmentMapPresenter.cpp:33

◆ removeTimeOfDay

void EnvironmentPresenter::removeTimeOfDay ( const int & row )
privateslot

Slot which is connected to the EnvironmentView::removeTimeOfDay signal. Calls the EnvironmentMapPresenter::removeRow method of the presenter object of the time of day map.

Parameters
[in] row the row of the table whose environment parameter should be deleted

Definition at line 171 of file EnvironmentPresenter.cpp.

172 {
173 if(timeOfDayPresenter->rowCount() != 0 )
174 undoStack->push(new RemoveEnvironmentItem(timeOfDayPresenter, row, "time of day table"));
175 }
EnvironmentPresenter::timeOfDayPresenter
EnvironmentMapPresenter *const timeOfDayPresenter
a pointer to the presenter object connecting the time of day map to its table view ...
Definition: EnvironmentPresenter.h:180
RemoveEnvironmentItem
Command class for removing rows from the table of environment settings.
Definition: EnvironmentPresenter.h:222
EnvironmentPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undoStack
Definition: EnvironmentPresenter.h:177
EnvironmentMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: EnvironmentMapPresenter.cpp:33

◆ removeVisibilityDistance

void EnvironmentPresenter::removeVisibilityDistance ( const int & row )
privateslot

Slot which is connected to the EnvironmentView::removeVisibilityDistance signal. Calls the EnvironmentMapPresenter::removeRow method of the presenter object of the map of vistibility distances.

Parameters
[in] row the row of the table whose environment parameter should be deleted

Definition at line 183 of file EnvironmentPresenter.cpp.

184 {
185 if(visibilityDistancePresenter->rowCount() != 0 )
186 undoStack->push(new RemoveEnvironmentItem(visibilityDistancePresenter, row, "visibility distances table"));
187 }
RemoveEnvironmentItem
Command class for removing rows from the table of environment settings.
Definition: EnvironmentPresenter.h:222
EnvironmentPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undoStack
Definition: EnvironmentPresenter.h:177
EnvironmentPresenter::visibilityDistancePresenter
EnvironmentMapPresenter *const visibilityDistancePresenter
a pointer to the presenter object connecting the visibility distance map to its table view ...
Definition: EnvironmentPresenter.h:181
EnvironmentMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: EnvironmentMapPresenter.cpp:33

◆ removeWeather

void EnvironmentPresenter::removeWeather ( const int & row )
privateslot

Slot which is connected to the EnvironmentView::removeWeather signal. Calls the EnvironmentMapPresenter::removeRow method of the presenter object of the map of weather parameters.

Parameters
[in] row the row of the table whose environment parameter should be deleted

Definition at line 206 of file EnvironmentPresenter.cpp.

207 {
208 if(weatherPresenter->rowCount() != 0 )
209 undoStack->push(new RemoveEnvironmentItem(weatherPresenter,row, "weather table"));
210 }
EnvironmentPresenter::weatherPresenter
EnvironmentMapPresenter *const weatherPresenter
a pointer to the presenter object connecting the weather map to its table view
Definition: EnvironmentPresenter.h:183
RemoveEnvironmentItem
Command class for removing rows from the table of environment settings.
Definition: EnvironmentPresenter.h:222
EnvironmentPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undoStack
Definition: EnvironmentPresenter.h:177
EnvironmentMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: EnvironmentMapPresenter.cpp:33

◆ setName

void EnvironmentPresenter::setName ( QString const & name )
privateslot

Slot which is connected to the EnvironmentView::modifiedName signal. Sets the model's value of the environment name to the one transmitted by the view.

Parameters
[in] name the environment name transmitted by the view

Definition at line 102 of file EnvironmentPresenter.cpp.

103 {
104 if(environment->getName() != name)
105 undoStack->push(new EditEnvironmentName(environment,environmentView,name));
106 }
EnvironmentPresenter::environment
EnvironmentInterface *const environment
a pointer to the model of the environment configuration
Definition: EnvironmentPresenter.h:175
EditEnvironmentName
Command class editing the environment&#39;s name.
Definition: EnvironmentPresenter.h:245
EnvironmentPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undoStack
Definition: EnvironmentPresenter.h:177
EnvironmentPresenter::environmentView
EnvironmentView *const environmentView
a pointer to the view of the environment configuration
Definition: EnvironmentPresenter.h:176
EnvironmentInterface::getName
virtual Name getName() const =0
Returns the current name of the environment configuration.
The documentation for this class was generated from the following files:
  • EnvironmentPresenter.h
  • EnvironmentPresenter.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EnvironmentPresenter Member List

This is the complete list of members for EnvironmentPresenter, including all inherited members.

addFriction() | EnvironmentPresenter | privateslot
addTimeOfDay() | EnvironmentPresenter | privateslot
addVisibilityDistance() | EnvironmentPresenter | privateslot
addWeather() | EnvironmentPresenter | privateslot
checkProbabilities() | EnvironmentPresenter | privateslot
default_friction | EnvironmentPresenter | privatestatic
default_probability | EnvironmentPresenter | privatestatic
default_timeOfDay | EnvironmentPresenter | privatestatic
default_visibilityDistance | EnvironmentPresenter | privatestatic
default_weather | EnvironmentPresenter | privatestatic
environment | EnvironmentPresenter | private
environmentView | EnvironmentPresenter | private
frictionPresenter | EnvironmentPresenter | private
removeFriction(const int &row) | EnvironmentPresenter | privateslot
removeTimeOfDay(const int &row) | EnvironmentPresenter | privateslot
removeVisibilityDistance(const int &row) | EnvironmentPresenter | privateslot
removeWeather(const int &row) | EnvironmentPresenter | privateslot
setName(QString const &name) | EnvironmentPresenter | privateslot
SetupFriction() | EnvironmentPresenter | private
SetupTimeOfDay() | EnvironmentPresenter | private
SetupVisibilityDistance() | EnvironmentPresenter | private
SetupWeather() | EnvironmentPresenter | private
timeOfDayPresenter | EnvironmentPresenter | private
undoStack | EnvironmentPresenter | private
updateView() | EnvironmentPresenter |
visibilityDistancePresenter | EnvironmentPresenter | private
weatherList | EnvironmentPresenter | privatestatic
weatherPresenter | EnvironmentPresenter | private
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: EnvironmentView Class Reference

Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
EnvironmentView Class Reference

This class provides an editor for configuring the environment setup, i.e. it is filled with the content stored in an EnvironmentInterface instance. More...

Inherits QWidget.

Signals

void | addFriction ()
Signal, emitted when the user clicks the add-button of the table of friction coefficients.
void | addTimeOfDay ()
Signal, emitted when the user clicks the add-button of the time of day table.
void | addVisibilityDistance ()
Signal, emitted when the user clicks the add-button of the table of visibility distances.
void | addWeather ()
Signal, emitted when the user clicks the add-button of the table of weather parameters.
void | modifiedName (const QString &name)
Signal, emitted when the user edits the name of the environment configuration. Transmits the new name the user has typed in. More...
void | removeFriction (const int &row)
Signal, emitted when the user clicks the remove-button of the table of friction coefficients. Transmits the row index of the table cell being currently active. More...
void | removeTimeOfDay (const int &row)
Signal, emitted when the user clicks the remove-button of the time of day table. Transmits the row index of the table cell being currently active. More...
void | removeVisibilityDistance (const int &row)
Signal, emitted when the user clicks the remove-button of the table of visibility distances. Transmits the row index of the table cell being currently active. More...
void | removeWeather (const int &row)
Signal, emitted when the user clicks the remove-button of the table of friction coefficients. Transmits the row index of the table cell being currently active. More...

Public Member Functions

QTableView * | getFrictionView () const
Method which provides access to the table of friction coefficients. More...
QTableView * | getTimeOfDayView () const
Method which provides access to the table of time of day parameters. More...
QTableView * | getVisibilityDistanceView () const
Method which provides access to the table of visibility distances. More...
QTableView * | getWeatherView () const
Method which provides access to the table of weather parameters. More...
void | setFriction_ProbabilityError (bool error)
Method which displays a probability error message for the table of friction coefficients if the boolian argument is "true". More...
void | setName (QString const &name)
Method which sets the current text of the environment name's line edit. More...
void | setTimeOfDay_ProbabilityError (bool error)
Method which displays a probability error message for the table of time of day parameters if the boolian argument is "true". More...
void | setVisibilityDistance_ProbabilityError (bool error)
Method which displays a probability error message for the table of visibility distances if the boolian argument is "true". More...
void | setWeather_ProbabilityError (bool error)
Method which displays a probability error message for the table of weather parameters if the boolian argument is "true". More...

Private Slots

void | on_add_Friction_clicked ()
Qt Designer-created slot which emits the addFriction signal when the user clicks the add_Friction button.
void | on_add_TimeOfDay_clicked ()
Qt Designer-created slot which emits the addTimeOfDay signal when the user clicks the add_TimeOfDay button.
void | on_add_VisibilityDistance_clicked ()
Qt Designer-created slot which emits the addVisibilityDistance signal when the user clicks the add_VisibilityDistance button.
void | on_add_Weather_clicked ()
Qt Designer-created slot which emits the addWeather signal when the user clicks the add_Weather button.
void | on_Name_editingFinished ()
Qt Designer-created slot which emits the modifiedName signal when finishes editing the line edit for the environment configuration's name.
void | on_remove_Friction_clicked ()
Qt Designer-created slot which emits the removeFriction signal when the user clicks the remove_Friction button.
void | on_remove_TimeOfDay_clicked ()
Qt Designer-created slot which emits the removeTimeOfDay signal when the user clicks the remove_TimeOfDay button.
void | on_remove_VisibilityDistance_clicked ()
Qt Designer-created slot which emits the removeVisibilityDistance signal when the user clicks the remove_VisibilityDistance button.
void | on_remove_Weather_clicked ()
Qt Designer-created slot which emits the removeWeather signal when the user clicks the remove_Weather button.

Private Member Functions

bool eventFilter (QObject *watched, QEvent *event)
Reimplementation of the event filter. This filter catches the resize events of the table views in order to resize their columns properly. (Doing it in the resize event of the table view itself did not yield the desired behaviour). More...

Private Attributes

Ui::EnvironmentView * ui
the ui object which contains the GUI elements

Detailed Description

This class provides an editor for configuring the environment setup, i.e. it is filled with the content stored in an EnvironmentInterface instance.

It contains an ui object describing the views appearance (defined in Environment.ui). and GUI elements. Particularly, it comprises table views (see Qt's QTableView class) for editing and displaying the maps of environment parameters. User action will lead to signal emissions which are noticed and managed by the corresponding presenter class, i.e. EnvironmentPresenter.

Definition at line 43 of file EnvironmentView.h.

Member Function Documentation

◆ eventFilter()

bool EnvironmentView::eventFilter | ( | QObject * | watched,
 |  | QEvent * | event
 | ) |  |
private

Reimplementation of the event filter. This filter catches the resize events of the table views in order to resize their columns properly. (Doing it in the resize event of the table view itself did not yield the desired behaviour).

Parameters
[in] | watched | the object whose events should be catched
[in] | event | the event to be catched
Returns
always "false" since the event should never be blocked

Definition at line 111 of file EnvironmentView.cpp.

112 {
113 QTableView* table = qobject_cast<QTableView*> (watched);
114
115 if( table && event->type() == QEvent::Resize )
116 {
117 int cell = (table->width())/2;
118 table->setColumnWidth(0, cell);
119 }
120
121 return false;
122 }

◆ getFrictionView()

QTableView * EnvironmentView::getFrictionView ( ) const

Method which provides access to the table of friction coefficients.

Returns
a pointer to the table of friction coefficients

Definition at line 91 of file EnvironmentView.cpp.

92 {
93 return ui->Friction;
94 }
EnvironmentView::ui
Ui::EnvironmentView * ui
the ui object which contains the GUI elements
Definition: EnvironmentView.h:271

◆ getTimeOfDayView()

QTableView * EnvironmentView::getTimeOfDayView ( ) const

Method which provides access to the table of time of day parameters.

Returns
a pointer to the table of time of day parameters

Definition at line 81 of file EnvironmentView.cpp.

82 {
83 return ui->TimeOfDay;
84 }
EnvironmentView::ui
Ui::EnvironmentView * ui
the ui object which contains the GUI elements
Definition: EnvironmentView.h:271

◆ getVisibilityDistanceView()

QTableView * EnvironmentView::getVisibilityDistanceView ( ) const

Method which provides access to the table of visibility distances.

Returns
a pointer to the table of visibility distances

Definition at line 96 of file EnvironmentView.cpp.

97 {
98 return ui->VisibilityDistance;
99 }
EnvironmentView::ui
Ui::EnvironmentView * ui
the ui object which contains the GUI elements
Definition: EnvironmentView.h:271

◆ getWeatherView()

QTableView * EnvironmentView::getWeatherView ( ) const

Method which provides access to the table of weather parameters.

Returns
a pointer to the table of weather parameters.

Definition at line 86 of file EnvironmentView.cpp.

87 {
88 return ui->Weather;
89 }
EnvironmentView::ui
Ui::EnvironmentView * ui
the ui object which contains the GUI elements
Definition: EnvironmentView.h:271

◆ modifiedName

void EnvironmentView::modifiedName ( const QString & name )
signal

Signal, emitted when the user edits the name of the environment configuration. Transmits the new name the user has typed in.

Parameters
[in] name the new name, the user has typed in the line edit

◆ removeFriction

void EnvironmentView::removeFriction ( const int & row )
signal

Signal, emitted when the user clicks the remove-button of the table of friction coefficients. Transmits the row index of the table cell being currently active.

Parameters
[in] row the row index of the table cell being currently active

◆ removeTimeOfDay

void EnvironmentView::removeTimeOfDay ( const int & row )
signal

Signal, emitted when the user clicks the remove-button of the time of day table. Transmits the row index of the table cell being currently active.

Parameters
[in] row the row index of the table cell being currently active

◆ removeVisibilityDistance

void EnvironmentView::removeVisibilityDistance ( const int & row )
signal

Signal, emitted when the user clicks the remove-button of the table of visibility distances. Transmits the row index of the table cell being currently active.

Parameters
[in] row the row index of the table cell being currently active

◆ removeWeather

void EnvironmentView::removeWeather ( const int & row )
signal

Signal, emitted when the user clicks the remove-button of the table of friction coefficients. Transmits the row index of the table cell being currently active.

Parameters
[in] row the row index of the table cell being currently active

◆ setFriction_ProbabilityError()

void EnvironmentView::setFriction_ProbabilityError ( bool error )

Method which displays a probability error message for the table of friction coefficients if the boolian argument is "true".

Parameters
[in] error the status whether the probabilities are erroneous (true) or not (false)

Definition at line 140 of file EnvironmentView.cpp.

141 {
142 if(error)
143 ui->Friction_ProbabilityError->setText("probability sum invalid!");
144 else
145 ui->Friction_ProbabilityError->setText("");
146 }
EnvironmentView::ui
Ui::EnvironmentView * ui
the ui object which contains the GUI elements
Definition: EnvironmentView.h:271

◆ setName()

void EnvironmentView::setName ( QString const & name )

Method which sets the current text of the environment name's line edit.

Parameters
[in] name the new name to be displayed by the line edit

Definition at line 106 of file EnvironmentView.cpp.

107 {
108 ui->Name->setText(name);
109 }
EnvironmentView::ui
Ui::EnvironmentView * ui
the ui object which contains the GUI elements
Definition: EnvironmentView.h:271

◆ setTimeOfDay_ProbabilityError()

void EnvironmentView::setTimeOfDay_ProbabilityError ( bool error )

Method which displays a probability error message for the table of time of day parameters if the boolian argument is "true".

Parameters
[in] error the status whether the probabilities are erroneous (true) or not (false)

Definition at line 124 of file EnvironmentView.cpp.

125 {
126 if(error)
127 ui->TimeOfDay_ProbabilityError->setText("probability sum invalid!");
128 else
129 ui->TimeOfDay_ProbabilityError->setText("");
130 }
EnvironmentView::ui
Ui::EnvironmentView * ui
the ui object which contains the GUI elements
Definition: EnvironmentView.h:271

◆ setVisibilityDistance_ProbabilityError()

void EnvironmentView::setVisibilityDistance_ProbabilityError ( bool error )

Method which displays a probability error message for the table of visibility distances if the boolian argument is "true".

Parameters
[in] error the status whether the probabilities are erroneous (true) or not (false)

Definition at line 132 of file EnvironmentView.cpp.

133 {
134 if(error)
135 ui->VisibilityDistance_ProbabilityError->setText("probability sum invalid!");
136 else
137 ui->VisibilityDistance_ProbabilityError->setText("");
138 }
EnvironmentView::ui
Ui::EnvironmentView * ui
the ui object which contains the GUI elements
Definition: EnvironmentView.h:271

◆ setWeather_ProbabilityError()

void EnvironmentView::setWeather_ProbabilityError ( bool error )

Method which displays a probability error message for the table of weather parameters if the boolian argument is "true".

Parameters
[in] error the status whether the probabilities are erroneous (true) or not (false)

Definition at line 148 of file EnvironmentView.cpp.

149 {
150 if(error)
151 ui->Weather_ProbabilityError->setText("probability sum invalid!");
152 else
153 ui->Weather_ProbabilityError->setText("");
154 }
EnvironmentView::ui
Ui::EnvironmentView * ui
the ui object which contains the GUI elements
Definition: EnvironmentView.h:271
The documentation for this class was generated from the following files:
  • EnvironmentView.h
  • EnvironmentView.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

EnvironmentView Member List

This is the complete list of members for EnvironmentView, including all inherited members.

addFriction() | EnvironmentView | signal
addTimeOfDay() | EnvironmentView | signal
addVisibilityDistance() | EnvironmentView | signal
addWeather() | EnvironmentView | signal
eventFilter(QObject *watched, QEvent *event) | EnvironmentView | private
getFrictionView() const | EnvironmentView |
getTimeOfDayView() const | EnvironmentView |
getVisibilityDistanceView() const | EnvironmentView |
getWeatherView() const | EnvironmentView |
modifiedName(const QString &name) | EnvironmentView | signal
on_add_Friction_clicked() | EnvironmentView | privateslot
on_add_TimeOfDay_clicked() | EnvironmentView | privateslot
on_add_VisibilityDistance_clicked() | EnvironmentView | privateslot
on_add_Weather_clicked() | EnvironmentView | privateslot
on_Name_editingFinished() | EnvironmentView | privateslot
on_remove_Friction_clicked() | EnvironmentView | privateslot
on_remove_TimeOfDay_clicked() | EnvironmentView | privateslot
on_remove_VisibilityDistance_clicked() | EnvironmentView | privateslot
on_remove_Weather_clicked() | EnvironmentView | privateslot
removeFriction(const int &row) | EnvironmentView | signal
removeTimeOfDay(const int &row) | EnvironmentView | signal
removeVisibilityDistance(const int &row) | EnvironmentView | signal
removeWeather(const int &row) | EnvironmentView | signal
setFriction_ProbabilityError(bool error) | EnvironmentView |
setName(QString const &name) | EnvironmentView |
setTimeOfDay_ProbabilityError(bool error) | EnvironmentView |
setVisibilityDistance_ProbabilityError(bool error) | EnvironmentView |
setWeather_ProbabilityError(bool error) | EnvironmentView |
ui | EnvironmentView | private
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentBaseView Class Reference

Public Slots | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
ExperimentBaseView Class Reference

This class provides a resizable container widget for the content of the experiment tab. More...

Inheritance diagram for ExperimentBaseView:
WidgetView

Public Slots

void updateSize ()
Slot which updates the size of this base view such that all child widgets (ExperimentView, ScenarioDisplayView, TrafficDisplayView and EnvironmentDisplayView) are visible.

Public Member Functions

void | adjustWidgets (QWidget *mainWindow)
Method which adjusts the positioning and size of the child widgets. The size of the child widgets is determined as fractions of the widget size passed as an argument (usually the TrafficSimulationView itself). More...
EnvironmentDisplayView * | getEnvironmentDisplayView () const
Method which returns the widget displaying infos on the environment configuration. More...
ExperimentView * | getExperimentView () const
Method which returns the experiment configuration editor widget. More...
ScenarioDisplayView * | getScenarioDisplayView () const
Method which returns the widget displaying infos on the scenario configuration. More...
TrafficDisplayView * | getTrafficDisplayView () const
Method which returns the widget displaying infos on the traffic configuration. More...
- Public Member Functions inherited from WidgetView
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Public Attributes

ExperimentView * experimentView
A pointer to the experiment configuration widget.
ScenarioDisplayView * scenarioDisplayView
A pointer to the display widget showing the scenario configuration.
TrafficDisplayView * trafficDisplayView
A pointer to the display widget showing the traffic configuration.

Protected Member Functions

void paintEvent (QPaintEvent *event) override
Reimplementation of the paint event. Here, the painting of the connection lines between the experiment configuration widget (ExperimentView) and the display views is organised. More...

Detailed Description

This class provides a resizable container widget for the content of the experiment tab.

The items inserted into this widget are the instances of ExperimentView, ScenarioDisplayView, EnvironmentDisplayView and TrafficDisplayView. Further, the paint event is reimplemented such that the display views are connected via lines to the experiment configuration widget. This will visualize the dependency of a working traffic simulation configuration to the traffic, scenario and environment configurations.

Definition at line 46 of file ExperimentBaseView.h.

Member Function Documentation

◆ adjustWidgets()

void ExperimentBaseView::adjustWidgets ( QWidget * mainWindow )

Method which adjusts the positioning and size of the child widgets. The size of the child widgets is determined as fractions of the widget size passed as an argument (usually the TrafficSimulationView itself).

Parameters
[in] mainWindow the widget from which the sizes of the child widgets are derived (usually TrafficSimulationView)

Definition at line 60 of file ExperimentBaseView.cpp.

61 {
62 int x,y;
63
64 // ajust the geometry of Experiment View:
65 x = ( mainWindow->width() - experimentView->width())/2;
66 experimentView->move(x,50);
67
68 // adjust the geometry of Environment Display View:
69 x = experimentView->x() - environmentDisplayView->width()/2 -130;
70 y = experimentView->y() + experimentView->height()+100;
71 environmentDisplayView->move(x,y);
72
73 // adjust the geometry of Scenario Display View:
74 x = experimentView->x() + experimentView->width()/2 - scenarioDisplayView->width()/2;
75 scenarioDisplayView->move(x,y);
76
77 // adjust the geometry of Traffic Display View:
78 x = experimentView->x() + experimentView->width() - trafficDisplayView->width()/2 +130;
79 trafficDisplayView->move(x,y);
80
81 updateSize();
82
83 }
ExperimentBaseView::trafficDisplayView
TrafficDisplayView * trafficDisplayView
A pointer to the display widget showing the traffic configuration.
Definition: ExperimentBaseView.h:117
ExperimentBaseView::scenarioDisplayView
ScenarioDisplayView * scenarioDisplayView
A pointer to the display widget showing the scenario configuration.
Definition: ExperimentBaseView.h:116
ExperimentBaseView::experimentView
ExperimentView * experimentView
A pointer to the experiment configuration widget.
Definition: ExperimentBaseView.h:115
ExperimentBaseView::updateSize
void updateSize()
Slot which updates the size of this base view such that all child widgets (ExperimentView, ScenarioDisplayView, TrafficDisplayView and EnvironmentDisplayView) are visible.
Definition: ExperimentBaseView.cpp:50

◆ getEnvironmentDisplayView()

EnvironmentDisplayView * ExperimentBaseView::getEnvironmentDisplayView ( ) const

Method which returns the widget displaying infos on the environment configuration.

Returns
The environment configuration display widget (EnvironmentDisplayView)

Definition at line 40 of file ExperimentBaseView.cpp.

41 {
42 return environmentDisplayView;
43 }

◆ getExperimentView()

ExperimentView * ExperimentBaseView::getExperimentView ( ) const

Method which returns the experiment configuration editor widget.

Returns
The experiment configuration editor widget (ExperimentView)

Definition at line 30 of file ExperimentBaseView.cpp.

31 {
32 return experimentView;
33 }
ExperimentBaseView::experimentView
ExperimentView * experimentView
A pointer to the experiment configuration widget.
Definition: ExperimentBaseView.h:115

◆ getScenarioDisplayView()

ScenarioDisplayView * ExperimentBaseView::getScenarioDisplayView ( ) const

Method which returns the widget displaying infos on the scenario configuration.

Returns
The scenario configuration display widget (ScenarioDisplayView)

Definition at line 35 of file ExperimentBaseView.cpp.

36 {
37 return scenarioDisplayView;
38 }
ExperimentBaseView::scenarioDisplayView
ScenarioDisplayView * scenarioDisplayView
A pointer to the display widget showing the scenario configuration.
Definition: ExperimentBaseView.h:116

◆ getTrafficDisplayView()

TrafficDisplayView * ExperimentBaseView::getTrafficDisplayView ( ) const

Method which returns the widget displaying infos on the traffic configuration.

Returns
The traffic configuration display widget (TrafficDisplayView)

Definition at line 45 of file ExperimentBaseView.cpp.

46 {
47 return trafficDisplayView;
48 }
ExperimentBaseView::trafficDisplayView
TrafficDisplayView * trafficDisplayView
A pointer to the display widget showing the traffic configuration.
Definition: ExperimentBaseView.h:117

◆ paintEvent()

void ExperimentBaseView::paintEvent ( QPaintEvent * event )
overrideprotectedvirtual

Reimplementation of the paint event. Here, the painting of the connection lines between the experiment configuration widget (ExperimentView) and the display views is organised.

Parameters
[in] event the paint event (Qt's QPaintEvent class)

Reimplemented from WidgetView.

Definition at line 85 of file ExperimentBaseView.cpp.

86 {
87 event->ignore();
88 QPainter painter(this);
89
90 QPoint P1(experimentView->x() + experimentView->width()/2, experimentView->y() + experimentView->height()) ;
91 QPoint P2(scenarioDisplayView->x() + scenarioDisplayView->width()/2, scenarioDisplayView->y());
92 QPoint P3(trafficDisplayView->x() + trafficDisplayView->width()/2, trafficDisplayView->y());
93 QPoint P4( environmentDisplayView->x() + environmentDisplayView->width()/2, environmentDisplayView->y() );
94
95 painter.setPen(QColor(QStringLiteral("#777777")));
96 QPainterPath path(P1);
97
98 path.lineTo(P2);
99 painter.drawPath(path);
100
101 path.lineTo(P1);
102 path.lineTo(P3);
103
104 painter.drawPath(path);
105
106 path.lineTo(P1);
107 path.lineTo(P4);
108
109 painter.drawPath(path);
110
111 }
ExperimentBaseView::trafficDisplayView
TrafficDisplayView * trafficDisplayView
A pointer to the display widget showing the traffic configuration.
Definition: ExperimentBaseView.h:117
ExperimentBaseView::scenarioDisplayView
ScenarioDisplayView * scenarioDisplayView
A pointer to the display widget showing the scenario configuration.
Definition: ExperimentBaseView.h:116
ExperimentBaseView::experimentView
ExperimentView * experimentView
A pointer to the experiment configuration widget.
Definition: ExperimentBaseView.h:115
The documentation for this class was generated from the following files:
  • ExperimentBaseView.h
  • ExperimentBaseView.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ExperimentBaseView Member List

This is the complete list of members for ExperimentBaseView, including all inherited members.

adjustWidgets(QWidget *mainWindow) | ExperimentBaseView |
experimentView | ExperimentBaseView |
getEnvironmentDisplayView() const | ExperimentBaseView |
getExperimentView() const | ExperimentBaseView |
getScenarioDisplayView() const | ExperimentBaseView |
getTrafficDisplayView() const | ExperimentBaseView |
paintEvent(QPaintEvent *event) override | ExperimentBaseView | protectedvirtual
scenarioDisplayView | ExperimentBaseView |
trafficDisplayView | ExperimentBaseView |
updateSize() | ExperimentBaseView | slot
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentInterface Class Reference

Public Types | Public Member Functions | List of all members
ExperimentInterface Class Referenceabstract

The Experiment Interface provides setter and getter methods for the XML elements listed under <ExperimentConfig> in the slaveConfig XML file. More...

Inheritance diagram for ExperimentInterface:
ExperimentModel

Public Types

using | ID = unsigned int
The experiment's ID (not used so far)
using | Libraries = QMap< QString, QString >
The map of libraries needed by the simulation slave.
using | LoggingGroups = QStringList
The list of logging groups.
using | NumberInvocations = int
The number of invocations.
using | Seed = int
The random seed used for random number generation.

Public Member Functions

virtual ID | getID () const =0
Returns the ID of the experiment. More...
virtual Libraries * | getLibraries () const =0
Returns the pointer to the Libraries map. More...
virtual LoggingGroups * | getLoggingGroups () const =0
Returns the pointer to the list of Logging Groups. More...
virtual NumberInvocations | getNumberInvocations () const =0
Returns the current number of invocations. More...
virtual Seed | getSeed () const =0
Returns the current random number seed. More...
virtual void | setNumberInvocations (NumberInvocations const &_numberInvocations)=0
Sets the number of invocations of the experiment. More...
virtual void | setSeed (Seed const &_seed)=0
Sets the seed used for random number generation. More...

Detailed Description

The Experiment Interface provides setter and getter methods for the XML elements listed under <ExperimentConfig> in the slaveConfig XML file.

These comprise the number of invocations, the random seed, the libraries required by the simulation slave and the logging groups. See the documentation of the simulation framework for the precise definition of these settings.

Definition at line 39 of file ExperimentInterface.h.

Member Function Documentation

◆ getID()

virtual ID ExperimentInterface::getID ( ) const
pure virtual

Returns the ID of the experiment.

Returns
The ID of the experiment
Note
The ID is not yet used since only one experiment is configured in one slaveConfig XML file.

Implemented in ExperimentModel.

◆ getLibraries()

virtual Libraries* ExperimentInterface::getLibraries ( ) const
pure virtual

Returns the pointer to the Libraries map.

Returns
the pointer to the libraries map

Implemented in ExperimentModel.

◆ getLoggingGroups()

virtual LoggingGroups* ExperimentInterface::getLoggingGroups ( ) const
pure virtual

Returns the pointer to the list of Logging Groups.

Returns
the pointer to the list of logging groups

Implemented in ExperimentModel.

◆ getNumberInvocations()

virtual NumberInvocations ExperimentInterface::getNumberInvocations ( ) const
pure virtual

Returns the current number of invocations.

Returns
the current number of invocations

Implemented in ExperimentModel.

◆ getSeed()

virtual Seed ExperimentInterface::getSeed ( ) const
pure virtual

Returns the current random number seed.

Returns
the current random number seed

Implemented in ExperimentModel.

◆ setNumberInvocations()

virtual void ExperimentInterface::setNumberInvocations ( NumberInvocations const & _numberInvocations )
pure virtual

Sets the number of invocations of the experiment.

Parameters
[in] _numberInvocations the number of invocations to be adopted.

Implemented in ExperimentModel.

◆ setSeed()

virtual void ExperimentInterface::setSeed ( Seed const & _seed )
pure virtual

Sets the seed used for random number generation.

Parameters
[in] _seed the random number seed to be adopted

Implemented in ExperimentModel.

The documentation for this class was generated from the following file:
  • ExperimentInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ExperimentInterface Member List

This is the complete list of members for ExperimentInterface, including all inherited members.

getID() const =0 | ExperimentInterface | pure virtual
getLibraries() const =0 | ExperimentInterface | pure virtual
getLoggingGroups() const =0 | ExperimentInterface | pure virtual
getNumberInvocations() const =0 | ExperimentInterface | pure virtual
getSeed() const =0 | ExperimentInterface | pure virtual
ID typedef | ExperimentInterface |
Libraries typedef | ExperimentInterface |
LoggingGroups typedef | ExperimentInterface |
NumberInvocations typedef | ExperimentInterface |
Seed typedef | ExperimentInterface |
setNumberInvocations(NumberInvocations const &_numberInvocations)=0 | ExperimentInterface | pure virtual
setSeed(Seed const &_seed)=0 | ExperimentInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentModel Class Reference

Public Member Functions | Static Public Attributes | Private Attributes | List of all members
ExperimentModel Class Reference

The ExperimentModel class implements the functionality of the ExperimentInterface class. More...

Inheritance diagram for ExperimentModel:
ExperimentInterface

Public Member Functions

virtual ID | getID () const override
Returns the ID of the experiment. More...
virtual Libraries * | getLibraries () const override
Returns the pointer to the Libraries map. More...
virtual LoggingGroups * | getLoggingGroups () const override
Returns the pointer to the list of Logging Groups. More...
virtual NumberInvocations | getNumberInvocations () const override
Returns the current number of invocations. More...
virtual Seed | getSeed () const override
Returns the current random number seed. More...
virtual void | setNumberInvocations (NumberInvocations const &_numberInvocations) override
Sets the number of invocations of the experiment. More...
virtual void | setSeed (Seed const &_seed) override
Sets the seed used for random number generation. More...

Static Public Attributes

static ID const | id_default = 0
The default ID.
static NumberInvocations const | numberInvocations_default = 1
The default number of invocations.
static Seed const | seed_default = 0
The default random seed.

Private Attributes

ID id
The ID of the experiment.
Libraries *const | libraries
The pointer to the experiment's map of libraries.
LoggingGroups *const | loggingGroups
The pointer to the experiment's list of logging groups.
NumberInvocations numberInvocations
The number of invocations of this experiment.
Seed seed
The random seed.

Additional Inherited Members

- Public Types inherited from ExperimentInterface
using | ID = unsigned int
The experiment's ID (not used so far)
using | Libraries = QMap< QString, QString >
The map of libraries needed by the simulation slave.
using | LoggingGroups = QStringList
The list of logging groups.
using | NumberInvocations = int
The number of invocations.
using | Seed = int
The random seed used for random number generation.

Detailed Description

The ExperimentModel class implements the functionality of the ExperimentInterface class.

Definition at line 29 of file ExperimentModel.h.

Member Function Documentation

◆ getID()

ExperimentInterface::ID ExperimentModel::getID ( ) const
overridevirtual

Returns the ID of the experiment.

Returns
The ID of the experiment
Note
The ID is not yet used since only one experiment is configured in one slaveConfig XML file.

Implements ExperimentInterface.

Definition at line 27 of file ExperimentModel.cpp.

28 {
29 return id;
30 }
ExperimentModel::id
ID id
The ID of the experiment.
Definition: ExperimentModel.h:55

◆ getLibraries()

ExperimentInterface::Libraries * ExperimentModel::getLibraries ( ) const
overridevirtual

Returns the pointer to the Libraries map.

Returns
the pointer to the libraries map

Implements ExperimentInterface.

Definition at line 52 of file ExperimentModel.cpp.

53 {
54 return libraries;
55 }
ExperimentModel::libraries
Libraries *const libraries
The pointer to the experiment&#39;s map of libraries.
Definition: ExperimentModel.h:58

◆ getLoggingGroups()

ExperimentInterface::LoggingGroups * ExperimentModel::getLoggingGroups ( ) const
overridevirtual

Returns the pointer to the list of Logging Groups.

Returns
the pointer to the list of logging groups

Implements ExperimentInterface.

Definition at line 57 of file ExperimentModel.cpp.

58 {
59 return loggingGroups;
60 }
ExperimentModel::loggingGroups
LoggingGroups *const loggingGroups
The pointer to the experiment&#39;s list of logging groups.
Definition: ExperimentModel.h:59

◆ getNumberInvocations()

ExperimentInterface::NumberInvocations ExperimentModel::getNumberInvocations ( ) const
overridevirtual

Returns the current number of invocations.

Returns
the current number of invocations

Implements ExperimentInterface.

Definition at line 37 of file ExperimentModel.cpp.

38 {
39 return numberInvocations;
40 }
ExperimentModel::numberInvocations
NumberInvocations numberInvocations
The number of invocations of this experiment.
Definition: ExperimentModel.h:56

◆ getSeed()

ExperimentInterface::Seed ExperimentModel::getSeed ( ) const
overridevirtual

Returns the current random number seed.

Returns
the current random number seed

Implements ExperimentInterface.

Definition at line 47 of file ExperimentModel.cpp.

48 {
49 return seed;
50 }
ExperimentModel::seed
Seed seed
The random seed.
Definition: ExperimentModel.h:57

◆ setNumberInvocations()

void ExperimentModel::setNumberInvocations ( NumberInvocations const & _numberInvocations )
overridevirtual

Sets the number of invocations of the experiment.

Parameters
[in] _numberInvocations the number of invocations to be adopted.

Implements ExperimentInterface.

Definition at line 32 of file ExperimentModel.cpp.

33 {
34 numberInvocations = _numberInvocations;
35 }
ExperimentModel::numberInvocations
NumberInvocations numberInvocations
The number of invocations of this experiment.
Definition: ExperimentModel.h:56

◆ setSeed()

void ExperimentModel::setSeed ( Seed const & _seed )
overridevirtual

Sets the seed used for random number generation.

Parameters
[in] _seed the random number seed to be adopted

Implements ExperimentInterface.

Definition at line 42 of file ExperimentModel.cpp.

43 {
44 seed = _seed;
45 }
ExperimentModel::seed
Seed seed
The random seed.
Definition: ExperimentModel.h:57
The documentation for this class was generated from the following files:
  • ExperimentModel.h
  • ExperimentModel.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ExperimentModel Member List

This is the complete list of members for ExperimentModel, including all inherited members.

getID() const override | ExperimentModel | virtual
getLibraries() const override | ExperimentModel | virtual
getLoggingGroups() const override | ExperimentModel | virtual
getNumberInvocations() const override | ExperimentModel | virtual
getSeed() const override | ExperimentModel | virtual
ID typedef | ExperimentInterface |
id | ExperimentModel | private
id_default | ExperimentModel | static
libraries | ExperimentModel | private
Libraries typedef | ExperimentInterface |
loggingGroups | ExperimentModel | private
LoggingGroups typedef | ExperimentInterface |
numberInvocations | ExperimentModel | private
NumberInvocations typedef | ExperimentInterface |
numberInvocations_default | ExperimentModel | static
Seed typedef | ExperimentInterface |
seed | ExperimentModel | private
seed_default | ExperimentModel | static
setNumberInvocations(NumberInvocations const &_numberInvocations) override | ExperimentModel | virtual
setSeed(Seed const &_seed) override | ExperimentModel | virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentPresenter Class Reference

Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ExperimentPresenter Class Reference

This class defines the presenter object which handles user events coming from the view (ExperimentView) and edits the model accordingly (ExperimentInterface). More...

Inherits QObject.

Signals

void startSimulation ()
Signal, emitted when the start simulation button has been clicked. Will trigger a process (started in TrafficSimulationPresenter) executing the simulation slave with the current simulation settings of this plugin.

Public Member Functions

void updateView ()
This method sets all display values of the view to the model values. This method is called after loading a combination XML file in order to show the loaded configuration.

Private Slots

void | addLibrary ()
Slot which adds a library to the libraries table.
void | addLoggingGroup ()
Slot which adds a logging group to the logging groups list.
void | removeLibrary (int const &row)
Slot which removes the library placed in the given row of the libraries table. More...
void | removeLoggingGroup (int const &row)
Slot which removes the logging groups placed in the given row of the logging groups list. More...
void | setNumberInvocations (ExperimentInterface::NumberInvocations _numberInvocations)
Slot which is connected to the ExperimentView::Invocations_valueChanged signal. It will set the model's value for the number of invocations to the one transmitted by the view. More...
void | setSeed (ExperimentInterface::Seed _seed)
Slot which is connected to the ExperimentView::Seed_valueChanged signal. It will set the model's value for the random seed to the one transmitted by the view. More...

Private Member Functions

void | setupLibraries ()
An initializer method which configures the table view of the libraries. Creates the table's presenter object (LibrariesPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.
void | setupLoggingGroups ()
An initializer method which configures the list view of the logging groups. Creates the list's presenter object (LoggingGroupsPresenter), sets up the combobox delegate for editing the list entries and establishes signal-slot connections for adding and removing list entries.

Private Attributes

ExperimentInterface *const | experiment
a pointer to the experiment model whose values are edited by this presenter
ExperimentView *const | experimentView
a ponter to the experiment's view whose events are handled by this presenter
LibrariesPresenter *const | librariesPresenter
a pointer to the presenter object of the libraries map
LoggingGroupsPresenter *const | loggingGroupsPresenter
a pointer to the presenter object of the logging groups list
ProjectInterface *const | project
a ponter to the project interface in order to access the filepath
QUndoStack *const | undoStack
a pointer to the undo stack

Static Private Attributes

static QStringList | libraryTypesList
a list of possible library types
static QStringList | loggingGroupsList
a selection list of possible logging groups

Detailed Description

This class defines the presenter object which handles user events coming from the view (ExperimentView) and edits the model accordingly (ExperimentInterface).

Definition at line 35 of file ExperimentPresenter.h.

Member Function Documentation

◆ removeLibrary

void ExperimentPresenter::removeLibrary ( int const & row )
privateslot

Slot which removes the library placed in the given row of the libraries table.

Parameters
[in] row the row of the libraries table to be removed

Definition at line 115 of file ExperimentPresenter.cpp.

116 {
117 if(librariesPresenter->rowCount() !=0)
118 undoStack->push(new RemoveLibrary(librariesPresenter, row));
119 }
ExperimentPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: ExperimentPresenter.h:130
LibrariesPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: LibrariesPresenter.cpp:26
RemoveLibrary
Command class for removing libraries from the libraries table.
Definition: ExperimentPresenter.h:163
ExperimentPresenter::librariesPresenter
LibrariesPresenter *const librariesPresenter
a pointer to the presenter object of the libraries map
Definition: ExperimentPresenter.h:133

◆ removeLoggingGroup

void ExperimentPresenter::removeLoggingGroup ( int const & row )
privateslot

Slot which removes the logging groups placed in the given row of the logging groups list.

Parameters
[in] row the row of the logging groups list to be removed

Definition at line 84 of file ExperimentPresenter.cpp.

85 {
86
87 if(row >=0 && loggingGroupsPresenter->rowCount() != 0)
88 undoStack->push(new RemoveLoggingGroup(loggingGroupsPresenter, row));
89 }
LoggingGroupsPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of items in the logging groups list...
Definition: LoggingGroupsPresenter.cpp:20
ExperimentPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: ExperimentPresenter.h:130
RemoveLoggingGroup
Command class for removing logging groups from the logging groups list.
Definition: ExperimentPresenter.h:205
ExperimentPresenter::loggingGroupsPresenter
LoggingGroupsPresenter *const loggingGroupsPresenter
a pointer to the presenter object of the logging groups list
Definition: ExperimentPresenter.h:137

◆ setNumberInvocations

void ExperimentPresenter::setNumberInvocations ( ExperimentInterface::NumberInvocations _numberInvocations )
privateslot

Slot which is connected to the ExperimentView::Invocations_valueChanged signal. It will set the model's value for the number of invocations to the one transmitted by the view.

Parameters
[in] _numberInvocations the number of invocations transmitted by the view

Definition at line 121 of file ExperimentPresenter.cpp.

122 {
123 if(experiment->getNumberInvocations() != _numberInvocations)
124 undoStack->push(new EditNumberInvocations(experiment, experimentView, _numberInvocations));
125 }
EditNumberInvocations
Command class editing the number of invocations.
Definition: ExperimentPresenter.h:226
ExperimentPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: ExperimentPresenter.h:130
ExperimentPresenter::experiment
ExperimentInterface *const experiment
a pointer to the experiment model whose values are edited by this presenter
Definition: ExperimentPresenter.h:127
ExperimentInterface::getNumberInvocations
virtual NumberInvocations getNumberInvocations() const =0
Returns the current number of invocations.
ExperimentPresenter::experimentView
ExperimentView *const experimentView
a ponter to the experiment&#39;s view whose events are handled by this presenter
Definition: ExperimentPresenter.h:128

◆ setSeed

void ExperimentPresenter::setSeed ( ExperimentInterface::Seed _seed )
privateslot

Slot which is connected to the ExperimentView::Seed_valueChanged signal. It will set the model's value for the random seed to the one transmitted by the view.

Parameters
[in] _seed the random seed transmitted by the view

Definition at line 127 of file ExperimentPresenter.cpp.

128 {
129 if(experiment->getSeed() != _seed)
130 undoStack->push(new EditRandomSeed(experiment, experimentView, _seed));
131 }
ExperimentPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: ExperimentPresenter.h:130
ExperimentPresenter::experiment
ExperimentInterface *const experiment
a pointer to the experiment model whose values are edited by this presenter
Definition: ExperimentPresenter.h:127
ExperimentInterface::getSeed
virtual Seed getSeed() const =0
Returns the current random number seed.
ExperimentPresenter::experimentView
ExperimentView *const experimentView
a ponter to the experiment&#39;s view whose events are handled by this presenter
Definition: ExperimentPresenter.h:128
EditRandomSeed
Command class editing the number of invocations.
Definition: ExperimentPresenter.h:249
The documentation for this class was generated from the following files:
  • ExperimentPresenter.h
  • ExperimentPresenter.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ExperimentPresenter Member List

This is the complete list of members for ExperimentPresenter, including all inherited members.

addLibrary() | ExperimentPresenter | privateslot
addLoggingGroup() | ExperimentPresenter | privateslot
experiment | ExperimentPresenter | private
experimentView | ExperimentPresenter | private
librariesPresenter | ExperimentPresenter | private
libraryTypesList | ExperimentPresenter | privatestatic
loggingGroupsList | ExperimentPresenter | privatestatic
loggingGroupsPresenter | ExperimentPresenter | private
project | ExperimentPresenter | private
removeLibrary(int const &row) | ExperimentPresenter | privateslot
removeLoggingGroup(int const &row) | ExperimentPresenter | privateslot
setNumberInvocations(ExperimentInterface::NumberInvocations _numberInvocations) | ExperimentPresenter | privateslot
setSeed(ExperimentInterface::Seed _seed) | ExperimentPresenter | privateslot
setupLibraries() | ExperimentPresenter | private
setupLoggingGroups() | ExperimentPresenter | private
startSimulation() | ExperimentPresenter | signal
undoStack | ExperimentPresenter | private
updateView() | ExperimentPresenter |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ExperimentView Class Reference

Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
ExperimentView Class Reference

This class provides an editor for configuring the experiment setup, i.e. it is filled with the content stored in an ExperimentInterface instance. More...

Inheritance diagram for ExperimentView:
WidgetView

Signals

void | addLibrary ()
Signal, emitted when the add-button in the library section has been pressed by the user.
void | addLoggingGroup ()
Signal, emitted when the add-button in the logging groups section has been pressed by the user.
void | Invocations_valueChanged (int value)
Signal, emitted when the number of invocations has been modified by the user.
void | removeLibrary (int const &row)
Signal, emitted when the remove-button in the library section has been pressed by the user.
void | removeLoggingGroup (int const &row)
Signal, emitted when the remove-button in the logging groups section has been pressed by the user.
void | resized ()
Signal, emitted when this view has been resized. Will be connected to the slot ExperimentBaseView::updateSize in order to resize the container widget according to the new size of this view.
void | Seed_valueChanged (int value)
Signal, emitted when the random seed value has been modified by the user.
void | startSimulation ()
Signal, emitted when the user clicks the Start Simulation Button. Will trigger a status check of the slave Config settings (edited this plugin) and the creation of the simulation slave process.

Public Member Functions

void | enableSimulation (bool enable)
Method which enables the start simulation button.
QTableView * | getLibrariesView () const
Method which gives access to the QTableView instance holding the entries of the libraries map. Will be used by the presenter to connect it to the corresponding model. More...
QListView * | getLoggingGroupsView () const
Method which gives access to the QListView instance listing the logging groups. Will be used by the presenter to connect it to the corresponding model. More...
void | setInvocationsValue (int value)
Method for setting the spinbox value for the number of invocations to the value passed as an argument. More...
void | setSeedValue (int value)
Method for setting the spinbox value for the random seed to the value passed as an argument. More...
- Public Member Functions inherited from WidgetView
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Private Slots

void | on_InvocationsValue_editingFinished ()
Qt Desinger-created slot activated when the spinbox for the number of invocations has been edited. Will emit the signal Invocations_valueChanged.
void | on_Library_add_clicked ()
Qt Desinger-created slot activated when the add-button in the Library section has been pressed. Emits the addLibrary signal.
void | on_Library_remove_clicked ()
Qt Desinger-created slot activated when the remove-button in the Library section has been pressed. Emits the removeLibrary signal.
void | on_LoggingGroup_add_clicked ()
Qt Desinger-created slot activated when the add-button in the logging groups section has been pressed. Emits the addLoggingGroup signal.
void | on_LoggingGroup_remove_clicked ()
Qt Desinger-created slot activated when the remove-button in the logging groups section has been pressed. Emits the removeLoggingGroup signal.
void | on_SeedValue_editingFinished ()
Qt Desinger-created slot activated when the spinbox value for the random seed has been edited. Will emit the signal Seed_valueChanged.
void | on_StartSimulation_clicked ()
Qt Desinger-created slot activated when the Start SImulation button has been clicked. Emits the startSimulation signal.

Private Member Functions

bool | eventFilter (QObject *watched, QEvent *event)
Reimplementation of the event filter. This filter catches the resize events of the table view (libraries table) in order to resize their columns properly. (Doing it in the resize event of the table view itself did not yield the desired behaviour). More...
void | resizeEvent (QResizeEvent *event)
Reimplementation of the resize event. Will emit the signal resized when this view is resized. More...

Private Attributes

Ui::ExperimentView * ui
the ui object containing the GUI elements of this editor

Additional Inherited Members

- Protected Member Functions inherited from WidgetView
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.

Detailed Description

This class provides an editor for configuring the experiment setup, i.e. it is filled with the content stored in an ExperimentInterface instance.

It contains an ui object describing the views appearance (defined in Experiment.ui). This ui object comprises a form layout with labels and editing elements for the different attributes of the experiment configuration. User action will lead to signal emissions which are noticed and managed by the corresponding presenter class, i.e. ExperimentPresenter.

Definition at line 47 of file ExperimentView.h.

Member Function Documentation

◆ eventFilter()

bool ExperimentView::eventFilter | ( | QObject * | watched,
 |  | QEvent * | event
 | ) |  |
private

Reimplementation of the event filter. This filter catches the resize events of the table view (libraries table) in order to resize their columns properly. (Doing it in the resize event of the table view itself did not yield the desired behaviour).

Parameters
[in] | watched | the object whose events should be catched
[in] | event | the event to be catched
Returns
always "false" since the event should never be blocked

Definition at line 97 of file ExperimentView.cpp.

98 {
99 QTableView* table = qobject_cast<QTableView*> (watched);
100
101 if( table && event->type() == QEvent::Resize )
102 {
103 int cell = (table->width())/2;
104 table->setColumnWidth(0, cell);
105 }
106
107 return false;
108 }

◆ getLibrariesView()

QTableView * ExperimentView::getLibrariesView ( ) const

Method which gives access to the QTableView instance holding the entries of the libraries map. Will be used by the presenter to connect it to the corresponding model.

Returns
the pointer to the table of libraries

Definition at line 81 of file ExperimentView.cpp.

82 {
83 return ui->LibrariesView;
84 }
ExperimentView::ui
Ui::ExperimentView * ui
the ui object containing the GUI elements of this editor
Definition: ExperimentView.h:209

◆ getLoggingGroupsView()

QListView * ExperimentView::getLoggingGroupsView ( ) const

Method which gives access to the QListView instance listing the logging groups. Will be used by the presenter to connect it to the corresponding model.

Returns
the pointer to the List view of the logging groups

Definition at line 76 of file ExperimentView.cpp.

77 {
78 return ui->LoggingGroupsView;
79 }
ExperimentView::ui
Ui::ExperimentView * ui
the ui object containing the GUI elements of this editor
Definition: ExperimentView.h:209

◆ resizeEvent()

void ExperimentView::resizeEvent ( QResizeEvent * event )
private

Reimplementation of the resize event. Will emit the signal resized when this view is resized.

Parameters
[in] event the resize event (Qt's QResizeEvent class)

Definition at line 91 of file ExperimentView.cpp.

92 {
93 event->ignore();
94 Q_EMIT resized();
95 }
ExperimentView::resized
void resized()
Signal, emitted when this view has been resized. Will be connected to the slot ExperimentBaseView::up...

◆ setInvocationsValue()

void ExperimentView::setInvocationsValue ( int value )

Method for setting the spinbox value for the number of invocations to the value passed as an argument.

Parameters
[in] value the value to be displayed by the spinbox

Definition at line 41 of file ExperimentView.cpp.

42 {
43 ui->InvocationsValue->setValue(value);
44 }
ExperimentView::ui
Ui::ExperimentView * ui
the ui object containing the GUI elements of this editor
Definition: ExperimentView.h:209

◆ setSeedValue()

void ExperimentView::setSeedValue ( int value )

Method for setting the spinbox value for the random seed to the value passed as an argument.

Parameters
[in] value the value to be displayed by the spinbox

Definition at line 86 of file ExperimentView.cpp.

87 {
88 ui->SeedValue->setValue(value);
89 }
ExperimentView::ui
Ui::ExperimentView * ui
the ui object containing the GUI elements of this editor
Definition: ExperimentView.h:209
The documentation for this class was generated from the following files:
  • ExperimentView.h
  • ExperimentView.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ExperimentView Member List

This is the complete list of members for ExperimentView, including all inherited members.

addLibrary() | ExperimentView | signal
addLoggingGroup() | ExperimentView | signal
enableSimulation(bool enable) | ExperimentView |
eventFilter(QObject *watched, QEvent *event) | ExperimentView | private
getLibrariesView() const | ExperimentView |
getLoggingGroupsView() const | ExperimentView |
Invocations_valueChanged(int value) | ExperimentView | signal
on_InvocationsValue_editingFinished() | ExperimentView | privateslot
on_Library_add_clicked() | ExperimentView | privateslot
on_Library_remove_clicked() | ExperimentView | privateslot
on_LoggingGroup_add_clicked() | ExperimentView | privateslot
on_LoggingGroup_remove_clicked() | ExperimentView | privateslot
on_SeedValue_editingFinished() | ExperimentView | privateslot
on_StartSimulation_clicked() | ExperimentView | privateslot
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
removeLibrary(int const &row) | ExperimentView | signal
removeLoggingGroup(int const &row) | ExperimentView | signal
resized() | ExperimentView | signal
resizeEvent(QResizeEvent *event) | ExperimentView | private
Seed_valueChanged(int value) | ExperimentView | signal
setInvocationsValue(int value) | ExperimentView |
setSeedValue(int value) | ExperimentView |
startSimulation() | ExperimentView | signal
ui | ExperimentView | private
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: LibrariesPresenter Class Reference

Public Member Functions | Private Attributes | List of all members
LibrariesPresenter Class Reference

This class describes the presenter object of the map of included libraries. More...

Inherits QAbstractTableModel.

Public Member Functions

void | addRow (const int &row, QString libType)
Method that adds a new row, i.e. a new library to of the given type. More...
int | columnCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders. More...
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex). More...
virtual Qt::ItemFlags | flags (const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable. More...
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format. More...
bool | removeRow (const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful range. More...
int | rowCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of libraries included. More...
virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value. More...
void | update ()
Method which updates the table according to the current entries of libraries.

Private Attributes

QStringList | _columnHeaders
a map translating row indices to library types More...
ExperimentInterface::Libraries *const | libraries
the map of libraries
ProjectInterface *const | project
a pointer to the project plugin (gives access to file system)

Detailed Description

This class describes the presenter object of the map of included libraries.

In the spirit of Qt's Model/View framework it constitutes the wrapper object connecting the model data (libraries map defined in ExperimentInterface) with the interface defined in QAbstractTableModel. This interface can be then utilized by an instance Qt's QTableView to display the map in a table format.

See https://doc.qt.io/qt-5/model-view-programming.html for Qt's model/view framework.

Definition at line 48 of file LibrariesPresenter.h.

Member Function Documentation

◆ addRow()

void LibrariesPresenter::addRow | ( | const int & | row,
 |  | QString | libType
 | ) |  |

Method that adds a new row, i.e. a new library to of the given type.

Parameters
[in] | row | the row of the table in which the lib is placed
[in] | libType | the type of the library to be added to the table

Definition at line 132 of file LibrariesPresenter.cpp.

133 {
134 // shift all row indices,starting from given row, up
135 for(auto _row= RowToLibType.size()-1; _row>=row; _row--)
136 RowToLibType.insert(_row + 1, RowToLibType.take(_row));
137
138 beginInsertRows(QModelIndex(), row, row);
139
140 RowToLibType.insert(row, libType);
141 libraries->insert(libType, "");
142
143 endInsertRows();
144 }
LibrariesPresenter::libraries
ExperimentInterface::Libraries *const libraries
the map of libraries
Definition: LibrariesPresenter.h:159

◆ columnCount()

int LibrariesPresenter::columnCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table columns

Definition at line 33 of file LibrariesPresenter.cpp.

34 {
35 Q_UNUSED(parent);
36
37 return _columnHeaders.count();
38 }
LibrariesPresenter::_columnHeaders
QStringList _columnHeaders
a map translating row indices to library types
Definition: LibrariesPresenter.h:162

◆ data()

QVariant LibrariesPresenter::data | ( | const QModelIndex & | index,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex).

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::DisplayRole or Qt::EditRole)
Returns
The data stored in the table cell (as a QVariant)

Definition at line 53 of file LibrariesPresenter.cpp.

54 {
55 int row = index.row();
56 int col = index.column();
57
58 if(row >= libraries->count())
59 return QVariant::Invalid;
60
61 if(role == Qt::TextAlignmentRole)
62 return QVariant(Qt::AlignCenter);
63
64
65 if(role == Qt::TextColorRole)
66 {
67 if(col ==1)
68 {
69 QString lib = libraries->value(RowToLibType[row]);
70
71 if(!QFileInfo::exists(project->getLibrary().absoluteFilePath(lib + QString(".dll"))) && !lib.isEmpty())
72 return QBrush(Qt::red);
73 else {
74 return QBrush(Qt::black);
75 }
76 }
77 }
78
79
80 if(role == Qt::DisplayRole || role == Qt::EditRole)
81 {
82 if( col == 0)
83 return QVariant(RowToLibType.value(row));
84 else if(col == 1)
85 {
86 QString lib = libraries->value(RowToLibType[row]);
87
88 if(!QFileInfo::exists(project->getLibrary().absoluteFilePath(lib + QString(".dll"))) && !lib.isEmpty())
89 return QString("%1 (not existing!)").arg(lib);
90
91 else
92 return lib;
93 }
94 }
95
96 return QVariant();
97 }
LibrariesPresenter::project
ProjectInterface *const project
a pointer to the project plugin (gives access to file system)
Definition: LibrariesPresenter.h:160
ProjectInterface::getLibrary
virtual QDir getLibrary() const =0
Gets the directory containing the components library.
LibrariesPresenter::libraries
ExperimentInterface::Libraries *const libraries
the map of libraries
Definition: LibrariesPresenter.h:159

◆ flags()

Qt::ItemFlags LibrariesPresenter::flags ( const QModelIndex & index ) const
overridevirtual

Reimplementation of the flags method. This will make the items of the model editable.

Parameters
[in] index An index identifying the cell of the table
Returns
An item flag

Definition at line 127 of file LibrariesPresenter.cpp.

128 {
129 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
130 }

◆ headerData()

QVariant LibrariesPresenter::headerData | ( | int | section,
 |  | Qt::Orientation | orientation,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format.

Parameters
[in] | section | A table section
[in] | role | A Qt role
[in] | orientation | A table orientation
Returns
The content of the table's header at the given section

Definition at line 40 of file LibrariesPresenter.cpp.

43 {
44 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
45 return _columnHeaders.value(section);
46
47 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
48 return section + 1;
49
50 return QVariant();
51 }
LibrariesPresenter::_columnHeaders
QStringList _columnHeaders
a map translating row indices to library types
Definition: LibrariesPresenter.h:162

◆ removeRow()

bool LibrariesPresenter::removeRow ( const int & row )

Method that removes the row specified by the given row-index, if this is in a meaningful range.

Parameters
[in] row the row-index
Returns
"True", if row is between 0 and the number of libraries, "false", otherwise

Definition at line 146 of file LibrariesPresenter.cpp.

147 {
148 if(RowToLibType.contains(row))
149 {
150 beginRemoveRows(QModelIndex(), row, row);
151 libraries->take(RowToLibType[row]);
152 RowToLibType.take(row);
153
154 for(int i =row+1; i<=RowToLibType.count() ; i++)
155 RowToLibType.insert(i-1, RowToLibType.take(i));
156
157 endRemoveRows();
158 return true;
159 }
160
161 return false;
162 }
LibrariesPresenter::libraries
ExperimentInterface::Libraries *const libraries
the map of libraries
Definition: LibrariesPresenter.h:159

◆ rowCount()

int LibrariesPresenter::rowCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of libraries included.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table rows

Definition at line 26 of file LibrariesPresenter.cpp.

27 {
28 Q_UNUSED(parent);
29
30 return libraries->count();
31 }
LibrariesPresenter::libraries
ExperimentInterface::Libraries *const libraries
the map of libraries
Definition: LibrariesPresenter.h:159

◆ setData()

bool LibrariesPresenter::setData | ( | const QModelIndex & | index,
 |  | const QVariant & | value,
 |  | int | role = Qt::EditRole
 | ) |  |
overridevirtual

Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value.

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::EditRole)
Returns
"True" if the index corresponds to an existing cell in the table, otherwise "false"

Definition at line 100 of file LibrariesPresenter.cpp.

103 {
104 int row = index.row();
105 int col = index.column();
106
107 if(role == Qt::EditRole)
108 {
109 if(col == 0 && !libraries->contains(value.toString()))
110 {
111 libraries->insert( value.toString(), libraries->take(RowToLibType[row]) );
112 RowToLibType[row] = value.toString();
113 Q_EMIT dataChanged(index, index);
114 return true;
115 }
116 else if(col == 1)
117 {
118 (*libraries)[RowToLibType[row]] = value.toString();
119 Q_EMIT dataChanged(index, index);
120 return true;
121 }
122 }
123
124 return false;
125 }
LibrariesPresenter::libraries
ExperimentInterface::Libraries *const libraries
the map of libraries
Definition: LibrariesPresenter.h:159

Member Data Documentation

◆ _columnHeaders

QStringList LibrariesPresenter::_columnHeaders
private

a map translating row indices to library types

the column header's info

Definition at line 162 of file LibrariesPresenter.h.

The documentation for this class was generated from the following files:
  • LibrariesPresenter.h
  • LibrariesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

LibrariesPresenter Member List

This is the complete list of members for LibrariesPresenter, including all inherited members.

_columnHeaders | LibrariesPresenter | private
addRow(const int &row, QString libType) | LibrariesPresenter |
columnCount(const QModelIndex &parent=QModelIndex()) const override | LibrariesPresenter |
data(const QModelIndex &index, int role=Qt::DisplayRole) const override | LibrariesPresenter |
flags(const QModelIndex &index) const override | LibrariesPresenter | virtual
headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override | LibrariesPresenter |
libraries | LibrariesPresenter | private
project | LibrariesPresenter | private
removeRow(const int &row) | LibrariesPresenter |
rowCount(const QModelIndex &parent=QModelIndex()) const override | LibrariesPresenter |
setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override | LibrariesPresenter | virtual
update() | LibrariesPresenter |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: LoggingGroupsPresenter Class Reference

Public Member Functions | Private Attributes | List of all members
LoggingGroupsPresenter Class Reference

This class describes the presenter object of the list of logging groups. More...

Inherits QAbstractListModel.

Public Member Functions

QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the model referenced by the given index (QModelIndex). More...
Qt::ItemFlags | flags (const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable. More...
virtual void | insertRow (int row, QString item, const QModelIndex &parent=QModelIndex())
Method that adds a new logging group to the list at the given row index. More...
virtual void | removeRow (int row, const QModelIndex &parent=QModelIndex())
Method that removes the logging group at the given index from the list. More...
int | rowCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of items in the logging groups list. More...
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the row referenced by the given index (QModelIndex) to the given value. More...
void | update ()
Method which updates the list according to the current entries of loggingGroups.

Private Attributes

ExperimentInterface::LoggingGroups *const loggingGroups
the string list of logging groups

Detailed Description

This class describes the presenter object of the list of logging groups.

In the spirit of Qt's Model/View framework it constitutes the wrapper object connecting the model data (the logging groups list defined in ExperimentInterface) with the interface defined in QAbstractListModel. This interface can be then utilized by an instance Qt's QListView to display the list.

See https://doc.qt.io/qt-5/model-view-programming.html for Qt's model/view framework.

Definition at line 47 of file LoggingGroupsPresenter.h.

Member Function Documentation

◆ data()

QVariant LoggingGroupsPresenter::data | ( | const QModelIndex & | index,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the data method. Returns the data stored in the model referenced by the given index (QModelIndex).

Parameters
[in] | index | A model index containing the row index
[in] | role | A Qt role (needs to be in Qt::DisplayRole or Qt::EditRole)
Returns
The data stored in the list (as a QVariant)

Definition at line 30 of file LoggingGroupsPresenter.cpp.

31 {
32 if (!index.isValid())
33 return QVariant::Invalid;
34
35 if(role == Qt::TextAlignmentRole)
36 return QVariant(Qt::AlignCenter);
37
38 if( role == Qt::DisplayRole || role == Qt::EditRole )
39 return QVariant(loggingGroups->at(index.row()));
40
41 return QVariant();
42 }
LoggingGroupsPresenter::loggingGroups
ExperimentInterface::LoggingGroups *const loggingGroups
the string list of logging groups
Definition: LoggingGroupsPresenter.h:125

◆ flags()

Qt::ItemFlags LoggingGroupsPresenter::flags ( const QModelIndex & index ) const
override

Reimplementation of the flags method. This will make the items of the model editable.

Parameters
[in] index A model index containing the row index
Returns
An item flag

Definition at line 57 of file LoggingGroupsPresenter.cpp.

58 {
59 return Qt::ItemIsEditable | QAbstractListModel::flags(index);
60 }

◆ insertRow()

void LoggingGroupsPresenter::insertRow | ( | int | row,
 |  | QString | item,
 |  | const QModelIndex & | parent = QModelIndex()
 | ) |  |
virtual

Method that adds a new logging group to the list at the given row index.

Parameters
[in] row the row index at which the logging group is placed in the list

Definition at line 62 of file LoggingGroupsPresenter.cpp.

63 {
64 beginInsertRows(parent, row, row );
65
66 loggingGroups->insert(row, item);
67
68 endInsertRows();
69 }
LoggingGroupsPresenter::loggingGroups
ExperimentInterface::LoggingGroups *const loggingGroups
the string list of logging groups
Definition: LoggingGroupsPresenter.h:125

◆ removeRow()

void LoggingGroupsPresenter::removeRow | ( | int | row,
 |  | const QModelIndex & | parent = QModelIndex()
 | ) |  |
virtual

Method that removes the logging group at the given index from the list.

Parameters
[in] row the row index of the logging group to be removed

Definition at line 71 of file LoggingGroupsPresenter.cpp.

72 {
73 beginRemoveRows(parent, row, row);
74
75 loggingGroups->removeAt(row);
76
77 endRemoveRows();
78 }
LoggingGroupsPresenter::loggingGroups
ExperimentInterface::LoggingGroups *const loggingGroups
the string list of logging groups
Definition: LoggingGroupsPresenter.h:125

◆ rowCount()

int LoggingGroupsPresenter::rowCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the rowCount method. Returns the number of items in the logging groups list.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of logging groups

Definition at line 20 of file LoggingGroupsPresenter.cpp.

21 {
22 // For list models only the root node (an invalid parent) should return the list's size. For all
23 // other (valid) parents, rowCount() should return 0 so that it does not become a tree model.
24 if (parent.isValid())
25 return 0;
26
27 return loggingGroups->count();
28 }
LoggingGroupsPresenter::loggingGroups
ExperimentInterface::LoggingGroups *const loggingGroups
the string list of logging groups
Definition: LoggingGroupsPresenter.h:125

◆ setData()

bool LoggingGroupsPresenter::setData | ( | const QModelIndex & | index,
 |  | const QVariant & | value,
 |  | int | role = Qt::EditRole
 | ) |  |
override

Reimplementation of the setData method. Sets the data stored in the row referenced by the given index (QModelIndex) to the given value.

Parameters
[in] | index | A model index containing the row index
[in] | role | A Qt role (needs to be in Qt::EditRole)
Returns
"True" if the index is valid, otherwise "false"

Definition at line 44 of file LoggingGroupsPresenter.cpp.

45 {
46 if (data(index, role) != value && role == Qt::EditRole)
47 {
48 if(!loggingGroups->contains(value.toString()))
49 (*loggingGroups)[index.row()] = value.toString();
50
51 Q_EMIT dataChanged(index, index, QVector<int>() << role);
52 return true;
53 }
54 return false;
55 }
LoggingGroupsPresenter::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the model referenced by the given ind...
Definition: LoggingGroupsPresenter.cpp:30
LoggingGroupsPresenter::loggingGroups
ExperimentInterface::LoggingGroups *const loggingGroups
the string list of logging groups
Definition: LoggingGroupsPresenter.h:125
The documentation for this class was generated from the following files:
  • LoggingGroupsPresenter.h
  • LoggingGroupsPresenter.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

LoggingGroupsPresenter Member List

This is the complete list of members for LoggingGroupsPresenter, including all inherited members.

data(const QModelIndex &index, int role=Qt::DisplayRole) const override | LoggingGroupsPresenter |
flags(const QModelIndex &index) const override | LoggingGroupsPresenter |
insertRow(int row, QString item, const QModelIndex &parent=QModelIndex()) | LoggingGroupsPresenter | virtual
loggingGroups | LoggingGroupsPresenter | private
removeRow(int row, const QModelIndex &parent=QModelIndex()) | LoggingGroupsPresenter | virtual
rowCount(const QModelIndex &parent=QModelIndex()) const override | LoggingGroupsPresenter |
setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override | LoggingGroupsPresenter |
update() | LoggingGroupsPresenter |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterItemInterface Class Reference

Public Types | Public Member Functions | List of all members
ParameterItemInterface Class Referenceabstract

This class defines parameters. More...

Inheritance diagram for ParameterItemInterface:
ParameterItemModel

Public Types

using | ID = unsigned int
typedef for the parameters id (when registered in a map)
using | Key = QString
typedef for the key description
using | Type = QString
typedef for the data type
using | Unit = QString
typedef for the parameter's unit
using | Value = QString
typedef for the parameter's value

Public Member Functions

virtual ID | getID () const =0
Method which returns the Id of this parameter if this parameter is registered in a map (ParameterMapInterface). Otherwise, an empty Id is returned. More...
virtual Key | getKey () const =0
Method which returns the key description of this parameter. More...
virtual Type | getType () const =0
Method which returns the datatype of this parameter. More...
virtual Unit | getUnit () const =0
Method which returns the unit of this parameter. More...
virtual Value | getValue () const =0
Method which returns the value of this parameter. More...
virtual void | setKey (Key const &key)=0
Method which sets the key description of this parameter to the given one. More...
virtual void | setType (Type const &type)=0
Method which sets the datatype of this parameter to the given type. More...
virtual void | setUnit (Value const &unit)=0
Method which sets the unit of this parameter to the given one. More...
virtual void | setValue (Value const &value)=0
Method which sets the value of this parameter to the given one. More...

Detailed Description

This class defines parameters.

Parameters consist of a key description, a datatype, a value and a unit. If parameters are registered in a map container class (here ParameterMapInterface), they also have a key identifier which can be accessed here. For simplicity, especially when bringing the parameters to an XML representation, all attributes are modeled as strings.

Definition at line 39 of file ParameterItemInterface.h.

Member Function Documentation

◆ getID()

virtual ID ParameterItemInterface::getID ( ) const
pure virtual

Method which returns the Id of this parameter if this parameter is registered in a map (ParameterMapInterface). Otherwise, an empty Id is returned.

Returns
the id of the parameter if registered in a map, otherwise an empty id

Implemented in ParameterItemModel.

◆ getKey()

virtual Key ParameterItemInterface::getKey ( ) const
pure virtual

Method which returns the key description of this parameter.

Returns
the key description of this parameter

Implemented in ParameterItemModel.

◆ getType()

virtual Type ParameterItemInterface::getType ( ) const
pure virtual

Method which returns the datatype of this parameter.

Returns
the datatype of this parameter

Implemented in ParameterItemModel.

◆ getUnit()

virtual Unit ParameterItemInterface::getUnit ( ) const
pure virtual

Method which returns the unit of this parameter.

Returns
the unit of this parameter

Implemented in ParameterItemModel.

◆ getValue()

virtual Value ParameterItemInterface::getValue ( ) const
pure virtual

Method which returns the value of this parameter.

Returns
the value of this parameter

Implemented in ParameterItemModel.

◆ setKey()

virtual void ParameterItemInterface::setKey ( Key const & key )
pure virtual

Method which sets the key description of this parameter to the given one.

Parameters
[in] the new key description of this parameter

Implemented in ParameterItemModel.

◆ setType()

virtual void ParameterItemInterface::setType ( Type const & type )
pure virtual

Method which sets the datatype of this parameter to the given type.

Parameters
[in] the new datatype of this parameter

Implemented in ParameterItemModel.

◆ setUnit()

virtual void ParameterItemInterface::setUnit ( Value const & unit )
pure virtual

Method which sets the unit of this parameter to the given one.

Parameters
[in] the new unit of this parameter

Implemented in ParameterItemModel.

◆ setValue()

virtual void ParameterItemInterface::setValue ( Value const & value )
pure virtual

Method which sets the value of this parameter to the given one.

Parameters
[in] the new value of this parameter

Implemented in ParameterItemModel.

The documentation for this class was generated from the following file:
  • ParameterItemInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ParameterItemInterface Member List

This is the complete list of members for ParameterItemInterface, including all inherited members.

getID() const =0 | ParameterItemInterface | pure virtual
getKey() const =0 | ParameterItemInterface | pure virtual
getType() const =0 | ParameterItemInterface | pure virtual
getUnit() const =0 | ParameterItemInterface | pure virtual
getValue() const =0 | ParameterItemInterface | pure virtual
ID typedef | ParameterItemInterface |
Key typedef | ParameterItemInterface |
setKey(Key const &key)=0 | ParameterItemInterface | pure virtual
setType(Type const &type)=0 | ParameterItemInterface | pure virtual
setUnit(Value const &unit)=0 | ParameterItemInterface | pure virtual
setValue(Value const &value)=0 | ParameterItemInterface | pure virtual
Type typedef | ParameterItemInterface |
Unit typedef | ParameterItemInterface |
Value typedef | ParameterItemInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterItemModel Class Reference

Public Member Functions | Private Attributes | Static Private Attributes | List of all members
ParameterItemModel Class Reference

This class implements the functionality of ParameterItemInterface. More...

Inheritance diagram for ParameterItemModel:
ParameterItemInterface

Public Member Functions

virtual ID | getID () const override
Method which returns the Id of this parameter if this parameter is registered in a map (ParameterMapInterface). Otherwise, an empty Id is returned. More...
virtual Key | getKey () const override
Method which returns the key description of this parameter. More...
virtual Type | getType () const override
Method which returns the datatype of this parameter. More...
virtual Unit | getUnit () const override
Method which returns the unit of this parameter. More...
virtual Value | getValue () const override
Method which returns the value of this parameter. More...
virtual void | setKey (Key const &_key) override
Method which sets the key description of this parameter to the given one. More...
virtual void | setType (Type const &_type) override
Method which sets the datatype of this parameter to the given type. More...
virtual void | setUnit (Value const &_unit) override
Method which sets the unit of this parameter to the given one. More...
virtual void | setValue (Value const &_value) override
Method which sets the value of this parameter to the given one. More...

Private Attributes

Key key
the string object for the parameter's description
Type type
the string object for the parameter's datatype
Unit unit
the string object for the parameter's unit
Value value
the parameter's value. Taken as a string in order to make it independent its datatype

Static Private Attributes

static Key | default_key = QString("parameter")
the default key desription
static Type | default_type = QString("Double")
the default datatype
static Unit | default_unit = QString("")
the default unit
static Value | default_value = QString("0.0")
the default value

Additional Inherited Members

- Public Types inherited from ParameterItemInterface
using | ID = unsigned int
typedef for the parameters id (when registered in a map)
using | Key = QString
typedef for the key description
using | Type = QString
typedef for the data type
using | Unit = QString
typedef for the parameter's unit
using | Value = QString
typedef for the parameter's value

Detailed Description

This class implements the functionality of ParameterItemInterface.

Definition at line 25 of file ParameterItemModel.h.

Member Function Documentation

◆ getID()

ParameterItemInterface::ID ParameterItemModel::getID ( ) const
overridevirtual

Method which returns the Id of this parameter if this parameter is registered in a map (ParameterMapInterface). Otherwise, an empty Id is returned.

Returns
the id of the parameter if registered in a map, otherwise an empty id

Implements ParameterItemInterface.

Definition at line 39 of file ParameterItemModel.cpp.

40 {
41 ParameterMapInterface const * const map = qobject_cast<ParameterMapInterface const * const > ( parent() );
42
43 return ( (map) ? map->getID( const_cast<ParameterItemModel *> (this) ) : ParameterItemInterface::ID() );
44 }
ParameterMapInterface
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt&#39;s QMap class but inherits from QObject class in order to utilize Qt&#39;s parenting system. Items registered in this map always become child of this map.
Definition: ParameterMapInterface.h:36
ParameterItemInterface::ID
unsigned int ID
typedef for the parameters id (when registered in a map)
Definition: ParameterItemInterface.h:45
ParameterMapInterface::getID
virtual ParameterMapInterface::ID getID(ParameterMapInterface::Item *const item) const =0
Method wich returns the id of the given parameter, if contained in the map. Otherwise an empty id is ...

◆ getKey()

ParameterItemInterface::Key ParameterItemModel::getKey ( ) const
overridevirtual

Method which returns the key description of this parameter.

Returns
the key description of this parameter

Implements ParameterItemInterface.

Definition at line 56 of file ParameterItemModel.cpp.

57 {
58 return key;
59 }
ParameterItemModel::key
Key key
the string object for the parameter&#39;s description
Definition: ParameterItemModel.h:57

◆ getType()

ParameterItemInterface::Type ParameterItemModel::getType ( ) const
overridevirtual

Method which returns the datatype of this parameter.

Returns
the datatype of this parameter

Implements ParameterItemInterface.

Definition at line 46 of file ParameterItemModel.cpp.

47 {
48 return type;
49 }
ParameterItemModel::type
Type type
the string object for the parameter&#39;s datatype
Definition: ParameterItemModel.h:56

◆ getUnit()

ParameterItemInterface::Unit ParameterItemModel::getUnit ( ) const
overridevirtual

Method which returns the unit of this parameter.

Returns
the unit of this parameter

Implements ParameterItemInterface.

Definition at line 76 of file ParameterItemModel.cpp.

77 {
78 return unit;
79 }
ParameterItemModel::unit
Unit unit
the string object for the parameter&#39;s unit
Definition: ParameterItemModel.h:59

◆ getValue()

ParameterItemInterface::Value ParameterItemModel::getValue ( ) const
overridevirtual

Method which returns the value of this parameter.

Returns
the value of this parameter

Implements ParameterItemInterface.

Definition at line 66 of file ParameterItemModel.cpp.

67 {
68 return value;
69 }
ParameterItemModel::value
Value value
the parameter&#39;s value. Taken as a string in order to make it independent its datatype ...
Definition: ParameterItemModel.h:58

◆ setKey()

void ParameterItemModel::setKey ( Key const & key )
overridevirtual

Method which sets the key description of this parameter to the given one.

Parameters
[in] the new key description of this parameter

Implements ParameterItemInterface.

Definition at line 61 of file ParameterItemModel.cpp.

62 {
63 key = _key;
64 }
ParameterItemModel::key
Key key
the string object for the parameter&#39;s description
Definition: ParameterItemModel.h:57

◆ setType()

void ParameterItemModel::setType ( Type const & type )
overridevirtual

Method which sets the datatype of this parameter to the given type.

Parameters
[in] the new datatype of this parameter

Implements ParameterItemInterface.

Definition at line 51 of file ParameterItemModel.cpp.

52 {
53 type = _type;
54 }
ParameterItemModel::type
Type type
the string object for the parameter&#39;s datatype
Definition: ParameterItemModel.h:56

◆ setUnit()

void ParameterItemModel::setUnit ( Value const & unit )
overridevirtual

Method which sets the unit of this parameter to the given one.

Parameters
[in] the new unit of this parameter

Implements ParameterItemInterface.

Definition at line 81 of file ParameterItemModel.cpp.

82 {
83 unit = _unit;
84 }
ParameterItemModel::unit
Unit unit
the string object for the parameter&#39;s unit
Definition: ParameterItemModel.h:59

◆ setValue()

void ParameterItemModel::setValue ( Value const & value )
overridevirtual

Method which sets the value of this parameter to the given one.

Parameters
[in] the new value of this parameter

Implements ParameterItemInterface.

Definition at line 71 of file ParameterItemModel.cpp.

72 {
73 value = _value;
74 }
ParameterItemModel::value
Value value
the parameter&#39;s value. Taken as a string in order to make it independent its datatype ...
Definition: ParameterItemModel.h:58
The documentation for this class was generated from the following files:
  • ParameterItemModel.h
  • ParameterItemModel.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ParameterItemModel Member List

This is the complete list of members for ParameterItemModel, including all inherited members.

default_key | ParameterItemModel | privatestatic
default_type | ParameterItemModel | privatestatic
default_unit | ParameterItemModel | privatestatic
default_value | ParameterItemModel | privatestatic
getID() const override | ParameterItemModel | virtual
getKey() const override | ParameterItemModel | virtual
getType() const override | ParameterItemModel | virtual
getUnit() const override | ParameterItemModel | virtual
getValue() const override | ParameterItemModel | virtual
ID typedef | ParameterItemInterface |
key | ParameterItemModel | private
Key typedef | ParameterItemInterface |
setKey(Key const &_key) override | ParameterItemModel | virtual
setType(Type const &_type) override | ParameterItemModel | virtual
setUnit(Value const &_unit) override | ParameterItemModel | virtual
setValue(Value const &_value) override | ParameterItemModel | virtual
Type typedef | ParameterItemInterface |
type | ParameterItemModel | private
unit | ParameterItemModel | private
Unit typedef | ParameterItemInterface |
value | ParameterItemModel | private
Value typedef | ParameterItemInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterMapInterface Class Reference

Public Types | Public Member Functions | List of all members
ParameterMapInterface Class Referenceabstract

This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...

Inheritance diagram for ParameterMapInterface:
ParameterMapModel

Public Types

using | ConstIterator = Map::ConstIterator
typedef for a constant iterator (read-only operations)
using | ID = ParameterItemInterface::ID
typedef for the id of a parameter
using | Item = ParameterItemInterface
typedef for the parameter
using | Iterator = Map::Iterator
typedef for an iterator
using | Map = QMap< ID, Item * >
typedef for the map of parameters

Public Member Functions

virtual bool | add (ParameterMapInterface::ID const &id)=0
Method which creates a parameter (instance of ParameterItemInterface) and adds it to the map under the given id. More...
virtual bool | add (ParameterMapInterface::ID const &id, ParameterMapInterface::Item const *const item)=0
Method which creates a new parameter (instance of ParameterItemInterface) as a copy of the given parameter (second item) and registers it under the id passed as a first argument. More...
virtual bool | add (ParameterMapInterface::Item *const item)=0
Method which adds the given parameter (instance of ParameterItemInterface) to the map under an automatically generated id. More...
virtual ParameterMapInterface::Iterator | begin ()=0
Gets an iterator pointing to the first parameter in the map. More...
virtual void | clear ()=0
Method which deletes all registered parameters and clears the map.
virtual ParameterMapInterface::ConstIterator | constBegin () const =0
Gets an iterator pointing to the first parameter in the map (use for read-only since pointing at constant values). More...
virtual ParameterMapInterface::ConstIterator | constEnd () const =0
Gets an iterator pointing at the end of the map after the last parameter (use for read-only). More...
virtual bool | contains (ParameterMapInterface::ID const &id) const =0
Method wich checks whether the map contains a parameter of the given id. More...
virtual int | count () const =0
Method which returns the number of parameter in the map. More...
virtual ParameterMapInterface::Iterator | end ()=0
Gets an iterator pointing to the end of the map after the last parameter. More...
virtual ParameterMapInterface::ID | generateID ()=0
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the maximum of all occupied ids. More...
virtual ParameterMapInterface::ID | getID (ParameterMapInterface::Item *const item) const =0
Method wich returns the id of the given parameter, if contained in the map. Otherwise an empty id is returned. More...
virtual QList< ID > | keys () const =0
Method which returns the list of all ids used in the map. More...
virtual bool | remove (ParameterMapInterface::ID const &id)=0
Method which removes the parameter with the given id from the map. The parameter is deleted after removing. Nothing will be done if there is no such parameter. More...
virtual bool | remove (ParameterMapInterface::Item *const item)=0
Method which removes the given parameter from the map. The parameter is deleted after removing. Nothing will be done if the parameter is not in the map. More...
virtual void | setID (ParameterMapInterface::Item *const item, ParameterMapInterface::ID const &id)=0
Method wich changes the id of the given parameter to the one passed as second argument. More...
virtual QList< Item * > | values () const =0
Method which returns the list of all parameters registered in this map. More...

Detailed Description

This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.

Definition at line 36 of file ParameterMapInterface.h.

Member Function Documentation

◆ add() [1/3]

virtual bool ParameterMapInterface::add ( ParameterMapInterface::ID const & id )
pure virtual

Method which creates a parameter (instance of ParameterItemInterface) and adds it to the map under the given id.

Parameters
[in] id the id under which the newly created item is registered
Returns
"true", if id is not used already, otherwise "false"

Implemented in ParameterMapModel.

◆ add() [2/3]

virtual bool ParameterMapInterface::add | ( | ParameterMapInterface::ID const & | id,
 |  | ParameterMapInterface::Item const *const | item
 | ) |  |
pure virtual

Method which creates a new parameter (instance of ParameterItemInterface) as a copy of the given parameter (second item) and registers it under the id passed as a first argument.

Parameters
[in] | id | the id to be used for the copied parameter
[in] | item | the parameter to be copied
Returns
"true", if id is not used already, otherwise "false"

Implemented in ParameterMapModel.

◆ add() [3/3]

virtual bool ParameterMapInterface::add ( ParameterMapInterface::Item *const item )
pure virtual

Method which adds the given parameter (instance of ParameterItemInterface) to the map under an automatically generated id.

Parameters
[in] item the parameter to be registered in this map
Returns
"true", if id is not used already, otherwise "false"

Implemented in ParameterMapModel.

◆ begin()

virtual ParameterMapInterface::Iterator ParameterMapInterface::begin ( )
pure virtual

Gets an iterator pointing to the first parameter in the map.

Returns
The iterator pointing at the first object in the map.

Implemented in ParameterMapModel.

◆ constBegin()

virtual ParameterMapInterface::ConstIterator ParameterMapInterface::constBegin ( ) const
pure virtual

Gets an iterator pointing to the first parameter in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implemented in ParameterMapModel.

◆ constEnd()

virtual ParameterMapInterface::ConstIterator ParameterMapInterface::constEnd ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last parameter (use for read-only).

Returns
The iterator pointing at the end of the map.

Implemented in ParameterMapModel.

◆ contains()

virtual bool ParameterMapInterface::contains ( ParameterMapInterface::ID const & id ) const
pure virtual

Method wich checks whether the map contains a parameter of the given id.

Parameters
[in] id the id to be searched for
Returns
true, if a parameter with given id exists, otherwise false.

Implemented in ParameterMapModel.

◆ count()

virtual int ParameterMapInterface::count ( ) const
pure virtual

Method which returns the number of parameter in the map.

Returns
the number of parameter in the map

Implemented in ParameterMapModel.

◆ end()

virtual ParameterMapInterface::Iterator ParameterMapInterface::end ( )
pure virtual

Gets an iterator pointing to the end of the map after the last parameter.

Returns
The iterator pointing at the end of the map.

Implemented in ParameterMapModel.

◆ generateID()

virtual ParameterMapInterface::ID ParameterMapInterface::generateID ( )
pure virtual

Method wich generates an unoccupied id for this map. The generated id will be by one larger than the maximum of all occupied ids.

Returns
an unoccupied id for this map

Implemented in ParameterMapModel.

◆ getID()

virtual ParameterMapInterface::ID ParameterMapInterface::getID ( ParameterMapInterface::Item *const item ) const
pure virtual

Method wich returns the id of the given parameter, if contained in the map. Otherwise an empty id is returned.

Parameters
[in] item the pointer to the sensor data object in question
Returns
the id of the object. Empty id if object is not in the map

Implemented in ParameterMapModel.

◆ keys()

virtual QList<ID> ParameterMapInterface::keys ( ) const
pure virtual

Method which returns the list of all ids used in the map.

Returns
the list of all ids used in the map

Implemented in ParameterMapModel.

◆ remove() [1/2]

virtual bool ParameterMapInterface::remove ( ParameterMapInterface::ID const & id )
pure virtual

Method which removes the parameter with the given id from the map. The parameter is deleted after removing. Nothing will be done if there is no such parameter.

Parameters
[in] id the id of the object to be removed
Returns
"true", if id exists in the map, otherwise "false"

Implemented in ParameterMapModel.

◆ remove() [2/2]

virtual bool ParameterMapInterface::remove ( ParameterMapInterface::Item *const item )
pure virtual

Method which removes the given parameter from the map. The parameter is deleted after removing. Nothing will be done if the parameter is not in the map.

Parameters
[in] item the parameter to be removed
Returns
"true", if parameter exists in the map, otherwise "false"

Implemented in ParameterMapModel.

◆ setID()

virtual void ParameterMapInterface::setID | ( | ParameterMapInterface::Item *const | item,
 |  | ParameterMapInterface::ID const & | id
 | ) |  |
pure virtual

Method wich changes the id of the given parameter to the one passed as second argument.

Parameters
[in] | item | the pointer to a parameter
[in] | id | the new id to be used for it

Implemented in ParameterMapModel.

◆ values()

virtual QList<Item*> ParameterMapInterface::values ( ) const
pure virtual

Method which returns the list of all parameters registered in this map.

Returns
the list of all parameters registered in this map.

Implemented in ParameterMapModel.

The documentation for this class was generated from the following file:
  • ParameterMapInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ParameterMapInterface Member List

This is the complete list of members for ParameterMapInterface, including all inherited members.

add(ParameterMapInterface::ID const &id)=0 | ParameterMapInterface | pure virtual
add(ParameterMapInterface::ID const &id, ParameterMapInterface::Item const *const item)=0 | ParameterMapInterface | pure virtual
add(ParameterMapInterface::Item *const item)=0 | ParameterMapInterface | pure virtual
begin()=0 | ParameterMapInterface | pure virtual
clear()=0 | ParameterMapInterface | pure virtual
constBegin() const =0 | ParameterMapInterface | pure virtual
constEnd() const =0 | ParameterMapInterface | pure virtual
ConstIterator typedef | ParameterMapInterface |
contains(ParameterMapInterface::ID const &id) const =0 | ParameterMapInterface | pure virtual
count() const =0 | ParameterMapInterface | pure virtual
end()=0 | ParameterMapInterface | pure virtual
generateID()=0 | ParameterMapInterface | pure virtual
getID(ParameterMapInterface::Item *const item) const =0 | ParameterMapInterface | pure virtual
ID typedef | ParameterMapInterface |
Item typedef | ParameterMapInterface |
Iterator typedef | ParameterMapInterface |
keys() const =0 | ParameterMapInterface | pure virtual
Map typedef | ParameterMapInterface |
remove(ParameterMapInterface::ID const &id)=0 | ParameterMapInterface | pure virtual
remove(ParameterMapInterface::Item *const item)=0 | ParameterMapInterface | pure virtual
setID(ParameterMapInterface::Item *const item, ParameterMapInterface::ID const &id)=0 | ParameterMapInterface | pure virtual
values() const =0 | ParameterMapInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterMapModel Class Reference

Public Member Functions | Private Attributes | List of all members
ParameterMapModel Class Reference

This class implements the functionality of ParameterMapInterface. More...

Inheritance diagram for ParameterMapModel:
ParameterMapInterface

Public Member Functions

virtual bool | add (ParameterMapInterface::ID const &id) override
Method which creates a parameter (instance of ParameterItemInterface) and adds it to the map under the given id. More...
virtual bool | add (ParameterMapInterface::ID const &id, ParameterMapInterface::Item const *const item) override
Method which creates a new parameter (instance of ParameterItemInterface) as a copy of the given parameter (second item) and registers it under the id passed as a first argument. More...
virtual bool | add (ParameterMapInterface::Item *const item) override
Method which adds the given parameter (instance of ParameterItemInterface) to the map under an automatically generated id. More...
virtual ParameterMapInterface::Iterator | begin () override
Gets an iterator pointing to the first parameter in the map. More...
virtual void | clear () override
Method which deletes all registered parameters and clears the map.
virtual ParameterMapInterface::ConstIterator | constBegin () const override
Gets an iterator pointing to the first parameter in the map (use for read-only since pointing at constant values). More...
virtual ParameterMapInterface::ConstIterator | constEnd () const override
Gets an iterator pointing at the end of the map after the last parameter (use for read-only). More...
virtual bool | contains (ParameterMapInterface::ID const &id) const override
Method wich checks whether the map contains a parameter of the given id. More...
virtual int | count () const override
Method which returns the number of parameter in the map. More...
virtual ParameterMapInterface::Iterator | end () override
Gets an iterator pointing to the end of the map after the last parameter. More...
virtual ParameterMapInterface::ID | generateID () override
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the maximum of all occupied ids. More...
virtual ParameterMapInterface::ID | getID (ParameterMapInterface::Item *const item) const override
Method wich returns the id of the given parameter, if contained in the map. Otherwise an empty id is returned. More...
virtual QList< ID > | keys () const override
Method which returns the list of all ids used in the map. More...
virtual bool | remove (ParameterMapInterface::ID const &id) override
Method which removes the parameter with the given id from the map. The parameter is deleted after removing. Nothing will be done if there is no such parameter. More...
virtual bool | remove (ParameterMapInterface::Item *const item) override
Method which removes the given parameter from the map. The parameter is deleted after removing. Nothing will be done if the parameter is not in the map. More...
virtual void | setID (ParameterMapInterface::Item *const item, ParameterMapInterface::ID const &id) override
Method wich changes the id of the given parameter to the one passed as second argument. More...
virtual QList< Item * > | values () const override
Method which returns the list of all parameters registered in this map. More...

Private Attributes

Map parameters
the map (container) for registering parameters

Additional Inherited Members

- Public Types inherited from ParameterMapInterface
using | ConstIterator = Map::ConstIterator
typedef for a constant iterator (read-only operations)
using | ID = ParameterItemInterface::ID
typedef for the id of a parameter
using | Item = ParameterItemInterface
typedef for the parameter
using | Iterator = Map::Iterator
typedef for an iterator
using | Map = QMap< ID, Item * >
typedef for the map of parameters

Detailed Description

This class implements the functionality of ParameterMapInterface.

Definition at line 25 of file ParameterMapModel.h.

Member Function Documentation

◆ add() [1/3]

bool ParameterMapModel::add ( ParameterMapInterface::ID const & id )
overridevirtual

Method which creates a parameter (instance of ParameterItemInterface) and adds it to the map under the given id.

Parameters
[in] id the id under which the newly created item is registered
Returns
"true", if id is not used already, otherwise "false"

Implements ParameterMapInterface.

Definition at line 42 of file ParameterMapModel.cpp.

43 {
44 if(!contains(id))
45 {
46 parameters.insert(id, new ParameterItemModel(this));
47 return true;
48 }
49
50 return false;
51 }
ParameterItemModel
This class implements the functionality of ParameterItemInterface.
Definition: ParameterItemModel.h:25
ParameterMapModel::contains
virtual bool contains(ParameterMapInterface::ID const &id) const override
Method wich checks whether the map contains a parameter of the given id.
Definition: ParameterMapModel.cpp:140
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74

◆ add() [2/3]

bool ParameterMapModel::add | ( | ParameterMapInterface::ID const & | id,
 |  | ParameterMapInterface::Item const *const | item
 | ) |  |
overridevirtual

Method which creates a new parameter (instance of ParameterItemInterface) as a copy of the given parameter (second item) and registers it under the id passed as a first argument.

Parameters
[in] | id | the id to be used for the copied parameter
[in] | item | the parameter to be copied
Returns
"true", if id is not used already, otherwise "false"

Implements ParameterMapInterface.

Definition at line 67 of file ParameterMapModel.cpp.

68 {
69 if(!contains(id))
70 {
71 parameters.insert(id, new ParameterItemModel(item, this));
72 return true;
73 }
74
75 return false;
76 }
ParameterItemModel
This class implements the functionality of ParameterItemInterface.
Definition: ParameterItemModel.h:25
ParameterMapModel::contains
virtual bool contains(ParameterMapInterface::ID const &id) const override
Method wich checks whether the map contains a parameter of the given id.
Definition: ParameterMapModel.cpp:140
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74

◆ add() [3/3]

bool ParameterMapModel::add ( ParameterMapInterface::Item *const item )
overridevirtual

Method which adds the given parameter (instance of ParameterItemInterface) to the map under an automatically generated id.

Parameters
[in] item the parameter to be registered in this map
Returns
"true", if id is not used already, otherwise "false"

Implements ParameterMapInterface.

Definition at line 53 of file ParameterMapModel.cpp.

54 {
55 ParameterMapInterface::ID id = generateID();
56
57 if(!contains(id))
58 {
59 parameters.insert(id, item);
60 item->setParent(this);
61 return true;
62 }
63
64 return false;
65 }
ParameterMapModel::contains
virtual bool contains(ParameterMapInterface::ID const &id) const override
Method wich checks whether the map contains a parameter of the given id.
Definition: ParameterMapModel.cpp:140
ParameterMapModel::generateID
virtual ParameterMapInterface::ID generateID() override
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
Definition: ParameterMapModel.cpp:127
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74
ParameterMapInterface::ID
ParameterItemInterface::ID ID
typedef for the id of a parameter
Definition: ParameterMapInterface.h:42

◆ begin()

ParameterMapInterface::Iterator ParameterMapModel::begin ( )
overridevirtual

Gets an iterator pointing to the first parameter in the map.

Returns
The iterator pointing at the first object in the map.

Implements ParameterMapInterface.

Definition at line 21 of file ParameterMapModel.cpp.

22 {
23 return parameters.begin();
24 }
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74

◆ constBegin()

ParameterMapInterface::ConstIterator ParameterMapModel::constBegin ( ) const
overridevirtual

Gets an iterator pointing to the first parameter in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implements ParameterMapInterface.

Definition at line 26 of file ParameterMapModel.cpp.

27 {
28 return parameters.constBegin();
29 }
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74

◆ constEnd()

ParameterMapInterface::ConstIterator ParameterMapModel::constEnd ( ) const
overridevirtual

Gets an iterator pointing at the end of the map after the last parameter (use for read-only).

Returns
The iterator pointing at the end of the map.

Implements ParameterMapInterface.

Definition at line 36 of file ParameterMapModel.cpp.

37 {
38 return parameters.constEnd();
39 }
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74

◆ contains()

bool ParameterMapModel::contains ( ParameterMapInterface::ID const & id ) const
overridevirtual

Method wich checks whether the map contains a parameter of the given id.

Parameters
[in] id the id to be searched for
Returns
true, if a parameter with given id exists, otherwise false.

Implements ParameterMapInterface.

Definition at line 140 of file ParameterMapModel.cpp.

141 {
142 return parameters.contains(id);
143 }
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74

◆ count()

int ParameterMapModel::count ( ) const
overridevirtual

Method which returns the number of parameter in the map.

Returns
the number of parameter in the map

Implements ParameterMapInterface.

Definition at line 155 of file ParameterMapModel.cpp.

156 {
157 return parameters.count();
158 }
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74

◆ end()

ParameterMapInterface::Iterator ParameterMapModel::end ( )
overridevirtual

Gets an iterator pointing to the end of the map after the last parameter.

Returns
The iterator pointing at the end of the map.

Implements ParameterMapInterface.

Definition at line 31 of file ParameterMapModel.cpp.

32 {
33 return parameters.end();
34 }
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74

◆ generateID()

ParameterMapInterface::ID ParameterMapModel::generateID ( )
overridevirtual

Method wich generates an unoccupied id for this map. The generated id will be by one larger than the maximum of all occupied ids.

Returns
an unoccupied id for this map

Implements ParameterMapInterface.

Definition at line 127 of file ParameterMapModel.cpp.

128 {
129 ParameterMapInterface::ID id = 1;
130 for (ParameterMapInterface::ID key : parameters.keys())
131 {
132 if (id <= key)
133 {
134 id = key + 1;
135 }
136 }
137 return id;
138 }
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74
ParameterMapInterface::ID
ParameterItemInterface::ID ID
typedef for the id of a parameter
Definition: ParameterMapInterface.h:42

◆ getID()

ParameterMapInterface::ID ParameterMapModel::getID ( ParameterMapInterface::Item *const item ) const
overridevirtual

Method wich returns the id of the given parameter, if contained in the map. Otherwise an empty id is returned.

Parameters
[in] item the pointer to the sensor data object in question
Returns
the id of the object. Empty id if object is not in the map

Implements ParameterMapInterface.

Definition at line 112 of file ParameterMapModel.cpp.

113 {
114 return parameters.key(item);
115 }
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74

◆ keys()

QList< ParameterMapInterface::ID > ParameterMapModel::keys ( ) const
overridevirtual

Method which returns the list of all ids used in the map.

Returns
the list of all ids used in the map

Implements ParameterMapInterface.

Definition at line 145 of file ParameterMapModel.cpp.

146 {
147 return parameters.keys();
148 }
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74

◆ remove() [1/2]

bool ParameterMapModel::remove ( ParameterMapInterface::ID const & id )
overridevirtual

Method which removes the parameter with the given id from the map. The parameter is deleted after removing. Nothing will be done if there is no such parameter.

Parameters
[in] id the id of the object to be removed
Returns
"true", if id exists in the map, otherwise "false"

Implements ParameterMapInterface.

Definition at line 78 of file ParameterMapModel.cpp.

79 {
80 if(contains(id))
81 {
82 delete parameters.take(id);
83 return true;
84 }
85
86 return false;
87 }
ParameterMapModel::contains
virtual bool contains(ParameterMapInterface::ID const &id) const override
Method wich checks whether the map contains a parameter of the given id.
Definition: ParameterMapModel.cpp:140
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74

◆ remove() [2/2]

bool ParameterMapModel::remove ( ParameterMapInterface::Item *const item )
overridevirtual

Method which removes the given parameter from the map. The parameter is deleted after removing. Nothing will be done if the parameter is not in the map.

Parameters
[in] item the parameter to be removed
Returns
"true", if parameter exists in the map, otherwise "false"

Implements ParameterMapInterface.

Definition at line 90 of file ParameterMapModel.cpp.

91 {
92
93 if(parameters.values().contains(item) )
94 {
95 ParameterItemInterface::ID id = getID(item);
96 delete parameters.take(id);
97 return true;
98 }
99
100 return false;
101 }
ParameterItemInterface::ID
unsigned int ID
typedef for the parameters id (when registered in a map)
Definition: ParameterItemInterface.h:45
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74
ParameterMapModel::getID
virtual ParameterMapInterface::ID getID(ParameterMapInterface::Item *const item) const override
Method wich returns the id of the given parameter, if contained in the map. Otherwise an empty id is ...
Definition: ParameterMapModel.cpp:112

◆ setID()

void ParameterMapModel::setID | ( | ParameterMapInterface::Item *const | item,
 |  | ParameterMapInterface::ID const & | id
 | ) |  |
overridevirtual

Method wich changes the id of the given parameter to the one passed as second argument.

Parameters
[in] | item | the pointer to a parameter
[in] | id | the new id to be used for it

Implements ParameterMapInterface.

Definition at line 117 of file ParameterMapModel.cpp.

119 {
120
121 ParameterMapInterface::ID oldID = getID(item);
122
123 parameters.take(oldID);
124 parameters.insert(id, item);
125 }
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74
ParameterMapModel::getID
virtual ParameterMapInterface::ID getID(ParameterMapInterface::Item *const item) const override
Method wich returns the id of the given parameter, if contained in the map. Otherwise an empty id is ...
Definition: ParameterMapModel.cpp:112
ParameterMapInterface::ID
ParameterItemInterface::ID ID
typedef for the id of a parameter
Definition: ParameterMapInterface.h:42

◆ values()

QList< ParameterItemInterface * > ParameterMapModel::values ( ) const
overridevirtual

Method which returns the list of all parameters registered in this map.

Returns
the list of all parameters registered in this map.

Implements ParameterMapInterface.

Definition at line 150 of file ParameterMapModel.cpp.

151 {
152 return parameters.values();
153 }
ParameterMapModel::parameters
Map parameters
the map (container) for registering parameters
Definition: ParameterMapModel.h:74
The documentation for this class was generated from the following files:
  • ParameterMapModel.h
  • ParameterMapModel.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ParameterMapModel Member List

This is the complete list of members for ParameterMapModel, including all inherited members.

add(ParameterMapInterface::ID const &id) override | ParameterMapModel | virtual
add(ParameterMapInterface::ID const &id, ParameterMapInterface::Item const *const item) override | ParameterMapModel | virtual
add(ParameterMapInterface::Item *const item) override | ParameterMapModel | virtual
begin() override | ParameterMapModel | virtual
clear() override | ParameterMapModel | virtual
constBegin() const override | ParameterMapModel | virtual
constEnd() const override | ParameterMapModel | virtual
ConstIterator typedef | ParameterMapInterface |
contains(ParameterMapInterface::ID const &id) const override | ParameterMapModel | virtual
count() const override | ParameterMapModel | virtual
end() override | ParameterMapModel | virtual
generateID() override | ParameterMapModel | virtual
getID(ParameterMapInterface::Item *const item) const override | ParameterMapModel | virtual
ID typedef | ParameterMapInterface |
Item typedef | ParameterMapInterface |
Iterator typedef | ParameterMapInterface |
keys() const override | ParameterMapModel | virtual
Map typedef | ParameterMapInterface |
parameters | ParameterMapModel | private
remove(ParameterMapInterface::ID const &id) override | ParameterMapModel | virtual
remove(ParameterMapInterface::Item *const item) override | ParameterMapModel | virtual
setID(ParameterMapInterface::Item *const item, ParameterMapInterface::ID const &id) override | ParameterMapModel | virtual
values() const override | ParameterMapModel | virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ParameterMapPresenter Class Reference

Public Member Functions | Private Attributes | List of all members
ParameterMapPresenter Class Reference

This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters. In fact, this class implements a wrapper for the map of parameters (ParameterMapInterface) to be editable by QTableView objects within Qt's Model/View framework. More...

Inherits QAbstractTableModel.

Public Member Functions

virtual void | addRow (ParameterItemInterface::Type _type, ParameterItemInterface::Key _key, ParameterItemInterface::Unit _unit, ParameterItemInterface::Value _value)
Method that adds a new row, i.e. a new parameter with the given attributes. More...
int | columnCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders. More...
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex). More...
Qt::ItemFlags | flags (const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! More...
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format. More...
virtual bool | removeRow (const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval. More...
int | rowCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of parameters. More...
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value. More...
void | setParameters (ParameterMapInterface *_parameters)
Method which sets the currently processed parameter map to the given argument. More...
void | update ()
Method which updates the table according to the current entries of parameters.

Private Attributes

QStringList | _columnHeaders
a string list containing the column header data of the table
ParameterMapInterface * parameters
the pointer to the map of parameters edited by this table wrapper
QMap< int, ParameterMapInterface::ID > | RowToID
a map of row indices to parameter Ids

Detailed Description

This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters. In fact, this class implements a wrapper for the map of parameters (ParameterMapInterface) to be editable by QTableView objects within Qt's Model/View framework.

Definition at line 33 of file ParameterMapPresenter.h.

Member Function Documentation

◆ addRow()

void ParameterMapPresenter::addRow | ( | ParameterItemInterface::Type | _type,
 |  | ParameterItemInterface::Key | _key,
 |  | ParameterItemInterface::Unit | _unit,
 |  | ParameterItemInterface::Value | _value
 | ) |  |
virtual

Method that adds a new row, i.e. a new parameter with the given attributes.

Parameters
[in] | _type | the datatype of the new parameter
[in] | _key | the key (name) of the new parameter
[in] | _unit | the unit of the new parameter
[in] | _value | the value of the new parameter

Definition at line 106 of file ParameterMapPresenter.cpp.

110 {
111 int row = rowCount();
112
113 if(parameters)
114 {
115 beginInsertRows(QModelIndex(), row , row);
116
117 ParameterMapInterface::ID id = parameters->generateID();
118 parameters->add(id);
119 RowToID.insert(row, id);
120
121 ParameterItemInterface * const param = parameters->getItem(id);
122 param->setType(_type);
123 param->setKey(_key);
124 param->setUnit(_unit);
125 param->setValue(_value);
126
127 endInsertRows();
128 }
129 }
ParameterItemInterface::setUnit
virtual void setUnit(Value const &unit)=0
Method which sets the unit of this parameter to the given one.
ParameterMapPresenter::parameters
ParameterMapInterface * parameters
the pointer to the map of parameters edited by this table wrapper
Definition: ParameterMapPresenter.h:155
ParameterItemInterface::setValue
virtual void setValue(Value const &value)=0
Method which sets the value of this parameter to the given one.
ParameterMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: ParameterMapPresenter.cpp:32
ParameterItemInterface::setType
virtual void setType(Type const &type)=0
Method which sets the datatype of this parameter to the given type.
ParameterMapPresenter::RowToID
QMap< int, ParameterMapInterface::ID > RowToID
a map of row indices to parameter Ids
Definition: ParameterMapPresenter.h:153
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39
ParameterMapInterface::generateID
virtual ParameterMapInterface::ID generateID()=0
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
ParameterMapInterface::ID
ParameterItemInterface::ID ID
typedef for the id of a parameter
Definition: ParameterMapInterface.h:42
ParameterItemInterface::setKey
virtual void setKey(Key const &key)=0
Method which sets the key description of this parameter to the given one.
ParameterMapInterface::add
virtual bool add(ParameterMapInterface::ID const &id)=0
Method which creates a parameter (instance of ParameterItemInterface) and adds it to the map under th...

◆ columnCount()

int ParameterMapPresenter::columnCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table columns

Definition at line 42 of file ParameterMapPresenter.cpp.

43 {
44 Q_UNUSED(parent)
45
46 return _columnHeaders.count();
47 }
ParameterMapPresenter::_columnHeaders
QStringList _columnHeaders
a string list containing the column header data of the table
Definition: ParameterMapPresenter.h:154

◆ data()

QVariant ParameterMapPresenter::data | ( | const QModelIndex & | index,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex).

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::DisplayRole or Qt::EditRole)
Returns
The data stored in the table cell (as a QVariant)

Definition at line 49 of file ParameterMapPresenter.cpp.

50 {
51 int row = index.row();
52 int col = index.column();
53 ParameterItemInterface * const param = parameters->getItem(RowToID[row]);
54
55 if(!param && row >= parameters->count())
56 return QVariant::Invalid;
57
58 if(role == Qt::TextAlignmentRole)
59 return QVariant(Qt::AlignCenter);
60
61 if(role == Qt::DisplayRole || role == Qt::EditRole)
62 {
63 if( col == 0 )
64 return QVariant(param->getType());
65 else if( col == 1)
66 return QVariant(param->getKey());
67 else if( col == 2)
68 return QVariant(param->getUnit());
69 else if ( col == 3)
70 return QVariant(param->getValue());
71 }
72
73 return QVariant();
74 }
ParameterItemInterface::getUnit
virtual Unit getUnit() const =0
Method which returns the unit of this parameter.
ParameterMapPresenter::parameters
ParameterMapInterface * parameters
the pointer to the map of parameters edited by this table wrapper
Definition: ParameterMapPresenter.h:155
ParameterItemInterface::getValue
virtual Value getValue() const =0
Method which returns the value of this parameter.
ParameterItemInterface::getType
virtual Type getType() const =0
Method which returns the datatype of this parameter.
ParameterItemInterface::getKey
virtual Key getKey() const =0
Method which returns the key description of this parameter.
ParameterMapInterface::count
virtual int count() const =0
Method which returns the number of parameter in the map.
ParameterMapPresenter::RowToID
QMap< int, ParameterMapInterface::ID > RowToID
a map of row indices to parameter Ids
Definition: ParameterMapPresenter.h:153
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39

◆ flags()

Qt::ItemFlags ParameterMapPresenter::flags ( const QModelIndex & index ) const
override

Reimplementation of the flags method. This will make the items of the model editable!

Parameters
[in] index An index identifying the cell of the table
Returns
An item flag

Definition at line 98 of file ParameterMapPresenter.cpp.

99 {
100 if (index.column() == 3)
101 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
102
103 return QAbstractTableModel::flags(index);
104 }

◆ headerData()

QVariant ParameterMapPresenter::headerData | ( | int | section,
 |  | Qt::Orientation | orientation,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format.

Parameters
[in] | section | A table section
[in] | role | A Qt role
[in] | orientation | A table orientation
Returns
The content of the table's header at the given section

Definition at line 21 of file ParameterMapPresenter.cpp.

22 {
23 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
24 return _columnHeaders.value(section);
25
26 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
27 return section + 1;
28
29 return QVariant();
30 }
ParameterMapPresenter::_columnHeaders
QStringList _columnHeaders
a string list containing the column header data of the table
Definition: ParameterMapPresenter.h:154

◆ removeRow()

bool ParameterMapPresenter::removeRow ( const int & row )
virtual

Method that removes the row specified by the given row-index, if this is in a meaningful interval.

Parameters
[in] row the row-index
Returns
"True", if row is between 0 and the number of parameters, "false", otherwise

Definition at line 131 of file ParameterMapPresenter.cpp.

132 {
133 if(parameters && RowToID.contains(row) && parameters->contains(RowToID[row]))
134 {
135 beginRemoveRows(QModelIndex(), row, row);
136
137 parameters->remove(RowToID[row]);
138 RowToID.remove(row);
139
140 for( int i=row+1; i<=RowToID.count() ; i++)
141 RowToID.insert( i-1, RowToID.take(i) );
142
143 endRemoveRows();
144 return true;
145 }
146
147 return false;
148 }
ParameterMapPresenter::parameters
ParameterMapInterface * parameters
the pointer to the map of parameters edited by this table wrapper
Definition: ParameterMapPresenter.h:155
ParameterMapInterface::contains
virtual bool contains(ParameterMapInterface::ID const &id) const =0
Method wich checks whether the map contains a parameter of the given id.
ParameterMapPresenter::RowToID
QMap< int, ParameterMapInterface::ID > RowToID
a map of row indices to parameter Ids
Definition: ParameterMapPresenter.h:153
ParameterMapInterface::remove
virtual bool remove(ParameterMapInterface::ID const &id)=0
Method which removes the parameter with the given id from the map. The parameter is deleted after rem...

◆ rowCount()

int ParameterMapPresenter::rowCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of parameters.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table rows

Definition at line 32 of file ParameterMapPresenter.cpp.

33 {
34 Q_UNUSED(parent)
35
36 if(parameters)
37 return parameters->count();
38 else
39 return 0;
40 }
ParameterMapPresenter::parameters
ParameterMapInterface * parameters
the pointer to the map of parameters edited by this table wrapper
Definition: ParameterMapPresenter.h:155
ParameterMapInterface::count
virtual int count() const =0
Method which returns the number of parameter in the map.

◆ setData()

bool ParameterMapPresenter::setData | ( | const QModelIndex & | index,
 |  | const QVariant & | value,
 |  | int | role = Qt::EditRole
 | ) |  |
override

Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value.

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::EditRole)
Returns
"True" if the index corresponds to an existing cell in the table, otherwise "false"

Definition at line 76 of file ParameterMapPresenter.cpp.

77 {
78 int row = index.row();
79 int col = index.column();
80 ParameterItemInterface * const param = parameters->getItem(RowToID[row]);
81
82 if(!param && row >= parameters->count())
83 return false;
84
85 if( role == Qt::EditRole)
86 {
87 if( col == 3)
88 {
89 param->setValue(value.toString());
90 Q_EMIT dataChanged(index, index);
91 return true;
92 }
93 }
94
95 return false;
96 }
ParameterMapPresenter::parameters
ParameterMapInterface * parameters
the pointer to the map of parameters edited by this table wrapper
Definition: ParameterMapPresenter.h:155
ParameterItemInterface::setValue
virtual void setValue(Value const &value)=0
Method which sets the value of this parameter to the given one.
ParameterMapInterface::count
virtual int count() const =0
Method which returns the number of parameter in the map.
ParameterMapPresenter::RowToID
QMap< int, ParameterMapInterface::ID > RowToID
a map of row indices to parameter Ids
Definition: ParameterMapPresenter.h:153
ParameterItemInterface
This class defines parameters.
Definition: ParameterItemInterface.h:39

◆ setParameters()

void ParameterMapPresenter::setParameters ( ParameterMapInterface * _parameters )

Method which sets the currently processed parameter map to the given argument.

Parameters
[in] _parameters the parameter map to be processed

Definition at line 150 of file ParameterMapPresenter.cpp.

151 {
152 parameters=_parameters;
153 update();
154 }
ParameterMapPresenter::parameters
ParameterMapInterface * parameters
the pointer to the map of parameters edited by this table wrapper
Definition: ParameterMapPresenter.h:155
ParameterMapPresenter::update
void update()
Method which updates the table according to the current entries of parameters.
Definition: ParameterMapPresenter.cpp:156
The documentation for this class was generated from the following files:
  • ParameterMapPresenter.h
  • ParameterMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ParameterMapPresenter Member List

This is the complete list of members for ParameterMapPresenter, including all inherited members.

_columnHeaders | ParameterMapPresenter | private
addRow(ParameterItemInterface::Type _type, ParameterItemInterface::Key _key, ParameterItemInterface::Unit _unit, ParameterItemInterface::Value _value) | ParameterMapPresenter | virtual
columnCount(const QModelIndex &parent=QModelIndex()) const override | ParameterMapPresenter |
data(const QModelIndex &index, int role=Qt::DisplayRole) const override | ParameterMapPresenter |
flags(const QModelIndex &index) const override | ParameterMapPresenter |
headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override | ParameterMapPresenter |
parameters | ParameterMapPresenter | private
removeRow(const int &row) | ParameterMapPresenter | virtual
rowCount(const QModelIndex &parent=QModelIndex()) const override | ParameterMapPresenter |
RowToID | ParameterMapPresenter | private
setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override | ParameterMapPresenter |
setParameters(ParameterMapInterface *_parameters) | ParameterMapPresenter |
update() | ParameterMapPresenter |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ProjectInterface Class Reference

Signals | Public Member Functions | List of all members
ProjectInterface Class Referenceabstract

This class defines the items constituing the project configuration: More...

Inherits QObject, and ServiceInterface< Interface, ID >.

Signals

void | cleared () const
Triggers signal to inform that the project has been reset successfully.
void | loaded () const
Triggers signal to inform that a project has been loaded successfully.
void | saved () const
Triggers signal to inform that a project has been saved successfully.
void | update ()
Triggers signal to inform that an item from the project configuration has been modified.

Public Member Functions

virtual bool | clear ()=0
Resets the project configuration. More...
virtual QDir | getLibrary () const =0
Gets the directory containing the components library. More...
virtual ProjectInterface::Library | getLibraryPath () const =0
Gets the path of the directory containing the components library. More...
virtual ProjectInterface::LogLevel | getLogLevel () const =0
Gets the level of information in the log files for the current project. More...
virtual ProjectInterface::LogMaster | getLogMaster () const =0
Gets the path of the directory containing the log file of the openPASS Master. More...
virtual ProjectInterface::LogSlave | getLogSlave () const =0
Gets the path of the directory containing the log file of the openPASS Slave. More...
virtual bool | getProjectStatus () const =0
Verifies if the required entries for the simulation are given. More...
virtual ProjectInterface::Result | getResultPath () const =0
Gets the path of the directory containing the project results. More...
virtual ProjectInterface::Slave | getSlaveExe () const =0
Gets the path of the executable openPASS slave. More...
virtual bool | load (QString const &filepath)=0
Loads a project from a file located in the given path filepath. More...
virtual bool | save (QString const &filepath) const =0
Saves a project to a file stored in the given path filepath. More...
virtual bool | setLibraryPath (ProjectInterface::Library const &library)=0
Sets the path of the directory containing the components library library. More...
virtual bool | setLogLevel (ProjectInterface::LogLevel const &logLevel)=0
Sets the level of information logLevel in the log files for the current project. More...
virtual bool | setLogMaster (ProjectInterface::LogMaster const &logMaster)=0
Sets the path of the directory containing the log file of the openPASS Master (Log Master) logMaster. More...
virtual bool | setLogSlave (ProjectInterface::LogSlave const &logSlave)=0
Sets the path of the directory containing the log file of the openPASS Slave (Log Slave) logSlave. More...
virtual bool | setResultPath (ProjectInterface::Result const &result)=0
Sets the path of the directory containing the project results result. More...
virtual bool | setSlaveExe (ProjectInterface::Slave const &slave)=0
Sets the path of the executable openPASS slave. More...

Detailed Description

This class defines the items constituing the project configuration:

  • the components library (path)
  • the project results (path)
  • the agent configuration file
  • the run configuration file
  • the scenery configuration file
  • the log file for openPASS Master
  • the log file for openPASS Slave
  • the level of information in log files [0...5]
  • the executable openPASS Slave (path) These items are transmitted as the framework configuration of the simulation for further process to openPASS Master.

Definition at line 46 of file ProjectInterface.h.

Member Function Documentation

◆ clear()

virtual bool ProjectInterface::clear ( )
pure virtual

Resets the project configuration.

Returns
True if project configuration successfully reset.

◆ getLibrary()

virtual QDir ProjectInterface::getLibrary ( ) const
pure virtual

Gets the directory containing the components library.

Returns
The components library.

◆ getLibraryPath()

virtual ProjectInterface::Library ProjectInterface::getLibraryPath ( ) const
pure virtual

Gets the path of the directory containing the components library.

Returns
The path of the components library.

◆ getLogLevel()

virtual ProjectInterface::LogLevel ProjectInterface::getLogLevel ( ) const
pure virtual

Gets the level of information in the log files for the current project.

Returns
The level of information in the log files.

◆ getLogMaster()

virtual ProjectInterface::LogMaster ProjectInterface::getLogMaster ( ) const
pure virtual

Gets the path of the directory containing the log file of the openPASS Master.

Returns
The path of the Log Master.

◆ getLogSlave()

virtual ProjectInterface::LogSlave ProjectInterface::getLogSlave ( ) const
pure virtual

Gets the path of the directory containing the log file of the openPASS Slave.

Returns
The path of the Log Slave.

◆ getProjectStatus()

virtual bool ProjectInterface::getProjectStatus ( ) const
pure virtual

Verifies if the required entries for the simulation are given.

Returns
True if all fields filled.

◆ getResultPath()

virtual ProjectInterface::Result ProjectInterface::getResultPath ( ) const
pure virtual

Gets the path of the directory containing the project results.

Returns
The path of the project results.

◆ getSlaveExe()

virtual ProjectInterface::Slave ProjectInterface::getSlaveExe ( ) const
pure virtual

Gets the path of the executable openPASS slave.

Returns
The path of the executable.

◆ load()

virtual bool ProjectInterface::load ( QString const & filepath )
pure virtual

Loads a project from a file located in the given path filepath.

Parameters
[in] filepath The path locating the project configuration file.
Returns
True if project successfully loaded.

◆ save()

virtual bool ProjectInterface::save ( QString const & filepath ) const
pure virtual

Saves a project to a file stored in the given path filepath.

Parameters
[in] filepath The path for storing the project configuration file.
Returns
True if project successfully saved.

◆ setLibraryPath()

virtual bool ProjectInterface::setLibraryPath ( ProjectInterface::Library const & library )
pure virtual

Sets the path of the directory containing the components library library.

Parameters
[in] library The path of the components library.
Returns
True if the path exists.

◆ setLogLevel()

virtual bool ProjectInterface::setLogLevel ( ProjectInterface::LogLevel const & logLevel )
pure virtual

Sets the level of information logLevel in the log files for the current project.

Parameters
[in] logLevel The level of information in the log files.
Returns
True if log level successfully modified.

◆ setLogMaster()

virtual bool ProjectInterface::setLogMaster ( ProjectInterface::LogMaster const & logMaster )
pure virtual

Sets the path of the directory containing the log file of the openPASS Master (Log Master) logMaster.

Parameters
[in] logMaster The path of the file Log Master.
Returns
True if the path exists.

◆ setLogSlave()

virtual bool ProjectInterface::setLogSlave ( ProjectInterface::LogSlave const & logSlave )
pure virtual

Sets the path of the directory containing the log file of the openPASS Slave (Log Slave) logSlave.

Parameters
[in] logSlave The path of the file Log Slave.
Returns
True if the path exists.

◆ setResultPath()

virtual bool ProjectInterface::setResultPath ( ProjectInterface::Result const & result )
pure virtual

Sets the path of the directory containing the project results result.

Parameters
[in] result The path of the project results.
Returns
True if the path exists.

◆ setSlaveExe()

virtual bool ProjectInterface::setSlaveExe ( ProjectInterface::Slave const & slave )
pure virtual

Sets the path of the executable openPASS slave.

Returns
True if the path exists.
The documentation for this class was generated from the following file:
  • ProjectInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ProjectInterface Member List

This is the complete list of members for ProjectInterface, including all inherited members.

clear()=0 | ProjectInterface | pure virtual
cleared() const | ProjectInterface | signal
getLibrary() const =0 | ProjectInterface | pure virtual
getLibraryPath() const =0 | ProjectInterface | pure virtual
getLogLevel() const =0 | ProjectInterface | pure virtual
getLogMaster() const =0 | ProjectInterface | pure virtual
getLogSlave() const =0 | ProjectInterface | pure virtual
getProjectStatus() const =0 | ProjectInterface | pure virtual
getResultPath() const =0 | ProjectInterface | pure virtual
getSlaveExe() const =0 | ProjectInterface | pure virtual
load(QString const &filepath)=0 | ProjectInterface | pure virtual
loaded() const | ProjectInterface | signal
save(QString const &filepath) const =0 | ProjectInterface | pure virtual
saved() const | ProjectInterface | signal
setLibraryPath(ProjectInterface::Library const &library)=0 | ProjectInterface | pure virtual
setLogLevel(ProjectInterface::LogLevel const &logLevel)=0 | ProjectInterface | pure virtual
setLogMaster(ProjectInterface::LogMaster const &logMaster)=0 | ProjectInterface | pure virtual
setLogSlave(ProjectInterface::LogSlave const &logSlave)=0 | ProjectInterface | pure virtual
setResultPath(ProjectInterface::Result const &result)=0 | ProjectInterface | pure virtual
setSlaveExe(ProjectInterface::Slave const &slave)=0 | ProjectInterface | pure virtual
update() | ProjectInterface | signal
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: RemoveEnvironmentItem Class Reference

List of all members
RemoveEnvironmentItem Class Reference

Command class for removing rows from the table of environment settings. More...

Inherits QUndoCommand.

Detailed Description

Command class for removing rows from the table of environment settings.

Definition at line 222 of file EnvironmentPresenter.h.

The documentation for this class was generated from the following files:
  • EnvironmentPresenter.h
  • EnvironmentPresenter.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

RemoveEnvironmentItem Member List

This is the complete list of members for RemoveEnvironmentItem, including all inherited members.

Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: RemoveLibrary Class Reference

List of all members
RemoveLibrary Class Reference

Command class for removing libraries from the libraries table. More...

Inherits QUndoCommand.

Detailed Description

Command class for removing libraries from the libraries table.

Definition at line 163 of file ExperimentPresenter.h.

The documentation for this class was generated from the following files:
  • ExperimentPresenter.h
  • ExperimentPresenter.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

RemoveLibrary Member List

This is the complete list of members for RemoveLibrary, including all inherited members.

Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: RemoveLoggingGroup Class Reference

List of all members
RemoveLoggingGroup Class Reference

Command class for removing logging groups from the logging groups list. More...

Inherits QUndoCommand.

Detailed Description

Command class for removing logging groups from the logging groups list.

Definition at line 205 of file ExperimentPresenter.h.

The documentation for this class was generated from the following files:
  • ExperimentPresenter.h
  • ExperimentPresenter.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

RemoveLoggingGroup Member List

This is the complete list of members for RemoveLoggingGroup, including all inherited members.

Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: RemoveTrafficItem Class Reference

List of all members
RemoveTrafficItem Class Reference

Command class for removing rows from the table of traffic settings. More...

Inherits QUndoCommand.

Detailed Description

Command class for removing rows from the table of traffic settings.

Definition at line 296 of file TrafficPresenter.h.

The documentation for this class was generated from the following files:
  • TrafficPresenter.h
  • TrafficPresenter.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

RemoveTrafficItem Member List

This is the complete list of members for RemoveTrafficItem, including all inherited members.

Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioAgentsPresenter Class Reference

Public Member Functions | Private Attributes | List of all members
ScenarioAgentsPresenter Class Reference

This class describes the presenter object of the scenario agents map. More...

Inherits QAbstractTableModel.

Public Member Functions

int | columnCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders. More...
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex). More...
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format. More...
int | rowCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of scenario agents. More...
void | update ()
Method which updates the table model according to the current entries of #entitites.

Private Attributes

QStringList | _columnHeaders
the column header's info
ScenarioInterface::Entities *const | entities
a map translating row indices to scenario agent names More...
QMap< QString, QList< QString > > const & | scenarioAgentsList
a map which holds a list of scenario agents (values) for each profiles catalogue (keys)

Detailed Description

This class describes the presenter object of the scenario agents map.

In the spirit of Qt's Model/View framework it constitutes the wrapper object connecting the model data (scenario agents map defined in ScenarioInterface) with the interface defined in QAbstractTableModel. This interface can be then utilized by instances Qt's QTableView to display the map entries in a table format. Since the table should only display the scenario agents, there is no setData method implemented here.

See https://doc.qt.io/qt-5/model-view-programming.html for Qt's model/view framework.

Definition at line 49 of file ScenarioAgentsPresenter.h.

Member Function Documentation

◆ columnCount()

int ScenarioAgentsPresenter::columnCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table columns

Definition at line 43 of file ScenarioAgentsPresenter.cpp.

44 {
45 Q_UNUSED(parent);
46
47 return _columnHeaders.count();
48 }
ScenarioAgentsPresenter::_columnHeaders
QStringList _columnHeaders
the column header&#39;s info
Definition: ScenarioAgentsPresenter.h:119

◆ data()

QVariant ScenarioAgentsPresenter::data | ( | const QModelIndex & | index,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex).

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::DisplayRole or Qt::EditRole)
Returns
The data stored in the table cell (as a QVariant)

Definition at line 50 of file ScenarioAgentsPresenter.cpp.

51 {
52 int row = index.row();
53 int col = index.column();
54 QString name = RowToName.value(row);
55
56 if(row >= entities->count())
57 return QVariant::Invalid;
58
59 if(role == Qt::TextAlignmentRole)
60 return QVariant(Qt::AlignCenter);
61
62 if(role == Qt::TextColorRole)
63 {
64 QBrush color(Qt::red);
65
66 if(col == 1)
67 {
68 QString catalogue = entities->value(name).first;
69
70 if(!scenarioAgentsList.contains(catalogue))
71 return color;
72 }
73 else if (col == 2)
74 {
75 QString agentProfile = entities->value(name).second;
76 QString catalogue = entities->value(name).first;
77
78 if(!scenarioAgentsList.contains(catalogue))
79 return color;
80 else if(!scenarioAgentsList.value(catalogue).contains(agentProfile))
81 return color;
82
83 }
84
85 return QBrush(Qt::black);
86 }
87
88
89
90 if(role == Qt::DisplayRole)
91 {
92
93 if( col == 0 )
94 return name;
95 else if(col == 1)
96 {
97 QString catalogue = entities->value(name).first;
98
99 if(!scenarioAgentsList.contains(catalogue))
100 {
101 return QString ("%1 (inaccessible!)").arg(catalogue);
102 }
103 else
104 return catalogue;
105 }
106 else if (col == 2)
107 {
108 QString agentProfile = entities->value(name).second;
109 QString catalogue = entities->value(name).first;
110
111 if(!scenarioAgentsList.contains(catalogue) || !scenarioAgentsList.value(catalogue).contains(agentProfile))
112 {
113 return QString("%1 (not existing!)").arg(agentProfile);
114 }
115 else {
116 return agentProfile;
117 }
118 }
119 }
120
121 return QVariant();
122 }
ScenarioAgentsPresenter::entities
ScenarioInterface::Entities *const entities
a map translating row indices to scenario agent names
Definition: ScenarioAgentsPresenter.h:118
ScenarioAgentsPresenter::scenarioAgentsList
QMap< QString, QList< QString > > const & scenarioAgentsList
a map which holds a list of scenario agents (values) for each profiles catalogue (keys) ...
Definition: ScenarioAgentsPresenter.h:120

◆ headerData()

QVariant ScenarioAgentsPresenter::headerData | ( | int | section,
 |  | Qt::Orientation | orientation,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format.

Parameters
[in] | section | A table section
[in] | role | A Qt role
[in] | orientation | A table orientation
Returns
The content of the table's header at the given section

Definition at line 25 of file ScenarioAgentsPresenter.cpp.

26 {
27 if( (role == Qt::DisplayRole) && (orientation== Qt::Horizontal) )
28 return _columnHeaders.value(section);
29
30 if( (role == Qt::DisplayRole) && (orientation == Qt::Vertical) )
31 return section+1;
32
33 return QVariant();
34 }
ScenarioAgentsPresenter::_columnHeaders
QStringList _columnHeaders
the column header&#39;s info
Definition: ScenarioAgentsPresenter.h:119

◆ rowCount()

int ScenarioAgentsPresenter::rowCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of scenario agents.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table rows

Definition at line 36 of file ScenarioAgentsPresenter.cpp.

37 {
38 Q_UNUSED(parent);
39
40 return entities->count();
41 }
ScenarioAgentsPresenter::entities
ScenarioInterface::Entities *const entities
a map translating row indices to scenario agent names
Definition: ScenarioAgentsPresenter.h:118

Member Data Documentation

◆ entities

ScenarioInterface::Entities* const ScenarioAgentsPresenter::entities
private

a map translating row indices to scenario agent names

the map of scenario agents (called 'entities' in the XOSC file standard)

Definition at line 118 of file ScenarioAgentsPresenter.h.

The documentation for this class was generated from the following files:
  • ScenarioAgentsPresenter.h
  • ScenarioAgentsPresenter.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ScenarioAgentsPresenter Member List

This is the complete list of members for ScenarioAgentsPresenter, including all inherited members.

_columnHeaders | ScenarioAgentsPresenter | private
columnCount(const QModelIndex &parent=QModelIndex()) const override | ScenarioAgentsPresenter |
data(const QModelIndex &index, int role=Qt::DisplayRole) const override | ScenarioAgentsPresenter |
entities | ScenarioAgentsPresenter | private
headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override | ScenarioAgentsPresenter |
rowCount(const QModelIndex &parent=QModelIndex()) const override | ScenarioAgentsPresenter |
scenarioAgentsList | ScenarioAgentsPresenter | private
update() | ScenarioAgentsPresenter |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioBaseView Class Reference

Public Slots | Public Member Functions | Public Attributes | List of all members
ScenarioBaseView Class Reference

This class provides a resizable container widget for the content of the scenario tab. More...

Inheritance diagram for ScenarioBaseView:
WidgetView

Public Slots

void updateSize ()
Slot which updates the size of this base view such that the child widget (ScenarioView) is visible.

Public Member Functions

void | adjustWidgets (QWidget *mainWindow)
Method which adjusts the positioning and size of the child widget. The size of the child widget is determined as a fraction of the widget size passed as an argument (usually the TrafficSimulationView itself). More...
ScenarioView * | getScenarioView () const
Method which returns the scenario configuration editor widget. More...
- Public Member Functions inherited from WidgetView
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Public Attributes

ScenarioView * scenarioView
A pointer to the scenario configuration widget.

Additional Inherited Members

- Protected Member Functions inherited from WidgetView
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.

Detailed Description

This class provides a resizable container widget for the content of the scenario tab.

The item inserted into this widget is the instance of ScenarioView.

Definition at line 24 of file ScenarioBaseView.h.

Member Function Documentation

◆ adjustWidgets()

void ScenarioBaseView::adjustWidgets ( QWidget * mainWindow )

Method which adjusts the positioning and size of the child widget. The size of the child widget is determined as a fraction of the widget size passed as an argument (usually the TrafficSimulationView itself).

Parameters
[in] mainWindow the widget from which the size of the child widget is derived (usually TrafficSimulationView)

Definition at line 28 of file ScenarioBaseView.cpp.

29 {
30 int x;
31
32 // ajust the position of Scenario View:
33 x= (mainWindow->width() - scenarioView->width() )/2;
34 scenarioView->move(x,30);
35
36 updateSize();
37 }
ScenarioBaseView::updateSize
void updateSize()
Slot which updates the size of this base view such that the child widget (ScenarioView) is visible...
Definition: ScenarioBaseView.cpp:18
ScenarioBaseView::scenarioView
ScenarioView * scenarioView
A pointer to the scenario configuration widget.
Definition: ScenarioBaseView.h:60

◆ getScenarioView()

ScenarioView * ScenarioBaseView::getScenarioView ( ) const

Method which returns the scenario configuration editor widget.

Returns
The scenario configuration editor widget (ScenarioView)

Definition at line 13 of file ScenarioBaseView.cpp.

14 {
15 return scenarioView;
16 }
ScenarioBaseView::scenarioView
ScenarioView * scenarioView
A pointer to the scenario configuration widget.
Definition: ScenarioBaseView.h:60
The documentation for this class was generated from the following files:
  • ScenarioBaseView.h
  • ScenarioBaseView.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ScenarioBaseView Member List

This is the complete list of members for ScenarioBaseView, including all inherited members.

adjustWidgets(QWidget *mainWindow) | ScenarioBaseView |
getScenarioView() const | ScenarioBaseView |
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
scenarioView | ScenarioBaseView |
updateSize() | ScenarioBaseView | slot
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioDisplayPresenter Class Reference

Public Slots | Public Member Functions | Private Attributes | List of all members
ScenarioDisplayPresenter Class Reference

This class defines the presenter which controls the content to be displayed in the ScenarioDisplayView widget. More...

Inherits QObject.

Public Slots

void | setScenarioAgentsView ()
Slot which is called when the map of scenario agents has been edited in the model. Updates the displayed number of scenario agents and triggers a status check.
void | setScenarioFileView ()
Slot which is called when the open scenario filename changed in the model. Updates the displayed scenario filename and triggers a status check.
void | setScenarioNameView ()
Slot which is called when the name of the scenario has changed in the model. Updates the displayed name and triggers a status check.

Public Member Functions

void | setStatus ()
Method which determines the status of the scenario settings. If all necessary configurations are made, the method displays the status "complete" and sets the frame of the display widget to green color. If "incomplete", the frame will be set to red color. Momentarily, the criterion for a complete configuration is that all forms in the ScenarioView widget are filled.
void | updateView ()
Method which sets all displayed values according to the model data. Will be called after loading a combination xml file.

Private Attributes

ProjectInterface *const | project
a pointer to the project interface in order to access the file system
ScenarioInterface * scenario
a pointer to the scenario model (interface) which is read by this presenter
QMap< QString, QList< QString > > | scenarioAgentsList
a map which holds a list of scenario agents (values) for each profiles catalogue (keys)
ScenarioDisplayView * scenarioDisplayView
a pointer to the display view whose content is managed by this presenter

Detailed Description

This class defines the presenter which controls the content to be displayed in the ScenarioDisplayView widget.

Definition at line 30 of file ScenarioDisplayPresenter.h.

The documentation for this class was generated from the following files:
  • ScenarioDisplayPresenter.h
  • ScenarioDisplayPresenter.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ScenarioDisplayPresenter Member List

This is the complete list of members for ScenarioDisplayPresenter, including all inherited members.

project | ScenarioDisplayPresenter | private
scenario | ScenarioDisplayPresenter | private
scenarioAgentsList | ScenarioDisplayPresenter | private
scenarioDisplayView | ScenarioDisplayPresenter | private
setScenarioAgentsView() | ScenarioDisplayPresenter | slot
setScenarioFileView() | ScenarioDisplayPresenter | slot
setScenarioNameView() | ScenarioDisplayPresenter | slot
setStatus() | ScenarioDisplayPresenter |
updateView() | ScenarioDisplayPresenter |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioDisplayView Class Reference

Public Types | Public Member Functions | Private Attributes | List of all members
ScenarioDisplayView Class Reference

This class provides a display for a quick overview of the scenario configuration. More...

Inheritance diagram for ScenarioDisplayView:
WidgetView

Public Types

enum StatusType { StatusType::Error = 0 }

Public Member Functions

void | setScenarioAgents (int scenarioAgents)
Method for setting the number of scenario agents which should be displayed. More...
void | setScenarioFile (QString scenarioFile)
Method for setting the name which should be displayed for the open scenario file. More...
void | setScenarioName (QString name)
Method for setting the name which should be displayed for the scenario. More...
void | setStatus (StatusType status, QString message)
Method which determines the frame color according to the status type passed as a first argument. Further, sets the status message to the second argument. More...
- Public Member Functions inherited from WidgetView
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Private Attributes

QMap< StatusType, QString > | color
a color map which determines the color code according to the status type
Ui::ScenarioDisplayView * | ui
the ui object containing the visualization elements of this display view

Additional Inherited Members

- Protected Member Functions inherited from WidgetView
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.

Detailed Description

This class provides a display for a quick overview of the scenario configuration.

It contains an ui object describing the views appearence (defined in ScenarioDisplayView.ui). This ui object comprises a form layout with labels showing the configuration that has been edited by ScenarioView. The frame of the view can be coloured in order to notify the user whether the configuration is complete or not.

Definition at line 40 of file ScenarioDisplayView.h.

Member Enumeration Documentation

◆ StatusType

enum ScenarioDisplayView::StatusType
strong
Enumerator
Error

enum class for classifying the status (will be used to determine the color of the frame)

Definition at line 45 of file ScenarioDisplayView.h.

45 {
46 Error = 0,
47 OK = 1,
48 Warning = 2
49 };

Member Function Documentation

◆ setScenarioAgents()

void ScenarioDisplayView::setScenarioAgents ( int scenarioAgents )

Method for setting the number of scenario agents which should be displayed.

Parameters
[in] scenarioAgents the number of scenario agents to be displayed

Definition at line 49 of file ScenarioDisplayView.cpp.

50 {
51 ui->ScenarioAgents->setText(QString::number(scenarioAgents));
52 }
ScenarioDisplayView::ui
Ui::ScenarioDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: ScenarioDisplayView.h:89

◆ setScenarioFile()

void ScenarioDisplayView::setScenarioFile ( QString scenarioFile )

Method for setting the name which should be displayed for the open scenario file.

Parameters
[in] scenarioFile the name to be displayed for the open scenario file

Definition at line 44 of file ScenarioDisplayView.cpp.

45 {
46 ui->ScenarioFile->setText(scenarioFile);
47 }
ScenarioDisplayView::ui
Ui::ScenarioDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: ScenarioDisplayView.h:89

◆ setScenarioName()

void ScenarioDisplayView::setScenarioName ( QString name )

Method for setting the name which should be displayed for the scenario.

Parameters
[in] name the name to be displayed for the scenario

Definition at line 39 of file ScenarioDisplayView.cpp.

40 {
41 ui->ScenarioName->setText(name);
42 }
ScenarioDisplayView::ui
Ui::ScenarioDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: ScenarioDisplayView.h:89

◆ setStatus()

void ScenarioDisplayView::setStatus | ( | StatusType | status,
 |  | QString | message
 | ) |  |

Method which determines the frame color according to the status type passed as a first argument. Further, sets the status message to the second argument.

Parameters
[in] | status | the status type (defined in enum class StatusType)
[in] | message | the message to be displayed as a status.

Definition at line 54 of file ScenarioDisplayView.cpp.

55 {
56 // display message on status
57 ui->Status->setText(message);
58
59 // coloring of the frame
60 setStyleSheet(color[status]);
61 }
ScenarioDisplayView::ui
Ui::ScenarioDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: ScenarioDisplayView.h:89
ScenarioDisplayView::color
QMap< StatusType, QString > color
a color map which determines the color code according to the status type
Definition: ScenarioDisplayView.h:88
The documentation for this class was generated from the following files:
  • ScenarioDisplayView.h
  • ScenarioDisplayView.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ScenarioDisplayView Member List

This is the complete list of members for ScenarioDisplayView, including all inherited members.

color | ScenarioDisplayView | private
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
setScenarioAgents(int scenarioAgents) | ScenarioDisplayView |
setScenarioFile(QString scenarioFile) | ScenarioDisplayView |
setScenarioName(QString name) | ScenarioDisplayView |
setStatus(StatusType status, QString message) | ScenarioDisplayView |
StatusType enum name | ScenarioDisplayView |
ui | ScenarioDisplayView | private
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
ScenarioInterface Class Referenceabstract

The Scenario Interface provides setter and getter methods for the combination XML elements related to an Open Scenario File. More...

Inheritance diagram for ScenarioInterface:
ScenarioModel

Public Types

using | CatalogueName = QString
The name of the catalogue in which an agent profile is defined.
using | CatalogueRef = QPair< CatalogueName, EntryName >
A catalogue reference, i.e. a reference to an entry (second) in an agent profiles catalogue (first)
using | Entities = QMap< Name, CatalogueRef >
The mapping of a scenario agent to an agent profile (catalogue reference)
using | EntryName = QString
An entry in the catalogue of agent profiles.
using | Name = QString
The name of the scenario.
using | ScenarioFile = QString
The name of the open scenario file.
using | Status = bool
Type characterizing the status of the scenario settings.

Signals

void | modifiedName ()
Signal, emitted when the name of the scenario has been modified.
void | modifiedScenarioFile ()
Signal, emitted when the open scenario filename has changed.
void | modifiedStatus ()
Signal, emitted when the scenario's status has changed.
void | setEntities ()
Signal, emitted when the entities map of the scenario setup has been set.

Public Member Functions

virtual Entities * | getEntities () const =0
Returns the map (= container class) in which all scenario agents information is registered. This comprises a name of the agent profile (key) and a catalogue reference (value). More...
virtual Name | getName () const =0
Returns the current name of the scenario. More...
virtual ScenarioFile | getScenarioFile () const =0
Returns the current name of the open scenario file to which this scenario setup refers. More...
virtual Status | getStatus () const =0
Method which returns the current status of the scenario settings. More...
virtual void | setName (Name const &newName)=0
Sets the name of the scenario to the given name. More...
virtual void | setScenarioFile (ScenarioFile const &filename)=0
Sets the filename of the open scenario file to the one passed as an argument. More...
virtual void | setStatus (Status const &_status)=0
Method for setting the status of the scenario configuration to the value passed as an argument. More...

Detailed Description

The Scenario Interface provides setter and getter methods for the combination XML elements related to an Open Scenario File.

These comprise the selection of the scenario file itself as well as the selection of the ego agent and other scenario agents.

Definition at line 36 of file ScenarioInterface.h.

Member Function Documentation

◆ getEntities()

virtual Entities* ScenarioInterface::getEntities ( ) const
pure virtual

Returns the map (= container class) in which all scenario agents information is registered. This comprises a name of the agent profile (key) and a catalogue reference (value).

Returns
the map of all scenario agents

Implemented in ScenarioModel.

◆ getName()

virtual Name ScenarioInterface::getName ( ) const
pure virtual

Returns the current name of the scenario.

Returns
the current name of the scenario

Implemented in ScenarioModel.

◆ getScenarioFile()

virtual ScenarioFile ScenarioInterface::getScenarioFile ( ) const
pure virtual

Returns the current name of the open scenario file to which this scenario setup refers.

Returns
the current name of the open scenario file

Implemented in ScenarioModel.

◆ getStatus()

virtual Status ScenarioInterface::getStatus ( ) const
pure virtual

Method which returns the current status of the scenario settings.

Returns
the current status of the scenario configuration

Implemented in ScenarioModel.

◆ setName()

virtual void ScenarioInterface::setName ( Name const & newName )
pure virtual

Sets the name of the scenario to the given name.

Parameters
[in] newName the new name to be adopted for the scenario

Implemented in ScenarioModel.

◆ setScenarioFile()

virtual void ScenarioInterface::setScenarioFile ( ScenarioFile const & filename )
pure virtual

Sets the filename of the open scenario file to the one passed as an argument.

Parameters
[in] filename the new name of the open scenario file

Implemented in ScenarioModel.

◆ setStatus()

virtual void ScenarioInterface::setStatus ( Status const & _status )
pure virtual

Method for setting the status of the scenario configuration to the value passed as an argument.

Parameters
[in] _status the status

Implemented in ScenarioModel.

The documentation for this class was generated from the following file:
  • ScenarioInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ScenarioInterface Member List

This is the complete list of members for ScenarioInterface, including all inherited members.

CatalogueName typedef | ScenarioInterface |
CatalogueRef typedef | ScenarioInterface |
Entities typedef | ScenarioInterface |
EntryName typedef | ScenarioInterface |
getEntities() const =0 | ScenarioInterface | pure virtual
getName() const =0 | ScenarioInterface | pure virtual
getScenarioFile() const =0 | ScenarioInterface | pure virtual
getStatus() const =0 | ScenarioInterface | pure virtual
modifiedName() | ScenarioInterface | signal
modifiedScenarioFile() | ScenarioInterface | signal
modifiedStatus() | ScenarioInterface | signal
Name typedef | ScenarioInterface |
ScenarioFile typedef | ScenarioInterface |
setEntities() | ScenarioInterface | signal
setName(Name const &newName)=0 | ScenarioInterface | pure virtual
setScenarioFile(ScenarioFile const &filename)=0 | ScenarioInterface | pure virtual
setStatus(Status const &_status)=0 | ScenarioInterface | pure virtual
Status typedef | ScenarioInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioModel Class Reference

Public Member Functions | Private Attributes | List of all members
ScenarioModel Class Reference

The Scenario Model class implements the functionality of the ScenarioItemInterface class. More...

Inheritance diagram for ScenarioModel:
ScenarioInterface

Public Member Functions

virtual Entities * | getEntities () const override
Returns the map (= container class) in which all scenario agents information is registered. This comprises a name of the agent profile (key) and a catalogue reference (value). More...
virtual Name | getName () const override
Returns the current name of the scenario. More...
virtual ScenarioFile | getScenarioFile () const override
Returns the current name of the open scenario file to which this scenario setup refers. More...
virtual Status | getStatus () const override
Method which returns the current status of the scenario settings. More...
virtual void | setName (Name const &newName) override
Sets the name of the scenario to the given name. More...
virtual void | setScenarioFile (ScenarioFile const &filename) override
Sets the filename of the open scenario file to the one passed as an argument. More...
virtual void | setStatus (Status const &_status) override
Method for setting the status of the scenario configuration to the value passed as an argument. More...

Private Attributes

Entities *const entities
the map of scenario agents (referred to as 'entities' in the XOSC file standard).
Name name
the name of the scenario configuration
ScenarioFile scenarioFile
the path to the OpenScenario file
Status status
the status of the scenario configuration

Additional Inherited Members

- Public Types inherited from ScenarioInterface
using | CatalogueName = QString
The name of the catalogue in which an agent profile is defined.
using | CatalogueRef = QPair< CatalogueName, EntryName >
A catalogue reference, i.e. a reference to an entry (second) in an agent profiles catalogue (first)
using | Entities = QMap< Name, CatalogueRef >
The mapping of a scenario agent to an agent profile (catalogue reference)
using | EntryName = QString
An entry in the catalogue of agent profiles.
using | Name = QString
The name of the scenario.
using | ScenarioFile = QString
The name of the open scenario file.
using | Status = bool
Type characterizing the status of the scenario settings.
- Signals inherited from ScenarioInterface
void | modifiedName ()
Signal, emitted when the name of the scenario has been modified.
void | modifiedScenarioFile ()
Signal, emitted when the open scenario filename has changed.
void | modifiedStatus ()
Signal, emitted when the scenario's status has changed.
void | setEntities ()
Signal, emitted when the entities map of the scenario setup has been set.

Detailed Description

The Scenario Model class implements the functionality of the ScenarioItemInterface class.

Definition at line 27 of file ScenarioModel.h.

Member Function Documentation

◆ getEntities()

ScenarioInterface::Entities * ScenarioModel::getEntities ( ) const
overridevirtual

Returns the map (= container class) in which all scenario agents information is registered. This comprises a name of the agent profile (key) and a catalogue reference (value).

Returns
the map of all scenario agents

Implements ScenarioInterface.

Definition at line 41 of file ScenarioModel.cpp.

42 {
43 return entities;
44 }
ScenarioModel::entities
Entities *const entities
the map of scenario agents (referred to as &#39;entities&#39; in the XOSC file standard). ...
Definition: ScenarioModel.h:53

◆ getName()

ScenarioInterface::Name ScenarioModel::getName ( ) const
overridevirtual

Returns the current name of the scenario.

Returns
the current name of the scenario

Implements ScenarioInterface.

Definition at line 29 of file ScenarioModel.cpp.

30 {
31 return name;
32 }
ScenarioModel::name
Name name
the name of the scenario configuration
Definition: ScenarioModel.h:51

◆ getScenarioFile()

ScenarioInterface::ScenarioFile ScenarioModel::getScenarioFile ( ) const
overridevirtual

Returns the current name of the open scenario file to which this scenario setup refers.

Returns
the current name of the open scenario file

Implements ScenarioInterface.

Definition at line 46 of file ScenarioModel.cpp.

47 {
48 return scenarioFile;
49 }
ScenarioModel::scenarioFile
ScenarioFile scenarioFile
the path to the OpenScenario file
Definition: ScenarioModel.h:52

◆ getStatus()

ScenarioInterface::Status ScenarioModel::getStatus ( ) const
overridevirtual

Method which returns the current status of the scenario settings.

Returns
the current status of the scenario configuration

Implements ScenarioInterface.

Definition at line 64 of file ScenarioModel.cpp.

65 {
66 return status;
67 }
ScenarioModel::status
Status status
the status of the scenario configuration
Definition: ScenarioModel.h:54

◆ setName()

void ScenarioModel::setName ( Name const & newName )
overridevirtual

Sets the name of the scenario to the given name.

Parameters
[in] newName the new name to be adopted for the scenario

Implements ScenarioInterface.

Definition at line 34 of file ScenarioModel.cpp.

35 {
36 name = newName;
37
38 Q_EMIT modifiedName();
39 }
ScenarioInterface::modifiedName
void modifiedName()
Signal, emitted when the name of the scenario has been modified.
ScenarioModel::name
Name name
the name of the scenario configuration
Definition: ScenarioModel.h:51

◆ setScenarioFile()

void ScenarioModel::setScenarioFile ( ScenarioFile const & filename )
overridevirtual

Sets the filename of the open scenario file to the one passed as an argument.

Parameters
[in] filename the new name of the open scenario file

Implements ScenarioInterface.

Definition at line 51 of file ScenarioModel.cpp.

52 {
53 scenarioFile=filename;
54 Q_EMIT modifiedScenarioFile();
55 }
ScenarioModel::scenarioFile
ScenarioFile scenarioFile
the path to the OpenScenario file
Definition: ScenarioModel.h:52
ScenarioInterface::modifiedScenarioFile
void modifiedScenarioFile()
Signal, emitted when the open scenario filename has changed.

◆ setStatus()

void ScenarioModel::setStatus ( Status const & _status )
overridevirtual

Method for setting the status of the scenario configuration to the value passed as an argument.

Parameters
[in] _status the status

Implements ScenarioInterface.

Definition at line 58 of file ScenarioModel.cpp.

59 {
60 status = _status;
61 Q_EMIT modifiedStatus();
62 }
ScenarioInterface::modifiedStatus
void modifiedStatus()
Signal, emitted when the scenario&#39;s status has changed.
ScenarioModel::status
Status status
the status of the scenario configuration
Definition: ScenarioModel.h:54
The documentation for this class was generated from the following files:
  • ScenarioModel.h
  • ScenarioModel.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ScenarioModel Member List

This is the complete list of members for ScenarioModel, including all inherited members.

CatalogueName typedef | ScenarioInterface |
CatalogueRef typedef | ScenarioInterface |
entities | ScenarioModel | private
Entities typedef | ScenarioInterface |
EntryName typedef | ScenarioInterface |
getEntities() const override | ScenarioModel | virtual
getName() const override | ScenarioModel | virtual
getScenarioFile() const override | ScenarioModel | virtual
getStatus() const override | ScenarioModel | virtual
modifiedName() | ScenarioInterface | signal
modifiedScenarioFile() | ScenarioInterface | signal
modifiedStatus() | ScenarioInterface | signal
name | ScenarioModel | private
Name typedef | ScenarioInterface |
scenarioFile | ScenarioModel | private
ScenarioFile typedef | ScenarioInterface |
setEntities() | ScenarioInterface | signal
setName(Name const &newName) override | ScenarioModel | virtual
setScenarioFile(ScenarioFile const &filename) override | ScenarioModel | virtual
setStatus(Status const &_status) override | ScenarioModel | virtual
status | ScenarioModel | private
Status typedef | ScenarioInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioPresenter Class Reference

Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
ScenarioPresenter Class Reference

This class defines the presenter object which handles user events coming from the view (ScenarioView) and edits the model accordingly (ScenarioInterface). More...

Inherits QObject.

Public Member Functions

void updateView ()
This method sets all display values of the view to the model values. This method is called after loading a combination XML file in order to show the loaded configuration.

Private Slots

void | refreshScenarioFile ()
Slot which refreshes the current scenario file. This means that it checks whether the file exists and updates the lists of defined agent profiles.
void | setName (QString const &name)
Slot which is connected to the ScenarioView::modifiedName signal. It will set the model's value for the scenario name to the one transmitted by the view. More...
void | setScenarioFile ()
Slot which is connected to the ScenarioView::modifiedScenarioFile signal. It will set the model's value for the open scenario filename to the one transmitted by the view. More...

Private Member Functions

void setScenarioAgentsList ()
This method fills the scenarioAgentsList map with all agent profiles referenced in the currently selected scenario file.

Private Attributes

ProjectInterface *const | project
a pointer to the project interface, needed for accessing the configs path
ScenarioInterface * scenario
a pointer to the scenario model whose values are edited by this presenter
QMap< QString, QList< QString > > | scenarioAgentsList
a map which holds a list of scenario agents (values) for each profiles catalogue (keys)
ScenarioAgentsPresenter * scenarioAgentsPresenter
a pointer to the presenter object of the scenario agent map
ScenarioView * scenarioView
a pointer to the scenario view whose events are handled by this presenter
QUndoStack *const | undoStack
a pointer to the undo stack

Detailed Description

This class defines the presenter object which handles user events coming from the view (ScenarioView) and edits the model accordingly (ScenarioInterface).

Definition at line 35 of file ScenarioPresenter.h.

Member Function Documentation

◆ setName

void ScenarioPresenter::setName ( QString const & name )
privateslot

Slot which is connected to the ScenarioView::modifiedName signal. It will set the model's value for the scenario name to the one transmitted by the view.

Parameters
[in] name the scenario name transmitted by the view

Definition at line 39 of file ScenarioPresenter.cpp.

40 {
41 if(scenario->getName()!= name)
42 undoStack->push(new EditScenarioName(scenario, scenarioView,name));
43 }
EditScenarioName
Command class editing the scenario&#39;s name.
Definition: ScenarioPresenter.h:98
ScenarioPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: ScenarioPresenter.h:89
ScenarioPresenter::scenario
ScenarioInterface * scenario
a pointer to the scenario model whose values are edited by this presenter
Definition: ScenarioPresenter.h:86
ScenarioPresenter::scenarioView
ScenarioView * scenarioView
a pointer to the scenario view whose events are handled by this presenter
Definition: ScenarioPresenter.h:87
ScenarioInterface::getName
virtual Name getName() const =0
Returns the current name of the scenario.

◆ setScenarioFile

void ScenarioPresenter::setScenarioFile ( )
privateslot

Slot which is connected to the ScenarioView::modifiedScenarioFile signal. It will set the model's value for the open scenario filename to the one transmitted by the view.

Parameters
[in] filename the open scenario filename transmitted by the view

Definition at line 45 of file ScenarioPresenter.cpp.

46 {
47 QString const filename = QFileDialog::getOpenFileName(
48 scenarioView, QObject::tr("openPASS / Choose OpenScenario File"),
49 project->getConfigPath(), QStringLiteral("OpenScenario File (*.xosc)"));
50
51 if(filename.isEmpty())
52 return;
53
54 else
55 {
56 QString relativePath = project->relativeToConfigPath(filename);
57
58 if(scenario->getScenarioFile()!= relativePath)
59 undoStack->push(new EditScenarioFile(scenario, scenarioView,relativePath));
60 }
61
62 }
ScenarioInterface::getScenarioFile
virtual ScenarioFile getScenarioFile() const =0
Returns the current name of the open scenario file to which this scenario setup refers.
ScenarioPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: ScenarioPresenter.h:89
EditScenarioFile
Command class editing the OpenSCENARIO file.
Definition: ScenarioPresenter.h:121
ScenarioPresenter::project
ProjectInterface *const project
a pointer to the project interface, needed for accessing the configs path
Definition: ScenarioPresenter.h:88
ScenarioPresenter::scenario
ScenarioInterface * scenario
a pointer to the scenario model whose values are edited by this presenter
Definition: ScenarioPresenter.h:86
ScenarioPresenter::scenarioView
ScenarioView * scenarioView
a pointer to the scenario view whose events are handled by this presenter
Definition: ScenarioPresenter.h:87
The documentation for this class was generated from the following files:
  • ScenarioPresenter.h
  • ScenarioPresenter.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ScenarioPresenter Member List

This is the complete list of members for ScenarioPresenter, including all inherited members.

project | ScenarioPresenter | private
refreshScenarioFile() | ScenarioPresenter | privateslot
scenario | ScenarioPresenter | private
scenarioAgentsList | ScenarioPresenter | private
scenarioAgentsPresenter | ScenarioPresenter | private
scenarioView | ScenarioPresenter | private
setName(QString const &name) | ScenarioPresenter | privateslot
setScenarioAgentsList() | ScenarioPresenter | private
setScenarioFile() | ScenarioPresenter | privateslot
undoStack | ScenarioPresenter | private
updateView() | ScenarioPresenter |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: ScenarioView Class Reference

Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
ScenarioView Class Reference

This class provides an editor for configuring the scenario setup, i.e. it is filled with the content stored in an ScenarioInterface instance. More...

Inherits QWidget.

Signals

void | modifiedName (QString const &name)
Signal emitted when the name of the scenario has been modified by the user. Transmits the new name to the presenter.
void | modifiedScenarioFile ()
Signal emitted when the open scenario file shall be modified.
void | refreshScenarioFile ()
Signal emitted when the open scenario file shall be refreshed.

Public Member Functions

QTableView * | getScenarioAgentsView () const
Method for returning the ui 's table widget. Will be passed to the corresponding presenter object containing the QAbstractTableModel. More...
void | setName (QString const &name)
Method which sets the line edit text for the scenario name to the name passed as an argument. More...
void | setScenarioFile (QString const &filename)
Method which sets the line edit text for the open scenario file to the name passed as an argument. More...
void | setScenarioFileError (QString const &message)
Method which sets an error message below the scenario file's line edit. More...

Private Slots

void | on_NameEdit_editingFinished ()
Qt Desinger-created slot activated when the line edit for the scenario name has been edited. Will emit the modifiedName signal.
void | on_ScenarioFileBrowse_clicked ()
Qt Desinger-created slot activated when the Scenario File Browse button is clicked by the user. Will emit the modifiedScenarioFile signal.
void | on_ScenarioFileRefresh_clicked ()
Qt Desinger-created slot activated when the Scenario File Refresh button is clicked by the user. Will emit the refreshScenarioFile signal.

Private Member Functions

bool eventFilter (QObject *watched, QEvent *event)
Reimplementation of the event filter. This filter catches the resize events of the table view in order to resize their columns properly. (Doing it in the resize event of the table view itself did not yield the desired behaviour). More...

Private Attributes

Ui::ScenarioView * ui
the ui object containing the GUI elements of the view

Detailed Description

This class provides an editor for configuring the scenario setup, i.e. it is filled with the content stored in an ScenarioInterface instance.

It contains an ui object describing the views appearance (defined in ScenarioVIew.ui). This ui object comprises a form layout with labels and editing elements for the different attributes of the scenario configuration. User action will lead to signal emissions which are noticed and managed by the corresponding presenter class.

Definition at line 42 of file ScenarioView.h.

Member Function Documentation

◆ eventFilter()

bool ScenarioView::eventFilter | ( | QObject * | watched,
 |  | QEvent * | event
 | ) |  |
private

Reimplementation of the event filter. This filter catches the resize events of the table view in order to resize their columns properly. (Doing it in the resize event of the table view itself did not yield the desired behaviour).

Parameters
[in] | watched | the object whose events should be catched
[in] | event | the event to be catched
Returns
always "false" since the event should never be blocked

Definition at line 64 of file ScenarioView.cpp.

65 {
66 QTableView* table = qobject_cast<QTableView*> (watched);
67
68 if( table && event->type() == QEvent::Resize )
69 {
70 int cell = (table->width())/3;
71 table->setColumnWidth(0, cell);
72 table->setColumnWidth(1, cell);
73 }
74
75 return false;
76 }

◆ getScenarioAgentsView()

QTableView * ScenarioView::getScenarioAgentsView ( ) const

Method for returning the ui 's table widget. Will be passed to the corresponding presenter object containing the QAbstractTableModel.

Returns
the table view for agent profiles

Definition at line 59 of file ScenarioView.cpp.

60 {
61 return ui->ScenarioAgentsView;
62 }
ScenarioView::ui
Ui::ScenarioView * ui
the ui object containing the GUI elements of the view
Definition: ScenarioView.h:135

◆ setName()

void ScenarioView::setName ( QString const & name )

Method which sets the line edit text for the scenario name to the name passed as an argument.

Parameters
[in] name the name which should be displayed

Definition at line 49 of file ScenarioView.cpp.

50 {
51 ui->NameEdit->setText(name);
52 }
ScenarioView::ui
Ui::ScenarioView * ui
the ui object containing the GUI elements of the view
Definition: ScenarioView.h:135

◆ setScenarioFile()

void ScenarioView::setScenarioFile ( QString const & filename )

Method which sets the line edit text for the open scenario file to the name passed as an argument.

Parameters
[in] filename the filename which should be displayed

Definition at line 54 of file ScenarioView.cpp.

55 {
56 ui->ScenarioFileEdit->setText(filename);
57 }
ScenarioView::ui
Ui::ScenarioView * ui
the ui object containing the GUI elements of the view
Definition: ScenarioView.h:135

◆ setScenarioFileError()

void ScenarioView::setScenarioFileError ( QString const & message )

Method which sets an error message below the scenario file's line edit.

Parameters
[in] message the error message to be displayed

Definition at line 78 of file ScenarioView.cpp.

79 {
80 ui->ScenarioFileError->setText(message);
81 }
ScenarioView::ui
Ui::ScenarioView * ui
the ui object containing the GUI elements of the view
Definition: ScenarioView.h:135
The documentation for this class was generated from the following files:
  • ScenarioView.h
  • ScenarioView.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

ScenarioView Member List

This is the complete list of members for ScenarioView, including all inherited members.

eventFilter(QObject *watched, QEvent *event) | ScenarioView | private
getScenarioAgentsView() const | ScenarioView |
modifiedName(QString const &name) | ScenarioView | signal
modifiedScenarioFile() | ScenarioView | signal
on_NameEdit_editingFinished() | ScenarioView | privateslot
on_ScenarioFileBrowse_clicked() | ScenarioView | privateslot
on_ScenarioFileRefresh_clicked() | ScenarioView | privateslot
refreshScenarioFile() | ScenarioView | signal
setName(QString const &name) | ScenarioView |
setScenarioFile(QString const &filename) | ScenarioView |
setScenarioFileError(QString const &message) | ScenarioView |
ui | ScenarioView | private
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorItemInterface Class Reference

Public Types | Public Member Functions | List of all members
SensorItemInterface Class Referenceabstract

The SensorItemInterface class combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to a sensor data object. More...

Inheritance diagram for SensorItemInterface:
SensorItemModel

Public Types

using | ID = unsigned int
typedef for the sensor's key identifier
using | Profile = SensorProfileItemInterface
tpedef for the sensor profile

Public Member Functions

virtual ID | getID () const =0
Method which returns the id of this sensor, if this sensor is registered in a map (SensorMapInterface). Otherwise, an empty id is returned. More...
virtual SensorPosition | getSensorPosition () const =0
Method which returns the position of the sensor. More...
virtual Profile * | getSensorProfile () const =0
Method which returns the sensor profile which is currently used. More...
virtual void | setSensorPosition (SensorPosition const &position)=0
Method which sets the position of the sensor to the one passed as an argument. More...
virtual void | setSensorProfile (Profile *const _profile)=0
Method which sets the sensor profile to the one passed as an argument. More...

Detailed Description

The SensorItemInterface class combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to a sensor data object.

Definition at line 56 of file SensorItemInterface.h.

Member Function Documentation

◆ getID()

virtual ID SensorItemInterface::getID ( ) const
pure virtual

Method which returns the id of this sensor, if this sensor is registered in a map (SensorMapInterface). Otherwise, an empty id is returned.

Returns
the id of this sensor

Implemented in SensorItemModel.

◆ getSensorPosition()

virtual SensorPosition SensorItemInterface::getSensorPosition ( ) const
pure virtual

Method which returns the position of the sensor.

Returns
the sensor's position structure

Implemented in SensorItemModel.

◆ getSensorProfile()

virtual Profile* SensorItemInterface::getSensorProfile ( ) const
pure virtual

Method which returns the sensor profile which is currently used.

Returns
the sensor profile in use

Implemented in SensorItemModel.

◆ setSensorPosition()

virtual void SensorItemInterface::setSensorPosition ( SensorPosition const & position )
pure virtual

Method which sets the position of the sensor to the one passed as an argument.

Parameters
[in] the new sensor position structure

Implemented in SensorItemModel.

◆ setSensorProfile()

virtual void SensorItemInterface::setSensorProfile ( Profile *const _profile )
pure virtual

Method which sets the sensor profile to the one passed as an argument.

Parameters
[in] the new sensor profile

Implemented in SensorItemModel.

The documentation for this class was generated from the following file:
  • SensorItemInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SensorItemInterface Member List

This is the complete list of members for SensorItemInterface, including all inherited members.

getID() const =0 | SensorItemInterface | pure virtual
getSensorPosition() const =0 | SensorItemInterface | pure virtual
getSensorProfile() const =0 | SensorItemInterface | pure virtual
ID typedef | SensorItemInterface |
Profile typedef | SensorItemInterface |
setSensorPosition(SensorPosition const &position)=0 | SensorItemInterface | pure virtual
setSensorProfile(Profile *const _profile)=0 | SensorItemInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorItemModel Class Reference

Public Member Functions | Private Attributes | Static Private Attributes | List of all members
SensorItemModel Class Reference

This class implements the functionality of SensorItemInterface. More...

Inheritance diagram for SensorItemModel:
SensorItemInterface

Public Member Functions

virtual ID | getID () const override
Method which returns the id of this sensor, if this sensor is registered in a map (SensorMapInterface). Otherwise, an empty id is returned. More...
virtual SensorPosition | getSensorPosition () const override
Method which returns the position of the sensor. More...
virtual Profile * | getSensorProfile () const override
Method which returns the sensor profile which is currently used. More...
virtual void | setSensorPosition (SensorPosition const &_position) override
Method which sets the position of the sensor to the one passed as an argument. More...
virtual void | setSensorProfile (Profile *const _profile) override
Method which sets the sensor profile to the one passed as an argument. More...

Private Attributes

SensorPosition position
the structure for storing sensor positioning data
Profile * profile
the pointer to the sensor's profile

Static Private Attributes

static SensorPosition default_position ={ QString("Default"), .0, 0.0, 0.0, 0.0, 0.0, 0.0}
the default position structure

Additional Inherited Members

- Public Types inherited from SensorItemInterface
using | ID = unsigned int
typedef for the sensor's key identifier
using | Profile = SensorProfileItemInterface
tpedef for the sensor profile

Detailed Description

This class implements the functionality of SensorItemInterface.

Definition at line 25 of file SensorItemModel.h.

Member Function Documentation

◆ getID()

SensorItemInterface::ID SensorItemModel::getID ( ) const
overridevirtual

Method which returns the id of this sensor, if this sensor is registered in a map (SensorMapInterface). Otherwise, an empty id is returned.

Returns
the id of this sensor

Implements SensorItemInterface.

Definition at line 46 of file SensorItemModel.cpp.

47 {
48 SensorMapInterface const * const map = qobject_cast<SensorMapInterface const * const > ( parent() );
49
50 return ( (map) ? map->getID( const_cast<SensorItemModel *> (this) ) : SensorItemInterface::ID() );
51 }
SensorMapInterface::getID
virtual SensorMapInterface::ID getID(SensorMapInterface::Item *const item) const =0
Method wich returns the id of the given sensor data object, if contained in the map. Otherwise an empty id is returned.
SensorMapInterface
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are ...
Definition: SensorMapInterface.h:36
SensorItemInterface::ID
unsigned int ID
typedef for the sensor&#39;s key identifier
Definition: SensorItemInterface.h:62

◆ getSensorPosition()

SensorPosition SensorItemModel::getSensorPosition ( ) const
overridevirtual

Method which returns the position of the sensor.

Returns
the sensor's position structure

Implements SensorItemInterface.

Definition at line 25 of file SensorItemModel.cpp.

26 {
27 return position;
28 }
SensorItemModel::position
SensorPosition position
the structure for storing sensor positioning data
Definition: SensorItemModel.h:43

◆ getSensorProfile()

SensorItemInterface::Profile * SensorItemModel::getSensorProfile ( ) const
overridevirtual

Method which returns the sensor profile which is currently used.

Returns
the sensor profile in use

Implements SensorItemInterface.

Definition at line 35 of file SensorItemModel.cpp.

36 {
37 return profile;
38 }
SensorItemModel::profile
Profile * profile
the pointer to the sensor&#39;s profile
Definition: SensorItemModel.h:44

◆ setSensorPosition()

void SensorItemModel::setSensorPosition ( SensorPosition const & position )
overridevirtual

Method which sets the position of the sensor to the one passed as an argument.

Parameters
[in] the new sensor position structure

Implements SensorItemInterface.

Definition at line 30 of file SensorItemModel.cpp.

31 {
32 position = _position;
33 }
SensorItemModel::position
SensorPosition position
the structure for storing sensor positioning data
Definition: SensorItemModel.h:43

◆ setSensorProfile()

void SensorItemModel::setSensorProfile ( Profile *const _profile )
overridevirtual

Method which sets the sensor profile to the one passed as an argument.

Parameters
[in] the new sensor profile

Implements SensorItemInterface.

Definition at line 40 of file SensorItemModel.cpp.

41 {
42 profile=_profile;
43 }
SensorItemModel::profile
Profile * profile
the pointer to the sensor&#39;s profile
Definition: SensorItemModel.h:44
The documentation for this class was generated from the following files:
  • SensorItemModel.h
  • SensorItemModel.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SensorItemModel Member List

This is the complete list of members for SensorItemModel, including all inherited members.

default_position | SensorItemModel | privatestatic
getID() const override | SensorItemModel | virtual
getSensorPosition() const override | SensorItemModel | virtual
getSensorProfile() const override | SensorItemModel | virtual
ID typedef | SensorItemInterface |
position | SensorItemModel | private
profile | SensorItemModel | private
Profile typedef | SensorItemInterface |
setSensorPosition(SensorPosition const &_position) override | SensorItemModel | virtual
setSensorProfile(Profile *const _profile) override | SensorItemModel | virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorMapInterface Class Reference

Public Types | Public Member Functions | List of all members
SensorMapInterface Class Referenceabstract

This class constitutes a container class in which sensor data (instances of SensorItemInterface) are registered. It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...

Inheritance diagram for SensorMapInterface:
SensorMapModel

Public Types

using | ConstIterator = Map::ConstIterator
typedef for a constant iterator (read-only operations)
using | ID = SensorItemInterface::ID
typedef for the id of the sensor data object
using | Item = SensorItemInterface
typedef for the sensor data object
using | Iterator = Map::Iterator
typedef for an iterator
using | Map = QMap< ID, Item * >
typedef for the map of sensor data

Public Member Functions

virtual bool | add (SensorMapInterface::ID const &id)=0
Method which creates a sensor data object (instance of SensorItemInterface) and adds it to the map under the given id. More...
virtual bool | add (SensorMapInterface::Item *const item)=0
Method which adds the given sensor data object (instance of SensorItemInterface) to the map under an automatically generated id. More...
virtual SensorMapInterface::Iterator | begin ()=0
Gets an iterator pointing to the first sensor data object in the map. More...
virtual void | clear ()=0
Method which deletes all sensor data objects and clears the map.
virtual SensorMapInterface::ConstIterator | constBegin () const =0
Gets an iterator pointing to the first sensor data object in the map (use for read-only since pointing at constant values). More...
virtual SensorMapInterface::ConstIterator | constEnd () const =0
Gets an iterator pointing at the end of the map after the last sensor data object (use for read-only). More...
virtual bool | contains (SensorMapInterface::ID const &id) const =0
Method wich checks whether the map contains a sensor data object of the given id. More...
virtual int | count () const =0
Method which returns the number of items in the map. More...
virtual SensorMapInterface::Iterator | end ()=0
Gets an iterator pointing to the end of the map after the last dsensor data object. More...
virtual SensorMapInterface::ID | generateID ()=0
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the maximum of all occupied ids. More...
virtual SensorMapInterface::ID | getID (SensorMapInterface::Item *const item) const =0
Method wich returns the id of the given sensor data object, if contained in the map. Otherwise an empty id is returned. More...
virtual SensorMapInterface::Item * | getItem (SensorMapInterface::ID const &id) const =0
Method which returns a pointer to the sensor data object specified by the given id. If the map does not contain an object with the given id, nullptr is returned. More...
virtual QList< ID > | keys () const =0
Method which returns the list of all ids used in the map. More...
virtual bool | remove (SensorMapInterface::ID const &id)=0
Method which removes the sensor data object with the given id from the map. The object is deleted after removing. Nothing will be done if there is no such object. More...
virtual bool | remove (SensorMapInterface::Item *const item)=0
Method which removes the given sensor data object from the map. The object is deleted after removing. Nothing will be done if the object is not in the map. More...
virtual void | setID (SensorMapInterface::Item *const item, SensorMapInterface::ID const &id)=0
Method wich changes the id of the given sensor data object to the one passed as second argument. More...
virtual QList< Item * > | values () const =0
Method which returns the list of all sensor data objects registered in this map. More...

Detailed Description

This class constitutes a container class in which sensor data (instances of SensorItemInterface) are registered. It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.

Definition at line 36 of file SensorMapInterface.h.

Member Function Documentation

◆ add() [1/2]

virtual bool SensorMapInterface::add ( SensorMapInterface::ID const & id )
pure virtual

Method which creates a sensor data object (instance of SensorItemInterface) and adds it to the map under the given id.

Parameters
[in] id the id under which the newly created item is registered
Returns
"true", if id is not used already, otherwise "false"

Implemented in SensorMapModel.

◆ add() [2/2]

virtual bool SensorMapInterface::add ( SensorMapInterface::Item *const item )
pure virtual

Method which adds the given sensor data object (instance of SensorItemInterface) to the map under an automatically generated id.

Parameters
[in] item the sensor data object to be registered in this map
Returns
"true", if name is not used already, otherwise "false"

Implemented in SensorMapModel.

◆ begin()

virtual SensorMapInterface::Iterator SensorMapInterface::begin ( )
pure virtual

Gets an iterator pointing to the first sensor data object in the map.

Returns
The iterator pointing at the first object in the map.

Implemented in SensorMapModel.

◆ constBegin()

virtual SensorMapInterface::ConstIterator SensorMapInterface::constBegin ( ) const
pure virtual

Gets an iterator pointing to the first sensor data object in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implemented in SensorMapModel.

◆ constEnd()

virtual SensorMapInterface::ConstIterator SensorMapInterface::constEnd ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last sensor data object (use for read-only).

Returns
The iterator pointing at the end of the map.

Implemented in SensorMapModel.

◆ contains()

virtual bool SensorMapInterface::contains ( SensorMapInterface::ID const & id ) const
pure virtual

Method wich checks whether the map contains a sensor data object of the given id.

Parameters
[in] id the id to be searched for
Returns
true, if sensor data object with given id exists, otherwise false.

Implemented in SensorMapModel.

◆ count()

virtual int SensorMapInterface::count ( ) const
pure virtual

Method which returns the number of items in the map.

Returns
the number of items in the map

Implemented in SensorMapModel.

◆ end()

virtual SensorMapInterface::Iterator SensorMapInterface::end ( )
pure virtual

Gets an iterator pointing to the end of the map after the last dsensor data object.

Returns
The iterator pointing at the end of the map.

Implemented in SensorMapModel.

◆ generateID()

virtual SensorMapInterface::ID SensorMapInterface::generateID ( )
pure virtual

Method wich generates an unoccupied id for this map. The generated id will be by one larger than the maximum of all occupied ids.

Returns
an unoccupied id for this map

Implemented in SensorMapModel.

◆ getID()

virtual SensorMapInterface::ID SensorMapInterface::getID ( SensorMapInterface::Item *const item ) const
pure virtual

Method wich returns the id of the given sensor data object, if contained in the map. Otherwise an empty id is returned.

Parameters
[in] item the pointer to the sensor data object in question
Returns
the id of the object. Empty id if object is not in the map

Implemented in SensorMapModel.

◆ getItem()

virtual SensorMapInterface::Item* SensorMapInterface::getItem ( SensorMapInterface::ID const & id ) const
pure virtual

Method which returns a pointer to the sensor data object specified by the given id. If the map does not contain an object with the given id, nullptr is returned.

Parameters
[in] id the id of the sensor data object to be returned
Returns
the pointer to the sensor data object having the given id, nullptr if given id does not exist

Implemented in SensorMapModel.

◆ keys()

virtual QList<ID> SensorMapInterface::keys ( ) const
pure virtual

Method which returns the list of all ids used in the map.

Returns
the list of all ids used in the map

Implemented in SensorMapModel.

◆ remove() [1/2]

virtual bool SensorMapInterface::remove ( SensorMapInterface::ID const & id )
pure virtual

Method which removes the sensor data object with the given id from the map. The object is deleted after removing. Nothing will be done if there is no such object.

Parameters
[in] id the id of the object to be removed
Returns
"true", if id exists in the map, otherwise "false"

Implemented in SensorMapModel.

◆ remove() [2/2]

virtual bool SensorMapInterface::remove ( SensorMapInterface::Item *const item )
pure virtual

Method which removes the given sensor data object from the map. The object is deleted after removing. Nothing will be done if the object is not in the map.

Parameters
[in] item the sensor data object to be removed
Returns
"true", if item exists in the map, otherwise "false"

Implemented in SensorMapModel.

◆ setID()

virtual void SensorMapInterface::setID | ( | SensorMapInterface::Item *const | item,
 |  | SensorMapInterface::ID const & | id
 | ) |  |
pure virtual

Method wich changes the id of the given sensor data object to the one passed as second argument.

Parameters
[in] | item | the pointer to a sensor data object
[in] | id | the new id to be used for it

Implemented in SensorMapModel.

◆ values()

virtual QList<Item*> SensorMapInterface::values ( ) const
pure virtual

Method which returns the list of all sensor data objects registered in this map.

Returns
the list of all sensor data objects registered in this map.

Implemented in SensorMapModel.

The documentation for this class was generated from the following file:
  • SensorMapInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SensorMapInterface Member List

This is the complete list of members for SensorMapInterface, including all inherited members.

add(SensorMapInterface::ID const &id)=0 | SensorMapInterface | pure virtual
add(SensorMapInterface::Item *const item)=0 | SensorMapInterface | pure virtual
begin()=0 | SensorMapInterface | pure virtual
clear()=0 | SensorMapInterface | pure virtual
constBegin() const =0 | SensorMapInterface | pure virtual
constEnd() const =0 | SensorMapInterface | pure virtual
ConstIterator typedef | SensorMapInterface |
contains(SensorMapInterface::ID const &id) const =0 | SensorMapInterface | pure virtual
count() const =0 | SensorMapInterface | pure virtual
end()=0 | SensorMapInterface | pure virtual
generateID()=0 | SensorMapInterface | pure virtual
getID(SensorMapInterface::Item *const item) const =0 | SensorMapInterface | pure virtual
getItem(SensorMapInterface::ID const &id) const =0 | SensorMapInterface | pure virtual
ID typedef | SensorMapInterface |
Item typedef | SensorMapInterface |
Iterator typedef | SensorMapInterface |
keys() const =0 | SensorMapInterface | pure virtual
Map typedef | SensorMapInterface |
remove(SensorMapInterface::ID const &id)=0 | SensorMapInterface | pure virtual
remove(SensorMapInterface::Item *const item)=0 | SensorMapInterface | pure virtual
setID(SensorMapInterface::Item *const item, SensorMapInterface::ID const &id)=0 | SensorMapInterface | pure virtual
values() const =0 | SensorMapInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorMapModel Class Reference

Public Member Functions | Private Attributes | List of all members
SensorMapModel Class Reference

This class implements the functionality of SensorMapInterface. More...

Inheritance diagram for SensorMapModel:
SensorMapInterface

Public Member Functions

virtual bool | add (SensorMapInterface::ID const &id) override
Method which creates a sensor data object (instance of SensorItemInterface) and adds it to the map under the given id. More...
virtual bool | add (SensorMapInterface::Item *const item) override
Method which adds the given sensor data object (instance of SensorItemInterface) to the map under an automatically generated id. More...
virtual SensorMapInterface::Iterator | begin () override
Gets an iterator pointing to the first sensor data object in the map. More...
virtual void | clear () override
Method which deletes all sensor data objects and clears the map.
virtual SensorMapInterface::ConstIterator | constBegin () const override
Gets an iterator pointing to the first sensor data object in the map (use for read-only since pointing at constant values). More...
virtual SensorMapInterface::ConstIterator | constEnd () const override
Gets an iterator pointing at the end of the map after the last sensor data object (use for read-only). More...
virtual bool | contains (SensorMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor data object of the given id. More...
virtual int | count () const override
Method which returns the number of items in the map. More...
virtual SensorMapInterface::Iterator | end () override
Gets an iterator pointing to the end of the map after the last dsensor data object. More...
virtual SensorMapInterface::ID | generateID () override
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the maximum of all occupied ids. More...
virtual SensorMapInterface::ID | getID (SensorMapInterface::Item *const item) const override
Method wich returns the id of the given sensor data object, if contained in the map. Otherwise an empty id is returned. More...
virtual SensorMapInterface::Item * | getItem (SensorMapInterface::ID const &id) const override
Method which returns a pointer to the sensor data object specified by the given id. If the map does not contain an object with the given id, nullptr is returned. More...
virtual QList< ID > | keys () const override
Method which returns the list of all ids used in the map. More...
virtual bool | remove (SensorMapInterface::ID const &id) override
Method which removes the sensor data object with the given id from the map. The object is deleted after removing. Nothing will be done if there is no such object. More...
virtual bool | remove (SensorMapInterface::Item *const item) override
Method which removes the given sensor data object from the map. The object is deleted after removing. Nothing will be done if the object is not in the map. More...
virtual void | setID (SensorMapInterface::Item *const item, SensorMapInterface::ID const &id) override
Method wich changes the id of the given sensor data object to the one passed as second argument. More...
virtual QList< Item * > | values () const override
Method which returns the list of all sensor data objects registered in this map. More...

Private Attributes

SensorMapInterface::Map sensors
the map (container) for registering sensor data

Additional Inherited Members

- Public Types inherited from SensorMapInterface
using | ConstIterator = Map::ConstIterator
typedef for a constant iterator (read-only operations)
using | ID = SensorItemInterface::ID
typedef for the id of the sensor data object
using | Item = SensorItemInterface
typedef for the sensor data object
using | Iterator = Map::Iterator
typedef for an iterator
using | Map = QMap< ID, Item * >
typedef for the map of sensor data

Detailed Description

This class implements the functionality of SensorMapInterface.

Definition at line 25 of file SensorMapModel.h.

Member Function Documentation

◆ add() [1/2]

bool SensorMapModel::add ( SensorMapInterface::ID const & id )
overridevirtual

Method which creates a sensor data object (instance of SensorItemInterface) and adds it to the map under the given id.

Parameters
[in] id the id under which the newly created item is registered
Returns
"true", if id is not used already, otherwise "false"

Implements SensorMapInterface.

Definition at line 42 of file SensorMapModel.cpp.

43 {
44 if(!contains(id))
45 {
46 sensors.insert(id, new SensorItemModel(this));
47 return true;
48 }
49
50 return false;
51 }
SensorItemModel
This class implements the functionality of SensorItemInterface.
Definition: SensorItemModel.h:25
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73
SensorMapModel::contains
virtual bool contains(SensorMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor data object of the given id. ...
Definition: SensorMapModel.cpp:129

◆ add() [2/2]

bool SensorMapModel::add ( SensorMapInterface::Item *const item )
overridevirtual

Method which adds the given sensor data object (instance of SensorItemInterface) to the map under an automatically generated id.

Parameters
[in] item the sensor data object to be registered in this map
Returns
"true", if name is not used already, otherwise "false"

Implements SensorMapInterface.

Definition at line 53 of file SensorMapModel.cpp.

54 {
55 SensorMapInterface::ID id = generateID();
56
57 if(!contains(id))
58 {
59 sensors.insert(id, item);
60 item->setParent(this);
61 return true;
62 }
63
64 return false;
65 }
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73
SensorMapModel::contains
virtual bool contains(SensorMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor data object of the given id. ...
Definition: SensorMapModel.cpp:129
SensorMapModel::generateID
virtual SensorMapInterface::ID generateID() override
Method wich generates an unoccupied id for this map. The generated id will be by one larger than the ...
Definition: SensorMapModel.cpp:116
SensorMapInterface::ID
SensorItemInterface::ID ID
typedef for the id of the sensor data object
Definition: SensorMapInterface.h:42

◆ begin()

SensorMapInterface::Iterator SensorMapModel::begin ( )
overridevirtual

Gets an iterator pointing to the first sensor data object in the map.

Returns
The iterator pointing at the first object in the map.

Implements SensorMapInterface.

Definition at line 21 of file SensorMapModel.cpp.

22 {
23 return sensors.begin();
24 }
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73

◆ constBegin()

SensorMapInterface::ConstIterator SensorMapModel::constBegin ( ) const
overridevirtual

Gets an iterator pointing to the first sensor data object in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implements SensorMapInterface.

Definition at line 26 of file SensorMapModel.cpp.

27 {
28 return sensors.constBegin();
29 }
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73

◆ constEnd()

SensorMapInterface::ConstIterator SensorMapModel::constEnd ( ) const
overridevirtual

Gets an iterator pointing at the end of the map after the last sensor data object (use for read-only).

Returns
The iterator pointing at the end of the map.

Implements SensorMapInterface.

Definition at line 36 of file SensorMapModel.cpp.

37 {
38 return sensors.constEnd();
39 }
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73

◆ contains()

bool SensorMapModel::contains ( SensorMapInterface::ID const & id ) const
overridevirtual

Method wich checks whether the map contains a sensor data object of the given id.

Parameters
[in] id the id to be searched for
Returns
true, if sensor data object with given id exists, otherwise false.

Implements SensorMapInterface.

Definition at line 129 of file SensorMapModel.cpp.

130 {
131 return sensors.contains(id);
132 }
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73

◆ count()

int SensorMapModel::count ( ) const
overridevirtual

Method which returns the number of items in the map.

Returns
the number of items in the map

Implements SensorMapInterface.

Definition at line 144 of file SensorMapModel.cpp.

145 {
146 return sensors.count();
147 }
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73

◆ end()

SensorMapInterface::Iterator SensorMapModel::end ( )
overridevirtual

Gets an iterator pointing to the end of the map after the last dsensor data object.

Returns
The iterator pointing at the end of the map.

Implements SensorMapInterface.

Definition at line 31 of file SensorMapModel.cpp.

32 {
33 return sensors.end();
34 }
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73

◆ generateID()

SensorMapInterface::ID SensorMapModel::generateID ( )
overridevirtual

Method wich generates an unoccupied id for this map. The generated id will be by one larger than the maximum of all occupied ids.

Returns
an unoccupied id for this map

Implements SensorMapInterface.

Definition at line 116 of file SensorMapModel.cpp.

117 {
118 SensorMapInterface::ID id = 1;
119 for (SensorMapInterface::ID key : sensors.keys())
120 {
121 if (id <= key)
122 {
123 id = key + 1;
124 }
125 }
126 return id;
127 }
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73
SensorMapInterface::ID
SensorItemInterface::ID ID
typedef for the id of the sensor data object
Definition: SensorMapInterface.h:42

◆ getID()

SensorMapInterface::ID SensorMapModel::getID ( SensorMapInterface::Item *const item ) const
overridevirtual

Method wich returns the id of the given sensor data object, if contained in the map. Otherwise an empty id is returned.

Parameters
[in] item the pointer to the sensor data object in question
Returns
the id of the object. Empty id if object is not in the map

Implements SensorMapInterface.

Definition at line 101 of file SensorMapModel.cpp.

102 {
103 return sensors.key(item);
104 }
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73

◆ getItem()

SensorMapInterface::Item * SensorMapModel::getItem ( SensorMapInterface::ID const & id ) const
overridevirtual

Method which returns a pointer to the sensor data object specified by the given id. If the map does not contain an object with the given id, nullptr is returned.

Parameters
[in] id the id of the sensor data object to be returned
Returns
the pointer to the sensor data object having the given id, nullptr if given id does not exist

Implements SensorMapInterface.

Definition at line 92 of file SensorMapModel.cpp.

93 {
94 if(contains(id))
95 return sensors.value(id);
96
97 return nullptr;
98 }
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73
SensorMapModel::contains
virtual bool contains(SensorMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor data object of the given id. ...
Definition: SensorMapModel.cpp:129

◆ keys()

QList< SensorMapInterface::ID > SensorMapModel::keys ( ) const
overridevirtual

Method which returns the list of all ids used in the map.

Returns
the list of all ids used in the map

Implements SensorMapInterface.

Definition at line 134 of file SensorMapModel.cpp.

135 {
136 return sensors.keys();
137 }
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73

◆ remove() [1/2]

bool SensorMapModel::remove ( SensorMapInterface::ID const & id )
overridevirtual

Method which removes the sensor data object with the given id from the map. The object is deleted after removing. Nothing will be done if there is no such object.

Parameters
[in] id the id of the object to be removed
Returns
"true", if id exists in the map, otherwise "false"

Implements SensorMapInterface.

Definition at line 67 of file SensorMapModel.cpp.

68 {
69 if(contains(id))
70 {
71 delete sensors.take(id);
72 return true;
73 }
74
75 return false;
76 }
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73
SensorMapModel::contains
virtual bool contains(SensorMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor data object of the given id. ...
Definition: SensorMapModel.cpp:129

◆ remove() [2/2]

bool SensorMapModel::remove ( SensorMapInterface::Item *const item )
overridevirtual

Method which removes the given sensor data object from the map. The object is deleted after removing. Nothing will be done if the object is not in the map.

Parameters
[in] item the sensor data object to be removed
Returns
"true", if item exists in the map, otherwise "false"

Implements SensorMapInterface.

Definition at line 79 of file SensorMapModel.cpp.

80 {
81
82 if(sensors.values().contains(item) )
83 {
84 SensorItemInterface::ID id = getID(item);
85 delete sensors.take(id);
86 return true;
87 }
88
89 return false;
90 }
SensorMapModel::getID
virtual SensorMapInterface::ID getID(SensorMapInterface::Item *const item) const override
Method wich returns the id of the given sensor data object, if contained in the map. Otherwise an empty id is returned.
Definition: SensorMapModel.cpp:101
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73
SensorItemInterface::ID
unsigned int ID
typedef for the sensor&#39;s key identifier
Definition: SensorItemInterface.h:62

◆ setID()

void SensorMapModel::setID | ( | SensorMapInterface::Item *const | item,
 |  | SensorMapInterface::ID const & | id
 | ) |  |
overridevirtual

Method wich changes the id of the given sensor data object to the one passed as second argument.

Parameters
[in] | item | the pointer to a sensor data object
[in] | id | the new id to be used for it

Implements SensorMapInterface.

Definition at line 106 of file SensorMapModel.cpp.

108 {
109
110 SensorMapInterface::ID oldID = getID(item);
111
112 sensors.take(oldID);
113 sensors.insert(id, item);
114 }
SensorMapModel::getID
virtual SensorMapInterface::ID getID(SensorMapInterface::Item *const item) const override
Method wich returns the id of the given sensor data object, if contained in the map. Otherwise an empty id is returned.
Definition: SensorMapModel.cpp:101
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73
SensorMapInterface::ID
SensorItemInterface::ID ID
typedef for the id of the sensor data object
Definition: SensorMapInterface.h:42

◆ values()

QList< SensorItemInterface * > SensorMapModel::values ( ) const
overridevirtual

Method which returns the list of all sensor data objects registered in this map.

Returns
the list of all sensor data objects registered in this map.

Implements SensorMapInterface.

Definition at line 139 of file SensorMapModel.cpp.

140 {
141 return sensors.values();
142 }
SensorMapModel::sensors
SensorMapInterface::Map sensors
the map (container) for registering sensor data
Definition: SensorMapModel.h:73
The documentation for this class was generated from the following files:
  • SensorMapModel.h
  • SensorMapModel.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SensorMapModel Member List

This is the complete list of members for SensorMapModel, including all inherited members.

add(SensorMapInterface::ID const &id) override | SensorMapModel | virtual
add(SensorMapInterface::Item *const item) override | SensorMapModel | virtual
begin() override | SensorMapModel | virtual
clear() override | SensorMapModel | virtual
constBegin() const override | SensorMapModel | virtual
constEnd() const override | SensorMapModel | virtual
ConstIterator typedef | SensorMapInterface |
contains(SensorMapInterface::ID const &id) const override | SensorMapModel | virtual
count() const override | SensorMapModel | virtual
end() override | SensorMapModel | virtual
generateID() override | SensorMapModel | virtual
getID(SensorMapInterface::Item *const item) const override | SensorMapModel | virtual
getItem(SensorMapInterface::ID const &id) const override | SensorMapModel | virtual
ID typedef | SensorMapInterface |
Item typedef | SensorMapInterface |
Iterator typedef | SensorMapInterface |
keys() const override | SensorMapModel | virtual
Map typedef | SensorMapInterface |
remove(SensorMapInterface::ID const &id) override | SensorMapModel | virtual
remove(SensorMapInterface::Item *const item) override | SensorMapModel | virtual
sensors | SensorMapModel | private
setID(SensorMapInterface::Item *const item, SensorMapInterface::ID const &id) override | SensorMapModel | virtual
values() const override | SensorMapModel | virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileItemInterface Class Reference

Public Types | Public Member Functions | List of all members
SensorProfileItemInterface Class Referenceabstract

This class defines objects containing all relevant information on sensor profiles. More...

Inheritance diagram for SensorProfileItemInterface:
SensorProfileItemModel

Public Types

using | ID = QPair< Name, Type >
typedef for the identifier of a sensor profile, i.e. its name and type
using | Name = QString
typedef for the sensor profile's name
using | Parameters = ParameterMapInterface
typedef for the sensor profile's parameters
using | Type = QString
typedef for the sensor's type (implementation)

Public Member Functions

virtual ID | getID () const =0
Method which returns the identifier of the sensor profile, i.e. the pair of name and type. More...
virtual Name | getName () const =0
Method which returns the name of the sensor profile. More...
virtual Parameters * | getParameters () const =0
Method which returns the parameter map of this sensor profile (instance of ParameterMapInterface). More...
virtual Type | getType () const =0
Method which returns the type (implementation) of the sensor adressed by this profile. More...

Detailed Description

This class defines objects containing all relevant information on sensor profiles.

In particular, the name, the type descibing the sensor's implementation and all parameters constitute a sensor profile addressed by this class.

Definition at line 36 of file SensorProfileItemInterface.h.

Member Function Documentation

◆ getID()

virtual ID SensorProfileItemInterface::getID ( ) const
pure virtual

Method which returns the identifier of the sensor profile, i.e. the pair of name and type.

Returns
the identifier of the sensor profile

Implemented in SensorProfileItemModel.

◆ getName()

virtual Name SensorProfileItemInterface::getName ( ) const
pure virtual

Method which returns the name of the sensor profile.

Returns
the name of the sensor profile

Implemented in SensorProfileItemModel.

◆ getParameters()

virtual Parameters* SensorProfileItemInterface::getParameters ( ) const
pure virtual

Method which returns the parameter map of this sensor profile (instance of ParameterMapInterface).

Returns
the parameter map of this sensor profile

Implemented in SensorProfileItemModel.

◆ getType()

virtual Type SensorProfileItemInterface::getType ( ) const
pure virtual

Method which returns the type (implementation) of the sensor adressed by this profile.

Returns
the type of the sensor

Implemented in SensorProfileItemModel.

The documentation for this class was generated from the following file:
  • SensorProfileItemInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SensorProfileItemInterface Member List

This is the complete list of members for SensorProfileItemInterface, including all inherited members.

getID() const =0 | SensorProfileItemInterface | pure virtual
getName() const =0 | SensorProfileItemInterface | pure virtual
getParameters() const =0 | SensorProfileItemInterface | pure virtual
getType() const =0 | SensorProfileItemInterface | pure virtual
ID typedef | SensorProfileItemInterface |
Name typedef | SensorProfileItemInterface |
Parameters typedef | SensorProfileItemInterface |
Type typedef | SensorProfileItemInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileItemModel Class Reference

Public Member Functions | Private Attributes | List of all members
SensorProfileItemModel Class Reference

This class implements the functionality of SensorProfileItemInterface. More...

Inheritance diagram for SensorProfileItemModel:
SensorProfileItemInterface

Public Member Functions

virtual ID | getID () const override
Method which returns the identifier of the sensor profile, i.e. the pair of name and type. More...
virtual Name | getName () const override
Method which returns the name of the sensor profile. More...
virtual Parameters * | getParameters () const override
Method which returns the parameter map of this sensor profile (instance of ParameterMapInterface). More...
virtual Type | getType () const override
Method which returns the type (implementation) of the sensor adressed by this profile. More...

Private Attributes

Parameters *const parameters
pointer to the parameter map of the sensor profile

Additional Inherited Members

- Public Types inherited from SensorProfileItemInterface
using | ID = QPair< Name, Type >
typedef for the identifier of a sensor profile, i.e. its name and type
using | Name = QString
typedef for the sensor profile's name
using | Parameters = ParameterMapInterface
typedef for the sensor profile's parameters
using | Type = QString
typedef for the sensor's type (implementation)

Detailed Description

This class implements the functionality of SensorProfileItemInterface.

Definition at line 25 of file SensorProfileItemModel.h.

Member Function Documentation

◆ getID()

SensorProfileItemInterface::ID SensorProfileItemModel::getID ( ) const
overridevirtual

Method which returns the identifier of the sensor profile, i.e. the pair of name and type.

Returns
the identifier of the sensor profile

Implements SensorProfileItemInterface.

Definition at line 45 of file SensorProfileItemModel.cpp.

46 {
47 SensorProfileMapInterface const * const map = qobject_cast<SensorProfileMapInterface const * const > ( parent() );
48
49 return ( (map) ? map->getID(const_cast<SensorProfileItemModel *> (this)) : SensorProfileItemInterface::ID() );
50 }
SensorProfileItemInterface::ID
QPair< Name, Type > ID
typedef for the identifier of a sensor profile, i.e. its name and type
Definition: SensorProfileItemInterface.h:44
SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
Definition: SensorProfileMapInterface.h:41
SensorProfileMapInterface::getID
virtual SensorProfileMapInterface::ID getID(SensorProfileMapInterface::Item *const item) const =0
Method wich returns the Id of the given sensor profile.

◆ getName()

SensorProfileItemInterface::Name SensorProfileItemModel::getName ( ) const
overridevirtual

Method which returns the name of the sensor profile.

Returns
the name of the sensor profile

Implements SensorProfileItemInterface.

Definition at line 24 of file SensorProfileItemModel.cpp.

25 {
26 SensorProfileMapInterface const * const map = qobject_cast<SensorProfileMapInterface const * const > ( parent() );
27
28 return ( (map) ? map->getID( const_cast<SensorProfileItemModel *> (this) ).first : SensorProfileItemInterface::Name() );
29 }
SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
Definition: SensorProfileMapInterface.h:41
SensorProfileItemInterface::Name
QString Name
typedef for the sensor profile&#39;s name
Definition: SensorProfileItemInterface.h:42
SensorProfileMapInterface::getID
virtual SensorProfileMapInterface::ID getID(SensorProfileMapInterface::Item *const item) const =0
Method wich returns the Id of the given sensor profile.

◆ getParameters()

SensorProfileItemInterface::Parameters * SensorProfileItemModel::getParameters ( ) const
overridevirtual

Method which returns the parameter map of this sensor profile (instance of ParameterMapInterface).

Returns
the parameter map of this sensor profile

Implements SensorProfileItemInterface.

Definition at line 40 of file SensorProfileItemModel.cpp.

41 {
42 return parameters;
43 }
SensorProfileItemModel::parameters
Parameters *const parameters
pointer to the parameter map of the sensor profile
Definition: SensorProfileItemModel.h:44

◆ getType()

SensorProfileItemInterface::Type SensorProfileItemModel::getType ( ) const
overridevirtual

Method which returns the type (implementation) of the sensor adressed by this profile.

Returns
the type of the sensor

Implements SensorProfileItemInterface.

Definition at line 32 of file SensorProfileItemModel.cpp.

33 {
34 SensorProfileMapInterface const * const map = qobject_cast<SensorProfileMapInterface const * const > ( parent() );
35
36 return ( (map) ? map->getID( const_cast<SensorProfileItemModel *> (this) ).second : SensorProfileItemInterface::Type() );
37 }
SensorProfileMapInterface
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInte...
Definition: SensorProfileMapInterface.h:41
SensorProfileMapInterface::getID
virtual SensorProfileMapInterface::ID getID(SensorProfileMapInterface::Item *const item) const =0
Method wich returns the Id of the given sensor profile.
SensorProfileItemInterface::Type
QString Type
typedef for the sensor&#39;s type (implementation)
Definition: SensorProfileItemInterface.h:43
The documentation for this class was generated from the following files:
  • SensorProfileItemModel.h
  • SensorProfileItemModel.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SensorProfileItemModel Member List

This is the complete list of members for SensorProfileItemModel, including all inherited members.

getID() const override | SensorProfileItemModel | virtual
getName() const override | SensorProfileItemModel | virtual
getParameters() const override | SensorProfileItemModel | virtual
getType() const override | SensorProfileItemModel | virtual
ID typedef | SensorProfileItemInterface |
Name typedef | SensorProfileItemInterface |
parameters | SensorProfileItemModel | private
Parameters typedef | SensorProfileItemInterface |
Type typedef | SensorProfileItemInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileMapInterface Class Reference

Public Types | Public Member Functions | List of all members
SensorProfileMapInterface Class Referenceabstract

This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInterface) are registered. As a key identifier the pair of sensor name and type (corrsponding to its implementation) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...

Inheritance diagram for SensorProfileMapInterface:
SensorProfileMapModel

Public Types

using | ConstIterator = Map::ConstIterator
a const iterator of the map (for read-only operations)
using | ID = QPair< Name, Type >
typedef for the pair of name and type used as an Id
using | Item = SensorProfileItemInterface
typedef for the sensor profile
using | Iterator = Map::Iterator
an iterator of the map
using | Map = QMap< ID, Item * >
typedef for the map, i.e. the container object of sensor profiles
using | Name = SensorProfileItemInterface::Name
typedef for the sensor profiles name
using | Type = SensorProfileItemInterface::Type
typedef for the sensor type (i.e. its algorithm/implementation)

Public Member Functions

virtual bool | add (SensorProfileMapInterface::ID const &id)=0
Method which creates a new sensor profile (instance of SensorProfileItemInterface) and adds it to the map under the given Id. More...
virtual SensorProfileMapInterface::Iterator | begin ()=0
Gets an iterator pointing to the first sensor profile in the map. More...
virtual void | clear ()=0
Method which deletes all registered sensor profiles and clears the map.
virtual SensorProfileMapInterface::ConstIterator | constBegin () const =0
Gets an iterator pointing to the first sensor profile in the map (use for read-only since pointing at constant values). More...
virtual SensorProfileMapInterface::ConstIterator | constEnd () const =0
Gets an iterator pointing at the end of the map after the last sensor profile (use for read-only). More...
virtual bool | contains (SensorProfileMapInterface::ID const &id) const =0
Method wich checks whether the map contains a sensor profile with the given Id. More...
virtual int | count () const =0
Method which returns the number of sensor profiles in the map. More...
virtual SensorProfileMapInterface::Iterator | end ()=0
Gets an iterator pointing to the end of the map after the last sensor profile. More...
virtual Name | generateName (Type type)=0
Method wich generates a default name of the pattern "Standard %1" for a sensor profile of the given type. The number %1 is chosen such that the generated name is not already used by another sensor profile of the same type. More...
virtual SensorProfileMapInterface::ID | getID (SensorProfileMapInterface::Item *const item) const =0
Method wich returns the Id of the given sensor profile. More...
virtual SensorProfileMapInterface::Item * | getItem (SensorProfileMapInterface::ID const &id) const =0
Method which returns a pointer to the sensor profile with the given Id. If the map does not contain a sensor profile with this Id, nullptr is returned. More...
virtual QList< ID > | keys () const =0
Method which returns the list of all sensor profile Ids in the map. More...
virtual bool | remove (SensorProfileMapInterface::ID const &id)=0
Method which removes the sensor profile with the given Id from the map. The profile is deleted after removing. Nothing will be done if there is no such profile. More...
virtual void | setID (SensorProfileMapInterface::Item *const item, SensorProfileMapInterface::ID const &id)=0
Method wich changes the Id of the given sensor profile to the one passed as second argument. More...
virtual QList< Item * > | values () const =0
Method which returns a list of pointers to all sensor profiles in the map. More...

Detailed Description

This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInterface) are registered. As a key identifier the pair of sensor name and type (corrsponding to its implementation) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.

Definition at line 41 of file SensorProfileMapInterface.h.

Member Function Documentation

◆ add()

virtual bool SensorProfileMapInterface::add ( SensorProfileMapInterface::ID const & id )
pure virtual

Method which creates a new sensor profile (instance of SensorProfileItemInterface) and adds it to the map under the given Id.

Parameters
[in] Id the Id under which the newly created item is registered
Returns
"true", if Id is not used already, otherwise "false"

Implemented in SensorProfileMapModel.

◆ begin()

virtual SensorProfileMapInterface::Iterator SensorProfileMapInterface::begin ( )
pure virtual

Gets an iterator pointing to the first sensor profile in the map.

Returns
The iterator pointing at the first object in the map.

Implemented in SensorProfileMapModel.

◆ constBegin()

virtual SensorProfileMapInterface::ConstIterator SensorProfileMapInterface::constBegin ( ) const
pure virtual

Gets an iterator pointing to the first sensor profile in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implemented in SensorProfileMapModel.

◆ constEnd()

virtual SensorProfileMapInterface::ConstIterator SensorProfileMapInterface::constEnd ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last sensor profile (use for read-only).

Returns
The iterator pointing at the end of the map.

Implemented in SensorProfileMapModel.

◆ contains()

virtual bool SensorProfileMapInterface::contains ( SensorProfileMapInterface::ID const & id ) const
pure virtual

Method wich checks whether the map contains a sensor profile with the given Id.

Parameters
[in] Id the Id to be searched for
Returns
true, if profile with given Id exists, otherwise false.

Implemented in SensorProfileMapModel.

◆ count()

virtual int SensorProfileMapInterface::count ( ) const
pure virtual

Method which returns the number of sensor profiles in the map.

Returns
the number of sensor profiles in the map

Implemented in SensorProfileMapModel.

◆ end()

virtual SensorProfileMapInterface::Iterator SensorProfileMapInterface::end ( )
pure virtual

Gets an iterator pointing to the end of the map after the last sensor profile.

Returns
The iterator pointing at the end of the map.

Implemented in SensorProfileMapModel.

◆ generateName()

virtual Name SensorProfileMapInterface::generateName ( Type type )
pure virtual

Method wich generates a default name of the pattern "Standard %1" for a sensor profile of the given type. The number %1 is chosen such that the generated name is not already used by another sensor profile of the same type.

Parameters
[in] type the sensor type for which a name should be generated
Returns
the generated default name

Implemented in SensorProfileMapModel.

◆ getID()

virtual SensorProfileMapInterface::ID SensorProfileMapInterface::getID ( SensorProfileMapInterface::Item *const item ) const
pure virtual

Method wich returns the Id of the given sensor profile.

Parameters
[in] item the pointer to the sensor profile in question
Returns
the Id of the given sensor profile

Implemented in SensorProfileMapModel.

◆ getItem()

virtual SensorProfileMapInterface::Item* SensorProfileMapInterface::getItem ( SensorProfileMapInterface::ID const & id ) const
pure virtual

Method which returns a pointer to the sensor profile with the given Id. If the map does not contain a sensor profile with this Id, nullptr is returned.

Parameters
[in] Id the Id of the sensor profile to be returned
Returns
the pointer to a sensor profile of given Id, nullptr if given Id does not exist in the map

Implemented in SensorProfileMapModel.

◆ keys()

virtual QList<ID> SensorProfileMapInterface::keys ( ) const
pure virtual

Method which returns the list of all sensor profile Ids in the map.

Returns
the list of all sensor profile Ids

Implemented in SensorProfileMapModel.

◆ remove()

virtual bool SensorProfileMapInterface::remove ( SensorProfileMapInterface::ID const & id )
pure virtual

Method which removes the sensor profile with the given Id from the map. The profile is deleted after removing. Nothing will be done if there is no such profile.

Parameters
[in] Id the Id of the sensor profile to be removed
Returns
"true", if Id exists in the map, otherwise "false"

Implemented in SensorProfileMapModel.

◆ setID()

virtual void SensorProfileMapInterface::setID | ( | SensorProfileMapInterface::Item *const | item,
 |  | SensorProfileMapInterface::ID const & | id
 | ) |  |
pure virtual

Method wich changes the Id of the given sensor profile to the one passed as second argument.

Parameters
[in] | item | the pointer to the sensor profile whose id should be changed
[in] | Id | the new Id of the sensor profile

Implemented in SensorProfileMapModel.

◆ values()

virtual QList<Item*> SensorProfileMapInterface::values ( ) const
pure virtual

Method which returns a list of pointers to all sensor profiles in the map.

Returns
the list of pointers to all sensor profiles

Implemented in SensorProfileMapModel.

The documentation for this class was generated from the following file:
  • SensorProfileMapInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SensorProfileMapInterface Member List

This is the complete list of members for SensorProfileMapInterface, including all inherited members.

add(SensorProfileMapInterface::ID const &id)=0 | SensorProfileMapInterface | pure virtual
begin()=0 | SensorProfileMapInterface | pure virtual
clear()=0 | SensorProfileMapInterface | pure virtual
constBegin() const =0 | SensorProfileMapInterface | pure virtual
constEnd() const =0 | SensorProfileMapInterface | pure virtual
ConstIterator typedef | SensorProfileMapInterface |
contains(SensorProfileMapInterface::ID const &id) const =0 | SensorProfileMapInterface | pure virtual
count() const =0 | SensorProfileMapInterface | pure virtual
end()=0 | SensorProfileMapInterface | pure virtual
generateName(Type type)=0 | SensorProfileMapInterface | pure virtual
getID(SensorProfileMapInterface::Item *const item) const =0 | SensorProfileMapInterface | pure virtual
getItem(SensorProfileMapInterface::ID const &id) const =0 | SensorProfileMapInterface | pure virtual
ID typedef | SensorProfileMapInterface |
Item typedef | SensorProfileMapInterface |
Iterator typedef | SensorProfileMapInterface |
keys() const =0 | SensorProfileMapInterface | pure virtual
Map typedef | SensorProfileMapInterface |
Name typedef | SensorProfileMapInterface |
remove(SensorProfileMapInterface::ID const &id)=0 | SensorProfileMapInterface | pure virtual
setID(SensorProfileMapInterface::Item *const item, SensorProfileMapInterface::ID const &id)=0 | SensorProfileMapInterface | pure virtual
Type typedef | SensorProfileMapInterface |
values() const =0 | SensorProfileMapInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorProfileMapModel Class Reference

Public Member Functions | Private Attributes | List of all members
SensorProfileMapModel Class Reference

This class implements the functionality of SensorProfileMapInterface. More...

Inheritance diagram for SensorProfileMapModel:
SensorProfileMapInterface

Public Member Functions

virtual bool | add (SensorProfileMapInterface::ID const &id) override
Method which creates a new sensor profile (instance of SensorProfileItemInterface) and adds it to the map under the given Id. More...
virtual SensorProfileMapInterface::Iterator | begin () override
Gets an iterator pointing to the first sensor profile in the map. More...
virtual void | clear () override
Method which deletes all registered sensor profiles and clears the map.
virtual SensorProfileMapInterface::ConstIterator | constBegin () const override
Gets an iterator pointing to the first sensor profile in the map (use for read-only since pointing at constant values). More...
virtual SensorProfileMapInterface::ConstIterator | constEnd () const override
Gets an iterator pointing at the end of the map after the last sensor profile (use for read-only). More...
virtual bool | contains (SensorProfileMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor profile with the given Id. More...
virtual int | count () const override
Method which returns the number of sensor profiles in the map. More...
virtual SensorProfileMapInterface::Iterator | end () override
Gets an iterator pointing to the end of the map after the last sensor profile. More...
virtual Name | generateName (Type type) override
Method wich generates a default name of the pattern "Standard %1" for a sensor profile of the given type. The number %1 is chosen such that the generated name is not already used by another sensor profile of the same type. More...
virtual SensorProfileMapInterface::ID | getID (SensorProfileMapInterface::Item *const item) const override
Method wich returns the Id of the given sensor profile. More...
virtual SensorProfileMapInterface::Item * | getItem (SensorProfileMapInterface::ID const &id) const override
Method which returns a pointer to the sensor profile with the given Id. If the map does not contain a sensor profile with this Id, nullptr is returned. More...
virtual QList< ID > | keys () const override
Method which returns the list of all sensor profile Ids in the map. More...
virtual bool | remove (SensorProfileMapInterface::ID const &id) override
Method which removes the sensor profile with the given Id from the map. The profile is deleted after removing. Nothing will be done if there is no such profile. More...
virtual void | setID (SensorProfileMapInterface::Item *const item, SensorProfileMapInterface::ID const &id) override
Method wich changes the Id of the given sensor profile to the one passed as second argument. More...
virtual QList< Item * > | values () const override
Method which returns a list of pointers to all sensor profiles in the map. More...

Private Attributes

Map sensorProfiles
the map (container) for registering sensor profiles

Additional Inherited Members

- Public Types inherited from SensorProfileMapInterface
using | ConstIterator = Map::ConstIterator
a const iterator of the map (for read-only operations)
using | ID = QPair< Name, Type >
typedef for the pair of name and type used as an Id
using | Item = SensorProfileItemInterface
typedef for the sensor profile
using | Iterator = Map::Iterator
an iterator of the map
using | Map = QMap< ID, Item * >
typedef for the map, i.e. the container object of sensor profiles
using | Name = SensorProfileItemInterface::Name
typedef for the sensor profiles name
using | Type = SensorProfileItemInterface::Type
typedef for the sensor type (i.e. its algorithm/implementation)

Detailed Description

This class implements the functionality of SensorProfileMapInterface.

Definition at line 25 of file SensorProfileMapModel.h.

Member Function Documentation

◆ add()

bool SensorProfileMapModel::add ( SensorProfileMapInterface::ID const & id )
overridevirtual

Method which creates a new sensor profile (instance of SensorProfileItemInterface) and adds it to the map under the given Id.

Parameters
[in] Id the Id under which the newly created item is registered
Returns
"true", if Id is not used already, otherwise "false"

Implements SensorProfileMapInterface.

Definition at line 42 of file SensorProfileMapModel.cpp.

43 {
44 if(!contains(id))
45 {
46 sensorProfiles.insert(id, new SensorProfileItemModel(this));
47 return true;
48 }
49
50 return false;
51 }
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72
SensorProfileItemModel
This class implements the functionality of SensorProfileItemInterface.
Definition: SensorProfileItemModel.h:25
SensorProfileMapModel::contains
virtual bool contains(SensorProfileMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor profile with the given Id.
Definition: SensorProfileMapModel.cpp:107

◆ begin()

SensorProfileMapInterface::Iterator SensorProfileMapModel::begin ( )
overridevirtual

Gets an iterator pointing to the first sensor profile in the map.

Returns
The iterator pointing at the first object in the map.

Implements SensorProfileMapInterface.

Definition at line 21 of file SensorProfileMapModel.cpp.

22 {
23 return sensorProfiles.begin();
24 }
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72

◆ constBegin()

SensorProfileMapInterface::ConstIterator SensorProfileMapModel::constBegin ( ) const
overridevirtual

Gets an iterator pointing to the first sensor profile in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implements SensorProfileMapInterface.

Definition at line 26 of file SensorProfileMapModel.cpp.

27 {
28 return sensorProfiles.constBegin();
29 }
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72

◆ constEnd()

SensorProfileMapInterface::ConstIterator SensorProfileMapModel::constEnd ( ) const
overridevirtual

Gets an iterator pointing at the end of the map after the last sensor profile (use for read-only).

Returns
The iterator pointing at the end of the map.

Implements SensorProfileMapInterface.

Definition at line 36 of file SensorProfileMapModel.cpp.

37 {
38 return sensorProfiles.constEnd();
39 }
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72

◆ contains()

bool SensorProfileMapModel::contains ( SensorProfileMapInterface::ID const & id ) const
overridevirtual

Method wich checks whether the map contains a sensor profile with the given Id.

Parameters
[in] Id the Id to be searched for
Returns
true, if profile with given Id exists, otherwise false.

Implements SensorProfileMapInterface.

Definition at line 107 of file SensorProfileMapModel.cpp.

108 {
109 return sensorProfiles.contains(id);
110 }
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72

◆ count()

int SensorProfileMapModel::count ( ) const
overridevirtual

Method which returns the number of sensor profiles in the map.

Returns
the number of sensor profiles in the map

Implements SensorProfileMapInterface.

Definition at line 122 of file SensorProfileMapModel.cpp.

123 {
124 return sensorProfiles.count();
125 }
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72

◆ end()

SensorProfileMapInterface::Iterator SensorProfileMapModel::end ( )
overridevirtual

Gets an iterator pointing to the end of the map after the last sensor profile.

Returns
The iterator pointing at the end of the map.

Implements SensorProfileMapInterface.

Definition at line 31 of file SensorProfileMapModel.cpp.

32 {
33 return sensorProfiles.end();
34 }
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72

◆ generateName()

SensorProfileMapInterface::Name SensorProfileMapModel::generateName ( Type type )
overridevirtual

Method wich generates a default name of the pattern "Standard %1" for a sensor profile of the given type. The number %1 is chosen such that the generated name is not already used by another sensor profile of the same type.

Parameters
[in] type the sensor type for which a name should be generated
Returns
the generated default name

Implements SensorProfileMapInterface.

Definition at line 88 of file SensorProfileMapModel.cpp.

89 {
90 int index = 1;
91 QString name = QString("Standard %1").arg(index);
92 SensorProfileMapInterface::ID id;
93
94 id = SensorProfileMapInterface::ID(name, type);
95
96 while( contains(id) )
97 {
98 index++;
99 name = QString("Standard %1").arg(index);
100 id = SensorProfileMapInterface::ID(name, type);
101 }
102
103 return name;
104
105 }
SensorProfileMapModel::contains
virtual bool contains(SensorProfileMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor profile with the given Id.
Definition: SensorProfileMapModel.cpp:107
SensorProfileMapInterface::ID
QPair< Name, Type > ID
typedef for the pair of name and type used as an Id
Definition: SensorProfileMapInterface.h:49

◆ getID()

SensorProfileMapInterface::ID SensorProfileMapModel::getID ( SensorProfileMapInterface::Item *const item ) const
overridevirtual

Method wich returns the Id of the given sensor profile.

Parameters
[in] item the pointer to the sensor profile in question
Returns
the Id of the given sensor profile

Implements SensorProfileMapInterface.

Definition at line 73 of file SensorProfileMapModel.cpp.

74 {
75 return sensorProfiles.key(item);
76 }
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72

◆ getItem()

SensorProfileMapInterface::Item * SensorProfileMapModel::getItem ( SensorProfileMapInterface::ID const & id ) const
overridevirtual

Method which returns a pointer to the sensor profile with the given Id. If the map does not contain a sensor profile with this Id, nullptr is returned.

Parameters
[in] Id the Id of the sensor profile to be returned
Returns
the pointer to a sensor profile of given Id, nullptr if given Id does not exist in the map

Implements SensorProfileMapInterface.

Definition at line 64 of file SensorProfileMapModel.cpp.

65 {
66 if(contains(id))
67 return sensorProfiles.value(id);
68
69 return nullptr;
70 }
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72
SensorProfileMapModel::contains
virtual bool contains(SensorProfileMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor profile with the given Id.
Definition: SensorProfileMapModel.cpp:107

◆ keys()

QList< SensorProfileMapInterface::ID > SensorProfileMapModel::keys ( ) const
overridevirtual

Method which returns the list of all sensor profile Ids in the map.

Returns
the list of all sensor profile Ids

Implements SensorProfileMapInterface.

Definition at line 112 of file SensorProfileMapModel.cpp.

113 {
114 return sensorProfiles.keys();
115 }
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72

◆ remove()

bool SensorProfileMapModel::remove ( SensorProfileMapInterface::ID const & id )
overridevirtual

Method which removes the sensor profile with the given Id from the map. The profile is deleted after removing. Nothing will be done if there is no such profile.

Parameters
[in] Id the Id of the sensor profile to be removed
Returns
"true", if Id exists in the map, otherwise "false"

Implements SensorProfileMapInterface.

Definition at line 53 of file SensorProfileMapModel.cpp.

54 {
55 if(contains(id))
56 {
57 delete sensorProfiles.take(id);
58 return true;
59 }
60
61 return false;
62 }
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72
SensorProfileMapModel::contains
virtual bool contains(SensorProfileMapInterface::ID const &id) const override
Method wich checks whether the map contains a sensor profile with the given Id.
Definition: SensorProfileMapModel.cpp:107

◆ setID()

void SensorProfileMapModel::setID | ( | SensorProfileMapInterface::Item *const | item,
 |  | SensorProfileMapInterface::ID const & | id
 | ) |  |
overridevirtual

Method wich changes the Id of the given sensor profile to the one passed as second argument.

Parameters
[in] | item | the pointer to the sensor profile whose id should be changed
[in] | Id | the new Id of the sensor profile

Implements SensorProfileMapInterface.

Definition at line 78 of file SensorProfileMapModel.cpp.

80 {
81
82 SensorProfileMapInterface::ID oldID = getID(item);
83
84 sensorProfiles.take(oldID);
85 sensorProfiles.insert(id, item);
86 }
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72
SensorProfileMapModel::getID
virtual SensorProfileMapInterface::ID getID(SensorProfileMapInterface::Item *const item) const override
Method wich returns the Id of the given sensor profile.
Definition: SensorProfileMapModel.cpp:73
SensorProfileMapInterface::ID
QPair< Name, Type > ID
typedef for the pair of name and type used as an Id
Definition: SensorProfileMapInterface.h:49

◆ values()

QList< SensorProfileItemInterface * > SensorProfileMapModel::values ( ) const
overridevirtual

Method which returns a list of pointers to all sensor profiles in the map.

Returns
the list of pointers to all sensor profiles

Implements SensorProfileMapInterface.

Definition at line 117 of file SensorProfileMapModel.cpp.

118 {
119 return sensorProfiles.values();
120 }
SensorProfileMapModel::sensorProfiles
Map sensorProfiles
the map (container) for registering sensor profiles
Definition: SensorProfileMapModel.h:72
The documentation for this class was generated from the following files:
  • SensorProfileMapModel.h
  • SensorProfileMapModel.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SensorProfileMapModel Member List

This is the complete list of members for SensorProfileMapModel, including all inherited members.

add(SensorProfileMapInterface::ID const &id) override | SensorProfileMapModel | virtual
begin() override | SensorProfileMapModel | virtual
clear() override | SensorProfileMapModel | virtual
constBegin() const override | SensorProfileMapModel | virtual
constEnd() const override | SensorProfileMapModel | virtual
ConstIterator typedef | SensorProfileMapInterface |
contains(SensorProfileMapInterface::ID const &id) const override | SensorProfileMapModel | virtual
count() const override | SensorProfileMapModel | virtual
end() override | SensorProfileMapModel | virtual
generateName(Type type) override | SensorProfileMapModel | virtual
getID(SensorProfileMapInterface::Item *const item) const override | SensorProfileMapModel | virtual
getItem(SensorProfileMapInterface::ID const &id) const override | SensorProfileMapModel | virtual
ID typedef | SensorProfileMapInterface |
Item typedef | SensorProfileMapInterface |
Iterator typedef | SensorProfileMapInterface |
keys() const override | SensorProfileMapModel | virtual
Map typedef | SensorProfileMapInterface |
Name typedef | SensorProfileMapInterface |
remove(SensorProfileMapInterface::ID const &id) override | SensorProfileMapModel | virtual
sensorProfiles | SensorProfileMapModel | private
setID(SensorProfileMapInterface::Item *const item, SensorProfileMapInterface::ID const &id) override | SensorProfileMapModel | virtual
Type typedef | SensorProfileMapInterface |
values() const override | SensorProfileMapModel | virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: StatusBarView Class Reference

Public Member Functions | Private Slots | Private Attributes | Static Private Attributes | List of all members
StatusBarView Class Reference

This class defines a status bar. More...

Inherits QWidget.

Public Member Functions

virtual void | hide ()
Reimplementation of hide. Sets the visible status of the text browser and the checked status of the button to 'false'.
virtual void | show ()
Reimplementation of show. Sets the visible status of the text browser and the checked status of the button to 'true'.
void | showText (QString text, Color color)
Method which displays the given text in the given color in the text browser. More...

Private Slots

void on_button_clicked ()
This slot is triggered when the hide/show button is clicked. Hides or shows the status bar.

Private Attributes

Ui::StatusBarView * ui
The ui object defining the status bar's appearance. It contains a QTextBrowser and a QPushButton object.

Static Private Attributes

static QMap< Color, QColor > colorMap
the map containing the colors depending on the message type.

Detailed Description

This class defines a status bar.

It comprises a ui object (defined in StatusBarView.ui) which includes a Text Browser (QTextBrowser) for showing text and a button (QPushButton) for showing and hiding the status bar. The status bar can be used to show, for instance, information relevant for the simulation.

Definition at line 39 of file StatusBarView.h.

Member Function Documentation

◆ showText()

void StatusBarView::showText | ( | QString | text,
 |  | Color | color
 | ) |  |

Method which displays the given text in the given color in the text browser.

Parameters
[in] | text | The text to be displayed
[in] | color | The color of the text

Definition at line 39 of file StatusBarView.cpp.

40 {
41 ui->StatusText->setTextColor(colorMap[color]);
42 ui->StatusText->setText(text);
43 }
StatusBarView::ui
Ui::StatusBarView * ui
The ui object defining the status bar&#39;s appearance. It contains a QTextBrowser and a QPushButton obje...
Definition: StatusBarView.h:86
StatusBarView::colorMap
static QMap< Color, QColor > colorMap
the map containing the colors depending on the message type.
Definition: StatusBarView.h:85
The documentation for this class was generated from the following files:
  • StatusBarView.h
  • StatusBarView.cpp
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

StatusBarView Member List

This is the complete list of members for StatusBarView, including all inherited members.

colorMap | StatusBarView | privatestatic
hide() | StatusBarView | virtual
on_button_clicked() | StatusBarView | privateslot
show() | StatusBarView | virtual
showText(QString text, Color color) | StatusBarView |
ui | StatusBarView | private
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentInputItemInterface Class Reference

Public Types | Public Member Functions | List of all members
SystemComponentInputItemInterface Class Referenceabstract

This class defines the items constituing an input of a component registered in a system. More...

Inherits QObject.

Inherited by SystemComponentInputItemModel.

Public Types

using | Cardinality = ComponentInputItemInterface::Cardinality
The cardinality of the component's input.
using | ID = ComponentInputItemInterface::ID
The identifier of the component's input.
using | Title = ComponentInputItemInterface::Title
The title for the component's input.
using | Type = ComponentInputItemInterface::Type
The type of the component's input.
using | Unit = ComponentInputItemInterface::Unit
The unit of the component's input.

Public Member Functions

virtual SystemComponentInputItemInterface::Cardinality | getCardinality () const =0
Gets the cardinality of the current registered input. More...
virtual SystemComponentItemInterface * | getComponent () const =0
Gets the parent component where the current input belongs to. More...
virtual SystemComponentInputItemInterface::ID | getID () const =0
Gets the key identifier of the current registered input. More...
virtual SystemComponentInputItemInterface::Title | getTitle () const =0
Gets the title of the current registered input. More...
virtual SystemComponentInputItemInterface::Type | getType () const =0
Gets the type of the current registered input. More...
virtual SystemComponentInputItemInterface::Unit | getUnit () const =0
Gets the unit of the current registered input. More...

Detailed Description

This class defines the items constituing an input of a component registered in a system.

This class defines the items constituing an input of a component registered in a system. These items are provided from the class defined in the Component Input Item Interface. This current class also provides access to the parent component where the input belongs to. This access allows retracing the connections by getting the input with its relative component (parent).

See also
ComponentInputItemInterface.h

Definition at line 34 of file SystemComponentInputItemInterface.h.

Member Function Documentation

◆ getCardinality()

virtual SystemComponentInputItemInterface::Cardinality SystemComponentInputItemInterface::getCardinality ( ) const
pure virtual

Gets the cardinality of the current registered input.

Gets the cardinality of the current registered input.

Returns
The cardinality of the input.

◆ getComponent()

virtual SystemComponentItemInterface* SystemComponentInputItemInterface::getComponent ( ) const
pure virtual

Gets the parent component where the current input belongs to.

Gets the parent component where the current input belongs to.

Returns
The pointer to the parent component.

◆ getID()

virtual SystemComponentInputItemInterface::ID SystemComponentInputItemInterface::getID ( ) const
pure virtual

Gets the key identifier of the current registered input.

Gets the key identifier of the current registered input.

Returns
The key identifier of the input.

◆ getTitle()

virtual SystemComponentInputItemInterface::Title SystemComponentInputItemInterface::getTitle ( ) const
pure virtual

Gets the title of the current registered input.

Gets the title of the current registered input.

Returns
The title of the input.

◆ getType()

virtual SystemComponentInputItemInterface::Type SystemComponentInputItemInterface::getType ( ) const
pure virtual

Gets the type of the current registered input.

Gets the type of the current registered input.

Returns
The type of the input.

◆ getUnit()

virtual SystemComponentInputItemInterface::Unit SystemComponentInputItemInterface::getUnit ( ) const
pure virtual

Gets the unit of the current registered input.

Gets the unit of the current registered input.

Returns
The unit of the input.
The documentation for this class was generated from the following file:
  • SystemComponentInputItemInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemComponentInputItemInterface Member List

This is the complete list of members for SystemComponentInputItemInterface, including all inherited members.

Cardinality typedef | SystemComponentInputItemInterface |
getCardinality() const =0 | SystemComponentInputItemInterface | pure virtual
getComponent() const =0 | SystemComponentInputItemInterface | pure virtual
getID() const =0 | SystemComponentInputItemInterface | pure virtual
getTitle() const =0 | SystemComponentInputItemInterface | pure virtual
getType() const =0 | SystemComponentInputItemInterface | pure virtual
getUnit() const =0 | SystemComponentInputItemInterface | pure virtual
ID typedef | SystemComponentInputItemInterface |
Title typedef | SystemComponentInputItemInterface |
Type typedef | SystemComponentInputItemInterface |
Unit typedef | SystemComponentInputItemInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentItemInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
SystemComponentItemInterface Class Referenceabstract

This class defines the items constituing the ccomponent registered in a system: More...

Inherits QObject.

Inherited by SystemComponentItemModel.

Public Types

using | ID = unsigned int
The component's key identifier in the system.
using | InputMap = SystemComponentInputMapInterface
The container registering the inputs of the component.
using | Library = ComponentItemInterface::Name
The component's key name (registered in the library)
using | OutputMap = SystemComponentOutputMapInterface
The container registering the outputs of the component.
using | ParameterMap = SystemComponentParameterMapInterface
The container registering the parameters of the component.
using | Position = QPoint
The position of the component in the System Editor.
using | Schedule = SystemComponentScheduleInterface
The object registering the parameters related to simulation schedule.
using | Title = ComponentItemInterface::Title
The Title of the component.
using | Type = ComponentItemInterface::Type
The type of the component.

Signals

void | modifiedPosition () const
Triggers signal to inform that the position of a component has been modified in the System Editor.
void | modifiedTitle () const
Triggers signal to inform that the title of a component has been modified.

Public Member Functions

virtual bool | duplicate (SystemComponentItemInterface::Position const &position)=0
Duplicates the current component and registers it to the map with a new identifier and a position in the System Editor position calculated from the current component position shifted with constant values. More...
virtual SystemComponentItemInterface::ID | getID () const =0
Gets the key identifier of the current component registered in the system. More...
virtual SystemComponentItemInterface::InputMap * | getInputs () const =0
Gets the inputs of the current registered component. More...
virtual SystemComponentItemInterface::Library | getLibrary () const =0
Gets the key name of the current component as registered in the library. More...
virtual SystemComponentItemInterface::OutputMap * | getOutputs () const =0
Gets the outputs of the current registered component. More...
virtual SystemComponentItemInterface::ParameterMap * | getParameters () const =0
Gets the parameters of the current registered component. More...
virtual SystemComponentItemInterface::Position | getPosition () const =0
Gets the position of the current registered component. More...
virtual SystemComponentItemInterface::Schedule * | getSchedule () const =0
Gets the simulation schedule related parameters of the current registered component. More...
virtual SystemComponentItemInterface::Title | getTitle () const =0
Gets the title of the current registered component. More...
virtual SystemComponentItemInterface::Type | getType () const =0
Gets the type of the current registered component. More...
virtual bool | remove ()=0
Deregisters the current component from the map (i.e. remove it from the system). More...
virtual bool | setPosition (SystemComponentItemInterface::Position const &position)=0
Sets the position of the current registered component in the System Editor. More...
virtual bool | setTitle (SystemComponentItemInterface::Title const &title)=0
Sets a title to the current registered component. More...

Detailed Description

This class defines the items constituing the ccomponent registered in a system:

  • the key identifier (must be UNIQUE)
  • the key name (to retrieve the component in the components library)
  • the type: Action or Algorithm or Sensor
  • the title (modifiable)
  • the schedule: Priority, Offset, Cycle Time, Response Time
  • the parameters
  • the inputs
  • the outputs
  • the position of the component in the System Editor

Definition at line 35 of file SystemComponentItemInterface.h.

Member Function Documentation

◆ duplicate()

virtual bool SystemComponentItemInterface::duplicate ( SystemComponentItemInterface::Position const & position )
pure virtual

Duplicates the current component and registers it to the map with a new identifier and a position in the System Editor position calculated from the current component position shifted with constant values.

Returns
True if component successfully deregistered.

◆ getID()

virtual SystemComponentItemInterface::ID SystemComponentItemInterface::getID ( ) const
pure virtual

Gets the key identifier of the current component registered in the system.

Returns
The key identifier of the component.

◆ getInputs()

virtual SystemComponentItemInterface::InputMap* SystemComponentItemInterface::getInputs ( ) const
pure virtual

Gets the inputs of the current registered component.

Returns
The pointer to the inputs of the component.

◆ getLibrary()

virtual SystemComponentItemInterface::Library SystemComponentItemInterface::getLibrary ( ) const
pure virtual

Gets the key name of the current component as registered in the library.

Returns
The key name of the component.

◆ getOutputs()

virtual SystemComponentItemInterface::OutputMap* SystemComponentItemInterface::getOutputs ( ) const
pure virtual

Gets the outputs of the current registered component.

Returns
The pointer to the outputs of the component.

◆ getParameters()

virtual SystemComponentItemInterface::ParameterMap* SystemComponentItemInterface::getParameters ( ) const
pure virtual

Gets the parameters of the current registered component.

Returns
The pointer to the parameters of the component.

◆ getPosition()

virtual SystemComponentItemInterface::Position SystemComponentItemInterface::getPosition ( ) const
pure virtual

Gets the position of the current registered component.

Returns
The position of the component.

◆ getSchedule()

virtual SystemComponentItemInterface::Schedule* SystemComponentItemInterface::getSchedule ( ) const
pure virtual

Gets the simulation schedule related parameters of the current registered component.

Returns
The pointer to the schedule of the component.

◆ getTitle()

virtual SystemComponentItemInterface::Title SystemComponentItemInterface::getTitle ( ) const
pure virtual

Gets the title of the current registered component.

Returns
The title of the component.

◆ getType()

virtual SystemComponentItemInterface::Type SystemComponentItemInterface::getType ( ) const
pure virtual

Gets the type of the current registered component.

Returns
The type of the component.

◆ remove()

virtual bool SystemComponentItemInterface::remove ( )
pure virtual

Deregisters the current component from the map (i.e. remove it from the system).

Returns
True if component successfully deregistered.

◆ setPosition()

virtual bool SystemComponentItemInterface::setPosition ( SystemComponentItemInterface::Position const & position )
pure virtual

Sets the position of the current registered component in the System Editor.

Returns
True if the position successfully modified.

◆ setTitle()

virtual bool SystemComponentItemInterface::setTitle ( SystemComponentItemInterface::Title const & title )
pure virtual

Sets a title to the current registered component.

Returns
True if the title successfully modified.
The documentation for this class was generated from the following file:
  • SystemComponentItemInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemComponentItemInterface Member List

This is the complete list of members for SystemComponentItemInterface, including all inherited members.

duplicate(SystemComponentItemInterface::Position const &position)=0 | SystemComponentItemInterface | pure virtual
getID() const =0 | SystemComponentItemInterface | pure virtual
getInputs() const =0 | SystemComponentItemInterface | pure virtual
getLibrary() const =0 | SystemComponentItemInterface | pure virtual
getOutputs() const =0 | SystemComponentItemInterface | pure virtual
getParameters() const =0 | SystemComponentItemInterface | pure virtual
getPosition() const =0 | SystemComponentItemInterface | pure virtual
getSchedule() const =0 | SystemComponentItemInterface | pure virtual
getTitle() const =0 | SystemComponentItemInterface | pure virtual
getType() const =0 | SystemComponentItemInterface | pure virtual
ID typedef | SystemComponentItemInterface |
InputMap typedef | SystemComponentItemInterface |
Library typedef | SystemComponentItemInterface |
modifiedPosition() const | SystemComponentItemInterface | signal
modifiedTitle() const | SystemComponentItemInterface | signal
OutputMap typedef | SystemComponentItemInterface |
ParameterMap typedef | SystemComponentItemInterface |
Position typedef | SystemComponentItemInterface |
remove()=0 | SystemComponentItemInterface | pure virtual
Schedule typedef | SystemComponentItemInterface |
setPosition(SystemComponentItemInterface::Position const &position)=0 | SystemComponentItemInterface | pure virtual
setTitle(SystemComponentItemInterface::Title const &title)=0 | SystemComponentItemInterface | pure virtual
Title typedef | SystemComponentItemInterface |
Type typedef | SystemComponentItemInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentManagerInterface Class Reference

Public Member Functions | List of all members
SystemComponentManagerInterface Class Referenceabstract

This class enables loading components as a library from a directory and provides a search functions for these components. More...

Inherits QObject.

Inherited by SystemComponentManagerModel.

Public Member Functions

virtual QList< ComponentItemInterface::Title > | listTitlesByType (ComponentItemInterface::Type const &type) const =0
Gets a list of titles of loaded components sorted according to the specified type type (Action, Algorithm or Sensor). This function is called when displaying the tree of components in the System Editor. More...
virtual bool | loadFromDirectory (QDir const &directory)=0
Loads XML files defining components from the selected directory directory. The filenames are registered in a map of components. More...
virtual ComponentItemInterface * | lookupItemByName (ComponentItemInterface::Name const &name) const =0
Gets a pointer to the component related-object with the specified key name name. This function is called when loading a system or when a component is duplicated. More...
virtual ComponentItemInterface * | lookupItemByTitle (ComponentItemInterface::Title const &title) const =0
Gets a pointer to the component related-object with the specified title title. This function is called when a component is drag and drop in the System Editor. More...

Detailed Description

This class enables loading components as a library from a directory and provides a search functions for these components.

Definition at line 22 of file SystemComponentManagerInterface.h.

Member Function Documentation

◆ listTitlesByType()

virtual QList<ComponentItemInterface::Title> SystemComponentManagerInterface::listTitlesByType ( ComponentItemInterface::Type const & type ) const
pure virtual

Gets a list of titles of loaded components sorted according to the specified type type (Action, Algorithm or Sensor). This function is called when displaying the tree of components in the System Editor.

Parameters
[in] type The output of a component registered in the system.
Returns
The list of titles of loaded components.

◆ loadFromDirectory()

virtual bool SystemComponentManagerInterface::loadFromDirectory ( QDir const & directory )
pure virtual

Loads XML files defining components from the selected directory directory. The filenames are registered in a map of components.

See also
ComponentMapInterface.h This function is called at the start of the application and when the user import an external library of components.
Parameters
[in] directory The directory with component-def files.
Returns
True if component library successfully loaded.

◆ lookupItemByName()

virtual ComponentItemInterface* SystemComponentManagerInterface::lookupItemByName ( ComponentItemInterface::Name const & name ) const
pure virtual

Gets a pointer to the component related-object with the specified key name name. This function is called when loading a system or when a component is duplicated.

Parameters
[in] name The key name of a component.
Returns
The pointer to the component.

◆ lookupItemByTitle()

virtual ComponentItemInterface* SystemComponentManagerInterface::lookupItemByTitle ( ComponentItemInterface::Title const & title ) const
pure virtual

Gets a pointer to the component related-object with the specified title title. This function is called when a component is drag and drop in the System Editor.

Parameters
[in] title The title of a component.
Returns
The pointer to the component.
The documentation for this class was generated from the following file:
  • SystemComponentManagerInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemComponentManagerInterface Member List

This is the complete list of members for SystemComponentManagerInterface, including all inherited members.

listTitlesByType(ComponentItemInterface::Type const &type) const =0 | SystemComponentManagerInterface | pure virtual
loadFromDirectory(QDir const &directory)=0 | SystemComponentManagerInterface | pure virtual
lookupItemByName(ComponentItemInterface::Name const &name) const =0 | SystemComponentManagerInterface | pure virtual
lookupItemByTitle(ComponentItemInterface::Title const &title) const =0 | SystemComponentManagerInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentMapInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
SystemComponentMapInterface Class Referenceabstract

This class manages the registration and deregistration of objects defining components (component related-objects) belonging to a system. More...

Inherits QObject.

Inherited by SystemComponentMapModel.

Public Types

using | ID = SystemComponentItemInterface::ID
The identifier of a component.
using | Item = SystemComponentItemInterface
The object defining the component.
using | Map = QMap< ID, Item * >
The container registering components belonging to a system.

Signals

void | added (SystemComponentMapInterface::Item *const component) const
Triggers signal to inform that the component component have been successfully added to the map (system). More...
void | cleared () const
Triggers signal to inform that all components have been successfully removed from the map (system).
void | mode (bool const &modify) const
Triggers signal to enable (when modify set to true) or disable (when set to false) the automatic repositioning of components in the System Editor. This signal is called when a system is loaded.
void | removed (SystemComponentMapInterface::Item *const component) const
Triggers signal to inform that the component component have been successfully removed from the map (system). More...

Public Member Functions

virtual bool | add (SystemComponentMapInterface::ID const &id, SystemComponentMapInterface::Item *const component)=0
Registers to the map the component related-object component under the key identifier id . This function is called when a system is loaded in the System Editor. More...
virtual bool | add (ComponentItemInterface const *const component, SystemComponentItemInterface::Position const &position)=0
Registers to the map the component related-object component and its position position on the System Editor. This function is called when a component is drag and drop into the System Editor. More...
virtual SystemComponentMapInterface::Iterator | begin ()=0
Gets an iterator pointing at the first component related-object in the map. More...
virtual SystemComponentMapInterface::ConstIterator | begin () const =0
Gets an iterator pointing at the first component related-object in the map (use for read-only since pointing at constant values). More...
virtual bool | clear ()=0
Deregisters or remove all the components from the map (system). More...
virtual bool | contains (SystemComponentMapInterface::ID const &id) const =0
Verifies if the map contains the component related-object under the key identifier id. More...
virtual SystemComponentMapInterface::Iterator | end ()=0
Gets an iterator pointing at the end of the map after the last component related-object. More...
virtual SystemComponentMapInterface::ConstIterator | end () const =0
Gets an iterator pointing at the end of the map after the last component related-object (use for read-only). More...
virtual SystemComponentMapInterface::ID | getID (SystemComponentMapInterface::Item *const item) const =0
Gets the key identifier of the component related-object item belonging to a system. More...
virtual SystemComponentMapInterface::Item * | getItem (SystemComponentMapInterface::ID const &id) const =0
Gets the component related-object under the key identifier id that belongs to a system. More...
virtual bool | remove (SystemComponentMapInterface::ID const &id)=0
Deregisters the component under the key identifier id from the map (i.e. remove it from the system). More...

Detailed Description

This class manages the registration and deregistration of objects defining components (component related-objects) belonging to a system.

Definition at line 22 of file SystemComponentMapInterface.h.

Member Function Documentation

◆ add() [1/2]

virtual bool SystemComponentMapInterface::add | ( | SystemComponentMapInterface::ID const & | id,
 |  | SystemComponentMapInterface::Item *const | component
 | ) |  |
pure virtual

Registers to the map the component related-object component under the key identifier id . This function is called when a system is loaded in the System Editor.

Parameters
[in] | id | The key identifier of the component.
[in] | component | The component related-object.
Returns
True if component successfully added.

◆ add() [2/2]

virtual bool SystemComponentMapInterface::add | ( | ComponentItemInterface const *const | component,
 |  | SystemComponentItemInterface::Position const & | position
 | ) |  |
pure virtual

Registers to the map the component related-object component and its position position on the System Editor. This function is called when a component is drag and drop into the System Editor.

Parameters
[in] | id | The key identifier of the component.
[in] | component | The component related-object.
Returns
True if component successfully added.

◆ added

void SystemComponentMapInterface::added ( SystemComponentMapInterface::Item *const component ) const
signal

Triggers signal to inform that the component component have been successfully added to the map (system).

Parameters
[in] component The pointer to object defining the component.

◆ begin() [1/2]

virtual SystemComponentMapInterface::Iterator SystemComponentMapInterface::begin ( )
pure virtual

Gets an iterator pointing at the first component related-object in the map.

Returns
The iterator pointing at the first object in the map.

◆ begin() [2/2]

virtual SystemComponentMapInterface::ConstIterator SystemComponentMapInterface::begin ( ) const
pure virtual

Gets an iterator pointing at the first component related-object in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

◆ clear()

virtual bool SystemComponentMapInterface::clear ( )
pure virtual

Deregisters or remove all the components from the map (system).

Returns
True if all components successfully removed.

◆ contains()

virtual bool SystemComponentMapInterface::contains ( SystemComponentMapInterface::ID const & id ) const
pure virtual

Verifies if the map contains the component related-object under the key identifier id.

Note
The system can have a component duplicated but registered with a different id in the map.
Parameters
[in] id The key id of the component.
Returns
True if component id already registered.

◆ end() [1/2]

virtual SystemComponentMapInterface::Iterator SystemComponentMapInterface::end ( )
pure virtual

Gets an iterator pointing at the end of the map after the last component related-object.

Returns
The iterator pointing at the end of the map.

◆ end() [2/2]

virtual SystemComponentMapInterface::ConstIterator SystemComponentMapInterface::end ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last component related-object (use for read-only).

Returns
The iterator pointing at the end of the map.

◆ getID()

virtual SystemComponentMapInterface::ID SystemComponentMapInterface::getID ( SystemComponentMapInterface::Item *const item ) const
pure virtual

Gets the key identifier of the component related-object item belonging to a system.

Parameters
[in] item The object defining the component.
Returns
The key identifier of the component in a system.

◆ getItem()

virtual SystemComponentMapInterface::Item* SystemComponentMapInterface::getItem ( SystemComponentMapInterface::ID const & id ) const
pure virtual

Gets the component related-object under the key identifier id that belongs to a system.

Parameters
[in] id The key identifier of the component in a system.
Returns
The pointer to object defining the component.

◆ remove()

virtual bool SystemComponentMapInterface::remove ( SystemComponentMapInterface::ID const & id )
pure virtual

Deregisters the component under the key identifier id from the map (i.e. remove it from the system).

Parameters
[in] id The key identifier of the component.
Returns
True if component successfully deregistered.

◆ removed

void SystemComponentMapInterface::removed ( SystemComponentMapInterface::Item *const component ) const
signal

Triggers signal to inform that the component component have been successfully removed from the map (system).

Parameters
[in] component The pointer to object defining the component.
The documentation for this class was generated from the following file:
  • SystemComponentMapInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemComponentMapInterface Member List

This is the complete list of members for SystemComponentMapInterface, including all inherited members.

add(SystemComponentMapInterface::ID const &id, SystemComponentMapInterface::Item *const component)=0 | SystemComponentMapInterface | pure virtual
add(ComponentItemInterface const *const component, SystemComponentItemInterface::Position const &position)=0 | SystemComponentMapInterface | pure virtual
added(SystemComponentMapInterface::Item *const component) const | SystemComponentMapInterface | signal
begin()=0 | SystemComponentMapInterface | pure virtual
begin() const =0 | SystemComponentMapInterface | pure virtual
clear()=0 | SystemComponentMapInterface | pure virtual
cleared() const | SystemComponentMapInterface | signal
contains(SystemComponentMapInterface::ID const &id) const =0 | SystemComponentMapInterface | pure virtual
end()=0 | SystemComponentMapInterface | pure virtual
end() const =0 | SystemComponentMapInterface | pure virtual
getID(SystemComponentMapInterface::Item *const item) const =0 | SystemComponentMapInterface | pure virtual
getItem(SystemComponentMapInterface::ID const &id) const =0 | SystemComponentMapInterface | pure virtual
ID typedef | SystemComponentMapInterface |
Item typedef | SystemComponentMapInterface |
Map typedef | SystemComponentMapInterface |
mode(bool const &modify) const | SystemComponentMapInterface | signal
remove(SystemComponentMapInterface::ID const &id)=0 | SystemComponentMapInterface | pure virtual
removed(SystemComponentMapInterface::Item *const component) const | SystemComponentMapInterface | signal
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentOutputItemInterface Class Reference

Public Member Functions | List of all members
SystemComponentOutputItemInterface Class Referenceabstract

This class defines the items constituing an output of a component registered in a system. These items are provided from the class defined in the Component Output Item Interface. This current class also provides access to the parent component where the output belongs to. This access allows retracing the connections by getting the output with its relative component (parent). More...

Inherits QObject.

Inherited by SystemComponentOutputItemModel.

Public Member Functions

virtual SystemComponentItemInterface * | getComponent () const =0
Gets the parent component where the current output belongs to. More...
virtual SystemComponentOutputItemInterface::ID | getID () const =0
Gets the key identifier of the current registered output. More...
virtual SystemComponentOutputItemInterface::Title | getTitle () const =0
Gets the title of the current registered output. More...
virtual SystemComponentOutputItemInterface::Type | getType () const =0
Gets the type of the current registered output. More...
virtual SystemComponentOutputItemInterface::Unit | getUnit () const =0
Gets the unit of the current registered output. More...

Detailed Description

This class defines the items constituing an output of a component registered in a system. These items are provided from the class defined in the Component Output Item Interface. This current class also provides access to the parent component where the output belongs to. This access allows retracing the connections by getting the output with its relative component (parent).

See also
ComponentOutputItemInterface.h

Definition at line 26 of file SystemComponentOutputItemInterface.h.

Member Function Documentation

◆ getComponent()

virtual SystemComponentItemInterface* SystemComponentOutputItemInterface::getComponent ( ) const
pure virtual

Gets the parent component where the current output belongs to.

Returns
The pointer to the parent component.

◆ getID()

virtual SystemComponentOutputItemInterface::ID SystemComponentOutputItemInterface::getID ( ) const
pure virtual

Gets the key identifier of the current registered output.

Returns
The key identifier of the output.

◆ getTitle()

virtual SystemComponentOutputItemInterface::Title SystemComponentOutputItemInterface::getTitle ( ) const
pure virtual

Gets the title of the current registered output.

Returns
The title of the output.

◆ getType()

virtual SystemComponentOutputItemInterface::Type SystemComponentOutputItemInterface::getType ( ) const
pure virtual

Gets the type of the current registered output.

Returns
The type of the output.

◆ getUnit()

virtual SystemComponentOutputItemInterface::Unit SystemComponentOutputItemInterface::getUnit ( ) const
pure virtual

Gets the unit of the current registered output.

Returns
The unit of the output.
The documentation for this class was generated from the following file:
  • SystemComponentOutputItemInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemComponentOutputItemInterface Member List

This is the complete list of members for SystemComponentOutputItemInterface, including all inherited members.

getComponent() const =0 | SystemComponentOutputItemInterface | pure virtual
getID() const =0 | SystemComponentOutputItemInterface | pure virtual
getTitle() const =0 | SystemComponentOutputItemInterface | pure virtual
getType() const =0 | SystemComponentOutputItemInterface | pure virtual
getUnit() const =0 | SystemComponentOutputItemInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentOutputMapInterface Class Reference

Public Types | Public Member Functions | List of all members
SystemComponentOutputMapInterface Class Referenceabstract

This class manages the registration and deregistration of outputs of a component registered in a system. More...

Inherits QObject.

Inherited by SystemComponentOutputMapModel.

Public Types

using | ID = SystemComponentOutputItemInterface::ID
The output's key identifier.
using | Item = SystemComponentOutputItemInterface
The object defining output.
using | Map = QMap< ID, Item * >
The container registering outputs.

Public Member Functions

virtual SystemComponentOutputMapInterface::Iterator | begin ()=0
Gets an iterator pointing at the first registered output in the map. More...
virtual SystemComponentOutputMapInterface::ConstIterator | begin () const =0
Gets an iterator pointing at the first registered output in the map (use for read-only since pointing at constant values). More...
virtual bool | contains (SystemComponentOutputMapInterface::ID const &id) const =0
Verifies if the map contains the output under the key identifier id. More...
virtual SystemComponentOutputMapInterface::Iterator | end ()=0
Gets an iterator pointing at the end of the map after the last registered output. More...
virtual SystemComponentOutputMapInterface::ConstIterator | end () const =0
Gets an iterator pointing at the end of the map after the last component output (use for read-only). More...
virtual SystemComponentOutputMapInterface::ID | getID (SystemComponentOutputMapInterface::Item *const item) const =0
Gets the key identifier of the component output related-object item as registered in the map. More...
virtual SystemComponentOutputMapInterface::Item * | getItem (SystemComponentOutputMapInterface::ID const &id) const =0
Gets the registered output related-object under the key identifier id. More...

Detailed Description

This class manages the registration and deregistration of outputs of a component registered in a system.

Definition at line 22 of file SystemComponentOutputMapInterface.h.

Member Function Documentation

◆ begin() [1/2]

virtual SystemComponentOutputMapInterface::Iterator SystemComponentOutputMapInterface::begin ( )
pure virtual

Gets an iterator pointing at the first registered output in the map.

Returns
The iterator pointing at the first output in map.

◆ begin() [2/2]

virtual SystemComponentOutputMapInterface::ConstIterator SystemComponentOutputMapInterface::begin ( ) const
pure virtual

Gets an iterator pointing at the first registered output in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first output in map.

◆ contains()

virtual bool SystemComponentOutputMapInterface::contains ( SystemComponentOutputMapInterface::ID const & id ) const
pure virtual

Verifies if the map contains the output under the key identifier id.

Parameters
[in] id The key id of an output.
Returns
True if output already registered.

◆ end() [1/2]

virtual SystemComponentOutputMapInterface::Iterator SystemComponentOutputMapInterface::end ( )
pure virtual

Gets an iterator pointing at the end of the map after the last registered output.

Returns
The iterator pointing at the end of the map.

◆ end() [2/2]

virtual SystemComponentOutputMapInterface::ConstIterator SystemComponentOutputMapInterface::end ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last component output (use for read-only).

Returns
The iterator pointing at the end of the map.

◆ getID()

virtual SystemComponentOutputMapInterface::ID SystemComponentOutputMapInterface::getID ( SystemComponentOutputMapInterface::Item *const item ) const
pure virtual

Gets the key identifier of the component output related-object item as registered in the map.

Parameters
[in] item The pointer to object defining the output.
Returns
The key identifier of the output.

◆ getItem()

virtual SystemComponentOutputMapInterface::Item* SystemComponentOutputMapInterface::getItem ( SystemComponentOutputMapInterface::ID const & id ) const
pure virtual

Gets the registered output related-object under the key identifier id.

Parameters
[in] id The key identifier of the output.
Returns
The pointer to object defining the output.
The documentation for this class was generated from the following file:
  • SystemComponentOutputMapInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemComponentOutputMapInterface Member List

This is the complete list of members for SystemComponentOutputMapInterface, including all inherited members.

begin()=0 | SystemComponentOutputMapInterface | pure virtual
begin() const =0 | SystemComponentOutputMapInterface | pure virtual
contains(SystemComponentOutputMapInterface::ID const &id) const =0 | SystemComponentOutputMapInterface | pure virtual
end()=0 | SystemComponentOutputMapInterface | pure virtual
end() const =0 | SystemComponentOutputMapInterface | pure virtual
getID(SystemComponentOutputMapInterface::Item *const item) const =0 | SystemComponentOutputMapInterface | pure virtual
getItem(SystemComponentOutputMapInterface::ID const &id) const =0 | SystemComponentOutputMapInterface | pure virtual
ID typedef | SystemComponentOutputMapInterface |
Item typedef | SystemComponentOutputMapInterface |
Map typedef | SystemComponentOutputMapInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterItemInterface Class Reference

Signals | Public Member Functions | List of all members
SystemComponentParameterItemInterface Class Referenceabstract

This class defines the items constituing a parameter of a component registered in a system. These items are provided from the class defined in the Component Parameter Item Interface. They are not modifiable in this class except the Value through callbacks defined for the System Editor. More...

Inherits QObject.

Inherited by SystemComponentParameterItemModel.

Signals

void modifiedValue () const
Triggers signal to inform that the value of the registered parameter has been modified.

Public Member Functions

virtual SystemComponentParameterItemInterface::ID | getID () const =0
Gets the key identifier of the current registered parameter. More...
virtual SystemComponentParameterItemInterface::Title | getTitle () const =0
Gets the title of the current registered parameter. More...
virtual SystemComponentParameterItemInterface::Type | getType () const =0
Gets the type of the current registered parameter. More...
virtual SystemComponentParameterItemInterface::Unit | getUnit () const =0
Gets the unit of the current registered parameter. More...
virtual SystemComponentParameterItemInterface::Value | getValue () const =0
Gets the value of the current registered parameter. More...
virtual bool | setValue (SystemComponentParameterItemInterface::Value const &value)=0
Sets the value of the current registered parameter. More...

Detailed Description

This class defines the items constituing a parameter of a component registered in a system. These items are provided from the class defined in the Component Parameter Item Interface. They are not modifiable in this class except the Value through callbacks defined for the System Editor.

See also
ComponentParameterItemInterface.h

Definition at line 23 of file SystemComponentParameterItemInterface.h.

Member Function Documentation

◆ getID()

virtual SystemComponentParameterItemInterface::ID SystemComponentParameterItemInterface::getID ( ) const
pure virtual

Gets the key identifier of the current registered parameter.

Returns
The key identifier of the parameter.

◆ getTitle()

virtual SystemComponentParameterItemInterface::Title SystemComponentParameterItemInterface::getTitle ( ) const
pure virtual

Gets the title of the current registered parameter.

Returns
The title of the parameter.

◆ getType()

virtual SystemComponentParameterItemInterface::Type SystemComponentParameterItemInterface::getType ( ) const
pure virtual

Gets the type of the current registered parameter.

Returns
The type of the parameter.

◆ getUnit()

virtual SystemComponentParameterItemInterface::Unit SystemComponentParameterItemInterface::getUnit ( ) const
pure virtual

Gets the unit of the current registered parameter.

Returns
The unit of the parameter.

◆ getValue()

virtual SystemComponentParameterItemInterface::Value SystemComponentParameterItemInterface::getValue ( ) const
pure virtual

Gets the value of the current registered parameter.

Returns
The value of the parameter.

◆ setValue()

virtual bool SystemComponentParameterItemInterface::setValue ( SystemComponentParameterItemInterface::Value const & value )
pure virtual

Sets the value of the current registered parameter.

Returns
True if the parameter value successfully modified.
The documentation for this class was generated from the following file:
  • SystemComponentParameterItemInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemComponentParameterItemInterface Member List

This is the complete list of members for SystemComponentParameterItemInterface, including all inherited members.

getID() const =0 | SystemComponentParameterItemInterface | pure virtual
getTitle() const =0 | SystemComponentParameterItemInterface | pure virtual
getType() const =0 | SystemComponentParameterItemInterface | pure virtual
getUnit() const =0 | SystemComponentParameterItemInterface | pure virtual
getValue() const =0 | SystemComponentParameterItemInterface | pure virtual
modifiedValue() const | SystemComponentParameterItemInterface | signal
setValue(SystemComponentParameterItemInterface::Value const &value)=0 | SystemComponentParameterItemInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentParameterMapInterface Class Reference

Public Types | Public Member Functions | List of all members
SystemComponentParameterMapInterface Class Referenceabstract

This class manages the registration and deregistration of parameters of a component registered in a system. More...

Inherits QObject.

Inherited by SystemComponentParameterMapModel.

Public Types

using | ID = SystemComponentParameterItemInterface::ID
The parameter's key identifier.
using | Item = SystemComponentParameterItemInterface
The object defining the parameter.
using | Map = QMap< ID, Item * >
The container registering parameters.

Public Member Functions

virtual SystemComponentParameterMapInterface::Iterator | begin ()=0
Gets an iterator pointing at the first registered parameter in the map. More...
virtual SystemComponentParameterMapInterface::ConstIterator | begin () const =0
Gets an iterator pointing at the first registerede parameter in the map (use for read-only since pointing at constant values). More...
virtual int | count () const =0
Counts the number of parameters registered for a component. More...
virtual SystemComponentParameterMapInterface::Iterator | end ()=0
Gets an iterator pointing at the end of the map after the last registered parameter. More...
virtual SystemComponentParameterMapInterface::ConstIterator | end () const =0
Gets an iterator pointing at the end of the map after the last registered parameter (use for read-only). More...
virtual SystemComponentParameterMapInterface::ID | getID (SystemComponentParameterMapInterface::Item *const item) const =0
Gets the key identifier of the registered parameter related-object item in the map. More...
virtual SystemComponentParameterMapInterface::Item * | getItem (SystemComponentParameterMapInterface::ID const &id) const =0
Gets the registered parameter related-object under the key identifier id. More...

Detailed Description

This class manages the registration and deregistration of parameters of a component registered in a system.

Definition at line 22 of file SystemComponentParameterMapInterface.h.

Member Function Documentation

◆ begin() [1/2]

virtual SystemComponentParameterMapInterface::Iterator SystemComponentParameterMapInterface::begin ( )
pure virtual

Gets an iterator pointing at the first registered parameter in the map.

Returns
The iterator pointing at the first parameter in the map.

◆ begin() [2/2]

virtual SystemComponentParameterMapInterface::ConstIterator SystemComponentParameterMapInterface::begin ( ) const
pure virtual

Gets an iterator pointing at the first registerede parameter in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first parameter in the map.

◆ count()

virtual int SystemComponentParameterMapInterface::count ( ) const
pure virtual

Counts the number of parameters registered for a component.

Returns
The number of parameters registered.

◆ end() [1/2]

virtual SystemComponentParameterMapInterface::Iterator SystemComponentParameterMapInterface::end ( )
pure virtual

Gets an iterator pointing at the end of the map after the last registered parameter.

Returns
The iterator pointing at the end of the map.

◆ end() [2/2]

virtual SystemComponentParameterMapInterface::ConstIterator SystemComponentParameterMapInterface::end ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last registered parameter (use for read-only).

Returns
The iterator pointing at the end of the map.

◆ getID()

virtual SystemComponentParameterMapInterface::ID SystemComponentParameterMapInterface::getID ( SystemComponentParameterMapInterface::Item *const item ) const
pure virtual

Gets the key identifier of the registered parameter related-object item in the map.

Parameters
[in] item The pointer to object defining the parameter.
Returns
The key identifier of the parameter.

◆ getItem()

virtual SystemComponentParameterMapInterface::Item* SystemComponentParameterMapInterface::getItem ( SystemComponentParameterMapInterface::ID const & id ) const
pure virtual

Gets the registered parameter related-object under the key identifier id.

Parameters
[in] id The key identifier of the registered parameter.
Returns
The pointer to object defining the parameter.
The documentation for this class was generated from the following file:
  • SystemComponentParameterMapInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemComponentParameterMapInterface Member List

This is the complete list of members for SystemComponentParameterMapInterface, including all inherited members.

begin()=0 | SystemComponentParameterMapInterface | pure virtual
begin() const =0 | SystemComponentParameterMapInterface | pure virtual
count() const =0 | SystemComponentParameterMapInterface | pure virtual
end()=0 | SystemComponentParameterMapInterface | pure virtual
end() const =0 | SystemComponentParameterMapInterface | pure virtual
getID(SystemComponentParameterMapInterface::Item *const item) const =0 | SystemComponentParameterMapInterface | pure virtual
getItem(SystemComponentParameterMapInterface::ID const &id) const =0 | SystemComponentParameterMapInterface | pure virtual
ID typedef | SystemComponentParameterMapInterface |
Item typedef | SystemComponentParameterMapInterface |
Map typedef | SystemComponentParameterMapInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemComponentScheduleInterface Class Reference

Signals | Public Member Functions | List of all members
SystemComponentScheduleInterface Class Referenceabstract

This class defines the simulation schedule related parameters of a component registered in a system: More...

Inherits QObject.

Inherited by SystemComponentScheduleModel.

Signals

void | modifiedCycle () const
Triggers signal to inform that the Cycle Time of the component has been modified.
void | modifiedOffset () const
Triggers signal to inform that the Offset Time of the component has been modified.
void | modifiedPriority () const
Triggers signal to inform that the Priority of the component has been modified.
void | modifiedResponse () const
Triggers signal to inform that the Response Time of the component has been modified.

Public Member Functions

virtual SystemComponentScheduleInterface::Cycle | getCycle () const =0
Gets the Cycle Time for the current registered component. More...
virtual SystemComponentScheduleInterface::Offset | getOffset () const =0
Gets the Offset Time for the current registered component. More...
virtual SystemComponentScheduleInterface::Priority | getPriority () const =0
Gets the Priority for the current registered component. More...
virtual SystemComponentScheduleInterface::Response | getResponse () const =0
Gets the Response Time for the current registered component. More...
virtual bool | setCycle (SystemComponentScheduleInterface::Cycle const &cycle)=0
Sets the Cycle Time for the current registered component. More...
virtual bool | setOffset (SystemComponentScheduleInterface::Offset const &offset)=0
Sets the Priority for the current registered component. More...
virtual bool | setPriority (SystemComponentScheduleInterface::Priority const &priority)=0
Sets the Priority for the current registered component. More...
virtual bool | setResponse (SystemComponentScheduleInterface::Response const &response)=0
Sets the Response Time for the current registered component. More...

Detailed Description

This class defines the simulation schedule related parameters of a component registered in a system:

  • Priority
  • Offset Time
  • Cycle Time
  • Response Time

Definition at line 25 of file SystemComponentScheduleInterface.h.

Member Function Documentation

◆ getCycle()

virtual SystemComponentScheduleInterface::Cycle SystemComponentScheduleInterface::getCycle ( ) const
pure virtual

Gets the Cycle Time for the current registered component.

Returns
The Cycle Time.

◆ getOffset()

virtual SystemComponentScheduleInterface::Offset SystemComponentScheduleInterface::getOffset ( ) const
pure virtual

Gets the Offset Time for the current registered component.

Returns
The Offset Time.

◆ getPriority()

virtual SystemComponentScheduleInterface::Priority SystemComponentScheduleInterface::getPriority ( ) const
pure virtual

Gets the Priority for the current registered component.

Returns
The Priority.

◆ getResponse()

virtual SystemComponentScheduleInterface::Response SystemComponentScheduleInterface::getResponse ( ) const
pure virtual

Gets the Response Time for the current registered component.

Returns
The Response Time.

◆ setCycle()

virtual bool SystemComponentScheduleInterface::setCycle ( SystemComponentScheduleInterface::Cycle const & cycle )
pure virtual

Sets the Cycle Time for the current registered component.

Returns
True if the Cycle Time successfully modified.

◆ setOffset()

virtual bool SystemComponentScheduleInterface::setOffset ( SystemComponentScheduleInterface::Offset const & offset )
pure virtual

Sets the Priority for the current registered component.

Returns
True if the Offset Time successfully modified.

◆ setPriority()

virtual bool SystemComponentScheduleInterface::setPriority ( SystemComponentScheduleInterface::Priority const & priority )
pure virtual

Sets the Priority for the current registered component.

Returns
True if the Priority successfully modified.

◆ setResponse()

virtual bool SystemComponentScheduleInterface::setResponse ( SystemComponentScheduleInterface::Response const & response )
pure virtual

Sets the Response Time for the current registered component.

Returns
True if the Response Time successfully modified.
The documentation for this class was generated from the following file:
  • SystemComponentScheduleInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemComponentScheduleInterface Member List

This is the complete list of members for SystemComponentScheduleInterface, including all inherited members.

getCycle() const =0 | SystemComponentScheduleInterface | pure virtual
getOffset() const =0 | SystemComponentScheduleInterface | pure virtual
getPriority() const =0 | SystemComponentScheduleInterface | pure virtual
getResponse() const =0 | SystemComponentScheduleInterface | pure virtual
modifiedCycle() const | SystemComponentScheduleInterface | signal
modifiedOffset() const | SystemComponentScheduleInterface | signal
modifiedPriority() const | SystemComponentScheduleInterface | signal
modifiedResponse() const | SystemComponentScheduleInterface | signal
setCycle(SystemComponentScheduleInterface::Cycle const &cycle)=0 | SystemComponentScheduleInterface | pure virtual
setOffset(SystemComponentScheduleInterface::Offset const &offset)=0 | SystemComponentScheduleInterface | pure virtual
setPriority(SystemComponentScheduleInterface::Priority const &priority)=0 | SystemComponentScheduleInterface | pure virtual
setResponse(SystemComponentScheduleInterface::Response const &response)=0 | SystemComponentScheduleInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemConnectionItemInterface Class Reference

Public Types | Public Member Functions | List of all members
SystemConnectionItemInterface Class Referenceabstract

This class defines the items constituing the connection that is established between two components of a system: More...

Inherits QObject.

Inherited by SystemConnectionItemModel.

Public Types

using | ID = unsigned int
The identifie of a connection between two components.
using | Source = SystemComponentOutputItemInterface
The output of a component of a system (connection extremity)
using | Target = SystemComponentInputItemInterface
The input of a component of a system (connection extremity)

Public Member Functions

virtual SystemConnectionItemInterface::ID | getID () const =0
Gets the key identifier of this connection in accordance to the system. More...
virtual SystemConnectionItemInterface::Source const * | getSource () const =0
Gets the starting of a connection which is the output of a component. More...
virtual SystemConnectionItemInterface::Target const * | getTarget () const =0
Gets the ending of a connection which is the input of a component. More...
virtual bool | isCompatible () const =0
Verifies if the output source of a component is compatible with the input target of the component selected to be connected to. It checks if these two items have the same type and unit. More...

Detailed Description

This class defines the items constituing the connection that is established between two components of a system:

  • the key identifier (must be UNIQUE)
  • the output "source" of a component (starting of the connection)
  • the input "target" of a component (ending of the connection) This class includes a method for checking the plausibility of a connection between two components (the output "source" and input "target" must have the same type and unit).

Definition at line 27 of file SystemConnectionItemInterface.h.

Member Function Documentation

◆ getID()

virtual SystemConnectionItemInterface::ID SystemConnectionItemInterface::getID ( ) const
pure virtual

Gets the key identifier of this connection in accordance to the system.

Returns
The key identifier of the connection in a system.

◆ getSource()

virtual SystemConnectionItemInterface::Source const* SystemConnectionItemInterface::getSource ( ) const
pure virtual

Gets the starting of a connection which is the output of a component.

Returns
The pointer to output (connection starting).

◆ getTarget()

virtual SystemConnectionItemInterface::Target const* SystemConnectionItemInterface::getTarget ( ) const
pure virtual

Gets the ending of a connection which is the input of a component.

Returns
The pointer to input (connection ending).

◆ isCompatible()

virtual bool SystemConnectionItemInterface::isCompatible ( ) const
pure virtual

Verifies if the output source of a component is compatible with the input target of the component selected to be connected to. It checks if these two items have the same type and unit.

Note
The items that have no units can be connected to any other item.
Returns
True if connection is plausible.
The documentation for this class was generated from the following file:
  • SystemConnectionItemInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemConnectionItemInterface Member List

This is the complete list of members for SystemConnectionItemInterface, including all inherited members.

getID() const =0 | SystemConnectionItemInterface | pure virtual
getSource() const =0 | SystemConnectionItemInterface | pure virtual
getTarget() const =0 | SystemConnectionItemInterface | pure virtual
ID typedef | SystemConnectionItemInterface |
isCompatible() const =0 | SystemConnectionItemInterface | pure virtual
Source typedef | SystemConnectionItemInterface |
Target typedef | SystemConnectionItemInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemConnectionMapInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
SystemConnectionMapInterface Class Referenceabstract

This class manages the registration and deregistration of objects defining connections (connection related-objects) that model the data flow between the components constituing a system. More...

Inherits QObject.

Inherited by SystemConnectionMapModel.

Public Types

using | Component = SystemComponentItemInterface
The component of a system.
using | ID = SystemConnectionItemInterface::ID
The identifier of a connection.
using | Item = SystemConnectionItemInterface
The object defining the connection.
using | Map = QMap< ID, Item * >
The container registering the connections.
using | Source = SystemConnectionItemInterface::Source
The output of a component of a system (connection extremity)
using | Target = SystemConnectionItemInterface::Target
The input of a component of a system (connection extremity)

Signals

void | mode (bool const &modify) const
Triggers signal to enable (when modify set to true) or disable (when set to false) the automatic repositioning of components in the System Editor. This signal is called when a system is loaded.
void | modified () const
Triggers signal to inform that connections have been modified (Called to update the View in the System Editor).

Public Member Functions

virtual bool | add (SystemConnectionMapInterface::ID const &id, SystemConnectionMapInterface::Source const *const source, SystemConnectionMapInterface::Target const *const target)=0
Registers to the map the connection related-object under the key identifier id and with the pair of items the starting and the ending of the connection respectively source and target. This function is called when a system is loaded in the System Editor. More...
virtual bool | add (SystemConnectionMapInterface::Source const *const source, SystemConnectionMapInterface::Target const *const target)=0
Registers to the map the connection related-object with the items source and target corresponding to the starting and ending of a connection between two components in a system. This function is called when two components are connected in the Sytem Editor. More...
virtual SystemConnectionMapInterface::Iterator | begin ()=0
Gets an iterator pointing at the first connection related-object in the map. More...
virtual SystemConnectionMapInterface::ConstIterator | begin () const =0
Gets an iterator pointing at the first connection related-object in the map (use for read-only since pointing at constant values). More...
virtual bool | clear ()=0
Deregisters or remove all the connections from the map (system). More...
virtual bool | contains (SystemConnectionMapInterface::Source const *const source, SystemConnectionMapInterface::Target const *const target) const =0
Verifies if the map contains the connection related-object with the items source and target corresponding to the start and ending of a connection. More...
virtual SystemConnectionMapInterface::Iterator | end ()=0
Gets an iterator pointing at the end of the map after the last connection related-object. More...
virtual SystemConnectionMapInterface::ConstIterator | end () const =0
Gets an iterator pointing at the end of the map after the last connection related-object (use for read-only). More...
virtual SystemConnectionMapInterface::ID | getID (SystemConnectionMapInterface::Item *const item) const =0
Gets the key identifier of the connection related-object item belonging to a system. More...
virtual SystemConnectionMapInterface::Item * | getItem (SystemConnectionMapInterface::ID const &id) const =0
Gets the connection related-object under the key identifier id that belongs to a system. More...
virtual bool | remove (SystemConnectionMapInterface::Component const *const component)=0
Deregisters from the map the connections getting out from and getting in to the component component. More...
virtual bool | remove (SystemConnectionMapInterface::Source const *const source)=0
Deregisters from the map the connection starting from the output source. More...
virtual bool | remove (SystemConnectionMapInterface::Target const *const target)=0
Deregisters from the map the connection ending to the input target. More...

Detailed Description

This class manages the registration and deregistration of objects defining connections (connection related-objects) that model the data flow between the components constituing a system.

Definition at line 25 of file SystemConnectionMapInterface.h.

Member Function Documentation

◆ add() [1/2]

virtual bool SystemConnectionMapInterface::add | ( | SystemConnectionMapInterface::ID const & | id,
 |  | SystemConnectionMapInterface::Source const *const | source,
 |  | SystemConnectionMapInterface::Target const *const | target
 | ) |  |
pure virtual

Registers to the map the connection related-object under the key identifier id and with the pair of items the starting and the ending of the connection respectively source and target. This function is called when a system is loaded in the System Editor.

Parameters
[in] | id | The key identifier of the connection.
[in] | source | The pointer to output (connection starting).
[in] | target | The pointer to input (connection ending).
Returns
True if connection successfully added.

◆ add() [2/2]

virtual bool SystemConnectionMapInterface::add | ( | SystemConnectionMapInterface::Source const *const | source,
 |  | SystemConnectionMapInterface::Target const *const | target
 | ) |  |
pure virtual

Registers to the map the connection related-object with the items source and target corresponding to the starting and ending of a connection between two components in a system. This function is called when two components are connected in the Sytem Editor.

Parameters
[in] | source | The pointer to output (connection starting).
[in] | target | The pointer to input (connection ending).
Returns
True if connection successfully added.

◆ begin() [1/2]

virtual SystemConnectionMapInterface::Iterator SystemConnectionMapInterface::begin ( )
pure virtual

Gets an iterator pointing at the first connection related-object in the map.

Returns
The iterator pointing at the first object in the map.

◆ begin() [2/2]

virtual SystemConnectionMapInterface::ConstIterator SystemConnectionMapInterface::begin ( ) const
pure virtual

Gets an iterator pointing at the first connection related-object in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

◆ clear()

virtual bool SystemConnectionMapInterface::clear ( )
pure virtual

Deregisters or remove all the connections from the map (system).

Returns
True if all connections successfully removed.

◆ contains()

virtual bool SystemConnectionMapInterface::contains | ( | SystemConnectionMapInterface::Source const *const | source,
 |  | SystemConnectionMapInterface::Target const *const | target
 | ) |  | const
 pure virtual

Verifies if the map contains the connection related-object with the items source and target corresponding to the start and ending of a connection.

Parameters
[in] | source | The pointer to output (connection starting).
[in] | target | The pointer to input (connection ending).
Returns
True if connection already registered.

◆ end() [1/2]

virtual SystemConnectionMapInterface::Iterator SystemConnectionMapInterface::end ( )
pure virtual

Gets an iterator pointing at the end of the map after the last connection related-object.

Returns
The iterator pointing at the end of the map.

◆ end() [2/2]

virtual SystemConnectionMapInterface::ConstIterator SystemConnectionMapInterface::end ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last connection related-object (use for read-only).

Returns
The iterator pointing at the end of the map.

◆ getID()

virtual SystemConnectionMapInterface::ID SystemConnectionMapInterface::getID ( SystemConnectionMapInterface::Item *const item ) const
pure virtual

Gets the key identifier of the connection related-object item belonging to a system.

Parameters
[in] item The pointer to object defining the connection.
Returns
The key identifier of the connection in a system.

◆ getItem()

virtual SystemConnectionMapInterface::Item* SystemConnectionMapInterface::getItem ( SystemConnectionMapInterface::ID const & id ) const
pure virtual

Gets the connection related-object under the key identifier id that belongs to a system.

Parameters
[in] id The key identifier of the connection in a system.
Returns
The pointer to object defining the connection.

◆ remove() [1/3]

virtual bool SystemConnectionMapInterface::remove ( SystemConnectionMapInterface::Component const *const component )
pure virtual

Deregisters from the map the connections getting out from and getting in to the component component.

Parameters
[in] component The pointer to component related-object.
Returns
True if connection successfully deregistered.

◆ remove() [2/3]

virtual bool SystemConnectionMapInterface::remove ( SystemConnectionMapInterface::Source const *const source )
pure virtual

Deregisters from the map the connection starting from the output source.

Parameters
[in] source The pointer to output (connection starting).
Returns
True if connection successfully deregistered.

◆ remove() [3/3]

virtual bool SystemConnectionMapInterface::remove ( SystemConnectionMapInterface::Target const *const target )
pure virtual

Deregisters from the map the connection ending to the input target.

Parameters
[in] target The pointer to input (connection ending).
Returns
True if connection successfully deregistered.
The documentation for this class was generated from the following file:
  • SystemConnectionMapInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemConnectionMapInterface Member List

This is the complete list of members for SystemConnectionMapInterface, including all inherited members.

add(SystemConnectionMapInterface::ID const &id, SystemConnectionMapInterface::Source const *const source, SystemConnectionMapInterface::Target const *const target)=0 | SystemConnectionMapInterface | pure virtual
add(SystemConnectionMapInterface::Source const *const source, SystemConnectionMapInterface::Target const *const target)=0 | SystemConnectionMapInterface | pure virtual
begin()=0 | SystemConnectionMapInterface | pure virtual
begin() const =0 | SystemConnectionMapInterface | pure virtual
clear()=0 | SystemConnectionMapInterface | pure virtual
Component typedef | SystemConnectionMapInterface |
contains(SystemConnectionMapInterface::Source const *const source, SystemConnectionMapInterface::Target const *const target) const =0 | SystemConnectionMapInterface | pure virtual
end()=0 | SystemConnectionMapInterface | pure virtual
end() const =0 | SystemConnectionMapInterface | pure virtual
getID(SystemConnectionMapInterface::Item *const item) const =0 | SystemConnectionMapInterface | pure virtual
getItem(SystemConnectionMapInterface::ID const &id) const =0 | SystemConnectionMapInterface | pure virtual
ID typedef | SystemConnectionMapInterface |
Item typedef | SystemConnectionMapInterface |
Map typedef | SystemConnectionMapInterface |
mode(bool const &modify) const | SystemConnectionMapInterface | signal
modified() const | SystemConnectionMapInterface | signal
remove(SystemConnectionMapInterface::Component const *const component)=0 | SystemConnectionMapInterface | pure virtual
remove(SystemConnectionMapInterface::Source const *const source)=0 | SystemConnectionMapInterface | pure virtual
remove(SystemConnectionMapInterface::Target const *const target)=0 | SystemConnectionMapInterface | pure virtual
Source typedef | SystemConnectionMapInterface |
Target typedef | SystemConnectionMapInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemInterface Class Reference

Signals | Public Member Functions | List of all members
SystemInterface Class Referenceabstract

This class manages creating new systems and also creating the tree of components loaded from a library and used to build systems. More...

Inherits QObject, and ServiceInterface< Interface, ID >.

Inherited by SystemModel.

Signals

void | cleared () const
Triggers signal to inform that a system has been reset successfully (e.g. used to update the System Editor when users pressing on <New system>=""> button).
void | loaded () const
Triggers signal to inform that a system has been loaded successfully (e.g. used to update the System Editor when users pressing on <Load system>=""> button).
void | saved () const
Triggers signal to inform that a system has been saved successfully.

Public Member Functions

virtual bool | clear ()=0
Resets the system (e.g. function called when users pressing on <New> button in the System Editor). More...
virtual SystemComponentManagerInterface * | getComponents () const =0
Creates an object managing the load and search of components. More...
virtual SystemMapInterface * | getSystems () const =0
Creates a map (container) to register systems. More...
virtual bool | load (QString const &filepath)=0
Loads a system from a file located in the given path filepath. (e.g. function called when users pressing on <Load> button in the System Editor). More...
virtual bool | load (QIODevice *const device)=0
Loads a system from the file device. More...
virtual bool | save (QString const &filepath) const =0
Saves a system to a file stored in the given path filepath. (e.g. function called when users pressing on <Save> button in the System Editor). More...
virtual bool | save (QIODevice *const device) const =0
Saves a system to the file device. More...

Detailed Description

This class manages creating new systems and also creating the tree of components loaded from a library and used to build systems.

Definition at line 27 of file SystemInterface.h.

Member Function Documentation

◆ clear()

virtual bool SystemInterface::clear ( )
pure virtual

Resets the system (e.g. function called when users pressing on <New> button in the System Editor).

Returns
True if system successfully reset.

◆ getComponents()

virtual SystemComponentManagerInterface* SystemInterface::getComponents ( ) const
pure virtual

Creates an object managing the load and search of components.

Returns
The pointer to object managing the components library.

◆ getSystems()

virtual SystemMapInterface* SystemInterface::getSystems ( ) const
pure virtual

Creates a map (container) to register systems.

Returns
The map registering systems.

◆ load() [1/2]

virtual bool SystemInterface::load ( QString const & filepath )
pure virtual

Loads a system from a file located in the given path filepath. (e.g. function called when users pressing on <Load> button in the System Editor).

Parameters
[in] filepath The path locating the file defining the system.
Returns
True if system successfully loaded.

◆ load() [2/2]

virtual bool SystemInterface::load ( QIODevice *const device )
pure virtual

Loads a system from the file device.

Parameters
[in] device The file defining the system.
Returns
True if system successfully loaded.

◆ save() [1/2]

virtual bool SystemInterface::save ( QString const & filepath ) const
pure virtual

Saves a system to a file stored in the given path filepath. (e.g. function called when users pressing on <Save> button in the System Editor).

Parameters
[in] filepath The path for storing the file defining the system.
Returns
True if system successfully saved.

◆ save() [2/2]

virtual bool SystemInterface::save ( QIODevice *const device ) const
pure virtual

Saves a system to the file device.

Parameters
[in] device The file defining the system.
Returns
True if system successfully saved.
The documentation for this class was generated from the following file:
  • SystemInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemInterface Member List

This is the complete list of members for SystemInterface, including all inherited members.

clear()=0 | SystemInterface | pure virtual
cleared() const | SystemInterface | signal
getComponents() const =0 | SystemInterface | pure virtual
getSystems() const =0 | SystemInterface | pure virtual
load(QString const &filepath)=0 | SystemInterface | pure virtual
load(QIODevice *const device)=0 | SystemInterface | pure virtual
loaded() const | SystemInterface | signal
save(QString const &filepath) const =0 | SystemInterface | pure virtual
save(QIODevice *const device) const =0 | SystemInterface | pure virtual
saved() const | SystemInterface | signal
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemItemInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
SystemItemInterface Class Referenceabstract

This class defines the items constituing a system: More...

Inherits QObject.

Inherited by SystemItemModel.

Public Types

using | ComponentMap = SystemComponentMapInterface
The container registering the components of the system.
using | ConnectionMap = SystemConnectionMapInterface
The container registering the connections.
using | ID = unsigned int
The identifier of the system.
using | Priority = unsigned int
The parameter Priority for the system.
using | Title = QString
The title for the system.

Signals

void | modifiedPriority () const
Triggers signal to inform that the priority of a system has been modified.
void | modifiedTitle () const
Triggers signal to inform that the title of a system has been modified.

Public Member Functions

virtual QList< SystemConnectionMapInterface::Source const * > | getCompatibleSources (SystemConnectionMapInterface::Target const *const target)=0
Gets a list of outputs of components constituing the current system. These outputs are checked to be compatible (same type and same unit) with the selected component input target. This function is called to highlight these outputs in the System Editor to help the users connecting the target input with the compatible outputs. More...
virtual QList< SystemConnectionMapInterface::Target const * > | getCompatibleTargets (SystemConnectionMapInterface::Source const *const source)=0
Gets a list of inputs of components constituing the current system. These inputs are checked to be compatible (same type and same unit) with the selected component output source. This function is called to highlight these inputs in the System Editor to help the users connecting the source output with the compatible inputs. More...
virtual SystemItemInterface::ComponentMap * | getComponents () const =0
Creates a map to register components that build the system. More...
virtual SystemItemInterface::ConnectionMap * | getConnections () const =0
Creates a map to register connections that link the components of the system. More...
virtual SystemItemInterface::ID | getID () const =0
Gets from the map (container) the key identifier of the current registered system. More...
virtual SystemItemInterface::Priority | getPriority () const =0
Gets the priority of the current registered system. More...
virtual SystemItemInterface::Title | getTitle () const =0
Gets the title of the current registered system. More...
virtual bool | setPriority (SystemItemInterface::Priority const &priority)=0
Sets a priority to the current registered system. More...
virtual bool | setTitle (SystemItemInterface::Title const &title)=0
Sets a title to the current registered system. More...

Detailed Description

This class defines the items constituing a system:

  • the key identifier (must be UNIQUE)
  • the title (modifiable)
  • the parameter Priority
  • the components building it
  • the connections linking the components

Definition at line 26 of file SystemItemInterface.h.

Member Function Documentation

◆ getCompatibleSources()

virtual QList<SystemConnectionMapInterface::Source const *> SystemItemInterface::getCompatibleSources ( SystemConnectionMapInterface::Target const *const target )
pure virtual

Gets a list of outputs of components constituing the current system. These outputs are checked to be compatible (same type and same unit) with the selected component input target. This function is called to highlight these outputs in the System Editor to help the users connecting the target input with the compatible outputs.

Parameters
[in] target The pointer to input of a component registered in the system.
Returns
The outputs of components registered in the system.

◆ getCompatibleTargets()

virtual QList<SystemConnectionMapInterface::Target const *> SystemItemInterface::getCompatibleTargets ( SystemConnectionMapInterface::Source const *const source )
pure virtual

Gets a list of inputs of components constituing the current system. These inputs are checked to be compatible (same type and same unit) with the selected component output source. This function is called to highlight these inputs in the System Editor to help the users connecting the source output with the compatible inputs.

Parameters
[in] source The pointer to output of a component registered in the system.
Returns
The inputs of components registered in the system.

◆ getComponents()

virtual SystemItemInterface::ComponentMap* SystemItemInterface::getComponents ( ) const
pure virtual

Creates a map to register components that build the system.

Returns
The map registering componentsof the system.

◆ getConnections()

virtual SystemItemInterface::ConnectionMap* SystemItemInterface::getConnections ( ) const
pure virtual

Creates a map to register connections that link the components of the system.

Returns
The map registering connections inside the system.

◆ getID()

virtual SystemItemInterface::ID SystemItemInterface::getID ( ) const
pure virtual

Gets from the map (container) the key identifier of the current registered system.

Returns
The key identifier of the current system.

◆ getPriority()

virtual SystemItemInterface::Priority SystemItemInterface::getPriority ( ) const
pure virtual

Gets the priority of the current registered system.

Returns
The priority of the system.

◆ getTitle()

virtual SystemItemInterface::Title SystemItemInterface::getTitle ( ) const
pure virtual

Gets the title of the current registered system.

Returns
The title of the system.

◆ setPriority()

virtual bool SystemItemInterface::setPriority ( SystemItemInterface::Priority const & priority )
pure virtual

Sets a priority to the current registered system.

Returns
True if the priority successfully modified.

◆ setTitle()

virtual bool SystemItemInterface::setTitle ( SystemItemInterface::Title const & title )
pure virtual

Sets a title to the current registered system.

Returns
True if the title successfully modified.
The documentation for this class was generated from the following file:
  • SystemItemInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemItemInterface Member List

This is the complete list of members for SystemItemInterface, including all inherited members.

ComponentMap typedef | SystemItemInterface |
ConnectionMap typedef | SystemItemInterface |
getCompatibleSources(SystemConnectionMapInterface::Target const *const target)=0 | SystemItemInterface | pure virtual
getCompatibleTargets(SystemConnectionMapInterface::Source const *const source)=0 | SystemItemInterface | pure virtual
getComponents() const =0 | SystemItemInterface | pure virtual
getConnections() const =0 | SystemItemInterface | pure virtual
getID() const =0 | SystemItemInterface | pure virtual
getPriority() const =0 | SystemItemInterface | pure virtual
getTitle() const =0 | SystemItemInterface | pure virtual
ID typedef | SystemItemInterface |
modifiedPriority() const | SystemItemInterface | signal
modifiedTitle() const | SystemItemInterface | signal
Priority typedef | SystemItemInterface |
setPriority(SystemItemInterface::Priority const &priority)=0 | SystemItemInterface | pure virtual
setTitle(SystemItemInterface::Title const &title)=0 | SystemItemInterface | pure virtual
Title typedef | SystemItemInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemMapInterface Class Reference

Public Types | Public Member Functions | List of all members
SystemMapInterface Class Referenceabstract

This class manages the registration and deregistration of object defining a system (system related-objects) using as identifier a key id. More...

Inherits QObject.

Inherited by SystemMapModel.

Public Types

using | ID = SystemItemInterface::ID
The identifier of a system.
using | Item = SystemItemInterface
The object defining the system.
using | Map = QMap< ID, Item * >
The container registering systems.

Public Member Functions

virtual SystemMapInterface::Iterator | begin ()=0
Gets an iterator pointing at the first system related-object in the map. More...
virtual SystemMapInterface::ConstIterator | begin () const =0
Gets an iterator pointing at the first system related-object in the map (use for read-only since pointing at constant values). More...
virtual bool | clear ()=0
Clears the items constituing the system. (e.g. function called when users pressing on <New> button in the System Editor). More...
virtual SystemMapInterface::Iterator | end ()=0
Gets an iterator pointing at the end of the map after the last system related-object. More...
virtual SystemMapInterface::ConstIterator | end () const =0
Gets an iterator pointing at the end of the map after the last system related-object (use for read-only). More...
virtual SystemMapInterface::ID | getID (SystemMapInterface::Item *const item) const =0
Gets the key identifier of the system related-object item from the container (map). More...
virtual SystemMapInterface::Item * | getItem (SystemMapInterface::ID const &id) const =0
Gets the system related-object under the key identifier id. More...

Detailed Description

This class manages the registration and deregistration of object defining a system (system related-objects) using as identifier a key id.

Definition at line 21 of file SystemMapInterface.h.

Member Function Documentation

◆ begin() [1/2]

virtual SystemMapInterface::Iterator SystemMapInterface::begin ( )
pure virtual

Gets an iterator pointing at the first system related-object in the map.

Returns
The iterator pointing at the first object in the map.

◆ begin() [2/2]

virtual SystemMapInterface::ConstIterator SystemMapInterface::begin ( ) const
pure virtual

Gets an iterator pointing at the first system related-object in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

◆ clear()

virtual bool SystemMapInterface::clear ( )
pure virtual

Clears the items constituing the system. (e.g. function called when users pressing on <New> button in the System Editor).

Returns
True if system items successfully cleared.

◆ end() [1/2]

virtual SystemMapInterface::Iterator SystemMapInterface::end ( )
pure virtual

Gets an iterator pointing at the end of the map after the last system related-object.

Returns
The iterator pointing at the end of the map.

◆ end() [2/2]

virtual SystemMapInterface::ConstIterator SystemMapInterface::end ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last system related-object (use for read-only).

Returns
The iterator pointing at the end of the map.

◆ getID()

virtual SystemMapInterface::ID SystemMapInterface::getID ( SystemMapInterface::Item *const item ) const
pure virtual

Gets the key identifier of the system related-object item from the container (map).

Parameters
[in] item The pointer to object defining the system.
Returns
The key identifier of the system.

◆ getItem()

virtual SystemMapInterface::Item* SystemMapInterface::getItem ( SystemMapInterface::ID const & id ) const
pure virtual

Gets the system related-object under the key identifier id.

Parameters
[in] id The key identifier of the system.
Returns
The pointer to object defining the system.
The documentation for this class was generated from the following file:
  • SystemMapInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemMapInterface Member List

This is the complete list of members for SystemMapInterface, including all inherited members.

begin()=0 | SystemMapInterface | pure virtual
begin() const =0 | SystemMapInterface | pure virtual
clear()=0 | SystemMapInterface | pure virtual
end()=0 | SystemMapInterface | pure virtual
end() const =0 | SystemMapInterface | pure virtual
getID(SystemMapInterface::Item *const item) const =0 | SystemMapInterface | pure virtual
getItem(SystemMapInterface::ID const &id) const =0 | SystemMapInterface | pure virtual
ID typedef | SystemMapInterface |
Item typedef | SystemMapInterface |
Map typedef | SystemMapInterface |
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemProfilePresenter Class Reference

Public Member Functions | Private Attributes | List of all members
SystemProfilePresenter Class Reference

This class constitutes the re-implementation of QAbstractTableModel for the table view of systems with a given algorithm type. The corresponding model data object is referred to as "system profile". In fact, this class implements a wrapper for these system profiles to be editable by QTableView objects within Qt's Model/View framework. More...

Inherits QAbstractTableModel.

Public Member Functions

virtual void | addRow (int const &row, VehicleProfileItemInterface::System system, VehicleProfileItemInterface::Probability probability)
Method that adds a new row, i.e. a system with the given probability. More...
int | columnCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders. More...
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex). More...
Qt::ItemFlags | flags (const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! More...
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format. More...
virtual bool | removeRow (const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval. More...
int | rowCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number systems in the map. More...
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value. More...
void | setSystems (VehicleProfileItemInterface::Systems *const _systems)
Method which sets the currently processed systems map to the given argument. More...
void | update ()
Method which updates the table according to the current entries of systems.

Private Attributes

QStringList | _columnHeaders
the string list of header data for columns
QMap< int, VehicleProfileItemInterface::System > | RowToSystem
the mapping of row indices to systems
VehicleProfileItemInterface::Systems * systems
the map of systems to be edited by this presenter

Detailed Description

This class constitutes the re-implementation of QAbstractTableModel for the table view of systems with a given algorithm type. The corresponding model data object is referred to as "system profile". In fact, this class implements a wrapper for these system profiles to be editable by QTableView objects within Qt's Model/View framework.

Definition at line 35 of file SystemProfilePresenter.h.

Member Function Documentation

◆ addRow()

void SystemProfilePresenter::addRow | ( | int const & | row,
 |  | VehicleProfileItemInterface::System | system,
 |  | VehicleProfileItemInterface::Probability | probability
 | ) |  |
virtual

Method that adds a new row, i.e. a system with the given probability.

Parameters
[in] | row | the index of the row to be added
[in] | system | the name of the system to be added
[in] | probability | the probability of the system

Definition at line 99 of file SystemProfilePresenter.cpp.

102 {
103
104 if(!systems->contains(system))
105 {
106 for(auto _row = RowToSystem.size()-1; _row>=row; _row--)
107 RowToSystem.insert(_row +1 , RowToSystem.take(_row));
108
109 RowToSystem.insert(row, system);
110
111 beginInsertRows(QModelIndex(), row, row);
112 systems->insert(system, probability);
113 endInsertRows();
114 }
115 }
SystemProfilePresenter::RowToSystem
QMap< int, VehicleProfileItemInterface::System > RowToSystem
the mapping of row indices to systems
Definition: SystemProfilePresenter.h:160
SystemProfilePresenter::systems
VehicleProfileItemInterface::Systems * systems
the map of systems to be edited by this presenter
Definition: SystemProfilePresenter.h:156

◆ columnCount()

int SystemProfilePresenter::columnCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table columns

Definition at line 39 of file SystemProfilePresenter.cpp.

40 {
41 Q_UNUSED(parent);
42
43 return _columnHeaders.count();
44 }
SystemProfilePresenter::_columnHeaders
QStringList _columnHeaders
the string list of header data for columns
Definition: SystemProfilePresenter.h:159

◆ data()

QVariant SystemProfilePresenter::data | ( | const QModelIndex & | index,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex).

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::DisplayRole or Qt::EditRole)
Returns
The data stored in the table cell (as a QVariant)

Definition at line 46 of file SystemProfilePresenter.cpp.

47 {
48
49 int row = index.row();
50 int col = index.column();
51
52 if(row >= systems->count() )
53 return QVariant::Invalid;
54
55 if(role == Qt::TextAlignmentRole)
56 return QVariant(Qt::AlignCenter);
57
58 if( role == Qt::DisplayRole || role == Qt::EditRole )
59 {
60 if( col == 0)
61 return QVariant(RowToSystem[ row ].first);
62
63 else if (col == 1)
64 return QVariant(RowToSystem[ row ].second);
65
66 else if ( col == 2)
67 return QVariant( systems->value(RowToSystem[row]) );
68 }
69
70 return QVariant();
71 }
SystemProfilePresenter::RowToSystem
QMap< int, VehicleProfileItemInterface::System > RowToSystem
the mapping of row indices to systems
Definition: SystemProfilePresenter.h:160
SystemProfilePresenter::systems
VehicleProfileItemInterface::Systems * systems
the map of systems to be edited by this presenter
Definition: SystemProfilePresenter.h:156

◆ flags()

Qt::ItemFlags SystemProfilePresenter::flags ( const QModelIndex & index ) const
override

Reimplementation of the flags method. This will make the items of the model editable!

Parameters
[in] index An index identifying the cell of the table
Returns
An item flag

Definition at line 91 of file SystemProfilePresenter.cpp.

92 {
93 if (index.column() == 2)
94 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
95
96 return QAbstractTableModel::flags(index);
97 }

◆ headerData()

QVariant SystemProfilePresenter::headerData | ( | int | section,
 |  | Qt::Orientation | orientation,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format.

Parameters
[in] | section | A table section
[in] | role | A Qt role
[in] | orientation | A table orientation
Returns
The content of the table's header at the given section

Definition at line 21 of file SystemProfilePresenter.cpp.

22 {
23 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
24 return _columnHeaders.value(section);
25
26 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
27 return section + 1;
28
29 return QVariant();
30 }
SystemProfilePresenter::_columnHeaders
QStringList _columnHeaders
the string list of header data for columns
Definition: SystemProfilePresenter.h:159

◆ removeRow()

bool SystemProfilePresenter::removeRow ( const int & row )
virtual

Method that removes the row specified by the given row-index, if this is in a meaningful interval.

Parameters
[in] row the row-index
Returns
"True", if row is between 0 and the number of systems, "false", otherwise

Definition at line 117 of file SystemProfilePresenter.cpp.

118 {
119 if( RowToSystem.contains(row) && systems->contains(RowToSystem[row]) )
120 {
121 beginRemoveRows(QModelIndex(), row, row);
122
123 systems->remove(RowToSystem[row]);
124 RowToSystem.remove(row);
125
126 for( int i=row+1; i<=RowToSystem.count() ; i++)
127 RowToSystem.insert( i-1, RowToSystem.take(i) );
128
129 endRemoveRows();
130 return true;
131 }
132
133 return false;
134 }
SystemProfilePresenter::RowToSystem
QMap< int, VehicleProfileItemInterface::System > RowToSystem
the mapping of row indices to systems
Definition: SystemProfilePresenter.h:160
SystemProfilePresenter::systems
VehicleProfileItemInterface::Systems * systems
the map of systems to be edited by this presenter
Definition: SystemProfilePresenter.h:156

◆ rowCount()

int SystemProfilePresenter::rowCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number systems in the map.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table rows

Definition at line 32 of file SystemProfilePresenter.cpp.

33 {
34 Q_UNUSED(parent);
35
36 return systems->count();
37 }
SystemProfilePresenter::systems
VehicleProfileItemInterface::Systems * systems
the map of systems to be edited by this presenter
Definition: SystemProfilePresenter.h:156

◆ setData()

bool SystemProfilePresenter::setData | ( | const QModelIndex & | index,
 |  | const QVariant & | value,
 |  | int | role = Qt::EditRole
 | ) |  |
override

Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value.

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::EditRole)
Returns
"True" if the index corresponds to an existing cell in the table, otherwise "false"

Definition at line 73 of file SystemProfilePresenter.cpp.

74 {
75 int row = index.row();
76 int col = index.column();
77
78 if( role == Qt::EditRole)
79 {
80 if( col == 2 )
81 {
82 (*systems)[ RowToSystem[ row ] ] = value.toDouble();
83 Q_EMIT dataChanged(index, index);
84 return true;
85 }
86 }
87
88 return false;
89 }
SystemProfilePresenter::RowToSystem
QMap< int, VehicleProfileItemInterface::System > RowToSystem
the mapping of row indices to systems
Definition: SystemProfilePresenter.h:160

◆ setSystems()

void SystemProfilePresenter::setSystems ( VehicleProfileItemInterface::Systems *const _systems )

Method which sets the currently processed systems map to the given argument.

Parameters
[in] _systems the systems map to be processed

Definition at line 136 of file SystemProfilePresenter.cpp.

137 {
138 systems = _systems;
139
140 if(systems)
141 update();
142 }
SystemProfilePresenter::update
void update()
Method which updates the table according to the current entries of systems.
Definition: SystemProfilePresenter.cpp:144
SystemProfilePresenter::systems
VehicleProfileItemInterface::Systems * systems
the map of systems to be edited by this presenter
Definition: SystemProfilePresenter.h:156
The documentation for this class was generated from the following files:
  • SystemProfilePresenter.h
  • SystemProfilePresenter.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemProfilePresenter Member List

This is the complete list of members for SystemProfilePresenter, including all inherited members.

_columnHeaders | SystemProfilePresenter | private
addRow(int const &row, VehicleProfileItemInterface::System system, VehicleProfileItemInterface::Probability probability) | SystemProfilePresenter | virtual
columnCount(const QModelIndex &parent=QModelIndex()) const override | SystemProfilePresenter |
data(const QModelIndex &index, int role=Qt::DisplayRole) const override | SystemProfilePresenter |
flags(const QModelIndex &index) const override | SystemProfilePresenter |
headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override | SystemProfilePresenter |
removeRow(const int &row) | SystemProfilePresenter | virtual
rowCount(const QModelIndex &parent=QModelIndex()) const override | SystemProfilePresenter |
RowToSystem | SystemProfilePresenter | private
setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override | SystemProfilePresenter |
setSystems(VehicleProfileItemInterface::Systems *const _systems) | SystemProfilePresenter |
systems | SystemProfilePresenter | private
update() | SystemProfilePresenter |
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SystemProfileView Class Reference

Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
SystemProfileView Class Reference

This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm type onto probabilities. More...

Inherits QWidget.

Signals

void | addSystem (QString AlgoType, QString const &selectionItem)
Signal, emitted when the add-button for systems has been clicked. Transmits the algorithm type and the system currently selected in the corresponding combo box (i.e. the one to be added to the table). More...
void | removeSystem (QString AlgoType, const int &row)
Signal, emitted after the remove-button for systems has been clicked. Transmits the algorithm type and the row index of the system to be removed from the table (i.e. the row which has focus). More...

Public Member Functions

QTableView * | getSystemView () const
Method which provides access to the table view for systems. More...
void | setSelectionItems (const QList< QString > &items)
Method which clears the selection list for the systems' combo box and inserts the given list. More...

Private Slots

void | on_addSystem_clicked ()
Slot triggered when the add-button for systems is clicked. Emits the addSystem signal transmitting the system currently displayed by the combo box.
void | on_removeSystem_clicked ()
Slot triggered when the remove-button for systems is clicked. Emits the removeSystem signal transmitting the system name currently displayed by the combo box.

Private Member Functions

bool eventFilter (QObject *watched, QEvent *event)
Reimplementation of the event filter for catching the resize-events of the systems' table view. It takes care of the proper column width ratio after resizing. More...

Private Attributes

Ui::SystemProfileView * ui
the ui object containing all GUI elements of this view

Detailed Description

This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm type onto probabilities.

The view constitutes a table view for assigning systems to probabilities, buttons for adding and removing systems and a combobox to select systems for adding.

Definition at line 40 of file SystemProfileView.h.

Member Function Documentation

◆ addSystem

void SystemProfileView::addSystem | ( | QString | AlgoType,
 |  | QString const & | selectionItem
 | ) |  |
signal

Signal, emitted when the add-button for systems has been clicked. Transmits the algorithm type and the system currently selected in the corresponding combo box (i.e. the one to be added to the table).

Parameters
[in] | AlgoType | the algorithm type of the systems
[in] | selectionItem | the system currently selected (i.e. to be added)

◆ eventFilter()

bool SystemProfileView::eventFilter | ( | QObject * | watched,
 |  | QEvent * | event
 | ) |  |
private

Reimplementation of the event filter for catching the resize-events of the systems' table view. It takes care of the proper column width ratio after resizing.

Parameters
[in] | watched | the watched object
[in] | event | the event to be catched
Returns
always "false" as the event should be catched but not filtered

Definition at line 59 of file SystemProfileView.cpp.

60 {
61 QTableView* table = qobject_cast<QTableView*> (watched);
62
63 if( table && event->type() == QEvent::Resize )
64 {
65 int cell = (table->width())/5;
66 table->setColumnWidth(0, cell);
67 table->setColumnWidth(1, 2*cell);
68 }
69
70 return false;
71 }

◆ getSystemView()

QTableView * SystemProfileView::getSystemView ( ) const

Method which provides access to the table view for systems.

Returns
the table view (QTableView) for systems

Definition at line 38 of file SystemProfileView.cpp.

39 {
40 return ui->SystemView;
41 }
SystemProfileView::ui
Ui::SystemProfileView * ui
the ui object containing all GUI elements of this view
Definition: SystemProfileView.h:118

◆ removeSystem

void SystemProfileView::removeSystem | ( | QString | AlgoType,
 |  | const int & | row
 | ) |  |
signal

Signal, emitted after the remove-button for systems has been clicked. Transmits the algorithm type and the row index of the system to be removed from the table (i.e. the row which has focus).

Parameters
[in] | AlgoType | the algorithm type of the systems
[in] | row | the row index of the system to be removed

◆ setSelectionItems()

void SystemProfileView::setSelectionItems ( const QList< QString > & items )

Method which clears the selection list for the systems' combo box and inserts the given list.

Parameters
[in] items the list of systems to be listed in the corresponding combo box

Definition at line 53 of file SystemProfileView.cpp.

54 {
55 ui->SystemSelection->clear();
56 ui->SystemSelection->addItems(items);
57 }
SystemProfileView::ui
Ui::SystemProfileView * ui
the ui object containing all GUI elements of this view
Definition: SystemProfileView.h:118
The documentation for this class was generated from the following files:
  • SystemProfileView.h
  • SystemProfileView.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SystemProfileView Member List

This is the complete list of members for SystemProfileView, including all inherited members.

addSystem(QString AlgoType, QString const &selectionItem) | SystemProfileView | signal
eventFilter(QObject *watched, QEvent *event) | SystemProfileView | private
getSystemView() const | SystemProfileView |
on_addSystem_clicked() | SystemProfileView | privateslot
on_removeSystem_clicked() | SystemProfileView | privateslot
removeSystem(QString AlgoType, const int &row) | SystemProfileView | signal
setSelectionItems(const QList< QString > &items) | SystemProfileView |
ui | SystemProfileView | private
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficBaseView Class Reference

Public Slots | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
TrafficBaseView Class Reference

This class provides a resizable container widget for the content of the traffic tab's scroll area. More...

Inheritance diagram for TrafficBaseView:
WidgetView

Public Slots

void updateSize ()
Slot which updates the size of this base view such that all child widgets (TrafficView, TrafficParametersView and TrafficLanesView) are visible.

Public Member Functions

void | adjustWidgets (QWidget *mainWindow)
Method which adjusts the positioning and size of the child widgets. The size of the child widgets is determined as fractions of the widget size passed as an argument (usually the TrafficSimulationView itself). More...
TrafficLanesView * | getTrafficLanesView () const
Method which returns the configuration widget for for assigning agent profiles to lanes (TrafficLanesView). More...
TrafficParametersView * | getTrafficParametersView () const
Method which returns the configuration widget for traffic parameters (TrafficParametersView). More...
TrafficView * | getTrafficView () const
Method which returns the traffic title view (TrafficView). More...
- Public Member Functions inherited from WidgetView
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Public Attributes

TrafficLanesView * trafficLanesView
A pointer to the traffic parameter configuration widget (TrafficParametersView)
TrafficParametersView * trafficParametersView
A pointer to the widget for lane-agent assignement (TrafficLanesView)
TrafficView * trafficView
A pointer to the traffic configuration's title view.

Protected Member Functions

void paintEvent (QPaintEvent *event) override
Reimplementation of the paint event. Here, the painting of the connection lines between the traffic's title widget (TrafficView) and the parameter and lane views is organised. More...

Detailed Description

This class provides a resizable container widget for the content of the traffic tab's scroll area.

The items inserted into this widget are the instances of TrafficView, TrafficParametersView and TrafficLanesView. Further, the paint event is reimplemented such that the parameters and lanes views are connected via lines to the title widget (TrafficView). This visualizes that both configurations (parameters and lanes) are necessary for a complete traffic configuration.

Definition at line 36 of file TrafficBaseView.h.

Member Function Documentation

◆ adjustWidgets()

void TrafficBaseView::adjustWidgets ( QWidget * mainWindow )

Method which adjusts the positioning and size of the child widgets. The size of the child widgets is determined as fractions of the widget size passed as an argument (usually the TrafficSimulationView itself).

Parameters
[in] mainWindow the widget from which the sizes of the child widgets are derived (usually TrafficSimulationView)

Definition at line 47 of file TrafficBaseView.cpp.

48 {
49 int x,y;
50
51 // adjust the geometry of the Traffic View:
52 x= (mainWindow->width() - trafficView->width() )/2;
53 trafficView->move(x,30);
54 // trafficView->setGeometry(x,30,mainWindow->width()/3,trafficView->height());
55
56 // adjust the geometry of Traffic Parameters View:
57 x = trafficView->x() - trafficParametersView->width()/2 - 30;
58 y = trafficView->height() + 130;
59 trafficParametersView->move(x,y);
60 // trafficParametersView->setGeometry(x,y, mainWindow->width()/3, trafficParametersView->height());
61
62 // adjust the geometry of Traffic Lanes View:
63 x = trafficView->x() + trafficView->width() - trafficLanesView->width()/2 + 30;
64 y = trafficView->height() + 130;
65 trafficLanesView->move(x,y);
66 // trafficLanesView->setGeometry(x,y, mainWindow->width()/3, trafficLanesView->height());
67
68 updateSize();
69
70 }
TrafficBaseView::trafficView
TrafficView * trafficView
A pointer to the traffic configuration&#39;s title view.
Definition: TrafficBaseView.h:97
TrafficBaseView::trafficParametersView
TrafficParametersView * trafficParametersView
A pointer to the widget for lane-agent assignement (TrafficLanesView)
Definition: TrafficBaseView.h:99
TrafficBaseView::trafficLanesView
TrafficLanesView * trafficLanesView
A pointer to the traffic parameter configuration widget (TrafficParametersView)
Definition: TrafficBaseView.h:98
TrafficBaseView::updateSize
void updateSize()
Slot which updates the size of this base view such that all child widgets (TrafficView, TrafficParametersView and TrafficLanesView) are visible.
Definition: TrafficBaseView.cpp:37

◆ getTrafficLanesView()

TrafficLanesView * TrafficBaseView::getTrafficLanesView ( ) const

Method which returns the configuration widget for for assigning agent profiles to lanes (TrafficLanesView).

Returns
the configuration widget for lane-agent assignment (TrafficLanesView)

Definition at line 32 of file TrafficBaseView.cpp.

33 {
34 return trafficLanesView;
35 }
TrafficBaseView::trafficLanesView
TrafficLanesView * trafficLanesView
A pointer to the traffic parameter configuration widget (TrafficParametersView)
Definition: TrafficBaseView.h:98

◆ getTrafficParametersView()

TrafficParametersView * TrafficBaseView::getTrafficParametersView ( ) const

Method which returns the configuration widget for traffic parameters (TrafficParametersView).

Returns
the configuration widget for traffic parameters

Definition at line 27 of file TrafficBaseView.cpp.

28 {
29 return trafficParametersView;
30 }
TrafficBaseView::trafficParametersView
TrafficParametersView * trafficParametersView
A pointer to the widget for lane-agent assignement (TrafficLanesView)
Definition: TrafficBaseView.h:99

◆ getTrafficView()

TrafficView * TrafficBaseView::getTrafficView ( ) const

Method which returns the traffic title view (TrafficView).

Returns
the traffic's title view (TrafficView).

Definition at line 22 of file TrafficBaseView.cpp.

23 {
24 return trafficView;
25 }
TrafficBaseView::trafficView
TrafficView * trafficView
A pointer to the traffic configuration&#39;s title view.
Definition: TrafficBaseView.h:97

◆ paintEvent()

void TrafficBaseView::paintEvent ( QPaintEvent * event )
overrideprotectedvirtual

Reimplementation of the paint event. Here, the painting of the connection lines between the traffic's title widget (TrafficView) and the parameter and lane views is organised.

Parameters
[in] event the paint event (Qt's QPaintEvent class)

Reimplemented from WidgetView.

Definition at line 72 of file TrafficBaseView.cpp.

73 {
74 event->ignore();
75 QPainter painter(this);
76
77 QPoint P1(trafficView->x() + trafficView->width()/2, trafficView->y() + trafficView->height()) ;
78 QPoint P2(trafficParametersView->x() + trafficParametersView->width()/2, trafficParametersView->y());
79 QPoint P3(trafficLanesView->x() + trafficLanesView->width()/2, trafficLanesView->y());
80
81 painter.setPen(QColor(QStringLiteral("#777777")));
82 QPainterPath path(P1);
83
84 path.lineTo(P2);
85 painter.drawPath(path);
86
87 path.lineTo(P1);
88
89 path.lineTo(P3);
90 painter.drawPath(path);
91 }
TrafficBaseView::trafficView
TrafficView * trafficView
A pointer to the traffic configuration&#39;s title view.
Definition: TrafficBaseView.h:97
TrafficBaseView::trafficParametersView
TrafficParametersView * trafficParametersView
A pointer to the widget for lane-agent assignement (TrafficLanesView)
Definition: TrafficBaseView.h:99
TrafficBaseView::trafficLanesView
TrafficLanesView * trafficLanesView
A pointer to the traffic parameter configuration widget (TrafficParametersView)
Definition: TrafficBaseView.h:98
The documentation for this class was generated from the following files:
  • TrafficBaseView.h
  • TrafficBaseView.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficBaseView Member List

This is the complete list of members for TrafficBaseView, including all inherited members.

adjustWidgets(QWidget *mainWindow) | TrafficBaseView |
getTrafficLanesView() const | TrafficBaseView |
getTrafficParametersView() const | TrafficBaseView |
getTrafficView() const | TrafficBaseView |
paintEvent(QPaintEvent *event) override | TrafficBaseView | protectedvirtual
trafficLanesView | TrafficBaseView |
trafficParametersView | TrafficBaseView |
trafficView | TrafficBaseView |
updateSize() | TrafficBaseView | slot
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficDisplayPresenter Class Reference

Public Slots | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TrafficDisplayPresenter Class Reference

This class defines the presenter which controls the content to be displayed in the TrafficDisplayView widget. More...

Inherits QObject.

Public Slots

void updateView ()
Method which sets all displayed values according to the model data. Will be called after loading a combination xml file.

Public Member Functions

void setStatus ()
Method which determines the status of the traffic settings. If all necessary configurations are made, the method displays the status "complete" and sets the frame of the display widget to green color. If "incomplete", the frame will be set to red color. Momentarily, the criterion for a complete configuration is that all forms in the TrafficView, TrafficParameters and TrafficLanes widgets are filled.

Private Member Functions

bool | checkAgentProfiles ()
Method which checks whether the agent profiles assigned to the lanes are defined in the profiles catalogue referenced by the traffic simulation plugin. More...
bool | checkProbabilities (TrafficItemMapInterface *const items)
Method which checks whether the given probabilities (stored in a list) sum up to 1. More...
void | setHomogeneitiesView ()
Slot which is called when the user edits the homogeneities map. Updates the displayed number of homogeneities accordingly and triggers a status check.
void | setPlatoonRatesView ()
Slot which is called when the user edits the platoon reates map. Updates the displayed number of platoon rates accordingly and triggers a status check.
void | setRegularLaneView ()
Slot which is called when the user edits the regular lane agents map. Updates the displayed number of agents on the regular lane accordingly and triggers a status check.
void | setRightmostLaneView ()
Slot which is called when the user edits the rightmost lane agents map. Updates the displayed number of agents on the rightmost lane accordingly and triggers a status check.
void | setTrafficNameView ()
Slot which is called when the name of the traffic configuration has changed in the model. Updates the displayed name and triggers a status check.
void | setVelocitiesView ()
Slot which is called when the user edits the velocities map. Updates the displayed number of velocities accordingly and triggers a status check.
void | setVolumesView ()
Slot which is called when the user edits the traffic volumes map. Updates the displayed number of traffic volumes accordingly and triggers a status check.

Private Attributes

QList< QString > *const agentList
a pointer to the list of available agent profiles (defined in a ProfilesCatalog.xml)
TrafficInterface * traffic
a pointer to the traffic model (interface) which is read by this presenter
TrafficDisplayView * trafficDisplayView
a pointer to the display view whose content is managed by this presenter

Detailed Description

This class defines the presenter which controls the content to be displayed in the TrafficDisplayView widget.

Definition at line 31 of file TrafficDisplayPresenter.h.

Member Function Documentation

◆ checkAgentProfiles()

bool TrafficDisplayPresenter::checkAgentProfiles ( )
private

Method which checks whether the agent profiles assigned to the lanes are defined in the profiles catalogue referenced by the traffic simulation plugin.

Returns
"true" if all agent profiles are defined in the profiles catalogue, "false" otherwise

Definition at line 141 of file TrafficDisplayPresenter.cpp.

142 {
143
144 // determine list of all used agent profiles
145 QList<TrafficItemInterface*> allAgents = traffic->getAgentsRegularLane()->values()
146 + traffic->getAgentsRightMostLane()->values();
147
148 // check whether used agent profiles are contained in the agentList!
149 // (agentList reflects all defined agent profiles in the profiles catalogue)
150 for(auto agent : allAgents)
151 {
152 TrafficItemInterface::Value name = agent->getValue();
153 if(!agentList->contains(name))
154 return false;
155 }
156
157 return true;
158 }
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
TrafficDisplayPresenter::agentList
QList< QString > *const agentList
a pointer to the list of available agent profiles (defined in a ProfilesCatalog.xml) ...
Definition: TrafficDisplayPresenter.h:130
TrafficItemInterface::Value
QString Value
the datatype for the traffic parameter&#39;s value (generally a string)
Definition: TrafficItemInterface.h:42
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
TrafficDisplayPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model (interface) which is read by this presenter
Definition: TrafficDisplayPresenter.h:128

◆ checkProbabilities()

bool TrafficDisplayPresenter::checkProbabilities ( TrafficItemMapInterface *const items )
private

Method which checks whether the given probabilities (stored in a list) sum up to 1.

Parameters
[in] probabilities the list of probabilities to be checked
Returns
"true" if probabilities sum up to 1, otherwise "false"

Definition at line 130 of file TrafficDisplayPresenter.cpp.

131 {
132 double sum = 0.0;
133
134 for(auto item : items->values())
135 sum += item->getProbability();
136
137 return sum == 1.0;
138 }
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
The documentation for this class was generated from the following files:
  • TrafficDisplayPresenter.h
  • TrafficDisplayPresenter.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficDisplayPresenter Member List

This is the complete list of members for TrafficDisplayPresenter, including all inherited members.

agentList | TrafficDisplayPresenter | private
checkAgentProfiles() | TrafficDisplayPresenter | private
checkProbabilities(TrafficItemMapInterface *const items) | TrafficDisplayPresenter | private
setHomogeneitiesView() | TrafficDisplayPresenter | private
setPlatoonRatesView() | TrafficDisplayPresenter | private
setRegularLaneView() | TrafficDisplayPresenter | private
setRightmostLaneView() | TrafficDisplayPresenter | private
setStatus() | TrafficDisplayPresenter |
setTrafficNameView() | TrafficDisplayPresenter | private
setVelocitiesView() | TrafficDisplayPresenter | private
setVolumesView() | TrafficDisplayPresenter | private
traffic | TrafficDisplayPresenter | private
trafficDisplayView | TrafficDisplayPresenter | private
updateView() | TrafficDisplayPresenter | slot
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficDisplayView Class Reference

Public Types | Public Member Functions | Private Attributes | List of all members
TrafficDisplayView Class Reference

This class provides a display for a quick overview of the traffic configuration. More...

Inheritance diagram for TrafficDisplayView:
WidgetView

Public Types

enum StatusType { StatusType::Error = 0 }

Public Member Functions

void | setHomogeneities (int number)
Method for setting the displayed number of homogeneities. More...
void | setPlatoonRates (int number)
Method for setting the displayed number of platoon rates. More...
void | setRegularLaneAgents (int number)
Method for setting the displayed number of regular lane agents. More...
void | setRightmostLaneAgents (int number)
Method for setting the displayed number of rightmost lane agents. More...
void | setStatus (StatusType status, QString message)
Method which determines the frame color according to the status type passed as a first argument. Further, sets the status message to the second argument. More...
void | setTrafficName (QString name)
Method for setting the name which should be displayed for the traffic configuration. More...
void | setVelocities (int number)
Method for setting the displayed number of velocities. More...
void | setVolumes (int number)
Method for setting the displayed number of traffic volumes. More...
- Public Member Functions inherited from WidgetView
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Private Attributes

QMap< StatusType, QString > | color
a color map which determines the color code according to the status type
Ui::TrafficDisplayView * | ui
the ui object containing the visualization elements of this display view

Additional Inherited Members

- Protected Member Functions inherited from WidgetView
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.

Detailed Description

This class provides a display for a quick overview of the traffic configuration.

It contains an ui object describing the views appearence (defined in TrafficDisplayView.ui). This ui object comprises a form layout with labels showing the configuration that has been edited by TrafficView, i.e. the number of traffic parameters and lane agent profiles. The frame of the view can be coloured in order to notify the user whether the configuration is complete or not.

Definition at line 42 of file TrafficDisplayView.h.

Member Enumeration Documentation

◆ StatusType

enum TrafficDisplayView::StatusType
strong
Enumerator
Error

enum class for classifying the status (will be used to determine the color of the frame)

Definition at line 47 of file TrafficDisplayView.h.

47 {
48 Error = 0,
49 OK = 1,
50 Warning = 2
51 };

Member Function Documentation

◆ setHomogeneities()

void TrafficDisplayView::setHomogeneities ( int number )

Method for setting the displayed number of homogeneities.

Parameters
[in] number the number of homogeneities.

Definition at line 61 of file TrafficDisplayView.cpp.

62 {
63 ui->Homogeneities->setText(QString::number(number));
64 }
TrafficDisplayView::ui
Ui::TrafficDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: TrafficDisplayView.h:118

◆ setPlatoonRates()

void TrafficDisplayView::setPlatoonRates ( int number )

Method for setting the displayed number of platoon rates.

Parameters
[in] number the number of platoon rates

Definition at line 51 of file TrafficDisplayView.cpp.

52 {
53 ui->PlatoonRates->setText(QString::number(number));
54 }
TrafficDisplayView::ui
Ui::TrafficDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: TrafficDisplayView.h:118

◆ setRegularLaneAgents()

void TrafficDisplayView::setRegularLaneAgents ( int number )

Method for setting the displayed number of regular lane agents.

Parameters
[in] number the number of regular lane agents

Definition at line 66 of file TrafficDisplayView.cpp.

67 {
68 ui->RegularLane->setText(QString::number(number) );
69 }
TrafficDisplayView::ui
Ui::TrafficDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: TrafficDisplayView.h:118

◆ setRightmostLaneAgents()

void TrafficDisplayView::setRightmostLaneAgents ( int number )

Method for setting the displayed number of rightmost lane agents.

Parameters
[in] number the number of rightmost lane agents

Definition at line 71 of file TrafficDisplayView.cpp.

72 {
73 ui->RightmostLane->setText(QString::number(number));
74 }
TrafficDisplayView::ui
Ui::TrafficDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: TrafficDisplayView.h:118

◆ setStatus()

void TrafficDisplayView::setStatus | ( | StatusType | status,
 |  | QString | message
 | ) |  |

Method which determines the frame color according to the status type passed as a first argument. Further, sets the status message to the second argument.

Parameters
[in] | status | the status type (defined in enum class StatusType)
[in] | message | the message to be displayed as a status.

Definition at line 76 of file TrafficDisplayView.cpp.

77 {
78 ui->Status->setText(message);
79
80 setStyleSheet(color[status]);
81 }
TrafficDisplayView::color
QMap< StatusType, QString > color
a color map which determines the color code according to the status type
Definition: TrafficDisplayView.h:117
TrafficDisplayView::ui
Ui::TrafficDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: TrafficDisplayView.h:118

◆ setTrafficName()

void TrafficDisplayView::setTrafficName ( QString name )

Method for setting the name which should be displayed for the traffic configuration.

Parameters
[in] name the name to be displayed for the traffic configuration

Definition at line 40 of file TrafficDisplayView.cpp.

41 {
42 ui->TrafficName->setText(name);
43 }
TrafficDisplayView::ui
Ui::TrafficDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: TrafficDisplayView.h:118

◆ setVelocities()

void TrafficDisplayView::setVelocities ( int number )

Method for setting the displayed number of velocities.

Parameters
[in] number the number of velocities

Definition at line 56 of file TrafficDisplayView.cpp.

57 {
58 ui->Velocities->setText(QString::number(number));
59 }
TrafficDisplayView::ui
Ui::TrafficDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: TrafficDisplayView.h:118

◆ setVolumes()

void TrafficDisplayView::setVolumes ( int number )

Method for setting the displayed number of traffic volumes.

Parameters
[in] number the number of traffic volumes

Definition at line 46 of file TrafficDisplayView.cpp.

47 {
48 ui->Volumes->setText(QString::number(number));
49 }
TrafficDisplayView::ui
Ui::TrafficDisplayView * ui
the ui object containing the visualization elements of this display view
Definition: TrafficDisplayView.h:118
The documentation for this class was generated from the following files:
  • TrafficDisplayView.h
  • TrafficDisplayView.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficDisplayView Member List

This is the complete list of members for TrafficDisplayView, including all inherited members.

color | TrafficDisplayView | private
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
setHomogeneities(int number) | TrafficDisplayView |
setPlatoonRates(int number) | TrafficDisplayView |
setRegularLaneAgents(int number) | TrafficDisplayView |
setRightmostLaneAgents(int number) | TrafficDisplayView |
setStatus(StatusType status, QString message) | TrafficDisplayView |
setTrafficName(QString name) | TrafficDisplayView |
setVelocities(int number) | TrafficDisplayView |
setVolumes(int number) | TrafficDisplayView |
StatusType enum name | TrafficDisplayView |
ui | TrafficDisplayView | private
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
TrafficInterface Class Referenceabstract

The Traffic Interface provides setter and getter methods for the combination XML subelements listed under the <TrafficConfig> element. More...

Inheritance diagram for TrafficInterface:
TrafficModel

Public Types

using | Homogeneities = TrafficItemMapInterface
The map for registering homogeneities.
using | Name = QString
The name of the traffic configuration.
using | PlatoonRates = TrafficItemMapInterface
The map for registering platoon rates.
using | Status = bool
Type characterizing the status of the environment settings.
using | TrafficAgents = TrafficItemMapInterface
The map for registering agent profiles.
using | Velocities = TrafficItemMapInterface
The map for registering velocities.
using | Volumes = TrafficItemMapInterface
The map for registering traffic volumes.

Signals

void | edited ()
Signal, emitted when the traffic configuration has been edited.
void | modifiedName ()
Signal, emitted when the name of the traffic setup has been modified.
void | modifiedStatus ()
Signal, emitted when the traffic's status has changed.

Public Member Functions

virtual TrafficAgents * | getAgentsRegularLane () const =0
Returns the map for registering agent profiles for regular lanes. More...
virtual TrafficAgents * | getAgentsRightMostLane () const =0
Returns the map for registering agent profiles for the rightmost lane. More...
virtual Homogeneities * | getHomogeneities () const =0
Returns the map for registering homogeneities. More...
virtual Name | getName () const =0
Returns the current name of the traffic setup. More...
virtual PlatoonRates * | getPlatoonRates () const =0
Returns the map for registering platoon rates. More...
virtual Status | getStatus () const =0
Method which returns the current status of the traffic settings. More...
virtual Velocities * | getVelocities () const =0
Returns the map for registering velocities. More...
virtual Volumes * | getVolumes () const =0
Returns the map for registering traffic volumes. More...
virtual void | setName (Name const &_name)=0
Sets the name of the traffic setup to the one passed as an argument. More...
virtual void | setStatus (Status const &_status)=0
Method for setting the status of the traffic configuration to the value passed as an argument. More...

Detailed Description

The Traffic Interface provides setter and getter methods for the combination XML subelements listed under the <TrafficConfig> element.

These comprise the maps for registering traffic volumes, platoon rates, velocities, homogeneities as well as for managing the distribution of agents on regular lanes and the rightmost lane. The corresponding maps are defined by the template class called TrafficItemMapInterface , whereas the aforementioned objects are defined in the class TrafficItemInterface.

Definition at line 41 of file TrafficInterface.h.

Member Function Documentation

◆ getAgentsRegularLane()

virtual TrafficAgents* TrafficInterface::getAgentsRegularLane ( ) const
pure virtual

Returns the map for registering agent profiles for regular lanes.

Returns
the map of agent profiles for regular lanes

Implemented in TrafficModel.

◆ getAgentsRightMostLane()

virtual TrafficAgents* TrafficInterface::getAgentsRightMostLane ( ) const
pure virtual

Returns the map for registering agent profiles for the rightmost lane.

Returns
the map of agent profiles for the rightmost lane

Implemented in TrafficModel.

◆ getHomogeneities()

virtual Homogeneities* TrafficInterface::getHomogeneities ( ) const
pure virtual

Returns the map for registering homogeneities.

Returns
the map of homogeneities

Implemented in TrafficModel.

◆ getName()

virtual Name TrafficInterface::getName ( ) const
pure virtual

Returns the current name of the traffic setup.

Returns
the current name of the traffic setup

Implemented in TrafficModel.

◆ getPlatoonRates()

virtual PlatoonRates* TrafficInterface::getPlatoonRates ( ) const
pure virtual

Returns the map for registering platoon rates.

Returns
the map of platoon rates

Implemented in TrafficModel.

◆ getStatus()

virtual Status TrafficInterface::getStatus ( ) const
pure virtual

Method which returns the current status of the traffic settings.

Returns
the current status of the traffic configuration

Implemented in TrafficModel.

◆ getVelocities()

virtual Velocities* TrafficInterface::getVelocities ( ) const
pure virtual

Returns the map for registering velocities.

Returns
the map of velocities

Implemented in TrafficModel.

◆ getVolumes()

virtual Volumes* TrafficInterface::getVolumes ( ) const
pure virtual

Returns the map for registering traffic volumes.

Returns
the map of traffic volumes

Implemented in TrafficModel.

◆ setName()

virtual void TrafficInterface::setName ( Name const & _name )
pure virtual

Sets the name of the traffic setup to the one passed as an argument.

Parameters
[in] _name the new name for the traffic setup

Implemented in TrafficModel.

◆ setStatus()

virtual void TrafficInterface::setStatus ( Status const & _status )
pure virtual

Method for setting the status of the traffic configuration to the value passed as an argument.

Parameters
[in] _status the status

Implemented in TrafficModel.

The documentation for this class was generated from the following file:
  • TrafficInterface.h
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficInterface Member List

This is the complete list of members for TrafficInterface, including all inherited members.

edited() | TrafficInterface | signal
getAgentsRegularLane() const =0 | TrafficInterface | pure virtual
getAgentsRightMostLane() const =0 | TrafficInterface | pure virtual
getHomogeneities() const =0 | TrafficInterface | pure virtual
getName() const =0 | TrafficInterface | pure virtual
getPlatoonRates() const =0 | TrafficInterface | pure virtual
getStatus() const =0 | TrafficInterface | pure virtual
getVelocities() const =0 | TrafficInterface | pure virtual
getVolumes() const =0 | TrafficInterface | pure virtual
Homogeneities typedef | TrafficInterface |
modifiedName() | TrafficInterface | signal
modifiedStatus() | TrafficInterface | signal
Name typedef | TrafficInterface |
PlatoonRates typedef | TrafficInterface |
setName(Name const &_name)=0 | TrafficInterface | pure virtual
setStatus(Status const &_status)=0 | TrafficInterface | pure virtual
Status typedef | TrafficInterface |
TrafficAgents typedef | TrafficInterface |
Velocities typedef | TrafficInterface |
Volumes typedef | TrafficInterface |
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
TrafficItemInterface Class Referenceabstract

The Traffic Item Interface defines a general traffic parameter which can be incorporated into the traffic configuration setup. More...

Inheritance diagram for TrafficItemInterface:
TrafficItemModel

Public Types

using | Probability = double
the selection probability's datatype
using | Value = QString
the datatype for the traffic parameter's value (generally a string)

Signals

void edited ()
Signal emitted whenever an attribute of the traffic parameter has changed.

Public Member Functions

virtual Probability | getProbability () const =0
Returns the current probability of the traffic item's occurence. More...
virtual Value | getValue () const =0
Returns the current value of the traffic item. More...
virtual void | setProbability (Probability const &_probability)=0
Sets the probability of the traffic item's occurence. More...
virtual void | setValue (Value const &_value)=0
Sets the traffic item's value to the value passed as an argument. More...

Detailed Description

The Traffic Item Interface defines a general traffic parameter which can be incorporated into the traffic configuration setup.

A traffic parameter is defined by a value (generally a string) as well as a probability to be selected in a simulation run. This class provides setter and getter method for manipulating these properties.

Definition at line 36 of file TrafficItemInterface.h.

Member Function Documentation

◆ getProbability()

virtual Probability TrafficItemInterface::getProbability ( ) const
pure virtual

Returns the current probability of the traffic item's occurence.

Returns
the current probability of the traffic item's occurence

Implemented in TrafficItemModel.

◆ getValue()

virtual Value TrafficItemInterface::getValue ( ) const
pure virtual

Returns the current value of the traffic item.

Returns
the current value of the traffic item

Implemented in TrafficItemModel.

◆ setProbability()

virtual void TrafficItemInterface::setProbability ( Probability const & _probability )
pure virtual

Sets the probability of the traffic item's occurence.

Parameters
[in] _probability the new probability to be adopted

Implemented in TrafficItemModel.

◆ setValue()

virtual void TrafficItemInterface::setValue ( Value const & _value )
pure virtual

Sets the traffic item's value to the value passed as an argument.

Parameters
[in] _value the new value to be adopted

Implemented in TrafficItemModel.

The documentation for this class was generated from the following file:
  • TrafficItemInterface.h
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficItemInterface Member List

This is the complete list of members for TrafficItemInterface, including all inherited members.

edited() | TrafficItemInterface | signal
getProbability() const =0 | TrafficItemInterface | pure virtual
getValue() const =0 | TrafficItemInterface | pure virtual
Probability typedef | TrafficItemInterface |
setProbability(Probability const &_probability)=0 | TrafficItemInterface | pure virtual
setValue(Value const &_value)=0 | TrafficItemInterface | pure virtual
Value typedef | TrafficItemInterface |
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemMapInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
TrafficItemMapInterface Class Referenceabstract

The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be registered under a key identifier (ID). The traffic items are defined in the TrafficItemInterface template class. More...

Inheritance diagram for TrafficItemMapInterface:
TrafficItemMapModel

Public Types

using | ConstIterator = Map::ConstIterator
A constant iterator (for reading only)
using | ID = unsigned int
The key identifier (ID)
using | Item = TrafficItemInterface
The traffic items registered in the map.
using | Iterator = Map::Iterator
An iterator for searching within the map.
using | Map = QMap< ID, Item * >
The map for registering traffic items (using Qt's QMap class)

Signals

void edited ()
Signal emitted when traffic items are added to or removed from this map. It is also connected to the TrafficItemInterface::edited signal emitted when the value or probability of a traffic item has been edited.

Public Member Functions

virtual bool | add (TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0
Method which creates a traffic item and registers it under the ID passed as a first argument, if not already used in the map. The value of the traffic item (datatype T) will be set to the one passed as a second argument. The probability is set to the default value of 0.5. More...
virtual bool | add (TrafficItemMapInterface::Item *const item)=0
Method which adds the given traffic item to the map, if not already contained in the map. The corresponding ID is generated using generateID(). More...
virtual TrafficItemMapInterface::Iterator | begin ()=0
Gets an iterator pointing at the first traffic item in the map. More...
virtual void | clear ()=0
Method which clears the map and deletes all items.
virtual TrafficItemMapInterface::ConstIterator | constBegin () const =0
Gets an iterator pointing at the first traffic item in the map (use for read-only since pointing at constant values). More...
virtual TrafficItemMapInterface::ConstIterator | constEnd () const =0
Gets an iterator pointing at the end of the map after the last traffic item (use for read-only). More...
virtual bool | contains (TrafficItemMapInterface::ID const &id) const =0
Method tests whether the map contains an entry under the given ID. More...
virtual int | count () const =0
Method which returns the number of items registered in the map. More...
virtual TrafficItemMapInterface::Iterator | end ()=0
Gets an iterator pointing at the end of the map after the last traffic item. More...
virtual TrafficItemMapInterface::ID | generateID () const =0
Method which returns the highest unoccupied ID of the map. More...
virtual TrafficItemMapInterface::ID | getID (TrafficItemMapInterface::Item *const item) const =0
Method which returns the ID of the given traffic item, if contained in the map. Returns Qt's default-constructed key if no such item is registered. More...
virtual TrafficItemMapInterface::Item * | getItem (TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the map, nullptr is returned. More...
virtual QList< ID > | keys () const =0
Method which returns a list of all IDs used in the map. For the list, Qt's QList class is used. More...
virtual bool | remove (TrafficItemMapInterface::ID const &id)=0
Method which removes the traffic item registered under the given ID from the map. Afterwards, the item is deleted. Nothing will be done, if there is no item with the given ID is contained in the map. More...
virtual bool | remove (TrafficItemMapInterface::Item *const item)=0
Method which removes the given traffic item from the map. Afterwards, the item is deleted. Nothing will be done, if there is there no such item registered in the map. More...
virtual QList< Item * > | values () const =0
Method which returns a list of all items registered in the map. For the list, Qt's QList class is used. More...

Detailed Description

The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be registered under a key identifier (ID). The traffic items are defined in the TrafficItemInterface template class.

Definition at line 33 of file TrafficItemMapInterface.h.

Member Function Documentation

◆ add() [1/2]

virtual bool TrafficItemMapInterface::add | ( | TrafficItemMapInterface::ID const & | id,
 |  | TrafficItemInterface::Probability const & | probability,
 |  | TrafficItemInterface::Value const & | value
 | ) |  |
pure virtual

Method which creates a traffic item and registers it under the ID passed as a first argument, if not already used in the map. The value of the traffic item (datatype T) will be set to the one passed as a second argument. The probability is set to the default value of 0.5.

Parameters
[in] | id | the ID under which the newly created item is registered
[in] | probability | the probability of the traffic item
[in] | value | the value of the traffic item
Returns
"true", if given ID is not already used, otherwise "false"

Implemented in TrafficItemMapModel.

◆ add() [2/2]

virtual bool TrafficItemMapInterface::add ( TrafficItemMapInterface::Item *const item )
pure virtual

Method which adds the given traffic item to the map, if not already contained in the map. The corresponding ID is generated using generateID().

Parameters
[in] item the traffic item to be registered
Returns
"true" if item is not already contained in the map, otherwise "false"

Implemented in TrafficItemMapModel.

◆ begin()

virtual TrafficItemMapInterface::Iterator TrafficItemMapInterface::begin ( )
pure virtual

Gets an iterator pointing at the first traffic item in the map.

Returns
The iterator pointing at the first object in the map.

Implemented in TrafficItemMapModel.

◆ constBegin()

virtual TrafficItemMapInterface::ConstIterator TrafficItemMapInterface::constBegin ( ) const
pure virtual

Gets an iterator pointing at the first traffic item in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implemented in TrafficItemMapModel.

◆ constEnd()

virtual TrafficItemMapInterface::ConstIterator TrafficItemMapInterface::constEnd ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last traffic item (use for read-only).

Returns
The iterator pointing at the end of the map.

Implemented in TrafficItemMapModel.

◆ contains()

virtual bool TrafficItemMapInterface::contains ( TrafficItemMapInterface::ID const & id ) const
pure virtual

Method tests whether the map contains an entry under the given ID.

Returns
"true", if there is an item under the given ID, "false" otherwise

Implemented in TrafficItemMapModel.

◆ count()

virtual int TrafficItemMapInterface::count ( ) const
pure virtual

Method which returns the number of items registered in the map.

Returns
the number of items in the map

Implemented in TrafficItemMapModel.

◆ end()

virtual TrafficItemMapInterface::Iterator TrafficItemMapInterface::end ( )
pure virtual

Gets an iterator pointing at the end of the map after the last traffic item.

Returns
The iterator pointing at the end of the map.

Implemented in TrafficItemMapModel.

◆ generateID()

virtual TrafficItemMapInterface::ID TrafficItemMapInterface::generateID ( ) const
pure virtual

Method which returns the highest unoccupied ID of the map.

Returns
the highest unocccupied ID of the map

Implemented in TrafficItemMapModel.

◆ getID()

virtual TrafficItemMapInterface::ID TrafficItemMapInterface::getID ( TrafficItemMapInterface::Item *const item ) const
pure virtual

Method which returns the ID of the given traffic item, if contained in the map. Returns Qt's default-constructed key if no such item is registered.

Parameters
[in] item the ID of the traffic item which should be returned
Returns
the ID of the given traffic item if contained. Otherwise, default-constructed key

Implemented in TrafficItemMapModel.

◆ getItem()

virtual TrafficItemMapInterface::Item* TrafficItemMapInterface::getItem ( TrafficItemMapInterface::ID const & id ) const
pure virtual

Method which returns the traffic item registered under the given ID. If there is no such item in the map, nullptr is returned.

Parameters
[in] id the ID of the traffic item which should be returned
Returns
the traffic item registered under the given ID if contained in the map, nullptr otherwise

Implemented in TrafficItemMapModel.

◆ keys()

virtual QList<ID> TrafficItemMapInterface::keys ( ) const
pure virtual

Method which returns a list of all IDs used in the map. For the list, Qt's QList class is used.

Returns
the list (QList) of all IDs used in the map

Implemented in TrafficItemMapModel.

◆ remove() [1/2]

virtual bool TrafficItemMapInterface::remove ( TrafficItemMapInterface::ID const & id )
pure virtual

Method which removes the traffic item registered under the given ID from the map. Afterwards, the item is deleted. Nothing will be done, if there is no item with the given ID is contained in the map.

Parameters
[in] id the ID whose corresponding item should be removed
Returns
"true" if there is an item with the given ID, otherwise "false"

Implemented in TrafficItemMapModel.

◆ remove() [2/2]

virtual bool TrafficItemMapInterface::remove ( TrafficItemMapInterface::Item *const item )
pure virtual

Method which removes the given traffic item from the map. Afterwards, the item is deleted. Nothing will be done, if there is there no such item registered in the map.

Parameters
[in] item the traffic item which should be removed
Returns
"true" if the item is contained in the map, otherwise "false"

Implemented in TrafficItemMapModel.

◆ values()

virtual QList<Item*> TrafficItemMapInterface::values ( ) const
pure virtual

Method which returns a list of all items registered in the map. For the list, Qt's QList class is used.

Returns
the list (QList) of all items in the map

Implemented in TrafficItemMapModel.

The documentation for this class was generated from the following file:
  • TrafficItemMapInterface.h
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficItemMapInterface Member List

This is the complete list of members for TrafficItemMapInterface, including all inherited members.

add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0 | TrafficItemMapInterface | pure virtual
add(TrafficItemMapInterface::Item *const item)=0 | TrafficItemMapInterface | pure virtual
begin()=0 | TrafficItemMapInterface | pure virtual
clear()=0 | TrafficItemMapInterface | pure virtual
constBegin() const =0 | TrafficItemMapInterface | pure virtual
constEnd() const =0 | TrafficItemMapInterface | pure virtual
ConstIterator typedef | TrafficItemMapInterface |
contains(TrafficItemMapInterface::ID const &id) const =0 | TrafficItemMapInterface | pure virtual
count() const =0 | TrafficItemMapInterface | pure virtual
edited() | TrafficItemMapInterface | signal
end()=0 | TrafficItemMapInterface | pure virtual
generateID() const =0 | TrafficItemMapInterface | pure virtual
getID(TrafficItemMapInterface::Item *const item) const =0 | TrafficItemMapInterface | pure virtual
getItem(TrafficItemMapInterface::ID const &id) const =0 | TrafficItemMapInterface | pure virtual
ID typedef | TrafficItemMapInterface |
Item typedef | TrafficItemMapInterface |
Iterator typedef | TrafficItemMapInterface |
keys() const =0 | TrafficItemMapInterface | pure virtual
Map typedef | TrafficItemMapInterface |
remove(TrafficItemMapInterface::ID const &id)=0 | TrafficItemMapInterface | pure virtual
remove(TrafficItemMapInterface::Item *const item)=0 | TrafficItemMapInterface | pure virtual
values() const =0 | TrafficItemMapInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemMapModel Class Reference

Public Member Functions | Public Attributes | List of all members
TrafficItemMapModel Class Reference

The TrafficItemMapModel class implements functionality of the TrafficItemMapInterface class. More...

Inheritance diagram for TrafficItemMapModel:
TrafficItemMapInterface

Public Member Functions

virtual bool | add (TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value) override
Method which creates a traffic item and registers it under the ID passed as a first argument, if not already used in the map. The value of the traffic item (datatype T) will be set to the one passed as a second argument. The probability is set to the default value of 0.5. More...
virtual bool | add (TrafficItemMapInterface::Item *const item) override
Method which adds the given traffic item to the map, if not already contained in the map. The corresponding ID is generated using generateID(). More...
virtual TrafficItemMapInterface::Iterator | begin () override
Gets an iterator pointing at the first traffic item in the map. More...
virtual void | clear () override
Method which clears the map and deletes all items.
virtual TrafficItemMapInterface::ConstIterator | constBegin () const override
Gets an iterator pointing at the first traffic item in the map (use for read-only since pointing at constant values). More...
virtual TrafficItemMapInterface::ConstIterator | constEnd () const override
Gets an iterator pointing at the end of the map after the last traffic item (use for read-only). More...
virtual bool | contains (TrafficItemMapInterface::ID const &id) const override
Method tests whether the map contains an entry under the given ID. More...
virtual int | count () const override
Method which returns the number of items registered in the map. More...
virtual TrafficItemMapInterface::Iterator | end () override
Gets an iterator pointing at the end of the map after the last traffic item. More...
virtual TrafficItemMapInterface::ID | generateID () const
Method which returns the highest unoccupied ID of the map. More...
virtual TrafficItemMapInterface::ID | getID (TrafficItemMapInterface::Item *const item) const override
Method which returns the ID of the given traffic item, if contained in the map. Returns Qt's default-constructed key if no such item is registered. More...
virtual TrafficItemMapInterface::Item * | getItem (TrafficItemMapInterface::ID const &id) const override
Method which returns the traffic item registered under the given ID. If there is no such item in the map, nullptr is returned. More...
virtual QList< TrafficItemMapInterface::ID > | keys () const override
Method which returns a list of all IDs used in the map. For the list, Qt's QList class is used. More...
virtual bool | remove (TrafficItemMapInterface::ID const &id) override
Method which removes the traffic item registered under the given ID from the map. Afterwards, the item is deleted. Nothing will be done, if there is no item with the given ID is contained in the map. More...
virtual bool | remove (TrafficItemMapInterface::Item *const item) override
Method which removes the given traffic item from the map. Afterwards, the item is deleted. Nothing will be done, if there is there no such item registered in the map. More...
virtual QList< TrafficItemMapInterface::Item * > | values () const override
Method which returns a list of all items registered in the map. For the list, Qt's QList class is used. More...

Public Attributes

TrafficItemMapInterface::Map map
the map of traffic items

Additional Inherited Members

- Public Types inherited from TrafficItemMapInterface
using | ConstIterator = Map::ConstIterator
A constant iterator (for reading only)
using | ID = unsigned int
The key identifier (ID)
using | Item = TrafficItemInterface
The traffic items registered in the map.
using | Iterator = Map::Iterator
An iterator for searching within the map.
using | Map = QMap< ID, Item * >
The map for registering traffic items (using Qt's QMap class)
- Signals inherited from TrafficItemMapInterface
void | edited ()
Signal emitted when traffic items are added to or removed from this map. It is also connected to the TrafficItemInterface::edited signal emitted when the value or probability of a traffic item has been edited.

Detailed Description

The TrafficItemMapModel class implements functionality of the TrafficItemMapInterface class.

Definition at line 28 of file TrafficItemMapModel.h.

Member Function Documentation

◆ add() [1/2]

bool TrafficItemMapModel::add | ( | TrafficItemMapInterface::ID const & | id,
 |  | TrafficItemInterface::Probability const & | probability,
 |  | TrafficItemInterface::Value const & | value
 | ) |  |
overridevirtual

Method which creates a traffic item and registers it under the ID passed as a first argument, if not already used in the map. The value of the traffic item (datatype T) will be set to the one passed as a second argument. The probability is set to the default value of 0.5.

Parameters
[in] | id | the ID under which the newly created item is registered
[in] | probability | the probability of the traffic item
[in] | value | the value of the traffic item
Returns
"true", if given ID is not already used, otherwise "false"

Implements TrafficItemMapInterface.

Definition at line 44 of file TrafficItemMapModel.cpp.

47 {
48 if(!contains(id))
49 {
50 TrafficItemInterface* item = new TrafficItemModel(this);
51 item->setValue(value);
52 item->setProbability(probability);
53 map.insert(id,item);
54
55 connect(item, &TrafficItemInterface::edited, this, &TrafficItemMapInterface::edited);
56
57 Q_EMIT edited();
58 return true;
59 }
60
61 return false;
62 }
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapModel::contains
virtual bool contains(TrafficItemMapInterface::ID const &id) const override
Method tests whether the map contains an entry under the given ID.
Definition: TrafficItemMapModel.cpp:130
TrafficItemInterface::edited
void edited()
Signal emitted whenever an attribute of the traffic parameter has changed.
TrafficItemModel
The TrafficItemModel class implements functionality of the TrafficItemInterface class.
Definition: TrafficItemModel.h:26
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficItemInterface::setValue
virtual void setValue(Value const &_value)=0
Sets the traffic item&#39;s value to the value passed as an argument.
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73
TrafficItemMapInterface::edited
void edited()
Signal emitted when traffic items are added to or removed from this map. It is also connected to the ...

◆ add() [2/2]

bool TrafficItemMapModel::add ( TrafficItemMapInterface::Item *const item )
overridevirtual

Method which adds the given traffic item to the map, if not already contained in the map. The corresponding ID is generated using generateID().

Parameters
[in] item the traffic item to be registered
Returns
"true" if item is not already contained in the map, otherwise "false"

Implements TrafficItemMapInterface.

Definition at line 65 of file TrafficItemMapModel.cpp.

66 {
67 TrafficItemMapInterface::ID id = generateID();
68
69 if(!contains(id) && !values().contains(item))
70 {
71 connect(item, &TrafficItemInterface::edited, this, &TrafficItemMapInterface::edited);
72 map.insert(id, item);
73 item->setParent(this);
74
75 Q_EMIT edited();
76 return true;
77 }
78
79 return false;
80 }
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficItemMapModel::contains
virtual bool contains(TrafficItemMapInterface::ID const &id) const override
Method tests whether the map contains an entry under the given ID.
Definition: TrafficItemMapModel.cpp:130
TrafficItemInterface::edited
void edited()
Signal emitted whenever an attribute of the traffic parameter has changed.
TrafficItemMapModel::values
virtual QList< TrafficItemMapInterface::Item * > values() const override
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
Definition: TrafficItemMapModel.cpp:142
TrafficItemMapModel::generateID
virtual TrafficItemMapInterface::ID generateID() const
Method which returns the highest unoccupied ID of the map.
Definition: TrafficItemMapModel.cpp:147
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73
TrafficItemMapInterface::edited
void edited()
Signal emitted when traffic items are added to or removed from this map. It is also connected to the ...

◆ begin()

TrafficItemMapInterface::Iterator TrafficItemMapModel::begin ( )
overridevirtual

Gets an iterator pointing at the first traffic item in the map.

Returns
The iterator pointing at the first object in the map.

Implements TrafficItemMapInterface.

Definition at line 20 of file TrafficItemMapModel.cpp.

21 {
22 return map.begin();
23 }
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73

◆ constBegin()

TrafficItemMapInterface::ConstIterator TrafficItemMapModel::constBegin ( ) const
overridevirtual

Gets an iterator pointing at the first traffic item in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implements TrafficItemMapInterface.

Definition at line 26 of file TrafficItemMapModel.cpp.

27 {
28 return map.constBegin();
29 }
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73

◆ constEnd()

TrafficItemMapInterface::ConstIterator TrafficItemMapModel::constEnd ( ) const
overridevirtual

Gets an iterator pointing at the end of the map after the last traffic item (use for read-only).

Returns
The iterator pointing at the end of the map.

Implements TrafficItemMapInterface.

Definition at line 38 of file TrafficItemMapModel.cpp.

39 {
40 return map.constEnd();
41 }
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73

◆ contains()

bool TrafficItemMapModel::contains ( TrafficItemMapInterface::ID const & id ) const
overridevirtual

Method tests whether the map contains an entry under the given ID.

Returns
"true", if there is an item under the given ID, "false" otherwise

Implements TrafficItemMapInterface.

Definition at line 130 of file TrafficItemMapModel.cpp.

131 {
132 return map.contains(id);
133 }
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73

◆ count()

int TrafficItemMapModel::count ( ) const
overridevirtual

Method which returns the number of items registered in the map.

Returns
the number of items in the map

Implements TrafficItemMapInterface.

Definition at line 161 of file TrafficItemMapModel.cpp.

162 {
163 return map.count();
164 }
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73

◆ end()

TrafficItemMapInterface::Iterator TrafficItemMapModel::end ( )
overridevirtual

Gets an iterator pointing at the end of the map after the last traffic item.

Returns
The iterator pointing at the end of the map.

Implements TrafficItemMapInterface.

Definition at line 32 of file TrafficItemMapModel.cpp.

33 {
34 return map.end();
35 }
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73

◆ generateID()

TrafficItemMapInterface::ID TrafficItemMapModel::generateID ( ) const
virtual

Method which returns the highest unoccupied ID of the map.

Returns
the highest unocccupied ID of the map

Implements TrafficItemMapInterface.

Definition at line 147 of file TrafficItemMapModel.cpp.

148 {
149 TrafficItemMapInterface::ID id = 0;
150 for (auto key : map.keys())
151 {
152 if (id <= key)
153 {
154 id = key + 1;
155 }
156 }
157 return id;
158 }
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73

◆ getID()

TrafficItemMapInterface::ID TrafficItemMapModel::getID ( TrafficItemMapInterface::Item *const item ) const
overridevirtual

Method which returns the ID of the given traffic item, if contained in the map. Returns Qt's default-constructed key if no such item is registered.

Parameters
[in] item the ID of the traffic item which should be returned
Returns
the ID of the given traffic item if contained. Otherwise, default-constructed key

Implements TrafficItemMapInterface.

Definition at line 124 of file TrafficItemMapModel.cpp.

125 {
126 return map.key(item);
127 }
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73

◆ getItem()

TrafficItemMapInterface::Item * TrafficItemMapModel::getItem ( TrafficItemMapInterface::ID const & id ) const
overridevirtual

Method which returns the traffic item registered under the given ID. If there is no such item in the map, nullptr is returned.

Parameters
[in] id the ID of the traffic item which should be returned
Returns
the traffic item registered under the given ID if contained in the map, nullptr otherwise

Implements TrafficItemMapInterface.

Definition at line 113 of file TrafficItemMapModel.cpp.

114 {
115 if(contains(id))
116 {
117 return map.value(id);
118 }
119
120 return nullptr;
121 }
TrafficItemMapModel::contains
virtual bool contains(TrafficItemMapInterface::ID const &id) const override
Method tests whether the map contains an entry under the given ID.
Definition: TrafficItemMapModel.cpp:130
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73

◆ keys()

QList< TrafficItemMapInterface::ID > TrafficItemMapModel::keys ( ) const
overridevirtual

Method which returns a list of all IDs used in the map. For the list, Qt's QList class is used.

Returns
the list (QList) of all IDs used in the map

Implements TrafficItemMapInterface.

Definition at line 136 of file TrafficItemMapModel.cpp.

137 {
138 return map.keys();
139 }
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73

◆ remove() [1/2]

bool TrafficItemMapModel::remove ( TrafficItemMapInterface::ID const & id )
overridevirtual

Method which removes the traffic item registered under the given ID from the map. Afterwards, the item is deleted. Nothing will be done, if there is no item with the given ID is contained in the map.

Parameters
[in] id the ID whose corresponding item should be removed
Returns
"true" if there is an item with the given ID, otherwise "false"

Implements TrafficItemMapInterface.

Definition at line 83 of file TrafficItemMapModel.cpp.

84 {
85 if(contains(id))
86 {
87 delete map.take(id);
88
89 Q_EMIT edited();
90 return true;
91 }
92
93 return false;
94 }
TrafficItemMapModel::contains
virtual bool contains(TrafficItemMapInterface::ID const &id) const override
Method tests whether the map contains an entry under the given ID.
Definition: TrafficItemMapModel.cpp:130
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73
TrafficItemMapInterface::edited
void edited()
Signal emitted when traffic items are added to or removed from this map. It is also connected to the ...

◆ remove() [2/2]

bool TrafficItemMapModel::remove ( TrafficItemMapInterface::Item *const item )
overridevirtual

Method which removes the given traffic item from the map. Afterwards, the item is deleted. Nothing will be done, if there is there no such item registered in the map.

Parameters
[in] item the traffic item which should be removed
Returns
"true" if the item is contained in the map, otherwise "false"

Implements TrafficItemMapInterface.

Definition at line 97 of file TrafficItemMapModel.cpp.

98 {
99
100 if( map.values().contains(item) )
101 {
102 TrafficItemMapInterface::ID id = getID(item);
103 delete map.take(id);
104
105 Q_EMIT edited();
106 return true;
107 }
108
109 return false;
110 }
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficItemMapModel::getID
virtual TrafficItemMapInterface::ID getID(TrafficItemMapInterface::Item *const item) const override
Method which returns the ID of the given traffic item, if contained in the map. Returns Qt&#39;s default-...
Definition: TrafficItemMapModel.cpp:124
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73
TrafficItemMapInterface::edited
void edited()
Signal emitted when traffic items are added to or removed from this map. It is also connected to the ...

◆ values()

QList< TrafficItemMapInterface::Item * > TrafficItemMapModel::values ( ) const
overridevirtual

Method which returns a list of all items registered in the map. For the list, Qt's QList class is used.

Returns
the list (QList) of all items in the map

Implements TrafficItemMapInterface.

Definition at line 142 of file TrafficItemMapModel.cpp.

143 {
144 return map.values();
145 }
TrafficItemMapModel::map
TrafficItemMapInterface::Map map
the map of traffic items
Definition: TrafficItemMapModel.h:73
The documentation for this class was generated from the following files:
  • TrafficItemMapModel.h
  • TrafficItemMapModel.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficItemMapModel Member List

This is the complete list of members for TrafficItemMapModel, including all inherited members.

add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value) override | TrafficItemMapModel | virtual
add(TrafficItemMapInterface::Item *const item) override | TrafficItemMapModel | virtual
begin() override | TrafficItemMapModel | virtual
clear() override | TrafficItemMapModel | virtual
constBegin() const override | TrafficItemMapModel | virtual
constEnd() const override | TrafficItemMapModel | virtual
ConstIterator typedef | TrafficItemMapInterface |
contains(TrafficItemMapInterface::ID const &id) const override | TrafficItemMapModel | virtual
count() const override | TrafficItemMapModel | virtual
edited() | TrafficItemMapInterface | signal
end() override | TrafficItemMapModel | virtual
generateID() const | TrafficItemMapModel | virtual
getID(TrafficItemMapInterface::Item *const item) const override | TrafficItemMapModel | virtual
getItem(TrafficItemMapInterface::ID const &id) const override | TrafficItemMapModel | virtual
ID typedef | TrafficItemMapInterface |
Item typedef | TrafficItemMapInterface |
Iterator typedef | TrafficItemMapInterface |
keys() const override | TrafficItemMapModel | virtual
map | TrafficItemMapModel |
Map typedef | TrafficItemMapInterface |
remove(TrafficItemMapInterface::ID const &id) override | TrafficItemMapModel | virtual
remove(TrafficItemMapInterface::Item *const item) override | TrafficItemMapModel | virtual
values() const override | TrafficItemMapModel | virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemMapPresenter Class Reference

Public Member Functions | List of all members
TrafficItemMapPresenter Class Reference

This class describes the presenter objects of the traffic parameter maps. More...

Inherits QAbstractTableModel.

Public Member Functions

void | addRow (const int &row, TrafficItemInterface::Value const &value, TrafficItemInterface::Probability const &probability)
Method that adds a new row, i.e. a new environment item to the edited component.
int | columnCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of #_columnHeaders. More...
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex). More...
virtual Qt::ItemFlags | flags (const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! More...
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in #_columnHeaders) is returned in the QVariant data format. More...
bool | removeRow (const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval. More...
int | rowCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of environment items. More...
virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value. More...
void | update ()
Method which updates the table according to the current entries of #environmentMap.

Detailed Description

This class describes the presenter objects of the traffic parameter maps.

In the spirit of Qt's Model/View framework it constitutes the wrapper class connecting the model data (TrafficItemMapInterface) to the interface defined in QAbstractTableModel. This interface can be utilized by instances of Qt's QTableView to display the map entries in a table format.

See https://doc.qt.io/qt-5/model-view-programming.html for Qt's model/view framework.

Definition at line 48 of file TrafficItemMapPresenter.h.

Member Function Documentation

◆ columnCount()

int TrafficItemMapPresenter::columnCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of #_columnHeaders.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table columns

Definition at line 40 of file TrafficItemMapPresenter.cpp.

41 {
42 Q_UNUSED(parent);
43
44 return _columnHeaders.count();
45 }

◆ data()

QVariant TrafficItemMapPresenter::data | ( | const QModelIndex & | index,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex).

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::DisplayRole or Qt::EditRole)
Returns
The data stored in the table cell (as a QVariant)

Definition at line 47 of file TrafficItemMapPresenter.cpp.

48 {
49 int row = index.row();
50 int col = index.column();
51 TrafficItemMapInterface::Item * item = trafficItemMap->getItem(RowToID[row]);
52
53 if(row >= trafficItemMap->count())
54 return QVariant::Invalid;
55
56 if(role == Qt::TextAlignmentRole)
57 return QVariant(Qt::AlignCenter);
58
59 if(item && (role == Qt::DisplayRole || role == Qt::EditRole))
60 {
61 if( col == 0)
62 return QVariant(item->getValue());
63
64 else if(col == 1)
65 return QVariant(item->getProbability());
66 }
67
68 return QVariant();
69 }
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemInterface::getProbability
virtual Probability getProbability() const =0
Returns the current probability of the traffic item&#39;s occurence.
TrafficItemInterface::getValue
virtual Value getValue() const =0
Returns the current value of the traffic item.
TrafficItemMapInterface::count
virtual int count() const =0
Method which returns the number of items registered in the map.
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...

◆ flags()

Qt::ItemFlags TrafficItemMapPresenter::flags ( const QModelIndex & index ) const
overridevirtual

Reimplementation of the flags method. This will make the items of the model editable!

Parameters
[in] index An index identifying the cell of the table
Returns
An item flag

Definition at line 102 of file TrafficItemMapPresenter.cpp.

103 {
104 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
105 }

◆ headerData()

QVariant TrafficItemMapPresenter::headerData | ( | int | section,
 |  | Qt::Orientation | orientation,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in #_columnHeaders) is returned in the QVariant data format.

Parameters
[in] | section | A table section
[in] | role | A Qt role
[in] | orientation | A table orientation
Returns
The content of the table's header at the given section

Definition at line 21 of file TrafficItemMapPresenter.cpp.

22 {
23 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
24 return _columnHeaders.value(section);
25
26 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
27 return section + 1;
28
29 return QVariant();
30 }

◆ removeRow()

bool TrafficItemMapPresenter::removeRow ( const int & row )

Method that removes the row specified by the given row-index, if this is in a meaningful interval.

Parameters
[in] row the row-index
Returns
"True", if row is between 0 and the number of inputs, "false", otherwise

Definition at line 125 of file TrafficItemMapPresenter.cpp.

126 {
127 if( RowToID.contains(row) )
128 {
129 beginRemoveRows(QModelIndex(), row, row);
130 trafficItemMap->remove(RowToID[row]);
131 RowToID.take(row);
132
133 // shift the ID to row map for everything below this Item
134 for( int i = row + 1; i<=RowToID.count() ; i++)
135 RowToID.insert( i-1, RowToID.take(i) );
136
137 endRemoveRows();
138
139 return true;
140 }
141 else
142 return false;
143 }
TrafficItemMapInterface::remove
virtual bool remove(TrafficItemMapInterface::ID const &id)=0
Method which removes the traffic item registered under the given ID from the map. Afterwards...

◆ rowCount()

int TrafficItemMapPresenter::rowCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of environment items.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table rows

Definition at line 32 of file TrafficItemMapPresenter.cpp.

33 {
34 Q_UNUSED(parent);
35
36 return trafficItemMap->count();
37 }
TrafficItemMapInterface::count
virtual int count() const =0
Method which returns the number of items registered in the map.

◆ setData()

bool TrafficItemMapPresenter::setData | ( | const QModelIndex & | index,
 |  | const QVariant & | value,
 |  | int | role = Qt::EditRole
 | ) |  |
overridevirtual

Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value.

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::EditRole)
Returns
"True" if the index corresponds to an existing cell in the table, otherwise "false"

Definition at line 71 of file TrafficItemMapPresenter.cpp.

74 {
75 int row = index.row();
76 int col = index.column();
77 TrafficItemMapInterface::Item * item = trafficItemMap->getItem(RowToID[row]);
78
79 if(role == Qt::EditRole)
80 {
81
82 if(col == 0)
83 {
84 item->setValue(value.toString());
85 Q_EMIT dataChanged(index, index);
86 Q_EMIT trafficItemMap->edited();
87 return true;
88 }
89 else if(col ==1)
90 {
91 item->setProbability(value.toDouble());
92 Q_EMIT dataChanged(index, index);
93 Q_EMIT trafficItemMap->edited();
94 return true;
95 }
96 }
97
98 return false;
99 }
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficItemInterface::setValue
virtual void setValue(Value const &_value)=0
Sets the traffic item&#39;s value to the value passed as an argument.
TrafficItemMapInterface::edited
void edited()
Signal emitted when traffic items are added to or removed from this map. It is also connected to the ...
The documentation for this class was generated from the following files:
  • TrafficItemMapPresenter.h
  • TrafficItemMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficItemMapPresenter Member List

This is the complete list of members for TrafficItemMapPresenter, including all inherited members.

addRow(const int &row, TrafficItemInterface::Value const &value, TrafficItemInterface::Probability const &probability) | TrafficItemMapPresenter |
columnCount(const QModelIndex &parent=QModelIndex()) const override | TrafficItemMapPresenter |
data(const QModelIndex &index, int role=Qt::DisplayRole) const override | TrafficItemMapPresenter |
flags(const QModelIndex &index) const override | TrafficItemMapPresenter | virtual
headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override | TrafficItemMapPresenter |
removeRow(const int &row) | TrafficItemMapPresenter |
rowCount(const QModelIndex &parent=QModelIndex()) const override | TrafficItemMapPresenter |
setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override | TrafficItemMapPresenter | virtual
update() | TrafficItemMapPresenter |
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemModel Class Reference

Public Member Functions | Public Attributes | List of all members
TrafficItemModel Class Reference

The TrafficItemModel class implements functionality of the TrafficItemInterface class. More...

Inheritance diagram for TrafficItemModel:
TrafficItemInterface

Public Member Functions

virtual Probability | getProbability () const override
Returns the current probability of the traffic item's occurence. More...
virtual Value | getValue () const override
Returns the current value of the traffic item. More...
virtual void | setProbability (Probability const &_probability) override
Sets the probability of the traffic item's occurence. More...
virtual void | setValue (Value const &_value) override
Sets the traffic item's value to the value passed as an argument. More...

Public Attributes

Probability probability
the selection probability of the traffic parameter
Value value
the current value of the traffic parameter

Additional Inherited Members

- Public Types inherited from TrafficItemInterface
using | Probability = double
the selection probability's datatype
using | Value = QString
the datatype for the traffic parameter's value (generally a string)
- Signals inherited from TrafficItemInterface
void | edited ()
Signal emitted whenever an attribute of the traffic parameter has changed.

Detailed Description

The TrafficItemModel class implements functionality of the TrafficItemInterface class.

Definition at line 26 of file TrafficItemModel.h.

Member Function Documentation

◆ getProbability()

TrafficItemInterface::Probability TrafficItemModel::getProbability ( ) const
overridevirtual

Returns the current probability of the traffic item's occurence.

Returns
the current probability of the traffic item's occurence

Implements TrafficItemInterface.

Definition at line 41 of file TrafficItemModel.cpp.

42 {
43 return probability;
44 }
TrafficItemModel::probability
Probability probability
the selection probability of the traffic parameter
Definition: TrafficItemModel.h:46

◆ getValue()

TrafficItemInterface::Value TrafficItemModel::getValue ( ) const
overridevirtual

Returns the current value of the traffic item.

Returns
the current value of the traffic item

Implements TrafficItemInterface.

Definition at line 27 of file TrafficItemModel.cpp.

28 {
29 return value;
30 }
TrafficItemModel::value
Value value
the current value of the traffic parameter
Definition: TrafficItemModel.h:45

◆ setProbability()

void TrafficItemModel::setProbability ( Probability const & _probability )
overridevirtual

Sets the probability of the traffic item's occurence.

Parameters
[in] _probability the new probability to be adopted

Implements TrafficItemInterface.

Definition at line 33 of file TrafficItemModel.cpp.

34 {
35 probability=_probability;
36
37 Q_EMIT edited();
38 }
TrafficItemInterface::edited
void edited()
Signal emitted whenever an attribute of the traffic parameter has changed.
TrafficItemModel::probability
Probability probability
the selection probability of the traffic parameter
Definition: TrafficItemModel.h:46

◆ setValue()

void TrafficItemModel::setValue ( Value const & _value )
overridevirtual

Sets the traffic item's value to the value passed as an argument.

Parameters
[in] _value the new value to be adopted

Implements TrafficItemInterface.

Definition at line 19 of file TrafficItemModel.cpp.

20 {
21 value = _value;
22
23 Q_EMIT edited();
24 }
TrafficItemInterface::edited
void edited()
Signal emitted whenever an attribute of the traffic parameter has changed.
TrafficItemModel::value
Value value
the current value of the traffic parameter
Definition: TrafficItemModel.h:45
The documentation for this class was generated from the following files:
  • TrafficItemModel.h
  • TrafficItemModel.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficItemModel Member List

This is the complete list of members for TrafficItemModel, including all inherited members.

edited() | TrafficItemInterface | signal
getProbability() const override | TrafficItemModel | virtual
getValue() const override | TrafficItemModel | virtual
Probability typedef | TrafficItemInterface |
probability | TrafficItemModel |
setProbability(Probability const &_probability) override | TrafficItemModel | virtual
setValue(Value const &_value) override | TrafficItemModel | virtual
value | TrafficItemModel |
Value typedef | TrafficItemInterface |
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficItemView Class Reference

Public Types | Signals | Public Member Functions | Protected Slots | Private Attributes | List of all members
TrafficItemView Class Reference

This class defines a general view for a traffic item, which can be a volume, platoon rate, velocity, homogeneity or an agent profile. More...

Inheritance diagram for TrafficItemView:
WidgetView

Public Types

enum Type { Type::Volume = 1 }

Signals

void | probabilityChanged (unsigned int ID, double value, Type type)
Signal, emitted when probability of the traffic item has been modified by the user. Transmits the ID, probability value and type of the item.
void | remove (unsigned int ID, Type type)
Signal, emitted when remove button has been clicked. Transmits the ID and type of the traffic item.
void | valueChanged (unsigned int ID, QString value, Type type)
Signal, emitted when the value of the traffic item has been changed. Transmits the ID, value and type of the item.

Public Member Functions

unsigned int | getID () const
Method which returns the ID of the traffic item. More...
int | getIndex () const
Method which returns the index of the traffic item. Items will be numerated in the order they appear in the TrafficParametersView or TrafficLanesView. More...
double | getProbability () const
Method which returns the probability of the traffic item. More...
Type | getType () const
Method which returns the type of the traffic item. The types are defined by the enum class Type. More...
QString | getValue () const
Method which returns the value of the traffic item. More...
void | setIndex (int newIndex)
Method which sets the displayed index of the traffic item to the one passed as an argument. More...
void | setProbability (double value)
Method which sets the displayed probability of the traffic item to the one passed as an argument. More...
void | setValue (QString value)
Method which sets the displayed value of the traffic item to the one passed as an argument. More...
- Public Member Functions inherited from WidgetView
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Protected Slots

void | on_probabilityValue_editingFinished ()
Qt Desinger-created slot activated when the probability value of the double spinbox has been edited by the user. Emits the probabilityChanged signal.
void | on_remove_clicked ()
Qt Desinger-created slot activated when the remove button has been clicked. Emits the remove signal.
void | valueView_valueChanged (QString const &value)
A slot which is activated when the value of the traffic item has been edited by the user. Emits the valueChanged signal. More...

Private Attributes

unsigned int | ID
the ID of the traffic item
int | index
the numeration index of the traffic item (changes, e.g., if traffic items in the list are removed)
Type type
the type of the traffic item
Ui::TrafficItemView * | ui
the ui object containing all visualization elements of the traffic item view

Additional Inherited Members

- Protected Member Functions inherited from WidgetView
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.

Detailed Description

This class defines a general view for a traffic item, which can be a volume, platoon rate, velocity, homogeneity or an agent profile.

A traffic item generally has a value (depending on the type) and a probability view. The latter is always a double spinbox, whereas the former constitutes a spinbox if the value is an integer or a double (volumes, platoon rates, velocites, homogeneities) or a label if the value is a string (agent profile).

Definition at line 30 of file TrafficItemView.h.

Member Enumeration Documentation

◆ Type

enum TrafficItemView::Type
strong
Enumerator
Volume

An enum class defining the type of the traffic item.

Definition at line 35 of file TrafficItemView.h.

35 {
36 Volume = 1,
37 PlatoonRate = 2,
38 Velocity = 3,
39 Homogeneity = 4,
40 Agent = 5,
41 };

Member Function Documentation

◆ getID()

unsigned int TrafficItemView::getID ( ) const

Method which returns the ID of the traffic item.

Returns
the ID of the traffic item

Definition at line 146 of file TrafficItemView.cpp.

147 {
148 return ID;
149 }
TrafficItemView::ID
unsigned int ID
the ID of the traffic item
Definition: TrafficItemView.h:156

◆ getIndex()

int TrafficItemView::getIndex ( ) const

Method which returns the index of the traffic item. Items will be numerated in the order they appear in the TrafficParametersView or TrafficLanesView.

Returns
the index of the traffic item

Definition at line 151 of file TrafficItemView.cpp.

152 {
153 return index;
154 }
TrafficItemView::index
int index
the numeration index of the traffic item (changes, e.g., if traffic items in the list are removed) ...
Definition: TrafficItemView.h:157

◆ getProbability()

double TrafficItemView::getProbability ( ) const

Method which returns the probability of the traffic item.

Returns
the probability of the traffic item

Definition at line 197 of file TrafficItemView.cpp.

198 {
199 return ui->probabilityValue->value();
200 }
TrafficItemView::ui
Ui::TrafficItemView * ui
the ui object containing all visualization elements of the traffic item view
Definition: TrafficItemView.h:159

◆ getType()

TrafficItemView::Type TrafficItemView::getType ( ) const

Method which returns the type of the traffic item. The types are defined by the enum class Type.

Returns
the type of the traffic item

Definition at line 209 of file TrafficItemView.cpp.

210 {
211 return type;
212 }
TrafficItemView::type
Type type
the type of the traffic item
Definition: TrafficItemView.h:158

◆ getValue()

QString TrafficItemView::getValue ( ) const

Method which returns the value of the traffic item.

Returns
the value of the traffic item

Definition at line 214 of file TrafficItemView.cpp.

215 {
216 switch(type)
217 {
218
219 case Type::Volume:
220 return QString("%1").arg(findChild<QSpinBox*>("valueView")->value());
221
222 case Type::PlatoonRate:
223 return QString("%1").arg(findChild<QDoubleSpinBox*>("valueView")->value());
224
225 case Type::Velocity:
226 return QString("%1").arg(findChild<QDoubleSpinBox*>("valueView")->value());
227
228 case Type::Homogeneity:
229 return QString("%1").arg(findChild<QDoubleSpinBox*>("valueView")->value());
230
231 case Type::Agent:
232 return findChild<QLabel*>("valueView")->text();
233
234 default:
235 return QString("");
236 }
237 }
TrafficItemView::Type::Volume
An enum class defining the type of the traffic item.
TrafficItemView::type
Type type
the type of the traffic item
Definition: TrafficItemView.h:158

◆ setIndex()

void TrafficItemView::setIndex ( int newIndex )

Method which sets the displayed index of the traffic item to the one passed as an argument.

Parameters
[in] the new index to be displayed

Definition at line 202 of file TrafficItemView.cpp.

203 {
204 index = newIndex;
205 ui->Title->setText(QString("%1. ").arg(index));
206 }
TrafficItemView::ui
Ui::TrafficItemView * ui
the ui object containing all visualization elements of the traffic item view
Definition: TrafficItemView.h:159
TrafficItemView::index
int index
the numeration index of the traffic item (changes, e.g., if traffic items in the list are removed) ...
Definition: TrafficItemView.h:157

◆ setProbability()

void TrafficItemView::setProbability ( double value )

Method which sets the displayed probability of the traffic item to the one passed as an argument.

Parameters
[in] the new probability to be displayed

Definition at line 192 of file TrafficItemView.cpp.

193 {
194 ui->probabilityValue->setValue(value);
195 }
TrafficItemView::ui
Ui::TrafficItemView * ui
the ui object containing all visualization elements of the traffic item view
Definition: TrafficItemView.h:159

◆ setValue()

void TrafficItemView::setValue ( QString value )

Method which sets the displayed value of the traffic item to the one passed as an argument.

Parameters
[in] the new value to be displayed

Definition at line 158 of file TrafficItemView.cpp.

159 {
160 switch(type)
161 {
162
163 case Type::Volume:
164 {
165 ui->ContentWidget->findChild<QSpinBox*>("valueView")->setValue(value.toInt());
166 break;
167 }
168 case Type::PlatoonRate:
169 {
170 ui->ContentWidget->findChild<QDoubleSpinBox*>("valueView")->setValue(value.toDouble());
171 break;
172 }
173 case Type::Velocity:
174 {
175 ui->ContentWidget->findChild<QDoubleSpinBox*>("valueView")->setValue(value.toDouble());
176 break;
177 }
178 case Type::Homogeneity:
179 {
180 ui->ContentWidget->findChild<QDoubleSpinBox*>("valueView")->setValue(value.toDouble());
181 break;
182 }
183 case Type::Agent:
184 {
185 ui->ContentWidget->findChild<QLabel*>("valueView")->setText(value);
186 break;
187 }
188 }
189 }
TrafficItemView::ui
Ui::TrafficItemView * ui
the ui object containing all visualization elements of the traffic item view
Definition: TrafficItemView.h:159
TrafficItemView::setValue
void setValue(QString value)
Method which sets the displayed value of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:158
TrafficItemView::Type::Volume
An enum class defining the type of the traffic item.
TrafficItemView::type
Type type
the type of the traffic item
Definition: TrafficItemView.h:158

◆ valueView_valueChanged

void TrafficItemView::valueView_valueChanged ( QString const & value )
protectedslot

A slot which is activated when the value of the traffic item has been edited by the user. Emits the valueChanged signal.

Parameters
[in] value the new value of the traffic item

Definition at line 136 of file TrafficItemView.cpp.

137 {
138 Q_EMIT valueChanged(ID,value,type);
139 }
TrafficItemView::ID
unsigned int ID
the ID of the traffic item
Definition: TrafficItemView.h:156
TrafficItemView::valueChanged
void valueChanged(unsigned int ID, QString value, Type type)
Signal, emitted when the value of the traffic item has been changed. Transmits the ID...
TrafficItemView::type
Type type
the type of the traffic item
Definition: TrafficItemView.h:158
The documentation for this class was generated from the following files:
  • TrafficItemView.h
  • TrafficItemView.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficItemView Member List

This is the complete list of members for TrafficItemView, including all inherited members.

getID() const | TrafficItemView |
getIndex() const | TrafficItemView |
getProbability() const | TrafficItemView |
getType() const | TrafficItemView |
getValue() const | TrafficItemView |
ID | TrafficItemView | private
index | TrafficItemView | private
on_probabilityValue_editingFinished() | TrafficItemView | protectedslot
on_remove_clicked() | TrafficItemView | protectedslot
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
probabilityChanged(unsigned int ID, double value, Type type) | TrafficItemView | signal
remove(unsigned int ID, Type type) | TrafficItemView | signal
setIndex(int newIndex) | TrafficItemView |
setProbability(double value) | TrafficItemView |
setValue(QString value) | TrafficItemView |
Type enum name | TrafficItemView |
type | TrafficItemView | private
ui | TrafficItemView | private
valueChanged(unsigned int ID, QString value, Type type) | TrafficItemView | signal
valueView_valueChanged(QString const &value) | TrafficItemView | protectedslot
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficLanesPresenter Class Reference

Signals | Public Member Functions | Private Slots | Private Attributes | List of all members
TrafficLanesPresenter Class Reference

This class defines the presenter object which handles events coming from the view (TrafficLanesView) and edits the model accordingly (TrafficInterface). More...

Inherits QObject.

Signals

void | cleared ()
Signal, emitted when the whole configuration has been cleared, i.e. all agent profiles have been removed from the regular and rightmost lanes.
void | RegularLaneAgent_added ()
Signal, emitted when an agent profile has been added to a regular lane in the model.
void | RegularLaneAgent_probabilityChanged ()
Signal, emitted when the probability of a regular lane agent's profile has been changed in the model.
void | RegularLaneAgent_removed ()
Signal, emitted when an agent profile has been removed from a regular lane in the model.
void | RightmostLaneAgent_added ()
Signal, emitted when an agent profile has been added to the rightmost lane in the model.
void | RightmostLaneAgent_probabilityChanged ()
Signal, emitted when the probability of a rightmost lane agent's profile has been changed in the model.
void | RightmostLaneAgent_removed ()
Signal, emitted when an agent profile has been removed from the rightmost lane in the model.

Public Member Functions

void | clearAgentSelectionView ()
Slot which is triggered when the map of available agent profiles (Agent Configuration Plugin) has been cleared. Deletes all regular and rightmost lane agent views and empties the selection lists of the comboboxes.
void | updateView ()
Method which updates the whole TrafficLanesView widget to display the entire model configuration. Will be called after loading a combination xml file.

Private Slots

void | addRegularLaneAgent (QString const &name)
Slot which is triggered when the add-button has been clicked in the regular lanes section of TrafficLanesView. Adds the transmitted agent profile to the map of regular lane agents and creates the corresponding view. The agent profile is only added if it has not been already incorporated. More...
void | addRightmostLaneAgent (QString const &name)
Slot which is triggered when the add-button has been clicked in the rightmost lane section of TrafficLanesView. Adds the transmitted agent profile to the map of rightmost lane agents and creates the corresponding view. The agent profile is only added if it has not been already incorporated. More...
void | removeRegularLaneAgent (unsigned int id)
Slot which is triggered when the remove-button has been clicked for a regular lane agent view. Removes the agent profile with the transmitted ID from the map and destroys the corresponding view. Nothing will be done if no agent profile of the given ID exists. More...
void | removeRegularLaneAgentByName (QString name)
Slot which acts as removeRegularLaneAgent but uses a name instead of the ID. This slot is connected to the removed signal of the agent map in the Agent Configuration Plugin which works with names instead of IDs. More...
void | removeRightmostLaneAgent (unsigned int id)
Slot which is triggered when the remove-button has been clicked for a rightmost lane agent view. Removes the agent profile with the transmitted ID from the map and destroys the corresponding view. Nothing will be done if no agent profile of the given ID exists. More...
void | removeRightmostLaneAgentByName (QString name)
Slot which acts as removeRightmostLaneAgent but uses a name instead of the ID. This slot is connected to the removed signal of the agent map in the Agent Configuration Plugin which works with names instead of IDs. More...
void | setRegularLaneAgentProbability (unsigned int id, double value)
Slot which is triggered when the displayed probability value of a regular lane agent has been edited by the user. Adopts the transmitted value (second argument) for the model probability of the agent profile with the given ID (first argument). More...
void | setRightmostLaneAgentProbability (unsigned int id, double value)
Slot which is triggered when the displayed probability value of a rightmost lane agent has been edited by the user. Adopts the transmitted value (second argument) for the model probability of the agent profile with the given ID (first argument). More...

Private Attributes

TrafficInterface * traffic
a pointer to the traffic model edited by this presenter
TrafficLanesView * trafficLanesView
a pointer to the editor view whose user events are managed by this presenter

Detailed Description

This class defines the presenter object which handles events coming from the view (TrafficLanesView) and edits the model accordingly (TrafficInterface).

More specifically, it manages the user interactions for the assignment of agent profiles to traffic lanes

Note
This presenter class emits signals after editing the model which are noticed by the TrafficDisplayPresenter class. Normally, these signals should be emitted by the model itself but since it invokes template class instances, for which Qt does not support the signal-slot mechanism, signals are exceptionally handled by this presenter class.

Definition at line 36 of file TrafficLanesPresenter.h.

Member Function Documentation

◆ addRegularLaneAgent

void TrafficLanesPresenter::addRegularLaneAgent ( QString const & name )
privateslot

Slot which is triggered when the add-button has been clicked in the regular lanes section of TrafficLanesView. Adds the transmitted agent profile to the map of regular lane agents and creates the corresponding view. The agent profile is only added if it has not been already incorporated.

Parameters
[in] name the name of the agent profile to be added

Definition at line 23 of file TrafficLanesPresenter.cpp.

24 {
25 unsigned int id = traffic->getAgentsRegularLane()->generateID();
26 QList<QString> names;
27
28 for(TrafficItemInterface<QString>* agent : traffic->getAgentsRegularLane()->values())
29 names.append(agent->getValue());
30
31 if(agentProfiles->contains(name) && !names.contains(name))
32 {
33 traffic->getAgentsRegularLane()->add(id, name);
34 trafficLanesView->addRegularLaneAgentView(id,name, 0.5);
35 Q_EMIT RegularLaneAgent_added();
36 }
37 }
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficLanesPresenter::RegularLaneAgent_added
void RegularLaneAgent_added()
Signal, emitted when an agent profile has been added to a regular lane in the model.
TrafficLanesView::addRegularLaneAgentView
void addRegularLaneAgentView(unsigned int id, QString name, double probability)
Method which creates an editor view for a regular lane agent profile and inserts it into the correspo...
Definition: TrafficLanesView.cpp:48
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
TrafficLanesPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model edited by this presenter
Definition: TrafficLanesPresenter.h:192
TrafficItemMapInterface::generateID
virtual TrafficItemMapInterface::ID generateID() const =0
Method which returns the highest unoccupied ID of the map.
TrafficItemMapInterface::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0
Method which creates a traffic item and registers it under the ID passed as a first argument...
TrafficLanesPresenter::trafficLanesView
TrafficLanesView * trafficLanesView
a pointer to the editor view whose user events are managed by this presenter
Definition: TrafficLanesPresenter.h:193

◆ addRightmostLaneAgent

void TrafficLanesPresenter::addRightmostLaneAgent ( QString const & name )
privateslot

Slot which is triggered when the add-button has been clicked in the rightmost lane section of TrafficLanesView. Adds the transmitted agent profile to the map of rightmost lane agents and creates the corresponding view. The agent profile is only added if it has not been already incorporated.

Parameters
[in] name the name of the agent profile to be added

Definition at line 40 of file TrafficLanesPresenter.cpp.

41 {
42 unsigned int id = traffic->getAgentsRightMostLane()->generateID();
43 QList<QString> names;
44
45 for(TrafficItemInterface<QString>* agent : traffic->getAgentsRightMostLane()->values())
46 names.append(agent->getValue());
47
48 if(agentProfiles->contains(name) && !names.contains(name))
49 {
50 traffic->getAgentsRightMostLane()->add(id, name);
51 trafficLanesView->addRightmostLaneAgentView(id,name, 0.5);
52 Q_EMIT RightmostLaneAgent_added();
53 }
54 }
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
TrafficLanesPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model edited by this presenter
Definition: TrafficLanesPresenter.h:192
TrafficLanesPresenter::RightmostLaneAgent_added
void RightmostLaneAgent_added()
Signal, emitted when an agent profile has been added to the rightmost lane in the model...
TrafficItemMapInterface::generateID
virtual TrafficItemMapInterface::ID generateID() const =0
Method which returns the highest unoccupied ID of the map.
TrafficItemMapInterface::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0
Method which creates a traffic item and registers it under the ID passed as a first argument...
TrafficLanesView::addRightmostLaneAgentView
void addRightmostLaneAgentView(unsigned int id, QString name, double probability)
Method which creates an editor view for a rightmost lane agent profile and inserts it into the corres...
Definition: TrafficLanesView.cpp:32
TrafficLanesPresenter::trafficLanesView
TrafficLanesView * trafficLanesView
a pointer to the editor view whose user events are managed by this presenter
Definition: TrafficLanesPresenter.h:193

◆ removeRegularLaneAgent

void TrafficLanesPresenter::removeRegularLaneAgent ( unsigned int id )
privateslot

Slot which is triggered when the remove-button has been clicked for a regular lane agent view. Removes the agent profile with the transmitted ID from the map and destroys the corresponding view. Nothing will be done if no agent profile of the given ID exists.

Parameters
[in] id the ID of the agent profile to be removed

Definition at line 57 of file TrafficLanesPresenter.cpp.

58 {
59 if(traffic->getAgentsRegularLane()->contains(id))
60 {
61 traffic->getAgentsRegularLane()->remove(id);
62 trafficLanesView->removeRegularLaneAgentView(id);
63 Q_EMIT RegularLaneAgent_removed();
64 }
65 }
TrafficItemMapInterface::contains
virtual bool contains(TrafficItemMapInterface::ID const &id) const =0
Method tests whether the map contains an entry under the given ID.
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
TrafficLanesPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model edited by this presenter
Definition: TrafficLanesPresenter.h:192
TrafficItemMapInterface::remove
virtual bool remove(TrafficItemMapInterface::ID const &id)=0
Method which removes the traffic item registered under the given ID from the map. Afterwards...
TrafficLanesView::removeRegularLaneAgentView
void removeRegularLaneAgentView(unsigned int id)
Method which removes the editor view for a regular lane agent profile specified by the ID passed as a...
Definition: TrafficLanesView.cpp:62
TrafficLanesPresenter::RegularLaneAgent_removed
void RegularLaneAgent_removed()
Signal, emitted when an agent profile has been removed from a regular lane in the model...
TrafficLanesPresenter::trafficLanesView
TrafficLanesView * trafficLanesView
a pointer to the editor view whose user events are managed by this presenter
Definition: TrafficLanesPresenter.h:193

◆ removeRegularLaneAgentByName

void TrafficLanesPresenter::removeRegularLaneAgentByName ( QString name )
privateslot

Slot which acts as removeRegularLaneAgent but uses a name instead of the ID. This slot is connected to the removed signal of the agent map in the Agent Configuration Plugin which works with names instead of IDs.

Parameters
[in] name the name of the regular agent profile to be removed

Definition at line 111 of file TrafficLanesPresenter.cpp.

112 {
113 QMap<QString, unsigned int> map;
114 TrafficItemMapInterface<QString>* agentMap = traffic->getAgentsRegularLane();
115
116 for(TrafficItemInterface<QString>* agent : agentMap->values())
117 map.insert(agent->getValue(), agentMap->getID(agent));
118
119 if(map.contains(name))
120 {
121 removeRegularLaneAgent(map[name]);
122 trafficLanesView->removeRegularLaneAgentView(map[name]);
123 Q_EMIT RegularLaneAgent_removed();
124 }
125 }
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficItemMapInterface::getID
virtual TrafficItemMapInterface::ID getID(TrafficItemMapInterface::Item *const item) const =0
Method which returns the ID of the given traffic item, if contained in the map. Returns Qt&#39;s default-...
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
TrafficLanesPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model edited by this presenter
Definition: TrafficLanesPresenter.h:192
TrafficLanesPresenter::removeRegularLaneAgent
void removeRegularLaneAgent(unsigned int id)
Slot which is triggered when the remove-button has been clicked for a regular lane agent view...
Definition: TrafficLanesPresenter.cpp:57
TrafficLanesView::removeRegularLaneAgentView
void removeRegularLaneAgentView(unsigned int id)
Method which removes the editor view for a regular lane agent profile specified by the ID passed as a...
Definition: TrafficLanesView.cpp:62
TrafficLanesPresenter::RegularLaneAgent_removed
void RegularLaneAgent_removed()
Signal, emitted when an agent profile has been removed from a regular lane in the model...
TrafficLanesPresenter::trafficLanesView
TrafficLanesView * trafficLanesView
a pointer to the editor view whose user events are managed by this presenter
Definition: TrafficLanesPresenter.h:193

◆ removeRightmostLaneAgent

void TrafficLanesPresenter::removeRightmostLaneAgent ( unsigned int id )
privateslot

Slot which is triggered when the remove-button has been clicked for a rightmost lane agent view. Removes the agent profile with the transmitted ID from the map and destroys the corresponding view. Nothing will be done if no agent profile of the given ID exists.

Parameters
[in] id the ID of the agent profile to be removed

Definition at line 67 of file TrafficLanesPresenter.cpp.

68 {
69 if(traffic->getAgentsRightMostLane()->contains(id))
70 {
71 traffic->getAgentsRightMostLane()->remove(id);
72 trafficLanesView->removeRightmostLaneAgentView(id);
73 Q_EMIT RightmostLaneAgent_removed();
74 }
75 }
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
TrafficItemMapInterface::contains
virtual bool contains(TrafficItemMapInterface::ID const &id) const =0
Method tests whether the map contains an entry under the given ID.
TrafficLanesPresenter::RightmostLaneAgent_removed
void RightmostLaneAgent_removed()
Signal, emitted when an agent profile has been removed from the rightmost lane in the model...
TrafficLanesPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model edited by this presenter
Definition: TrafficLanesPresenter.h:192
TrafficItemMapInterface::remove
virtual bool remove(TrafficItemMapInterface::ID const &id)=0
Method which removes the traffic item registered under the given ID from the map. Afterwards...
TrafficLanesView::removeRightmostLaneAgentView
void removeRightmostLaneAgentView(unsigned int id)
Method which removes the editor view for a rightmost lane agent profile specified by the ID passed as...
Definition: TrafficLanesView.cpp:81
TrafficLanesPresenter::trafficLanesView
TrafficLanesView * trafficLanesView
a pointer to the editor view whose user events are managed by this presenter
Definition: TrafficLanesPresenter.h:193

◆ removeRightmostLaneAgentByName

void TrafficLanesPresenter::removeRightmostLaneAgentByName ( QString name )
privateslot

Slot which acts as removeRightmostLaneAgent but uses a name instead of the ID. This slot is connected to the removed signal of the agent map in the Agent Configuration Plugin which works with names instead of IDs.

Parameters
[in] name the name of the rightmost agent profile to be removed

Definition at line 127 of file TrafficLanesPresenter.cpp.

128 {
129 QMap<QString, unsigned int> map;
130 TrafficItemMapInterface<QString>* agentMap = traffic->getAgentsRightMostLane();
131
132 for(TrafficItemInterface<QString>* agent : agentMap->values())
133 map.insert(agent->getValue(), agentMap->getID(agent));
134
135 if(map.contains(name))
136 {
137 removeRightmostLaneAgent(map[name]);
138 trafficLanesView->removeRightmostLaneAgentView(map[name]);
139 Q_EMIT RightmostLaneAgent_removed();
140 }
141 }
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficItemMapInterface::getID
virtual TrafficItemMapInterface::ID getID(TrafficItemMapInterface::Item *const item) const =0
Method which returns the ID of the given traffic item, if contained in the map. Returns Qt&#39;s default-...
TrafficLanesPresenter::removeRightmostLaneAgent
void removeRightmostLaneAgent(unsigned int id)
Slot which is triggered when the remove-button has been clicked for a rightmost lane agent view...
Definition: TrafficLanesPresenter.cpp:67
TrafficLanesPresenter::RightmostLaneAgent_removed
void RightmostLaneAgent_removed()
Signal, emitted when an agent profile has been removed from the rightmost lane in the model...
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...
TrafficLanesPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model edited by this presenter
Definition: TrafficLanesPresenter.h:192
TrafficLanesView::removeRightmostLaneAgentView
void removeRightmostLaneAgentView(unsigned int id)
Method which removes the editor view for a rightmost lane agent profile specified by the ID passed as...
Definition: TrafficLanesView.cpp:81
TrafficLanesPresenter::trafficLanesView
TrafficLanesView * trafficLanesView
a pointer to the editor view whose user events are managed by this presenter
Definition: TrafficLanesPresenter.h:193

◆ setRegularLaneAgentProbability

void TrafficLanesPresenter::setRegularLaneAgentProbability | ( | unsigned int | id,
 |  | double | value
 | ) |  |
privateslot

Slot which is triggered when the displayed probability value of a regular lane agent has been edited by the user. Adopts the transmitted value (second argument) for the model probability of the agent profile with the given ID (first argument).

Parameters
[in] | id | the ID of the agent profile
[in] | value | the probability to be adopted

Definition at line 77 of file TrafficLanesPresenter.cpp.

78 {
79 if(traffic->getAgentsRegularLane()->contains(id))
80 {
81 traffic->getAgentsRegularLane()->getItem(id)->setProbability(value);
82 Q_EMIT RegularLaneAgent_probabilityChanged();
83 }
84 }
TrafficItemMapInterface::contains
virtual bool contains(TrafficItemMapInterface::ID const &id) const =0
Method tests whether the map contains an entry under the given ID.
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficLanesPresenter::RegularLaneAgent_probabilityChanged
void RegularLaneAgent_probabilityChanged()
Signal, emitted when the probability of a regular lane agent&#39;s profile has been changed in the model...
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficLanesPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model edited by this presenter
Definition: TrafficLanesPresenter.h:192

◆ setRightmostLaneAgentProbability

void TrafficLanesPresenter::setRightmostLaneAgentProbability | ( | unsigned int | id,
 |  | double | value
 | ) |  |
privateslot

Slot which is triggered when the displayed probability value of a rightmost lane agent has been edited by the user. Adopts the transmitted value (second argument) for the model probability of the agent profile with the given ID (first argument).

Parameters
[in] | id | the ID of the agent profile
[in] | value | the probability to be adopted

Definition at line 86 of file TrafficLanesPresenter.cpp.

87 {
88 if(traffic->getAgentsRightMostLane()->contains(id))
89 {
90 traffic->getAgentsRightMostLane()->getItem(id)->setProbability(value);
91 Q_EMIT RightmostLaneAgent_probabilityChanged();
92 }
93 }
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
TrafficItemMapInterface::contains
virtual bool contains(TrafficItemMapInterface::ID const &id) const =0
Method tests whether the map contains an entry under the given ID.
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficLanesPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model edited by this presenter
Definition: TrafficLanesPresenter.h:192
TrafficLanesPresenter::RightmostLaneAgent_probabilityChanged
void RightmostLaneAgent_probabilityChanged()
Signal, emitted when the probability of a rightmost lane agent&#39;s profile has been changed in the mode...
The documentation for this class was generated from the following files:
  • TrafficLanesPresenter.h
  • TrafficLanesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficLanesPresenter Member List

This is the complete list of members for TrafficLanesPresenter, including all inherited members.

addRegularLaneAgent(QString const &name) | TrafficLanesPresenter | privateslot
addRightmostLaneAgent(QString const &name) | TrafficLanesPresenter | privateslot
clearAgentSelectionView() | TrafficLanesPresenter |
cleared() | TrafficLanesPresenter | signal
RegularLaneAgent_added() | TrafficLanesPresenter | signal
RegularLaneAgent_probabilityChanged() | TrafficLanesPresenter | signal
RegularLaneAgent_removed() | TrafficLanesPresenter | signal
removeRegularLaneAgent(unsigned int id) | TrafficLanesPresenter | privateslot
removeRegularLaneAgentByName(QString name) | TrafficLanesPresenter | privateslot
removeRightmostLaneAgent(unsigned int id) | TrafficLanesPresenter | privateslot
removeRightmostLaneAgentByName(QString name) | TrafficLanesPresenter | privateslot
RightmostLaneAgent_added() | TrafficLanesPresenter | signal
RightmostLaneAgent_probabilityChanged() | TrafficLanesPresenter | signal
RightmostLaneAgent_removed() | TrafficLanesPresenter | signal
setRegularLaneAgentProbability(unsigned int id, double value) | TrafficLanesPresenter | privateslot
setRightmostLaneAgentProbability(unsigned int id, double value) | TrafficLanesPresenter | privateslot
traffic | TrafficLanesPresenter | private
trafficLanesView | TrafficLanesPresenter | private
updateView() | TrafficLanesPresenter |
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficLanesView Class Reference

Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
TrafficLanesView Class Reference

This class defines the editor widget for assigning agent profiles to regular and rightmost lanes. More...

Inheritance diagram for TrafficLanesView:
WidgetView

Signals

void | addRegularLaneAgent (QString const &name)
Signal, emitted when the add button in the regula lane agents section is clicked. Transmits the name of the agent profile currently selected in the combobox.
void | addRightmostLaneAgent (QString const &name)
Signal, emitted when the add button in the rightmost lane agents section is clicked. Transmits the name of the agent profile currently selected in the combobox.
void | RegularLaneAgent_probabilityChanged (unsigned int id, double value)
Signal, emitted when the probability of a particular regular lane agent is modified by the user. Transmits the ID and the new probability displayed in the spinbox.
void | removeRegularLaneAgent (unsigned int id)
Signal, emitted when the remove button of a particular regular lane agent profile is clicked. Transmits the ID of the profile.
void | removeRightmostLaneAgent (unsigned int id)
Signal, emitted when the remove button of a particular rightmost lane agent profile is clicked. Transmits the ID of the profile.
void | resized ()
Signal, emitted when this view is resized.
void | RightmostLaneAgent_probabilityChanged (unsigned int id, double value)
Signal, emitted when the probability of a particular rightmost lane agent is modified by the user. Transmits the ID and the new probability displayed in the spinbox.

Public Member Functions

void | addRegularLaneAgentView (unsigned int id, QString name, double probability)
Method which creates an editor view for a regular lane agent profile and inserts it into the corresponding regular lane section using the ID passed as a first argument. The name and the probability value to be displayed are passed as second and third arguments, respectively. The entire view (this class) is resized accordingly. More...
void | addRightmostLaneAgentView (unsigned int id, QString name, double probability)
Method which creates an editor view for a rightmost lane agent profile and inserts it into the corresponding rightmost lane section using the ID passed as a first argument. The name and the probability value to be displayed are passed as second and third arguments, respectively. The entire view (this class) is resized accordingly. More...
void | clearTrafficLanesView ()
Method which deletes all existing editor views for both, regular and rightmost lanes. Resizes the entire view (this class) to its initial size.
void | removeRegularLaneAgentView (unsigned int id)
Method which removes the editor view for a regular lane agent profile specified by the ID passed as an argument. The entire view (this class) is resized accordingly and the enumeration of the remaining views is adjusted. More...
void | removeRightmostLaneAgentView (unsigned int id)
Method which removes the editor view for a rightmost lane agent profile specified by the ID passed as an argument. The entire view (this class) is resized accordingly and the enumeration of the remaining views is adjusted. More...
void | setAgentSelectionItems (const QStringList &items)
Method which fills the comboboxes for agent profile selections with the string list passed as an argument. More...
void | setRegularLaneAgentProbability (unsigned int id, double value)
Method which sets the display value of the probability for the regular lane agent profile specified by the ID passed as a first argument. The new value is passed as a second argument. More...
void | setRightmostLaneAgentProbability (unsigned int id, double value)
Method which sets the display value of the probability for the rightmost lane agent profile specified by the ID passed as a first argument. The new value is passed as a second argument. More...
- Public Member Functions inherited from WidgetView
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Private Slots

void | on_addRegularLaneAgent_clicked ()
Qt Desinger-created slot activated when the add-button in the regula lanes section is clicked. Emits the addRegularLaneAgent signal.
void | on_addRightmostLaneAgent_clicked ()
Qt Desinger-created slot activated when the add-button in the rightmost lane section is clicked. Emits the addRightmostLaneAgent signal.

Private Member Functions

void resizeEvent (QResizeEvent *event)
Reimplementation of the resize event. Emits the resized signal when this view is resized.

Private Attributes

int | initialHeight
The initial height (empty form) of this view.
Ui::TrafficLanesView * | ui
The ui object containing all visualization elements.

Additional Inherited Members

- Protected Member Functions inherited from WidgetView
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.

Detailed Description

This class defines the editor widget for assigning agent profiles to regular and rightmost lanes.

It consists of an ui element (TrafficLanesView.ui) with two sections, one for listing agent profiles assigned to regular lanes and one for the rightmost lane. In these sections, the editor views for the agent profiles and their probabilities of occurence can be inserted upon pressing the corresponding add-buttons.

Definition at line 33 of file TrafficLanesView.h.

Member Function Documentation

◆ addRegularLaneAgentView()

void TrafficLanesView::addRegularLaneAgentView | ( | unsigned int | id,
 |  | QString | name,
 |  | double | probability
 | ) |  |

Method which creates an editor view for a regular lane agent profile and inserts it into the corresponding regular lane section using the ID passed as a first argument. The name and the probability value to be displayed are passed as second and third arguments, respectively. The entire view (this class) is resized accordingly.

Parameters
[in] | id | the ID of the view
[in] | name | the displayed name of the profile
[in] | probability | the probability value to be displayed

Definition at line 48 of file TrafficLanesView.cpp.

49 {
50 int index = ui->RegularLaneLayout->count() +1 ;
51 TrafficItemView * agentView = new TrafficItemView(TrafficItemView::Type::Agent, id, index, this);
52 agentView->setValue(name);
53 agentView->setProbability(probability);
54
55 connect(agentView, &TrafficItemView::remove, this, &TrafficLanesView::removeRegularLaneAgent);
56 connect(agentView, &TrafficItemView::probabilityChanged, this, &TrafficLanesView::RegularLaneAgent_probabilityChanged);
57
58 ui->RegularLaneLayout->insertWidget(index-1, agentView);
59 resize(width(), height() + agentView->height());
60 }
TrafficItemView::setProbability
void setProbability(double value)
Method which sets the displayed probability of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:192
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficItemView::remove
void remove(unsigned int ID, Type type)
Signal, emitted when remove button has been clicked. Transmits the ID and type of the traffic item...
TrafficItemView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, Type type)
Signal, emitted when probability of the traffic item has been modified by the user. Transmits the ID, probability value and type of the item.
TrafficLanesView::removeRegularLaneAgent
void removeRegularLaneAgent(unsigned int id)
Signal, emitted when the remove button of a particular regular lane agent profile is clicked...
TrafficLanesView::RegularLaneAgent_probabilityChanged
void RegularLaneAgent_probabilityChanged(unsigned int id, double value)
Signal, emitted when the probability of a particular regular lane agent is modified by the user...
TrafficLanesView::ui
Ui::TrafficLanesView * ui
The ui object containing all visualization elements.
Definition: TrafficLanesView.h:191
TrafficItemView::setValue
void setValue(QString value)
Method which sets the displayed value of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:158

◆ addRightmostLaneAgentView()

void TrafficLanesView::addRightmostLaneAgentView | ( | unsigned int | id,
 |  | QString | name,
 |  | double | probability
 | ) |  |

Method which creates an editor view for a rightmost lane agent profile and inserts it into the corresponding rightmost lane section using the ID passed as a first argument. The name and the probability value to be displayed are passed as second and third arguments, respectively. The entire view (this class) is resized accordingly.

Parameters
[in] | id | the ID of the view
[in] | name | the displayed name of the profile
[in] | probability | the probability value to be displayed

Definition at line 32 of file TrafficLanesView.cpp.

33 {
34 int index = ui->RightmostLaneLayout->count() +1;
35
36 TrafficItemView * agentView = new TrafficItemView(TrafficItemView::Type::Agent, id, index, this);
37 agentView->setValue(name);
38 agentView->setProbability(probability);
39
40 connect(agentView, &TrafficItemView::remove, this, &TrafficLanesView::removeRightmostLaneAgent);
41 connect(agentView, &TrafficItemView::probabilityChanged, this, &TrafficLanesView::RightmostLaneAgent_probabilityChanged);
42
43
44 ui->RightmostLaneLayout->insertWidget(index-1, agentView);
45 resize(width(), height() + agentView->height());
46 }
TrafficItemView::setProbability
void setProbability(double value)
Method which sets the displayed probability of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:192
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficLanesView::RightmostLaneAgent_probabilityChanged
void RightmostLaneAgent_probabilityChanged(unsigned int id, double value)
Signal, emitted when the probability of a particular rightmost lane agent is modified by the user...
TrafficItemView::remove
void remove(unsigned int ID, Type type)
Signal, emitted when remove button has been clicked. Transmits the ID and type of the traffic item...
TrafficItemView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, Type type)
Signal, emitted when probability of the traffic item has been modified by the user. Transmits the ID, probability value and type of the item.
TrafficLanesView::ui
Ui::TrafficLanesView * ui
The ui object containing all visualization elements.
Definition: TrafficLanesView.h:191
TrafficItemView::setValue
void setValue(QString value)
Method which sets the displayed value of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:158
TrafficLanesView::removeRightmostLaneAgent
void removeRightmostLaneAgent(unsigned int id)
Signal, emitted when the remove button of a particular rightmost lane agent profile is clicked...

◆ removeRegularLaneAgentView()

void TrafficLanesView::removeRegularLaneAgentView ( unsigned int id )

Method which removes the editor view for a regular lane agent profile specified by the ID passed as an argument. The entire view (this class) is resized accordingly and the enumeration of the remaining views is adjusted.

Parameters
[in] id the ID of the view to be removed

Definition at line 62 of file TrafficLanesView.cpp.

63 {
64 bool shift = false;
65
66 for(auto agentView : ui->RegularLaneWidget->findChildren<TrafficItemView*>())
67 {
68 if(shift)
69 agentView->setIndex(agentView->getIndex()-1);
70
71 if(agentView->getID() == id)
72 {
73 ui->RegularLaneLayout->removeWidget(agentView);
74 resize(width(), height() - agentView->height());
75 delete agentView;
76 shift = true;
77 }
78 }
79 }
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficLanesView::ui
Ui::TrafficLanesView * ui
The ui object containing all visualization elements.
Definition: TrafficLanesView.h:191

◆ removeRightmostLaneAgentView()

void TrafficLanesView::removeRightmostLaneAgentView ( unsigned int id )

Method which removes the editor view for a rightmost lane agent profile specified by the ID passed as an argument. The entire view (this class) is resized accordingly and the enumeration of the remaining views is adjusted.

Parameters
[in] id the ID of the view to be removed

Definition at line 81 of file TrafficLanesView.cpp.

82 {
83 bool shift = false;
84
85 for(auto agentView : ui->RightmostLaneWidget->findChildren<TrafficItemView*>())
86 {
87 if(shift)
88 agentView->setIndex(agentView->getIndex()-1);
89
90 if(agentView->getID() == id)
91 {
92 ui->RightmostLaneLayout->removeWidget(agentView);
93 resize(width(), height() - agentView->height());
94 delete agentView;
95 shift = true;
96 }
97 }
98 }
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficLanesView::ui
Ui::TrafficLanesView * ui
The ui object containing all visualization elements.
Definition: TrafficLanesView.h:191

◆ setAgentSelectionItems()

void TrafficLanesView::setAgentSelectionItems ( const QStringList & items )

Method which fills the comboboxes for agent profile selections with the string list passed as an argument.

Parameters
[in] items the string list of selectable items to be offered by the comboboxes

Definition at line 100 of file TrafficLanesView.cpp.

101 {
102 ui->RegularLaneAgent->clear();
103 ui->RegularLaneAgent->addItems(items);
104
105 ui->RightmostLaneAgent->clear();
106 ui->RightmostLaneAgent->addItems(items);
107 }
TrafficLanesView::ui
Ui::TrafficLanesView * ui
The ui object containing all visualization elements.
Definition: TrafficLanesView.h:191

◆ setRegularLaneAgentProbability()

void TrafficLanesView::setRegularLaneAgentProbability | ( | unsigned int | id,
 |  | double | value
 | ) |  |

Method which sets the display value of the probability for the regular lane agent profile specified by the ID passed as a first argument. The new value is passed as a second argument.

Parameters
[in] | id | the ID of the regular lane agent editor view
[in] | value | the probability value to be displayed

Definition at line 117 of file TrafficLanesView.cpp.

118 {
119 for(auto agentView: ui->RegularLaneWidget->findChildren<TrafficItemView*>())
120 {
121 if(agentView->getID() == id)
122 agentView->setProbability(value);
123 }
124 }
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficLanesView::ui
Ui::TrafficLanesView * ui
The ui object containing all visualization elements.
Definition: TrafficLanesView.h:191

◆ setRightmostLaneAgentProbability()

void TrafficLanesView::setRightmostLaneAgentProbability | ( | unsigned int | id,
 |  | double | value
 | ) |  |

Method which sets the display value of the probability for the rightmost lane agent profile specified by the ID passed as a first argument. The new value is passed as a second argument.

Parameters
[in] | id | the ID of the rightmost lane agent editor view
[in] | value | the probability value to be displayed

Definition at line 126 of file TrafficLanesView.cpp.

127 {
128 for(auto agentView: ui->RightmostLaneWidget->findChildren<TrafficItemView*>())
129 {
130 if(agentView->getID() == id)
131 agentView->setProbability(value);
132 }
133 }
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficLanesView::ui
Ui::TrafficLanesView * ui
The ui object containing all visualization elements.
Definition: TrafficLanesView.h:191
The documentation for this class was generated from the following files:
  • TrafficLanesView.h
  • TrafficLanesView.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficLanesView Member List

This is the complete list of members for TrafficLanesView, including all inherited members.

addRegularLaneAgent(QString const &name) | TrafficLanesView | signal
addRegularLaneAgentView(unsigned int id, QString name, double probability) | TrafficLanesView |
addRightmostLaneAgent(QString const &name) | TrafficLanesView | signal
addRightmostLaneAgentView(unsigned int id, QString name, double probability) | TrafficLanesView |
clearTrafficLanesView() | TrafficLanesView |
initialHeight | TrafficLanesView | private
on_addRegularLaneAgent_clicked() | TrafficLanesView | privateslot
on_addRightmostLaneAgent_clicked() | TrafficLanesView | privateslot
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
RegularLaneAgent_probabilityChanged(unsigned int id, double value) | TrafficLanesView | signal
removeRegularLaneAgent(unsigned int id) | TrafficLanesView | signal
removeRegularLaneAgentView(unsigned int id) | TrafficLanesView |
removeRightmostLaneAgent(unsigned int id) | TrafficLanesView | signal
removeRightmostLaneAgentView(unsigned int id) | TrafficLanesView |
resized() | TrafficLanesView | signal
resizeEvent(QResizeEvent *event) | TrafficLanesView | private
RightmostLaneAgent_probabilityChanged(unsigned int id, double value) | TrafficLanesView | signal
setAgentSelectionItems(const QStringList &items) | TrafficLanesView |
setRegularLaneAgentProbability(unsigned int id, double value) | TrafficLanesView |
setRightmostLaneAgentProbability(unsigned int id, double value) | TrafficLanesView |
ui | TrafficLanesView | private
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficModel Class Reference

Public Member Functions | Public Attributes | List of all members
TrafficModel Class Reference

The TrafficModel class implements the functionality of the TrafficInterface class. More...

Inheritance diagram for TrafficModel:
TrafficInterface

Public Member Functions

virtual TrafficAgents * | getAgentsRegularLane () const override
Returns the map for registering agent profiles for regular lanes. More...
virtual TrafficAgents * | getAgentsRightMostLane () const override
Returns the map for registering agent profiles for the rightmost lane. More...
virtual Homogeneities * | getHomogeneities () const override
Returns the map for registering homogeneities. More...
virtual Name | getName () const override
Returns the current name of the traffic setup. More...
virtual PlatoonRates * | getPlatoonRates () const override
Returns the map for registering platoon rates. More...
virtual Status | getStatus () const override
Method which returns the current status of the traffic settings. More...
virtual Velocities * | getVelocities () const override
Returns the map for registering velocities. More...
virtual Volumes * | getVolumes () const override
Returns the map for registering traffic volumes. More...
virtual void | setName (Name const &_name) override
Sets the name of the traffic setup to the one passed as an argument. More...
virtual void | setStatus (Status const &_status) override
Method for setting the status of the traffic configuration to the value passed as an argument. More...

Public Attributes

TrafficAgents *const | agentsRegularLane
the map of traffic agents driving on regular lanes
TrafficAgents *const | agentsRightMostLane
the map of traffic agents driving on the rightmost lane
Homogeneities *const | homogeneities
the map of homogeneities
Name name
the name of the traffic configuration
PlatoonRates *const | platoonRates
the map of platoon rates
Status status
the current status of the settings. "true" means that the configuration is principally ready for simulation
Velocities *const | velocities
the map of velocities
Volumes *const | volumes
the map of traffic volumes

Additional Inherited Members

- Public Types inherited from TrafficInterface
using | Homogeneities = TrafficItemMapInterface
The map for registering homogeneities.
using | Name = QString
The name of the traffic configuration.
using | PlatoonRates = TrafficItemMapInterface
The map for registering platoon rates.
using | Status = bool
Type characterizing the status of the environment settings.
using | TrafficAgents = TrafficItemMapInterface
The map for registering agent profiles.
using | Velocities = TrafficItemMapInterface
The map for registering velocities.
using | Volumes = TrafficItemMapInterface
The map for registering traffic volumes.
- Signals inherited from TrafficInterface
void | edited ()
Signal, emitted when the traffic configuration has been edited.
void | modifiedName ()
Signal, emitted when the name of the traffic setup has been modified.
void | modifiedStatus ()
Signal, emitted when the traffic's status has changed.

Detailed Description

The TrafficModel class implements the functionality of the TrafficInterface class.

Definition at line 27 of file TrafficModel.h.

Member Function Documentation

◆ getAgentsRegularLane()

TrafficInterface::TrafficAgents * TrafficModel::getAgentsRegularLane ( ) const
overridevirtual

Returns the map for registering agent profiles for regular lanes.

Returns
the map of agent profiles for regular lanes

Implements TrafficInterface.

Definition at line 81 of file TrafficModel.cpp.

82 {
83 return agentsRegularLane;
84 }
TrafficModel::agentsRegularLane
TrafficAgents *const agentsRegularLane
the map of traffic agents driving on regular lanes
Definition: TrafficModel.h:58

◆ getAgentsRightMostLane()

TrafficInterface::TrafficAgents * TrafficModel::getAgentsRightMostLane ( ) const
overridevirtual

Returns the map for registering agent profiles for the rightmost lane.

Returns
the map of agent profiles for the rightmost lane

Implements TrafficInterface.

Definition at line 76 of file TrafficModel.cpp.

77 {
78 return agentsRightMostLane;
79 }
TrafficModel::agentsRightMostLane
TrafficAgents *const agentsRightMostLane
the map of traffic agents driving on the rightmost lane
Definition: TrafficModel.h:59

◆ getHomogeneities()

TrafficInterface::Homogeneities * TrafficModel::getHomogeneities ( ) const
overridevirtual

Returns the map for registering homogeneities.

Returns
the map of homogeneities

Implements TrafficInterface.

Definition at line 71 of file TrafficModel.cpp.

72 {
73 return homogeneities;
74 }
TrafficModel::homogeneities
Homogeneities *const homogeneities
the map of homogeneities
Definition: TrafficModel.h:57

◆ getName()

TrafficInterface::Name TrafficModel::getName ( ) const
overridevirtual

Returns the current name of the traffic setup.

Returns
the current name of the traffic setup

Implements TrafficInterface.

Definition at line 45 of file TrafficModel.cpp.

46 {
47 return name;
48 }
TrafficModel::name
Name name
the name of the traffic configuration
Definition: TrafficModel.h:53

◆ getPlatoonRates()

TrafficInterface::PlatoonRates * TrafficModel::getPlatoonRates ( ) const
overridevirtual

Returns the map for registering platoon rates.

Returns
the map of platoon rates

Implements TrafficInterface.

Definition at line 61 of file TrafficModel.cpp.

62 {
63 return platoonRates;
64 }
TrafficModel::platoonRates
PlatoonRates *const platoonRates
the map of platoon rates
Definition: TrafficModel.h:55

◆ getStatus()

TrafficInterface::Status TrafficModel::getStatus ( ) const
overridevirtual

Method which returns the current status of the traffic settings.

Returns
the current status of the traffic configuration

Implements TrafficInterface.

Definition at line 92 of file TrafficModel.cpp.

93 {
94 return status;
95 }
TrafficModel::status
Status status
the current status of the settings. "true" means that the configuration is principally ready for simu...
Definition: TrafficModel.h:60

◆ getVelocities()

TrafficInterface::Velocities * TrafficModel::getVelocities ( ) const
overridevirtual

Returns the map for registering velocities.

Returns
the map of velocities

Implements TrafficInterface.

Definition at line 66 of file TrafficModel.cpp.

67 {
68 return velocities;
69 }
TrafficModel::velocities
Velocities *const velocities
the map of velocities
Definition: TrafficModel.h:56

◆ getVolumes()

TrafficInterface::Volumes * TrafficModel::getVolumes ( ) const
overridevirtual

Returns the map for registering traffic volumes.

Returns
the map of traffic volumes

Implements TrafficInterface.

Definition at line 56 of file TrafficModel.cpp.

57 {
58 return volumes;
59 }
TrafficModel::volumes
Volumes *const volumes
the map of traffic volumes
Definition: TrafficModel.h:54

◆ setName()

void TrafficModel::setName ( Name const & _name )
overridevirtual

Sets the name of the traffic setup to the one passed as an argument.

Parameters
[in] _name the new name for the traffic setup

Implements TrafficInterface.

Definition at line 50 of file TrafficModel.cpp.

51 {
52 name = _name;
53 Q_EMIT modifiedName();
54 }
TrafficModel::name
Name name
the name of the traffic configuration
Definition: TrafficModel.h:53
TrafficInterface::modifiedName
void modifiedName()
Signal, emitted when the name of the traffic setup has been modified.

◆ setStatus()

void TrafficModel::setStatus ( Status const & _status )
overridevirtual

Method for setting the status of the traffic configuration to the value passed as an argument.

Parameters
[in] _status the status

Implements TrafficInterface.

Definition at line 86 of file TrafficModel.cpp.

87 {
88 status = _status;
89 Q_EMIT modifiedStatus();
90 }
TrafficModel::status
Status status
the current status of the settings. "true" means that the configuration is principally ready for simu...
Definition: TrafficModel.h:60
TrafficInterface::modifiedStatus
void modifiedStatus()
Signal, emitted when the traffic&#39;s status has changed.
The documentation for this class was generated from the following files:
  • TrafficModel.h
  • TrafficModel.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficModel Member List

This is the complete list of members for TrafficModel, including all inherited members.

agentsRegularLane | TrafficModel |
agentsRightMostLane | TrafficModel |
edited() | TrafficInterface | signal
getAgentsRegularLane() const override | TrafficModel | virtual
getAgentsRightMostLane() const override | TrafficModel | virtual
getHomogeneities() const override | TrafficModel | virtual
getName() const override | TrafficModel | virtual
getPlatoonRates() const override | TrafficModel | virtual
getStatus() const override | TrafficModel | virtual
getVelocities() const override | TrafficModel | virtual
getVolumes() const override | TrafficModel | virtual
Homogeneities typedef | TrafficInterface |
homogeneities | TrafficModel |
modifiedName() | TrafficInterface | signal
modifiedStatus() | TrafficInterface | signal
name | TrafficModel |
Name typedef | TrafficInterface |
platoonRates | TrafficModel |
PlatoonRates typedef | TrafficInterface |
setName(Name const &_name) override | TrafficModel | virtual
setStatus(Status const &_status) override | TrafficModel | virtual
status | TrafficModel |
Status typedef | TrafficInterface |
TrafficAgents typedef | TrafficInterface |
velocities | TrafficModel |
Velocities typedef | TrafficInterface |
Volumes typedef | TrafficInterface |
volumes | TrafficModel |
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficParametersPresenter Class Reference

Signals | Public Member Functions | Private Slots | Private Attributes | List of all members
TrafficParametersPresenter Class Reference

This class defines the presenter object which handles events coming from the view (TrafficParametersView) and edits the model accordingly (TrafficInterface), i.e. more specifically the parameters therein. More...

Inherits QObject.

Signals

void | cleared ()
Signal, emitted when a the entire configuration has been cleared in the model.
void | homogeneity_added ()
Signal, emitted when a homogeneity has been added to the model.
void | homogeneity_probabilityChanged ()
Signal, emitted when the probability of a homogeneity item has been changed.
void | homogeneity_removed ()
Signal, emitted when a homogeneity has been removed from the model.
void | platoonRate_added ()
Signal, emitted when a platoon rate has been added to the model.
void | platoonRate_probabilityChanged ()
Signal, emitted when the probability of a platoon rate has been changed.
void | platoonRate_removed ()
Signal, emitted when a platoon rate has been removed from the model.
void | velocity_added ()
Signal, emitted when a velocity has been added to the model.
void | velocity_probabilityChanged ()
Signal, emitted when the probability of a velocity item has been changed.
void | velocity_removed ()
Signal, emitted when a velocity has been removed from the model.
void | volume_added ()
Signal, emitted when a traffic volume has been added to the model.
void | volume_probabilityChanged ()
Signal, emitted when the probability of a traffic volume has been changed.
void | volume_removed ()
Signal, emitted when a traffic volume has been removed from the model.

Public Member Functions

void updateView ()
Method which updates the whole TrafficParametersView widget to display the entire model configuration. Will be called after loading a combination xml file.

Private Slots

void | addHomogeneity ()
Slot which is triggered when the add-button has been clicked in the homogeneities section of TrafficParametersView. Adds a homogeneity with default value 0.5 and probability 0.5 to the model, creates the corresponding view and inserts it into the homogeneities section of TrafficParametersView.
void | addPlatoonRate ()
Slot which is triggered when the add-button has been clicked in the platoon rates section of TrafficParametersView. Adds a platoon rate with default value 0.5 and probability 0.5 to the model, creates the corresponding view and inserts it into the platoon rates section of TrafficParametersView.
void | addVelocity ()
Slot which is triggered when the add-button has been clicked in the velocities section of TrafficParametersView. Adds a velocity with default value 50.0 and probability 0.5 to the model, creates the corresponding view and inserts it into the velocities section of TrafficParametersView.
void | addVolume ()
Slot which is triggered when the add-button has been clicked in the volumes section of TrafficParametersView. Adds a traffic volume with default value 500 and probability 0.5 to the model, creates the corresponding view and inserts it into the volumes section of TrafficParametersView.
void | clearTrafficParameters ()
Slot which deletes all traffic item views.
void | removeTrafficItem (unsigned int id, TrafficItemView::Type type)
Slot which is triggered when the remove-button of some traffic item has been clicked. Removes the traffic item of the transmitted ID and type from the model and destroys the corresponding view. More...
void | setProbability (unsigned int id, double value, TrafficItemView::Type type)
Slot which is triggered when the displayed probability value of a traffic item has been modified by the user. Will adopt the transmitted probability for the model item's probability specified by the transmitted ID and type. More...
void | setValue (unsigned int id, QString value, TrafficItemView::Type type)
Slot which is triggered when the displayed value of a traffic item has been modified by the user. Will adopt the transmitted value for the model item's value specified by the transmitted ID and type. More...

Private Attributes

TrafficInterface * traffic
a pointer to the traffic model to be edited by this presenter
TrafficParametersView * trafficParametersView
a pointer to the editor widget whose user events are managed by this presenter

Detailed Description

This class defines the presenter object which handles events coming from the view (TrafficParametersView) and edits the model accordingly (TrafficInterface), i.e. more specifically the parameters therein.

Note
This presenter class emits signals after editing the model which are noticed by the TrafficDisplayPresenter class. Normally, these signals should be emitted by the model itself but since it invokes template class instances, for which Qt does not support the signal-slot mechanism, signals are exceptionally handled by this presenter class.

Definition at line 32 of file TrafficParametersPresenter.h.

Member Function Documentation

◆ removeTrafficItem

void TrafficParametersPresenter::removeTrafficItem | ( | unsigned int | id,
 |  | TrafficItemView::Type | type
 | ) |  |
privateslot

Slot which is triggered when the remove-button of some traffic item has been clicked. Removes the traffic item of the transmitted ID and type from the model and destroys the corresponding view.

Parameters
[in] | id | the ID of the traffic item to be removed
[in] | type | the type of the traffic item to be removed

Definition at line 61 of file TrafficParametersPresenter.cpp.

62 {
63 switch(type)
64 {
65 case TrafficItemView::Type::Volume:
66 {
67 if(traffic->getVolumes()->remove(id))
68 {
69 trafficParametersView->removeTrafficItemView(id, type);
70 Q_EMIT volume_removed();
71 }
72
73 break;
74 }
75 case TrafficItemView::Type::PlatoonRate:
76 {
77 if(traffic->getPlatoonRates()->remove(id))
78 {
79 trafficParametersView->removeTrafficItemView(id, type);
80 Q_EMIT platoonRate_removed();
81 }
82
83 break;
84 }
85 case TrafficItemView::Type::Velocity:
86 {
87 if(traffic->getVelocities()->remove(id))
88 {
89 trafficParametersView->removeTrafficItemView(id, type);
90 Q_EMIT velocity_removed();
91 }
92
93 break;
94 }
95 case TrafficItemView::Type::Homogeneity:
96 {
97 if(traffic->getHomogeneities()->remove(id))
98 {
99 trafficParametersView->removeTrafficItemView(id, type);
100 Q_EMIT homogeneity_removed();
101 }
102
103 break;
104 }
105 default:
106 break;
107 }
108 }
TrafficParametersPresenter::volume_removed
void volume_removed()
Signal, emitted when a traffic volume has been removed from the model.
TrafficParametersPresenter::trafficParametersView
TrafficParametersView * trafficParametersView
a pointer to the editor widget whose user events are managed by this presenter
Definition: TrafficParametersPresenter.h:175
TrafficParametersPresenter::platoonRate_removed
void platoonRate_removed()
Signal, emitted when a platoon rate has been removed from the model.
TrafficInterface::getVelocities
virtual Velocities * getVelocities() const =0
Returns the map for registering velocities.
TrafficParametersPresenter::homogeneity_removed
void homogeneity_removed()
Signal, emitted when a homogeneity has been removed from the model.
TrafficInterface::getVolumes
virtual Volumes * getVolumes() const =0
Returns the map for registering traffic volumes.
TrafficInterface::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const =0
Returns the map for registering platoon rates.
TrafficInterface::getHomogeneities
virtual Homogeneities * getHomogeneities() const =0
Returns the map for registering homogeneities.
TrafficParametersPresenter::velocity_removed
void velocity_removed()
Signal, emitted when a velocity has been removed from the model.
TrafficItemView::Type::Volume
An enum class defining the type of the traffic item.
TrafficItemMapInterface::remove
virtual bool remove(TrafficItemMapInterface::ID const &id)=0
Method which removes the traffic item registered under the given ID from the map. Afterwards...
TrafficParametersView::removeTrafficItemView
void removeTrafficItemView(unsigned int id, TrafficItemView::Type type)
Method which removes the view of a traffic item with the given ID and type. All item views lying belo...
Definition: TrafficParametersView.cpp:105
TrafficParametersPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model to be edited by this presenter
Definition: TrafficParametersPresenter.h:174

◆ setProbability

void TrafficParametersPresenter::setProbability | ( | unsigned int | id,
 |  | double | value,
 |  | TrafficItemView::Type | type
 | ) |  |
privateslot

Slot which is triggered when the displayed probability value of a traffic item has been modified by the user. Will adopt the transmitted probability for the model item's probability specified by the transmitted ID and type.

Parameters
[in] | id | the ID of the traffic item
[in] | value | the probability value to be adopted
[in] | type | the type of the traffic item

Definition at line 111 of file TrafficParametersPresenter.cpp.

112 {
113 switch(type)
114 {
115 case TrafficItemView::Type::Volume:
116 {
117 traffic->getVolumes()->getItem(id)->setProbability(value);
118 Q_EMIT volume_probabilityChanged();
119 break;
120 }
121 case TrafficItemView::Type::PlatoonRate:
122 {
123 traffic->getPlatoonRates()->getItem(id)->setProbability(value);
124 Q_EMIT platoonRate_probabilityChanged();
125 break;
126 }
127 case TrafficItemView::Type::Velocity:
128 {
129 traffic->getVelocities()->getItem(id)->setProbability(value);
130 Q_EMIT velocity_probabilityChanged();
131 break;
132 }
133 case TrafficItemView::Type::Homogeneity:
134 {
135 traffic->getHomogeneities()->getItem(id)->setProbability(value);
136 Q_EMIT homogeneity_probabilityChanged();
137 break;
138 }
139 default:
140 break;
141 }
142 }
TrafficInterface::getVelocities
virtual Velocities * getVelocities() const =0
Returns the map for registering velocities.
TrafficParametersPresenter::platoonRate_probabilityChanged
void platoonRate_probabilityChanged()
Signal, emitted when the probability of a platoon rate has been changed.
TrafficInterface::getVolumes
virtual Volumes * getVolumes() const =0
Returns the map for registering traffic volumes.
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficInterface::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const =0
Returns the map for registering platoon rates.
TrafficInterface::getHomogeneities
virtual Homogeneities * getHomogeneities() const =0
Returns the map for registering homogeneities.
TrafficParametersPresenter::homogeneity_probabilityChanged
void homogeneity_probabilityChanged()
Signal, emitted when the probability of a homogeneity item has been changed.
TrafficParametersPresenter::velocity_probabilityChanged
void velocity_probabilityChanged()
Signal, emitted when the probability of a velocity item has been changed.
TrafficItemView::Type::Volume
An enum class defining the type of the traffic item.
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficParametersPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model to be edited by this presenter
Definition: TrafficParametersPresenter.h:174
TrafficParametersPresenter::volume_probabilityChanged
void volume_probabilityChanged()
Signal, emitted when the probability of a traffic volume has been changed.

◆ setValue

void TrafficParametersPresenter::setValue | ( | unsigned int | id,
 |  | QString | value,
 |  | TrafficItemView::Type | type
 | ) |  |
privateslot

Slot which is triggered when the displayed value of a traffic item has been modified by the user. Will adopt the transmitted value for the model item's value specified by the transmitted ID and type.

Parameters
[in] | id | the ID of the traffic item
[in] | value | the value to be adopted for the model item
[in] | type | the type of the traffic item

Definition at line 144 of file TrafficParametersPresenter.cpp.

145 {
146 switch(type)
147 {
148 case TrafficItemView::Type::Volume:
149 {
150 traffic->getVolumes()->getItem(id)->setValue(value.toInt());
151 break;
152 }
153 case TrafficItemView::Type::PlatoonRate:
154 {
155 traffic->getPlatoonRates()->getItem(id)->setValue(value.toDouble());
156 break;
157 }
158 case TrafficItemView::Type::Velocity:
159 {
160 traffic->getVelocities()->getItem(id)->setValue(value.toDouble());
161 break;
162 }
163 case TrafficItemView::Type::Homogeneity:
164 {
165 traffic->getHomogeneities()->getItem(id)->setValue(value.toDouble());
166 break;
167 }
168 default:
169 break;
170 }
171 }
TrafficInterface::getVelocities
virtual Velocities * getVelocities() const =0
Returns the map for registering velocities.
TrafficInterface::getVolumes
virtual Volumes * getVolumes() const =0
Returns the map for registering traffic volumes.
TrafficInterface::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const =0
Returns the map for registering platoon rates.
TrafficInterface::getHomogeneities
virtual Homogeneities * getHomogeneities() const =0
Returns the map for registering homogeneities.
TrafficItemView::Type::Volume
An enum class defining the type of the traffic item.
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficItemInterface::setValue
virtual void setValue(Value const &_value)=0
Sets the traffic item&#39;s value to the value passed as an argument.
TrafficParametersPresenter::traffic
TrafficInterface * traffic
a pointer to the traffic model to be edited by this presenter
Definition: TrafficParametersPresenter.h:174
The documentation for this class was generated from the following files:
  • TrafficParametersPresenter.h
  • TrafficParametersPresenter.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficParametersPresenter Member List

This is the complete list of members for TrafficParametersPresenter, including all inherited members.

addHomogeneity() | TrafficParametersPresenter | privateslot
addPlatoonRate() | TrafficParametersPresenter | privateslot
addVelocity() | TrafficParametersPresenter | privateslot
addVolume() | TrafficParametersPresenter | privateslot
cleared() | TrafficParametersPresenter | signal
clearTrafficParameters() | TrafficParametersPresenter | privateslot
homogeneity_added() | TrafficParametersPresenter | signal
homogeneity_probabilityChanged() | TrafficParametersPresenter | signal
homogeneity_removed() | TrafficParametersPresenter | signal
platoonRate_added() | TrafficParametersPresenter | signal
platoonRate_probabilityChanged() | TrafficParametersPresenter | signal
platoonRate_removed() | TrafficParametersPresenter | signal
removeTrafficItem(unsigned int id, TrafficItemView::Type type) | TrafficParametersPresenter | privateslot
setProbability(unsigned int id, double value, TrafficItemView::Type type) | TrafficParametersPresenter | privateslot
setValue(unsigned int id, QString value, TrafficItemView::Type type) | TrafficParametersPresenter | privateslot
traffic | TrafficParametersPresenter | private
trafficParametersView | TrafficParametersPresenter | private
updateView() | TrafficParametersPresenter |
velocity_added() | TrafficParametersPresenter | signal
velocity_probabilityChanged() | TrafficParametersPresenter | signal
velocity_removed() | TrafficParametersPresenter | signal
volume_added() | TrafficParametersPresenter | signal
volume_probabilityChanged() | TrafficParametersPresenter | signal
volume_removed() | TrafficParametersPresenter | signal
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficParametersView Class Reference

Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
TrafficParametersView Class Reference

This class defines the editor widget for traffic parameters and their probabilities. More...

Inheritance diagram for TrafficParametersView:
WidgetView

Signals

void | addHomogeneity ()
Signal, emitted when the add-button in the homogeneities section has been pressed.
void | addPlatoonRate ()
Signal, emitted when the add-button in the platoon rates section has been pressed.
void | addVelocity ()
Signal, emitted when the add-button in the velocities section has been pressed.
void | addVolume ()
Signal, emitted when the add-button in the traffic volumes section has been pressed.
void | probabilityChanged (unsigned int ID, double value, TrafficItemView::Type type)
Signal, emitted when the probability of a traffic item has been modified. Transmits the ID, the new probability value and the type of the traffic item.
void | remove (unsigned int ID, TrafficItemView::Type type)
Signal, emitted when the remove button of a traffic parameter has been clicked. Transmits the ID and the type of the traffic item.
void | resized ()
Signal, emitted when this view has been resized.
void | valueChanged (unsigned int ID, QString value, TrafficItemView::Type type)
Signal, emitted when the value of a traffic item has been modified. Transmits the ID, the new value and the type of the traffic item.

Public Member Functions

void | addHomogeneityView (unsigned int id, QString value, double probability)
Method which creates a view of a homogeneity using the given ID and inserts the view into the Homogeneities section. Sets the display values of value and probability to the second and third arguments, respectively. Also connects the remove, valueChanged and probabilityChanged signals of TrafficItemView to the signals within this class such that they can be forwarded to the presenter. The whole editor widget is resized according to the required size of the item view. More...
void | addPlatoonRateView (unsigned int id, QString value, double probability)
Method which creates a view of a platoon rate using the given ID and inserts the view into the Platoon Rates section. Sets the display values of value and probability to the second and third arguments, respectively. Also connects the remove, valueChanged and probabilityChanged signals of TrafficItemView to the signals within this class such that they can be forwarded to the presenter. The whole editor widget is resized according to the required size of the item view. More...
void | addVelocityView (unsigned int id, QString value, double probability)
Method which creates a view of a velocity using the given ID and inserts the view into the Velocities section. Sets the display values of value and probability to the second and third arguments, respectively. Also connects the remove, valueChanged and probabilityChanged signals of TrafficItemView to the signals within this class such that they can be forwarded to the presenter. The whole editor widget is resized according to the required size of the item view. More...
void | addVolumeView (unsigned int id, QString value, double probability)
Method which creates a view of a traffic volume using the given ID and inserts the view into the Volumes section. Sets the display values of value and probability to the second and third arguments, respectively. Also connects the remove, valueChanged and probabilityChanged signals of TrafficItemView to the signals within this class such that they can be forwarded to the presenter. The whole editor widget is resized according to the required size of the item view. More...
void | clearTrafficParametersView ()
Method which deletes all registered traffic parameter views and resizes the this editor widget to its initial size.
void | removeTrafficItemView (unsigned int id, TrafficItemView::Type type)
Method which removes the view of a traffic item with the given ID and type. All item views lying below the removed one will be moved on place up in order to fill the gap. Afterwards, the whole editor widget is resized. More...
void | setProbability (unsigned int id, TrafficItemView::Type type, double value)
Method which sets the displayed probability value of the traffic parameter with the given id and type to the value passed as a third argument. More...
void | setValue (unsigned int id, TrafficItemView::Type type, QString value)
Method which sets the displayed value of the traffic parameter with the given id and type to the value passed as a third argument. More...
- Public Member Functions inherited from WidgetView
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Private Slots

void | on_addHomogeneity_clicked ()
Qt Desinger-created slot activated when the add-button in the homogeneities section has been clicked. Will emit the addHomogeneity signal.
void | on_addPlatoonRate_clicked ()
Qt Desinger-created slot activated when the add-button in the platoon rates section has been clicked. Will emit the addPlatoonRate signal.
void | on_addVelocity_clicked ()
Qt Desinger-created slot activated when the add-button in the velocities section has been clicked. Will emit the addVelocity signal.
void | on_addVolume_clicked ()
Qt Desinger-created slot activated when the add-button in the traffic volumes section has been clicked. Will emit the addVolume signal.

Private Member Functions

void resizeEvent (QResizeEvent *event)
Reimplementation of the resize event. Emits the resized() signal. More...

Private Attributes

int | initialHeight
the initial height of this editor widget
Ui::TrafficParametersView * | ui
the ui object containing all visualization elements of this editor widget

Additional Inherited Members

- Protected Member Functions inherited from WidgetView
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.

Detailed Description

This class defines the editor widget for traffic parameters and their probabilities.

It constitutes an ui element (TrafficParametersView.ui) with four list sections for traffic volumes, platoon rates, velocities and homogeneities. In these list sections, the visualization of the particular traffic items (instances of TrafficItemView) can be inserted upon pressing the corresponding add buttons.

Definition at line 29 of file TrafficParametersView.h.

Member Function Documentation

◆ addHomogeneityView()

void TrafficParametersView::addHomogeneityView | ( | unsigned int | id,
 |  | QString | value,
 |  | double | probability
 | ) |  |

Method which creates a view of a homogeneity using the given ID and inserts the view into the Homogeneities section. Sets the display values of value and probability to the second and third arguments, respectively. Also connects the remove, valueChanged and probabilityChanged signals of TrafficItemView to the signals within this class such that they can be forwarded to the presenter. The whole editor widget is resized according to the required size of the item view.

Parameters
[in] | id | the ID of the view
[in] | value | the value to be displayed (as a string)
[in] | probability | the probability to be displayed

Definition at line 88 of file TrafficParametersView.cpp.

89 {
90
91 int index = ui->homogeneitiesLayout->count()+1;
92 TrafficItemView * homogeneityView = new TrafficItemView(TrafficItemView::Type::Homogeneity, id, index, this);
93 homogeneityView->setValue(value);
94 homogeneityView->setProbability(probability);
95
96 connect(homogeneityView, &TrafficItemView::remove, this, &TrafficParametersView::remove);
97 connect(homogeneityView, &TrafficItemView::valueChanged, this, &TrafficParametersView::valueChanged);
98 connect(homogeneityView, &TrafficItemView::probabilityChanged, this, &TrafficParametersView::probabilityChanged);
99
100 ui->homogeneitiesLayout->insertWidget(index, homogeneityView);
101 resize(width(), height() + homogeneityView->height());
102 }
TrafficItemView::setProbability
void setProbability(double value)
Method which sets the displayed probability of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:192
TrafficParametersView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, TrafficItemView::Type type)
Signal, emitted when the probability of a traffic item has been modified. Transmits the ID...
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficParametersView::ui
Ui::TrafficParametersView * ui
the ui object containing all visualization elements of this editor widget
Definition: TrafficParametersView.h:218
TrafficParametersView::valueChanged
void valueChanged(unsigned int ID, QString value, TrafficItemView::Type type)
Signal, emitted when the value of a traffic item has been modified. Transmits the ID...
TrafficItemView::remove
void remove(unsigned int ID, Type type)
Signal, emitted when remove button has been clicked. Transmits the ID and type of the traffic item...
TrafficItemView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, Type type)
Signal, emitted when probability of the traffic item has been modified by the user. Transmits the ID, probability value and type of the item.
TrafficItemView::setValue
void setValue(QString value)
Method which sets the displayed value of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:158
TrafficParametersView::remove
void remove(unsigned int ID, TrafficItemView::Type type)
Signal, emitted when the remove button of a traffic parameter has been clicked. Transmits the ID and ...
TrafficItemView::valueChanged
void valueChanged(unsigned int ID, QString value, Type type)
Signal, emitted when the value of the traffic item has been changed. Transmits the ID...

◆ addPlatoonRateView()

void TrafficParametersView::addPlatoonRateView | ( | unsigned int | id,
 |  | QString | value,
 |  | double | probability
 | ) |  |

Method which creates a view of a platoon rate using the given ID and inserts the view into the Platoon Rates section. Sets the display values of value and probability to the second and third arguments, respectively. Also connects the remove, valueChanged and probabilityChanged signals of TrafficItemView to the signals within this class such that they can be forwarded to the presenter. The whole editor widget is resized according to the required size of the item view.

Parameters
[in] | id | the ID of the view
[in] | value | the value to be displayed (as a string)
[in] | probability | the probability to be displayed

Definition at line 58 of file TrafficParametersView.cpp.

59 {
60 int index = ui->platoonRatesLayout->count()+1;
61 TrafficItemView * platoonRateView = new TrafficItemView(TrafficItemView::Type::PlatoonRate, id, index , this);
62 platoonRateView->setValue(value);
63 platoonRateView->setProbability(probability);
64
65 connect(platoonRateView, &TrafficItemView::remove, this, &TrafficParametersView::remove);
66 connect(platoonRateView, &TrafficItemView::valueChanged, this, &TrafficParametersView::valueChanged);
67 connect(platoonRateView, &TrafficItemView::probabilityChanged, this, &TrafficParametersView::probabilityChanged);
68
69 resize(width(), height() + platoonRateView->height());
70 ui->platoonRatesLayout->insertWidget(index, platoonRateView);
71 }
TrafficItemView::setProbability
void setProbability(double value)
Method which sets the displayed probability of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:192
TrafficParametersView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, TrafficItemView::Type type)
Signal, emitted when the probability of a traffic item has been modified. Transmits the ID...
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficParametersView::ui
Ui::TrafficParametersView * ui
the ui object containing all visualization elements of this editor widget
Definition: TrafficParametersView.h:218
TrafficParametersView::valueChanged
void valueChanged(unsigned int ID, QString value, TrafficItemView::Type type)
Signal, emitted when the value of a traffic item has been modified. Transmits the ID...
TrafficItemView::remove
void remove(unsigned int ID, Type type)
Signal, emitted when remove button has been clicked. Transmits the ID and type of the traffic item...
TrafficItemView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, Type type)
Signal, emitted when probability of the traffic item has been modified by the user. Transmits the ID, probability value and type of the item.
TrafficItemView::setValue
void setValue(QString value)
Method which sets the displayed value of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:158
TrafficParametersView::remove
void remove(unsigned int ID, TrafficItemView::Type type)
Signal, emitted when the remove button of a traffic parameter has been clicked. Transmits the ID and ...
TrafficItemView::valueChanged
void valueChanged(unsigned int ID, QString value, Type type)
Signal, emitted when the value of the traffic item has been changed. Transmits the ID...

◆ addVelocityView()

void TrafficParametersView::addVelocityView | ( | unsigned int | id,
 |  | QString | value,
 |  | double | probability
 | ) |  |

Method which creates a view of a velocity using the given ID and inserts the view into the Velocities section. Sets the display values of value and probability to the second and third arguments, respectively. Also connects the remove, valueChanged and probabilityChanged signals of TrafficItemView to the signals within this class such that they can be forwarded to the presenter. The whole editor widget is resized according to the required size of the item view.

Parameters
[in] | id | the ID of the view
[in] | value | the value to be displayed (as a string)
[in] | probability | the probability to be displayed

Definition at line 73 of file TrafficParametersView.cpp.

74 {
75 int index = ui->velocitiesLayout->count()+1;
76 TrafficItemView * velocityView = new TrafficItemView(TrafficItemView::Type::Velocity, id, index, this);
77 velocityView->setValue(value);
78 velocityView->setProbability(probability);
79
80 connect(velocityView, &TrafficItemView::remove, this, &TrafficParametersView::remove);
81 connect(velocityView, &TrafficItemView::valueChanged, this, &TrafficParametersView::valueChanged);
82 connect(velocityView, &TrafficItemView::probabilityChanged, this, &TrafficParametersView::probabilityChanged);
83
84 ui->velocitiesLayout->insertWidget(index, velocityView);
85 resize(width(), height() + velocityView->height());
86 }
TrafficItemView::setProbability
void setProbability(double value)
Method which sets the displayed probability of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:192
TrafficParametersView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, TrafficItemView::Type type)
Signal, emitted when the probability of a traffic item has been modified. Transmits the ID...
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficParametersView::ui
Ui::TrafficParametersView * ui
the ui object containing all visualization elements of this editor widget
Definition: TrafficParametersView.h:218
TrafficParametersView::valueChanged
void valueChanged(unsigned int ID, QString value, TrafficItemView::Type type)
Signal, emitted when the value of a traffic item has been modified. Transmits the ID...
TrafficItemView::remove
void remove(unsigned int ID, Type type)
Signal, emitted when remove button has been clicked. Transmits the ID and type of the traffic item...
TrafficItemView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, Type type)
Signal, emitted when probability of the traffic item has been modified by the user. Transmits the ID, probability value and type of the item.
TrafficItemView::setValue
void setValue(QString value)
Method which sets the displayed value of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:158
TrafficParametersView::remove
void remove(unsigned int ID, TrafficItemView::Type type)
Signal, emitted when the remove button of a traffic parameter has been clicked. Transmits the ID and ...
TrafficItemView::valueChanged
void valueChanged(unsigned int ID, QString value, Type type)
Signal, emitted when the value of the traffic item has been changed. Transmits the ID...

◆ addVolumeView()

void TrafficParametersView::addVolumeView | ( | unsigned int | id,
 |  | QString | value,
 |  | double | probability
 | ) |  |

Method which creates a view of a traffic volume using the given ID and inserts the view into the Volumes section. Sets the display values of value and probability to the second and third arguments, respectively. Also connects the remove, valueChanged and probabilityChanged signals of TrafficItemView to the signals within this class such that they can be forwarded to the presenter. The whole editor widget is resized according to the required size of the item view.

Parameters
[in] | id | the ID of the view
[in] | value | the value to be displayed (as a string)
[in] | probability | the probability to be displayed

Definition at line 43 of file TrafficParametersView.cpp.

44 {
45 int index = ui->volumesLayout->count()+1;
46 TrafficItemView * volumeView = new TrafficItemView(TrafficItemView::Type::Volume, id, index, this);
47 volumeView->setValue(value);
48 volumeView->setProbability(probability);
49
50 connect(volumeView, &TrafficItemView::remove, this, &TrafficParametersView::remove);
51 connect(volumeView, &TrafficItemView::valueChanged, this, &TrafficParametersView::valueChanged);
52 connect(volumeView, &TrafficItemView::probabilityChanged, this, &TrafficParametersView::probabilityChanged);
53
54 resize(width(), height() + volumeView->height());
55 ui->volumesLayout->insertWidget(index-1, volumeView);
56 }
TrafficItemView::setProbability
void setProbability(double value)
Method which sets the displayed probability of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:192
TrafficParametersView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, TrafficItemView::Type type)
Signal, emitted when the probability of a traffic item has been modified. Transmits the ID...
TrafficItemView
This class defines a general view for a traffic item, which can be a volume, platoon rate...
Definition: TrafficItemView.h:30
TrafficParametersView::ui
Ui::TrafficParametersView * ui
the ui object containing all visualization elements of this editor widget
Definition: TrafficParametersView.h:218
TrafficParametersView::valueChanged
void valueChanged(unsigned int ID, QString value, TrafficItemView::Type type)
Signal, emitted when the value of a traffic item has been modified. Transmits the ID...
TrafficItemView::remove
void remove(unsigned int ID, Type type)
Signal, emitted when remove button has been clicked. Transmits the ID and type of the traffic item...
TrafficItemView::probabilityChanged
void probabilityChanged(unsigned int ID, double value, Type type)
Signal, emitted when probability of the traffic item has been modified by the user. Transmits the ID, probability value and type of the item.
TrafficItemView::setValue
void setValue(QString value)
Method which sets the displayed value of the traffic item to the one passed as an argument...
Definition: TrafficItemView.cpp:158
TrafficItemView::Type::Volume
An enum class defining the type of the traffic item.
TrafficParametersView::remove
void remove(unsigned int ID, TrafficItemView::Type type)
Signal, emitted when the remove button of a traffic parameter has been clicked. Transmits the ID and ...
TrafficItemView::valueChanged
void valueChanged(unsigned int ID, QString value, Type type)
Signal, emitted when the value of the traffic item has been changed. Transmits the ID...

◆ removeTrafficItemView()

void TrafficParametersView::removeTrafficItemView | ( | unsigned int | id,
 |  | TrafficItemView::Type | type
 | ) |  |

Method which removes the view of a traffic item with the given ID and type. All item views lying below the removed one will be moved on place up in order to fill the gap. Afterwards, the whole editor widget is resized.

Parameters
[in] | id | the ID of the view
[in] | value | the value to be displayed (as a string)
[in] | probability | the probability to be displayed

Definition at line 105 of file TrafficParametersView.cpp.

106 {
107 bool shift = false;
108
109 for(auto trafficItemView : findChildren<TrafficItemView*>())
110 {
111 if(trafficItemView->getType() == type )
112 {
113 if(shift)
114 trafficItemView->setIndex(trafficItemView->getIndex()-1);
115
116 if(trafficItemView->getID() == id )
117 {
118 resize(width(), height() - trafficItemView->height());
119 delete trafficItemView;
120 shift = true;
121 }
122 }
123 }
124 }

◆ resizeEvent()

void TrafficParametersView::resizeEvent ( QResizeEvent * event )
private

Reimplementation of the resize event. Emits the resized() signal.

Parameters
[in] event the resize event (Qt's QResizeEvent class)

Definition at line 127 of file TrafficParametersView.cpp.

128 {
129 event->ignore();
130 Q_EMIT resized();
131 }
TrafficParametersView::resized
void resized()
Signal, emitted when this view has been resized.

◆ setProbability()

void TrafficParametersView::setProbability | ( | unsigned int | id,
 |  | TrafficItemView::Type | type,
 |  | double | value
 | ) |  |

Method which sets the displayed probability value of the traffic parameter with the given id and type to the value passed as a third argument.

Parameters
[in] | id | the ID of the traffic parameter
[in] | type | the type of the traffic parameter
[in] | value | the probability value to be displayed

Definition at line 133 of file TrafficParametersView.cpp.

134 {
135 for(auto trafficItemView : findChildren<TrafficItemView*>())
136 {
137 if( trafficItemView->getType() == type && trafficItemView->getID() == id )
138 trafficItemView->setProbability(value);
139 }
140 }

◆ setValue()

void TrafficParametersView::setValue | ( | unsigned int | id,
 |  | TrafficItemView::Type | type,
 |  | QString | value
 | ) |  |

Method which sets the displayed value of the traffic parameter with the given id and type to the value passed as a third argument.

Parameters
[in] | id | the ID of the traffic parameter
[in] | type | the type of the traffic parameter
[in] | value | the value to be displayed

Definition at line 142 of file TrafficParametersView.cpp.

143 {
144 for(auto trafficItemView : findChildren<TrafficItemView*>())
145 {
146 if( trafficItemView->getType() == type && trafficItemView->getID() == id )
147 trafficItemView->setValue(value);
148 }
149 }
The documentation for this class was generated from the following files:
  • TrafficParametersView.h
  • TrafficParametersView.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficParametersView Member List

This is the complete list of members for TrafficParametersView, including all inherited members.

addHomogeneity() | TrafficParametersView | signal
addHomogeneityView(unsigned int id, QString value, double probability) | TrafficParametersView |
addPlatoonRate() | TrafficParametersView | signal
addPlatoonRateView(unsigned int id, QString value, double probability) | TrafficParametersView |
addVelocity() | TrafficParametersView | signal
addVelocityView(unsigned int id, QString value, double probability) | TrafficParametersView |
addVolume() | TrafficParametersView | signal
addVolumeView(unsigned int id, QString value, double probability) | TrafficParametersView |
clearTrafficParametersView() | TrafficParametersView |
initialHeight | TrafficParametersView | private
on_addHomogeneity_clicked() | TrafficParametersView | privateslot
on_addPlatoonRate_clicked() | TrafficParametersView | privateslot
on_addVelocity_clicked() | TrafficParametersView | privateslot
on_addVolume_clicked() | TrafficParametersView | privateslot
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
probabilityChanged(unsigned int ID, double value, TrafficItemView::Type type) | TrafficParametersView | signal
remove(unsigned int ID, TrafficItemView::Type type) | TrafficParametersView | signal
removeTrafficItemView(unsigned int id, TrafficItemView::Type type) | TrafficParametersView |
resized() | TrafficParametersView | signal
resizeEvent(QResizeEvent *event) | TrafficParametersView | private
setProbability(unsigned int id, TrafficItemView::Type type, double value) | TrafficParametersView |
setValue(unsigned int id, TrafficItemView::Type type, QString value) | TrafficParametersView |
ui | TrafficParametersView | private
valueChanged(unsigned int ID, QString value, TrafficItemView::Type type) | TrafficParametersView | signal
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficPresenter Class Reference

Public Slots | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
TrafficPresenter Class Reference

This class defines the presenter object which handles user events coming from the view (TrafficView) and edits the model accordingly (TrafficInterface). More...

Inherits QObject.

Public Slots

void | checkAgents ()
Slot which is connected, with the TrafficInterface::edited signal in order to check whether all selected agents exist in the profiles catalogue.
void | checkProbabilities ()
Slot which is connected, with the TrafficInterface::edited signal in order to check the probability sum of all traffic items. Sets the error status of all the items to "true" if probabilities do not sum up to 1.

Public Member Functions

void updateView ()
Method which updates the view (TrafficView) to the current state of the model (TrafficModel / TrafficInterface).

Private Slots

void | addHomogeneity ()
Slot is connected to the TrafficView::addHomogeneity signal. Calls the TrafficItemMapPresenter::addRow method of the presenter of the homogeneities map. This will create a new homogeneity parameter with default value and probability.
void | addPlatoonRate ()
Slot is connected to the TrafficView::addPlatoonRate signal. Calls the TrafficItemMapPresenter::addRow method of the presenter of the platoon rates map. This will create a new platoon rate with default value and probability.
void | addRegularLaneAgent ()
Slot is connected to the TrafficView::addRegularLaneAgent signal. Calls the TrafficItemMapPresenter::addRow method of the corresponding presenter. If agentList is not empty, this will create a new regular lane agent with default probability.
void | addRightmostLaneAgent ()
Slot is connected to the TrafficView::addRightmostLaneAgent signal. Calls the TrafficItemMapPresenter::addRow method of the corresponding presenter. If agentList is not empty, this will create a new rightmost lane agent with default probability.
void | addVelocity ()
Slot is connected to the TrafficView::addVelocity signal. Calls the TrafficItemMapPresenter::addRow method of the presenter of the velocities map. This will create a new velocity parameter with default value and probability.
void | addVolume ()
Slot is connected to the TrafficView::addVolume signal. Calls the TrafficItemMapPresenter::addRow method of the presenter of the volume map. This will create a new traffic volume with default value and probability.
void | removeHomogeneity (const int &row)
Slot which is connected to the TrafficView::removeHomogeneity signal. Calls the EnvironmentMapPresenter::removeRow method of the corresponding presenter object. This will remove the homogeneity parameter associated with the transmitted row index. More...
void | removePlatoonRate (const int &row)
Slot which is connected to the TrafficView::removePlatoonRate signal. Calls the EnvironmentMapPresenter::removeRow method of the corresponding presenter object. This will remove the platoon rate associated with the transmitted row index. More...
void | removeRegularLaneAgent (const int &row)
Slot which is connected to the TrafficView::removeRegularLaneAgent signal. Calls the EnvironmentMapPresenter::removeRow method of the corresponding presenter object. This will remove the regular lane agent associated with the transmitted row index. More...
void | removeRightmostLaneAgent (const int &row)
Slot which is connected to the TrafficView::removeRightmostLaneAgent signal. Calls the EnvironmentMapPresenter::removeRow method of the corresponding presenter object. This will remove the rightmost lane agent associated with the transmitted row index. More...
void | removeVelocity (const int &row)
Slot which is connected to the TrafficView::removeVelocity signal. Calls the EnvironmentMapPresenter::removeRow method of the corresponding presenter object. This will remove the velocity parameter associated with the transmitted row index. More...
void | removeVolume (const int &row)
Slot which is connected to the TrafficView::removeVolume signal. Calls the EnvironmentMapPresenter::removeRow method of the presenter the volume map. This will remove the traffic volume associated with the transmitted row index. More...
void | setName (QString const &name)
Slot which is connected to the TrafficView::modifiedName signal. Sets the traffic configuration's name to the one transmitted by the view. More...

Private Member Functions

void | setupHomogeneities ()
An initializer method which configures the table view of the homogeneities map. Creates the table's presenter object (TrafficItemMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.
void | setupPlatoonRates ()
An initializer method which configures the table view of the platoon rates map. Creates the table's presenter object (TrafficItemMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.
void | setupRegularLaneAgents ()
An initializer method which configures the table view of the regular lane agents map. Creates the table's presenter object (TrafficItemMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.
void | setupRightmostLaneAgents ()
An initializer method which configures the table view of the rightmost lane agents map. Creates the table's presenter object (TrafficItemMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.
void | setupVelocities ()
An initializer method which configures the table view of the velocities map. Creates the table's presenter object (TrafficItemMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.
void | setupVolumes ()
An initializer method which configures the table view of the traffic volumes map. Creates the table's presenter object (TrafficItemMapPresenter), sets up the delegates for editing the table entries and establishes signal-slot connections for adding and removing table rows.

Private Attributes

QList< QString > *const | agentList
a pointer to the list of available agent profiles (defined in a ProfilesCatalog.xml)
TrafficItemMapPresenter *const | homogeneities
a pointer to the presenter object connecting the homogeneities map to its table view
TrafficItemMapPresenter *const | platoonRates
a pointer to the presenter object connecting the platoon rates map to its table view
TrafficItemMapPresenter *const | regularLaneAgents
a pointer to the presenter object connecting the regular lane agents map to its table view
TrafficItemMapPresenter *const | rightmostLaneAgents
a pointer to the presenter object connecting the rightmost lane agents map to its table view
TrafficInterface *const | traffic
a pointer to the model of the traffic configuration
TrafficView *const | trafficView
a pointer to the view of the traffic configuration
QUndoStack *const | undoStack
a pointer to the undo stack
TrafficItemMapPresenter *const | velocities
a pointer to the presenter object connecting the velocities map to its table view
TrafficItemMapPresenter *const | volumes
a pointer to the presenter object connecting the traffic volumes map to its table view

Static Private Attributes

static QString const | default_homogeneity = "0.80"
a default value for the homogeneity
static QString const | default_platoonRate = "0.50"
a default value for the platoon rate
static double const | default_probability = 0.5
a default value for a selection probability
static QString const | default_velocity = "90"
a default value for the velocity
static QString const | default_volume = "600"
a default value for the traffic volume

Detailed Description

This class defines the presenter object which handles user events coming from the view (TrafficView) and edits the model accordingly (TrafficInterface).

Definition at line 33 of file TrafficPresenter.h.

Member Function Documentation

◆ removeHomogeneity

void TrafficPresenter::removeHomogeneity ( const int & row )
privateslot

Slot which is connected to the TrafficView::removeHomogeneity signal. Calls the EnvironmentMapPresenter::removeRow method of the corresponding presenter object. This will remove the homogeneity parameter associated with the transmitted row index.

Parameters
[in] row the row of the table whose entry should be deleted

Definition at line 143 of file TrafficPresenter.cpp.

144 {
145 if(homogeneities->rowCount() != 0)
146 undoStack->push(new RemoveTrafficItem(homogeneities, row, "homogeneities table"));
147 }
TrafficPresenter::homogeneities
TrafficItemMapPresenter *const homogeneities
a pointer to the presenter object connecting the homogeneities map to its table view ...
Definition: TrafficPresenter.h:250
RemoveTrafficItem
Command class for removing rows from the table of traffic settings.
Definition: TrafficPresenter.h:296
TrafficPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficPresenter.h:265
TrafficItemMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: TrafficItemMapPresenter.cpp:32

◆ removePlatoonRate

void TrafficPresenter::removePlatoonRate ( const int & row )
privateslot

Slot which is connected to the TrafficView::removePlatoonRate signal. Calls the EnvironmentMapPresenter::removeRow method of the corresponding presenter object. This will remove the platoon rate associated with the transmitted row index.

Parameters
[in] row the row of the table whose entry should be deleted

Definition at line 121 of file TrafficPresenter.cpp.

122 {
123 if(platoonRates->rowCount() != 0)
124 undoStack->push(new RemoveTrafficItem(platoonRates, row, "platoon rates table"));
125 }
TrafficPresenter::platoonRates
TrafficItemMapPresenter *const platoonRates
a pointer to the presenter object connecting the platoon rates map to its table view ...
Definition: TrafficPresenter.h:248
RemoveTrafficItem
Command class for removing rows from the table of traffic settings.
Definition: TrafficPresenter.h:296
TrafficPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficPresenter.h:265
TrafficItemMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: TrafficItemMapPresenter.cpp:32

◆ removeRegularLaneAgent

void TrafficPresenter::removeRegularLaneAgent ( const int & row )
privateslot

Slot which is connected to the TrafficView::removeRegularLaneAgent signal. Calls the EnvironmentMapPresenter::removeRow method of the corresponding presenter object. This will remove the regular lane agent associated with the transmitted row index.

Parameters
[in] row the row of the table whose entry should be deleted

Definition at line 155 of file TrafficPresenter.cpp.

156 {
157 if(regularLaneAgents->rowCount() != 0)
158 undoStack->push(new RemoveTrafficItem(regularLaneAgents, row, "regular lane agents table"));
159 }
TrafficPresenter::regularLaneAgents
TrafficItemMapPresenter *const regularLaneAgents
a pointer to the presenter object connecting the regular lane agents map to its table view ...
Definition: TrafficPresenter.h:251
RemoveTrafficItem
Command class for removing rows from the table of traffic settings.
Definition: TrafficPresenter.h:296
TrafficPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficPresenter.h:265
TrafficItemMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: TrafficItemMapPresenter.cpp:32

◆ removeRightmostLaneAgent

void TrafficPresenter::removeRightmostLaneAgent ( const int & row )
privateslot

Slot which is connected to the TrafficView::removeRightmostLaneAgent signal. Calls the EnvironmentMapPresenter::removeRow method of the corresponding presenter object. This will remove the rightmost lane agent associated with the transmitted row index.

Parameters
[in] row the row of the table whose entry should be deleted

Definition at line 167 of file TrafficPresenter.cpp.

168 {
169 if(rightmostLaneAgents->rowCount() != 0)
170 undoStack->push(new RemoveTrafficItem(rightmostLaneAgents, row, "rightmost lane agents table"));
171 }
TrafficPresenter::rightmostLaneAgents
TrafficItemMapPresenter *const rightmostLaneAgents
a pointer to the presenter object connecting the rightmost lane agents map to its table view ...
Definition: TrafficPresenter.h:252
RemoveTrafficItem
Command class for removing rows from the table of traffic settings.
Definition: TrafficPresenter.h:296
TrafficPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficPresenter.h:265
TrafficItemMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: TrafficItemMapPresenter.cpp:32

◆ removeVelocity

void TrafficPresenter::removeVelocity ( const int & row )
privateslot

Slot which is connected to the TrafficView::removeVelocity signal. Calls the EnvironmentMapPresenter::removeRow method of the corresponding presenter object. This will remove the velocity parameter associated with the transmitted row index.

Parameters
[in] row the row of the table whose entry should be deleted

Definition at line 132 of file TrafficPresenter.cpp.

133 {
134 if(velocities->rowCount() != 0)
135 undoStack->push(new RemoveTrafficItem(velocities, row, "velocities table"));
136 }
RemoveTrafficItem
Command class for removing rows from the table of traffic settings.
Definition: TrafficPresenter.h:296
TrafficPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficPresenter.h:265
TrafficPresenter::velocities
TrafficItemMapPresenter *const velocities
a pointer to the presenter object connecting the velocities map to its table view ...
Definition: TrafficPresenter.h:249
TrafficItemMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: TrafficItemMapPresenter.cpp:32

◆ removeVolume

void TrafficPresenter::removeVolume ( const int & row )
privateslot

Slot which is connected to the TrafficView::removeVolume signal. Calls the EnvironmentMapPresenter::removeRow method of the presenter the volume map. This will remove the traffic volume associated with the transmitted row index.

Parameters
[in] row the row of the table whose entry should be deleted

Definition at line 110 of file TrafficPresenter.cpp.

111 {
112 if(volumes->rowCount() != 0)
113 undoStack->push(new RemoveTrafficItem(volumes, row, "traffic volumes table"));
114 }
TrafficPresenter::volumes
TrafficItemMapPresenter *const volumes
a pointer to the presenter object connecting the traffic volumes map to its table view ...
Definition: TrafficPresenter.h:247
RemoveTrafficItem
Command class for removing rows from the table of traffic settings.
Definition: TrafficPresenter.h:296
TrafficPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficPresenter.h:265
TrafficItemMapPresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: TrafficItemMapPresenter.cpp:32

◆ setName

void TrafficPresenter::setName ( QString const & name )
privateslot

Slot which is connected to the TrafficView::modifiedName signal. Sets the traffic configuration's name to the one transmitted by the view.

Parameters
[in] name the traffic name transmitted by the view

Definition at line 99 of file TrafficPresenter.cpp.

100 {
101 if(traffic->getName() != name)
102 undoStack->push(new EditTrafficName(traffic, trafficView, name));
103 }
TrafficPresenter::traffic
TrafficInterface *const traffic
a pointer to the model of the traffic configuration
Definition: TrafficPresenter.h:243
TrafficPresenter::trafficView
TrafficView *const trafficView
a pointer to the view of the traffic configuration
Definition: TrafficPresenter.h:244
TrafficInterface::getName
virtual Name getName() const =0
Returns the current name of the traffic setup.
TrafficPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficPresenter.h:265
EditTrafficName
Command class for editing the traffic&#39;s name.
Definition: TrafficPresenter.h:321
The documentation for this class was generated from the following files:
  • TrafficPresenter.h
  • TrafficPresenter.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficPresenter Member List

This is the complete list of members for TrafficPresenter, including all inherited members.

addHomogeneity() | TrafficPresenter | privateslot
addPlatoonRate() | TrafficPresenter | privateslot
addRegularLaneAgent() | TrafficPresenter | privateslot
addRightmostLaneAgent() | TrafficPresenter | privateslot
addVelocity() | TrafficPresenter | privateslot
addVolume() | TrafficPresenter | privateslot
agentList | TrafficPresenter | private
checkAgents() | TrafficPresenter | slot
checkProbabilities() | TrafficPresenter | slot
default_homogeneity | TrafficPresenter | privatestatic
default_platoonRate | TrafficPresenter | privatestatic
default_probability | TrafficPresenter | privatestatic
default_velocity | TrafficPresenter | privatestatic
default_volume | TrafficPresenter | privatestatic
homogeneities | TrafficPresenter | private
platoonRates | TrafficPresenter | private
regularLaneAgents | TrafficPresenter | private
removeHomogeneity(const int &row) | TrafficPresenter | privateslot
removePlatoonRate(const int &row) | TrafficPresenter | privateslot
removeRegularLaneAgent(const int &row) | TrafficPresenter | privateslot
removeRightmostLaneAgent(const int &row) | TrafficPresenter | privateslot
removeVelocity(const int &row) | TrafficPresenter | privateslot
removeVolume(const int &row) | TrafficPresenter | privateslot
rightmostLaneAgents | TrafficPresenter | private
setName(QString const &name) | TrafficPresenter | privateslot
setupHomogeneities() | TrafficPresenter | private
setupPlatoonRates() | TrafficPresenter | private
setupRegularLaneAgents() | TrafficPresenter | private
setupRightmostLaneAgents() | TrafficPresenter | private
setupVelocities() | TrafficPresenter | private
setupVolumes() | TrafficPresenter | private
traffic | TrafficPresenter | private
trafficView | TrafficPresenter | private
undoStack | TrafficPresenter | private
updateView() | TrafficPresenter |
velocities | TrafficPresenter | private
volumes | TrafficPresenter | private
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationInterface Class Reference

Public Member Functions | List of all members
TrafficSimulationInterface Class Referenceabstract

The TrafficSimulationInterface class forms the body of a traffic simulation configuration. More...

Inheritance diagram for TrafficSimulationInterface:
TrafficSimulationModel

Public Member Functions

virtual EnvironmentInterface * | getEnvironment () const =0
Returns the pointer to the environment configuration object, i.e. an instance of the EnvironmentInterface class. More...
virtual ExperimentInterface * | getExperiment () const =0
Returns the pointer to the experiment configuration object, i.e. an instance of the ExperimentInterface class. More...
virtual ProfilesCatalogue | getProfilesCatalogue () const =0
Returns the current profiles catalogue. More...
virtual ScenarioInterface * | getScenario () const =0
Returns the pointer to the scenario configuration object, i.e. an instance of the ScenarioInterface class. More...
virtual TrafficInterface * | getTraffic () const =0
Returns the pointer to the traffic configuration object, i.e. an instance of the TrafficInterface class. More...
virtual void | setProfilesCatalogue (ProfilesCatalogue const &_profilesCatalogue)=0
Sets the current profiles catalogue to the one passed as an argument. More...

Detailed Description

The TrafficSimulationInterface class forms the body of a traffic simulation configuration.

It references the experiment, scenario, traffic and environment configuration classes and, hence, corresponds to the root element of the combination XML file.

Definition at line 37 of file TrafficSimulationInterface.h.

Member Function Documentation

◆ getEnvironment()

virtual EnvironmentInterface* TrafficSimulationInterface::getEnvironment ( ) const
pure virtual

Returns the pointer to the environment configuration object, i.e. an instance of the EnvironmentInterface class.

Returns
the pointer to the environment configuration object

Implemented in TrafficSimulationModel.

◆ getExperiment()

virtual ExperimentInterface* TrafficSimulationInterface::getExperiment ( ) const
pure virtual

Returns the pointer to the experiment configuration object, i.e. an instance of the ExperimentInterface class.

Returns
the pointer to the experiment configuration object

Implemented in TrafficSimulationModel.

◆ getProfilesCatalogue()

virtual ProfilesCatalogue TrafficSimulationInterface::getProfilesCatalogue ( ) const
pure virtual

Returns the current profiles catalogue.

Returns
the current profiles catalogue

Implemented in TrafficSimulationModel.

◆ getScenario()

virtual ScenarioInterface* TrafficSimulationInterface::getScenario ( ) const
pure virtual

Returns the pointer to the scenario configuration object, i.e. an instance of the ScenarioInterface class.

Returns
the pointer to the scenario configuration object

Implemented in TrafficSimulationModel.

◆ getTraffic()

virtual TrafficInterface* TrafficSimulationInterface::getTraffic ( ) const
pure virtual

Returns the pointer to the traffic configuration object, i.e. an instance of the TrafficInterface class.

Returns
the pointer to the traffic configuration object

Implemented in TrafficSimulationModel.

◆ setProfilesCatalogue()

virtual void TrafficSimulationInterface::setProfilesCatalogue ( ProfilesCatalogue const & _profilesCatalogue )
pure virtual

Sets the current profiles catalogue to the one passed as an argument.

Parameters
[in] _profilesCatalogue the profiles catalogue to be adopted

Implemented in TrafficSimulationModel.

The documentation for this class was generated from the following file:
  • TrafficSimulationInterface.h
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficSimulationInterface Member List

This is the complete list of members for TrafficSimulationInterface, including all inherited members.

getEnvironment() const =0 | TrafficSimulationInterface | pure virtual
getExperiment() const =0 | TrafficSimulationInterface | pure virtual
getProfilesCatalogue() const =0 | TrafficSimulationInterface | pure virtual
getScenario() const =0 | TrafficSimulationInterface | pure virtual
getTraffic() const =0 | TrafficSimulationInterface | pure virtual
setProfilesCatalogue(ProfilesCatalogue const &_profilesCatalogue)=0 | TrafficSimulationInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationModel Class Reference

Public Member Functions | List of all members
TrafficSimulationModel Class Reference

The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class. More...

Inheritance diagram for TrafficSimulationModel:
TrafficSimulationInterface

Public Member Functions

virtual EnvironmentInterface * | getEnvironment () const override
Returns the pointer to the environment configuration object, i.e. an instance of the EnvironmentInterface class. More...
virtual ExperimentInterface * | getExperiment () const override
Returns the pointer to the experiment configuration object, i.e. an instance of the ExperimentInterface class. More...
virtual ProfilesCatalogue | getProfilesCatalogue () const override
Returns the current profiles catalogue. More...
virtual ScenarioInterface * | getScenario () const override
Returns the pointer to the scenario configuration object, i.e. an instance of the ScenarioInterface class. More...
virtual TrafficInterface * | getTraffic () const override
Returns the pointer to the traffic configuration object, i.e. an instance of the TrafficInterface class. More...
virtual void | setProfilesCatalogue (ProfilesCatalogue const &_profilesCatalogue) override
Sets the current profiles catalogue to the one passed as an argument. More...

Detailed Description

The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class.

Definition at line 33 of file TrafficSimulationModel.h.

Member Function Documentation

◆ getEnvironment()

EnvironmentInterface * TrafficSimulationModel::getEnvironment ( ) const
overridevirtual

Returns the pointer to the environment configuration object, i.e. an instance of the EnvironmentInterface class.

Returns
the pointer to the environment configuration object

Implements TrafficSimulationInterface.

Definition at line 29 of file TrafficSimulationModel.cpp.

30 {
31 return environment;
32 }

◆ getExperiment()

ExperimentInterface * TrafficSimulationModel::getExperiment ( ) const
overridevirtual

Returns the pointer to the experiment configuration object, i.e. an instance of the ExperimentInterface class.

Returns
the pointer to the experiment configuration object

Implements TrafficSimulationInterface.

Definition at line 24 of file TrafficSimulationModel.cpp.

25 {
26 return experiment;
27 }

◆ getProfilesCatalogue()

TrafficSimulationInterface::ProfilesCatalogue TrafficSimulationModel::getProfilesCatalogue ( ) const
overridevirtual

Returns the current profiles catalogue.

Returns
the current profiles catalogue

Implements TrafficSimulationInterface.

Definition at line 44 of file TrafficSimulationModel.cpp.

45 {
46 return profilesCatalogue;
47 }

◆ getScenario()

ScenarioInterface * TrafficSimulationModel::getScenario ( ) const
overridevirtual

Returns the pointer to the scenario configuration object, i.e. an instance of the ScenarioInterface class.

Returns
the pointer to the scenario configuration object

Implements TrafficSimulationInterface.

Definition at line 34 of file TrafficSimulationModel.cpp.

35 {
36 return scenario;
37 }

◆ getTraffic()

TrafficInterface * TrafficSimulationModel::getTraffic ( ) const
overridevirtual

Returns the pointer to the traffic configuration object, i.e. an instance of the TrafficInterface class.

Returns
the pointer to the traffic configuration object

Implements TrafficSimulationInterface.

Definition at line 39 of file TrafficSimulationModel.cpp.

40 {
41 return traffic;
42 }

◆ setProfilesCatalogue()

void TrafficSimulationModel::setProfilesCatalogue ( ProfilesCatalogue const & _profilesCatalogue )
overridevirtual

Sets the current profiles catalogue to the one passed as an argument.

Parameters
[in] _profilesCatalogue the profiles catalogue to be adopted

Implements TrafficSimulationInterface.

Definition at line 49 of file TrafficSimulationModel.cpp.

50 {
51 profilesCatalogue = _profilesCatalogue;
52 }
The documentation for this class was generated from the following files:
  • TrafficSimulationModel.h
  • TrafficSimulationModel.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficSimulationModel Member List

This is the complete list of members for TrafficSimulationModel, including all inherited members.

getEnvironment() const override | TrafficSimulationModel | virtual
getExperiment() const override | TrafficSimulationModel | virtual
getProfilesCatalogue() const override | TrafficSimulationModel | virtual
getScenario() const override | TrafficSimulationModel | virtual
getTraffic() const override | TrafficSimulationModel | virtual
setProfilesCatalogue(ProfilesCatalogue const &_profilesCatalogue) override | TrafficSimulationModel | virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationPresenter Class Reference

Private Slots | Private Member Functions | Private Attributes | List of all members
TrafficSimulationPresenter Class Reference

This class defines the presenter object for the main view of the Traffic Simulation Plugin and instantiates all other presenters. More...

Inherits QObject.

Private Slots

void | checkStatus ()
Slot which checks the status of the configuration for each tab, i.e. the experiment, environment, scenario and traffic tabs. If all configurations are complete and correct, the start button for the simulation will be enabled.
void | clear ()
Slot which is triggered after the user has clicked the new-button in the action menu and confirmed that the worksheet should be cleared. It calls the TrafficSimulationInterface::clear routine in order to clear the whole configuration and views.
void | load ()
Slot which is triggered after the user has clicked the load-button in the action menu. Will open file dialog to select a filepath for the slaveConfig xml file to be loaded. It calls the TrafficSimulationXMLLoadModel::load routine for loading a slaveConfig XML file.
void | save ()
Slot which is triggered after the user has clicked the save-button in the action menu. Will open file dialog to select a filepath for the slaveConfig xml file to be saved. It calls the TrafficSimulationXMLSaveModel::save routine for saving the momentary configuration to a slaveConfig XML file.
void | setProfileCatalogue ()
Slot which opens the file dialog for the user to select a profiles catalouge XML file. Further, it scans the chosen profile catalogue for agent profiles and updates agentProfiles accordingly. If the profile catalogue is changed, all agent profiles included into the traffic settings (TrafficInterface) are deleted. Before, a dialog window with a warning is displayed requiring a user confirmation. More...
void | simulationFinished (int exitCode)
Slot which is triggered when the simulation slave has terminated. It will pop up an info window with the exit code the slave has terminated with as well as the location of the log file.
void | startSimulation ()
Slot which is triggered when the simulation button is pressed. It creates a process for executing the simulation slave defined in the corresponding slave path (see ProjectInterface). Before, it saves the current settings to the file 'slaveConfig.xml'. If such a file already exists, the user will be asked whether to override it or not.
void | updateCatalogueView ()
Slot which displays the profile catalogues view. Further, it loads the agent list, defined in the profiles catalogue. If any errors occur, these will be displayed in the GUI as well.
void | updateStatusBar (int index)
Slot which displays information in the status bar depending on the current tab. More...

Private Member Functions

void | clearEnvironmentConfig ()
Method, which resets all setting made in the environment config to the default and empties all tables.
void | clearExperimentConfig ()
Method, which resets all setting made in the experiment config to the default and empties all tables.
void | clearScenarioConfig ()
Method, which resets all setting made in the scenario config to the default and empties all tables.
void | clearTrafficConfig ()
Method, which resets all setting made in the traffic config to the default and empties all tables.
void | copyEnvironmentConfig (TrafficSimulationInterface const *const from)
Method, which copies all environment settings from the given argument to trafficSimulation. More...
void | copyExperimentConfig (TrafficSimulationInterface const *const from)
Method, which copies all experiment settings from the given argument to trafficSimulation. More...
void | copyScenarioConfig (TrafficSimulationInterface const *const from)
Method, which copies all scenario settings from the given argument to trafficSimulation. More...
void | copyTrafficConfig (TrafficSimulationInterface const *const from)
Method, which copies all traffic settings from the given argument to trafficSimulation. More...

Private Attributes

QList< QString > | agentProfiles
a list of agent profiles defined in the profile catalogue
EnvironmentDisplayPresenter *const | environmentDisplayPresenter
a pointer to the environment display presenter instantiated here
EnvironmentPresenter *const | environmentPresenter
a pointer to the environment presenter instantiated here
ExperimentPresenter *const | experimentPresenter
a pointer to the experiment presenter instantiated here
ProjectInterface *const | project
a pointer to the project settings (provides access to the path settings
QShortcut *const | redo
shortcut for redo
ScenarioDisplayPresenter *const | scenarioDisplayPresenter
a pointer to the scenario display presenter instantiated here
ScenarioPresenter *const | scenarioPresenter
a pointer to the scenario presenter instantiated here
TrafficDisplayPresenter *const | trafficDisplayPresenter
a pointer to the traffic display presenter instantiated here
TrafficPresenter *const | trafficPresenter
a pointer to the traffic presenter instantiated here
TrafficSimulationInterface *const | trafficSimulation
a pointer to the model class edited by this presenter
TrafficSimulationView *const | trafficSimulationView
a pointer to the editor view whose user events are handled by this presenter
QShortcut *const | undo
shortcut for undo
QUndoStack *const | undoStack
a pointer to the undo stack

Detailed Description

This class defines the presenter object for the main view of the Traffic Simulation Plugin and instantiates all other presenters.

The major user events to be handled are those from the action menu bar, i.e. loading, saving and clearing the whole configuration.

Definition at line 49 of file TrafficSimulationPresenter.h.

Member Function Documentation

◆ copyEnvironmentConfig()

void TrafficSimulationPresenter::copyEnvironmentConfig ( TrafficSimulationInterface const *const from )
private

Method, which copies all environment settings from the given argument to trafficSimulation.

Parameters
[in] from the traffic simulation instance to copy from

Definition at line 311 of file TrafficSimulationPresenter.cpp.

312 {
313 EnvironmentMapPresenter * table;
314 QMap<EnvironmentInterface::ID, EnvironmentInterface::Item *> * map;
315
316 // 0. edit name
317 undoStack->push(new EditEnvironmentName(trafficSimulation->getEnvironment(),
318 trafficSimulationView->getEnvironmentView(),
319 from->getEnvironment()->getName()));
320
321 // 1. copy time of day table
322 table = findChild<EnvironmentMapPresenter *>("timeOfDayTable");
323 map = from->getEnvironment()->getTimeOfDayMap();
324 for(auto item : *map)
325 undoStack->push(new AddEnvironmentItem(table, item->getValue(), item->getProbability()));
326
327 // 2. copy visibility distance table
328 table = findChild<EnvironmentMapPresenter *>("visibilityDistanceTable");
329 map = from->getEnvironment()->getVisibilityDistanceMap();
330 for(auto item : *map)
331 undoStack->push(new AddEnvironmentItem(table, item->getValue(), item->getProbability()));
332
333 // 3. copy friction table
334 table = findChild<EnvironmentMapPresenter *>("frictionTable");
335 map = from->getEnvironment()->getFrictionMap();
336 for(auto item : *map)
337 undoStack->push(new AddEnvironmentItem(table, item->getValue(), item->getProbability()));
338
339 // 4. copy weather table
340 table = findChild<EnvironmentMapPresenter *>("weatherTable");
341 map = from->getEnvironment()->getWeatherMap();
342 for(auto item : *map)
343 undoStack->push(new AddEnvironmentItem(table, item->getValue(), item->getProbability()));
344 }
AddEnvironmentItem
Command class for adding rows to the table of environment settings.
Definition: EnvironmentPresenter.h:198
TrafficSimulationPresenter::trafficSimulationView
TrafficSimulationView *const trafficSimulationView
a pointer to the editor view whose user events are handled by this presenter
Definition: TrafficSimulationPresenter.h:201
EditEnvironmentName
Command class editing the environment&#39;s name.
Definition: EnvironmentPresenter.h:245
TrafficSimulationView::getEnvironmentView
EnvironmentView * getEnvironmentView()
Method that returns the environment configuration widget (instance of EnvironmentView).
Definition: TrafficSimulationView.cpp:162
EnvironmentMapPresenter
This class describes the presenter objects of the environment parameter maps.
Definition: EnvironmentMapPresenter.h:49
TrafficSimulationInterface::getEnvironment
virtual EnvironmentInterface * getEnvironment() const =0
Returns the pointer to the environment configuration object, i.e. an instance of the EnvironmentInter...
TrafficSimulationPresenter::trafficSimulation
TrafficSimulationInterface *const trafficSimulation
a pointer to the model class edited by this presenter
Definition: TrafficSimulationPresenter.h:200
TrafficSimulationPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficSimulationPresenter.h:203

◆ copyExperimentConfig()

void TrafficSimulationPresenter::copyExperimentConfig ( TrafficSimulationInterface const *const from )
private

Method, which copies all experiment settings from the given argument to trafficSimulation.

Parameters
[in] from the traffic simulation instance to copy from

Definition at line 281 of file TrafficSimulationPresenter.cpp.

282 {
283 int row;
284
285 undoStack->push(new EditNumberInvocations(trafficSimulation->getExperiment(),
286 trafficSimulationView->getExperimentView(),
287 from->getExperiment()->getNumberInvocations()));
288
289 undoStack->push(new EditRandomSeed(trafficSimulation->getExperiment(),
290 trafficSimulationView->getExperimentView(),
291 from->getExperiment()->getSeed()));
292
293 LibrariesPresenter * const libPresenter = findChild<LibrariesPresenter * const>();
294 ExperimentInterface::Libraries * const loadedLibs = from->getExperiment()->getLibraries();
295 row = 0;
296 for(auto libType : loadedLibs->keys())
297 {
298 undoStack->push(new AddLibrary(libPresenter, libType));
299 undoStack->push(new EditData(libPresenter, libPresenter->index(row,1), loadedLibs->value(libType), ""));
300 ++row;
301 }
302
303 LoggingGroupsPresenter * const loggingGroupsPresenter = findChild<LoggingGroupsPresenter * const>();
304 ExperimentInterface::LoggingGroups * const loadedLoggingGroups = from->getExperiment()->getLoggingGroups();
305 for(auto loggingGroup : *loadedLoggingGroups)
306 {
307 undoStack->push(new AddLoggingGroup(loggingGroupsPresenter, loggingGroup));
308 }
309 }
EditNumberInvocations
Command class editing the number of invocations.
Definition: ExperimentPresenter.h:226
ExperimentInterface::Libraries
QMap< QString, QString > Libraries
The map of libraries needed by the simulation slave.
Definition: ExperimentInterface.h:47
TrafficSimulationPresenter::trafficSimulationView
TrafficSimulationView *const trafficSimulationView
a pointer to the editor view whose user events are handled by this presenter
Definition: TrafficSimulationPresenter.h:201
LoggingGroupsPresenter
This class describes the presenter object of the list of logging groups.
Definition: LoggingGroupsPresenter.h:47
AddLoggingGroup
Command class for adding logging groups to the logging groups list.
Definition: ExperimentPresenter.h:185
ExperimentInterface::LoggingGroups
QStringList LoggingGroups
The list of logging groups.
Definition: ExperimentInterface.h:48
LibrariesPresenter
This class describes the presenter object of the map of included libraries.
Definition: LibrariesPresenter.h:48
AddLibrary
Command class for adding libraries to the libraries table.
Definition: ExperimentPresenter.h:144
TrafficSimulationView::getExperimentView
ExperimentView * getExperimentView()
Method that returns the experiment configuration widget (instance of ExperimentView).
Definition: TrafficSimulationView.cpp:157
TrafficSimulationInterface::getExperiment
virtual ExperimentInterface * getExperiment() const =0
Returns the pointer to the experiment configuration object, i.e. an instance of the ExperimentInterfa...
EditRandomSeed
Command class editing the number of invocations.
Definition: ExperimentPresenter.h:249
TrafficSimulationPresenter::trafficSimulation
TrafficSimulationInterface *const trafficSimulation
a pointer to the model class edited by this presenter
Definition: TrafficSimulationPresenter.h:200
TrafficSimulationPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficSimulationPresenter.h:203

◆ copyScenarioConfig()

void TrafficSimulationPresenter::copyScenarioConfig ( TrafficSimulationInterface const *const from )
private

Method, which copies all scenario settings from the given argument to trafficSimulation.

Parameters
[in] from the traffic simulation instance to copy from

Definition at line 346 of file TrafficSimulationPresenter.cpp.

347 {
348 // 0. edit name
349 undoStack->push(new EditScenarioName(trafficSimulation->getScenario(),
350 trafficSimulationView->getScenarioView(),
351 from->getScenario()->getName()));
352
353 // 1. edit scenario file
354 undoStack->push(new EditScenarioFile(trafficSimulation->getScenario(),
355 trafficSimulationView->getScenarioView(),
356 from->getScenario()->getScenarioFile()));
357 }
TrafficSimulationPresenter::trafficSimulationView
TrafficSimulationView *const trafficSimulationView
a pointer to the editor view whose user events are handled by this presenter
Definition: TrafficSimulationPresenter.h:201
EditScenarioName
Command class editing the scenario&#39;s name.
Definition: ScenarioPresenter.h:98
EditScenarioFile
Command class editing the OpenSCENARIO file.
Definition: ScenarioPresenter.h:121
TrafficSimulationView::getScenarioView
ScenarioView * getScenarioView()
Method that returns the scenario configuration widget (instance of ScenarioView). ...
Definition: TrafficSimulationView.cpp:177
TrafficSimulationPresenter::trafficSimulation
TrafficSimulationInterface *const trafficSimulation
a pointer to the model class edited by this presenter
Definition: TrafficSimulationPresenter.h:200
TrafficSimulationPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficSimulationPresenter.h:203
TrafficSimulationInterface::getScenario
virtual ScenarioInterface * getScenario() const =0
Returns the pointer to the scenario configuration object, i.e. an instance of the ScenarioInterface c...

◆ copyTrafficConfig()

void TrafficSimulationPresenter::copyTrafficConfig ( TrafficSimulationInterface const *const from )
private

Method, which copies all traffic settings from the given argument to trafficSimulation.

Parameters
[in] from the traffic simulation instance to copy from

Definition at line 359 of file TrafficSimulationPresenter.cpp.

360 {
361 TrafficItemMapPresenter * table;
362 TrafficItemMapInterface * map;
363
364 // 0. edit name
365 undoStack->push(new EditTrafficName(trafficSimulation->getTraffic(),
366 trafficSimulationView->getTrafficView(),
367 from->getTraffic()->getName()));
368
369 // 1. copy traffic volume table
370 table = findChild<TrafficItemMapPresenter *>("volumesTable");
371 map = from->getTraffic()->getVolumes();
372 for(auto item: *map)
373 undoStack->push(new AddTrafficItem(table, item->getValue(), item->getProbability()));
374
375 // 2. copy velocities table
376 table = findChild<TrafficItemMapPresenter *>("velocitiesTable");
377 map = from->getTraffic()->getVelocities();
378 for(auto item: *map)
379 undoStack->push(new AddTrafficItem(table, item->getValue(), item->getProbability()));
380
381 // 3. copy platoon Rates table
382 table = findChild<TrafficItemMapPresenter *>("platoonRatesTable");
383 map = from->getTraffic()->getPlatoonRates();
384 for(auto item: *map)
385 undoStack->push(new AddTrafficItem(table, item->getValue(), item->getProbability()));
386
387 // 4. copy homogeneities table
388 table = findChild<TrafficItemMapPresenter *>("homogeneitiesTable");
389 map = from->getTraffic()->getHomogeneities();
390 for(auto item: *map)
391 undoStack->push(new AddTrafficItem(table, item->getValue(), item->getProbability()));
392
393 // 5. copy regular lange agents table
394 table = findChild<TrafficItemMapPresenter *>("regularLaneAgentsTable");
395 map = from->getTraffic()->getAgentsRegularLane();
396 for(auto item: *map)
397 undoStack->push(new AddTrafficItem(table, item->getValue(), item->getProbability()));
398
399 // 6. copy rightmost lange agents table
400 table = findChild<TrafficItemMapPresenter *>("rightmostLaneAgentsTable");
401 map = from->getTraffic()->getAgentsRightMostLane();
402 for(auto item: *map)
403 undoStack->push(new AddTrafficItem(table, item->getValue(), item->getProbability()));
404 }
TrafficSimulationPresenter::trafficSimulationView
TrafficSimulationView *const trafficSimulationView
a pointer to the editor view whose user events are handled by this presenter
Definition: TrafficSimulationPresenter.h:201
TrafficSimulationInterface::getTraffic
virtual TrafficInterface * getTraffic() const =0
Returns the pointer to the traffic configuration object, i.e. an instance of the TrafficInterface cla...
TrafficItemMapInterface
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be...
Definition: TrafficItemMapInterface.h:33
TrafficSimulationView::getTrafficView
TrafficView * getTrafficView()
Method that returns the traffic configuration widget (instance of TrafficView).
Definition: TrafficSimulationView.cpp:182
AddTrafficItem
Command class for adding rows to the table of traffic settings.
Definition: TrafficPresenter.h:272
TrafficItemMapPresenter
This class describes the presenter objects of the traffic parameter maps.
Definition: TrafficItemMapPresenter.h:48
EditTrafficName
Command class for editing the traffic&#39;s name.
Definition: TrafficPresenter.h:321
TrafficSimulationPresenter::trafficSimulation
TrafficSimulationInterface *const trafficSimulation
a pointer to the model class edited by this presenter
Definition: TrafficSimulationPresenter.h:200
TrafficSimulationPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficSimulationPresenter.h:203

◆ setProfileCatalogue

void TrafficSimulationPresenter::setProfileCatalogue ( )
privateslot

Slot which opens the file dialog for the user to select a profiles catalouge XML file. Further, it scans the chosen profile catalogue for agent profiles and updates agentProfiles accordingly. If the profile catalogue is changed, all agent profiles included into the traffic settings (TrafficInterface) are deleted. Before, a dialog window with a warning is displayed requiring a user confirmation.

Parameters
[in] filename the filename of the profile catalogue to be adopted

Definition at line 485 of file TrafficSimulationPresenter.cpp.

486 {
487 QString const filename = QFileDialog::getOpenFileName(
488 trafficSimulationView, QObject::tr("openPASS / Select profiles catalogue"),
489 project->getConfigPath(), QStringLiteral("ProfilesCatalog (*.xml)"));
490
491 QString Catalogue= project->relativeToConfigPath(filename);
492
493 if(trafficSimulation->getProfilesCatalogue()!= Catalogue)
494 undoStack->push(new EditProfilesCatalogue(trafficSimulation, trafficSimulationView,Catalogue));
495 }
TrafficSimulationPresenter::trafficSimulationView
TrafficSimulationView *const trafficSimulationView
a pointer to the editor view whose user events are handled by this presenter
Definition: TrafficSimulationPresenter.h:201
TrafficSimulationInterface::getProfilesCatalogue
virtual ProfilesCatalogue getProfilesCatalogue() const =0
Returns the current profiles catalogue.
TrafficSimulationPresenter::project
ProjectInterface *const project
a pointer to the project settings (provides access to the path settings
Definition: TrafficSimulationPresenter.h:202
EditProfilesCatalogue
Command class for editing the profiles catalogue.
Definition: TrafficSimulationPresenter.h:226
TrafficSimulationPresenter::trafficSimulation
TrafficSimulationInterface *const trafficSimulation
a pointer to the model class edited by this presenter
Definition: TrafficSimulationPresenter.h:200
TrafficSimulationPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: TrafficSimulationPresenter.h:203

◆ updateStatusBar

void TrafficSimulationPresenter::updateStatusBar ( int index )
privateslot

Slot which displays information in the status bar depending on the current tab.

Parameters
[in] index the current tab index

Definition at line 197 of file TrafficSimulationPresenter.cpp.

198 {
199 QString info;
200
201 switch(index)
202 {
203
204 // Experiment Configuration
205 case 0:
206 {
207 info = QString("This tab contains the overall experiment setup. Experiments can be configured and started here.");
208 trafficSimulationView->showStatusBarText(info, StatusBarView::Color::Message);
209 break;
210 }
211 // Environment Configuration
212 case 1:
213 {
214 info = QString("This tab contains information about the world and the general environment inside the simulation. "
215 "Every invocation re-rolls the environment parameters. Probabilities need to add up to 1.0 for each parameter. Note that, in "
216 "the current implementation, the environment parameters 'time of day' as well as 'weather' are not used yet.");
217 trafficSimulationView->showStatusBarText(info, StatusBarView::Color::Message);
218 break;
219 }
220 case 2:
221 {
222 info = QString("This tab contains information about the scenario and scenery setup for the experiment. This information does not change between invocations. "
223 "Here the scenario and scenery files as well as the AgentProfiles for all agents are specified. For every agent listed in the scenario file one AgentProfile is required");
224 trafficSimulationView->showStatusBarText(info, StatusBarView::Color::Message);
225 break;
226 }
227 case 3:
228 {
229 info = QString("This tab contains parameters regarding the traffic and distribution of agent profiles for all surrounding vehicles. "
230 "Every invocation re-rolls the traffic parameters and agents. Probabilities need to add up to 1.0 for each parameter.");
231 trafficSimulationView->showStatusBarText(info, StatusBarView::Color::Message);
232 break;
233 }
234 default:
235 break;
236
237 }
238 }
TrafficSimulationPresenter::trafficSimulationView
TrafficSimulationView *const trafficSimulationView
a pointer to the editor view whose user events are handled by this presenter
Definition: TrafficSimulationPresenter.h:201
TrafficSimulationView::showStatusBarText
void showStatusBarText(QString text, StatusBarView::Color color)
Method which shows the text message passed as a first argument in the info bar in the color code spec...
Definition: TrafficSimulationView.cpp:200
The documentation for this class was generated from the following files:
  • TrafficSimulationPresenter.h
  • TrafficSimulationPresenter.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficSimulationPresenter Member List

This is the complete list of members for TrafficSimulationPresenter, including all inherited members.

agentProfiles | TrafficSimulationPresenter | private
checkStatus() | TrafficSimulationPresenter | privateslot
clear() | TrafficSimulationPresenter | privateslot
clearEnvironmentConfig() | TrafficSimulationPresenter | private
clearExperimentConfig() | TrafficSimulationPresenter | private
clearScenarioConfig() | TrafficSimulationPresenter | private
clearTrafficConfig() | TrafficSimulationPresenter | private
copyEnvironmentConfig(TrafficSimulationInterface const *const from) | TrafficSimulationPresenter | private
copyExperimentConfig(TrafficSimulationInterface const *const from) | TrafficSimulationPresenter | private
copyScenarioConfig(TrafficSimulationInterface const *const from) | TrafficSimulationPresenter | private
copyTrafficConfig(TrafficSimulationInterface const *const from) | TrafficSimulationPresenter | private
environmentDisplayPresenter | TrafficSimulationPresenter | private
environmentPresenter | TrafficSimulationPresenter | private
experimentPresenter | TrafficSimulationPresenter | private
load() | TrafficSimulationPresenter | privateslot
project | TrafficSimulationPresenter | private
redo | TrafficSimulationPresenter | private
save() | TrafficSimulationPresenter | privateslot
scenarioDisplayPresenter | TrafficSimulationPresenter | private
scenarioPresenter | TrafficSimulationPresenter | private
setProfileCatalogue() | TrafficSimulationPresenter | privateslot
simulationFinished(int exitCode) | TrafficSimulationPresenter | privateslot
startSimulation() | TrafficSimulationPresenter | privateslot
trafficDisplayPresenter | TrafficSimulationPresenter | private
trafficPresenter | TrafficSimulationPresenter | private
trafficSimulation | TrafficSimulationPresenter | private
trafficSimulationView | TrafficSimulationPresenter | private
undo | TrafficSimulationPresenter | private
undoStack | TrafficSimulationPresenter | private
updateCatalogueView() | TrafficSimulationPresenter | privateslot
updateStatusBar(int index) | TrafficSimulationPresenter | privateslot
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationView Class Reference

Public Slots | Signals | Public Member Functions | Protected Member Functions | Private Slots | Private Attributes | Static Private Attributes | List of all members
TrafficSimulationView Class Reference

This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other configuration views as child widgets. More...

Inherits QWidget.

Public Slots

void on_tabWidget_currentChanged (int index)
Slot, activated when the current tab has changed. Will emit the currentTabChanged signal transmitting the new tab index. More...

Signals

void | currentTabChanged (int index)
Signal, emitted when the current tab has been changed. Transmits the index of the tab.
void | LoadSetup ()
Signal, emitted after the load-button in the action menu has been clicked.
void | NewSetup ()
Signal, emitted when the new-button in the action menu is clicked.
void | profileCatalogueChanged ()
Signal, emitted when the profiles catalogue has been modified by the user. More...
void | Redo ()
Signal, emitted after the redo-button in the action menu has been clicked.
void | refreshCatalogue ()
Signal, emitted when the refresh button of the profile catalogue has been clicked by the user. Will lead to an update of the list of available agent profiles according to the currently displayed profile catalogue.
void | SaveSetup ()
Signal, emitted after the save-button in the action menu has been clicked.
void | Undo ()
Signal, emitted after the undo-button in the action menu has been clicked.

Public Member Functions

void | adjustWidgets ()
Method for adjusting the geometry and positioning of child widgets according to the geometry of this view.
EnvironmentDisplayView * getEnvironmentDisplayView ()
Method that returns the environment display widget (instance of EnvironmentDisplayView). More...
EnvironmentView * getEnvironmentView ()
Method that returns the environment configuration widget (instance of EnvironmentView). More...
ExperimentView * getExperimentView ()
Method that returns the experiment configuration widget (instance of ExperimentView). More...
ScenarioDisplayView * getScenarioDisplayView ()
Method that returns the scenario display widget (instance of ScenarioDisplayView). More...
ScenarioView * getScenarioView ()
Method that returns the scenario configuration widget (instance of ScenarioView). More...
TrafficDisplayView * getTrafficDisplayView ()
Method that returns the traffic display widget (instance of TrafficDisplayView). More...
TrafficView * getTrafficView ()
Method that returns the traffic configuration widget (instance of TrafficView). More...
QUndoView * | getUndoView ()
Method that returns the undo view. More...
void | hideStatusBar ()
Method which hides the info bar.
void | setProfileCatalogueError (QString const &message)
Method which sets an error message next the profile catalogue's line edit. More...
void | setProfileCatalogueView (QString const &filename)
Method which sets the filename displayed in the profile catalogue's line edit to the one passed as an argument. More...
void | showStatusBarText (QString text, StatusBarView::Color color)
Method which shows the text message passed as a first argument in the info bar in the color code specified as a second argument.
TrafficSimulationView (WindowInterface *const window, QWidget *parent=nullptr)
Constructor which initialises all attributes, creates the ui object as well as the actions for the action menu and the status bar. Further, all the tab widget contents for editing the experiment, scenario and traffic are created. More...

Protected Member Functions

virtual void resizeEvent (QResizeEvent *event) override
Reimplementation of the resize event. Triggers adjustWidgets in order to adjust the geometry of the child widgets when this view has been resized. More...

Private Slots

void | actionHistory ()
Slot which is triggered when the command history button is clicked. Will show or hide the command history.
void | actionLoad ()
Slot which is triggered when the load-button of the action menu has been clicked. Prompts a file dialog box to let the user select a filepath. Afterwards the signal LoadSetup is emitted transmitting the selected filepath.
void | actionNew ()
Slot which is triggered when the new-button of the action menu has been clicked. Shows a warning dialog box making the user aware of the fact that the worksheet will be deleted when continuing. When the user clickes "yes", the NewSetup signal is emitted.
void | actionRedo ()
Slot which is triggered when the redo-button of the action menu has been clicked. Will trigger the redo of the previously undone action.
void | actionSave ()
Slot which is triggered when the save-button of the action menu has been clicked. Prompts a file dialog box to let the user select a filepath. Afterwards the signal SaveSetup is emitted transmitting the selected filepath.
void | actionUndo ()
Slot which is triggered when the undo-button of the action menu has been clicked. Will trigger the undo of the previous action.
void | on_CatalogueBrowse_clicked ()
Slot which is triggered when Browse-button next to the profile catalogue's line edit is clicked. It will open a dialog box in which the user can select a profile catalogue from the file system. If the user has made a valid selection, the filename will be transmitted to the presenter object (TrafficSimulationPresenter) via the signal profileCatalogueChanged.
void | on_CatalogueRefresh_clicked ()
Slot which is triggered when the Refresh button of the profiles catalogue section is clicked. Will emit the refreshCatalogue signal.

Private Attributes

WindowInterface::Action *const | actionMenuHistory
The action menu object for showing the command history.
WindowInterface::Action *const | actionMenuLoad
The action menu object for loading a slaveConfig file.
WindowInterface::Action *const | actionMenuNew
The action menu object for the creating a new worksheet.
WindowInterface::Action *const | actionMenuRedo
The action menu object for redoing actions.
WindowInterface::Action *const | actionMenuSave
The action menu object for saving a slaveConfig file.
WindowInterface::Action *const | actionMenuUndo
The action menu object for undoing actions.
EnvironmentView * environmentView
the view of the environment configuration
ExperimentBaseView * experimentBaseView
The container widget for the experiment configuration (to be put into the scroll area)
ScenarioView * scenarioView
the view of the scenario settings
StatusBarView * statusbar
the info bar object
TrafficView * trafficView
the view of the traffic configuration
Ui::TrafficSimulationView * | ui
The ui object defining the components of the view.
QUndoView *const | undoView
the view of the undo stack
WindowInterface *const | window
pointer to the window interface for registering this view

Static Private Attributes

static const WindowInterface::ID ViewID = QStringLiteral("openPASS.TrafficSimulation")
the view id under which this view is registered in the window interface

Detailed Description

This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other configuration views as child widgets.

It contains an ui object describing the views appearence (defined in TrafficSimulation.ui). This ui object comprises a tab widget for the experiment, scenario, environments and traffic views. These tabs contain scroll areas in which a resizable container widget will be put for the particular configuration widget. Further, the action menu and info bar are instantiated.

Definition at line 56 of file TrafficSimulationView.h.

Constructor & Destructor Documentation

◆ TrafficSimulationView()

TrafficSimulationView::TrafficSimulationView | ( | WindowInterface *const | window,
 |  | QWidget * | parent = nullptr
 | ) |  |
explicit

Constructor which initialises all attributes, creates the ui object as well as the actions for the action menu and the status bar. Further, all the tab widget contents for editing the experiment, scenario and traffic are created.

Parameters
[in] | window | pointer to the window interface in order to register the view
[in] | parent | a parent widget

Definition at line 22 of file TrafficSimulationView.cpp.

24 : QWidget(parent)
25 , window(window)
26 , undoView(new QUndoView(this))
27 , actionMenuNew(WindowInterface::createAction(tr("Clear"), this, &TrafficSimulationView::actionNew))
28 , actionMenuLoad(WindowInterface::createAction(tr("Load"), this, &TrafficSimulationView::actionLoad))
29 , actionMenuSave(WindowInterface::createAction(tr("Save"), this, &TrafficSimulationView::actionSave))
30 , actionMenuUndo(WindowInterface::createAction(tr(""), this, &TrafficSimulationView::actionUndo))
31 , actionMenuRedo(WindowInterface::createAction(tr(""), this, &TrafficSimulationView::actionRedo))
32 , actionMenuHistory(WindowInterface::createAction(tr("Command History"),this, &TrafficSimulationView::actionHistory))
33 , ui(new Ui::TrafficSimulationView)
34 , statusbar(new StatusBarView(this))
35 {
36 ui->setupUi(this);
37
38 // Create the views
39
40 // 1. Experiment Base View
41 experimentBaseView = new ExperimentBaseView(this);
42 delete ui->experimentScrollArea->widget();
43 ui->experimentScrollArea->setWidget(experimentBaseView);
44
45 // 2. Environment View
46 environmentView = new EnvironmentView(this);
47 delete ui->environmentScrollArea->widget();
48 ui->environmentScrollArea->setWidget( environmentView );
49
50 // 3. Scenario View
51 scenarioView = new ScenarioView(this);
52 delete ui->scenarioScrollArea->widget();
53 ui->scenarioScrollArea->setWidget(scenarioView);
54
55 // 4. Traffic View
56 trafficView = new TrafficView(this);
57 delete ui->trafficScrollArea->widget();
58 ui->trafficScrollArea->setWidget(trafficView);
59
60 // 5. Insert status bar and hide it
61 ui->layout->insertWidget(2, statusbar,0);
62 statusbar->hide();
63
64 // Register view in window interface
65 window->add(ViewID,WindowInterface::createButton(tr("Scenario-based\nSimulation"), 0, 06000),this,{actionMenuNew, actionMenuLoad,actionMenuSave,
66 actionMenuUndo, actionMenuRedo, actionMenuHistory} );
67
68 // prepare undo view and undo/redo buttons
69 actionMenuRedo->setIcon(style()->standardIcon(QStyle::StandardPixmap::SP_ArrowRight));
70 actionMenuUndo->setIcon(style()->standardIcon(QStyle::StandardPixmap::SP_ArrowLeft));
71 actionMenuRedo->setToolTip("redo previous action");
72 actionMenuUndo->setToolTip("undo last action");
73 undoView->raise();
74 undoView->hide();
75
76
77 // adjust the positioning of the widgets according to the size of this view
78 adjustWidgets();
79 }
TrafficSimulationView::window
WindowInterface *const window
pointer to the window interface for registering this view
Definition: TrafficSimulationView.h:300
TrafficSimulationView::actionMenuUndo
WindowInterface::Action *const actionMenuUndo
The action menu object for undoing actions.
Definition: TrafficSimulationView.h:308
TrafficSimulationView::experimentBaseView
ExperimentBaseView * experimentBaseView
The container widget for the experiment configuration (to be put into the scroll area) ...
Definition: TrafficSimulationView.h:322
TrafficSimulationView::environmentView
EnvironmentView * environmentView
the view of the environment configuration
Definition: TrafficSimulationView.h:317
TrafficSimulationView::actionUndo
void actionUndo()
Slot which is triggered when the undo-button of the action menu has been clicked. Will trigger the un...
Definition: TrafficSimulationView.cpp:131
TrafficSimulationView::adjustWidgets
void adjustWidgets()
Method for adjusting the geometry and positioning of child widgets according to the geometry of this ...
Definition: TrafficSimulationView.cpp:146
TrafficSimulationView::undoView
QUndoView *const undoView
the view of the undo stack
Definition: TrafficSimulationView.h:302
TrafficSimulationView::actionMenuNew
WindowInterface::Action *const actionMenuNew
The action menu object for the creating a new worksheet.
Definition: TrafficSimulationView.h:305
WindowInterface::add
virtual void add(WindowInterface::ID const &id, WindowInterface::Button *const button, WindowInterface::Widget *const widget=nullptr, WindowInterface::Menu const &menu={})=0
Registers the Window View with the identifier id, including its selecting button, and its correspondi...
TrafficSimulationView::actionMenuRedo
WindowInterface::Action *const actionMenuRedo
The action menu object for redoing actions.
Definition: TrafficSimulationView.h:309
EnvironmentView
This class provides an editor for configuring the environment setup, i.e. it is filled with the conte...
Definition: EnvironmentView.h:43
TrafficSimulationView::ViewID
static const WindowInterface::ID ViewID
the view id under which this view is registered in the window interface
Definition: TrafficSimulationView.h:301
TrafficSimulationView::trafficView
TrafficView * trafficView
the view of the traffic configuration
Definition: TrafficSimulationView.h:319
WindowInterface::createButton
static WindowInterface::Button * createButton(WindowInterface::ButtonTitle const &title, WindowInterface::ButtonType const &type=0, WindowInterface::ButtonOrder const &order=-1)
Creates button for a Window View selection with the title title, of type type and located on the side...
Definition: WindowInterface.h:109
TrafficSimulationView::ui
Ui::TrafficSimulationView * ui
The ui object defining the components of the view.
Definition: TrafficSimulationView.h:313
TrafficSimulationView::actionRedo
void actionRedo()
Slot which is triggered when the redo-button of the action menu has been clicked. Will trigger the re...
Definition: TrafficSimulationView.cpp:126
TrafficSimulationView::actionMenuSave
WindowInterface::Action *const actionMenuSave
The action menu object for saving a slaveConfig file.
Definition: TrafficSimulationView.h:307
WindowInterface::createAction
static WindowInterface::Action * createAction(WindowInterface::ActionTitle const &title, Object object, Function function)
Creates button in the menu bar of the Window View object with the title title and associated to a cal...
Definition: WindowInterface.h:130
TrafficSimulationView::actionSave
void actionSave()
Slot which is triggered when the save-button of the action menu has been clicked. Prompts a file dial...
Definition: TrafficSimulationView.cpp:141
TrafficSimulationView::actionMenuHistory
WindowInterface::Action *const actionMenuHistory
The action menu object for showing the command history.
Definition: TrafficSimulationView.h:310
TrafficSimulationView::statusbar
StatusBarView * statusbar
the info bar object
Definition: TrafficSimulationView.h:314
ExperimentBaseView
This class provides a resizable container widget for the content of the experiment tab...
Definition: ExperimentBaseView.h:46
TrafficView
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content s...
Definition: TrafficView.h:43
TrafficSimulationView::actionHistory
void actionHistory()
Slot which is triggered when the command history button is clicked. Will show or hide the command his...
Definition: TrafficSimulationView.cpp:112
TrafficSimulationView::actionLoad
void actionLoad()
Slot which is triggered when the load-button of the action menu has been clicked. Prompts a file dial...
Definition: TrafficSimulationView.cpp:136
StatusBarView::hide
virtual void hide()
Reimplementation of hide. Sets the visible status of the text browser and the checked status of the b...
Definition: StatusBarView.cpp:51
ScenarioView
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content ...
Definition: ScenarioView.h:42
StatusBarView
This class defines a status bar.
Definition: StatusBarView.h:39
TrafficSimulationView::scenarioView
ScenarioView * scenarioView
the view of the scenario settings
Definition: TrafficSimulationView.h:318
TrafficSimulationView::actionNew
void actionNew()
Slot which is triggered when the new-button of the action menu has been clicked. Shows a warning dial...
Definition: TrafficSimulationView.cpp:94
TrafficSimulationView::actionMenuLoad
WindowInterface::Action *const actionMenuLoad
The action menu object for loading a slaveConfig file.
Definition: TrafficSimulationView.h:306

Member Function Documentation

◆ getEnvironmentDisplayView()

EnvironmentDisplayView * TrafficSimulationView::getEnvironmentDisplayView ( )

Method that returns the environment display widget (instance of EnvironmentDisplayView).

Returns
the environment display widget

Definition at line 167 of file TrafficSimulationView.cpp.

168 {
169 return experimentBaseView->getEnvironmentDisplayView();
170 }
TrafficSimulationView::experimentBaseView
ExperimentBaseView * experimentBaseView
The container widget for the experiment configuration (to be put into the scroll area) ...
Definition: TrafficSimulationView.h:322
ExperimentBaseView::getEnvironmentDisplayView
EnvironmentDisplayView * getEnvironmentDisplayView() const
Method which returns the widget displaying infos on the environment configuration.
Definition: ExperimentBaseView.cpp:40

◆ getEnvironmentView()

EnvironmentView * TrafficSimulationView::getEnvironmentView ( )

Method that returns the environment configuration widget (instance of EnvironmentView).

Returns
the environment configuration widget

Definition at line 162 of file TrafficSimulationView.cpp.

163 {
164 return environmentView;
165 }
TrafficSimulationView::environmentView
EnvironmentView * environmentView
the view of the environment configuration
Definition: TrafficSimulationView.h:317

◆ getExperimentView()

ExperimentView * TrafficSimulationView::getExperimentView ( )

Method that returns the experiment configuration widget (instance of ExperimentView).

Returns
the experiment configuration widget

Definition at line 157 of file TrafficSimulationView.cpp.

158 {
159 return experimentBaseView->getExperimentView();
160 }
ExperimentBaseView::getExperimentView
ExperimentView * getExperimentView() const
Method which returns the experiment configuration editor widget.
Definition: ExperimentBaseView.cpp:30
TrafficSimulationView::experimentBaseView
ExperimentBaseView * experimentBaseView
The container widget for the experiment configuration (to be put into the scroll area) ...
Definition: TrafficSimulationView.h:322

◆ getScenarioDisplayView()

ScenarioDisplayView * TrafficSimulationView::getScenarioDisplayView ( )

Method that returns the scenario display widget (instance of ScenarioDisplayView).

Returns
the scenario display widget

Definition at line 172 of file TrafficSimulationView.cpp.

173 {
174 return experimentBaseView->getScenarioDisplayView();
175 }
TrafficSimulationView::experimentBaseView
ExperimentBaseView * experimentBaseView
The container widget for the experiment configuration (to be put into the scroll area) ...
Definition: TrafficSimulationView.h:322
ExperimentBaseView::getScenarioDisplayView
ScenarioDisplayView * getScenarioDisplayView() const
Method which returns the widget displaying infos on the scenario configuration.
Definition: ExperimentBaseView.cpp:35

◆ getScenarioView()

ScenarioView * TrafficSimulationView::getScenarioView ( )

Method that returns the scenario configuration widget (instance of ScenarioView).

Returns
the scenario configuration widget

Definition at line 177 of file TrafficSimulationView.cpp.

178 {
179 return scenarioView;
180 }
TrafficSimulationView::scenarioView
ScenarioView * scenarioView
the view of the scenario settings
Definition: TrafficSimulationView.h:318

◆ getTrafficDisplayView()

TrafficDisplayView * TrafficSimulationView::getTrafficDisplayView ( )

Method that returns the traffic display widget (instance of TrafficDisplayView).

Returns
the traffic display widget

Definition at line 187 of file TrafficSimulationView.cpp.

188 {
189 return experimentBaseView->getTrafficDisplayView();
190 }
TrafficSimulationView::experimentBaseView
ExperimentBaseView * experimentBaseView
The container widget for the experiment configuration (to be put into the scroll area) ...
Definition: TrafficSimulationView.h:322
ExperimentBaseView::getTrafficDisplayView
TrafficDisplayView * getTrafficDisplayView() const
Method which returns the widget displaying infos on the traffic configuration.
Definition: ExperimentBaseView.cpp:45

◆ getTrafficView()

TrafficView * TrafficSimulationView::getTrafficView ( )

Method that returns the traffic configuration widget (instance of TrafficView).

Returns
the traffic configuration widget

Definition at line 182 of file TrafficSimulationView.cpp.

183 {
184 return trafficView;
185 }
TrafficSimulationView::trafficView
TrafficView * trafficView
the view of the traffic configuration
Definition: TrafficSimulationView.h:319

◆ getUndoView()

QUndoView * TrafficSimulationView::getUndoView ( )

Method that returns the undo view.

Returns
the undo view

Definition at line 152 of file TrafficSimulationView.cpp.

153 {
154 return undoView;
155 }
TrafficSimulationView::undoView
QUndoView *const undoView
the view of the undo stack
Definition: TrafficSimulationView.h:302

◆ on_tabWidget_currentChanged

void TrafficSimulationView::on_tabWidget_currentChanged ( int index )
slot

Slot, activated when the current tab has changed. Will emit the currentTabChanged signal transmitting the new tab index.

Parameters
[in] index the new tab index

Definition at line 89 of file TrafficSimulationView.cpp.

90 {
91 Q_EMIT currentTabChanged(index);
92 }
TrafficSimulationView::currentTabChanged
void currentTabChanged(int index)
Signal, emitted when the current tab has been changed. Transmits the index of the tab...

◆ profileCatalogueChanged

void TrafficSimulationView::profileCatalogueChanged ( )
signal

Signal, emitted when the profiles catalogue has been modified by the user.

Parameters
[in] filename the new filename of the profiles catalogue

◆ resizeEvent()

void TrafficSimulationView::resizeEvent ( QResizeEvent * event )
overrideprotectedvirtual

Reimplementation of the resize event. Triggers adjustWidgets in order to adjust the geometry of the child widgets when this view has been resized.

Parameters
[in] event the resize event (instance of Qt's QResizeEvent class)

Definition at line 193 of file TrafficSimulationView.cpp.

194 {
195 event->ignore();
196 adjustWidgets();
197 }
TrafficSimulationView::adjustWidgets
void adjustWidgets()
Method for adjusting the geometry and positioning of child widgets according to the geometry of this ...
Definition: TrafficSimulationView.cpp:146

◆ setProfileCatalogueError()

void TrafficSimulationView::setProfileCatalogueError ( QString const & message )

Method which sets an error message next the profile catalogue's line edit.

Parameters
[in] message the error message to be displayed

Definition at line 226 of file TrafficSimulationView.cpp.

227 {
228 ui->CatalogueError->setText(message);
229 }
TrafficSimulationView::ui
Ui::TrafficSimulationView * ui
The ui object defining the components of the view.
Definition: TrafficSimulationView.h:313

◆ setProfileCatalogueView()

void TrafficSimulationView::setProfileCatalogueView ( QString const & filename )

Method which sets the filename displayed in the profile catalogue's line edit to the one passed as an argument.

Parameters
[in] filename the filename to be displayed for the profile catalogue

Definition at line 210 of file TrafficSimulationView.cpp.

211 {
212 ui->ProfileCatalogue->setText(filename);
213 }
TrafficSimulationView::ui
Ui::TrafficSimulationView * ui
The ui object defining the components of the view.
Definition: TrafficSimulationView.h:313
The documentation for this class was generated from the following files:
  • TrafficSimulationView.h
  • TrafficSimulationView.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficSimulationView Member List

This is the complete list of members for TrafficSimulationView, including all inherited members.

actionHistory() | TrafficSimulationView | privateslot
actionLoad() | TrafficSimulationView | privateslot
actionMenuHistory | TrafficSimulationView | private
actionMenuLoad | TrafficSimulationView | private
actionMenuNew | TrafficSimulationView | private
actionMenuRedo | TrafficSimulationView | private
actionMenuSave | TrafficSimulationView | private
actionMenuUndo | TrafficSimulationView | private
actionNew() | TrafficSimulationView | privateslot
actionRedo() | TrafficSimulationView | privateslot
actionSave() | TrafficSimulationView | privateslot
actionUndo() | TrafficSimulationView | privateslot
adjustWidgets() | TrafficSimulationView |
currentTabChanged(int index) | TrafficSimulationView | signal
environmentView | TrafficSimulationView | private
experimentBaseView | TrafficSimulationView | private
getEnvironmentDisplayView() | TrafficSimulationView |
getEnvironmentView() | TrafficSimulationView |
getExperimentView() | TrafficSimulationView |
getScenarioDisplayView() | TrafficSimulationView |
getScenarioView() | TrafficSimulationView |
getTrafficDisplayView() | TrafficSimulationView |
getTrafficView() | TrafficSimulationView |
getUndoView() | TrafficSimulationView |
hideStatusBar() | TrafficSimulationView |
LoadSetup() | TrafficSimulationView | signal
NewSetup() | TrafficSimulationView | signal
on_CatalogueBrowse_clicked() | TrafficSimulationView | privateslot
on_CatalogueRefresh_clicked() | TrafficSimulationView | privateslot
on_tabWidget_currentChanged(int index) | TrafficSimulationView | slot
profileCatalogueChanged() | TrafficSimulationView | signal
Redo() | TrafficSimulationView | signal
refreshCatalogue() | TrafficSimulationView | signal
resizeEvent(QResizeEvent *event) override | TrafficSimulationView | protectedvirtual
SaveSetup() | TrafficSimulationView | signal
scenarioView | TrafficSimulationView | private
setProfileCatalogueError(QString const &message) | TrafficSimulationView |
setProfileCatalogueView(QString const &filename) | TrafficSimulationView |
showStatusBarText(QString text, StatusBarView::Color color) | TrafficSimulationView |
statusbar | TrafficSimulationView | private
TrafficSimulationView(WindowInterface *const window, QWidget *parent=nullptr) | TrafficSimulationView | explicit
trafficView | TrafficSimulationView | private
ui | TrafficSimulationView | private
Undo() | TrafficSimulationView | signal
undoView | TrafficSimulationView | private
ViewID | TrafficSimulationView | privatestatic
window | TrafficSimulationView | private
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationXMLBaseModel Class Reference

List of all members
TrafficSimulationXMLBaseModel Class Reference

This class defines the XML element names of the combination XML file. More...

Inheritance diagram for TrafficSimulationXMLBaseModel:
TrafficSimulationXMLLoadModel TrafficSimulationXMLSaveModel

Detailed Description

This class defines the XML element names of the combination XML file.

Further, it contains lists of subelements if an XML element has subelements. These lists are used to check that all required subelements are contained when loading a combination XML file.

Note
Since this class contains a variety QStrings with the XML element names, we refrain from a detailed documentation of the class attributes. Looking at the .cpp files, it should be immediately clear what the variables contains.

Definition at line 41 of file TrafficSimulationXMLBaseModel.h.

The documentation for this class was generated from the following files:
  • TrafficSimulationXMLBaseModel.h
  • TrafficSimulationXMLBaseModel.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficSimulationXMLBaseModel Member List

This is the complete list of members for TrafficSimulationXMLBaseModel, including all inherited members.

Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationXMLLoadModel Class Reference

Static Public Member Functions | List of all members
TrafficSimulationXMLLoadModel Class Reference

This class provides routines for loading the combination XML file and for storing all information in the corresponding instances of the model classes. More...

Inheritance diagram for TrafficSimulationXMLLoadModel:
TrafficSimulationXMLBaseModel

Static Public Member Functions

static bool | load (const QString &filepath, TrafficSimulationInterface *const trafficSimulation)
This method manages the whole loading process and calls the subroutines for loading the particular sections of the slaveConfig XML file. This routine opens the submitted file and connects it to an QXmlStreamReader instance. More...
static bool | loadEnvironment (QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all xml elements connected to <EnvironmentConfig> from the combination xml file and stores the corresponding values in in the given EnvironmentInterface instance. More...
static bool | loadExperiment (QXmlStreamReader &xml, ExperimentInterface *experiment)
This method reads all xml elements connected to <ExperimentConfig> from the slaveConfig xml file and stores the corresponding values in in the given ExperimentInterface instance. More...
static bool | loadFrictionMap (QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all friction coefficinets from the combination xml file and stores their values and probabilities. More...
static bool | loadLibraries (QXmlStreamReader &xml, ExperimentInterface::Libraries *const libraries)
This method reads all xml elements of <Libraries> within the <ExperimentConfig> element. These correspond to the libraries needed by the simulation slave. More...
static bool | loadLoggingGroups (QXmlStreamReader &xml, ExperimentInterface::LoggingGroups *const loggingGroups)
This method reads all xml elements of <LoggingGroups> within the <ExperimentConfig> element. More...
static bool | loadScenarioConfig (QXmlStreamReader &xml, ScenarioInterface *scenario)
This method reads all xml elements connected to <ScenarioConfig> from the combination xml file. This comprises the scenario name, the open scenario file and all scenario agents. For the latter, the subroutine #loadScenarioAgents is used. The corresponding values are stored in the given instance of ScenarioInterface. More...
static bool | loadTimeOfDayMap (QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all time of day entries from the combination xml file and stores their values and probabilities. More...
static bool | loadTraffic (QXmlStreamReader &xml, TrafficInterface *traffic)
This method reads all xml elements connected to <TrafficConfig> from the combination xml file and stores their values in the given TrafficInterface instance. This comprises all traffic parameters and the agents on the regular and rightmost lanes. More...
static bool | loadTrafficAgents (QXmlStreamReader &xml, TrafficItemMapInterface *agents)
This method reads all agent profiles from the combination xml file and stores their names and probabilities in the given map. More...
static bool | loadTrafficHomogeneities (QXmlStreamReader &xml, TrafficItemMapInterface *homogeneities)
This method reads all homogeneities, being subelements of <TrafficParameters>, from the combination xml file and stores their values and probabilities in the given map. More...
static bool | loadTrafficParameters (QXmlStreamReader &xml, TrafficInterface *traffic)
This method reads all xml elements connected to <TrafficParameters> from the combination xml file and stores their values in the given TrafficInterface instance. This comprises the traffic volumes, platoon rates, velocities and homogeneities, each loaded in a separate subroutine. More...
static bool | loadTrafficPlatoonRates (QXmlStreamReader &xml, TrafficItemMapInterface *platoonRates)
This method reads all platoon rates, being subelements of <TrafficParameters>, from the combination xml file and stores their values and probabilities in the given map. More...
static bool | loadTrafficVelocities (QXmlStreamReader &xml, TrafficItemMapInterface *velocities)
This method reads all velocities, being subelements of <TrafficParameters>, from the combination xml file and stores their values and probabilities in the given map. More...
static bool | loadTrafficVolumes (QXmlStreamReader &xml, TrafficItemMapInterface *volumes)
This method reads all traffic volumes, being subelements of <TrafficParameters>, from the combination xml file and stores their values and probabilities in the given map. More...
static bool | loadVisibilityDistanceMap (QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all visibility distances from the combination xml file and stores their values and probabilities.. More...
static bool | loadWeatherMap (QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all weather entries from the combination xml file and stores their values and probabilities. More...

Detailed Description

This class provides routines for loading the combination XML file and for storing all information in the corresponding instances of the model classes.

The loading and the corrsponding routines strictly follow the structure of the corresponding combination XML file. In the general structure of such a loading method, a loop over all xml subelements within the given xml element is incorporated During this loop, the loaded subelement names are compared to the keywords defined in TrafficSimulationXMLBaseModel. In case of a match, the corresponding element text is read and the information is stored in the proper attribute of the configuration object. Unknown xml elements are generally skipped. Further, it is checked whether all required elements are listed in the file. If not, the routine returns "false", otherwise "true". In order to check for xml rules, the QXmlStreamReader class is used for parsing.

Definition at line 52 of file TrafficSimulationXMLLoadModel.h.

Member Function Documentation

◆ load()

bool TrafficSimulationXMLLoadModel::load | ( | const QString & | filepath,
 |  | TrafficSimulationInterface *const | trafficSimulation
 | ) |  |
static

This method manages the whole loading process and calls the subroutines for loading the particular sections of the slaveConfig XML file. This routine opens the submitted file and connects it to an QXmlStreamReader instance.

Parameters
[in] | filepath | the filepath of the combination xml file
[in] | trafficSimulation | pointer to the traffic simulation interface for storing the loaded configuration
[in] | agents | pointer to the agent map of the agent configuration plugin
Returns
"true" if given filepath can be opened and all loading subroutines finished successfully. "false" otherwise

Definition at line 13 of file TrafficSimulationXMLLoadModel.cpp.

15 {
16
17 QFile file(filepath);
18 bool success = true;
19
20 if(file.open(QIODevice::ReadOnly | QIODevice::Text))
21 {
22 QXmlStreamReader xml(&file);
23
24 //verify Root element
25 xml.readNextStartElement();
26
27 if(xml.name() != KeyRoot)
28 return false;
29
30 // set the Profiles catalogue and generate agents list
31 xml.readNextStartElement();
32 if(xml.name() == KeyProfilesCatalogue)
33 {
34 TrafficSimulationInterface::ProfilesCatalogue catalogue = xml.readElementText();
35 trafficSimulation->setProfilesCatalogue(catalogue);
36 }
37 else
38 return false;
39
40 while(xml.readNextStartElement())
41 {
42 if(xml.name() == KeyExperiment)
43 success = loadExperiment(xml,trafficSimulation->getExperiment()) && success;
44 else if (xml.name() == KeyEnvironment )
45 {
46 trafficSimulation->getEnvironment()->setName(xml.attributes().value("Name").toString());
47 success = loadEnvironment(xml, trafficSimulation->getEnvironment()) && success;
48 }
49 else if(xml.name() == KeyScenario)
50 {
51 trafficSimulation->getScenario()->setName(xml.attributes().value("Name").toString());
52 success = loadScenarioConfig(xml, trafficSimulation->getScenario()) && success;
53 }
54 else if(xml.name() == KeyTraffic)
55 {
56 trafficSimulation->getTraffic()->setName(xml.attributes().value("Name").toString());
57 success = loadTraffic(xml, trafficSimulation->getTraffic());
58 }
59 else
60 xml.skipCurrentElement();
61 }
62
63 return success;
64 }
65
66 return false;
67 }
TrafficSimulationInterface::getTraffic
virtual TrafficInterface * getTraffic() const =0
Returns the pointer to the traffic configuration object, i.e. an instance of the TrafficInterface cla...
ScenarioInterface::setName
virtual void setName(Name const &newName)=0
Sets the name of the scenario to the given name.
TrafficSimulationXMLLoadModel::loadTraffic
static bool loadTraffic(QXmlStreamReader &xml, TrafficInterface *traffic)
This method reads all xml elements connected to <TrafficConfig> from the combination xml file and sto...
Definition: TrafficSimulationXMLLoadModel.cpp:397
TrafficSimulationXMLLoadModel::loadExperiment
static bool loadExperiment(QXmlStreamReader &xml, ExperimentInterface *experiment)
This method reads all xml elements connected to <ExperimentConfig> from the slaveConfig xml file and ...
Definition: TrafficSimulationXMLLoadModel.cpp:110
TrafficSimulationXMLLoadModel::loadScenarioConfig
static bool loadScenarioConfig(QXmlStreamReader &xml, ScenarioInterface *scenario)
This method reads all xml elements connected to <ScenarioConfig> from the combination xml file...
Definition: TrafficSimulationXMLLoadModel.cpp:316
TrafficSimulationInterface::setProfilesCatalogue
virtual void setProfilesCatalogue(ProfilesCatalogue const &_profilesCatalogue)=0
Sets the current profiles catalogue to the one passed as an argument.
TrafficInterface::setName
virtual void setName(Name const &_name)=0
Sets the name of the traffic setup to the one passed as an argument.
TrafficSimulationInterface::getEnvironment
virtual EnvironmentInterface * getEnvironment() const =0
Returns the pointer to the environment configuration object, i.e. an instance of the EnvironmentInter...
TrafficSimulationInterface::getExperiment
virtual ExperimentInterface * getExperiment() const =0
Returns the pointer to the experiment configuration object, i.e. an instance of the ExperimentInterfa...
TrafficSimulationXMLLoadModel::loadEnvironment
static bool loadEnvironment(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all xml elements connected to <EnvironmentConfig> from the combination xml file and...
Definition: TrafficSimulationXMLLoadModel.cpp:174
EnvironmentInterface::setName
virtual void setName(Name const &_name)=0
Sets the name of the environment configuration to the one passed as an argument.
TrafficSimulationInterface::getScenario
virtual ScenarioInterface * getScenario() const =0
Returns the pointer to the scenario configuration object, i.e. an instance of the ScenarioInterface c...

◆ loadEnvironment()

bool TrafficSimulationXMLLoadModel::loadEnvironment | ( | QXmlStreamReader & | xml,
 |  | EnvironmentInterface * | environment
 | ) |  |
static

This method reads all xml elements connected to <EnvironmentConfig> from the combination xml file and stores the corresponding values in in the given EnvironmentInterface instance.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | experiment | the EnvironmentInterface instance in which values are stored
Returns
"true", if all necessary xml elements have been read, otherwise "false"

Definition at line 174 of file TrafficSimulationXMLLoadModel.cpp.

176 {
177 bool success = true;
178 QList<QString> keys = KeyListEnvironment;
179
180 while(xml.readNextStartElement())
181 {
182
183 keys.removeAll(xml.name().toString());
184
185 if(xml.name() == KeyTimeOfDayMap)
186 success = loadTimeOfDayMap(xml, environment) && success;
187
188 else if(xml.name() == KeyVisibilityDistanceMap)
189 success = loadVisibilityDistanceMap(xml,environment) && success;
190
191 else if(xml.name() == KeyFrictionMap)
192 success = loadFrictionMap(xml, environment) && success;
193
194 else if(xml.name() == KeyWeatherMap)
195 success = loadWeatherMap(xml, environment) && success;
196
197 else
198 xml.skipCurrentElement();
199 }
200
201 return success && keys.isEmpty();
202 }
TrafficSimulationXMLLoadModel::loadWeatherMap
static bool loadWeatherMap(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all weather entries from the combination xml file and stores their values and proba...
Definition: TrafficSimulationXMLLoadModel.cpp:288
TrafficSimulationXMLLoadModel::loadVisibilityDistanceMap
static bool loadVisibilityDistanceMap(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all visibility distances from the combination xml file and stores their values and ...
Definition: TrafficSimulationXMLLoadModel.cpp:232
TrafficSimulationXMLLoadModel::loadFrictionMap
static bool loadFrictionMap(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all friction coefficinets from the combination xml file and stores their values and...
Definition: TrafficSimulationXMLLoadModel.cpp:260
TrafficSimulationXMLLoadModel::loadTimeOfDayMap
static bool loadTimeOfDayMap(QXmlStreamReader &xml, EnvironmentInterface *environment)
This method reads all time of day entries from the combination xml file and stores their values and p...
Definition: TrafficSimulationXMLLoadModel.cpp:204

◆ loadExperiment()

bool TrafficSimulationXMLLoadModel::loadExperiment | ( | QXmlStreamReader & | xml,
 |  | ExperimentInterface * | experiment
 | ) |  |
static

This method reads all xml elements connected to <ExperimentConfig> from the slaveConfig xml file and stores the corresponding values in in the given ExperimentInterface instance.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | experiment | the ExperimentInterface instance in which values are stored
Returns
"true", if all necessary xml elements have been read, otherwise "false"

Definition at line 110 of file TrafficSimulationXMLLoadModel.cpp.

112 {
113 bool success = true;
114 QList <QString> elements = KeyListExperiment;
115
116 while(xml.readNextStartElement())
117 {
118 if(xml.name() == KeyExperimentID)
119 {
120 xml.skipCurrentElement();
121 elements.removeAll(KeyExperimentID);
122 }
123 else if(xml.name()==KeyExperimentNumberInvocations)
124 {
125 experiment->setNumberInvocations(xml.readElementText().toInt());
126 elements.removeAll(KeyExperimentNumberInvocations);
127 }
128 else if(xml.name()==KeyExperimentSeed)
129 {
130 experiment->setSeed(xml.readElementText().toInt());
131 elements.removeAll(KeyExperimentSeed);
132 }
133 else if(xml.name() == KeyExperimentLibraries)
134 {
135 success = loadLibraries(xml, experiment->getLibraries()) && success;
136 elements.removeAll(KeyExperimentLibraries);
137 }
138 else if(xml.name() == KeyExperimentLoggingGroups)
139 {
140 success = loadLoggingGroups(xml, experiment->getLoggingGroups()) && success;
141 elements.removeAll(KeyExperimentLoggingGroups);
142 }
143 else
144 xml.skipCurrentElement();
145 }
146
147 return elements.isEmpty() && success;
148
149 }
ExperimentInterface::getLoggingGroups
virtual LoggingGroups * getLoggingGroups() const =0
Returns the pointer to the list of Logging Groups.
ExperimentInterface::getLibraries
virtual Libraries * getLibraries() const =0
Returns the pointer to the Libraries map.
TrafficSimulationXMLLoadModel::loadLibraries
static bool loadLibraries(QXmlStreamReader &xml, ExperimentInterface::Libraries *const libraries)
This method reads all xml elements of <Libraries> within the <ExperimentConfig> element. These correspond to the libraries needed by the simulation slave.
Definition: TrafficSimulationXMLLoadModel.cpp:151
ExperimentInterface::setNumberInvocations
virtual void setNumberInvocations(NumberInvocations const &_numberInvocations)=0
Sets the number of invocations of the experiment.
TrafficSimulationXMLLoadModel::loadLoggingGroups
static bool loadLoggingGroups(QXmlStreamReader &xml, ExperimentInterface::LoggingGroups *const loggingGroups)
This method reads all xml elements of <LoggingGroups> within the <ExperimentConfig> element...
Definition: TrafficSimulationXMLLoadModel.cpp:160
ExperimentInterface::setSeed
virtual void setSeed(Seed const &_seed)=0
Sets the seed used for random number generation.

◆ loadFrictionMap()

bool TrafficSimulationXMLLoadModel::loadFrictionMap | ( | QXmlStreamReader & | xml,
 |  | EnvironmentInterface * | environment
 | ) |  |
static

This method reads all friction coefficinets from the combination xml file and stores their values and probabilities.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | environment | the pointer to the environment configuration, i.e. the instance of EnvironmentInterface
Returns
"true", if all listed xml elements are of type "Friction", otherwise "false"

Definition at line 260 of file TrafficSimulationXMLLoadModel.cpp.

261 {
262
263 while(xml.readNextStartElement())
264 {
265
266 if(xml.name() == KeyFriction )
267 {
268 EnvironmentItemInterface * item = environment->createItem(xml.attributes().value("Value").toString(),
269 xml.attributes().value("Probability").toDouble());
270
271 EnvironmentInterface::ID id = (environment->getFrictionMap()->isEmpty()) ?
272 1 : environment->getFrictionMap()->lastKey() + 1;
273
274 environment->getFrictionMap()->insert(id, item);
275
276 xml.readElementText();
277 }
278 else
279 {
280 xml.skipCurrentElement();
281 return false;
282 }
283 }
284
285 return true;
286 }
EnvironmentInterface::ID
unsigned int ID
A key identifier for the map of environment items.
Definition: EnvironmentInterface.h:54
EnvironmentInterface::getFrictionMap
virtual FrictionMap * getFrictionMap() const =0
Returns a pointer to the map of friction coefficients.
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentInterface::createItem
virtual Item * createItem(Item::Value const &value, Item::Probability const &probability)=0
Creates an environmental parameter (i.e. an instance of EnvironmentItemInterface) with the given valu...

◆ loadLibraries()

bool TrafficSimulationXMLLoadModel::loadLibraries | ( | QXmlStreamReader & | xml,
 |  | ExperimentInterface::Libraries *const | libraries
 | ) |  |
static

This method reads all xml elements of <Libraries> within the <ExperimentConfig> element. These correspond to the libraries needed by the simulation slave.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | libraries | the pointer to the libraries map
Returns
so far always "true"

Definition at line 151 of file TrafficSimulationXMLLoadModel.cpp.

153 {
154 while (xml.readNextStartElement())
155 libraries->insert(xml.name().toString(), xml.readElementText());
156
157 return true;
158 }

◆ loadLoggingGroups()

bool TrafficSimulationXMLLoadModel::loadLoggingGroups | ( | QXmlStreamReader & | xml,
 |  | ExperimentInterface::LoggingGroups *const | loggingGroups
 | ) |  |
static

This method reads all xml elements of <LoggingGroups> within the <ExperimentConfig> element.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | libraries | the pointer to the list of logging groups
Returns
"true", if all read xml elements are named "LoggingGroup", "false", othewise.

Definition at line 160 of file TrafficSimulationXMLLoadModel.cpp.

162 {
163 while(xml.readNextStartElement())
164 {
165 if(xml.name() == KeyExperimentLoggingGroup)
166 loggingGroups->append(xml.readElementText());
167 else
168 return false;
169 }
170
171 return true;
172 }

◆ loadScenarioConfig()

bool TrafficSimulationXMLLoadModel::loadScenarioConfig | ( | QXmlStreamReader & | xml,
 |  | ScenarioInterface * | scenario
 | ) |  |
static

This method reads all xml elements connected to <ScenarioConfig> from the combination xml file. This comprises the scenario name, the open scenario file and all scenario agents. For the latter, the subroutine #loadScenarioAgents is used. The corresponding values are stored in the given instance of ScenarioInterface.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | scenario | the ScenarioInterface instance in which values are stored
Returns
"true", if all necessary xml elements have been read and if the loading routine for scenario agents was successful. Otherwise "false"

Definition at line 316 of file TrafficSimulationXMLLoadModel.cpp.

317 {
318
319 bool success = true;
320 QList<QString> keys = KeyListScenario;
321
322 while(xml.readNextStartElement())
323 {
324 if(xml.name() == KeyScenarioFile)
325 {
326 scenario->setScenarioFile(xml.readElementText());
327 keys.removeAll(KeyScenarioFile);
328 }
329 }
330
331 return keys.isEmpty() && success;
332 }
ScenarioInterface::setScenarioFile
virtual void setScenarioFile(ScenarioFile const &filename)=0
Sets the filename of the open scenario file to the one passed as an argument.

◆ loadTimeOfDayMap()

bool TrafficSimulationXMLLoadModel::loadTimeOfDayMap | ( | QXmlStreamReader & | xml,
 |  | EnvironmentInterface * | environment
 | ) |  |
static

This method reads all time of day entries from the combination xml file and stores their values and probabilities.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | environment | the pointer to the environment configuration, i.e. the instance of EnvironmentInterface
Returns
"true", if all listed xml elements are of type "TimeOfDay", otherwise "false"

Definition at line 204 of file TrafficSimulationXMLLoadModel.cpp.

205 {
206
207 while(xml.readNextStartElement())
208 {
209
210 if(xml.name() == KeyTimeOfDay )
211 {
212 EnvironmentItemInterface * item = environment->createItem(xml.attributes().value("Value").toString(),
213 xml.attributes().value("Probability").toDouble());
214
215 EnvironmentInterface::ID id = (environment->getTimeOfDayMap()->isEmpty()) ?
216 1 : environment->getTimeOfDayMap()->lastKey() + 1;
217
218 environment->getTimeOfDayMap()->insert(id, item);
219
220 xml.readElementText();
221 }
222 else
223 {
224 xml.skipCurrentElement();
225 return false;
226 }
227 }
228
229 return true;
230 }
EnvironmentInterface::ID
unsigned int ID
A key identifier for the map of environment items.
Definition: EnvironmentInterface.h:54
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentInterface::createItem
virtual Item * createItem(Item::Value const &value, Item::Probability const &probability)=0
Creates an environmental parameter (i.e. an instance of EnvironmentItemInterface) with the given valu...
EnvironmentInterface::getTimeOfDayMap
virtual TimeOfDayMap * getTimeOfDayMap() const =0
Returns a pointer to the time of day parameter map.

◆ loadTraffic()

bool TrafficSimulationXMLLoadModel::loadTraffic | ( | QXmlStreamReader & | xml,
 |  | TrafficInterface * | traffic
 | ) |  |
static

This method reads all xml elements connected to <TrafficConfig> from the combination xml file and stores their values in the given TrafficInterface instance. This comprises all traffic parameters and the agents on the regular and rightmost lanes.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | traffic | the TrafficInterface instance in which value are stored
[in] | configAgents | the agents map of the Agent Configuration Plugin
Returns
"true", if all necessary traffic elements have been loaded with success, otherwise "false"

Definition at line 397 of file TrafficSimulationXMLLoadModel.cpp.

398 {
399 bool success = true;
400 QList<QString> keys = KeyListTraffic;
401
402 while(xml.readNextStartElement())
403 {
404
405 keys.removeAll(xml.name().toString());
406
407 if(xml.name() == KeyTrafficParameters)
408 success = loadTrafficParameters(xml, traffic) && success;
409
410 else if(xml.name() == KeyTrafficRegularLane)
411 success = loadTrafficAgents(xml, traffic->getAgentsRegularLane()) && success;
412
413 else if(xml.name() == KeyTrafficRightmostLane)
414 success = loadTrafficAgents(xml, traffic->getAgentsRightMostLane()) && success;
415 else
416 xml.skipCurrentElement();
417 }
418
419 return success && keys.isEmpty();
420 }
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
TrafficSimulationXMLLoadModel::loadTrafficParameters
static bool loadTrafficParameters(QXmlStreamReader &xml, TrafficInterface *traffic)
This method reads all xml elements connected to <TrafficParameters> from the combination xml file and...
Definition: TrafficSimulationXMLLoadModel.cpp:422
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
TrafficSimulationXMLLoadModel::loadTrafficAgents
static bool loadTrafficAgents(QXmlStreamReader &xml, TrafficItemMapInterface *agents)
This method reads all agent profiles from the combination xml file and stores their names and probabi...
Definition: TrafficSimulationXMLLoadModel.cpp:559

◆ loadTrafficAgents()

bool TrafficSimulationXMLLoadModel::loadTrafficAgents | ( | QXmlStreamReader & | xml,
 |  | TrafficItemMapInterface * | agents
 | ) |  |
static

This method reads all agent profiles from the combination xml file and stores their names and probabilities in the given map.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | agents | the agents map in which profiles are stored. An instance of TrafficItemMapInterface with the datatype "QString"
Returns
"true", if all listed xml elements are of type "AgentProfile" and if agent profile exists in the agents map of the Agent Configuration Plugin. Otherwise "false"

Definition at line 559 of file TrafficSimulationXMLLoadModel.cpp.

560 {
561 while(xml.readNextStartElement())
562 {
563 if(xml.name()==KeyTrafficAgent)
564 {
565 TrafficItemMapInterface::ID id = agents->generateID();
566 agents->add(id, 0, "");
567 TrafficItemInterface* agent = agents->getItem(id);
568
569
570 agent->setValue(xml.attributes().value("Name").toString());
571 agent->setProbability(xml.attributes().value("Probability").toDouble());
572
573 xml.readElementText();
574 }
575 else
576 {
577 xml.skipCurrentElement();
578 return false;
579 }
580 }
581
582 return true;
583 }
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficItemMapInterface::generateID
virtual TrafficItemMapInterface::ID generateID() const =0
Method which returns the highest unoccupied ID of the map.
TrafficItemMapInterface::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0
Method which creates a traffic item and registers it under the ID passed as a first argument...
TrafficItemInterface::setValue
virtual void setValue(Value const &_value)=0
Sets the traffic item&#39;s value to the value passed as an argument.

◆ loadTrafficHomogeneities()

bool TrafficSimulationXMLLoadModel::loadTrafficHomogeneities | ( | QXmlStreamReader & | xml,
 |  | TrafficItemMapInterface * | homogeneities
 | ) |  |
static

This method reads all homogeneities, being subelements of <TrafficParameters>, from the combination xml file and stores their values and probabilities in the given map.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | homogenieites | the homogeneities map, i.e. an instance of TrafficItemMapInterface with the datatype "double"
Returns
"true", if all listed xml elements are of type "Homogeneity", otherwise "false"

Definition at line 533 of file TrafficSimulationXMLLoadModel.cpp.

534 {
535
536 while(xml.readNextStartElement())
537 {
538 if(xml.name() == KeyTrafficHomogeneity )
539 {
540 TrafficItemMapInterface::ID id = homogeneities->generateID();
541 homogeneities->add(id,0, "");
542 TrafficItemInterface* homogeneity = homogeneities->getItem(id);
543
544 homogeneity->setValue(xml.attributes().value("Value").toString());
545 homogeneity->setProbability(xml.attributes().value("Probability").toDouble());
546
547 xml.readElementText();
548 }
549 else
550 {
551 xml.skipCurrentElement();
552 return false;
553 }
554 }
555 return true;
556 }
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficItemMapInterface::generateID
virtual TrafficItemMapInterface::ID generateID() const =0
Method which returns the highest unoccupied ID of the map.
TrafficItemMapInterface::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0
Method which creates a traffic item and registers it under the ID passed as a first argument...
TrafficItemInterface::setValue
virtual void setValue(Value const &_value)=0
Sets the traffic item&#39;s value to the value passed as an argument.

◆ loadTrafficParameters()

bool TrafficSimulationXMLLoadModel::loadTrafficParameters | ( | QXmlStreamReader & | xml,
 |  | TrafficInterface * | traffic
 | ) |  |
static

This method reads all xml elements connected to <TrafficParameters> from the combination xml file and stores their values in the given TrafficInterface instance. This comprises the traffic volumes, platoon rates, velocities and homogeneities, each loaded in a separate subroutine.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | traffic | the TrafficInterface instance in which value are stored
Returns
"true", if all necessary traffic parameters are covered by the combination xml and the loading subroutines finished with success. Otherwise "false"

Definition at line 422 of file TrafficSimulationXMLLoadModel.cpp.

423 {
424 bool success = true;
425 QList<QString> keys = KeyListTrafficParameters;
426
427 while(xml.readNextStartElement())
428 {
429 keys.removeAll(xml.name().toString());
430
431 if(xml.name() == KeyTrafficVolumes)
432 success = loadTrafficVolumes(xml, traffic->getVolumes()) && success;
433
434 else if (xml.name() == KeyTrafficPlatoonRates)
435 success = loadTrafficPlatoonRates(xml, traffic->getPlatoonRates()) && success;
436
437 else if (xml.name() == KeyTrafficVelocities)
438 success = loadTrafficVelocities(xml, traffic->getVelocities()) && success;
439
440 else if (xml.name() == KeyTrafficHomogeneities)
441 success = loadTrafficHomogeneities(xml, traffic->getHomogeneities()) && success;
442
443 else
444 xml.skipCurrentElement();
445 }
446
447 return success && keys.isEmpty();
448 }
TrafficSimulationXMLLoadModel::loadTrafficPlatoonRates
static bool loadTrafficPlatoonRates(QXmlStreamReader &xml, TrafficItemMapInterface *platoonRates)
This method reads all platoon rates, being subelements of <TrafficParameters>, from the combination x...
Definition: TrafficSimulationXMLLoadModel.cpp:477
TrafficInterface::getVelocities
virtual Velocities * getVelocities() const =0
Returns the map for registering velocities.
TrafficInterface::getVolumes
virtual Volumes * getVolumes() const =0
Returns the map for registering traffic volumes.
TrafficInterface::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const =0
Returns the map for registering platoon rates.
TrafficInterface::getHomogeneities
virtual Homogeneities * getHomogeneities() const =0
Returns the map for registering homogeneities.
TrafficSimulationXMLLoadModel::loadTrafficHomogeneities
static bool loadTrafficHomogeneities(QXmlStreamReader &xml, TrafficItemMapInterface *homogeneities)
This method reads all homogeneities, being subelements of <TrafficParameters>, from the combination x...
Definition: TrafficSimulationXMLLoadModel.cpp:533
TrafficSimulationXMLLoadModel::loadTrafficVelocities
static bool loadTrafficVelocities(QXmlStreamReader &xml, TrafficItemMapInterface *velocities)
This method reads all velocities, being subelements of <TrafficParameters>, from the combination xml ...
Definition: TrafficSimulationXMLLoadModel.cpp:504
TrafficSimulationXMLLoadModel::loadTrafficVolumes
static bool loadTrafficVolumes(QXmlStreamReader &xml, TrafficItemMapInterface *volumes)
This method reads all traffic volumes, being subelements of <TrafficParameters>, from the combination...
Definition: TrafficSimulationXMLLoadModel.cpp:450

◆ loadTrafficPlatoonRates()

bool TrafficSimulationXMLLoadModel::loadTrafficPlatoonRates | ( | QXmlStreamReader & | xml,
 |  | TrafficItemMapInterface * | platoonRates
 | ) |  |
static

This method reads all platoon rates, being subelements of <TrafficParameters>, from the combination xml file and stores their values and probabilities in the given map.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | platoonRates | the platoon rates map, i.e. an instance of TrafficItemMapInterface with the datatype "double"
Returns
"true", if all listed xml elements are of type "PlatoonRate", otherwise "false"

Definition at line 477 of file TrafficSimulationXMLLoadModel.cpp.

478 {
479
480 while(xml.readNextStartElement())
481 {
482 if(xml.name() == KeyTrafficPlatoonRate )
483 {
484 TrafficItemMapInterface::ID id = platoonRates->generateID();
485 platoonRates->add(id,0, "");
486 TrafficItemInterface * platoonRate = platoonRates->getItem(id);
487
488 platoonRate->setValue(xml.attributes().value("Value").toString());
489 platoonRate->setProbability(xml.attributes().value("Probability").toDouble());
490
491 xml.readElementText();
492 }
493 else
494 {
495 xml.skipCurrentElement();
496 return false;
497 }
498 }
499
500 return true;
501
502 }
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficItemMapInterface::generateID
virtual TrafficItemMapInterface::ID generateID() const =0
Method which returns the highest unoccupied ID of the map.
TrafficItemMapInterface::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0
Method which creates a traffic item and registers it under the ID passed as a first argument...
TrafficItemInterface::setValue
virtual void setValue(Value const &_value)=0
Sets the traffic item&#39;s value to the value passed as an argument.

◆ loadTrafficVelocities()

bool TrafficSimulationXMLLoadModel::loadTrafficVelocities | ( | QXmlStreamReader & | xml,
 |  | TrafficItemMapInterface * | velocities
 | ) |  |
static

This method reads all velocities, being subelements of <TrafficParameters>, from the combination xml file and stores their values and probabilities in the given map.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | velocities | the velocities map, i.e. an instance of TrafficItemMapInterface with the datatype "double"
Returns
"true", if all listed xml elements are of type "Velocity", otherwise "false"

Definition at line 504 of file TrafficSimulationXMLLoadModel.cpp.

505 {
506
507 while(xml.readNextStartElement())
508 {
509
510 if(xml.name() == KeyTrafficVelocity )
511 {
512 TrafficItemMapInterface::ID id = velocities->generateID();
513 velocities->add(id,0, "");
514 TrafficItemInterface* velocity = velocities->getItem(id);
515
516 velocity->setValue(xml.attributes().value("Value").toString());
517 velocity->setProbability(xml.attributes().value("Probability").toDouble());
518
519 xml.readElementText();
520 }
521 else
522 {
523 xml.skipCurrentElement();
524 return false;
525 }
526 }
527 return true;
528
529 }
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficItemMapInterface::generateID
virtual TrafficItemMapInterface::ID generateID() const =0
Method which returns the highest unoccupied ID of the map.
TrafficItemMapInterface::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0
Method which creates a traffic item and registers it under the ID passed as a first argument...
TrafficItemInterface::setValue
virtual void setValue(Value const &_value)=0
Sets the traffic item&#39;s value to the value passed as an argument.

◆ loadTrafficVolumes()

bool TrafficSimulationXMLLoadModel::loadTrafficVolumes | ( | QXmlStreamReader & | xml,
 |  | TrafficItemMapInterface * | volumes
 | ) |  |
static

This method reads all traffic volumes, being subelements of <TrafficParameters>, from the combination xml file and stores their values and probabilities in the given map.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | volumes | the volumes map, i.e. an instance of TrafficItemMapInterface with the datatype "int"
Returns
"true", if all listed xml elements are of type "Volume", otherwise "false"

Definition at line 450 of file TrafficSimulationXMLLoadModel.cpp.

451 {
452
453 while(xml.readNextStartElement())
454 {
455
456 if(xml.name() == KeyTrafficVolume )
457 {
458 TrafficItemMapInterface::ID id = volumes->generateID();
459 volumes->add(id,0.0, "");
460 TrafficItemInterface* volume = volumes->getItem(id);
461
462 volume->setValue(xml.attributes().value("Value").toString());
463 volume->setProbability(xml.attributes().value("Probability").toDouble());
464
465 xml.readElementText();
466 }
467 else
468 {
469 xml.skipCurrentElement();
470 return false;
471 }
472 }
473
474 return true;
475 }
TrafficItemMapInterface::ID
unsigned int ID
The key identifier (ID)
Definition: TrafficItemMapInterface.h:38
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemInterface::setProbability
virtual void setProbability(Probability const &_probability)=0
Sets the probability of the traffic item&#39;s occurence.
TrafficItemMapInterface::getItem
virtual TrafficItemMapInterface::Item * getItem(TrafficItemMapInterface::ID const &id) const =0
Method which returns the traffic item registered under the given ID. If there is no such item in the ...
TrafficItemMapInterface::generateID
virtual TrafficItemMapInterface::ID generateID() const =0
Method which returns the highest unoccupied ID of the map.
TrafficItemMapInterface::add
virtual bool add(TrafficItemMapInterface::ID const &id, TrafficItemInterface::Probability const &probability, TrafficItemInterface::Value const &value)=0
Method which creates a traffic item and registers it under the ID passed as a first argument...
TrafficItemInterface::setValue
virtual void setValue(Value const &_value)=0
Sets the traffic item&#39;s value to the value passed as an argument.

◆ loadVisibilityDistanceMap()

bool TrafficSimulationXMLLoadModel::loadVisibilityDistanceMap | ( | QXmlStreamReader & | xml,
 |  | EnvironmentInterface * | environment
 | ) |  |
static

This method reads all visibility distances from the combination xml file and stores their values and probabilities..

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | environment | the pointer to the environment configuration, i.e. the instance of EnvironmentInterface
Returns
"true", if all listed xml elements are of type "VisibilityDistance", otherwise "false"

Definition at line 232 of file TrafficSimulationXMLLoadModel.cpp.

233 {
234
235 while(xml.readNextStartElement())
236 {
237
238 if(xml.name() == KeyVisibilityDistance )
239 {
240 EnvironmentItemInterface * item = environment->createItem(xml.attributes().value("Value").toString(),
241 xml.attributes().value("Probability").toDouble());
242
243 EnvironmentInterface::ID id = (environment->getVisibilityDistanceMap()->isEmpty()) ?
244 1 : environment->getVisibilityDistanceMap()->lastKey() + 1;
245
246 environment->getVisibilityDistanceMap()->insert(id, item);
247
248 xml.readElementText();
249 }
250 else
251 {
252 xml.skipCurrentElement();
253 return false;
254 }
255 }
256
257 return true;
258 }
EnvironmentInterface::ID
unsigned int ID
A key identifier for the map of environment items.
Definition: EnvironmentInterface.h:54
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentInterface::getVisibilityDistanceMap
virtual VisibilityDistanceMap * getVisibilityDistanceMap() const =0
Returns a pointer to the map of visibility distances.
EnvironmentInterface::createItem
virtual Item * createItem(Item::Value const &value, Item::Probability const &probability)=0
Creates an environmental parameter (i.e. an instance of EnvironmentItemInterface) with the given valu...

◆ loadWeatherMap()

bool TrafficSimulationXMLLoadModel::loadWeatherMap | ( | QXmlStreamReader & | xml,
 |  | EnvironmentInterface * | environment
 | ) |  |
static

This method reads all weather entries from the combination xml file and stores their values and probabilities.

Parameters
[in] | xml | the xml stream reader object connected to the combination xml file
[in] | environment | the pointer to the environment configuration, i.e. the instance of EnvironmentInterface
Returns
"true", if all listed xml elements are of type "Weather", otherwise "false"

Definition at line 288 of file TrafficSimulationXMLLoadModel.cpp.

289 {
290
291 while(xml.readNextStartElement())
292 {
293
294 if(xml.name() == KeyWeather )
295 {
296 EnvironmentItemInterface * item = environment->createItem(xml.attributes().value("Value").toString(),
297 xml.attributes().value("Probability").toDouble());
298
299 EnvironmentInterface::ID id = (environment->getWeatherMap()->isEmpty()) ?
300 1 : environment->getWeatherMap()->lastKey() + 1;
301
302 environment->getWeatherMap()->insert(id, item);
303
304 xml.readElementText();
305 }
306 else
307 {
308 xml.skipCurrentElement();
309 return false;
310 }
311 }
312
313 return true;
314 }
EnvironmentInterface::ID
unsigned int ID
A key identifier for the map of environment items.
Definition: EnvironmentInterface.h:54
EnvironmentItemInterface
The EnvironmentItemInterface class provides methods for reading and editing environment parameters...
Definition: EnvironmentItemInterface.h:37
EnvironmentInterface::createItem
virtual Item * createItem(Item::Value const &value, Item::Probability const &probability)=0
Creates an environmental parameter (i.e. an instance of EnvironmentItemInterface) with the given valu...
EnvironmentInterface::getWeatherMap
virtual WeatherMap * getWeatherMap() const =0
Returns a pointer to the map of whether parameters.
The documentation for this class was generated from the following files:
  • TrafficSimulationXMLLoadModel.h
  • TrafficSimulationXMLLoadModel.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficSimulationXMLLoadModel Member List

This is the complete list of members for TrafficSimulationXMLLoadModel, including all inherited members.

load(const QString &filepath, TrafficSimulationInterface *const trafficSimulation) | TrafficSimulationXMLLoadModel | static
loadEnvironment(QXmlStreamReader &xml, EnvironmentInterface *environment) | TrafficSimulationXMLLoadModel | static
loadExperiment(QXmlStreamReader &xml, ExperimentInterface *experiment) | TrafficSimulationXMLLoadModel | static
loadFrictionMap(QXmlStreamReader &xml, EnvironmentInterface *environment) | TrafficSimulationXMLLoadModel | static
loadLibraries(QXmlStreamReader &xml, ExperimentInterface::Libraries *const libraries) | TrafficSimulationXMLLoadModel | static
loadLoggingGroups(QXmlStreamReader &xml, ExperimentInterface::LoggingGroups *const loggingGroups) | TrafficSimulationXMLLoadModel | static
loadScenarioConfig(QXmlStreamReader &xml, ScenarioInterface *scenario) | TrafficSimulationXMLLoadModel | static
loadTimeOfDayMap(QXmlStreamReader &xml, EnvironmentInterface *environment) | TrafficSimulationXMLLoadModel | static
loadTraffic(QXmlStreamReader &xml, TrafficInterface *traffic) | TrafficSimulationXMLLoadModel | static
loadTrafficAgents(QXmlStreamReader &xml, TrafficItemMapInterface *agents) | TrafficSimulationXMLLoadModel | static
loadTrafficHomogeneities(QXmlStreamReader &xml, TrafficItemMapInterface *homogeneities) | TrafficSimulationXMLLoadModel | static
loadTrafficParameters(QXmlStreamReader &xml, TrafficInterface *traffic) | TrafficSimulationXMLLoadModel | static
loadTrafficPlatoonRates(QXmlStreamReader &xml, TrafficItemMapInterface *platoonRates) | TrafficSimulationXMLLoadModel | static
loadTrafficVelocities(QXmlStreamReader &xml, TrafficItemMapInterface *velocities) | TrafficSimulationXMLLoadModel | static
loadTrafficVolumes(QXmlStreamReader &xml, TrafficItemMapInterface *volumes) | TrafficSimulationXMLLoadModel | static
loadVisibilityDistanceMap(QXmlStreamReader &xml, EnvironmentInterface *environment) | TrafficSimulationXMLLoadModel | static
loadWeatherMap(QXmlStreamReader &xml, EnvironmentInterface *environment) | TrafficSimulationXMLLoadModel | static
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficSimulationXMLSaveModel Class Reference

Static Public Member Functions | List of all members
TrafficSimulationXMLSaveModel Class Reference

This class provides routines for saving the slaveConfig XML file. More...

Inheritance diagram for TrafficSimulationXMLSaveModel:
TrafficSimulationXMLBaseModel

Static Public Member Functions

static bool | save (const QString &filepath, const TrafficSimulationInterface *const trafficSimulation)
This method manages the whole saving process. It opens the given filepath and, on success, goes through all required configuration objects and calls the corresponding xml save routines. More...
static void | saveEnvironment (QXmlStreamWriter &xml, EnvironmentInterface *environment)
This method writes all xml subelements of <EnvironmentConfig> stored in the given instance of EnvironmentInterface. More...
static void | saveExperiment (QXmlStreamWriter &xml, ExperimentInterface *experiment)
This method writes all xml subelements of <ExperimentConfig> stored in the given instance of ExperimentInterface. More...
static void | saveFrictionMap (QXmlStreamWriter &xml, EnvironmentInterface::FrictionMap *map)
This method saves all friction coefficients and corresponding probabilities stored in the given map. More...
static void | saveLibraries (QXmlStreamWriter &xml, ExperimentInterface::Libraries *const libraries)
This method writes all Libraries needed by the simulation slave, i.e. all XML elements of <Libraries> occuring in <ExperimentConfig>. More...
static void | saveLoggingGroups (QXmlStreamWriter &xml, ExperimentInterface::LoggingGroups *const loggingGroups)
This method writes all logging groups, i.e. all XML elements of <LoggingGroups> occuring in <ExperimentConfig>. More...
static void | saveScenario (QXmlStreamWriter &xml, ScenarioInterface *scenario)
This method writes all xml subelements of <EgoConfig> and <ScenarioConfig> stored in the given instance of ScenarioInterface. More...
static void | saveTimeOfDayMap (QXmlStreamWriter &xml, EnvironmentInterface::TimeOfDayMap *map)
This method saves all time of day entries and corresponding probabilities stored in the given map. More...
static void | saveTraffic (QXmlStreamWriter &xml, TrafficInterface *traffic)
This method writes all xml subelements of <TrafficConfig> stored in the given instance of TrafficInterface. It incorporates the subroutines for saving traffic parameters and the agents on regular and rightmost lanes. More...
static void | saveTrafficHomogeneities (QXmlStreamWriter &xml, TrafficItemMapInterface *homogeneities)
This method saves all homogeneities and corresponding probabilities stored in the given homogeneities map. More...
static void | saveTrafficParameters (QXmlStreamWriter &xml, TrafficInterface *traffic)
This method saves all traffic parameter values and probabilities, i.e. all xml subelements of <TrafficParameters> stored in the given instance of TrafficInterface. This comprises traffic volumes, platoon rates, velocities and homogeneities. More...
static void | saveTrafficPlatoonRates (QXmlStreamWriter &xml, TrafficItemMapInterface *platoonRates)
This method saves all platoon rates and corresponding probabilities stored in the given platoon rates map. More...
static void | saveTrafficRegularLane (QXmlStreamWriter &xml, TrafficItemMapInterface *agents)
This method saves all regular lane agent profiles and corresponding probabilities stored in the given map. More...
static void | saveTrafficRightmostLane (QXmlStreamWriter &xml, TrafficItemMapInterface *agents)
This method saves all rightmost lane agent profiles and corresponding probabilities stored in the given map. More...
static void | saveTrafficVelocities (QXmlStreamWriter &xml, TrafficItemMapInterface *velocities)
This method saves all velocities and corresponding probabilities stored in the given velocities map. More...
static void | saveTrafficVolumes (QXmlStreamWriter &xml, TrafficItemMapInterface *volumes)
This method saves all traffic volumes and corresponding probabilities stored in the given volumes map. More...
static void | saveVisibilityDistanceMap (QXmlStreamWriter &xml, EnvironmentInterface::VisibilityDistanceMap *map)
This method saves all vistibility distance entries and corresponding probabilities stored in the given map. More...
static void | saveWeatherMap (QXmlStreamWriter &xml, EnvironmentInterface::WeatherMap *map)
This method saves all weather entries and corresponding probabilities stored in the given map. More...

Detailed Description

This class provides routines for saving the slaveConfig XML file.

The saving process and the corrsponding routines strictly follow the structure of the corresponding combination XML file. In the general structure of such a saving method, a loop over all xml subelements within the given xml element is incorporated and the values of the corresponding configuration object are written to the file using the xml names defined in TrafficSimulationXMLBaseModel. As an xml parser, Qt's QXmlStreamWriter class is used.

Definition at line 43 of file TrafficSimulationXMLSaveModel.h.

Member Function Documentation

◆ save()

bool TrafficSimulationXMLSaveModel::save | ( | const QString & | filepath,
 |  | const TrafficSimulationInterface *const | trafficSimulation
 | ) |  |
static

This method manages the whole saving process. It opens the given filepath and, on success, goes through all required configuration objects and calls the corresponding xml save routines.

Parameters
[in] | filepath | the filepath of the combination XML file to be written
[in] | trafficSimulation | the object containing all information on the simulation configuation
Returns
"true" if the filepath could be successfully opened, otherwise "false"

Definition at line 13 of file TrafficSimulationXMLSaveModel.cpp.

15 {
16 QFile file(filepath);
17
18 if(file.open(QIODevice::WriteOnly | QIODevice::Text))
19 {
20 QXmlStreamWriter xml(&file);
21
22 xml.setAutoFormatting(true);
23 xml.setAutoFormattingIndent(2);
24
25 // Start Document
26 xml.writeStartDocument();
27
28 // Root Element
29 xml.writeStartElement(KeyRoot);
30 xml.writeAttribute("SchemaVersion", "0.6.1");
31
32 // Save Profiles catalogue
33 xml.writeTextElement(KeyProfilesCatalogue, trafficSimulation->getProfilesCatalogue());
34
35 // Save Experiment
36 saveExperiment(xml, trafficSimulation->getExperiment());
37
38 // Save Environment
39 saveEnvironment(xml, trafficSimulation->getEnvironment());
40
41 // Save Scenario
42 saveScenario(xml,trafficSimulation->getScenario());
43
44 // Save Traffic
45 saveTraffic(xml, trafficSimulation->getTraffic());
46
47 xml.writeEndElement();
48 // End Document
49 xml.writeEndDocument();
50
51 return true;
52 }
53
54 return false;
55 }
TrafficSimulationInterface::getTraffic
virtual TrafficInterface * getTraffic() const =0
Returns the pointer to the traffic configuration object, i.e. an instance of the TrafficInterface cla...
TrafficSimulationXMLSaveModel::saveScenario
static void saveScenario(QXmlStreamWriter &xml, ScenarioInterface *scenario)
This method writes all xml subelements of <EgoConfig> and <ScenarioConfig> stored in the given instan...
Definition: TrafficSimulationXMLSaveModel.cpp:179
TrafficSimulationInterface::getProfilesCatalogue
virtual ProfilesCatalogue getProfilesCatalogue() const =0
Returns the current profiles catalogue.
TrafficSimulationXMLSaveModel::saveExperiment
static void saveExperiment(QXmlStreamWriter &xml, ExperimentInterface *experiment)
This method writes all xml subelements of <ExperimentConfig> stored in the given instance of Experime...
Definition: TrafficSimulationXMLSaveModel.cpp:57
TrafficSimulationInterface::getEnvironment
virtual EnvironmentInterface * getEnvironment() const =0
Returns the pointer to the environment configuration object, i.e. an instance of the EnvironmentInter...
TrafficSimulationInterface::getExperiment
virtual ExperimentInterface * getExperiment() const =0
Returns the pointer to the experiment configuration object, i.e. an instance of the ExperimentInterfa...
TrafficSimulationXMLSaveModel::saveEnvironment
static void saveEnvironment(QXmlStreamWriter &xml, EnvironmentInterface *environment)
This method writes all xml subelements of <EnvironmentConfig> stored in the given instance of Environ...
Definition: TrafficSimulationXMLSaveModel.cpp:96
TrafficSimulationXMLSaveModel::saveTraffic
static void saveTraffic(QXmlStreamWriter &xml, TrafficInterface *traffic)
This method writes all xml subelements of <TrafficConfig> stored in the given instance of TrafficInte...
Definition: TrafficSimulationXMLSaveModel.cpp:194
TrafficSimulationInterface::getScenario
virtual ScenarioInterface * getScenario() const =0
Returns the pointer to the scenario configuration object, i.e. an instance of the ScenarioInterface c...

◆ saveEnvironment()

void TrafficSimulationXMLSaveModel::saveEnvironment | ( | QXmlStreamWriter & | xml,
 |  | EnvironmentInterface * | environment
 | ) |  |
static

This method writes all xml subelements of <EnvironmentConfig> stored in the given instance of EnvironmentInterface.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | environment | the object containing all information on the environment configuation

Definition at line 96 of file TrafficSimulationXMLSaveModel.cpp.

98 {
99 // Save Environment
100 xml.writeStartElement(KeyEnvironment);
101 xml.writeAttribute(QString("Name"), environment->getName());
102
103 saveTimeOfDayMap(xml, environment->getTimeOfDayMap());
104
105 saveVisibilityDistanceMap(xml, environment->getVisibilityDistanceMap());
106
107 saveFrictionMap(xml, environment->getFrictionMap());
108
109 saveWeatherMap(xml, environment->getWeatherMap());
110
111 xml.writeEndElement();
112 xml.writeComment("#############################################################################################");
113 }
TrafficSimulationXMLSaveModel::saveWeatherMap
static void saveWeatherMap(QXmlStreamWriter &xml, EnvironmentInterface::WeatherMap *map)
This method saves all weather entries and corresponding probabilities stored in the given map...
Definition: TrafficSimulationXMLSaveModel.cpp:163
TrafficSimulationXMLSaveModel::saveTimeOfDayMap
static void saveTimeOfDayMap(QXmlStreamWriter &xml, EnvironmentInterface::TimeOfDayMap *map)
This method saves all time of day entries and corresponding probabilities stored in the given map...
Definition: TrafficSimulationXMLSaveModel.cpp:115
EnvironmentInterface::getFrictionMap
virtual FrictionMap * getFrictionMap() const =0
Returns a pointer to the map of friction coefficients.
TrafficSimulationXMLSaveModel::saveVisibilityDistanceMap
static void saveVisibilityDistanceMap(QXmlStreamWriter &xml, EnvironmentInterface::VisibilityDistanceMap *map)
This method saves all vistibility distance entries and corresponding probabilities stored in the give...
Definition: TrafficSimulationXMLSaveModel.cpp:131
EnvironmentInterface::getVisibilityDistanceMap
virtual VisibilityDistanceMap * getVisibilityDistanceMap() const =0
Returns a pointer to the map of visibility distances.
TrafficSimulationXMLSaveModel::saveFrictionMap
static void saveFrictionMap(QXmlStreamWriter &xml, EnvironmentInterface::FrictionMap *map)
This method saves all friction coefficients and corresponding probabilities stored in the given map...
Definition: TrafficSimulationXMLSaveModel.cpp:147
EnvironmentInterface::getWeatherMap
virtual WeatherMap * getWeatherMap() const =0
Returns a pointer to the map of whether parameters.
EnvironmentInterface::getTimeOfDayMap
virtual TimeOfDayMap * getTimeOfDayMap() const =0
Returns a pointer to the time of day parameter map.
EnvironmentInterface::getName
virtual Name getName() const =0
Returns the current name of the environment configuration.

◆ saveExperiment()

void TrafficSimulationXMLSaveModel::saveExperiment | ( | QXmlStreamWriter & | xml,
 |  | ExperimentInterface * | experiment
 | ) |  |
static

This method writes all xml subelements of <ExperimentConfig> stored in the given instance of ExperimentInterface.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | experiment | the object containing all information on the experiment configuation

Definition at line 57 of file TrafficSimulationXMLSaveModel.cpp.

59 {
60 xml.writeStartElement(KeyExperiment);
61
62 xml.writeTextElement(KeyExperimentID, QString::number(experiment->getID()));
63 xml.writeTextElement(KeyExperimentNumberInvocations, QString::number(experiment->getNumberInvocations()));
64 xml.writeTextElement(KeyExperimentSeed, QString::number(experiment->getSeed()));
65
66 saveLibraries(xml, experiment->getLibraries());
67 saveLoggingGroups(xml, experiment->getLoggingGroups());
68
69 xml.writeEndElement();
70 xml.writeComment("#############################################################################################");
71
72 }
ExperimentInterface::getLoggingGroups
virtual LoggingGroups * getLoggingGroups() const =0
Returns the pointer to the list of Logging Groups.
ExperimentInterface::getLibraries
virtual Libraries * getLibraries() const =0
Returns the pointer to the Libraries map.
TrafficSimulationXMLSaveModel::saveLoggingGroups
static void saveLoggingGroups(QXmlStreamWriter &xml, ExperimentInterface::LoggingGroups *const loggingGroups)
This method writes all logging groups, i.e. all XML elements of <LoggingGroups> occuring in <Experime...
Definition: TrafficSimulationXMLSaveModel.cpp:85
ExperimentInterface::getNumberInvocations
virtual NumberInvocations getNumberInvocations() const =0
Returns the current number of invocations.
TrafficSimulationXMLSaveModel::saveLibraries
static void saveLibraries(QXmlStreamWriter &xml, ExperimentInterface::Libraries *const libraries)
This method writes all Libraries needed by the simulation slave, i.e. all XML elements of <Libraries>...
Definition: TrafficSimulationXMLSaveModel.cpp:74
ExperimentInterface::getSeed
virtual Seed getSeed() const =0
Returns the current random number seed.
ExperimentInterface::getID
virtual ID getID() const =0
Returns the ID of the experiment.

◆ saveFrictionMap()

void TrafficSimulationXMLSaveModel::saveFrictionMap | ( | QXmlStreamWriter & | xml,
 |  | EnvironmentInterface::FrictionMap * | map
 | ) |  |
static

This method saves all friction coefficients and corresponding probabilities stored in the given map.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | map | the map of friction coefficinets, whose values are instances of EnvironmentItemInterface

Definition at line 147 of file TrafficSimulationXMLSaveModel.cpp.

149 {
150
151 xml.writeStartElement(KeyFrictionMap);
152 for(auto item : map->values())
153 {
154 xml.writeStartElement(KeyFriction);
155 xml.writeAttribute(QString("Value"), item->getValue());
156 xml.writeAttribute(QString("Probability"), QString::number(item->getProbability()));
157 xml.writeEndElement();
158 }
159
160 xml.writeEndElement();
161 }

◆ saveLibraries()

void TrafficSimulationXMLSaveModel::saveLibraries | ( | QXmlStreamWriter & | xml,
 |  | ExperimentInterface::Libraries *const | libraries
 | ) |  |
static

This method writes all Libraries needed by the simulation slave, i.e. all XML elements of <Libraries> occuring in <ExperimentConfig>.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | libraries | the pointer to the map of all libraries

Definition at line 74 of file TrafficSimulationXMLSaveModel.cpp.

76 {
77 xml.writeStartElement(KeyExperimentLibraries);
78
79 for(auto type : libraries->keys())
80 xml.writeTextElement(type, libraries->value(type));
81
82 xml.writeEndElement();
83 }

◆ saveLoggingGroups()

void TrafficSimulationXMLSaveModel::saveLoggingGroups | ( | QXmlStreamWriter & | xml,
 |  | ExperimentInterface::LoggingGroups *const | loggingGroups
 | ) |  |
static

This method writes all logging groups, i.e. all XML elements of <LoggingGroups> occuring in <ExperimentConfig>.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | libraries | the pointer to the list of all logging groups

Definition at line 85 of file TrafficSimulationXMLSaveModel.cpp.

87 {
88 xml.writeStartElement(KeyExperimentLoggingGroups);
89
90 for (auto loggingGroup : *loggingGroups)
91 xml.writeTextElement(KeyExperimentLoggingGroup, loggingGroup);
92
93 xml.writeEndElement();
94 }

◆ saveScenario()

void TrafficSimulationXMLSaveModel::saveScenario | ( | QXmlStreamWriter & | xml,
 |  | ScenarioInterface * | scenario
 | ) |  |
static

This method writes all xml subelements of <EgoConfig> and <ScenarioConfig> stored in the given instance of ScenarioInterface.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | scenario | the object containing all information on the ego and scenario configuation

Definition at line 179 of file TrafficSimulationXMLSaveModel.cpp.

181 {
182 // Save Scenario Configs
183 xml.writeStartElement(KeyScenario);
184 xml.writeAttribute(QString("Name"),scenario->getName());
185
186 xml.writeTextElement(KeyScenarioFile, scenario->getScenarioFile());
187
188 xml.writeEndElement();
189 xml.writeComment("#############################################################################################");
190
191 }
ScenarioInterface::getScenarioFile
virtual ScenarioFile getScenarioFile() const =0
Returns the current name of the open scenario file to which this scenario setup refers.
ScenarioInterface::getName
virtual Name getName() const =0
Returns the current name of the scenario.

◆ saveTimeOfDayMap()

void TrafficSimulationXMLSaveModel::saveTimeOfDayMap | ( | QXmlStreamWriter & | xml,
 |  | EnvironmentInterface::TimeOfDayMap * | map
 | ) |  |
static

This method saves all time of day entries and corresponding probabilities stored in the given map.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | map | the time of day map, whose values are instances of EnvironmentItemInterface

Definition at line 115 of file TrafficSimulationXMLSaveModel.cpp.

117 {
118
119 xml.writeStartElement(KeyTimeOfDayMap);
120 for(auto item : map->values())
121 {
122 xml.writeStartElement(KeyTimeOfDay);
123 xml.writeAttribute(QString("Value"), item->getValue());
124 xml.writeAttribute(QString("Probability"), QString::number(item->getProbability()));
125 xml.writeEndElement();
126 }
127
128 xml.writeEndElement();
129 }

◆ saveTraffic()

void TrafficSimulationXMLSaveModel::saveTraffic | ( | QXmlStreamWriter & | xml,
 |  | TrafficInterface * | traffic
 | ) |  |
static

This method writes all xml subelements of <TrafficConfig> stored in the given instance of TrafficInterface. It incorporates the subroutines for saving traffic parameters and the agents on regular and rightmost lanes.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | traffic | the object containing all information on the traffic configuation

Definition at line 194 of file TrafficSimulationXMLSaveModel.cpp.

196 {
197 xml.writeStartElement(KeyTraffic);
198 xml.writeAttribute(QString("Name"), traffic->getName());
199
200 saveTrafficParameters(xml, traffic);
201 saveTrafficRegularLane(xml, traffic->getAgentsRegularLane());
202 saveTrafficRightmostLane(xml, traffic->getAgentsRightMostLane());
203
204 xml.writeEndElement();
205 xml.writeComment("#############################################################################################");
206
207 }
TrafficInterface::getAgentsRightMostLane
virtual TrafficAgents * getAgentsRightMostLane() const =0
Returns the map for registering agent profiles for the rightmost lane.
TrafficSimulationXMLSaveModel::saveTrafficParameters
static void saveTrafficParameters(QXmlStreamWriter &xml, TrafficInterface *traffic)
This method saves all traffic parameter values and probabilities, i.e. all xml subelements of <Traffi...
Definition: TrafficSimulationXMLSaveModel.cpp:209
TrafficInterface::getAgentsRegularLane
virtual TrafficAgents * getAgentsRegularLane() const =0
Returns the map for registering agent profiles for regular lanes.
TrafficSimulationXMLSaveModel::saveTrafficRightmostLane
static void saveTrafficRightmostLane(QXmlStreamWriter &xml, TrafficItemMapInterface *agents)
This method saves all rightmost lane agent profiles and corresponding probabilities stored in the giv...
Definition: TrafficSimulationXMLSaveModel.cpp:303
TrafficInterface::getName
virtual Name getName() const =0
Returns the current name of the traffic setup.
TrafficSimulationXMLSaveModel::saveTrafficRegularLane
static void saveTrafficRegularLane(QXmlStreamWriter &xml, TrafficItemMapInterface *agents)
This method saves all regular lane agent profiles and corresponding probabilities stored in the given...
Definition: TrafficSimulationXMLSaveModel.cpp:287

◆ saveTrafficHomogeneities()

void TrafficSimulationXMLSaveModel::saveTrafficHomogeneities | ( | QXmlStreamWriter & | xml,
 |  | TrafficItemMapInterface * | homogeneities
 | ) |  |
static

This method saves all homogeneities and corresponding probabilities stored in the given homogeneities map.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | homogeneities | the homogeneities map being an instance of TrafficItemMapInterface with the datatype "double"

Definition at line 270 of file TrafficSimulationXMLSaveModel.cpp.

272 {
273 xml.writeStartElement(KeyTrafficHomogeneities);
274
275 for(TrafficItemInterface * homogeneity : homogeneities->values())
276 {
277 xml.writeStartElement(KeyTrafficHomogeneity);
278 xml.writeAttribute("Value", homogeneity->getValue());
279 xml.writeAttribute("Probability", QString("%1").arg(homogeneity->getProbability()));
280 xml.writeEndElement();
281 }
282
283 xml.writeEndElement();
284 }
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...

◆ saveTrafficParameters()

void TrafficSimulationXMLSaveModel::saveTrafficParameters | ( | QXmlStreamWriter & | xml,
 |  | TrafficInterface * | traffic
 | ) |  |
static

This method saves all traffic parameter values and probabilities, i.e. all xml subelements of <TrafficParameters> stored in the given instance of TrafficInterface. This comprises traffic volumes, platoon rates, velocities and homogeneities.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | traffic | the object containing all information on the traffic configuation

Definition at line 209 of file TrafficSimulationXMLSaveModel.cpp.

211 {
212 xml.writeStartElement(KeyTrafficParameters);
213
214 saveTrafficVolumes(xml, traffic->getVolumes());
215 saveTrafficPlatoonRates(xml, traffic->getPlatoonRates());
216 saveTrafficVelocities(xml, traffic->getVelocities());
217 saveTrafficHomogeneities(xml, traffic->getHomogeneities());
218
219 xml.writeEndElement();
220 }
TrafficInterface::getVelocities
virtual Velocities * getVelocities() const =0
Returns the map for registering velocities.
TrafficInterface::getVolumes
virtual Volumes * getVolumes() const =0
Returns the map for registering traffic volumes.
TrafficSimulationXMLSaveModel::saveTrafficVolumes
static void saveTrafficVolumes(QXmlStreamWriter &xml, TrafficItemMapInterface *volumes)
This method saves all traffic volumes and corresponding probabilities stored in the given volumes map...
Definition: TrafficSimulationXMLSaveModel.cpp:222
TrafficSimulationXMLSaveModel::saveTrafficVelocities
static void saveTrafficVelocities(QXmlStreamWriter &xml, TrafficItemMapInterface *velocities)
This method saves all velocities and corresponding probabilities stored in the given velocities map...
Definition: TrafficSimulationXMLSaveModel.cpp:254
TrafficInterface::getPlatoonRates
virtual PlatoonRates * getPlatoonRates() const =0
Returns the map for registering platoon rates.
TrafficInterface::getHomogeneities
virtual Homogeneities * getHomogeneities() const =0
Returns the map for registering homogeneities.
TrafficSimulationXMLSaveModel::saveTrafficHomogeneities
static void saveTrafficHomogeneities(QXmlStreamWriter &xml, TrafficItemMapInterface *homogeneities)
This method saves all homogeneities and corresponding probabilities stored in the given homogeneities...
Definition: TrafficSimulationXMLSaveModel.cpp:270
TrafficSimulationXMLSaveModel::saveTrafficPlatoonRates
static void saveTrafficPlatoonRates(QXmlStreamWriter &xml, TrafficItemMapInterface *platoonRates)
This method saves all platoon rates and corresponding probabilities stored in the given platoon rates...
Definition: TrafficSimulationXMLSaveModel.cpp:238

◆ saveTrafficPlatoonRates()

void TrafficSimulationXMLSaveModel::saveTrafficPlatoonRates | ( | QXmlStreamWriter & | xml,
 |  | TrafficItemMapInterface * | platoonRates
 | ) |  |
static

This method saves all platoon rates and corresponding probabilities stored in the given platoon rates map.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | platoonRates | the platoon rates map being an instance of TrafficItemMapInterface with the datatype "double"

Definition at line 238 of file TrafficSimulationXMLSaveModel.cpp.

240 {
241 xml.writeStartElement(KeyTrafficPlatoonRates);
242
243 for(TrafficItemInterface * platoonRate : platoonRates->values())
244 {
245 xml.writeStartElement(KeyTrafficPlatoonRate);
246 xml.writeAttribute("Value", platoonRate->getValue());
247 xml.writeAttribute("Probability", QString("%1").arg(platoonRate->getProbability()));
248 xml.writeEndElement();
249 }
250
251 xml.writeEndElement();
252 }
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...

◆ saveTrafficRegularLane()

void TrafficSimulationXMLSaveModel::saveTrafficRegularLane | ( | QXmlStreamWriter & | xml,
 |  | TrafficItemMapInterface * | agents
 | ) |  |
static

This method saves all regular lane agent profiles and corresponding probabilities stored in the given map.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | agents | the agents map being an instance of TrafficItemMapInterface with the datatype "QString"

Definition at line 287 of file TrafficSimulationXMLSaveModel.cpp.

289 {
290 xml.writeStartElement(KeyTrafficRegularLane);
291
292 for(TrafficItemInterface * agent : agents->values())
293 {
294 xml.writeStartElement(KeyTrafficAgent);
295 xml.writeAttribute("Name", agent->getValue());
296 xml.writeAttribute("Probability", QString("%1").arg(agent->getProbability()));
297 xml.writeEndElement();
298 }
299
300 xml.writeEndElement();
301 }
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...

◆ saveTrafficRightmostLane()

void TrafficSimulationXMLSaveModel::saveTrafficRightmostLane | ( | QXmlStreamWriter & | xml,
 |  | TrafficItemMapInterface * | agents
 | ) |  |
static

This method saves all rightmost lane agent profiles and corresponding probabilities stored in the given map.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | agents | the agents map being an instance of TrafficItemMapInterface with the datatype "QString"

Definition at line 303 of file TrafficSimulationXMLSaveModel.cpp.

305 {
306 xml.writeStartElement(KeyTrafficRightmostLane);
307
308 for(TrafficItemInterface* agent : agents->values())
309 {
310 xml.writeStartElement(KeyTrafficAgent);
311 xml.writeAttribute("Name", agent->getValue());
312 xml.writeAttribute("Probability", QString("%1").arg(agent->getProbability()));
313 xml.writeEndElement();
314 }
315
316 xml.writeEndElement();
317 }
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...

◆ saveTrafficVelocities()

void TrafficSimulationXMLSaveModel::saveTrafficVelocities | ( | QXmlStreamWriter & | xml,
 |  | TrafficItemMapInterface * | velocities
 | ) |  |
static

This method saves all velocities and corresponding probabilities stored in the given velocities map.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | velocities | the velocities map being an instance of TrafficItemMapInterface with the datatype "double"

Definition at line 254 of file TrafficSimulationXMLSaveModel.cpp.

256 {
257 xml.writeStartElement(KeyTrafficVelocities);
258
259 for(TrafficItemInterface * velocity : velocities->values())
260 {
261 xml.writeStartElement(KeyTrafficVelocity);
262 xml.writeAttribute("Value", velocity->getValue());
263 xml.writeAttribute("Probability", QString("%1").arg(velocity->getProbability()));
264 xml.writeEndElement();
265 }
266
267 xml.writeEndElement();
268 }
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...

◆ saveTrafficVolumes()

void TrafficSimulationXMLSaveModel::saveTrafficVolumes | ( | QXmlStreamWriter & | xml,
 |  | TrafficItemMapInterface * | volumes
 | ) |  |
static

This method saves all traffic volumes and corresponding probabilities stored in the given volumes map.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | volumes | the volumes map being an instance of TrafficItemMapInterface with the datatype "int"

Definition at line 222 of file TrafficSimulationXMLSaveModel.cpp.

224 {
225 xml.writeStartElement(KeyTrafficVolumes);
226
227 for(TrafficItemInterface* volume : volumes->values())
228 {
229 xml.writeStartElement(KeyTrafficVolume);
230 xml.writeAttribute("Value", volume->getValue());
231 xml.writeAttribute("Probability", QString("%1").arg(volume->getProbability()));
232 xml.writeEndElement();
233 }
234
235 xml.writeEndElement();
236 }
TrafficItemInterface
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the tra...
Definition: TrafficItemInterface.h:36
TrafficItemMapInterface::values
virtual QList< Item * > values() const =0
Method which returns a list of all items registered in the map. For the list, Qt&#39;s QList class is use...

◆ saveVisibilityDistanceMap()

void TrafficSimulationXMLSaveModel::saveVisibilityDistanceMap | ( | QXmlStreamWriter & | xml,
 |  | EnvironmentInterface::VisibilityDistanceMap * | map
 | ) |  |
static

This method saves all vistibility distance entries and corresponding probabilities stored in the given map.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | map | the map of visibility distances, whose values are instances of EnvironmentItemInterface

Definition at line 131 of file TrafficSimulationXMLSaveModel.cpp.

133 {
134
135 xml.writeStartElement(KeyVisibilityDistanceMap);
136 for(auto item : map->values())
137 {
138 xml.writeStartElement(KeyVisibilityDistance);
139 xml.writeAttribute(QString("Value"), item->getValue());
140 xml.writeAttribute(QString("Probability"), QString::number(item->getProbability()));
141 xml.writeEndElement();
142 }
143
144 xml.writeEndElement();
145 }

◆ saveWeatherMap()

void TrafficSimulationXMLSaveModel::saveWeatherMap | ( | QXmlStreamWriter & | xml,
 |  | EnvironmentInterface::WeatherMap * | map
 | ) |  |
static

This method saves all weather entries and corresponding probabilities stored in the given map.

Parameters
[in] | xml | the instance of QXmlStreamWriter connected to the combination xml file
[in] | map | the weather map, whose values are instances of EnvironmentItemInterface

Definition at line 163 of file TrafficSimulationXMLSaveModel.cpp.

165 {
166
167 xml.writeStartElement(KeyWeatherMap);
168 for(auto item : map->values())
169 {
170 xml.writeStartElement(KeyWeather);
171 xml.writeAttribute(QString("Value"), item->getValue());
172 xml.writeAttribute(QString("Probability"), QString::number(item->getProbability()));
173 xml.writeEndElement();
174 }
175
176 xml.writeEndElement();
177 }
The documentation for this class was generated from the following files:
  • TrafficSimulationXMLSaveModel.h
  • TrafficSimulationXMLSaveModel.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficSimulationXMLSaveModel Member List

This is the complete list of members for TrafficSimulationXMLSaveModel, including all inherited members.

save(const QString &filepath, const TrafficSimulationInterface *const trafficSimulation) | TrafficSimulationXMLSaveModel | static
saveEnvironment(QXmlStreamWriter &xml, EnvironmentInterface *environment) | TrafficSimulationXMLSaveModel | static
saveExperiment(QXmlStreamWriter &xml, ExperimentInterface *experiment) | TrafficSimulationXMLSaveModel | static
saveFrictionMap(QXmlStreamWriter &xml, EnvironmentInterface::FrictionMap *map) | TrafficSimulationXMLSaveModel | static
saveLibraries(QXmlStreamWriter &xml, ExperimentInterface::Libraries *const libraries) | TrafficSimulationXMLSaveModel | static
saveLoggingGroups(QXmlStreamWriter &xml, ExperimentInterface::LoggingGroups *const loggingGroups) | TrafficSimulationXMLSaveModel | static
saveScenario(QXmlStreamWriter &xml, ScenarioInterface *scenario) | TrafficSimulationXMLSaveModel | static
saveTimeOfDayMap(QXmlStreamWriter &xml, EnvironmentInterface::TimeOfDayMap *map) | TrafficSimulationXMLSaveModel | static
saveTraffic(QXmlStreamWriter &xml, TrafficInterface *traffic) | TrafficSimulationXMLSaveModel | static
saveTrafficHomogeneities(QXmlStreamWriter &xml, TrafficItemMapInterface *homogeneities) | TrafficSimulationXMLSaveModel | static
saveTrafficParameters(QXmlStreamWriter &xml, TrafficInterface *traffic) | TrafficSimulationXMLSaveModel | static
saveTrafficPlatoonRates(QXmlStreamWriter &xml, TrafficItemMapInterface *platoonRates) | TrafficSimulationXMLSaveModel | static
saveTrafficRegularLane(QXmlStreamWriter &xml, TrafficItemMapInterface *agents) | TrafficSimulationXMLSaveModel | static
saveTrafficRightmostLane(QXmlStreamWriter &xml, TrafficItemMapInterface *agents) | TrafficSimulationXMLSaveModel | static
saveTrafficVelocities(QXmlStreamWriter &xml, TrafficItemMapInterface *velocities) | TrafficSimulationXMLSaveModel | static
saveTrafficVolumes(QXmlStreamWriter &xml, TrafficItemMapInterface *volumes) | TrafficSimulationXMLSaveModel | static
saveVisibilityDistanceMap(QXmlStreamWriter &xml, EnvironmentInterface::VisibilityDistanceMap *map) | TrafficSimulationXMLSaveModel | static
saveWeatherMap(QXmlStreamWriter &xml, EnvironmentInterface::WeatherMap *map) | TrafficSimulationXMLSaveModel | static
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: TrafficView Class Reference

Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
TrafficView Class Reference

This class provides an editor for configuring the traffic setup, i.e. it is filled with the content stored in an TrafficInterface instance. More...

Inherits QWidget.

Signals

void | addHomogeneity ()
Signal emitted when add-button above the homogeneities table is clicked.
void | addPlatoonRate ()
Signal emitted when add-button above the platoon rates table is clicked.
void | addRegularLaneAgent ()
Signal emitted when add-button above the regular lane agents table is clicked.
void | addRightmostLaneAgent ()
Signal emitted when add-button above the rigthmost lane agents table is clicked.
void | addVelocity ()
Signal emitted when add-button above the velocities table is clicked.
void | addVolume ()
Signal emitted when add-button above the traffic volume table is clicked.
void | modifiedName (QString const &_name)
Signal emitted when the name of the traffic has been modified by the user. Transmits the new name to the presenter.
void | removeHomogeneity (const int &row)
Signal emitted when remove-button above the homogeneities table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter). More...
void | removePlatoonRate (const int &row)
Signal emitted when remove-button above the platoon rates table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter). More...
void | removeRegularLaneAgent (const int &row)
Signal emitted when remove-button above the regular lane agents table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter). More...
void | removeRightmostLaneAgent (const int &row)
Signal emitted when remove-button above the rightmost lane agents table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter). More...
void | removeVelocity (const int &row)
Signal emitted when remove-button above the velocities table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter). More...
void | removeVolume (const int &row)
Signal emitted when remove-button above the traffic volume table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter). More...

Public Member Functions

QTableView * | getHomogeneitiesView () const
Method which provides access to the table view displaying homogeneities. More...
QTableView * | getPlatoonRatesView () const
Method which provides access to the table view displaying platoon rates. More...
QTableView * | getRegularLaneAgentsView () const
Method which provides access to the table view displaying regular lane agents. More...
QTableView * | getRightmostLaneAgentsView () const
Method which provides access to the table view displaying rightmost lane agents. More...
QTableView * | getVelocitiesView () const
Method which provides access to the table view displaying velocities. More...
QTableView * | getVolumesView () const
Method which provides access to the table view displaying traffic volumes. More...
void | setAgentProfilesError (QString const &message)
Method which displays a an error message concerning agent profiles. More...
void | setHomogeneities_ProbabilityError (bool error)
Method which displays a probability error message for the table of homogeneities if the boolian argument is "true". More...
void | setName (QString const &_name)
Method which sets the traffic configuration's name to the one passed as an argument. More...
void | setPlatoonRates_ProbabilityError (bool error)
Method which displays a probability error message for the table of platoon rates if the boolian argument is "true". More...
void | setRegularLane_ProbabilityError (bool error)
Method which displays a probability error message for the table of regular lane agents if the boolian argument is "true". More...
void | setRightmostLane_ProbabilityError (bool error)
Method which displays a probability error message for the table of rightmost lane agents if the boolian argument is "true". More...
void | setVelocities_ProbabilityError (bool error)
Method which displays a probability error message for the table of velocities if the boolian argument is "true". More...
void | setVolumes_ProbabilityError (bool error)
Method which displays a probability error message for the table of traffic volumes if the boolian argument is "true". More...

Private Slots

void | on_addHomogeneity_clicked ()
Slot which is triggered when the user clicks on the add-button above the homogeneities table. Will emit the addHomogeneity signal.
void | on_addPlatoonRate_clicked ()
Slot which is triggered when the user clicks on the add-button above the platoon rate table. Will emit the addVolume signal.
void | on_addRegularLaneAgent_clicked ()
Slot which is triggered when the user clicks on the add-button above the regular lane agents table. Will emit the addRegularLaneAgent signal.
void | on_addRightmostLaneAgent_clicked ()
Slot which is triggered when the user clicks on the add-button above the rightmost lane agents table. Will emit the addRightmostLaneAgent signal.
void | on_addVelocity_clicked ()
Slot which is triggered when the user clicks on the add-button above the velocities table. Will emit the addVelocity signal.
void | on_addVolume_clicked ()
Slot which is triggered when the user clicks on the add-button above the traffic volumes table. Will emit the addVolume signal.
void | on_NameEdit_editingFinished ()
Slot which is triggered when the user has finished editing the traffic configuration's name. Will emit the modifiedName signal transmitting the new name to the corresponding presenter object.
void | on_removeHomogeneity_clicked ()
Signal, emitted when the user clicks the remove-button of the homogeneities table. Will emit the removeHomogeneity signal transmitting the currently selected row index of the table.
void | on_removePlatoonRate_clicked ()
Signal, emitted when the user clicks the remove-button of the platoon rates table. Will emit the removePlatoonRate signal transmitting the currently selected row index of the table.
void | on_removeRegularLaneAgent_clicked ()
Signal, emitted when the user clicks the remove-button of the regular lane agents table. Will emit the removeRegularLaneAgent signal transmitting the currently selected row index of the table.
void | on_removeRightmostLaneAgent_clicked ()
Signal, emitted when the user clicks the remove-button of the rightmost lane agents table. Will emit the removeRightmostLaneAgent signal transmitting the currently selected row index of the table.
void | on_removeVelocity_clicked ()
Signal, emitted when the user clicks the remove-button of the velocities table. Will emit the removeVelocity signal transmitting the currently selected row index of the table.
void | on_removeVolume_clicked ()
Signal, emitted when the user clicks the remove-button of the traffic volumes table. Will emit the removeVolume signal transmitting the currently selected row index of the table.

Private Member Functions

bool eventFilter (QObject *watched, QEvent *event)
Reimplementation of the event filter. This filter catches the resize events of the table views in order to resize their columns properly. (Doing it in the resize event of the table view itself did not yield the desired behaviour). More...

Private Attributes

Ui::TrafficView * ui
the ui object containing the GUI elements of this view

Detailed Description

This class provides an editor for configuring the traffic setup, i.e. it is filled with the content stored in an TrafficInterface instance.

It contains an ui object describing the views appearance (defined in TrafficView.ui) and GUI elements. Particularly, it comprises table views (see Qt's QTableView class) for editing and displaying the maps of traffic parameters. User action will lead to signal emissions which are noticed and managed by the corresponding presenter class, i.e. TrafficPresenter.

Definition at line 43 of file TrafficView.h.

Member Function Documentation

◆ eventFilter()

bool TrafficView::eventFilter | ( | QObject * | watched,
 |  | QEvent * | event
 | ) |  |
private

Reimplementation of the event filter. This filter catches the resize events of the table views in order to resize their columns properly. (Doing it in the resize event of the table view itself did not yield the desired behaviour).

Parameters
[in] | watched | the object whose events should be catched
[in] | event | the event to be catched
Returns
always "false" since the event should never be blocked

Definition at line 148 of file TrafficView.cpp.

149 {
150 QTableView* table = qobject_cast<QTableView*> (watched);
151
152 if( table && event->type() == QEvent::Resize )
153 {
154 int cell = (table->width())/2;
155 table->setColumnWidth(0, cell);
156 }
157
158 return false;
159 }

◆ getHomogeneitiesView()

QTableView * TrafficView::getHomogeneitiesView ( ) const

Method which provides access to the table view displaying homogeneities.

Returns
a pointer to the homogeneities table view

Definition at line 73 of file TrafficView.cpp.

74 {
75 return ui->HomogeneitiesView;
76 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370

◆ getPlatoonRatesView()

QTableView * TrafficView::getPlatoonRatesView ( ) const

Method which provides access to the table view displaying platoon rates.

Returns
a pointer to the platoon rates table view

Definition at line 68 of file TrafficView.cpp.

69 {
70 return ui->PlatoonRatesView;
71 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370

◆ getRegularLaneAgentsView()

QTableView * TrafficView::getRegularLaneAgentsView ( ) const

Method which provides access to the table view displaying regular lane agents.

Returns
a pointer to the regular lane agents table view

Definition at line 78 of file TrafficView.cpp.

79 {
80 return ui->RegularLaneAgentsView;
81 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370

◆ getRightmostLaneAgentsView()

QTableView * TrafficView::getRightmostLaneAgentsView ( ) const

Method which provides access to the table view displaying rightmost lane agents.

Returns
a pointer to the rightmost lane agents table view

Definition at line 83 of file TrafficView.cpp.

84 {
85 return ui->RightmostLaneAgentsView;
86 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370

◆ getVelocitiesView()

QTableView * TrafficView::getVelocitiesView ( ) const

Method which provides access to the table view displaying velocities.

Returns
a pointer to the velocities table view

Definition at line 63 of file TrafficView.cpp.

64 {
65 return ui->VelocitiesView;
66 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370

◆ getVolumesView()

QTableView * TrafficView::getVolumesView ( ) const

Method which provides access to the table view displaying traffic volumes.

Returns
a pointer to the traffic volumes table view

Definition at line 58 of file TrafficView.cpp.

59 {
60 return ui->VolumesView;
61 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370

◆ removeHomogeneity

void TrafficView::removeHomogeneity ( const int & row )
signal

Signal emitted when remove-button above the homogeneities table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter).

Parameters
[in] row the currently selected row

◆ removePlatoonRate

void TrafficView::removePlatoonRate ( const int & row )
signal

Signal emitted when remove-button above the platoon rates table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter).

Parameters
[in] row the currently selected row

◆ removeRegularLaneAgent

void TrafficView::removeRegularLaneAgent ( const int & row )
signal

Signal emitted when remove-button above the regular lane agents table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter).

Parameters
[in] row the currently selected row

◆ removeRightmostLaneAgent

void TrafficView::removeRightmostLaneAgent ( const int & row )
signal

Signal emitted when remove-button above the rightmost lane agents table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter).

Parameters
[in] row the currently selected row

◆ removeVelocity

void TrafficView::removeVelocity ( const int & row )
signal

Signal emitted when remove-button above the velocities table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter).

Parameters
[in] row the currently selected row

◆ removeVolume

void TrafficView::removeVolume ( const int & row )
signal

Signal emitted when remove-button above the traffic volume table is clicked. Transmits the currently selected row index to the presenter (TrafficPresenter).

Parameters
[in] row the currently selected row

◆ setAgentProfilesError()

void TrafficView::setAgentProfilesError ( QString const & message )

Method which displays a an error message concerning agent profiles.

Parameters
[in] message the error message to be displayed

Definition at line 210 of file TrafficView.cpp.

211 {
212 ui->agentProfilesError->setText(message);
213 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370

◆ setHomogeneities_ProbabilityError()

void TrafficView::setHomogeneities_ProbabilityError ( bool error )

Method which displays a probability error message for the table of homogeneities if the boolian argument is "true".

Parameters
[in] error the status whether the probabilities are erroneous (true) or not (false)

Definition at line 186 of file TrafficView.cpp.

187 {
188 if(error)
189 ui->Homogeneity_ProbabilityError->setText("probability sum invalid!");
190 else
191 ui->Homogeneity_ProbabilityError->setText("");
192 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370

◆ setName()

void TrafficView::setName ( QString const & _name )

Method which sets the traffic configuration's name to the one passed as an argument.

Parameters
[in] _name the new name for the traffic configuration

Definition at line 47 of file TrafficView.cpp.

48 {
49 ui->NameEdit->setText(_name);
50 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370

◆ setPlatoonRates_ProbabilityError()

void TrafficView::setPlatoonRates_ProbabilityError ( bool error )

Method which displays a probability error message for the table of platoon rates if the boolian argument is "true".

Parameters
[in] error the status whether the probabilities are erroneous (true) or not (false)

Definition at line 178 of file TrafficView.cpp.

179 {
180 if(error)
181 ui->PlatoonRate_ProbabilityError->setText("probability sum invalid!");
182 else
183 ui->PlatoonRate_ProbabilityError->setText("");
184 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370

◆ setRegularLane_ProbabilityError()

void TrafficView::setRegularLane_ProbabilityError ( bool error )

Method which displays a probability error message for the table of regular lane agents if the boolian argument is "true".

Parameters
[in] error the status whether the probabilities are erroneous (true) or not (false)

Definition at line 194 of file TrafficView.cpp.

195 {
196 if(error)
197 ui->RegularLane_ProbabilityError->setText("probability sum invalid!");
198 else
199 ui->RegularLane_ProbabilityError->setText("");
200 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370

◆ setRightmostLane_ProbabilityError()

void TrafficView::setRightmostLane_ProbabilityError ( bool error )

Method which displays a probability error message for the table of rightmost lane agents if the boolian argument is "true".

Parameters
[in] error the status whether the probabilities are erroneous (true) or not (false)

Definition at line 202 of file TrafficView.cpp.

203 {
204 if(error)
205 ui->RightmostLane_ProbabilityError->setText("probability sum invalid!");
206 else
207 ui->RightmostLane_ProbabilityError->setText("");
208 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370

◆ setVelocities_ProbabilityError()

void TrafficView::setVelocities_ProbabilityError ( bool error )

Method which displays a probability error message for the table of velocities if the boolian argument is "true".

Parameters
[in] error the status whether the probabilities are erroneous (true) or not (false)

Definition at line 162 of file TrafficView.cpp.

163 {
164 if(error)
165 ui->Velocity_ProbabilityError->setText("probability sum invalid!");
166 else
167 ui->Velocity_ProbabilityError->setText("");
168 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370

◆ setVolumes_ProbabilityError()

void TrafficView::setVolumes_ProbabilityError ( bool error )

Method which displays a probability error message for the table of traffic volumes if the boolian argument is "true".

Parameters
[in] error the status whether the probabilities are erroneous (true) or not (false)

Definition at line 170 of file TrafficView.cpp.

171 {
172 if(error)
173 ui->Volume_ProbabilityError->setText("probability sum invalid!");
174 else
175 ui->Volume_ProbabilityError->setText("");
176 }
TrafficView::ui
Ui::TrafficView * ui
the ui object containing the GUI elements of this view
Definition: TrafficView.h:370
The documentation for this class was generated from the following files:
  • TrafficView.h
  • TrafficView.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

TrafficView Member List

This is the complete list of members for TrafficView, including all inherited members.

addHomogeneity() | TrafficView | signal
addPlatoonRate() | TrafficView | signal
addRegularLaneAgent() | TrafficView | signal
addRightmostLaneAgent() | TrafficView | signal
addVelocity() | TrafficView | signal
addVolume() | TrafficView | signal
eventFilter(QObject *watched, QEvent *event) | TrafficView | private
getHomogeneitiesView() const | TrafficView |
getPlatoonRatesView() const | TrafficView |
getRegularLaneAgentsView() const | TrafficView |
getRightmostLaneAgentsView() const | TrafficView |
getVelocitiesView() const | TrafficView |
getVolumesView() const | TrafficView |
modifiedName(QString const &_name) | TrafficView | signal
on_addHomogeneity_clicked() | TrafficView | privateslot
on_addPlatoonRate_clicked() | TrafficView | privateslot
on_addRegularLaneAgent_clicked() | TrafficView | privateslot
on_addRightmostLaneAgent_clicked() | TrafficView | privateslot
on_addVelocity_clicked() | TrafficView | privateslot
on_addVolume_clicked() | TrafficView | privateslot
on_NameEdit_editingFinished() | TrafficView | privateslot
on_removeHomogeneity_clicked() | TrafficView | privateslot
on_removePlatoonRate_clicked() | TrafficView | privateslot
on_removeRegularLaneAgent_clicked() | TrafficView | privateslot
on_removeRightmostLaneAgent_clicked() | TrafficView | privateslot
on_removeVelocity_clicked() | TrafficView | privateslot
on_removeVolume_clicked() | TrafficView | privateslot
removeHomogeneity(const int &row) | TrafficView | signal
removePlatoonRate(const int &row) | TrafficView | signal
removeRegularLaneAgent(const int &row) | TrafficView | signal
removeRightmostLaneAgent(const int &row) | TrafficView | signal
removeVelocity(const int &row) | TrafficView | signal
removeVolume(const int &row) | TrafficView | signal
setAgentProfilesError(QString const &message) | TrafficView |
setHomogeneities_ProbabilityError(bool error) | TrafficView |
setName(QString const &_name) | TrafficView |
setPlatoonRates_ProbabilityError(bool error) | TrafficView |
setRegularLane_ProbabilityError(bool error) | TrafficView |
setRightmostLane_ProbabilityError(bool error) | TrafficView |
setVelocities_ProbabilityError(bool error) | TrafficView |
setVolumes_ProbabilityError(bool error) | TrafficView |
ui | TrafficView | private
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentItemInterface Class Reference

Public Types | Public Member Functions | List of all members
VehicleComponentItemInterface Class Referenceabstract

The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a algorithms that will be built into a vehicle with a certain probability. More...

Inheritance diagram for VehicleComponentItemInterface:
VehicleComponentItemModel

Public Types

using | Probability = double
typedef for a probability
using | Profile = VehicleComponentProfileItemInterface
typedef for the profile containing the parameterization
using | Profiles = QMap< Profile *, Probability >
typedef for the map which assigns probabilities to profiles
using | SensorLinks = QMap< unsigned int, QString >
typedef for the map describing sensor links
using | Type = QString
typedef for the component type (= algorithm)

Public Member Functions

virtual Profiles * | getProfiles () const =0
Method which returns the map of profiles assigned to probabilites. More...
virtual SensorLinks * | getSensorLinks () const =0
Method which returns the map of sensor links. More...
virtual Type | getType () const =0
Method which returns type (algorithm) of the vehicle component. More...

Detailed Description

The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a algorithms that will be built into a vehicle with a certain probability.

The stored data comprise the algorithm of the component (type), a profile containing the parameterization together with probabilities for the profile to be instantiated and, finally, sensor links if the component requires sensor data.

Definition at line 42 of file VehicleComponentItemInterface.h.

Member Function Documentation

◆ getProfiles()

virtual Profiles* VehicleComponentItemInterface::getProfiles ( ) const
pure virtual

Method which returns the map of profiles assigned to probabilites.

Returns
the pointer to the map of profiles assigned to probabilities

Implemented in VehicleComponentItemModel.

◆ getSensorLinks()

virtual SensorLinks* VehicleComponentItemInterface::getSensorLinks ( ) const
pure virtual

Method which returns the map of sensor links.

Returns
the pointer to the sensor links

Implemented in VehicleComponentItemModel.

◆ getType()

virtual Type VehicleComponentItemInterface::getType ( ) const
pure virtual

Method which returns type (algorithm) of the vehicle component.

Returns
the type (algorithm) of the vehicle component

Implemented in VehicleComponentItemModel.

The documentation for this class was generated from the following file:
  • VehicleComponentItemInterface.h
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleComponentItemInterface Member List

This is the complete list of members for VehicleComponentItemInterface, including all inherited members.

getProfiles() const =0 | VehicleComponentItemInterface | pure virtual
getSensorLinks() const =0 | VehicleComponentItemInterface | pure virtual
getType() const =0 | VehicleComponentItemInterface | pure virtual
Probability typedef | VehicleComponentItemInterface |
Profile typedef | VehicleComponentItemInterface |
Profiles typedef | VehicleComponentItemInterface |
SensorLinks typedef | VehicleComponentItemInterface |
Type typedef | VehicleComponentItemInterface |
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentItemModel Class Reference

Public Member Functions | Private Attributes | List of all members
VehicleComponentItemModel Class Reference

This class implements the functionality of VehicleComponentItemInterface. More...

Inheritance diagram for VehicleComponentItemModel:
VehicleComponentItemInterface

Public Member Functions

virtual Profiles * | getProfiles () const override
Method which returns the map of profiles assigned to probabilites. More...
virtual SensorLinks * | getSensorLinks () const override
Method which returns the map of sensor links. More...
virtual Type | getType () const override
Method which returns type (algorithm) of the vehicle component. More...

Private Attributes

Profiles *const | profiles
the pointer to the vehicle component profiles
SensorLinks *const | sensorLinks
the pointer to the map defining sensor links

Additional Inherited Members

- Public Types inherited from VehicleComponentItemInterface
using | Probability = double
typedef for a probability
using | Profile = VehicleComponentProfileItemInterface
typedef for the profile containing the parameterization
using | Profiles = QMap< Profile *, Probability >
typedef for the map which assigns probabilities to profiles
using | SensorLinks = QMap< unsigned int, QString >
typedef for the map describing sensor links
using | Type = QString
typedef for the component type (= algorithm)

Detailed Description

This class implements the functionality of VehicleComponentItemInterface.

Definition at line 25 of file VehicleComponentItemModel.h.

Member Function Documentation

◆ getProfiles()

VehicleComponentItemInterface::Profiles * VehicleComponentItemModel::getProfiles ( ) const
overridevirtual

Method which returns the map of profiles assigned to probabilites.

Returns
the pointer to the map of profiles assigned to probabilities

Implements VehicleComponentItemInterface.

Definition at line 34 of file VehicleComponentItemModel.cpp.

35 {
36 return profiles;
37 }
VehicleComponentItemModel::profiles
Profiles *const profiles
the pointer to the vehicle component profiles
Definition: VehicleComponentItemModel.h:41

◆ getSensorLinks()

VehicleComponentItemInterface::SensorLinks * VehicleComponentItemModel::getSensorLinks ( ) const
overridevirtual

Method which returns the map of sensor links.

Returns
the pointer to the sensor links

Implements VehicleComponentItemInterface.

Definition at line 39 of file VehicleComponentItemModel.cpp.

40 {
41 return sensorLinks;
42 }
VehicleComponentItemModel::sensorLinks
SensorLinks *const sensorLinks
the pointer to the map defining sensor links
Definition: VehicleComponentItemModel.h:42

◆ getType()

VehicleComponentItemInterface::Type VehicleComponentItemModel::getType ( ) const
overridevirtual

Method which returns type (algorithm) of the vehicle component.

Returns
the type (algorithm) of the vehicle component

Implements VehicleComponentItemInterface.

Definition at line 27 of file VehicleComponentItemModel.cpp.

28 {
29 VehicleComponentMapInterface const * const map = qobject_cast<VehicleComponentMapInterface const * const > ( parent() );
30
31 return ( (map) ? map->getType( const_cast<VehicleComponentItemModel *> (this) ) : VehicleComponentItemInterface::Type() );
32 }
VehicleComponentMapInterface
This class constitutes a container class for vehicle component data (instances of VehicleComponentIte...
Definition: VehicleComponentMapInterface.h:38
VehicleComponentItemInterface::Type
QString Type
typedef for the component type (= algorithm)
Definition: VehicleComponentItemInterface.h:48
VehicleComponentMapInterface::getType
virtual VehicleComponentMapInterface::Type getType(VehicleComponentMapInterface::Item *const item) const =0
Method wich returns the type of the given vehicle component data object.
The documentation for this class was generated from the following files:
  • VehicleComponentItemModel.h
  • VehicleComponentItemModel.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleComponentItemModel Member List

This is the complete list of members for VehicleComponentItemModel, including all inherited members.

getProfiles() const override | VehicleComponentItemModel | virtual
getSensorLinks() const override | VehicleComponentItemModel | virtual
getType() const override | VehicleComponentItemModel | virtual
Probability typedef | VehicleComponentItemInterface |
Profile typedef | VehicleComponentItemInterface |
profiles | VehicleComponentItemModel | private
Profiles typedef | VehicleComponentItemInterface |
sensorLinks | VehicleComponentItemModel | private
SensorLinks typedef | VehicleComponentItemInterface |
Type typedef | VehicleComponentItemInterface |
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentMapInterface Class Reference

Public Types | Public Member Functions | List of all members
VehicleComponentMapInterface Class Referenceabstract

This class constitutes a container class for vehicle component data (instances of VehicleComponentItemInterface) using the vehicle component's type (i.e. the algorithm it represents) as a key identifier. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...

Inheritance diagram for VehicleComponentMapInterface:
VehicleComponentMapModel

Public Types

using | ConstIterator = Map::ConstIterator
a const iterator of the map (for read-only operations)
using | Item = VehicleComponentItemInterface
typedef for the vehicle component data
using | Iterator = Map::Iterator
an iterator of the map
using | Map = QMap< Type, Item * >
typedef for the map, i.e. the container object of vehicle component data
using | Type = VehicleComponentItemInterface::Type
typedef for the vehicle component's type

Public Member Functions

virtual bool | add (VehicleComponentMapInterface::Type const &type)=0
Method which creates a new vehicle component data object (instance of VehicleComponentItemInterface) and adds it to the map under the given type. More...
virtual VehicleComponentMapInterface::Iterator | begin ()=0
Gets an iterator pointing to the first vehicle component data in the map. More...
virtual void | clear ()=0
Method which deletes all registered vehicle component data objects and clears the map.
virtual VehicleComponentMapInterface::ConstIterator | constBegin () const =0
Gets an iterator pointing to the first vehicle component data object in the map (use for read-only since pointing at constant values). More...
virtual VehicleComponentMapInterface::ConstIterator | constEnd () const =0
Gets an iterator pointing at the end of the map after the last vehicle component data object (use for read-only). More...
virtual bool | contains (VehicleComponentMapInterface::Type const &type) const =0
Method wich checks whether the map contains a vehicle component data object with the given type. More...
virtual int | count () const =0
Method which returns the number of vehicle component data objects in the map. More...
virtual VehicleComponentMapInterface::Iterator | end ()=0
Gets an iterator pointing to the end of the map after the last vehicle component data object. More...
virtual VehicleComponentMapInterface::Item * | getItem (VehicleComponentMapInterface::Type const &type) const =0
Method which returns a pointer to the vehicle component data object of the given type. If the map does not contain a vehicle component data object of that type, nullptr is returned. More...
virtual VehicleComponentMapInterface::Type | getType (VehicleComponentMapInterface::Item *const item) const =0
Method wich returns the type of the given vehicle component data object. More...
virtual QStringList | keys () const =0
Method which returns the list of all vehicle component types in the map. More...
virtual bool | remove (VehicleComponentMapInterface::Type const &type)=0
Method which removes the vehicle component data object with the given type from the map. The object is deleted after removing. Nothing will be done if there is no such profile. More...
virtual void | setType (VehicleComponentMapInterface::Item *const item, VehicleComponentMapInterface::Type const &type)=0
Method wich changes the type of the given vehicle component data object to the one passed as second argument. More...
virtual QList< Item * > | values () const =0
Method which returns a list of pointers to all vehicle component data objects in the map. More...

Detailed Description

This class constitutes a container class for vehicle component data (instances of VehicleComponentItemInterface) using the vehicle component's type (i.e. the algorithm it represents) as a key identifier. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.

Definition at line 38 of file VehicleComponentMapInterface.h.

Member Function Documentation

◆ add()

virtual bool VehicleComponentMapInterface::add ( VehicleComponentMapInterface::Type const & type )
pure virtual

Method which creates a new vehicle component data object (instance of VehicleComponentItemInterface) and adds it to the map under the given type.

Parameters
[in] type the type under which the newly created item is registered
Returns
"true", if type is not used already, otherwise "false"

Implemented in VehicleComponentMapModel.

◆ begin()

virtual VehicleComponentMapInterface::Iterator VehicleComponentMapInterface::begin ( )
pure virtual

Gets an iterator pointing to the first vehicle component data in the map.

Returns
The iterator pointing at the first object in the map.

Implemented in VehicleComponentMapModel.

◆ constBegin()

virtual VehicleComponentMapInterface::ConstIterator VehicleComponentMapInterface::constBegin ( ) const
pure virtual

Gets an iterator pointing to the first vehicle component data object in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implemented in VehicleComponentMapModel.

◆ constEnd()

virtual VehicleComponentMapInterface::ConstIterator VehicleComponentMapInterface::constEnd ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last vehicle component data object (use for read-only).

Returns
The iterator pointing at the end of the map.

Implemented in VehicleComponentMapModel.

◆ contains()

virtual bool VehicleComponentMapInterface::contains ( VehicleComponentMapInterface::Type const & type ) const
pure virtual

Method wich checks whether the map contains a vehicle component data object with the given type.

Parameters
[in] type the type to be searched for
Returns
true, if object with given type exists, otherwise false.

Implemented in VehicleComponentMapModel.

◆ count()

virtual int VehicleComponentMapInterface::count ( ) const
pure virtual

Method which returns the number of vehicle component data objects in the map.

Returns
the number of vehicle component data objects in the map

Implemented in VehicleComponentMapModel.

◆ end()

virtual VehicleComponentMapInterface::Iterator VehicleComponentMapInterface::end ( )
pure virtual

Gets an iterator pointing to the end of the map after the last vehicle component data object.

Returns
The iterator pointing at the end of the map.

Implemented in VehicleComponentMapModel.

◆ getItem()

virtual VehicleComponentMapInterface::Item* VehicleComponentMapInterface::getItem ( VehicleComponentMapInterface::Type const & type ) const
pure virtual

Method which returns a pointer to the vehicle component data object of the given type. If the map does not contain a vehicle component data object of that type, nullptr is returned.

Parameters
[in] type the type of the vehicle component data object to be returned
Returns
the pointer to a vehicle component data object of given type, nullptr if no such type exists

Implemented in VehicleComponentMapModel.

◆ getType()

virtual VehicleComponentMapInterface::Type VehicleComponentMapInterface::getType ( VehicleComponentMapInterface::Item *const item ) const
pure virtual

Method wich returns the type of the given vehicle component data object.

Parameters
[in] item the pointer to the vehicle component data in question
Returns
the type of the given vehicle component data

Implemented in VehicleComponentMapModel.

◆ keys()

virtual QStringList VehicleComponentMapInterface::keys ( ) const
pure virtual

Method which returns the list of all vehicle component types in the map.

Returns
the list of all vehicle component data types

Implemented in VehicleComponentMapModel.

◆ remove()

virtual bool VehicleComponentMapInterface::remove ( VehicleComponentMapInterface::Type const & type )
pure virtual

Method which removes the vehicle component data object with the given type from the map. The object is deleted after removing. Nothing will be done if there is no such profile.

Parameters
[in] type the type of the vehicle component data to be removed
Returns
"true", if type exists in the map, otherwise "false"

Implemented in VehicleComponentMapModel.

◆ setType()

virtual void VehicleComponentMapInterface::setType | ( | VehicleComponentMapInterface::Item *const | item,
 |  | VehicleComponentMapInterface::Type const & | type
 | ) |  |
pure virtual

Method wich changes the type of the given vehicle component data object to the one passed as second argument.

Parameters
[in] | item | the pointer to the vehicle component data object whose type should be changed
[in] | type | the new type of the vehicle component data object

Implemented in VehicleComponentMapModel.

◆ values()

virtual QList<Item*> VehicleComponentMapInterface::values ( ) const
pure virtual

Method which returns a list of pointers to all vehicle component data objects in the map.

Returns
the list of pointers to all vehicle component data objects

Implemented in VehicleComponentMapModel.

The documentation for this class was generated from the following file:
  • VehicleComponentMapInterface.h
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleComponentMapInterface Member List

This is the complete list of members for VehicleComponentMapInterface, including all inherited members.

add(VehicleComponentMapInterface::Type const &type)=0 | VehicleComponentMapInterface | pure virtual
begin()=0 | VehicleComponentMapInterface | pure virtual
clear()=0 | VehicleComponentMapInterface | pure virtual
constBegin() const =0 | VehicleComponentMapInterface | pure virtual
constEnd() const =0 | VehicleComponentMapInterface | pure virtual
ConstIterator typedef | VehicleComponentMapInterface |
contains(VehicleComponentMapInterface::Type const &type) const =0 | VehicleComponentMapInterface | pure virtual
count() const =0 | VehicleComponentMapInterface | pure virtual
end()=0 | VehicleComponentMapInterface | pure virtual
getItem(VehicleComponentMapInterface::Type const &type) const =0 | VehicleComponentMapInterface | pure virtual
getType(VehicleComponentMapInterface::Item *const item) const =0 | VehicleComponentMapInterface | pure virtual
Item typedef | VehicleComponentMapInterface |
Iterator typedef | VehicleComponentMapInterface |
keys() const =0 | VehicleComponentMapInterface | pure virtual
Map typedef | VehicleComponentMapInterface |
remove(VehicleComponentMapInterface::Type const &type)=0 | VehicleComponentMapInterface | pure virtual
setType(VehicleComponentMapInterface::Item *const item, VehicleComponentMapInterface::Type const &type)=0 | VehicleComponentMapInterface | pure virtual
Type typedef | VehicleComponentMapInterface |
values() const =0 | VehicleComponentMapInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentMapModel Class Reference

Public Member Functions | Private Attributes | List of all members
VehicleComponentMapModel Class Reference

This class implements the functionality of VehicleComponentMapInterface. More...

Inheritance diagram for VehicleComponentMapModel:
VehicleComponentMapInterface

Public Member Functions

virtual bool | add (VehicleComponentMapInterface::Type const &type) override
Method which creates a new vehicle component data object (instance of VehicleComponentItemInterface) and adds it to the map under the given type. More...
virtual VehicleComponentMapInterface::Iterator | begin () override
Gets an iterator pointing to the first vehicle component data in the map. More...
virtual void | clear () override
Method which deletes all registered vehicle component data objects and clears the map.
virtual VehicleComponentMapInterface::ConstIterator | constBegin () const override
Gets an iterator pointing to the first vehicle component data object in the map (use for read-only since pointing at constant values). More...
virtual VehicleComponentMapInterface::ConstIterator | constEnd () const override
Gets an iterator pointing at the end of the map after the last vehicle component data object (use for read-only). More...
virtual bool | contains (VehicleComponentMapInterface::Type const &type) const override
Method wich checks whether the map contains a vehicle component data object with the given type. More...
virtual int | count () const override
Method which returns the number of vehicle component data objects in the map. More...
virtual VehicleComponentMapInterface::Iterator | end () override
Gets an iterator pointing to the end of the map after the last vehicle component data object. More...
virtual VehicleComponentMapInterface::Item * | getItem (VehicleComponentMapInterface::Type const &type) const override
Method which returns a pointer to the vehicle component data object of the given type. If the map does not contain a vehicle component data object of that type, nullptr is returned. More...
virtual VehicleComponentMapInterface::Type | getType (VehicleComponentMapInterface::Item *const item) const override
Method wich returns the type of the given vehicle component data object. More...
virtual QStringList | keys () const override
Method which returns the list of all vehicle component types in the map. More...
virtual bool | remove (VehicleComponentMapInterface::Type const &type) override
Method which removes the vehicle component data object with the given type from the map. The object is deleted after removing. Nothing will be done if there is no such profile. More...
virtual void | setType (VehicleComponentMapInterface::Item *const item, VehicleComponentMapInterface::Type const &type) override
Method wich changes the type of the given vehicle component data object to the one passed as second argument. More...
virtual QList< Item * > | values () const override
Method which returns a list of pointers to all vehicle component data objects in the map. More...

Private Attributes

VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components

Additional Inherited Members

- Public Types inherited from VehicleComponentMapInterface
using | ConstIterator = Map::ConstIterator
a const iterator of the map (for read-only operations)
using | Item = VehicleComponentItemInterface
typedef for the vehicle component data
using | Iterator = Map::Iterator
an iterator of the map
using | Map = QMap< Type, Item * >
typedef for the map, i.e. the container object of vehicle component data
using | Type = VehicleComponentItemInterface::Type
typedef for the vehicle component's type

Detailed Description

This class implements the functionality of VehicleComponentMapInterface.

Definition at line 25 of file VehicleComponentMapModel.h.

Member Function Documentation

◆ add()

bool VehicleComponentMapModel::add ( VehicleComponentMapInterface::Type const & type )
overridevirtual

Method which creates a new vehicle component data object (instance of VehicleComponentItemInterface) and adds it to the map under the given type.

Parameters
[in] type the type under which the newly created item is registered
Returns
"true", if type is not used already, otherwise "false"

Implements VehicleComponentMapInterface.

Definition at line 43 of file VehicleComponentMapModel.cpp.

44 {
45 if(!contains(type))
46 {
47 components.insert(type, new VehicleComponentItemModel(this));
48 return true;
49 }
50
51 return false;
52 }
VehicleComponentItemModel
This class implements the functionality of VehicleComponentItemInterface.
Definition: VehicleComponentItemModel.h:25
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68
VehicleComponentMapModel::contains
virtual bool contains(VehicleComponentMapInterface::Type const &type) const override
Method wich checks whether the map contains a vehicle component data object with the given type...
Definition: VehicleComponentMapModel.cpp:90

◆ begin()

VehicleComponentMapInterface::Iterator VehicleComponentMapModel::begin ( )
overridevirtual

Gets an iterator pointing to the first vehicle component data in the map.

Returns
The iterator pointing at the first object in the map.

Implements VehicleComponentMapInterface.

Definition at line 22 of file VehicleComponentMapModel.cpp.

23 {
24 return components.begin();
25 }
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68

◆ constBegin()

VehicleComponentMapInterface::ConstIterator VehicleComponentMapModel::constBegin ( ) const
overridevirtual

Gets an iterator pointing to the first vehicle component data object in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implements VehicleComponentMapInterface.

Definition at line 27 of file VehicleComponentMapModel.cpp.

28 {
29 return components.constBegin();
30 }
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68

◆ constEnd()

VehicleComponentMapInterface::ConstIterator VehicleComponentMapModel::constEnd ( ) const
overridevirtual

Gets an iterator pointing at the end of the map after the last vehicle component data object (use for read-only).

Returns
The iterator pointing at the end of the map.

Implements VehicleComponentMapInterface.

Definition at line 37 of file VehicleComponentMapModel.cpp.

38 {
39 return components.constEnd();
40 }
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68

◆ contains()

bool VehicleComponentMapModel::contains ( VehicleComponentMapInterface::Type const & type ) const
overridevirtual

Method wich checks whether the map contains a vehicle component data object with the given type.

Parameters
[in] type the type to be searched for
Returns
true, if object with given type exists, otherwise false.

Implements VehicleComponentMapInterface.

Definition at line 90 of file VehicleComponentMapModel.cpp.

91 {
92 return components.contains(type);
93 }
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68

◆ count()

int VehicleComponentMapModel::count ( ) const
overridevirtual

Method which returns the number of vehicle component data objects in the map.

Returns
the number of vehicle component data objects in the map

Implements VehicleComponentMapInterface.

Definition at line 105 of file VehicleComponentMapModel.cpp.

106 {
107 return components.count();
108 }
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68

◆ end()

VehicleComponentMapInterface::Iterator VehicleComponentMapModel::end ( )
overridevirtual

Gets an iterator pointing to the end of the map after the last vehicle component data object.

Returns
The iterator pointing at the end of the map.

Implements VehicleComponentMapInterface.

Definition at line 32 of file VehicleComponentMapModel.cpp.

33 {
34 return components.end();
35 }
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68

◆ getItem()

VehicleComponentMapInterface::Item * VehicleComponentMapModel::getItem ( VehicleComponentMapInterface::Type const & type ) const
overridevirtual

Method which returns a pointer to the vehicle component data object of the given type. If the map does not contain a vehicle component data object of that type, nullptr is returned.

Parameters
[in] type the type of the vehicle component data object to be returned
Returns
the pointer to a vehicle component data object of given type, nullptr if no such type exists

Implements VehicleComponentMapInterface.

Definition at line 65 of file VehicleComponentMapModel.cpp.

66 {
67 if(contains(type))
68 return components.value(type);
69
70 return nullptr;
71 }
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68
VehicleComponentMapModel::contains
virtual bool contains(VehicleComponentMapInterface::Type const &type) const override
Method wich checks whether the map contains a vehicle component data object with the given type...
Definition: VehicleComponentMapModel.cpp:90

◆ getType()

VehicleComponentMapInterface::Type VehicleComponentMapModel::getType ( VehicleComponentMapInterface::Item *const item ) const
overridevirtual

Method wich returns the type of the given vehicle component data object.

Parameters
[in] item the pointer to the vehicle component data in question
Returns
the type of the given vehicle component data

Implements VehicleComponentMapInterface.

Definition at line 74 of file VehicleComponentMapModel.cpp.

75 {
76 return components.key(item);
77 }
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68

◆ keys()

QStringList VehicleComponentMapModel::keys ( ) const
overridevirtual

Method which returns the list of all vehicle component types in the map.

Returns
the list of all vehicle component data types

Implements VehicleComponentMapInterface.

Definition at line 95 of file VehicleComponentMapModel.cpp.

96 {
97 return QStringList(components.keys() );
98 }
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68

◆ remove()

bool VehicleComponentMapModel::remove ( VehicleComponentMapInterface::Type const & type )
overridevirtual

Method which removes the vehicle component data object with the given type from the map. The object is deleted after removing. Nothing will be done if there is no such profile.

Parameters
[in] type the type of the vehicle component data to be removed
Returns
"true", if type exists in the map, otherwise "false"

Implements VehicleComponentMapInterface.

Definition at line 54 of file VehicleComponentMapModel.cpp.

55 {
56 if(contains(type))
57 {
58 delete components.take(type);
59 return true;
60 }
61
62 return false;
63 }
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68
VehicleComponentMapModel::contains
virtual bool contains(VehicleComponentMapInterface::Type const &type) const override
Method wich checks whether the map contains a vehicle component data object with the given type...
Definition: VehicleComponentMapModel.cpp:90

◆ setType()

void VehicleComponentMapModel::setType | ( | VehicleComponentMapInterface::Item *const | item,
 |  | VehicleComponentMapInterface::Type const & | type
 | ) |  |
overridevirtual

Method wich changes the type of the given vehicle component data object to the one passed as second argument.

Parameters
[in] | item | the pointer to the vehicle component data object whose type should be changed
[in] | type | the new type of the vehicle component data object

Implements VehicleComponentMapInterface.

Definition at line 79 of file VehicleComponentMapModel.cpp.

81 {
82
83 Type oldType = item->getType();
84
85 components.take(oldType);
86 components.insert(type, item);
87 }
VehicleComponentItemInterface::getType
virtual Type getType() const =0
Method which returns type (algorithm) of the vehicle component.
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68
VehicleComponentMapInterface::Type
VehicleComponentItemInterface::Type Type
typedef for the vehicle component&#39;s type
Definition: VehicleComponentMapInterface.h:43

◆ values()

QList< VehicleComponentItemInterface * > VehicleComponentMapModel::values ( ) const
overridevirtual

Method which returns a list of pointers to all vehicle component data objects in the map.

Returns
the list of pointers to all vehicle component data objects

Implements VehicleComponentMapInterface.

Definition at line 100 of file VehicleComponentMapModel.cpp.

101 {
102 return components.values();
103 }
VehicleComponentMapModel::components
VehicleComponentMapInterface::Map components
the map (container) for registering vehicle components
Definition: VehicleComponentMapModel.h:68
The documentation for this class was generated from the following files:
  • VehicleComponentMapModel.h
  • VehicleComponentMapModel.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleComponentMapModel Member List

This is the complete list of members for VehicleComponentMapModel, including all inherited members.

add(VehicleComponentMapInterface::Type const &type) override | VehicleComponentMapModel | virtual
begin() override | VehicleComponentMapModel | virtual
clear() override | VehicleComponentMapModel | virtual
components | VehicleComponentMapModel | private
constBegin() const override | VehicleComponentMapModel | virtual
constEnd() const override | VehicleComponentMapModel | virtual
ConstIterator typedef | VehicleComponentMapInterface |
contains(VehicleComponentMapInterface::Type const &type) const override | VehicleComponentMapModel | virtual
count() const override | VehicleComponentMapModel | virtual
end() override | VehicleComponentMapModel | virtual
getItem(VehicleComponentMapInterface::Type const &type) const override | VehicleComponentMapModel | virtual
getType(VehicleComponentMapInterface::Item *const item) const override | VehicleComponentMapModel | virtual
Item typedef | VehicleComponentMapInterface |
Iterator typedef | VehicleComponentMapInterface |
keys() const override | VehicleComponentMapModel | virtual
Map typedef | VehicleComponentMapInterface |
remove(VehicleComponentMapInterface::Type const &type) override | VehicleComponentMapModel | virtual
setType(VehicleComponentMapInterface::Item *const item, VehicleComponentMapInterface::Type const &type) override | VehicleComponentMapModel | virtual
Type typedef | VehicleComponentMapInterface |
values() const override | VehicleComponentMapModel | virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileItemInterface Class Reference

Public Types | Public Member Functions | List of all members
VehicleComponentProfileItemInterface Class Referenceabstract

This class defines vehicle component profiles which contain the parameterization of a vehicle component, i.e. an instance of the VehicleComponentItemInterface class. More...

Inheritance diagram for VehicleComponentProfileItemInterface:
VehicleComponentProfileItemModel

Public Types

using | Name = QString
typedef for the name of the profile
using | Parameters = ParameterMapInterface
typedef for the parameter map
using | Type = QString
typedef for the type (algorithm) of the corresponding vehicle component

Public Member Functions

virtual Name | getName () const =0
Method which returns the name of the vehicle component profile. More...
virtual Parameters * | getParameters () const =0
Method which returns the parameter map of the vehicle component profile. More...
virtual Type | getType () const =0
Method which returns the type of the corresponding vehicle component. More...

Detailed Description

This class defines vehicle component profiles which contain the parameterization of a vehicle component, i.e. an instance of the VehicleComponentItemInterface class.

The profiles are characterized by a name and the type of the vehicle component (algorithm) they correspond to. Further, the profiles access the parameter map.

Definition at line 40 of file VehicleComponentProfileItemInterface.h.

Member Function Documentation

◆ getName()

virtual Name VehicleComponentProfileItemInterface::getName ( ) const
pure virtual

Method which returns the name of the vehicle component profile.

Returns
the vehicle component profile's name

Implemented in VehicleComponentProfileItemModel.

◆ getParameters()

virtual Parameters* VehicleComponentProfileItemInterface::getParameters ( ) const
pure virtual

Method which returns the parameter map of the vehicle component profile.

Returns
the vehicle component profile's parameter map

Implemented in VehicleComponentProfileItemModel.

◆ getType()

virtual Type VehicleComponentProfileItemInterface::getType ( ) const
pure virtual

Method which returns the type of the corresponding vehicle component.

Returns
the type of the corresponding vehicle component

Implemented in VehicleComponentProfileItemModel.

The documentation for this class was generated from the following file:
  • VehicleComponentProfileItemInterface.h
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleComponentProfileItemInterface Member List

This is the complete list of members for VehicleComponentProfileItemInterface, including all inherited members.

getName() const =0 | VehicleComponentProfileItemInterface | pure virtual
getParameters() const =0 | VehicleComponentProfileItemInterface | pure virtual
getType() const =0 | VehicleComponentProfileItemInterface | pure virtual
Name typedef | VehicleComponentProfileItemInterface |
Parameters typedef | VehicleComponentProfileItemInterface |
Type typedef | VehicleComponentProfileItemInterface |
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileItemModel Class Reference

Public Member Functions | Private Attributes | List of all members
VehicleComponentProfileItemModel Class Reference

This class implements the functionality of VehicleComponentProfileItemInterface. More...

Inheritance diagram for VehicleComponentProfileItemModel:
VehicleComponentProfileItemInterface

Public Member Functions

virtual Name | getName () const override
Method which returns the name of the vehicle component profile. More...
virtual Parameters * | getParameters () const override
Method which returns the parameter map of the vehicle component profile. More...
virtual Type | getType () const override
Method which returns the type of the corresponding vehicle component. More...

Private Attributes

Parameters *const parameters
the pointer to the parameter map of this profile

Additional Inherited Members

- Public Types inherited from VehicleComponentProfileItemInterface
using | Name = QString
typedef for the name of the profile
using | Parameters = ParameterMapInterface
typedef for the parameter map
using | Type = QString
typedef for the type (algorithm) of the corresponding vehicle component

Detailed Description

This class implements the functionality of VehicleComponentProfileItemInterface.

Definition at line 25 of file VehicleComponentProfileItemModel.h.

Member Function Documentation

◆ getName()

VehicleComponentProfileItemInterface::Name VehicleComponentProfileItemModel::getName ( ) const
overridevirtual

Method which returns the name of the vehicle component profile.

Returns
the vehicle component profile's name

Implements VehicleComponentProfileItemInterface.

Definition at line 26 of file VehicleComponentProfileItemModel.cpp.

27 {
28 VehicleComponentProfileMapInterface const * const map = qobject_cast<VehicleComponentProfileMapInterface const * const > ( parent() );
29
30 return ( (map) ? map->getID( const_cast<VehicleComponentProfileItemModel *> (this) ).first : VehicleComponentProfileItemInterface::Name() );
31 }
VehicleComponentProfileMapInterface::getID
virtual VehicleComponentProfileMapInterface::ID getID(VehicleComponentProfileMapInterface::Item *const item) const =0
Method wich returns the Id of the given vehicle component profile.
VehicleComponentProfileItemInterface::Name
QString Name
typedef for the name of the profile
Definition: VehicleComponentProfileItemInterface.h:46
VehicleComponentProfileMapInterface
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
Definition: VehicleComponentProfileMapInterface.h:41

◆ getParameters()

VehicleComponentProfileItemInterface::Parameters * VehicleComponentProfileItemModel::getParameters ( ) const
overridevirtual

Method which returns the parameter map of the vehicle component profile.

Returns
the vehicle component profile's parameter map

Implements VehicleComponentProfileItemInterface.

Definition at line 42 of file VehicleComponentProfileItemModel.cpp.

43 {
44 return parameters;
45 }
VehicleComponentProfileItemModel::parameters
Parameters *const parameters
the pointer to the parameter map of this profile
Definition: VehicleComponentProfileItemModel.h:42

◆ getType()

VehicleComponentProfileItemInterface::Type VehicleComponentProfileItemModel::getType ( ) const
overridevirtual

Method which returns the type of the corresponding vehicle component.

Returns
the type of the corresponding vehicle component

Implements VehicleComponentProfileItemInterface.

Definition at line 34 of file VehicleComponentProfileItemModel.cpp.

35 {
36 VehicleComponentProfileMapInterface const * const map = qobject_cast<VehicleComponentProfileMapInterface const * const > ( parent() );
37
38 return ( (map) ? map->getID( const_cast<VehicleComponentProfileItemModel *> (this) ).second : VehicleComponentProfileItemInterface::Type() );
39 }
VehicleComponentProfileItemInterface::Type
QString Type
typedef for the type (algorithm) of the corresponding vehicle component
Definition: VehicleComponentProfileItemInterface.h:47
VehicleComponentProfileMapInterface::getID
virtual VehicleComponentProfileMapInterface::ID getID(VehicleComponentProfileMapInterface::Item *const item) const =0
Method wich returns the Id of the given vehicle component profile.
VehicleComponentProfileMapInterface
This class constitutes a container class for vehicle component profiles (instances of VehicleComponen...
Definition: VehicleComponentProfileMapInterface.h:41
The documentation for this class was generated from the following files:
  • VehicleComponentProfileItemModel.h
  • VehicleComponentProfileItemModel.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleComponentProfileItemModel Member List

This is the complete list of members for VehicleComponentProfileItemModel, including all inherited members.

getName() const override | VehicleComponentProfileItemModel | virtual
getParameters() const override | VehicleComponentProfileItemModel | virtual
getType() const override | VehicleComponentProfileItemModel | virtual
Name typedef | VehicleComponentProfileItemInterface |
Parameters typedef | VehicleComponentProfileItemInterface |
parameters | VehicleComponentProfileItemModel | private
Type typedef | VehicleComponentProfileItemInterface |
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileMapInterface Class Reference

Public Types | Public Member Functions | List of all members
VehicleComponentProfileMapInterface Class Referenceabstract

This class constitutes a container class for vehicle component profiles (instances of VehicleComponentProfileItemInterface). As a key identifier the pair of the profile's name and type (corrsponding to to the implementation/algorithm of the vehicle component) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map. More...

Inheritance diagram for VehicleComponentProfileMapInterface:
VehicleComponentProfileMapModel

Public Types

using | ConstIterator = Map::ConstIterator
a const iterator of the map (for read-only operations)
using | ID = QPair< Name, Type >
typedef for the pair of name and type used as an Id
using | Item = VehicleComponentProfileItemInterface
typedef for the vehicle component profile
using | Iterator = Map::Iterator
an iterator of the map
using | Map = QMap< ID, Item * >
typedef for the map, i.e. the container object of vehicle component profiles
using | Name = VehicleComponentProfileItemInterface::Name
typedef for the vehicle component profiles name
using | Type = VehicleComponentProfileItemInterface::Type
typedef for the sensor type (i.e. its algorithm/implementation)

Public Member Functions

virtual bool | add (VehicleComponentProfileMapInterface::ID const &id)=0
Method which creates a new vehicle component profile (instance of VehicleComponentProfileItemInterface) and adds it to the map under the given Id. More...
virtual VehicleComponentProfileMapInterface::Iterator | begin ()=0
Gets an iterator pointing to the first vehicle component profile in the map. More...
virtual void | clear ()=0
Method which deletes all registered vehicle component profiles and clears the map.
virtual VehicleComponentProfileMapInterface::ConstIterator | constBegin () const =0
Gets an iterator pointing to the first vehicle component profile in the map (use for read-only since pointing at constant values). More...
virtual VehicleComponentProfileMapInterface::ConstIterator | constEnd () const =0
Gets an iterator pointing at the end of the map after the last vehicle component profile (use for read-only). More...
virtual bool | contains (VehicleComponentProfileMapInterface::ID const &id) const =0
Method wich checks whether the map contains a vehicle component profile with the given Id. More...
virtual int | count () const =0
Method which returns the number of vehicle component profiles in the map. More...
virtual VehicleComponentProfileMapInterface::Iterator | end ()=0
Gets an iterator pointing to the end of the map after the last vehicle component profile. More...
virtual VehicleComponentProfileMapInterface::ID | getID (VehicleComponentProfileMapInterface::Item *const item) const =0
Method wich returns the Id of the given vehicle component profile. More...
virtual VehicleComponentProfileMapInterface::Item * | getItem (VehicleComponentProfileMapInterface::ID const &id) const =0
Method which returns a pointer to the vehicle component profile with the given Id. If the map does not contain a vehicle component profile with this Id, nullptr is returned. More...
virtual QList< ID > | keys () const =0
Method which returns the list of all vehicle component profile Ids in the map. More...
virtual bool | remove (VehicleComponentProfileMapInterface::ID const &id)=0
Method which removes the vehicle component profile with the given Id from the map. The profile is deleted after removing. Nothing will be done if there is no such profile. More...
virtual void | setID (VehicleComponentProfileMapInterface::Item *const item, VehicleComponentProfileMapInterface::ID const &id)=0
Method wich changes the Id of the given vehicle component profile to the one passed as second argument. More...
virtual QList< Item * > | values () const =0
Method which returns a list of pointers to all vehicle component profiles in the map. More...

Detailed Description

This class constitutes a container class for vehicle component profiles (instances of VehicleComponentProfileItemInterface). As a key identifier the pair of the profile's name and type (corrsponding to to the implementation/algorithm of the vehicle component) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.

Definition at line 41 of file VehicleComponentProfileMapInterface.h.

Member Function Documentation

◆ add()

virtual bool VehicleComponentProfileMapInterface::add ( VehicleComponentProfileMapInterface::ID const & id )
pure virtual

Method which creates a new vehicle component profile (instance of VehicleComponentProfileItemInterface) and adds it to the map under the given Id.

Parameters
[in] Id the Id under which the newly created item is registered
Returns
"true", if Id is not used already, otherwise "false"

Implemented in VehicleComponentProfileMapModel.

◆ begin()

virtual VehicleComponentProfileMapInterface::Iterator VehicleComponentProfileMapInterface::begin ( )
pure virtual

Gets an iterator pointing to the first vehicle component profile in the map.

Returns
The iterator pointing at the first object in the map.

Implemented in VehicleComponentProfileMapModel.

◆ constBegin()

virtual VehicleComponentProfileMapInterface::ConstIterator VehicleComponentProfileMapInterface::constBegin ( ) const
pure virtual

Gets an iterator pointing to the first vehicle component profile in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implemented in VehicleComponentProfileMapModel.

◆ constEnd()

virtual VehicleComponentProfileMapInterface::ConstIterator VehicleComponentProfileMapInterface::constEnd ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last vehicle component profile (use for read-only).

Returns
The iterator pointing at the end of the map.

Implemented in VehicleComponentProfileMapModel.

◆ contains()

virtual bool VehicleComponentProfileMapInterface::contains ( VehicleComponentProfileMapInterface::ID const & id ) const
pure virtual

Method wich checks whether the map contains a vehicle component profile with the given Id.

Parameters
[in] Id the Id to be searched for
Returns
true, if profile with given Id exists, otherwise false.

Implemented in VehicleComponentProfileMapModel.

◆ count()

virtual int VehicleComponentProfileMapInterface::count ( ) const
pure virtual

Method which returns the number of vehicle component profiles in the map.

Returns
the number of vehicle component profiles in the map

Implemented in VehicleComponentProfileMapModel.

◆ end()

virtual VehicleComponentProfileMapInterface::Iterator VehicleComponentProfileMapInterface::end ( )
pure virtual

Gets an iterator pointing to the end of the map after the last vehicle component profile.

Returns
The iterator pointing at the end of the map.

Implemented in VehicleComponentProfileMapModel.

◆ getID()

virtual VehicleComponentProfileMapInterface::ID VehicleComponentProfileMapInterface::getID ( VehicleComponentProfileMapInterface::Item *const item ) const
pure virtual

Method wich returns the Id of the given vehicle component profile.

Parameters
[in] item the pointer to the vehicle component profile in question
Returns
the Id of the given vehicle component profile

Implemented in VehicleComponentProfileMapModel.

◆ getItem()

virtual VehicleComponentProfileMapInterface::Item* VehicleComponentProfileMapInterface::getItem ( VehicleComponentProfileMapInterface::ID const & id ) const
pure virtual

Method which returns a pointer to the vehicle component profile with the given Id. If the map does not contain a vehicle component profile with this Id, nullptr is returned.

Parameters
[in] Id the Id of the vehicle component profile to be returned
Returns
the pointer to a vehicle component profile of given Id, nullptr if given Id does not exist in the map

Implemented in VehicleComponentProfileMapModel.

◆ keys()

virtual QList<ID> VehicleComponentProfileMapInterface::keys ( ) const
pure virtual

Method which returns the list of all vehicle component profile Ids in the map.

Returns
the list of all vehicle component profile Ids

Implemented in VehicleComponentProfileMapModel.

◆ remove()

virtual bool VehicleComponentProfileMapInterface::remove ( VehicleComponentProfileMapInterface::ID const & id )
pure virtual

Method which removes the vehicle component profile with the given Id from the map. The profile is deleted after removing. Nothing will be done if there is no such profile.

Parameters
[in] Id the Id of the vehicle component profile to be removed
Returns
"true", if Id exists in the map, otherwise "false"

Implemented in VehicleComponentProfileMapModel.

◆ setID()

virtual void VehicleComponentProfileMapInterface::setID | ( | VehicleComponentProfileMapInterface::Item *const | item,
 |  | VehicleComponentProfileMapInterface::ID const & | id
 | ) |  |
pure virtual

Method wich changes the Id of the given vehicle component profile to the one passed as second argument.

Parameters
[in] | item | the pointer to the vehicle component profile whose id should be changed
[in] | Id | the new Id of the vehicle component profile

Implemented in VehicleComponentProfileMapModel.

◆ values()

virtual QList<Item*> VehicleComponentProfileMapInterface::values ( ) const
pure virtual

Method which returns a list of pointers to all vehicle component profiles in the map.

Returns
the list of pointers to all vehicle component profiles

Implemented in VehicleComponentProfileMapModel.

The documentation for this class was generated from the following file:
  • VehicleComponentProfileMapInterface.h
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleComponentProfileMapInterface Member List

This is the complete list of members for VehicleComponentProfileMapInterface, including all inherited members.

add(VehicleComponentProfileMapInterface::ID const &id)=0 | VehicleComponentProfileMapInterface | pure virtual
begin()=0 | VehicleComponentProfileMapInterface | pure virtual
clear()=0 | VehicleComponentProfileMapInterface | pure virtual
constBegin() const =0 | VehicleComponentProfileMapInterface | pure virtual
constEnd() const =0 | VehicleComponentProfileMapInterface | pure virtual
ConstIterator typedef | VehicleComponentProfileMapInterface |
contains(VehicleComponentProfileMapInterface::ID const &id) const =0 | VehicleComponentProfileMapInterface | pure virtual
count() const =0 | VehicleComponentProfileMapInterface | pure virtual
end()=0 | VehicleComponentProfileMapInterface | pure virtual
getID(VehicleComponentProfileMapInterface::Item *const item) const =0 | VehicleComponentProfileMapInterface | pure virtual
getItem(VehicleComponentProfileMapInterface::ID const &id) const =0 | VehicleComponentProfileMapInterface | pure virtual
ID typedef | VehicleComponentProfileMapInterface |
Item typedef | VehicleComponentProfileMapInterface |
Iterator typedef | VehicleComponentProfileMapInterface |
keys() const =0 | VehicleComponentProfileMapInterface | pure virtual
Map typedef | VehicleComponentProfileMapInterface |
Name typedef | VehicleComponentProfileMapInterface |
remove(VehicleComponentProfileMapInterface::ID const &id)=0 | VehicleComponentProfileMapInterface | pure virtual
setID(VehicleComponentProfileMapInterface::Item *const item, VehicleComponentProfileMapInterface::ID const &id)=0 | VehicleComponentProfileMapInterface | pure virtual
Type typedef | VehicleComponentProfileMapInterface |
values() const =0 | VehicleComponentProfileMapInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleComponentProfileMapModel Class Reference

Public Member Functions | Private Attributes | List of all members
VehicleComponentProfileMapModel Class Reference

This class implements the functionality of VehicleComponentProfileMapInterface. More...

Inheritance diagram for VehicleComponentProfileMapModel:
VehicleComponentProfileMapInterface

Public Member Functions

virtual bool | add (VehicleComponentProfileMapInterface::ID const &id) override
Method which creates a new vehicle component profile (instance of VehicleComponentProfileItemInterface) and adds it to the map under the given Id. More...
virtual VehicleComponentProfileMapInterface::Iterator | begin () override
Gets an iterator pointing to the first vehicle component profile in the map. More...
virtual void | clear () override
Method which deletes all registered vehicle component profiles and clears the map.
virtual VehicleComponentProfileMapInterface::ConstIterator | constBegin () const override
Gets an iterator pointing to the first vehicle component profile in the map (use for read-only since pointing at constant values). More...
virtual VehicleComponentProfileMapInterface::ConstIterator | constEnd () const override
Gets an iterator pointing at the end of the map after the last vehicle component profile (use for read-only). More...
virtual bool | contains (VehicleComponentProfileMapInterface::ID const &id) const override
Method wich checks whether the map contains a vehicle component profile with the given Id. More...
virtual int | count () const override
Method which returns the number of vehicle component profiles in the map. More...
virtual VehicleComponentProfileMapInterface::Iterator | end () override
Gets an iterator pointing to the end of the map after the last vehicle component profile. More...
virtual VehicleComponentProfileMapInterface::ID | getID (VehicleComponentProfileMapInterface::Item *const item) const override
Method wich returns the Id of the given vehicle component profile. More...
virtual VehicleComponentProfileMapInterface::Item * | getItem (VehicleComponentProfileMapInterface::ID const &id) const override
Method which returns a pointer to the vehicle component profile with the given Id. If the map does not contain a vehicle component profile with this Id, nullptr is returned. More...
virtual QList< ID > | keys () const override
Method which returns the list of all vehicle component profile Ids in the map. More...
virtual bool | remove (VehicleComponentProfileMapInterface::ID const &id) override
Method which removes the vehicle component profile with the given Id from the map. The profile is deleted after removing. Nothing will be done if there is no such profile. More...
virtual void | setID (VehicleComponentProfileMapInterface::Item *const item, VehicleComponentProfileMapInterface::ID const &id) override
Method wich changes the Id of the given vehicle component profile to the one passed as second argument. More...
virtual QList< Item * > | values () const override
Method which returns a list of pointers to all vehicle component profiles in the map. More...

Private Attributes

VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles

Additional Inherited Members

- Public Types inherited from VehicleComponentProfileMapInterface
using | ConstIterator = Map::ConstIterator
a const iterator of the map (for read-only operations)
using | ID = QPair< Name, Type >
typedef for the pair of name and type used as an Id
using | Item = VehicleComponentProfileItemInterface
typedef for the vehicle component profile
using | Iterator = Map::Iterator
an iterator of the map
using | Map = QMap< ID, Item * >
typedef for the map, i.e. the container object of vehicle component profiles
using | Name = VehicleComponentProfileItemInterface::Name
typedef for the vehicle component profiles name
using | Type = VehicleComponentProfileItemInterface::Type
typedef for the sensor type (i.e. its algorithm/implementation)

Detailed Description

This class implements the functionality of VehicleComponentProfileMapInterface.

Definition at line 26 of file VehicleComponentProfileMapModel.h.

Member Function Documentation

◆ add()

bool VehicleComponentProfileMapModel::add ( VehicleComponentProfileMapInterface::ID const & id )
overridevirtual

Method which creates a new vehicle component profile (instance of VehicleComponentProfileItemInterface) and adds it to the map under the given Id.

Parameters
[in] Id the Id under which the newly created item is registered
Returns
"true", if Id is not used already, otherwise "false"

Implements VehicleComponentProfileMapInterface.

Definition at line 43 of file VehicleComponentProfileMapModel.cpp.

44 {
45 if(!contains(id))
46 {
47 componentProfiles.insert(id, new VehicleComponentProfileItemModel(this));
48 return true;
49 }
50
51 return false;
52 }
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70
VehicleComponentProfileMapModel::contains
virtual bool contains(VehicleComponentProfileMapInterface::ID const &id) const override
Method wich checks whether the map contains a vehicle component profile with the given Id...
Definition: VehicleComponentProfileMapModel.cpp:90
VehicleComponentProfileItemModel
This class implements the functionality of VehicleComponentProfileItemInterface.
Definition: VehicleComponentProfileItemModel.h:25

◆ begin()

VehicleComponentProfileMapInterface::Iterator VehicleComponentProfileMapModel::begin ( )
overridevirtual

Gets an iterator pointing to the first vehicle component profile in the map.

Returns
The iterator pointing at the first object in the map.

Implements VehicleComponentProfileMapInterface.

Definition at line 22 of file VehicleComponentProfileMapModel.cpp.

23 {
24 return componentProfiles.begin();
25 }
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70

◆ constBegin()

VehicleComponentProfileMapInterface::ConstIterator VehicleComponentProfileMapModel::constBegin ( ) const
overridevirtual

Gets an iterator pointing to the first vehicle component profile in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implements VehicleComponentProfileMapInterface.

Definition at line 27 of file VehicleComponentProfileMapModel.cpp.

28 {
29 return componentProfiles.constBegin();
30 }
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70

◆ constEnd()

VehicleComponentProfileMapInterface::ConstIterator VehicleComponentProfileMapModel::constEnd ( ) const
overridevirtual

Gets an iterator pointing at the end of the map after the last vehicle component profile (use for read-only).

Returns
The iterator pointing at the end of the map.

Implements VehicleComponentProfileMapInterface.

Definition at line 37 of file VehicleComponentProfileMapModel.cpp.

38 {
39 return componentProfiles.constEnd();
40 }
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70

◆ contains()

bool VehicleComponentProfileMapModel::contains ( VehicleComponentProfileMapInterface::ID const & id ) const
overridevirtual

Method wich checks whether the map contains a vehicle component profile with the given Id.

Parameters
[in] Id the Id to be searched for
Returns
true, if profile with given Id exists, otherwise false.

Implements VehicleComponentProfileMapInterface.

Definition at line 90 of file VehicleComponentProfileMapModel.cpp.

91 {
92 return componentProfiles.contains(id);
93 }
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70

◆ count()

int VehicleComponentProfileMapModel::count ( ) const
overridevirtual

Method which returns the number of vehicle component profiles in the map.

Returns
the number of vehicle component profiles in the map

Implements VehicleComponentProfileMapInterface.

Definition at line 105 of file VehicleComponentProfileMapModel.cpp.

106 {
107 return componentProfiles.count();
108 }
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70

◆ end()

VehicleComponentProfileMapInterface::Iterator VehicleComponentProfileMapModel::end ( )
overridevirtual

Gets an iterator pointing to the end of the map after the last vehicle component profile.

Returns
The iterator pointing at the end of the map.

Implements VehicleComponentProfileMapInterface.

Definition at line 32 of file VehicleComponentProfileMapModel.cpp.

33 {
34 return componentProfiles.end();
35 }
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70

◆ getID()

VehicleComponentProfileMapInterface::ID VehicleComponentProfileMapModel::getID ( VehicleComponentProfileMapInterface::Item *const item ) const
overridevirtual

Method wich returns the Id of the given vehicle component profile.

Parameters
[in] item the pointer to the vehicle component profile in question
Returns
the Id of the given vehicle component profile

Implements VehicleComponentProfileMapInterface.

Definition at line 74 of file VehicleComponentProfileMapModel.cpp.

75 {
76 return componentProfiles.key(item);
77 }
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70

◆ getItem()

VehicleComponentProfileMapInterface::Item * VehicleComponentProfileMapModel::getItem ( VehicleComponentProfileMapInterface::ID const & id ) const
overridevirtual

Method which returns a pointer to the vehicle component profile with the given Id. If the map does not contain a vehicle component profile with this Id, nullptr is returned.

Parameters
[in] Id the Id of the vehicle component profile to be returned
Returns
the pointer to a vehicle component profile of given Id, nullptr if given Id does not exist in the map

Implements VehicleComponentProfileMapInterface.

Definition at line 65 of file VehicleComponentProfileMapModel.cpp.

66 {
67 if(contains(id))
68 return componentProfiles.value(id);
69
70 return nullptr;
71 }
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70
VehicleComponentProfileMapModel::contains
virtual bool contains(VehicleComponentProfileMapInterface::ID const &id) const override
Method wich checks whether the map contains a vehicle component profile with the given Id...
Definition: VehicleComponentProfileMapModel.cpp:90

◆ keys()

QList< VehicleComponentProfileMapInterface::ID > VehicleComponentProfileMapModel::keys ( ) const
overridevirtual

Method which returns the list of all vehicle component profile Ids in the map.

Returns
the list of all vehicle component profile Ids

Implements VehicleComponentProfileMapInterface.

Definition at line 95 of file VehicleComponentProfileMapModel.cpp.

96 {
97 return componentProfiles.keys();
98 }
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70

◆ remove()

bool VehicleComponentProfileMapModel::remove ( VehicleComponentProfileMapInterface::ID const & id )
overridevirtual

Method which removes the vehicle component profile with the given Id from the map. The profile is deleted after removing. Nothing will be done if there is no such profile.

Parameters
[in] Id the Id of the vehicle component profile to be removed
Returns
"true", if Id exists in the map, otherwise "false"

Implements VehicleComponentProfileMapInterface.

Definition at line 54 of file VehicleComponentProfileMapModel.cpp.

55 {
56 if(contains(id))
57 {
58 delete componentProfiles.take(id);
59 return true;
60 }
61
62 return false;
63 }
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70
VehicleComponentProfileMapModel::contains
virtual bool contains(VehicleComponentProfileMapInterface::ID const &id) const override
Method wich checks whether the map contains a vehicle component profile with the given Id...
Definition: VehicleComponentProfileMapModel.cpp:90

◆ setID()

void VehicleComponentProfileMapModel::setID | ( | VehicleComponentProfileMapInterface::Item *const | item,
 |  | VehicleComponentProfileMapInterface::ID const & | id
 | ) |  |
overridevirtual

Method wich changes the Id of the given vehicle component profile to the one passed as second argument.

Parameters
[in] | item | the pointer to the vehicle component profile whose id should be changed
[in] | Id | the new Id of the vehicle component profile

Implements VehicleComponentProfileMapInterface.

Definition at line 79 of file VehicleComponentProfileMapModel.cpp.

81 {
82
83 VehicleComponentProfileMapInterface::ID oldID = getID(item);
84
85 componentProfiles.take(oldID);
86 componentProfiles.insert(id, item);
87 }
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70
VehicleComponentProfileMapInterface::ID
QPair< Name, Type > ID
typedef for the pair of name and type used as an Id
Definition: VehicleComponentProfileMapInterface.h:49
VehicleComponentProfileMapModel::getID
virtual VehicleComponentProfileMapInterface::ID getID(VehicleComponentProfileMapInterface::Item *const item) const override
Method wich returns the Id of the given vehicle component profile.
Definition: VehicleComponentProfileMapModel.cpp:74

◆ values()

QList< VehicleComponentProfileItemInterface * > VehicleComponentProfileMapModel::values ( ) const
overridevirtual

Method which returns a list of pointers to all vehicle component profiles in the map.

Returns
the list of pointers to all vehicle component profiles

Implements VehicleComponentProfileMapInterface.

Definition at line 100 of file VehicleComponentProfileMapModel.cpp.

101 {
102 return componentProfiles.values();
103 }
VehicleComponentProfileMapModel::componentProfiles
VehicleComponentProfileMapInterface::Map componentProfiles
the map (container) of vehicle component profiles
Definition: VehicleComponentProfileMapModel.h:70
The documentation for this class was generated from the following files:
  • VehicleComponentProfileMapModel.h
  • VehicleComponentProfileMapModel.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleComponentProfileMapModel Member List

This is the complete list of members for VehicleComponentProfileMapModel, including all inherited members.

add(VehicleComponentProfileMapInterface::ID const &id) override | VehicleComponentProfileMapModel | virtual
begin() override | VehicleComponentProfileMapModel | virtual
clear() override | VehicleComponentProfileMapModel | virtual
componentProfiles | VehicleComponentProfileMapModel | private
constBegin() const override | VehicleComponentProfileMapModel | virtual
constEnd() const override | VehicleComponentProfileMapModel | virtual
ConstIterator typedef | VehicleComponentProfileMapInterface |
contains(VehicleComponentProfileMapInterface::ID const &id) const override | VehicleComponentProfileMapModel | virtual
count() const override | VehicleComponentProfileMapModel | virtual
end() override | VehicleComponentProfileMapModel | virtual
getID(VehicleComponentProfileMapInterface::Item *const item) const override | VehicleComponentProfileMapModel | virtual
getItem(VehicleComponentProfileMapInterface::ID const &id) const override | VehicleComponentProfileMapModel | virtual
ID typedef | VehicleComponentProfileMapInterface |
Item typedef | VehicleComponentProfileMapInterface |
Iterator typedef | VehicleComponentProfileMapInterface |
keys() const override | VehicleComponentProfileMapModel | virtual
Map typedef | VehicleComponentProfileMapInterface |
Name typedef | VehicleComponentProfileMapInterface |
remove(VehicleComponentProfileMapInterface::ID const &id) override | VehicleComponentProfileMapModel | virtual
setID(VehicleComponentProfileMapInterface::Item *const item, VehicleComponentProfileMapInterface::ID const &id) override | VehicleComponentProfileMapModel | virtual
Type typedef | VehicleComponentProfileMapInterface |
values() const override | VehicleComponentProfileMapModel | virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileCommands::AddSystem Class Reference

  • VehicleProfileCommands
  • AddSystem
List of all members
VehicleProfileCommands::AddSystem Class Reference

This class defines the command for undoable add-operations on the map of systems of a specific algorithm type. More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable add-operations on the map of systems of a specific algorithm type.

Definition at line 527 of file VehicleProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • VehicleProfilesPresenter.h
  • VehicleProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • VehicleProfileCommands
  • AddSystem
VehicleProfileCommands::AddSystem Member List

This is the complete list of members for VehicleProfileCommands::AddSystem, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileCommands::AddSystemProfile Class Reference

  • VehicleProfileCommands
  • AddSystemProfile
List of all members
VehicleProfileCommands::AddSystemProfile Class Reference

This class defines the command for undoably creating a new map for systems of a specific algorithm type to be assigned to the current vehicle profile. More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoably creating a new map for systems of a specific algorithm type to be assigned to the current vehicle profile.

Definition at line 464 of file VehicleProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • VehicleProfilesPresenter.h
  • VehicleProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • VehicleProfileCommands
  • AddSystemProfile
VehicleProfileCommands::AddSystemProfile Member List

This is the complete list of members for VehicleProfileCommands::AddSystemProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileCommands::AddVehicleProfile Class Reference

  • VehicleProfileCommands
  • AddVehicleProfile
List of all members
VehicleProfileCommands::AddVehicleProfile Class Reference

This class defines the command for undoable add-operations on the map of vehicle profiles (VehicleProfileMapInterface). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable add-operations on the map of vehicle profiles (VehicleProfileMapInterface).

Definition at line 302 of file VehicleProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • VehicleProfilesPresenter.h
  • VehicleProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • VehicleProfileCommands
  • AddVehicleProfile
VehicleProfileCommands::AddVehicleProfile Member List

This is the complete list of members for VehicleProfileCommands::AddVehicleProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileCommands::EditVehicleProfile Class Reference

  • VehicleProfileCommands
  • EditVehicleProfile
List of all members
VehicleProfileCommands::EditVehicleProfile Class Reference

This class defines the command for undoable renaming-operations on the map of vehicle profiles (VehicleProfileMapInterface). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable renaming-operations on the map of vehicle profiles (VehicleProfileMapInterface).

Definition at line 357 of file VehicleProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • VehicleProfilesPresenter.h
  • VehicleProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • VehicleProfileCommands
  • EditVehicleProfile
VehicleProfileCommands::EditVehicleProfile Member List

This is the complete list of members for VehicleProfileCommands::EditVehicleProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileCommands::RemoveSystem Class Reference

  • VehicleProfileCommands
  • RemoveSystem
List of all members
VehicleProfileCommands::RemoveSystem Class Reference

This class defines the command for undoable remove-operations on the map of systems of a specific algorithm type. More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable remove-operations on the map of systems of a specific algorithm type.

Definition at line 550 of file VehicleProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • VehicleProfilesPresenter.h
  • VehicleProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • VehicleProfileCommands
  • RemoveSystem
VehicleProfileCommands::RemoveSystem Member List

This is the complete list of members for VehicleProfileCommands::RemoveSystem, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileCommands::RemoveSystemProfile Class Reference

  • VehicleProfileCommands
  • RemoveSystemProfile
List of all members
VehicleProfileCommands::RemoveSystemProfile Class Reference

This class defines the command for undoably removing the map for systems of a specific algorithm type assigned to the current vehicle profile. More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoably removing the map for systems of a specific algorithm type assigned to the current vehicle profile.

Definition at line 496 of file VehicleProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • VehicleProfilesPresenter.h
  • VehicleProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • VehicleProfileCommands
  • RemoveSystemProfile
VehicleProfileCommands::RemoveSystemProfile Member List

This is the complete list of members for VehicleProfileCommands::RemoveSystemProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileCommands::RemoveVehicleProfile Class Reference

  • VehicleProfileCommands
  • RemoveVehicleProfile
List of all members
VehicleProfileCommands::RemoveVehicleProfile Class Reference

This class defines the command for undoable remove-operations on the map of vehicle profiles (VehicleProfileMapInterface). More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable remove-operations on the map of vehicle profiles (VehicleProfileMapInterface).

Definition at line 329 of file VehicleProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • VehicleProfilesPresenter.h
  • VehicleProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • VehicleProfileCommands
  • RemoveVehicleProfile
VehicleProfileCommands::RemoveVehicleProfile Member List

This is the complete list of members for VehicleProfileCommands::RemoveVehicleProfile, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileCommands::SetCurrentVehicle Class Reference

  • VehicleProfileCommands
  • SetCurrentVehicle
List of all members
VehicleProfileCommands::SetCurrentVehicle Class Reference

This class defines the command for undoable set-operations on the currently selected vehicle profile. More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable set-operations on the currently selected vehicle profile.

Definition at line 277 of file VehicleProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • VehicleProfilesPresenter.h
  • VehicleProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • VehicleProfileCommands
  • SetCurrentVehicle
VehicleProfileCommands::SetCurrentVehicle Member List

This is the complete list of members for VehicleProfileCommands::SetCurrentVehicle, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileCommands::SetModel Class Reference

  • VehicleProfileCommands
  • SetModel
List of all members
VehicleProfileCommands::SetModel Class Reference

This class defines the command for undoable set-operations on the vehicle model of the currently edited vehicle profile. More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable set-operations on the vehicle model of the currently edited vehicle profile.

Definition at line 410 of file VehicleProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • VehicleProfilesPresenter.h
  • VehicleProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • VehicleProfileCommands
  • SetModel
VehicleProfileCommands::SetModel Member List

This is the complete list of members for VehicleProfileCommands::SetModel, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileCommands::SetModelCatalogue Class Reference

  • VehicleProfileCommands
  • SetModelCatalogue
List of all members
VehicleProfileCommands::SetModelCatalogue Class Reference

This class defines the command for undoable set-operations on the vehicle model catalogue of the currently edited vehicle profile. More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable set-operations on the vehicle model catalogue of the currently edited vehicle profile.

Definition at line 383 of file VehicleProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • VehicleProfilesPresenter.h
  • VehicleProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • VehicleProfileCommands
  • SetModelCatalogue
VehicleProfileCommands::SetModelCatalogue Member List

This is the complete list of members for VehicleProfileCommands::SetModelCatalogue, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileCommands::SetSystemConfig Class Reference

  • VehicleProfileCommands
  • SetSystemConfig
List of all members
VehicleProfileCommands::SetSystemConfig Class Reference

This class defines the command for undoable set-operations on the system config of the currently edited vehicle profile. More...

Inherits QUndoCommand.

Detailed Description

This class defines the command for undoable set-operations on the system config of the currently edited vehicle profile.

Definition at line 436 of file VehicleProfilesPresenter.h.

The documentation for this class was generated from the following files:
  • VehicleProfilesPresenter.h
  • VehicleProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

  • VehicleProfileCommands
  • SetSystemConfig
VehicleProfileCommands::SetSystemConfig Member List

This is the complete list of members for VehicleProfileCommands::SetSystemConfig, including all inherited members.

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileItemInterface Class Reference

Public Types | Public Member Functions | List of all members
VehicleProfileItemInterface Class Referenceabstract

This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the simulation. More...

Inheritance diagram for VehicleProfileItemInterface:
VehicleProfileItemModel

Public Types

using | AlgoType = QString
typedef for the algorithm type (in fact, the implementation of the algorithm)
using | Model = QString
typedef for the vehicle model
using | ModelCatalogue = QString
typedef for the vehicle model catalogue
using | Name = QString
typedef for the name of the vehicle profile
using | Probability = double
typedef for a probability
using | Sensors = SensorMapInterface
typedef for sensors (-> to be exported from systems in system config)
using | System = QPair< SystemID, SystemTitle >
typedef for a system (here, the system Id and title are sufficient)
using | SystemConfig = QString
typedef for the system config XML file
using | SystemID = unsigned int
typedef for a system Id (valid in corresponding system config XML file)
using | SystemProfiles = QMap< AlgoType, Systems * >
typedef for the map sorting the probability-assigned systems by the algorithm type
using | Systems = QMap< System, Probability >
typedef for the map assigning probabilities to systems
using | SystemTitle = QString
typedef for the system title
using | VehicleComponents = VehicleComponentMapInterface
typedef for the vehicle component (-> to be exported from systems in system config)

Public Member Functions

virtual Model | getModel () const =0
Method which returns the currently selected vehicle model. More...
virtual ModelCatalogue | getModelCatalogue () const =0
Method which returns the current vehicle model catalogue. More...
virtual Name | getName () const =0
Method which returns the name of the vehicle profile. More...
virtual Sensors * | getSensors () const =0
Method which returns the map of sensors, i.e. the container class for instances of the SensorItemInterface class. More...
virtual SystemConfig | getSystemConfig () const =0
Method which returns the name of the current system config XML file. More...
virtual SystemProfiles * | getSystemProfiles () const =0
Method which returns all mappings of systems to probabilities sorted by their algorithm type. The corresponding data structure is defined by the typedef SystemProfiles. More...
virtual Systems * | getSystems (AlgoType const &_type) const =0
Method which returns the mapping of all systems of the given algorithm type to their equipment probabilities. More...
virtual VehicleComponents * | getVehicleComponents () const =0
Method which returns the map of vehicle components, i.e. the container class for instances of the VehicleComponentItemInterface class. More...
virtual void | setModel (Model const &_model)=0
Method which sets the current vehicle model to the one passed as an argument. More...
virtual void | setModelCatalogue (ModelCatalogue const &_modelCatalogue)=0
Method which sets the current vehicle model catalogue to the one passed as an argument. More...
virtual void | setSystemConfig (SystemConfig const &_systemConfig)=0
Method which sets the current system config XML file to the one passed as an argument. More...

Detailed Description

This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the simulation.

This particularly comprises the vehicle model and optional driver assistance systems (ADAS) and sensors. In the profile catalogue (see documentation of the simulation core), ADAS and sensors are defined by the XML elements <components> and <sensors>, respectively. In this catalogue, it is also defined how vehicle components (ADAS) are connected to sensors via the so-called <sensorLinks> elements. Furthermore, the (stochastic) parameterizations of sensors and vehicle components is established via sensor profiles and vehicle component profiles, respectively. However, the GUI offers the System Editor Plugin where these pieces of information on ADAS and sensors are edited by the user. Therefore, a system config XML file exported from the System Editor Plugin is referenced here in order to extract this information. While for the GUI, the reference to specific systems of a system config XML file is sufficient, the profile catalogue needs these information to be transferred to the corresponding profiles which are, thus, also part of this class. Note, that a special feature OpenPASS that ADAS and their parameterization (profiles) can be equipped stochastically. Hence, the systems defined in the system config are assigned to the corresponding probabilities.

Definition at line 71 of file VehicleProfileItemInterface.h.

Member Function Documentation

◆ getModel()

virtual Model VehicleProfileItemInterface::getModel ( ) const
pure virtual

Method which returns the currently selected vehicle model.

Returns
the currently selected vehicle model

Implemented in VehicleProfileItemModel.

◆ getModelCatalogue()

virtual ModelCatalogue VehicleProfileItemInterface::getModelCatalogue ( ) const
pure virtual

Method which returns the current vehicle model catalogue.

Returns
the name of the current vehicle model catalogue

Implemented in VehicleProfileItemModel.

◆ getName()

virtual Name VehicleProfileItemInterface::getName ( ) const
pure virtual

Method which returns the name of the vehicle profile.

Returns
the name of the vehicle profile

Implemented in VehicleProfileItemModel.

◆ getSensors()

virtual Sensors* VehicleProfileItemInterface::getSensors ( ) const
pure virtual

Method which returns the map of sensors, i.e. the container class for instances of the SensorItemInterface class.

Note
this getter method is only used when exporting the definition of a system in the system config XML file to the format needed by the profiles catalogue.
Returns
the map of sensors

Implemented in VehicleProfileItemModel.

◆ getSystemConfig()

virtual SystemConfig VehicleProfileItemInterface::getSystemConfig ( ) const
pure virtual

Method which returns the name of the current system config XML file.

Returns
the current system config XML filename

Implemented in VehicleProfileItemModel.

◆ getSystemProfiles()

virtual SystemProfiles* VehicleProfileItemInterface::getSystemProfiles ( ) const
pure virtual

Method which returns all mappings of systems to probabilities sorted by their algorithm type. The corresponding data structure is defined by the typedef SystemProfiles.

Returns
the system profiles map (see corresponding typedef SystemProfiles)

Implemented in VehicleProfileItemModel.

◆ getSystems()

virtual Systems* VehicleProfileItemInterface::getSystems ( AlgoType const & _type ) const
pure virtual

Method which returns the mapping of all systems of the given algorithm type to their equipment probabilities.

Parameters
[in] _type the requested algorithm type
Returns
the mapping of all systems to equipment probabilities being of type _type.

Implemented in VehicleProfileItemModel.

◆ getVehicleComponents()

virtual VehicleComponents* VehicleProfileItemInterface::getVehicleComponents ( ) const
pure virtual

Method which returns the map of vehicle components, i.e. the container class for instances of the VehicleComponentItemInterface class.

Note
this getter method is only used when exporting the definition of a system in thesystem config XML file to the format needed by the profiles catalogue.
Returns
the map of vehicle components

Implemented in VehicleProfileItemModel.

◆ setModel()

virtual void VehicleProfileItemInterface::setModel ( Model const & _model )
pure virtual

Method which sets the current vehicle model to the one passed as an argument.

Parameters
[in] _model the new vehicle model

Implemented in VehicleProfileItemModel.

◆ setModelCatalogue()

virtual void VehicleProfileItemInterface::setModelCatalogue ( ModelCatalogue const & _modelCatalogue )
pure virtual

Method which sets the current vehicle model catalogue to the one passed as an argument.

Parameters
[in] _modelCatalogue the new vehicle model catalogue

Implemented in VehicleProfileItemModel.

◆ setSystemConfig()

virtual void VehicleProfileItemInterface::setSystemConfig ( SystemConfig const & _systemConfig )
pure virtual

Method which sets the current system config XML file to the one passed as an argument.

Parameters
[in] _systemConfig the new system config XML file to be used

Implemented in VehicleProfileItemModel.

The documentation for this class was generated from the following file:
  • VehicleProfileItemInterface.h
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleProfileItemInterface Member List

This is the complete list of members for VehicleProfileItemInterface, including all inherited members.

AlgoType typedef | VehicleProfileItemInterface |
getModel() const =0 | VehicleProfileItemInterface | pure virtual
getModelCatalogue() const =0 | VehicleProfileItemInterface | pure virtual
getName() const =0 | VehicleProfileItemInterface | pure virtual
getSensors() const =0 | VehicleProfileItemInterface | pure virtual
getSystemConfig() const =0 | VehicleProfileItemInterface | pure virtual
getSystemProfiles() const =0 | VehicleProfileItemInterface | pure virtual
getSystems(AlgoType const &_type) const =0 | VehicleProfileItemInterface | pure virtual
getVehicleComponents() const =0 | VehicleProfileItemInterface | pure virtual
Model typedef | VehicleProfileItemInterface |
ModelCatalogue typedef | VehicleProfileItemInterface |
Name typedef | VehicleProfileItemInterface |
Probability typedef | VehicleProfileItemInterface |
Sensors typedef | VehicleProfileItemInterface |
setModel(Model const &_model)=0 | VehicleProfileItemInterface | pure virtual
setModelCatalogue(ModelCatalogue const &_modelCatalogue)=0 | VehicleProfileItemInterface | pure virtual
setSystemConfig(SystemConfig const &_systemConfig)=0 | VehicleProfileItemInterface | pure virtual
System typedef | VehicleProfileItemInterface |
SystemConfig typedef | VehicleProfileItemInterface |
SystemID typedef | VehicleProfileItemInterface |
SystemProfiles typedef | VehicleProfileItemInterface |
Systems typedef | VehicleProfileItemInterface |
SystemTitle typedef | VehicleProfileItemInterface |
VehicleComponents typedef | VehicleProfileItemInterface |
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileItemModel Class Reference

Public Member Functions | Private Attributes | List of all members
VehicleProfileItemModel Class Reference

This class implements the functionality of VehicleProfileItemInterface. More...

Inheritance diagram for VehicleProfileItemModel:
VehicleProfileItemInterface

Public Member Functions

virtual Model | getModel () const override
Method which returns the currently selected vehicle model. More...
virtual ModelCatalogue | getModelCatalogue () const override
Method which returns the current vehicle model catalogue. More...
virtual Name | getName () const override
Method which returns the name of the vehicle profile. More...
virtual Sensors * | getSensors () const override
Method which returns the map of sensors, i.e. the container class for instances of the SensorItemInterface class. More...
virtual SystemConfig | getSystemConfig () const override
Method which returns the name of the current system config XML file. More...
virtual SystemProfiles * | getSystemProfiles () const override
Method which returns all mappings of systems to probabilities sorted by their algorithm type. The corresponding data structure is defined by the typedef SystemProfiles. More...
virtual Systems * | getSystems (AlgoType const &_type) const override
Method which returns the mapping of all systems of the given algorithm type to their equipment probabilities. More...
virtual VehicleComponents * | getVehicleComponents () const override
Method which returns the map of vehicle components, i.e. the container class for instances of the VehicleComponentItemInterface class. More...
virtual void | setModel (Model const &_model) override
Method which sets the current vehicle model to the one passed as an argument. More...
virtual void | setModelCatalogue (ModelCatalogue const &_modelCatalogue) override
Method which sets the current vehicle model catalogue to the one passed as an argument. More...
virtual void | setSystemConfig (SystemConfig const &_systemConfig) override
Method which sets the current system config XML file to the one passed as an argument. More...

Private Attributes

VehicleComponents *const | components
the map containing all vehicle component data
Model model
the string object storing the current vehicle model
ModelCatalogue modelCatalogue
the string object storing the selected vehicle model catalogue
Sensors *const | sensors
the map containing all sensor data
SystemConfig systemConfig
the string object storing the selected system config file
SystemProfiles * systemProfiles
the map registering mappings of systems onto probabilities using the algorithm type as a key identifier

Additional Inherited Members

- Public Types inherited from VehicleProfileItemInterface
using | AlgoType = QString
typedef for the algorithm type (in fact, the implementation of the algorithm)
using | Model = QString
typedef for the vehicle model
using | ModelCatalogue = QString
typedef for the vehicle model catalogue
using | Name = QString
typedef for the name of the vehicle profile
using | Probability = double
typedef for a probability
using | Sensors = SensorMapInterface
typedef for sensors (-> to be exported from systems in system config)
using | System = QPair< SystemID, SystemTitle >
typedef for a system (here, the system Id and title are sufficient)
using | SystemConfig = QString
typedef for the system config XML file
using | SystemID = unsigned int
typedef for a system Id (valid in corresponding system config XML file)
using | SystemProfiles = QMap< AlgoType, Systems * >
typedef for the map sorting the probability-assigned systems by the algorithm type
using | Systems = QMap< System, Probability >
typedef for the map assigning probabilities to systems
using | SystemTitle = QString
typedef for the system title
using | VehicleComponents = VehicleComponentMapInterface
typedef for the vehicle component (-> to be exported from systems in system config)

Detailed Description

This class implements the functionality of VehicleProfileItemInterface.

Definition at line 25 of file VehicleProfileItemModel.h.

Member Function Documentation

◆ getModel()

VehicleProfileItemInterface::Model VehicleProfileItemModel::getModel ( ) const
overridevirtual

Method which returns the currently selected vehicle model.

Returns
the currently selected vehicle model

Implements VehicleProfileItemInterface.

Definition at line 64 of file VehicleProfileItemModel.cpp.

65 {
66 return model;
67 }
VehicleProfileItemModel::model
Model model
the string object storing the current vehicle model
Definition: VehicleProfileItemModel.h:64

◆ getModelCatalogue()

VehicleProfileItemInterface::ModelCatalogue VehicleProfileItemModel::getModelCatalogue ( ) const
overridevirtual

Method which returns the current vehicle model catalogue.

Returns
the name of the current vehicle model catalogue

Implements VehicleProfileItemInterface.

Definition at line 74 of file VehicleProfileItemModel.cpp.

75 {
76 return modelCatalogue;
77 }
VehicleProfileItemModel::modelCatalogue
ModelCatalogue modelCatalogue
the string object storing the selected vehicle model catalogue
Definition: VehicleProfileItemModel.h:63

◆ getName()

VehicleProfileItemInterface::Name VehicleProfileItemModel::getName ( ) const
overridevirtual

Method which returns the name of the vehicle profile.

Returns
the name of the vehicle profile

Implements VehicleProfileItemInterface.

Definition at line 57 of file VehicleProfileItemModel.cpp.

58 {
59 VehicleProfileMapInterface const * const map = qobject_cast<VehicleProfileMapInterface const * const > ( parent() );
60
61 return ( (map) ? map->getName( const_cast<VehicleProfileItemModel *> (this) ) : VehicleProfileItemInterface::Name() );
62 }
VehicleProfileItemInterface::Name
QString Name
typedef for the name of the vehicle profile
Definition: VehicleProfileItemInterface.h:76
VehicleProfileMapInterface
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemIn...
Definition: VehicleProfileMapInterface.h:39
VehicleProfileMapInterface::getName
virtual VehicleProfileMapInterface::Name getName(VehicleProfileMapInterface::Item *const item) const =0
Method wich returns the name of the given vehicle profile.

◆ getSensors()

VehicleProfileItemInterface::Sensors * VehicleProfileItemModel::getSensors ( ) const
overridevirtual

Method which returns the map of sensors, i.e. the container class for instances of the SensorItemInterface class.

Note
this getter method is only used when exporting the definition of a system in the system config XML file to the format needed by the profiles catalogue.
Returns
the map of sensors

Implements VehicleProfileItemInterface.

Definition at line 111 of file VehicleProfileItemModel.cpp.

112 {
113 return sensors;
114 }
VehicleProfileItemModel::sensors
Sensors *const sensors
the map containing all sensor data
Definition: VehicleProfileItemModel.h:70

◆ getSystemConfig()

VehicleProfileItemModel::SystemConfig VehicleProfileItemModel::getSystemConfig ( ) const
overridevirtual

Method which returns the name of the current system config XML file.

Returns
the current system config XML filename

Implements VehicleProfileItemInterface.

Definition at line 84 of file VehicleProfileItemModel.cpp.

85 {
86 return systemConfig;
87 }
VehicleProfileItemModel::systemConfig
SystemConfig systemConfig
the string object storing the selected system config file
Definition: VehicleProfileItemModel.h:65

◆ getSystemProfiles()

VehicleProfileItemModel::SystemProfiles * VehicleProfileItemModel::getSystemProfiles ( ) const
overridevirtual

Method which returns all mappings of systems to probabilities sorted by their algorithm type. The corresponding data structure is defined by the typedef SystemProfiles.

Returns
the system profiles map (see corresponding typedef SystemProfiles)

Implements VehicleProfileItemInterface.

Definition at line 94 of file VehicleProfileItemModel.cpp.

95 {
96 return systemProfiles;
97 }
VehicleProfileItemModel::systemProfiles
SystemProfiles * systemProfiles
the map registering mappings of systems onto probabilities using the algorithm type as a key identifi...
Definition: VehicleProfileItemModel.h:66

◆ getSystems()

VehicleProfileItemModel::Systems * VehicleProfileItemModel::getSystems ( AlgoType const & _type ) const
overridevirtual

Method which returns the mapping of all systems of the given algorithm type to their equipment probabilities.

Parameters
[in] _type the requested algorithm type
Returns
the mapping of all systems to equipment probabilities being of type _type.

Implements VehicleProfileItemInterface.

Definition at line 99 of file VehicleProfileItemModel.cpp.

100 {
101 return systemProfiles->value(_type);
102 }
VehicleProfileItemModel::systemProfiles
SystemProfiles * systemProfiles
the map registering mappings of systems onto probabilities using the algorithm type as a key identifi...
Definition: VehicleProfileItemModel.h:66

◆ getVehicleComponents()

VehicleProfileItemInterface::VehicleComponents * VehicleProfileItemModel::getVehicleComponents ( ) const
overridevirtual

Method which returns the map of vehicle components, i.e. the container class for instances of the VehicleComponentItemInterface class.

Note
this getter method is only used when exporting the definition of a system in thesystem config XML file to the format needed by the profiles catalogue.
Returns
the map of vehicle components

Implements VehicleProfileItemInterface.

Definition at line 106 of file VehicleProfileItemModel.cpp.

107 {
108 return components;
109 }
VehicleProfileItemModel::components
VehicleComponents *const components
the map containing all vehicle component data
Definition: VehicleProfileItemModel.h:69

◆ setModel()

void VehicleProfileItemModel::setModel ( Model const & _model )
overridevirtual

Method which sets the current vehicle model to the one passed as an argument.

Parameters
[in] _model the new vehicle model

Implements VehicleProfileItemInterface.

Definition at line 69 of file VehicleProfileItemModel.cpp.

70 {
71 model = _model;
72 }
VehicleProfileItemModel::model
Model model
the string object storing the current vehicle model
Definition: VehicleProfileItemModel.h:64

◆ setModelCatalogue()

void VehicleProfileItemModel::setModelCatalogue ( ModelCatalogue const & _modelCatalogue )
overridevirtual

Method which sets the current vehicle model catalogue to the one passed as an argument.

Parameters
[in] _modelCatalogue the new vehicle model catalogue

Implements VehicleProfileItemInterface.

Definition at line 79 of file VehicleProfileItemModel.cpp.

80 {
81 modelCatalogue = _modelCatalogue;
82 }
VehicleProfileItemModel::modelCatalogue
ModelCatalogue modelCatalogue
the string object storing the selected vehicle model catalogue
Definition: VehicleProfileItemModel.h:63

◆ setSystemConfig()

void VehicleProfileItemModel::setSystemConfig ( SystemConfig const & _systemConfig )
overridevirtual

Method which sets the current system config XML file to the one passed as an argument.

Parameters
[in] _systemConfig the new system config XML file to be used

Implements VehicleProfileItemInterface.

Definition at line 89 of file VehicleProfileItemModel.cpp.

90 {
91 systemConfig = _systemConfig;
92 }
VehicleProfileItemModel::systemConfig
SystemConfig systemConfig
the string object storing the selected system config file
Definition: VehicleProfileItemModel.h:65
The documentation for this class was generated from the following files:
  • VehicleProfileItemModel.h
  • VehicleProfileItemModel.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleProfileItemModel Member List

This is the complete list of members for VehicleProfileItemModel, including all inherited members.

AlgoType typedef | VehicleProfileItemInterface |
components | VehicleProfileItemModel | private
getModel() const override | VehicleProfileItemModel | virtual
getModelCatalogue() const override | VehicleProfileItemModel | virtual
getName() const override | VehicleProfileItemModel | virtual
getSensors() const override | VehicleProfileItemModel | virtual
getSystemConfig() const override | VehicleProfileItemModel | virtual
getSystemProfiles() const override | VehicleProfileItemModel | virtual
getSystems(AlgoType const &_type) const override | VehicleProfileItemModel | virtual
getVehicleComponents() const override | VehicleProfileItemModel | virtual
model | VehicleProfileItemModel | private
Model typedef | VehicleProfileItemInterface |
modelCatalogue | VehicleProfileItemModel | private
ModelCatalogue typedef | VehicleProfileItemInterface |
Name typedef | VehicleProfileItemInterface |
Probability typedef | VehicleProfileItemInterface |
Sensors typedef | VehicleProfileItemInterface |
sensors | VehicleProfileItemModel | private
setModel(Model const &_model) override | VehicleProfileItemModel | virtual
setModelCatalogue(ModelCatalogue const &_modelCatalogue) override | VehicleProfileItemModel | virtual
setSystemConfig(SystemConfig const &_systemConfig) override | VehicleProfileItemModel | virtual
System typedef | VehicleProfileItemInterface |
SystemConfig typedef | VehicleProfileItemInterface |
systemConfig | VehicleProfileItemModel | private
SystemID typedef | VehicleProfileItemInterface |
systemProfiles | VehicleProfileItemModel | private
SystemProfiles typedef | VehicleProfileItemInterface |
Systems typedef | VehicleProfileItemInterface |
SystemTitle typedef | VehicleProfileItemInterface |
VehicleComponents typedef | VehicleProfileItemInterface |
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileMapInterface Class Reference

Public Types | Signals | Public Member Functions | List of all members
VehicleProfileMapInterface Class Referenceabstract

This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map. More...

Inheritance diagram for VehicleProfileMapInterface:
VehicleProfileMapModel

Public Types

using | ConstIterator = Map::ConstIterator
a const iterator of the map (for read-only operations)
using | Item = VehicleProfileItemInterface
typedef for vehicle profiles (items registered in the map)
using | Iterator = Map::Iterator
an iterator of the map
using | Map = QMap< Name, Item * >
typedef for the map, i.e. the container object of vehicle profiles
using | Name = VehicleProfileItemInterface::Name
typedef for vehicle profile names (= key identifiers of the map)

Signals

void | added (Name const &name)
Signal emitted when a vehicle profile has been added to the map. Transmits the name of the correponding vehicle profile. More...
void | modifiedName (Name const &oldName, Name const &newName)
Signal emitted when the name of the vehicle profile has been changed. Transmits both, the new and old names of the profile. More...
void | removed (Name const &name)
Signal emitted when a vehicle profile has been removed from the map. Transmits the name of the correponding vehicle profile. More...

Public Member Functions

virtual bool | add (VehicleProfileMapInterface::Name const &name)=0
Method which creates a new vehicle profile (instance of VehicleProfileItemInterface) and adds it to the map under the given name. More...
virtual bool | add (VehicleProfileMapInterface::Name const &name, VehicleProfileMapInterface::Item const *const item)=0
Method which creates a copy of the given vehicle profile (seond argument) and adds it to the map using the given name. More...
virtual VehicleProfileMapInterface::Iterator | begin ()=0
Gets an iterator pointing to the first vehicle profile in the map. More...
virtual VehicleProfileMapInterface::ConstIterator | constBegin () const =0
Gets an iterator pointing to the first vehicle profile in the map (use for read-only since pointing at constant values). More...
virtual VehicleProfileMapInterface::ConstIterator | constEnd () const =0
Gets an iterator pointing at the end of the map after the last vehicle profile (use for read-only). More...
virtual bool | contains (VehicleProfileMapInterface::Name const &name) const =0
Method wich checks whether the map contains a vehicle profile with the given name. More...
virtual int | count () const =0
Method which returns the number of vehicle profiles in the map. More...
virtual VehicleProfileMapInterface::Iterator | end ()=0
Gets an iterator pointing to the end of the map after the last vehicle profile. More...
virtual VehicleProfileMapInterface::Item * | getItem (VehicleProfileMapInterface::Name const &name) const =0
Method which returns a pointer to the vehicle profile with the given name. If the map does not contain a vehicle profile with this name, nullptr is returned. More...
virtual VehicleProfileMapInterface::Name | getName (VehicleProfileMapInterface::Item *const item) const =0
Method wich returns the name of the given vehicle profile. More...
virtual QStringList | keys () const =0
Method which returns the (string) list of all vehicle profile names in the map. More...
virtual bool | remove (VehicleProfileMapInterface::Name const &name)=0
Method which removes the vehicle profile with the given name from the map. The profile is deleted after removing. Nothing will be done if there is no such profile. More...
virtual void | setName (VehicleProfileMapInterface::Item *const item, VehicleProfileMapInterface::Name const &name)=0
Method wich changes the name of the given vehicle profile to the one passed as second argument. More...
virtual QList< Item * > | values () const =0
Method which returns a list of pointers to all vehicle profiles in the map. More...

Detailed Description

This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map.

Definition at line 39 of file VehicleProfileMapInterface.h.

Member Function Documentation

◆ add() [1/2]

virtual bool VehicleProfileMapInterface::add ( VehicleProfileMapInterface::Name const & name )
pure virtual

Method which creates a new vehicle profile (instance of VehicleProfileItemInterface) and adds it to the map under the given name.

Parameters
[in] name the name under which the newly created item is registered
Returns
"true", if name is not used already, otherwise "false"

Implemented in VehicleProfileMapModel.

◆ add() [2/2]

virtual bool VehicleProfileMapInterface::add | ( | VehicleProfileMapInterface::Name const & | name,
 |  | VehicleProfileMapInterface::Item const *const | item
 | ) |  |
pure virtual

Method which creates a copy of the given vehicle profile (seond argument) and adds it to the map using the given name.

Parameters
[in] | name | the name under which the copied item is registered
[in] | item | the vehicle pofile to be copied
Returns
"true", if name is not used already, otherwise "false"

Implemented in VehicleProfileMapModel.

◆ added

void VehicleProfileMapInterface::added ( Name const & name )
signal

Signal emitted when a vehicle profile has been added to the map. Transmits the name of the correponding vehicle profile.

Parameters
[in] name the name of the added vehicle profile

◆ begin()

virtual VehicleProfileMapInterface::Iterator VehicleProfileMapInterface::begin ( )
pure virtual

Gets an iterator pointing to the first vehicle profile in the map.

Returns
The iterator pointing at the first object in the map.

Implemented in VehicleProfileMapModel.

◆ constBegin()

virtual VehicleProfileMapInterface::ConstIterator VehicleProfileMapInterface::constBegin ( ) const
pure virtual

Gets an iterator pointing to the first vehicle profile in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implemented in VehicleProfileMapModel.

◆ constEnd()

virtual VehicleProfileMapInterface::ConstIterator VehicleProfileMapInterface::constEnd ( ) const
pure virtual

Gets an iterator pointing at the end of the map after the last vehicle profile (use for read-only).

Returns
The iterator pointing at the end of the map.

Implemented in VehicleProfileMapModel.

◆ contains()

virtual bool VehicleProfileMapInterface::contains ( VehicleProfileMapInterface::Name const & name ) const
pure virtual

Method wich checks whether the map contains a vehicle profile with the given name.

Parameters
[in] name the name to be searched for
Returns
true, if profile with given name exists, otherwise false.

Implemented in VehicleProfileMapModel.

◆ count()

virtual int VehicleProfileMapInterface::count ( ) const
pure virtual

Method which returns the number of vehicle profiles in the map.

Returns
the number of vehicle profiles in the map

Implemented in VehicleProfileMapModel.

◆ end()

virtual VehicleProfileMapInterface::Iterator VehicleProfileMapInterface::end ( )
pure virtual

Gets an iterator pointing to the end of the map after the last vehicle profile.

Returns
The iterator pointing at the end of the map.

Implemented in VehicleProfileMapModel.

◆ getItem()

virtual VehicleProfileMapInterface::Item* VehicleProfileMapInterface::getItem ( VehicleProfileMapInterface::Name const & name ) const
pure virtual

Method which returns a pointer to the vehicle profile with the given name. If the map does not contain a vehicle profile with this name, nullptr is returned.

Parameters
[in] name the name of the vehicle profile to be returned
Returns
the pointer to a vehicle profile of given name, nullptr if given name does not exist in the map

Implemented in VehicleProfileMapModel.

◆ getName()

virtual VehicleProfileMapInterface::Name VehicleProfileMapInterface::getName ( VehicleProfileMapInterface::Item *const item ) const
pure virtual

Method wich returns the name of the given vehicle profile.

Parameters
[in] item the pointer to the vehicle profile in question
Returns
the name of the given vehicle profile

Implemented in VehicleProfileMapModel.

◆ keys()

virtual QStringList VehicleProfileMapInterface::keys ( ) const
pure virtual

Method which returns the (string) list of all vehicle profile names in the map.

Returns
the (string) list of all vehicle profile names

Implemented in VehicleProfileMapModel.

◆ modifiedName

void VehicleProfileMapInterface::modifiedName | ( | Name const & | oldName,
 |  | Name const & | newName
 | ) |  |
signal

Signal emitted when the name of the vehicle profile has been changed. Transmits both, the new and old names of the profile.

Parameters
[in] | oldName | the old name of the vehicle profile
[in] | newName | the new name of the vehicle profile

◆ remove()

virtual bool VehicleProfileMapInterface::remove ( VehicleProfileMapInterface::Name const & name )
pure virtual

Method which removes the vehicle profile with the given name from the map. The profile is deleted after removing. Nothing will be done if there is no such profile.

Parameters
[in] name the name of the vehicle profile to be removed
Returns
"true", if name exists in the map, otherwise "false"

Implemented in VehicleProfileMapModel.

◆ removed

void VehicleProfileMapInterface::removed ( Name const & name )
signal

Signal emitted when a vehicle profile has been removed from the map. Transmits the name of the correponding vehicle profile.

Parameters
[in] name the name of the removed vehicle profile

◆ setName()

virtual void VehicleProfileMapInterface::setName | ( | VehicleProfileMapInterface::Item *const | item,
 |  | VehicleProfileMapInterface::Name const & | name
 | ) |  |
pure virtual

Method wich changes the name of the given vehicle profile to the one passed as second argument.

Parameters
[in] | item | the pointer to the vehicle profile to be renamed
[in] | name | the new name of the agent profile

Implemented in VehicleProfileMapModel.

◆ values()

virtual QList<Item*> VehicleProfileMapInterface::values ( ) const
pure virtual

Method which returns a list of pointers to all vehicle profiles in the map.

Returns
the list of pointers to all vehicle profiles

Implemented in VehicleProfileMapModel.

The documentation for this class was generated from the following file:
  • VehicleProfileMapInterface.h
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleProfileMapInterface Member List

This is the complete list of members for VehicleProfileMapInterface, including all inherited members.

add(VehicleProfileMapInterface::Name const &name)=0 | VehicleProfileMapInterface | pure virtual
add(VehicleProfileMapInterface::Name const &name, VehicleProfileMapInterface::Item const *const item)=0 | VehicleProfileMapInterface | pure virtual
added(Name const &name) | VehicleProfileMapInterface | signal
begin()=0 | VehicleProfileMapInterface | pure virtual
constBegin() const =0 | VehicleProfileMapInterface | pure virtual
constEnd() const =0 | VehicleProfileMapInterface | pure virtual
ConstIterator typedef | VehicleProfileMapInterface |
contains(VehicleProfileMapInterface::Name const &name) const =0 | VehicleProfileMapInterface | pure virtual
count() const =0 | VehicleProfileMapInterface | pure virtual
end()=0 | VehicleProfileMapInterface | pure virtual
getItem(VehicleProfileMapInterface::Name const &name) const =0 | VehicleProfileMapInterface | pure virtual
getName(VehicleProfileMapInterface::Item *const item) const =0 | VehicleProfileMapInterface | pure virtual
Item typedef | VehicleProfileMapInterface |
Iterator typedef | VehicleProfileMapInterface |
keys() const =0 | VehicleProfileMapInterface | pure virtual
Map typedef | VehicleProfileMapInterface |
modifiedName(Name const &oldName, Name const &newName) | VehicleProfileMapInterface | signal
Name typedef | VehicleProfileMapInterface |
remove(VehicleProfileMapInterface::Name const &name)=0 | VehicleProfileMapInterface | pure virtual
removed(Name const &name) | VehicleProfileMapInterface | signal
setName(VehicleProfileMapInterface::Item *const item, VehicleProfileMapInterface::Name const &name)=0 | VehicleProfileMapInterface | pure virtual
values() const =0 | VehicleProfileMapInterface | pure virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfileMapModel Class Reference

Public Member Functions | List of all members
VehicleProfileMapModel Class Reference

This class implements the functionality of VehicleProfileMapInterface. More...

Inheritance diagram for VehicleProfileMapModel:
VehicleProfileMapInterface

Public Member Functions

virtual bool | add (VehicleProfileMapInterface::Name const &name) override
Method which creates a new vehicle profile (instance of VehicleProfileItemInterface) and adds it to the map under the given name. More...
virtual bool | add (VehicleProfileMapInterface::Name const &name, VehicleProfileMapInterface::Item const *const item) override
Method which creates a copy of the given vehicle profile (seond argument) and adds it to the map using the given name. More...
virtual VehicleProfileMapInterface::Iterator | begin () override
Gets an iterator pointing to the first vehicle profile in the map. More...
virtual VehicleProfileMapInterface::ConstIterator | constBegin () const override
Gets an iterator pointing to the first vehicle profile in the map (use for read-only since pointing at constant values). More...
virtual VehicleProfileMapInterface::ConstIterator | constEnd () const override
Gets an iterator pointing at the end of the map after the last vehicle profile (use for read-only). More...
virtual bool | contains (VehicleProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a vehicle profile with the given name. More...
virtual int | count () const override
Method which returns the number of vehicle profiles in the map. More...
virtual VehicleProfileMapInterface::Iterator | end () override
Gets an iterator pointing to the end of the map after the last vehicle profile. More...
virtual VehicleProfileMapInterface::Item * | getItem (VehicleProfileMapInterface::Name const &name) const override
Method which returns a pointer to the vehicle profile with the given name. If the map does not contain a vehicle profile with this name, nullptr is returned. More...
virtual VehicleProfileMapInterface::Name | getName (VehicleProfileMapInterface::Item *const item) const override
Method wich returns the name of the given vehicle profile. More...
virtual QStringList | keys () const override
Method which returns the (string) list of all vehicle profile names in the map. More...
virtual bool | remove (VehicleProfileMapInterface::Name const &name) override
Method which removes the vehicle profile with the given name from the map. The profile is deleted after removing. Nothing will be done if there is no such profile. More...
virtual void | setName (VehicleProfileMapInterface::Item *const item, VehicleProfileMapInterface::Name const &name) override
Method wich changes the name of the given vehicle profile to the one passed as second argument. More...
virtual QList< Item * > | values () const override
Method which returns a list of pointers to all vehicle profiles in the map. More...

Additional Inherited Members

- Public Types inherited from VehicleProfileMapInterface
using | ConstIterator = Map::ConstIterator
a const iterator of the map (for read-only operations)
using | Item = VehicleProfileItemInterface
typedef for vehicle profiles (items registered in the map)
using | Iterator = Map::Iterator
an iterator of the map
using | Map = QMap< Name, Item * >
typedef for the map, i.e. the container object of vehicle profiles
using | Name = VehicleProfileItemInterface::Name
typedef for vehicle profile names (= key identifiers of the map)
- Signals inherited from VehicleProfileMapInterface
void | added (Name const &name)
Signal emitted when a vehicle profile has been added to the map. Transmits the name of the correponding vehicle profile. More...
void | modifiedName (Name const &oldName, Name const &newName)
Signal emitted when the name of the vehicle profile has been changed. Transmits both, the new and old names of the profile. More...
void | removed (Name const &name)
Signal emitted when a vehicle profile has been removed from the map. Transmits the name of the correponding vehicle profile. More...

Detailed Description

This class implements the functionality of VehicleProfileMapInterface.

Definition at line 25 of file VehicleProfileMapModel.h.

Member Function Documentation

◆ add() [1/2]

bool VehicleProfileMapModel::add ( VehicleProfileMapInterface::Name const & name )
overridevirtual

Method which creates a new vehicle profile (instance of VehicleProfileItemInterface) and adds it to the map under the given name.

Parameters
[in] name the name under which the newly created item is registered
Returns
"true", if name is not used already, otherwise "false"

Implements VehicleProfileMapInterface.

Definition at line 42 of file VehicleProfileMapModel.cpp.

43 {
44 if(!contains(name))
45 {
46 profiles.insert(name, new VehicleProfileItemModel(this));
47 Q_EMIT added(name);
48 return true;
49 }
50
51 return false;
52 }
VehicleProfileMapInterface::added
void added(Name const &name)
Signal emitted when a vehicle profile has been added to the map. Transmits the name of the correpondi...
VehicleProfileMapModel::contains
virtual bool contains(VehicleProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a vehicle profile with the given name.
Definition: VehicleProfileMapModel.cpp:108
VehicleProfileItemModel
This class implements the functionality of VehicleProfileItemInterface.
Definition: VehicleProfileItemModel.h:25

◆ add() [2/2]

bool VehicleProfileMapModel::add | ( | VehicleProfileMapInterface::Name const & | name,
 |  | VehicleProfileMapInterface::Item const *const | item
 | ) |  |
overridevirtual

Method which creates a copy of the given vehicle profile (seond argument) and adds it to the map using the given name.

Parameters
[in] | name | the name under which the copied item is registered
[in] | item | the vehicle pofile to be copied
Returns
"true", if name is not used already, otherwise "false"

Implements VehicleProfileMapInterface.

Definition at line 54 of file VehicleProfileMapModel.cpp.

55 {
56
57 if(!contains(name))
58 {
59 profiles.insert(name, new VehicleProfileItemModel(item, this));
60 Q_EMIT added(name);
61 return true;
62 }
63
64 return false;
65 }
VehicleProfileMapInterface::added
void added(Name const &name)
Signal emitted when a vehicle profile has been added to the map. Transmits the name of the correpondi...
VehicleProfileMapModel::contains
virtual bool contains(VehicleProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a vehicle profile with the given name.
Definition: VehicleProfileMapModel.cpp:108
VehicleProfileItemModel
This class implements the functionality of VehicleProfileItemInterface.
Definition: VehicleProfileItemModel.h:25

◆ begin()

VehicleProfileMapInterface::Iterator VehicleProfileMapModel::begin ( )
overridevirtual

Gets an iterator pointing to the first vehicle profile in the map.

Returns
The iterator pointing at the first object in the map.

Implements VehicleProfileMapInterface.

Definition at line 21 of file VehicleProfileMapModel.cpp.

22 {
23 return profiles.begin();
24 }

◆ constBegin()

VehicleProfileMapInterface::ConstIterator VehicleProfileMapModel::constBegin ( ) const
overridevirtual

Gets an iterator pointing to the first vehicle profile in the map (use for read-only since pointing at constant values).

Returns
The iterator pointing at the first object in the map.

Implements VehicleProfileMapInterface.

Definition at line 26 of file VehicleProfileMapModel.cpp.

27 {
28 return profiles.constBegin();
29 }

◆ constEnd()

VehicleProfileMapInterface::ConstIterator VehicleProfileMapModel::constEnd ( ) const
overridevirtual

Gets an iterator pointing at the end of the map after the last vehicle profile (use for read-only).

Returns
The iterator pointing at the end of the map.

Implements VehicleProfileMapInterface.

Definition at line 36 of file VehicleProfileMapModel.cpp.

37 {
38 return profiles.constEnd();
39 }

◆ contains()

bool VehicleProfileMapModel::contains ( VehicleProfileMapInterface::Name const & name ) const
overridevirtual

Method wich checks whether the map contains a vehicle profile with the given name.

Parameters
[in] name the name to be searched for
Returns
true, if profile with given name exists, otherwise false.

Implements VehicleProfileMapInterface.

Definition at line 108 of file VehicleProfileMapModel.cpp.

109 {
110 return profiles.contains(name);
111 }

◆ count()

int VehicleProfileMapModel::count ( ) const
overridevirtual

Method which returns the number of vehicle profiles in the map.

Returns
the number of vehicle profiles in the map

Implements VehicleProfileMapInterface.

Definition at line 123 of file VehicleProfileMapModel.cpp.

124 {
125 return profiles.count();
126 }

◆ end()

VehicleProfileMapInterface::Iterator VehicleProfileMapModel::end ( )
overridevirtual

Gets an iterator pointing to the end of the map after the last vehicle profile.

Returns
The iterator pointing at the end of the map.

Implements VehicleProfileMapInterface.

Definition at line 31 of file VehicleProfileMapModel.cpp.

32 {
33 return profiles.end();
34 }

◆ getItem()

VehicleProfileMapInterface::Item * VehicleProfileMapModel::getItem ( VehicleProfileMapInterface::Name const & name ) const
overridevirtual

Method which returns a pointer to the vehicle profile with the given name. If the map does not contain a vehicle profile with this name, nullptr is returned.

Parameters
[in] name the name of the vehicle profile to be returned
Returns
the pointer to a vehicle profile of given name, nullptr if given name does not exist in the map

Implements VehicleProfileMapInterface.

Definition at line 79 of file VehicleProfileMapModel.cpp.

80 {
81 if(contains(name))
82 {
83 return profiles.value(name);
84 }
85
86 return nullptr;
87 }
VehicleProfileMapModel::contains
virtual bool contains(VehicleProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a vehicle profile with the given name.
Definition: VehicleProfileMapModel.cpp:108

◆ getName()

VehicleProfileMapInterface::Name VehicleProfileMapModel::getName ( VehicleProfileMapInterface::Item *const item ) const
overridevirtual

Method wich returns the name of the given vehicle profile.

Parameters
[in] item the pointer to the vehicle profile in question
Returns
the name of the given vehicle profile

Implements VehicleProfileMapInterface.

Definition at line 90 of file VehicleProfileMapModel.cpp.

91 {
92 return profiles.key(item);
93 }

◆ keys()

QStringList VehicleProfileMapModel::keys ( ) const
overridevirtual

Method which returns the (string) list of all vehicle profile names in the map.

Returns
the (string) list of all vehicle profile names

Implements VehicleProfileMapInterface.

Definition at line 113 of file VehicleProfileMapModel.cpp.

114 {
115 return QStringList( profiles.keys() );
116 }

◆ remove()

bool VehicleProfileMapModel::remove ( VehicleProfileMapInterface::Name const & name )
overridevirtual

Method which removes the vehicle profile with the given name from the map. The profile is deleted after removing. Nothing will be done if there is no such profile.

Parameters
[in] name the name of the vehicle profile to be removed
Returns
"true", if name exists in the map, otherwise "false"

Implements VehicleProfileMapInterface.

Definition at line 67 of file VehicleProfileMapModel.cpp.

68 {
69 if(contains(name))
70 {
71 delete profiles.take(name);
72 Q_EMIT removed(name);
73 return true;
74 }
75
76 return false;
77 }
VehicleProfileMapModel::contains
virtual bool contains(VehicleProfileMapInterface::Name const &name) const override
Method wich checks whether the map contains a vehicle profile with the given name.
Definition: VehicleProfileMapModel.cpp:108
VehicleProfileMapInterface::removed
void removed(Name const &name)
Signal emitted when a vehicle profile has been removed from the map. Transmits the name of the correp...

◆ setName()

void VehicleProfileMapModel::setName | ( | VehicleProfileMapInterface::Item *const | item,
 |  | VehicleProfileMapInterface::Name const & | name
 | ) |  |
overridevirtual

Method wich changes the name of the given vehicle profile to the one passed as second argument.

Parameters
[in] | item | the pointer to the vehicle profile to be renamed
[in] | name | the new name of the agent profile

Implements VehicleProfileMapInterface.

Definition at line 95 of file VehicleProfileMapModel.cpp.

97 {
98
99 Name oldName = getName(item);
100
101 profiles.take(oldName);
102 profiles.insert(name, item);
103
104 Q_EMIT modifiedName(oldName, name);
105 }
VehicleProfileMapModel::getName
virtual VehicleProfileMapInterface::Name getName(VehicleProfileMapInterface::Item *const item) const override
Method wich returns the name of the given vehicle profile.
Definition: VehicleProfileMapModel.cpp:90
VehicleProfileMapInterface::Name
VehicleProfileItemInterface::Name Name
typedef for vehicle profile names (= key identifiers of the map)
Definition: VehicleProfileMapInterface.h:44
VehicleProfileMapInterface::modifiedName
void modifiedName(Name const &oldName, Name const &newName)
Signal emitted when the name of the vehicle profile has been changed. Transmits both, the new and old names of the profile.

◆ values()

QList< VehicleProfileItemInterface * > VehicleProfileMapModel::values ( ) const
overridevirtual

Method which returns a list of pointers to all vehicle profiles in the map.

Returns
the list of pointers to all vehicle profiles

Implements VehicleProfileMapInterface.

Definition at line 118 of file VehicleProfileMapModel.cpp.

119 {
120 return profiles.values();
121 }
The documentation for this class was generated from the following files:
  • VehicleProfileMapModel.h
  • VehicleProfileMapModel.cpp
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleProfileMapModel Member List

This is the complete list of members for VehicleProfileMapModel, including all inherited members.

add(VehicleProfileMapInterface::Name const &name) override | VehicleProfileMapModel | virtual
add(VehicleProfileMapInterface::Name const &name, VehicleProfileMapInterface::Item const *const item) override | VehicleProfileMapModel | virtual
added(Name const &name) | VehicleProfileMapInterface | signal
begin() override | VehicleProfileMapModel | virtual
constBegin() const override | VehicleProfileMapModel | virtual
constEnd() const override | VehicleProfileMapModel | virtual
ConstIterator typedef | VehicleProfileMapInterface |
contains(VehicleProfileMapInterface::Name const &name) const override | VehicleProfileMapModel | virtual
count() const override | VehicleProfileMapModel | virtual
end() override | VehicleProfileMapModel | virtual
getItem(VehicleProfileMapInterface::Name const &name) const override | VehicleProfileMapModel | virtual
getName(VehicleProfileMapInterface::Item *const item) const override | VehicleProfileMapModel | virtual
Item typedef | VehicleProfileMapInterface |
Iterator typedef | VehicleProfileMapInterface |
keys() const override | VehicleProfileMapModel | virtual
Map typedef | VehicleProfileMapInterface |
modifiedName(Name const &oldName, Name const &newName) | VehicleProfileMapInterface | signal
Name typedef | VehicleProfileMapInterface |
remove(VehicleProfileMapInterface::Name const &name) override | VehicleProfileMapModel | virtual
removed(Name const &name) | VehicleProfileMapInterface | signal
setName(VehicleProfileMapInterface::Item *const item, VehicleProfileMapInterface::Name const &name) override | VehicleProfileMapModel | virtual
values() const override | VehicleProfileMapModel | virtual
Generated on Wed Feb 19 2020 14:58:15 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfilesMapPresenter Class Reference

Public Slots | Signals | Public Member Functions | Private Attributes | List of all members
VehicleProfilesMapPresenter Class Reference

This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle profiles. In fact, this class implements a wrapper for the map of vehicle profiles (VehicleProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework. More...

Inherits QAbstractTableModel.

Public Slots

void | editName (AgentItemInterface::VehicleProfile const &oldName, AgentItemInterface::VehicleProfile const &newName)
Slot which changes the name of the vehicle profile. More...
void | remove (AgentItemInterface::VehicleProfile const &profile)
Slot removes the given vehicle profile if contained in the table. More...

Signals

void checkProbabilities ()
Signal emitted whenever the probability sum of the vehicle profile table should be checked. This usually happens whenever vehicle profiles are added or removed or if probability values are edited.

Public Member Functions

virtual void | addRow (int const &row, AgentItemInterface::VehicleProfile const &profile, AgentItemInterface::Probability const &probability)
Method that adds a new row, i.e. a vehicle profile with the given probability. More...
int | columnCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders. More...
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex). More...
Qt::ItemFlags | flags (const QModelIndex &index) const override
Reimplementation of the flags method. This will make the items of the model editable! More...
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format. More...
virtual bool | removeRow (const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval. More...
int | rowCount (const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of vehicle profiles. More...
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value. More...
void | setVehicleProfiles (AgentItemInterface::VehicleProfiles *const _vehicleProfiles)
Method which sets the currently processed vehicle profiles map to the given argument. More...
void | update ()
Method which updates the table according to the current entries of vehicleProfiles.

Private Attributes

QStringList | _columnHeaders
the list containing the header data for columns
QMap< int, AgentItemInterface::VehicleProfile > | RowToProfile
a mapping of row indices to profile names
AgentItemInterface::VehicleProfiles * vehicleProfiles
the pointer to the map of vehicle profiles assigned to an agent profile

Detailed Description

This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle profiles. In fact, this class implements a wrapper for the map of vehicle profiles (VehicleProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework.

Definition at line 33 of file VehicleProfilesMapPresenter.h.

Member Function Documentation

◆ addRow()

void VehicleProfilesMapPresenter::addRow | ( | int const & | row,
 |  | AgentItemInterface::VehicleProfile const & | profile,
 |  | AgentItemInterface::Probability const & | probability
 | ) |  |
virtual

Method that adds a new row, i.e. a vehicle profile with the given probability.

Parameters
[in] | row | the index of the row to be added
[in] | profile | the name of the profile to be added
[in] | probability | the probability of the profile

Definition at line 103 of file VehicleProfilesMapPresenter.cpp.

106 {
107 if(vehicleProfiles)
108 {
109 for(auto _row= RowToProfile.size()-1; _row>=row; _row--)
110 RowToProfile.insert(_row + 1, RowToProfile.take(_row));
111
112 RowToProfile.insert( row, profile );
113
114 beginInsertRows(QModelIndex(), row, row );
115 vehicleProfiles->insert(profile, probability);
116 endInsertRows();
117 Q_EMIT checkProbabilities();
118 }
119
120 }
VehicleProfilesMapPresenter::vehicleProfiles
AgentItemInterface::VehicleProfiles * vehicleProfiles
the pointer to the map of vehicle profiles assigned to an agent profile
Definition: VehicleProfilesMapPresenter.h:177
VehicleProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::VehicleProfile > RowToProfile
a mapping of row indices to profile names
Definition: VehicleProfilesMapPresenter.h:181
VehicleProfilesMapPresenter::checkProbabilities
void checkProbabilities()
Signal emitted whenever the probability sum of the vehicle profile table should be checked...

◆ columnCount()

int VehicleProfilesMapPresenter::columnCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the columnCount method. Returns the number of columns, in fact the number of list entries of _columnHeaders.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table columns

Definition at line 42 of file VehicleProfilesMapPresenter.cpp.

43 {
44 Q_UNUSED(parent)
45
46 return _columnHeaders.count();
47 }
VehicleProfilesMapPresenter::_columnHeaders
QStringList _columnHeaders
the list containing the header data for columns
Definition: VehicleProfilesMapPresenter.h:180

◆ data()

QVariant VehicleProfilesMapPresenter::data | ( | const QModelIndex & | index,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the data method. Returns the data stored in the table cell referenced by the given index (QModelIndex).

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::DisplayRole or Qt::EditRole)
Returns
The data stored in the table cell (as a QVariant)

Definition at line 49 of file VehicleProfilesMapPresenter.cpp.

50 {
51 int row = index.row();
52 int col = index.column();
53
54 if(!vehicleProfiles && row >= vehicleProfiles->count())
55 return QVariant::Invalid;
56
57 if( role == Qt::TextAlignmentRole)
58 return QVariant( Qt::AlignCenter );
59
60 if(role == Qt::DisplayRole || role == Qt::EditRole)
61 {
62 if(col == 0)
63 return QVariant(RowToProfile[row]);
64 else if(col == 1)
65 return QVariant(vehicleProfiles->value( RowToProfile[row] ));
66 }
67
68 return QVariant();
69 }
VehicleProfilesMapPresenter::vehicleProfiles
AgentItemInterface::VehicleProfiles * vehicleProfiles
the pointer to the map of vehicle profiles assigned to an agent profile
Definition: VehicleProfilesMapPresenter.h:177
VehicleProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::VehicleProfile > RowToProfile
a mapping of row indices to profile names
Definition: VehicleProfilesMapPresenter.h:181

◆ editName

void VehicleProfilesMapPresenter::editName | ( | AgentItemInterface::VehicleProfile const & | oldName,
 |  | AgentItemInterface::VehicleProfile const & | newName
 | ) |  |
slot

Slot which changes the name of the vehicle profile.

Parameters
[in] | oldName | the old name of the vehicle profile
[in] | newName | the new name of the vehicle profile

Definition at line 167 of file VehicleProfilesMapPresenter.cpp.

169 {
170 if(vehicleProfiles && vehicleProfiles->contains(oldName))
171 {
172 vehicleProfiles->insert( newName, vehicleProfiles->take(oldName));
173
174 int row = RowToProfile.key(oldName);
175 RowToProfile.insert(row, newName);
176 }
177 }
VehicleProfilesMapPresenter::vehicleProfiles
AgentItemInterface::VehicleProfiles * vehicleProfiles
the pointer to the map of vehicle profiles assigned to an agent profile
Definition: VehicleProfilesMapPresenter.h:177
VehicleProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::VehicleProfile > RowToProfile
a mapping of row indices to profile names
Definition: VehicleProfilesMapPresenter.h:181

◆ flags()

Qt::ItemFlags VehicleProfilesMapPresenter::flags ( const QModelIndex & index ) const
override

Reimplementation of the flags method. This will make the items of the model editable!

Parameters
[in] index An index identifying the cell of the table
Returns
An item flag

Definition at line 98 of file VehicleProfilesMapPresenter.cpp.

99 {
100 return Qt::ItemIsEditable | QAbstractTableModel::flags(index);
101 }

◆ headerData()

QVariant VehicleProfilesMapPresenter::headerData | ( | int | section,
 |  | Qt::Orientation | orientation,
 |  | int | role = Qt::DisplayRole
 | ) |  | const
 override

Reimplementation of the headerData method. Returns the data of the table's header in the table section passed as a first argument. Further, the given role needs to be Qt::DisplayRole and the given orientation needs to be horizontal. The header data (stored in _columnHeaders) is returned in the QVariant data format.

Parameters
[in] | section | A table section
[in] | role | A Qt role
[in] | orientation | A table orientation
Returns
The content of the table's header at the given section

Definition at line 21 of file VehicleProfilesMapPresenter.cpp.

22 {
23 if( (role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
24 return _columnHeaders.value(section);
25
26 if((role == Qt::DisplayRole) && (orientation == Qt::Vertical))
27 return section + 1;
28
29 return QVariant();
30 }
VehicleProfilesMapPresenter::_columnHeaders
QStringList _columnHeaders
the list containing the header data for columns
Definition: VehicleProfilesMapPresenter.h:180

◆ remove

void VehicleProfilesMapPresenter::remove ( AgentItemInterface::VehicleProfile const & profile )
slot

Slot removes the given vehicle profile if contained in the table.

Parameters
[in] profile the profile to be removed

Definition at line 179 of file VehicleProfilesMapPresenter.cpp.

180 {
181 removeRow(RowToProfile.key(profile));
182 }
VehicleProfilesMapPresenter::removeRow
virtual bool removeRow(const int &row)
Method that removes the row specified by the given row-index, if this is in a meaningful interval...
Definition: VehicleProfilesMapPresenter.cpp:122
VehicleProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::VehicleProfile > RowToProfile
a mapping of row indices to profile names
Definition: VehicleProfilesMapPresenter.h:181

◆ removeRow()

bool VehicleProfilesMapPresenter::removeRow ( const int & row )
virtual

Method that removes the row specified by the given row-index, if this is in a meaningful interval.

Parameters
[in] row the row-index
Returns
"True", if row is between 0 and the number of profiles, "false", otherwise

Definition at line 122 of file VehicleProfilesMapPresenter.cpp.

123 {
124 if(vehicleProfiles && RowToProfile.contains(row) && vehicleProfiles->contains(RowToProfile[row]))
125 {
126 beginRemoveRows(QModelIndex(), row, row);
127
128 vehicleProfiles->take( RowToProfile[row] );
129 RowToProfile.take(row);
130
131 for( int i = row + 1; i<=RowToProfile.count() ; i++ )
132 RowToProfile.insert( i-1, RowToProfile.take(i));
133
134 endRemoveRows();
135 Q_EMIT checkProbabilities();
136 return true;
137 }
138 else
139 return false;
140 }
VehicleProfilesMapPresenter::vehicleProfiles
AgentItemInterface::VehicleProfiles * vehicleProfiles
the pointer to the map of vehicle profiles assigned to an agent profile
Definition: VehicleProfilesMapPresenter.h:177
VehicleProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::VehicleProfile > RowToProfile
a mapping of row indices to profile names
Definition: VehicleProfilesMapPresenter.h:181
VehicleProfilesMapPresenter::checkProbabilities
void checkProbabilities()
Signal emitted whenever the probability sum of the vehicle profile table should be checked...

◆ rowCount()

int VehicleProfilesMapPresenter::rowCount ( const QModelIndex & parent = QModelIndex() ) const
override

Reimplementation of the rowCount method. Returns the number of rows in the table which is, in fact, the number of vehicle profiles.

Parameters
[in] parent This variable is unused (but required according to the signature of the method)
Returns
The number of table rows

Definition at line 32 of file VehicleProfilesMapPresenter.cpp.

33 {
34 Q_UNUSED(parent)
35
36 if(vehicleProfiles)
37 return vehicleProfiles->count();
38 else
39 return 0;
40 }
VehicleProfilesMapPresenter::vehicleProfiles
AgentItemInterface::VehicleProfiles * vehicleProfiles
the pointer to the map of vehicle profiles assigned to an agent profile
Definition: VehicleProfilesMapPresenter.h:177

◆ setData()

bool VehicleProfilesMapPresenter::setData | ( | const QModelIndex & | index,
 |  | const QVariant & | value,
 |  | int | role = Qt::EditRole
 | ) |  |
override

Reimplementation of the setData method. Sets the data stored in the table cell referenced by the given index (QModelIndex) to the given value.

Parameters
[in] | index | An index identifying the cell of the table
[in] | role | A Qt role (needs to be in Qt::EditRole)
Returns
"True" if the index corresponds to an existing cell in the table, otherwise "false"

Definition at line 71 of file VehicleProfilesMapPresenter.cpp.

72 {
73 int row = index.row();
74 int col = index.column();
75
76 if(vehicleProfiles && role == Qt::EditRole)
77 {
78 if(col == 0 && !vehicleProfiles->keys().contains(value.toString()))
79 {
80 vehicleProfiles->insert( value.toString(), vehicleProfiles->take(RowToProfile[row]) );
81 RowToProfile.take( row );
82 RowToProfile.insert( row, value.toString() );
83 Q_EMIT dataChanged(index, index);
84 return true;
85 }
86 else if ( col ==1 && vehicleProfiles->contains(RowToProfile[row]))
87 {
88 (*vehicleProfiles)[RowToProfile[row]] = value.toDouble();
89 Q_EMIT dataChanged(index, index);
90 Q_EMIT checkProbabilities();
91 return true;
92 }
93 }
94
95 return false;
96 }
VehicleProfilesMapPresenter::vehicleProfiles
AgentItemInterface::VehicleProfiles * vehicleProfiles
the pointer to the map of vehicle profiles assigned to an agent profile
Definition: VehicleProfilesMapPresenter.h:177
VehicleProfilesMapPresenter::RowToProfile
QMap< int, AgentItemInterface::VehicleProfile > RowToProfile
a mapping of row indices to profile names
Definition: VehicleProfilesMapPresenter.h:181
VehicleProfilesMapPresenter::checkProbabilities
void checkProbabilities()
Signal emitted whenever the probability sum of the vehicle profile table should be checked...

◆ setVehicleProfiles()

void VehicleProfilesMapPresenter::setVehicleProfiles ( AgentItemInterface::VehicleProfiles *const _vehicleProfiles )

Method which sets the currently processed vehicle profiles map to the given argument.

Parameters
[in] _vehicleProfiles the vehicle profiles map to be processed

Definition at line 142 of file VehicleProfilesMapPresenter.cpp.

143 {
144 vehicleProfiles=_vehicleProfiles;
145 update();
146 }
VehicleProfilesMapPresenter::update
void update()
Method which updates the table according to the current entries of vehicleProfiles.
Definition: VehicleProfilesMapPresenter.cpp:149
VehicleProfilesMapPresenter::vehicleProfiles
AgentItemInterface::VehicleProfiles * vehicleProfiles
the pointer to the map of vehicle profiles assigned to an agent profile
Definition: VehicleProfilesMapPresenter.h:177
The documentation for this class was generated from the following files:
  • VehicleProfilesMapPresenter.h
  • VehicleProfilesMapPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleProfilesMapPresenter Member List

This is the complete list of members for VehicleProfilesMapPresenter, including all inherited members.

_columnHeaders | VehicleProfilesMapPresenter | private
addRow(int const &row, AgentItemInterface::VehicleProfile const &profile, AgentItemInterface::Probability const &probability) | VehicleProfilesMapPresenter | virtual
checkProbabilities() | VehicleProfilesMapPresenter | signal
columnCount(const QModelIndex &parent=QModelIndex()) const override | VehicleProfilesMapPresenter |
data(const QModelIndex &index, int role=Qt::DisplayRole) const override | VehicleProfilesMapPresenter |
editName(AgentItemInterface::VehicleProfile const &oldName, AgentItemInterface::VehicleProfile const &newName) | VehicleProfilesMapPresenter | slot
flags(const QModelIndex &index) const override | VehicleProfilesMapPresenter |
headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override | VehicleProfilesMapPresenter |
remove(AgentItemInterface::VehicleProfile const &profile) | VehicleProfilesMapPresenter | slot
removeRow(const int &row) | VehicleProfilesMapPresenter | virtual
rowCount(const QModelIndex &parent=QModelIndex()) const override | VehicleProfilesMapPresenter |
RowToProfile | VehicleProfilesMapPresenter | private
setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override | VehicleProfilesMapPresenter |
setVehicleProfiles(AgentItemInterface::VehicleProfiles *const _vehicleProfiles) | VehicleProfilesMapPresenter |
update() | VehicleProfilesMapPresenter |
vehicleProfiles | VehicleProfilesMapPresenter | private
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfilesPresenter Class Reference

Public Slots | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
VehicleProfilesPresenter Class Reference

This class defines the presenter object for vehicle profiles which handles user events from the view (VehicleProfilesView) and edits the model data (VehicleProfileMapInterface) accordingly. More...

Inherits QObject.

Public Slots

void | loadModelCatalogue (QString const &filepath)
Method which scans the vehicle model catalogue specified by the given filepath and stores the vehicle model names defined therein in modelList. More...
void | refreshModelCatalogue ()
Slot triggered by the VehicleProfilesView::refreshModelCatalogue and ProjectInterface::update signals. Re-loads the currently selected vehicle model catalogue and updates the error messages accordingly.
void | refreshSystemConfig ()
Slot triggered by the VehicleProfilesView::refreshSystemConfig and ProjectInterface::update signals. Updates the system list of the currently selected system config file and upates the error messages accordingly.

Public Member Functions

void | updateVehicleSelectionItems ()
Method which updates the combo box list of available vehicle profiles to the ones currently defined in the model data (VehicleProfileMapInterface).
void | updateView ()
Method which completely re-builds the view according to the model data of the currently selected vehicle profile.

Private Slots

void | addSystem (QString const &type, QString const &selectionItem)
Slot, triggered by the SystemProfileView::addSystem signal. Undoably adds the given system selection item to the systems map of the given algorithm type. More...
void | addSystemProfile (QString const &type)
Slot, triggered by the VehicleProfilesView::addSystemProfile signal. Undoably adds a map for systems of the given algorithm type and creates a corresponding table view and presenter object. More...
void | addVehicleProfile (QString const &name)
Slot triggered by the VehicleProfilesView::addVehicleProfile signal. Performs an undoable add-operation on the vehicle profiles map. Sets the newly created vehicle profile as the currently edited profile and updates the view accordingly. More...
void | editVehicleProfileName (QString const &oldName, QString const &newName)
Slot triggered by the VehicleProfilesView::modifiedName signal. Performs an undoable rename-operation on the name of the currently edited vehicle profile. More...
void | removeSystem (QString const &type, int const &row)
Slot, triggered by the SystemProfileView::removeSystem signal. Undoably removes the specified row from the systems table (map) of the given algorithm type. More...
void | removeSystemProfile (QString const &type)
Slot, triggered by the VehicleProfilesView::removeSystemProfile signal. Undoably removes the map for systems of the given algorithm type, destroys the corresponding table view and deregisters the corresponding presenter object. More...
void | removeVehicleProfile (QString const &name)
Slot triggered by the VehicleProfilesView::removeVehicleProfile signal. Performs an undoable remove-operation on the vehicle profiles map removing the currently selected profile. If the list of available profiles is not empty, it sets the currently edited profile to the first entry of the list. More...
void | setCurrentVehicleProfile (QString const &name)
Slot triggered by the VehicleProfilesView::selectedVehicleProfile signal. Performs an undoable set-operation on the currently edited vehicle profile setting it to the transmitted profile. Updates the view accordingly. More...
void | setModel (QString const &modelName)
Slot triggered by the VehicleProfilesView::modifiedModel signal. Performs an undoable assignment of the given vehicle model to the currently edited vehicle profile. More...
void | setModelCatalogue ()
Slot triggered by the VehicleProfilesView::changeModelCatalogue signal. Opens a file dialog for the user to select a vehicle model catalogue file. After a non-empty selection has been made, an undoable set-operation for the model catalogue of the currently edited vehicle profile ist performed. The model catalogue is thereby set to the one selected by the user and the view is updated accordingly.
void | setSystemConfig ()
Slot triggered by the VehicleProfilesView::changeSystemConfig signal. Opens a file dialog for the user to select a system config XML file. After a non-empty selection has been made, an undoable set-operation on the system config of the currently edited vehicle profile ist performed. The system config is thereby set to the one selected by the user and the view is updated accordingly.

Private Member Functions

bool | systemsConsistent ()
Method which checks whether all assigned systems are consistent with the currently selected system config file. More...
void | updateSystemList ()
Method which updates the list of all available systems in the currently selected system config, sorted by the algorithm types.
void | updateSystemsView ()
Method which completely re-builds the view of all system tables which are included into the currently edited vehicle profile. Is called by the updateView method.

Private Attributes

VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
QList< QString > | modelList
the list of all models in the current vehicle model catalogue
ProjectInterface *const | project
a pointer to the project interface for accessing the config file structure
SystemInterface *const | systemInterface
a pointer to the system interface of the System editor. Serves as a container into which the system config can be loaded.
QMap< QString, QList< QString > > | systemList
the list of all systems in the current system config sorted by the algorithm type
QMap< VehicleProfileItemInterface::Name, QMap< QString, SystemProfilePresenter * > * > | systemProfilePresenters
a container for each vehicle profile that stores all table presenter objects for systems of a certain algorithm type
QUndoStack *const | undoStack
a pointer to the undo stack
VehicleProfileMapInterface *const | vehicleProfiles
the pointer to the map of vehicle profiles
VehicleProfilesView *const | vehicleProfilesView
the pointer to the view displaying the currently edited profile

Static Private Attributes

static double default_probability = 0.5
a default probability

Friends

class AgentConfigurationPresenter

Detailed Description

This class defines the presenter object for vehicle profiles which handles user events from the view (VehicleProfilesView) and edits the model data (VehicleProfileMapInterface) accordingly.

Since all actions performed on the model data (i.e. the *.ui file) should be undoable, the presenter instantiates the corresponding undo-commands and pushes them onto the undo stack. The actual operation on the model is then performed in these command object using the re-implementations of the undo/redo methods. See Qt's undo framework for further details.

Definition at line 59 of file VehicleProfilesPresenter.h.

Member Function Documentation

◆ addSystem

void VehicleProfilesPresenter::addSystem | ( | QString const & | type,
 |  | QString const & | selectionItem
 | ) |  |
privateslot

Slot, triggered by the SystemProfileView::addSystem signal. Undoably adds the given system selection item to the systems map of the given algorithm type.

Parameters
[in] | type | the algorithm type specifying the map of systems to which a system is to be added
[in] | selectionItem | the item of the system combo box that has been selected for adding

Definition at line 227 of file VehicleProfilesPresenter.cpp.

228 {
229 // find the system profile presenter
230 if(currentVehicleProfile)
231 {
232 SystemProfilePresenter * systemProfilePresenter = systemProfilePresenters.value(currentVehicleProfile->getName())->value(type);
233
234 if(systemProfilePresenter)
235 {
236 VehicleProfileItemInterface::System system;
237
238 // string has pattern "Title (ID=0)"
239 system.second = selectionItem.section( " (ID=", 0, 0);
240 QString ID = selectionItem.section( " (ID=", 1, 1);
241 ID.chop(1);
242 system.first = ID.toUInt();
243
244 undoStack->push(new VehicleProfileCommands::AddSystem(systemProfilePresenter, system, default_probability));
245 }
246 }
247 }
VehicleProfileItemInterface::System
QPair< SystemID, SystemTitle > System
typedef for a system (here, the system Id and title are sufficient)
Definition: VehicleProfileItemInterface.h:87
VehicleProfileCommands::AddSystem
This class defines the command for undoable add-operations on the map of systems of a specific algori...
Definition: VehicleProfilesPresenter.h:527
VehicleProfilesPresenter::systemProfilePresenters
QMap< VehicleProfileItemInterface::Name, QMap< QString, SystemProfilePresenter * > * > systemProfilePresenters
a container for each vehicle profile that stores all table presenter objects for systems of a certain...
Definition: VehicleProfilesPresenter.h:265
SystemProfilePresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of systems wit...
Definition: SystemProfilePresenter.h:35
VehicleProfilesPresenter::currentVehicleProfile
VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
Definition: VehicleProfilesPresenter.h:257
VehicleProfilesPresenter::default_probability
static double default_probability
a default probability
Definition: VehicleProfilesPresenter.h:268
VehicleProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of the vehicle profile.
VehicleProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: VehicleProfilesPresenter.h:262

◆ addSystemProfile

void VehicleProfilesPresenter::addSystemProfile ( QString const & type )
privateslot

Slot, triggered by the VehicleProfilesView::addSystemProfile signal. Undoably adds a map for systems of the given algorithm type and creates a corresponding table view and presenter object.

Note
The aforementioned map of systems is called system profile in this implementation.
Parameters
[in] type the algorithm type for the map of systems to be created

Definition at line 202 of file VehicleProfilesPresenter.cpp.

203 {
204 if(currentVehicleProfile && !currentVehicleProfile->getSystemProfiles()->keys().contains(type) && !type.isEmpty())
205 {
206 undoStack->push(new VehicleProfileCommands::AddSystemProfile(vehicleProfiles,
207 currentVehicleProfile->getName(),
208 type,
209 systemProfilePresenters.value(currentVehicleProfile->getName()),
210 this));
211 }
212 }
VehicleProfilesPresenter::systemProfilePresenters
QMap< VehicleProfileItemInterface::Name, QMap< QString, SystemProfilePresenter * > * > systemProfilePresenters
a container for each vehicle profile that stores all table presenter objects for systems of a certain...
Definition: VehicleProfilesPresenter.h:265
VehicleProfilesPresenter::vehicleProfiles
VehicleProfileMapInterface *const vehicleProfiles
the pointer to the map of vehicle profiles
Definition: VehicleProfilesPresenter.h:258
VehicleProfilesPresenter::currentVehicleProfile
VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
Definition: VehicleProfilesPresenter.h:257
VehicleProfileItemInterface::getSystemProfiles
virtual SystemProfiles * getSystemProfiles() const =0
Method which returns all mappings of systems to probabilities sorted by their algorithm type...
VehicleProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of the vehicle profile.
VehicleProfileCommands::AddSystemProfile
This class defines the command for undoably creating a new map for systems of a specific algorithm ty...
Definition: VehicleProfilesPresenter.h:464
VehicleProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: VehicleProfilesPresenter.h:262

◆ addVehicleProfile

void VehicleProfilesPresenter::addVehicleProfile ( QString const & name )
privateslot

Slot triggered by the VehicleProfilesView::addVehicleProfile signal. Performs an undoable add-operation on the vehicle profiles map. Sets the newly created vehicle profile as the currently edited profile and updates the view accordingly.

Parameters
[in] name the name of the new driver profile

Definition at line 81 of file VehicleProfilesPresenter.cpp.

82 {
83 undoStack->beginMacro(QString("added vehicle profile %1").arg(name));
84 undoStack->push(new VehicleProfileCommands::AddVehicleProfile(vehicleProfiles, vehicleProfilesView, name,&systemProfilePresenters));
85 undoStack->push(new VehicleProfileCommands::SetCurrentVehicle(vehicleProfiles, &currentVehicleProfile, name, this));
86 undoStack->endMacro();
87 }
VehicleProfilesPresenter::systemProfilePresenters
QMap< VehicleProfileItemInterface::Name, QMap< QString, SystemProfilePresenter * > * > systemProfilePresenters
a container for each vehicle profile that stores all table presenter objects for systems of a certain...
Definition: VehicleProfilesPresenter.h:265
VehicleProfilesPresenter::vehicleProfiles
VehicleProfileMapInterface *const vehicleProfiles
the pointer to the map of vehicle profiles
Definition: VehicleProfilesPresenter.h:258
VehicleProfilesPresenter::currentVehicleProfile
VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
Definition: VehicleProfilesPresenter.h:257
VehicleProfilesPresenter::vehicleProfilesView
VehicleProfilesView *const vehicleProfilesView
the pointer to the view displaying the currently edited profile
Definition: VehicleProfilesPresenter.h:259
VehicleProfileCommands::SetCurrentVehicle
This class defines the command for undoable set-operations on the currently selected vehicle profile...
Definition: VehicleProfilesPresenter.h:277
VehicleProfileCommands::AddVehicleProfile
This class defines the command for undoable add-operations on the map of vehicle profiles (VehiclePro...
Definition: VehicleProfilesPresenter.h:302
VehicleProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: VehicleProfilesPresenter.h:262

◆ editVehicleProfileName

void VehicleProfilesPresenter::editVehicleProfileName | ( | QString const & | oldName,
 |  | QString const & | newName
 | ) |  |
privateslot

Slot triggered by the VehicleProfilesView::modifiedName signal. Performs an undoable rename-operation on the name of the currently edited vehicle profile.

Parameters
[in] | oldName | the old name of the vehicle profile
[in] | newName | the new name of the vehicle profile

Definition at line 104 of file VehicleProfilesPresenter.cpp.

105 {
106 if(vehicleProfiles->contains(oldName) && !vehicleProfiles->contains(newName))
107 {
108 undoStack->push(new VehicleProfileCommands::EditVehicleProfile(vehicleProfiles, vehicleProfilesView, oldName, newName));
109 }
110
111 }
VehicleProfileMapInterface::contains
virtual bool contains(VehicleProfileMapInterface::Name const &name) const =0
Method wich checks whether the map contains a vehicle profile with the given name.
VehicleProfilesPresenter::vehicleProfiles
VehicleProfileMapInterface *const vehicleProfiles
the pointer to the map of vehicle profiles
Definition: VehicleProfilesPresenter.h:258
VehicleProfileCommands::EditVehicleProfile
This class defines the command for undoable renaming-operations on the map of vehicle profiles (Vehic...
Definition: VehicleProfilesPresenter.h:357
VehicleProfilesPresenter::vehicleProfilesView
VehicleProfilesView *const vehicleProfilesView
the pointer to the view displaying the currently edited profile
Definition: VehicleProfilesPresenter.h:259
VehicleProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: VehicleProfilesPresenter.h:262

◆ loadModelCatalogue

void VehicleProfilesPresenter::loadModelCatalogue ( QString const & filepath )
slot

Method which scans the vehicle model catalogue specified by the given filepath and stores the vehicle model names defined therein in modelList.

Parameters
[in] filepath the file path of the vehicle model catalogue to be scanned for models

Definition at line 311 of file VehicleProfilesPresenter.cpp.

312 {
313 QString path = project->absoluteToConfigPath(filepath);
314 QFile file(path);
315
316 modelList.clear();
317 if(currentVehicleProfile && file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text) )
318 {
319 QXmlStreamReader xml(&file);
320 xml.readNextStartElement();
321
322 while( xml.readNextStartElement() )
323 {
324 if(xml.name() == QString("Catalog"))
325 {
326 while( xml.readNextStartElement() )
327 {
328 if(xml.name() == QString("Vehicle"))
329 {
330 modelList << xml.attributes().value("name").toString();
331 xml.skipCurrentElement();
332 }
333 else
334 xml.skipCurrentElement();
335 }
336 }
337 else
338 xml.skipCurrentElement();
339 }
340 }
341 vehicleProfilesView->setModelSelectionItems(modelList);
342 }
VehicleProfilesPresenter::modelList
QList< QString > modelList
the list of all models in the current vehicle model catalogue
Definition: VehicleProfilesPresenter.h:267
VehicleProfilesPresenter::currentVehicleProfile
VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
Definition: VehicleProfilesPresenter.h:257
VehicleProfilesPresenter::vehicleProfilesView
VehicleProfilesView *const vehicleProfilesView
the pointer to the view displaying the currently edited profile
Definition: VehicleProfilesPresenter.h:259
VehicleProfilesView::setModelSelectionItems
void setModelSelectionItems(QStringList const &models)
Method which the sets the vehicle models&#39; selection list (combo box) to the one passed as an argument...
Definition: VehicleProfilesView.cpp:148
VehicleProfilesPresenter::project
ProjectInterface *const project
a pointer to the project interface for accessing the config file structure
Definition: VehicleProfilesPresenter.h:261

◆ removeSystem

void VehicleProfilesPresenter::removeSystem | ( | QString const & | type,
 |  | int const & | row
 | ) |  |
privateslot

Slot, triggered by the SystemProfileView::removeSystem signal. Undoably removes the specified row from the systems table (map) of the given algorithm type.

Parameters
[in] | type | the algorithm type specifying the map of systems from which a system is to be removed
[in] | row | the row index of the system to be removed

Definition at line 249 of file VehicleProfilesPresenter.cpp.

250 {
251 SystemProfilePresenter * systemProfilePresenter = systemProfilePresenters.value(currentVehicleProfile->getName())->value(type);
252
253 if(systemProfilePresenter && systemProfilePresenter->rowCount()!=0)
254 undoStack->push(new VehicleProfileCommands::RemoveSystem(systemProfilePresenter, row));
255 }
VehicleProfilesPresenter::systemProfilePresenters
QMap< VehicleProfileItemInterface::Name, QMap< QString, SystemProfilePresenter * > * > systemProfilePresenters
a container for each vehicle profile that stores all table presenter objects for systems of a certain...
Definition: VehicleProfilesPresenter.h:265
SystemProfilePresenter
This class constitutes the re-implementation of QAbstractTableModel for the table view of systems wit...
Definition: SystemProfilePresenter.h:35
VehicleProfileCommands::RemoveSystem
This class defines the command for undoable remove-operations on the map of systems of a specific alg...
Definition: VehicleProfilesPresenter.h:550
VehicleProfilesPresenter::currentVehicleProfile
VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
Definition: VehicleProfilesPresenter.h:257
SystemProfilePresenter::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Reimplementation of the rowCount method. Returns the number of rows in the table which is...
Definition: SystemProfilePresenter.cpp:32
VehicleProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of the vehicle profile.
VehicleProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: VehicleProfilesPresenter.h:262

◆ removeSystemProfile

void VehicleProfilesPresenter::removeSystemProfile ( QString const & type )
privateslot

Slot, triggered by the VehicleProfilesView::removeSystemProfile signal. Undoably removes the map for systems of the given algorithm type, destroys the corresponding table view and deregisters the corresponding presenter object.

Note
The aforementioned map of systems is called system profile in this implementation.
Parameters
[in] type the algorithm type for the map of systems to be removed

Definition at line 214 of file VehicleProfilesPresenter.cpp.

215 {
216 if(currentVehicleProfile && systemList.keys().contains(type))
217 {
218 undoStack->push(new VehicleProfileCommands::RemoveSystemProfile(vehicleProfiles,
219 currentVehicleProfile->getName(),
220 type,
221 systemProfilePresenters[currentVehicleProfile->getName()],
222 this));
223 }
224 }
VehicleProfilesPresenter::systemProfilePresenters
QMap< VehicleProfileItemInterface::Name, QMap< QString, SystemProfilePresenter * > * > systemProfilePresenters
a container for each vehicle profile that stores all table presenter objects for systems of a certain...
Definition: VehicleProfilesPresenter.h:265
VehicleProfilesPresenter::vehicleProfiles
VehicleProfileMapInterface *const vehicleProfiles
the pointer to the map of vehicle profiles
Definition: VehicleProfilesPresenter.h:258
VehicleProfilesPresenter::currentVehicleProfile
VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
Definition: VehicleProfilesPresenter.h:257
VehicleProfileCommands::RemoveSystemProfile
This class defines the command for undoably removing the map for systems of a specific algorithm type...
Definition: VehicleProfilesPresenter.h:496
VehicleProfilesPresenter::systemList
QMap< QString, QList< QString > > systemList
the list of all systems in the current system config sorted by the algorithm type ...
Definition: VehicleProfilesPresenter.h:266
VehicleProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of the vehicle profile.
VehicleProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: VehicleProfilesPresenter.h:262

◆ removeVehicleProfile

void VehicleProfilesPresenter::removeVehicleProfile ( QString const & name )
privateslot

Slot triggered by the VehicleProfilesView::removeVehicleProfile signal. Performs an undoable remove-operation on the vehicle profiles map removing the currently selected profile. If the list of available profiles is not empty, it sets the currently edited profile to the first entry of the list.

Parameters
[in] name the name of the vehicle profile to be removed

Definition at line 89 of file VehicleProfilesPresenter.cpp.

90 {
91 if(currentVehicleProfile && currentVehicleProfile->getName() == name)
92 {
93 QList<VehicleProfileItemInterface::Name> vehicleList = vehicleProfiles->keys();
94 vehicleList.removeAll(name);
95 VehicleProfileItemInterface::Name vehicleName = vehicleList.isEmpty() ? "" : vehicleList.first();
96
97 undoStack->beginMacro(QString("removed vehicle profile %1").arg(name));
98 undoStack->push(new VehicleProfileCommands::SetCurrentVehicle(vehicleProfiles, &currentVehicleProfile, vehicleName, this));
99 undoStack->push(new VehicleProfileCommands::RemoveVehicleProfile(vehicleProfiles, vehicleProfilesView, name, &systemProfilePresenters));
100 undoStack->endMacro();
101 }
102 }
VehicleProfileItemInterface::Name
QString Name
typedef for the name of the vehicle profile
Definition: VehicleProfileItemInterface.h:76
VehicleProfilesPresenter::systemProfilePresenters
QMap< VehicleProfileItemInterface::Name, QMap< QString, SystemProfilePresenter * > * > systemProfilePresenters
a container for each vehicle profile that stores all table presenter objects for systems of a certain...
Definition: VehicleProfilesPresenter.h:265
VehicleProfilesPresenter::vehicleProfiles
VehicleProfileMapInterface *const vehicleProfiles
the pointer to the map of vehicle profiles
Definition: VehicleProfilesPresenter.h:258
VehicleProfileMapInterface::keys
virtual QStringList keys() const =0
Method which returns the (string) list of all vehicle profile names in the map.
VehicleProfilesPresenter::currentVehicleProfile
VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
Definition: VehicleProfilesPresenter.h:257
VehicleProfilesPresenter::vehicleProfilesView
VehicleProfilesView *const vehicleProfilesView
the pointer to the view displaying the currently edited profile
Definition: VehicleProfilesPresenter.h:259
VehicleProfileCommands::SetCurrentVehicle
This class defines the command for undoable set-operations on the currently selected vehicle profile...
Definition: VehicleProfilesPresenter.h:277
VehicleProfileCommands::RemoveVehicleProfile
This class defines the command for undoable remove-operations on the map of vehicle profiles (Vehicle...
Definition: VehicleProfilesPresenter.h:329
VehicleProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of the vehicle profile.
VehicleProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: VehicleProfilesPresenter.h:262

◆ setCurrentVehicleProfile

void VehicleProfilesPresenter::setCurrentVehicleProfile ( QString const & name )
privateslot

Slot triggered by the VehicleProfilesView::selectedVehicleProfile signal. Performs an undoable set-operation on the currently edited vehicle profile setting it to the transmitted profile. Updates the view accordingly.

Parameters
[in] name the vehicle profile which should be currently edited

Definition at line 74 of file VehicleProfilesPresenter.cpp.

75 {
76 if(currentVehicleProfile && currentVehicleProfile->getName() != name)
77 undoStack->push(new VehicleProfileCommands::SetCurrentVehicle(vehicleProfiles, &currentVehicleProfile, name, this));
78 }
VehicleProfilesPresenter::vehicleProfiles
VehicleProfileMapInterface *const vehicleProfiles
the pointer to the map of vehicle profiles
Definition: VehicleProfilesPresenter.h:258
VehicleProfilesPresenter::currentVehicleProfile
VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
Definition: VehicleProfilesPresenter.h:257
VehicleProfileCommands::SetCurrentVehicle
This class defines the command for undoable set-operations on the currently selected vehicle profile...
Definition: VehicleProfilesPresenter.h:277
VehicleProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of the vehicle profile.
VehicleProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: VehicleProfilesPresenter.h:262

◆ setModel

void VehicleProfilesPresenter::setModel ( QString const & modelName )
privateslot

Slot triggered by the VehicleProfilesView::modifiedModel signal. Performs an undoable assignment of the given vehicle model to the currently edited vehicle profile.

Parameters
[in] model the vehicle model to be assigned

Definition at line 344 of file VehicleProfilesPresenter.cpp.

345 {
346 if(currentVehicleProfile)
347 undoStack->push(new VehicleProfileCommands::SetModel(vehicleProfiles, vehicleProfilesView, currentVehicleProfile->getName(), modelName));
348 }
VehicleProfilesPresenter::vehicleProfiles
VehicleProfileMapInterface *const vehicleProfiles
the pointer to the map of vehicle profiles
Definition: VehicleProfilesPresenter.h:258
VehicleProfilesPresenter::currentVehicleProfile
VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
Definition: VehicleProfilesPresenter.h:257
VehicleProfilesPresenter::vehicleProfilesView
VehicleProfilesView *const vehicleProfilesView
the pointer to the view displaying the currently edited profile
Definition: VehicleProfilesPresenter.h:259
VehicleProfileItemInterface::getName
virtual Name getName() const =0
Method which returns the name of the vehicle profile.
VehicleProfileCommands::SetModel
This class defines the command for undoable set-operations on the vehicle model of the currently edit...
Definition: VehicleProfilesPresenter.h:410
VehicleProfilesPresenter::undoStack
QUndoStack *const undoStack
a pointer to the undo stack
Definition: VehicleProfilesPresenter.h:262

◆ systemsConsistent()

bool VehicleProfilesPresenter::systemsConsistent ( )
private

Method which checks whether all assigned systems are consistent with the currently selected system config file.

Returns
true, if systems are consistent with system config, false, otherwise

Definition at line 414 of file VehicleProfilesPresenter.cpp.

415 {
416 for(auto type : currentVehicleProfile->getSystemProfiles()->keys())
417 {
418 if(!systemList.contains(type))
419 return false;
420
421 for(auto system : currentVehicleProfile->getSystems(type)->keys())
422 {
423 QString listItem = QString("%1 (ID=%2)").arg(system.second).arg(system.first);
424 if( !systemList.value(type).contains(listItem) )
425 return false;
426 }
427 }
428
429 return true;
430 }
VehicleProfilesPresenter::currentVehicleProfile
VehicleProfileItemInterface * currentVehicleProfile
a pointer to the vehicle profile to be currently edited
Definition: VehicleProfilesPresenter.h:257
VehicleProfileItemInterface::getSystemProfiles
virtual SystemProfiles * getSystemProfiles() const =0
Method which returns all mappings of systems to probabilities sorted by their algorithm type...
VehicleProfileItemInterface::getSystems
virtual Systems * getSystems(AlgoType const &_type) const =0
Method which returns the mapping of all systems of the given algorithm type to their equipment probab...
VehicleProfilesPresenter::systemList
QMap< QString, QList< QString > > systemList
the list of all systems in the current system config sorted by the algorithm type ...
Definition: VehicleProfilesPresenter.h:266
The documentation for this class was generated from the following files:
  • VehicleProfilesPresenter.h
  • VehicleProfilesPresenter.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleProfilesPresenter Member List

This is the complete list of members for VehicleProfilesPresenter, including all inherited members.

addSystem(QString const &type, QString const &selectionItem) | VehicleProfilesPresenter | privateslot
addSystemProfile(QString const &type) | VehicleProfilesPresenter | privateslot
addVehicleProfile(QString const &name) | VehicleProfilesPresenter | privateslot
currentVehicleProfile | VehicleProfilesPresenter | private
default_probability | VehicleProfilesPresenter | privatestatic
editVehicleProfileName(QString const &oldName, QString const &newName) | VehicleProfilesPresenter | privateslot
loadModelCatalogue(QString const &filepath) | VehicleProfilesPresenter | slot
modelList | VehicleProfilesPresenter | private
project | VehicleProfilesPresenter | private
refreshModelCatalogue() | VehicleProfilesPresenter | slot
refreshSystemConfig() | VehicleProfilesPresenter | slot
removeSystem(QString const &type, int const &row) | VehicleProfilesPresenter | privateslot
removeSystemProfile(QString const &type) | VehicleProfilesPresenter | privateslot
removeVehicleProfile(QString const &name) | VehicleProfilesPresenter | privateslot
setCurrentVehicleProfile(QString const &name) | VehicleProfilesPresenter | privateslot
setModel(QString const &modelName) | VehicleProfilesPresenter | privateslot
setModelCatalogue() | VehicleProfilesPresenter | privateslot
setSystemConfig() | VehicleProfilesPresenter | privateslot
systemInterface | VehicleProfilesPresenter | private
systemList | VehicleProfilesPresenter | private
systemProfilePresenters | VehicleProfilesPresenter | private
systemsConsistent() | VehicleProfilesPresenter | private
undoStack | VehicleProfilesPresenter | private
updateSystemList() | VehicleProfilesPresenter | private
updateSystemsView() | VehicleProfilesPresenter | private
updateVehicleSelectionItems() | VehicleProfilesPresenter |
updateView() | VehicleProfilesPresenter |
vehicleProfiles | VehicleProfilesPresenter | private
vehicleProfilesView | VehicleProfilesPresenter | private
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: VehicleProfilesView Class Reference

Signals | Public Member Functions | Private Slots | Private Attributes | List of all members
VehicleProfilesView Class Reference

This class defines the view for editing vehicle profiles. The view constitutes a combo box for selecting and buttons for adding, removing and renaming vehicle profiles. Further, GUI elements for vehicle model catalogue and vehicle model as well as for the system config are provided. Systems defined in a system config are sorted by the algorithm type used therein. For the corresponding selection of an algorithm type, a combo box including add- and remove- buttons is set up. The dynamic instantiation of the table views for systems of a certain algorithm type (SystemProfileView) is performed in the presenter object (VehicleProfilesPresenter). This object calls public methods of this class in order to instantiate the table views and and lay them out in this widget. More...

Inheritance diagram for VehicleProfilesView:
WidgetView

Signals

void | addSystemProfile (QString const &type)
Signal, emitted after the add-button of an algorithm type has been clicked. Transmits the algorithm type of the current selection in the combo box. This signal will be handled by the presenter object (VehicleProfilesPresenter) which creates the table view for assigning systems of the given algo type to this profile (instance of SystemProfileView). More...
void | addVehicleProfile (QString const &name)
Signal, emitted after the add-button for vehicle profiles has been clicked and a name for a new profile has been typed in. Transmits the name of the new vehicle profile. More...
void | changeModelCatalogue ()
Signal, emitted after the browse-button of the vehicle model catalogue has been pressed.
void | changeSystemConfig ()
Signal, emitted after the browse-button of the system config file has been pressed.
void | modifiedModel (QString const &ModelName)
Signal, emitted after the current entry in the vehicle models' combo box has been changed by the user. Transmits the new selection. More...
void | modifiedName (QString const &oldName, QString const &newName)
Signal, emitted after the rename-button has been pressed and a new name for the current profile has been typed into the dialog box. Transmits the new and old name. More...
void | refreshModelCatalogue ()
Signal, emitted after the refresh-button of the vehicle model catalogue has been pressed.
void | refreshSystemConfig ()
Signal, emitted after the refresh-button of the system config file has been pressed.
void | removeSystemProfile (QString const &type)
Signal, emitted after the remove-button of an algorithm type has been clicked. Transmits the algorithm type of the current selection in the combo box. This signal will be handled by the presenter object (VehicleProfilesPresenter) which instantiates the table view for assigning systems of the given algo type to this profile (instance of SystemProfileView). More...
void | removeVehicleProfile (QString const &name)
Signal, emitted after the remove-button for vehicle profiles has been clicked. Transmits the name of the vehicle profile currently selected in the combo box, which is the one to be removed. More...
void | selectedVehicleProfile (QString const &name)
Signal, emitted after the current entry of the combo box for available vehicle profiles has been changed by the user. Transmit the newly selected vehicle profile. More...

Public Member Functions

SystemProfileView * | addSystemProfileView (QString const &type)
Method which creates an instance of SystemProfileView, i.e. a table for assigning systems of the given algorithm type to probabilities. The created view is added to the bottom of the layout of this view and a pointer to it is returned. More...
void | addVehicleProfileSelectionItem (QString const &name)
Method which adds the given vehicle profile name to the selection list in the combo box for vehicle profiles. Further enables the whole view. More...
void | clearSystemProfileViews ()
Method which deletes all instances of SystemProfileView, i.e. the table for assigning systems to probabilities.
void | enableConfiguration (bool enable)
Method which enables or disables the GUI elements of this view, apart from the add-button for adding vehicle profiles. Disabling usually happens when there is no vehicle profile configured. More...
void | enableModelView (bool enable)
Method which enables or disables the combo box for vehicle models. Disabling the menu usually happens when there is no vehicle model catalogue loaded. More...
void | removeSystemProfileView (QString const &type)
Method which deletes the instance of SystemProfileView, i.e. the table for assigning systems of the given (algorithm) type to probabilities. More...
void | removeVehicleProfileSelectionItem (QString const &name)
Method which removes the given vehicle profile name from the selection list in the combo box for vehicle profiles. More...
void | setCurrentVehicle (QString const &name)
Method which sets the vehicle profile name to be currently shown in the combo box for vehicle profiles. More...
void | setModel (QString const &model)
Method which the sets the vehicle model currently displayed by the vehicle models' combo box to the one passed as an argument. More...
void | setModelCatalogue (QString const &filepath)
Method which sets the currently displayed vehicle model catalogue to the one passed as an argument. More...
void | setModelCatalogueError (QString const &message)
Method which displays the given error message (red color) next to the GUI element for editing the vehicle model catalogue. More...
void | setModelSelectionItems (QStringList const &models)
Method which the sets the vehicle models' selection list (combo box) to the one passed as an argument. More...
void | setSystemConfig (QString const &systemConfig)
Method which sets the currently displayed system config file to the one passed as an argument. More...
void | setSystemConfigError (QString const &message)
Method which displays the given error message (red color) next to the GUI element for the system config file. More...
void | setSystemProfileSelection (QList< QString > profiles)
Method which the sets the selection list of algorithm types (referred to as system profiles in the code) in the corresponding combo box to the one passed as an argument. More...
void | setSystemProfilesError (QString const &message)
Method which displays the given error message (red color) above the tables in which systems of a certain algorithm type are assigned to probalities. More...
void | setVehicleProfileSelectionItems (QStringList const &names)
Method which clears the selection list for vehicle profiles (combo box) and inserts the given list. More...
- Public Member Functions inherited from WidgetView
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Private Slots

void | on_add_clicked ()
Slot triggered when the user clicks the add-button for vehicle profiles and has typed in a valid name. Emits the addVehicleProfile signal transmitting the new name.
void | on_addSystemProfile_clicked ()
Slot triggered when the user clicks the add-button next to the algorithm type combo box. Emits the addSystemProfile signal transmitting the current algorithm type displayed by the combo box.
void | on_edit_clicked ()
Slot triggered when the user clicks the rename-button for vehicle profiles. Opens a dialog box asking the user to type in a valid name. Emits the modifiedName signal transmitting the new and old names of the coresponding vehicle profile.
void | on_Model_activated (const QString &model)
Slot triggered when the user changes the current entry of the vehicle model's combo box. Emits the modifiedModel signal transmitting the newly selected vehicle model's name. More...
void | on_modelCatalogue_Browse_clicked ()
Slot triggered when the user clicks the browse-button for the vehicle model catalogue. Emits the changeModelCatalogue signal.
void | on_modelCatalogue_Refresh_clicked ()
Slot triggered when the user clicks the refresh-button for the vehicle model catalogue. Emits the refreshModelCatalogue signal.
void | on_Name_activated (const QString &name)
Slot triggered when the user changes the vehicle profile displayed by the corresponding combo box. Emits the selectedVehicleProfile signal with the name of the newly selected profile. More...
void | on_remove_clicked ()
Slot triggered when the user clicks the remove-button for vehicle profiles. Emits the removeVehicleProfile signal transmitting the name of the vehicle profile that is currently displayed by the corresponding combo box (the profile to be removed).
void | on_removeSystemProfile_clicked ()
Slot triggered when the user clicks the remove-button next to the algorithm type combo box. Emits the removeSystemProfile signal transmitting the current algorithm type displayed by the combo box.
void | on_systemConfigBrowse_clicked ()
Slot triggered when the user clicks the browse-button for the system config file. Emits the changeSystemConfig signal.
void | on_systemConfigRefresh_clicked ()
Slot triggered when the user clicks the refresh-button for the system config file. Emits the refreshSystemConfig signal.

Private Attributes

Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view

Additional Inherited Members

- Protected Member Functions inherited from WidgetView
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.

Detailed Description

This class defines the view for editing vehicle profiles. The view constitutes a combo box for selecting and buttons for adding, removing and renaming vehicle profiles. Further, GUI elements for vehicle model catalogue and vehicle model as well as for the system config are provided. Systems defined in a system config are sorted by the algorithm type used therein. For the corresponding selection of an algorithm type, a combo box including add- and remove- buttons is set up. The dynamic instantiation of the table views for systems of a certain algorithm type (SystemProfileView) is performed in the presenter object (VehicleProfilesPresenter). This object calls public methods of this class in order to instantiate the table views and and lay them out in this widget.

Definition at line 56 of file VehicleProfilesView.h.

Member Function Documentation

◆ addSystemProfile

void VehicleProfilesView::addSystemProfile ( QString const & type )
signal

Signal, emitted after the add-button of an algorithm type has been clicked. Transmits the algorithm type of the current selection in the combo box. This signal will be handled by the presenter object (VehicleProfilesPresenter) which creates the table view for assigning systems of the given algo type to this profile (instance of SystemProfileView).

Parameters
[in] type the algorithm type of

◆ addSystemProfileView()

SystemProfileView * VehicleProfilesView::addSystemProfileView ( QString const & type )

Method which creates an instance of SystemProfileView, i.e. a table for assigning systems of the given algorithm type to probabilities. The created view is added to the bottom of the layout of this view and a pointer to it is returned.

Parameters
[in] type the (algorithm) type of the system table view to be created
Returns
a pointer to the newly created view (instance of SystemProfileView)

Definition at line 190 of file VehicleProfilesView.cpp.

191 {
192 int rows = ui->vehicleProfilesLayout->rowCount();
193 int columns = ui->vehicleProfilesLayout->columnCount();
194 SystemProfileView * systemProfileView = new SystemProfileView(type, this);
195
196 ui->vehicleProfilesLayout->addWidget(systemProfileView, rows, 0, 1, columns );
197
198 return systemProfileView;
199 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399
SystemProfileView
This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm ...
Definition: SystemProfileView.h:40

◆ addVehicleProfile

void VehicleProfilesView::addVehicleProfile ( QString const & name )
signal

Signal, emitted after the add-button for vehicle profiles has been clicked and a name for a new profile has been typed in. Transmits the name of the new vehicle profile.

Parameters
[in] name the name of the new vehicle profile

◆ addVehicleProfileSelectionItem()

void VehicleProfilesView::addVehicleProfileSelectionItem ( QString const & name )

Method which adds the given vehicle profile name to the selection list in the combo box for vehicle profiles. Further enables the whole view.

Parameters
[in] name the vehicle profile's name to be added to the selection list

Definition at line 99 of file VehicleProfilesView.cpp.

100 {
101 ui->Name->addItem(name);
102
103 enableConfiguration(true);
104 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399
VehicleProfilesView::enableConfiguration
void enableConfiguration(bool enable)
Method which enables or disables the GUI elements of this view, apart from the add-button for adding ...
Definition: VehicleProfilesView.cpp:159

◆ enableConfiguration()

void VehicleProfilesView::enableConfiguration ( bool enable )

Method which enables or disables the GUI elements of this view, apart from the add-button for adding vehicle profiles. Disabling usually happens when there is no vehicle profile configured.

Parameters
[in] enable the flag for enabling (true) or disabling (false) the GUI elements

Definition at line 159 of file VehicleProfilesView.cpp.

160 {
161 ui->remove->setEnabled(enable);
162 ui->edit->setEnabled(enable);
163 ui->systemConfigBrowse->setEnabled(enable);
164 ui->systemConfigRefresh->setEnabled(enable);
165 ui->systemConfig->setEnabled(enable);
166 ui->modelCatalogue->setEnabled(enable);
167 ui->modelCatalogue_Browse->setEnabled(enable);
168 ui->modelCatalogue_Refresh->setEnabled(enable);
169 ui->Model->setEnabled(enable);
170 ui->SystemProfiles->setEnabled(enable);
171 ui->addSystemProfile->setEnabled(enable);
172 ui->removeSystemProfile->setEnabled(enable);
173 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399

◆ enableModelView()

void VehicleProfilesView::enableModelView ( bool enable )

Method which enables or disables the combo box for vehicle models. Disabling the menu usually happens when there is no vehicle model catalogue loaded.

Parameters
[in] enable the flag for enabling (true) or disabling (false) the vehicle models' menu

Definition at line 154 of file VehicleProfilesView.cpp.

155 {
156 ui->Model->setEnabled(enable);
157 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399

◆ modifiedModel

void VehicleProfilesView::modifiedModel ( QString const & ModelName )
signal

Signal, emitted after the current entry in the vehicle models' combo box has been changed by the user. Transmits the new selection.

Parameters
[in] model the current vehicle model selection

◆ modifiedName

void VehicleProfilesView::modifiedName | ( | QString const & | oldName,
 |  | QString const & | newName
 | ) |  |
signal

Signal, emitted after the rename-button has been pressed and a new name for the current profile has been typed into the dialog box. Transmits the new and old name.

Parameters
[in] | oldName | the old name of the renamed vehicle profile
[in] | newName | the new name of the vehicle profile

◆ on_Model_activated

void VehicleProfilesView::on_Model_activated ( const QString & model )
privateslot

Slot triggered when the user changes the current entry of the vehicle model's combo box. Emits the modifiedModel signal transmitting the newly selected vehicle model's name.

Parameters
[in] model the newly selected vehicle model

Definition at line 143 of file VehicleProfilesView.cpp.

144 {
145 Q_EMIT modifiedModel(model);
146 }
VehicleProfilesView::modifiedModel
void modifiedModel(QString const &ModelName)
Signal, emitted after the current entry in the vehicle models&#39; combo box has been changed by the user...

◆ on_Name_activated

void VehicleProfilesView::on_Name_activated ( const QString & name )
privateslot

Slot triggered when the user changes the vehicle profile displayed by the corresponding combo box. Emits the selectedVehicleProfile signal with the name of the newly selected profile.

Parameters
[in] name the name of the selected vehicle profile

Definition at line 128 of file VehicleProfilesView.cpp.

129 {
130 Q_EMIT selectedVehicleProfile(name);
131 }
VehicleProfilesView::selectedVehicleProfile
void selectedVehicleProfile(QString const &name)
Signal, emitted after the current entry of the combo box for available vehicle profiles has been chan...

◆ removeSystemProfile

void VehicleProfilesView::removeSystemProfile ( QString const & type )
signal

Signal, emitted after the remove-button of an algorithm type has been clicked. Transmits the algorithm type of the current selection in the combo box. This signal will be handled by the presenter object (VehicleProfilesPresenter) which instantiates the table view for assigning systems of the given algo type to this profile (instance of SystemProfileView).

Parameters
[in] type the algorithm type of

◆ removeSystemProfileView()

void VehicleProfilesView::removeSystemProfileView ( QString const & type )

Method which deletes the instance of SystemProfileView, i.e. the table for assigning systems of the given (algorithm) type to probabilities.

Parameters
[in] type the (algorithm) type of the system table view to be deleted

Definition at line 201 of file VehicleProfilesView.cpp.

202 {
203 SystemProfileView * systemProfileView = findChild<SystemProfileView*>(type);
204
205 if(!type.isEmpty() && systemProfileView)
206 {
207 ui->vehicleProfilesLayout->removeWidget(systemProfileView);
208 delete systemProfileView;
209 }
210 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399
SystemProfileView
This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm ...
Definition: SystemProfileView.h:40

◆ removeVehicleProfile

void VehicleProfilesView::removeVehicleProfile ( QString const & name )
signal

Signal, emitted after the remove-button for vehicle profiles has been clicked. Transmits the name of the vehicle profile currently selected in the combo box, which is the one to be removed.

Parameters
[in] name the name of the vehicle profile to be removed

◆ removeVehicleProfileSelectionItem()

void VehicleProfilesView::removeVehicleProfileSelectionItem ( QString const & name )

Method which removes the given vehicle profile name from the selection list in the combo box for vehicle profiles.

Parameters
[in] name the vehicle profile's name to be removed from the selection list

Definition at line 106 of file VehicleProfilesView.cpp.

107 {
108 int index = ui->Name->findText(name);
109 ui->Name->removeItem(index);
110 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399

◆ selectedVehicleProfile

void VehicleProfilesView::selectedVehicleProfile ( QString const & name )
signal

Signal, emitted after the current entry of the combo box for available vehicle profiles has been changed by the user. Transmit the newly selected vehicle profile.

Parameters
[in] name the name of the selected vehicle profile

◆ setCurrentVehicle()

void VehicleProfilesView::setCurrentVehicle ( QString const & name )

Method which sets the vehicle profile name to be currently shown in the combo box for vehicle profiles.

Parameters
[in] name the vehicle profile to be currently shown in the corresponding combo box

Definition at line 93 of file VehicleProfilesView.cpp.

94 {
95 if(ui->Name->findText(name) != -1)
96 ui->Name->setCurrentText(name);
97 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399

◆ setModel()

void VehicleProfilesView::setModel ( QString const & model )

Method which the sets the vehicle model currently displayed by the vehicle models' combo box to the one passed as an argument.

Parameters
[in] system the list of systems

Definition at line 180 of file VehicleProfilesView.cpp.

181 {
182 ui->Model->setCurrentText(model);
183 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399

◆ setModelCatalogue()

void VehicleProfilesView::setModelCatalogue ( QString const & filepath )

Method which sets the currently displayed vehicle model catalogue to the one passed as an argument.

Parameters
[in] filepath the vehicle model catalogue's file path to be displayed

Definition at line 185 of file VehicleProfilesView.cpp.

186 {
187 ui->modelCatalogue->setText(filepath);
188 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399

◆ setModelCatalogueError()

void VehicleProfilesView::setModelCatalogueError ( QString const & message )

Method which displays the given error message (red color) next to the GUI element for editing the vehicle model catalogue.

Parameters
[in] message the error message to be displayed

Definition at line 232 of file VehicleProfilesView.cpp.

233 {
234 ui->modelCatalogueError->setText(message);
235 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399

◆ setModelSelectionItems()

void VehicleProfilesView::setModelSelectionItems ( QStringList const & models )

Method which the sets the vehicle models' selection list (combo box) to the one passed as an argument.

Parameters
[in] models the list of vehicle models to be offered by the menu

Definition at line 148 of file VehicleProfilesView.cpp.

149 {
150 ui->Model->clear();
151 ui->Model->addItems(models);
152 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399

◆ setSystemConfig()

void VehicleProfilesView::setSystemConfig ( QString const & systemConfig )

Method which sets the currently displayed system config file to the one passed as an argument.

Parameters
[in] systemConfig the system config's file path to be displayed

Definition at line 175 of file VehicleProfilesView.cpp.

176 {
177 ui->systemConfig->setText(systemConfig);
178 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399

◆ setSystemConfigError()

void VehicleProfilesView::setSystemConfigError ( QString const & message )

Method which displays the given error message (red color) next to the GUI element for the system config file.

Parameters
[in] message the error message to be displayed

Definition at line 227 of file VehicleProfilesView.cpp.

228 {
229 ui->systemConfigError->setText(message);
230 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399

◆ setSystemProfileSelection()

void VehicleProfilesView::setSystemProfileSelection ( QList< QString > profiles )

Method which the sets the selection list of algorithm types (referred to as system profiles in the code) in the corresponding combo box to the one passed as an argument.

Parameters
[in] profiles the list of algorithm types

Definition at line 212 of file VehicleProfilesView.cpp.

213 {
214 ui->SystemProfiles->clear();
215 ui->SystemProfiles->addItems(profiles);
216 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399

◆ setSystemProfilesError()

void VehicleProfilesView::setSystemProfilesError ( QString const & message )

Method which displays the given error message (red color) above the tables in which systems of a certain algorithm type are assigned to probalities.

Parameters
[in] message the error message to be displayed

Definition at line 237 of file VehicleProfilesView.cpp.

238 {
239 ui->systemProfilesError->setText(message);
240 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399

◆ setVehicleProfileSelectionItems()

void VehicleProfilesView::setVehicleProfileSelectionItems ( QStringList const & names )

Method which clears the selection list for vehicle profiles (combo box) and inserts the given list.

Parameters
[in] names the list of vehicle profile names to be listed in the corresponding combo box

Definition at line 112 of file VehicleProfilesView.cpp.

113 {
114 ui->Name->clear();
115 ui->Name->addItems(names);
116 }
VehicleProfilesView::ui
Ui::VehicleProfilesView * ui
the ui object defining the GUI elements of this view
Definition: VehicleProfilesView.h:399
The documentation for this class was generated from the following files:
  • VehicleProfilesView.h
  • VehicleProfilesView.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

VehicleProfilesView Member List

This is the complete list of members for VehicleProfilesView, including all inherited members.

addSystemProfile(QString const &type) | VehicleProfilesView | signal
addSystemProfileView(QString const &type) | VehicleProfilesView |
addVehicleProfile(QString const &name) | VehicleProfilesView | signal
addVehicleProfileSelectionItem(QString const &name) | VehicleProfilesView |
changeModelCatalogue() | VehicleProfilesView | signal
changeSystemConfig() | VehicleProfilesView | signal
clearSystemProfileViews() | VehicleProfilesView |
enableConfiguration(bool enable) | VehicleProfilesView |
enableModelView(bool enable) | VehicleProfilesView |
modifiedModel(QString const &ModelName) | VehicleProfilesView | signal
modifiedName(QString const &oldName, QString const &newName) | VehicleProfilesView | signal
on_add_clicked() | VehicleProfilesView | privateslot
on_addSystemProfile_clicked() | VehicleProfilesView | privateslot
on_edit_clicked() | VehicleProfilesView | privateslot
on_Model_activated(const QString &model) | VehicleProfilesView | privateslot
on_modelCatalogue_Browse_clicked() | VehicleProfilesView | privateslot
on_modelCatalogue_Refresh_clicked() | VehicleProfilesView | privateslot
on_Name_activated(const QString &name) | VehicleProfilesView | privateslot
on_remove_clicked() | VehicleProfilesView | privateslot
on_removeSystemProfile_clicked() | VehicleProfilesView | privateslot
on_systemConfigBrowse_clicked() | VehicleProfilesView | privateslot
on_systemConfigRefresh_clicked() | VehicleProfilesView | privateslot
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
refreshModelCatalogue() | VehicleProfilesView | signal
refreshSystemConfig() | VehicleProfilesView | signal
removeSystemProfile(QString const &type) | VehicleProfilesView | signal
removeSystemProfileView(QString const &type) | VehicleProfilesView |
removeVehicleProfile(QString const &name) | VehicleProfilesView | signal
removeVehicleProfileSelectionItem(QString const &name) | VehicleProfilesView |
selectedVehicleProfile(QString const &name) | VehicleProfilesView | signal
setCurrentVehicle(QString const &name) | VehicleProfilesView |
setModel(QString const &model) | VehicleProfilesView |
setModelCatalogue(QString const &filepath) | VehicleProfilesView |
setModelCatalogueError(QString const &message) | VehicleProfilesView |
setModelSelectionItems(QStringList const &models) | VehicleProfilesView |
setSystemConfig(QString const &systemConfig) | VehicleProfilesView |
setSystemConfigError(QString const &message) | VehicleProfilesView |
setSystemProfileSelection(QList< QString > profiles) | VehicleProfilesView |
setSystemProfilesError(QString const &message) | VehicleProfilesView |
setVehicleProfileSelectionItems(QStringList const &names) | VehicleProfilesView |
ui | VehicleProfilesView | private
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: WidgetView Class Reference

Public Member Functions | Protected Member Functions | List of all members
WidgetView Class Reference

A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable proper processing of style sheets. More...

Inheritance diagram for WidgetView:
AgentMapView DriverProfilesView EnvironmentDisplayView ExperimentBaseView ExperimentView ScenarioBaseView ScenarioDisplayView TrafficBaseView TrafficDisplayView TrafficItemView TrafficLanesView TrafficParametersView VehicleProfilesView

Public Member Functions

WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
WidgetView (QWidget *const parent=nullptr)
Constructor which sets a parent widget if passed as an argument. More...
virtual | ~WidgetView ()=default
Default destructor.
virtual | ~WidgetView ()=default
Default destructor.

Protected Member Functions

virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.
virtual void | paintEvent (QPaintEvent *event) override
Reimplementation of the paint event for proper processing of style sheets.

Detailed Description

A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable proper processing of style sheets.

Definition at line 29 of file OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h.

Constructor & Destructor Documentation

◆ WidgetView() [1/2]

WidgetView::WidgetView ( QWidget *const parent = nullptr )
explicit

Constructor which sets a parent widget if passed as an argument.

Parameters
[in] parent A parent widget

Definition at line 17 of file OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp.

18 : QWidget(parent)
19 {
20 }

◆ WidgetView() [2/2]

WidgetView::WidgetView ( QWidget *const parent = nullptr )
explicit

Constructor which sets a parent widget if passed as an argument.

Parameters
[in] parent A parent widget
The documentation for this class was generated from the following files:
  • OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h
  • OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

WidgetView Member List

This is the complete list of members for WidgetView, including all inherited members.

paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
paintEvent(QPaintEvent *event) override | WidgetView | protectedvirtual
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
WidgetView(QWidget *const parent=nullptr) | WidgetView | explicit
~WidgetView()=default | WidgetView | virtual
~WidgetView()=default | WidgetView | virtual
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: WindowInterface Class Reference

Public Types | Public Member Functions | Static Public Member Functions | List of all members
WindowInterface Class Referenceabstract

This class manages the registration and deregistration of Window Views which include the menu bar with its buttons and menu buttons. More...

Inherits QObject, and ServiceInterface< Interface, ID >.

Public Types

using | Action = QPushButton
The button in the menu of the stacked widget.
using | ActionMenu = QMenu
The drop down menu of the button in the stacked widget's menu.
using | ActionTitle = QString
The title of the button in the stacked widget's menu.
using | Button = QPushButton
The button in the side bar displaying the corresponding widget.
using | ButtonOrder = unsigned short
The order of the widget related button in the side bar.
using | ButtonTitle = QString
The title of the widget related button.
using | ButtonType = unsigned short
The type of the widget related button.
using | ID = QString
The identifier of the stacked widget.
using | Widget = QWidget
The stacked widget.

Public Member Functions

virtual void | add (WindowInterface::ID const &id, WindowInterface::Button *const button, WindowInterface::Widget *const widget=nullptr, WindowInterface::Menu const &menu={})=0
Registers the Window View with the identifier id, including its selecting button, and its corresponding widget and menu bar. More...
virtual bool | exists (WindowInterface::ID const &id) const =0
Verifies if the Window View with the identifier id is already registred. More...
virtual bool | remove (WindowInterface::ID const &id)=0
Deregisters a Window View with the identifier id. More...

Static Public Member Functions

template<typename Object , typename Function >
static WindowInterface::Action * | createAction (WindowInterface::ActionTitle const &title, Object object, Function function)
Creates button in the menu bar of the Window View object with the title title and associated to a callback function function. More...
static WindowInterface::Action * | createAction (WindowInterface::ActionTitle const &title, WindowInterface::ActionMenu *const menu)
Creates a menu button in the menu bar with the title title and associated to the menu widget menu. More...
static WindowInterface::Button * | createButton (WindowInterface::ButtonTitle const &title, WindowInterface::ButtonType const &type=0, WindowInterface::ButtonOrder const &order=-1)
Creates button for a Window View selection with the title title, of type type and located on the side bar of openPASS main window at position order. More...
static WindowInterface::Action * | createSeparator ()
Creates a separator in the menu bar of a Window View.

Detailed Description

This class manages the registration and deregistration of Window Views which include the menu bar with its buttons and menu buttons.

Definition at line 44 of file WindowInterface.h.

Member Function Documentation

◆ add()

virtual void WindowInterface::add | ( | WindowInterface::ID const & | id,
 |  | WindowInterface::Button *const | button,
 |  | WindowInterface::Widget *const | widget = nullptr,
 |  | WindowInterface::Menu const & | menu = {}
 | ) |  |
pure virtual

Registers the Window View with the identifier id, including its selecting button, and its corresponding widget and menu bar.

Parameters
[in] | id | The identifier for a Window View.
[in] | button | The button for selecting the Window View.
[in] | widget | The widget corresponding to the Window View.
[in] | menu | The menu correponding to the Window View.

◆ createAction() [1/2]

template<typename Object , typename Function >
static WindowInterface::Action* WindowInterface::createAction | ( | WindowInterface::ActionTitle const & | title,
 |  | Object | object,
 |  | Function | function
 | ) |  |
inlinestatic

Creates button in the menu bar of the Window View object with the title title and associated to a callback function function.

Parameters
[in] | title | The title for the new button.
[in] | object | The Window View where to create the button.
[in] | function | The callback function of the new button.
Returns
The new button of the menu bar of the Window View.

Definition at line 130 of file WindowInterface.h.

133 {
134 WindowInterface::Action * const action = new WindowInterface::Action(title);
135 QObject::connect(action, &WindowInterface::Action::clicked, object, function);
136 return action;
137 }
WindowInterface::Action
QPushButton Action
The button in the menu of the stacked widget.
Definition: WindowInterface.h:56

◆ createAction() [2/2]

static WindowInterface::Action* WindowInterface::createAction | ( | WindowInterface::ActionTitle const & | title,
 |  | WindowInterface::ActionMenu *const | menu
 | ) |  |
inlinestatic

Creates a menu button in the menu bar with the title title and associated to the menu widget menu.

Parameters
[in] | title | The title for the new button.
[in] | menu | The menu widget associated to the new button.
Returns
The new menu button for the menu bar.

Definition at line 147 of file WindowInterface.h.

149 {
150 WindowInterface::Action * const action = new WindowInterface::Action(title);
151 action->setMenu(menu);
152 return action;
153 }
WindowInterface::Action
QPushButton Action
The button in the menu of the stacked widget.
Definition: WindowInterface.h:56

◆ createButton()

static WindowInterface::Button* WindowInterface::createButton | ( | WindowInterface::ButtonTitle const & | title,
 |  | WindowInterface::ButtonType const & | type = 0,
 |  | WindowInterface::ButtonOrder const & | order = -1
 | ) |  |
inlinestatic

Creates button for a Window View selection with the title title, of type type and located on the side bar of openPASS main window at position order.

Parameters
[in] | title | The title for the new button.
[in] | type | The type for the new button.
[in] | order | The order of the new button in the tool side bar.
Returns
The new button related to a Window View.

Definition at line 109 of file WindowInterface.h.

112 {
113 WindowInterface::Button * const button = new WindowInterface::Button(title);
114 button->setProperty("type", type);
115 button->setProperty("order", order);
116 return button;
117 }
WindowInterface::Button
QPushButton Button
The button in the side bar displaying the corresponding widget.
Definition: WindowInterface.h:51

◆ exists()

virtual bool WindowInterface::exists ( WindowInterface::ID const & id ) const
pure virtual

Verifies if the Window View with the identifier id is already registred.

Parameters
[in] id The identifier for a Window View.
Returns
True if the Window View is already registred.

◆ remove()

virtual bool WindowInterface::remove ( WindowInterface::ID const & id )
pure virtual

Deregisters a Window View with the identifier id.

Parameters
[in] id The identifier for a Window View.
Returns
True if the Window View were deregistred successfully.
The documentation for this class was generated from the following file:
  • WindowInterface.h
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

WindowInterface Member List

This is the complete list of members for WindowInterface, including all inherited members.

Action typedef | WindowInterface |
ActionMenu typedef | WindowInterface |
ActionTitle typedef | WindowInterface |
add(WindowInterface::ID const &id, WindowInterface::Button *const button, WindowInterface::Widget *const widget=nullptr, WindowInterface::Menu const &menu={})=0 | WindowInterface | pure virtual
Button typedef | WindowInterface |
ButtonOrder typedef | WindowInterface |
ButtonTitle typedef | WindowInterface |
ButtonType typedef | WindowInterface |
createAction(WindowInterface::ActionTitle const &title, Object object, Function function) | WindowInterface | inlinestatic
createAction(WindowInterface::ActionTitle const &title, WindowInterface::ActionMenu *const menu) | WindowInterface | inlinestatic
createButton(WindowInterface::ButtonTitle const &title, WindowInterface::ButtonType const &type=0, WindowInterface::ButtonOrder const &order=-1) | WindowInterface | inlinestatic
createSeparator() | WindowInterface | inlinestatic
exists(WindowInterface::ID const &id) const =0 | WindowInterface | pure virtual
ID typedef | WindowInterface |
remove(WindowInterface::ID const &id)=0 | WindowInterface | pure virtual
Widget typedef | WindowInterface |
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Models Directory Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Models
Models Directory Reference
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Views Directory Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Views
Views Directory Reference
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Views Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Views
Views Directory Reference

Files

file | EnvironmentDisplayView.h [code]
This class provides a display for a quick overview of the environment configuration.
file | EnvironmentView.h [code]
This class provides an editor for configuring the environment setup, i.e. it is filled with the content stored in an EnvironmentInterface instance.
file | ExperimentBaseView.h [code]
This class provides a resizable container widget for the content of the experiment tab's scroll area.
file | ExperimentView.h [code]
This class provides an editor for configuring the experiment setup, i.e. it is filled with the content stored in an ExperimentInterface instance.
file | ScenarioBaseView.h [code]
This class provides a resizable container widget for the content of the scenario tab's scroll area.
file | ScenarioDisplayView.h [code]
This class provides a display for a quick overview of the scenario configuration.
file | ScenarioView.h [code]
This class provides an editor for configuring the scenario setup, i.e. it is filled with the content stored in an ScenarioInterface instance.
file | StatusBarView.h [code]
This class defines a status bar.
file | TrafficBaseView.h [code]
This class provides a resizable container widget for the content of the traffic tab.
file | TrafficDisplayView.h [code]
This class provides a display for a quick overview of the traffic configuration.
file | TrafficItemView.h [code]
This class defines a general view for a traffic item, which can be a volume, platoon rate, velocity, homogeneity or an agent profile.
file | TrafficLanesView.h [code]
This class defines the editor widget for assigning agent profiles to regular and rightmost lanes.
file | TrafficParametersView.h [code]
This class defines the editor widget for traffic parameters and their probabilities.
file | TrafficSimulationView.h [code]
This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other configuration views as child widgets.
file | TrafficView.h [code]
This class provides an editor for configuring the traffic setup, i.e. it is filled with the content stored in an TrafficInterface instance.
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Models Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Models
Models Directory Reference

Files

file | EnvironmentItemModel.h [code]
The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class.
file | EnvironmentModel.h [code]
The Environment Model implements the functionality of the EnvironmentInterface class.
file | ExperimentModel.h [code]
The ExperimentModel class implements the functionality of the ExperimentInterface class.
file | ScenarioModel.h [code]
The Scenario Model class implements the functionality of the ScenarioItemInterface class.
file | TrafficItemMapModel.h [code]
The TrafficItemMapModel class implements functionality of the TrafficItemMapInterface class.
file | TrafficItemModel.h [code]
The TrafficItemModel class implements functionality of the TrafficItemInterface class.
file | TrafficModel.h [code]
The TrafficModel class implements the functionality of the TrafficInterface class.
file | TrafficSimulationModel.h [code]
The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class.
file | TrafficSimulationXMLBaseModel.h [code]
This class defines the XML element names of the combination XML file.
file | TrafficSimulationXMLLoadModel.h [code]
This class provides routines for loading the combination XML file and for storing all information in the corresponding instances of the model classes.
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Models Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Models
Models Directory Reference

Files

file | AgentConfigurationModel.h [code]
This class implements the functionality of AgentConfigurationInterface.
file | AgentItemModel.h [code]
This class implements the functionality of AgentItemInterface.
file | AgentMapModel.h [code]
This class implements the functionality of AgentMapInterface.
file | DriverProfileItemModel.h [code]
This class implements the functionality of DriverProfileItemInterface.
file | DriverProfileMapModel.h [code]
This class implements the functionality of DriverProfileMapInterface.
file | ParameterItemModel.h [code]
This class implements the functionality of ParameterItemInterface.
file | ParameterMapModel.h [code]
This class implements the functionality of ParameterMapInterface.
file | SensorItemModel.h [code]
This class implements the functionality of SensorItemInterface.
file | SensorMapModel.h [code]
This class implements the functionality of SensorMapInterface.
file | SensorProfileItemModel.h [code]
This class implements the functionality of SensorProfileItemInterface.
file | SensorProfileMapModel.h [code]
This class implements the functionality of SensorProfileMapInterface.
file | VehicleComponentItemModel.h [code]
This class implements the functionality of VehicleComponentItemInterface.
file | VehicleComponentMapModel.h [code]
This class implements the functionality of VehicleComponentMapInterface.
file | VehicleComponentProfileItemModel.h [code]
This class implements the functionality of VehicleComponentProfileItemInterface.
file | VehicleComponentProfileMapModel.h [code]
This class implements the functionality of VehicleComponentProfileMapInterface.
file | VehicleProfileItemModel.h [code]
This class implements the functionality of VehicleProfileItemInterface.
file | VehicleProfileMapModel.h [code]
This class implements the functionality of VehicleProfileMapInterface.
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Interfaces Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
Interfaces Directory Reference

Directories

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS_GUI Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
openPASS_GUI Directory Reference

Directories

directory | openPASS
directory | openPASS-Component
directory | openPASS-Project
directory | openPASS-Window
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS-Component Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
openPASS-Component Directory Reference
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Interfaces Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
Interfaces Directory Reference

Directories

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Interfaces Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
Interfaces Directory Reference

Directories

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS-TrafficSimulation Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Interfaces
  • openPASS-TrafficSimulation
openPASS-TrafficSimulation Directory Reference

Files

file | EnvironmentInterface.h [code]
The EnvironmentInterface class provides setter and getter methods for the maps of environmental parameters, listed under <EnvironmentConfig> in the slaveConfig XML file.
file | EnvironmentItemInterface.h [code]
The EnvironmentItemInterface class provides methods for reading and editing environment parameters.
file | ExperimentInterface.h [code]
The Experiment Interface provides setter and getter methods for the XML elements listed under <ExperimentConfig> in the slaveConfig XML file.
file | ScenarioInterface.h [code]
The Scenario Interface provides setter and getter methods for the combination XML elements related to an Open Scenario File.
file | TrafficInterface.h [code]
The Traffic Interface provides setter and getter methods for the combination XML subelements listed under the <TrafficConfig> element.
file | TrafficItemInterface.h [code]
The Traffic Item Interface defines a general traffic parameter which can be incorporated into the traffic configuration setup.
file | TrafficItemMapInterface.h [code]
The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be registered under a key identifier (ID). The traffic items are defined in the TrafficItemInterface class.
file | TrafficSimulationInterface.h [code]
The TrafficSimulationInterface class forms the body of a traffic simulation configuration.
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Interfaces Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS
  • Interfaces
Interfaces Directory Reference

Directories

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS-Component Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Component
  • Interfaces
  • openPASS-Component
openPASS-Component Directory Reference

Files

file | ComponentInputItemInterface.h [code]
The Component Input Item Interface (CIII) contains the functions setters and getters of the items constituing an input of a component. This interface belongs to the Component Plugin (CP).
file | ComponentInputMapInterface.h [code]
The Component Input Map Interface (CIMI) contains the functions managing the registration and deregistration of the inputs of a component. This interface belongs to the Component Plugin (CP).
file | ComponentInterface.h [code]
The Component Interface (CI) contains the functions creating components. This interface belongs to the Component Plugin (CP).
file | ComponentItemInterface.h [code]
The Component Item Interface (CII) contains the functions setters and getters of the items constituing a component. This interface belongs to the Component Plugin (CP).
file | ComponentMapInterface.h [code]
The Component Map Interface (CMI) contains the functions managing the registration and deregistration of components. This interface belongs to the Component Plugin (CP).
file | ComponentOutputItemInterface.h [code]
The Component Output Item Interface (COII) contains the functions setters and getters of the items constituing an output of a component. This interface belongs to the Component Plugin (CP).
file | ComponentOutputMapInterface.h [code]
The Component Output Map Interface (COMI) contains the functions managing the registration and deregistration of the outputs of a component. This interface belongs to the Component Plugin (CP).
file | ComponentParameterItemInterface.h [code]
The Component Parameter Item Interface (CPII) contains the functions setters and getters of the items constituing a parameter of a component. This interface belongs to the Component Plugin (CP).
file | ComponentParameterMapInterface.h [code]
The Component Parameter Map Interface (CPMI) contains the functions managing the registration and deregistration of the parameters of a component. This interface belongs to the Component Plugin (CP).
file | ComponentScheduleInterface.h [code]
The Component Schedule Interface (CSI) contains the functions setters and getters for the schedule parameters of a component. This interface belongs to the Component Plugin (CP).
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS-Project Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Project
  • Interfaces
  • openPASS-Project
openPASS-Project Directory Reference

Files

file ProjectInterface.h [code]
The Project Interface (PI) contains the functions setters and getters of the items constituing the project configuration or framework configuration for the simulation. This interface belongs to the Project Plugin (PP).
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Presenters Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Presenters
Presenters Directory Reference

Files

file | AgentConfigurationCombinationPresenter.h [code]
This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of this plugin to the profiles catalogue XML file needed by the simulation slave.
file | AgentConfigurationPresenter.h [code]
This class defines the presenter object which handles events from the view (AgentConfigurationView) and edits the model data (AgentConfigurationInterface) accordingly.
file | AgentMapPresenter.h [code]
This file contains the class AgentMapPresenter defining the presenter object for agent profiles as well as the classes for all undo-command objects used by AgentMapPresenter.
file | DriverProfilesMapPresenter.h [code]
This class constitutes the re-implementation of QAbstractTableModel for the table view of driver profiles. In fact, this class implements a wrapper for the map of driver profiles (DriverProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework.
file | DriverProfilesPresenter.h [code]
This file contains the class DriverProfilesPresenter defining the presenter object for driver profiles as well as the classes for all undo-command objects used by DriverProfilesPresenter.
file | ParameterMapPresenter.h [code]
This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters. In fact, this class implements a wrapper for the map of parameters (ParameterMapInterface) to be editable by QTableView objects within Qt's Model/View framework.
file | SystemProfilePresenter.h [code]
This class constitutes the re-implementation of QAbstractTableModel for the table view of systems with a given algorithm type. The corresponding model data object is referred to as "system profile". In fact, this class implements a wrapper for these system profiles to be editable by QTableView objects within Qt's Model/View framework.
file | VehicleProfilesMapPresenter.h [code]
This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle profiles. In fact, this class implements a wrapper for the map of vehicle profiles (VehicleProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework.
file | VehicleProfilesPresenter.h [code]
This file contains the class VehicleProfilesPresenter defining the presenter object for vehicle profiles as well as the classes for all undo-command objects used by VehicleProfilesPresenter.
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Views Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Views
Views Directory Reference

Files

file | AgentConfigurationView.h [code]
This class constitutes the main view of the agent configuration plugin. It instantiates the action menu as well as a tab widget as a container widget for views of agent, driver and vehicle profiles as well as the undo stack. The main task of this view is to emit signals upon user actions on the action menu which are handled in the corresponding prestenter object (AgentConfigurationPresenter).
file | AgentMapView.h [code]
This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu for selecting a profile to be edited as well as buttons for removing and adding agent profiles. Further, a menu for editing the type ("dynamic" or "static") is provided whose selection switches between two different views. If the type "dynamic" is selected, two tables for assigning driver and vehicle profiles with probabilities appear. If type "static" is selected, the view is reduced to a selection menu for a system config + system as well as a vehicle model catalogue + model. The switching between the two modes is realized via a stacked widget whose pages contain the GUI elements being exclusive for the selected mode. Further information on how to use this view can be found in the GUI tutorial.
file | DriverProfilesView.h [code]
This class defines the view for editing driver profiles. The view constitutes a combo box for switching between different driver profiles, add-, remove- and rename buttons and a table view for editing the parameters of the driver profile. Further information on how to use this view can be found in the GUI tutorial.
file | SystemProfileView.h [code]
This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm type onto probabilities.
file | VehicleProfilesView.h [code]
This class defines the view for editing vehicle profiles. The view constitutes a combo box for selecting and buttons for adding, removing and renaming vehicle profiles. Further, GUI elements for vehicle model catalogue and vehicle model as well as for the system config are provided. Systems defined in a system config are sorted by the algorithm type used therein. For the corresponding selection of an algorithm type, a combo box including add- and remove- buttons is set up. The dynamic instantiation of the table views for systems of a certain algorithm type (SystemProfileView) is performed in the presenter object (VehicleProfilesPresenter). This object calls public methods of this class in order to instantiate the table views and and lay them out in this widget.
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: OpenPass_Source_Code Directory Reference

  • OpenPass_Source_Code
OpenPass_Source_Code Directory Reference
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Interfaces Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Project
  • Interfaces
Interfaces Directory Reference

Directories

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS-GUI Directory Reference

  • dev.edag_OLD
  • openPASS-GUI
openPASS-GUI Directory Reference

Directories

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Presenters Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
  • Presenters
Presenters Directory Reference

Files

file | EnvironmentDisplayPresenter.h [code]
This class defines the presenter which controls the content to be displayed in the EnvironmentDisplayView widget.
file | EnvironmentMapPresenter.h [code]
This class describes the presenter objects of the environment parameter maps.
file | EnvironmentPresenter.h [code]
This class defines the presenter object which handles user events coming from the view (EnvironmentView) and edits the model accordingly (EnvironmentInterface).
file | ExperimentPresenter.h [code]
This class defines the presenter object which handles user events coming from the view (ExperimentView) and edits the model accordingly (ExperimentInterface).
file | LibrariesPresenter.h [code]
This class describes the presenter object of the map of included libraries.
file | ScenarioAgentsPresenter.h [code]
This class describes the presenter object of the scenario agents map.
file | ScenarioDisplayPresenter.h [code]
This class defines the presenter which controls the content to be displayed in the ScenarioDisplayView widget.
file | ScenarioPresenter.h [code]
This class defines the presenter object which handles user events coming from the view (ScenarioView) and edits the model accordingly (ScenarioInterface).
file | TrafficDisplayPresenter.h [code]
This class defines the presenter which controls the content to be displayed in the TrafficDisplayView widget.
file | TrafficItemMapPresenter.h [code]
This class describes the presenter objects of the traffic parameter maps.
file | TrafficLanesPresenter.h [code]
This class defines the presenter object which handles events coming from the view (TrafficLanesView) and edits the model accordingly (TrafficInterface).
file | TrafficParametersPresenter.h [code]
This class defines the presenter object which handles events coming from the view (TrafficParametersView) and edits the model accordingly (TrafficInterface), i.e. more specifically the parameters therein.
file | TrafficPresenter.h [code]
This class defines the presenter object which handles user events coming from the view (TrafficView) and edits the model accordingly (TrafficInterface).
file | TrafficSimulationPresenter.h [code]
This class defines the presenter object for the main view of the Traffic Simulation Plugin and instantiates all other presenters.
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS-System Directory Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
openPASS-System Directory Reference

Directories

directory Interfaces

Files

file SystemPlugin.cpp [code]
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS
  • Interfaces
  • openPASS
openPASS Directory Reference

Files

file | PluginInterface.h [code]
...
file | PluginManagerInterface.h [code]
...
file | RandomInterface.h [code]
...
file | ServiceInterface.h [code]
...
file | ServiceManagerInterface.h [code]
...
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS-Window Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Window
openPASS-Window Directory Reference
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: dev.edag_OLD Directory Reference

  • dev.edag_OLD
dev.edag_OLD Directory Reference
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Interfaces Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Window
  • Interfaces
Interfaces Directory Reference

Directories

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS-TrafficSimulation Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-TrafficSimulation
openPASS-TrafficSimulation Directory Reference

Directories

directory Interfaces

Files

file TrafficSimulationPlugin.h [code]
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Interfaces Directory Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
Interfaces Directory Reference

Directories

Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS-AgentConfiguration Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
  • Interfaces
  • openPASS-AgentConfiguration
openPASS-AgentConfiguration Directory Reference

Files

file | AgentConfigurationInterface.h [code]
This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-relevant ProfilesCatalog.xml files.
file | AgentItemInterface.h [code]
This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-relevant profiles cataloge (*.xml) under <AgentProfiles>.
file | AgentMapInterface.h [code]
This class constitutes a container class in which agent profiles (instances of AgentItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map.
file | DriverProfileItemInterface.h [code]
This class defines objects containing all relevant information on driver profiles.
file | DriverProfileMapInterface.h [code]
This class constitutes a container class in which driver profiles (instances of DriverProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map.
file | ParameterItemInterface.h [code]
This class defines parameters.
file | ParameterMapInterface.h [code]
This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.
file | SensorItemInterface.h [code]
This file contains the class declaration of a sensor data object as well as a structure for a sensor position.
file | SensorMapInterface.h [code]
This class constitutes a container class in which sensor data (instances of SensorItemInterface) are registered. It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.
file | SensorProfileItemInterface.h [code]
This class defines objects containing all relevant information on sensor profiles.
file | SensorProfileMapInterface.h [code]
This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInterface) are registered. As a key identifier the pair of sensor name and type (corrsponding to its implementation) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.
file | VehicleComponentItemInterface.h [code]
The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a algorithms that will be built into a vehicle with a certain probability.
file | VehicleComponentMapInterface.h [code]
This class constitutes a container class for vehicle component data (instances of VehicleComponentItemInterface) using the vehicle component's type (i.e. the algorithm it represents) as a key identifier. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.
file | VehicleComponentProfileItemInterface.h [code]
This class defines vehicle component profiles which contain the parameterization of a vehicle component, i.e. an instance of the VehicleComponentItemInterface class.
file | VehicleComponentProfileMapInterface.h [code]
This class constitutes a container class for vehicle component profiles (instances of VehicleComponentProfileItemInterface). As a key identifier the pair of the profile's name and type (corrsponding to to the implementation/algorithm of the vehicle component) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map.
file | VehicleProfileItemInterface.h [code]
This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the simulation.
file | VehicleProfileMapInterface.h [code]
This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map.
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS-System Directory Reference

  • dev.edag_OLD
  • openPASS-GUI
  • openPASS-System
  • Interfaces
  • openPASS-System
openPASS-System Directory Reference

Files

file | SystemComponentInputItemInterface.h [code]
The System Component Input Item Interface (SCIII) contains the functions getters of the items constituing an input of a component and accesses the items of the parent component.
file | SystemComponentInputMapInterface.h [code]
The System Component Input Map Interface (SCIMI) contains the functions managing the registration and deregistration of the inputs of a component registered in a system. This interface belongs to the System Plugin (SP).
file | SystemComponentItemInterface.h [code]
The System Component Item Interface (SCmII) contains the functions setters and getters of the items constituing a component registered in a system. This interface belongs to the System Plugin (SP).
file | SystemComponentManagerInterface.h [code]
The System Component Manager Interface (SCMI) contains the functions loading components as a library that can be used to build a system. This interface belongs to the System Plugin (SP).
file | SystemComponentMapInterface.h [code]
The System Component Map Interface (SCmMI) contains the functions managing the registration and deregistration of components building a system. This interface belongs to the System Plugin (SP).
file | SystemComponentOutputItemInterface.h [code]
The System Component Output Item Interface (SCOII) contains the functions getters of the items constituing an output of a component and accesses the object parent the component. This interface belongs to the System Plugin (SP).
file | SystemComponentOutputMapInterface.h [code]
The System Component Output Map Interface (SCOMI) contains the functions managing the registration and deregistration of the outputs of a component registered in a system. This interface belongs to the System Plugin (SP).
file | SystemComponentParameterItemInterface.h [code]
The System Component Parameter Item Interface (SCPII) contains the functions setters and getters of the items constituing a parameter of a component registered in a system. This interface belongs to the System Plugin (SP).
file | SystemComponentParameterMapInterface.h [code]
The System Component Parameter Map Interface (SCPMI) contains the functions managing the registration and deregistration of the parameters of a component registered to a system. This interface belongs to the System Plugin (CP).
file | SystemComponentScheduleInterface.h [code]
The System Component Schedule Interface (SCSI) contains the functions setters and getters for the simulation schedule related parameters of a component registered in a system. This interface belongs to the System Plugin (SP).
file | SystemConnectionItemInterface.h [code]
The System Connection Item Interface (SCnII) contains the functions getters of the items constituing the connection between two components of a system. This interface belongs to the System Plugin (SP).
file | SystemConnectionMapInterface.h [code]
The System Connection Map Interface (SCnMI) contains the functions managing the registration and deregistration of connections linking components building a system. This interface belongs to the System Plugin (SP).
file | SystemInterface.h [code]
The System Interface (SI) contains the functions creating systems and creating a tree listing the components loaded from library. This interface belongs to the System Plugin (SP).
file | SystemItemInterface.h [code]
The System Item Interface (SII) contains the functions setters and getters of the items constituing a system. This interface belongs to the System Plugin (SP).
file | SystemMapInterface.h [code]
The System Map Interface (SMI) contains the functions managing the registration and deregistration of systems. This interface belongs to the System Plugin (SP).
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS
openPASS Directory Reference
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS-AgentConfiguration Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-AgentConfiguration
openPASS-AgentConfiguration Directory Reference

Directories

directory Interfaces

Files

file AgentConfigurationPlugin.h [code]
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS-Project Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Project
openPASS-Project Directory Reference
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: openPASS-Window Directory Reference

  • OpenPass_Source_Code
  • openPASS_GUI
  • openPASS-Window
  • Interfaces
  • openPASS-Window
openPASS-Window Directory Reference

Files

file WindowInterface.h [code]
The Window Interface (WI) contains the functions managing the Window View of openPASS application.
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: File List

File List
Here is a list of all documented files with brief descriptions:
AgentConfigurationCombinationPresenter.cpp |
AgentConfigurationCombinationPresenter.h | This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of this plugin to the profiles catalogue XML file needed by the simulation slave
AgentConfigurationCombinationXMLBaseModel.cpp |
AgentConfigurationCombinationXMLBaseModel.h |
AgentConfigurationCombinationXMLSaveModel.cpp |
AgentConfigurationCombinationXMLSaveModel.h |
AgentConfigurationInterface.h | This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-relevant ProfilesCatalog.xml files
AgentConfigurationModel.cpp |
AgentConfigurationModel.h | This class implements the functionality of AgentConfigurationInterface
AgentConfigurationPlugin.cpp |
AgentConfigurationPlugin.h |
AgentConfigurationPresenter.cpp |
AgentConfigurationPresenter.h | This class defines the presenter object which handles events from the view (AgentConfigurationView) and edits the model data (AgentConfigurationInterface) accordingly
AgentConfigurationView.cpp |
AgentConfigurationView.h | This class constitutes the main view of the agent configuration plugin. It instantiates the action menu as well as a tab widget as a container widget for views of agent, driver and vehicle profiles as well as the undo stack. The main task of this view is to emit signals upon user actions on the action menu which are handled in the corresponding prestenter object (AgentConfigurationPresenter)
AgentConfigurationXMLBaseModel.cpp |
AgentConfigurationXMLBaseModel.h |
AgentConfigurationXMLLoadModel.cpp |
AgentConfigurationXMLLoadModel.h |
AgentConfigurationXMLSaveModel.cpp |
AgentConfigurationXMLSaveModel.h |
AgentItemInterface.h | This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-relevant profiles cataloge (*.xml) under <AgentProfiles>
AgentItemModel.cpp |
AgentItemModel.h | This class implements the functionality of AgentItemInterface
AgentMapInterface.h | This class constitutes a container class in which agent profiles (instances of AgentItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map
AgentMapModel.cpp |
AgentMapModel.h | This class implements the functionality of AgentMapInterface
AgentMapPresenter.cpp |
AgentMapPresenter.h | This file contains the class AgentMapPresenter defining the presenter object for agent profiles as well as the classes for all undo-command objects used by AgentMapPresenter
AgentMapView.cpp |
AgentMapView.h | This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu for selecting a profile to be edited as well as buttons for removing and adding agent profiles. Further, a menu for editing the type ("dynamic" or "static") is provided whose selection switches between two different views. If the type "dynamic" is selected, two tables for assigning driver and vehicle profiles with probabilities appear. If type "static" is selected, the view is reduced to a selection menu for a system config + system as well as a vehicle model catalogue + model. The switching between the two modes is realized via a stacked widget whose pages contain the GUI elements being exclusive for the selected mode. Further information on how to use this view can be found in the GUI tutorial
ComponentInputItemInterface.h | The Component Input Item Interface (CIII) contains the functions setters and getters of the items constituing an input of a component. This interface belongs to the Component Plugin (CP)
ComponentInputMapInterface.h | The Component Input Map Interface (CIMI) contains the functions managing the registration and deregistration of the inputs of a component. This interface belongs to the Component Plugin (CP)
ComponentInterface.h | The Component Interface (CI) contains the functions creating components. This interface belongs to the Component Plugin (CP)
ComponentItemInterface.h | The Component Item Interface (CII) contains the functions setters and getters of the items constituing a component. This interface belongs to the Component Plugin (CP)
ComponentMapInterface.h | The Component Map Interface (CMI) contains the functions managing the registration and deregistration of components. This interface belongs to the Component Plugin (CP)
ComponentOutputItemInterface.h | The Component Output Item Interface (COII) contains the functions setters and getters of the items constituing an output of a component. This interface belongs to the Component Plugin (CP)
ComponentOutputMapInterface.h | The Component Output Map Interface (COMI) contains the functions managing the registration and deregistration of the outputs of a component. This interface belongs to the Component Plugin (CP)
ComponentParameterItemInterface.h | The Component Parameter Item Interface (CPII) contains the functions setters and getters of the items constituing a parameter of a component. This interface belongs to the Component Plugin (CP)
ComponentParameterMapInterface.h | The Component Parameter Map Interface (CPMI) contains the functions managing the registration and deregistration of the parameters of a component. This interface belongs to the Component Plugin (CP)
ComponentScheduleInterface.h | The Component Schedule Interface (CSI) contains the functions setters and getters for the schedule parameters of a component. This interface belongs to the Component Plugin (CP)
DelegateComboBoxView.cpp |
DelegateComboBoxView.h |
DelegateDoubleView.cpp |
DelegateDoubleView.h |
DelegateFileBrowseView.cpp |
DelegateFileBrowseView.h |
DoubleSpinBoxView.cpp |
DoubleSpinBoxView.h |
DriverProfileItemInterface.h | This class defines objects containing all relevant information on driver profiles
DriverProfileItemModel.cpp |
DriverProfileItemModel.h | This class implements the functionality of DriverProfileItemInterface
DriverProfileMapInterface.h | This class constitutes a container class in which driver profiles (instances of DriverProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map
DriverProfileMapModel.cpp |
DriverProfileMapModel.h | This class implements the functionality of DriverProfileMapInterface
DriverProfilesMapPresenter.cpp |
DriverProfilesMapPresenter.h | This class constitutes the re-implementation of QAbstractTableModel for the table view of driver profiles. In fact, this class implements a wrapper for the map of driver profiles (DriverProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework
DriverProfilesPresenter.cpp |
DriverProfilesPresenter.h | This file contains the class DriverProfilesPresenter defining the presenter object for driver profiles as well as the classes for all undo-command objects used by DriverProfilesPresenter
DriverProfilesView.cpp |
DriverProfilesView.h | This class defines the view for editing driver profiles. The view constitutes a combo box for switching between different driver profiles, add-, remove- and rename buttons and a table view for editing the parameters of the driver profile. Further information on how to use this view can be found in the GUI tutorial
EnvironmentBaseView.cpp |
EnvironmentBaseView.h |
EnvironmentDisplayPresenter.cpp |
EnvironmentDisplayPresenter.h | This class defines the presenter which controls the content to be displayed in the EnvironmentDisplayView widget
EnvironmentDisplayView.cpp |
EnvironmentDisplayView.h | This class provides a display for a quick overview of the environment configuration
EnvironmentInterface.h | The EnvironmentInterface class provides setter and getter methods for the maps of environmental parameters, listed under <EnvironmentConfig> in the slaveConfig XML file
EnvironmentItemInterface.h | The EnvironmentItemInterface class provides methods for reading and editing environment parameters
EnvironmentItemModel.cpp |
EnvironmentItemModel.h | The EnvironmentItemModel class implements the functionality of the EnvironmentItemInterface class
EnvironmentItemView.cpp |
EnvironmentItemView.h |
EnvironmentMapPresenter.cpp |
EnvironmentMapPresenter.h | This class describes the presenter objects of the environment parameter maps
EnvironmentModel.cpp |
EnvironmentModel.h | The Environment Model implements the functionality of the EnvironmentInterface class
EnvironmentPresenter.cpp |
EnvironmentPresenter.h | This class defines the presenter object which handles user events coming from the view (EnvironmentView) and edits the model accordingly (EnvironmentInterface)
EnvironmentView.cpp |
EnvironmentView.h | This class provides an editor for configuring the environment setup, i.e. it is filled with the content stored in an EnvironmentInterface instance
ExperimentBaseView.cpp |
ExperimentBaseView.h | This class provides a resizable container widget for the content of the experiment tab's scroll area
ExperimentInterface.h | The Experiment Interface provides setter and getter methods for the XML elements listed under <ExperimentConfig> in the slaveConfig XML file
ExperimentModel.cpp |
ExperimentModel.h | The ExperimentModel class implements the functionality of the ExperimentInterface class
ExperimentPresenter.cpp |
ExperimentPresenter.h | This class defines the presenter object which handles user events coming from the view (ExperimentView) and edits the model accordingly (ExperimentInterface)
ExperimentView.cpp |
ExperimentView.h | This class provides an editor for configuring the experiment setup, i.e. it is filled with the content stored in an ExperimentInterface instance
FileBrowseView.cpp |
FileBrowseView.h |
LibrariesPresenter.cpp |
LibrariesPresenter.h | This class describes the presenter object of the map of included libraries
LoggingGroupsPresenter.cpp |
LoggingGroupsPresenter.h |
ParameterItemInterface.h | This class defines parameters
ParameterItemModel.cpp |
ParameterItemModel.h | This class implements the functionality of ParameterItemInterface
ParameterItemPresenter.cpp |
ParameterItemPresenter.h |
ParameterItemView.cpp |
ParameterItemView.h |
ParameterMapInterface.h | This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
ParameterMapModel.cpp |
ParameterMapModel.h | This class implements the functionality of ParameterMapInterface
ParameterMapPresenter.cpp |
ParameterMapPresenter.h | This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters. In fact, this class implements a wrapper for the map of parameters (ParameterMapInterface) to be editable by QTableView objects within Qt's Model/View framework
PluginInterface.h | ..
PluginManagerInterface.h | ..
ProfileItemView.cpp |
ProfileItemView.h |
ProfileMapInterface.h |
ProjectInterface.h | The Project Interface (PI) contains the functions setters and getters of the items constituing the project configuration or framework configuration for the simulation. This interface belongs to the Project Plugin (PP)
RandomInterface.h | ..
ScenarioAgentsPresenter.cpp |
ScenarioAgentsPresenter.h | This class describes the presenter object of the scenario agents map
ScenarioBaseView.cpp |
ScenarioBaseView.h | This class provides a resizable container widget for the content of the scenario tab's scroll area
ScenarioDisplayPresenter.cpp |
ScenarioDisplayPresenter.h | This class defines the presenter which controls the content to be displayed in the ScenarioDisplayView widget
ScenarioDisplayView.cpp |
ScenarioDisplayView.h | This class provides a display for a quick overview of the scenario configuration
ScenarioInterface.h | The Scenario Interface provides setter and getter methods for the combination XML elements related to an Open Scenario File
ScenarioModel.cpp |
ScenarioModel.h | The Scenario Model class implements the functionality of the ScenarioItemInterface class
ScenarioPresenter.cpp |
ScenarioPresenter.h | This class defines the presenter object which handles user events coming from the view (ScenarioView) and edits the model accordingly (ScenarioInterface)
ScenarioView.cpp |
ScenarioView.h | This class provides an editor for configuring the scenario setup, i.e. it is filled with the content stored in an ScenarioInterface instance
SelectedSystemItemView.cpp |
SelectedSystemItemView.h |
SensorItemInterface.h | This file contains the class declaration of a sensor data object as well as a structure for a sensor position
SensorItemModel.cpp |
SensorItemModel.h | This class implements the functionality of SensorItemInterface
SensorMapInterface.h | This class constitutes a container class in which sensor data (instances of SensorItemInterface) are registered. It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
SensorMapModel.cpp |
SensorMapModel.h | This class implements the functionality of SensorMapInterface
SensorProfileItemInterface.h | This class defines objects containing all relevant information on sensor profiles
SensorProfileItemModel.cpp |
SensorProfileItemModel.h | This class implements the functionality of SensorProfileItemInterface
SensorProfileMapInterface.h | This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInterface) are registered. As a key identifier the pair of sensor name and type (corrsponding to its implementation) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
SensorProfileMapModel.cpp |
SensorProfileMapModel.h | This class implements the functionality of SensorProfileMapInterface
ServiceInterface.h | ..
ServiceManagerInterface.h | ..
SpinBoxView.cpp |
SpinBoxView.h |
StatusBarView.cpp |
StatusBarView.h | This class defines a status bar
SystemBaseView.cpp |
SystemBaseView.h |
SystemComponentInputItemInterface.h | The System Component Input Item Interface (SCIII) contains the functions getters of the items constituing an input of a component and accesses the items of the parent component
SystemComponentInputItemModel.cpp |
SystemComponentInputItemModel.h |
SystemComponentInputItemView.cpp |
SystemComponentInputItemView.h |
SystemComponentInputMapInterface.h | The System Component Input Map Interface (SCIMI) contains the functions managing the registration and deregistration of the inputs of a component registered in a system. This interface belongs to the System Plugin (SP)
SystemComponentInputMapModel.cpp |
SystemComponentInputMapModel.h |
SystemComponentItemInterface.h | The System Component Item Interface (SCmII) contains the functions setters and getters of the items constituing a component registered in a system. This interface belongs to the System Plugin (SP)
SystemComponentItemModel.cpp |
SystemComponentItemModel.h |
SystemComponentItemView.cpp |
SystemComponentItemView.h |
SystemComponentManagerInterface.h | The System Component Manager Interface (SCMI) contains the functions loading components as a library that can be used to build a system. This interface belongs to the System Plugin (SP)
SystemComponentManagerModel.cpp |
SystemComponentManagerModel.h |
SystemComponentManagerView.cpp |
SystemComponentManagerView.h |
SystemComponentMapInterface.h | The System Component Map Interface (SCmMI) contains the functions managing the registration and deregistration of components building a system. This interface belongs to the System Plugin (SP)
SystemComponentMapModel.cpp |
SystemComponentMapModel.h |
SystemComponentOutputItemInterface.h | The System Component Output Item Interface (SCOII) contains the functions getters of the items constituing an output of a component and accesses the object parent the component. This interface belongs to the System Plugin (SP)
SystemComponentOutputItemModel.cpp |
SystemComponentOutputItemModel.h |
SystemComponentOutputItemView.cpp |
SystemComponentOutputItemView.h |
SystemComponentOutputMapInterface.h | The System Component Output Map Interface (SCOMI) contains the functions managing the registration and deregistration of the outputs of a component registered in a system. This interface belongs to the System Plugin (SP)
SystemComponentOutputMapModel.cpp |
SystemComponentOutputMapModel.h |
SystemComponentParameterItemInterface.h | The System Component Parameter Item Interface (SCPII) contains the functions setters and getters of the items constituing a parameter of a component registered in a system. This interface belongs to the System Plugin (SP)
SystemComponentParameterItemModel.cpp |
SystemComponentParameterItemModel.h |
SystemComponentParameterItemView.cpp |
SystemComponentParameterItemView.h |
SystemComponentParameterMapInterface.h | The System Component Parameter Map Interface (SCPMI) contains the functions managing the registration and deregistration of the parameters of a component registered to a system. This interface belongs to the System Plugin (CP)
SystemComponentParameterMapModel.cpp |
SystemComponentParameterMapModel.h |
SystemComponentParameterValueBoolView.cpp |
SystemComponentParameterValueBoolView.h |
SystemComponentParameterValueDoubleView.cpp |
SystemComponentParameterValueDoubleView.h |
SystemComponentParameterValueFloatView.cpp |
SystemComponentParameterValueFloatView.h |
SystemComponentParameterValueIntView.cpp |
SystemComponentParameterValueIntView.h |
SystemComponentParameterValueStringView.cpp |
SystemComponentParameterValueStringView.h |
SystemComponentScheduleInterface.h | The System Component Schedule Interface (SCSI) contains the functions setters and getters for the simulation schedule related parameters of a component registered in a system. This interface belongs to the System Plugin (SP)
SystemComponentScheduleModel.cpp |
SystemComponentScheduleModel.h |
SystemComponentScheduleView.cpp |
SystemComponentScheduleView.h |
SystemComponentTitleView.cpp |
SystemComponentTitleView.h |
SystemConnectionItemInterface.h | The System Connection Item Interface (SCnII) contains the functions getters of the items constituing the connection between two components of a system. This interface belongs to the System Plugin (SP)
SystemConnectionItemModel.cpp |
SystemConnectionItemModel.h |
SystemConnectionMapInterface.h | The System Connection Map Interface (SCnMI) contains the functions managing the registration and deregistration of connections linking components building a system. This interface belongs to the System Plugin (SP)
SystemConnectionMapModel.cpp |
SystemConnectionMapModel.h |
SystemInterface.h | The System Interface (SI) contains the functions creating systems and creating a tree listing the components loaded from library. This interface belongs to the System Plugin (SP)
SystemItemInterface.h | The System Item Interface (SII) contains the functions setters and getters of the items constituing a system. This interface belongs to the System Plugin (SP)
SystemItemModel.cpp |
SystemItemModel.h |
SystemItemView.cpp |
SystemItemView.h |
SystemMapInterface.h | The System Map Interface (SMI) contains the functions managing the registration and deregistration of systems. This interface belongs to the System Plugin (SP)
SystemMapModel.cpp |
SystemMapModel.h |
SystemModel.cpp |
SystemModel.h |
SystemPlugin.cpp |
SystemPlugin.h |
SystemProfilePresenter.cpp |
SystemProfilePresenter.h | This class constitutes the re-implementation of QAbstractTableModel for the table view of systems with a given algorithm type. The corresponding model data object is referred to as "system profile". In fact, this class implements a wrapper for these system profiles to be editable by QTableView objects within Qt's Model/View framework
SystemProfileView.cpp |
SystemProfileView.h | This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm type onto probabilities
SystemView.cpp |
SystemView.h |
SystemXMLBaseModel.cpp |
SystemXMLBaseModel.h |
SystemXMLLoadModel.cpp |
SystemXMLLoadModel.h |
SystemXMLSaveModel.cpp |
SystemXMLSaveModel.h |
TrafficBaseView.cpp |
TrafficBaseView.h | This class provides a resizable container widget for the content of the traffic tab
TrafficDisplayPresenter.cpp |
TrafficDisplayPresenter.h | This class defines the presenter which controls the content to be displayed in the TrafficDisplayView widget
TrafficDisplayView.cpp |
TrafficDisplayView.h | This class provides a display for a quick overview of the traffic configuration
TrafficInterface.h | The Traffic Interface provides setter and getter methods for the combination XML subelements listed under the <TrafficConfig> element
TrafficItemInterface.h | The Traffic Item Interface defines a general traffic parameter which can be incorporated into the traffic configuration setup
TrafficItemMapInterface.h | The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be registered under a key identifier (ID). The traffic items are defined in the TrafficItemInterface class
TrafficItemMapModel.cpp |
TrafficItemMapModel.h | The TrafficItemMapModel class implements functionality of the TrafficItemMapInterface class
TrafficItemMapPresenter.cpp |
TrafficItemMapPresenter.h | This class describes the presenter objects of the traffic parameter maps
TrafficItemModel.cpp |
TrafficItemModel.h | The TrafficItemModel class implements functionality of the TrafficItemInterface class
TrafficItemView.cpp |
TrafficItemView.h | This class defines a general view for a traffic item, which can be a volume, platoon rate, velocity, homogeneity or an agent profile
TrafficLanesPresenter.cpp |
TrafficLanesPresenter.h | This class defines the presenter object which handles events coming from the view (TrafficLanesView) and edits the model accordingly (TrafficInterface)
TrafficLanesView.cpp |
TrafficLanesView.h | This class defines the editor widget for assigning agent profiles to regular and rightmost lanes
TrafficModel.cpp |
TrafficModel.h | The TrafficModel class implements the functionality of the TrafficInterface class
TrafficParametersPresenter.cpp |
TrafficParametersPresenter.h | This class defines the presenter object which handles events coming from the view (TrafficParametersView) and edits the model accordingly (TrafficInterface), i.e. more specifically the parameters therein
TrafficParametersView.cpp |
TrafficParametersView.h | This class defines the editor widget for traffic parameters and their probabilities
TrafficPresenter.cpp |
TrafficPresenter.h | This class defines the presenter object which handles user events coming from the view (TrafficView) and edits the model accordingly (TrafficInterface)
TrafficSimulationInterface.h | The TrafficSimulationInterface class forms the body of a traffic simulation configuration
TrafficSimulationModel.cpp |
TrafficSimulationModel.h | The TrafficSimulationModel class implements functionality of the TrafficSimulationInterface class
TrafficSimulationPlugin.cpp |
TrafficSimulationPlugin.h |
TrafficSimulationPresenter.cpp |
TrafficSimulationPresenter.h | This class defines the presenter object for the main view of the Traffic Simulation Plugin and instantiates all other presenters
TrafficSimulationView.cpp |
TrafficSimulationView.h | This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other configuration views as child widgets
TrafficSimulationXMLBaseModel.cpp |
TrafficSimulationXMLBaseModel.h | This class defines the XML element names of the combination XML file
TrafficSimulationXMLLoadModel.cpp |
TrafficSimulationXMLLoadModel.h | This class provides routines for loading the combination XML file and for storing all information in the corresponding instances of the model classes
TrafficSimulationXMLSaveModel.cpp |
TrafficSimulationXMLSaveModel.h |
TrafficView.cpp |
TrafficView.h | This class provides an editor for configuring the traffic setup, i.e. it is filled with the content stored in an TrafficInterface instance
TrafficVolumeView.cpp |
TrafficVolumeView.h |
VehicleComponentItemInterface.h | The VehicleComponentItemInterface class defines data on vehicle components which can be thought of a algorithms that will be built into a vehicle with a certain probability
VehicleComponentItemModel.cpp |
VehicleComponentItemModel.h | This class implements the functionality of VehicleComponentItemInterface
VehicleComponentMapInterface.h | This class constitutes a container class for vehicle component data (instances of VehicleComponentItemInterface) using the vehicle component's type (i.e. the algorithm it represents) as a key identifier. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
VehicleComponentMapModel.cpp |
VehicleComponentMapModel.h | This class implements the functionality of VehicleComponentMapInterface
VehicleComponentProfileItemInterface.h | This class defines vehicle component profiles which contain the parameterization of a vehicle component, i.e. an instance of the VehicleComponentItemInterface class
VehicleComponentProfileItemModel.cpp |
VehicleComponentProfileItemModel.h | This class implements the functionality of VehicleComponentProfileItemInterface
VehicleComponentProfileMapInterface.h | This class constitutes a container class for vehicle component profiles (instances of VehicleComponentProfileItemInterface). As a key identifier the pair of the profile's name and type (corrsponding to to the implementation/algorithm of the vehicle component) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
VehicleComponentProfileMapModel.cpp |
VehicleComponentProfileMapModel.h | This class implements the functionality of VehicleComponentProfileMapInterface
VehicleProfileItemInterface.h | This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the simulation
VehicleProfileItemModel.cpp |
VehicleProfileItemModel.h | This class implements the functionality of VehicleProfileItemInterface
VehicleProfileMapInterface.h | This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map
VehicleProfileMapModel.cpp |
VehicleProfileMapModel.h | This class implements the functionality of VehicleProfileMapInterface
VehicleProfilesMapPresenter.cpp |
VehicleProfilesMapPresenter.h | This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle profiles. In fact, this class implements a wrapper for the map of vehicle profiles (VehicleProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework
VehicleProfilesPresenter.cpp |
VehicleProfilesPresenter.h | This file contains the class VehicleProfilesPresenter defining the presenter object for vehicle profiles as well as the classes for all undo-command objects used by VehicleProfilesPresenter
VehicleProfilesView.cpp |
VehicleProfilesView.h | This class defines the view for editing vehicle profiles. The view constitutes a combo box for selecting and buttons for adding, removing and renaming vehicle profiles. Further, GUI elements for vehicle model catalogue and vehicle model as well as for the system config are provided. Systems defined in a system config are sorted by the algorithm type used therein. For the corresponding selection of an algorithm type, a combo box including add- and remove- buttons is set up. The dynamic instantiation of the table views for systems of a certain algorithm type (SystemProfileView) is performed in the presenter object (VehicleProfilesPresenter). This object calls public methods of this class in order to instantiate the table views and and lay them out in this widget
OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.cpp |
OpenPass_Source_Code/openPASS_GUI/openPASS-AgentConfiguration/Views/WidgetView.cpp |
OLD/openPASS-GUI/openPASS-System/Views/WidgetView.cpp |
OpenPass_Source_Code/openPASS_GUI/openPASS-TrafficSimulation/Views/WidgetView.h |
OpenPass_Source_Code/openPASS_GUI/openPASS-AgentConfiguration/Views/WidgetView.h |
OLD/openPASS-GUI/openPASS-System/Views/WidgetView.h |
WindowInterface.h | The Window Interface (WI) contains the functions managing the Window View of openPASS application
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- _ -

  • _columnHeaders : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , ParameterMapPresenter , ScenarioAgentsPresenter , SystemProfilePresenter , VehicleProfilesMapPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- ~ -

  • ~WidgetView() : WidgetView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- a -

  • Action : WindowInterface
  • actionClear() : AgentConfigurationView
  • actionExport() : AgentConfigurationView
  • actionHistory() : AgentConfigurationView , TrafficSimulationView
  • actionLoad() : AgentConfigurationView , TrafficSimulationView
  • ActionMenu : WindowInterface
  • actionMenuClear : AgentConfigurationView
  • actionMenuExport : AgentConfigurationView
  • actionMenuHistory : AgentConfigurationView , TrafficSimulationView
  • actionMenuLoad : AgentConfigurationView , TrafficSimulationView
  • actionMenuNew : TrafficSimulationView
  • actionMenuRedo : AgentConfigurationView , TrafficSimulationView
  • actionMenuSave : AgentConfigurationView , TrafficSimulationView
  • actionMenuUndo : AgentConfigurationView , TrafficSimulationView
  • actionNew() : TrafficSimulationView
  • actionRedo() : AgentConfigurationView , TrafficSimulationView
  • actionSave() : AgentConfigurationView , TrafficSimulationView
  • ActionTitle : WindowInterface
  • actionUndo() : AgentConfigurationView , TrafficSimulationView
  • add() : AgentMapInterface , AgentMapModel , AgentMapView , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentMapInterface , SystemConnectionMapInterface , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel , WindowInterface
  • addAgent() : AgentMapPresenter , AgentMapView
  • addDriver() : DriverProfilesPresenter
  • addDriverProfile() : AgentMapPresenter , AgentMapView , DriverProfilesView
  • addDriverView() : DriverProfilesView
  • added() : AgentMapInterface , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , SystemComponentMapInterface , VehicleProfileMapInterface
  • addFriction() : EnvironmentPresenter , EnvironmentView
  • addHomogeneity() : TrafficParametersPresenter , TrafficParametersView , TrafficPresenter , TrafficView
  • addHomogeneityView() : TrafficParametersView
  • addLibrary() : ExperimentPresenter , ExperimentView
  • addLoggingGroup() : ExperimentPresenter , ExperimentView
  • addPlatoonRate() : TrafficParametersPresenter , TrafficParametersView , TrafficPresenter , TrafficView
  • addPlatoonRateView() : TrafficParametersView
  • addRegularLaneAgent() : TrafficLanesPresenter , TrafficLanesView , TrafficPresenter , TrafficView
  • addRegularLaneAgentView() : TrafficLanesView
  • addRightmostLaneAgent() : TrafficLanesPresenter , TrafficLanesView , TrafficPresenter , TrafficView
  • addRightmostLaneAgentView() : TrafficLanesView
  • addRow() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , ParameterMapPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • addSystem() : SystemProfileView , VehicleProfilesPresenter
  • addSystemProfile() : VehicleProfilesPresenter , VehicleProfilesView
  • addSystemProfileView() : VehicleProfilesView
  • addTimeOfDay() : EnvironmentPresenter , EnvironmentView
  • addVehicleProfile() : AgentMapPresenter , AgentMapView , VehicleProfilesPresenter , VehicleProfilesView
  • addVehicleProfileSelectionItem() : VehicleProfilesView
  • addVelocity() : TrafficParametersPresenter , TrafficParametersView , TrafficPresenter , TrafficView
  • addVelocityView() : TrafficParametersView
  • addVisibilityDistance() : EnvironmentPresenter , EnvironmentView
  • addVolume() : TrafficParametersPresenter , TrafficParametersView , TrafficPresenter , TrafficView
  • addVolumeView() : TrafficParametersView
  • addWeather() : EnvironmentPresenter , EnvironmentView
  • adjustWidgets() : ExperimentBaseView , ScenarioBaseView , TrafficBaseView , TrafficSimulationView
  • agentConfiguration : AgentConfigurationPresenter
  • agentConfigurationView : AgentConfigurationPresenter
  • agentList : TrafficDisplayPresenter , TrafficPresenter
  • agentProfiles : TrafficSimulationPresenter
  • agents : AgentConfigurationModel , AgentMapModel , AgentMapPresenter
  • agentsPresenter : AgentConfigurationPresenter
  • agentsRegularLane : TrafficModel
  • agentsRightMostLane : TrafficModel
  • agentsView : AgentConfigurationView , AgentMapPresenter
  • AlgoType : VehicleProfileItemInterface
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- b -

  • begin() : AgentMapInterface , AgentMapModel , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemComponentParameterMapInterface , SystemConnectionMapInterface , SystemMapInterface , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • bool_list : DriverProfilesPresenter
  • Button : WindowInterface
  • ButtonOrder : WindowInterface
  • ButtonTitle : WindowInterface
  • ButtonType : WindowInterface
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- c -

  • Cardinality : SystemComponentInputItemInterface
  • CatalogueName : ScenarioInterface
  • CatalogueRef : ScenarioInterface
  • changeModelCatalogue() : VehicleProfilesView
  • changeSystemConfig() : VehicleProfilesView
  • checkAgentProfiles() : TrafficDisplayPresenter
  • checkAgents() : TrafficPresenter
  • checkDriverProbabilities() : AgentMapPresenter
  • checkProbabilities() : DriverProfilesMapPresenter , EnvironmentDisplayPresenter , EnvironmentPresenter , TrafficDisplayPresenter , TrafficPresenter , VehicleProfilesMapPresenter
  • checkStatus() : TrafficSimulationPresenter
  • checkVehicleProbabilities() : AgentMapPresenter
  • clear() : AgentConfigurationPresenter , AgentMapView , ComponentInputItemInterface , ComponentInputMapInterface , ComponentItemInterface , ComponentMapInterface , ComponentOutputItemInterface , ComponentOutputMapInterface , ComponentParameterItemInterface , ComponentParameterMapInterface , ComponentScheduleInterface , ParameterMapInterface , ParameterMapModel , ProjectInterface , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentMapInterface , SystemConnectionMapInterface , SystemInterface , SystemMapInterface , TrafficItemMapInterface , TrafficItemMapModel , TrafficSimulationPresenter , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel
  • clearAgentProfiles() : AgentConfigurationPresenter
  • clearAgentSelectionView() : TrafficLanesPresenter
  • clearDriverProfiles() : AgentConfigurationPresenter
  • cleared() : AgentMapInterface , ComponentInputItemInterface , ComponentInputMapInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentOutputMapInterface , ComponentParameterItemInterface , ComponentParameterMapInterface , ComponentScheduleInterface , ProjectInterface , SystemComponentMapInterface , SystemInterface , TrafficLanesPresenter , TrafficParametersPresenter
  • clearEnvironmentConfig() : TrafficSimulationPresenter
  • clearExperimentConfig() : TrafficSimulationPresenter
  • clearScenarioConfig() : TrafficSimulationPresenter
  • ClearSetup() : AgentConfigurationView
  • clearSystemProfileViews() : VehicleProfilesView
  • clearTrafficConfig() : TrafficSimulationPresenter
  • clearTrafficLanesView() : TrafficLanesView
  • clearTrafficParameters() : TrafficParametersPresenter
  • clearTrafficParametersView() : TrafficParametersView
  • clearVehicleProfiles() : AgentConfigurationPresenter
  • color : EnvironmentDisplayView , ScenarioDisplayView , TrafficDisplayView
  • colorMap : StatusBarView
  • columnCount() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , ParameterMapPresenter , ScenarioAgentsPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • Component : SystemConnectionMapInterface
  • ComponentMap : SystemItemInterface
  • componentProfiles : AgentConfigurationModel , VehicleComponentProfileMapModel
  • components : VehicleComponentMapModel , VehicleProfileItemModel
  • ConnectionMap : SystemItemInterface
  • constBegin() : AgentMapInterface , AgentMapModel , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • constEnd() : AgentMapInterface , AgentMapModel , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • ConstIterator : AgentMapInterface , DriverProfileMapInterface , ParameterMapInterface , SensorMapInterface , SensorProfileMapInterface , TrafficItemMapInterface , VehicleComponentMapInterface , VehicleComponentProfileMapInterface , VehicleProfileMapInterface
  • contains() : AgentMapInterface , AgentMapModel , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemConnectionMapInterface , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • copyAgentProfiles() : AgentConfigurationPresenter
  • copyDriverProfiles() : AgentConfigurationPresenter
  • copyEnvironmentConfig() : TrafficSimulationPresenter
  • copyExperimentConfig() : TrafficSimulationPresenter
  • copyScenarioConfig() : TrafficSimulationPresenter
  • copyTrafficConfig() : TrafficSimulationPresenter
  • copyVehicleProfiles() : AgentConfigurationPresenter
  • count() : AgentMapInterface , AgentMapModel , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentParameterMapInterface , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • createAction() : WindowInterface
  • createButton() : WindowInterface
  • createComponentItem() : ComponentInterface
  • createComponentMap() : ComponentInterface
  • createInput() : ComponentInputMapInterface
  • createItem() : EnvironmentInterface , EnvironmentModel
  • createOutput() : ComponentOutputMapInterface
  • createParameter() : ComponentParameterMapInterface
  • createSeparator() : WindowInterface
  • currentAgent : AgentMapPresenter
  • currentDriver : DriverProfilesPresenter
  • currentTabChanged() : TrafficSimulationView
  • currentVehicleProfile : VehicleProfilesPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- d -

  • data() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , LoggingGroupsPresenter , ParameterMapPresenter , ScenarioAgentsPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • default_friction : EnvironmentPresenter
  • default_homogeneity : TrafficPresenter
  • default_key : ParameterItemModel
  • default_platoonRate : TrafficPresenter
  • default_position : SensorItemModel
  • default_probability : AgentMapPresenter , EnvironmentPresenter , TrafficPresenter , VehicleProfilesPresenter
  • default_timeOfDay : EnvironmentPresenter
  • default_type : ParameterItemModel
  • default_unit : ParameterItemModel
  • default_value : ParameterItemModel
  • default_velocity : TrafficPresenter
  • default_visibilityDistance : EnvironmentPresenter
  • default_volume : TrafficPresenter
  • default_weather : EnvironmentPresenter
  • DriverConfig : DriverProfileItemInterface
  • driverConfig : DriverProfileItemModel
  • DriverProfile : AgentItemInterface
  • driverProfiles : AgentConfigurationModel
  • DriverProfiles : AgentItemInterface
  • driverProfiles : AgentMapPresenter , DriverProfileMapModel , DriverProfilesMapPresenter
  • driverProfilesList : AgentMapPresenter
  • driverProfilesMap : AgentMapPresenter
  • driverProfilesPresenter : AgentConfigurationPresenter
  • driverProfilesView : AgentConfigurationView
  • drivers : DriverProfilesPresenter
  • driversView : DriverProfilesPresenter
  • duplicate() : SystemComponentItemInterface
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- e -

  • editAgent() : AgentMapPresenter
  • editDriver() : DriverProfilesPresenter
  • edited() : EnvironmentInterface , EnvironmentItemInterface , TrafficInterface , TrafficItemInterface , TrafficItemMapInterface
  • editedName() : DriverProfilesView
  • editName() : DriverProfilesMapPresenter , VehicleProfilesMapPresenter
  • editVehicleProfileName() : VehicleProfilesPresenter
  • enableConfiguration() : AgentMapView , DriverProfilesView , VehicleProfilesView
  • enableModelView() : AgentMapView , VehicleProfilesView
  • enableSimulation() : ExperimentView
  • enableSystemView() : AgentMapView
  • end() : AgentMapInterface , AgentMapModel , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemComponentParameterMapInterface , SystemConnectionMapInterface , SystemMapInterface , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • entities : ScenarioAgentsPresenter
  • Entities : ScenarioInterface
  • entities : ScenarioModel
  • EntryName : ScenarioInterface
  • environment : EnvironmentDisplayPresenter , EnvironmentMapPresenter , EnvironmentPresenter
  • environmentDisplayPresenter : TrafficSimulationPresenter
  • environmentDisplayView : EnvironmentDisplayPresenter
  • environmentMap : EnvironmentMapPresenter
  • environmentPresenter : TrafficSimulationPresenter
  • environmentView : EnvironmentPresenter , TrafficSimulationView
  • eventFilter() : AgentMapView , DriverProfilesView , EnvironmentView , ExperimentView , ScenarioView , SystemProfileView , TrafficView
  • exists() : WindowInterface
  • experiment : ExperimentPresenter
  • experimentBaseView : TrafficSimulationView
  • experimentPresenter : TrafficSimulationPresenter
  • experimentView : ExperimentBaseView , ExperimentPresenter
  • ExportSetup() : AgentConfigurationView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Enumerations

  • StatusType : EnvironmentDisplayView , ScenarioDisplayView , TrafficDisplayView
  • Type : TrafficItemView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- f -

  • findUnusedDriverProfile() : AgentMapPresenter
  • findUnusedVehicleProfile() : AgentMapPresenter
  • flags() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , LoggingGroupsPresenter , ParameterMapPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • FrictionMap : EnvironmentInterface
  • frictionMap : EnvironmentModel
  • frictionPresenter : EnvironmentPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- a -

  • actionClear() : AgentConfigurationView
  • actionExport() : AgentConfigurationView
  • actionHistory() : AgentConfigurationView , TrafficSimulationView
  • actionLoad() : AgentConfigurationView , TrafficSimulationView
  • actionNew() : TrafficSimulationView
  • actionRedo() : AgentConfigurationView , TrafficSimulationView
  • actionSave() : AgentConfigurationView , TrafficSimulationView
  • actionUndo() : AgentConfigurationView , TrafficSimulationView
  • add() : AgentMapInterface , AgentMapModel , AgentMapView , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentMapInterface , SystemConnectionMapInterface , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel , WindowInterface
  • addAgent() : AgentMapPresenter , AgentMapView
  • addDriver() : DriverProfilesPresenter
  • addDriverProfile() : AgentMapPresenter , AgentMapView , DriverProfilesView
  • addDriverView() : DriverProfilesView
  • added() : AgentMapInterface , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , SystemComponentMapInterface , VehicleProfileMapInterface
  • addFriction() : EnvironmentPresenter , EnvironmentView
  • addHomogeneity() : TrafficParametersPresenter , TrafficParametersView , TrafficPresenter , TrafficView
  • addHomogeneityView() : TrafficParametersView
  • addLibrary() : ExperimentPresenter , ExperimentView
  • addLoggingGroup() : ExperimentPresenter , ExperimentView
  • addPlatoonRate() : TrafficParametersPresenter , TrafficParametersView , TrafficPresenter , TrafficView
  • addPlatoonRateView() : TrafficParametersView
  • addRegularLaneAgent() : TrafficLanesPresenter , TrafficLanesView , TrafficPresenter , TrafficView
  • addRegularLaneAgentView() : TrafficLanesView
  • addRightmostLaneAgent() : TrafficLanesPresenter , TrafficLanesView , TrafficPresenter , TrafficView
  • addRightmostLaneAgentView() : TrafficLanesView
  • addRow() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , ParameterMapPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • addSystem() : SystemProfileView , VehicleProfilesPresenter
  • addSystemProfile() : VehicleProfilesPresenter , VehicleProfilesView
  • addSystemProfileView() : VehicleProfilesView
  • addTimeOfDay() : EnvironmentPresenter , EnvironmentView
  • addVehicleProfile() : AgentMapPresenter , AgentMapView , VehicleProfilesPresenter , VehicleProfilesView
  • addVehicleProfileSelectionItem() : VehicleProfilesView
  • addVelocity() : TrafficParametersPresenter , TrafficParametersView , TrafficPresenter , TrafficView
  • addVelocityView() : TrafficParametersView
  • addVisibilityDistance() : EnvironmentPresenter , EnvironmentView
  • addVolume() : TrafficParametersPresenter , TrafficParametersView , TrafficPresenter , TrafficView
  • addVolumeView() : TrafficParametersView
  • addWeather() : EnvironmentPresenter , EnvironmentView
  • adjustWidgets() : ExperimentBaseView , ScenarioBaseView , TrafficBaseView , TrafficSimulationView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- ~ -

  • ~WidgetView() : WidgetView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- b -

  • begin() : AgentMapInterface , AgentMapModel , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemComponentParameterMapInterface , SystemConnectionMapInterface , SystemMapInterface , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- c -

  • changeModelCatalogue() : VehicleProfilesView
  • changeSystemConfig() : VehicleProfilesView
  • checkAgentProfiles() : TrafficDisplayPresenter
  • checkAgents() : TrafficPresenter
  • checkDriverProbabilities() : AgentMapPresenter
  • checkProbabilities() : DriverProfilesMapPresenter , EnvironmentDisplayPresenter , EnvironmentPresenter , TrafficDisplayPresenter , TrafficPresenter , VehicleProfilesMapPresenter
  • checkStatus() : TrafficSimulationPresenter
  • checkVehicleProbabilities() : AgentMapPresenter
  • clear() : AgentConfigurationPresenter , AgentMapView , ComponentInputItemInterface , ComponentInputMapInterface , ComponentItemInterface , ComponentMapInterface , ComponentOutputItemInterface , ComponentOutputMapInterface , ComponentParameterItemInterface , ComponentParameterMapInterface , ComponentScheduleInterface , ParameterMapInterface , ParameterMapModel , ProjectInterface , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentMapInterface , SystemConnectionMapInterface , SystemInterface , SystemMapInterface , TrafficItemMapInterface , TrafficItemMapModel , TrafficSimulationPresenter , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel
  • clearAgentProfiles() : AgentConfigurationPresenter
  • clearAgentSelectionView() : TrafficLanesPresenter
  • clearDriverProfiles() : AgentConfigurationPresenter
  • cleared() : AgentMapInterface , ComponentInputItemInterface , ComponentInputMapInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentOutputMapInterface , ComponentParameterItemInterface , ComponentParameterMapInterface , ComponentScheduleInterface , ProjectInterface , SystemComponentMapInterface , SystemInterface , TrafficLanesPresenter , TrafficParametersPresenter
  • clearEnvironmentConfig() : TrafficSimulationPresenter
  • clearExperimentConfig() : TrafficSimulationPresenter
  • clearScenarioConfig() : TrafficSimulationPresenter
  • ClearSetup() : AgentConfigurationView
  • clearSystemProfileViews() : VehicleProfilesView
  • clearTrafficConfig() : TrafficSimulationPresenter
  • clearTrafficLanesView() : TrafficLanesView
  • clearTrafficParameters() : TrafficParametersPresenter
  • clearTrafficParametersView() : TrafficParametersView
  • clearVehicleProfiles() : AgentConfigurationPresenter
  • columnCount() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , ParameterMapPresenter , ScenarioAgentsPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • constBegin() : AgentMapInterface , AgentMapModel , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • constEnd() : AgentMapInterface , AgentMapModel , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • contains() : AgentMapInterface , AgentMapModel , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemConnectionMapInterface , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • copyAgentProfiles() : AgentConfigurationPresenter
  • copyDriverProfiles() : AgentConfigurationPresenter
  • copyEnvironmentConfig() : TrafficSimulationPresenter
  • copyExperimentConfig() : TrafficSimulationPresenter
  • copyScenarioConfig() : TrafficSimulationPresenter
  • copyTrafficConfig() : TrafficSimulationPresenter
  • copyVehicleProfiles() : AgentConfigurationPresenter
  • count() : AgentMapInterface , AgentMapModel , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentParameterMapInterface , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • createAction() : WindowInterface
  • createButton() : WindowInterface
  • createComponentItem() : ComponentInterface
  • createComponentMap() : ComponentInterface
  • createInput() : ComponentInputMapInterface
  • createItem() : EnvironmentInterface , EnvironmentModel
  • createOutput() : ComponentOutputMapInterface
  • createParameter() : ComponentParameterMapInterface
  • createSeparator() : WindowInterface
  • currentTabChanged() : TrafficSimulationView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- d -

  • data() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , LoggingGroupsPresenter , ParameterMapPresenter , ScenarioAgentsPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • duplicate() : SystemComponentItemInterface
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- e -

  • editAgent() : AgentMapPresenter
  • editDriver() : DriverProfilesPresenter
  • edited() : EnvironmentInterface , EnvironmentItemInterface , TrafficInterface , TrafficItemInterface , TrafficItemMapInterface
  • editedName() : DriverProfilesView
  • editName() : DriverProfilesMapPresenter , VehicleProfilesMapPresenter
  • editVehicleProfileName() : VehicleProfilesPresenter
  • enableConfiguration() : AgentMapView , DriverProfilesView , VehicleProfilesView
  • enableModelView() : AgentMapView , VehicleProfilesView
  • enableSimulation() : ExperimentView
  • enableSystemView() : AgentMapView
  • end() : AgentMapInterface , AgentMapModel , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemComponentParameterMapInterface , SystemConnectionMapInterface , SystemMapInterface , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • eventFilter() : AgentMapView , DriverProfilesView , EnvironmentView , ExperimentView , ScenarioView , SystemProfileView , TrafficView
  • exists() : WindowInterface
  • ExportSetup() : AgentConfigurationView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- f -

  • findUnusedDriverProfile() : AgentMapPresenter
  • findUnusedVehicleProfile() : AgentMapPresenter
  • flags() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , LoggingGroupsPresenter , ParameterMapPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- g -

  • generateID() : ComponentInputMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , TrafficItemMapInterface , TrafficItemMapModel
  • generateName() : SensorProfileMapInterface , SensorProfileMapModel
  • getAgents() : AgentConfigurationInterface , AgentConfigurationModel
  • getAgentsRegularLane() : TrafficInterface , TrafficModel
  • getAgentsRightMostLane() : TrafficInterface , TrafficModel
  • getAgentsView() : AgentConfigurationView
  • getCardinality() : ComponentInputItemInterface , SystemComponentInputItemInterface
  • getCompatibleSources() : SystemItemInterface
  • getCompatibleTargets() : SystemItemInterface
  • getComponent() : SystemComponentInputItemInterface , SystemComponentOutputItemInterface
  • getComponents() : SystemInterface , SystemItemInterface
  • getConfig() : DriverProfileItemInterface , DriverProfileItemModel
  • getConnections() : SystemItemInterface
  • getCycle() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • getDriverProfiles() : AgentConfigurationInterface , AgentConfigurationModel , AgentItemInterface
  • getDriverProfilesView() : AgentConfigurationView , AgentMapView
  • getEntities() : ScenarioInterface , ScenarioModel
  • getEnvironment() : TrafficSimulationInterface , TrafficSimulationModel
  • getEnvironmentDisplayView() : ExperimentBaseView , TrafficSimulationView
  • getEnvironmentView() : TrafficSimulationView
  • getExperiment() : TrafficSimulationInterface , TrafficSimulationModel
  • getExperimentView() : ExperimentBaseView , TrafficSimulationView
  • getFrictionMap() : EnvironmentInterface , EnvironmentModel
  • getFrictionView() : EnvironmentView
  • getHomogeneities() : TrafficInterface , TrafficModel
  • getHomogeneitiesView() : TrafficView
  • getID() : ComponentInputItemInterface , ComponentInputMapInterface , ComponentOutputItemInterface , ComponentOutputMapInterface , ComponentParameterItemInterface , ComponentParameterMapInterface , ExperimentInterface , ExperimentModel , ParameterItemInterface , ParameterItemModel , ParameterMapInterface , ParameterMapModel , SensorItemInterface , SensorItemModel , SensorMapInterface , SensorMapModel , SensorProfileItemInterface , SensorProfileItemModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentInputItemInterface , SystemComponentItemInterface , SystemComponentMapInterface , SystemComponentOutputItemInterface , SystemComponentOutputMapInterface , SystemComponentParameterItemInterface , SystemComponentParameterMapInterface , SystemConnectionItemInterface , SystemConnectionMapInterface , SystemItemInterface , SystemMapInterface , TrafficItemMapInterface , TrafficItemMapModel , TrafficItemView , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel
  • getIndex() : ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , TrafficItemView
  • getInputs() : ComponentItemInterface , SystemComponentItemInterface
  • getItem() : AgentMapInterface , AgentMapModel , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemComponentParameterMapInterface , SystemConnectionMapInterface , SystemMapInterface , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • getKey() : ParameterItemInterface , ParameterItemModel
  • getLibraries() : ExperimentInterface , ExperimentModel
  • getLibrariesView() : ExperimentView
  • getLibrary() : ProjectInterface , SystemComponentItemInterface
  • getLibraryPath() : ProjectInterface
  • getLoggingGroups() : ExperimentInterface , ExperimentModel
  • getLoggingGroupsView() : ExperimentView
  • getLogLevel() : ProjectInterface
  • getLogMaster() : ProjectInterface
  • getLogSlave() : ProjectInterface
  • getModel() : VehicleProfileItemInterface , VehicleProfileItemModel
  • getModelCatalogue() : VehicleProfileItemInterface , VehicleProfileItemModel
  • getName() : AgentItemInterface , AgentMapInterface , AgentMapModel , ComponentItemInterface , ComponentMapInterface , DriverProfileItemInterface , DriverProfileItemModel , DriverProfileMapInterface , DriverProfileMapModel , EnvironmentInterface , EnvironmentModel , ScenarioInterface , ScenarioModel , SensorProfileItemInterface , SensorProfileItemModel , TrafficInterface , TrafficModel , VehicleComponentProfileItemInterface , VehicleComponentProfileItemModel , VehicleProfileItemInterface , VehicleProfileItemModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • getNumberInvocations() : ExperimentInterface , ExperimentModel
  • getOffset() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • getOutputs() : ComponentItemInterface , SystemComponentItemInterface
  • getParameters() : ComponentItemInterface , DriverProfileItemInterface , DriverProfileItemModel , SensorProfileItemInterface , SensorProfileItemModel , SystemComponentItemInterface , VehicleComponentProfileItemInterface , VehicleComponentProfileItemModel
  • getParameterView() : DriverProfilesView
  • getPlatoonRates() : TrafficInterface , TrafficModel
  • getPlatoonRatesView() : TrafficView
  • getPosition() : SystemComponentItemInterface
  • getPriority() : SystemComponentScheduleInterface , SystemItemInterface
  • getProbability() : EnvironmentItemInterface , EnvironmentItemModel , TrafficItemInterface , TrafficItemModel , TrafficItemView
  • getProfiles() : VehicleComponentItemInterface , VehicleComponentItemModel
  • getProfilesCatalogue() : TrafficSimulationInterface , TrafficSimulationModel
  • getProjectStatus() : ProjectInterface
  • getRegularLaneAgentsView() : TrafficView
  • getResponse() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • getResultPath() : ProjectInterface
  • getRightmostLaneAgentsView() : TrafficView
  • getScenario() : TrafficSimulationInterface , TrafficSimulationModel
  • getScenarioAgentsView() : ScenarioView
  • getScenarioDisplayView() : ExperimentBaseView , TrafficSimulationView
  • getScenarioFile() : ScenarioInterface , ScenarioModel
  • getScenarioView() : ScenarioBaseView , TrafficSimulationView
  • getSchedule() : ComponentItemInterface , SystemComponentItemInterface
  • getSeed() : ExperimentInterface , ExperimentModel
  • getSensorLinks() : VehicleComponentItemInterface , VehicleComponentItemModel
  • getSensorPosition() : SensorItemInterface , SensorItemModel
  • getSensorProfile() : SensorItemInterface , SensorItemModel
  • getSensorProfiles() : AgentConfigurationInterface , AgentConfigurationModel
  • getSensors() : VehicleProfileItemInterface , VehicleProfileItemModel
  • getSlaveExe() : ProjectInterface
  • getSource() : SystemConnectionItemInterface
  • getStatus() : EnvironmentInterface , EnvironmentModel , ScenarioInterface , ScenarioModel , TrafficInterface , TrafficModel
  • getSystem() : AgentItemInterface
  • getSystemConfig() : AgentItemInterface , VehicleProfileItemInterface , VehicleProfileItemModel
  • getSystemID() : AgentItemInterface
  • getSystemProfiles() : VehicleProfileItemInterface , VehicleProfileItemModel
  • getSystems() : SystemInterface , VehicleProfileItemInterface , VehicleProfileItemModel
  • getSystemTitle() : AgentItemInterface
  • getSystemView() : SystemProfileView
  • getTarget() : SystemConnectionItemInterface
  • getTimeOfDayMap() : EnvironmentInterface , EnvironmentModel
  • getTimeOfDayView() : EnvironmentView
  • getTitle() : ComponentInputItemInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , SystemComponentInputItemInterface , SystemComponentItemInterface , SystemComponentOutputItemInterface , SystemComponentParameterItemInterface , SystemItemInterface
  • getTraffic() : TrafficSimulationInterface , TrafficSimulationModel
  • getTrafficDisplayView() : ExperimentBaseView , TrafficSimulationView
  • getTrafficLanesView() : TrafficBaseView
  • getTrafficParametersView() : TrafficBaseView
  • getTrafficView() : TrafficBaseView , TrafficSimulationView
  • getType() : AgentItemInterface , ComponentInputItemInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , ParameterItemInterface , ParameterItemModel , SensorProfileItemInterface , SensorProfileItemModel , SystemComponentInputItemInterface , SystemComponentItemInterface , SystemComponentOutputItemInterface , SystemComponentParameterItemInterface , TrafficItemView , VehicleComponentItemInterface , VehicleComponentItemModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileItemInterface , VehicleComponentProfileItemModel
  • getUndoView() : AgentConfigurationView , TrafficSimulationView
  • getUnit() : ComponentInputItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , ParameterItemInterface , ParameterItemModel , SystemComponentInputItemInterface , SystemComponentOutputItemInterface , SystemComponentParameterItemInterface
  • getValue() : ComponentParameterItemInterface , EnvironmentItemInterface , EnvironmentItemModel , ParameterItemInterface , ParameterItemModel , SystemComponentParameterItemInterface , TrafficItemInterface , TrafficItemModel , TrafficItemView
  • getVehicleComponentProfiles() : AgentConfigurationInterface , AgentConfigurationModel
  • getVehicleComponents() : VehicleProfileItemInterface , VehicleProfileItemModel
  • getVehicleModel() : AgentItemInterface
  • getVehicleModelCatalogue() : AgentItemInterface
  • getVehicleProfiles() : AgentConfigurationInterface , AgentConfigurationModel , AgentItemInterface
  • getVehicleProfilesView() : AgentConfigurationView , AgentMapView
  • getVelocities() : TrafficInterface , TrafficModel
  • getVelocitiesView() : TrafficView
  • getVisibilityDistanceMap() : EnvironmentInterface , EnvironmentModel
  • getVisibilityDistanceView() : EnvironmentView
  • getVolumes() : TrafficInterface , TrafficModel
  • getVolumesView() : TrafficView
  • getWeatherMap() : EnvironmentInterface , EnvironmentModel
  • getWeatherView() : EnvironmentView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- h -

  • headerData() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , ParameterMapPresenter , ScenarioAgentsPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • hide() : StatusBarView
  • hideStatusBar() : TrafficSimulationView
  • homogeneity_added() : TrafficParametersPresenter
  • homogeneity_probabilityChanged() : TrafficParametersPresenter
  • homogeneity_removed() : TrafficParametersPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- i -

  • insertRow() : LoggingGroupsPresenter
  • Invocations_valueChanged() : ExperimentView
  • isCompatible() : SystemConnectionItemInterface
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- k -

  • keys() : AgentMapInterface , AgentMapModel , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- l -

  • listTitlesByType() : SystemComponentManagerInterface
  • load() : AgentConfigurationPresenter , ComponentItemInterface , ProjectInterface , SystemInterface , TrafficSimulationPresenter , TrafficSimulationXMLLoadModel
  • loaded() : ComponentItemInterface , ProjectInterface , SystemInterface
  • loadEnvironment() : TrafficSimulationXMLLoadModel
  • loadExperiment() : TrafficSimulationXMLLoadModel
  • loadFrictionMap() : TrafficSimulationXMLLoadModel
  • loadFromDirectory() : SystemComponentManagerInterface
  • loadLibraries() : TrafficSimulationXMLLoadModel
  • loadLoggingGroups() : TrafficSimulationXMLLoadModel
  • loadModelCatalogue() : VehicleProfilesPresenter
  • loadScenarioConfig() : TrafficSimulationXMLLoadModel
  • LoadSetup() : AgentConfigurationView , TrafficSimulationView
  • loadTimeOfDayMap() : TrafficSimulationXMLLoadModel
  • loadTraffic() : TrafficSimulationXMLLoadModel
  • loadTrafficAgents() : TrafficSimulationXMLLoadModel
  • loadTrafficHomogeneities() : TrafficSimulationXMLLoadModel
  • loadTrafficParameters() : TrafficSimulationXMLLoadModel
  • loadTrafficPlatoonRates() : TrafficSimulationXMLLoadModel
  • loadTrafficVelocities() : TrafficSimulationXMLLoadModel
  • loadTrafficVolumes() : TrafficSimulationXMLLoadModel
  • loadVisibilityDistanceMap() : TrafficSimulationXMLLoadModel
  • loadWeatherMap() : TrafficSimulationXMLLoadModel
  • lookupItemByName() : SystemComponentManagerInterface
  • lookupItemByTitle() : SystemComponentManagerInterface
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- m -

  • mode() : SystemComponentMapInterface , SystemConnectionMapInterface
  • modified() : SystemConnectionMapInterface
  • modifiedCardinality() : ComponentInputItemInterface
  • modifiedCycle() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • modifiedID() : ComponentInputMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface
  • modifiedModel() : VehicleProfilesView
  • modifiedName() : AgentMapInterface , AgentMapView , ComponentItemInterface , ComponentMapInterface , DriverProfileMapInterface , EnvironmentInterface , EnvironmentView , ScenarioInterface , ScenarioView , TrafficInterface , TrafficView , VehicleProfileMapInterface , VehicleProfilesView
  • modifiedOffset() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • modifiedPosition() : SystemComponentItemInterface
  • modifiedPriority() : SystemComponentScheduleInterface , SystemItemInterface
  • modifiedResponse() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • modifiedScenarioFile() : ScenarioInterface , ScenarioView
  • modifiedStatus() : EnvironmentInterface , ScenarioInterface , TrafficInterface
  • modifiedTitle() : ComponentInputItemInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , SystemComponentItemInterface , SystemItemInterface
  • modifiedType() : ComponentInputItemInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface
  • modifiedUnit() : ComponentInputItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface
  • modifiedValue() : ComponentParameterItemInterface , SystemComponentParameterItemInterface
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- n -

  • NewSetup() : TrafficSimulationView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- o -

  • on_add_clicked() : AgentMapView , DriverProfilesView , VehicleProfilesView
  • on_add_Friction_clicked() : EnvironmentView
  • on_add_TimeOfDay_clicked() : EnvironmentView
  • on_add_VisibilityDistance_clicked() : EnvironmentView
  • on_add_Weather_clicked() : EnvironmentView
  • on_addDriver_clicked() : AgentMapView
  • on_addHomogeneity_clicked() : TrafficParametersView , TrafficView
  • on_addPlatoonRate_clicked() : TrafficParametersView , TrafficView
  • on_addRegularLaneAgent_clicked() : TrafficLanesView , TrafficView
  • on_addRightmostLaneAgent_clicked() : TrafficLanesView , TrafficView
  • on_addSystem_clicked() : SystemProfileView
  • on_addSystemProfile_clicked() : VehicleProfilesView
  • on_addVehicle_clicked() : AgentMapView
  • on_addVelocity_clicked() : TrafficParametersView , TrafficView
  • on_addVolume_clicked() : TrafficParametersView , TrafficView
  • on_AgentProfileSelection_activated() : AgentMapView
  • on_Browse_clicked() : DriverProfilesView
  • on_button_clicked() : StatusBarView
  • on_CatalogueBrowse_clicked() : TrafficSimulationView
  • on_CatalogueRefresh_clicked() : TrafficSimulationView
  • on_edit_clicked() : AgentMapView , DriverProfilesView , VehicleProfilesView
  • on_InvocationsValue_editingFinished() : ExperimentView
  • on_Library_add_clicked() : ExperimentView
  • on_Library_remove_clicked() : ExperimentView
  • on_LoggingGroup_add_clicked() : ExperimentView
  • on_LoggingGroup_remove_clicked() : ExperimentView
  • on_Model_activated() : AgentMapView , VehicleProfilesView
  • on_modelCatalogue_Browse_clicked() : VehicleProfilesView
  • on_modelCatalogue_Refresh_clicked() : VehicleProfilesView
  • on_ModelCatalogueBrowse_clicked() : AgentMapView
  • on_ModelCatalogueRefresh_clicked() : AgentMapView
  • on_Name_activated() : DriverProfilesView , VehicleProfilesView
  • on_Name_editingFinished() : EnvironmentView
  • on_NameEdit_editingFinished() : ScenarioView , TrafficView
  • on_probabilityValue_editingFinished() : TrafficItemView
  • on_remove_clicked() : AgentMapView , DriverProfilesView , TrafficItemView , VehicleProfilesView
  • on_remove_Friction_clicked() : EnvironmentView
  • on_remove_TimeOfDay_clicked() : EnvironmentView
  • on_remove_VisibilityDistance_clicked() : EnvironmentView
  • on_remove_Weather_clicked() : EnvironmentView
  • on_removeDriver_clicked() : AgentMapView
  • on_removeHomogeneity_clicked() : TrafficView
  • on_removePlatoonRate_clicked() : TrafficView
  • on_removeRegularLaneAgent_clicked() : TrafficView
  • on_removeRightmostLaneAgent_clicked() : TrafficView
  • on_removeSystem_clicked() : SystemProfileView
  • on_removeSystemProfile_clicked() : VehicleProfilesView
  • on_removeVehicle_clicked() : AgentMapView
  • on_removeVelocity_clicked() : TrafficView
  • on_removeVolume_clicked() : TrafficView
  • on_ScenarioFileBrowse_clicked() : ScenarioView
  • on_ScenarioFileRefresh_clicked() : ScenarioView
  • on_SeedValue_editingFinished() : ExperimentView
  • on_StartSimulation_clicked() : ExperimentView
  • on_system_activated() : AgentMapView
  • on_systemConfigBrowse_clicked() : AgentMapView , VehicleProfilesView
  • on_systemConfigRefresh_clicked() : AgentMapView , VehicleProfilesView
  • on_tabWidget_currentChanged() : TrafficSimulationView
  • on_Type_activated() : AgentMapView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- p -

  • paintEvent() : ExperimentBaseView , TrafficBaseView , WidgetView
  • platoonRate_added() : TrafficParametersPresenter
  • platoonRate_probabilityChanged() : TrafficParametersPresenter
  • platoonRate_removed() : TrafficParametersPresenter
  • probabilityChanged() : TrafficItemView , TrafficParametersView
  • profileCatalogueChanged() : TrafficSimulationView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- r -

  • Redo() : AgentConfigurationView , TrafficSimulationView
  • refreshCatalogue() : TrafficSimulationView
  • refreshModelCatalogue() : AgentMapPresenter , AgentMapView , VehicleProfilesPresenter , VehicleProfilesView
  • refreshScenarioFile() : ScenarioPresenter , ScenarioView
  • refreshSystemConfig() : AgentMapPresenter , AgentMapView , VehicleProfilesPresenter , VehicleProfilesView
  • RegularLaneAgent_added() : TrafficLanesPresenter
  • RegularLaneAgent_probabilityChanged() : TrafficLanesPresenter , TrafficLanesView
  • RegularLaneAgent_removed() : TrafficLanesPresenter
  • remove() : AgentMapInterface , AgentMapModel , AgentMapView , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , DriverProfilesMapPresenter , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentItemInterface , SystemComponentMapInterface , SystemConnectionMapInterface , TrafficItemMapInterface , TrafficItemMapModel , TrafficItemView , TrafficParametersView , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel , VehicleProfilesMapPresenter , WindowInterface
  • removeAgent() : AgentMapPresenter , AgentMapView
  • removed() : AgentMapInterface , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , SystemComponentMapInterface , VehicleProfileMapInterface
  • removeDriver() : DriverProfilesPresenter
  • removeDriverProfile() : AgentMapPresenter , AgentMapView , DriverProfilesView
  • removeDriverView() : DriverProfilesView
  • removeFriction() : EnvironmentPresenter , EnvironmentView
  • removeHomogeneity() : TrafficPresenter , TrafficView
  • removeLibrary() : ExperimentPresenter , ExperimentView
  • removeLoggingGroup() : ExperimentPresenter , ExperimentView
  • removePlatoonRate() : TrafficPresenter , TrafficView
  • removeRegularLaneAgent() : TrafficLanesPresenter , TrafficLanesView , TrafficPresenter , TrafficView
  • removeRegularLaneAgentByName() : TrafficLanesPresenter
  • removeRegularLaneAgentView() : TrafficLanesView
  • removeRightmostLaneAgent() : TrafficLanesPresenter , TrafficLanesView , TrafficPresenter , TrafficView
  • removeRightmostLaneAgentByName() : TrafficLanesPresenter
  • removeRightmostLaneAgentView() : TrafficLanesView
  • removeRow() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , LoggingGroupsPresenter , ParameterMapPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • removeSystem() : SystemProfileView , VehicleProfilesPresenter
  • removeSystemProfile() : VehicleProfilesPresenter , VehicleProfilesView
  • removeSystemProfileView() : VehicleProfilesView
  • removeTimeOfDay() : EnvironmentPresenter , EnvironmentView
  • removeTrafficItem() : TrafficParametersPresenter
  • removeTrafficItemView() : TrafficParametersView
  • removeVehicleProfile() : AgentMapPresenter , AgentMapView , VehicleProfilesPresenter , VehicleProfilesView
  • removeVehicleProfileSelectionItem() : VehicleProfilesView
  • removeVelocity() : TrafficPresenter , TrafficView
  • removeVisibilityDistance() : EnvironmentPresenter , EnvironmentView
  • removeVolume() : TrafficPresenter , TrafficView
  • removeWeather() : EnvironmentPresenter , EnvironmentView
  • reset() : EnvironmentInterface , EnvironmentModel
  • resized() : ExperimentView , TrafficLanesView , TrafficParametersView
  • resizeEvent() : ExperimentView , TrafficLanesView , TrafficParametersView , TrafficSimulationView
  • RightmostLaneAgent_added() : TrafficLanesPresenter
  • RightmostLaneAgent_probabilityChanged() : TrafficLanesPresenter , TrafficLanesView
  • RightmostLaneAgent_removed() : TrafficLanesPresenter
  • rowCount() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , LoggingGroupsPresenter , ParameterMapPresenter , ScenarioAgentsPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- s -

  • save() : AgentConfigurationPresenter , ComponentItemInterface , ProjectInterface , SystemInterface , TrafficSimulationPresenter , TrafficSimulationXMLSaveModel
  • saved() : ComponentItemInterface , ProjectInterface , SystemInterface
  • saveEnvironment() : TrafficSimulationXMLSaveModel
  • saveExperiment() : TrafficSimulationXMLSaveModel
  • saveFrictionMap() : TrafficSimulationXMLSaveModel
  • saveLibraries() : TrafficSimulationXMLSaveModel
  • saveLoggingGroups() : TrafficSimulationXMLSaveModel
  • saveScenario() : TrafficSimulationXMLSaveModel
  • SaveSetup() : AgentConfigurationView , TrafficSimulationView
  • saveTimeOfDayMap() : TrafficSimulationXMLSaveModel
  • saveTraffic() : TrafficSimulationXMLSaveModel
  • saveTrafficHomogeneities() : TrafficSimulationXMLSaveModel
  • saveTrafficParameters() : TrafficSimulationXMLSaveModel
  • saveTrafficPlatoonRates() : TrafficSimulationXMLSaveModel
  • saveTrafficRegularLane() : TrafficSimulationXMLSaveModel
  • saveTrafficRightmostLane() : TrafficSimulationXMLSaveModel
  • saveTrafficVelocities() : TrafficSimulationXMLSaveModel
  • saveTrafficVolumes() : TrafficSimulationXMLSaveModel
  • saveVisibilityDistanceMap() : TrafficSimulationXMLSaveModel
  • saveWeatherMap() : TrafficSimulationXMLSaveModel
  • Seed_valueChanged() : ExperimentView
  • selectedDriverConfig() : DriverProfilesView
  • selectedSystem() : AgentMapView
  • selectedVehicleProfile() : VehicleProfilesView
  • selectionChanged() : AgentMapView , DriverProfilesView
  • setAgentProfilesError() : TrafficView
  • setAgentSelectionItems() : AgentMapView , TrafficLanesView
  • setCardinality() : ComponentInputItemInterface
  • setConfig() : DriverProfileItemInterface , DriverProfileItemModel
  • setConfigView() : DriverProfilesView
  • setCurrentAgent() : AgentMapPresenter , AgentMapView
  • setCurrentDriver() : DriverProfilesPresenter , DriverProfilesView
  • setCurrentModel() : AgentMapView
  • setCurrentModelCatalogue() : AgentMapView
  • setCurrentSystem() : AgentMapView
  • setCurrentSystemConfig() : AgentMapView
  • setCurrentType() : AgentMapView
  • setCurrentVehicle() : VehicleProfilesView
  • setCurrentVehicleProfile() : VehicleProfilesPresenter
  • setCycle() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • setData() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , LoggingGroupsPresenter , ParameterMapPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • setDriverConfig() : DriverProfilesPresenter
  • setDriverProbabilityError() : AgentMapView
  • setDriverProfiles() : DriverProfilesMapPresenter
  • setDriverSelectionItems() : DriverProfilesView
  • setEntities() : ScenarioInterface
  • setEnvironmentName() : EnvironmentDisplayView
  • setEnvironmentNameView() : EnvironmentDisplayPresenter
  • setFriction() : EnvironmentDisplayView
  • setFriction_ProbabilityError() : EnvironmentView
  • setFrictionView() : EnvironmentDisplayPresenter
  • setHomogeneities() : TrafficDisplayView
  • setHomogeneities_ProbabilityError() : TrafficView
  • setHomogeneitiesView() : TrafficDisplayPresenter
  • setID() : ComponentInputItemInterface , ComponentInputMapInterface , ComponentOutputItemInterface , ComponentOutputMapInterface , ComponentParameterItemInterface , ComponentParameterMapInterface , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel
  • setIndex() : TrafficItemView
  • setInvocationsValue() : ExperimentView
  • setKey() : ParameterItemInterface , ParameterItemModel
  • setLibraryPath() : ProjectInterface
  • setLogLevel() : ProjectInterface
  • setLogMaster() : ProjectInterface
  • setLogSlave() : ProjectInterface
  • setModel() : AgentMapPresenter , AgentMapView , VehicleProfileItemInterface , VehicleProfileItemModel , VehicleProfilesPresenter , VehicleProfilesView
  • setModelCatalogue() : AgentMapPresenter , AgentMapView , VehicleProfileItemInterface , VehicleProfileItemModel , VehicleProfilesPresenter , VehicleProfilesView
  • setModelCatalogueError() : AgentMapView , VehicleProfilesView
  • setModelItems() : AgentMapPresenter
  • setModelSelectionItems() : AgentMapView , VehicleProfilesView
  • setName() : AgentMapInterface , AgentMapModel , ComponentMapInterface , DriverProfileMapInterface , DriverProfileMapModel , EnvironmentInterface , EnvironmentModel , EnvironmentPresenter , EnvironmentView , ScenarioInterface , ScenarioModel , ScenarioPresenter , ScenarioView , TrafficInterface , TrafficModel , TrafficPresenter , TrafficView , VehicleProfileMapInterface , VehicleProfileMapModel
  • setNumberInvocations() : ExperimentInterface , ExperimentModel , ExperimentPresenter
  • setOffset() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • setParameterDelegates() : DriverProfilesPresenter
  • setParameters() : ParameterMapPresenter
  • setPlatoonRates() : TrafficDisplayView
  • setPlatoonRates_ProbabilityError() : TrafficView
  • setPlatoonRatesView() : TrafficDisplayPresenter
  • setPosition() : SystemComponentItemInterface
  • setPriority() : SystemComponentScheduleInterface , SystemItemInterface
  • setProbability() : EnvironmentItemInterface , EnvironmentItemModel , TrafficItemInterface , TrafficItemModel , TrafficItemView , TrafficParametersPresenter , TrafficParametersView
  • setProfileCatalogue() : TrafficSimulationPresenter
  • setProfileCatalogueError() : TrafficSimulationView
  • setProfileCatalogueView() : TrafficSimulationView
  • setProfilesCatalogue() : TrafficSimulationInterface , TrafficSimulationModel
  • setRegularLane_ProbabilityError() : TrafficView
  • setRegularLaneAgentProbability() : TrafficLanesPresenter , TrafficLanesView
  • setRegularLaneAgents() : TrafficDisplayView
  • setRegularLaneView() : TrafficDisplayPresenter
  • setResponse() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • setResultPath() : ProjectInterface
  • setRightmostLane_ProbabilityError() : TrafficView
  • setRightmostLaneAgentProbability() : TrafficLanesPresenter , TrafficLanesView
  • setRightmostLaneAgents() : TrafficDisplayView
  • setRightmostLaneView() : TrafficDisplayPresenter
  • setScenarioAgents() : ScenarioDisplayView
  • setScenarioAgentsList() : ScenarioPresenter
  • setScenarioAgentsView() : ScenarioDisplayPresenter
  • setScenarioFile() : ScenarioDisplayView , ScenarioInterface , ScenarioModel , ScenarioPresenter , ScenarioView
  • setScenarioFileError() : ScenarioView
  • setScenarioFileView() : ScenarioDisplayPresenter
  • setScenarioName() : ScenarioDisplayView
  • setScenarioNameView() : ScenarioDisplayPresenter
  • setSeed() : ExperimentInterface , ExperimentModel , ExperimentPresenter
  • setSeedValue() : ExperimentView
  • setSelectionItems() : SystemProfileView
  • setSensorPosition() : SensorItemInterface , SensorItemModel
  • setSensorProfile() : SensorItemInterface , SensorItemModel
  • setSlaveExe() : ProjectInterface
  • setStatus() : EnvironmentDisplayPresenter , EnvironmentDisplayView , EnvironmentInterface , EnvironmentModel , ScenarioDisplayPresenter , ScenarioDisplayView , ScenarioInterface , ScenarioModel , TrafficDisplayPresenter , TrafficDisplayView , TrafficInterface , TrafficModel
  • setSystem() : AgentMapPresenter
  • setSystemConfig() : AgentItemInterface , AgentMapPresenter , AgentMapView , VehicleProfileItemInterface , VehicleProfileItemModel , VehicleProfilesPresenter , VehicleProfilesView
  • setSystemConfigError() : AgentMapView , VehicleProfilesView
  • setSystemID() : AgentItemInterface
  • setSystemItems() : AgentMapPresenter
  • setSystemProfileSelection() : VehicleProfilesView
  • setSystemProfilesError() : VehicleProfilesView
  • setSystems() : SystemProfilePresenter
  • setSystemSelectionItems() : AgentMapView
  • setSystemTitle() : AgentItemInterface
  • setTimeOfDay() : EnvironmentDisplayView
  • setTimeOfDay_ProbabilityError() : EnvironmentView
  • setTimeOfDayView() : EnvironmentDisplayPresenter
  • setTitle() : ComponentInputItemInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , SystemComponentItemInterface , SystemItemInterface
  • setTrafficName() : TrafficDisplayView
  • setTrafficNameView() : TrafficDisplayPresenter
  • setType() : AgentItemInterface , AgentMapPresenter , ComponentInputItemInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , ParameterItemInterface , ParameterItemModel , VehicleComponentMapInterface , VehicleComponentMapModel
  • setUnit() : ComponentInputItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , ParameterItemInterface , ParameterItemModel
  • setupDriverProfilesMap() : AgentMapPresenter
  • SetupFriction() : EnvironmentPresenter
  • setupHomogeneities() : TrafficPresenter
  • setupLibraries() : ExperimentPresenter
  • setupLoggingGroups() : ExperimentPresenter
  • setupPlatoonRates() : TrafficPresenter
  • setupRegularLaneAgents() : TrafficPresenter
  • setupRightmostLaneAgents() : TrafficPresenter
  • SetupTimeOfDay() : EnvironmentPresenter
  • setupVehicleProfilesMap() : AgentMapPresenter
  • setupVelocities() : TrafficPresenter
  • SetupVisibilityDistance() : EnvironmentPresenter
  • setupVolumes() : TrafficPresenter
  • SetupWeather() : EnvironmentPresenter
  • setValue() : ComponentParameterItemInterface , EnvironmentItemInterface , EnvironmentItemModel , ParameterItemInterface , ParameterItemModel , SystemComponentParameterItemInterface , TrafficItemInterface , TrafficItemModel , TrafficItemView , TrafficParametersPresenter , TrafficParametersView
  • setVehicleModel() : AgentItemInterface
  • setVehicleModelCatalogue() : AgentItemInterface
  • setVehicleProbabilityError() : AgentMapView
  • setVehicleProfiles() : VehicleProfilesMapPresenter
  • setVehicleProfileSelectionItems() : VehicleProfilesView
  • setVelocities() : TrafficDisplayView
  • setVelocities_ProbabilityError() : TrafficView
  • setVelocitiesView() : TrafficDisplayPresenter
  • setVisibilityDistance() : EnvironmentDisplayView
  • setVisibilityDistance_ProbabilityError() : EnvironmentView
  • setVisibilityDistanceView() : EnvironmentDisplayPresenter
  • setVolumes() : TrafficDisplayView
  • setVolumes_ProbabilityError() : TrafficView
  • setVolumesView() : TrafficDisplayPresenter
  • setWeather() : EnvironmentDisplayView
  • setWeather_ProbabilityError() : EnvironmentView
  • setWeatherView() : EnvironmentDisplayPresenter
  • show() : StatusBarView
  • showStatusBarText() : TrafficSimulationView
  • showText() : StatusBarView
  • simulationFinished() : TrafficSimulationPresenter
  • startSimulation() : ExperimentPresenter , ExperimentView , TrafficSimulationPresenter
  • systemsConsistent() : VehicleProfilesPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- t -

  • TrafficSimulationView() : TrafficSimulationView
  • typeChanged() : AgentMapView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- u -

  • Undo() : AgentConfigurationView , TrafficSimulationView
  • update() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , LoggingGroupsPresenter , ParameterMapPresenter , ProjectInterface , ScenarioAgentsPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • updateAgentSelectionItems() : AgentMapPresenter
  • updateCatalogueView() : TrafficSimulationPresenter
  • updateDriverSelectionItems() : AgentMapPresenter , DriverProfilesPresenter
  • updateSize() : ExperimentBaseView , ScenarioBaseView , TrafficBaseView
  • updateStatusBar() : TrafficSimulationPresenter
  • updateSystemList() : VehicleProfilesPresenter
  • updateSystemsView() : VehicleProfilesPresenter
  • updateVehicleSelectionItems() : AgentMapPresenter , VehicleProfilesPresenter
  • updateView() : AgentMapPresenter , DriverProfilesPresenter , EnvironmentDisplayPresenter , EnvironmentPresenter , ExperimentPresenter , ScenarioDisplayPresenter , ScenarioPresenter , TrafficDisplayPresenter , TrafficLanesPresenter , TrafficParametersPresenter , TrafficPresenter , VehicleProfilesPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- v -

  • valueChanged() : TrafficItemView , TrafficParametersView
  • values() : AgentMapInterface , AgentMapModel , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • valueView_valueChanged() : TrafficItemView
  • velocity_added() : TrafficParametersPresenter
  • velocity_probabilityChanged() : TrafficParametersPresenter
  • velocity_removed() : TrafficParametersPresenter
  • volume_added() : TrafficParametersPresenter
  • volume_probabilityChanged() : TrafficParametersPresenter
  • volume_removed() : TrafficParametersPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Functions

- w -

  • WidgetView() : WidgetView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- g -

  • generateID() : ComponentInputMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , TrafficItemMapInterface , TrafficItemMapModel
  • generateName() : SensorProfileMapInterface , SensorProfileMapModel
  • getAgents() : AgentConfigurationInterface , AgentConfigurationModel
  • getAgentsRegularLane() : TrafficInterface , TrafficModel
  • getAgentsRightMostLane() : TrafficInterface , TrafficModel
  • getAgentsView() : AgentConfigurationView
  • getCardinality() : ComponentInputItemInterface , SystemComponentInputItemInterface
  • getCompatibleSources() : SystemItemInterface
  • getCompatibleTargets() : SystemItemInterface
  • getComponent() : SystemComponentInputItemInterface , SystemComponentOutputItemInterface
  • getComponents() : SystemInterface , SystemItemInterface
  • getConfig() : DriverProfileItemInterface , DriverProfileItemModel
  • getConnections() : SystemItemInterface
  • getCycle() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • getDriverProfiles() : AgentConfigurationInterface , AgentConfigurationModel , AgentItemInterface
  • getDriverProfilesView() : AgentConfigurationView , AgentMapView
  • getEntities() : ScenarioInterface , ScenarioModel
  • getEnvironment() : TrafficSimulationInterface , TrafficSimulationModel
  • getEnvironmentDisplayView() : ExperimentBaseView , TrafficSimulationView
  • getEnvironmentView() : TrafficSimulationView
  • getExperiment() : TrafficSimulationInterface , TrafficSimulationModel
  • getExperimentView() : ExperimentBaseView , TrafficSimulationView
  • getFrictionMap() : EnvironmentInterface , EnvironmentModel
  • getFrictionView() : EnvironmentView
  • getHomogeneities() : TrafficInterface , TrafficModel
  • getHomogeneitiesView() : TrafficView
  • getID() : ComponentInputItemInterface , ComponentInputMapInterface , ComponentOutputItemInterface , ComponentOutputMapInterface , ComponentParameterItemInterface , ComponentParameterMapInterface , ExperimentInterface , ExperimentModel , ParameterItemInterface , ParameterItemModel , ParameterMapInterface , ParameterMapModel , SensorItemInterface , SensorItemModel , SensorMapInterface , SensorMapModel , SensorProfileItemInterface , SensorProfileItemModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentInputItemInterface , SystemComponentItemInterface , SystemComponentMapInterface , SystemComponentOutputItemInterface , SystemComponentOutputMapInterface , SystemComponentParameterItemInterface , SystemComponentParameterMapInterface , SystemConnectionItemInterface , SystemConnectionMapInterface , SystemItemInterface , SystemMapInterface , TrafficItemMapInterface , TrafficItemMapModel , TrafficItemView , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel
  • getIndex() : ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , TrafficItemView
  • getInputs() : ComponentItemInterface , SystemComponentItemInterface
  • getItem() : AgentMapInterface , AgentMapModel , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemComponentParameterMapInterface , SystemConnectionMapInterface , SystemMapInterface , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • getKey() : ParameterItemInterface , ParameterItemModel
  • getLibraries() : ExperimentInterface , ExperimentModel
  • getLibrariesView() : ExperimentView
  • getLibrary() : ProjectInterface , SystemComponentItemInterface
  • getLibraryPath() : ProjectInterface
  • getLoggingGroups() : ExperimentInterface , ExperimentModel
  • getLoggingGroupsView() : ExperimentView
  • getLogLevel() : ProjectInterface
  • getLogMaster() : ProjectInterface
  • getLogSlave() : ProjectInterface
  • getModel() : VehicleProfileItemInterface , VehicleProfileItemModel
  • getModelCatalogue() : VehicleProfileItemInterface , VehicleProfileItemModel
  • getName() : AgentItemInterface , AgentMapInterface , AgentMapModel , ComponentItemInterface , ComponentMapInterface , DriverProfileItemInterface , DriverProfileItemModel , DriverProfileMapInterface , DriverProfileMapModel , EnvironmentInterface , EnvironmentModel , ScenarioInterface , ScenarioModel , SensorProfileItemInterface , SensorProfileItemModel , TrafficInterface , TrafficModel , VehicleComponentProfileItemInterface , VehicleComponentProfileItemModel , VehicleProfileItemInterface , VehicleProfileItemModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • getNumberInvocations() : ExperimentInterface , ExperimentModel
  • getOffset() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • getOutputs() : ComponentItemInterface , SystemComponentItemInterface
  • getParameters() : ComponentItemInterface , DriverProfileItemInterface , DriverProfileItemModel , SensorProfileItemInterface , SensorProfileItemModel , SystemComponentItemInterface , VehicleComponentProfileItemInterface , VehicleComponentProfileItemModel
  • getParameterView() : DriverProfilesView
  • getPlatoonRates() : TrafficInterface , TrafficModel
  • getPlatoonRatesView() : TrafficView
  • getPosition() : SystemComponentItemInterface
  • getPriority() : SystemComponentScheduleInterface , SystemItemInterface
  • getProbability() : EnvironmentItemInterface , EnvironmentItemModel , TrafficItemInterface , TrafficItemModel , TrafficItemView
  • getProfiles() : VehicleComponentItemInterface , VehicleComponentItemModel
  • getProfilesCatalogue() : TrafficSimulationInterface , TrafficSimulationModel
  • getProjectStatus() : ProjectInterface
  • getRegularLaneAgentsView() : TrafficView
  • getResponse() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • getResultPath() : ProjectInterface
  • getRightmostLaneAgentsView() : TrafficView
  • getScenario() : TrafficSimulationInterface , TrafficSimulationModel
  • getScenarioAgentsView() : ScenarioView
  • getScenarioDisplayView() : ExperimentBaseView , TrafficSimulationView
  • getScenarioFile() : ScenarioInterface , ScenarioModel
  • getScenarioView() : ScenarioBaseView , TrafficSimulationView
  • getSchedule() : ComponentItemInterface , SystemComponentItemInterface
  • getSeed() : ExperimentInterface , ExperimentModel
  • getSensorLinks() : VehicleComponentItemInterface , VehicleComponentItemModel
  • getSensorPosition() : SensorItemInterface , SensorItemModel
  • getSensorProfile() : SensorItemInterface , SensorItemModel
  • getSensorProfiles() : AgentConfigurationInterface , AgentConfigurationModel
  • getSensors() : VehicleProfileItemInterface , VehicleProfileItemModel
  • getSlaveExe() : ProjectInterface
  • getSource() : SystemConnectionItemInterface
  • getStatus() : EnvironmentInterface , EnvironmentModel , ScenarioInterface , ScenarioModel , TrafficInterface , TrafficModel
  • getSystem() : AgentItemInterface
  • getSystemConfig() : AgentItemInterface , VehicleProfileItemInterface , VehicleProfileItemModel
  • getSystemID() : AgentItemInterface
  • getSystemProfiles() : VehicleProfileItemInterface , VehicleProfileItemModel
  • getSystems() : SystemInterface , VehicleProfileItemInterface , VehicleProfileItemModel
  • getSystemTitle() : AgentItemInterface
  • getSystemView() : SystemProfileView
  • getTarget() : SystemConnectionItemInterface
  • getTimeOfDayMap() : EnvironmentInterface , EnvironmentModel
  • getTimeOfDayView() : EnvironmentView
  • getTitle() : ComponentInputItemInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , SystemComponentInputItemInterface , SystemComponentItemInterface , SystemComponentOutputItemInterface , SystemComponentParameterItemInterface , SystemItemInterface
  • getTraffic() : TrafficSimulationInterface , TrafficSimulationModel
  • getTrafficDisplayView() : ExperimentBaseView , TrafficSimulationView
  • getTrafficLanesView() : TrafficBaseView
  • getTrafficParametersView() : TrafficBaseView
  • getTrafficView() : TrafficBaseView , TrafficSimulationView
  • getType() : AgentItemInterface , ComponentInputItemInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , ParameterItemInterface , ParameterItemModel , SensorProfileItemInterface , SensorProfileItemModel , SystemComponentInputItemInterface , SystemComponentItemInterface , SystemComponentOutputItemInterface , SystemComponentParameterItemInterface , TrafficItemView , VehicleComponentItemInterface , VehicleComponentItemModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileItemInterface , VehicleComponentProfileItemModel
  • getUndoView() : AgentConfigurationView , TrafficSimulationView
  • getUnit() : ComponentInputItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , ParameterItemInterface , ParameterItemModel , SystemComponentInputItemInterface , SystemComponentOutputItemInterface , SystemComponentParameterItemInterface
  • getValue() : ComponentParameterItemInterface , EnvironmentItemInterface , EnvironmentItemModel , ParameterItemInterface , ParameterItemModel , SystemComponentParameterItemInterface , TrafficItemInterface , TrafficItemModel , TrafficItemView
  • getVehicleComponentProfiles() : AgentConfigurationInterface , AgentConfigurationModel
  • getVehicleComponents() : VehicleProfileItemInterface , VehicleProfileItemModel
  • getVehicleModel() : AgentItemInterface
  • getVehicleModelCatalogue() : AgentItemInterface
  • getVehicleProfiles() : AgentConfigurationInterface , AgentConfigurationModel , AgentItemInterface
  • getVehicleProfilesView() : AgentConfigurationView , AgentMapView
  • getVelocities() : TrafficInterface , TrafficModel
  • getVelocitiesView() : TrafficView
  • getVisibilityDistanceMap() : EnvironmentInterface , EnvironmentModel
  • getVisibilityDistanceView() : EnvironmentView
  • getVolumes() : TrafficInterface , TrafficModel
  • getVolumesView() : TrafficView
  • getWeatherMap() : EnvironmentInterface , EnvironmentModel
  • getWeatherView() : EnvironmentView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- h -

  • headerData() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , ParameterMapPresenter , ScenarioAgentsPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • hide() : StatusBarView
  • hideStatusBar() : TrafficSimulationView
  • Homogeneities : TrafficInterface
  • homogeneities : TrafficModel , TrafficPresenter
  • homogeneity_added() : TrafficParametersPresenter
  • homogeneity_probabilityChanged() : TrafficParametersPresenter
  • homogeneity_removed() : TrafficParametersPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- i -

  • ID : ComponentInputMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , EnvironmentInterface , ExperimentInterface
  • id : ExperimentModel
  • ID : ParameterItemInterface , ParameterMapInterface , SensorItemInterface , SensorMapInterface , SensorProfileItemInterface , SensorProfileMapInterface , SystemComponentInputItemInterface , SystemComponentItemInterface , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemComponentParameterMapInterface , SystemConnectionItemInterface , SystemConnectionMapInterface , SystemItemInterface , SystemMapInterface , TrafficItemMapInterface , TrafficItemView , VehicleComponentProfileMapInterface , WindowInterface
  • id_default : ExperimentModel
  • index : TrafficItemView
  • initialHeight : TrafficLanesView , TrafficParametersView
  • InputMap : ComponentItemInterface , SystemComponentItemInterface
  • insertRow() : LoggingGroupsPresenter
  • Invocations_valueChanged() : ExperimentView
  • isCompatible() : SystemConnectionItemInterface
  • Item : AgentMapInterface , ComponentInputMapInterface , ComponentInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , EnvironmentInterface , ParameterMapInterface , SensorMapInterface , SensorProfileMapInterface , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemComponentParameterMapInterface , SystemConnectionMapInterface , SystemMapInterface , TrafficItemMapInterface , VehicleComponentMapInterface , VehicleComponentProfileMapInterface , VehicleProfileMapInterface
  • Iterator : AgentMapInterface , DriverProfileMapInterface , ParameterMapInterface , SensorMapInterface , SensorProfileMapInterface , TrafficItemMapInterface , VehicleComponentMapInterface , VehicleComponentProfileMapInterface , VehicleProfileMapInterface
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- k -

  • Key : ParameterItemInterface
  • key : ParameterItemModel
  • keys() : AgentMapInterface , AgentMapModel , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- l -

  • Libraries : ExperimentInterface
  • libraries : ExperimentModel , LibrariesPresenter
  • librariesPresenter : ExperimentPresenter
  • Library : SystemComponentItemInterface
  • libraryTypesList : ExperimentPresenter
  • listTitlesByType() : SystemComponentManagerInterface
  • load() : AgentConfigurationPresenter , ComponentItemInterface , ProjectInterface , SystemInterface , TrafficSimulationPresenter , TrafficSimulationXMLLoadModel
  • loaded() : ComponentItemInterface , ProjectInterface , SystemInterface
  • loadEnvironment() : TrafficSimulationXMLLoadModel
  • loadExperiment() : TrafficSimulationXMLLoadModel
  • loadFrictionMap() : TrafficSimulationXMLLoadModel
  • loadFromDirectory() : SystemComponentManagerInterface
  • loadLibraries() : TrafficSimulationXMLLoadModel
  • loadLoggingGroups() : TrafficSimulationXMLLoadModel
  • loadModelCatalogue() : VehicleProfilesPresenter
  • loadScenarioConfig() : TrafficSimulationXMLLoadModel
  • LoadSetup() : AgentConfigurationView , TrafficSimulationView
  • loadTimeOfDayMap() : TrafficSimulationXMLLoadModel
  • loadTraffic() : TrafficSimulationXMLLoadModel
  • loadTrafficAgents() : TrafficSimulationXMLLoadModel
  • loadTrafficHomogeneities() : TrafficSimulationXMLLoadModel
  • loadTrafficParameters() : TrafficSimulationXMLLoadModel
  • loadTrafficPlatoonRates() : TrafficSimulationXMLLoadModel
  • loadTrafficVelocities() : TrafficSimulationXMLLoadModel
  • loadTrafficVolumes() : TrafficSimulationXMLLoadModel
  • loadVisibilityDistanceMap() : TrafficSimulationXMLLoadModel
  • loadWeatherMap() : TrafficSimulationXMLLoadModel
  • LoggingGroups : ExperimentInterface
  • loggingGroups : ExperimentModel , LoggingGroupsPresenter
  • loggingGroupsList : ExperimentPresenter
  • loggingGroupsPresenter : ExperimentPresenter
  • lookupItemByName() : SystemComponentManagerInterface
  • lookupItemByTitle() : SystemComponentManagerInterface
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- m -

  • Map : AgentMapInterface , ComponentInputMapInterface , ComponentInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , ParameterMapInterface , SensorMapInterface , SensorProfileMapInterface , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemComponentParameterMapInterface , SystemConnectionMapInterface , SystemMapInterface , TrafficItemMapInterface
  • map : TrafficItemMapModel
  • Map : VehicleComponentMapInterface , VehicleComponentProfileMapInterface , VehicleProfileMapInterface
  • mode() : SystemComponentMapInterface , SystemConnectionMapInterface
  • Model : VehicleProfileItemInterface
  • model : VehicleProfileItemModel
  • ModelCatalogue : VehicleProfileItemInterface
  • modelCatalogue : VehicleProfileItemModel
  • modelList : AgentMapPresenter , VehicleProfilesPresenter
  • modified() : SystemConnectionMapInterface
  • modifiedCardinality() : ComponentInputItemInterface
  • modifiedCycle() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • modifiedID() : ComponentInputMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface
  • modifiedModel() : VehicleProfilesView
  • modifiedName() : AgentMapInterface , AgentMapView , ComponentItemInterface , ComponentMapInterface , DriverProfileMapInterface , EnvironmentInterface , EnvironmentView , ScenarioInterface , ScenarioView , TrafficInterface , TrafficView , VehicleProfileMapInterface , VehicleProfilesView
  • modifiedOffset() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • modifiedPosition() : SystemComponentItemInterface
  • modifiedPriority() : SystemComponentScheduleInterface , SystemItemInterface
  • modifiedResponse() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • modifiedScenarioFile() : ScenarioInterface , ScenarioView
  • modifiedStatus() : EnvironmentInterface , ScenarioInterface , TrafficInterface
  • modifiedTitle() : ComponentInputItemInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , SystemComponentItemInterface , SystemItemInterface
  • modifiedType() : ComponentInputItemInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface
  • modifiedUnit() : ComponentInputItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface
  • modifiedValue() : ComponentParameterItemInterface , SystemComponentParameterItemInterface
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- n -

  • Name : AgentItemInterface , AgentMapInterface , ComponentItemInterface , ComponentMapInterface , DriverProfileItemInterface , DriverProfileMapInterface , EnvironmentInterface
  • name : EnvironmentModel
  • Name : ScenarioInterface
  • name : ScenarioModel
  • Name : SensorProfileItemInterface , SensorProfileMapInterface , TrafficInterface
  • name : TrafficModel
  • Name : VehicleComponentProfileItemInterface , VehicleComponentProfileMapInterface , VehicleProfileItemInterface , VehicleProfileMapInterface
  • NewSetup() : TrafficSimulationView
  • NumberInvocations : ExperimentInterface
  • numberInvocations : ExperimentModel
  • numberInvocations_default : ExperimentModel
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- o -

  • on_add_clicked() : AgentMapView , DriverProfilesView , VehicleProfilesView
  • on_add_Friction_clicked() : EnvironmentView
  • on_add_TimeOfDay_clicked() : EnvironmentView
  • on_add_VisibilityDistance_clicked() : EnvironmentView
  • on_add_Weather_clicked() : EnvironmentView
  • on_addDriver_clicked() : AgentMapView
  • on_addHomogeneity_clicked() : TrafficParametersView , TrafficView
  • on_addPlatoonRate_clicked() : TrafficParametersView , TrafficView
  • on_addRegularLaneAgent_clicked() : TrafficLanesView , TrafficView
  • on_addRightmostLaneAgent_clicked() : TrafficLanesView , TrafficView
  • on_addSystem_clicked() : SystemProfileView
  • on_addSystemProfile_clicked() : VehicleProfilesView
  • on_addVehicle_clicked() : AgentMapView
  • on_addVelocity_clicked() : TrafficParametersView , TrafficView
  • on_addVolume_clicked() : TrafficParametersView , TrafficView
  • on_AgentProfileSelection_activated() : AgentMapView
  • on_Browse_clicked() : DriverProfilesView
  • on_button_clicked() : StatusBarView
  • on_CatalogueBrowse_clicked() : TrafficSimulationView
  • on_CatalogueRefresh_clicked() : TrafficSimulationView
  • on_edit_clicked() : AgentMapView , DriverProfilesView , VehicleProfilesView
  • on_InvocationsValue_editingFinished() : ExperimentView
  • on_Library_add_clicked() : ExperimentView
  • on_Library_remove_clicked() : ExperimentView
  • on_LoggingGroup_add_clicked() : ExperimentView
  • on_LoggingGroup_remove_clicked() : ExperimentView
  • on_Model_activated() : AgentMapView , VehicleProfilesView
  • on_modelCatalogue_Browse_clicked() : VehicleProfilesView
  • on_modelCatalogue_Refresh_clicked() : VehicleProfilesView
  • on_ModelCatalogueBrowse_clicked() : AgentMapView
  • on_ModelCatalogueRefresh_clicked() : AgentMapView
  • on_Name_activated() : DriverProfilesView , VehicleProfilesView
  • on_Name_editingFinished() : EnvironmentView
  • on_NameEdit_editingFinished() : ScenarioView , TrafficView
  • on_probabilityValue_editingFinished() : TrafficItemView
  • on_remove_clicked() : AgentMapView , DriverProfilesView , TrafficItemView , VehicleProfilesView
  • on_remove_Friction_clicked() : EnvironmentView
  • on_remove_TimeOfDay_clicked() : EnvironmentView
  • on_remove_VisibilityDistance_clicked() : EnvironmentView
  • on_remove_Weather_clicked() : EnvironmentView
  • on_removeDriver_clicked() : AgentMapView
  • on_removeHomogeneity_clicked() : TrafficView
  • on_removePlatoonRate_clicked() : TrafficView
  • on_removeRegularLaneAgent_clicked() : TrafficView
  • on_removeRightmostLaneAgent_clicked() : TrafficView
  • on_removeSystem_clicked() : SystemProfileView
  • on_removeSystemProfile_clicked() : VehicleProfilesView
  • on_removeVehicle_clicked() : AgentMapView
  • on_removeVelocity_clicked() : TrafficView
  • on_removeVolume_clicked() : TrafficView
  • on_ScenarioFileBrowse_clicked() : ScenarioView
  • on_ScenarioFileRefresh_clicked() : ScenarioView
  • on_SeedValue_editingFinished() : ExperimentView
  • on_StartSimulation_clicked() : ExperimentView
  • on_system_activated() : AgentMapView
  • on_systemConfigBrowse_clicked() : AgentMapView , VehicleProfilesView
  • on_systemConfigRefresh_clicked() : AgentMapView , VehicleProfilesView
  • on_tabWidget_currentChanged() : TrafficSimulationView
  • on_Type_activated() : AgentMapView
  • OutputMap : ComponentItemInterface , SystemComponentItemInterface
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- p -

  • paintEvent() : ExperimentBaseView , TrafficBaseView , WidgetView
  • ParameterMap : ComponentItemInterface , SystemComponentItemInterface
  • Parameters : DriverProfileItemInterface
  • parameters : DriverProfileItemModel , DriverProfilesPresenter , ParameterMapModel , ParameterMapPresenter
  • Parameters : SensorProfileItemInterface
  • parameters : SensorProfileItemModel
  • Parameters : VehicleComponentProfileItemInterface
  • parameters : VehicleComponentProfileItemModel
  • platoonRate_added() : TrafficParametersPresenter
  • platoonRate_probabilityChanged() : TrafficParametersPresenter
  • platoonRate_removed() : TrafficParametersPresenter
  • PlatoonRates : TrafficInterface
  • platoonRates : TrafficModel , TrafficPresenter
  • position : SensorItemModel
  • Position : SystemComponentItemInterface
  • Priority : SystemItemInterface
  • Probability : AgentItemInterface , EnvironmentItemInterface
  • probability : EnvironmentItemModel
  • Probability : TrafficItemInterface
  • probability : TrafficItemModel
  • Probability : VehicleComponentItemInterface , VehicleProfileItemInterface
  • probabilityChanged() : TrafficItemView , TrafficParametersView
  • Profile : SensorItemInterface
  • profile : SensorItemModel
  • Profile : VehicleComponentItemInterface
  • profileCatalogueChanged() : TrafficSimulationView
  • Profiles : VehicleComponentItemInterface
  • profiles : VehicleComponentItemModel
  • project : AgentConfigurationPresenter , AgentMapPresenter , ExperimentPresenter , LibrariesPresenter , ScenarioDisplayPresenter , ScenarioPresenter , TrafficSimulationPresenter , VehicleProfilesPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- r -

  • redo : AgentConfigurationPresenter
  • Redo() : AgentConfigurationView
  • redo : TrafficSimulationPresenter
  • Redo() : TrafficSimulationView
  • refreshCatalogue() : TrafficSimulationView
  • refreshModelCatalogue() : AgentMapPresenter , AgentMapView , VehicleProfilesPresenter , VehicleProfilesView
  • refreshScenarioFile() : ScenarioPresenter , ScenarioView
  • refreshSystemConfig() : AgentMapPresenter , AgentMapView , VehicleProfilesPresenter , VehicleProfilesView
  • RegularLaneAgent_added() : TrafficLanesPresenter
  • RegularLaneAgent_probabilityChanged() : TrafficLanesPresenter , TrafficLanesView
  • RegularLaneAgent_removed() : TrafficLanesPresenter
  • regularLaneAgents : TrafficPresenter
  • remove() : AgentMapInterface , AgentMapModel , AgentMapView , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , DriverProfileMapModel , DriverProfilesMapPresenter , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , SystemComponentItemInterface , SystemComponentMapInterface , SystemConnectionMapInterface , TrafficItemMapInterface , TrafficItemMapModel , TrafficItemView , TrafficParametersView , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel , VehicleProfilesMapPresenter , WindowInterface
  • removeAgent() : AgentMapPresenter , AgentMapView
  • removed() : AgentMapInterface , ComponentInputMapInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , SystemComponentMapInterface , VehicleProfileMapInterface
  • removeDriver() : DriverProfilesPresenter
  • removeDriverProfile() : AgentMapPresenter , AgentMapView , DriverProfilesView
  • removeDriverView() : DriverProfilesView
  • removeFriction() : EnvironmentPresenter , EnvironmentView
  • removeHomogeneity() : TrafficPresenter , TrafficView
  • removeLibrary() : ExperimentPresenter , ExperimentView
  • removeLoggingGroup() : ExperimentPresenter , ExperimentView
  • removePlatoonRate() : TrafficPresenter , TrafficView
  • removeRegularLaneAgent() : TrafficLanesPresenter , TrafficLanesView , TrafficPresenter , TrafficView
  • removeRegularLaneAgentByName() : TrafficLanesPresenter
  • removeRegularLaneAgentView() : TrafficLanesView
  • removeRightmostLaneAgent() : TrafficLanesPresenter , TrafficLanesView , TrafficPresenter , TrafficView
  • removeRightmostLaneAgentByName() : TrafficLanesPresenter
  • removeRightmostLaneAgentView() : TrafficLanesView
  • removeRow() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , LoggingGroupsPresenter , ParameterMapPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • removeSystem() : SystemProfileView , VehicleProfilesPresenter
  • removeSystemProfile() : VehicleProfilesPresenter , VehicleProfilesView
  • removeSystemProfileView() : VehicleProfilesView
  • removeTimeOfDay() : EnvironmentPresenter , EnvironmentView
  • removeTrafficItem() : TrafficParametersPresenter
  • removeTrafficItemView() : TrafficParametersView
  • removeVehicleProfile() : AgentMapPresenter , AgentMapView , VehicleProfilesPresenter , VehicleProfilesView
  • removeVehicleProfileSelectionItem() : VehicleProfilesView
  • removeVelocity() : TrafficPresenter , TrafficView
  • removeVisibilityDistance() : EnvironmentPresenter , EnvironmentView
  • removeVolume() : TrafficPresenter , TrafficView
  • removeWeather() : EnvironmentPresenter , EnvironmentView
  • reset() : EnvironmentInterface , EnvironmentModel
  • resized() : ExperimentView , TrafficLanesView , TrafficParametersView
  • resizeEvent() : ExperimentView , TrafficLanesView , TrafficParametersView , TrafficSimulationView
  • RightmostLaneAgent_added() : TrafficLanesPresenter
  • RightmostLaneAgent_probabilityChanged() : TrafficLanesPresenter , TrafficLanesView
  • RightmostLaneAgent_removed() : TrafficLanesPresenter
  • rightmostLaneAgents : TrafficPresenter
  • rowCount() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , LoggingGroupsPresenter , ParameterMapPresenter , ScenarioAgentsPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • RowToID : EnvironmentMapPresenter , ParameterMapPresenter
  • RowToProfile : DriverProfilesMapPresenter , VehicleProfilesMapPresenter
  • RowToSystem : SystemProfilePresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- s -

  • save() : AgentConfigurationPresenter , ComponentItemInterface , ProjectInterface , SystemInterface , TrafficSimulationPresenter , TrafficSimulationXMLSaveModel
  • saved() : ComponentItemInterface , ProjectInterface , SystemInterface
  • saveEnvironment() : TrafficSimulationXMLSaveModel
  • saveExperiment() : TrafficSimulationXMLSaveModel
  • saveFrictionMap() : TrafficSimulationXMLSaveModel
  • saveLibraries() : TrafficSimulationXMLSaveModel
  • saveLoggingGroups() : TrafficSimulationXMLSaveModel
  • saveScenario() : TrafficSimulationXMLSaveModel
  • SaveSetup() : AgentConfigurationView , TrafficSimulationView
  • saveTimeOfDayMap() : TrafficSimulationXMLSaveModel
  • saveTraffic() : TrafficSimulationXMLSaveModel
  • saveTrafficHomogeneities() : TrafficSimulationXMLSaveModel
  • saveTrafficParameters() : TrafficSimulationXMLSaveModel
  • saveTrafficPlatoonRates() : TrafficSimulationXMLSaveModel
  • saveTrafficRegularLane() : TrafficSimulationXMLSaveModel
  • saveTrafficRightmostLane() : TrafficSimulationXMLSaveModel
  • saveTrafficVelocities() : TrafficSimulationXMLSaveModel
  • saveTrafficVolumes() : TrafficSimulationXMLSaveModel
  • saveVisibilityDistanceMap() : TrafficSimulationXMLSaveModel
  • saveWeatherMap() : TrafficSimulationXMLSaveModel
  • scenario : ScenarioDisplayPresenter , ScenarioPresenter
  • scenarioAgentsList : ScenarioAgentsPresenter , ScenarioDisplayPresenter , ScenarioPresenter
  • scenarioAgentsPresenter : ScenarioPresenter
  • scenarioDisplayPresenter : TrafficSimulationPresenter
  • scenarioDisplayView : ExperimentBaseView , ScenarioDisplayPresenter
  • ScenarioFile : ScenarioInterface
  • scenarioFile : ScenarioModel
  • scenarioPresenter : TrafficSimulationPresenter
  • scenarioView : ScenarioBaseView , ScenarioPresenter , TrafficSimulationView
  • Schedule : ComponentItemInterface , SystemComponentItemInterface
  • Seed : ExperimentInterface
  • seed : ExperimentModel
  • seed_default : ExperimentModel
  • Seed_valueChanged() : ExperimentView
  • selectedDriverConfig() : DriverProfilesView
  • selectedSystem() : AgentMapView
  • selectedVehicleProfile() : VehicleProfilesView
  • selectionChanged() : AgentMapView , DriverProfilesView
  • SensorLinks : VehicleComponentItemInterface
  • sensorLinks : VehicleComponentItemModel
  • sensorProfiles : AgentConfigurationModel , SensorProfileMapModel
  • sensors : SensorMapModel
  • Sensors : VehicleProfileItemInterface
  • sensors : VehicleProfileItemModel
  • setAgentProfilesError() : TrafficView
  • setAgentSelectionItems() : AgentMapView , TrafficLanesView
  • setCardinality() : ComponentInputItemInterface
  • setConfig() : DriverProfileItemInterface , DriverProfileItemModel
  • setConfigView() : DriverProfilesView
  • setCurrentAgent() : AgentMapPresenter , AgentMapView
  • setCurrentDriver() : DriverProfilesPresenter , DriverProfilesView
  • setCurrentModel() : AgentMapView
  • setCurrentModelCatalogue() : AgentMapView
  • setCurrentSystem() : AgentMapView
  • setCurrentSystemConfig() : AgentMapView
  • setCurrentType() : AgentMapView
  • setCurrentVehicle() : VehicleProfilesView
  • setCurrentVehicleProfile() : VehicleProfilesPresenter
  • setCycle() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • setData() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , LoggingGroupsPresenter , ParameterMapPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • setDriverConfig() : DriverProfilesPresenter
  • setDriverProbabilityError() : AgentMapView
  • setDriverProfiles() : DriverProfilesMapPresenter
  • setDriverSelectionItems() : DriverProfilesView
  • setEntities() : ScenarioInterface
  • setEnvironmentName() : EnvironmentDisplayView
  • setEnvironmentNameView() : EnvironmentDisplayPresenter
  • setFriction() : EnvironmentDisplayView
  • setFriction_ProbabilityError() : EnvironmentView
  • setFrictionView() : EnvironmentDisplayPresenter
  • setHomogeneities() : TrafficDisplayView
  • setHomogeneities_ProbabilityError() : TrafficView
  • setHomogeneitiesView() : TrafficDisplayPresenter
  • setID() : ComponentInputItemInterface , ComponentInputMapInterface , ComponentOutputItemInterface , ComponentOutputMapInterface , ComponentParameterItemInterface , ComponentParameterMapInterface , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel
  • setIndex() : TrafficItemView
  • setInvocationsValue() : ExperimentView
  • setKey() : ParameterItemInterface , ParameterItemModel
  • setLibraryPath() : ProjectInterface
  • setLogLevel() : ProjectInterface
  • setLogMaster() : ProjectInterface
  • setLogSlave() : ProjectInterface
  • setModel() : AgentMapPresenter , AgentMapView , VehicleProfileItemInterface , VehicleProfileItemModel , VehicleProfilesPresenter , VehicleProfilesView
  • setModelCatalogue() : AgentMapPresenter , AgentMapView , VehicleProfileItemInterface , VehicleProfileItemModel , VehicleProfilesPresenter , VehicleProfilesView
  • setModelCatalogueError() : AgentMapView , VehicleProfilesView
  • setModelItems() : AgentMapPresenter
  • setModelSelectionItems() : AgentMapView , VehicleProfilesView
  • setName() : AgentMapInterface , AgentMapModel , ComponentMapInterface , DriverProfileMapInterface , DriverProfileMapModel , EnvironmentInterface , EnvironmentModel , EnvironmentPresenter , EnvironmentView , ScenarioInterface , ScenarioModel , ScenarioPresenter , ScenarioView , TrafficInterface , TrafficModel , TrafficPresenter , TrafficView , VehicleProfileMapInterface , VehicleProfileMapModel
  • setNumberInvocations() : ExperimentInterface , ExperimentModel , ExperimentPresenter
  • setOffset() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • setParameterDelegates() : DriverProfilesPresenter
  • setParameters() : ParameterMapPresenter
  • setPlatoonRates() : TrafficDisplayView
  • setPlatoonRates_ProbabilityError() : TrafficView
  • setPlatoonRatesView() : TrafficDisplayPresenter
  • setPosition() : SystemComponentItemInterface
  • setPriority() : SystemComponentScheduleInterface , SystemItemInterface
  • setProbability() : EnvironmentItemInterface , EnvironmentItemModel , TrafficItemInterface , TrafficItemModel , TrafficItemView , TrafficParametersPresenter , TrafficParametersView
  • setProfileCatalogue() : TrafficSimulationPresenter
  • setProfileCatalogueError() : TrafficSimulationView
  • setProfileCatalogueView() : TrafficSimulationView
  • setProfilesCatalogue() : TrafficSimulationInterface , TrafficSimulationModel
  • setRegularLane_ProbabilityError() : TrafficView
  • setRegularLaneAgentProbability() : TrafficLanesPresenter , TrafficLanesView
  • setRegularLaneAgents() : TrafficDisplayView
  • setRegularLaneView() : TrafficDisplayPresenter
  • setResponse() : ComponentScheduleInterface , SystemComponentScheduleInterface
  • setResultPath() : ProjectInterface
  • setRightmostLane_ProbabilityError() : TrafficView
  • setRightmostLaneAgentProbability() : TrafficLanesPresenter , TrafficLanesView
  • setRightmostLaneAgents() : TrafficDisplayView
  • setRightmostLaneView() : TrafficDisplayPresenter
  • setScenarioAgents() : ScenarioDisplayView
  • setScenarioAgentsList() : ScenarioPresenter
  • setScenarioAgentsView() : ScenarioDisplayPresenter
  • setScenarioFile() : ScenarioDisplayView , ScenarioInterface , ScenarioModel , ScenarioPresenter , ScenarioView
  • setScenarioFileError() : ScenarioView
  • setScenarioFileView() : ScenarioDisplayPresenter
  • setScenarioName() : ScenarioDisplayView
  • setScenarioNameView() : ScenarioDisplayPresenter
  • setSeed() : ExperimentInterface , ExperimentModel , ExperimentPresenter
  • setSeedValue() : ExperimentView
  • setSelectionItems() : SystemProfileView
  • setSensorPosition() : SensorItemInterface , SensorItemModel
  • setSensorProfile() : SensorItemInterface , SensorItemModel
  • setSlaveExe() : ProjectInterface
  • setStatus() : EnvironmentDisplayPresenter , EnvironmentDisplayView , EnvironmentInterface , EnvironmentModel , ScenarioDisplayPresenter , ScenarioDisplayView , ScenarioInterface , ScenarioModel , TrafficDisplayPresenter , TrafficDisplayView , TrafficInterface , TrafficModel
  • setSystem() : AgentMapPresenter
  • setSystemConfig() : AgentItemInterface , AgentMapPresenter , AgentMapView , VehicleProfileItemInterface , VehicleProfileItemModel , VehicleProfilesPresenter , VehicleProfilesView
  • setSystemConfigError() : AgentMapView , VehicleProfilesView
  • setSystemID() : AgentItemInterface
  • setSystemItems() : AgentMapPresenter
  • setSystemProfileSelection() : VehicleProfilesView
  • setSystemProfilesError() : VehicleProfilesView
  • setSystems() : SystemProfilePresenter
  • setSystemSelectionItems() : AgentMapView
  • setSystemTitle() : AgentItemInterface
  • setTimeOfDay() : EnvironmentDisplayView
  • setTimeOfDay_ProbabilityError() : EnvironmentView
  • setTimeOfDayView() : EnvironmentDisplayPresenter
  • setTitle() : ComponentInputItemInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , SystemComponentItemInterface , SystemItemInterface
  • setTrafficName() : TrafficDisplayView
  • setTrafficNameView() : TrafficDisplayPresenter
  • setType() : AgentItemInterface , AgentMapPresenter , ComponentInputItemInterface , ComponentItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , ParameterItemInterface , ParameterItemModel , VehicleComponentMapInterface , VehicleComponentMapModel
  • setUnit() : ComponentInputItemInterface , ComponentOutputItemInterface , ComponentParameterItemInterface , ParameterItemInterface , ParameterItemModel
  • setupDriverProfilesMap() : AgentMapPresenter
  • SetupFriction() : EnvironmentPresenter
  • setupHomogeneities() : TrafficPresenter
  • setupLibraries() : ExperimentPresenter
  • setupLoggingGroups() : ExperimentPresenter
  • setupPlatoonRates() : TrafficPresenter
  • setupRegularLaneAgents() : TrafficPresenter
  • setupRightmostLaneAgents() : TrafficPresenter
  • SetupTimeOfDay() : EnvironmentPresenter
  • setupVehicleProfilesMap() : AgentMapPresenter
  • setupVelocities() : TrafficPresenter
  • SetupVisibilityDistance() : EnvironmentPresenter
  • setupVolumes() : TrafficPresenter
  • SetupWeather() : EnvironmentPresenter
  • setValue() : ComponentParameterItemInterface , EnvironmentItemInterface , EnvironmentItemModel , ParameterItemInterface , ParameterItemModel , SystemComponentParameterItemInterface , TrafficItemInterface , TrafficItemModel , TrafficItemView , TrafficParametersPresenter , TrafficParametersView
  • setVehicleModel() : AgentItemInterface
  • setVehicleModelCatalogue() : AgentItemInterface
  • setVehicleProbabilityError() : AgentMapView
  • setVehicleProfiles() : VehicleProfilesMapPresenter
  • setVehicleProfileSelectionItems() : VehicleProfilesView
  • setVelocities() : TrafficDisplayView
  • setVelocities_ProbabilityError() : TrafficView
  • setVelocitiesView() : TrafficDisplayPresenter
  • setVisibilityDistance() : EnvironmentDisplayView
  • setVisibilityDistance_ProbabilityError() : EnvironmentView
  • setVisibilityDistanceView() : EnvironmentDisplayPresenter
  • setVolumes() : TrafficDisplayView
  • setVolumes_ProbabilityError() : TrafficView
  • setVolumesView() : TrafficDisplayPresenter
  • setWeather() : EnvironmentDisplayView
  • setWeather_ProbabilityError() : EnvironmentView
  • setWeatherView() : EnvironmentDisplayPresenter
  • show() : StatusBarView
  • showStatusBarText() : TrafficSimulationView
  • showText() : StatusBarView
  • simulationFinished() : TrafficSimulationPresenter
  • Source : SystemConnectionItemInterface , SystemConnectionMapInterface
  • startSimulation() : ExperimentPresenter , ExperimentView , TrafficSimulationPresenter
  • Status : EnvironmentInterface
  • status : EnvironmentModel
  • Status : ScenarioInterface
  • status : ScenarioModel
  • Status : TrafficInterface
  • status : TrafficModel
  • statusbar : TrafficSimulationView
  • StatusType : EnvironmentDisplayView , ScenarioDisplayView , TrafficDisplayView
  • System : AgentItemInterface , VehicleProfileItemInterface
  • SystemConfig : AgentItemInterface , VehicleProfileItemInterface
  • systemConfig : VehicleProfileItemModel
  • SystemID : AgentItemInterface , VehicleProfileItemInterface
  • systemInterface : VehicleProfilesPresenter
  • systemList : AgentMapPresenter , VehicleProfilesPresenter
  • systemProfilePresenters : VehicleProfilesPresenter
  • SystemProfiles : VehicleProfileItemInterface
  • systemProfiles : VehicleProfileItemModel
  • systems : SystemProfilePresenter
  • Systems : VehicleProfileItemInterface
  • systemsConsistent() : VehicleProfilesPresenter
  • SystemTitle : AgentItemInterface , VehicleProfileItemInterface
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- t -

  • Target : SystemConnectionItemInterface , SystemConnectionMapInterface
  • TimeOfDayMap : EnvironmentInterface
  • timeOfDayMap : EnvironmentModel
  • timeOfDayPresenter : EnvironmentPresenter
  • Title : ComponentItemInterface , SystemComponentInputItemInterface , SystemComponentItemInterface , SystemItemInterface
  • traffic : TrafficDisplayPresenter , TrafficLanesPresenter , TrafficParametersPresenter , TrafficPresenter
  • TrafficAgents : TrafficInterface
  • trafficDisplayPresenter : TrafficSimulationPresenter
  • trafficDisplayView : ExperimentBaseView , TrafficDisplayPresenter
  • trafficLanesView : TrafficBaseView , TrafficLanesPresenter
  • trafficParametersView : TrafficBaseView , TrafficParametersPresenter
  • trafficPresenter : TrafficSimulationPresenter
  • trafficSimulation : TrafficSimulationPresenter
  • trafficSimulationView : TrafficSimulationPresenter
  • TrafficSimulationView() : TrafficSimulationView
  • trafficView : TrafficBaseView , TrafficPresenter , TrafficSimulationView
  • Type : AgentItemInterface , ParameterItemInterface
  • type : ParameterItemModel
  • Type : SensorProfileItemInterface , SensorProfileMapInterface , SystemComponentInputItemInterface , SystemComponentItemInterface
  • type : TrafficItemView
  • Type : TrafficItemView , VehicleComponentItemInterface , VehicleComponentMapInterface , VehicleComponentProfileItemInterface , VehicleComponentProfileMapInterface
  • typeChanged() : AgentMapView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Typedefs

- a -

  • Action : WindowInterface
  • ActionMenu : WindowInterface
  • ActionTitle : WindowInterface
  • AlgoType : VehicleProfileItemInterface

- b -

  • Button : WindowInterface
  • ButtonOrder : WindowInterface
  • ButtonTitle : WindowInterface
  • ButtonType : WindowInterface

- c -

  • Cardinality : SystemComponentInputItemInterface
  • CatalogueName : ScenarioInterface
  • CatalogueRef : ScenarioInterface
  • Component : SystemConnectionMapInterface
  • ComponentMap : SystemItemInterface
  • ConnectionMap : SystemItemInterface
  • ConstIterator : AgentMapInterface , DriverProfileMapInterface , ParameterMapInterface , SensorMapInterface , SensorProfileMapInterface , TrafficItemMapInterface , VehicleComponentMapInterface , VehicleComponentProfileMapInterface , VehicleProfileMapInterface

- d -

  • DriverConfig : DriverProfileItemInterface
  • DriverProfile : AgentItemInterface
  • DriverProfiles : AgentItemInterface

- e -

  • Entities : ScenarioInterface
  • EntryName : ScenarioInterface

- f -

  • FrictionMap : EnvironmentInterface

- h -

  • Homogeneities : TrafficInterface

- i -

  • ID : ComponentInputMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , EnvironmentInterface , ExperimentInterface , ParameterItemInterface , ParameterMapInterface , SensorItemInterface , SensorMapInterface , SensorProfileItemInterface , SensorProfileMapInterface , SystemComponentInputItemInterface , SystemComponentItemInterface , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemComponentParameterMapInterface , SystemConnectionItemInterface , SystemConnectionMapInterface , SystemItemInterface , SystemMapInterface , TrafficItemMapInterface , VehicleComponentProfileMapInterface , WindowInterface
  • InputMap : ComponentItemInterface , SystemComponentItemInterface
  • Item : AgentMapInterface , ComponentInputMapInterface , ComponentInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , EnvironmentInterface , ParameterMapInterface , SensorMapInterface , SensorProfileMapInterface , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemComponentParameterMapInterface , SystemConnectionMapInterface , SystemMapInterface , TrafficItemMapInterface , VehicleComponentMapInterface , VehicleComponentProfileMapInterface , VehicleProfileMapInterface
  • Iterator : AgentMapInterface , DriverProfileMapInterface , ParameterMapInterface , SensorMapInterface , SensorProfileMapInterface , TrafficItemMapInterface , VehicleComponentMapInterface , VehicleComponentProfileMapInterface , VehicleProfileMapInterface

- k -

  • Key : ParameterItemInterface

- l -

  • Libraries : ExperimentInterface
  • Library : SystemComponentItemInterface
  • LoggingGroups : ExperimentInterface

- m -

  • Map : AgentMapInterface , ComponentInputMapInterface , ComponentInterface , ComponentMapInterface , ComponentOutputMapInterface , ComponentParameterMapInterface , DriverProfileMapInterface , ParameterMapInterface , SensorMapInterface , SensorProfileMapInterface , SystemComponentMapInterface , SystemComponentOutputMapInterface , SystemComponentParameterMapInterface , SystemConnectionMapInterface , SystemMapInterface , TrafficItemMapInterface , VehicleComponentMapInterface , VehicleComponentProfileMapInterface , VehicleProfileMapInterface
  • Model : VehicleProfileItemInterface
  • ModelCatalogue : VehicleProfileItemInterface

- n -

  • Name : AgentItemInterface , AgentMapInterface , ComponentItemInterface , ComponentMapInterface , DriverProfileItemInterface , DriverProfileMapInterface , EnvironmentInterface , ScenarioInterface , SensorProfileItemInterface , SensorProfileMapInterface , TrafficInterface , VehicleComponentProfileItemInterface , VehicleComponentProfileMapInterface , VehicleProfileItemInterface , VehicleProfileMapInterface
  • NumberInvocations : ExperimentInterface

- o -

  • OutputMap : ComponentItemInterface , SystemComponentItemInterface

- p -

  • ParameterMap : ComponentItemInterface , SystemComponentItemInterface
  • Parameters : DriverProfileItemInterface , SensorProfileItemInterface , VehicleComponentProfileItemInterface
  • PlatoonRates : TrafficInterface
  • Position : SystemComponentItemInterface
  • Priority : SystemItemInterface
  • Probability : AgentItemInterface , EnvironmentItemInterface , TrafficItemInterface , VehicleComponentItemInterface , VehicleProfileItemInterface
  • Profile : SensorItemInterface , VehicleComponentItemInterface
  • Profiles : VehicleComponentItemInterface

- s -

  • ScenarioFile : ScenarioInterface
  • Schedule : ComponentItemInterface , SystemComponentItemInterface
  • Seed : ExperimentInterface
  • SensorLinks : VehicleComponentItemInterface
  • Sensors : VehicleProfileItemInterface
  • Source : SystemConnectionItemInterface , SystemConnectionMapInterface
  • Status : EnvironmentInterface , ScenarioInterface , TrafficInterface
  • System : AgentItemInterface , VehicleProfileItemInterface
  • SystemConfig : AgentItemInterface , VehicleProfileItemInterface
  • SystemID : AgentItemInterface , VehicleProfileItemInterface
  • SystemProfiles : VehicleProfileItemInterface
  • Systems : VehicleProfileItemInterface
  • SystemTitle : AgentItemInterface , VehicleProfileItemInterface

- t -

  • Target : SystemConnectionItemInterface , SystemConnectionMapInterface
  • TimeOfDayMap : EnvironmentInterface
  • Title : ComponentItemInterface , SystemComponentInputItemInterface , SystemComponentItemInterface , SystemItemInterface
  • TrafficAgents : TrafficInterface
  • Type : AgentItemInterface , ParameterItemInterface , SensorProfileItemInterface , SensorProfileMapInterface , SystemComponentInputItemInterface , SystemComponentItemInterface , VehicleComponentItemInterface , VehicleComponentMapInterface , VehicleComponentProfileItemInterface , VehicleComponentProfileMapInterface

- u -

  • Unit : ParameterItemInterface , SystemComponentInputItemInterface

- v -

  • Value : EnvironmentItemInterface , ParameterItemInterface , TrafficItemInterface
  • VehicleComponents : VehicleProfileItemInterface
  • VehicleModel : AgentItemInterface
  • VehicleModelCatalogue : AgentItemInterface
  • VehicleProfile : AgentItemInterface
  • VehicleProfiles : AgentItemInterface
  • Velocities : TrafficInterface
  • VisibilityDistanceMap : EnvironmentInterface
  • Volumes : TrafficInterface

- w -

  • WeatherMap : EnvironmentInterface
  • Widget : WindowInterface
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- u -

  • ui : AgentConfigurationView , AgentMapView , DriverProfilesView , EnvironmentDisplayView , EnvironmentView , ExperimentView , ScenarioDisplayView , ScenarioView , StatusBarView , SystemProfileView , TrafficDisplayView , TrafficItemView , TrafficLanesView , TrafficParametersView , TrafficSimulationView , TrafficView , VehicleProfilesView
  • undo : AgentConfigurationPresenter
  • Undo() : AgentConfigurationView
  • undo : TrafficSimulationPresenter
  • Undo() : TrafficSimulationView
  • undoStack : AgentConfigurationPresenter , AgentMapPresenter , DriverProfilesPresenter , EnvironmentMapPresenter , EnvironmentPresenter , ExperimentPresenter , ScenarioPresenter , TrafficPresenter , TrafficSimulationPresenter , VehicleProfilesPresenter
  • undoView : AgentConfigurationView , TrafficSimulationView
  • Unit : ParameterItemInterface
  • unit : ParameterItemModel
  • Unit : SystemComponentInputItemInterface
  • update() : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , LoggingGroupsPresenter , ParameterMapPresenter , ProjectInterface , ScenarioAgentsPresenter , SystemProfilePresenter , TrafficItemMapPresenter , VehicleProfilesMapPresenter
  • updateAgentSelectionItems() : AgentMapPresenter
  • updateCatalogueView() : TrafficSimulationPresenter
  • updateDriverSelectionItems() : AgentMapPresenter , DriverProfilesPresenter
  • updateSize() : ExperimentBaseView , ScenarioBaseView , TrafficBaseView
  • updateStatusBar() : TrafficSimulationPresenter
  • updateSystemList() : VehicleProfilesPresenter
  • updateSystemsView() : VehicleProfilesPresenter
  • updateVehicleSelectionItems() : AgentMapPresenter , VehicleProfilesPresenter
  • updateView() : AgentMapPresenter , DriverProfilesPresenter , EnvironmentDisplayPresenter , EnvironmentPresenter , ExperimentPresenter , ScenarioDisplayPresenter , ScenarioPresenter , TrafficDisplayPresenter , TrafficLanesPresenter , TrafficParametersPresenter , TrafficPresenter , VehicleProfilesPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- v -

  • Value : EnvironmentItemInterface
  • value : EnvironmentItemModel
  • Value : ParameterItemInterface
  • value : ParameterItemModel
  • Value : TrafficItemInterface
  • value : TrafficItemModel
  • valueChanged() : TrafficItemView , TrafficParametersView
  • values() : AgentMapInterface , AgentMapModel , DriverProfileMapInterface , DriverProfileMapModel , ParameterMapInterface , ParameterMapModel , SensorMapInterface , SensorMapModel , SensorProfileMapInterface , SensorProfileMapModel , TrafficItemMapInterface , TrafficItemMapModel , VehicleComponentMapInterface , VehicleComponentMapModel , VehicleComponentProfileMapInterface , VehicleComponentProfileMapModel , VehicleProfileMapInterface , VehicleProfileMapModel
  • valueView_valueChanged() : TrafficItemView
  • VehicleComponents : VehicleProfileItemInterface
  • VehicleModel : AgentItemInterface
  • VehicleModelCatalogue : AgentItemInterface
  • VehicleProfile : AgentItemInterface
  • vehicleProfiles : AgentConfigurationModel
  • VehicleProfiles : AgentItemInterface
  • vehicleProfiles : AgentMapPresenter , VehicleProfilesMapPresenter , VehicleProfilesPresenter
  • vehicleProfilesList : AgentMapPresenter
  • vehicleProfilesMap : AgentMapPresenter
  • vehicleProfilesPresenter : AgentConfigurationPresenter
  • vehicleProfilesView : AgentConfigurationView , VehicleProfilesPresenter
  • Velocities : TrafficInterface
  • velocities : TrafficModel , TrafficPresenter
  • velocity_added() : TrafficParametersPresenter
  • velocity_probabilityChanged() : TrafficParametersPresenter
  • velocity_removed() : TrafficParametersPresenter
  • ViewID : AgentConfigurationView , TrafficSimulationView
  • VisibilityDistanceMap : EnvironmentInterface
  • visibilityDistanceMap : EnvironmentModel
  • visibilityDistancePresenter : EnvironmentPresenter
  • volume_added() : TrafficParametersPresenter
  • volume_probabilityChanged() : TrafficParametersPresenter
  • volume_removed() : TrafficParametersPresenter
  • Volumes : TrafficInterface
  • volumes : TrafficModel , TrafficPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- _ -

  • _columnHeaders : DriverProfilesMapPresenter , EnvironmentMapPresenter , LibrariesPresenter , ParameterMapPresenter , ScenarioAgentsPresenter , SystemProfilePresenter , VehicleProfilesMapPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- a -

  • actionMenuClear : AgentConfigurationView
  • actionMenuExport : AgentConfigurationView
  • actionMenuHistory : AgentConfigurationView , TrafficSimulationView
  • actionMenuLoad : AgentConfigurationView , TrafficSimulationView
  • actionMenuNew : TrafficSimulationView
  • actionMenuRedo : AgentConfigurationView , TrafficSimulationView
  • actionMenuSave : AgentConfigurationView , TrafficSimulationView
  • actionMenuUndo : AgentConfigurationView , TrafficSimulationView
  • agentConfiguration : AgentConfigurationPresenter
  • agentConfigurationView : AgentConfigurationPresenter
  • agentList : TrafficDisplayPresenter , TrafficPresenter
  • agentProfiles : TrafficSimulationPresenter
  • agents : AgentConfigurationModel , AgentMapModel , AgentMapPresenter
  • agentsPresenter : AgentConfigurationPresenter
  • agentsRegularLane : TrafficModel
  • agentsRightMostLane : TrafficModel
  • agentsView : AgentConfigurationView , AgentMapPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- b -

  • bool_list : DriverProfilesPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- c -

  • color : EnvironmentDisplayView , ScenarioDisplayView , TrafficDisplayView
  • colorMap : StatusBarView
  • componentProfiles : AgentConfigurationModel , VehicleComponentProfileMapModel
  • components : VehicleComponentMapModel , VehicleProfileItemModel
  • currentAgent : AgentMapPresenter
  • currentDriver : DriverProfilesPresenter
  • currentVehicleProfile : VehicleProfilesPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- d -

  • default_friction : EnvironmentPresenter
  • default_homogeneity : TrafficPresenter
  • default_key : ParameterItemModel
  • default_platoonRate : TrafficPresenter
  • default_position : SensorItemModel
  • default_probability : AgentMapPresenter , EnvironmentPresenter , TrafficPresenter , VehicleProfilesPresenter
  • default_timeOfDay : EnvironmentPresenter
  • default_type : ParameterItemModel
  • default_unit : ParameterItemModel
  • default_value : ParameterItemModel
  • default_velocity : TrafficPresenter
  • default_visibilityDistance : EnvironmentPresenter
  • default_volume : TrafficPresenter
  • default_weather : EnvironmentPresenter
  • driverConfig : DriverProfileItemModel
  • driverProfiles : AgentConfigurationModel , AgentMapPresenter , DriverProfileMapModel , DriverProfilesMapPresenter
  • driverProfilesList : AgentMapPresenter
  • driverProfilesMap : AgentMapPresenter
  • driverProfilesPresenter : AgentConfigurationPresenter
  • driverProfilesView : AgentConfigurationView
  • drivers : DriverProfilesPresenter
  • driversView : DriverProfilesPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- e -

  • entities : ScenarioAgentsPresenter , ScenarioModel
  • environment : EnvironmentDisplayPresenter , EnvironmentMapPresenter , EnvironmentPresenter
  • environmentDisplayPresenter : TrafficSimulationPresenter
  • environmentDisplayView : EnvironmentDisplayPresenter
  • environmentMap : EnvironmentMapPresenter
  • environmentPresenter : TrafficSimulationPresenter
  • environmentView : EnvironmentPresenter , TrafficSimulationView
  • experiment : ExperimentPresenter
  • experimentBaseView : TrafficSimulationView
  • experimentPresenter : TrafficSimulationPresenter
  • experimentView : ExperimentBaseView , ExperimentPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- f -

  • frictionMap : EnvironmentModel
  • frictionPresenter : EnvironmentPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- h -

  • homogeneities : TrafficModel , TrafficPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- i -

  • id : ExperimentModel
  • ID : TrafficItemView
  • id_default : ExperimentModel
  • index : TrafficItemView
  • initialHeight : TrafficLanesView , TrafficParametersView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- k -

  • key : ParameterItemModel
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- l -

  • libraries : ExperimentModel , LibrariesPresenter
  • librariesPresenter : ExperimentPresenter
  • libraryTypesList : ExperimentPresenter
  • loggingGroups : ExperimentModel , LoggingGroupsPresenter
  • loggingGroupsList : ExperimentPresenter
  • loggingGroupsPresenter : ExperimentPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- m -

  • map : TrafficItemMapModel
  • model : VehicleProfileItemModel
  • modelCatalogue : VehicleProfileItemModel
  • modelList : AgentMapPresenter , VehicleProfilesPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- n -

  • name : EnvironmentModel , ScenarioModel , TrafficModel
  • numberInvocations : ExperimentModel
  • numberInvocations_default : ExperimentModel
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- p -

  • parameters : DriverProfileItemModel , DriverProfilesPresenter , ParameterMapModel , ParameterMapPresenter , SensorProfileItemModel , VehicleComponentProfileItemModel
  • platoonRates : TrafficModel , TrafficPresenter
  • position : SensorItemModel
  • probability : EnvironmentItemModel , TrafficItemModel
  • profile : SensorItemModel
  • profiles : VehicleComponentItemModel
  • project : AgentConfigurationPresenter , AgentMapPresenter , ExperimentPresenter , LibrariesPresenter , ScenarioDisplayPresenter , ScenarioPresenter , TrafficSimulationPresenter , VehicleProfilesPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- r -

  • redo : AgentConfigurationPresenter , TrafficSimulationPresenter
  • regularLaneAgents : TrafficPresenter
  • rightmostLaneAgents : TrafficPresenter
  • RowToID : EnvironmentMapPresenter , ParameterMapPresenter
  • RowToProfile : DriverProfilesMapPresenter , VehicleProfilesMapPresenter
  • RowToSystem : SystemProfilePresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- s -

  • scenario : ScenarioDisplayPresenter , ScenarioPresenter
  • scenarioAgentsList : ScenarioAgentsPresenter , ScenarioDisplayPresenter , ScenarioPresenter
  • scenarioAgentsPresenter : ScenarioPresenter
  • scenarioDisplayPresenter : TrafficSimulationPresenter
  • scenarioDisplayView : ExperimentBaseView , ScenarioDisplayPresenter
  • scenarioFile : ScenarioModel
  • scenarioPresenter : TrafficSimulationPresenter
  • scenarioView : ScenarioBaseView , ScenarioPresenter , TrafficSimulationView
  • seed : ExperimentModel
  • seed_default : ExperimentModel
  • sensorLinks : VehicleComponentItemModel
  • sensorProfiles : AgentConfigurationModel , SensorProfileMapModel
  • sensors : SensorMapModel , VehicleProfileItemModel
  • status : EnvironmentModel , ScenarioModel , TrafficModel
  • statusbar : TrafficSimulationView
  • systemConfig : VehicleProfileItemModel
  • systemInterface : VehicleProfilesPresenter
  • systemList : AgentMapPresenter , VehicleProfilesPresenter
  • systemProfilePresenters : VehicleProfilesPresenter
  • systemProfiles : VehicleProfileItemModel
  • systems : SystemProfilePresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- t -

  • timeOfDayMap : EnvironmentModel
  • timeOfDayPresenter : EnvironmentPresenter
  • traffic : TrafficDisplayPresenter , TrafficLanesPresenter , TrafficParametersPresenter , TrafficPresenter
  • trafficDisplayPresenter : TrafficSimulationPresenter
  • trafficDisplayView : ExperimentBaseView , TrafficDisplayPresenter
  • trafficLanesView : TrafficBaseView , TrafficLanesPresenter
  • trafficParametersView : TrafficBaseView , TrafficParametersPresenter
  • trafficPresenter : TrafficSimulationPresenter
  • trafficSimulation : TrafficSimulationPresenter
  • trafficSimulationView : TrafficSimulationPresenter
  • trafficView : TrafficBaseView , TrafficPresenter , TrafficSimulationView
  • type : ParameterItemModel , TrafficItemView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- u -

  • ui : AgentConfigurationView , AgentMapView , DriverProfilesView , EnvironmentDisplayView , EnvironmentView , ExperimentView , ScenarioDisplayView , ScenarioView , StatusBarView , SystemProfileView , TrafficDisplayView , TrafficItemView , TrafficLanesView , TrafficParametersView , TrafficSimulationView , TrafficView , VehicleProfilesView
  • undo : AgentConfigurationPresenter , TrafficSimulationPresenter
  • undoStack : AgentConfigurationPresenter , AgentMapPresenter , DriverProfilesPresenter , EnvironmentMapPresenter , EnvironmentPresenter , ExperimentPresenter , ScenarioPresenter , TrafficPresenter , TrafficSimulationPresenter , VehicleProfilesPresenter
  • undoView : AgentConfigurationView , TrafficSimulationView
  • unit : ParameterItemModel
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- v -

  • value : EnvironmentItemModel , ParameterItemModel , TrafficItemModel
  • vehicleProfiles : AgentConfigurationModel , AgentMapPresenter , VehicleProfilesMapPresenter , VehicleProfilesPresenter
  • vehicleProfilesList : AgentMapPresenter
  • vehicleProfilesMap : AgentMapPresenter
  • vehicleProfilesPresenter : AgentConfigurationPresenter
  • vehicleProfilesView : AgentConfigurationView , VehicleProfilesPresenter
  • velocities : TrafficModel , TrafficPresenter
  • ViewID : AgentConfigurationView , TrafficSimulationView
  • visibilityDistanceMap : EnvironmentModel
  • visibilityDistancePresenter : EnvironmentPresenter
  • volumes : TrafficModel , TrafficPresenter
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members - Variables

- w -

  • weatherList : EnvironmentPresenter
  • weatherMap : EnvironmentModel
  • weatherPresenter : EnvironmentPresenter
  • window : AgentConfigurationView , TrafficSimulationView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- w -

  • weatherList : EnvironmentPresenter
  • WeatherMap : EnvironmentInterface
  • weatherMap : EnvironmentModel
  • weatherPresenter : EnvironmentPresenter
  • Widget : WindowInterface
  • WidgetView() : WidgetView
  • window : AgentConfigurationView , TrafficSimulationView
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Class Hierarchy

Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
[detail level 12]
C AddEnvironmentItem | Command class for adding rows to the table of environment settings
C AddLibrary | Command class for adding libraries to the libraries table
C AddLoggingGroup | Command class for adding logging groups to the logging groups list
C AddTrafficItem | Command class for adding rows to the table of traffic settings
C AgentConfigurationCombinationPresenter | This class defines a presenter object for exporting the model data (AgentConfigurationInterface) of this plugin to the profiles catalogue XML file needed by the simulation slave
▶C AgentConfigurationInterface | This class represents the root element of both, the GUI-specific *.ui as well as the simulation core-relevant ProfilesCatalog.xml files
C AgentConfigurationModel | This class implements the functionality of AgentConfigurationInterface
C AgentConfigurationPresenter | This class defines the presenter object which handles events from the view (AgentConfigurationView) and edits the model data (AgentConfigurationInterface) accordingly
C AgentConfigurationView | This class constitutes the main view of the agent configuration plugin. It instantiates the action menu as well as a tab widget as a container widget for views of agent, driver and vehicle profiles as well as the undo stack. The main task of this view is to emit signals upon user actions on the action menu which are handled in the corresponding prestenter object (AgentConfigurationPresenter)
C AgentItemInterface | This class defines agent profiles defined in both, the GUI-specific *.ui and the simulation core-relevant profiles cataloge (*.xml) under <AgentProfiles>
▶C AgentMapInterface | This class constitutes a container class in which agent profiles (instances of AgentItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map
C AgentMapModel | This class implements the functionality of AgentMapInterface
C AgentMapPresenter | Handles user events from the view (AgentMapView) and edits the model data (AgentMapInterface) accordingly. Since all actions performed on the model data (i.e. the *.ui file) should be undoable, the presenter instantiates the corresponding undo-commands and pushes them onto the undo stack. The actual operation on the model is then performed in these command object using the re-implementations of the undo/redo methods. See Qt's undo framework for further details
C AgentProfileCommands::AddAgentProfile | This class defines the command for undoable add-operations on the map of agent profiles (AgentMapInterface)
C AgentProfileCommands::AddDriverProfile | This class defines the command for undoable add-operations on the driver profiles table of the currently edited agent profile (for dynamic agent profiles only)
C AgentProfileCommands::AddVehicleProfile | This class defines the command for undoable add-operations on the vehicle profiles table of the currently edited agent profile (for dynamic agent profiles only)
C AgentProfileCommands::EditAgentModel | This class defines the command for undoable set-operations on the vehicle model of the currently edited agent profile (for static profiles only)
C AgentProfileCommands::EditAgentModelCatalogue | This class defines the command for undoable set-operations on the vehicle model catalogue of the currently edited agent profile (for static profiles only)
C AgentProfileCommands::EditAgentProfile | This class defines the command for undoable renaming-operations on the map of agent profiles (AgentMapInterface)
C AgentProfileCommands::EditAgentSystem | This class defines the command for undoable set-operations on the system of the currently edited agent profile (for static profiles only)
C AgentProfileCommands::EditAgentSystemConfig | This class defines the command for undoable set-operations on the system config file of the currently edited agent profile (for static profiles only)
C AgentProfileCommands::EditAgentType | This class defines the command for undoable set-operations on the type (static or dynamic) of an agent profile
C AgentProfileCommands::RemoveAgentProfile | This class defines the command for undoable remove-operations on the map of agent profiles (AgentMapInterface)
C AgentProfileCommands::RemoveDriverProfile | This class defines the command for undoable remove-operations on the driver profiles table of the currently edited agent profile (for dynamic agent profiles only)
C AgentProfileCommands::RemoveVehicleProfile | This class defines the command for undoable remove-operations on the vehicle profiles table of the currently edited agent profile (for dynamic agent profiles only)
C AgentProfileCommands::SetCurrentAgent | This class defines the command for undoable set-operations on the currently selected agent profile
C ComponentInputItemInterface | This class defines the items constituing an input of a component:
C ComponentInputMapInterface | This class manages the registration and deregistration of inputs of a component. It provides a map as container with unique identifiers as a keys to sort the inputs
C ComponentInterface | This class manages creating new component and also creating the map which registers created components
C ComponentItemInterface | This class defines the items constituing a component:
C ComponentMapInterface | This class manages the registration and deregistration of objects defining a component (component related-objects) using as identifier a key name
C ComponentOutputItemInterface | This class defines the items constituing an output of a component:
C ComponentOutputMapInterface | This class manages the registration and deregistration of outputs of a component. It provides a map as container with unique identifiers as a keys to sort the outputs
C ComponentParameterItemInterface | This class defines the items constituing a parameter of a component:
C ComponentParameterMapInterface | This class manages the registration and deregistration of parameters of a component. It provides a map as container with unique identifiers as a keys to sort the parameters
C ComponentScheduleInterface | This class defines the schedule parameters of a component:
C DriverProfileCommands::AddDriverProfile | This class defines the command for undoable add-operations on the map of driver profiles (DriverProfileMapInterface)
C DriverProfileCommands::EditDriverProfile | This class defines the command for undoable renaming-operations on the map of driver profiles (DriverProfileMapInterface)
C DriverProfileCommands::RemoveDriverProfile | This class defines the command for undoable remove-operations on the map of driver profiles (DriverProfileMapInterface)
C DriverProfileCommands::SetCurrentDriver | This class defines the command for undoable set-operations on the currently selected driver profile
▶C DriverProfileItemInterface | This class defines objects containing all relevant information on driver profiles
C DriverProfileItemModel | This class implements the functionality of DriverProfileItemInterface
▶C DriverProfileMapInterface | This class constitutes a container class in which driver profiles (instances of DriverProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map
C DriverProfileMapModel | This class implements the functionality of DriverProfileMapInterface
C DriverProfilesMapPresenter | This class constitutes the re-implementation of QAbstractTableModel for the table view of driver profiles. In fact, this class implements a wrapper for the map of driver profiles (DriverProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework
C DriverProfilesPresenter | This class defines the presenter object for driver profiles which handles user events from the view (DriverProfilesView) and edits the model data (DriverProfileMapInterface) accordingly
C EditEnvironmentName | Command class editing the environment's name
C EditNumberInvocations | Command class editing the number of invocations
C EditProfilesCatalogue | Command class for editing the profiles catalogue
C EditRandomSeed | Command class editing the number of invocations
C EditScenarioFile | Command class editing the OpenSCENARIO file
C EditScenarioName | Command class editing the scenario's name
C EditTrafficName | Command class for editing the traffic's name
C EnvironmentDisplayPresenter | This class defines the presenter which controls the content to be displayed in the EnvironmentDisplayView widget
▶C EnvironmentInterface | Setter and getter methods for the maps of environmental parameters, listed under <EnvironmentConfig> in the slaveConfig XML file
C EnvironmentModel | The Environment Model implements the functionality of the EnvironmentInterface class
▶C EnvironmentItemInterface | Methods for reading and editing environment parameters
C EnvironmentItemModel | Implements the functionality of the EnvironmentItemInterface class
C EnvironmentMapPresenter | This class describes the presenter objects of the environment parameter maps
C EnvironmentPresenter | This class defines the presenter object which handles user events coming from the view (EnvironmentView) and edits the model accordingly (EnvironmentInterface)
C EnvironmentView | This class provides an editor for configuring the environment setup, i.e. it is filled with the content stored in an EnvironmentInterface instance
▶C ExperimentInterface | The Experiment Interface provides setter and getter methods for the XML elements listed under <ExperimentConfig> in the slaveConfig XML file
C ExperimentModel | Implements the functionality of the ExperimentInterface class
C ExperimentPresenter | This class defines the presenter object which handles user events coming from the view (ExperimentView) and edits the model accordingly (ExperimentInterface)
C LibrariesPresenter | This class describes the presenter object of the map of included libraries
C LoggingGroupsPresenter | This class describes the presenter object of the list of logging groups
▶C ParameterItemInterface | This class defines parameters
C ParameterItemModel | This class implements the functionality of ParameterItemInterface
▶C ParameterMapInterface | This class constitutes a container class for parameters (instances of ParameterItemInterface). It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
C ParameterMapModel | This class implements the functionality of ParameterMapInterface
C ParameterMapPresenter | This class constitutes the re-implementation of QAbstractTableModel for the table view of parameters. In fact, this class implements a wrapper for the map of parameters (ParameterMapInterface) to be editable by QTableView objects within Qt's Model/View framework
C ProjectInterface | This class defines the items constituing the project configuration:
C RemoveEnvironmentItem | Command class for removing rows from the table of environment settings
C RemoveLibrary | Command class for removing libraries from the libraries table
C RemoveLoggingGroup | Command class for removing logging groups from the logging groups list
C RemoveTrafficItem | Command class for removing rows from the table of traffic settings
C ScenarioAgentsPresenter | This class describes the presenter object of the scenario agents map
C ScenarioDisplayPresenter | This class defines the presenter which controls the content to be displayed in the ScenarioDisplayView widget
▶C ScenarioInterface | The Scenario Interface provides setter and getter methods for the combination XML elements related to an Open Scenario File
C ScenarioModel | The Scenario Model class implements the functionality of the ScenarioItemInterface class
C ScenarioPresenter | This class defines the presenter object which handles user events coming from the view (ScenarioView) and edits the model accordingly (ScenarioInterface)
C ScenarioView | This class provides an editor for configuring the scenario setup, i.e. it is filled with the content stored in an ScenarioInterface instance
▶C SensorItemInterface | Combines a sensor profile (SensorProfileItemInterface, containing parameters) and the sensor position to a sensor data object
C SensorItemModel | This class implements the functionality of SensorItemInterface
▶C SensorMapInterface | This class constitutes a container class in which sensor data (instances of SensorItemInterface) are registered. It uses the functionality of Qt's QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
C SensorMapModel | This class implements the functionality of SensorMapInterface
C SensorPosition | This structure gathers all variables which specify a sensor position. This includes three spatial coordinates (vehicle reference frame) as well as three angles (Euler angles) for the orientation. Additionally, a name for identifying/characterizing the sensor position is provided
▶C SensorProfileItemInterface | This class defines objects containing all relevant information on sensor profiles
C SensorProfileItemModel | This class implements the functionality of SensorProfileItemInterface
▶C SensorProfileMapInterface | This class constitutes a container class in which sensor profiles (instances of SensorProfileItemInterface) are registered. As a key identifier the pair of sensor name and type (corrsponding to its implementation) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
C SensorProfileMapModel | This class implements the functionality of SensorProfileMapInterface
C StatusBarView | This class defines a status bar
C SystemComponentInputItemInterface | This class defines the items constituing an input of a component registered in a system
C SystemComponentItemInterface | This class defines the items constituing the ccomponent registered in a system:
C SystemComponentManagerInterface | This class enables loading components as a library from a directory and provides a search functions for these components
C SystemComponentMapInterface | This class manages the registration and deregistration of objects defining components (component related-objects) belonging to a system
C SystemComponentOutputItemInterface | This class defines the items constituing an output of a component registered in a system. These items are provided from the class defined in the Component Output Item Interface. This current class also provides access to the parent component where the output belongs to. This access allows retracing the connections by getting the output with its relative component (parent)
C SystemComponentOutputMapInterface | This class manages the registration and deregistration of outputs of a component registered in a system
C SystemComponentParameterItemInterface | This class defines the items constituing a parameter of a component registered in a system. These items are provided from the class defined in the Component Parameter Item Interface. They are not modifiable in this class except the Value through callbacks defined for the System Editor
C SystemComponentParameterMapInterface | This class manages the registration and deregistration of parameters of a component registered in a system
C SystemComponentScheduleInterface | This class defines the simulation schedule related parameters of a component registered in a system:
C SystemConnectionItemInterface | This class defines the items constituing the connection that is established between two components of a system:
C SystemConnectionMapInterface | This class manages the registration and deregistration of objects defining connections (connection related-objects) that model the data flow between the components constituing a system
C SystemInterface | This class manages creating new systems and also creating the tree of components loaded from a library and used to build systems
C SystemItemInterface | This class defines the items constituing a system:
C SystemMapInterface | This class manages the registration and deregistration of object defining a system (system related-objects) using as identifier a key id
C SystemProfilePresenter | This class constitutes the re-implementation of QAbstractTableModel for the table view of systems with a given algorithm type. The corresponding model data object is referred to as "system profile". In fact, this class implements a wrapper for these system profiles to be editable by QTableView objects within Qt's Model/View framework
C SystemProfileView | This class defines the view of system profiles, i.e. the mapping of systems with a certain algorithm type onto probabilities
C TrafficDisplayPresenter | This class defines the presenter which controls the content to be displayed in the TrafficDisplayView widget
▶C TrafficInterface | The Traffic Interface provides setter and getter methods for the combination XML subelements listed under the <TrafficConfig> element
C TrafficModel | Implements the functionality of the TrafficInterface class
▶C TrafficItemInterface | The Traffic Item Interface defines a general traffic parameter which can be incorporated into the traffic configuration setup
C TrafficItemModel | Implements functionality of the TrafficItemInterface class
▶C TrafficItemMapInterface | The Traffic Item Map Interface class defines the map in which traffic items of different kinds can be registered under a key identifier (ID). The traffic items are defined in the TrafficItemInterface template class
C TrafficItemMapModel | Implements functionality of the TrafficItemMapInterface class
C TrafficItemMapPresenter | This class describes the presenter objects of the traffic parameter maps
C TrafficLanesPresenter | This class defines the presenter object which handles events coming from the view (TrafficLanesView) and edits the model accordingly (TrafficInterface)
C TrafficParametersPresenter | This class defines the presenter object which handles events coming from the view (TrafficParametersView) and edits the model accordingly (TrafficInterface), i.e. more specifically the parameters therein
C TrafficPresenter | This class defines the presenter object which handles user events coming from the view (TrafficView) and edits the model accordingly (TrafficInterface)
▶C TrafficSimulationInterface | Forms the body of a traffic simulation configuration
C TrafficSimulationModel | Implements functionality of the TrafficSimulationInterface class
C TrafficSimulationPresenter | This class defines the presenter object for the main view of the Traffic Simulation Plugin and instantiates all other presenters
C TrafficSimulationView | This class constitutes the main view of the Traffic Simulation Plugin and instantiates all other configuration views as child widgets
▶C TrafficSimulationXMLBaseModel | This class defines the XML element names of the combination XML file
C TrafficSimulationXMLLoadModel | This class provides routines for loading the combination XML file and for storing all information in the corresponding instances of the model classes
C TrafficSimulationXMLSaveModel | This class provides routines for saving the slaveConfig XML file
C TrafficView | This class provides an editor for configuring the traffic setup, i.e. it is filled with the content stored in an TrafficInterface instance
▶C VehicleComponentItemInterface | Defines data on vehicle components which can be thought of a algorithms that will be built into a vehicle with a certain probability
C VehicleComponentItemModel | This class implements the functionality of VehicleComponentItemInterface
▶C VehicleComponentMapInterface | This class constitutes a container class for vehicle component data (instances of VehicleComponentItemInterface) using the vehicle component's type (i.e. the algorithm it represents) as a key identifier. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
C VehicleComponentMapModel | This class implements the functionality of VehicleComponentMapInterface
▶C VehicleComponentProfileItemInterface | This class defines vehicle component profiles which contain the parameterization of a vehicle component, i.e. an instance of the VehicleComponentItemInterface class
C VehicleComponentProfileItemModel | This class implements the functionality of VehicleComponentProfileItemInterface
▶C VehicleComponentProfileMapInterface | This class constitutes a container class for vehicle component profiles (instances of VehicleComponentProfileItemInterface). As a key identifier the pair of the profile's name and type (corrsponding to to the implementation/algorithm of the vehicle component) is used. This class uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system. Items registered in this map always become child of this map
C VehicleComponentProfileMapModel | This class implements the functionality of VehicleComponentProfileMapInterface
C VehicleProfileCommands::AddSystem | This class defines the command for undoable add-operations on the map of systems of a specific algorithm type
C VehicleProfileCommands::AddSystemProfile | This class defines the command for undoably creating a new map for systems of a specific algorithm type to be assigned to the current vehicle profile
C VehicleProfileCommands::AddVehicleProfile | This class defines the command for undoable add-operations on the map of vehicle profiles (VehicleProfileMapInterface)
C VehicleProfileCommands::EditVehicleProfile | This class defines the command for undoable renaming-operations on the map of vehicle profiles (VehicleProfileMapInterface)
C VehicleProfileCommands::RemoveSystem | This class defines the command for undoable remove-operations on the map of systems of a specific algorithm type
C VehicleProfileCommands::RemoveSystemProfile | This class defines the command for undoably removing the map for systems of a specific algorithm type assigned to the current vehicle profile
C VehicleProfileCommands::RemoveVehicleProfile | This class defines the command for undoable remove-operations on the map of vehicle profiles (VehicleProfileMapInterface)
C VehicleProfileCommands::SetCurrentVehicle | This class defines the command for undoable set-operations on the currently selected vehicle profile
C VehicleProfileCommands::SetModel | This class defines the command for undoable set-operations on the vehicle model of the currently edited vehicle profile
C VehicleProfileCommands::SetModelCatalogue | This class defines the command for undoable set-operations on the vehicle model catalogue of the currently edited vehicle profile
C VehicleProfileCommands::SetSystemConfig | This class defines the command for undoable set-operations on the system config of the currently edited vehicle profile
▶C VehicleProfileItemInterface | This class defines vehicle profiles which unite all data necessary for instantiating a vehicle in the simulation
C VehicleProfileItemModel | This class implements the functionality of VehicleProfileItemInterface
▶C VehicleProfileMapInterface | This class constitutes a container class in which vehicle profiles (instances of VehicleProfileItemInterface) are registered using their names as key identifiers. It uses the functionality of Qt' QMap class but inherits from QObject class in order to utilize Qt's parenting system as well as signals and slots. Items registered in this map always become child of this map
C VehicleProfileMapModel | This class implements the functionality of VehicleProfileMapInterface
C VehicleProfilesMapPresenter | This class constitutes the re-implementation of QAbstractTableModel for the table view of vehicle profiles. In fact, this class implements a wrapper for the map of vehicle profiles (VehicleProfileMapInterface) to be editable by QTableView objects within Qt's Model/View framework
C VehicleProfilesPresenter | This class defines the presenter object for vehicle profiles which handles user events from the view (VehicleProfilesView) and edits the model data (VehicleProfileMapInterface) accordingly
▶C WidgetView | A reimplementation of the QWidget class. It reimplements the QWidgets paint Event in order to enable proper processing of style sheets
C AgentMapView | This class defines the view for editing agent profiles. The view mainly constitutes a drop down menu for selecting a profile to be edited as well as buttons for removing and adding agent profiles. Further, a menu for editing the type ("dynamic" or "static") is provided whose selection switches between two different views. If the type "dynamic" is selected, two tables for assigning driver and vehicle profiles with probabilities appear. If type "static" is selected, the view is reduced to a selection menu for a system config + system as well as a vehicle model catalogue + model. The switching between the two modes is realized via a stacked widget whose pages contain the GUI elements being exclusive for the selected mode. Further information on how to use this view can be found in the GUI tutorial
C DriverProfilesView | This class defines the view for editing driver profiles. The view constitutes a combo box for switching between different driver profiles, add-, remove- and rename buttons and a table view for editing the parameters of the driver profile. Further information on how to use this view can be found in the GUI tutorial
C EnvironmentDisplayView | This class provides a display for a quick overview of the environment configuration
C ExperimentBaseView | This class provides a resizable container widget for the content of the experiment tab
C ExperimentView | This class provides an editor for configuring the experiment setup, i.e. it is filled with the content stored in an ExperimentInterface instance
C ScenarioBaseView | This class provides a resizable container widget for the content of the scenario tab
C ScenarioDisplayView | This class provides a display for a quick overview of the scenario configuration
C TrafficBaseView | This class provides a resizable container widget for the content of the traffic tab's scroll area
C TrafficDisplayView | This class provides a display for a quick overview of the traffic configuration
C TrafficItemView | This class defines a general view for a traffic item, which can be a volume, platoon rate, velocity, homogeneity or an agent profile
C TrafficLanesView | This class defines the editor widget for assigning agent profiles to regular and rightmost lanes
C TrafficParametersView | This class defines the editor widget for traffic parameters and their probabilities
C VehicleProfilesView | This class defines the view for editing vehicle profiles. The view constitutes a combo box for selecting and buttons for adding, removing and renaming vehicle profiles. Further, GUI elements for vehicle model catalogue and vehicle model as well as for the system config are provided. Systems defined in a system config are sorted by the algorithm type used therein. For the corresponding selection of an algorithm type, a combo box including add- and remove- buttons is set up. The dynamic instantiation of the table views for systems of a certain algorithm type (SystemProfileView) is performed in the presenter object (VehicleProfilesPresenter). This object calls public methods of this class in order to instantiate the table views and and lay them out in this widget
C WindowInterface | This class manages the registration and deregistration of Window Views which include the menu bar with its buttons and menu buttons
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Main Page

The name openPASS is a short form of "Open Platorm for Assessment of Safety Systems". Accordingly, the software openPASS is a simulation tool devoted for emulating traffic situations to estimate the effectiveness of advanced driver assistance systems or automated driving functions. This software is developed within a project part of the Eclipse Working Group openPASS.

The global scope of openPASS is to provide a modular tool easy to extend according to the constant need of further development to cope with the constant innovation in vehicle systems. The requirements for the software architecture is to have a framework with an easy concept of handling modules integration and defining standardized interfaces. With this compliance, it allows any user to develop new methods in a new module and implement it into the platform.

The openPASS platform can be splitted in two blocs: a GUI and a Simulation Core (see image below provided from the main page of the openPASS project in Eclipse website). These two blocs are interacting with different modules devoted for specific functionality (e.g. module related to system definition).

openPASS top-level architecture

The current document is focusing on the openPASS GUI version 0.6. It includes a description of the software architecture and the developed features.

Architecture of openPASS GUI

The framework of the openPASS GUI is based on a plugin architecture and provides a service interface to enable interaction between plugins. It uses the libraries from Qt 5.6 (QPluginLoader, QLibrary) to load at run-time the plugins.

Each plugin may have one or several interfaces which can depend on other plugin interfaces. Such dependencies must be taken into account when the plugins are initially loaded. All these requirements are handled through the following interfaces:

Plugin Interface | The Plugin Interface (PI) contains predefined methods for plugins (initialization and deinitialization) and fills (populates) plugins with services (interfaces)
Plugin Manager Interface | The Plugin Manager Interface (PMI) contains the functions managing the loading process of the openPASS plugins
Service Interface | The Service Interface (SI) contains the functions to register, deregister sevices and to access to their instance
Service Manager Interface | The Service Manager Interface (SMI) contains the functions managing a map of services

Every new plugin have to inherit the Plugin Interface.

And, if there is an interface defined in the plugin, this must inherit the registered Service Interface.

To see in details all the steps to create a plugin and an interface, go to Example Create a Basic Plugin.

Note
The main application of openPASS GUI is only containing methods related to Plugins and Services management. It is not defining the main window View. This is in fact implemented through a plugin named Window Plugin (WP). The idea behind this concept is that the main window can be modified without affecting the main framework of the application.

Features in openPASS 0.6

The features in openPASS GUI are gathered into Plugins according to their common fonctionality; i.e. every Plugin have a main task like the System Plugin which is modelling ADAS systems. The Plugins available in the current openPASS 0.6 are:

Window Plugin | The Window Plugin (WP) is dedicated for managing the View of the application
Component Plugin | The Component Plugin (CP) is dedicated for managing the component XML metadata
System Plugin | The System Plugin (SP) provides a graphical user interface for a model-based programming of ADAS
Agent Configuration Plugin | The Agent Configuration Plugin provides an editor for agent profiles to be used in a scenario-based simulation.
Traffic Simulation Plugin | The Traffic Simulation Plugin provides a user interface for configuring a scenario-based simulation.

The Plugins are structured according to their specification. Generally, they have a Model/View structure with:

  • the View: including event handeling methods;
  • the Model: including data process such as getters and setters functions.

This type of structure is easier to implement with the signal/slot feature of Qt in order to establish communication between objects. This strucutre is illustrated through Example2.

Note
If a Plugin does not require a window View (UI), the structure is minimalized to a Model.
Generated on Wed Feb 19 2020 14:58:16 for openPASS GUI by doxygen 1.8.14


openPASS GUI: page_componentPlugin.txt File Reference

page_componentPlugin.txt File Reference
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: page_windowPlugin.txt File Reference

page_windowPlugin.txt File Reference
Generated on Wed Feb 19 2020 14:58:12 for openPASS GUI by doxygen 1.8.14


openPASS GUI: SensorPosition Struct Reference

List of all members
SensorPosition Struct Reference

This structure gathers all variables which specify a sensor position. This includes three spatial coordinates (vehicle reference frame) as well as three angles (Euler angles) for the orientation. Additionally, a name for identifying/characterizing the sensor position is provided. More...

Detailed Description

This structure gathers all variables which specify a sensor position. This includes three spatial coordinates (vehicle reference frame) as well as three angles (Euler angles) for the orientation. Additionally, a name for identifying/characterizing the sensor position is provided.

Definition at line 39 of file SensorItemInterface.h.

The documentation for this struct was generated from the following file:
  • SensorItemInterface.h
Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14


openPASS GUI: Member List

SensorPosition Member List

This is the complete list of members for SensorPosition, including all inherited members.

Generated on Wed Feb 19 2020 14:58:14 for openPASS GUI by doxygen 1.8.14