SUMO - Simulation of Urban MObility
GNECalibratorVehicleTypeDialog.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // Dialog for edit calibrator vehicleTypes
18 /****************************************************************************/
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #ifdef _MSC_VER
24 #include <windows_config.h>
25 #else
26 #include <config.h>
27 #endif
28 
29 #include <iostream>
34 
36 #include "GNECalibrator.h"
37 #include "GNEEdge.h"
38 #include "GNELane.h"
39 #include "GNEViewNet.h"
40 #include "GNENet.h"
42 #include "GNEUndoList.h"
44 
45 
46 // ===========================================================================
47 // FOX callback mapping
48 // ===========================================================================
49 
50 FXDEFMAP(GNECalibratorVehicleTypeDialog) GNECalibratorVehicleTypeDialogMap[] = {
52 };
53 
54 // Object implementation
55 FXIMPLEMENT(GNECalibratorVehicleTypeDialog, GNEAdditionalDialog, GNECalibratorVehicleTypeDialogMap, ARRAYNUMBER(GNECalibratorVehicleTypeDialogMap))
56 
57 // ===========================================================================
58 // member method definitions
59 // ===========================================================================
60 
61 GNECalibratorVehicleTypeDialog::GNECalibratorVehicleTypeDialog(GNECalibratorVehicleType* editedCalibratorVehicleType, bool updatingElement) :
62  GNEAdditionalDialog(editedCalibratorVehicleType->getCalibratorParent(), 500, 370),
63  myEditedCalibratorVehicleType(editedCalibratorVehicleType),
64  myUpdatingElement(updatingElement),
65  myCalibratorVehicleTypeValid(true),
66  myInvalidAttr(SUMO_ATTR_NOTHING) {
67  // change default header
68  std::string typeOfOperation = myUpdatingElement ? "Edit " + toString(myEditedCalibratorVehicleType->getTag()) + " of " : "Create " + toString(myEditedCalibratorVehicleType->getTag()) + " for ";
69  changeAdditionalDialogHeader(typeOfOperation + toString(myEditedCalibratorVehicleType->getCalibratorParent()->getTag()) + " '" + myEditedCalibratorVehicleType->getCalibratorParent()->getID() + "'");
70 
71  // Create auxiliar frames for values
72  FXHorizontalFrame* columns = new FXHorizontalFrame(myContentFrame, GUIDesignUniformHorizontalFrame);
73  FXVerticalFrame* columnLeftLabel = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
74  FXVerticalFrame* columnLeftValues = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
75  FXVerticalFrame* columnRightLabel = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
76  FXVerticalFrame* columnRightValues = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
77 
78  // create FXComboBox for VClass
79  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_VCLASS).c_str(), 0, GUIDesignLabelThick);
80  myComboBoxVClass = new FXComboBox(columnLeftLabel, GUIDesignComboBoxNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignComboBox);
81  myComboBoxVClassLabelImage = new FXLabel(columnLeftValues, "", 0, GUIDesignLabelIconExtendedx46Ticked);
82  myComboBoxVClassLabelImage->setBackColor(FXRGBA(255, 255, 255, 255));
83  // fill combo Box with all VClass
84  std::vector<std::string> VClassStrings = SumoVehicleClassStrings.getStrings();
85  for (auto i : VClassStrings) {
86  if (i != SumoVehicleClassStrings.getString(SVC_IGNORING)) {
87  myComboBoxVClass->appendItem(i.c_str());
88  }
89  }
90  // only show 10 VClasses
91  myComboBoxVClass->setNumVisible(10);
92 
93  // create combo bof for vehicle shapes
94  new FXLabel(columnRightLabel, toString(SUMO_ATTR_GUISHAPE).c_str(), 0, GUIDesignLabelThick);
95  myComboBoxShape = new FXComboBox(columnRightLabel, GUIDesignComboBoxNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignComboBox);
96  myComboBoxShapeLabelImage = new FXLabel(columnRightValues, "", 0, GUIDesignLabelIconExtendedx46Ticked);
97  myComboBoxShapeLabelImage->setBackColor(FXRGBA(255, 255, 255, 255));
98  // fill combo Box with all vehicle shapes
99  std::vector<std::string> VShapeStrings = SumoVehicleShapeStrings.getStrings();
100  for (auto i : VShapeStrings) {
101  if (i != SumoVehicleShapeStrings.getString(SVS_UNKNOWN)) {
102  myComboBoxShape->appendItem(i.c_str());
103  }
104  }
105  // only show 10 Shapes
106  myComboBoxShape->setNumVisible(10);
107 
108  // 01 create FXTextField and Label for vehicleTypeID
109  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ID).c_str(), 0, GUIDesignLabelThick);
110  myTextFieldVehicleTypeID = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
111 
112  // 02 create FXTextField and Label for Accel
113  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ACCEL).c_str(), 0, GUIDesignLabelThick);
114  myTextFieldAccel = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
115 
116  // 03 create FXTextField and Label for Decel
117  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_DECEL).c_str(), 0, GUIDesignLabelThick);
118  myTextFieldDecel = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
119 
120  // 04 create FXTextField and Label for Sigma
121  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_SIGMA).c_str(), 0, GUIDesignLabelThick);
122  myTextFieldSigma = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
123 
124  // 05 create FXTextField and Label for Tau
125  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_TAU).c_str(), 0, GUIDesignLabelThick);
126  myTextFieldTau = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
127 
128  // 06 create FXTextField and Label for Length
129  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_LENGTH).c_str(), 0, GUIDesignLabelThick);
130  myTextFieldLength = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
131 
132  // 07 create FXTextField and Label for MinGap
133  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_MINGAP).c_str(), 0, GUIDesignLabelThick);
134  myTextFieldMinGap = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
135 
136  // 08 create FXTextField and Label for MaxSpeed
137  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_MAXSPEED).c_str(), 0, GUIDesignLabelThick);
138  myTextFieldMaxSpeed = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
139 
140  // 09 create FXTextField and Label for SpeedFactor
141  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_SPEEDFACTOR).c_str(), 0, GUIDesignLabelThick);
142  myTextFieldSpeedFactor = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
143 
144  // 10 create FXTextField and Label for SpeedDev
145  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_SPEEDDEV).c_str(), 0, GUIDesignLabelThick);
146  myTextFieldSpeedDev = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
147 
148  // 11 create FXTextField and Label for Color
149  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_COLOR).c_str(), 0, GUIDesignLabelThick);
150  myTextFieldColor = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
151 
152  // 12 create FXTextField and Label for EmissionClass
153  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_EMISSIONCLASS).c_str(), 0, GUIDesignLabelThick);
154  myTextFieldEmissionClass = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
155 
156  // 01 create FXTextField and Label for Width
157  new FXLabel(columnRightLabel, toString(SUMO_ATTR_WIDTH).c_str(), 0, GUIDesignLabelThick);
158  myTextFieldWidth = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
159 
160  // 02 create FXTextField and Label for Filename
161  new FXLabel(columnRightLabel, toString(SUMO_ATTR_IMGFILE).c_str(), 0, GUIDesignLabelThick);
162  myTextFieldFilename = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
163 
164  // 03 create FXTextField and Label for Impatience
165  new FXLabel(columnRightLabel, toString(SUMO_ATTR_IMPATIENCE).c_str(), 0, GUIDesignLabelThick);
166  myTextFieldImpatience = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
167 
168  // 04 create FXTextField and Label for LaneChangeModel
169  new FXLabel(columnRightLabel, toString(SUMO_ATTR_LANE_CHANGE_MODEL).c_str(), 0, GUIDesignLabelThick);
170  myTextFieldLaneChangeModel = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
171 
172  // 05 create FXTextField and Label for CarFollowModel
173  new FXLabel(columnRightLabel, toString(SUMO_ATTR_CAR_FOLLOW_MODEL).c_str(), 0, GUIDesignLabelThick);
174  myTextFieldCarFollowModel = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
175 
176  // 06 create FXTextField and Label for PersonCapacity
177  new FXLabel(columnRightLabel, toString(SUMO_ATTR_PERSON_CAPACITY).c_str(), 0, GUIDesignLabelThick);
178  myTextFieldPersonCapacity = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldInt);
179 
180  // 07 create FXTextField and Label for ContainerCapacity
181  new FXLabel(columnRightLabel, toString(SUMO_ATTR_CONTAINER_CAPACITY).c_str(), 0, GUIDesignLabelThick);
182  myTextFieldContainerCapacity = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldInt);
183 
184  // 08 create FXTextField and Label for BoardingDuration
185  new FXLabel(columnRightLabel, toString(SUMO_ATTR_BOARDING_DURATION).c_str(), 0, GUIDesignLabelThick);
186  myTextFieldBoardingDuration = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
187 
188  // 09 create FXTextField and Label for LoadingDuration
189  new FXLabel(columnRightLabel, toString(SUMO_ATTR_LOADING_DURATION).c_str(), 0, GUIDesignLabelThick);
190  myTextFieldLoadingDuration = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
191 
192  // 10 create FXTextField and Label for LatAlignment
193  new FXLabel(columnRightLabel, toString(SUMO_ATTR_LATALIGNMENT).c_str(), 0, GUIDesignLabelThick);
194  myTextFieldLatAlignment = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
195 
196  // 11 create FXTextField and Label for MinGapLat
197  new FXLabel(columnRightLabel, toString(SUMO_ATTR_MINGAP_LAT).c_str(), 0, GUIDesignLabelThick);
198  myTextFieldMinGapLat = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
199 
200  // 12 create FXTextField and Label for MaxSpeedLat
201  new FXLabel(columnRightLabel, toString(SUMO_ATTR_MAXSPEED_LAT).c_str(), 0, GUIDesignLabelThick);
202  myTextFieldMaxSpeedLat = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
203 
204  // update fields
205  updateCalibratorVehicleTypeValues();
206 
207  // start a undo list for editing local to this additional
208  initChanges();
209 
210  // add element if we aren't updating an existent element
211  if (myUpdatingElement == false) {
212  myEditedCalibratorVehicleType->getCalibratorParent()->getViewNet()->getUndoList()->add(new GNEChange_CalibratorItem(myEditedCalibratorVehicleType, true), true);
213  }
214 
215  // open as modal dialog
216  openAsModalDialog();
217 }
218 
219 
221 
222 
223 long
224 GNECalibratorVehicleTypeDialog::onCmdAccept(FXObject*, FXSelector, void*) {
225  if (myCalibratorVehicleTypeValid == false) {
226  // write warning if netedit is running in testing mode
227  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
228  WRITE_WARNING("Opening FXMessageBox of type 'warning'");
229  }
230  std::string operation1 = myUpdatingElement ? ("updating") : ("creating");
231  std::string operation2 = myUpdatingElement ? ("updated") : ("created");
232  std::string parentTagString = toString(myEditedCalibratorVehicleType->getCalibratorParent()->getTag());
233  std::string tagString = toString(myEditedCalibratorVehicleType->getTag());
234  // open warning dialogBox
235  FXMessageBox::warning(getApp(), MBOX_OK,
236  ("Error " + operation1 + " " + parentTagString + "'s " + tagString).c_str(), "%s",
237  (parentTagString + "'s " + tagString + " cannot be " + operation2 +
238  " because parameter " + toString(myInvalidAttr) +
239  " is invalid.").c_str());
240  // write warning if netedit is running in testing mode
241  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
242  WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'");
243  }
244  return 0;
245  } else {
246  // accept changes before closing dialog
247  acceptChanges();
248  // stop dialgo sucesfully
249  getApp()->stopModal(this, TRUE);
250  return 1;
251  }
252 }
253 
254 
255 long
256 GNECalibratorVehicleTypeDialog::onCmdCancel(FXObject*, FXSelector, void*) {
257  // cancel changes
258  cancelChanges();
259  // Stop Modal
260  getApp()->stopModal(this, FALSE);
261  return 1;
262 }
263 
264 
265 long
266 GNECalibratorVehicleTypeDialog::onCmdReset(FXObject*, FXSelector, void*) {
267  // reset changes
268  resetChanges();
269  // update fields
271  return 1;
272 }
273 
274 
275 long
277  // At start we assumed, that all values are valid
280  // get pointer to undo list (Only for code legilibity)
282  // set color of myComboBoxShape, depending if current value is valid or not
284  myComboBoxShape->setTextColor(FXRGB(0, 0, 0));
286  } else {
287  myComboBoxShape->setTextColor(FXRGB(255, 0, 0));
290  }
291  // set color of myComboBoxVClass, depending if current value is valid or not
293  myComboBoxVClass->setTextColor(FXRGB(0, 0, 0));
296  } else {
297  myComboBoxVClass->setTextColor(FXRGB(255, 0, 0));
300  }
301  // set color of myTextFieldVehicleTypeID, depending if current value is valid or not
303  myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0));
306  myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0));
308  } else {
309  myTextFieldVehicleTypeID->setTextColor(FXRGB(255, 0, 0));
312  }
313  // set color of myTextFieldAccel, depending if current value is valid or not
315  myTextFieldAccel->setTextColor(FXRGB(0, 0, 0));
317  } else {
318  myTextFieldAccel->setTextColor(FXRGB(255, 0, 0));
321  }
322  // set color of myTextFieldDecel, depending if current value is valid or not
324  myTextFieldDecel->setTextColor(FXRGB(0, 0, 0));
326  } else {
327  myTextFieldDecel->setTextColor(FXRGB(255, 0, 0));
330  }
331  // set color of myTextFieldSigma, depending if current value is valid or not
333  myTextFieldSigma->setTextColor(FXRGB(0, 0, 0));
335  } else {
336  myTextFieldSigma->setTextColor(FXRGB(255, 0, 0));
339  }
340  // set color of myTextFieldTau, depending if current value is valid or not
342  myTextFieldTau->setTextColor(FXRGB(0, 0, 0));
344  } else {
345  myTextFieldTau->setTextColor(FXRGB(255, 0, 0));
348  }
349  // set color of myTextFieldLength, depending if current value is valid or not
351  myTextFieldLength->setTextColor(FXRGB(0, 0, 0));
353  } else {
354  myTextFieldLength->setTextColor(FXRGB(255, 0, 0));
357  }
358  // set color of myTextFieldMinGap, depending if current value is valid or not
360  myTextFieldMinGap->setTextColor(FXRGB(0, 0, 0));
362  } else {
363  myTextFieldMinGap->setTextColor(FXRGB(255, 0, 0));
366  }
367  // set color of myTextFieldMaxSpeed, depending if current value is valid or not
369  myTextFieldMaxSpeed->setTextColor(FXRGB(0, 0, 0));
371  } else {
372  myTextFieldMaxSpeed->setTextColor(FXRGB(255, 0, 0));
375  }
376  // set color of myTextFieldSpeedFactor, depending if current value is valid or not
378  myTextFieldSpeedFactor->setTextColor(FXRGB(0, 0, 0));
380  } else {
381  myTextFieldSpeedFactor->setTextColor(FXRGB(255, 0, 0));
384  }
385  // set color of myTextFieldSpeedDev, depending if current value is valid or not
387  myTextFieldSpeedDev->setTextColor(FXRGB(0, 0, 0));
389  } else {
390  myTextFieldSpeedDev->setTextColor(FXRGB(255, 0, 0));
393  }
394  // set color of myTextFieldColor, depending if current value is valid or not
396  myTextFieldColor->setTextColor(FXRGB(0, 0, 0));
398  } else {
399  myTextFieldColor->setTextColor(FXRGB(255, 0, 0));
402  }
403  // set color of myTextFieldEmissionClass, depending if current value is valid or not
405  myTextFieldEmissionClass->setTextColor(FXRGB(0, 0, 0));
407  } else {
408  myTextFieldEmissionClass->setTextColor(FXRGB(255, 0, 0));
411  }
412  // set color of myTextFieldWidth, depending if current value is valid or not
414  myTextFieldWidth->setTextColor(FXRGB(0, 0, 0));
416  } else {
417  myTextFieldWidth->setTextColor(FXRGB(255, 0, 0));
420  }
421  // set color of myTextFieldFilename, depending if current value is valid or not
423  myTextFieldFilename->setTextColor(FXRGB(0, 0, 0));
425  } else {
426  myTextFieldFilename->setTextColor(FXRGB(255, 0, 0));
429  }
430  // set color of myTextFieldImpatience, depending if current value is valid or not
432  myTextFieldImpatience->setTextColor(FXRGB(0, 0, 0));
434  } else {
435  myTextFieldImpatience->setTextColor(FXRGB(255, 0, 0));
438  }
439  // set color of myTextFieldLaneChangeModel, depending if current value is valid or not
441  myTextFieldLaneChangeModel->setTextColor(FXRGB(0, 0, 0));
443  } else {
444  myTextFieldLaneChangeModel->setTextColor(FXRGB(255, 0, 0));
447  }
448  // set color of myTextFieldCarFollowModel, depending if current value is valid or not
450  myTextFieldCarFollowModel->setTextColor(FXRGB(0, 0, 0));
452  } else {
453  myTextFieldCarFollowModel->setTextColor(FXRGB(255, 0, 0));
456  }
457  // set color of myTextFieldPersonCapacity, depending if current value is valid or not
459  myTextFieldPersonCapacity->setTextColor(FXRGB(0, 0, 0));
461  } else {
462  myTextFieldPersonCapacity->setTextColor(FXRGB(255, 0, 0));
465  }
466  // set color of myTextFieldContainerCapacity, depending if current value is valid or not
468  myTextFieldContainerCapacity->setTextColor(FXRGB(0, 0, 0));
470  } else {
471  myTextFieldContainerCapacity->setTextColor(FXRGB(255, 0, 0));
474  }
475  // set color of myTextFieldBoardingDuration, depending if current value is valid or not
477  myTextFieldBoardingDuration->setTextColor(FXRGB(0, 0, 0));
479  } else {
480  myTextFieldBoardingDuration->setTextColor(FXRGB(255, 0, 0));
483  }
484  // set color of myTextFieldLoadingDuration, depending if current value is valid or not
486  myTextFieldLoadingDuration->setTextColor(FXRGB(0, 0, 0));
488  } else {
489  myTextFieldLoadingDuration->setTextColor(FXRGB(255, 0, 0));
492  }
493  // set color of myTextFieldLatAlignment, depending if current value is valid or not
495  myTextFieldLatAlignment->setTextColor(FXRGB(0, 0, 0));
497  } else {
498  myTextFieldLatAlignment->setTextColor(FXRGB(255, 0, 0));
501  }
502  // set color of myTextFieldMinGapLat, depending if current value is valid or not
504  myTextFieldMinGapLat->setTextColor(FXRGB(0, 0, 0));
506  } else {
507  myTextFieldMinGapLat->setTextColor(FXRGB(255, 0, 0));
510  }
511  // set color of myTextFieldVehicleTypeID, depending if current value is valid or not
513  myTextFieldMaxSpeedLat->setTextColor(FXRGB(0, 0, 0));
515  } else {
516  myTextFieldMaxSpeedLat->setTextColor(FXRGB(255, 0, 0));
519  }
520  return 1;
521 }
522 
523 
524 void
526  //set values of myEditedCalibratorVehicleType int fields
553  // set image labels
555 }
556 
557 
558 void
560  // set Icon in label depending of current VClass
562  case SVC_PRIVATE:
564  break;
565  case SVC_EMERGENCY:
567  break;
568  case SVC_AUTHORITY:
570  break;
571  case SVC_ARMY:
573  break;
574  case SVC_VIP:
576  break;
577  case SVC_PASSENGER:
579  break;
580  case SVC_HOV:
582  break;
583  case SVC_TAXI:
585  break;
586  case SVC_BUS:
588  break;
589  case SVC_COACH:
591  break;
592  case SVC_DELIVERY:
594  break;
595  case SVC_TRUCK:
597  break;
598  case SVC_TRAILER:
600  break;
601  case SVC_TRAM:
603  break;
604  case SVC_RAIL_URBAN:
606  break;
607  case SVC_RAIL:
609  break;
610  case SVC_RAIL_ELECTRIC:
612  break;
613  case SVC_MOTORCYCLE:
615  break;
616  case SVC_MOPED:
618  break;
619  case SVC_BICYCLE:
621  break;
622  case SVC_PEDESTRIAN:
624  break;
625  case SVC_E_VEHICLE:
627  break;
628  case SVC_SHIP:
630  break;
631  case SVC_CUSTOM1:
633  break;
634  case SVC_CUSTOM2:
636  break;
637  default:
639  break;
640  }
641 }
642 
643 /****************************************************************************/
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
FXTextField * myTextFieldSpeedFactor
FXTextfield for SpeedFactor.
long onCmdSetVariable(FXObject *, FXSelector, void *)
after change a variable of vehicle type
void resetChanges()
reset changes did in this dialog.
FXComboBox * myComboBoxVClass
FXComboBox for VClass.
vehicle is a motorcycle
vehicle is a coach
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:199
FXTextField * myTextFieldMinGapLat
FXTextfield for MinGapLat.
is a pedestrian
FXTextField * myTextFieldLoadingDuration
FXTextfield for LoadingDuration.
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false)
FXTextField * myTextFieldAccel
FXTextfield for Accel.
vehicle is a not electrified rail
FXTextField * myTextFieldFilename
FXTextfield for Filename.
vehicle is a bicycle
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
vehicle is a small delivery vehicle
Dialog to edit sequences, parameters, etc.. of Additionals.
FXTextField * myTextFieldVehicleTypeID
FXTextfield for vehicleTypeID.
vehicle is a light rail
FXTextField * myTextFieldMaxSpeed
FXTextfield for MaxSpeed.
FXTextField * myTextFieldWidth
FXTextfield for Width.
FXComboBox * myComboBoxShape
FXComboBox for Shape.
FXTextField * myTextFieldBoardingDuration
FXTextfield for BoardingDuration.
vehicle is a HOV
#define GUIDesignLabelIconExtendedx46Ticked
label ticked filled extended over frame used for VClasses. can be used by icons of 64x32 pixels ...
Definition: GUIDesigns.h:179
vehicle is a (possibly fast moving) electric rail
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:199
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:64
authorities vehicles
vehicle is a city rail
vehicle is a large transport vehicle
is a user-defined type
#define GUIDesignComboBox
Definition: GUIDesigns.h:189
void updateCalibratorVehicleTypeValues()
update data fields
GNEUndoList * getUndoList() const
get the undoList object
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
Definition: GUIDesigns.h:243
bool isValid(SumoXMLAttr key, const std::string &value)
FXTextField * myTextFieldLatAlignment
FXTextfield for LatAlignment.
#define GUIDesignTextField
Definition: GUIDesigns.h:40
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:55
#define GUIDesignUniformHorizontalFrame
design for horizontal frame used to pack another frames with a uniform width
Definition: GUIDesigns.h:252
FXTextField * myTextFieldLaneChangeModel
FXTextfield for LaneChangeModel.
army vehicles
private vehicles
not defined
bool myUpdatingElement
flag to indicate if flow are being created or modified
FXTextField * myTextFieldPersonCapacity
FXTextfield for PersonCapacity.
SumoXMLAttr myInvalidAttr
current sumo attribute invalid
FXTextField * myTextFieldColor
FXTextfield for Color.
Dialog for edit rerouter intervals.
invalid attribute
FXTextField * myTextFieldSigma
FXTextfield for Sigma.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
FXTextField * myTextFieldImpatience
FXTextfield for Impatience.
vehicle is a passenger car (a "normal" car)
bool myCalibratorVehicleTypeValid
flag to check if current calibrator vehicleType is valid
FXTextField * myTextFieldEmissionClass
FXTextfield for EmissionClass.
is an arbitrary ship
vehicle is a moped
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:49
vehicle is a taxi
vehicle is a bus
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
void acceptChanges()
Accept changes did in this dialog.
FXTextField * myTextFieldContainerCapacity
FXTextfield for ContainerCapacity.
long onCmdAccept(FXObject *, FXSelector, void *)
vip vehicles
FXTextField * myTextFieldTau
FXTextfield for Tau.
void cancelChanges()
Cancel changes did in this dialog.
vehicle is a large transport vehicle
#define GUIDesignLabelThick
label extended over frame with thick and with text justify to left and height of 23 ...
Definition: GUIDesigns.h:152
#define GUIDesignTextFieldInt
text field extended over Frame with thick frame and limited to Integers
Definition: GUIDesigns.h:43
FXTextField * myTextFieldMinGap
FXTextfield for MinGap.
FXTextField * myTextFieldCarFollowModel
FXTextfield for CarFollowModel.
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to Doubles/doubles
Definition: GUIDesigns.h:46
GNECalibrator * getCalibratorParent() const
get pointer to calibrator parent
FXDEFMAP(GNECalibratorVehicleTypeDialog) GNECalibratorVehicleTypeDialogMap[]
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
public emergency vehicles
A color information.
FXTextField * myTextFieldLength
FXTextfield for Length.
FXTextField * myTextFieldSpeedDev
FXTextfield for SpeedDev.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
vehicles ignoring classes
GNECalibratorVehicleType * myEditedCalibratorVehicleType
pointer to original calibrator vehicle type
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
FXTextField * myTextFieldMaxSpeedLat
FXTextfield for MaxSpeedLat.
is a user-defined type
FXTextField * myTextFieldDecel
FXTextfield for Decel.
FXLabel * myComboBoxVClassLabelImage
label with image of VClass
SumoXMLTag getTag() const
get XML Tag assigned to this object
is an electric vehicle