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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // Dialog for edit calibrator vehicleTypes
16 /****************************************************************************/
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 #include <config.h>
22 
23 #include <iostream>
32 #include <netedit/GNEViewNet.h>
33 #include <netedit/GNENet.h>
35 #include <netedit/GNEUndoList.h>
36 
38 
39 
40 // ===========================================================================
41 // FOX callback mapping
42 // ===========================================================================
43 
44 FXDEFMAP(GNECalibratorVehicleTypeDialog) GNECalibratorVehicleTypeDialogMap[] = {
46 };
47 
48 // Object implementation
49 FXIMPLEMENT(GNECalibratorVehicleTypeDialog, GNEAdditionalDialog, GNECalibratorVehicleTypeDialogMap, ARRAYNUMBER(GNECalibratorVehicleTypeDialogMap))
50 
51 // ===========================================================================
52 // member method definitions
53 // ===========================================================================
54 
55 GNECalibratorVehicleTypeDialog::GNECalibratorVehicleTypeDialog(GNEAdditional* editedCalibratorVehicleType, bool updatingElement) :
56  GNEAdditionalDialog(editedCalibratorVehicleType, updatingElement, 500, 370),
57  myCalibratorVehicleTypeValid(true),
58  myInvalidAttr(SUMO_ATTR_NOTHING) {
59  // change default header
60  changeAdditionalDialogHeader(updatingElement ? "Edit " + myEditedAdditional->getTagStr() + " of " : "Create " + myEditedAdditional->getTagStr());
61 
62  // Create auxiliar frames for values
63  FXHorizontalFrame* columns = new FXHorizontalFrame(myContentFrame, GUIDesignUniformHorizontalFrame);
64  FXVerticalFrame* columnLeftLabel = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
65  FXVerticalFrame* columnLeftValues = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
66  FXVerticalFrame* columnRightLabel = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
67  FXVerticalFrame* columnRightValues = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
68 
69  // create FXComboBox for VClass
70  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_VCLASS).c_str(), nullptr, GUIDesignLabelThick);
71  myComboBoxVClass = new FXComboBox(columnLeftLabel, GUIDesignComboBoxNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignComboBox);
72  myComboBoxVClassLabelImage = new FXLabel(columnLeftValues, "", nullptr, GUIDesignLabelIconExtendedx46Ticked);
73  myComboBoxVClassLabelImage->setBackColor(FXRGBA(255, 255, 255, 255));
74  // fill combo Box with all VClass
75  std::vector<std::string> VClassStrings = SumoVehicleClassStrings.getStrings();
76  for (auto i : VClassStrings) {
77  if (i != SumoVehicleClassStrings.getString(SVC_IGNORING)) {
78  myComboBoxVClass->appendItem(i.c_str());
79  }
80  }
81  // only show 10 VClasses
82  myComboBoxVClass->setNumVisible(10);
83 
84  // create combo bof for vehicle shapes
85  new FXLabel(columnRightLabel, toString(SUMO_ATTR_GUISHAPE).c_str(), nullptr, GUIDesignLabelThick);
86  myComboBoxShape = new FXComboBox(columnRightLabel, GUIDesignComboBoxNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignComboBox);
87  myComboBoxShapeLabelImage = new FXLabel(columnRightValues, "", nullptr, GUIDesignLabelIconExtendedx46Ticked);
88  myComboBoxShapeLabelImage->setBackColor(FXRGBA(255, 255, 255, 255));
89  // fill combo Box with all vehicle shapes
90  std::vector<std::string> VShapeStrings = SumoVehicleShapeStrings.getStrings();
91  for (auto i : VShapeStrings) {
92  if (i != SumoVehicleShapeStrings.getString(SVS_UNKNOWN)) {
93  myComboBoxShape->appendItem(i.c_str());
94  }
95  }
96  // only show 10 Shapes
97  myComboBoxShape->setNumVisible(10);
98 
99  // 01 create FXTextField and Label for vehicleTypeID
100  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ID).c_str(), nullptr, GUIDesignLabelThick);
101  myTextFieldVehicleTypeID = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
102 
103  // 02 create FXTextField and Label for Accel
104  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ACCEL).c_str(), nullptr, GUIDesignLabelThick);
105  myTextFieldAccel = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
106 
107  // 03 create FXTextField and Label for Decel
108  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_DECEL).c_str(), nullptr, GUIDesignLabelThick);
109  myTextFieldDecel = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
110 
111  // 04 create FXTextField and Label for Sigma
112  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_SIGMA).c_str(), nullptr, GUIDesignLabelThick);
113  myTextFieldSigma = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
114 
115  // 05 create FXTextField and Label for Tau
116  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_TAU).c_str(), nullptr, GUIDesignLabelThick);
117  myTextFieldTau = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
118 
119  // 06 create FXTextField and Label for Length
120  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_LENGTH).c_str(), nullptr, GUIDesignLabelThick);
121  myTextFieldLength = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
122 
123  // 07 create FXTextField and Label for MinGap
124  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_MINGAP).c_str(), nullptr, GUIDesignLabelThick);
125  myTextFieldMinGap = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
126 
127  // 08 create FXTextField and Label for MaxSpeed
128  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_MAXSPEED).c_str(), nullptr, GUIDesignLabelThick);
129  myTextFieldMaxSpeed = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
130 
131  // 09 create FXTextField and Label for SpeedFactor
132  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_SPEEDFACTOR).c_str(), nullptr, GUIDesignLabelThick);
133  myTextFieldSpeedFactor = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
134 
135  // 10 create FXTextField and Label for SpeedDev
136  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_SPEEDDEV).c_str(), nullptr, GUIDesignLabelThick);
137  myTextFieldSpeedDev = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
138 
139  // 11 create FXTextField and Label for Color
140  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_COLOR).c_str(), nullptr, GUIDesignLabelThick);
141  myTextFieldColor = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
142 
143  // 12 create FXTextField and Label for EmissionClass
144  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_EMISSIONCLASS).c_str(), nullptr, GUIDesignLabelThick);
145  myTextFieldEmissionClass = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
146 
147  // 01 create FXTextField and Label for Width
148  new FXLabel(columnRightLabel, toString(SUMO_ATTR_WIDTH).c_str(), nullptr, GUIDesignLabelThick);
149  myTextFieldWidth = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
150 
151  // 02 create FXTextField and Label for Filename
152  new FXLabel(columnRightLabel, toString(SUMO_ATTR_IMGFILE).c_str(), nullptr, GUIDesignLabelThick);
153  myTextFieldFilename = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
154 
155  // 03 create FXTextField and Label for Impatience
156  new FXLabel(columnRightLabel, toString(SUMO_ATTR_IMPATIENCE).c_str(), nullptr, GUIDesignLabelThick);
157  myTextFieldImpatience = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
158 
159  // 04 create FXTextField and Label for LaneChangeModel
160  new FXLabel(columnRightLabel, toString(SUMO_ATTR_LANE_CHANGE_MODEL).c_str(), nullptr, GUIDesignLabelThick);
161  myTextFieldLaneChangeModel = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
162 
163  // 05 create FXTextField and Label for CarFollowModel
164  new FXLabel(columnRightLabel, toString(SUMO_ATTR_CAR_FOLLOW_MODEL).c_str(), nullptr, GUIDesignLabelThick);
165  myTextFieldCarFollowModel = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
166 
167  // 06 create FXTextField and Label for PersonCapacity
168  new FXLabel(columnRightLabel, toString(SUMO_ATTR_PERSON_CAPACITY).c_str(), nullptr, GUIDesignLabelThick);
169  myTextFieldPersonCapacity = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldInt);
170 
171  // 07 create FXTextField and Label for ContainerCapacity
172  new FXLabel(columnRightLabel, toString(SUMO_ATTR_CONTAINER_CAPACITY).c_str(), nullptr, GUIDesignLabelThick);
173  myTextFieldContainerCapacity = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldInt);
174 
175  // 08 create FXTextField and Label for BoardingDuration
176  new FXLabel(columnRightLabel, toString(SUMO_ATTR_BOARDING_DURATION).c_str(), nullptr, GUIDesignLabelThick);
177  myTextFieldBoardingDuration = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
178 
179  // 09 create FXTextField and Label for LoadingDuration
180  new FXLabel(columnRightLabel, toString(SUMO_ATTR_LOADING_DURATION).c_str(), nullptr, GUIDesignLabelThick);
181  myTextFieldLoadingDuration = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
182 
183  // 10 create FXTextField and Label for LatAlignment
184  new FXLabel(columnRightLabel, toString(SUMO_ATTR_LATALIGNMENT).c_str(), nullptr, GUIDesignLabelThick);
185  myTextFieldLatAlignment = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
186 
187  // 11 create FXTextField and Label for MinGapLat
188  new FXLabel(columnRightLabel, toString(SUMO_ATTR_MINGAP_LAT).c_str(), nullptr, GUIDesignLabelThick);
189  myTextFieldMinGapLat = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
190 
191  // 12 create FXTextField and Label for MaxSpeedLat
192  new FXLabel(columnRightLabel, toString(SUMO_ATTR_MAXSPEED_LAT).c_str(), nullptr, GUIDesignLabelThick);
193  myTextFieldMaxSpeedLat = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
194 
195  // update fields
196  updateCalibratorVehicleTypeValues();
197 
198  // start a undo list for editing local to this additional
199  initChanges();
200 
201  // add element if we aren't updating an existent element
202  if (myUpdatingElement == false) {
203  myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(myEditedAdditional, true), true);
204  }
205 
206  // open as modal dialog
207  openAsModalDialog();
208 }
209 
210 
212 
213 
214 long
215 GNECalibratorVehicleTypeDialog::onCmdAccept(FXObject*, FXSelector, void*) {
216  if (myCalibratorVehicleTypeValid == false) {
217  // write warning if netedit is running in testing mode
218  WRITE_DEBUG("Opening FXMessageBox of type 'warning'");
219  std::string operation1 = myUpdatingElement ? ("updating") : ("creating");
220  std::string operation2 = myUpdatingElement ? ("updated") : ("created");
221  std::string tagString = myEditedAdditional->getTagStr();
222  // open warning dialogBox
223  FXMessageBox::warning(getApp(), MBOX_OK,
224  ("Error " + operation1 + " " + tagString).c_str(), "%s",
225  (tagString + " cannot be " + operation2 +
226  " because parameter " + toString(myInvalidAttr) +
227  " is invalid.").c_str());
228  // write warning if netedit is running in testing mode
229  WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'");
230  return 0;
231  } else {
232  // accept changes before closing dialog
233  acceptChanges();
234  // stop dialgo sucesfully
235  getApp()->stopModal(this, TRUE);
236  return 1;
237  }
238 }
239 
240 
241 long
242 GNECalibratorVehicleTypeDialog::onCmdCancel(FXObject*, FXSelector, void*) {
243  // cancel changes
244  cancelChanges();
245  // Stop Modal
246  getApp()->stopModal(this, FALSE);
247  return 1;
248 }
249 
250 
251 long
252 GNECalibratorVehicleTypeDialog::onCmdReset(FXObject*, FXSelector, void*) {
253  // reset changes
254  resetChanges();
255  // update fields
257  return 1;
258 }
259 
260 
261 long
263  // At start we assumed, that all values are valid
266  // set color of myComboBoxShape, depending if current value is valid or not
268  myComboBoxShape->setTextColor(FXRGB(0, 0, 0));
270  } else {
271  myComboBoxShape->setTextColor(FXRGB(255, 0, 0));
274  }
275  // set color of myComboBoxVClass, depending if current value is valid or not
276  if (myEditedAdditional->isValid(SUMO_ATTR_VCLASS, myComboBoxVClass->getText().text())) {
277  myComboBoxVClass->setTextColor(FXRGB(0, 0, 0));
280  } else {
281  myComboBoxVClass->setTextColor(FXRGB(255, 0, 0));
284  }
285  // set color of myTextFieldVehicleTypeID, depending if current value is valid or not
287  myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0));
289  } else if (myEditedAdditional->getAttribute(SUMO_ATTR_ID) == myTextFieldVehicleTypeID->getText().text()) {
290  myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0));
292  } else {
293  myTextFieldVehicleTypeID->setTextColor(FXRGB(255, 0, 0));
296  }
297  // set color of myTextFieldAccel, depending if current value is valid or not
298  if (myEditedAdditional->isValid(SUMO_ATTR_ACCEL, myTextFieldAccel->getText().text())) {
299  myTextFieldAccel->setTextColor(FXRGB(0, 0, 0));
301  } else {
302  myTextFieldAccel->setTextColor(FXRGB(255, 0, 0));
305  }
306  // set color of myTextFieldDecel, depending if current value is valid or not
307  if (myEditedAdditional->isValid(SUMO_ATTR_DECEL, myTextFieldDecel->getText().text())) {
308  myTextFieldDecel->setTextColor(FXRGB(0, 0, 0));
310  } else {
311  myTextFieldDecel->setTextColor(FXRGB(255, 0, 0));
314  }
315  // set color of myTextFieldSigma, depending if current value is valid or not
316  if (myEditedAdditional->isValid(SUMO_ATTR_SIGMA, myTextFieldSigma->getText().text())) {
317  myTextFieldSigma->setTextColor(FXRGB(0, 0, 0));
319  } else {
320  myTextFieldSigma->setTextColor(FXRGB(255, 0, 0));
323  }
324  // set color of myTextFieldTau, depending if current value is valid or not
325  if (myEditedAdditional->isValid(SUMO_ATTR_TAU, myTextFieldTau->getText().text())) {
326  myTextFieldTau->setTextColor(FXRGB(0, 0, 0));
328  } else {
329  myTextFieldTau->setTextColor(FXRGB(255, 0, 0));
332  }
333  // set color of myTextFieldLength, depending if current value is valid or not
335  myTextFieldLength->setTextColor(FXRGB(0, 0, 0));
337  } else {
338  myTextFieldLength->setTextColor(FXRGB(255, 0, 0));
341  }
342  // set color of myTextFieldMinGap, depending if current value is valid or not
344  myTextFieldMinGap->setTextColor(FXRGB(0, 0, 0));
346  } else {
347  myTextFieldMinGap->setTextColor(FXRGB(255, 0, 0));
350  }
351  // set color of myTextFieldMaxSpeed, depending if current value is valid or not
353  myTextFieldMaxSpeed->setTextColor(FXRGB(0, 0, 0));
355  } else {
356  myTextFieldMaxSpeed->setTextColor(FXRGB(255, 0, 0));
359  }
360  // set color of myTextFieldSpeedFactor, depending if current value is valid or not
362  myTextFieldSpeedFactor->setTextColor(FXRGB(0, 0, 0));
364  } else {
365  myTextFieldSpeedFactor->setTextColor(FXRGB(255, 0, 0));
368  }
369  // set color of myTextFieldSpeedDev, depending if current value is valid or not
371  myTextFieldSpeedDev->setTextColor(FXRGB(0, 0, 0));
373  } else {
374  myTextFieldSpeedDev->setTextColor(FXRGB(255, 0, 0));
377  }
378  // set color of myTextFieldColor, depending if current value is valid or not
379  if (myEditedAdditional->isValid(SUMO_ATTR_COLOR, myTextFieldColor->getText().text())) {
380  myTextFieldColor->setTextColor(FXRGB(0, 0, 0));
382  } else {
383  myTextFieldColor->setTextColor(FXRGB(255, 0, 0));
386  }
387  // set color of myTextFieldEmissionClass, depending if current value is valid or not
389  myTextFieldEmissionClass->setTextColor(FXRGB(0, 0, 0));
391  } else {
392  myTextFieldEmissionClass->setTextColor(FXRGB(255, 0, 0));
395  }
396  // set color of myTextFieldWidth, depending if current value is valid or not
397  if (myEditedAdditional->isValid(SUMO_ATTR_WIDTH, myTextFieldWidth->getText().text())) {
398  myTextFieldWidth->setTextColor(FXRGB(0, 0, 0));
400  } else {
401  myTextFieldWidth->setTextColor(FXRGB(255, 0, 0));
404  }
405  // set color of myTextFieldFilename, depending if current value is valid or not
407  myTextFieldFilename->setTextColor(FXRGB(0, 0, 0));
409  } else {
410  myTextFieldFilename->setTextColor(FXRGB(255, 0, 0));
413  }
414  // set color of myTextFieldImpatience, depending if current value is valid or not
416  myTextFieldImpatience->setTextColor(FXRGB(0, 0, 0));
418  } else {
419  myTextFieldImpatience->setTextColor(FXRGB(255, 0, 0));
422  }
423  // set color of myTextFieldLaneChangeModel, depending if current value is valid or not
425  myTextFieldLaneChangeModel->setTextColor(FXRGB(0, 0, 0));
427  } else {
428  myTextFieldLaneChangeModel->setTextColor(FXRGB(255, 0, 0));
431  }
432  // set color of myTextFieldCarFollowModel, depending if current value is valid or not
434  myTextFieldCarFollowModel->setTextColor(FXRGB(0, 0, 0));
436  } else {
437  myTextFieldCarFollowModel->setTextColor(FXRGB(255, 0, 0));
440  }
441  // set color of myTextFieldPersonCapacity, depending if current value is valid or not
443  myTextFieldPersonCapacity->setTextColor(FXRGB(0, 0, 0));
445  } else {
446  myTextFieldPersonCapacity->setTextColor(FXRGB(255, 0, 0));
449  }
450  // set color of myTextFieldContainerCapacity, depending if current value is valid or not
452  myTextFieldContainerCapacity->setTextColor(FXRGB(0, 0, 0));
454  } else {
455  myTextFieldContainerCapacity->setTextColor(FXRGB(255, 0, 0));
458  }
459  // set color of myTextFieldBoardingDuration, depending if current value is valid or not
461  myTextFieldBoardingDuration->setTextColor(FXRGB(0, 0, 0));
463  } else {
464  myTextFieldBoardingDuration->setTextColor(FXRGB(255, 0, 0));
467  }
468  // set color of myTextFieldLoadingDuration, depending if current value is valid or not
470  myTextFieldLoadingDuration->setTextColor(FXRGB(0, 0, 0));
472  } else {
473  myTextFieldLoadingDuration->setTextColor(FXRGB(255, 0, 0));
476  }
477  // set color of myTextFieldLatAlignment, depending if current value is valid or not
479  myTextFieldLatAlignment->setTextColor(FXRGB(0, 0, 0));
481  } else {
482  myTextFieldLatAlignment->setTextColor(FXRGB(255, 0, 0));
485  }
486  // set color of myTextFieldMinGapLat, depending if current value is valid or not
488  myTextFieldMinGapLat->setTextColor(FXRGB(0, 0, 0));
490  } else {
491  myTextFieldMinGapLat->setTextColor(FXRGB(255, 0, 0));
494  }
495  // set color of myTextFieldVehicleTypeID, depending if current value is valid or not
497  myTextFieldMaxSpeedLat->setTextColor(FXRGB(0, 0, 0));
499  } else {
500  myTextFieldMaxSpeedLat->setTextColor(FXRGB(255, 0, 0));
503  }
504  return 1;
505 }
506 
507 
508 void
510  //set values of myEditedAdditional int fields
537  // set image labels
539 }
540 
541 
542 void
544  // set Icon in label depending of current VClass
546  case SVC_PRIVATE:
548  break;
549  case SVC_EMERGENCY:
551  break;
552  case SVC_AUTHORITY:
554  break;
555  case SVC_ARMY:
557  break;
558  case SVC_VIP:
560  break;
561  case SVC_PASSENGER:
563  break;
564  case SVC_HOV:
566  break;
567  case SVC_TAXI:
569  break;
570  case SVC_BUS:
572  break;
573  case SVC_COACH:
575  break;
576  case SVC_DELIVERY:
578  break;
579  case SVC_TRUCK:
581  break;
582  case SVC_TRAILER:
584  break;
585  case SVC_TRAM:
587  break;
588  case SVC_RAIL_URBAN:
590  break;
591  case SVC_RAIL:
593  break;
594  case SVC_RAIL_ELECTRIC:
596  break;
597  case SVC_MOTORCYCLE:
599  break;
600  case SVC_MOPED:
602  break;
603  case SVC_BICYCLE:
605  break;
606  case SVC_PEDESTRIAN:
608  break;
609  case SVC_E_VEHICLE:
611  break;
612  case SVC_SHIP:
614  break;
615  case SVC_CUSTOM1:
617  break;
618  case SVC_CUSTOM2:
620  break;
621  default:
623  break;
624  }
625 }
626 
627 /****************************************************************************/
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
method for checking if the key and their conrrespond attribute are valids
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:205
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
vehicle is a small delivery vehicle
Dialog to edit sequences, parameters, etc.. of Additionals.
FXTextField * myTextFieldVehicleTypeID
FXTextfield for vehicleTypeID.
vehicle is a light rail
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes ...
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:181
virtual std::string getAttribute(SumoXMLAttr key) const =0
vehicle is a (possibly fast moving) electric rail
authorities vehicles
vehicle is a city rail
vehicle is a large transport vehicle
is a user-defined type
#define GUIDesignComboBox
Definition: GUIDesigns.h:195
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:258
FXTextField * myTextFieldLatAlignment
FXTextfield for LatAlignment.
#define GUIDesignTextField
Definition: GUIDesigns.h:34
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
#define GUIDesignUniformHorizontalFrame
design for horizontal frame used to pack another frames with a uniform width
Definition: GUIDesigns.h:267
FXTextField * myTextFieldLaneChangeModel
FXTextfield for LaneChangeModel.
bool myUpdatingElement
flag to indicate if additional are being created or modified (cannot be changed after open dialog) ...
army vehicles
private vehicles
not defined
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)
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:248
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
GNEAdditional * myEditedAdditional
pointer to edited aditional
vehicle is a moped
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:46
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.
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
long onCmdAccept(FXObject *, FXSelector, void *)
vip vehicles
const std::string & getTagStr() const
get tag assigned to this object in string format
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:154
#define GUIDesignTextFieldInt
text field extended over Frame with thick frame and limited to Integers
Definition: GUIDesigns.h:37
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:40
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
FXTextField * myTextFieldMaxSpeedLat
FXTextfield for MaxSpeedLat.
is a user-defined type
FXTextField * myTextFieldDecel
FXTextfield for Decel.
FXLabel * myComboBoxVClassLabelImage
label with image of VClass
is an electric vehicle