Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNERerouterIntervalDialog.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// Dialog for edit rerouter intervals
19/****************************************************************************/
20
24#include <netedit/GNEViewNet.h>
25#include <netedit/GNENet.h>
26#include <netedit/GNEUndoList.h>
27
29
30
31// ===========================================================================
32// FOX callback mapping
33// ===========================================================================
34
35FXDEFMAP(GNERerouterIntervalDialog) GNERerouterIntervalDialogMap[] = {
36 // called when user click over buttons
42
43 // clicked table (Double and triple clicks allow to remove element more fast)
59
60 // use "update" instead of "command" to avoid problems mit icons
67};
68
69// Object implementation
70FXIMPLEMENT(GNERerouterIntervalDialog, GNEAdditionalDialog, GNERerouterIntervalDialogMap, ARRAYNUMBER(GNERerouterIntervalDialogMap))
71
72// ===========================================================================
73// member method definitions
74// ===========================================================================
75
76GNERerouterIntervalDialog::GNERerouterIntervalDialog(GNEAdditional* rerouterInterval, bool updatingElement) :
77 GNEAdditionalDialog(rerouterInterval, updatingElement, 960, 480),
78 myBeginEndValid(true),
79 myClosingLaneReroutesValid(true),
80 myClosingReroutesValid(true),
81 myDestProbReroutesValid(true),
82 myParkingAreaReroutesValid(true),
83 myRouteProbReroutesValid(true) {
84 // fill closing Reroutes
85 for (auto i : myEditedAdditional->getChildAdditionals()) {
86 if (i->getTagProperty().getTag() == SUMO_TAG_CLOSING_REROUTE) {
87 myClosingReroutesEdited.push_back(i);
88 }
89 }
90 // fill closing Lane Reroutes
91 for (auto i : myEditedAdditional->getChildAdditionals()) {
92 if (i->getTagProperty().getTag() == SUMO_TAG_CLOSING_LANE_REROUTE) {
93 myClosingLaneReroutesEdited.push_back(i);
94 }
95 }
96 // fill Dest Prob Reroutes
97 for (auto i : myEditedAdditional->getChildAdditionals()) {
98 if (i->getTagProperty().getTag() == SUMO_TAG_DEST_PROB_REROUTE) {
99 myDestProbReroutesEdited.push_back(i);
100 }
101 }
102 // fill Route Prob Reroutes
103 for (auto i : myEditedAdditional->getChildAdditionals()) {
104 if (i->getTagProperty().getTag() == SUMO_TAG_ROUTE_PROB_REROUTE) {
105 myRouteProbReroutesEdited.push_back(i);
106 }
107 }
108 // fill Parking Area reroutes
109 for (auto i : myEditedAdditional->getChildAdditionals()) {
110 if (i->getTagProperty().getTag() == SUMO_TAG_PARKING_AREA_REROUTE) {
111 myParkingAreaRerouteEdited.push_back(i);
112 }
113 }
114 // change default header
115 std::string typeOfOperation = myUpdatingElement ? "Edit " + myEditedAdditional->getTagStr() + " of " : "Create " + myEditedAdditional->getTagStr() + " for ";
116 changeAdditionalDialogHeader(typeOfOperation + myEditedAdditional->getParentAdditionals().at(0)->getTagStr() + " '" + myEditedAdditional->getParentAdditionals().at(0)->getID() + "'");
117
118 // Create auxiliar frames for tables
119 FXHorizontalFrame* columns = new FXHorizontalFrame(myContentFrame, GUIDesignUniformHorizontalFrame);
120 FXVerticalFrame* columnLeft = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
121 FXVerticalFrame* columnRight = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
122 FXVerticalFrame* columnRight2 = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
123
124 // create horizontal frame for begin and end label
125 FXHorizontalFrame* beginEndElementsLeft = new FXHorizontalFrame(columnLeft, GUIDesignAuxiliarHorizontalFrame);
126 new FXLabel(beginEndElementsLeft, (toString(SUMO_ATTR_BEGIN) + " and " + toString(SUMO_ATTR_END) + " of " + myEditedAdditional->getTagStr()).c_str(), nullptr, GUIDesignLabelThick(JUSTIFY_NORMAL));
127 myCheckLabel = new FXLabel(beginEndElementsLeft, "", GUIIconSubSys::getIcon(GUIIcon::CORRECT), GUIDesignLabelIcon32x32Thicked);
128
129 // create horizontal frame for begin and end text fields
130 FXHorizontalFrame* beginEndElementsRight = new FXHorizontalFrame(columnRight, GUIDesignAuxiliarHorizontalFrame);
131 myBeginTextField = new FXTextField(beginEndElementsRight, GUIDesignTextFieldNCol, this, MID_GNE_REROUTEDIALOG_EDIT_INTERVAL, GUIDesignTextField);
132 myBeginTextField->setText(toString(myEditedAdditional->getAttribute(SUMO_ATTR_BEGIN)).c_str());
133 myEndTextField = new FXTextField(beginEndElementsRight, GUIDesignTextFieldNCol, this, MID_GNE_REROUTEDIALOG_EDIT_INTERVAL, GUIDesignTextField);
134 myEndTextField->setText(toString(myEditedAdditional->getAttribute(SUMO_ATTR_END)).c_str());
135
136 // Create labels and tables
137 FXHorizontalFrame* buttonAndLabelClosingLaneReroute = new FXHorizontalFrame(columnLeft, GUIDesignAuxiliarHorizontalFrame);
138 myAddClosingLaneReroutes = GUIDesigns::buildFXButton(buttonAndLabelClosingLaneReroute, "", "", "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_REROUTEDIALOG_ADD_CLOSINGLANEREROUTE, GUIDesignButtonIcon);
139 new FXLabel(buttonAndLabelClosingLaneReroute, ("Add new " + toString(SUMO_TAG_CLOSING_LANE_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick(JUSTIFY_NORMAL));
140 myClosingLaneRerouteTable = new FXTable(columnLeft, this, MID_GNE_REROUTEDIALOG_TABLE_CLOSINGLANEREROUTE, GUIDesignTableAdditionals);
141 myClosingLaneRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
142 myClosingLaneRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
143
144 FXHorizontalFrame* buttonAndLabelClosinReroute = new FXHorizontalFrame(columnLeft, GUIDesignAuxiliarHorizontalFrame);
145 myAddClosingReroutes = GUIDesigns::buildFXButton(buttonAndLabelClosinReroute, "", "", "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_REROUTEDIALOG_ADD_CLOSINGREROUTE, GUIDesignButtonIcon);
146 new FXLabel(buttonAndLabelClosinReroute, ("Add new " + toString(SUMO_TAG_CLOSING_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick(JUSTIFY_NORMAL));
147 myClosingRerouteTable = new FXTable(columnLeft, this, MID_GNE_REROUTEDIALOG_TABLE_CLOSINGREROUTE, GUIDesignTableAdditionals);
148 myClosingRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
149 myClosingRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
150
151 FXHorizontalFrame* buttonAndLabelDestProbReroute = new FXHorizontalFrame(columnRight, GUIDesignAuxiliarHorizontalFrame);
152 myAddDestProbReroutes = GUIDesigns::buildFXButton(buttonAndLabelDestProbReroute, "", "", "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_REROUTEDIALOG_ADD_DESTPROBREROUTE, GUIDesignButtonIcon);
153 new FXLabel(buttonAndLabelDestProbReroute, ("Add new " + toString(SUMO_TAG_DEST_PROB_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick(JUSTIFY_NORMAL));
154 myDestProbRerouteTable = new FXTable(columnRight, this, MID_GNE_REROUTEDIALOG_TABLE_DESTPROBREROUTE, GUIDesignTableAdditionals);
155 myDestProbRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
156 myDestProbRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
157
158 FXHorizontalFrame* buttonAndLabelRouteProbReroute = new FXHorizontalFrame(columnRight, GUIDesignAuxiliarHorizontalFrame);
159 myAddRouteProbReroute = GUIDesigns::buildFXButton(buttonAndLabelRouteProbReroute, "", "", "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_REROUTEDIALOG_ADD_ROUTEPROBREROUTE, GUIDesignButtonIcon);
160 FXLabel* routeProbRerouteLabel = new FXLabel(buttonAndLabelRouteProbReroute, ("Add new " + toString(SUMO_TAG_ROUTE_PROB_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick(JUSTIFY_NORMAL));
161 myRouteProbRerouteTable = new FXTable(columnRight, this, MID_GNE_REROUTEDIALOG_TABLE_ROUTEPROBREROUTE, GUIDesignTableAdditionals);
162 myRouteProbRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
163 myRouteProbRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
164
165 FXHorizontalFrame* buttonAndLabelParkingAreaReroute = new FXHorizontalFrame(columnRight2, GUIDesignAuxiliarHorizontalFrame);
166 FXButton* parkingAreaRerouteButton = myAddParkingAreaReroute = GUIDesigns::buildFXButton(buttonAndLabelParkingAreaReroute, "", "", "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_REROUTEDIALOG_ADD_PARKINGAREAREROUTE, GUIDesignButtonIcon);
167 FXLabel* parkingAreaRerouteLabel = new FXLabel(buttonAndLabelParkingAreaReroute, ("Add new " + toString(SUMO_TAG_PARKING_AREA_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick(JUSTIFY_NORMAL));
168 myParkingAreaRerouteTable = new FXTable(columnRight2, this, MID_GNE_REROUTEDIALOG_TABLE_PARKINGAREAREROUTE, GUIDesignTableAdditionals);
169 myParkingAreaRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
170 myParkingAreaRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
171
172 // disable add parkingAreaReroute Button and change label if there isn't parkingAreas in net
173 if (rerouterInterval->getNet()->getAttributeCarriers()->getAdditionals().at(SUMO_TAG_PARKING_AREA).size() == 0) {
174 parkingAreaRerouteButton->disable();
175 parkingAreaRerouteLabel->setText(("There isn't " + toString(SUMO_TAG_PARKING_AREA) + "s in net").c_str());
176 }
177
178 // disable add routeProbReroute Button and change label if the rerouter has multiple edges (random routes can only work from one edge)
179 // for whatever reason, sonar complains in the next line that parkingAreaRerouteLabel may leak, but fox does the cleanup
180 if (rerouterInterval->getParentAdditionals().at(0)->getChildEdges().size() > 1) { // NOSONAR
181 myAddRouteProbReroute->disable();
182 routeProbRerouteLabel->setText(TL("Rerouter has more than one edge"));
183 }
184
185 // update tables
186 // for whatever reason, sonar complains in the next line that routeProbRerouteLabel may leak, but fox does the cleanup
187 updateClosingLaneReroutesTable(); // NOSONAR
188 updateClosingReroutesTable();
189 updateDestProbReroutesTable();
190 updateRouteProbReroutesTable();
191 updateParkingAreaReroutesTable();
192
193 // start a undo list for editing local to this additional
194 initChanges();
195
196 // add element if we aren't updating an existent element
197 if (!myUpdatingElement) {
198 myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(myEditedAdditional, true), true);
199 }
200
201 // Open as modal dialog
202 openAsModalDialog();
203}
204
205
207
208
209long
210GNERerouterIntervalDialog::onCmdAccept(FXObject*, FXSelector, void*) {
211 // set strings for dialogs
212 std::string errorTitle = "Error" + toString(myUpdatingElement ? "updating" : "creating") + " " + myEditedAdditional->getTagStr() + " of " + myEditedAdditional->getParentAdditionals().at(0)->getTagStr();
213 std::string operationType = myEditedAdditional->getParentAdditionals().at(0)->getTagStr() + "'s " + myEditedAdditional->getTagStr() + " cannot be " + (myUpdatingElement ? "updated" : "created") + " because ";
214 if (!myBeginEndValid) {
215 // write warning if netedit is running in testing mode
216 WRITE_DEBUG("Opening FXMessageBox of type 'warning'");
217 // open warning Box
218 FXMessageBox::warning(getApp(), MBOX_OK, errorTitle.c_str(), "%s", (operationType + myEditedAdditional->getTagStr() + " defined by " + toString(SUMO_ATTR_BEGIN) + " and " + toString(SUMO_ATTR_END) + " is invalid.").c_str());
219 // write warning if netedit is running in testing mode
220 WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'");
221 return 0;
222 } else if (myClosingLaneReroutesEdited.empty() &&
223 myClosingReroutesEdited.empty() &&
224 myDestProbReroutesEdited.empty() &&
227 // write warning if netedit is running in testing mode
228 WRITE_DEBUG("Opening FXMessageBox of type 'warning'");
229 // open warning Box
230 FXMessageBox::warning(getApp(), MBOX_OK, errorTitle.c_str(), "%s", (operationType + "at least one " + myEditedAdditional->getTagStr() + "'s element must be defined.").c_str());
231 // write warning if netedit is running in testing mode
232 WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'");
233 return 0;
234 } else if ((myClosingLaneReroutesEdited.size() > 0) && (myClosingLaneReroutesValid == false)) {
235 // write warning if netedit is running in testing mode
236 WRITE_DEBUG("Opening FXMessageBox of type 'warning'");
237 // open warning Box
238 FXMessageBox::warning(getApp(), MBOX_OK, errorTitle.c_str(), "%s", (operationType + "there are invalid " + toString(SUMO_TAG_CLOSING_LANE_REROUTE) + "s.").c_str());
239 // write warning if netedit is running in testing mode
240 WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'");
241 return 0;
242 } else if ((myClosingLaneReroutesEdited.size() > 0) && (myClosingReroutesValid == false)) {
243 // write warning if netedit is running in testing mode
244 WRITE_DEBUG("Opening FXMessageBox of type 'warning'");
245 // open warning Box
246 FXMessageBox::warning(getApp(), MBOX_OK, errorTitle.c_str(), "%s", (operationType + "there are invalid " + toString(SUMO_TAG_CLOSING_REROUTE) + "s.").c_str());
247 // write warning if netedit is running in testing mode
248 WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'");
249 return 0;
250 } else if ((myDestProbReroutesEdited.size() > 0) && (myDestProbReroutesValid == false)) {
251 // write warning if netedit is running in testing mode
252 WRITE_DEBUG("Opening FXMessageBox of type 'warning'");
253 // open warning Box
254 FXMessageBox::warning(getApp(), MBOX_OK, errorTitle.c_str(), "%s", (operationType + "there are invalid " + toString(SUMO_TAG_PARKING_AREA_REROUTE) + "s.").c_str());
255 // write warning if netedit is running in testing mode
256 WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'");
257 return 0;
258 } else if ((myParkingAreaRerouteEdited.size() > 0) && (myParkingAreaReroutesValid == false)) {
259 // write warning if netedit is running in testing mode
260 WRITE_DEBUG("Opening FXMessageBox of type 'warning'");
261 // open warning Box
262 FXMessageBox::warning(getApp(), MBOX_OK, errorTitle.c_str(), "%s", (operationType + "there are invalid " + toString(SUMO_TAG_DEST_PROB_REROUTE) + "s.").c_str());
263 // write warning if netedit is running in testing mode
264 WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'");
265 return 0;
266 } else if ((myRouteProbReroutesEdited.size() > 0) && (myRouteProbReroutesValid == false)) {
267 // write warning if netedit is running in testing mode
268 WRITE_DEBUG("Opening FXMessageBox of type 'warning'");
269 // open warning Box
270 FXMessageBox::warning(getApp(), MBOX_OK, errorTitle.c_str(), "%s", (operationType + "there are invalid " + toString(SUMO_TAG_ROUTE_PROB_REROUTE) + "s.").c_str());
271 // write warning if netedit is running in testing mode
272 WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'");
273 return 0;
274 } else {
275 // accept changes before closing dialog
277 // Stop Modal
278 getApp()->stopModal(this, TRUE);
279 return 1;
280 }
281}
282
283
284long
285GNERerouterIntervalDialog::onCmdCancel(FXObject*, FXSelector, void*) {
286 // cancel changes
288 // Stop Modal
289 getApp()->stopModal(this, FALSE);
290 return 1;
291}
292
293
294long
295GNERerouterIntervalDialog::onCmdReset(FXObject*, FXSelector, void*) {
296 // reset changes
297 resetChanges();
298 // update tables
303 return 1;
304}
305
306
307long
309 // first check if there is lanes in the network
310 if (myEditedAdditional->getNet()->getAttributeCarriers()->getEdges().size() > 0) {
311 // get lane
312 GNELane* lane = myEditedAdditional->getNet()->getAttributeCarriers()->getEdges().begin()->second->getLanes().front();
313 // create closing lane reroute
315 // add it using undoList
316 myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(closingLaneReroute, true), true);
317 myClosingLaneReroutesEdited.push_back(closingLaneReroute);
318 // update closing lane reroutes table
320 } else {
321 WRITE_WARNING(TL("There are no lanes in the network"));
322 }
323 return 1;
324}
325
326
327long
329 // first check if there is lanes in the network
330 if (myEditedAdditional->getNet()->getAttributeCarriers()->getEdges().size() > 0) {
331 // get edge
332 GNEEdge* edge = myEditedAdditional->getNet()->getAttributeCarriers()->getEdges().begin()->second;
333 // create closing reroute
334 GNEClosingReroute* closingReroute = new GNEClosingReroute(myEditedAdditional, edge, SVCAll);
335 // add it using undoList
336 myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(closingReroute, true), true);
337 myClosingReroutesEdited.push_back(closingReroute);
338 // update closing reroutes table
340 } else {
341 WRITE_WARNING(TL("There are no edges in the network"));
342 }
343 return 1;
344}
345
346
347long
349 // first check if there is lanes in the network
350 if (myEditedAdditional->getNet()->getAttributeCarriers()->getEdges().size() > 0) {
351 // get edge
352 GNEEdge* edge = myEditedAdditional->getNet()->getAttributeCarriers()->getEdges().begin()->second;
353 // create closing reroute and add it to table
354 GNEDestProbReroute* destProbReroute = new GNEDestProbReroute(myEditedAdditional, edge, 1);
355 // add it using undoList
356 myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(destProbReroute, true), true);
357 myDestProbReroutesEdited.push_back(destProbReroute);
358 // update dest Prob reroutes table
360 } else {
361 WRITE_WARNING(TL("There are no edges in the network"));
362 }
363 return 1;
364}
365
366
367long
369 // get routes
371 // check if there is at least one route
372 if (routes.size() > 0) {
373 // create route Prob Reroute
374 GNERouteProbReroute* routeProbReroute = new GNERouteProbReroute(myEditedAdditional, routes.begin()->second, 1);
375 myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(routeProbReroute, true), true);
376 myRouteProbReroutesEdited.push_back(routeProbReroute);
377 // update route prob reroutes table
379 }
380 return 1;
381}
382
383
384long
386 // first check if there is lanes in the network
388 // get parking area
390 // create parkingAreaReroute and add it to table
391 GNEParkingAreaReroute* parkingAreaReroute = new GNEParkingAreaReroute(myEditedAdditional, parkingArea, 1, 1);
392 // add it using undoList
393 myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(parkingAreaReroute, true), true);
394 myParkingAreaRerouteEdited.push_back(parkingAreaReroute);
395 // update dest Prob reroutes table
397 } else {
398 WRITE_WARNING(TL("There are no parking areas in the network"));
399 }
400 return 1;
401}
402
403
404long
406 // check if some delete button was pressed
407 for (int i = 0; i < (int)myClosingLaneReroutesEdited.size(); i++) {
408 if (myClosingLaneRerouteTable->getItem(i, 4)->hasFocus()) {
409 myClosingLaneRerouteTable->removeRows(i);
413 return 1;
414 }
415 }
416 return 0;
417}
418
419
420long
422 // check if some delete button was pressed
423 for (int i = 0; i < (int)myClosingReroutesEdited.size(); i++) {
424 if (myClosingRerouteTable->getItem(i, 4)->hasFocus()) {
425 myClosingRerouteTable->removeRows(i);
429 return 1;
430 }
431 }
432 return 1;
433}
434
435
436long
438 // check if some delete button was pressed
439 for (int i = 0; i < (int)myDestProbReroutesEdited.size(); i++) {
440 if (myDestProbRerouteTable->getItem(i, 3)->hasFocus()) {
441 myDestProbRerouteTable->removeRows(i);
445 return 1;
446 }
447 }
448 return 0;
449}
450
451
452long
454 // check if some delete button was pressed
455 for (int i = 0; i < (int)myRouteProbReroutesEdited.size(); i++) {
456 if (myRouteProbRerouteTable->getItem(i, 3)->hasFocus()) {
457 myRouteProbRerouteTable->removeRows(i);
461 return 1;
462 }
463 }
464 return 0;
465}
466
467
468long
470 // check if some delete button was pressed
471 for (int i = 0; i < (int)myParkingAreaRerouteEdited.size(); i++) {
472 if (myParkingAreaRerouteTable->getItem(i, 3)->hasFocus()) {
473 ;
474 } else if (myParkingAreaRerouteTable->getItem(i, 4)->hasFocus()) {
475 myParkingAreaRerouteTable->removeRows(i);
479 return 1;
480 }
481 }
482 return 0;
483}
484
485
486long
489 // iterate over table and check that all parameters are correct
490 for (int i = 0; i < myClosingLaneRerouteTable->getNumRows(); i++) {
491 GNEAdditional* closingLaneReroute = myClosingLaneReroutesEdited.at(i);
492 if (!SUMOXMLDefinitions::isValidNetID(myClosingLaneRerouteTable->getItem(i, 0)->getText().text())) {
495 } else if (closingLaneReroute->isValid(SUMO_ATTR_LANE, myClosingLaneRerouteTable->getItem(i, 0)->getText().text()) == false) {
498 } else if (closingLaneReroute->isValid(SUMO_ATTR_ALLOW, myClosingLaneRerouteTable->getItem(i, 1)->getText().text()) == false) {
501 } else if (closingLaneReroute->isValid(SUMO_ATTR_DISALLOW, myClosingLaneRerouteTable->getItem(i, 2)->getText().text()) == false) {
504 } else {
505 // check if allow/disallow should be changed
506 bool changeAllow = myClosingLaneRerouteTable->getItem(i, 1)->getText().text() != closingLaneReroute->getAttribute(SUMO_ATTR_ALLOW);
507 bool changeDisallow = myClosingLaneRerouteTable->getItem(i, 2)->getText().text() != closingLaneReroute->getAttribute(SUMO_ATTR_DISALLOW);
508 // set new values in Closing reroute
509 closingLaneReroute->setAttribute(SUMO_ATTR_LANE, myClosingLaneRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
510 if (changeAllow) {
511 closingLaneReroute->setAttribute(SUMO_ATTR_ALLOW, myClosingLaneRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
512 myClosingLaneRerouteTable->getItem(i, 2)->setText(closingLaneReroute->getAttribute(SUMO_ATTR_DISALLOW).c_str());
513
514 }
515 if (changeDisallow) {
516 closingLaneReroute->setAttribute(SUMO_ATTR_DISALLOW, myClosingLaneRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
517 myClosingLaneRerouteTable->getItem(i, 1)->setText(closingLaneReroute->getAttribute(SUMO_ATTR_ALLOW).c_str());
518 }
519 // set Correct label
521 }
522 }
523 // update list
525 return 1;
526}
527
528
529long
532 // iterate over table and check that all parameters are correct
533 for (int i = 0; i < myClosingRerouteTable->getNumRows(); i++) {
534 GNEAdditional* closingReroute = myClosingReroutesEdited.at(i);
535 if (!SUMOXMLDefinitions::isValidNetID(myClosingRerouteTable->getItem(i, 0)->getText().text())) {
538 } else if (closingReroute->isValid(SUMO_ATTR_EDGE, myClosingRerouteTable->getItem(i, 0)->getText().text()) == false) {
541 } else if (closingReroute->isValid(SUMO_ATTR_ALLOW, myClosingRerouteTable->getItem(i, 1)->getText().text()) == false) {
544 } else if (closingReroute->isValid(SUMO_ATTR_DISALLOW, myClosingRerouteTable->getItem(i, 2)->getText().text()) == false) {
547 } else {
548 // check if allow/disallow should be changed
549 bool changeAllow = myClosingRerouteTable->getItem(i, 1)->getText().text() != closingReroute->getAttribute(SUMO_ATTR_ALLOW);
550 bool changeDisallow = myClosingRerouteTable->getItem(i, 2)->getText().text() != closingReroute->getAttribute(SUMO_ATTR_DISALLOW);
551 // set new values in Closing reroute
552 closingReroute->setAttribute(SUMO_ATTR_EDGE, myClosingRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
553 if (changeAllow) {
554 closingReroute->setAttribute(SUMO_ATTR_ALLOW, myClosingRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
555 myClosingRerouteTable->getItem(i, 2)->setText(closingReroute->getAttribute(SUMO_ATTR_DISALLOW).c_str());
556
557 }
558 if (changeDisallow) {
559 closingReroute->setAttribute(SUMO_ATTR_DISALLOW, myClosingRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
560 myClosingRerouteTable->getItem(i, 1)->setText(closingReroute->getAttribute(SUMO_ATTR_ALLOW).c_str());
561 }
562 // set Correct label
564 }
565 }
566 // update list
567 myClosingRerouteTable->update();
568 return 1;
569}
570
571
572long
575 // iterate over table and check that all parameters are correct
576 for (int i = 0; i < myDestProbRerouteTable->getNumRows(); i++) {
577 GNEAdditional* destProbReroute = myDestProbReroutesEdited.at(i);
578 if (!SUMOXMLDefinitions::isValidNetID(myDestProbRerouteTable->getItem(i, 0)->getText().text())) {
581 } else if (destProbReroute->isValid(SUMO_ATTR_EDGE, myDestProbRerouteTable->getItem(i, 0)->getText().text()) == false) {
584 } else if (destProbReroute->isValid(SUMO_ATTR_PROB, myDestProbRerouteTable->getItem(i, 1)->getText().text()) == false) {
587 } else {
588 // set new values in Closing reroute
589 destProbReroute->setAttribute(SUMO_ATTR_EDGE, myDestProbRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
590 destProbReroute->setAttribute(SUMO_ATTR_PROB, myDestProbRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
591 // set Correct label
593 }
594 }
595 // update list
596 myDestProbRerouteTable->update();
597 return 1;
598}
599
600
601long
604 // iterate over table and check that all parameters are correct
605 for (int i = 0; i < myRouteProbRerouteTable->getNumRows(); i++) {
606 GNEAdditional* routeProbReroute = myRouteProbReroutesEdited.at(i);
607 if (!SUMOXMLDefinitions::isValidNetID(myRouteProbRerouteTable->getItem(i, 0)->getText().text())) {
610 } else if (routeProbReroute->isValid(SUMO_ATTR_PROB, myRouteProbRerouteTable->getItem(i, 1)->getText().text()) == false) {
613 } else {
614 // set new values in Closing reroute
615 routeProbReroute->setAttribute(SUMO_ATTR_ROUTE, myRouteProbRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
616 routeProbReroute->setAttribute(SUMO_ATTR_PROB, myRouteProbRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
617 // set Correct label
619 }
620 }
621 // update list
622 myRouteProbRerouteTable->update();
623 return 1;
624}
625
626
627long
630 // iterate over table and check that all parameters are correct
631 for (int i = 0; i < myParkingAreaRerouteTable->getNumRows(); i++) {
632 GNEAdditional* parkingAreaReroute = myParkingAreaRerouteEdited.at(i);
633 if (parkingAreaReroute->isValid(SUMO_ATTR_PARKING, myParkingAreaRerouteTable->getItem(i, 0)->getText().text()) == false) {
636 } else if (parkingAreaReroute->isValid(SUMO_ATTR_PROB, myParkingAreaRerouteTable->getItem(i, 1)->getText().text()) == false) {
639 } else if (parkingAreaReroute->isValid(SUMO_ATTR_VISIBLE, myParkingAreaRerouteTable->getItem(i, 2)->getText().text()) == false) {
642 } else {
643 // set new values in Closing reroute
644 parkingAreaReroute->setAttribute(SUMO_ATTR_PARKING, myParkingAreaRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
645 parkingAreaReroute->setAttribute(SUMO_ATTR_PROB, myParkingAreaRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
646 parkingAreaReroute->setAttribute(SUMO_ATTR_VISIBLE, myParkingAreaRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
647 // set Correct label
649 }
650 }
651 // update list
653 return 1;
654}
655
656
657long
661 // set new values in rerouter interval
664 // change icon
665 myBeginEndValid = true;
667 } else {
668 myBeginEndValid = false;
670 }
671 return 0;
672}
673
674
675void
677 // clear table
678 myClosingLaneRerouteTable->clearItems();
679 // set number of rows
680 myClosingLaneRerouteTable->setTableSize(int(myClosingLaneReroutesEdited.size()), 5);
681 // Configure list
682 myClosingLaneRerouteTable->setVisibleColumns(5);
683 myClosingLaneRerouteTable->setColumnWidth(0, 83);
684 myClosingLaneRerouteTable->setColumnWidth(1, 83);
685 myClosingLaneRerouteTable->setColumnWidth(2, 82);
686 myClosingLaneRerouteTable->setColumnWidth(3, GUIDesignHeight);
687 myClosingLaneRerouteTable->setColumnWidth(4, GUIDesignHeight);
688 myClosingLaneRerouteTable->setColumnText(0, toString(SUMO_ATTR_LANE).c_str());
689 myClosingLaneRerouteTable->setColumnText(1, toString(SUMO_ATTR_ALLOW).c_str());
690 myClosingLaneRerouteTable->setColumnText(2, toString(SUMO_ATTR_DISALLOW).c_str());
691 myClosingLaneRerouteTable->setColumnText(3, "");
692 myClosingLaneRerouteTable->setColumnText(4, "");
693 myClosingLaneRerouteTable->getRowHeader()->setWidth(0);
694 // Declare pointer to FXTableItem
695 FXTableItem* item = nullptr;
696 // iterate over values
697 for (int i = 0; i < (int)myClosingLaneReroutesEdited.size(); i++) {
698 // Set closing edge
699 item = new FXTableItem(myClosingLaneReroutesEdited.at(i)->getAttribute(SUMO_ATTR_LANE).c_str());
700 myClosingLaneRerouteTable->setItem(i, 0, item);
701 // set allow vehicles
702 item = new FXTableItem(myClosingLaneReroutesEdited.at(i)->getAttribute(SUMO_ATTR_ALLOW).c_str());
703 myClosingLaneRerouteTable->setItem(i, 1, item);
704 // set disallow vehicles
705 item = new FXTableItem(myClosingLaneReroutesEdited.at(i)->getAttribute(SUMO_ATTR_DISALLOW).c_str());
706 myClosingLaneRerouteTable->setItem(i, 2, item);
707 // set valid icon
708 item = new FXTableItem("");
710 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
711 item->setEnabled(false);
712 myClosingLaneRerouteTable->setItem(i, 3, item);
713 // set remove
714 item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE));
715 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
716 item->setEnabled(false);
717 myClosingLaneRerouteTable->setItem(i, 4, item);
718 }
719}
720
721
722void
724 // clear table
725 myClosingRerouteTable->clearItems();
726 // set number of rows
727 myClosingRerouteTable->setTableSize(int(myClosingReroutesEdited.size()), 5);
728 // Configure list
729 myClosingRerouteTable->setVisibleColumns(5);
730 myClosingRerouteTable->setColumnWidth(0, 83);
731 myClosingRerouteTable->setColumnWidth(1, 83);
732 myClosingRerouteTable->setColumnWidth(2, 82);
733 myClosingRerouteTable->setColumnWidth(3, GUIDesignHeight);
734 myClosingRerouteTable->setColumnWidth(4, GUIDesignHeight);
735 myClosingRerouteTable->setColumnText(0, toString(SUMO_ATTR_EDGE).c_str());
736 myClosingRerouteTable->setColumnText(1, toString(SUMO_ATTR_ALLOW).c_str());
737 myClosingRerouteTable->setColumnText(2, toString(SUMO_ATTR_DISALLOW).c_str());
738 myClosingRerouteTable->setColumnText(3, "");
739 myClosingRerouteTable->setColumnText(4, "");
740 myClosingRerouteTable->getRowHeader()->setWidth(0);
741 // Declare pointer to FXTableItem
742 FXTableItem* item = nullptr;
743 // iterate over values
744 for (int i = 0; i < (int)myClosingReroutesEdited.size(); i++) {
745 // Set closing edge
746 item = new FXTableItem(myClosingReroutesEdited.at(i)->getAttribute(SUMO_ATTR_EDGE).c_str());
747 myClosingRerouteTable->setItem(i, 0, item);
748 // set allow vehicles
749 item = new FXTableItem(myClosingReroutesEdited.at(i)->getAttribute(SUMO_ATTR_ALLOW).c_str());
750 myClosingRerouteTable->setItem(i, 1, item);
751 // set disallow vehicles
752 item = new FXTableItem(myClosingReroutesEdited.at(i)->getAttribute(SUMO_ATTR_DISALLOW).c_str());
753 myClosingRerouteTable->setItem(i, 2, item);
754 // set valid icon
755 item = new FXTableItem("");
757 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
758 item->setEnabled(false);
759 myClosingRerouteTable->setItem(i, 3, item);
760 // set remove
761 item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE));
762 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
763 item->setEnabled(false);
764 myClosingRerouteTable->setItem(i, 4, item);
765 }
766}
767
768
769void
771 // clear table
772 myDestProbRerouteTable->clearItems();
773 // set number of rows
774 myDestProbRerouteTable->setTableSize(int(myDestProbReroutesEdited.size()), 4);
775 // Configure list
776 myDestProbRerouteTable->setVisibleColumns(4);
777 myDestProbRerouteTable->setColumnWidth(0, 124);
778 myDestProbRerouteTable->setColumnWidth(1, 124);
779 myDestProbRerouteTable->setColumnWidth(2, GUIDesignHeight);
780 myDestProbRerouteTable->setColumnWidth(3, GUIDesignHeight);
781 myDestProbRerouteTable->setColumnText(0, toString(SUMO_ATTR_EDGE).c_str());
782 myDestProbRerouteTable->setColumnText(1, toString(SUMO_ATTR_PROB).c_str());
783 myDestProbRerouteTable->setColumnText(2, "");
784 myDestProbRerouteTable->setColumnText(3, "");
785 myDestProbRerouteTable->getRowHeader()->setWidth(0);
786 // Declare pointer to FXTableItem
787 FXTableItem* item = nullptr;
788 // iterate over values
789 for (int i = 0; i < (int)myDestProbReroutesEdited.size(); i++) {
790 // Set new destination
791 item = new FXTableItem(myDestProbReroutesEdited.at(i)->getAttribute(SUMO_ATTR_EDGE).c_str());
792 myDestProbRerouteTable->setItem(i, 0, item);
793 // Set probability
794 item = new FXTableItem(myDestProbReroutesEdited.at(i)->getAttribute(SUMO_ATTR_PROB).c_str());
795 myDestProbRerouteTable->setItem(i, 1, item);
796 // set valid icon
797 item = new FXTableItem("");
799 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
800 item->setEnabled(false);
801 myDestProbRerouteTable->setItem(i, 2, item);
802 // set remove
803 item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE));
804 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
805 item->setEnabled(false);
806 myDestProbRerouteTable->setItem(i, 3, item);
807 }
808}
809
810
811void
813 // clear table
814 myRouteProbRerouteTable->clearItems();
815 // set number of rows
816 myRouteProbRerouteTable->setTableSize(int(myRouteProbReroutesEdited.size()), 4);
817 // Configure list
818 myRouteProbRerouteTable->setVisibleColumns(4);
819 myRouteProbRerouteTable->setColumnWidth(0, 124);
820 myRouteProbRerouteTable->setColumnWidth(1, 124);
821 myRouteProbRerouteTable->setColumnWidth(2, GUIDesignHeight);
822 myRouteProbRerouteTable->setColumnWidth(3, GUIDesignHeight);
823 myRouteProbRerouteTable->setColumnText(0, toString(SUMO_ATTR_ROUTE).c_str());
824 myRouteProbRerouteTable->setColumnText(1, toString(SUMO_ATTR_PROB).c_str());
825 myRouteProbRerouteTable->setColumnText(2, "");
826 myRouteProbRerouteTable->setColumnText(3, "");
827 myRouteProbRerouteTable->getRowHeader()->setWidth(0);
828 // Declare pointer to FXTableItem
829 FXTableItem* item = nullptr;
830 // iterate over values
831 for (int i = 0; i < (int)myRouteProbReroutesEdited.size(); i++) {
832 // Set new route
833 item = new FXTableItem(myRouteProbReroutesEdited.at(i)->getAttribute(SUMO_ATTR_ROUTE).c_str());
834 myRouteProbRerouteTable->setItem(i, 0, item);
835 // Set probability
836 item = new FXTableItem(myRouteProbReroutesEdited.at(i)->getAttribute(SUMO_ATTR_PROB).c_str());
837 myRouteProbRerouteTable->setItem(i, 1, item);
838 // set valid icon
839 item = new FXTableItem("");
841 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
842 item->setEnabled(false);
843 myRouteProbRerouteTable->setItem(i, 2, item);
844 // set remove
845 item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE));
846 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
847 item->setEnabled(false);
848 myRouteProbRerouteTable->setItem(i, 3, item);
849 }
850}
851
852
853void
855 // clear table
856 myParkingAreaRerouteTable->clearItems();
857 // set number of rows
858 myParkingAreaRerouteTable->setTableSize(int(myParkingAreaRerouteEdited.size()), 5);
859 // Configure list
860 myParkingAreaRerouteTable->setVisibleColumns(4);
861 myParkingAreaRerouteTable->setColumnWidth(0, 124);
862 myParkingAreaRerouteTable->setColumnWidth(1, 90);
863 myParkingAreaRerouteTable->setColumnWidth(2, 35);
864 myParkingAreaRerouteTable->setColumnWidth(3, GUIDesignHeight);
865 myParkingAreaRerouteTable->setColumnWidth(4, GUIDesignHeight);
866 myParkingAreaRerouteTable->setColumnText(0, toString(SUMO_ATTR_PARKING).c_str());
867 myParkingAreaRerouteTable->setColumnText(1, toString(SUMO_ATTR_PROB).c_str());
868 myParkingAreaRerouteTable->setColumnText(2, "vis.");
869 myParkingAreaRerouteTable->setColumnText(3, "");
870 myParkingAreaRerouteTable->setColumnText(4, "");
871 myParkingAreaRerouteTable->getRowHeader()->setWidth(0);
872 // Declare pointer to FXTableItem
873 FXTableItem* item = nullptr;
874 // iterate over values
875 for (int i = 0; i < (int)myParkingAreaRerouteEdited.size(); i++) {
876 // Set new destination
877 item = new FXTableItem(myParkingAreaRerouteEdited.at(i)->getAttribute(SUMO_ATTR_PARKING).c_str());
878 myParkingAreaRerouteTable->setItem(i, 0, item);
879 // Set probability
880 item = new FXTableItem(myParkingAreaRerouteEdited.at(i)->getAttribute(SUMO_ATTR_PROB).c_str());
881 myParkingAreaRerouteTable->setItem(i, 1, item);
882 // Set visible
883 item = new FXTableItem(myParkingAreaRerouteEdited.at(i)->getAttribute(SUMO_ATTR_VISIBLE) == "1" ? "true" : "false");
884 myParkingAreaRerouteTable->setItem(i, 2, item);
885 // set valid icon
886 item = new FXTableItem("");
888 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
889 item->setEnabled(false);
890 myParkingAreaRerouteTable->setItem(i, 3, item);
891 // set remove
892 item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE));
893 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
894 item->setEnabled(false);
895 myParkingAreaRerouteTable->setItem(i, 4, item);
896 }
897}
898
899
900/****************************************************************************/
FXDEFMAP(GNERerouterIntervalDialog) GNERerouterIntervalDialogMap[]
@ MID_GNE_REROUTEDIALOG_EDIT_INTERVAL
edit interval
@ MID_GNE_REROUTEDIALOG_TABLE_PARKINGAREAREROUTE
change table parkingAreaReroute
@ MID_GNE_REROUTEDIALOG_ADD_CLOSINGREROUTE
add closing reroute
@ MID_GNE_REROUTEDIALOG_TABLE_CLOSINGLANEREROUTE
change table closing lane reroute reroute
@ MID_GNE_REROUTEDIALOG_ADD_CLOSINGLANEREROUTE
add closing lane reroute
@ MID_GNE_REROUTEDIALOG_TABLE_ROUTEPROBREROUTE
change table route probability reroute
@ MID_GNE_REROUTEDIALOG_ADD_PARKINGAREAREROUTE
add parkingAreaReroute
@ MID_GNE_REROUTEDIALOG_ADD_DESTPROBREROUTE
add destination probability route
@ MID_GNE_REROUTEDIALOG_TABLE_DESTPROBREROUTE
change table destination probability reroute
@ MID_GNE_REROUTEDIALOG_TABLE_CLOSINGREROUTE
change table route closing reroute
@ MID_GNE_REROUTEDIALOG_ADD_ROUTEPROBREROUTE
add route probability route
#define GUIDesignButtonIcon
button only with icon
Definition GUIDesigns.h:97
#define GUIDesignTableAdditionals
design for tables used in additional dialogs
Definition GUIDesigns.h:637
#define GUIDesignTextField
Definition GUIDesigns.h:65
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:405
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:80
#define GUIDesignUniformHorizontalFrame
design for horizontal frame used to pack another frames with a uniform width
Definition GUIDesigns.h:414
#define GUIDesignLabelIcon32x32Thicked
label ticked filled only with an icon of 32x32
Definition GUIDesigns.h:273
#define GUIDesignLabelThick(justify)
label extended over frame with thick and with text justify to left
Definition GUIDesigns.h:255
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
Definition GUIDesigns.h:396
#define WRITE_DEBUG(msg)
Definition MsgHandler.h:306
#define WRITE_WARNING(msg)
Definition MsgHandler.h:295
#define TL(string)
Definition MsgHandler.h:315
const SVCPermissions SVCAll
all VClasses are allowed
@ SUMO_TAG_CLOSING_REROUTE
reroute of type closing
@ SUMO_TAG_PARKING_AREA_REROUTE
entry for an alternative parking zone
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_ROUTE_PROB_REROUTE
probability of route of a reroute
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ SUMO_TAG_DEST_PROB_REROUTE
probability of destination of a reroute
@ SUMO_TAG_CLOSING_LANE_REROUTE
lane of a reroute of type closing
@ SUMO_ATTR_PARKING
@ SUMO_ATTR_DISALLOW
@ SUMO_ATTR_ALLOW
@ SUMO_ATTR_LANE
@ SUMO_ATTR_EDGE
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_PROB
@ SUMO_ATTR_ROUTE
@ SUMO_ATTR_VISIBLE
int GUIDesignHeight
the default size for GUI elements
Definition StdDefs.cpp:35
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
Dialog to edit sequences, parameters, etc.. of Additionals.
bool myUpdatingElement
flag to indicate if additional are being created or modified (cannot be changed after open dialog)
void acceptChanges()
Accept changes did in this dialog.
void cancelChanges()
Cancel changes did in this dialog.
GNEAdditional * myEditedAdditional
pointer to edited additional
void resetChanges()
reset changes did in this dialog.
An Element which don't belong to GNENet but has influence in the simulation.
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 additional changes
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
method for checking if the key and their correspondent attribute are valids
const std::string & getTagStr() const
get tag assigned to this object in string format
GNENet * getNet() const
get pointer to net
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEAdditional * > > & getAdditionals() const
get additionals
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEDemandElement * > > & getDemandElements() const
get demand elements
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:125
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2147
Dialog for edit rerouter intervals.
long onCmdAddDestProbReroute(FXObject *, FXSelector, void *)
add dest prob reroute
long onCmdClickedClosingReroute(FXObject *, FXSelector, void *)
remove closing reroute
bool myRouteProbReroutesValid
flag to check if route prob reroutes are valid
long onCmdAddClosingReroute(FXObject *, FXSelector, void *)
add closing reroute
void updateRouteProbReroutesTable()
update data of probability reroutes table
std::vector< GNEAdditional * > myRouteProbReroutesEdited
Route Prob Reroutes edited.
long onCmdClickedClosingLaneReroute(FXObject *, FXSelector, void *)
remove closing lane reroute
void updateClosingLaneReroutesTable()
update data of closing lane reroute table
FXTable * myDestProbRerouteTable
list with destination probability reroutes
bool myDestProbReroutesValid
flag to check if Destination probability reroutes are valid
long onCmdClickedRouteProbReroute(FXObject *, FXSelector, void *)
remove route prob reroute
FXTable * myClosingRerouteTable
list with closing reroutes
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
FXTextField * myEndTextField
end time text field
long onCmdEditClosingLaneReroute(FXObject *, FXSelector, void *)
/edit closing lane reroute
std::vector< GNEAdditional * > myClosingReroutesEdited
closing Reroutes edited
void updateClosingReroutesTable()
update data of closing reroute table
long onCmdEditRouteProbReroute(FXObject *, FXSelector, void *)
/edit route prob reroute
void updateDestProbReroutesTable()
update data of destination probability reroute table
FXLabel * myCheckLabel
begin/end time check label
FXTextField * myBeginTextField
begin time text field
std::vector< GNEAdditional * > myClosingLaneReroutesEdited
closing Lane Reroutes edited
FXTable * myParkingAreaRerouteTable
list with parkingAreaReroutes
bool myClosingReroutesValid
flag to check if closing reroutes are valid
long onCmdAddRouteProbReroute(FXObject *, FXSelector, void *)
add route prob reroute
long onCmdChangeBeginEnd(FXObject *, FXSelector, void *)
called when begin or end is changed
long onCmdAddParkingAreaReroute(FXObject *, FXSelector, void *)
add parkingAreaReroute
bool myParkingAreaReroutesValid
flag to check if parkingAreaReroutes are valid
long onCmdAddClosingLaneReroute(FXObject *, FXSelector, void *)
add closing lane reroute
FXTable * myClosingLaneRerouteTable
list with closing lane reroutes
bool myBeginEndValid
flag to check if begin an end are valid
FXTable * myRouteProbRerouteTable
list with route probability reroute
long onCmdEditClosingReroute(FXObject *, FXSelector, void *)
/edit closing reroute
long onCmdClickedParkingAreaReroute(FXObject *, FXSelector, void *)
remove parkingAreaReroute
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
std::vector< GNEAdditional * > myParkingAreaRerouteEdited
Parking Area reroute edited.
long onCmdEditDestProbReroute(FXObject *, FXSelector, void *)
/edit dest prob reroute
bool myClosingLaneReroutesValid
flag to check if closing lane reroutes are valid
long onCmdClickedDestProbReroute(FXObject *, FXSelector, void *)
remove dest prob reroute
long onCmdAccept(FXObject *, FXSelector, void *)
long onCmdEditParkingAreaReroute(FXObject *, FXSelector, void *)
/edit parkingAreaReroute
std::vector< GNEAdditional * > myDestProbReroutesEdited
Dest Prob Reroutes edited.
void updateParkingAreaReroutesTable()
update data of parkingAreaReroute table
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...
GNEUndoList * getUndoList() const
get the undoList object
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
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element