Eclipse SUMO - Simulation of Urban MObility
GNEVehicleTypeDialog.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // Dialog for edit vehicleTypes
19 /****************************************************************************/
20 
21 #include <netedit/GNENet.h>
22 #include <netedit/GNEUndoList.h>
23 #include <netedit/GNEViewNet.h>
32 
33 #include "GNEVehicleTypeDialog.h"
34 
35 
36 // ===========================================================================
37 // FOX callback mapping
38 // ===========================================================================
39 
44 };
45 
46 FXDEFMAP(GNEVehicleTypeDialog::CarFollowingModelParameters) CarFollowingModelParametersMap[] = {
48 };
49 
50 // Object implementation
51 FXIMPLEMENT(GNEVehicleTypeDialog::VTypeAttributes, FXVerticalFrame, VTypeAttributesMap, ARRAYNUMBER(VTypeAttributesMap))
52 FXIMPLEMENT(GNEVehicleTypeDialog::CarFollowingModelParameters, FXGroupBox, CarFollowingModelParametersMap, ARRAYNUMBER(CarFollowingModelParametersMap))
53 
54 // ===========================================================================
55 // member method definitions
56 // ===========================================================================
57 
58 // ---------------------------------------------------------------------------
59 // GNEVehicleTypeDialog::VClassRow - methods
60 // ---------------------------------------------------------------------------
61 
62 GNEVehicleTypeDialog::VTypeAttributes::VClassRow::VClassRow(VTypeAttributes* VTypeAttributesParent, FXVerticalFrame* column) :
63  FXHorizontalFrame(column, GUIDesignAuxiliarHorizontalFrame),
64  myVTypeAttributesParent(VTypeAttributesParent) {
65  // create two auxiliary frames
66  FXVerticalFrame* verticalFrameLabelAndComboBox = new FXVerticalFrame(this, GUIDesignAuxiliarVerticalFrame);
67  // create MFXComboBoxIcon for VClass
68  new FXLabel(verticalFrameLabelAndComboBox, toString(SUMO_ATTR_VCLASS).c_str(), nullptr, GUIDesignLabelThickedFixed(150));
69  myComboBoxVClass = new MFXComboBoxIcon(verticalFrameLabelAndComboBox, GUIDesignComboBoxNCol, true, GUIDesignComboBoxVisibleItemsMedium,
70  VTypeAttributesParent, MID_GNE_SET_ATTRIBUTE, GUIDesignComboBox);
71  myComboBoxVClassLabelImage = new FXLabel(this, "", nullptr, GUIDesignLabelTickedIcon180x46);
72  myComboBoxVClassLabelImage->setBackColor(FXRGBA(255, 255, 255, 255));
73  // fill combo Box with all allowed VClass for the current edited VType
74  for (const auto& vClass : myVTypeAttributesParent->myVehicleTypeDialog->getEditedDemandElement()->getTagProperty().getAttributeProperties(SUMO_ATTR_VCLASS).getDiscreteValues()) {
75  myComboBoxVClass->appendIconItem(vClass.c_str(), VClassIcons::getVClassIcon(SumoVehicleClassStrings.get(vClass)));
76  }
77 }
78 
79 
82  // set color of myComboBoxVClass, depending if current value is valid or not
83  myComboBoxVClass->setTextColor(FXRGB(0, 0, 0));
85  myComboBoxVClass->setTextColor(FXRGB(0, 0, 0));
86  // check if VType has to be updated
88  // update VClass in VType
91  // update label image
93  // obtain default vType parameters
95  // check if mutable rows need to be updated
97  myVTypeAttributesParent->myLength->updateValue(toString(defaultVTypeParameters.length));
98  }
100  myVTypeAttributesParent->myMinGap->updateValue(toString(defaultVTypeParameters.minGap));
101  }
104  }
107  }
110  }
113  }
115  myVTypeAttributesParent->myWidth->updateValue(toString(defaultVTypeParameters.width));
116  }
118  myVTypeAttributesParent->myHeight->updateValue(toString(defaultVTypeParameters.height));
119  }
121  myVTypeAttributesParent->myOSGFile->updateValue(toString(defaultVTypeParameters.osgFile));
122  }
125  }
128  }
131  }
134  }
135  // update GUIShape
136  if (myComboBoxVClass->getText().empty()) {
138  } else {
140  }
141  }
142  } else {
143  myComboBoxVClass->setTextColor(FXRGB(255, 0, 0));
146  }
148 }
149 
150 
153  const auto vClass = myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(SUMO_ATTR_VCLASS);
154  int index = 0;
155  for (int i = 0; i < myComboBoxVClass->getNumItems(); i++) {
156  if (myComboBoxVClass->getItemText(i) == vClass) {
157  index = i;
158  }
159  }
160  myComboBoxVClass->setCurrentItem(index);
161  setVClassLabelImage();
162  return myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getVClass();
163 }
164 
165 
166 void
168  // by default vClass is passenger
169  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(SUMO_ATTR_VCLASS).empty()) {
170  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_PASSENGER));
171  } else {
172  // set Icon in label depending of current VClass
173  switch (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getVClass()) {
174  case SVC_PRIVATE:
175  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_PRIVATE));
176  break;
177  case SVC_EMERGENCY:
178  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_EMERGENCY));
179  break;
180  case SVC_AUTHORITY:
181  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_AUTHORITY));
182  break;
183  case SVC_ARMY:
184  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_ARMY));
185  break;
186  case SVC_VIP:
187  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_VIP));
188  break;
189  case SVC_PASSENGER:
190  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_PASSENGER));
191  break;
192  case SVC_HOV:
193  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_HOV));
194  break;
195  case SVC_TAXI:
196  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_TAXI));
197  break;
198  case SVC_BUS:
199  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_BUS));
200  break;
201  case SVC_COACH:
202  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_COACH));
203  break;
204  case SVC_DELIVERY:
205  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_DELIVERY));
206  break;
207  case SVC_TRUCK:
208  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_TRUCK));
209  break;
210  case SVC_TRAILER:
211  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_TRAILER));
212  break;
213  case SVC_TRAM:
214  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_TRAM));
215  break;
216  case SVC_RAIL_URBAN:
217  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_RAIL_URBAN));
218  break;
219  case SVC_RAIL:
220  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_RAIL));
221  break;
222  case SVC_RAIL_ELECTRIC:
223  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_RAIL_ELECTRIC));
224  break;
225  case SVC_RAIL_FAST:
226  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_RAIL_FAST));
227  break;
228  case SVC_MOTORCYCLE:
229  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_MOTORCYCLE));
230  break;
231  case SVC_MOPED:
232  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_MOPED));
233  break;
234  case SVC_BICYCLE:
235  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_BICYCLE));
236  break;
237  case SVC_PEDESTRIAN:
238  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_PEDESTRIAN));
239  break;
240  case SVC_E_VEHICLE:
241  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_EVEHICLE));
242  break;
243  case SVC_SHIP:
244  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_SHIP));
245  break;
246  case SVC_CONTAINER:
247  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_CUSTOM1));
248  break;
249  case SVC_CABLE_CAR:
250  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_CUSTOM1));
251  break;
252  case SVC_SUBWAY:
253  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_CUSTOM1));
254  break;
255  case SVC_AIRCRAFT:
256  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_CUSTOM1));
257  break;
258  case SVC_WHEELCHAIR:
259  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_CUSTOM1));
260  break;
261  case SVC_SCOOTER:
262  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_CUSTOM1));
263  break;
264  case SVC_DRONE:
265  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_CUSTOM1));
266  break;
267  case SVC_CUSTOM1:
268  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_CUSTOM1));
269  break;
270  case SVC_CUSTOM2:
271  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_CUSTOM2));
272  break;
273  default:
274  myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_IGNORING));
275  break;
276  }
277  }
278 }
279 
280 // ---------------------------------------------------------------------------
281 // GNEVehicleTypeDialog::VShapeRow - methods
282 // ---------------------------------------------------------------------------
283 
284 GNEVehicleTypeDialog::VTypeAttributes::VShapeRow::VShapeRow(VTypeAttributes* VTypeAttributesParent, FXVerticalFrame* column) :
285  FXHorizontalFrame(column, GUIDesignAuxiliarHorizontalFrame),
286  myVTypeAttributesParent(VTypeAttributesParent) {
287  // create two auxiliar frames
288  FXVerticalFrame* verticalFrameLabelAndComboBox = new FXVerticalFrame(this, GUIDesignAuxiliarVerticalFrame);
289  // create combo for vehicle shapes
290  new FXLabel(verticalFrameLabelAndComboBox, toString(SUMO_ATTR_GUISHAPE).c_str(), nullptr, GUIDesignLabelThickedFixed(150));
292  VTypeAttributesParent, MID_GNE_SET_ATTRIBUTE, GUIDesignComboBox);
293  myComboBoxShapeLabelImage = new FXLabel(this, "", nullptr, GUIDesignLabelTickedIcon180x46);
294  myComboBoxShapeLabelImage->setBackColor(FXRGBA(255, 255, 255, 255));
295  // fill combo Box with all vehicle shapes
296  std::vector<std::string> VShapeStrings = SumoVehicleShapeStrings.getStrings();
297  for (const auto& VShapeString : VShapeStrings) {
298  if (VShapeString != SumoVehicleShapeStrings.getString(SUMOVehicleShape::UNKNOWN)) {
299  myComboBoxShape->appendIconItem(VShapeString.c_str(), nullptr);
300  }
301  }
302 }
303 
304 
305 void
307  // set color of myComboBoxShape, depending if current value is valid or not
308  if (myComboBoxShape->isEnabled()) {
309  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text())) {
310  myComboBoxShape->setTextColor(FXRGB(0, 0, 0));
311  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text(),
312  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
313  setVShapeLabelImage();
314  } else {
315  myComboBoxShape->setTextColor(FXRGB(255, 0, 0));
316  myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid = false;
317  myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = SUMO_ATTR_GUISHAPE;
318  }
319  }
320 }
321 
322 
323 void
325  // set value
326  const int index = myComboBoxShape->findItem(myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(SUMO_ATTR_GUISHAPE).c_str());
327  if (index == -1) {
328  myComboBoxShape->disable();
329  } else {
330  myComboBoxShape->setCurrentItem(index);
331  myComboBoxShape->enable();
332  }
333  setVShapeLabelImage();
334 }
335 
336 
337 void
339  // create new VClassDefaultValues using the new VClass
340  SUMOVTypeParameter::VClassDefaultValues newVClass(vClass);
341  // set value
342  const int index = myComboBoxShape->findItem(SumoVehicleShapeStrings.getString(newVClass.shape).c_str());
343  if (index == -1) {
344  myComboBoxShape->disable();
345  } else {
346  myComboBoxShape->setCurrentItem(index);
347  myComboBoxShape->enable();
348  }
349  myComboBoxShape->setTextColor(FXRGB(0, 0, 0));
350  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text(),
351  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
352  setVShapeLabelImage();
353 }
354 
355 
356 void
358  // set Icon in label depending of current VClass
359  switch (getVehicleShapeID(myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(SUMO_ATTR_GUISHAPE))) {
361  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_UNKNOWN));
362  break;
364  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PEDESTRIAN));
365  break;
367  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BICYCLE));
368  break;
370  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_MOPED));
371  break;
373  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_MOTORCYCLE));
374  break;
376  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER));
377  break;
379  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER_SEDAN));
380  break;
382  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER_HATCHBACK));
383  break;
385  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER_WAGON));
386  break;
388  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER_VAN));
389  break;
391  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_TAXI));
392  break;
394  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_DELIVERY));
395  break;
397  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_TRUCK));
398  break;
400  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_TRUCK_SEMITRAILER));
401  break;
403  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_TRUCK_1TRAILER));
404  break;
406  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BUS));
407  break;
409  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BUS_COACH));
410  break;
412  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BUS_FLEXIBLE));
413  break;
415  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BUS_TROLLEY));
416  break;
418  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_RAIL));
419  break;
421  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_RAIL_CAR));
422  break;
424  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_RAIL_CARGO));
425  break;
427  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_E_VEHICLE));
428  break;
430  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_ANT));
431  break;
433  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_SHIP));
434  break;
436  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_EMERGENCY));
437  break;
439  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_FIREBRIGADE));
440  break;
442  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_POLICE));
443  break;
445  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_RICKSHAW));
446  break;
448  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_SCOOTER));
449  break;
451  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_AIRCRAFT));
452  break;
453  default:
454  myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_IGNORING));
455  break;
456  }
457 }
458 
459 // ---------------------------------------------------------------------------
460 // GNEVehicleTypeDialog::VTypeAttributes - methods
461 // ---------------------------------------------------------------------------
462 
463 GNEVehicleTypeDialog::VTypeAttributes::VTypeAttributeRow::VTypeAttributeRow(VTypeAttributes* VTypeAttributesParent, FXVerticalFrame* verticalFrame, const SumoXMLAttr attr, const RowAttrType rowAttrType, const std::vector<std::string>& values) :
464  FXHorizontalFrame(verticalFrame, GUIDesignAuxiliarHorizontalFrame),
465  myVTypeAttributesParent(VTypeAttributesParent),
466  myAttr(attr),
467  myRowAttrType(rowAttrType),
468  myButton(nullptr),
469  myTextField(nullptr),
470  myComboBox(nullptr) {
471  // first check if we have to create a button or a label
472  if ((rowAttrType == ROWTYPE_COLOR) || (rowAttrType == ROWTYPE_FILENAME)) {
473  myButton = GUIDesigns::buildFXButton(this, filterAttributeName(attr), "", "", nullptr, VTypeAttributesParent, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonFixed(150));
474  if (rowAttrType == ROWTYPE_COLOR) {
476  }
477  } else if (rowAttrType == ROWTYPE_PARAMETERS) {
478  myButton = GUIDesigns::buildFXButton(this, TL("Edit parameters"), "", "", nullptr, VTypeAttributesParent, MID_GNE_OPEN_PARAMETERS_DIALOG, GUIDesignButtonFixed(150));
479  } else {
480  GUIDesigns::buildFXLabel(this, filterAttributeName(attr), "", "", nullptr, GUIDesignLabelThickedFixed(150));
481  }
482  // now check if we have to create a textfield or a ComboBox
483  if ((rowAttrType == ROWTYPE_STRING) || (rowAttrType == ROWTYPE_COLOR) || (rowAttrType == ROWTYPE_FILENAME) || (rowAttrType == ROWTYPE_PARAMETERS)) {
484  myTextField = new FXTextField(this, GUIDesignTextFieldNCol, VTypeAttributesParent, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldFixed(180));
485  } else if (rowAttrType == ROWTYPE_COMBOBOX) {
487  VTypeAttributesParent, MID_GNE_SET_ATTRIBUTE, GUIDesignComboBoxWidth180);
488  // fill combo Box with values
489  for (const auto& value : values) {
490  myComboBox->appendIconItem(value.c_str(), nullptr);
491  }
492  } else {
493  throw ProcessError(TL("Invalid row type"));
494  }
495 }
496 
497 
498 void
500  if (myRowAttrType == ROWTYPE_COMBOBOX) {
501  // set color of myComboBox, depending if current value is valid or not
502  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myComboBox->getText().text())) {
503  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myComboBox->getText().text(),
504  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
505  // update value after setting it
506  updateValue();
507  } else {
508  myComboBox->setTextColor(FXRGB(255, 0, 0));
509  // mark VType as invalid
510  myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid = false;
511  myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
512  }
513  } else if (myRowAttrType == ROWTYPE_COLOR) {
514  // set color of myTextFieldColor, depending if current value is valid or not
515  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(SUMO_ATTR_COLOR, myTextField->getText().text())) {
516  // set color depending if is a default value
517  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(SUMO_ATTR_COLOR) != myTextField->getText().text()) {
518  myTextField->setTextColor(FXRGB(0, 0, 0));
519  } else {
520  myTextField->setTextColor(FXRGB(195, 195, 195));
521  }
522  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_COLOR, myTextField->getText().text(), myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
523  } else {
524  myTextField->setTextColor(FXRGB(255, 0, 0));
525  myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid = false;
526  myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = SUMO_ATTR_COLOR;
527  }
528  } else {
529  // set color of textField, depending if current value is valid or not
530  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myTextField->getText().text())) {
531  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myTextField->getText().text(),
532  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
533  // update value after setting it
534  updateValue();
535  } else {
536  myTextField->setTextColor(FXRGB(255, 0, 0));
537  // mark VType as invalid
538  myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid = false;
539  myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
540  }
541  }
542 }
543 
544 
545 void
547  if (myComboBox) {
548  // set color of myComboBox, depending if current value is valid or not
549  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myComboBox->getText().text())) {
550  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myComboBox->getText().text(),
551  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
552  // update value after setting it
553  updateValue(defaultValue);
554  } else {
555  myComboBox->setTextColor(FXRGB(255, 0, 0));
556  // mark VType as invalid
557  myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid = false;
558  myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
559  }
560  } else {
561  // set color of textField, depending if current value is valid or not
562  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myTextField->getText().text())) {
563  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myTextField->getText().text(),
564  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
565  // update value after setting it
566  updateValue(defaultValue);
567  } else {
568  myTextField->setTextColor(FXRGB(255, 0, 0));
569  // mark VType as invalid
570  myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid = false;
571  myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
572  }
573  }
574 }
575 
576 
577 void
579  if (myRowAttrType == ROWTYPE_COMBOBOX) {
580  // set value
581  const int index = myComboBox->findItem(myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
582  if (index == -1) {
583  myComboBox->disable();
584  } else {
585  myComboBox->setCurrentItem(index);
586  myComboBox->enable();
587  }
588  // set color depending if is a default value
589  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myComboBox->getText().text()) {
590  myComboBox->setTextColor(FXRGB(0, 0, 0));
591  } else {
592  myComboBox->setTextColor(FXRGB(195, 195, 195));
593  }
594  } else if (myRowAttrType == ROWTYPE_COLOR) {
595  // set field color
596  myTextField->setText(myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
597  // set color depending if is a default value
598  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myTextField->getText().text()) {
599  myTextField->setTextColor(FXRGB(0, 0, 0));
600  } else {
601  myTextField->setTextColor(FXRGB(195, 195, 195));
602  }
603  } else if (myAttr == GNE_ATTR_PARAMETERS) {
604  // get parameters
605  const std::string& parametersStr = myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr);
606  // set text of myTextField using current value of VType
607  myTextField->setText(parametersStr.c_str());
608  // set text color
609  myTextField->setTextColor(FXRGB(0, 0, 0));
610  // clear parameters
611  myParameters.clear();
612  // separate value in a vector of string using | as separator
613  StringTokenizer parameters(parametersStr, "|", true);
614  // iterate over all values
615  while (parameters.hasNext()) {
616  // obtain key and value and save it in myParameters
617  const std::vector<std::string> keyValue = StringTokenizer(parameters.next(), "=", true).getVector();
618  if (keyValue.size() == 2) {
619  myParameters[keyValue.front()] = keyValue.back();
620  }
621  }
622  } else {
623  // set text of myTextField using current value of VType
624  myTextField->setText(myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
625  // set color depending if is a default value
626  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myTextField->getText().text()) {
627  myTextField->setTextColor(FXRGB(0, 0, 0));
628  } else {
629  myTextField->setTextColor(FXRGB(195, 195, 195));
630  }
631  }
632 }
633 
634 
635 void
637  if (myComboBox) {
638  // set value
639  const int index = myComboBox->findItem(myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
640  if (index == -1) {
641  myComboBox->disable();
642  } else {
643  myComboBox->setCurrentItem(index);
644  myComboBox->enable();
645  }
646  // set color depending if is a default value
647  if (defaultValue != myComboBox->getText().text()) {
648  myComboBox->setTextColor(FXRGB(0, 0, 0));
649  } else {
650  myComboBox->setTextColor(FXRGB(195, 195, 195));
651  }
652  } else {
653  // set text of myTextField using current value of VType
654  myTextField->setText(myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
655  // set color depending if is a default value
656  if (defaultValue != myTextField->getText().text()) {
657  myTextField->setTextColor(FXRGB(0, 0, 0));
658  } else {
659  myTextField->setTextColor(FXRGB(195, 195, 195));
660  }
661  }
662 }
663 
664 
665 const FXButton*
667  return myButton;
668 }
669 
670 
671 void
673  // create FXColorDialog
674  FXColorDialog colordialog(this, TL("Color Dialog"));
675  colordialog.setTarget(this);
676  colordialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::COLORWHEEL));
677  // If previous attribute wasn't correct, set black as default color
678  if (GNEAttributeCarrier::canParse<RGBColor>(myTextField->getText().text())) {
679  colordialog.setRGBA(MFXUtils::getFXColor(GNEAttributeCarrier::parse<RGBColor>(myTextField->getText().text())));
680  } else {
681  colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::BLACK));
682  }
683  // execute dialog to get a new color
684  if (colordialog.execute()) {
685  std::string newValue = toString(MFXUtils::getRGBColor(colordialog.getRGBA()));
686  myTextField->setText(newValue.c_str());
687  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, newValue)) {
688  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, newValue, myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
689  // If previously value was incorrect, change font color to black
690  myTextField->setTextColor(FXRGB(0, 0, 0));
691  myTextField->killFocus();
692  }
693  }
694 }
695 
696 
697 void
699  // get the new image file
700  FXFileDialog opendialog(this, TL("Open Image"));
701  opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::VTYPE));
702  opendialog.setSelectMode(SELECTFILE_EXISTING);
703  opendialog.setPatternList("All files (*)");
704  if (gCurrentFolder.length() != 0) {
705  opendialog.setDirectory(gCurrentFolder);
706  }
707  if (opendialog.execute()) {
708  // update global current folder
709  gCurrentFolder = opendialog.getDirectory();
710  // get image path
711  std::string imagePath = opendialog.getFilename().text();
712  // check if image is valid
713  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, imagePath)) {
714  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, imagePath, myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
715  myTextField->setText(imagePath.c_str());
716  // If previously value was incorrect, change font color to black
717  myTextField->setTextColor(FXRGB(0, 0, 0));
718  myTextField->killFocus();
719  }
720  }
721 }
722 
723 
724 void
726  // get the new file name
727  FXFileDialog opendialog(this, TL("Open OSG File"));
728  opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::VTYPE));
729  opendialog.setSelectMode(SELECTFILE_EXISTING);
730  opendialog.setPatternList("OSG file (*.obj)");
731  if (gCurrentFolder.length() != 0) {
732  opendialog.setDirectory(gCurrentFolder);
733  }
734  if (opendialog.execute()) {
735  // update global current folder
736  gCurrentFolder = opendialog.getDirectory();
737  // get image path
738  std::string imagePath = opendialog.getFilename().text();
739  // check if image is valid
740  if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, imagePath)) {
741  myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, imagePath, myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
742  myTextField->setText(imagePath.c_str());
743  // If previously value was incorrect, change font color to black
744  myTextField->setTextColor(FXRGB(0, 0, 0));
745  myTextField->killFocus();
746  }
747  }
748 }
749 
750 
751 std::string
753  return myTextField->getText().text();
754 }
755 
756 
757 std::vector<std::pair<std::string, std::string> >
759  std::vector<std::pair<std::string, std::string> > result;
760  // Generate a vector string using the following structure: "<key1,value1>, <key2, value2>,...
761  for (const auto& parameter : myParameters) {
762  result.push_back(std::make_pair(parameter.first, parameter.second));
763  }
764  return result;
765 }
766 
767 
768 void
769 GNEVehicleTypeDialog::VTypeAttributes::VTypeAttributeRow::setParameters(const std::vector<std::pair<std::string, std::string> >& parameters) {
770  // first clear parameters
771  myParameters.clear();
772  // declare result
773  std::string result;
774  // iterate over parameters
775  for (const auto& parameter : parameters) {
776  // Generate an string using the following structure: "key1=value1|key2=value2|...
777  result += parameter.first + "=" + parameter.second + "|";
778  // fill parameters
779  myParameters[parameter.first] = parameter.second;
780  }
781  // remove the last "|"
782  if (!result.empty()) {
783  result.pop_back();
784  }
785  // set text field
786  myTextField->setText(result.c_str());
787 }
788 
789 
790 std::string
792  switch (attr) {
793  // JM
795  return "crossingGap";
797  return "driveAfterYellowTime";
799  return "driveAfterRedTime";
801  return "driveRedSpeed";
803  return "ignoreKeepClearTime";
805  return "ignoreFoeSpeed";
807  return "ignoreFoeProb";
809  return "sigmaMinor";
811  return "timegapMinor";
812  // LCM
814  return "strategic";
816  return "cooperative";
818  return "speedGain";
820  return "keepRight";
822  return "sublane";
824  return "opposite";
825  case SUMO_ATTR_LCA_PUSHY:
826  return "pushy";
828  return "pushyGap";
830  return "assertive";
832  return "impatience";
834  return "timeToImpatience";
836  return "accelLat";
838  return "lookaheadLeft";
840  return "speedGainRight";
842  return "maxSpeedLatStanding";
844  return "maxSpeedLatFactor";
846  return "turnAlignDistance";
848  return "overtakeRight";
850  return "keepRightAcceptanceTime";
852  return "overtakeDeltaSpeedFactor";
853  /* case SUMO_ATTR_LCA_EXPERIMENTAL1:
854  return "experimental1";
855  */
856  default:
857  return toString(attr);
858  }
859 }
860 
861 // ---------------------------------------------------------------------------
862 // GNEVehicleTypeDialog::VTypeAttributes - methods
863 // ---------------------------------------------------------------------------
864 
865 GNEVehicleTypeDialog::VTypeAttributes::VTypeAttributes(GNEVehicleTypeDialog* vehicleTypeDialog, FXHorizontalFrame* column) :
866  FXVerticalFrame(column, GUIDesignAuxiliarVerticalFrame),
867  myVehicleTypeDialog(vehicleTypeDialog) {
868  // declare two auxiliary horizontal frames
869  FXHorizontalFrame* firstAuxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
870  FXVerticalFrame* firstAuxiliarVerticalFrame = new FXVerticalFrame(firstAuxiliarHorizontalFrame, GUIDesignAuxiliarVerticalFrame);
871  // create attributes for common attributes
872  FXGroupBox* commonAttributes = new FXGroupBox(firstAuxiliarVerticalFrame, "Vehicle Type attributes", GUIDesignGroupBoxFrame);
873  // create horizontal frame for columns of attributes
874  FXHorizontalFrame* columnsBasicVTypeAttributes = new FXHorizontalFrame(commonAttributes, GUIDesignAuxiliarHorizontalFrame);
875  // build left attributes
876  buildAttributesA(new FXVerticalFrame(columnsBasicVTypeAttributes, GUIDesignAuxiliarFrame));
877  // build right attributes
878  buildAttributesB(new FXVerticalFrame(columnsBasicVTypeAttributes, GUIDesignAuxiliarFrame));
879  // create GroupBox for Junction Model Attributes
880  FXGroupBox* JMAttributes = new FXGroupBox(firstAuxiliarVerticalFrame, "Junction Model attributes", GUIDesignGroupBoxFrame);
881  // create horizontal frame for columns of Junction Model attributes
882  FXHorizontalFrame* columnsJMVTypeAttributes = new FXHorizontalFrame(JMAttributes, GUIDesignAuxiliarHorizontalFrame);
883  // build left attributes
884  buildJunctionModelAttributesA(new FXVerticalFrame(columnsJMVTypeAttributes, GUIDesignAuxiliarFrame));
885  // build right attributes
886  buildJunctionModelAttributesB(new FXVerticalFrame(columnsJMVTypeAttributes, GUIDesignAuxiliarFrame));
887  // create GroupBox for Junction Model Attributes
888  FXGroupBox* LCMAttributes = new FXGroupBox(firstAuxiliarHorizontalFrame, "Lane Change Model attributes", GUIDesignGroupBoxFrame);
889  // create Lane Change Model Attributes
890  buildLaneChangeModelAttributes(new FXVerticalFrame(LCMAttributes, GUIDesignAuxiliarFrame));
891 }
892 
893 
894 void
896  // 01 Create VClassRow
897  myVClassRow = new VClassRow(this, column);
898 
899  // 02 create FXTextField and Label for vehicleTypeID
900  FXHorizontalFrame* row = new FXHorizontalFrame(column, GUIDesignAuxiliarHorizontalFrame);
901  new FXLabel(row, toString(SUMO_ATTR_ID).c_str(), nullptr, GUIDesignLabelThickedFixed(150));
902  myTextFieldVehicleTypeID = new FXTextField(row, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldFixed(180));
903 
904  // 03 create FXTextField and Button for Color
905  myColor = new VTypeAttributeRow(this, column, SUMO_ATTR_COLOR, VTypeAttributeRow::RowAttrType::ROWTYPE_COLOR);
906 
907  // 04 create FXTextField and Label for Length
908  myLength = new VTypeAttributeRow(this, column, SUMO_ATTR_LENGTH, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
909 
910  // 05 create FXTextField and Label for MinGap
911  myMinGap = new VTypeAttributeRow(this, column, SUMO_ATTR_MINGAP, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
912 
913  // 06 create FXTextField and Label for MaxSpeed
914  myMaxSpeed = new VTypeAttributeRow(this, column, SUMO_ATTR_MAXSPEED, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
915 
916  // 07 create VTypeAttributeRow and Label for desired max speed
917  myDesiredMaxSpeed = new VTypeAttributeRow(this, column, SUMO_ATTR_DESIRED_MAXSPEED, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
918 
919  // 08 create FXTextField and Label for SpeedFactor
920  mySpeedFactor = new VTypeAttributeRow(this, column, SUMO_ATTR_SPEEDFACTOR, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
921 
922  // 09 create FXTextField and Label for EmissionClass
923  myEmissionClass = new VTypeAttributeRow(this, column, SUMO_ATTR_EMISSIONCLASS, VTypeAttributeRow::RowAttrType::ROWTYPE_COMBOBOX, PollutantsInterface::getAllClassesStr());
924 
925  // 10 create FXTextField and Label for Width
926  myWidth = new VTypeAttributeRow(this, column, SUMO_ATTR_WIDTH, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
927 
928  // 11 create FXTextField and Label for Height
929  myHeight = new VTypeAttributeRow(this, column, SUMO_ATTR_HEIGHT, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
930 
931  // 12 create FXTextField and Label for Filename
932  myFilename = new VTypeAttributeRow(this, column, SUMO_ATTR_IMGFILE, VTypeAttributeRow::RowAttrType::ROWTYPE_FILENAME);
933 
934  // 13 create FXTextField and Label for Filename
935  myOSGFile = new VTypeAttributeRow(this, column, SUMO_ATTR_OSGFILE, VTypeAttributeRow::RowAttrType::ROWTYPE_FILENAME);
936 
937  // 14 create VTypeAttributeRow and Label for LaneChangeModel
938  myLaneChangeModel = new VTypeAttributeRow(this, column, SUMO_ATTR_LANE_CHANGE_MODEL, VTypeAttributeRow::RowAttrType::ROWTYPE_COMBOBOX, SUMOXMLDefinitions::LaneChangeModels.getStrings());
939 }
940 
941 
942 void
944  // 01 Create VShapeRow
945  myVShapeRow = new VShapeRow(this, column);
946 
947  // 02 create VTypeAttributeRow and Label for Probability
948  myProbability = new VTypeAttributeRow(this, column, SUMO_ATTR_PROB, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
949 
950  // 03 create VTypeAttributeRow and Label for PersonCapacity
951  myPersonCapacity = new VTypeAttributeRow(this, column, SUMO_ATTR_PERSON_CAPACITY, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
952 
953  // 04 create VTypeAttributeRow and Label for ContainerCapacity
954  myContainerCapacity = new VTypeAttributeRow(this, column, SUMO_ATTR_CONTAINER_CAPACITY, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
955 
956  // 05 create VTypeAttributeRow and Label for BoardingDuration
957  myBoardingDuration = new VTypeAttributeRow(this, column, SUMO_ATTR_BOARDING_DURATION, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
958 
959  // 06 create VTypeAttributeRow and Label for LoadingDuration
960  myLoadingDuration = new VTypeAttributeRow(this, column, SUMO_ATTR_LOADING_DURATION, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
961 
962  // 07 create ComboBox and Label for LatAlignment
963  myLatAlignment = new VTypeAttributeRow(this, column, SUMO_ATTR_LATALIGNMENT, VTypeAttributeRow::RowAttrType::ROWTYPE_COMBOBOX, SUMOVTypeParameter::getLatAlignmentStrings());
964 
965  // 08 create VTypeAttributeRow and Label for MinGapLat
966  myMinGapLat = new VTypeAttributeRow(this, column, SUMO_ATTR_MINGAP_LAT, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
967 
968  // 09 create VTypeAttributeRow and Label for MaxSpeedLat
969  myMaxSpeedLat = new VTypeAttributeRow(this, column, SUMO_ATTR_MAXSPEED_LAT, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
970 
971  // 10 create VTypeAttributeRow and Label for ActionStepLength
972  myActionStepLength = new VTypeAttributeRow(this, column, SUMO_ATTR_ACTIONSTEPLENGTH, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
973 
974  // 11 create FXTextField and Label for Carriage length
975  myCarriageLength = new VTypeAttributeRow(this, column, SUMO_ATTR_CARRIAGE_LENGTH, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
976 
977  // 12 create FXTextField and Label for Locomotive length
978  myLocomotiveLength = new VTypeAttributeRow(this, column, SUMO_ATTR_LOCOMOTIVE_LENGTH, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
979 
980  // 13 create FXTextField and Label for carriage GAP
981  myCarriageGap = new VTypeAttributeRow(this, column, SUMO_ATTR_CARRIAGE_GAP, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
982 
983  // 14 create FXTextField and Label for parameters
984  myParameters = new VTypeAttributeRow(this, column, GNE_ATTR_PARAMETERS, VTypeAttributeRow::RowAttrType::ROWTYPE_PARAMETERS);
985 }
986 
987 
988 void
990  // 01 create VTypeAttributeRow and Label for JMCrossingGap
991  myJMCrossingGap = new VTypeAttributeRow(this, column, SUMO_ATTR_JM_CROSSING_GAP, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
992 
993  // 02 create VTypeAttributeRow and Label for JMIgnoreKeepclearTime
994  myJMIgnoreKeepclearTime = new VTypeAttributeRow(this, column, SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
995 
996  // 03 create VTypeAttributeRow and Label for JMDriveAfterYellowTime
997  myJMDriveAfterYellowTime = new VTypeAttributeRow(this, column, SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
998 
999  // 04 create VTypeAttributeRow and Label for JMDriveAfterRedTime
1000  myJMDriveAfterRedTime = new VTypeAttributeRow(this, column, SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1001 
1002  // 05 create VTypeAttributeRow and Label for JMDriveRedSpeed
1003  myJMDriveRedSpeed = new VTypeAttributeRow(this, column, SUMO_ATTR_JM_DRIVE_RED_SPEED, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1004 }
1005 
1006 
1007 void
1009  // 01 create VTypeAttributeRow and Label for JMIgnoreFoeProb
1010  myJMIgnoreFoeProb = new VTypeAttributeRow(this, column, SUMO_ATTR_JM_IGNORE_FOE_PROB, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1011 
1012  // 02 create VTypeAttributeRow and Label for JMIgnoreFoeSpeed
1013  myJMIgnoreFoeSpeed = new VTypeAttributeRow(this, column, SUMO_ATTR_JM_IGNORE_FOE_SPEED, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1014 
1015  // 03 create VTypeAttributeRow and Label for JMSigmaMinor
1016  myJMSigmaMinor = new VTypeAttributeRow(this, column, SUMO_ATTR_JM_SIGMA_MINOR, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1017 
1018  // 04 create VTypeAttributeRow and Label for JMTimeGapMinor
1019  myJMTimeGapMinor = new VTypeAttributeRow(this, column, SUMO_ATTR_JM_TIMEGAP_MINOR, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1020 
1021  // 05 create VTypeAttributeRow and Label for Impatience
1022  myJMImpatience = new VTypeAttributeRow(this, column, SUMO_ATTR_IMPATIENCE, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1023 }
1024 
1025 
1026 void
1028  // 01 create VTypeAttributeRow and Label for strategic param
1029  myLCAStrategicParam = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_STRATEGIC_PARAM, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1030 
1031  // 02 create VTypeAttributeRow and Label for cooperative param
1032  myLCACooperativeParam = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_COOPERATIVE_PARAM, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1033 
1034  // 03 create VTypeAttributeRow and Label for speed gain param
1035  myLCASpeedgainParam = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_SPEEDGAIN_PARAM, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1036 
1037  // 04 create VTypeAttributeRow and Label for keepright param
1038  myLCAKeeprightParam = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_KEEPRIGHT_PARAM, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1039 
1040  // 05 create VTypeAttributeRow and Label for sublane param
1041  myLCASublaneParam = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_SUBLANE_PARAM, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1042 
1043  // 06 create VTypeAttributeRow and Label for opposite param
1044  myLCAOppositeParam = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_OPPOSITE_PARAM, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1045 
1046  // 07 create VTypeAttributeRow and Label for pushy
1047  myLCAPushy = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_PUSHY, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1048 
1049  // 08 create VTypeAttributeRow and Label for pushy gap
1050  myLCAPushygap = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_PUSHYGAP, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1051 
1052  // 09 create VTypeAttributeRow and Label for assertive
1053  myLCAAssertive = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_ASSERTIVE, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1054 
1055  // 10 create VTypeAttributeRow and Label for impatience
1056  myLCAImpatience = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_IMPATIENCE, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1057 
1058  // 11 create VTypeAttributeRow and Label for time to impatience
1059  myLCATimeToImpatience = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_TIME_TO_IMPATIENCE, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1060 
1061  // 12 create VTypeAttributeRow and Label for accel lat
1062  myLCAAccelLat = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_ACCEL_LAT, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1063 
1064  // 13 create VTypeAttributeRow and Label for look ahead lefth
1065  myLCALookAheadLeft = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_LOOKAHEADLEFT, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1066 
1067  // 14 create VTypeAttributeRow and Label for speed gain right
1068  myLCASpeedGainRight = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_SPEEDGAINRIGHT, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1069 
1070  // 15 create VTypeAttributeRow and Label for max speed lat standing
1071  myLCAMaxSpeedLatStanding = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_MAXSPEEDLATSTANDING, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1072 
1073  // 16 create VTypeAttributeRow and Label for max speed lat factor
1074  myLCAMaxSpeedLatFactor = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_MAXSPEEDLATFACTOR, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1075 
1076  // 17 create VTypeAttributeRow and Label for turn alignment distance
1077  myLCATurnAlignmentDistance = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1078 
1079  // 18 create VTypeAttributeRow and Label for overtake right
1080  myLCAOvertakeRight = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_OVERTAKE_RIGHT, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1081 
1082  // 19 create VTypeAttributeRow and Label for keep right acceptance time
1083  myLCAKeepRightAcceptanceTime = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_KEEPRIGHT_ACCEPTANCE_TIME, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1084 
1085  // 20 create VTypeAttributeRow and Label for overtake deltaspeed factor
1086  myLCAOvertakeDeltaSpeedFactor = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_OVERTAKE_DELTASPEED_FACTOR, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
1087 
1088  // 21 create VTypeAttributeRow and Label for experimental
1089  /* myLCAExperimental = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_EXPERIMENTAL1, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING); */
1090 }
1091 
1092 
1093 void
1095  //set values of myEditedDemandElement into fields
1096  myTextFieldVehicleTypeID->setText(myVehicleTypeDialog->myEditedDemandElement->getAttribute(SUMO_ATTR_ID).c_str());
1097  // set variables of special rows VClass and VShape
1098  SUMOVTypeParameter::VClassDefaultValues defaultVTypeParameters(myVClassRow->updateValue());
1099  myVShapeRow->updateValues();
1100  // update rows
1101  myLaneChangeModel->updateValue();
1102  myLatAlignment->updateValue(toString(defaultVTypeParameters.latAlignmentProcedure));
1103  myColor->updateValue();
1104  myLength->updateValue(toString(defaultVTypeParameters.length));
1105  myMinGap->updateValue(toString(defaultVTypeParameters.minGap));
1106  myMaxSpeed->updateValue(toString(defaultVTypeParameters.maxSpeed));
1107  myDesiredMaxSpeed->updateValue(toString(defaultVTypeParameters.desiredMaxSpeed));
1108  mySpeedFactor->updateValue(toString(defaultVTypeParameters.speedFactor.getParameter()[0]));
1109  myEmissionClass->updateValue(toString(defaultVTypeParameters.emissionClass));
1110  myWidth->updateValue(toString(defaultVTypeParameters.width));
1111  myHeight->updateValue(toString(defaultVTypeParameters.height));
1112  myFilename->updateValue();
1113  myOSGFile->updateValue(toString(defaultVTypeParameters.osgFile));
1114  myPersonCapacity->updateValue(toString(defaultVTypeParameters.personCapacity));
1115  myContainerCapacity->updateValue(toString(defaultVTypeParameters.containerCapacity));
1116  myCarriageLength->updateValue(toString(defaultVTypeParameters.carriageLength));
1117  myLocomotiveLength->updateValue(toString(defaultVTypeParameters.locomotiveLength));
1118  myBoardingDuration->updateValue();
1119  myLoadingDuration->updateValue();
1120  myMinGapLat->updateValue();
1121  myMaxSpeedLat->updateValue();
1122  myActionStepLength->updateValue();
1123  myProbability->updateValue();
1124  myCarriageGap->updateValue();
1125  // JM Parameters
1126  myJMCrossingGap->updateValue();
1127  myJMIgnoreKeepclearTime->updateValue();
1128  myJMDriveAfterYellowTime->updateValue();
1129  myJMDriveAfterRedTime->updateValue();
1130  myJMDriveRedSpeed->updateValue();
1131  myJMIgnoreFoeProb->updateValue();
1132  myJMIgnoreFoeSpeed->updateValue();
1133  myJMSigmaMinor->updateValue();
1134  myJMTimeGapMinor->updateValue();
1135  myJMImpatience->updateValue();
1136  // LCM Attributes
1137  myLCAStrategicParam->updateValue();
1138  myLCACooperativeParam->updateValue();
1139  myLCASpeedgainParam->updateValue();
1140  myLCAKeeprightParam->updateValue();
1141  myLCASublaneParam->updateValue();
1142  myLCAOppositeParam->updateValue();
1143  myLCAPushy->updateValue();
1144  myLCAPushygap->updateValue();
1145  myLCAAssertive->updateValue();
1146  myLCAImpatience->updateValue();
1147  myLCATimeToImpatience->updateValue();
1148  myLCAAccelLat->updateValue();
1149  myLCALookAheadLeft->updateValue();
1150  myLCASpeedGainRight->updateValue();
1151  myLCAMaxSpeedLatStanding->updateValue();
1152  myLCAMaxSpeedLatFactor->updateValue();
1153  myLCATurnAlignmentDistance->updateValue();
1154  myLCAOvertakeRight->updateValue();
1155  myLCAKeepRightAcceptanceTime->updateValue();
1156  myLCAOvertakeDeltaSpeedFactor->updateValue();
1157  /* myLCAExperimental->updateValue(); */
1158  // parameters
1159  myParameters->updateValue();
1160 }
1161 
1162 
1163 long
1165  // At start we assumed, that all values are valid
1166  myVehicleTypeDialog->myVehicleTypeValid = true;
1167  myVehicleTypeDialog->myInvalidAttr = SUMO_ATTR_NOTHING;
1168  // set color of myTextFieldVehicleTypeID, depending if current value is valid or not
1169  if (myVehicleTypeDialog->myEditedDemandElement->isValid(SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text())) {
1170  myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0));
1171  myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
1172  } else if (myVehicleTypeDialog->myEditedDemandElement->getAttribute(SUMO_ATTR_ID) == myTextFieldVehicleTypeID->getText().text()) {
1173  myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0));
1174  myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
1175  } else {
1176  myTextFieldVehicleTypeID->setTextColor(FXRGB(255, 0, 0));
1177  myVehicleTypeDialog->myVehicleTypeValid = false;
1178  myVehicleTypeDialog->myInvalidAttr = SUMO_ATTR_ID;
1179  }
1180  // set variables of special rows VClass and VShape
1181  SUMOVTypeParameter::VClassDefaultValues defaultVTypeParameters(myVClassRow->setVariable());
1182  // set variables of special rows VShape
1183  myVShapeRow->setVariable();
1184  // set attributes in rest rows
1185  myColor->setVariable();
1186  myLength->setVariable(toString(defaultVTypeParameters.length));
1187  myMinGap->setVariable(toString(defaultVTypeParameters.minGap));
1188  myMaxSpeed->setVariable(toString(defaultVTypeParameters.maxSpeed));
1189  myDesiredMaxSpeed->setVariable(toString(defaultVTypeParameters.desiredMaxSpeed));
1190  mySpeedFactor->setVariable(toString(defaultVTypeParameters.speedFactor.getParameter()[0]));
1191  myEmissionClass->setVariable(toString(defaultVTypeParameters.emissionClass));
1192  myWidth->setVariable(toString(defaultVTypeParameters.width));
1193  myHeight->setVariable(toString(defaultVTypeParameters.height));
1194  myOSGFile->setVariable(toString(defaultVTypeParameters.osgFile));
1195  // set attributes in rows
1196  myLaneChangeModel->setVariable();
1197  myLatAlignment->setVariable(toString(defaultVTypeParameters.latAlignmentProcedure));
1198  myLength->setVariable(toString(defaultVTypeParameters.length));
1199  myMinGap->setVariable(toString(defaultVTypeParameters.minGap));
1200  myMaxSpeed->setVariable(toString(defaultVTypeParameters.maxSpeed));
1201  mySpeedFactor->setVariable(toString(defaultVTypeParameters.speedFactor.getParameter()[0]));
1202  myEmissionClass->setVariable(toString(defaultVTypeParameters.emissionClass));
1203  myWidth->setVariable(toString(defaultVTypeParameters.width));
1204  myHeight->setVariable(toString(defaultVTypeParameters.height));
1205  myFilename->setVariable();
1206  myOSGFile->setVariable(toString(defaultVTypeParameters.osgFile));
1207  myPersonCapacity->setVariable(toString(defaultVTypeParameters.personCapacity));
1208  myContainerCapacity->setVariable(toString(defaultVTypeParameters.containerCapacity));
1209  myCarriageLength->setVariable(toString(defaultVTypeParameters.carriageLength));
1210  myLocomotiveLength->setVariable(toString(defaultVTypeParameters.locomotiveLength));
1211  myBoardingDuration->setVariable();
1212  myLoadingDuration->setVariable();
1213  myMinGapLat->setVariable();
1214  myMaxSpeedLat->setVariable();
1215  myActionStepLength->setVariable();
1216  myProbability->setVariable();
1217  myCarriageGap->setVariable();
1218  // JM Variables
1219  myJMCrossingGap->setVariable();
1220  myJMIgnoreKeepclearTime->setVariable();
1221  myJMDriveAfterYellowTime->setVariable();
1222  myJMDriveAfterRedTime->setVariable();
1223  myJMDriveRedSpeed->setVariable();
1224  myJMIgnoreFoeProb->setVariable();
1225  myJMIgnoreFoeSpeed->setVariable();
1226  myJMSigmaMinor->setVariable();
1227  myJMTimeGapMinor->setVariable();
1228  myJMImpatience->setVariable();
1229  // LCM Attributes
1230  myLCAStrategicParam->setVariable();
1231  myLCACooperativeParam->setVariable();
1232  myLCASpeedgainParam->setVariable();
1233  myLCAKeeprightParam->setVariable();
1234  myLCASublaneParam->setVariable();
1235  myLCAOppositeParam->setVariable();
1236  myLCAPushy->setVariable();
1237  myLCAPushygap->setVariable();
1238  myLCAAssertive->setVariable();
1239  myLCAImpatience->setVariable();
1240  myLCATimeToImpatience->setVariable();
1241  myLCAAccelLat->setVariable();
1242  myLCALookAheadLeft->setVariable();
1243  myLCASpeedGainRight->setVariable();
1244  myLCAMaxSpeedLatStanding->setVariable();
1245  myLCAMaxSpeedLatFactor->setVariable();
1246  myLCATurnAlignmentDistance->setVariable();
1247  myLCAOvertakeRight->setVariable();
1248  myLCAKeepRightAcceptanceTime->setVariable();
1249  myLCAOvertakeDeltaSpeedFactor->setVariable();
1250  /* myLCAExperimental->setVariable(); */
1251  myParameters->setVariable();
1252  return true;
1253 }
1254 
1255 
1256 long
1258  // check what dialog has to be opened
1259  if (obj == myColor->getButton()) {
1260  myColor->openColorDialog();
1261  } else if (obj == myFilename->getButton()) {
1262  myFilename->openImageFileDialog();
1263  } else if (obj == myOSGFile->getButton()) {
1264  myFilename->openOSGFileDialog();
1265  }
1266  return 1;
1267 }
1268 
1269 
1270 long
1272  // write debug information
1273  WRITE_DEBUG("Open parameters dialog");
1274  // edit parameters using dialog
1275  if (GNESingleParametersDialog(myParameters, myVehicleTypeDialog->getEditedDemandElement()->getNet()->getViewNet()).execute()) {
1276  // write debug information
1277  WRITE_DEBUG("Close parameters dialog");
1278  // set values edited in Parameter dialog in Edited AC
1279  myVehicleTypeDialog->getEditedDemandElement()->setAttribute(GNE_ATTR_PARAMETERS, myParameters->getParametersStr(), myVehicleTypeDialog->getEditedDemandElement()->getNet()->getViewNet()->getUndoList());
1280  } else {
1281  // write debug information
1282  WRITE_DEBUG("Cancel parameters dialog");
1283  }
1284  return 1;
1285 }
1286 
1287 // ---------------------------------------------------------------------------
1288 // GNEVehicleTypeDialog::VShapeRow - methods
1289 // ---------------------------------------------------------------------------
1290 
1292  FXGroupBox(column, "Car Following Model attributes", GUIDesignGroupBoxFrame),
1293  myVehicleTypeDialog(vehicleTypeDialog) {
1294 
1295  // create vertical frame for rows
1296  myVerticalFrameRows = new FXVerticalFrame(this, GUIDesignAuxiliarFrame);
1297 
1298  // declare combo box
1299  FXHorizontalFrame* row = new FXHorizontalFrame(myVerticalFrameRows, GUIDesignAuxiliarHorizontalFrame);
1300  new FXLabel(row, "Algorithm", nullptr, GUIDesignLabelThickedFixed(150));
1303 
1304  // fill combo Box with all Car following models
1305  std::vector<std::string> CFModels = SUMOXMLDefinitions::CarFollowModels.getStrings();
1306  for (const auto& CFModel : CFModels) {
1307  myComboBoxCarFollowModel->appendIconItem(CFModel.c_str(), nullptr);
1308  }
1309 
1310  // 01 create FX and Label for Accel
1312  myRows.push_back(myAccelRow);
1313 
1314  // 02 create FX and Label for Decel
1316  myRows.push_back(myDecelRow);
1317 
1318  // 03 create FX and Label for Apparent decel
1320  myRows.push_back(myApparentDecelRow);
1321 
1322  // 04 create FX and Label for emergency decel
1324  myRows.push_back(myEmergencyDecelRow);
1325 
1326  // 05 create FX and Label for Sigma
1328  myRows.push_back(mySigmaRow);
1329 
1330  // 06 create FX and Label for Tau
1332  myRows.push_back(myTauRow);
1333 
1334  // 07 myMinGapFactor FX and Label for MinGapFactor
1336  myRows.push_back(myMinGapFactorRow);
1337 
1338  // 08 create FX and Label for K
1340  myRows.push_back(myKRow);
1341 
1342  // 09 create FX and Label for PHI
1344  myRows.push_back(myPhiRow);
1345 
1346  // 10 create FX and Label for Deleta
1348  myRows.push_back(myDeltaRow);
1349 
1350  // 11 create FX and Label for Stepping
1352  myRows.push_back(mySteppingRow);
1353 
1354  // 12 create FX and Label for Security
1356  myRows.push_back(mySecurityRow);
1357 
1358  // 13 create FX and Label for Estimation
1360  myRows.push_back(myEstimationRow);
1361 
1362  // 14 create FX and Label for TMP1
1364  myRows.push_back(myTmp1Row);
1365 
1366  // 15 create FX and Label for TMP2
1368  myRows.push_back(myTmp2Row);
1369 
1370  // 16 create FX and Label for TMP3
1372  myRows.push_back(myTmp3Row);
1373 
1374  // 17 create FX and Label for TMP4
1376  myRows.push_back(myTmp4Row);
1377 
1378  // 18 create FX and Label for TMP5
1380  myRows.push_back(myTmp5Row);
1381 
1382  // 19 create FX and Label for trainType (allow strings)
1384  myRows.push_back(myTrainTypeRow);
1385 
1386  // 20 create FX and Label for Tau Last
1388  myRows.push_back(myTrauLastRow);
1389 
1390  // 21 create FX and Label for Aprob
1392  myRows.push_back(myAprobRow);
1393 
1394  // 22 create FX and Label for Adapt Factor
1396  myRows.push_back(myAdaptFactorRow);
1397 
1398  // 23 create FX and Label for Adapt Time
1400  myRows.push_back(myAdaptTimeRow);
1401 
1402  // 24 create FX and Label for W99 CC 01
1404  myRows.push_back(myW99CC1);
1405 
1406  // 25 create FX and Label for W99 CC 02
1408  myRows.push_back(myW99CC2);
1409 
1410  // 26 create FX and Label for W99 CC 03
1412  myRows.push_back(myW99CC3);
1413 
1414  // 27 create FX and Label for W99 CC 04
1416  myRows.push_back(myW99CC4);
1417 
1418  // 28 create FX and Label for W99 CC 05
1420  myRows.push_back(myW99CC5);
1421 
1422  // 29 create FX and Label for W99 CC 06
1424  myRows.push_back(myW99CC6);
1425 
1426  // 30 create FX and Label for W99 CC 07
1428  myRows.push_back(myW99CC7);
1429 
1430  // 31 create FX and Label for W99 CC 08
1432  myRows.push_back(myW99CC8);
1433 
1434  // 32 create FX and Label for W99 CC 09
1436  myRows.push_back(myW99CC9);
1437 
1438  // X1 create FX and Label for Look ahead/preview Time
1440  myRows.push_back(myTpreviewRow);
1441 
1442  // X2 create FX and Label for Reaction Time
1444  myRows.push_back(myTreactionRow);
1445 
1446  // X3 create FX and Label for Wiener Process Driving Error
1448  myRows.push_back(myTPersDriveRow);
1449 
1450  // X4 create FX and Label for Wiener Process Estimation Error
1452  myRows.push_back(myTPersEstimateRow);
1453 
1454  // X5 create FX and Label for Coolness parameter
1456  myRows.push_back(myCcoolnessRow);
1457 
1458  // X6 create FX and Label for leader speed estimation error
1460  myRows.push_back(mySigmaleaderRow);
1461 
1462  // X7 create FX and Label for Gap estimation error
1464  myRows.push_back(mySigmagapRow);
1465 
1466  // X8 create FX and Label for Driving Error
1468  myRows.push_back(mySigmaerrorRow);
1469 
1470  // X9 create FX and Label for max jerk
1472  myRows.push_back(myJerkmaxRow);
1473 
1474  // X10 create FX and Label for AP Driver Update threshold
1476  myRows.push_back(myEpsilonaccRow);
1477 
1478  // X11 create FX and Label for Startup Time to acc_max
1480  myRows.push_back(myTaccmaxRow);
1481 
1482  // X12 create FX and Label for Startup M flatness
1484  myRows.push_back(myMflatnessRow);
1485 
1486  // X13 create FX and Label for Startup M begin
1488  myRows.push_back(myMbeginRow);
1489 
1490  // X14 create FX and Label for using vehicle dynamics
1492  myRows.push_back(myUseVehDynamicsRow);
1493 
1494  // X14 create FX and Label for using vehicle dynamics
1496  myRows.push_back(myMaxVehPreviewRow);
1497 
1498  // create myLabelIncompleteAttribute
1499  myLabelIncompleteAttribute = new FXLabel(myVerticalFrameRows, "Some attributes wasn't\nimplemented yet", nullptr, GUIDesignLabelAboutInfoCenter);
1501 
1502  // show or hide ComboBox depending of current selected CFM
1503  refreshCFMFields();
1504 }
1505 
1506 
1507 void
1509  // start hiding all rows
1510  for (const auto& row : myRows) {
1511  row->hide();
1512  }
1513  // hide myLabelIncompleteAttribute
1514  myLabelIncompleteAttribute->hide();
1515  // show textfield depending of current CFM
1516  if (SUMOXMLDefinitions::CarFollowModels.hasString(myComboBoxCarFollowModel->getText().text())) {
1517  // show textfield depending of selected CFM
1518  switch (SUMOXMLDefinitions::CarFollowModels.get(myComboBoxCarFollowModel->getText().text())) {
1519  case SUMO_TAG_CF_KRAUSS:
1522  myTauRow->show();
1523  myAccelRow->show();
1524  myDecelRow->show();
1525  myApparentDecelRow->show();
1526  myEmergencyDecelRow->show();
1527  mySigmaRow->show();
1528  break;
1529  case SUMO_TAG_CF_KRAUSSX:
1530  myTauRow->show();
1531  myTmp1Row->show();
1532  myTmp2Row->show();
1533  myTmp3Row->show();
1534  myTmp4Row->show();
1535  myTmp5Row->show();
1536  break;
1537  case SUMO_TAG_CF_SMART_SK:
1538  case SUMO_TAG_CF_DANIEL1:
1539  myTauRow->show();
1540  myAccelRow->show();
1541  myDecelRow->show();
1542  myEmergencyDecelRow->show();
1543  mySigmaRow->show();
1544  myMinGapFactorRow->show();
1545  myTmp1Row->show();
1546  myTmp2Row->show();
1547  myTmp3Row->show();
1548  myTmp4Row->show();
1549  myTmp5Row->show();
1550  break;
1552  myTauRow->show();
1553  myAccelRow->show();
1554  myDecelRow->show();
1555  myEmergencyDecelRow->show();
1556  mySigmaRow->show();
1557  myMinGapFactorRow->show();
1558  myTrauLastRow->show();
1559  myAprobRow->show();
1560  break;
1561  case SUMO_TAG_CF_IDM:
1562  myTauRow->show();
1563  myAccelRow->show();
1564  myDecelRow->show();
1565  myEmergencyDecelRow->show();
1566  myDeltaRow->show();
1567  mySteppingRow->show();
1568  myMinGapFactorRow->show();
1569  break;
1570  case SUMO_TAG_CF_IDMM:
1571  myTauRow->show();
1572  myAccelRow->show();
1573  myDecelRow->show();
1574  myEmergencyDecelRow->show();
1575  myDeltaRow->show();
1576  mySteppingRow->show();
1577  myMinGapFactorRow->show();
1578  myAdaptFactorRow->show();
1579  myAdaptTimeRow->show();
1580  break;
1581  case SUMO_TAG_CF_EIDM:
1582  myTauRow->show();
1583  myAccelRow->show();
1584  myDecelRow->show();
1585  myEmergencyDecelRow->show();
1586  myDeltaRow->show();
1587  mySteppingRow->show();
1588  myMinGapFactorRow->show();
1589  myTpreviewRow->show();
1590  myTreactionRow->show();
1591  myTPersDriveRow->show();
1592  myTPersEstimateRow->show();
1593  myCcoolnessRow->show();
1594  mySigmaleaderRow->show();
1595  mySigmagapRow->show();
1596  mySigmaerrorRow->show();
1597  myJerkmaxRow->show();
1598  myEpsilonaccRow->show();
1599  myTaccmaxRow->show();
1600  myMflatnessRow->show();
1601  myMbeginRow->show();
1602  myUseVehDynamicsRow->show();
1603  myMaxVehPreviewRow->show();
1604  break;
1605  case SUMO_TAG_CF_BKERNER:
1606  myTauRow->show();
1607  myAccelRow->show();
1608  myDecelRow->show();
1609  myEmergencyDecelRow->show();
1610  myKRow->show();
1611  myPhiRow->show();
1612  myMinGapFactorRow->show();
1613  break;
1614  case SUMO_TAG_CF_WIEDEMANN:
1615  myTauRow->show();
1616  myAccelRow->show();
1617  myDecelRow->show();
1618  myEmergencyDecelRow->show();
1619  myMinGapFactorRow->show();
1620  mySecurityRow->show();
1621  myEstimationRow->show();
1622  break;
1623  case SUMO_TAG_CF_W99:
1624  myW99CC1->show();
1625  myW99CC2->show();
1626  myW99CC3->show();
1627  myW99CC4->show();
1628  myW99CC5->show();
1629  myW99CC6->show();
1630  myW99CC7->show();
1631  myW99CC8->show();
1632  myW99CC9->show();
1633  break;
1634  case SUMO_TAG_CF_RAIL:
1635  myTauRow->show();
1636  myTrainTypeRow->show();
1637  break;
1638  case SUMO_TAG_CF_ACC:
1639  myTauRow->show();
1640  myAccelRow->show();
1641  myDecelRow->show();
1642  myEmergencyDecelRow->show();
1643  myMinGapFactorRow->show();
1644  // show myLabelIncompleteAttribute
1645  myLabelIncompleteAttribute->show();
1656  break;
1657  case SUMO_TAG_CF_CACC:
1658  myTauRow->show();
1659  myAccelRow->show();
1660  myDecelRow->show();
1661  myEmergencyDecelRow->show();
1662  myMinGapFactorRow->show();
1663  // show myLabelIncompleteAttribute
1664  myLabelIncompleteAttribute->show();
1681  break;
1682  case SUMO_TAG_CF_CC:
1683  myTauRow->show();
1684  myAccelRow->show();
1685  myDecelRow->show();
1686  // show myLabelIncompleteAttribute
1687  myLabelIncompleteAttribute->show();
1709  break;
1710  default:
1711  break;
1712  }
1713  }
1714  myVerticalFrameRows->recalc();
1715  update();
1716 }
1717 
1718 
1719 void
1721  //set values of myEditedDemandElement into fields
1722  if (myVehicleTypeDialog->myEditedDemandElement->getAttribute(SUMO_ATTR_CAR_FOLLOW_MODEL).empty()) {
1723  myComboBoxCarFollowModel->setCurrentItem(0);
1724  } else {
1725  // set value
1726  const int index = myComboBoxCarFollowModel->findItem(myVehicleTypeDialog->myEditedDemandElement->getAttribute(SUMO_ATTR_CAR_FOLLOW_MODEL).c_str());
1727  if (index == -1) {
1728  myComboBoxCarFollowModel->disable();
1729  } else {
1730  myComboBoxCarFollowModel->setCurrentItem(index);
1731  myComboBoxCarFollowModel->enable();
1732  }
1733  }
1734  // refresh fields
1735  refreshCFMFields();
1736  // update value in all Rows
1737  for (const auto& row : myRows) {
1738  row->updateValue();
1739  }
1740 }
1741 
1742 
1743 long
1745  // At start we assumed, that all values are valid
1746  myVehicleTypeDialog->myVehicleTypeValid = true;
1747  myVehicleTypeDialog->myInvalidAttr = SUMO_ATTR_NOTHING;
1748  // set color of myTextFieldCarFollowModel, depending if current value is valid or not
1749  if (myVehicleTypeDialog->myEditedDemandElement->isValid(SUMO_ATTR_CAR_FOLLOW_MODEL, myComboBoxCarFollowModel->getText().text())) {
1750  myComboBoxCarFollowModel->setTextColor(FXRGB(0, 0, 0));
1751  myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_CAR_FOLLOW_MODEL, myComboBoxCarFollowModel->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
1752  } else {
1753  myComboBoxCarFollowModel->setTextColor(FXRGB(255, 0, 0));
1754  myVehicleTypeDialog->myVehicleTypeValid = false;
1755  myVehicleTypeDialog->myInvalidAttr = SUMO_ATTR_CAR_FOLLOW_MODEL;
1756  }
1757  // set variable in all Rows
1758  for (const auto& row : myRows) {
1759  row->setVariable();
1760  }
1761  // refresh fields
1762  refreshCFMFields();
1763  return true;
1764 }
1765 
1766 // ---------------------------------------------------------------------------
1767 // GNEVehicleTypeDialog - public methods
1768 // ---------------------------------------------------------------------------
1769 
1770 GNEVehicleTypeDialog::GNEVehicleTypeDialog(GNEDemandElement* editedVehicleType, bool updatingElement) :
1771  GNEDemandElementDialog(editedVehicleType, updatingElement, 1372, 575),
1772  myVehicleTypeValid(true),
1774 
1775  // change default header
1776  changeDemandElementDialogHeader(updatingElement ? "Edit " + myEditedDemandElement->getTagStr() : "Create " + myEditedDemandElement->getTagStr());
1777 
1778  // Create auxiliar frames for values
1779  FXHorizontalFrame* columns = new FXHorizontalFrame(myContentFrame, GUIDesignAuxiliarHorizontalFrame);
1780 
1781  // create vehicle type attributes
1782  myVTypeAttributes = new VTypeAttributes(this, columns);
1783 
1784  // create car following model parameters
1786 
1787  // start a undo list for editing local to this additional
1788  initChanges();
1789 
1790  // add element if we aren't updating an existent element
1791  if (!myUpdatingElement) {
1793  }
1794 
1795  // update values of Vehicle Type common attributes
1797 
1798  // update values of Car Following Model Parameters
1800 
1801  // open as modal dialog
1803 }
1804 
1805 
1807 
1808 
1809 long
1810 GNEVehicleTypeDialog::onCmdAccept(FXObject*, FXSelector, void*) {
1811  if (!myVehicleTypeValid) {
1812  // write warning if netedit is running in testing mode
1813  WRITE_DEBUG("Opening FXMessageBox of type 'warning'");
1814  std::string operation1 = myUpdatingElement ? ("updating") : ("creating");
1815  std::string operation2 = myUpdatingElement ? ("updated") : ("created");
1816  std::string tagString = myEditedDemandElement->getTagStr();
1817  // open warning dialogBox
1818  FXMessageBox::warning(getApp(), MBOX_OK,
1819  ("Error " + operation1 + " " + tagString).c_str(), "%s",
1820  (tagString + " cannot be " + operation2 +
1821  " because parameter " + toString(myInvalidAttr) +
1822  " is invalid.").c_str());
1823  // write warning if netedit is running in testing mode
1824  WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'");
1825  return 0;
1826  } else {
1827  // accept changes before closing dialog
1828  acceptChanges();
1829  // stop dialog successfully
1830  getApp()->stopModal(this, TRUE);
1831  return 1;
1832  }
1833 }
1834 
1835 
1836 long
1837 GNEVehicleTypeDialog::onCmdCancel(FXObject*, FXSelector, void*) {
1838  // cancel changes
1839  cancelChanges();
1840  // Stop Modal
1841  getApp()->stopModal(this, FALSE);
1842  return 1;
1843 }
1844 
1845 
1846 long
1847 GNEVehicleTypeDialog::onCmdReset(FXObject*, FXSelector, void*) {
1848  // reset changes
1849  resetChanges();
1850  // update values of Vehicle Type common attributes
1852  // update values of Car Following Model Parameters
1854  return 1;
1855 }
1856 
1857 // ---------------------------------------------------------------------------
1858 // GNEVehicleTypeDialog - private methods
1859 // ---------------------------------------------------------------------------
1860 
1862  FXHorizontalFrame(verticalFrame, GUIDesignAuxiliarHorizontalFrame),
1863  myCarFollowingModelParametersParent(carFollowingModelParametersParent),
1864  myAttr(attr),
1865  myTextField(nullptr) {
1866  new FXLabel(this, toString(attr).c_str(), nullptr, GUIDesignLabelThickedFixed(150));
1867  myTextField = new FXTextField(this, GUIDesignTextFieldNCol, carFollowingModelParametersParent, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldFixed(180));
1868 }
1869 
1870 
1871 void
1873  // set color of textField, depending if current value is valid or not
1874  if (myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myTextField->getText().text())) {
1875  // set color depending if is a default value
1876  if (myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myTextField->getText().text()) {
1877  myTextField->setTextColor(FXRGB(0, 0, 0));
1878  } else {
1879  myTextField->setTextColor(FXRGB(195, 195, 195));
1880  }
1881  myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myTextField->getText().text(),
1882  myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
1883  // update value after setting it
1884  updateValue();
1885  } else {
1886  myTextField->setTextColor(FXRGB(255, 0, 0));
1887  // mark VType as invalid
1888  myCarFollowingModelParametersParent->myVehicleTypeDialog->myVehicleTypeValid = false;
1889  myCarFollowingModelParametersParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
1890  }
1891 }
1892 
1893 
1894 void
1896  // set text of myTextField using current value of VType
1897  myTextField->setText(myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
1898  // set color depending if is a default value
1899  if (myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myTextField->getText().text()) {
1900  myTextField->setTextColor(FXRGB(0, 0, 0));
1901  } else {
1902  myTextField->setTextColor(FXRGB(195, 195, 195));
1903  }
1904 }
1905 
1906 
1907 /****************************************************************************/
FXDEFMAP(GNEVehicleTypeDialog::VTypeAttributes) VTypeAttributesMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:931
@ MID_GNE_OPEN_PARAMETERS_DIALOG
open parameters dialog
Definition: GUIAppEnum.h:975
@ MID_GNE_SET_ATTRIBUTE_DIALOG
attribute edited trough dialog
Definition: GUIAppEnum.h:967
#define GUIDesignTextFieldFixed(width)
text field with fixed width
Definition: GUIDesigns.h:71
#define GUIDesignComboBox
Definition: GUIDesigns.h:299
#define GUIDesignComboBoxWidth180
comboBox with thick frame, width 180
Definition: GUIDesigns.h:311
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:317
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:405
#define GUIDesignLabelTickedIcon180x46
label ticked filled extended over frame used for VClasses/VShapes. (can be used by icons of 64x32 pix...
Definition: GUIDesigns.h:282
#define GUIDesignLabelAboutInfoCenter
label extended over frame with thick and with text justify to center
Definition: GUIDesigns.h:270
#define GUIDesignComboBoxVisibleItemsMedium
combo box medium small
Definition: GUIDesigns.h:53
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:80
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:352
#define GUIDesignAuxiliarVerticalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:411
#define GUIDesignButtonFixed(width)
button rectangular with thick and raise frame with the given width
Definition: GUIDesigns.h:103
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
Definition: GUIDesigns.h:396
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
Definition: GUIDesigns.h:258
FXString gCurrentFolder
The folder used as last.
@ VCLASS_TRAILER
@ VCLASS_PASSENGER
@ VSHAPE_PEDESTRIAN
@ VSHAPE_PASSENGER
@ VCLASS_BICYCLE
@ VCLASS_RAIL_FAST
@ VSHAPE_UNKNOWN
@ VSHAPE_FIREBRIGADE
@ VSHAPE_EMERGENCY
@ VSHAPE_PASSENGER_VAN
@ VSHAPE_PASSENGER_WAGON
@ VSHAPE_MOPED
@ VCLASS_CUSTOM2
@ VSHAPE_RAIL_CAR
@ VCLASS_MOTORCYCLE
@ VCLASS_COACH
@ VCLASS_AUTHORITY
@ VCLASS_TRUCK
@ VCLASS_MOPED
@ VSHAPE_E_VEHICLE
@ VCLASS_PEDESTRIAN
@ VCLASS_PRIVATE
@ VSHAPE_PASSENGER_HATCHBACK
@ VSHAPE_TRUCK_1TRAILER
@ VSHAPE_POLICE
@ VSHAPE_RAIL_CARGO
@ VSHAPE_BICYCLE
@ VSHAPE_AIRCRAFT
@ VCLASS_CUSTOM1
@ VSHAPE_BUS_TROLLEY
@ VSHAPE_DELIVERY
@ VSHAPE_PASSENGER_SEDAN
@ VSHAPE_BUS_FLEXIBLE
@ VCLASS_DELIVERY
@ VSHAPE_RICKSHAW
@ VSHAPE_MOTORCYCLE
@ VCLASS_RAIL_ELECTRIC
@ VCLASS_IGNORING
@ VSHAPE_TRUCK
@ VCLASS_EMERGENCY
@ VSHAPE_BUS_COACH
@ VCLASS_RAIL_URBAN
@ VSHAPE_TRUCK_SEMITRAILER
@ VCLASS_EVEHICLE
@ VSHAPE_SCOOTER
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:306
#define TL(string)
Definition: MsgHandler.h:315
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SUMOVehicleShape::UNKNOWN, false)
@ RICKSHAW
render as a rickshaw
@ BUS
render as a bus
@ RAIL_CARGO
render as a cargo train
@ EMERGENCY
render as an emergency vehicle
@ RAIL
render as a rail
@ PASSENGER_VAN
render as a van
@ PASSENGER
render as a passenger vehicle
@ SCOOTER
render as a scooter
@ RAIL_CAR
render as a (city) rail without locomotive
@ SHIP
render as a arbitrary ship
@ DELIVERY
render as a delivery vehicle
@ BICYCLE
render as a bicycle
@ MOTORCYCLE
render as a motorcycle
@ UNKNOWN
not defined
@ BUS_TROLLEY
render as a trolley bus
@ TAXI
automated car (with cruise controllers)
@ E_VEHICLE
render as a (futuristic) e-vehicle
@ ANT
render as a giant ant
@ TRUCK
render as a transport vehicle
@ AIRCRAFT
render as aircraft
@ FIREBRIGADE
render as a fire brigade
@ PASSENGER_HATCHBACK
render as a hatchback passenger vehicle ("Fliessheck")
@ MOPED
render as a moped
@ BUS_FLEXIBLE
render as a flexible city bus
@ TRUCK_1TRAILER
render as a transport vehicle with one trailer
@ PASSENGER_SEDAN
render as a sedan passenger vehicle ("Stufenheck")
@ BUS_COACH
render as a coach
@ POLICE
render as a police car
@ PASSENGER_WAGON
render as a wagon passenger vehicle ("Combi")
@ TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
@ PEDESTRIAN
render as a pedestrian
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_SHIP
is an arbitrary ship
@ SVC_PRIVATE
private vehicles
@ SVC_VIP
vip vehicles
@ SVC_HOV
vehicle is a HOV
@ SVC_TRUCK
vehicle is a large transport vehicle
@ SVC_CUSTOM2
is a user-defined type
@ SVC_WHEELCHAIR
@ SVC_RAIL
vehicle is a not electrified rail
@ SVC_COACH
vehicle is a coach
@ SVC_CABLE_CAR
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_CONTAINER
@ SVC_SCOOTER
@ SVC_RAIL_FAST
vehicle that is allowed to drive on high-speed rail tracks
@ SVC_TRAILER
vehicle is a large transport vehicle
@ SVC_CUSTOM1
is a user-defined type
@ SVC_ARMY
army vehicles
@ SVC_DRONE
@ SVC_RAIL_ELECTRIC
rail vehicle that requires electrified tracks
@ SVC_DELIVERY
vehicle is a small delivery vehicle
@ SVC_RAIL_URBAN
vehicle is a city rail
@ SVC_MOTORCYCLE
vehicle is a motorcycle
@ SVC_EMERGENCY
public emergency vehicles
@ SVC_MOPED
vehicle is a moped
@ SVC_AUTHORITY
authorities vehicles
@ SVC_TRAM
vehicle is a light rail
@ SVC_TAXI
vehicle is a taxi
@ SVC_BUS
vehicle is a bus
@ SVC_E_VEHICLE
is an electric vehicle
@ SVC_AIRCRAFT
@ SVC_SUBWAY
@ SVC_PEDESTRIAN
pedestrian
@ SUMO_TAG_CF_KRAUSS
@ SUMO_TAG_CF_BKERNER
@ SUMO_TAG_CF_KRAUSSX
@ SUMO_TAG_CF_CACC
@ SUMO_TAG_CF_CC
@ SUMO_TAG_CF_KRAUSS_PLUS_SLOPE
@ SUMO_TAG_CF_IDM
@ SUMO_TAG_CF_W99
@ SUMO_TAG_CF_RAIL
@ SUMO_TAG_CF_SMART_SK
@ SUMO_TAG_CF_EIDM
@ SUMO_TAG_CF_PWAGNER2009
@ SUMO_TAG_CF_KRAUSS_ORIG1
@ SUMO_TAG_CF_WIEDEMANN
@ SUMO_TAG_CF_IDMM
@ SUMO_TAG_CF_DANIEL1
@ SUMO_TAG_CF_ACC
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_TMP4
@ SUMO_ATTR_CF_W99_CC9
@ SUMO_ATTR_CF_EIDM_T_ACC_MAX
@ SUMO_ATTR_CF_EIDM_EPSILON_ACC
@ SUMO_ATTR_CF_W99_CC5
@ SUMO_ATTR_LCA_PUSHY
@ SUMO_ATTR_EMISSIONCLASS
@ SUMO_ATTR_JM_IGNORE_FOE_SPEED
@ SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME
@ SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD
@ SUMO_ATTR_CF_WIEDEMANN_SECURITY
@ SUMO_ATTR_LCA_ASSERTIVE
@ SUMO_ATTR_TRAIN_TYPE
@ SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS
@ SUMO_ATTR_CF_IDMM_ADAPT_TIME
@ SUMO_ATTR_LANE_CHANGE_MODEL
@ SUMO_ATTR_CF_KERNER_PHI
@ SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE
@ SUMO_ATTR_CF_EIDM_C_COOLNESS
@ SUMO_ATTR_CF_EIDM_SIG_ERROR
@ SUMO_ATTR_LCA_PUSHYGAP
@ SUMO_ATTR_LCA_LOOKAHEADLEFT
@ SUMO_ATTR_APPARENTDECEL
@ SUMO_ATTR_MAXSPEED_LAT
@ SUMO_ATTR_LCA_SPEEDGAIN_PARAM
@ SUMO_ATTR_TMP3
@ SUMO_ATTR_ACTIONSTEPLENGTH
@ SUMO_ATTR_LCA_IMPATIENCE
@ SUMO_ATTR_MINGAP
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME
@ SUMO_ATTR_TMP2
@ SUMO_ATTR_CF_W99_CC8
@ SUMO_ATTR_LOADING_DURATION
@ SUMO_ATTR_CF_IDM_DELTA
@ SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW
@ SUMO_ATTR_LCA_MAXSPEEDLATFACTOR
@ SUMO_ATTR_CF_EIDM_T_REACTION
@ SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE
@ SUMO_ATTR_CF_PWAGNER2009_TAULAST
@ SUMO_ATTR_CF_EIDM_SIG_GAP
@ SUMO_ATTR_CAR_FOLLOW_MODEL
@ SUMO_ATTR_CF_EIDM_JERK_MAX
@ SUMO_ATTR_DECEL
@ SUMO_ATTR_LCA_MAXSPEEDLATSTANDING
@ SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME
@ SUMO_ATTR_LCA_KEEPRIGHT_PARAM
@ SUMO_ATTR_GUISHAPE
@ SUMO_ATTR_DESIRED_MAXSPEED
@ SUMO_ATTR_JM_IGNORE_FOE_PROB
@ SUMO_ATTR_CONTAINER_CAPACITY
@ SUMO_ATTR_LCA_COOPERATIVE_PARAM
@ SUMO_ATTR_LCA_OPPOSITE_PARAM
@ SUMO_ATTR_MINGAP_LAT
@ SUMO_ATTR_EMERGENCYDECEL
@ SUMO_ATTR_CF_W99_CC3
@ SUMO_ATTR_LCA_OVERTAKE_DELTASPEED_FACTOR
@ SUMO_ATTR_HEIGHT
@ SUMO_ATTR_LCA_SUBLANE_PARAM
@ SUMO_ATTR_JM_CROSSING_GAP
@ SUMO_ATTR_CARRIAGE_LENGTH
@ SUMO_ATTR_LATALIGNMENT
@ SUMO_ATTR_CF_IDM_STEPPING
@ SUMO_ATTR_CF_IDMM_ADAPT_FACTOR
@ SUMO_ATTR_IMPATIENCE
@ SUMO_ATTR_COLLISION_MINGAP_FACTOR
@ SUMO_ATTR_VCLASS
@ SUMO_ATTR_ACCEL
@ SUMO_ATTR_BOARDING_DURATION
@ SUMO_ATTR_CF_EIDM_M_FLATNESS
@ SUMO_ATTR_CF_W99_CC2
@ SUMO_ATTR_CF_W99_CC4
@ SUMO_ATTR_JM_SIGMA_MINOR
@ SUMO_ATTR_CF_W99_CC6
@ SUMO_ATTR_PROB
@ SUMO_ATTR_CF_EIDM_M_BEGIN
@ SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE
@ SUMO_ATTR_SPEEDFACTOR
@ SUMO_ATTR_CF_EIDM_SIG_LEADER
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_CF_PWAGNER2009_APPROB
@ SUMO_ATTR_MAXSPEED
@ SUMO_ATTR_ID
@ SUMO_ATTR_SIGMA
@ SUMO_ATTR_K
@ SUMO_ATTR_TMP1
@ SUMO_ATTR_OSGFILE
@ SUMO_ATTR_LCA_OVERTAKE_RIGHT
@ SUMO_ATTR_LCA_ACCEL_LAT
@ SUMO_ATTR_CF_W99_CC7
@ SUMO_ATTR_LCA_STRATEGIC_PARAM
@ SUMO_ATTR_CF_W99_CC1
@ SUMO_ATTR_TAU
@ SUMO_ATTR_IMGFILE
@ SUMO_ATTR_WIDTH
@ SUMO_ATTR_PERSON_CAPACITY
@ SUMO_ATTR_LCA_KEEPRIGHT_ACCEPTANCE_TIME
@ SUMO_ATTR_LOCOMOTIVE_LENGTH
@ SUMO_ATTR_TMP5
@ SUMO_ATTR_NOTHING
invalid attribute, must be the last one
@ SUMO_ATTR_JM_DRIVE_RED_SPEED
@ SUMO_ATTR_LCA_TIME_TO_IMPATIENCE
@ SUMO_ATTR_JM_TIMEGAP_MINOR
@ SUMO_ATTR_CARRIAGE_GAP
@ SUMO_ATTR_CF_WIEDEMANN_ESTIMATION
@ SUMO_ATTR_LCA_SPEEDGAINRIGHT
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
std::vector< double > & getParameter()
Returns the parameters of this distribution.
virtual bool isAttributeEnabled(SumoXMLAttr key) const
const std::string & getTagStr() const
get tag assigned to this object in string format
GNENet * getNet() const
get pointer to net
Dialog to edit sequences, parameters, etc.. of DemandElements.
void acceptChanges()
Accept changes did in this dialog.
GNEDemandElement * myEditedDemandElement
pointer to edited additional
FXVerticalFrame * myContentFrame
frame for contents
bool myUpdatingElement
flag to indicate if additional are being created or modified (cannot be changed after open dialog)
FXint openAsModalDialog(FXuint placement=PLACEMENT_CURSOR)
execute dialog as modal
void initChanges()
init a new group of changes that will be do it in dialog
void cancelChanges()
Cancel changes did in this dialog.
void changeDemandElementDialogHeader(const std::string &newHeader)
change additional dialog header
void resetChanges()
reset changes did in this dialog.
virtual SUMOVehicleClass getVClass() const =0
obtain VClass related with this demand element
virtual std::string getAttribute(SumoXMLAttr key) const =0
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform demand element changes
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
method for checking if the key and their conrrespond attribute are valids
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2055
Dialog for edit parameters.
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
class used for represent rows with Car Following Model parameters
CarFollowingModelRow(CarFollowingModelParameters *carFollowingModelParametersParent, FXVerticalFrame *verticalFrame, SumoXMLAttr attr)
constructor
CarFollowingModelRow * myPhiRow
Row for MinGap (only for Kerner)
CarFollowingModelRow * myW99CC1
Row for W99 CC 01.
CarFollowingModelRow * myTpreviewRow
Row for Look ahead/preview Time.
CarFollowingModelRow * myW99CC8
Row for W99 CC 08.
CarFollowingModelRow * myW99CC6
Row for W99 CC 06.
CarFollowingModelRow * mySteppingRow
Row for MinGap(only for IDM)
CarFollowingModelRow * myMflatnessRow
Row for Startup M flatness.
CarFollowingModelRow * myW99CC3
Row for W99 CC 03.
CarFollowingModelRow * myW99CC2
Row for W99 CC 02.
CarFollowingModelRow * myTreactionRow
Row for Reaction Time.
FXLabel * myLabelIncompleteAttribute
temporal label for incomplete attributes
CarFollowingModelRow * myCcoolnessRow
Row for Coolness parameter.
CarFollowingModelRow * mySigmagapRow
Row for Gap estimation error.
CarFollowingModelRow * mySecurityRow
Row for Security (only for Wiedemann)
CarFollowingModelRow * myW99CC7
Row for W99 CC 07.
CarFollowingModelRow * myW99CC5
Row for W99 CC 05.
CarFollowingModelRow * myAccelRow
Row for Accel.
CarFollowingModelRow * myEpsilonaccRow
Row for AP Driver Update threshold.
CarFollowingModelRow * myAprobRow
Row for Aprob.
CarFollowingModelRow * myW99CC9
Row for W99 CC 09.
CarFollowingModelRow * myKRow
Row for MinGap (only for Kerner)
CarFollowingModelRow * myTPersDriveRow
Row for Wiener Process Driving Error.
long onCmdSetVariable(FXObject *, FXSelector, void *)
CarFollowingModelRow * myMaxVehPreviewRow
Row for Using vehicle preview.
CarFollowingModelRow * myAdaptFactorRow
Row for Adapt Factor.
CarFollowingModelRow * myTPersEstimateRow
Row for Wiener Process Estimation Error.
MFXComboBoxIcon * myComboBoxCarFollowModel
Row for CarFollowModel.
CarFollowingModelRow * myJerkmaxRow
Row for max jerk.
FXVerticalFrame * myVerticalFrameRows
Vertical Frame for CarFollowingModelRow.
CarFollowingModelRow * myTaccmaxRow
Row for Startup Time to acc_max.
CarFollowingModelRow * myApparentDecelRow
Row for apparent Decel.
CarFollowingModelRow * myDecelRow
Row for Decel.
CarFollowingModelRow * myW99CC4
Row for W99 CC 04.
std::vector< CarFollowingModelRow * > myRows
vector with the Car Following Model Row
CarFollowingModelRow * myEmergencyDecelRow
Row for emergency Decel.
CarFollowingModelRow * mySigmaleaderRow
Row for leader speed estimation error.
CarFollowingModelRow * myTrainTypeRow
Row for TrainType.
void refreshCFMFields()
refresh Car Following Model Fields
CarFollowingModelRow * myEstimationRow
Row for Estimation (only for Wiedemann)
CarFollowingModelRow * mySigmaRow
Row for Sigma.
CarFollowingModelRow * myMbeginRow
Row for Startup M begin.
CarFollowingModelRow * mySigmaerrorRow
Row for Driving Error.
CarFollowingModelRow * myAdaptTimeRow
Row for Adapt Time.
CarFollowingModelRow * myDeltaRow
Row for MinGap (only for IDM)
CarFollowingModelRow * myTrauLastRow
Row for TauLast.
CarFollowingModelRow * myUseVehDynamicsRow
Row for Using vehicle dynamics.
CarFollowingModelParameters(GNEVehicleTypeDialog *vehicleTypeDialog, FXHorizontalFrame *column)
FOX-declaration.
CarFollowingModelRow * myMinGapFactorRow
Row for MinGapFactor.
SUMOVehicleClass setVariable()
set vehicle class
VTypeAttributes * myVTypeAttributesParent
pointer to VTypeAttributes parent
MFXComboBoxIcon * myComboBoxVClass
MFXComboBoxIcon for VClass.
MFXComboBoxIcon * myComboBoxShape
MFXComboBoxIcon for Shape.
FXLabel * myComboBoxShapeLabelImage
label with image of Shape
VShapeRow(VTypeAttributes *VTypeAttributesParent, FXVerticalFrame *column)
constructor
void updateValue(SUMOVehicleClass vClass)
update value
class used for represent rows with Vehicle Type parameters
VTypeAttributeRow(VTypeAttributes *VTypeAttributesParent, FXVerticalFrame *verticalFrame, const SumoXMLAttr attr, const RowAttrType rowAttrType, const std::vector< std::string > &values={})
constructor
MFXComboBoxIcon * myComboBox
ComboBox for attributes with limited values.
std::string getParametersStr() const
get parameters as string
void updateValue()
update value of Vehicle Type (using default value obtained from GNEAttributeCarrier)
void setVariable()
set Variable in VehicleType (using default value obtained from GNEAttributeCarrier)
std::vector< std::pair< std::string, std::string > > getParametersVectorStr() const
get parameters as vector of strings
void setParameters(const std::vector< std::pair< std::string, std::string > > &parameters)
set parameters
std::string filterAttributeName(const SumoXMLAttr attr) const
filter attribute name
GNEVehicleTypeDialog * myVehicleTypeDialog
VTypeAttributeRow for experimental.
VTypeAttributeRow * myHeight
VTypeAttributeRow for Height.
VTypeAttributeRow * myContainerCapacity
VTypeAttributeRow for ContainerCapacity.
VTypeAttributeRow * myMaxSpeed
VTypeAttributeRow for MaxSpeed.
void buildAttributesA(FXVerticalFrame *column)
build common attributes (A)
VTypeAttributeRow * myMinGap
VTypeAttributeRow for MinGap.
VTypeAttributeRow * myOSGFile
VTypeAttributeRow for OSG.
VTypeAttributeRow * myParameters
VTypeAttributeRow for parameters.
void buildJunctionModelAttributesA(FXVerticalFrame *column)
build JunctionModel attributes (A)
VTypeAttributeRow * myEmissionClass
VTypeAttributeRow for EmissionClass.
VTypeAttributeRow * myCarriageLength
VTypeAttributeRow for carriage length.
VTypeAttributeRow * mySpeedFactor
VTypeAttributeRow for SpeedFactor.
long onCmdOpenAttributeDialog(FXObject *obj, FXSelector, void *)
@event called after press a button dialog
void buildJunctionModelAttributesB(FXVerticalFrame *column)
build JunctionModel attributes (B)
void buildAttributesB(FXVerticalFrame *column)
build common attributes (B)
VTypeAttributeRow * myLocomotiveLength
VTypeAttributeRow for locomotive length.
long onCmdSetAttribute(FXObject *, FXSelector, void *)
VShapeRow * myVShapeRow
vehicle shape row
VTypeAttributeRow * myWidth
VTypeAttributeRow for Width.
VTypeAttributeRow * myPersonCapacity
VTypeAttributeRow for PersonCapacity.
void buildLaneChangeModelAttributes(FXVerticalFrame *column)
build LaneChangeModel attributes
VTypeAttributeRow * myDesiredMaxSpeed
VTypeAttributeRow for desired max speed.
long onCmdOpenParametersEditor(FXObject *obj, FXSelector, void *)
@event called after press a button dialog
VTypeAttributes(GNEVehicleTypeDialog *vehicleTypeDialog, FXHorizontalFrame *column)
constructor
VTypeAttributeRow * myLength
VTypeAttributeRow for Length.
Dialog for editing calibrator vehicle types.
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
SumoXMLAttr myInvalidAttr
current sumo attribute invalid
bool myVehicleTypeValid
flag to check if current vehicleType is valid
VTypeAttributes * myVTypeAttributes
Vehicle Type Common Attributes.
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
CarFollowingModelParameters * myCarFollowingModelParameters
Car Following model parameters.
GNEVehicleTypeDialog(GNEDemandElement *editedVehicleType, bool updatingElement)
constructor
long onCmdAccept(FXObject *, FXSelector, void *)
GNEUndoList * getUndoList() const
get the undoList object
static FXLabel * buildFXLabel(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXuint opts, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
Construct label with given text and icon.
Definition: GUIDesigns.cpp:118
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
Definition: GUIDesigns.cpp:128
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
ComboBox with icon.
FXString getText() const
Get the text.
void setTextColor(FXColor clr)
Change text color.
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon item in the last position
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:112
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:106
static const std::vector< std::string > & getAllClassesStr()
Get all SUMOEmissionClass in string format.
static const RGBColor BLACK
Definition: RGBColor.h:193
static std::vector< std::string > getLatAlignmentStrings()
return all valid strings for latAlignment
static StringBijection< SumoXMLTag > CarFollowModels
car following models
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
std::vector< std::string > getStrings() const
std::vector< std::string > getVector()
return vector of strings
bool hasNext()
returns the information whether further substrings exist
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
static FXIcon * getVClassIcon(const SUMOVehicleClass vc)
returns icon associated to the given vClass
Definition: VClassIcons.cpp:35
auto get(const nlohmann::detail::iteration_proxy_value< IteratorType > &i) -> decltype(i.key())
Definition: json.hpp:4451
struct for default values that depend of VClass
int personCapacity
The person capacity of the vehicle.
double carriageLength
the length of train carriages
double desiredMaxSpeed
The vehicle type's desired maximum speed [m/s].
std::string osgFile
3D model file for this class
SUMOEmissionClass emissionClass
The emission class of this vehicle.
double minGap
This class' free space in front of the vehicle itself.
int containerCapacity
The container capacity of the vehicle.
double maxSpeed
The vehicle type's maximum speed [m/s] (technical limit, not subject to speed deviation)
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
double length
The physical vehicle length.
SUMOVehicleShape shape
This class' shape.
LatAlignmentDefinition latAlignmentProcedure
the lateral alignment procedure
double locomotiveLength
the length of train locomotive