64 myVTypeAttributesParent(VTypeAttributesParent) {
72 myComboBoxVClassLabelImage->setBackColor(FXRGBA(255, 255, 255, 255));
74 for (
const auto& vClass : myVTypeAttributesParent->myVehicleTypeDialog->getEditedDemandElement()->getTagProperty().getAttributeProperties(
SUMO_ATTR_VCLASS).getDiscreteValues()) {
78 if (myComboBoxVClass->getNumItems() > 10) {
79 myComboBoxVClass->setNumVisible(10);
81 myComboBoxVClass->setNumVisible(myComboBoxVClass->getNumItems());
159 const auto vClass = myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(
SUMO_ATTR_VCLASS);
161 for (
int i = 0; i < myComboBoxVClass->getNumItems(); i++) {
162 if (myComboBoxVClass->getItem(i).text() == vClass) {
166 myComboBoxVClass->setCurrentItem(index);
167 setVClassLabelImage();
168 return myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getVClass();
175 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(
SUMO_ATTR_VCLASS).empty()) {
179 switch (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getVClass()) {
271 myVTypeAttributesParent(VTypeAttributesParent) {
282 for (
const auto& VShapeString : VShapeStrings) {
295 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(
SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text())) {
296 myComboBoxShape->setTextColor(FXRGB(0, 0, 0));
297 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(
SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text(),
298 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
299 setVShapeLabelImage();
301 myComboBoxShape->setTextColor(FXRGB(255, 0, 0));
302 myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
310 myComboBoxShape->setText(myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(
SUMO_ATTR_GUISHAPE).c_str());
311 setVShapeLabelImage();
320 myComboBoxShape->setTextColor(FXRGB(0, 0, 0));
321 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(
SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text(),
322 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
323 setVShapeLabelImage();
436 myVTypeAttributesParent(VTypeAttributesParent),
438 myRowAttrType(rowAttrType),
440 myTextField(nullptr),
441 myComboBox(nullptr) {
456 for (
const auto& value : values) {
473 if (myRowAttrType == ROWTYPE_COMBOBOX) {
475 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myComboBox->getText().text())) {
476 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myComboBox->getText().text(),
477 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
481 myComboBox->setTextColor(FXRGB(255, 0, 0));
483 myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
484 myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
486 }
else if (myRowAttrType == ROWTYPE_COLOR) {
488 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(
SUMO_ATTR_COLOR, myTextField->getText().text())) {
490 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(
SUMO_ATTR_COLOR) != myTextField->getText().text()) {
491 myTextField->setTextColor(FXRGB(0, 0, 0));
493 myTextField->setTextColor(FXRGB(195, 195, 195));
495 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(
SUMO_ATTR_COLOR, myTextField->getText().text(), myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
497 myTextField->setTextColor(FXRGB(255, 0, 0));
498 myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
499 myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr =
SUMO_ATTR_COLOR;
503 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myTextField->getText().text())) {
504 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myTextField->getText().text(),
505 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
509 myTextField->setTextColor(FXRGB(255, 0, 0));
511 myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
512 myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
522 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myComboBox->getText().text())) {
523 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myComboBox->getText().text(),
524 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
526 updateValue(defaultValue);
528 myComboBox->setTextColor(FXRGB(255, 0, 0));
530 myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
531 myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
535 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myTextField->getText().text())) {
536 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myTextField->getText().text(),
537 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
539 updateValue(defaultValue);
541 myTextField->setTextColor(FXRGB(255, 0, 0));
543 myVTypeAttributesParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
544 myVTypeAttributesParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
552 if (myRowAttrType == ROWTYPE_COMBOBOX) {
554 myComboBox->setText(myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
556 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myComboBox->getText().text()) {
557 myComboBox->setTextColor(FXRGB(0, 0, 0));
559 myComboBox->setTextColor(FXRGB(195, 195, 195));
561 }
else if (myRowAttrType == ROWTYPE_COLOR) {
563 myTextField->setText(myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
565 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myTextField->getText().text()) {
566 myTextField->setTextColor(FXRGB(0, 0, 0));
568 myTextField->setTextColor(FXRGB(195, 195, 195));
572 const std::string& parametersStr = myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr);
574 myTextField->setText(parametersStr.c_str());
576 myTextField->setTextColor(FXRGB(0, 0, 0));
585 if (keyValue.size() == 2) {
591 myTextField->setText(myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
593 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myTextField->getText().text()) {
594 myTextField->setTextColor(FXRGB(0, 0, 0));
596 myTextField->setTextColor(FXRGB(195, 195, 195));
606 myComboBox->setText(myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
608 if (defaultValue != myComboBox->getText().text()) {
609 myComboBox->setTextColor(FXRGB(0, 0, 0));
611 myComboBox->setTextColor(FXRGB(195, 195, 195));
615 myTextField->setText(myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
617 if (defaultValue != myTextField->getText().text()) {
618 myTextField->setTextColor(FXRGB(0, 0, 0));
620 myTextField->setTextColor(FXRGB(195, 195, 195));
635 FXColorDialog colordialog(
this,
TL(
"Color Dialog"));
636 colordialog.setTarget(
this);
638 if (GNEAttributeCarrier::canParse<RGBColor>(myTextField->getText().text())) {
639 colordialog.setRGBA(
MFXUtils::getFXColor(GNEAttributeCarrier::parse<RGBColor>(myTextField->getText().text())));
644 if (colordialog.execute()) {
646 myTextField->setText(newValue.c_str());
647 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, newValue)) {
648 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, newValue, myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
650 myTextField->setTextColor(FXRGB(0, 0, 0));
651 myTextField->killFocus();
660 FXFileDialog opendialog(
this,
TL(
"Open Image"));
662 opendialog.setSelectMode(SELECTFILE_EXISTING);
663 opendialog.setPatternList(
"All files (*)");
667 if (opendialog.execute()) {
671 std::string imagePath = opendialog.getFilename().text();
673 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, imagePath)) {
674 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, imagePath, myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
675 myTextField->setText(imagePath.c_str());
677 myTextField->setTextColor(FXRGB(0, 0, 0));
678 myTextField->killFocus();
687 FXFileDialog opendialog(
this,
TL(
"Open OSG File"));
689 opendialog.setSelectMode(SELECTFILE_EXISTING);
690 opendialog.setPatternList(
"OSG file (*.obj)");
694 if (opendialog.execute()) {
698 std::string imagePath = opendialog.getFilename().text();
700 if (myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, imagePath)) {
701 myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, imagePath, myVTypeAttributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
702 myTextField->setText(imagePath.c_str());
704 myTextField->setTextColor(FXRGB(0, 0, 0));
705 myTextField->killFocus();
713 return myTextField->getText().text();
717std::vector<std::pair<std::string, std::string> >
719 std::vector<std::pair<std::string, std::string> > result;
722 result.push_back(std::make_pair(parameter.first, parameter.second));
735 for (
const auto& parameter : parameters) {
737 result += parameter.first +
"=" + parameter.second +
"|";
742 if (!result.empty()) {
746 myTextField->setText(result.c_str());
755 return "crossingGap";
757 return "driveAfterYellowTime";
759 return "driveAfterRedTime";
761 return "driveRedSpeed";
763 return "ignoreKeepClearTime";
765 return "ignoreFoeSpeed";
767 return "ignoreFoeProb";
771 return "timegapMinor";
776 return "cooperative";
794 return "timeToImpatience";
798 return "lookaheadLeft";
800 return "speedGainRight";
802 return "maxSpeedLatStanding";
804 return "maxSpeedLatFactor";
806 return "turnAlignDistance";
808 return "overtakeRight";
810 return "keepRightAcceptanceTime";
812 return "overtakeDeltaSpeedFactor";
832 FXGroupBox* commonAttributes =
new FXGroupBox(firstAuxiliarVerticalFrame,
"Vehicle Type attributes",
GUIDesignGroupBoxFrame);
840 FXGroupBox* JMAttributes =
new FXGroupBox(firstAuxiliarVerticalFrame,
"Junction Model attributes",
GUIDesignGroupBoxFrame);
848 FXGroupBox* LCMAttributes =
new FXGroupBox(firstAuxiliarHorizontalFrame,
"Lane Change Model attributes",
GUIDesignGroupBoxFrame);
857 myVClassRow =
new VClassRow(
this, column);
905 myVShapeRow =
new VShapeRow(
this, column);
1056 myTextFieldVehicleTypeID->setText(myVehicleTypeDialog->myEditedDemandElement->getAttribute(
SUMO_ATTR_ID).c_str());
1059 myVShapeRow->updateValues();
1061 myLaneChangeModel->updateValue();
1063 myColor->updateValue();
1070 myWidth->updateValue(
toString(defaultVTypeParameters.
width));
1072 myFilename->updateValue();
1078 myBoardingDuration->updateValue();
1079 myLoadingDuration->updateValue();
1080 myMinGapLat->updateValue();
1081 myMaxSpeedLat->updateValue();
1082 myActionStepLength->updateValue();
1083 myProbability->updateValue();
1084 myCarriageGap->updateValue();
1086 myJMCrossingGap->updateValue();
1087 myJMIgnoreKeepclearTime->updateValue();
1088 myJMDriveAfterYellowTime->updateValue();
1089 myJMDriveAfterRedTime->updateValue();
1090 myJMDriveRedSpeed->updateValue();
1091 myJMIgnoreFoeProb->updateValue();
1092 myJMIgnoreFoeSpeed->updateValue();
1093 myJMSigmaMinor->updateValue();
1094 myJMTimeGapMinor->updateValue();
1095 myJMImpatience->updateValue();
1097 myLCAStrategicParam->updateValue();
1098 myLCACooperativeParam->updateValue();
1099 myLCASpeedgainParam->updateValue();
1100 myLCAKeeprightParam->updateValue();
1101 myLCASublaneParam->updateValue();
1102 myLCAOppositeParam->updateValue();
1103 myLCAPushy->updateValue();
1104 myLCAPushygap->updateValue();
1105 myLCAAssertive->updateValue();
1106 myLCAImpatience->updateValue();
1107 myLCATimeToImpatience->updateValue();
1108 myLCAAccelLat->updateValue();
1109 myLCALookAheadLeft->updateValue();
1110 myLCASpeedGainRight->updateValue();
1111 myLCAMaxSpeedLatStanding->updateValue();
1112 myLCAMaxSpeedLatFactor->updateValue();
1113 myLCATurnAlignmentDistance->updateValue();
1114 myLCAOvertakeRight->updateValue();
1115 myLCAKeepRightAcceptanceTime->updateValue();
1116 myLCAOvertakeDeltaSpeedFactor->updateValue();
1119 myParameters->updateValue();
1126 myVehicleTypeDialog->myVehicleTypeValid =
true;
1129 if (myVehicleTypeDialog->myEditedDemandElement->isValid(
SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text())) {
1130 myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0));
1131 myVehicleTypeDialog->myEditedDemandElement->setAttribute(
SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
1132 }
else if (myVehicleTypeDialog->myEditedDemandElement->getAttribute(
SUMO_ATTR_ID) == myTextFieldVehicleTypeID->getText().text()) {
1133 myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0));
1134 myVehicleTypeDialog->myEditedDemandElement->setAttribute(
SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
1136 myTextFieldVehicleTypeID->setTextColor(FXRGB(255, 0, 0));
1137 myVehicleTypeDialog->myVehicleTypeValid =
false;
1143 myVShapeRow->setVariable();
1145 myColor->setVariable();
1152 myWidth->setVariable(
toString(defaultVTypeParameters.
width));
1156 myLaneChangeModel->setVariable();
1163 myWidth->setVariable(
toString(defaultVTypeParameters.
width));
1165 myFilename->setVariable();
1171 myBoardingDuration->setVariable();
1172 myLoadingDuration->setVariable();
1173 myMinGapLat->setVariable();
1174 myMaxSpeedLat->setVariable();
1175 myActionStepLength->setVariable();
1176 myProbability->setVariable();
1177 myCarriageGap->setVariable();
1179 myJMCrossingGap->setVariable();
1180 myJMIgnoreKeepclearTime->setVariable();
1181 myJMDriveAfterYellowTime->setVariable();
1182 myJMDriveAfterRedTime->setVariable();
1183 myJMDriveRedSpeed->setVariable();
1184 myJMIgnoreFoeProb->setVariable();
1185 myJMIgnoreFoeSpeed->setVariable();
1186 myJMSigmaMinor->setVariable();
1187 myJMTimeGapMinor->setVariable();
1188 myJMImpatience->setVariable();
1190 myLCAStrategicParam->setVariable();
1191 myLCACooperativeParam->setVariable();
1192 myLCASpeedgainParam->setVariable();
1193 myLCAKeeprightParam->setVariable();
1194 myLCASublaneParam->setVariable();
1195 myLCAOppositeParam->setVariable();
1196 myLCAPushy->setVariable();
1197 myLCAPushygap->setVariable();
1198 myLCAAssertive->setVariable();
1199 myLCAImpatience->setVariable();
1200 myLCATimeToImpatience->setVariable();
1201 myLCAAccelLat->setVariable();
1202 myLCALookAheadLeft->setVariable();
1203 myLCASpeedGainRight->setVariable();
1204 myLCAMaxSpeedLatStanding->setVariable();
1205 myLCAMaxSpeedLatFactor->setVariable();
1206 myLCATurnAlignmentDistance->setVariable();
1207 myLCAOvertakeRight->setVariable();
1208 myLCAKeepRightAcceptanceTime->setVariable();
1209 myLCAOvertakeDeltaSpeedFactor->setVariable();
1211 myParameters->setVariable();
1219 if (obj == myColor->getButton()) {
1220 myColor->openColorDialog();
1221 }
else if (obj == myFilename->getButton()) {
1222 myFilename->openImageFileDialog();
1223 }
else if (obj == myOSGFile->getButton()) {
1224 myFilename->openOSGFileDialog();
1235 if (
GNESingleParametersDialog(myParameters, myVehicleTypeDialog->getEditedDemandElement()->getNet()->getViewNet()).execute()) {
1239 myVehicleTypeDialog->getEditedDemandElement()->setAttribute(
GNE_ATTR_PARAMETERS, myParameters->getParametersStr(), myVehicleTypeDialog->getEditedDemandElement()->getNet()->getViewNet()->getUndoList());
1253 myVehicleTypeDialog(vehicleTypeDialog) {
1265 for (
const auto& CFModel : CFModels) {
1470 for (
const auto& row : myRows) {
1474 myLabelIncompleteAttribute->hide();
1485 myApparentDecelRow->show();
1486 myEmergencyDecelRow->show();
1502 myEmergencyDecelRow->show();
1504 myMinGapFactorRow->show();
1515 myEmergencyDecelRow->show();
1517 myMinGapFactorRow->show();
1518 myTrauLastRow->show();
1525 myEmergencyDecelRow->show();
1527 mySteppingRow->show();
1528 myMinGapFactorRow->show();
1534 myEmergencyDecelRow->show();
1536 mySteppingRow->show();
1537 myMinGapFactorRow->show();
1538 myAdaptFactorRow->show();
1539 myAdaptTimeRow->show();
1545 myEmergencyDecelRow->show();
1547 mySteppingRow->show();
1548 myMinGapFactorRow->show();
1549 myTpreviewRow->show();
1550 myTreactionRow->show();
1551 myTPersDriveRow->show();
1552 myTPersEstimateRow->show();
1553 myCcoolnessRow->show();
1554 mySigmaleaderRow->show();
1555 mySigmagapRow->show();
1556 mySigmaerrorRow->show();
1557 myJerkmaxRow->show();
1558 myEpsilonaccRow->show();
1559 myTaccmaxRow->show();
1560 myMflatnessRow->show();
1561 myMbeginRow->show();
1562 myUseVehDynamicsRow->show();
1563 myMaxVehPreviewRow->show();
1569 myEmergencyDecelRow->show();
1572 myMinGapFactorRow->show();
1578 myEmergencyDecelRow->show();
1579 myMinGapFactorRow->show();
1580 mySecurityRow->show();
1581 myEstimationRow->show();
1596 myTrainTypeRow->show();
1602 myEmergencyDecelRow->show();
1603 myMinGapFactorRow->show();
1605 myLabelIncompleteAttribute->show();
1621 myEmergencyDecelRow->show();
1622 myMinGapFactorRow->show();
1624 myLabelIncompleteAttribute->show();
1647 myLabelIncompleteAttribute->show();
1674 myVerticalFrameRows->recalc();
1683 myComboBoxCarFollowModel->setCurrentItem(0);
1685 myComboBoxCarFollowModel->setText(myVehicleTypeDialog->myEditedDemandElement->getAttribute(
SUMO_ATTR_CAR_FOLLOW_MODEL).c_str());
1690 for (
const auto& row : myRows) {
1699 myVehicleTypeDialog->myVehicleTypeValid =
true;
1702 if (myVehicleTypeDialog->myEditedDemandElement->isValid(
SUMO_ATTR_CAR_FOLLOW_MODEL, myComboBoxCarFollowModel->getText().text())) {
1703 myComboBoxCarFollowModel->setTextColor(FXRGB(0, 0, 0));
1704 myVehicleTypeDialog->myEditedDemandElement->setAttribute(
SUMO_ATTR_CAR_FOLLOW_MODEL, myComboBoxCarFollowModel->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
1706 myComboBoxCarFollowModel->setTextColor(FXRGB(255, 0, 0));
1707 myVehicleTypeDialog->myVehicleTypeValid =
false;
1711 for (
const auto& row : myRows) {
1766 WRITE_DEBUG(
"Opening FXMessageBox of type 'warning'");
1771 FXMessageBox::warning(getApp(), MBOX_OK,
1772 (
"Error " + operation1 +
" " + tagString).c_str(),
"%s",
1773 (tagString +
" cannot be " + operation2 +
1775 " is invalid.").c_str());
1777 WRITE_DEBUG(
"Closed FXMessageBox of type 'warning' with 'OK'");
1783 getApp()->stopModal(
this, TRUE);
1794 getApp()->stopModal(
this, FALSE);
1816 myCarFollowingModelParametersParent(carFollowingModelParametersParent),
1818 myTextField(nullptr) {
1827 if (myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myTextField->getText().text())) {
1829 if (myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myTextField->getText().text()) {
1830 myTextField->setTextColor(FXRGB(0, 0, 0));
1832 myTextField->setTextColor(FXRGB(195, 195, 195));
1834 myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myTextField->getText().text(),
1835 myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList());
1839 myTextField->setTextColor(FXRGB(255, 0, 0));
1841 myCarFollowingModelParametersParent->myVehicleTypeDialog->myVehicleTypeValid =
false;
1842 myCarFollowingModelParametersParent->myVehicleTypeDialog->myInvalidAttr = myAttr;
1850 myTextField->setText(myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(myAttr).c_str());
1852 if (myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getTagProperty().getDefaultValue(myAttr) != myTextField->getText().text()) {
1853 myTextField->setTextColor(FXRGB(0, 0, 0));
1855 myTextField->setTextColor(FXRGB(195, 195, 195));
FXDEFMAP(GNEVehicleTypeDialog::VTypeAttributes) VTypeAttributesMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_OPEN_PARAMETERS_DIALOG
open parameters dialog
@ MID_GNE_SET_ATTRIBUTE_DIALOG
attribute edited trough dialog
#define GUIDesignTextFieldFixed(width)
text field with fixed width
#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 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 GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
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
@ AIRCRAFT
render as aircraft
@ 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.
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 * 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 * myTmp4Row
Row for TMP4.
CarFollowingModelRow * myW99CC3
Row for W99 CC 03.
CarFollowingModelRow * myTmp1Row
Row for TMP1.
CarFollowingModelRow * myW99CC2
Row for W99 CC 02.
CarFollowingModelRow * myTreactionRow
Row for Reaction Time.
FXLabel * myLabelIncompleteAttribute
temporal label for incomplete attributes
CarFollowingModelRow * myCcoolnessRow
Row for Coolness parameter.
CarFollowingModelRow * mySigmagapRow
Row for Gap estimation error.
CarFollowingModelRow * mySecurityRow
Row for Security (only for Wiedemann)
CarFollowingModelRow * myW99CC7
Row for W99 CC 07.
CarFollowingModelRow * myW99CC5
Row for W99 CC 05.
CarFollowingModelRow * myTmp5Row
Row for TMP5.
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 *)
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.
MFXComboBoxIcon * myComboBoxCarFollowModel
Row for CarFollowModel.
CarFollowingModelRow * myJerkmaxRow
Row for max jerk.
FXVerticalFrame * myVerticalFrameRows
Vertical Frame for CarFollowingModelRow.
CarFollowingModelRow * myTaccmaxRow
Row for Startup Time to acc_max.
CarFollowingModelRow * myApparentDecelRow
Row for apparent Decel.
CarFollowingModelRow * myDecelRow
Row for Decel.
CarFollowingModelRow * myW99CC4
Row for W99 CC 04.
std::vector< CarFollowingModelRow * > myRows
vector with the Car Following Model Row
CarFollowingModelRow * myEmergencyDecelRow
Row for emergency Decel.
CarFollowingModelRow * mySigmaleaderRow
Row for leader speed estimation error.
CarFollowingModelRow * myTrainTypeRow
Row for TrainType.
void refreshCFMFields()
refresh Car Following Model Fields
CarFollowingModelRow * myEstimationRow
Row for Estimation (only for Wiedemann)
CarFollowingModelRow * mySigmaRow
Row for Sigma.
CarFollowingModelRow * myMbeginRow
Row for Startup M begin.
CarFollowingModelRow * mySigmaerrorRow
Row for Driving Error.
CarFollowingModelRow * myAdaptTimeRow
Row for Adapt Time.
CarFollowingModelRow * myDeltaRow
Row for MinGap (only for IDM)
CarFollowingModelRow * myTrauLastRow
Row for TauLast.
CarFollowingModelRow * myUseVehDynamicsRow
Row for Using vehicle dynamics.
CarFollowingModelParameters(GNEVehicleTypeDialog *vehicleTypeDialog, FXHorizontalFrame *column)
FOX-declaration.
CarFollowingModelRow * myMinGapFactorRow
Row for MinGapFactor.
SUMOVehicleClass setVariable()
set vehicle class
VTypeAttributes * myVTypeAttributesParent
pointer to VTypeAttributes parent
SUMOVehicleClass updateValue()
update values
void setVClassLabelImage()
set VClass texture
MFXComboBoxIcon * myComboBoxVClass
FXComboBox for VClass.
MFXComboBoxIcon * myComboBoxShape
FXComboBox for Shape.
FXLabel * myComboBoxShapeLabelImage
label with image of Shape
void setVShapeLabelImage()
set VShape texture
void updateValues()
update values
void setVariable()
set variables
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
FXString filterAttributeName(const SumoXMLAttr attr) const
filter attribute name
FXTextField * myTextField
text field
void openImageFileDialog()
open image file dialog
MFXComboBoxIcon * myComboBox
ComboBox for attributes with limited values.
std::string getParametersStr() const
get parameters as string
void updateValue()
update value of Vehicle Type (using default value obtained from GNEAttributeCarrier)
RowAttrType
Attribute type.
void setVariable()
set Variable in VehicleType (using default value obtained from GNEAttributeCarrier)
const FXButton * getButton() const
get button
std::vector< std::pair< std::string, std::string > > getParametersVectorStr() const
get parameters as vector of strings
FXButton * myButton
button
void setParameters(const std::vector< std::pair< std::string, std::string > > ¶meters)
set parameters
void openOSGFileDialog()
open OSG file dialog
void openColorDialog()
open color dialog
GNEVehicleTypeDialog * myVehicleTypeDialog
VTypeAttributeRow for experimental.
VTypeAttributeRow * myHeight
VTypeAttributeRow for Height.
VTypeAttributeRow * myContainerCapacity
VTypeAttributeRow for ContainerCapacity.
VTypeAttributeRow * myMaxSpeed
VTypeAttributeRow for MaxSpeed.
void buildAttributesA(FXVerticalFrame *column)
build commmon attributes (A)
VTypeAttributeRow * myMinGap
VTypeAttributeRow for MinGap.
VTypeAttributeRow * myOSGFile
VTypeAttributeRow for OSG.
VTypeAttributeRow * myParameters
VTypeAttributeRow for parameters.
void buildJunctionModelAttributesA(FXVerticalFrame *column)
build JunctionModel attributes (A)
VTypeAttributeRow * myEmissionClass
VTypeAttributeRow for EmissionClass.
VTypeAttributeRow * myCarriageLength
VTypeAttributeRow for carriage length.
void updateValues()
update values
VTypeAttributeRow * mySpeedFactor
VTypeAttributeRow for SpeedFactor.
long onCmdOpenAttributeDialog(FXObject *obj, FXSelector, void *)
@event called after press a button dialog
void buildJunctionModelAttributesB(FXVerticalFrame *column)
build JunctionModel attributes (B)
void buildAttributesB(FXVerticalFrame *column)
build commmon attributes (B)
VTypeAttributeRow * myLocomotiveLength
VTypeAttributeRow for locomotive length.
long onCmdSetAttribute(FXObject *, FXSelector, void *)
VShapeRow * myVShapeRow
vehicle shape row
VTypeAttributeRow * myWidth
VTypeAttributeRow for Width.
VTypeAttributeRow * myPersonCapacity
VTypeAttributeRow for PersonCapacity.
void buildLaneChangeModelAttributes(FXVerticalFrame *column)
build LaneChangeModel attributes
VTypeAttributeRow * myDesiredMaxSpeed
VTypeAttributeRow for desired max speed.
long onCmdOpenParametersEditor(FXObject *obj, FXSelector, void *)
@event called after press a button dialog
VTypeAttributes(GNEVehicleTypeDialog *vehicleTypeDialog, FXHorizontalFrame *column)
constructor
VTypeAttributeRow * myLength
VTypeAttributeRow for Length.
Dialog for editing calibrator vehicle types.
~GNEVehicleTypeDialog()
destructor
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
SumoXMLAttr myInvalidAttr
current sumo attribute invalid
bool myVehicleTypeValid
flag to check if current vehicleType is valid
VTypeAttributes * myVTypeAttributes
Vehicle Type Common Attributes.
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
CarFollowingModelParameters * myCarFollowingModelParameters
Car Following model parameters.
GNEVehicleTypeDialog(GNEDemandElement *editedVehicleType, bool updatingElement)
constructor
long onCmdAccept(FXObject *, FXSelector, void *)
GNEUndoList * getUndoList() const
get the undoList object
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXint getNumItems() const
Return the number of items in the list.
FXString getText() const
Get the text.
void setTextColor(FXColor clr)
Change text color.
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
static FXIcon * getVClassIcon(const SUMOVehicleClass vc)
returns icon associated to the given vClass
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