Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEVehicleTypeDialog.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 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 declaration
30// ===========================================================================
31
33class MFXComboBoxIcon;
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
38
39class GNEVehicleTypeDialog : public GNETemplateElementDialog<GNEDemandElement> {
40
41public:
43 class VTypeAttributes : protected FXVerticalFrame {
46
47 public:
49 class VClassRow : protected FXHorizontalFrame {
50
51 public:
53 VClassRow(VTypeAttributes* VTypeAttributesParent, FXVerticalFrame* column);
54
57
60
61 private:
64
67
70
73 };
74
76 class VShapeRow : protected FXHorizontalFrame {
77
78 public:
80 VShapeRow(VTypeAttributes* VTypeAttributesParent, FXVerticalFrame* column);
81
83 void setVariable();
84
86 void updateValues();
87
89 void updateValue(SUMOVehicleClass vClass);
90
91 private:
94
97
100
102 void setVShapeLabelImage();
103
104 };
105
107 class VTypeAttributeRow : private FXHorizontalFrame {
108 public:
109
118
120 VTypeAttributeRow(VTypeAttributes* VTypeAttributesParent, FXVerticalFrame* verticalFrame, const SumoXMLAttr attr, const RowAttrType rowAttrType, const std::vector<std::string>& values = {});
121
123 void setVariable();
124
126 void setVariable(const std::string& defaultValue);
127
129 void updateValue();
130
132 void updateValue(const std::string& defaultValue);
133
135 const FXButton* getButton() const;
136
138 void openColorDialog();
139
141 void openImageFileDialog();
142
144 void openOSGFileDialog();
145
147 std::string getParametersStr() const;
148
150 std::vector<std::pair<std::string, std::string> > getParametersVectorStr() const;
151
153 void setParameters(const std::vector<std::pair<std::string, std::string> >& parameters);
154
155 private:
158
161
164
166 FXButton* myButton;
167
169 FXTextField* myTextField;
170
173
176
178 std::string filterAttributeName(const SumoXMLAttr attr) const;
179 };
180
182 VTypeAttributes(GNEVehicleTypeDialog* vehicleTypeDialog, FXHorizontalFrame* column);
183
185 void buildAttributesA(FXVerticalFrame* column);
186
188 void buildAttributesB(FXVerticalFrame* column);
189
191 void buildJunctionModelAttributesA(FXVerticalFrame* column);
192
194 void buildJunctionModelAttributesB(FXVerticalFrame* column);
195
197 void buildLaneChangeModelAttributes(FXVerticalFrame* column);
198
200 void updateValues();
201
205 long onCmdSetAttribute(FXObject*, FXSelector, void*);
206
208 long onCmdOpenAttributeDialog(FXObject* obj, FXSelector, void*);
209
211 long onCmdOpenParametersEditor(FXObject* obj, FXSelector, void*);
212
214
215 protected:
216 FOX_CONSTRUCTOR(VTypeAttributes)
217
218
220
223
226
229
232
235
238
241
244
247
250
253
256
259
262 /*
263 Waiting for #16343
265 VTypeAttributeRow* myCarriageLength;
266
268 VTypeAttributeRow* myLocomotiveLength;
269
271 VTypeAttributeRow* myCarriageGap;
272 */
275
278
281
284
287
290
293
296
299
302
305
307
310
313
316
319
322
325
328
331
334
337
340
342
343
346
349
352
355
358
361
364
367
370
373
376
379
382
385
388
391
394
397
400
403
406
408 /* VTypeAttributeRow* myLCAExperimental; */
409
411
412 private:
415 };
416
418 class CarFollowingModelParameters : public FXGroupBox {
421
422 public:
424 CarFollowingModelParameters(GNEVehicleTypeDialog* vehicleTypeDialog, FXHorizontalFrame* column);
425
427 void refreshCFMFields();
428
430 void updateValues();
431
435 long onCmdSetVariable(FXObject*, FXSelector, void*);
436
438
439 protected:
440 FOX_CONSTRUCTOR(CarFollowingModelParameters)
441
442
443 class CarFollowingModelRow : public FXHorizontalFrame {
444 public:
446 CarFollowingModelRow(CarFollowingModelParameters* carFollowingModelParametersParent, FXVerticalFrame* verticalFrame, SumoXMLAttr attr);
447
449 void setVariable();
450
452 void updateValue();
453
454 private:
457
460
462 FXTextField* myTextField;
463 };
464
465 private:
468
470 std::vector<CarFollowingModelRow*> myRows;
471
474
476 FXVerticalFrame* myVerticalFrameRows;
477
480
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
603
606
609
612
615
618
621 };
622
625
628
630 void runInternalTest(const InternalTestStep::DialogArgument* dialogArgument);
631
634
636 long onCmdAccept(FXObject*, FXSelector, void*);
637
639 long onCmdReset(FXObject*, FXSelector, void*);
640
642
643private:
646
649
652
655
658
661};
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
GNETemplateElementDialog(GNEDemandElement *element, DialogType type)
class used for represent rows with Car Following Model parameters
CarFollowingModelRow(CarFollowingModelParameters *carFollowingModelParametersParent, FXVerticalFrame *verticalFrame, SumoXMLAttr attr)
constructor
CarFollowingModelParameters * myCarFollowingModelParametersParent
pointer to CarFollowingModelParameters parent
CarFollowingModelRow * myPhiRow
Row for MinGap (only for Kerner).
CarFollowingModelRow * myW99CC1
Row for W99 CC 01.
CarFollowingModelRow * myTpreviewRow
Row for Look ahead/preview Time.
CarFollowingModelRow * myW99CC8
Row for W99 CC 08.
CarFollowingModelRow * myW99CC6
Row for W99 CC 06.
CarFollowingModelRow * mySteppingRow
Row for MinGap(only for IDM).
CarFollowingModelRow * myMflatnessRow
Row for Startup M flatness.
CarFollowingModelRow * myW99CC3
Row for W99 CC 03.
CarFollowingModelRow * myW99CC2
Row for W99 CC 02.
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 * myW99CC7
Row for W99 CC 07.
CarFollowingModelRow * myW99CC5
Row for W99 CC 05.
CarFollowingModelRow * myAccelRow
Row for Accel.
CarFollowingModelRow * myEpsilonaccRow
Row for AP Driver Update threshold.
CarFollowingModelRow * myAprobRow
Row for Aprob.
CarFollowingModelRow * myW99CC9
Row for W99 CC 09.
CarFollowingModelRow * myKRow
Row for MinGap (only for Kerner).
CarFollowingModelRow * myTPersDriveRow
Row for Wiener Process Driving Error.
long onCmdSetVariable(FXObject *, FXSelector, void *)
CarFollowingModelRow * myMaxVehPreviewRow
Row for Using vehicle preview.
CarFollowingModelRow * myAdaptFactorRow
Row for Adapt Factor.
CarFollowingModelRow * myTPersEstimateRow
Row for Wiener Process Estimation Error.
MFXComboBoxIcon * myComboBoxCarFollowModel
Row for CarFollowModel.
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.
CarFollowingModelRow * myW99CC4
Row for W99 CC 04.
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.
void refreshCFMFields()
refresh Car Following Model Fields
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.
CarFollowingModelParameters(GNEVehicleTypeDialog *vehicleTypeDialog, FXHorizontalFrame *column)
FOX-declaration.
CarFollowingModelRow * myMinGapFactorRow
Row for MinGapFactor.
VClassRow(VTypeAttributes *VTypeAttributesParent, FXVerticalFrame *column)
constructor
FXLabel * myComboBoxVClassLabelImage
label with image of VClass
VTypeAttributes * myVTypeAttributesParent
pointer to VTypeAttributes parent
MFXComboBoxIcon * myComboBoxVClass
MFXComboBoxIcon for VClass.
VTypeAttributes * myVTypeAttributesParent
pointer to VTypeAttributes parent
MFXComboBoxIcon * myComboBoxShape
MFXComboBoxIcon for Shape.
FXLabel * myComboBoxShapeLabelImage
label with image of Shape
VShapeRow(VTypeAttributes *VTypeAttributesParent, FXVerticalFrame *column)
constructor
void updateValue(SUMOVehicleClass vClass)
update value
class used for represent rows with Vehicle Type parameters
VTypeAttributeRow(VTypeAttributes *VTypeAttributesParent, FXVerticalFrame *verticalFrame, const SumoXMLAttr attr, const RowAttrType rowAttrType, const std::vector< std::string > &values={})
constructor
MFXComboBoxIcon * myComboBox
ComboBox for attributes with limited values.
Parameterised::Map myParameters
pointer to current parameter map
std::string getParametersStr() const
get parameters as string
void updateValue()
update value of Vehicle Type (using default value obtained from GNEAttributeCarrier)
void setVariable()
set Variable in VehicleType (using default value obtained from GNEAttributeCarrier)
std::vector< std::pair< std::string, std::string > > getParametersVectorStr() const
get parameters as vector of strings
VTypeAttributes * myVTypeAttributesParent
pointer to VTypeAttributeParameters parent
void setParameters(const std::vector< std::pair< std::string, std::string > > &parameters)
set parameters
std::string filterAttributeName(const SumoXMLAttr attr) const
filter attribute name
GNEVehicleTypeDialog * myVehicleTypeDialog
VTypeAttributeRow for experimental.
VTypeAttributeRow * myHeight
VTypeAttributeRow for Height.
VTypeAttributeRow * myLCASpeedgainParam
VTypeAttributeRow for speed gain param.
VTypeAttributeRow * myLaneChangeModel
VTypeAttributeRow for LaneChangeModel.
VTypeAttributeRow * myJMSigmaMinor
VTypeAttributeRow for Sigma Minor.
VTypeAttributeRow * myJMCrossingGap
VTypeAttributeRow for Crossing Gap.
VTypeAttributeRow * myLCAKeeprightParam
VTypeAttributeRow for keep right param.
VTypeAttributeRow * myLCAAccelLat
VTypeAttributeRow for accel lat.
VTypeAttributeRow * myContainerCapacity
VTypeAttributeRow for ContainerCapacity.
VTypeAttributeRow * myMaxSpeed
VTypeAttributeRow for MaxSpeed.
VTypeAttributeRow * myJMIgnoreFoeSpeed
VTypeAttributeRow for Ignore FOE Speed.
void buildAttributesA(FXVerticalFrame *column)
build common attributes (A)
VTypeAttributeRow * myFilename
VTypeAttributeRow for Filename.
VTypeAttributeRow * myMinGap
VTypeAttributeRow for MinGap.
VTypeAttributeRow * myOSGFile
VTypeAttributeRow for OSG.
VTypeAttributeRow * myJMDriveAfterYellowTime
VTypeAttributeRow for Drive After Yellow Time.
VTypeAttributeRow * myMaxSpeedLat
VTypeAttributeRow for MaxSpeedLat.
VTypeAttributeRow * myParameters
VTypeAttributeRow for parameters.
void buildJunctionModelAttributesA(FXVerticalFrame *column)
build JunctionModel attributes (A)
VTypeAttributeRow * myLCAOvertakeRight
VTypeAttributeRow for overtake right.
VTypeAttributeRow * myLCATimeToImpatience
VTypeAttributeRow for time to impatience.
VTypeAttributeRow * myJMTimeGapMinor
VTypeAttributeRow for Time GAP Minor.
VTypeAttributeRow * myLCAKeepRightAcceptanceTime
VTypeAttributeRow for keep right acceptance time.
VTypeAttributeRow * myEmissionClass
VTypeAttributeRow for EmissionClass.
VTypeAttributeRow * myLCAMaxSpeedLatStanding
VTypeAttributeRow for max speed lat standing.
VTypeAttributeRow * myJMDriveAfterRedTime
VTypeAttributeRow for Drive After Red Time.
VTypeAttributeRow * myJMIgnoreFoeProb
VTypeAttributeRow for Ignore FOE Probability.
VTypeAttributeRow * myMinGapLat
VTypeAttributeRow for MinGapLat.
VTypeAttributeRow * myLCAStrategicParam
VTypeAttributeRow for strategic param.
VTypeAttributeRow * myProbability
VTypeAttributeRow for Probability.
VTypeAttributeRow * myJMDriveRedSpeed
VTypeAttributeRow for Drive Red Speed.
VTypeAttributeRow * myLCAOvertakeDeltaSpeedFactor
VTypeAttributeRow for overtake deltaspeed factor.
FXTextField * myTextFieldVehicleTypeID
FXTextfield for vehicleTypeID.
VTypeAttributeRow * myLCAMaxSpeedLatFactor
VTypeAttributeRow for max speed lat factor.
VClassRow * myVClassRow
vehicle class row
VTypeAttributeRow * myLCAAssertive
VTypeAttributeRow for assertive.
VTypeAttributeRow * myJMImpatience
VTypeAttributeRow for Impatience.
VTypeAttributeRow * mySpeedFactor
VTypeAttributeRow for SpeedFactor.
long onCmdOpenAttributeDialog(FXObject *obj, FXSelector, void *)
@event called after press a button dialog
VTypeAttributeRow * myLCAPushy
VTypeAttributeRow for pushy.
void buildJunctionModelAttributesB(FXVerticalFrame *column)
build JunctionModel attributes (B)
void buildAttributesB(FXVerticalFrame *column)
build common attributes (B)
VTypeAttributeRow * myActionStepLength
VTypeAttributeRow for ActionStepLength.
VTypeAttributeRow * myLCAOppositeParam
VTypeAttributeRow for opposite param.
long onCmdSetAttribute(FXObject *, FXSelector, void *)
VTypeAttributeRow * myLoadingDuration
VTypeAttributeRow for LoadingDuration.
VShapeRow * myVShapeRow
vehicle shape row
VTypeAttributeRow * myLCACooperativeParam
VTypeAttributeRow for cooperative param.
VTypeAttributeRow * myWidth
VTypeAttributeRow for Width.
VTypeAttributeRow * myJMIgnoreKeepclearTime
VTypeAttributeRow for Ignore Keep Clear Time.
VTypeAttributeRow * myLCAPushygap
VTypeAttributeRow for pushy gap.
VTypeAttributeRow * myPersonCapacity
VTypeAttributeRow for PersonCapacity.
VTypeAttributeRow * myColor
VTypeAttributeRow for color.
VTypeAttributeRow * myLCALookAheadLeft
VTypeAttributeRow for look ahead left.
VTypeAttributeRow * myLCAImpatience
VTypeAttributeRow for impatience.
VTypeAttributeRow * myLatAlignment
VTypeAttributeRow for LatAlignment.
VTypeAttributeRow * myLCATurnAlignmentDistance
VTypeAttributeRow for turn alignment distance.
VTypeAttributeRow * myLCASpeedGainRight
VTypeAttributeRow for speed gain right.
void buildLaneChangeModelAttributes(FXVerticalFrame *column)
build LaneChangeModel attributes
VTypeAttributeRow * myDesiredMaxSpeed
VTypeAttributeRow for desired max speed.
long onCmdOpenParametersEditor(FXObject *obj, FXSelector, void *)
@event called after press a button dialog
VTypeAttributeRow * myLCASublaneParam
VTypeAttributeRow for sublane param.
VTypeAttributeRow * myBoardingDuration
VTypeAttributeRow for BoardingDuration.
VTypeAttributes(GNEVehicleTypeDialog *vehicleTypeDialog, FXHorizontalFrame *column)
constructor
VTypeAttributeRow * myLength
VTypeAttributeRow for Length.
GNEVehicleTypeDialog(const GNEVehicleTypeDialog &)=delete
Invalidated copy constructor.
void runInternalTest(const InternalTestStep::DialogArgument *dialogArgument)
run internal test
SumoXMLAttr myInvalidAttr
current sumo attribute invalid
bool myVehicleTypeValid
flag to check if current vehicleType is valid
VTypeAttributes * myVTypeAttributes
Vehicle Type Common Attributes.
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
CarFollowingModelParameters * myCarFollowingModelParameters
Car Following model parameters.
long onCmdAccept(FXObject *, FXSelector, void *)
event after press accept button
GNEVehicleTypeDialog(GNEDemandElement *vehicleType)
constructor
GNEVehicleTypeDialog & operator=(const GNEVehicleTypeDialog &)=delete
Invalidated assignment operator.
dialog arguments, used for certain modal dialogs that can not be edited using tab
std::map< std::string, std::string > Map
parameters map
every row value