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