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-2020 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 
24 
25 #include "GNEDemandElementDialog.h"
26 
27 // ===========================================================================
28 // class declarations
29 // ===========================================================================
30 
31 class GNEVehicleType;
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
36 
43 
44 public:
46  class VTypeAtributes : protected FXVerticalFrame {
49 
50  public:
52  class VClassRow : protected FXHorizontalFrame {
53 
54  public:
56  VClassRow(VTypeAtributes* VTypeAtributesParent, FXVerticalFrame* column);
57 
60 
63 
64  private:
67 
69  FXComboBox* myComboBoxVClass;
70 
73 
75  void setVClassLabelImage();
76  };
77 
79  class VShapeRow : protected FXHorizontalFrame {
80 
81  public:
83  VShapeRow(VTypeAtributes* VTypeAtributesParent, FXVerticalFrame* column);
84 
86  void setVariable();
87 
89  void updateValues();
90 
91  private:
94 
96  FXComboBox* myComboBoxShape;
97 
100 
102  void setVShapeLabelImage();
103 
104  };
105 
107  class VTypeAttributeRow : private FXHorizontalFrame {
108  public:
109 
111  enum RowAttrType {
117  };
118 
120  VTypeAttributeRow(VTypeAtributes* VTypeAtributesParent, 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 
172  FXComboBox* myComboBox;
173 
175  std::map<std::string, std::string> myParameters;
176 
178  FXString filterAttributeName(const SumoXMLAttr attr) const;
179  };
180 
182  VTypeAtributes(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(VTypeAtributes)
217 
218 
220 
223 
226 
229 
232 
235 
238 
241 
244 
247 
250 
253 
256 
259 
262 
265 
268 
271 
274 
277 
280 
283 
286 
289 
292 
295 
298 
301 
304 
306 
309 
312 
315 
318 
321 
324 
327 
330 
333 
336 
339 
341 
342 
345 
348 
351 
354 
357 
360 
363 
366 
369 
372 
375 
378 
381 
384 
387 
390 
393 
396 
399 
401  /* VTypeAttributeRow* myLCAExperimental; */
402 
404 
405  private:
408  };
409 
411  class CarFollowingModelParameters : public FXGroupBox {
414 
415  public:
417  CarFollowingModelParameters(GNEVehicleTypeDialog* vehicleTypeDialog, FXHorizontalFrame* column);
418 
420  void refreshCFMFields();
421 
423  void updateValues();
424 
428  long onCmdSetVariable(FXObject*, FXSelector, void*);
430 
431  protected:
432  FOX_CONSTRUCTOR(CarFollowingModelParameters)
433 
434 
435  class CarFollowingModelRow : public FXHorizontalFrame {
436  public:
438  CarFollowingModelRow(CarFollowingModelParameters* carFollowingModelParametersParent, FXVerticalFrame* verticalFrame, SumoXMLAttr attr);
439 
441  void setVariable();
442 
444  void updateValue();
445 
446  private:
449 
452 
454  FXTextField* myTextField;
455  };
456 
457  private:
460 
462  std::vector<CarFollowingModelRow*> myRows;
463 
466 
468  FXVerticalFrame* myVerticalFrameRows;
469 
472 
475 
478 
481 
484 
487 
490 
493 
496 
499 
502 
505 
508 
511 
514 
517 
520 
523 
526 
529 
532 
535 
538 
541  };
542 
544  GNEVehicleTypeDialog(GNEDemandElement* editedVehicleType, bool updatingElement);
545 
548 
552  long onCmdAccept(FXObject*, FXSelector, void*);
553 
555  long onCmdCancel(FXObject*, FXSelector, void*);
556 
558  long onCmdReset(FXObject*, FXSelector, void*);
559 
561  long onCmdSetVariable(FXObject*, FXSelector, void*);
563 
564 private:
567 
570 
573 
576 
579 
582 };
583 
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 belongs to GNENet but has influency 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 * mySteppingRow
Row for MinGap(only for IDM)
FXLabel * myLabelIncompleteAttribute
temporal label for incomplete attributes
GNEVehicleTypeDialog * myVehicleTypeDialog
pointer to Vehicle Type dialog parent
CarFollowingModelRow * mySecurityRow
Row for Security (only for Wiedemann)
CarFollowingModelRow * myAccelRow
Row for Accel.
CarFollowingModelRow * myAprobRow
Row for Aprob.
CarFollowingModelRow * myKRow
Row for MinGap (only for Kerner)
CarFollowingModelRow * myAdaptFactorRow
Row for Adapt Factor.
FXVerticalFrame * myVerticalFrameRows
Vertical Frame for CarFollowingModelRow.
CarFollowingModelRow * myApparentDecelRow
Row for aparent Decel.
CarFollowingModelRow * myDecelRow
Row for Decel.
std::vector< CarFollowingModelRow * > myRows
vector with the Car Following Model Row
FXComboBox * myComboBoxCarFollowModel
Row for CarFollowModel.
CarFollowingModelRow * myEmergencyDecelRow
Row for emergency Decel.
CarFollowingModelRow * myTrainTypeRow
Row for TrainType.
CarFollowingModelRow * myEstimationRow
Row for Estimation (only for Wiedemann)
CarFollowingModelRow * mySigmaRow
Row for Sigma.
CarFollowingModelRow * myAdaptTimeRow
Row for Adapt Time.
CarFollowingModelRow * myDeltaRow
Row for MinGap (only for IDM)
CarFollowingModelRow * myTrauLastRow
Row for TauLast.
CarFollowingModelRow * myMinGapFactorRow
Row for MinGapFactor.
FXComboBox * myComboBoxVClass
FXComboBox for VClass.
FXLabel * myComboBoxVClassLabelImage
label with image of VClass
VTypeAtributes * myVTypeAtributesParent
pointer to VTypeAtributes parent
SUMOVehicleClass setVariable()
set vehicle class
VClassRow(VTypeAtributes *VTypeAtributesParent, FXVerticalFrame *column)
constructor
VShapeRow(VTypeAtributes *VTypeAtributesParent, FXVerticalFrame *column)
constructor
FXLabel * myComboBoxShapeLabelImage
label with image of Shape
VTypeAtributes * myVTypeAtributesParent
pointer to VTypeAtributes parent
FXComboBox * myComboBoxShape
FXComboBox for Shape.
class used for represent rows with Vehicle Type parameters
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
FXComboBox * myComboBox
ComboBox for attributes with limited values.
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 Variablen 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
std::map< std::string, std::string > myParameters
pointer to current parameter map
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 * myLCATurnAlignmentDistance
VTypeAttributeRow for turn alignment distance.
long onCmdSetAttribute(FXObject *, FXSelector, void *)
VTypeAttributeRow * myLCALookAheadLeft
VTypeAttributeRow for loock 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 * mySpeedDev
VTypeAttributeRow for SpeedDev.
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.
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 * 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 edit rerouter intervals.
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
GNEVehicleTypeDialog & operator=(const GNEVehicleTypeDialog &)=delete
Invalidated assignment operator.
CarFollowingModelParameters * myCarFollowingModelParameters
Car Following model parameters.
GNEVehicleTypeDialog(GNEDemandElement *editedVehicleType, bool updatingElement)
constructor
long onCmdSetVariable(FXObject *, FXSelector, void *)
@event after change a variable of vehicle type
long onCmdAccept(FXObject *, FXSelector, void *)