Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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-2026 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
26#include <netedit/GNENet.h>
28#include <netedit/GNEUndoList.h>
34
36
37// ===========================================================================
38// FOX callback mapping
39// ===========================================================================
40
46
50
51// Object implementation
52FXIMPLEMENT(GNEVehicleTypeDialog::VTypeAttributes, FXVerticalFrame, VTypeAttributesMap, ARRAYNUMBER(VTypeAttributesMap))
53FXIMPLEMENT(GNEVehicleTypeDialog::CarFollowingModelParameters, FXGroupBox, CarFollowingModelParametersMap, ARRAYNUMBER(CarFollowingModelParametersMap))
54
55// ===========================================================================
56// member method definitions
57// ===========================================================================
58
59// ---------------------------------------------------------------------------
60// GNEVehicleTypeDialog::VClassRow - methods
61// ---------------------------------------------------------------------------
62
63GNEVehicleTypeDialog::VTypeAttributes::VClassRow::VClassRow(VTypeAttributes* VTypeAttributesParent, FXVerticalFrame* column) :
64 FXHorizontalFrame(column, GUIDesignAuxiliarHorizontalFrame),
65 myVTypeAttributesParent(VTypeAttributesParent) {
66 // create two auxiliary frames
67 FXVerticalFrame* verticalFrameLabelAndComboBox = new FXVerticalFrame(this, GUIDesignAuxiliarVerticalFrame);
68 // create MFXComboBoxIcon for VClass
69 new FXLabel(verticalFrameLabelAndComboBox, toString(SUMO_ATTR_VCLASS).c_str(), nullptr, GUIDesignLabelThickedFixed(150));
70 myComboBoxVClass = new MFXComboBoxIcon(verticalFrameLabelAndComboBox, myVTypeAttributesParent->myVehicleTypeDialog->getApplicationWindow()->getStaticTooltipMenu(),
72 myComboBoxVClassLabelImage = new FXLabel(this, "", nullptr, GUIDesignLabelTickedIcon180x46);
73 myComboBoxVClassLabelImage->setBackColor(FXRGBA(255, 255, 255, 255));
74 // fill combo Box with all allowed VClass for the current edited VType
75 for (const auto& vClass : myVTypeAttributesParent->myVehicleTypeDialog->getElement()->getTagProperty()->getAttributeProperties(SUMO_ATTR_VCLASS)->getDiscreteValues()) {
76 myComboBoxVClass->appendIconItem(vClass.c_str(), VClassIcons::getVClassIcon(SumoVehicleClassStrings.get(vClass)));
77 }
78}
79
80
83 // set color of myComboBoxVClass, depending if current value is valid or not
85 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->isValid(SUMO_ATTR_VCLASS, myComboBoxVClass->getText().text())) {
87 // check if VType has to be updated
88 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->getAttribute(SUMO_ATTR_VCLASS) != myComboBoxVClass->getText().text()) {
89 // update VClass in VType
90 myVTypeAttributesParent->myVehicleTypeDialog->myElement->setAttribute(SUMO_ATTR_VCLASS, myComboBoxVClass->getText().text(),
91 myVTypeAttributesParent->myVehicleTypeDialog->myElement->getNet()->getUndoList());
92 // update label image
94 // obtain default vType parameters
95 SUMOVTypeParameter::VClassDefaultValues defaultVTypeParameters(myVTypeAttributesParent->myVehicleTypeDialog->myElement->getVClass());
96 // check if mutable rows need to be updated
97 if (!myVTypeAttributesParent->myVehicleTypeDialog->myElement->isAttributeEnabled(SUMO_ATTR_LENGTH)) {
98 myVTypeAttributesParent->myLength->updateValue(toString(defaultVTypeParameters.length));
99 }
100 if (!myVTypeAttributesParent->myVehicleTypeDialog->myElement->isAttributeEnabled(SUMO_ATTR_MINGAP)) {
101 myVTypeAttributesParent->myMinGap->updateValue(toString(defaultVTypeParameters.minGap));
102 }
103 if (!myVTypeAttributesParent->myVehicleTypeDialog->myElement->isAttributeEnabled(SUMO_ATTR_MAXSPEED)) {
104 myVTypeAttributesParent->myMaxSpeed->updateValue(toString(defaultVTypeParameters.maxSpeed));
105 }
106 if (!myVTypeAttributesParent->myVehicleTypeDialog->myElement->isAttributeEnabled(SUMO_ATTR_DESIRED_MAXSPEED)) {
107 myVTypeAttributesParent->myDesiredMaxSpeed->updateValue(toString(defaultVTypeParameters.desiredMaxSpeed));
108 }
109 if (!myVTypeAttributesParent->myVehicleTypeDialog->myElement->isAttributeEnabled(SUMO_ATTR_SPEEDFACTOR)) {
110 myVTypeAttributesParent->mySpeedFactor->updateValue(toString(defaultVTypeParameters.speedFactor.getParameter(0)));
111 }
112 if (!myVTypeAttributesParent->myVehicleTypeDialog->myElement->isAttributeEnabled(SUMO_ATTR_EMISSIONCLASS)) {
113 myVTypeAttributesParent->myEmissionClass->updateValue(toString(defaultVTypeParameters.emissionClass));
114 }
115 if (!myVTypeAttributesParent->myVehicleTypeDialog->myElement->isAttributeEnabled(SUMO_ATTR_WIDTH)) {
116 myVTypeAttributesParent->myWidth->updateValue(toString(defaultVTypeParameters.width));
117 }
118 if (!myVTypeAttributesParent->myVehicleTypeDialog->myElement->isAttributeEnabled(SUMO_ATTR_HEIGHT)) {
119 myVTypeAttributesParent->myHeight->updateValue(toString(defaultVTypeParameters.height));
120 }
121 if (!myVTypeAttributesParent->myVehicleTypeDialog->myElement->isAttributeEnabled(SUMO_ATTR_OSGFILE)) {
122 myVTypeAttributesParent->myOSGFile->updateValue(toString(defaultVTypeParameters.osgFile));
123 }
124 if (!myVTypeAttributesParent->myVehicleTypeDialog->myElement->isAttributeEnabled(SUMO_ATTR_PERSON_CAPACITY)) {
125 myVTypeAttributesParent->myPersonCapacity->updateValue(toString(defaultVTypeParameters.personCapacity));
126 }
127 if (!myVTypeAttributesParent->myVehicleTypeDialog->myElement->isAttributeEnabled(SUMO_ATTR_CONTAINER_CAPACITY)) {
128 myVTypeAttributesParent->myContainerCapacity->updateValue(toString(defaultVTypeParameters.containerCapacity));
129 }
130 /*
131 Waiting for #16343
132 if (!myVTypeAttributesParent->myVehicleTypeDialog->myElement->isAttributeEnabled(SUMO_ATTR_CARRIAGE_LENGTH)) {
133 myVTypeAttributesParent->myCarriageLength->updateValue(toString(defaultVTypeParameters.containerCapacity));
134 }
135 if (!myVTypeAttributesParent->myVehicleTypeDialog->myElement->isAttributeEnabled(SUMO_ATTR_LOCOMOTIVE_LENGTH)) {
136 myVTypeAttributesParent->myLocomotiveLength->updateValue(toString(defaultVTypeParameters.locomotiveLength));
137 }
138 // update GUIShape
139 if (SumoVehicleClassStrings.hasString(myComboBoxVClass->getText().text())) {
140 myVTypeAttributesParent->myVShapeRow->updateValue(SumoVehicleClassStrings.get(myComboBoxVClass->getText().text()));
141 }
142 */
143 }
144 } else {
146 myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid = false;
147 myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = SUMO_ATTR_VCLASS;
148 }
149 return myVTypeAttributesParent->myVehicleTypeDialog->myElement->getVClass();
150}
151
152
155 const auto vClass = myVTypeAttributesParent->myVehicleTypeDialog->myElement->getAttribute(SUMO_ATTR_VCLASS);
156 int index = 0;
157 for (int i = 0; i < myComboBoxVClass->getNumItems(); i++) {
158 if (myComboBoxVClass->getItemText(i) == vClass) {
159 index = i;
160 }
161 }
162 myComboBoxVClass->setCurrentItem(index);
164 return myVTypeAttributesParent->myVehicleTypeDialog->myElement->getVClass();
165}
166
167
168void
170 // by default vClass is passenger
171 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->getAttribute(SUMO_ATTR_VCLASS).empty()) {
173 } else {
174 // set Icon in label depending of current VClass
175 switch (myVTypeAttributesParent->myVehicleTypeDialog->myElement->getVClass()) {
176 case SVC_PRIVATE:
178 break;
179 case SVC_EMERGENCY:
181 break;
182 case SVC_AUTHORITY:
184 break;
185 case SVC_ARMY:
187 break;
188 case SVC_VIP:
190 break;
191 case SVC_PASSENGER:
193 break;
194 case SVC_HOV:
196 break;
197 case SVC_TAXI:
199 break;
200 case SVC_BUS:
202 break;
203 case SVC_COACH:
205 break;
206 case SVC_DELIVERY:
208 break;
209 case SVC_TRUCK:
211 break;
212 case SVC_TRAILER:
214 break;
215 case SVC_TRAM:
217 break;
218 case SVC_RAIL_URBAN:
220 break;
221 case SVC_RAIL:
223 break;
226 break;
227 case SVC_RAIL_FAST:
229 break;
230 case SVC_MOTORCYCLE:
232 break;
233 case SVC_MOPED:
235 break;
236 case SVC_BICYCLE:
238 break;
239 case SVC_PEDESTRIAN:
241 break;
242 case SVC_E_VEHICLE:
244 break;
245 case SVC_SHIP:
247 break;
248 case SVC_CONTAINER:
250 break;
251 case SVC_CABLE_CAR:
253 break;
254 case SVC_SUBWAY:
256 break;
257 case SVC_AIRCRAFT:
259 break;
260 case SVC_WHEELCHAIR:
262 break;
263 case SVC_SCOOTER:
265 break;
266 case SVC_DRONE:
268 break;
269 case SVC_CUSTOM1:
271 break;
272 case SVC_CUSTOM2:
274 break;
275 default:
277 break;
278 }
279 }
280}
281
282// ---------------------------------------------------------------------------
283// GNEVehicleTypeDialog::VShapeRow - methods
284// ---------------------------------------------------------------------------
285
286GNEVehicleTypeDialog::VTypeAttributes::VShapeRow::VShapeRow(VTypeAttributes* VTypeAttributesParent, FXVerticalFrame* column) :
287 FXHorizontalFrame(column, GUIDesignAuxiliarHorizontalFrame),
288 myVTypeAttributesParent(VTypeAttributesParent) {
289 // create two auxiliar frames
290 FXVerticalFrame* verticalFrameLabelAndComboBox = new FXVerticalFrame(this, GUIDesignAuxiliarVerticalFrame);
291 // create combo for vehicle shapes
292 new FXLabel(verticalFrameLabelAndComboBox, toString(SUMO_ATTR_GUISHAPE).c_str(), nullptr, GUIDesignLabelThickedFixed(150));
293 myComboBoxShape = new MFXComboBoxIcon(verticalFrameLabelAndComboBox, myVTypeAttributesParent->myVehicleTypeDialog->getApplicationWindow()->getStaticTooltipMenu(),
295 myComboBoxShapeLabelImage = new FXLabel(this, "", nullptr, GUIDesignLabelTickedIcon180x46);
296 myComboBoxShapeLabelImage->setBackColor(FXRGBA(255, 255, 255, 255));
297 // fill combo Box with all vehicle shapes
298 std::vector<std::string> VShapeStrings = SumoVehicleShapeStrings.getStrings();
299 myComboBoxShape->appendIconItem("default", nullptr);
300 for (const auto& VShapeString : VShapeStrings) {
301 if (VShapeString != SumoVehicleShapeStrings.getString(SUMOVehicleShape::UNKNOWN)) {
302 myComboBoxShape->appendIconItem(VShapeString.c_str(), nullptr);
303 }
304 }
305}
306
307
308void
310 // set color of myComboBoxShape, depending if current value is valid or not
311 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->isValid(SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text())) {
313 myVTypeAttributesParent->myVehicleTypeDialog->myElement->setAttribute(SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text(),
314 myVTypeAttributesParent->myVehicleTypeDialog->myElement->getNet()->getUndoList());
316 } else {
318 myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid = false;
319 myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = SUMO_ATTR_GUISHAPE;
320 }
321}
322
323
324void
326 // set value
327 const int index = myComboBoxShape->findItem(myVTypeAttributesParent->myVehicleTypeDialog->myElement->getAttribute(SUMO_ATTR_GUISHAPE).c_str());
328 if (index == -1) {
329 myComboBoxShape->setCurrentItem(0);
330 } else {
331 myComboBoxShape->setCurrentItem(index);
332 }
334}
335
336
337void
339 // create new VClassDefaultValues using the new VClass
341 // set value
342 const int index = myComboBoxShape->findItem(SumoVehicleShapeStrings.getString(newVClass.shape).c_str());
343 if (index == -1) {
344 myComboBoxShape->setCurrentItem(0);
345 } else {
346 myComboBoxShape->setCurrentItem(index);
347 }
349 myVTypeAttributesParent->myVehicleTypeDialog->myElement->setAttribute(SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text(),
350 myVTypeAttributesParent->myVehicleTypeDialog->myElement->getNet()->getUndoList());
352}
353
354
355void
357 // set Icon in label depending of current VClass
358 switch (getVehicleShapeID(myVTypeAttributesParent->myVehicleTypeDialog->myElement->getAttribute(SUMO_ATTR_GUISHAPE))) {
361 break;
364 break;
367 break;
370 break;
373 break;
376 break;
379 break;
382 break;
385 break;
388 break;
391 break;
394 break;
397 break;
400 break;
403 break;
406 break;
409 break;
412 break;
415 break;
418 break;
421 break;
424 break;
427 break;
430 break;
433 break;
436 break;
439 break;
442 break;
445 break;
448 break;
451 break;
452 default:
454 break;
455 }
456}
457
458// ---------------------------------------------------------------------------
459// GNEVehicleTypeDialog::VTypeAttributes - methods
460// ---------------------------------------------------------------------------
461
462GNEVehicleTypeDialog::VTypeAttributes::VTypeAttributeRow::VTypeAttributeRow(VTypeAttributes* VTypeAttributesParent, FXVerticalFrame* verticalFrame, const SumoXMLAttr attr, const RowAttrType rowAttrType, const std::vector<std::string>& values) :
463 FXHorizontalFrame(verticalFrame, GUIDesignAuxiliarHorizontalFrame),
464 myVTypeAttributesParent(VTypeAttributesParent),
465 myAttr(attr),
466 myRowAttrType(rowAttrType),
467 myButton(nullptr),
468 myTextField(nullptr),
469 myComboBox(nullptr) {
470 // first check if we have to create a button or a label
471 if ((rowAttrType == ROWTYPE_COLOR) || (rowAttrType == ROWTYPE_FILENAME)) {
472 myButton = GUIDesigns::buildFXButton(this, filterAttributeName(attr), "", "", nullptr, VTypeAttributesParent, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonFixed(150));
473 if (rowAttrType == ROWTYPE_COLOR) {
475 }
476 } else if (rowAttrType == ROWTYPE_PARAMETERS) {
477 myButton = GUIDesigns::buildFXButton(this, TL("Edit parameters"), "", "", nullptr, VTypeAttributesParent, MID_GNE_ATTRIBUTESEDITOR_PARAMETERS, GUIDesignButtonFixed(150));
478 } else {
480 }
481 // now check if we have to create a textfield or a ComboBox
482 if ((rowAttrType == ROWTYPE_STRING) || (rowAttrType == ROWTYPE_COLOR) || (rowAttrType == ROWTYPE_FILENAME) || (rowAttrType == ROWTYPE_PARAMETERS)) {
483 myTextField = new FXTextField(this, GUIDesignTextFieldNCol, VTypeAttributesParent, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldFixed(180));
484 } else if (rowAttrType == ROWTYPE_COMBOBOX) {
485 myComboBox = new MFXComboBoxIcon(this, myVTypeAttributesParent->myVehicleTypeDialog->getApplicationWindow()->getStaticTooltipMenu(),
487 // fill combo Box with values
488 for (const auto& value : values) {
489 myComboBox->appendIconItem(value.c_str(), nullptr);
490 }
491 } else {
492 throw ProcessError(TL("Invalid row type"));
493 }
494}
495
496
497void
500 // set color of myComboBox, depending if current value is valid or not
501 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->isValid(myAttr, myComboBox->getText().text())) {
502 myVTypeAttributesParent->myVehicleTypeDialog->myElement->setAttribute(myAttr, myComboBox->getText().text(),
503 myVTypeAttributesParent->myVehicleTypeDialog->myElement->getNet()->getUndoList());
504 // update value after setting it
505 updateValue();
506 } else {
507 myComboBox->setTextColor(GUIDesignTextColorRed);
508 // mark VType as invalid
509 myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid = false;
510 myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
511 }
512 } else if (myRowAttrType == ROWTYPE_COLOR) {
513 // set color of myTextFieldColor, depending if current value is valid or not
514 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->isValid(SUMO_ATTR_COLOR, myTextField->getText().text())) {
515 // set color depending if is a default value
516 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->getTagProperty()->getDefaultStringValue(SUMO_ATTR_COLOR) != myTextField->getText().text()) {
518 } else {
519 myTextField->setTextColor(FXRGB(195, 195, 195));
520 }
521 myVTypeAttributesParent->myVehicleTypeDialog->myElement->setAttribute(SUMO_ATTR_COLOR, myTextField->getText().text(), myVTypeAttributesParent->myVehicleTypeDialog->myElement->getNet()->getUndoList());
522 } else {
523 myTextField->setTextColor(GUIDesignTextColorRed);
524 myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid = false;
525 myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = SUMO_ATTR_COLOR;
526 }
527 } else {
528 // set color of textField, depending if current value is valid or not
529 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->isValid(myAttr, myTextField->getText().text())) {
530 myVTypeAttributesParent->myVehicleTypeDialog->myElement->setAttribute(myAttr, myTextField->getText().text(),
531 myVTypeAttributesParent->myVehicleTypeDialog->myElement->getNet()->getUndoList());
532 // update value after setting it
533 updateValue();
534 } else {
535 myTextField->setTextColor(GUIDesignTextColorRed);
536 // mark VType as invalid
537 myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid = false;
538 myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
539 }
540 }
541}
542
543
544void
546 if (myComboBox) {
547 // set color of myComboBox, depending if current value is valid or not
548 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->isValid(myAttr, myComboBox->getText().text())) {
549 myVTypeAttributesParent->myVehicleTypeDialog->myElement->setAttribute(myAttr, myComboBox->getText().text(),
550 myVTypeAttributesParent->myVehicleTypeDialog->myElement->getNet()->getUndoList());
551 // update value after setting it
552 updateValue(defaultValue);
553 } else {
554 myComboBox->setTextColor(GUIDesignTextColorRed);
555 // mark VType as invalid
556 myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid = false;
557 myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
558 }
559 } else {
560 // set color of textField, depending if current value is valid or not
561 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->isValid(myAttr, myTextField->getText().text())) {
562 myVTypeAttributesParent->myVehicleTypeDialog->myElement->setAttribute(myAttr, myTextField->getText().text(),
563 myVTypeAttributesParent->myVehicleTypeDialog->myElement->getNet()->getUndoList());
564 // update value after setting it
565 updateValue(defaultValue);
566 } else {
567 myTextField->setTextColor(GUIDesignTextColorRed);
568 // mark VType as invalid
569 myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid = false;
570 myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
571 }
572 }
573}
574
575
576void
579 // set value
580 const int index = myComboBox->findItem(myVTypeAttributesParent->myVehicleTypeDialog->myElement->getAttribute(myAttr).c_str());
581 if (index == -1) {
582 myComboBox->disable();
583 } else {
584 myComboBox->setCurrentItem(index);
585 myComboBox->enable();
586 }
587 // set color depending if is a default value
588 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->getTagProperty()->getDefaultStringValue(myAttr) != myComboBox->getText().text()) {
589 myComboBox->setTextColor(GUIDesignTextColorBlack);
590 } else {
591 myComboBox->setTextColor(FXRGB(195, 195, 195));
592 }
593 } else if (myRowAttrType == ROWTYPE_COLOR) {
594 // set field color
595 myTextField->setText(myVTypeAttributesParent->myVehicleTypeDialog->myElement->getAttribute(myAttr).c_str());
596 // set color depending if is a default value
597 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->getTagProperty()->getDefaultStringValue(myAttr) != myTextField->getText().text()) {
599 } else {
600 myTextField->setTextColor(FXRGB(195, 195, 195));
601 }
602 } else if (myAttr == GNE_ATTR_PARAMETERS) {
603 // get parameters
604 const std::string& parametersStr = myVTypeAttributesParent->myVehicleTypeDialog->myElement->getAttribute(myAttr);
605 // set text of myTextField using current value of VType
606 myTextField->setText(parametersStr.c_str());
607 // set text color
609 // clear parameters
610 myParameters.clear();
611 // separate value in a vector of string using | as separator
612 StringTokenizer parameters(parametersStr, "|", true);
613 // iterate over all values
614 while (parameters.hasNext()) {
615 // obtain key and value and save it in myParameters
616 const std::vector<std::string> keyValue = StringTokenizer(parameters.next(), "=", true).getVector();
617 if (keyValue.size() == 2) {
618 myParameters[keyValue.front()] = keyValue.back();
619 }
620 }
621 } else {
622 // set text of myTextField using current value of VType
623 myTextField->setText(myVTypeAttributesParent->myVehicleTypeDialog->myElement->getAttribute(myAttr).c_str());
624 // set color depending if is a default value
625 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->getTagProperty()->getDefaultStringValue(myAttr) != myTextField->getText().text()) {
627 } else {
628 myTextField->setTextColor(FXRGB(195, 195, 195));
629 }
630 }
631}
632
633
634void
636 if (myComboBox) {
637 // set value
638 const int index = myComboBox->findItem(myVTypeAttributesParent->myVehicleTypeDialog->myElement->getAttribute(myAttr).c_str());
639 if (index == -1) {
640 myComboBox->disable();
641 } else {
642 myComboBox->setCurrentItem(index);
643 myComboBox->enable();
644 }
645 // set color depending if is a default value
646 if (defaultValue != myComboBox->getText().text()) {
647 myComboBox->setTextColor(GUIDesignTextColorBlack);
648 } else {
649 myComboBox->setTextColor(FXRGB(195, 195, 195));
650 }
651 } else {
652 // set text of myTextField using current value of VType
653 myTextField->setText(myVTypeAttributesParent->myVehicleTypeDialog->myElement->getAttribute(myAttr).c_str());
654 // set color depending if is a default value
655 if (defaultValue != myTextField->getText().text()) {
657 } else {
658 myTextField->setTextColor(FXRGB(195, 195, 195));
659 }
660 }
661}
662
663
664const FXButton*
668
669
670void
672 const auto editedDemandElement = myVTypeAttributesParent->myVehicleTypeDialog->myElement;
674 // If previous attribute wasn't correct, set black as default color
676 color = GNEAttributeCarrier::parse<RGBColor>(myTextField->getText().text());
677 }
678 // declare colorDialog
679 const auto colorDialog = new GNEColorDialog(editedDemandElement->getNet()->getGNEApplicationWindow(),
680 myVTypeAttributesParent->myVehicleTypeDialog, color);
681 // continue depending of result
682 if (colorDialog->getResult() == GNEDialog::Result::ACCEPT) {
683 std::string newValue = toString(colorDialog->getColor());
684 myTextField->setText(newValue.c_str());
685 if (editedDemandElement->isValid(myAttr, newValue)) {
686 editedDemandElement->setAttribute(myAttr, newValue, editedDemandElement->getNet()->getUndoList());
687 // If previously value was incorrect, change font color to black
689 myTextField->killFocus();
690 }
691 }
692}
693
694
695void
697 // get the new image file
698 FXFileDialog opendialog(this, TL("Open Image"));
699 opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::VTYPE));
700 opendialog.setSelectMode(SELECTFILE_EXISTING);
701 opendialog.setPatternList(SUMOXMLDefinitions::ImageFileExtensions.getMultilineString().c_str());
702 if (gCurrentFolder.length() != 0) {
703 opendialog.setDirectory(gCurrentFolder);
704 }
705 if (opendialog.execute()) {
706 // update global current folder
707 gCurrentFolder = opendialog.getDirectory();
708 // get image path
709 std::string imagePath = opendialog.getFilename().text();
710 // check if image is valid
711 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->isValid(myAttr, imagePath)) {
712 myVTypeAttributesParent->myVehicleTypeDialog->myElement->setAttribute(myAttr, imagePath, myVTypeAttributesParent->myVehicleTypeDialog->myElement->getNet()->getUndoList());
713 myTextField->setText(imagePath.c_str());
714 // If previously value was incorrect, change font color to black
716 myTextField->killFocus();
717 }
718 }
719}
720
721
722void
724 // get the new file name
725 FXFileDialog opendialog(this, TL("Open OSG File"));
726 opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::VTYPE));
727 opendialog.setSelectMode(SELECTFILE_EXISTING);
728 opendialog.setPatternList(SUMOXMLDefinitions::OSGFileExtensions.getMultilineString().c_str());
729 if (gCurrentFolder.length() != 0) {
730 opendialog.setDirectory(gCurrentFolder);
731 }
732 if (opendialog.execute()) {
733 // update global current folder
734 gCurrentFolder = opendialog.getDirectory();
735 // get image path
736 std::string imagePath = opendialog.getFilename().text();
737 // check if image is valid
738 if (myVTypeAttributesParent->myVehicleTypeDialog->myElement->isValid(myAttr, imagePath)) {
739 myVTypeAttributesParent->myVehicleTypeDialog->myElement->setAttribute(myAttr, imagePath, myVTypeAttributesParent->myVehicleTypeDialog->myElement->getNet()->getUndoList());
740 myTextField->setText(imagePath.c_str());
741 // If previously value was incorrect, change font color to black
743 myTextField->killFocus();
744 }
745 }
746}
747
748
749std::string
753
754
755std::vector<std::pair<std::string, std::string> >
757 std::vector<std::pair<std::string, std::string> > result;
758 // Generate a vector string using the following structure: "<key1,value1>, <key2, value2>,...
759 for (const auto& parameter : myParameters) {
760 result.push_back(std::make_pair(parameter.first, parameter.second));
761 }
762 return result;
763}
764
765
766void
767GNEVehicleTypeDialog::VTypeAttributes::VTypeAttributeRow::setParameters(const std::vector<std::pair<std::string, std::string> >& parameters) {
768 // first clear parameters
769 myParameters.clear();
770 // declare result
771 std::string result;
772 // iterate over parameters
773 for (const auto& parameter : parameters) {
774 // Generate an string using the following structure: "key1=value1|key2=value2|...
775 result += parameter.first + "=" + parameter.second + "|";
776 // fill parameters
777 myParameters[parameter.first] = parameter.second;
778 }
779 // remove the last "|"
780 if (!result.empty()) {
781 result.pop_back();
782 }
783 // set text field
784 myTextField->setText(result.c_str());
785}
786
787
788std::string
790 switch (attr) {
791 // JM
793 return "crossingGap";
795 return "driveAfterYellowTime";
797 return "driveAfterRedTime";
799 return "driveRedSpeed";
801 return "ignoreKeepClearTime";
803 return "ignoreFoeSpeed";
805 return "ignoreFoeProb";
807 return "sigmaMinor";
809 return "timegapMinor";
810 // LCM
812 return "strategic";
814 return "cooperative";
816 return "speedGain";
818 return "keepRight";
820 return "sublane";
822 return "opposite";
824 return "pushy";
826 return "pushyGap";
828 return "assertive";
830 return "impatience";
832 return "timeToImpatience";
834 return "accelLat";
836 return "lookaheadLeft";
838 return "speedGainRight";
840 return "maxSpeedLatStanding";
842 return "maxSpeedLatFactor";
844 return "turnAlignDistance";
846 return "overtakeRight";
848 return "keepRightAcceptanceTime";
850 return "overtakeDeltaSpeedFactor";
851 /* case SUMO_ATTR_LCA_EXPERIMENTAL1:
852 return "experimental1";
853 */
854 default:
855 return toString(attr);
856 }
857}
858
859// ---------------------------------------------------------------------------
860// GNEVehicleTypeDialog::VTypeAttributes - methods
861// ---------------------------------------------------------------------------
862
864 FXVerticalFrame(column, GUIDesignAuxiliarVerticalFrame),
865 myVehicleTypeDialog(vehicleTypeDialog) {
866 // declare two auxiliary horizontal frames
867 FXHorizontalFrame* firstAuxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
868 FXVerticalFrame* firstAuxiliarVerticalFrame = new FXVerticalFrame(firstAuxiliarHorizontalFrame, GUIDesignAuxiliarVerticalFrame);
869 // create attributes for common attributes
870 FXGroupBox* commonAttributes = new FXGroupBox(firstAuxiliarVerticalFrame, "Vehicle Type attributes", GUIDesignGroupBoxFrame);
871 // create horizontal frame for columns of attributes
872 FXHorizontalFrame* columnsBasicVTypeAttributes = new FXHorizontalFrame(commonAttributes, GUIDesignAuxiliarHorizontalFrame);
873 // build left attributes
874 buildAttributesA(new FXVerticalFrame(columnsBasicVTypeAttributes, GUIDesignAuxiliarFrame));
875 // build right attributes
876 buildAttributesB(new FXVerticalFrame(columnsBasicVTypeAttributes, GUIDesignAuxiliarFrame));
877 // create GroupBox for Junction Model Attributes
878 FXGroupBox* JMAttributes = new FXGroupBox(firstAuxiliarVerticalFrame, "Junction Model attributes", GUIDesignGroupBoxFrame);
879 // create horizontal frame for columns of Junction Model attributes
880 FXHorizontalFrame* columnsJMVTypeAttributes = new FXHorizontalFrame(JMAttributes, GUIDesignAuxiliarHorizontalFrame);
881 // build left attributes
882 buildJunctionModelAttributesA(new FXVerticalFrame(columnsJMVTypeAttributes, GUIDesignAuxiliarFrame));
883 // build right attributes
884 buildJunctionModelAttributesB(new FXVerticalFrame(columnsJMVTypeAttributes, GUIDesignAuxiliarFrame));
885 // create GroupBox for Junction Model Attributes
886 FXGroupBox* LCMAttributes = new FXGroupBox(firstAuxiliarHorizontalFrame, "Lane Change Model attributes", GUIDesignGroupBoxFrame);
887 // create Lane Change Model Attributes
888 buildLaneChangeModelAttributes(new FXVerticalFrame(LCMAttributes, GUIDesignAuxiliarFrame));
889}
890
891
892void
894 // 01 Create VClassRow
895 myVClassRow = new VClassRow(this, column);
896
897 // 02 create FXTextField and Label for vehicleTypeID
898 FXHorizontalFrame* row = new FXHorizontalFrame(column, GUIDesignAuxiliarHorizontalFrame);
899 new FXLabel(row, toString(SUMO_ATTR_ID).c_str(), nullptr, GUIDesignLabelThickedFixed(150));
901
902 // 03 create FXTextField and Button for Color
904
905 // 04 create FXTextField and Label for Length
907
908 // 05 create FXTextField and Label for MinGap
910
911 // 06 create FXTextField and Label for MaxSpeed
913
914 // 07 create VTypeAttributeRow and Label for desired max speed
916
917 // 08 create FXTextField and Label for SpeedFactor
919
920 // 09 create FXTextField and Label for EmissionClass
921 myEmissionClass = new VTypeAttributeRow(this, column, SUMO_ATTR_EMISSIONCLASS, VTypeAttributeRow::RowAttrType::ROWTYPE_COMBOBOX, PollutantsInterface::getAllClassesStr());
922
923 // 10 create FXTextField and Label for Width
925
926 // 11 create FXTextField and Label for Height
928
929 // 12 create FXTextField and Label for Filename
931
932 // 13 create FXTextField and Label for Filename
934
935 // 14 create VTypeAttributeRow and Label for LaneChangeModel
937}
938
939
940void
942 // 01 Create VShapeRow
943 myVShapeRow = new VShapeRow(this, column);
944
945 // 02 create VTypeAttributeRow and Label for Probability
947
948 // 03 create VTypeAttributeRow and Label for PersonCapacity
950
951 // 04 create VTypeAttributeRow and Label for ContainerCapacity
953
954 // 05 create VTypeAttributeRow and Label for BoardingDuration
956
957 // 06 create VTypeAttributeRow and Label for LoadingDuration
959
960 // 07 create ComboBox and Label for LatAlignment
962
963 // 08 create VTypeAttributeRow and Label for MinGapLat
965
966 // 09 create VTypeAttributeRow and Label for MaxSpeedLat
968
969 // 10 create VTypeAttributeRow and Label for ActionStepLength
971 /*
972 Waiting for #16343
973 // 11 create FXTextField and Label for Carriage length
974 myCarriageLength = new VTypeAttributeRow(this, column, SUMO_ATTR_CARRIAGE_LENGTH, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
975
976 // 12 create FXTextField and Label for Locomotive length
977 myLocomotiveLength = new VTypeAttributeRow(this, column, SUMO_ATTR_LOCOMOTIVE_LENGTH, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
978
979 // 13 create FXTextField and Label for carriage GAP
980 myCarriageGap = new VTypeAttributeRow(this, column, SUMO_ATTR_CARRIAGE_GAP, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING);
981 */
982 // 14 create FXTextField and Label for parameters
984}
985
986
987void
989 // 01 create VTypeAttributeRow and Label for JMCrossingGap
991
992 // 02 create VTypeAttributeRow and Label for JMIgnoreKeepclearTime
994
995 // 03 create VTypeAttributeRow and Label for JMDriveAfterYellowTime
997
998 // 04 create VTypeAttributeRow and Label for JMDriveAfterRedTime
1000
1001 // 05 create VTypeAttributeRow and Label for JMDriveRedSpeed
1003}
1004
1005
1006void
1008 // 01 create VTypeAttributeRow and Label for JMIgnoreFoeProb
1010
1011 // 02 create VTypeAttributeRow and Label for JMIgnoreFoeSpeed
1013
1014 // 03 create VTypeAttributeRow and Label for JMSigmaMinor
1016
1017 // 04 create VTypeAttributeRow and Label for JMTimeGapMinor
1019
1020 // 05 create VTypeAttributeRow and Label for Impatience
1022}
1023
1024
1025void
1027 // 01 create VTypeAttributeRow and Label for strategic param
1029
1030 // 02 create VTypeAttributeRow and Label for cooperative param
1032
1033 // 03 create VTypeAttributeRow and Label for speed gain param
1035
1036 // 04 create VTypeAttributeRow and Label for keepright param
1038
1039 // 05 create VTypeAttributeRow and Label for sublane param
1041
1042 // 06 create VTypeAttributeRow and Label for opposite param
1044
1045 // 07 create VTypeAttributeRow and Label for pushy
1047
1048 // 08 create VTypeAttributeRow and Label for pushy gap
1050
1051 // 09 create VTypeAttributeRow and Label for assertive
1053
1054 // 10 create VTypeAttributeRow and Label for impatience
1056
1057 // 11 create VTypeAttributeRow and Label for time to impatience
1059
1060 // 12 create VTypeAttributeRow and Label for accel lat
1062
1063 // 13 create VTypeAttributeRow and Label for look ahead lefth
1065
1066 // 14 create VTypeAttributeRow and Label for speed gain right
1068
1069 // 15 create VTypeAttributeRow and Label for max speed lat standing
1071
1072 // 16 create VTypeAttributeRow and Label for max speed lat factor
1074
1075 // 17 create VTypeAttributeRow and Label for turn alignment distance
1077
1078 // 18 create VTypeAttributeRow and Label for overtake right
1080
1081 // 19 create VTypeAttributeRow and Label for keep right acceptance time
1083
1084 // 20 create VTypeAttributeRow and Label for overtake deltaspeed factor
1086
1087 // 21 create VTypeAttributeRow and Label for experimental
1088 /* myLCAExperimental = new VTypeAttributeRow(this, column, SUMO_ATTR_LCA_EXPERIMENTAL1, VTypeAttributeRow::RowAttrType::ROWTYPE_STRING); */
1089}
1090
1091
1092void
1094 //set values of myElement into fields
1095 myTextFieldVehicleTypeID->setText(myVehicleTypeDialog->myElement->getAttribute(SUMO_ATTR_ID).c_str());
1096 // set variables of special rows VClass and VShape
1097 SUMOVTypeParameter::VClassDefaultValues defaultVTypeParameters(myVClassRow->updateValue());
1098 myVShapeRow->updateValues();
1099 // update rows
1100 myLaneChangeModel->updateValue();
1101 myLatAlignment->updateValue(toString(defaultVTypeParameters.latAlignmentProcedure));
1102 myColor->updateValue();
1103 myLength->updateValue(toString(defaultVTypeParameters.length));
1104 myMinGap->updateValue(toString(defaultVTypeParameters.minGap));
1105 myMaxSpeed->updateValue(toString(defaultVTypeParameters.maxSpeed));
1106 myDesiredMaxSpeed->updateValue(toString(defaultVTypeParameters.desiredMaxSpeed));
1107 mySpeedFactor->updateValue(toString(defaultVTypeParameters.speedFactor.getParameter(0)));
1108 myEmissionClass->updateValue(toString(defaultVTypeParameters.emissionClass));
1109 myWidth->updateValue(toString(defaultVTypeParameters.width));
1110 myHeight->updateValue(toString(defaultVTypeParameters.height));
1111 myFilename->updateValue();
1112 myOSGFile->updateValue(toString(defaultVTypeParameters.osgFile));
1113 myPersonCapacity->updateValue(toString(defaultVTypeParameters.personCapacity));
1114 myContainerCapacity->updateValue(toString(defaultVTypeParameters.containerCapacity));
1115 /*
1116 Waiting for #16343
1117 myCarriageLength->updateValue(toString(defaultVTypeParameters.carriageLength));
1118 myLocomotiveLength->updateValue(toString(defaultVTypeParameters.locomotiveLength));
1119 myCarriageGap->updateValue();
1120 */
1121 myBoardingDuration->updateValue();
1122 myLoadingDuration->updateValue();
1123 myMinGapLat->updateValue();
1124 myMaxSpeedLat->updateValue();
1125 myActionStepLength->updateValue();
1126 myProbability->updateValue();
1127 // JM Parameters
1128 myJMCrossingGap->updateValue();
1129 myJMIgnoreKeepclearTime->updateValue();
1130 myJMDriveAfterYellowTime->updateValue();
1131 myJMDriveAfterRedTime->updateValue();
1132 myJMDriveRedSpeed->updateValue();
1133 myJMIgnoreFoeProb->updateValue();
1134 myJMIgnoreFoeSpeed->updateValue();
1135 myJMSigmaMinor->updateValue();
1136 myJMTimeGapMinor->updateValue();
1137 myJMImpatience->updateValue();
1138 // LCM Attributes
1139 myLCAStrategicParam->updateValue();
1140 myLCACooperativeParam->updateValue();
1141 myLCASpeedgainParam->updateValue();
1142 myLCAKeeprightParam->updateValue();
1143 myLCASublaneParam->updateValue();
1144 myLCAOppositeParam->updateValue();
1145 myLCAPushy->updateValue();
1146 myLCAPushygap->updateValue();
1147 myLCAAssertive->updateValue();
1148 myLCAImpatience->updateValue();
1149 myLCATimeToImpatience->updateValue();
1150 myLCAAccelLat->updateValue();
1151 myLCALookAheadLeft->updateValue();
1152 myLCASpeedGainRight->updateValue();
1153 myLCAMaxSpeedLatStanding->updateValue();
1154 myLCAMaxSpeedLatFactor->updateValue();
1155 myLCATurnAlignmentDistance->updateValue();
1156 myLCAOvertakeRight->updateValue();
1157 myLCAKeepRightAcceptanceTime->updateValue();
1158 myLCAOvertakeDeltaSpeedFactor->updateValue();
1159 /* myLCAExperimental->updateValue(); */
1160 // parameters
1161 myParameters->updateValue();
1162}
1163
1164
1165long
1167 // At start we assumed, that all values are valid
1168 myVehicleTypeDialog->myVehicleTypeValid = true;
1169 myVehicleTypeDialog->myInvalidAttr = SUMO_ATTR_NOTHING;
1170 // set color of myTextFieldVehicleTypeID, depending if current value is valid or not
1171 if (myVehicleTypeDialog->myElement->isValid(SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text())) {
1173 myVehicleTypeDialog->myElement->setAttribute(SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text(), myVehicleTypeDialog->myElement->getNet()->getUndoList());
1174 } else if (myVehicleTypeDialog->myElement->getAttribute(SUMO_ATTR_ID) == myTextFieldVehicleTypeID->getText().text()) {
1176 myVehicleTypeDialog->myElement->setAttribute(SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text(), myVehicleTypeDialog->myElement->getNet()->getUndoList());
1177 } else {
1179 myVehicleTypeDialog->myVehicleTypeValid = false;
1180 myVehicleTypeDialog->myInvalidAttr = SUMO_ATTR_ID;
1181 }
1182 // set variables of special rows VClass and VShape
1183 SUMOVTypeParameter::VClassDefaultValues defaultVTypeParameters(myVClassRow->setVariable());
1184 // set variables of special rows VShape
1185 myVShapeRow->setVariable();
1186 // set attributes in rest rows
1187 myColor->setVariable();
1188 myLength->setVariable(toString(defaultVTypeParameters.length));
1189 myMinGap->setVariable(toString(defaultVTypeParameters.minGap));
1190 myMaxSpeed->setVariable(toString(defaultVTypeParameters.maxSpeed));
1191 myDesiredMaxSpeed->setVariable(toString(defaultVTypeParameters.desiredMaxSpeed));
1192 mySpeedFactor->setVariable(toString(defaultVTypeParameters.speedFactor.getParameter(0)));
1193 myEmissionClass->setVariable(toString(defaultVTypeParameters.emissionClass));
1194 myWidth->setVariable(toString(defaultVTypeParameters.width));
1195 myHeight->setVariable(toString(defaultVTypeParameters.height));
1196 myOSGFile->setVariable(toString(defaultVTypeParameters.osgFile));
1197 // set attributes in rows
1198 myLaneChangeModel->setVariable();
1199 myLatAlignment->setVariable(toString(defaultVTypeParameters.latAlignmentProcedure));
1200 myLength->setVariable(toString(defaultVTypeParameters.length));
1201 myMinGap->setVariable(toString(defaultVTypeParameters.minGap));
1202 myMaxSpeed->setVariable(toString(defaultVTypeParameters.maxSpeed));
1203 mySpeedFactor->setVariable(toString(defaultVTypeParameters.speedFactor.getParameter(0)));
1204 myEmissionClass->setVariable(toString(defaultVTypeParameters.emissionClass));
1205 myWidth->setVariable(toString(defaultVTypeParameters.width));
1206 myHeight->setVariable(toString(defaultVTypeParameters.height));
1207 myFilename->setVariable();
1208 myOSGFile->setVariable(toString(defaultVTypeParameters.osgFile));
1209 myPersonCapacity->setVariable(toString(defaultVTypeParameters.personCapacity));
1210 myContainerCapacity->setVariable(toString(defaultVTypeParameters.containerCapacity));
1211 /*
1212 Waiting for #16343
1213 myCarriageLength->setVariable(toString(defaultVTypeParameters.carriageLength));
1214 myLocomotiveLength->setVariable(toString(defaultVTypeParameters.locomotiveLength));
1215 myCarriageGap->setVariable();
1216 */
1217 myBoardingDuration->setVariable();
1218 myLoadingDuration->setVariable();
1219 myMinGapLat->setVariable();
1220 myMaxSpeedLat->setVariable();
1221 myActionStepLength->setVariable();
1222 myProbability->setVariable();
1223 // JM Variables
1224 myJMCrossingGap->setVariable();
1225 myJMIgnoreKeepclearTime->setVariable();
1226 myJMDriveAfterYellowTime->setVariable();
1227 myJMDriveAfterRedTime->setVariable();
1228 myJMDriveRedSpeed->setVariable();
1229 myJMIgnoreFoeProb->setVariable();
1230 myJMIgnoreFoeSpeed->setVariable();
1231 myJMSigmaMinor->setVariable();
1232 myJMTimeGapMinor->setVariable();
1233 myJMImpatience->setVariable();
1234 // LCM Attributes
1235 myLCAStrategicParam->setVariable();
1236 myLCACooperativeParam->setVariable();
1237 myLCASpeedgainParam->setVariable();
1238 myLCAKeeprightParam->setVariable();
1239 myLCASublaneParam->setVariable();
1240 myLCAOppositeParam->setVariable();
1241 myLCAPushy->setVariable();
1242 myLCAPushygap->setVariable();
1243 myLCAAssertive->setVariable();
1244 myLCAImpatience->setVariable();
1245 myLCATimeToImpatience->setVariable();
1246 myLCAAccelLat->setVariable();
1247 myLCALookAheadLeft->setVariable();
1248 myLCASpeedGainRight->setVariable();
1249 myLCAMaxSpeedLatStanding->setVariable();
1250 myLCAMaxSpeedLatFactor->setVariable();
1251 myLCATurnAlignmentDistance->setVariable();
1252 myLCAOvertakeRight->setVariable();
1253 myLCAKeepRightAcceptanceTime->setVariable();
1254 myLCAOvertakeDeltaSpeedFactor->setVariable();
1255 /* myLCAExperimental->setVariable(); */
1256 myParameters->setVariable();
1257 return true;
1258}
1259
1260
1261long
1263 // check what dialog has to be opened
1264 if (obj == myColor->getButton()) {
1265 myColor->openColorDialog();
1266 } else if (obj == myFilename->getButton()) {
1267 myFilename->openImageFileDialog();
1268 } else if (obj == myOSGFile->getButton()) {
1269 myFilename->openOSGFileDialog();
1270 }
1271 return 1;
1272}
1273
1274
1275long
1277 auto viewNet = myVehicleTypeDialog->getElement()->getNet()->getViewNet();
1278 // create parameters dialog
1279 const GNEParametersDialog singleParametersDialog(viewNet->getViewParent()->getGNEAppWindows(), myVehicleTypeDialog,
1280 myVehicleTypeDialog->getElement()->getParameters()->getParametersMap());
1281 // continue depending of result
1282 if (singleParametersDialog.getResult() == GNEDialog::Result::ACCEPT) {
1283 // set values edited in Parameter dialog in Edited AC
1284 myVehicleTypeDialog->getElement()->setAttribute(GNE_ATTR_PARAMETERS, myParameters->getParametersStr(), viewNet->getUndoList());
1285 }
1286 return 1;
1287}
1288
1289// ---------------------------------------------------------------------------
1290// GNEVehicleTypeDialog::VShapeRow - methods
1291// ---------------------------------------------------------------------------
1292
1294 FXGroupBox(column, "Car Following Model attributes", GUIDesignGroupBoxFrame),
1295 myVehicleTypeDialog(vehicleTypeDialog) {
1296
1297 // create vertical frame for rows
1298 myVerticalFrameRows = new FXVerticalFrame(this, GUIDesignAuxiliarFrame);
1299
1300 // declare combo box
1301 FXHorizontalFrame* row = new FXHorizontalFrame(myVerticalFrameRows, GUIDesignAuxiliarHorizontalFrame);
1302 new FXLabel(row, "Algorithm", nullptr, GUIDesignLabelThickedFixed(150));
1303 myComboBoxCarFollowModel = new MFXComboBoxIcon(row, myVehicleTypeDialog->getApplicationWindow()->getStaticTooltipMenu(),
1305 // fill combo Box with all Car following models
1306 std::vector<std::string> CFModels = SUMOXMLDefinitions::CarFollowModels.getStrings();
1307 for (const auto& CFModel : CFModels) {
1308 myComboBoxCarFollowModel->appendIconItem(CFModel.c_str(), nullptr);
1309 }
1310
1311 // 01 create FX and Label for Accel
1313 myRows.push_back(myAccelRow);
1314
1315 // 02 create FX and Label for Decel
1317 myRows.push_back(myDecelRow);
1318
1319 // 03 create FX and Label for Apparent decel
1321 myRows.push_back(myApparentDecelRow);
1322
1323 // 04 create FX and Label for emergency decel
1325 myRows.push_back(myEmergencyDecelRow);
1326
1327 // 05 create FX and Label for Sigma
1329 myRows.push_back(mySigmaRow);
1330
1331 // 06 create FX and Label for Tau
1333 myRows.push_back(myTauRow);
1334
1335 // 07 myMinGapFactor FX and Label for MinGapFactor
1337 myRows.push_back(myMinGapFactorRow);
1338
1339 // 08 create FX and Label for K
1341 myRows.push_back(myKRow);
1342
1343 // 09 create FX and Label for PHI
1345 myRows.push_back(myPhiRow);
1346
1347 // 10 create FX and Label for Deleta
1349 myRows.push_back(myDeltaRow);
1350
1351 // 11 create FX and Label for Stepping
1353 myRows.push_back(mySteppingRow);
1354
1355 // 12 create FX and Label for Security
1357 myRows.push_back(mySecurityRow);
1358
1359 // 13 create FX and Label for Estimation
1361 myRows.push_back(myEstimationRow);
1362
1363 // 14 create FX and Label for TMP1
1365 myRows.push_back(myTmp1Row);
1366
1367 // 15 create FX and Label for TMP2
1369 myRows.push_back(myTmp2Row);
1370
1371 // 16 create FX and Label for TMP3
1373 myRows.push_back(myTmp3Row);
1374
1375 // 17 create FX and Label for TMP4
1377 myRows.push_back(myTmp4Row);
1378
1379 // 18 create FX and Label for TMP5
1381 myRows.push_back(myTmp5Row);
1382
1383 // 19 create FX and Label for trainType (allow strings)
1385 myRows.push_back(myTrainTypeRow);
1386
1387 // 20 create FX and Label for Tau Last
1389 myRows.push_back(myTrauLastRow);
1390
1391 // 21 create FX and Label for Aprob
1393 myRows.push_back(myAprobRow);
1394
1395 // 22 create FX and Label for Adapt Factor
1397 myRows.push_back(myAdaptFactorRow);
1398
1399 // 23 create FX and Label for Adapt Time
1401 myRows.push_back(myAdaptTimeRow);
1402
1403 // 24 create FX and Label for W99 CC 01
1405 myRows.push_back(myW99CC1);
1406
1407 // 25 create FX and Label for W99 CC 02
1409 myRows.push_back(myW99CC2);
1410
1411 // 26 create FX and Label for W99 CC 03
1413 myRows.push_back(myW99CC3);
1414
1415 // 27 create FX and Label for W99 CC 04
1417 myRows.push_back(myW99CC4);
1418
1419 // 28 create FX and Label for W99 CC 05
1421 myRows.push_back(myW99CC5);
1422
1423 // 29 create FX and Label for W99 CC 06
1425 myRows.push_back(myW99CC6);
1426
1427 // 30 create FX and Label for W99 CC 07
1429 myRows.push_back(myW99CC7);
1430
1431 // 31 create FX and Label for W99 CC 08
1433 myRows.push_back(myW99CC8);
1434
1435 // 32 create FX and Label for W99 CC 09
1437 myRows.push_back(myW99CC9);
1438
1439 // X1 create FX and Label for Look ahead/preview Time
1441 myRows.push_back(myTpreviewRow);
1442
1443 // X2 create FX and Label for Reaction Time
1445 myRows.push_back(myTreactionRow);
1446
1447 // X3 create FX and Label for Wiener Process Driving Error
1449 myRows.push_back(myTPersDriveRow);
1450
1451 // X4 create FX and Label for Wiener Process Estimation Error
1453 myRows.push_back(myTPersEstimateRow);
1454
1455 // X5 create FX and Label for Coolness parameter
1457 myRows.push_back(myCcoolnessRow);
1458
1459 // X6 create FX and Label for leader speed estimation error
1461 myRows.push_back(mySigmaleaderRow);
1462
1463 // X7 create FX and Label for Gap estimation error
1465 myRows.push_back(mySigmagapRow);
1466
1467 // X8 create FX and Label for Driving Error
1469 myRows.push_back(mySigmaerrorRow);
1470
1471 // X9 create FX and Label for max jerk
1473 myRows.push_back(myJerkmaxRow);
1474
1475 // X10 create FX and Label for AP Driver Update threshold
1477 myRows.push_back(myEpsilonaccRow);
1478
1479 // X11 create FX and Label for Startup Time to acc_max
1481 myRows.push_back(myTaccmaxRow);
1482
1483 // X12 create FX and Label for Startup M flatness
1485 myRows.push_back(myMflatnessRow);
1486
1487 // X13 create FX and Label for Startup M begin
1489 myRows.push_back(myMbeginRow);
1490
1491 // X14 create FX and Label for using vehicle dynamics
1493 myRows.push_back(myUseVehDynamicsRow);
1494
1495 // X14 create FX and Label for using vehicle dynamics
1497 myRows.push_back(myMaxVehPreviewRow);
1498
1499 // create myLabelIncompleteAttribute
1500 myLabelIncompleteAttribute = new FXLabel(myVerticalFrameRows, "Some attributes wasn't\nimplemented yet", nullptr, GUIDesignLabelAboutInfoCenter);
1502
1503 // show or hide ComboBox depending of current selected CFM
1505}
1506
1507
1508void
1510 // start hiding all rows
1511 for (const auto& row : myRows) {
1512 row->hide();
1513 }
1514 // hide myLabelIncompleteAttribute
1516 // show textfield depending of current CFM
1517 if (SUMOXMLDefinitions::CarFollowModels.hasString(myComboBoxCarFollowModel->getText().text())) {
1518 // show textfield depending of selected CFM
1519 switch (SUMOXMLDefinitions::CarFollowModels.get(myComboBoxCarFollowModel->getText().text())) {
1520 case SUMO_TAG_CF_KRAUSS:
1523 myTauRow->show();
1524 myAccelRow->show();
1525 myDecelRow->show();
1526 myApparentDecelRow->show();
1527 myEmergencyDecelRow->show();
1528 mySigmaRow->show();
1529 break;
1531 myTauRow->show();
1532 myTmp1Row->show();
1533 myTmp2Row->show();
1534 myTmp3Row->show();
1535 myTmp4Row->show();
1536 myTmp5Row->show();
1537 break;
1540 myTauRow->show();
1541 myAccelRow->show();
1542 myDecelRow->show();
1543 myEmergencyDecelRow->show();
1544 mySigmaRow->show();
1545 myMinGapFactorRow->show();
1546 myTmp1Row->show();
1547 myTmp2Row->show();
1548 myTmp3Row->show();
1549 myTmp4Row->show();
1550 myTmp5Row->show();
1551 break;
1553 myTauRow->show();
1554 myAccelRow->show();
1555 myDecelRow->show();
1556 myEmergencyDecelRow->show();
1557 mySigmaRow->show();
1558 myMinGapFactorRow->show();
1559 myTrauLastRow->show();
1560 myAprobRow->show();
1561 break;
1562 case SUMO_TAG_CF_IDM:
1563 myTauRow->show();
1564 myAccelRow->show();
1565 myDecelRow->show();
1566 myEmergencyDecelRow->show();
1567 myDeltaRow->show();
1568 mySteppingRow->show();
1569 myMinGapFactorRow->show();
1570 break;
1571 case SUMO_TAG_CF_IDMM:
1572 myTauRow->show();
1573 myAccelRow->show();
1574 myDecelRow->show();
1575 myEmergencyDecelRow->show();
1576 myDeltaRow->show();
1577 mySteppingRow->show();
1578 myMinGapFactorRow->show();
1579 myAdaptFactorRow->show();
1580 myAdaptTimeRow->show();
1581 break;
1582 case SUMO_TAG_CF_EIDM:
1583 myTauRow->show();
1584 myAccelRow->show();
1585 myDecelRow->show();
1586 myEmergencyDecelRow->show();
1587 myDeltaRow->show();
1588 mySteppingRow->show();
1589 myMinGapFactorRow->show();
1590 myTpreviewRow->show();
1591 myTreactionRow->show();
1592 myTPersDriveRow->show();
1593 myTPersEstimateRow->show();
1594 myCcoolnessRow->show();
1595 mySigmaleaderRow->show();
1596 mySigmagapRow->show();
1597 mySigmaerrorRow->show();
1598 myJerkmaxRow->show();
1599 myEpsilonaccRow->show();
1600 myTaccmaxRow->show();
1601 myMflatnessRow->show();
1602 myMbeginRow->show();
1603 myUseVehDynamicsRow->show();
1604 myMaxVehPreviewRow->show();
1605 break;
1607 myTauRow->show();
1608 myAccelRow->show();
1609 myDecelRow->show();
1610 myEmergencyDecelRow->show();
1611 myKRow->show();
1612 myPhiRow->show();
1613 myMinGapFactorRow->show();
1614 break;
1616 myTauRow->show();
1617 myAccelRow->show();
1618 myDecelRow->show();
1619 myEmergencyDecelRow->show();
1620 myMinGapFactorRow->show();
1621 mySecurityRow->show();
1622 myEstimationRow->show();
1623 break;
1624 case SUMO_TAG_CF_W99:
1625 myW99CC1->show();
1626 myW99CC2->show();
1627 myW99CC3->show();
1628 myW99CC4->show();
1629 myW99CC5->show();
1630 myW99CC6->show();
1631 myW99CC7->show();
1632 myW99CC8->show();
1633 myW99CC9->show();
1634 break;
1635 case SUMO_TAG_CF_RAIL:
1636 myTauRow->show();
1637 myTrainTypeRow->show();
1638 break;
1639 case SUMO_TAG_CF_ACC:
1640 myTauRow->show();
1641 myAccelRow->show();
1642 myDecelRow->show();
1643 myEmergencyDecelRow->show();
1644 myMinGapFactorRow->show();
1645 // show myLabelIncompleteAttribute
1657 break;
1658 case SUMO_TAG_CF_CACC:
1659 myTauRow->show();
1660 myAccelRow->show();
1661 myDecelRow->show();
1662 myEmergencyDecelRow->show();
1663 myMinGapFactorRow->show();
1664 // show myLabelIncompleteAttribute
1682 break;
1683 case SUMO_TAG_CF_CC:
1684 myTauRow->show();
1685 myAccelRow->show();
1686 myDecelRow->show();
1687 // show myLabelIncompleteAttribute
1710 break;
1711 default:
1712 break;
1713 }
1714 }
1715 myVerticalFrameRows->recalc();
1716 update();
1717}
1718
1719
1720void
1722 //set values of myElement into fields
1723 if (myVehicleTypeDialog->myElement->getAttribute(SUMO_ATTR_CAR_FOLLOW_MODEL).empty()) {
1724 myComboBoxCarFollowModel->setCurrentItem(0);
1725 } else {
1726 // set value
1727 const int index = myComboBoxCarFollowModel->findItem(myVehicleTypeDialog->myElement->getAttribute(SUMO_ATTR_CAR_FOLLOW_MODEL).c_str());
1728 if (index == -1) {
1729 myComboBoxCarFollowModel->disable();
1730 } else {
1731 myComboBoxCarFollowModel->setCurrentItem(index);
1732 myComboBoxCarFollowModel->enable();
1733 }
1734 }
1735 // refresh fields
1737 // update value in all Rows
1738 for (const auto& row : myRows) {
1739 row->updateValue();
1740 }
1741}
1742
1743
1744long
1746 // At start we assumed, that all values are valid
1747 myVehicleTypeDialog->myVehicleTypeValid = true;
1748 myVehicleTypeDialog->myInvalidAttr = SUMO_ATTR_NOTHING;
1749 // set color of myTextFieldCarFollowModel, depending if current value is valid or not
1750 if (myVehicleTypeDialog->myElement->isValid(SUMO_ATTR_CAR_FOLLOW_MODEL, myComboBoxCarFollowModel->getText().text())) {
1752 myVehicleTypeDialog->myElement->setAttribute(SUMO_ATTR_CAR_FOLLOW_MODEL, myComboBoxCarFollowModel->getText().text(), myVehicleTypeDialog->myElement->getNet()->getUndoList());
1753 } else {
1755 myVehicleTypeDialog->myVehicleTypeValid = false;
1757 }
1758 // set variable in all Rows
1759 for (const auto& row : myRows) {
1760 row->setVariable();
1761 }
1762 // refresh fields
1764 return true;
1765}
1766
1767// ---------------------------------------------------------------------------
1768// GNEVehicleTypeDialog - public methods
1769// ---------------------------------------------------------------------------
1770
1773 myVehicleTypeValid(true),
1775 // Create auxiliar frames for values
1776 FXHorizontalFrame* columns = new FXHorizontalFrame(myContentFrame, GUIDesignAuxiliarHorizontalFrame);
1777 // create vehicle type attributes
1778 myVTypeAttributes = new VTypeAttributes(this, columns);
1779 // create car following model parameters
1781 // update values of Vehicle Type common attributes
1782 myVTypeAttributes->updateValues();
1783 // update values of Car Following Model Parameters
1784 myCarFollowingModelParameters->updateValues();
1785 // open dialog
1786 openDialog();
1787}
1788
1789
1791
1792
1793void
1795 // nothing to do
1796}
1797
1798
1799long
1800GNEVehicleTypeDialog::onCmdAccept(FXObject*, FXSelector, void*) {
1801 if (!myVehicleTypeValid) {
1802 // show warning dialogbox about experimental state (only once)
1803 GNEWarningBasicDialog(myElement->getNet()->getGNEApplicationWindow(),
1804 TLF("Error editing %", myElement->getTagStr()),
1805 TLF("The % cannot be updated because attribute % is invalid.",
1806 myElement->getTagStr(), toString(myInvalidAttr)));
1807 return 1;
1808 } else {
1809 // close dialog accepting changes
1810 return acceptElementDialog();
1811 }
1812}
1813
1814
1815long
1816GNEVehicleTypeDialog::onCmdReset(FXObject*, FXSelector, void*) {
1817 // reset changes
1818 resetChanges();
1819 // update values of Vehicle Type common attributes
1820 myVTypeAttributes->updateValues();
1821 // update values of Car Following Model Parameters
1822 myCarFollowingModelParameters->updateValues();
1823 return 1;
1824}
1825
1826// ---------------------------------------------------------------------------
1827// GNEVehicleTypeDialog - private methods
1828// ---------------------------------------------------------------------------
1829
1831 FXVerticalFrame* verticalFrame, SumoXMLAttr attr) :
1832 FXHorizontalFrame(verticalFrame, GUIDesignAuxiliarHorizontalFrame),
1833 myCarFollowingModelParametersParent(carFollowingModelParametersParent),
1834 myAttr(attr),
1835 myTextField(nullptr) {
1836 new FXLabel(this, toString(attr).c_str(), nullptr, GUIDesignLabelThickedFixed(150));
1837 myTextField = new FXTextField(this, GUIDesignTextFieldNCol, carFollowingModelParametersParent, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldFixed(180));
1838}
1839
1840
1841void
1843 // set color of textField, depending if current value is valid or not
1844 if (myCarFollowingModelParametersParent->myVehicleTypeDialog->myElement->isValid(myAttr, myTextField->getText().text())) {
1845 // set color depending if is a default value
1846 if (myCarFollowingModelParametersParent->myVehicleTypeDialog->myElement->getTagProperty()->getDefaultStringValue(myAttr) != myTextField->getText().text()) {
1847 myTextField->setTextColor(GUIDesignTextColorBlack);
1848 } else {
1849 myTextField->setTextColor(FXRGB(195, 195, 195));
1850 }
1851 myCarFollowingModelParametersParent->myVehicleTypeDialog->myElement->setAttribute(myAttr, myTextField->getText().text(),
1852 myCarFollowingModelParametersParent->myVehicleTypeDialog->myElement->getNet()->getUndoList());
1853 // update value after setting it
1854 updateValue();
1855 } else {
1856 myTextField->setTextColor(GUIDesignTextColorRed);
1857 // mark VType as invalid
1858 myCarFollowingModelParametersParent->myVehicleTypeDialog->myVehicleTypeValid = false;
1859 myCarFollowingModelParametersParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
1860 }
1861}
1862
1863
1864void
1866 // set text of myTextField using current value of VType
1867 myTextField->setText(myCarFollowingModelParametersParent->myVehicleTypeDialog->myElement->getAttribute(myAttr).c_str());
1868 // set color depending if is a default value
1869 if (myCarFollowingModelParametersParent->myVehicleTypeDialog->myElement->getTagProperty()->getDefaultStringValue(myAttr) != myTextField->getText().text()) {
1870 myTextField->setTextColor(GUIDesignTextColorBlack);
1871 } else {
1872 myTextField->setTextColor(FXRGB(195, 195, 195));
1873 }
1874}
1875
1876
1877/****************************************************************************/
DialogType
Definition DialogType.h:30
FXDEFMAP(GNEVehicleTypeDialog::VTypeAttributes) VTypeAttributesMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_ATTRIBUTESEDITOR_PARAMETERS
open generic parameters editor
@ MID_GNE_SET_ATTRIBUTE_DIALOG
attribute edited trough dialog
#define GUIDesignTextFieldFixed(width)
text field with fixed width
Definition GUIDesigns.h:80
#define GUIDesignTextColorRed
red color (for invalid text)
Definition GUIDesigns.h:44
#define GUIDesignComboBox
Definition GUIDesigns.h:295
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:430
#define GUIDesignLabelTickedIcon180x46
label ticked filled extended over frame used for VClasses/VShapes. (can be used by icons of 64x32 pix...
Definition GUIDesigns.h:278
#define GUIDesignLabelAboutInfoCenter
label extended over frame with thick and with text justify to center
Definition GUIDesigns.h:266
#define GUIDesignComboBoxFixed(customWidth)
comboBox with thick frame, fixed width
Definition GUIDesigns.h:307
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:92
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition GUIDesigns.h:365
#define GUIDesignAuxiliarVerticalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:439
#define GUIDesignComboBoxVisibleItems
Definition GUIDesigns.h:64
#define GUIDesignTextColorBlack
black color (for correct text)
Definition GUIDesigns.h:38
#define GUIDesignButtonFixed(width)
button rectangular with thick and raise frame with the given width
Definition GUIDesigns.h:115
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
Definition GUIDesigns.h:409
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
Definition GUIDesigns.h:254
FXString gCurrentFolder
The folder used as last.
@ VSHAPE_TAXI
Definition GUIIcons.h:673
@ VCLASS_TRAILER
Definition GUIIcons.h:601
@ VCLASS_PASSENGER
Definition GUIIcons.h:594
@ VSHAPE_PEDESTRIAN
Definition GUIIcons.h:664
@ VSHAPE_PASSENGER
Definition GUIIcons.h:668
@ VCLASS_BICYCLE
Definition GUIIcons.h:609
@ VCLASS_HOV
Definition GUIIcons.h:595
@ VCLASS_RAIL_FAST
Definition GUIIcons.h:606
@ VSHAPE_UNKNOWN
Definition GUIIcons.h:693
@ COLORWHEEL
Definition GUIIcons.h:189
@ VSHAPE_FIREBRIGADE
Definition GUIIcons.h:689
@ VSHAPE_EMERGENCY
Definition GUIIcons.h:688
@ VCLASS_AIRCRAFT
Definition GUIIcons.h:616
@ VSHAPE_PASSENGER_VAN
Definition GUIIcons.h:672
@ VSHAPE_PASSENGER_WAGON
Definition GUIIcons.h:671
@ VSHAPE_MOPED
Definition GUIIcons.h:666
@ VCLASS_CUSTOM2
Definition GUIIcons.h:621
@ VSHAPE_RAIL_CAR
Definition GUIIcons.h:683
@ VCLASS_ARMY
Definition GUIIcons.h:592
@ VCLASS_MOTORCYCLE
Definition GUIIcons.h:607
@ VSHAPE_SHIP
Definition GUIIcons.h:687
@ VCLASS_COACH
Definition GUIIcons.h:598
@ VCLASS_BUS
Definition GUIIcons.h:597
@ VCLASS_AUTHORITY
Definition GUIIcons.h:591
@ VCLASS_SCOOTER
Definition GUIIcons.h:618
@ VCLASS_TRUCK
Definition GUIIcons.h:600
@ VCLASS_MOPED
Definition GUIIcons.h:608
@ VSHAPE_E_VEHICLE
Definition GUIIcons.h:685
@ VCLASS_PEDESTRIAN
Definition GUIIcons.h:610
@ VCLASS_PRIVATE
Definition GUIIcons.h:589
@ VSHAPE_PASSENGER_HATCHBACK
Definition GUIIcons.h:670
@ VSHAPE_BUS
Definition GUIIcons.h:678
@ VSHAPE_TRUCK_1TRAILER
Definition GUIIcons.h:677
@ VCLASS_CABLE_CAR
Definition GUIIcons.h:614
@ VSHAPE_POLICE
Definition GUIIcons.h:690
@ VSHAPE_RAIL_CARGO
Definition GUIIcons.h:684
@ VCLASS_SUBWAY
Definition GUIIcons.h:615
@ VSHAPE_BICYCLE
Definition GUIIcons.h:665
@ VSHAPE_AIRCRAFT
Definition GUIIcons.h:694
@ VCLASS_CONTAINER
Definition GUIIcons.h:613
@ VSHAPE_ANT
Definition GUIIcons.h:686
@ VCLASS_CUSTOM1
Definition GUIIcons.h:620
@ VCLASS_TAXI
Definition GUIIcons.h:596
@ VSHAPE_BUS_TROLLEY
Definition GUIIcons.h:681
@ VSHAPE_DELIVERY
Definition GUIIcons.h:674
@ VSHAPE_PASSENGER_SEDAN
Definition GUIIcons.h:669
@ VSHAPE_BUS_FLEXIBLE
Definition GUIIcons.h:680
@ VCLASS_DELIVERY
Definition GUIIcons.h:599
@ VCLASS_VIP
Definition GUIIcons.h:593
@ VSHAPE_RICKSHAW
Definition GUIIcons.h:691
@ VSHAPE_MOTORCYCLE
Definition GUIIcons.h:667
@ VCLASS_DRONE
Definition GUIIcons.h:619
@ VCLASS_RAIL_ELECTRIC
Definition GUIIcons.h:605
@ VCLASS_IGNORING
Definition GUIIcons.h:588
@ VSHAPE_TRUCK
Definition GUIIcons.h:675
@ VCLASS_SHIP
Definition GUIIcons.h:612
@ VCLASS_WHEELCHAIR
Definition GUIIcons.h:617
@ VCLASS_EMERGENCY
Definition GUIIcons.h:590
@ VSHAPE_BUS_COACH
Definition GUIIcons.h:679
@ VCLASS_RAIL_URBAN
Definition GUIIcons.h:603
@ VCLASS_RAIL
Definition GUIIcons.h:604
@ VSHAPE_TRUCK_SEMITRAILER
Definition GUIIcons.h:676
@ VCLASS_TRAM
Definition GUIIcons.h:602
@ VCLASS_EVEHICLE
Definition GUIIcons.h:611
@ VSHAPE_SCOOTER
Definition GUIIcons.h:692
@ VSHAPE_RAIL
Definition GUIIcons.h:682
#define TL(string)
Definition MsgHandler.h:304
#define TLF(string,...)
Definition MsgHandler.h:306
const std::string invalid_return< std::string >::value
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SUMOVehicleShape::UNKNOWN, false)
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)
@ 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_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_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_CF_WIEDEMANN_ESTIMATION
@ SUMO_ATTR_LCA_SPEEDGAINRIGHT
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:49
double getParameter(const int index) const
Returns the nth parameter of this distribution.
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
void openDialog(FXWindow *focusableElement=nullptr)
GNETemplateElementDialog(GNEDemandElement *element, DialogType type)
class used for represent rows with Car Following Model parameters
CarFollowingModelRow(CarFollowingModelParameters *carFollowingModelParametersParent, FXVerticalFrame *verticalFrame, SumoXMLAttr attr)
constructor
CarFollowingModelParameters * myCarFollowingModelParametersParent
pointer to CarFollowingModelParameters parent
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.
GNEVehicleTypeDialog * myVehicleTypeDialog
pointer to Vehicle Type dialog parent
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.
VClassRow(VTypeAttributes *VTypeAttributesParent, FXVerticalFrame *column)
constructor
FXLabel * myComboBoxVClassLabelImage
label with image of VClass
VTypeAttributes * myVTypeAttributesParent
pointer to VTypeAttributes parent
MFXComboBoxIcon * myComboBoxVClass
MFXComboBoxIcon for VClass.
VTypeAttributes * myVTypeAttributesParent
pointer to VTypeAttributes parent
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.
Parameterised::Map myParameters
pointer to current parameter map
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
VTypeAttributes * myVTypeAttributesParent
pointer to VTypeAttributeParameters parent
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 * myLCASpeedgainParam
VTypeAttributeRow for speed gain param.
VTypeAttributeRow * myLaneChangeModel
VTypeAttributeRow for LaneChangeModel.
VTypeAttributeRow * myJMSigmaMinor
VTypeAttributeRow for Sigma Minor.
VTypeAttributeRow * myJMCrossingGap
VTypeAttributeRow for Crossing Gap.
VTypeAttributeRow * myLCAKeeprightParam
VTypeAttributeRow for keep right param.
VTypeAttributeRow * myLCAAccelLat
VTypeAttributeRow for accel lat.
VTypeAttributeRow * myContainerCapacity
VTypeAttributeRow for ContainerCapacity.
VTypeAttributeRow * myMaxSpeed
VTypeAttributeRow for MaxSpeed.
VTypeAttributeRow * myJMIgnoreFoeSpeed
VTypeAttributeRow for Ignore FOE Speed.
void buildAttributesA(FXVerticalFrame *column)
build common attributes (A)
VTypeAttributeRow * myFilename
VTypeAttributeRow for Filename.
VTypeAttributeRow * myMinGap
VTypeAttributeRow for MinGap.
VTypeAttributeRow * myOSGFile
VTypeAttributeRow for OSG.
VTypeAttributeRow * myJMDriveAfterYellowTime
VTypeAttributeRow for Drive After Yellow Time.
VTypeAttributeRow * myMaxSpeedLat
VTypeAttributeRow for MaxSpeedLat.
VTypeAttributeRow * myParameters
VTypeAttributeRow for parameters.
void buildJunctionModelAttributesA(FXVerticalFrame *column)
build JunctionModel attributes (A)
VTypeAttributeRow * myLCAOvertakeRight
VTypeAttributeRow for overtake right.
VTypeAttributeRow * myLCATimeToImpatience
VTypeAttributeRow for time to impatience.
VTypeAttributeRow * myJMTimeGapMinor
VTypeAttributeRow for Time GAP Minor.
VTypeAttributeRow * myLCAKeepRightAcceptanceTime
VTypeAttributeRow for keep right acceptance time.
VTypeAttributeRow * myEmissionClass
VTypeAttributeRow for EmissionClass.
VTypeAttributeRow * myLCAMaxSpeedLatStanding
VTypeAttributeRow for max speed lat standing.
VTypeAttributeRow * myJMDriveAfterRedTime
VTypeAttributeRow for Drive After Red Time.
VTypeAttributeRow * myJMIgnoreFoeProb
VTypeAttributeRow for Ignore FOE Probability.
VTypeAttributeRow * myMinGapLat
VTypeAttributeRow for MinGapLat.
VTypeAttributeRow * myLCAStrategicParam
VTypeAttributeRow for strategic param.
VTypeAttributeRow * myProbability
VTypeAttributeRow for Probability.
VTypeAttributeRow * myJMDriveRedSpeed
VTypeAttributeRow for Drive Red Speed.
VTypeAttributeRow * myLCAOvertakeDeltaSpeedFactor
VTypeAttributeRow for overtake deltaspeed factor.
FXTextField * myTextFieldVehicleTypeID
FXTextfield for vehicleTypeID.
VTypeAttributeRow * myLCAMaxSpeedLatFactor
VTypeAttributeRow for max speed lat factor.
VClassRow * myVClassRow
vehicle class row
VTypeAttributeRow * myLCAAssertive
VTypeAttributeRow for assertive.
VTypeAttributeRow * myJMImpatience
VTypeAttributeRow for Impatience.
VTypeAttributeRow * mySpeedFactor
VTypeAttributeRow for SpeedFactor.
long onCmdOpenAttributeDialog(FXObject *obj, FXSelector, void *)
@event called after press a button dialog
VTypeAttributeRow * myLCAPushy
VTypeAttributeRow for pushy.
void buildJunctionModelAttributesB(FXVerticalFrame *column)
build JunctionModel attributes (B)
void buildAttributesB(FXVerticalFrame *column)
build common attributes (B)
VTypeAttributeRow * myActionStepLength
VTypeAttributeRow for ActionStepLength.
VTypeAttributeRow * myLCAOppositeParam
VTypeAttributeRow for opposite param.
long onCmdSetAttribute(FXObject *, FXSelector, void *)
VTypeAttributeRow * myLoadingDuration
VTypeAttributeRow for LoadingDuration.
VShapeRow * myVShapeRow
vehicle shape row
VTypeAttributeRow * myLCACooperativeParam
VTypeAttributeRow for cooperative param.
VTypeAttributeRow * myWidth
VTypeAttributeRow for Width.
VTypeAttributeRow * myJMIgnoreKeepclearTime
VTypeAttributeRow for Ignore Keep Clear Time.
VTypeAttributeRow * myLCAPushygap
VTypeAttributeRow for pushy gap.
VTypeAttributeRow * myPersonCapacity
VTypeAttributeRow for PersonCapacity.
VTypeAttributeRow * myColor
VTypeAttributeRow for color.
VTypeAttributeRow * myLCALookAheadLeft
VTypeAttributeRow for look ahead left.
VTypeAttributeRow * myLCAImpatience
VTypeAttributeRow for impatience.
VTypeAttributeRow * myLatAlignment
VTypeAttributeRow for LatAlignment.
VTypeAttributeRow * myLCATurnAlignmentDistance
VTypeAttributeRow for turn alignment distance.
VTypeAttributeRow * myLCASpeedGainRight
VTypeAttributeRow for speed gain right.
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
VTypeAttributeRow * myLCASublaneParam
VTypeAttributeRow for sublane param.
VTypeAttributeRow * myBoardingDuration
VTypeAttributeRow for BoardingDuration.
VTypeAttributes(GNEVehicleTypeDialog *vehicleTypeDialog, FXHorizontalFrame *column)
constructor
VTypeAttributeRow * myLength
VTypeAttributeRow for Length.
void runInternalTest(const InternalTestStep::DialogArgument *dialogArgument)
run internal test
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.
long onCmdAccept(FXObject *, FXSelector, void *)
event after press accept button
GNEVehicleTypeDialog(GNEDemandElement *vehicleType)
constructor
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.
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
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
dialog arguments, used for certain modal dialogs that can not be edited using tab
static const RGBColor BLACK
Definition RGBColor.h:200
static std::vector< std::string > getLatAlignmentStrings()
return all valid strings for latAlignment
static StringBijection< SumoXMLTag > CarFollowModels
car following models
static StringBijection< OSGFileExtension > OSGFileExtensions
OSG file Extensions.
static StringBijection< ImageFileExtension > ImageFileExtensions
image file extensions
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
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
struct for default values that depend of VClass
int personCapacity
The person capacity of the vehicle.
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