SUMO - Simulation of Urban MObility
GNECalibratorVehicleTypeDialog.cpp
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software; you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation; either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #ifdef _MSC_VER
25 #include <windows_config.h>
26 #else
27 #include <config.h>
28 #endif
29 
30 #include <iostream>
35 
37 #include "GNECalibratorDialog.h"
38 #include "GNECalibrator.h"
39 #include "GNEEdge.h"
40 #include "GNELane.h"
41 #include "GNEViewNet.h"
42 #include "GNENet.h"
43 
44 
45 // ===========================================================================
46 // FOX callback mapping
47 // ===========================================================================
48 
49 FXDEFMAP(GNECalibratorVehicleTypeDialog) GNECalibratorVehicleTypeDialogMap[] = {
54 };
55 
56 // Object implementation
57 FXIMPLEMENT(GNECalibratorVehicleTypeDialog, FXDialogBox, GNECalibratorVehicleTypeDialogMap, ARRAYNUMBER(GNECalibratorVehicleTypeDialogMap))
58 
59 // ===========================================================================
60 // member method definitions
61 // ===========================================================================
62 
63 GNECalibratorVehicleTypeDialog::GNECalibratorVehicleTypeDialog(GNECalibratorDialog* calibratorDialog, GNECalibratorVehicleType& calibratorVehicleType, bool updatingElement) :
64  GNEAdditionalDialog(calibratorVehicleType.getCalibratorParent(), 500, 375),
65  myCalibratorDialogParent(calibratorDialog),
66  myCalibratorVehicleType(&calibratorVehicleType),
67  myUpdatingElement(updatingElement),
68  myCalibratorVehicleTypeValid(true),
69  myInvalidAttr(SUMO_ATTR_NOTHING) {
70  // change default header
71  changeAdditionalDialogHeader("Edit " + toString(calibratorVehicleType.getTag()) + " of " + toString(calibratorVehicleType.getCalibratorParent()->getTag()) +
72  " '" + calibratorVehicleType.getCalibratorParent()->getID() + "'");
73 
74  // Create auxiliar frames for values
75  FXHorizontalFrame* columns = new FXHorizontalFrame(myContentFrame, GUIDesignUniformHorizontalFrame);
76  FXVerticalFrame* columnLeftLabel = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
77  FXVerticalFrame* columnLeftValues = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
78  FXVerticalFrame* columnRightLabel = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
79  FXVerticalFrame* columnRightValues = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
80 
81  // FXComboBox for VClass
82  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_VCLASS).c_str(), 0, GUIDesignLabelThick);
83  myComboBoxVClass = new FXComboBox(columnLeftLabel, GUIDesignComboBoxNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignComboBox);
84  myComboBoxVClassLabelImage = new FXLabel(columnLeftValues, "", 0, GUIDesignLabelIconExtendedx46Ticked);
85  myComboBoxVClassLabelImage->setBackColor(FXRGBA(255, 255, 255, 255));
86  // fill combo Box
87  std::vector<std::string> VClassStrings = SumoVehicleClassStrings.getStrings();
88  for (std::vector<std::string>::iterator i = VClassStrings.begin(); i != VClassStrings.end(); i++) {
89  if ((*i) != SumoVehicleClassStrings.getString(SVC_IGNORING)) {
90  myComboBoxVClass->appendItem(i->c_str());
91  }
92  }
93  myComboBoxVClass->setNumVisible(10);
94 
95  // FXComboBox for Shape
96  new FXLabel(columnRightLabel, toString(SUMO_ATTR_SHAPE).c_str(), 0, GUIDesignLabelThick);
97  myComboBoxShape = new FXComboBox(columnRightLabel, GUIDesignComboBoxNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignComboBox);
98  myComboBoxShapeLabelImage = new FXLabel(columnRightValues, "", 0, GUIDesignLabelIconExtendedx46Ticked);
99  myComboBoxShapeLabelImage->setBackColor(FXRGBA(255, 255, 255, 255));
100  // fill combo Box
101  std::vector<std::string> VShapeStrings = SumoVehicleShapeStrings.getStrings();
102  for (std::vector<std::string>::iterator i = VShapeStrings.begin(); i != VShapeStrings.end(); i++) {
103  if ((*i) != SumoVehicleShapeStrings.getString(SVS_UNKNOWN)) {
104  myComboBoxShape->appendItem(i->c_str());
105  }
106  }
107  myComboBoxShape->setNumVisible(10);
108 
109  // 01 create FXTextField and Label for vehicleTypeID
110  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ID).c_str(), 0, GUIDesignLabelThick);
111  myTextFieldVehicleTypeID = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
112 
113  // 02 create FXTextField and Label for Accel
114  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ACCEL).c_str(), 0, GUIDesignLabelThick);
115  myTextFieldAccel = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
116 
117  // 03 create FXTextField and Label for Decel
118  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_DECEL).c_str(), 0, GUIDesignLabelThick);
119  myTextFieldDecel = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
120 
121  // 04 create FXTextField and Label for Sigma
122  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_SIGMA).c_str(), 0, GUIDesignLabelThick);
123  myTextFieldSigma = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
124 
125  // 05 create FXTextField and Label for Tau
126  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_TAU).c_str(), 0, GUIDesignLabelThick);
127  myTextFieldTau = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
128 
129  // 06 create FXTextField and Label for Length
130  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_LENGTH).c_str(), 0, GUIDesignLabelThick);
131  myTextFieldLength = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
132 
133  // 07 create FXTextField and Label for MinGap
134  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_MINGAP).c_str(), 0, GUIDesignLabelThick);
135  myTextFieldMinGap = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
136 
137  // 08 create FXTextField and Label for MaxSpeed
138  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_MAXSPEED).c_str(), 0, GUIDesignLabelThick);
139  myTextFieldMaxSpeed = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
140 
141  // 09 create FXTextField and Label for SpeedFactor
142  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_SPEEDFACTOR).c_str(), 0, GUIDesignLabelThick);
143  myTextFieldSpeedFactor = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
144 
145  // 10 create FXTextField and Label for SpeedDev
146  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_SPEEDDEV).c_str(), 0, GUIDesignLabelThick);
147  myTextFieldSpeedDev = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
148 
149  // 11 create FXTextField and Label for Color
150  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_COLOR).c_str(), 0, GUIDesignLabelThick);
151  myTextFieldColor = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
152 
153  // 12 create FXTextField and Label for EmissionClass
154  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_EMISSIONCLASS).c_str(), 0, GUIDesignLabelThick);
155  myTextFieldEmissionClass = new FXTextField(columnLeftValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
156 
157  // 01 create FXTextField and Label for Width
158  new FXLabel(columnRightLabel, toString(SUMO_ATTR_WIDTH).c_str(), 0, GUIDesignLabelThick);
159  myTextFieldWidth = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
160 
161  // 02 create FXTextField and Label for Filename
162  new FXLabel(columnRightLabel, toString(SUMO_ATTR_FILE).c_str(), 0, GUIDesignLabelThick);
163  myTextFieldFilename = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
164 
165  // 03 create FXTextField and Label for Impatience
166  new FXLabel(columnRightLabel, toString(SUMO_ATTR_IMPATIENCE).c_str(), 0, GUIDesignLabelThick);
167  myTextFieldImpatience = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
168 
169  // 04 create FXTextField and Label for LaneChangeModel
170  new FXLabel(columnRightLabel, toString(SUMO_ATTR_LANE_CHANGE_MODEL).c_str(), 0, GUIDesignLabelThick);
171  myTextFieldLaneChangeModel = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
172 
173  // 05 create FXTextField and Label for CarFollowModel
174  new FXLabel(columnRightLabel, toString(SUMO_ATTR_CAR_FOLLOW_MODEL).c_str(), 0, GUIDesignLabelThick);
175  myTextFieldCarFollowModel = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
176 
177  // 06 create FXTextField and Label for PersonCapacity
178  new FXLabel(columnRightLabel, toString(SUMO_ATTR_PERSON_CAPACITY).c_str(), 0, GUIDesignLabelThick);
179  myTextFieldPersonCapacity = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldInt);
180 
181  // 07 create FXTextField and Label for ContainerCapacity
182  new FXLabel(columnRightLabel, toString(SUMO_ATTR_CONTAINER_CAPACITY).c_str(), 0, GUIDesignLabelThick);
183  myTextFieldContainerCapacity = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldInt);
184 
185  // 08 create FXTextField and Label for BoardingDuration
186  new FXLabel(columnRightLabel, toString(SUMO_ATTR_BOARDING_DURATION).c_str(), 0, GUIDesignLabelThick);
187  myTextFieldBoardingDuration = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
188 
189  // 09 create FXTextField and Label for LoadingDuration
190  new FXLabel(columnRightLabel, toString(SUMO_ATTR_LOADING_DURATION).c_str(), 0, GUIDesignLabelThick);
191  myTextFieldLoadingDuration = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
192 
193  // 10 create FXTextField and Label for LatAlignment
194  new FXLabel(columnRightLabel, toString(SUMO_ATTR_LATALIGNMENT).c_str(), 0, GUIDesignLabelThick);
195  myTextFieldLatAlignment = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
196 
197  // 11 create FXTextField and Label for MinGapLat
198  new FXLabel(columnRightLabel, toString(SUMO_ATTR_MINGAP_LAT).c_str(), 0, GUIDesignLabelThick);
199  myTextFieldMinGapLat = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
200 
201  // 12 create FXTextField and Label for MaxSpeedLat
202  new FXLabel(columnRightLabel, toString(SUMO_ATTR_MAXSPEED_LAT).c_str(), 0, GUIDesignLabelThick);
203  myTextFieldMaxSpeedLat = new FXTextField(columnRightValues, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
204 
205  // create copy of GNECalibratorVehicleType
206  myCopyOfCalibratorVehicleType = new GNECalibratorVehicleType(myCalibratorVehicleType->getCalibratorParent());
207 
208  // copy all values of myCalibratorVehicleType into myCopyOfCalibratorVehicleType to set initial values
209  (*myCopyOfCalibratorVehicleType) = (*myCalibratorVehicleType);
210 
211  // update fields
212  updateCalibratorVehicleTypeValues();
213 }
214 
215 
217  // delete copy
219 }
220 
221 
222 long
223 GNECalibratorVehicleTypeDialog::onCmdAccept(FXObject*, FXSelector, void*) {
224  if (myCalibratorVehicleTypeValid == false) {
225  // write warning if netedit is running in testing mode
227  WRITE_WARNING("Opening FXMessageBox of type 'warning'");
228  }
229  // open warning dialogBox
230  FXMessageBox::warning(getApp(), MBOX_OK,
231  ("Error " + std::string((myUpdatingElement == true) ? ("updating") : ("creating")) + " " + toString(myCalibratorVehicleType->getCalibratorParent()->getTag()) +
232  "'s " + toString(myCalibratorVehicleType->getTag())).c_str(), "%s",
234  " cannot be " + std::string((myUpdatingElement == true) ? ("updated") : ("created")) + " because parameter " + toString(myInvalidAttr) +
235  " is invalid.").c_str());
236  // write warning if netedit is running in testing mode
238  WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'");
239  }
240  return 0;
241  } else {
242  // copy all values of myCopyOfCalibratorVehicleType into myCalibratorVehicleType
243  (*myCalibratorVehicleType) = (*myCopyOfCalibratorVehicleType);
244  getApp()->stopModal(this, TRUE);
245  return 1;
246  }
247 }
248 
249 
250 long
251 GNECalibratorVehicleTypeDialog::onCmdCancel(FXObject*, FXSelector, void*) {
252  // Stop Modal
253  getApp()->stopModal(this, FALSE);
254  return 1;
255 }
256 
257 
258 long
259 GNECalibratorVehicleTypeDialog::onCmdReset(FXObject*, FXSelector, void*) {
260  // copy all values of myCalibratorVehicleType into myCopyOfCalibratorVehicleType to set initial values
261  (*myCopyOfCalibratorVehicleType) = (*myCalibratorVehicleType);
262  // update fields
264  return 1;
265 }
266 
267 
268 long
270  // At start we assumed, that all values are valid
273  // set color of myComboBoxShape, depending if current value is valid or not
274  if (myCopyOfCalibratorVehicleType->setShape(myComboBoxShape->getText().text()) == true) {
275  myComboBoxShape->setTextColor(FXRGB(0, 0, 0));
276  } else {
277  myComboBoxShape->setTextColor(FXRGB(255, 0, 0));
280  }
281  // set color of myComboBoxVClass, depending if current value is valid or not
282  if (myCopyOfCalibratorVehicleType->setVClass(myComboBoxVClass->getText().text()) == true) {
283  myComboBoxVClass->setTextColor(FXRGB(0, 0, 0));
285  } else {
286  myComboBoxVClass->setTextColor(FXRGB(255, 0, 0));
289  }
290  // set color of myTextFieldVehicleTypeID, depending if current value is valid or not
292  myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0));
293  } else if (myCopyOfCalibratorVehicleType->setVehicleTypeID(myTextFieldVehicleTypeID->getText().text()) == true) {
294  myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0));
295  } else {
296  myTextFieldVehicleTypeID->setTextColor(FXRGB(255, 0, 0));
299  }
300  // set color of myTextFieldAccel, depending if current value is valid or not
301  if (myCopyOfCalibratorVehicleType->setAccel(myTextFieldAccel->getText().text()) == true) {
302  myTextFieldAccel->setTextColor(FXRGB(0, 0, 0));
303  } else {
304  myTextFieldAccel->setTextColor(FXRGB(255, 0, 0));
307  }
308  // set color of myTextFieldDecel, depending if current value is valid or not
309  if (myCopyOfCalibratorVehicleType->setDecel(myTextFieldDecel->getText().text()) == true) {
310  myTextFieldDecel->setTextColor(FXRGB(0, 0, 0));
311  } else {
312  myTextFieldDecel->setTextColor(FXRGB(255, 0, 0));
315  }
316  // set color of myTextFieldSigma, depending if current value is valid or not
317  if (myCopyOfCalibratorVehicleType->setSigma(myTextFieldSigma->getText().text()) == true) {
318  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 (myCopyOfCalibratorVehicleType->setTau(myTextFieldTau->getText().text()) == true) {
326  myTextFieldTau->setTextColor(FXRGB(0, 0, 0));
327  } else {
328  myTextFieldTau->setTextColor(FXRGB(255, 0, 0));
331  }
332  // set color of myTextFieldLength, depending if current value is valid or not
333  if (myCopyOfCalibratorVehicleType->setLength(myTextFieldLength->getText().text()) == true) {
334  myTextFieldLength->setTextColor(FXRGB(0, 0, 0));
335  } else {
336  myTextFieldLength->setTextColor(FXRGB(255, 0, 0));
339  }
340  // set color of myTextFieldMinGap, depending if current value is valid or not
341  if (myCopyOfCalibratorVehicleType->setMinGap(myTextFieldMinGap->getText().text()) == true) {
342  myTextFieldMinGap->setTextColor(FXRGB(0, 0, 0));
343  } else {
344  myTextFieldMinGap->setTextColor(FXRGB(255, 0, 0));
347  }
348  // set color of myTextFieldMaxSpeed, depending if current value is valid or not
349  if (myCopyOfCalibratorVehicleType->setMaxSpeed(myTextFieldMaxSpeed->getText().text()) == true) {
350  myTextFieldMaxSpeed->setTextColor(FXRGB(0, 0, 0));
351  } else {
352  myTextFieldMaxSpeed->setTextColor(FXRGB(255, 0, 0));
355  }
356  // set color of myTextFieldSpeedFactor, depending if current value is valid or not
357  if (myCopyOfCalibratorVehicleType->setSpeedFactor(myTextFieldSpeedFactor->getText().text()) == true) {
358  myTextFieldSpeedFactor->setTextColor(FXRGB(0, 0, 0));
359  } else {
360  myTextFieldSpeedFactor->setTextColor(FXRGB(255, 0, 0));
363  }
364  // set color of myTextFieldSpeedDev, depending if current value is valid or not
365  if (myCopyOfCalibratorVehicleType->setSpeedDev(myTextFieldSpeedDev->getText().text()) == true) {
366  myTextFieldSpeedDev->setTextColor(FXRGB(0, 0, 0));
367  } else {
368  myTextFieldSpeedDev->setTextColor(FXRGB(255, 0, 0));
371  }
372  // set color of myTextFieldColor, depending if current value is valid or not
373  if (myCopyOfCalibratorVehicleType->setColor(myTextFieldColor->getText().text()) == true) {
374  myTextFieldColor->setTextColor(FXRGB(0, 0, 0));
375  } else {
376  myTextFieldColor->setTextColor(FXRGB(255, 0, 0));
379  }
380  // set color of myTextFieldEmissionClass, depending if current value is valid or not
382  myTextFieldEmissionClass->setTextColor(FXRGB(0, 0, 0));
383  } else {
384  myTextFieldEmissionClass->setTextColor(FXRGB(255, 0, 0));
387  }
388  // set color of myTextFieldWidth, depending if current value is valid or not
389  if (myCopyOfCalibratorVehicleType->setWidth(myTextFieldWidth->getText().text()) == true) {
390  myTextFieldWidth->setTextColor(FXRGB(0, 0, 0));
391  } else {
392  myTextFieldWidth->setTextColor(FXRGB(255, 0, 0));
395  }
396  // set color of myTextFieldFilename, depending if current value is valid or not
397  if (myCopyOfCalibratorVehicleType->setFilename(myTextFieldFilename->getText().text()) == true) {
398  myTextFieldFilename->setTextColor(FXRGB(0, 0, 0));
399  } else {
400  myTextFieldFilename->setTextColor(FXRGB(255, 0, 0));
403  }
404  // set color of myTextFieldImpatience, depending if current value is valid or not
405  if (myCopyOfCalibratorVehicleType->setImpatience(myTextFieldImpatience->getText().text()) == true) {
406  myTextFieldImpatience->setTextColor(FXRGB(0, 0, 0));
407  } else {
408  myTextFieldImpatience->setTextColor(FXRGB(255, 0, 0));
411  }
412  // set color of myTextFieldLaneChangeModel, depending if current value is valid or not
414  myTextFieldLaneChangeModel->setTextColor(FXRGB(0, 0, 0));
415  } else {
416  myTextFieldLaneChangeModel->setTextColor(FXRGB(255, 0, 0));
419  }
420  // set color of myTextFieldCarFollowModel, depending if current value is valid or not
422  myTextFieldCarFollowModel->setTextColor(FXRGB(0, 0, 0));
423  } else {
424  myTextFieldCarFollowModel->setTextColor(FXRGB(255, 0, 0));
427  }
428  // set color of myTextFieldPersonCapacity, depending if current value is valid or not
430  myTextFieldPersonCapacity->setTextColor(FXRGB(0, 0, 0));
431  } else {
432  myTextFieldPersonCapacity->setTextColor(FXRGB(255, 0, 0));
435  }
436  // set color of myTextFieldContainerCapacity, depending if current value is valid or not
438  myTextFieldContainerCapacity->setTextColor(FXRGB(0, 0, 0));
439  } else {
440  myTextFieldContainerCapacity->setTextColor(FXRGB(255, 0, 0));
443  }
444  // set color of myTextFieldBoardingDuration, depending if current value is valid or not
446  myTextFieldBoardingDuration->setTextColor(FXRGB(0, 0, 0));
447  } else {
448  myTextFieldBoardingDuration->setTextColor(FXRGB(255, 0, 0));
451  }
452  // set color of myTextFieldLoadingDuration, depending if current value is valid or not
454  myTextFieldLoadingDuration->setTextColor(FXRGB(0, 0, 0));
455  } else {
456  myTextFieldLoadingDuration->setTextColor(FXRGB(255, 0, 0));
459  }
460  // set color of myTextFieldLatAlignment, depending if current value is valid or not
462  myTextFieldLatAlignment->setTextColor(FXRGB(0, 0, 0));
463  } else {
464  myTextFieldLatAlignment->setTextColor(FXRGB(255, 0, 0));
467  }
468  // set color of myTextFieldMinGapLat, depending if current value is valid or not
469  if (myCopyOfCalibratorVehicleType->setMinGapLat(myTextFieldMinGapLat->getText().text()) == true) {
470  myTextFieldMinGapLat->setTextColor(FXRGB(0, 0, 0));
471  } else {
472  myTextFieldMinGapLat->setTextColor(FXRGB(255, 0, 0));
475  }
476  // set color of myTextFieldVehicleTypeID, depending if current value is valid or not
477  if (myCopyOfCalibratorVehicleType->setMaxSpeedLat(myTextFieldMaxSpeedLat->getText().text()) == true) {
478  myTextFieldMaxSpeedLat->setTextColor(FXRGB(0, 0, 0));
479  } else {
480  myTextFieldMaxSpeedLat->setTextColor(FXRGB(255, 0, 0));
483  }
484  return 1;
485 }
486 
487 
488 void
490  //set values of myCopyOfCalibratorVehicleType int fields
517  // set image labels
519 }
520 
521 
522 void
524  // set Icon in label depending of current VClass
526  case SVC_PRIVATE:
528  break;
529  case SVC_EMERGENCY:
531  break;
532  case SVC_AUTHORITY:
534  break;
535  case SVC_ARMY:
537  break;
538  case SVC_VIP:
540  break;
541  case SVC_PASSENGER:
543  break;
544  case SVC_HOV:
546  break;
547  case SVC_TAXI:
549  break;
550  case SVC_BUS:
552  break;
553  case SVC_COACH:
555  break;
556  case SVC_DELIVERY:
558  break;
559  case SVC_TRUCK:
561  break;
562  case SVC_TRAILER:
564  break;
565  case SVC_TRAM:
567  break;
568  case SVC_RAIL_URBAN:
570  break;
571  case SVC_RAIL:
573  break;
574  case SVC_RAIL_ELECTRIC:
576  break;
577  case SVC_MOTORCYCLE:
579  break;
580  case SVC_MOPED:
582  break;
583  case SVC_BICYCLE:
585  break;
586  case SVC_PEDESTRIAN:
588  break;
589  case SVC_E_VEHICLE:
591  break;
592  case SVC_SHIP:
594  break;
595  case SVC_CUSTOM1:
597  break;
598  case SVC_CUSTOM2:
600  break;
601  default:
603  break;
604  }
605 }
606 
607 /****************************************************************************/
SUMOVehicleShape getShape() const
get shape
FXTextField * myTextFieldSpeedFactor
FXTextfield for SpeedFactor.
double getMinGapLat() const
get min gap lat
std::string getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a &#39; &#39;.
long onCmdSetVariable(FXObject *, FXSelector, void *)
after change a variable of vehicle type
FXComboBox * myComboBoxVClass
FXComboBox for VClass.
vehicle is a motorcycle
vehicle is a coach
SUMOVehicleClass getVClass() const
get VClass
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:197
bool setTau(double tau=1.0)
set tau
FXTextField * myTextFieldMinGapLat
FXTextfield for MinGapLat.
is a pedestrian
GNECalibratorDialog * myCalibratorDialogParent
pointer to GNECalibratorDialog parent
bool setDecel(double decel=4.5)
set decel
FXTextField * myTextFieldLoadingDuration
FXTextfield for LoadingDuration.
std::string getLatAlignment() const
get lateral lat
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false)
bool setLength(double length=5.0)
set length
double getWidth() const
get width
FXTextField * myTextFieldAccel
FXTextfield for Accel.
vehicle is a not electrified rail
FXTextField * myTextFieldFilename
FXTextfield for Filename.
bool setImpatience(double impatience=0.0)
set impatience
vehicle is a bicycle
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
bool setAccel(double accel=2.6)
set accel
bool setMinGapLat(double minGapLat=0.12)
set min gap lat
bool setEmissionClass(std::string emissionClass="P_7_7")
set emission class
vehicle is a small delivery vehicle
double getSigma() const
get sigma
bool setShape(std::string shape)
set shape (string version)
Dialog to edit sequences, parameters, etc.. of Additionals.
FXTextField * myTextFieldVehicleTypeID
FXTextfield for vehicleTypeID.
vehicle is a light rail
FXTextField * myTextFieldMaxSpeed
FXTextfield for MaxSpeed.
GNECalibratorVehicleType * myCalibratorVehicleType
pointer to original calibrator vehicle type
std::string getEmissionClass() const
get emission class
double getLoadingDuration() const
get loading duration
bool setFilename(std::string filename="")
set filename
FXTextField * myTextFieldWidth
FXTextfield for Width.
FXComboBox * myComboBoxShape
FXComboBox for Shape.
FXTextField * myTextFieldBoardingDuration
FXTextfield for BoardingDuration.
bool setMaxSpeed(double maxSpeed=70.0)
set max speed
vehicle is a HOV
double getSpeedDev() const
get speed dev
#define GUIDesignLabelIconExtendedx46Ticked
label ticked filled extended over frame used for VClasses. can be used by icons of 64x32 pixels ...
Definition: GUIDesigns.h:180
std::string getLaneChangeModel() const
get lane change model
GNECalibratorVehicleType * myCopyOfCalibratorVehicleType
pointer in which save modifications of CalibratorVehicleType
vehicle is a (possibly fast moving) electric rail
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
bool isTestingModeEnabled() const
check if netedit is running in testing mode
Definition: GNEViewNet.cpp:405
GNECalibrator * getCalibratorParent() const
get calibrator parent
authorities vehicles
vehicle is a city rail
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
double getMaxSpeed() const
get max speed
vehicle is a large transport vehicle
is a user-defined type
#define GUIDesignComboBox
Definition: GUIDesigns.h:187
void updateCalibratorVehicleTypeValues()
update data fields
std::string getCarFollowModel() const
get car follow model
bool setWidth(double width=2.0)
set width
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
Definition: GUIDesigns.h:241
FXTextField * myTextFieldLatAlignment
FXTextfield for LatAlignment.
std::string getVehicleTypeID() const
get VehicleTypeID
#define GUIDesignTextField
Definition: GUIDesigns.h:41
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:56
std::string getColor() const
get color
#define GUIDesignUniformHorizontalFrame
design for horizontal frame used to pack another frames with a uniform width
Definition: GUIDesigns.h:250
FXTextField * myTextFieldLaneChangeModel
FXTextfield for LaneChangeModel.
int getPersonCapacity() const
get person capacity
double getDecel() const
get decel
army vehicles
bool setPersonCapacity(int personCapacity=4)
set person capacity
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.
double getSpeedFactor() const
get speed factor
Dialog for edit rerouter intervals.
invalid attribute
FXTextField * myTextFieldSigma
FXTextfield for Sigma.
edge: the shape in xml-definition
double getImpatience() const
get impatience
std::string getFilename() const
get filename
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
FXTextField * myTextFieldImpatience
FXTextfield for Impatience.
double getMinGap() const
get min gap
bool setSigma(double sigma=0.5)
set sigma
double getBoardingDuration() const
get boarding duration
vehicle is a passenger car (a "normal" car)
double getLength() const
get length
bool myCalibratorVehicleTypeValid
flag to check if current calibrator vehicleType is valid
bool setSpeedDev(double speedDev=0.0)
set speed dev
FXTextField * myTextFieldEmissionClass
FXTextfield for EmissionClass.
is an arbitrary ship
bool setBoardingDuration(double boardingDuration=0.5)
set boarding duration
bool setMaxSpeedLat(double maxSpeedLat=1.0)
set max speed lat
vehicle is a moped
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:50
vehicle is a taxi
Dialog for edit calibrators.
vehicle is a bus
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
bool setLaneChangeModel(std::string laneChangeModel="LC2013")
set lane change model
bool setCarFollowModel(std::string carFollowModel="Krauss")
set car follow model
bool setMinGap(double minGap=2.5)
set min gap
FXTextField * myTextFieldContainerCapacity
FXTextfield for ContainerCapacity.
bool setSpeedFactor(double speedFactor=1.0)
set speed factor
long onCmdAccept(FXObject *, FXSelector, void *)
vip vehicles
FXTextField * myTextFieldTau
FXTextfield for Tau.
vehicle is a large transport vehicle
#define GUIDesignLabelThick
label extended over frame with thick and with text justify to left
Definition: GUIDesigns.h:153
#define GUIDesignTextFieldInt
text field extended over Frame with thick frame and limited to Integers
Definition: GUIDesigns.h:44
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:47
GNECalibrator * getCalibratorParent() const
get pointer to calibrator parent
FXDEFMAP(GNECalibratorVehicleTypeDialog) GNECalibratorVehicleTypeDialogMap[]
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
bool setVClass(SUMOVehicleClass vClass=SVC_PRIVATE)
set VClass
int getContainerCapacity() const
get container capacity
public emergency vehicles
bool setColor(std::string color="1,1,0")
set color
double getAccel() const
get accel
A color information.
FXTextField * myTextFieldLength
FXTextfield for Length.
bool setLoadingDuration(double loadingDuration=90.0)
set loading duration
FXTextField * myTextFieldSpeedDev
FXTextfield for SpeedDev.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
SumoXMLTag getTag() const
get tag
bool setContainerCapacity(int containerCapacity=0)
set container capacity
vehicles ignoring classes
bool setVehicleTypeID(std::string vehicleTypeID)
set vehicleType ID
bool setLatAlignment(std::string latAlignment="center")
set lateral lat
FXTextField * myTextFieldMaxSpeedLat
FXTextfield for MaxSpeedLat.
is a user-defined type
FXTextField * myTextFieldDecel
FXTextfield for Decel.
FXLabel * myComboBoxVClassLabelImage
label with image of VClass
double getMaxSpeedLat() const
get max speed lat
SumoXMLTag getTag() const
get XML Tag assigned to this object
is an electric vehicle