Eclipse SUMO - Simulation of Urban MObility
GNERerouterIntervalDialog.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // Dialog for edit rerouter intervals
16 /****************************************************************************/
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 #include <config.h>
22 
26 #include <netedit/GNEViewNet.h>
27 #include <netedit/GNENet.h>
28 #include <netedit/GNEUndoList.h>
29 
31 
32 
33 // ===========================================================================
34 // FOX callback mapping
35 // ===========================================================================
36 
37 FXDEFMAP(GNERerouterIntervalDialog) GNERerouterIntervalDialogMap[] = {
38  // called when user click over buttons
44 
45  // clicked table (Double and triple clicks allow to remove element more fast)
61 
62  // use "update" instead of "command" to avoid problems mit icons
69 };
70 
71 // Object implementation
72 FXIMPLEMENT(GNERerouterIntervalDialog, GNEAdditionalDialog, GNERerouterIntervalDialogMap, ARRAYNUMBER(GNERerouterIntervalDialogMap))
73 
74 // ===========================================================================
75 // member method definitions
76 // ===========================================================================
77 
78 GNERerouterIntervalDialog::GNERerouterIntervalDialog(GNEAdditional* rerouterInterval, bool updatingElement) :
79  GNEAdditionalDialog(rerouterInterval, updatingElement, 960, 480),
80  myBeginEndValid(true),
81  myClosingLaneReroutesValid(true),
82  myClosingReroutesValid(true),
83  myDestProbReroutesValid(true),
84  myParkingAreaReroutesValid(true),
85  myRouteProbReroutesValid(true) {
86  // fill closing Reroutes
87  for (auto i : myEditedAdditional->getAdditionalChildren()) {
88  if (i->getTagProperty().getTag() == SUMO_TAG_CLOSING_REROUTE) {
89  myClosingReroutesEdited.push_back(i);
90  }
91  }
92  // fill closing Lane Reroutes
93  for (auto i : myEditedAdditional->getAdditionalChildren()) {
94  if (i->getTagProperty().getTag() == SUMO_TAG_CLOSING_LANE_REROUTE) {
95  myClosingLaneReroutesEdited.push_back(i);
96  }
97  }
98  // fill Dest Prob Reroutes
99  for (auto i : myEditedAdditional->getAdditionalChildren()) {
100  if (i->getTagProperty().getTag() == SUMO_TAG_DEST_PROB_REROUTE) {
101  myDestProbReroutesEdited.push_back(i);
102  }
103  }
104  // fill Route Prob Reroutes
105  for (auto i : myEditedAdditional->getAdditionalChildren()) {
106  if (i->getTagProperty().getTag() == SUMO_TAG_ROUTE_PROB_REROUTE) {
107  myRouteProbReroutesEdited.push_back(i);
108  }
109  }
110  // fill Parking Area reroutes
111  for (auto i : myEditedAdditional->getAdditionalChildren()) {
112  if (i->getTagProperty().getTag() == SUMO_TAG_PARKING_ZONE_REROUTE) {
113  myParkingAreaRerouteEdited.push_back(i);
114  }
115  }
116  // change default header
117  std::string typeOfOperation = myUpdatingElement ? "Edit " + myEditedAdditional->getTagStr() + " of " : "Create " + myEditedAdditional->getTagStr() + " for ";
118  changeAdditionalDialogHeader(typeOfOperation + myEditedAdditional->getAdditionalParents().at(0)->getTagStr() + " '" + myEditedAdditional->getAdditionalParents().at(0)->getID() + "'");
119 
120  // Create auxiliar frames for tables
121  FXHorizontalFrame* columns = new FXHorizontalFrame(myContentFrame, GUIDesignUniformHorizontalFrame);
122  FXVerticalFrame* columnLeft = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
123  FXVerticalFrame* columnRight = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
124  FXVerticalFrame* columnRight2 = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
125 
126  // create horizontal frame for begin and end label
127  FXHorizontalFrame* beginEndElementsLeft = new FXHorizontalFrame(columnLeft, GUIDesignAuxiliarHorizontalFrame);
128  new FXLabel(beginEndElementsLeft, (toString(SUMO_ATTR_BEGIN) + " and " + toString(SUMO_ATTR_END) + " of " + myEditedAdditional->getTagStr()).c_str(), nullptr, GUIDesignLabelLeftThick);
129  myCheckLabel = new FXLabel(beginEndElementsLeft, "", GUIIconSubSys::getIcon(ICON_CORRECT), GUIDesignLabelIcon32x32Thicked);
130 
131  // create horizontal frame for begin and end text fields
132  FXHorizontalFrame* beginEndElementsRight = new FXHorizontalFrame(columnRight, GUIDesignAuxiliarHorizontalFrame);
133  myBeginTextField = new FXTextField(beginEndElementsRight, GUIDesignTextFieldNCol, this, MID_GNE_REROUTEDIALOG_EDIT_INTERVAL, GUIDesignTextFieldReal);
134  myBeginTextField->setText(toString(myEditedAdditional->getAttribute(SUMO_ATTR_BEGIN)).c_str());
135  myEndTextField = new FXTextField(beginEndElementsRight, GUIDesignTextFieldNCol, this, MID_GNE_REROUTEDIALOG_EDIT_INTERVAL, GUIDesignTextFieldReal);
136  myEndTextField->setText(toString(myEditedAdditional->getAttribute(SUMO_ATTR_END)).c_str());
137 
138  // Create labels and tables
139  FXHorizontalFrame* buttonAndLabelClosingLaneReroute = new FXHorizontalFrame(columnLeft, GUIDesignAuxiliarHorizontalFrame);
140  myAddClosingLaneReroutes = new FXButton(buttonAndLabelClosingLaneReroute, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_REROUTEDIALOG_ADD_CLOSINGLANEREROUTE, GUIDesignButtonIcon);
141  new FXLabel(buttonAndLabelClosingLaneReroute, ("Add new " + toString(SUMO_TAG_CLOSING_LANE_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick);
142  myClosingLaneRerouteTable = new FXTable(columnLeft, this, MID_GNE_REROUTEDIALOG_TABLE_CLOSINGLANEREROUTE, GUIDesignTableAdditionals);
143  myClosingLaneRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
144  myClosingLaneRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
145 
146  FXHorizontalFrame* buttonAndLabelClosinReroute = new FXHorizontalFrame(columnLeft, GUIDesignAuxiliarHorizontalFrame);
147  myAddClosingReroutes = new FXButton(buttonAndLabelClosinReroute, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_REROUTEDIALOG_ADD_CLOSINGREROUTE, GUIDesignButtonIcon);
148  new FXLabel(buttonAndLabelClosinReroute, ("Add new " + toString(SUMO_TAG_CLOSING_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick);
149  myClosingRerouteTable = new FXTable(columnLeft, this, MID_GNE_REROUTEDIALOG_TABLE_CLOSINGREROUTE, GUIDesignTableAdditionals);
150  myClosingRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
151  myClosingRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
152 
153  FXHorizontalFrame* buttonAndLabelDestProbReroute = new FXHorizontalFrame(columnRight, GUIDesignAuxiliarHorizontalFrame);
154  myAddDestProbReroutes = new FXButton(buttonAndLabelDestProbReroute, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_REROUTEDIALOG_ADD_DESTPROBREROUTE, GUIDesignButtonIcon);
155  new FXLabel(buttonAndLabelDestProbReroute, ("Add new " + toString(SUMO_TAG_DEST_PROB_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick);
156  myDestProbRerouteTable = new FXTable(columnRight, this, MID_GNE_REROUTEDIALOG_TABLE_DESTPROBREROUTE, GUIDesignTableAdditionals);
157  myDestProbRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
158  myDestProbRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
159 
160  FXHorizontalFrame* buttonAndLabelRouteProbReroute = new FXHorizontalFrame(columnRight, GUIDesignAuxiliarHorizontalFrame);
161  myAddRouteProbReroute = new FXButton(buttonAndLabelRouteProbReroute, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_REROUTEDIALOG_ADD_ROUTEPROBREROUTE, GUIDesignButtonIcon);
162  FXLabel* routeProbRerouteLabel = new FXLabel(buttonAndLabelRouteProbReroute, ("Add new " + toString(SUMO_TAG_ROUTE_PROB_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick);
163  myRouteProbRerouteTable = new FXTable(columnRight, this, MID_GNE_REROUTEDIALOG_TABLE_ROUTEPROBREROUTE, GUIDesignTableAdditionals);
164  myRouteProbRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
165  myRouteProbRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
166 
167  FXHorizontalFrame* buttonAndLabelParkingAreaReroute = new FXHorizontalFrame(columnRight2, GUIDesignAuxiliarHorizontalFrame);
168  FXButton* parkingAreaRerouteButton = myAddParkingAreaReroute = new FXButton(buttonAndLabelParkingAreaReroute, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_REROUTEDIALOG_ADD_PARKINGAREAREROUTE, GUIDesignButtonIcon);
169  FXLabel* parkingAreaRerouteLabel = new FXLabel(buttonAndLabelParkingAreaReroute, ("Add new " + toString(SUMO_TAG_PARKING_ZONE_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick);
170  myParkingAreaRerouteTable = new FXTable(columnRight2, this, MID_GNE_REROUTEDIALOG_TABLE_PARKINGAREAREROUTE, GUIDesignTableAdditionals);
171  myParkingAreaRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
172  myParkingAreaRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
173 
174  // disable add parkingAreaReroute Button and change label if there isn't parkingAreas in net
175  if (rerouterInterval->getViewNet()->getNet()->getAttributeCarriers().additionals.at(SUMO_TAG_PARKING_AREA).size() == 0) {
176  parkingAreaRerouteButton->disable();
177  parkingAreaRerouteLabel->setText(("There isn't " + toString(SUMO_TAG_PARKING_AREA) + "s in net").c_str());
178  }
179 
180  // disable add routeProbReroute Button and change label if the rerouter has multiple edges (random routes can only work from one edge)
181  if (rerouterInterval->getAdditionalParents().at(0)->getEdgeChildren().size() > 1) {
182  myAddRouteProbReroute->disable();
183  routeProbRerouteLabel->setText("Rerouter has more than one edge");
184  }
185 
186  // update tables
187  updateClosingLaneReroutesTable();
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 == false) {
198  myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(myEditedAdditional, true), true);
199  }
200 
201  // Open as modal dialog
202  openAsModalDialog();
203 }
204 
205 
207 
208 
209 long
210 GNERerouterIntervalDialog::onCmdAccept(FXObject*, FXSelector, void*) {
211  // set strings for dialogs
212  std::string errorTitle = "Error" + toString(myUpdatingElement ? "updating" : "creating") + " " + myEditedAdditional->getTagStr() + " of " + myEditedAdditional->getAdditionalParents().at(0)->getTagStr();
213  std::string operationType = myEditedAdditional->getAdditionalParents().at(0)->getTagStr() + "'s " + myEditedAdditional->getTagStr() + " cannot be " + (myUpdatingElement ? "updated" : "created") + " because ";
214  if (myBeginEndValid == false) {
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() &&
225  myParkingAreaRerouteEdited.empty() &&
226  myRouteProbReroutesEdited.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_ZONE_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
276  acceptChanges();
277  // Stop Modal
278  getApp()->stopModal(this, TRUE);
279  return 1;
280  }
281 }
282 
283 
284 long
285 GNERerouterIntervalDialog::onCmdCancel(FXObject*, FXSelector, void*) {
286  // cancel changes
287  cancelChanges();
288  // Stop Modal
289  getApp()->stopModal(this, FALSE);
290  return 1;
291 }
292 
293 
294 long
295 GNERerouterIntervalDialog::onCmdReset(FXObject*, FXSelector, void*) {
296  // reset changes
297  resetChanges();
298  // update tables
303  return 1;
304 }
305 
306 
307 long
309  // create closing lane reroute
310  GNEClosingLaneReroute* closingLaneReroute = new GNEClosingLaneReroute(this);
311  myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(closingLaneReroute, true), true);
312  myClosingLaneReroutesEdited.push_back(closingLaneReroute);
313  // update closing lane reroutes table
315  return 1;
316 }
317 
318 
319 long
321  // create closing reroute
322  GNEClosingReroute* closingReroute = new GNEClosingReroute(this);
323  myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(closingReroute, true), true);
324  myClosingReroutesEdited.push_back(closingReroute);
325  // update closing reroutes table
327  return 1;
328 }
329 
330 
331 long
333  // create closing reroute and add it to table
334  GNEDestProbReroute* destProbReroute = new GNEDestProbReroute(this);
335  myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(destProbReroute, true), true);
336  myDestProbReroutesEdited.push_back(destProbReroute);
337  // update dest Prob reroutes table
339  return 1;
340 }
341 
342 
343 long
345  // create route Prob Reroute
346  GNERouteProbReroute* routeProbReroute = new GNERouteProbReroute(this);
347  myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(routeProbReroute, true), true);
348  myRouteProbReroutesEdited.push_back(routeProbReroute);
349  // update route prob reroutes table
351  return 1;
352 }
353 
354 
355 long
357  // create parkingAreaReroute and add it to table
358  GNEParkingAreaReroute* parkingAreaReroute = new GNEParkingAreaReroute(this);
359  myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(parkingAreaReroute, true), true);
360  myParkingAreaRerouteEdited.push_back(parkingAreaReroute);
361  // update dest Prob reroutes table
363  return 1;
364 }
365 
366 
367 long
369  // check if some delete button was pressed
370  for (int i = 0; i < (int)myClosingLaneReroutesEdited.size(); i++) {
371  if (myClosingLaneRerouteTable->getItem(i, 4)->hasFocus()) {
372  myClosingLaneRerouteTable->removeRows(i);
376  return 1;
377  }
378  }
379  return 0;
380 }
381 
382 
383 long
385  // check if some delete button was pressed
386  for (int i = 0; i < (int)myClosingReroutesEdited.size(); i++) {
387  if (myClosingRerouteTable->getItem(i, 4)->hasFocus()) {
388  myClosingRerouteTable->removeRows(i);
392  return 1;
393  }
394  }
395  return 1;
396 }
397 
398 
399 long
401  // check if some delete button was pressed
402  for (int i = 0; i < (int)myDestProbReroutesEdited.size(); i++) {
403  if (myDestProbRerouteTable->getItem(i, 3)->hasFocus()) {
404  myDestProbRerouteTable->removeRows(i);
408  return 1;
409  }
410  }
411  return 0;
412 }
413 
414 
415 long
417  // check if some delete button was pressed
418  for (int i = 0; i < (int)myRouteProbReroutesEdited.size(); i++) {
419  if (myRouteProbRerouteTable->getItem(i, 3)->hasFocus()) {
420  myRouteProbRerouteTable->removeRows(i);
424  return 1;
425  }
426  }
427  return 0;
428 }
429 
430 
431 long
433  // check if some delete button was pressed
434  for (int i = 0; i < (int)myParkingAreaRerouteEdited.size(); i++) {
435  if (myParkingAreaRerouteTable->getItem(i, 3)->hasFocus()) {
436  ;
437  } else if (myParkingAreaRerouteTable->getItem(i, 4)->hasFocus()) {
438  myParkingAreaRerouteTable->removeRows(i);
442  return 1;
443  }
444  }
445  return 0;
446 }
447 
448 
449 long
452  // iterate over table and check that all parameters are correct
453  for (int i = 0; i < myClosingLaneRerouteTable->getNumRows(); i++) {
454  GNEAdditional* closingLaneReroute = myClosingLaneReroutesEdited.at(i);
455  if (!SUMOXMLDefinitions::isValidNetID(myClosingLaneRerouteTable->getItem(i, 0)->getText().text())) {
458  } else if (closingLaneReroute->isValid(SUMO_ATTR_ALLOW, myClosingLaneRerouteTable->getItem(i, 1)->getText().text()) == false) {
461  } else if (closingLaneReroute->isValid(SUMO_ATTR_DISALLOW, myClosingLaneRerouteTable->getItem(i, 2)->getText().text()) == false) {
464  } else {
465  // check if allow/disallow should be changed
466  bool changeAllow = myClosingLaneRerouteTable->getItem(i, 1)->getText().text() != closingLaneReroute->getAttribute(SUMO_ATTR_ALLOW);
467  bool changeDisallow = myClosingLaneRerouteTable->getItem(i, 2)->getText().text() != closingLaneReroute->getAttribute(SUMO_ATTR_DISALLOW);
468  // set new values in Closing reroute
469  closingLaneReroute->setAttribute(SUMO_ATTR_LANE, myClosingLaneRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getViewNet()->getUndoList());
470  if (changeAllow) {
471  closingLaneReroute->setAttribute(SUMO_ATTR_ALLOW, myClosingLaneRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getViewNet()->getUndoList());
472  myClosingLaneRerouteTable->getItem(i, 2)->setText(closingLaneReroute->getAttribute(SUMO_ATTR_DISALLOW).c_str());
473 
474  }
475  if (changeDisallow) {
476  closingLaneReroute->setAttribute(SUMO_ATTR_DISALLOW, myClosingLaneRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getViewNet()->getUndoList());
477  myClosingLaneRerouteTable->getItem(i, 1)->setText(closingLaneReroute->getAttribute(SUMO_ATTR_ALLOW).c_str());
478  }
479  // set Correct label
481  }
482  }
483  // update list
484  myClosingLaneRerouteTable->update();
485  return 1;
486 }
487 
488 
489 long
491  myClosingReroutesValid = true;
492  // iterate over table and check that all parameters are correct
493  for (int i = 0; i < myClosingRerouteTable->getNumRows(); i++) {
494  GNEAdditional* closingReroute = myClosingReroutesEdited.at(i);
495  if (!SUMOXMLDefinitions::isValidNetID(myClosingRerouteTable->getItem(i, 0)->getText().text())) {
496  myClosingReroutesValid = false;
497  myClosingRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR));
498  } else if (closingReroute->isValid(SUMO_ATTR_ALLOW, myClosingRerouteTable->getItem(i, 1)->getText().text()) == false) {
499  myClosingReroutesValid = false;
500  myClosingRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR));
501  } else if (closingReroute->isValid(SUMO_ATTR_DISALLOW, myClosingRerouteTable->getItem(i, 2)->getText().text()) == false) {
502  myClosingReroutesValid = false;
503  myClosingRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR));
504  } else {
505  // check if allow/disallow should be changed
506  bool changeAllow = myClosingRerouteTable->getItem(i, 1)->getText().text() != closingReroute->getAttribute(SUMO_ATTR_ALLOW);
507  bool changeDisallow = myClosingRerouteTable->getItem(i, 2)->getText().text() != closingReroute->getAttribute(SUMO_ATTR_DISALLOW);
508  // set new values in Closing reroute
509  closingReroute->setAttribute(SUMO_ATTR_EDGE, myClosingRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getViewNet()->getUndoList());
510  if (changeAllow) {
511  closingReroute->setAttribute(SUMO_ATTR_ALLOW, myClosingRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getViewNet()->getUndoList());
512  myClosingRerouteTable->getItem(i, 2)->setText(closingReroute->getAttribute(SUMO_ATTR_DISALLOW).c_str());
513 
514  }
515  if (changeDisallow) {
516  closingReroute->setAttribute(SUMO_ATTR_DISALLOW, myClosingRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getViewNet()->getUndoList());
517  myClosingRerouteTable->getItem(i, 1)->setText(closingReroute->getAttribute(SUMO_ATTR_ALLOW).c_str());
518  }
519  // set Correct label
521  }
522  }
523  // update list
524  myClosingRerouteTable->update();
525  return 1;
526 }
527 
528 
529 long
532  // iterate over table and check that all parameters are correct
533  for (int i = 0; i < myDestProbRerouteTable->getNumRows(); i++) {
534  GNEAdditional* destProbReroute = myDestProbReroutesEdited.at(i);
535  if (!SUMOXMLDefinitions::isValidNetID(myDestProbRerouteTable->getItem(i, 0)->getText().text())) {
536  myDestProbReroutesValid = false;
537  myDestProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR));
538  } else if (destProbReroute->isValid(SUMO_ATTR_PROB, myDestProbRerouteTable->getItem(i, 1)->getText().text()) == false) {
539  myDestProbReroutesValid = false;
540  myDestProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR));
541  } else {
542  // set new values in Closing reroute
543  destProbReroute->setAttribute(SUMO_ATTR_EDGE, myDestProbRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getViewNet()->getUndoList());
544  destProbReroute->setAttribute(SUMO_ATTR_PROB, myDestProbRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getViewNet()->getUndoList());
545  // set Correct label
547  }
548  }
549  // update list
550  myDestProbRerouteTable->update();
551  return 1;
552 }
553 
554 
555 long
558  // iterate over table and check that all parameters are correct
559  for (int i = 0; i < myRouteProbRerouteTable->getNumRows(); i++) {
560  GNEAdditional* routeProbReroute = myRouteProbReroutesEdited.at(i);
561  if (!SUMOXMLDefinitions::isValidNetID(myRouteProbRerouteTable->getItem(i, 0)->getText().text())) {
562  myRouteProbReroutesValid = false;
564  } else if (routeProbReroute->isValid(SUMO_ATTR_PROB, myRouteProbRerouteTable->getItem(i, 1)->getText().text()) == false) {
565  myRouteProbReroutesValid = false;
567  } else {
568  // set new values in Closing reroute
569  routeProbReroute->setAttribute(SUMO_ATTR_ROUTE, myRouteProbRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getViewNet()->getUndoList());
570  routeProbReroute->setAttribute(SUMO_ATTR_PROB, myRouteProbRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getViewNet()->getUndoList());
571  // set Correct label
573  }
574  }
575  // update list
576  myRouteProbRerouteTable->update();
577  return 1;
578 }
579 
580 
581 long
584  // iterate over table and check that all parameters are correct
585  for (int i = 0; i < myParkingAreaRerouteTable->getNumRows(); i++) {
586  GNEAdditional* parkingAreaReroute = myParkingAreaRerouteEdited.at(i);
587  if (!SUMOXMLDefinitions::isValidNetID(myParkingAreaRerouteTable->getItem(i, 0)->getText().text())) {
590  } else if (parkingAreaReroute->isValid(SUMO_ATTR_PROB, myParkingAreaRerouteTable->getItem(i, 1)->getText().text()) == false) {
593  } else if (parkingAreaReroute->isValid(SUMO_ATTR_VISIBLE, myParkingAreaRerouteTable->getItem(i, 2)->getText().text()) == false) {
596  } else {
597  // set new values in Closing reroute
598  parkingAreaReroute->setAttribute(SUMO_ATTR_PARKING, myParkingAreaRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getViewNet()->getUndoList());
599  parkingAreaReroute->setAttribute(SUMO_ATTR_PROB, myParkingAreaRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getViewNet()->getUndoList());
600  parkingAreaReroute->setAttribute(SUMO_ATTR_VISIBLE, myParkingAreaRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getViewNet()->getUndoList());
601  // set Correct label
603  }
604  }
605  // update list
606  myParkingAreaRerouteTable->update();
607  return 1;
608 }
609 
610 
611 long
612 GNERerouterIntervalDialog::onCmdChangeBeginEnd(FXObject*, FXSelector, void*) {
613  if (myEditedAdditional->isValid(SUMO_ATTR_BEGIN, myBeginTextField->getText().text()) &&
615  // set new values in rerouter interval
618  // sort intervals of rerouter
620  // change icon
621  myBeginEndValid = true;
623  } else {
624  myBeginEndValid = false;
626  }
627  return 0;
628 }
629 
630 
631 void
633  // clear table
634  myClosingLaneRerouteTable->clearItems();
635  // set number of rows
636  myClosingLaneRerouteTable->setTableSize(int(myClosingLaneReroutesEdited.size()), 5);
637  // Configure list
638  myClosingLaneRerouteTable->setVisibleColumns(5);
639  myClosingLaneRerouteTable->setColumnWidth(0, 83);
640  myClosingLaneRerouteTable->setColumnWidth(1, 83);
641  myClosingLaneRerouteTable->setColumnWidth(2, 82);
644  myClosingLaneRerouteTable->setColumnText(0, toString(SUMO_ATTR_LANE).c_str());
645  myClosingLaneRerouteTable->setColumnText(1, toString(SUMO_ATTR_ALLOW).c_str());
646  myClosingLaneRerouteTable->setColumnText(2, toString(SUMO_ATTR_DISALLOW).c_str());
647  myClosingLaneRerouteTable->setColumnText(3, "");
648  myClosingLaneRerouteTable->setColumnText(4, "");
649  myClosingLaneRerouteTable->getRowHeader()->setWidth(0);
650  // Declare pointer to FXTableItem
651  FXTableItem* item = nullptr;
652  // iterate over values
653  for (int i = 0; i < (int)myClosingLaneReroutesEdited.size(); i++) {
654  // Set closing edge
655  item = new FXTableItem(myClosingLaneReroutesEdited.at(i)->getAttribute(SUMO_ATTR_LANE).c_str());
656  myClosingLaneRerouteTable->setItem(i, 0, item);
657  // set allow vehicles
658  item = new FXTableItem(myClosingLaneReroutesEdited.at(i)->getAttribute(SUMO_ATTR_ALLOW).c_str());
659  myClosingLaneRerouteTable->setItem(i, 1, item);
660  // set disallow vehicles
661  item = new FXTableItem(myClosingLaneReroutesEdited.at(i)->getAttribute(SUMO_ATTR_DISALLOW).c_str());
662  myClosingLaneRerouteTable->setItem(i, 2, item);
663  // set valid icon
664  item = new FXTableItem("");
665  item->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT));
666  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
667  item->setEnabled(false);
668  myClosingLaneRerouteTable->setItem(i, 3, item);
669  // set remove
670  item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE));
671  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
672  item->setEnabled(false);
673  myClosingLaneRerouteTable->setItem(i, 4, item);
674  }
675 }
676 
677 
678 void
680  // clear table
681  myClosingRerouteTable->clearItems();
682  // set number of rows
683  myClosingRerouteTable->setTableSize(int(myClosingReroutesEdited.size()), 5);
684  // Configure list
685  myClosingRerouteTable->setVisibleColumns(5);
686  myClosingRerouteTable->setColumnWidth(0, 83);
687  myClosingRerouteTable->setColumnWidth(1, 83);
688  myClosingRerouteTable->setColumnWidth(2, 82);
691  myClosingRerouteTable->setColumnText(0, toString(SUMO_ATTR_EDGE).c_str());
692  myClosingRerouteTable->setColumnText(1, toString(SUMO_ATTR_ALLOW).c_str());
693  myClosingRerouteTable->setColumnText(2, toString(SUMO_ATTR_DISALLOW).c_str());
694  myClosingRerouteTable->setColumnText(3, "");
695  myClosingRerouteTable->setColumnText(4, "");
696  myClosingRerouteTable->getRowHeader()->setWidth(0);
697  // Declare pointer to FXTableItem
698  FXTableItem* item = nullptr;
699  // iterate over values
700  for (int i = 0; i < (int)myClosingReroutesEdited.size(); i++) {
701  // Set closing edge
702  item = new FXTableItem(myClosingReroutesEdited.at(i)->getAttribute(SUMO_ATTR_EDGE).c_str());
703  myClosingRerouteTable->setItem(i, 0, item);
704  // set allow vehicles
705  item = new FXTableItem(myClosingReroutesEdited.at(i)->getAttribute(SUMO_ATTR_ALLOW).c_str());
706  myClosingRerouteTable->setItem(i, 1, item);
707  // set disallow vehicles
708  item = new FXTableItem(myClosingReroutesEdited.at(i)->getAttribute(SUMO_ATTR_DISALLOW).c_str());
709  myClosingRerouteTable->setItem(i, 2, item);
710  // set valid icon
711  item = new FXTableItem("");
712  item->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT));
713  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
714  item->setEnabled(false);
715  myClosingRerouteTable->setItem(i, 3, item);
716  // set remove
717  item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE));
718  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
719  item->setEnabled(false);
720  myClosingRerouteTable->setItem(i, 4, item);
721  }
722 }
723 
724 
725 void
727  // clear table
728  myDestProbRerouteTable->clearItems();
729  // set number of rows
730  myDestProbRerouteTable->setTableSize(int(myDestProbReroutesEdited.size()), 4);
731  // Configure list
732  myDestProbRerouteTable->setVisibleColumns(4);
733  myDestProbRerouteTable->setColumnWidth(0, 124);
734  myDestProbRerouteTable->setColumnWidth(1, 124);
737  myDestProbRerouteTable->setColumnText(0, toString(SUMO_ATTR_EDGE).c_str());
738  myDestProbRerouteTable->setColumnText(1, toString(SUMO_ATTR_PROB).c_str());
739  myDestProbRerouteTable->setColumnText(2, "");
740  myDestProbRerouteTable->setColumnText(3, "");
741  myDestProbRerouteTable->getRowHeader()->setWidth(0);
742  // Declare pointer to FXTableItem
743  FXTableItem* item = nullptr;
744  // iterate over values
745  for (int i = 0; i < (int)myDestProbReroutesEdited.size(); i++) {
746  // Set new destination
747  item = new FXTableItem(myDestProbReroutesEdited.at(i)->getAttribute(SUMO_ATTR_EDGE).c_str());
748  myDestProbRerouteTable->setItem(i, 0, item);
749  // Set probability
750  item = new FXTableItem(myDestProbReroutesEdited.at(i)->getAttribute(SUMO_ATTR_PROB).c_str());
751  myDestProbRerouteTable->setItem(i, 1, item);
752  // set valid icon
753  item = new FXTableItem("");
754  item->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT));
755  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
756  item->setEnabled(false);
757  myDestProbRerouteTable->setItem(i, 2, item);
758  // set remove
759  item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE));
760  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
761  item->setEnabled(false);
762  myDestProbRerouteTable->setItem(i, 3, item);
763  }
764 }
765 
766 
767 void
769  // clear table
770  myRouteProbRerouteTable->clearItems();
771  // set number of rows
772  myRouteProbRerouteTable->setTableSize(int(myRouteProbReroutesEdited.size()), 4);
773  // Configure list
774  myRouteProbRerouteTable->setVisibleColumns(4);
775  myRouteProbRerouteTable->setColumnWidth(0, 124);
776  myRouteProbRerouteTable->setColumnWidth(1, 124);
779  myRouteProbRerouteTable->setColumnText(0, toString(SUMO_ATTR_ROUTE).c_str());
780  myRouteProbRerouteTable->setColumnText(1, toString(SUMO_ATTR_PROB).c_str());
781  myRouteProbRerouteTable->setColumnText(2, "");
782  myRouteProbRerouteTable->setColumnText(3, "");
783  myRouteProbRerouteTable->getRowHeader()->setWidth(0);
784  // Declare pointer to FXTableItem
785  FXTableItem* item = nullptr;
786  // iterate over values
787  for (int i = 0; i < (int)myRouteProbReroutesEdited.size(); i++) {
788  // Set new route
789  item = new FXTableItem(myRouteProbReroutesEdited.at(i)->getAttribute(SUMO_ATTR_ROUTE).c_str());
790  myRouteProbRerouteTable->setItem(i, 0, item);
791  // Set probability
792  item = new FXTableItem(myRouteProbReroutesEdited.at(i)->getAttribute(SUMO_ATTR_PROB).c_str());
793  myRouteProbRerouteTable->setItem(i, 1, item);
794  // set valid icon
795  item = new FXTableItem("");
796  item->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT));
797  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
798  item->setEnabled(false);
799  myRouteProbRerouteTable->setItem(i, 2, item);
800  // set remove
801  item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE));
802  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
803  item->setEnabled(false);
804  myRouteProbRerouteTable->setItem(i, 3, item);
805  }
806 }
807 
808 
809 void
811  // clear table
812  myParkingAreaRerouteTable->clearItems();
813  // set number of rows
814  myParkingAreaRerouteTable->setTableSize(int(myParkingAreaRerouteEdited.size()), 5);
815  // Configure list
816  myParkingAreaRerouteTable->setVisibleColumns(4);
817  myParkingAreaRerouteTable->setColumnWidth(0, 124);
818  myParkingAreaRerouteTable->setColumnWidth(1, 90);
819  myParkingAreaRerouteTable->setColumnWidth(2, 35);
822  myParkingAreaRerouteTable->setColumnText(0, toString(SUMO_ATTR_PARKING).c_str());
823  myParkingAreaRerouteTable->setColumnText(1, toString(SUMO_ATTR_PROB).c_str());
824  myParkingAreaRerouteTable->setColumnText(2, "vis.");
825  myParkingAreaRerouteTable->setColumnText(3, "");
826  myParkingAreaRerouteTable->setColumnText(4, "");
827  myParkingAreaRerouteTable->getRowHeader()->setWidth(0);
828  // Declare pointer to FXTableItem
829  FXTableItem* item = nullptr;
830  // iterate over values
831  for (int i = 0; i < (int)myParkingAreaRerouteEdited.size(); i++) {
832  // Set new destination
833  item = new FXTableItem(myParkingAreaRerouteEdited.at(i)->getAttribute(SUMO_ATTR_PARKING).c_str());
834  myParkingAreaRerouteTable->setItem(i, 0, item);
835  // Set probability
836  item = new FXTableItem(myParkingAreaRerouteEdited.at(i)->getAttribute(SUMO_ATTR_PROB).c_str());
837  myParkingAreaRerouteTable->setItem(i, 1, item);
838  // Set visible
839  item = new FXTableItem(myParkingAreaRerouteEdited.at(i)->getAttribute(SUMO_ATTR_VISIBLE) == "1" ? "true" : "false");
840  myParkingAreaRerouteTable->setItem(i, 2, item);
841  // set valid icon
842  item = new FXTableItem("");
843  item->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT));
844  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
845  item->setEnabled(false);
846  myParkingAreaRerouteTable->setItem(i, 3, item);
847  // set remove
848  item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE));
849  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
850  item->setEnabled(false);
851  myParkingAreaRerouteTable->setItem(i, 4, item);
852  }
853 }
854 
855 
856 /****************************************************************************/
GUIDesignAuxiliarHorizontalFrame
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:289
MID_GNE_REROUTEDIALOG_TABLE_CLOSINGREROUTE
change table route closing reroute
Definition: GUIAppEnum.h:972
GNERerouterIntervalDialog::onCmdEditRouteProbReroute
long onCmdEditRouteProbReroute(FXObject *, FXSelector, void *)
/edit route prob reroute
Definition: GNERerouterIntervalDialog.cpp:556
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
GUIDesignTextFieldNCol
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:58
GUIDesignLabelThick
#define GUIDesignLabelThick
label extended over frame with thick and with text justify to left and height of 23
Definition: GUIDesigns.h:174
SUMO_ATTR_DISALLOW
Definition: SUMOXMLDefinitions.h:780
MID_GNE_REROUTEDIALOG_ADD_ROUTEPROBREROUTE
add route probability route
Definition: GUIAppEnum.h:990
GNERerouterIntervalDialog::onCmdClickedClosingLaneReroute
long onCmdClickedClosingLaneReroute(FXObject *, FXSelector, void *)
remove closing lane reroute
Definition: GNERerouterIntervalDialog.cpp:368
ICON_CORRECT
Definition: GUIIcons.h:382
GUIDesignUniformHorizontalFrame
#define GUIDesignUniformHorizontalFrame
design for horizontal frame used to pack another frames with a uniform width
Definition: GUIDesigns.h:295
GNERerouterIntervalDialog::onCmdEditParkingAreaReroute
long onCmdEditParkingAreaReroute(FXObject *, FXSelector, void *)
/edit parkingAreaReroute
Definition: GNERerouterIntervalDialog.cpp:582
GNEChange_Additional
Definition: GNEChange_Additional.h:45
GNEAdditionalDialog
Dialog to edit sequences, parameters, etc.. of Additionals.
Definition: GNEAdditionalDialog.h:45
MID_GNE_REROUTEDIALOG_ADD_PARKINGAREAREROUTE
add parkingAreaReroute
Definition: GUIAppEnum.h:992
GNERerouterIntervalDialog::onCmdAddDestProbReroute
long onCmdAddDestProbReroute(FXObject *, FXSelector, void *)
add dest prob reroute
Definition: GNERerouterIntervalDialog.cpp:332
GNERerouterIntervalDialog::myRouteProbRerouteTable
FXTable * myRouteProbRerouteTable
list with route probability reroute
Definition: GNERerouterIntervalDialog.h:163
SUMO_ATTR_EDGE
Definition: SUMOXMLDefinitions.h:424
GNERerouterIntervalDialog::myClosingLaneReroutesValid
bool myClosingLaneReroutesValid
flag to check if closing lane reroutes are valid
Definition: GNERerouterIntervalDialog.h:187
GNERerouterIntervalDialog::onCmdAccept
long onCmdAccept(FXObject *, FXSelector, void *)
Definition: GNERerouterIntervalDialog.cpp:210
GUIDesigns.h
SUMO_ATTR_LANE
Definition: SUMOXMLDefinitions.h:635
GNEAdditional::setAttribute
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes
GNERerouterIntervalDialog::updateRouteProbReroutesTable
void updateRouteProbReroutesTable()
update data of probabilitry reroutes table
Definition: GNERerouterIntervalDialog.cpp:768
MID_GNE_REROUTEDIALOG_EDIT_INTERVAL
edit interval
Definition: GUIAppEnum.h:994
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:602
ICON_REMOVE
Definition: GUIIcons.h:185
GNERerouterIntervalDialog::myParkingAreaRerouteTable
FXTable * myParkingAreaRerouteTable
list with parkingAreaReroutes
Definition: GNERerouterIntervalDialog.h:166
GNERerouterIntervalDialog::myDestProbRerouteTable
FXTable * myDestProbRerouteTable
list with destiny probability reroutes
Definition: GNERerouterIntervalDialog.h:160
GUIAppEnum.h
SUMO_ATTR_BEGIN
weights: time range begin
Definition: SUMOXMLDefinitions.h:675
GNEAdditionalDialog::cancelChanges
void cancelChanges()
Cancel changes did in this dialog.
Definition: GNEAdditionalDialog.cpp:136
GNEChange_Additional.h
SUMO_TAG_PARKING_ZONE_REROUTE
entry for an alternative parking zone
Definition: SUMOXMLDefinitions.h:199
GNERerouterIntervalDialog::myClosingLaneRerouteTable
FXTable * myClosingLaneRerouteTable
list with closing lane reroutes
Definition: GNERerouterIntervalDialog.h:154
SUMO_TAG_DEST_PROB_REROUTE
probability of destiny of a reroute
Definition: SUMOXMLDefinitions.h:191
GNEAdditional::getAttribute
virtual std::string getAttribute(SumoXMLAttr key) const =0
GNERerouterIntervalDialog::myBeginTextField
FXTextField * myBeginTextField
begin time text field
Definition: GNERerouterIntervalDialog.h:130
GUIDesignTableIconCellWidth
#define GUIDesignTableIconCellWidth
width of cells that only contains an Icon
Definition: GUIDesigns.h:483
GNERerouterIntervalDialog::myClosingLaneReroutesEdited
std::vector< GNEAdditional * > myClosingLaneReroutesEdited
closing Lane Reroutes edited
Definition: GNERerouterIntervalDialog.h:172
GNERerouterIntervalDialog::updateClosingReroutesTable
void updateClosingReroutesTable()
update data of closing reroute table
Definition: GNERerouterIntervalDialog.cpp:679
SUMO_ATTR_PROB
Definition: SUMOXMLDefinitions.h:627
GNERerouterIntervalDialog::onCmdClickedClosingReroute
long onCmdClickedClosingReroute(FXObject *, FXSelector, void *)
remove closing reroute
Definition: GNERerouterIntervalDialog.cpp:384
GUIDesignButtonIcon
#define GUIDesignButtonIcon
button only with icon (23x23)
Definition: GUIDesigns.h:75
GNERerouterIntervalDialog::onCmdChangeBeginEnd
long onCmdChangeBeginEnd(FXObject *, FXSelector, void *)
called when begin or endis changed
Definition: GNERerouterIntervalDialog.cpp:612
GNERerouterIntervalDialog::onCmdClickedDestProbReroute
long onCmdClickedDestProbReroute(FXObject *, FXSelector, void *)
remove dest prob reroute
Definition: GNERerouterIntervalDialog.cpp:400
GNEClosingReroute
Definition: GNEClosingReroute.h:41
GNERouteProbReroute
Definition: GNERouteProbReroute.h:43
ICON_ADD
Definition: GUIIcons.h:184
GNEViewNet.h
GNERerouterIntervalDialog::~GNERerouterIntervalDialog
~GNERerouterIntervalDialog()
destructor
Definition: GNERerouterIntervalDialog.cpp:206
SUMO_ATTR_ROUTE
Definition: SUMOXMLDefinitions.h:441
GNERerouterIntervalDialog.h
MID_GNE_REROUTEDIALOG_ADD_CLOSINGREROUTE
add closing reroute
Definition: GUIAppEnum.h:986
SUMO_TAG_PARKING_AREA
A parking area.
Definition: SUMOXMLDefinitions.h:108
GNERerouterIntervalDialog::onCmdReset
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
Definition: GNERerouterIntervalDialog.cpp:295
GNERerouterIntervalDialog::myClosingRerouteTable
FXTable * myClosingRerouteTable
list with closing reroutes
Definition: GNERerouterIntervalDialog.h:157
GNERerouterIntervalDialog::updateDestProbReroutesTable
void updateDestProbReroutesTable()
update data of destiny probabilitry reroute table
Definition: GNERerouterIntervalDialog.cpp:726
SUMO_TAG_ROUTE_PROB_REROUTE
probability of route of a reroute
Definition: SUMOXMLDefinitions.h:197
GNEAdditionalDialog::myUpdatingElement
bool myUpdatingElement
flag to indicate if additional are being created or modified (cannot be changed after open dialog)
Definition: GNEAdditionalDialog.h:86
GNEViewNet::getUndoList
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:933
GNERerouterIntervalDialog::onCmdCancel
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
Definition: GNERerouterIntervalDialog.cpp:285
GNERerouterIntervalDialog::onCmdAddClosingReroute
long onCmdAddClosingReroute(FXObject *, FXSelector, void *)
add closing reroute
Definition: GNERerouterIntervalDialog.cpp:320
GNERerouterIntervalDialog::myCheckLabel
FXLabel * myCheckLabel
begin/end time check label
Definition: GNERerouterIntervalDialog.h:136
MID_GNE_REROUTEDIALOG_TABLE_DESTPROBREROUTE
change table destiny probability reroute
Definition: GUIAppEnum.h:974
SUMO_TAG_CLOSING_REROUTE
reroute of type closing
Definition: SUMOXMLDefinitions.h:193
GNERerouterIntervalDialog::myBeginEndValid
bool myBeginEndValid
flag to check if begin an end are valid
Definition: GNERerouterIntervalDialog.h:184
MID_GNE_REROUTEDIALOG_TABLE_PARKINGAREAREROUTE
change table parkingAreaReroute
Definition: GUIAppEnum.h:978
GNERerouterIntervalDialog::myClosingReroutesEdited
std::vector< GNEAdditional * > myClosingReroutesEdited
closing Reroutes edited
Definition: GNERerouterIntervalDialog.h:169
GNERerouterIntervalDialog::myRouteProbReroutesEdited
std::vector< GNEAdditional * > myRouteProbReroutesEdited
Route Prob Reroutes edited.
Definition: GNERerouterIntervalDialog.h:178
GNERerouterIntervalDialog::onCmdEditClosingReroute
long onCmdEditClosingReroute(FXObject *, FXSelector, void *)
/edit closing reroute
Definition: GNERerouterIntervalDialog.cpp:490
GNEClosingLaneReroute
Definition: GNEClosingLaneReroute.h:42
GNEAdditionalDialog::myEditedAdditional
GNEAdditional * myEditedAdditional
pointer to edited aditional
Definition: GNEAdditionalDialog.h:83
GUIDesignTextFieldReal
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to doubles/floats
Definition: GUIDesigns.h:40
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
GUIDesignLabelLeftThick
#define GUIDesignLabelLeftThick
label extended over frame with thick and with text justify to left and height of 23
Definition: GUIDesigns.h:177
GNERerouterIntervalDialog::onCmdAddClosingLaneReroute
long onCmdAddClosingLaneReroute(FXObject *, FXSelector, void *)
add closing lane reroute
Definition: GNERerouterIntervalDialog.cpp:308
GNERerouterIntervalDialog::onCmdAddParkingAreaReroute
long onCmdAddParkingAreaReroute(FXObject *, FXSelector, void *)
add parkingAreaReroute
Definition: GNERerouterIntervalDialog.cpp:356
GNEDestProbReroute
Definition: GNEDestProbReroute.h:42
GNEHierarchicalElementParents::getAdditionalParents
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators)
Definition: GNEHierarchicalElementParents.cpp:86
GNEAdditionalDialog::acceptChanges
void acceptChanges()
Accept changes did in this dialog.
Definition: GNEAdditionalDialog.cpp:125
MID_GNE_REROUTEDIALOG_ADD_CLOSINGLANEREROUTE
add closing lane reroute
Definition: GUIAppEnum.h:984
GNERerouterIntervalDialog::myDestProbReroutesEdited
std::vector< GNEAdditional * > myDestProbReroutesEdited
Dest Prob Reroutes edited.
Definition: GNERerouterIntervalDialog.h:175
GNERerouterIntervalDialog::onCmdAddRouteProbReroute
long onCmdAddRouteProbReroute(FXObject *, FXSelector, void *)
add route prob reroute
Definition: GNERerouterIntervalDialog.cpp:344
SUMOXMLDefinitions::isValidNetID
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
Definition: SUMOXMLDefinitions.cpp:964
GUIDesignLabelIcon32x32Thicked
#define GUIDesignLabelIcon32x32Thicked
label ticked filled only with an icon of 32x32
Definition: GUIDesigns.h:198
SUMO_ATTR_VISIBLE
Definition: SUMOXMLDefinitions.h:893
MID_GNE_REROUTEDIALOG_TABLE_CLOSINGLANEREROUTE
change table closing lane reroute reroute
Definition: GUIAppEnum.h:970
GNEAdditional::getViewNet
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
Definition: GNEAdditional.cpp:387
SUMO_ATTR_ALLOW
Definition: SUMOXMLDefinitions.h:779
GNERerouterIntervalDialog::myRouteProbReroutesValid
bool myRouteProbReroutesValid
flag to check if route prob reroutes are valid
Definition: GNERerouterIntervalDialog.h:199
GNERerouterIntervalDialog::myParkingAreaReroutesValid
bool myParkingAreaReroutesValid
flag to check if parkingAreaReroutes are valid
Definition: GNERerouterIntervalDialog.h:196
SUMO_ATTR_PARKING
Definition: SUMOXMLDefinitions.h:798
GUIDesignAuxiliarFrame
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions
Definition: GUIDesigns.h:286
config.h
SUMO_TAG_CLOSING_LANE_REROUTE
lane of a reroute of type closing
Definition: SUMOXMLDefinitions.h:195
SUMO_ATTR_END
weights: time range end
Definition: SUMOXMLDefinitions.h:677
GUIDesignTableAdditionals
#define GUIDesignTableAdditionals
design for tables used in additional dialogs
Definition: GUIDesigns.h:480
GNEAttributeCarrier::getTagStr
const std::string & getTagStr() const
get tag assigned to this object in string format
Definition: GNEAttributeCarrier.cpp:1165
GNERerouterIntervalDialog::myClosingReroutesValid
bool myClosingReroutesValid
flag to check if closing reroutes are valid
Definition: GNERerouterIntervalDialog.h:190
GNEHierarchicalElementChildren::sortAdditionalChildren
void sortAdditionalChildren()
sort children (used by Rerouters, VSS, TAZs...)
Definition: GNEHierarchicalElementChildren.cpp:138
GNERerouterIntervalDialog::myParkingAreaRerouteEdited
std::vector< GNEAdditional * > myParkingAreaRerouteEdited
Parking Area reroute edited.
Definition: GNERerouterIntervalDialog.h:181
MID_GNE_REROUTEDIALOG_TABLE_ROUTEPROBREROUTE
change table route probability reroute
Definition: GUIAppEnum.h:976
GNERerouterIntervalDialog::onCmdClickedRouteProbReroute
long onCmdClickedRouteProbReroute(FXObject *, FXSelector, void *)
remove route prob reroute
Definition: GNERerouterIntervalDialog.cpp:416
GNERerouterIntervalDialog::updateClosingLaneReroutesTable
void updateClosingLaneReroutesTable()
update data of closing lane reroute table
Definition: GNERerouterIntervalDialog.cpp:632
ICON_ERROR
Definition: GUIIcons.h:383
GNEParkingAreaReroute
Definition: GNEParkingAreaReroute.h:43
GNERerouterIntervalDialog::onCmdEditDestProbReroute
long onCmdEditDestProbReroute(FXObject *, FXSelector, void *)
/edit dest prob reroute
Definition: GNERerouterIntervalDialog.cpp:530
MID_GNE_REROUTEDIALOG_ADD_DESTPROBREROUTE
add destiny probability route
Definition: GUIAppEnum.h:988
WRITE_DEBUG
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:246
GNEAdditional::isValid
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
method for checking if the key and their conrrespond attribute are valids
GNERerouterIntervalDialog::onCmdClickedParkingAreaReroute
long onCmdClickedParkingAreaReroute(FXObject *, FXSelector, void *)
remove parkingAreaReroute
Definition: GNERerouterIntervalDialog.cpp:432
GNEAdditionalDialog::resetChanges
void resetChanges()
reset changes did in this dialog.
Definition: GNEAdditionalDialog.cpp:142
GNERerouterIntervalDialog::myDestProbReroutesValid
bool myDestProbReroutesValid
flag to check if Destiny probability reroutes are valid
Definition: GNERerouterIntervalDialog.h:193
GNENet.h
GNERerouterIntervalDialog::updateParkingAreaReroutesTable
void updateParkingAreaReroutesTable()
update data of parkingAreaReroute table
Definition: GNERerouterIntervalDialog.cpp:810
FXDEFMAP
FXDEFMAP(GNERerouterIntervalDialog) GNERerouterIntervalDialogMap[]
GNERerouterIntervalDialog
Dialog for edit rerouter intervals.
Definition: GNERerouterIntervalDialog.h:53
GNEUndoList.h
GNERerouterIntervalDialog::onCmdEditClosingLaneReroute
long onCmdEditClosingLaneReroute(FXObject *, FXSelector, void *)
/edit closing lane reroute
Definition: GNERerouterIntervalDialog.cpp:450
GNERerouterIntervalDialog::myEndTextField
FXTextField * myEndTextField
end time text field
Definition: GNERerouterIntervalDialog.h:133