Eclipse SUMO - Simulation of Urban MObility
GNEVehicleTypeDialog.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// Dialog for edit vehicleTypes
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
25
27
28// ===========================================================================
29// class declarations
30// ===========================================================================
31
32class GNEVType;
33
34// ===========================================================================
35// class definitions
36// ===========================================================================
37
47
48public:
50 class VTypeAtributes : protected FXVerticalFrame {
53
54 public:
56 class VClassRow : protected FXHorizontalFrame {
57
58 public:
60 VClassRow(VTypeAtributes* VTypeAtributesParent, FXVerticalFrame* column);
61
64
67
68 private:
71
74
77
80 };
81
83 class VShapeRow : protected FXHorizontalFrame {
84
85 public:
87 VShapeRow(VTypeAtributes* VTypeAtributesParent, FXVerticalFrame* column);
88
90 void setVariable();
91
93 void updateValues();
94
96 void updateValue(SUMOVehicleClass vClass);
97
98 private:
101
104
107
109 void setVShapeLabelImage();
110
111 };
112
114 class VTypeAttributeRow : private FXHorizontalFrame {
115 public:
116
124 };
125
127 VTypeAttributeRow(VTypeAtributes* VTypeAtributesParent, FXVerticalFrame* verticalFrame, const SumoXMLAttr attr, const RowAttrType rowAttrType, const std::vector<std::string>& values = {});
128
130 void setVariable();
131
133 void setVariable(const std::string& defaultValue);
134
136 void updateValue();
137
139 void updateValue(const std::string& defaultValue);
140
142 const FXButton* getButton() const;
143
145 void openColorDialog();
146
148 void openImageFileDialog();
149
151 void openOSGFileDialog();
152
154 std::string getParametersStr() const;
155
157 std::vector<std::pair<std::string, std::string> > getParametersVectorStr() const;
158
160 void setParameters(const std::vector<std::pair<std::string, std::string> >& parameters);
161
162 private:
165
168
171
173 FXButton* myButton;
174
176 FXTextField* myTextField;
177
180
183
185 FXString filterAttributeName(const SumoXMLAttr attr) const;
186 };
187
189 VTypeAtributes(GNEVehicleTypeDialog* vehicleTypeDialog, FXHorizontalFrame* column);
190
192 void buildAttributesA(FXVerticalFrame* column);
193
195 void buildAttributesB(FXVerticalFrame* column);
196
198 void buildJunctionModelAttributesA(FXVerticalFrame* column);
199
201 void buildJunctionModelAttributesB(FXVerticalFrame* column);
202
204 void buildLaneChangeModelAttributes(FXVerticalFrame* column);
205
207 void updateValues();
208
212 long onCmdSetAttribute(FXObject*, FXSelector, void*);
213
215 long onCmdOpenAttributeDialog(FXObject* obj, FXSelector, void*);
216
218 long onCmdOpenParametersEditor(FXObject* obj, FXSelector, void*);
219
221
222 protected:
223 FOX_CONSTRUCTOR(VTypeAtributes)
224
225
227
230
233
236
239
242
245
248
251
254
257
260
263
266
269
272
275
278
281
284
287
290
293
296
299
302
305
308
311
313
316
319
322
325
328
331
334
337
340
343
346
348
349
352
355
358
361
364
367
370
373
376
379
382
385
388
391
394
397
400
403
406
409
412
414 /* VTypeAttributeRow* myLCAExperimental; */
415
417
418 private:
421 };
422
424 class CarFollowingModelParameters : public FXGroupBox {
427
428 public:
430 CarFollowingModelParameters(GNEVehicleTypeDialog* vehicleTypeDialog, FXHorizontalFrame* column);
431
433 void refreshCFMFields();
434
436 void updateValues();
437
441 long onCmdSetVariable(FXObject*, FXSelector, void*);
442
444
445 protected:
446 FOX_CONSTRUCTOR(CarFollowingModelParameters)
447
448
449 class CarFollowingModelRow : public FXHorizontalFrame {
450 public:
452 CarFollowingModelRow(CarFollowingModelParameters* carFollowingModelParametersParent, FXVerticalFrame* verticalFrame, SumoXMLAttr attr);
453
455 void setVariable();
456
458 void updateValue();
459
460 private:
463
466
468 FXTextField* myTextField;
469 };
470
471 private:
474
476 std::vector<CarFollowingModelRow*> myRows;
477
480
482 FXVerticalFrame* myVerticalFrameRows;
483
486
489
492
495
498
501
504
507
510
513
516
519
522
525
528
531
534
537
540
543
546
549
552
555
558
561
564
567
570
573
576
579
582
585
588
591
594
597
600 };
601
603 GNEVehicleTypeDialog(GNEDemandElement* editedVehicleType, bool updatingElement);
604
607
611 long onCmdAccept(FXObject*, FXSelector, void*);
612
614 long onCmdCancel(FXObject*, FXSelector, void*);
615
617 long onCmdReset(FXObject*, FXSelector, void*);
618
620
621private:
624
627
630
633
636
639};
640
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Dialog to edit sequences, parameters, etc.. of DemandElements.
An Element which don't belong to GNENet but has influence in the simulation.
class used for represent rows with Car Following Model parameters
CarFollowingModelParameters * myCarFollowingModelParametersParent
pointer to CarFollowingModelParameters parent
CarFollowingModelRow * myPhiRow
Row for MinGap (only for Kerner)
CarFollowingModelRow * myTpreviewRow
Row for Look ahead/preview Time.
CarFollowingModelRow * mySteppingRow
Row for MinGap(only for IDM)
CarFollowingModelRow * myMflatnessRow
Row for Startup M flatness.
CarFollowingModelRow * myTreactionRow
Row for Reaction Time.
FXLabel * myLabelIncompleteAttribute
temporal label for incomplete attributes
CarFollowingModelRow * myCcoolnessRow
Row for Coolness parameter.
GNEVehicleTypeDialog * myVehicleTypeDialog
pointer to Vehicle Type dialog parent
CarFollowingModelRow * mySigmagapRow
Row for Gap estimation error.
CarFollowingModelRow * mySecurityRow
Row for Security (only for Wiedemann)
CarFollowingModelRow * myAccelRow
Row for Accel.
CarFollowingModelRow * myEpsilonaccRow
Row for AP Driver Update threshold.
CarFollowingModelRow * myAprobRow
Row for Aprob.
CarFollowingModelRow * myKRow
Row for MinGap (only for Kerner)
CarFollowingModelRow * myTPersDriveRow
Row for Wiener Process Driving Error.
CarFollowingModelRow * myMaxVehPreviewRow
Row for Using vehicle preview.
CarFollowingModelRow * myAdaptFactorRow
Row for Adapt Factor.
CarFollowingModelRow * myTPersEstimateRow
Row for Wiener Process Estimation Error.
CarFollowingModelRow * myJerkmaxRow
Row for max jerk.
FXVerticalFrame * myVerticalFrameRows
Vertical Frame for CarFollowingModelRow.
CarFollowingModelRow * myTaccmaxRow
Row for Startup Time to acc_max.
CarFollowingModelRow * myApparentDecelRow
Row for apparent Decel.
CarFollowingModelRow * myDecelRow
Row for Decel.
std::vector< CarFollowingModelRow * > myRows
vector with the Car Following Model Row
CarFollowingModelRow * myEmergencyDecelRow
Row for emergency Decel.
CarFollowingModelRow * mySigmaleaderRow
Row for leader speed estimation error.
CarFollowingModelRow * myTrainTypeRow
Row for TrainType.
CarFollowingModelRow * myEstimationRow
Row for Estimation (only for Wiedemann)
CarFollowingModelRow * mySigmaRow
Row for Sigma.
CarFollowingModelRow * myMbeginRow
Row for Startup M begin.
CarFollowingModelRow * mySigmaerrorRow
Row for Driving Error.
CarFollowingModelRow * myAdaptTimeRow
Row for Adapt Time.
CarFollowingModelRow * myDeltaRow
Row for MinGap (only for IDM)
CarFollowingModelRow * myTrauLastRow
Row for TauLast.
CarFollowingModelRow * myUseVehDynamicsRow
Row for Using vehicle dynamics.
MFXIconComboBox * myComboBoxCarFollowModel
Row for CarFollowModel.
CarFollowingModelRow * myMinGapFactorRow
Row for MinGapFactor.
FXLabel * myComboBoxVClassLabelImage
label with image of VClass
VTypeAtributes * myVTypeAtributesParent
pointer to VTypeAtributes parent
MFXIconComboBox * myComboBoxVClass
FXComboBox for VClass.
SUMOVehicleClass setVariable()
set vehicle class
VClassRow(VTypeAtributes *VTypeAtributesParent, FXVerticalFrame *column)
constructor
VShapeRow(VTypeAtributes *VTypeAtributesParent, FXVerticalFrame *column)
constructor
FXLabel * myComboBoxShapeLabelImage
label with image of Shape
MFXIconComboBox * myComboBoxShape
FXComboBox for Shape.
VTypeAtributes * myVTypeAtributesParent
pointer to VTypeAtributes parent
void updateValue(SUMOVehicleClass vClass)
update value
class used for represent rows with Vehicle Type parameters
MFXIconComboBox * myComboBox
ComboBox for attributes with limited values.
std::string getParametersStr() const
get parameters as string
void updateValue()
update value of Vehicle Type (using default value obtained from GNEAttributeCarrier)
void setParameters(const std::vector< std::pair< std::string, std::string > > &parameters)
set parameters
Parameterised::Map myParameters
pointer to current parameter map
std::vector< std::pair< std::string, std::string > > getParametersVectorStr() const
get parameters as vector of strings
FXString filterAttributeName(const SumoXMLAttr attr) const
filter attribute name
void setVariable()
set Variable in VehicleType (using default value obtained from GNEAttributeCarrier)
VTypeAttributeRow(VTypeAtributes *VTypeAtributesParent, FXVerticalFrame *verticalFrame, const SumoXMLAttr attr, const RowAttrType rowAttrType, const std::vector< std::string > &values={})
constructor
VTypeAtributes * myVTypeAtributesParent
pointer to VTypeAttributeParameters parent
VTypeAttributeRow * myJMIgnoreFoeProb
VTypeAttributeRow for Ignore FOE Probability.
VTypeAttributeRow * myFilename
VTypeAttributeRow for Filename.
VTypeAttributeRow * myLCACooperativeParam
VTypeAttributeRow for cooperative param.
VTypeAttributeRow * myContainerCapacity
VTypeAttributeRow for ContainerCapacity.
VTypeAttributeRow * myJMSigmaMinor
VTypeAttributeRow for Sigma Minor.
VTypeAttributeRow * myLCAAssertive
VTypeAttributeRow for assertive.
VTypeAttributeRow * myLCATimeToImpatience
VTypeAttributeRow for time to impatience.
VTypeAttributeRow * myLatAlignment
VTypeAttributeRow for LatAlignment.
VTypeAttributeRow * myJMIgnoreKeepclearTime
VTypeAttributeRow for Ignore Keep Clear Time.
VTypeAttributeRow * myLaneChangeModel
VTypeAttributeRow for LaneChangeModel.
VTypeAttributeRow * myActionStepLength
VTypeAttributeRow for ActionStepLength.
VTypeAttributeRow * myLCAStrategicParam
VTypeAttributeRow for strategic param.
VTypeAttributeRow * myHeight
VTypeAttributeRow for Height.
VTypeAttributeRow * myJMTimeGapMinor
VTypeAttributeRow for Time GAP Minor.
VTypeAttributeRow * myLocomotiveLength
VTypeAttributeRow for locomotive length.
VTypeAttributeRow * myLCAMaxSpeedLatFactor
VTypeAttributeRow for max speed lat factor.
void buildJunctionModelAttributesB(FXVerticalFrame *column)
build JunctionModel attributes (B)
VTypeAttributeRow * myJMCrossingGap
VTypeAttributeRow for Crossing Gap.
VTypeAttributeRow * myJMDriveAfterYellowTime
VTypeAttributeRow for Drive After Yellow Time.
GNEVehicleTypeDialog * myVehicleTypeDialog
VTypeAttributeRow for experimental.
VTypeAttributeRow * myLCAKeepRightAcceptanceTime
VTypeAttributeRow for keep right acceptance time.
VTypeAttributeRow * myLCATurnAlignmentDistance
VTypeAttributeRow for turn alignment distance.
long onCmdSetAttribute(FXObject *, FXSelector, void *)
VTypeAttributeRow * myLCALookAheadLeft
VTypeAttributeRow for look ahead left.
VTypeAttributeRow * myLCAImpatience
VTypeAttributeRow for impatience.
VTypeAttributeRow * myBoardingDuration
VTypeAttributeRow for BoardingDuration.
VTypeAttributeRow * myMaxSpeedLat
VTypeAttributeRow for MaxSpeedLat.
VTypeAttributeRow * myJMDriveRedSpeed
VTypeAttributeRow for Drive Red Speed.
VTypeAttributeRow * myLCAPushygap
VTypeAttributeRow for pushy gap.
VTypeAttributeRow * myLength
VTypeAttributeRow for Length.
VTypeAttributeRow * myJMDriveAfterRedTime
VTypeAttributeRow for Drive After Red Time.
VTypeAttributeRow * myParameters
VTypeAttributeRow for parameters.
VTypeAttributeRow * myCarriageLength
VTypeAttributeRow for carriage length.
VTypeAttributeRow * myLCAOppositeParam
VTypeAttributeRow for opposite param.
VTypeAttributeRow * myLCAPushy
VTypeAttributeRow for pushy.
VTypeAttributeRow * myColor
VTypeAttributeRow for color.
VTypeAttributeRow * myDesiredMaxSpeed
VTypeAttributeRow for desired max speed.
long onCmdOpenAttributeDialog(FXObject *obj, FXSelector, void *)
@event called after press a button dialog
VTypeAttributeRow * myMinGap
VTypeAttributeRow for MinGap.
VTypeAttributeRow * myJMIgnoreFoeSpeed
VTypeAttributeRow for Ignore FOE Speed.
FXTextField * myTextFieldVehicleTypeID
FXTextfield for vehicleTypeID.
VTypeAttributeRow * myLCASpeedgainParam
VTypeAttributeRow for speed gain param.
VTypeAttributeRow * myPersonCapacity
VTypeAttributeRow for PersonCapacity.
VTypeAttributeRow * myLCAMaxSpeedLatStanding
VTypeAttributeRow for max speed lat standing.
VTypeAttributeRow * myEmissionClass
VTypeAttributeRow for EmissionClass.
VTypeAttributeRow * myLCAAccelLat
VTypeAttributeRow for accel lat.
VTypeAttributeRow * myCarriageGap
VTypeAttributeRow for carriage GAP.
void buildAttributesB(FXVerticalFrame *column)
build commmon attributes (B)
VTypeAttributeRow * myMinGapLat
VTypeAttributeRow for MinGapLat.
VTypeAttributeRow * myJMImpatience
VTypeAttributeRow for Impatience.
VTypeAttributeRow * myProbability
VTypeAttributeRow for Probability.
void buildLaneChangeModelAttributes(FXVerticalFrame *column)
build LaneChangeModel attributes
VTypeAttributeRow * myLCAKeeprightParam
VTypeAttributeRow for keep right param.
VTypeAttributeRow * myLCAOvertakeDeltaSpeedFactor
VTypeAttributeRow for overtake deltaspeed factor.
VTypeAttributeRow * myLCASublaneParam
VTypeAttributeRow for sublane param.
VTypeAttributeRow * myOSGFile
VTypeAttributeRow for OSG.
void buildAttributesA(FXVerticalFrame *column)
build commmon attributes (A)
VClassRow * myVClassRow
vehicle class row
VTypeAttributeRow * myLCASpeedGainRight
VTypeAttributeRow for speed gain right.
VTypeAttributeRow * myMaxSpeed
VTypeAttributeRow for MaxSpeed.
VTypeAtributes(GNEVehicleTypeDialog *vehicleTypeDialog, FXHorizontalFrame *column)
constructor
VTypeAttributeRow * mySpeedFactor
VTypeAttributeRow for SpeedFactor.
VTypeAttributeRow * myLoadingDuration
VTypeAttributeRow for LoadingDuration.
VTypeAttributeRow * myWidth
VTypeAttributeRow for Width.
long onCmdOpenParametersEditor(FXObject *obj, FXSelector, void *)
@event called after press a button dialog
void buildJunctionModelAttributesA(FXVerticalFrame *column)
build JunctionModel attributes (A)
VTypeAttributeRow * myLCAOvertakeRight
VTypeAttributeRow for overtake right.
VShapeRow * myVShapeRow
vehicle shape row
Dialog for editing calibrator vehicle types.
VTypeAtributes * myVTypeAtributes
Vehicle Type Common Attributes.
GNEVehicleTypeDialog(const GNEVehicleTypeDialog &)=delete
Invalidated copy constructor.
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
SumoXMLAttr myInvalidAttr
current sumo attribute invalid
bool myVehicleTypeValid
flag to check if current vehicleType is valid
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
CarFollowingModelParameters * myCarFollowingModelParameters
Car Following model parameters.
GNEVehicleTypeDialog(GNEDemandElement *editedVehicleType, bool updatingElement)
constructor
long onCmdAccept(FXObject *, FXSelector, void *)
GNEVehicleTypeDialog & operator=(const GNEVehicleTypeDialog &)=delete
Invalidated assignment operator.
ComboBox with icon.
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
every row value