62 myVTypeAtributesParent(VTypeAtributesParent) {
70 myComboBoxVClassLabelImage->setBackColor(FXRGBA(255, 255, 255, 255));
72 for (
const auto& vClass : myVTypeAtributesParent->myVehicleTypeDialog->getEditedDemandElement()->getTagProperty().getAttributeProperties(
SUMO_ATTR_VCLASS).getDiscreteValues()) {
76 if (myComboBoxVClass->getNumItems() > 10) {
77 myComboBoxVClass->setNumVisible(10);
79 myComboBoxVClass->setNumVisible(myComboBoxVClass->getNumItems());
157 const auto vClass = myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(
SUMO_ATTR_VCLASS);
159 for (
int i = 0; i < myComboBoxVClass->getNumItems(); i++) {
160 if (myComboBoxVClass->getItem(i).text() == vClass) {
164 myComboBoxVClass->setCurrentItem(index);
165 setVClassLabelImage();
166 return myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getVClass();
173 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(
SUMO_ATTR_VCLASS).empty()) {
177 switch (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getVClass()) {
269 myVTypeAtributesParent(VTypeAtributesParent) {
280 for (
const auto& VShapeString : VShapeStrings) {
293 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(
SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text())) {
294 myComboBoxShape->setTextColor(FXRGB(0, 0, 0));
295 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(
SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text(),
296 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
297 setVShapeLabelImage();
299 myComboBoxShape->setTextColor(FXRGB(255, 0, 0));
300 myVTypeAtributesParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
308 myComboBoxShape->setText(myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(
SUMO_ATTR_GUISHAPE).c_str());
309 setVShapeLabelImage();
318 myComboBoxShape->setTextColor(FXRGB(0, 0, 0));
319 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(
SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text(),
320 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
321 setVShapeLabelImage();
431 myVTypeAtributesParent(VTypeAtributesParent),
433 myRowAttrType(rowAttrType),
435 myTextField(nullptr),
436 myComboBox(nullptr) {
451 for (
const auto& value : values) {
468 if (myRowAttrType == ROWTYPE_COMBOBOX) {
470 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myComboBox->getText().text())) {
471 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myComboBox->getText().text(),
472 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
476 myComboBox->setTextColor(FXRGB(255, 0, 0));
478 myVTypeAtributesParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
479 myVTypeAtributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
481 }
else if (myRowAttrType == ROWTYPE_COLOR) {
483 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(
SUMO_ATTR_COLOR, myTextField->getText().text())) {
485 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(
SUMO_ATTR_COLOR) != myTextField->getText().text()) {
486 myTextField->setTextColor(FXRGB(0, 0, 0));
488 myTextField->setTextColor(FXRGB(195, 195, 195));
490 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(
SUMO_ATTR_COLOR, myTextField->getText().text(), myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
492 myTextField->setTextColor(FXRGB(255, 0, 0));
493 myVTypeAtributesParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
494 myVTypeAtributesParent->myVehicleTypeDialog->myInvalidAttr =
SUMO_ATTR_COLOR;
498 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myTextField->getText().text())) {
499 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myTextField->getText().text(),
500 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
504 myTextField->setTextColor(FXRGB(255, 0, 0));
506 myVTypeAtributesParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
507 myVTypeAtributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
517 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myComboBox->getText().text())) {
518 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myComboBox->getText().text(),
519 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
521 updateValue(defaultValue);
523 myComboBox->setTextColor(FXRGB(255, 0, 0));
525 myVTypeAtributesParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
526 myVTypeAtributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
530 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myTextField->getText().text())) {
531 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myTextField->getText().text(),
532 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
534 updateValue(defaultValue);
536 myTextField->setTextColor(FXRGB(255, 0, 0));
538 myVTypeAtributesParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
539 myVTypeAtributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
547 if (myRowAttrType == ROWTYPE_COMBOBOX) {
549 myComboBox->setText(myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
551 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myComboBox->getText().text()) {
552 myComboBox->setTextColor(FXRGB(0, 0, 0));
554 myComboBox->setTextColor(FXRGB(195, 195, 195));
556 }
else if (myRowAttrType == ROWTYPE_COLOR) {
558 myTextField->setText(myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
560 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myTextField->getText().text()) {
561 myTextField->setTextColor(FXRGB(0, 0, 0));
563 myTextField->setTextColor(FXRGB(195, 195, 195));
567 const std::string& parametersStr = myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr);
569 myTextField->setText(parametersStr.c_str());
571 myTextField->setTextColor(FXRGB(0, 0, 0));
580 if (keyValue.size() == 2) {
586 myTextField->setText(myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
588 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myTextField->getText().text()) {
589 myTextField->setTextColor(FXRGB(0, 0, 0));
591 myTextField->setTextColor(FXRGB(195, 195, 195));
601 myComboBox->setText(myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
603 if (defaultValue != myComboBox->getText().text()) {
604 myComboBox->setTextColor(FXRGB(0, 0, 0));
606 myComboBox->setTextColor(FXRGB(195, 195, 195));
610 myTextField->setText(myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
612 if (defaultValue != myTextField->getText().text()) {
613 myTextField->setTextColor(FXRGB(0, 0, 0));
615 myTextField->setTextColor(FXRGB(195, 195, 195));
630 FXColorDialog colordialog(
this, tr(
"Color Dialog"));
631 colordialog.setTarget(
this);
633 if (GNEAttributeCarrier::canParse<RGBColor>(myTextField->getText().text())) {
634 colordialog.setRGBA(
MFXUtils::getFXColor(GNEAttributeCarrier::parse<RGBColor>(myTextField->getText().text())));
639 if (colordialog.execute()) {
641 myTextField->setText(newValue.c_str());
642 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, newValue)) {
643 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, newValue, myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
645 myTextField->setTextColor(FXRGB(0, 0, 0));
646 myTextField->killFocus();
655 FXFileDialog opendialog(
this,
TL(
"Open Image"));
657 opendialog.setSelectMode(SELECTFILE_EXISTING);
658 opendialog.setPatternList(
"All files (*)");
662 if (opendialog.execute()) {
666 std::string imagePath = opendialog.getFilename().text();
668 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, imagePath)) {
669 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, imagePath, myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
670 myTextField->setText(imagePath.c_str());
672 myTextField->setTextColor(FXRGB(0, 0, 0));
673 myTextField->killFocus();
682 FXFileDialog opendialog(
this,
TL(
"Open OSG File"));
684 opendialog.setSelectMode(SELECTFILE_EXISTING);
685 opendialog.setPatternList(
"OSG file (*.obj)");
689 if (opendialog.execute()) {
693 std::string imagePath = opendialog.getFilename().text();
695 if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, imagePath)) {
696 myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, imagePath, myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
697 myTextField->setText(imagePath.c_str());
699 myTextField->setTextColor(FXRGB(0, 0, 0));
700 myTextField->killFocus();
708 return myTextField->getText().text();
712std::vector<std::pair<std::string, std::string> >
714 std::vector<std::pair<std::string, std::string> > result;
717 result.push_back(std::make_pair(parameter.first, parameter.second));
730 for (
const auto& parameter : parameters) {
732 result += parameter.first +
"=" + parameter.second +
"|";
737 if (!result.empty()) {
741 myTextField->setText(result.c_str());
750 return "crossingGap";
752 return "driveAfterYellowTime";
754 return "driveAfterRedTime";
756 return "driveRedSpeed";
758 return "ignoreKeepClearTime";
760 return "ignoreFoeSpeed";
762 return "ignoreFoeProb";
766 return "timegapMinor";
771 return "cooperative";
789 return "timeToImpatience";
793 return "lookaheadLeft";
795 return "speedGainRight";
797 return "maxSpeedLatStanding";
799 return "maxSpeedLatFactor";
801 return "turnAlignDistance";
803 return "overtakeRight";
805 return "keepRightAcceptanceTime";
807 return "overtakeDeltaSpeedFactor";
827 FXGroupBox* commonAttributes =
new FXGroupBox(firstAuxiliarVerticalFrame,
"Vehicle Type attributes",
GUIDesignGroupBoxFrame);
835 FXGroupBox* JMAttributes =
new FXGroupBox(firstAuxiliarVerticalFrame,
"Junction Model attributes",
GUIDesignGroupBoxFrame);
843 FXGroupBox* LCMAttributes =
new FXGroupBox(firstAuxiliarHorizontalFrame,
"Lane Change Model attributes",
GUIDesignGroupBoxFrame);
852 myVClassRow =
new VClassRow(
this, column);
900 myVShapeRow =
new VShapeRow(
this, column);
1051 myTextFieldVehicleTypeID->setText(myVehicleTypeDialog->myEditedDemandElement->getAttribute(
SUMO_ATTR_ID).c_str());
1054 myVShapeRow->updateValues();
1056 myLaneChangeModel->updateValue();
1058 myColor->updateValue();
1065 myWidth->updateValue(
toString(defaultVTypeParameters.
width));
1067 myFilename->updateValue();
1073 myBoardingDuration->updateValue();
1074 myLoadingDuration->updateValue();
1075 myMinGapLat->updateValue();
1076 myMaxSpeedLat->updateValue();
1077 myActionStepLength->updateValue();
1078 myProbability->updateValue();
1079 myCarriageGap->updateValue();
1081 myJMCrossingGap->updateValue();
1082 myJMIgnoreKeepclearTime->updateValue();
1083 myJMDriveAfterYellowTime->updateValue();
1084 myJMDriveAfterRedTime->updateValue();
1085 myJMDriveRedSpeed->updateValue();
1086 myJMIgnoreFoeProb->updateValue();
1087 myJMIgnoreFoeSpeed->updateValue();
1088 myJMSigmaMinor->updateValue();
1089 myJMTimeGapMinor->updateValue();
1090 myJMImpatience->updateValue();
1092 myLCAStrategicParam->updateValue();
1093 myLCACooperativeParam->updateValue();
1094 myLCASpeedgainParam->updateValue();
1095 myLCAKeeprightParam->updateValue();
1096 myLCASublaneParam->updateValue();
1097 myLCAOppositeParam->updateValue();
1098 myLCAPushy->updateValue();
1099 myLCAPushygap->updateValue();
1100 myLCAAssertive->updateValue();
1101 myLCAImpatience->updateValue();
1102 myLCATimeToImpatience->updateValue();
1103 myLCAAccelLat->updateValue();
1104 myLCALookAheadLeft->updateValue();
1105 myLCASpeedGainRight->updateValue();
1106 myLCAMaxSpeedLatStanding->updateValue();
1107 myLCAMaxSpeedLatFactor->updateValue();
1108 myLCATurnAlignmentDistance->updateValue();
1109 myLCAOvertakeRight->updateValue();
1110 myLCAKeepRightAcceptanceTime->updateValue();
1111 myLCAOvertakeDeltaSpeedFactor->updateValue();
1114 myParameters->updateValue();
1121 myVehicleTypeDialog->myVehicleTypeValid =
true;
1124 if (myVehicleTypeDialog->myEditedDemandElement->isValid(
SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text())) {
1125 myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0));
1126 myVehicleTypeDialog->myEditedDemandElement->setAttribute(
SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
1127 }
else if (myVehicleTypeDialog->myEditedDemandElement->getAttribute(
SUMO_ATTR_ID) == myTextFieldVehicleTypeID->getText().text()) {
1128 myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0));
1129 myVehicleTypeDialog->myEditedDemandElement->setAttribute(
SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
1131 myTextFieldVehicleTypeID->setTextColor(FXRGB(255, 0, 0));
1132 myVehicleTypeDialog->myVehicleTypeValid =
false;
1138 myVShapeRow->setVariable();
1140 myColor->setVariable();
1147 myWidth->setVariable(
toString(defaultVTypeParameters.
width));
1151 myLaneChangeModel->setVariable();
1158 myWidth->setVariable(
toString(defaultVTypeParameters.
width));
1160 myFilename->setVariable();
1166 myBoardingDuration->setVariable();
1167 myLoadingDuration->setVariable();
1168 myMinGapLat->setVariable();
1169 myMaxSpeedLat->setVariable();
1170 myActionStepLength->setVariable();
1171 myProbability->setVariable();
1172 myCarriageGap->setVariable();
1174 myJMCrossingGap->setVariable();
1175 myJMIgnoreKeepclearTime->setVariable();
1176 myJMDriveAfterYellowTime->setVariable();
1177 myJMDriveAfterRedTime->setVariable();
1178 myJMDriveRedSpeed->setVariable();
1179 myJMIgnoreFoeProb->setVariable();
1180 myJMIgnoreFoeSpeed->setVariable();
1181 myJMSigmaMinor->setVariable();
1182 myJMTimeGapMinor->setVariable();
1183 myJMImpatience->setVariable();
1185 myLCAStrategicParam->setVariable();
1186 myLCACooperativeParam->setVariable();
1187 myLCASpeedgainParam->setVariable();
1188 myLCAKeeprightParam->setVariable();
1189 myLCASublaneParam->setVariable();
1190 myLCAOppositeParam->setVariable();
1191 myLCAPushy->setVariable();
1192 myLCAPushygap->setVariable();
1193 myLCAAssertive->setVariable();
1194 myLCAImpatience->setVariable();
1195 myLCATimeToImpatience->setVariable();
1196 myLCAAccelLat->setVariable();
1197 myLCALookAheadLeft->setVariable();
1198 myLCASpeedGainRight->setVariable();
1199 myLCAMaxSpeedLatStanding->setVariable();
1200 myLCAMaxSpeedLatFactor->setVariable();
1201 myLCATurnAlignmentDistance->setVariable();
1202 myLCAOvertakeRight->setVariable();
1203 myLCAKeepRightAcceptanceTime->setVariable();
1204 myLCAOvertakeDeltaSpeedFactor->setVariable();
1206 myParameters->setVariable();
1214 if (obj == myColor->getButton()) {
1215 myColor->openColorDialog();
1216 }
else if (obj == myFilename->getButton()) {
1217 myFilename->openImageFileDialog();
1218 }
else if (obj == myOSGFile->getButton()) {
1219 myFilename->openOSGFileDialog();
1230 if (
GNESingleParametersDialog(myParameters, myVehicleTypeDialog->getEditedDemandElement()->getNet()->getViewNet()).execute()) {
1234 myVehicleTypeDialog->getEditedDemandElement()->setAttribute(
GNE_ATTR_PARAMETERS, myParameters->getParametersStr(), myVehicleTypeDialog->getEditedDemandElement()->getNet()->getViewNet()->getUndoList());
1248 myVehicleTypeDialog(vehicleTypeDialog) {
1260 for (
const auto& CFModel : CFModels) {
1429 for (
const auto& row : myRows) {
1433 myLabelIncompleteAttribute->hide();
1444 myApparentDecelRow->show();
1445 myEmergencyDecelRow->show();
1461 myEmergencyDecelRow->show();
1463 myMinGapFactorRow->show();
1474 myEmergencyDecelRow->show();
1476 myMinGapFactorRow->show();
1477 myTrauLastRow->show();
1484 myEmergencyDecelRow->show();
1486 mySteppingRow->show();
1487 myMinGapFactorRow->show();
1493 myEmergencyDecelRow->show();
1495 mySteppingRow->show();
1496 myMinGapFactorRow->show();
1497 myAdaptFactorRow->show();
1498 myAdaptTimeRow->show();
1504 myEmergencyDecelRow->show();
1506 mySteppingRow->show();
1507 myMinGapFactorRow->show();
1508 myTpreviewRow->show();
1509 myTreactionRow->show();
1510 myTPersDriveRow->show();
1511 myTPersEstimateRow->show();
1512 myCcoolnessRow->show();
1513 mySigmaleaderRow->show();
1514 mySigmagapRow->show();
1515 mySigmaerrorRow->show();
1516 myJerkmaxRow->show();
1517 myEpsilonaccRow->show();
1518 myTaccmaxRow->show();
1519 myMflatnessRow->show();
1520 myMbeginRow->show();
1521 myUseVehDynamicsRow->show();
1522 myMaxVehPreviewRow->show();
1528 myEmergencyDecelRow->show();
1531 myMinGapFactorRow->show();
1537 myEmergencyDecelRow->show();
1538 myMinGapFactorRow->show();
1539 mySecurityRow->show();
1540 myEstimationRow->show();
1544 myTrainTypeRow->show();
1550 myEmergencyDecelRow->show();
1551 myMinGapFactorRow->show();
1553 myLabelIncompleteAttribute->show();
1569 myEmergencyDecelRow->show();
1570 myMinGapFactorRow->show();
1572 myLabelIncompleteAttribute->show();
1595 myLabelIncompleteAttribute->show();
1622 myVerticalFrameRows->recalc();
1631 myComboBoxCarFollowModel->setCurrentItem(0);
1633 myComboBoxCarFollowModel->setText(myVehicleTypeDialog->myEditedDemandElement->getAttribute(
SUMO_ATTR_CAR_FOLLOW_MODEL).c_str());
1638 for (
const auto& row : myRows) {
1647 myVehicleTypeDialog->myVehicleTypeValid =
true;
1650 if (myVehicleTypeDialog->myEditedDemandElement->isValid(
SUMO_ATTR_CAR_FOLLOW_MODEL, myComboBoxCarFollowModel->getText().text())) {
1651 myComboBoxCarFollowModel->setTextColor(FXRGB(0, 0, 0));
1652 myVehicleTypeDialog->myEditedDemandElement->setAttribute(
SUMO_ATTR_CAR_FOLLOW_MODEL, myComboBoxCarFollowModel->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
1654 myComboBoxCarFollowModel->setTextColor(FXRGB(255, 0, 0));
1655 myVehicleTypeDialog->myVehicleTypeValid =
false;
1659 for (
const auto& row : myRows) {
1714 WRITE_DEBUG(
"Opening FXMessageBox of type 'warning'");
1719 FXMessageBox::warning(getApp(), MBOX_OK,
1720 (
"Error " + operation1 +
" " + tagString).c_str(),
"%s",
1721 (tagString +
" cannot be " + operation2 +
1723 " is invalid.").c_str());
1725 WRITE_DEBUG(
"Closed FXMessageBox of type 'warning' with 'OK'");
1731 getApp()->stopModal(
this, TRUE);
1742 getApp()->stopModal(
this, FALSE);
1764 myCarFollowingModelParametersParent(carFollowingModelParametersParent),
1766 myTextField(nullptr) {
1775 if (myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myTextField->getText().text())) {
1777 if (myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myTextField->getText().text()) {
1778 myTextField->setTextColor(FXRGB(0, 0, 0));
1780 myTextField->setTextColor(FXRGB(195, 195, 195));
1782 myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myTextField->getText().text(),
1783 myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
1787 myTextField->setTextColor(FXRGB(255, 0, 0));
1789 myCarFollowingModelParametersParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
1790 myCarFollowingModelParametersParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
1798 myTextField->setText(myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
1800 if (myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myTextField->getText().text()) {
1801 myTextField->setTextColor(FXRGB(0, 0, 0));
1803 myTextField->setTextColor(FXRGB(195, 195, 195));
FXDEFMAP(GNEVehicleTypeDialog::VTypeAtributes) VTypeAtributesMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_OPEN_PARAMETERS_DIALOG
open parameters dialog
@ MID_GNE_SET_ATTRIBUTE_DIALOG
attribute edited trough dialog
#define GUIDesignComboBox
#define GUIDesignComboBoxWidth180
comboBox with thick frame, width 180
#define GUIDesignComboBoxNCol
number of column of every combo box
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignTextFielWidth180
text field with thick frame, width of 180 (Used in type frame)
#define GUIDesignLabelTickedIcon180x46
label ticked filled extended over frame used for VClasses/VShapes. (can be used by icons of 64x32 pix...
#define GUIDesignLabelAboutInfoCenter
label extended over frame with thick and with text justify to center
#define GUIDesignTextFieldNCol
Num of column of text field.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
#define GUIDesignAuxiliarVerticalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignButtonRectangular150
button rectangular with thick and raise frame with a width of 150
#define GUIDesignLabelAttribute150
label extended over the matrix column with thick frame
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions
FXString gCurrentFolder
The folder used as last.
@ VSHAPE_PASSENGER_HATCHBACK
@ VSHAPE_TRUCK_SEMITRAILER
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)
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_HOV
vehicle is a HOV
@ SVC_TRUCK
vehicle is a large transport vehicle
@ SVC_CUSTOM2
is a user-defined type
@ SVC_RAIL
vehicle is a not electrified rail
@ SVC_COACH
vehicle is a coach
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ 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_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_PEDESTRIAN
pedestrian
@ RICKSHAW
render as a rickshaw
@ RAIL_CARGO
render as a cargo train
@ EMERGENCY
render as an emergency vehicle
@ 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
@ 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
@ FIREBRIGADE
render as a fire brigade
@ PASSENGER_HATCHBACK
render as a hatchback passenger vehicle ("Fliessheck")
@ 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
@ SUMO_TAG_CF_KRAUSS_PLUS_SLOPE
@ SUMO_TAG_CF_PWAGNER2009
@ SUMO_TAG_CF_KRAUSS_ORIG1
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_CF_EIDM_T_ACC_MAX
@ SUMO_ATTR_CF_EIDM_EPSILON_ACC
@ 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_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_LOOKAHEADLEFT
@ SUMO_ATTR_APPARENTDECEL
@ SUMO_ATTR_LCA_SPEEDGAIN_PARAM
@ SUMO_ATTR_ACTIONSTEPLENGTH
@ SUMO_ATTR_LCA_IMPATIENCE
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME
@ SUMO_ATTR_LOADING_DURATION
@ 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_LCA_MAXSPEEDLATSTANDING
@ SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME
@ SUMO_ATTR_LCA_KEEPRIGHT_PARAM
@ 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_EMERGENCYDECEL
@ SUMO_ATTR_LCA_OVERTAKE_DELTASPEED_FACTOR
@ SUMO_ATTR_LCA_SUBLANE_PARAM
@ SUMO_ATTR_JM_CROSSING_GAP
@ SUMO_ATTR_CARRIAGE_LENGTH
@ SUMO_ATTR_CF_IDM_STEPPING
@ SUMO_ATTR_CF_IDMM_ADAPT_FACTOR
@ SUMO_ATTR_COLLISION_MINGAP_FACTOR
@ SUMO_ATTR_BOARDING_DURATION
@ SUMO_ATTR_CF_EIDM_M_FLATNESS
@ SUMO_ATTR_JM_SIGMA_MINOR
@ SUMO_ATTR_CF_EIDM_M_BEGIN
@ SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE
@ SUMO_ATTR_CF_EIDM_SIG_LEADER
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_CF_PWAGNER2009_APPROB
@ SUMO_ATTR_LCA_OVERTAKE_RIGHT
@ SUMO_ATTR_LCA_ACCEL_LAT
@ SUMO_ATTR_LCA_STRATEGIC_PARAM
@ SUMO_ATTR_PERSON_CAPACITY
@ SUMO_ATTR_LCA_KEEPRIGHT_ACCEPTANCE_TIME
@ SUMO_ATTR_LOCOMOTIVE_LENGTH
@ SUMO_ATTR_NOTHING
invalid attribute
@ 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)
std::vector< double > & getParameter()
Returns the parameters of this distribution.
static FXIcon * getVClassIcon(const SUMOVehicleClass vc)
returns icon associated to the given vClass
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.
An Element which don't belong to GNENet but has influence in the simulation.
virtual SUMOVehicleClass getVClass() const =0
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
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
FXTextField * myTextField
text field
void setVariable()
set Variable in VehicleType
CarFollowingModelRow(CarFollowingModelParameters *carFollowingModelParametersParent, FXVerticalFrame *verticalFrame, SumoXMLAttr attr)
constructor
void updateValue()
update value of Vehicle Type
class for CarFollowingModel
CarFollowingModelRow * myPhiRow
Row for MinGap (only for Kerner)
CarFollowingModelRow * myTpreviewRow
Row for Look ahead/preview Time.
CarFollowingModelRow * mySteppingRow
Row for MinGap(only for IDM)
CarFollowingModelRow * myMflatnessRow
Row for Startup M flatness.
CarFollowingModelRow * myTmp4Row
Row for TMP4.
CarFollowingModelRow * myTmp1Row
Row for TMP1.
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 * myTmp5Row
Row for TMP5.
CarFollowingModelRow * myAccelRow
Row for Accel.
CarFollowingModelRow * myEpsilonaccRow
Row for AP Driver Update threshold.
CarFollowingModelRow * myAprobRow
Row for Aprob.
CarFollowingModelRow * myKRow
Row for MinGap (only for Kerner)
CarFollowingModelRow * myTPersDriveRow
Row for Wiener Process Driving Error.
long onCmdSetVariable(FXObject *, FXSelector, void *)
void updateValues()
update values
CarFollowingModelRow * myTmp3Row
Row for TMP3.
CarFollowingModelRow * myMaxVehPreviewRow
Row for Using vehicle preview.
CarFollowingModelRow * myAdaptFactorRow
Row for Adapt Factor.
CarFollowingModelRow * myTmp2Row
Row for TMP2.
CarFollowingModelRow * myTauRow
Row for Tau.
CarFollowingModelRow * myTPersEstimateRow
Row for Wiener Process Estimation Error.
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.
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.
MFXIconComboBox * myComboBoxCarFollowModel
Row for CarFollowModel.
CarFollowingModelRow * myMinGapFactorRow
Row for MinGapFactor.
SUMOVehicleClass updateValue()
update values
VTypeAtributes * myVTypeAtributesParent
pointer to VTypeAtributes parent
MFXIconComboBox * myComboBoxVClass
FXComboBox for VClass.
SUMOVehicleClass setVariable()
set vehicle class
void setVClassLabelImage()
set VClass texture
void setVariable()
set variables
void updateValues()
update values
VShapeRow(VTypeAtributes *VTypeAtributesParent, FXVerticalFrame *column)
constructor
FXLabel * myComboBoxShapeLabelImage
label with image of Shape
MFXIconComboBox * myComboBoxShape
FXComboBox for Shape.
void updateValue(SUMOVehicleClass vClass)
update value
void setVShapeLabelImage()
set VShape texture
class used for represent rows with Vehicle Type parameters
MFXIconComboBox * myComboBox
ComboBox for attributes with limited values.
void openImageFileDialog()
open image file dialog
std::string getParametersStr() const
get parameters as string
void openColorDialog()
open color dialog
const FXButton * getButton() const
get button
void updateValue()
update value of Vehicle Type (using default value obtained from GNEAttributeCarrier)
void setParameters(const std::vector< std::pair< std::string, std::string > > ¶meters)
set parameters
std::vector< std::pair< std::string, std::string > > getParametersVectorStr() const
get parameters as vector of strings
FXTextField * myTextField
text field
FXButton * myButton
button
FXString filterAttributeName(const SumoXMLAttr attr) const
filter attribute name
void setVariable()
set Variable in VehicleType (using default value obtained from GNEAttributeCarrier)
VTypeAttributeRow(VTypeAtributes *VTypeAtributesParent, FXVerticalFrame *verticalFrame, const SumoXMLAttr attr, const RowAttrType rowAttrType, const std::vector< std::string > &values={})
constructor
RowAttrType
Attribute type.
void openOSGFileDialog()
open OSG file dialog
VTypeAttributeRow * myContainerCapacity
VTypeAttributeRow for ContainerCapacity.
void updateValues()
update values
VTypeAttributeRow * myHeight
VTypeAttributeRow for Height.
VTypeAttributeRow * myLocomotiveLength
VTypeAttributeRow for locomotive length.
void buildJunctionModelAttributesB(FXVerticalFrame *column)
build JunctionModel attributes (B)
GNEVehicleTypeDialog * myVehicleTypeDialog
VTypeAttributeRow for experimental.
long onCmdSetAttribute(FXObject *, FXSelector, void *)
VTypeAttributeRow * myLength
VTypeAttributeRow for Length.
VTypeAttributeRow * myParameters
VTypeAttributeRow for parameters.
VTypeAttributeRow * myCarriageLength
VTypeAttributeRow for carriage length.
VTypeAttributeRow * myDesiredMaxSpeed
VTypeAttributeRow for desired max speed.
long onCmdOpenAttributeDialog(FXObject *obj, FXSelector, void *)
@event called after press a button dialog
VTypeAttributeRow * myMinGap
VTypeAttributeRow for MinGap.
VTypeAttributeRow * myPersonCapacity
VTypeAttributeRow for PersonCapacity.
VTypeAttributeRow * myEmissionClass
VTypeAttributeRow for EmissionClass.
void buildAttributesB(FXVerticalFrame *column)
build commmon attributes (B)
void buildLaneChangeModelAttributes(FXVerticalFrame *column)
build LaneChangeModel attributes
VTypeAttributeRow * myOSGFile
VTypeAttributeRow for OSG.
void buildAttributesA(FXVerticalFrame *column)
build commmon attributes (A)
VTypeAttributeRow * myMaxSpeed
VTypeAttributeRow for MaxSpeed.
VTypeAtributes(GNEVehicleTypeDialog *vehicleTypeDialog, FXHorizontalFrame *column)
constructor
VTypeAttributeRow * mySpeedFactor
VTypeAttributeRow for SpeedFactor.
VTypeAttributeRow * myWidth
VTypeAttributeRow for Width.
long onCmdOpenParametersEditor(FXObject *obj, FXSelector, void *)
@event called after press a button dialog
void buildJunctionModelAttributesA(FXVerticalFrame *column)
build JunctionModel attributes (A)
VShapeRow * myVShapeRow
vehicle shape row
Dialog for editing calibrator vehicle types.
~GNEVehicleTypeDialog()
destructor
VTypeAtributes * myVTypeAtributes
Vehicle Type Common Attributes.
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
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 FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXString getText() const
Get the text.
void setTextColor(FXColor clr)
Change text color.
FXint getNumItems() const
Return the number of items in the list.
void setNumVisible(FXint nvis)
Set the number of visible items in the drop down list.
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
static const std::vector< std::string > & getAllClassesStr()
Get all SUMOEmissionClass in string format.
static const RGBColor BLACK
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
auto get(const nlohmann::detail::iteration_proxy_value< IteratorType > &i) -> decltype(i.key())
struct for default values that depend of VClass
double height
This class' height.
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 width
This class' width.
double length
The physical vehicle length.
SUMOVehicleShape shape
This class' shape.
LatAlignmentDefinition latAlignmentProcedure
the lateral alignment procedure
double locomotiveLength
the length of train locomotive