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.dev/sumo
3 // Copyright (C) 2001-2024 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 
26 #include "GNEDemandElementDialog.h"
27 
28 // ===========================================================================
29 // class declarations
30 // ===========================================================================
31 
32 class GNEVType;
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
37 
47 
48 public:
50  class VTypeAttributes : protected FXVerticalFrame {
53 
54  public:
56  class VClassRow : protected FXHorizontalFrame {
57 
58  public:
60  VClassRow(VTypeAttributes* VTypeAttributesParent, FXVerticalFrame* column);
61 
64 
67 
68  private:
71 
74 
77 
79  void setVClassLabelImage();
80  };
81 
83  class VShapeRow : protected FXHorizontalFrame {
84 
85  public:
87  VShapeRow(VTypeAttributes* VTypeAttributesParent, 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 
118  enum RowAttrType {
124  };
125 
127  VTypeAttributeRow(VTypeAttributes* VTypeAttributesParent, 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  std::string filterAttributeName(const SumoXMLAttr attr) const;
186  };
187 
189  VTypeAttributes(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(VTypeAttributes)
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 
603 
606 
609 
612 
615 
618 
621 
624 
627  };
628 
630  GNEVehicleTypeDialog(GNEDemandElement* editedVehicleType, bool updatingElement);
631 
634 
638  long onCmdAccept(FXObject*, FXSelector, void*);
639 
641  long onCmdCancel(FXObject*, FXSelector, void*);
642 
644  long onCmdReset(FXObject*, FXSelector, void*);
645 
647 
648 private:
651 
654 
657 
660 
663 
666 };
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.
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 * 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.
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.
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.
CarFollowingModelRow * myMinGapFactorRow
Row for MinGapFactor.
VClassRow(VTypeAttributes *VTypeAttributesParent, FXVerticalFrame *column)
constructor
SUMOVehicleClass setVariable()
set vehicle class
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 * myCarriageGap
VTypeAttributeRow for carriage GAP.
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 * myCarriageLength
VTypeAttributeRow for carriage length.
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 * myLocomotiveLength
VTypeAttributeRow for locomotive length.
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.
Dialog for editing calibrator vehicle types.
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
VTypeAttributes * myVTypeAttributes
Vehicle Type Common Attributes.
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
GNEVehicleTypeDialog & operator=(const GNEVehicleTypeDialog &)=delete
Invalidated assignment operator.
CarFollowingModelParameters * myCarFollowingModelParameters
Car Following model parameters.
GNEVehicleTypeDialog(GNEDemandElement *editedVehicleType, bool updatingElement)
constructor
long onCmdAccept(FXObject *, FXSelector, void *)
ComboBox with icon.
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
every row value