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-2022 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // Dialog for edit rerouter intervals
19 /****************************************************************************/
20 #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_AREA_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(GUIIcon::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(GUIIcon::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(GUIIcon::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(GUIIcon::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(GUIIcon::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(GUIIcon::ADD), this, MID_GNE_REROUTEDIALOG_ADD_PARKINGAREAREROUTE, GUIDesignButtonIcon);
168  FXLabel* parkingAreaRerouteLabel = new FXLabel(buttonAndLabelParkingAreaReroute, ("Add new " + toString(SUMO_TAG_PARKING_AREA_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->getNet()->getAttributeCarriers()->getAdditionals().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->getNet()->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_AREA_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  // first check if there is lanes in the network
309  if (myEditedAdditional->getNet()->getAttributeCarriers()->getEdges().size() > 0) {
310  // get lane
311  GNELane* lane = myEditedAdditional->getNet()->getAttributeCarriers()->getEdges().begin()->second->getLanes().front();
312  // create closing lane reroute
313  GNEClosingLaneReroute* closingLaneReroute = new GNEClosingLaneReroute(myEditedAdditional, lane, SVCAll);
314  // add it using undoList
315  myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(closingLaneReroute, true), true);
316  myClosingLaneReroutesEdited.push_back(closingLaneReroute);
317  // update closing lane reroutes table
319  } else {
320  WRITE_WARNING("There is no lanes in the network");
321  }
322  return 1;
323 }
324 
325 
326 long
328  // first check if there is lanes in the network
329  if (myEditedAdditional->getNet()->getAttributeCarriers()->getEdges().size() > 0) {
330  // get edge
331  GNEEdge* edge = myEditedAdditional->getNet()->getAttributeCarriers()->getEdges().begin()->second;
332  // create closing reroute
333  GNEClosingReroute* closingReroute = new GNEClosingReroute(myEditedAdditional, edge, SVCAll);
334  // add it using undoList
335  myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(closingReroute, true), true);
336  myClosingReroutesEdited.push_back(closingReroute);
337  // update closing reroutes table
339  } else {
340  WRITE_WARNING("There is no edges in the network");
341  }
342  return 1;
343 }
344 
345 
346 long
348  // first check if there is lanes in the network
349  if (myEditedAdditional->getNet()->getAttributeCarriers()->getEdges().size() > 0) {
350  // get edge
351  GNEEdge* edge = myEditedAdditional->getNet()->getAttributeCarriers()->getEdges().begin()->second;
352  // create closing reroute and add it to table
353  GNEDestProbReroute* destProbReroute = new GNEDestProbReroute(myEditedAdditional, edge, 1);
354  // add it using undoList
355  myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(destProbReroute, true), true);
356  myDestProbReroutesEdited.push_back(destProbReroute);
357  // update dest Prob reroutes table
359  } else {
360  WRITE_WARNING("There is no edges in the network");
361  }
362  return 1;
363 }
364 
365 
366 long
368  // get routes
370  // check if there is at least one route
371  if (routes.size() > 0) {
372  // create route Prob Reroute
373  GNERouteProbReroute* routeProbReroute = new GNERouteProbReroute(myEditedAdditional, *routes.begin(), 1);
374  myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(routeProbReroute, true), true);
375  myRouteProbReroutesEdited.push_back(routeProbReroute);
376  // update route prob reroutes table
378  }
379  return 1;
380 }
381 
382 
383 long
385  // first check if there is lanes in the network
387  // get parking area
389  // create parkingAreaReroute and add it to table
390  GNEParkingAreaReroute* parkingAreaReroute = new GNEParkingAreaReroute(myEditedAdditional, parkingArea, 1, 1);
391  // add it using undoList
392  myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(parkingAreaReroute, true), true);
393  myParkingAreaRerouteEdited.push_back(parkingAreaReroute);
394  // update dest Prob reroutes table
396  } else {
397  WRITE_WARNING("There is no parking areas in the network");
398  }
399  return 1;
400 }
401 
402 
403 long
405  // check if some delete button was pressed
406  for (int i = 0; i < (int)myClosingLaneReroutesEdited.size(); i++) {
407  if (myClosingLaneRerouteTable->getItem(i, 4)->hasFocus()) {
408  myClosingLaneRerouteTable->removeRows(i);
412  return 1;
413  }
414  }
415  return 0;
416 }
417 
418 
419 long
421  // check if some delete button was pressed
422  for (int i = 0; i < (int)myClosingReroutesEdited.size(); i++) {
423  if (myClosingRerouteTable->getItem(i, 4)->hasFocus()) {
424  myClosingRerouteTable->removeRows(i);
428  return 1;
429  }
430  }
431  return 1;
432 }
433 
434 
435 long
437  // check if some delete button was pressed
438  for (int i = 0; i < (int)myDestProbReroutesEdited.size(); i++) {
439  if (myDestProbRerouteTable->getItem(i, 3)->hasFocus()) {
440  myDestProbRerouteTable->removeRows(i);
444  return 1;
445  }
446  }
447  return 0;
448 }
449 
450 
451 long
453  // check if some delete button was pressed
454  for (int i = 0; i < (int)myRouteProbReroutesEdited.size(); i++) {
455  if (myRouteProbRerouteTable->getItem(i, 3)->hasFocus()) {
456  myRouteProbRerouteTable->removeRows(i);
460  return 1;
461  }
462  }
463  return 0;
464 }
465 
466 
467 long
469  // check if some delete button was pressed
470  for (int i = 0; i < (int)myParkingAreaRerouteEdited.size(); i++) {
471  if (myParkingAreaRerouteTable->getItem(i, 3)->hasFocus()) {
472  ;
473  } else if (myParkingAreaRerouteTable->getItem(i, 4)->hasFocus()) {
474  myParkingAreaRerouteTable->removeRows(i);
478  return 1;
479  }
480  }
481  return 0;
482 }
483 
484 
485 long
488  // iterate over table and check that all parameters are correct
489  for (int i = 0; i < myClosingLaneRerouteTable->getNumRows(); i++) {
490  GNEAdditional* closingLaneReroute = myClosingLaneReroutesEdited.at(i);
491  if (!SUMOXMLDefinitions::isValidNetID(myClosingLaneRerouteTable->getItem(i, 0)->getText().text())) {
494  } else if (closingLaneReroute->isValid(SUMO_ATTR_LANE, myClosingLaneRerouteTable->getItem(i, 0)->getText().text()) == false) {
497  } else if (closingLaneReroute->isValid(SUMO_ATTR_ALLOW, myClosingLaneRerouteTable->getItem(i, 1)->getText().text()) == false) {
500  } else if (closingLaneReroute->isValid(SUMO_ATTR_DISALLOW, myClosingLaneRerouteTable->getItem(i, 2)->getText().text()) == false) {
503  } else {
504  // check if allow/disallow should be changed
505  bool changeAllow = myClosingLaneRerouteTable->getItem(i, 1)->getText().text() != closingLaneReroute->getAttribute(SUMO_ATTR_ALLOW);
506  bool changeDisallow = myClosingLaneRerouteTable->getItem(i, 2)->getText().text() != closingLaneReroute->getAttribute(SUMO_ATTR_DISALLOW);
507  // set new values in Closing reroute
508  closingLaneReroute->setAttribute(SUMO_ATTR_LANE, myClosingLaneRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
509  if (changeAllow) {
510  closingLaneReroute->setAttribute(SUMO_ATTR_ALLOW, myClosingLaneRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
511  myClosingLaneRerouteTable->getItem(i, 2)->setText(closingLaneReroute->getAttribute(SUMO_ATTR_DISALLOW).c_str());
512 
513  }
514  if (changeDisallow) {
515  closingLaneReroute->setAttribute(SUMO_ATTR_DISALLOW, myClosingLaneRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
516  myClosingLaneRerouteTable->getItem(i, 1)->setText(closingLaneReroute->getAttribute(SUMO_ATTR_ALLOW).c_str());
517  }
518  // set Correct label
520  }
521  }
522  // update list
523  myClosingLaneRerouteTable->update();
524  return 1;
525 }
526 
527 
528 long
530  myClosingReroutesValid = true;
531  // iterate over table and check that all parameters are correct
532  for (int i = 0; i < myClosingRerouteTable->getNumRows(); i++) {
533  GNEAdditional* closingReroute = myClosingReroutesEdited.at(i);
534  if (!SUMOXMLDefinitions::isValidNetID(myClosingRerouteTable->getItem(i, 0)->getText().text())) {
535  myClosingReroutesValid = false;
537  } else if (closingReroute->isValid(SUMO_ATTR_EDGE, myClosingRerouteTable->getItem(i, 0)->getText().text()) == false) {
538  myClosingReroutesValid = false;
540  } else if (closingReroute->isValid(SUMO_ATTR_ALLOW, myClosingRerouteTable->getItem(i, 1)->getText().text()) == false) {
541  myClosingReroutesValid = false;
543  } else if (closingReroute->isValid(SUMO_ATTR_DISALLOW, myClosingRerouteTable->getItem(i, 2)->getText().text()) == false) {
544  myClosingReroutesValid = false;
546  } else {
547  // check if allow/disallow should be changed
548  bool changeAllow = myClosingRerouteTable->getItem(i, 1)->getText().text() != closingReroute->getAttribute(SUMO_ATTR_ALLOW);
549  bool changeDisallow = myClosingRerouteTable->getItem(i, 2)->getText().text() != closingReroute->getAttribute(SUMO_ATTR_DISALLOW);
550  // set new values in Closing reroute
551  closingReroute->setAttribute(SUMO_ATTR_EDGE, myClosingRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
552  if (changeAllow) {
553  closingReroute->setAttribute(SUMO_ATTR_ALLOW, myClosingRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
554  myClosingRerouteTable->getItem(i, 2)->setText(closingReroute->getAttribute(SUMO_ATTR_DISALLOW).c_str());
555 
556  }
557  if (changeDisallow) {
558  closingReroute->setAttribute(SUMO_ATTR_DISALLOW, myClosingRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
559  myClosingRerouteTable->getItem(i, 1)->setText(closingReroute->getAttribute(SUMO_ATTR_ALLOW).c_str());
560  }
561  // set Correct label
563  }
564  }
565  // update list
566  myClosingRerouteTable->update();
567  return 1;
568 }
569 
570 
571 long
574  // iterate over table and check that all parameters are correct
575  for (int i = 0; i < myDestProbRerouteTable->getNumRows(); i++) {
576  GNEAdditional* destProbReroute = myDestProbReroutesEdited.at(i);
577  if (!SUMOXMLDefinitions::isValidNetID(myDestProbRerouteTable->getItem(i, 0)->getText().text())) {
578  myDestProbReroutesValid = false;
580  } else if (destProbReroute->isValid(SUMO_ATTR_EDGE, myDestProbRerouteTable->getItem(i, 0)->getText().text()) == false) {
581  myDestProbReroutesValid = false;
583  } else if (destProbReroute->isValid(SUMO_ATTR_PROB, myDestProbRerouteTable->getItem(i, 1)->getText().text()) == false) {
584  myDestProbReroutesValid = false;
586  } else {
587  // set new values in Closing reroute
588  destProbReroute->setAttribute(SUMO_ATTR_EDGE, myDestProbRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
589  destProbReroute->setAttribute(SUMO_ATTR_PROB, myDestProbRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
590  // set Correct label
592  }
593  }
594  // update list
595  myDestProbRerouteTable->update();
596  return 1;
597 }
598 
599 
600 long
603  // iterate over table and check that all parameters are correct
604  for (int i = 0; i < myRouteProbRerouteTable->getNumRows(); i++) {
605  GNEAdditional* routeProbReroute = myRouteProbReroutesEdited.at(i);
606  if (!SUMOXMLDefinitions::isValidNetID(myRouteProbRerouteTable->getItem(i, 0)->getText().text())) {
607  myRouteProbReroutesValid = false;
609  } else if (routeProbReroute->isValid(SUMO_ATTR_PROB, myRouteProbRerouteTable->getItem(i, 1)->getText().text()) == false) {
610  myRouteProbReroutesValid = false;
612  } else {
613  // set new values in Closing reroute
614  routeProbReroute->setAttribute(SUMO_ATTR_ROUTE, myRouteProbRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
615  routeProbReroute->setAttribute(SUMO_ATTR_PROB, myRouteProbRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
616  // set Correct label
618  }
619  }
620  // update list
621  myRouteProbRerouteTable->update();
622  return 1;
623 }
624 
625 
626 long
629  // iterate over table and check that all parameters are correct
630  for (int i = 0; i < myParkingAreaRerouteTable->getNumRows(); i++) {
631  GNEAdditional* parkingAreaReroute = myParkingAreaRerouteEdited.at(i);
632  if (parkingAreaReroute->isValid(SUMO_ATTR_PARKING, myParkingAreaRerouteTable->getItem(i, 0)->getText().text()) == false) {
635  } else if (parkingAreaReroute->isValid(SUMO_ATTR_PROB, myParkingAreaRerouteTable->getItem(i, 1)->getText().text()) == false) {
638  } else if (parkingAreaReroute->isValid(SUMO_ATTR_VISIBLE, myParkingAreaRerouteTable->getItem(i, 2)->getText().text()) == false) {
641  } else {
642  // set new values in Closing reroute
643  parkingAreaReroute->setAttribute(SUMO_ATTR_PARKING, myParkingAreaRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
644  parkingAreaReroute->setAttribute(SUMO_ATTR_PROB, myParkingAreaRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
645  parkingAreaReroute->setAttribute(SUMO_ATTR_VISIBLE, myParkingAreaRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList());
646  // set Correct label
648  }
649  }
650  // update list
651  myParkingAreaRerouteTable->update();
652  return 1;
653 }
654 
655 
656 long
657 GNERerouterIntervalDialog::onCmdChangeBeginEnd(FXObject*, FXSelector, void*) {
658  if (myEditedAdditional->isValid(SUMO_ATTR_BEGIN, myBeginTextField->getText().text()) &&
660  // set new values in rerouter interval
663  // change icon
664  myBeginEndValid = true;
666  } else {
667  myBeginEndValid = false;
669  }
670  return 0;
671 }
672 
673 
674 void
676  // clear table
677  myClosingLaneRerouteTable->clearItems();
678  // set number of rows
679  myClosingLaneRerouteTable->setTableSize(int(myClosingLaneReroutesEdited.size()), 5);
680  // Configure list
681  myClosingLaneRerouteTable->setVisibleColumns(5);
682  myClosingLaneRerouteTable->setColumnWidth(0, 83);
683  myClosingLaneRerouteTable->setColumnWidth(1, 83);
684  myClosingLaneRerouteTable->setColumnWidth(2, 82);
685  myClosingLaneRerouteTable->setColumnWidth(3, GUIDesignHeight);
686  myClosingLaneRerouteTable->setColumnWidth(4, GUIDesignHeight);
687  myClosingLaneRerouteTable->setColumnText(0, toString(SUMO_ATTR_LANE).c_str());
688  myClosingLaneRerouteTable->setColumnText(1, toString(SUMO_ATTR_ALLOW).c_str());
689  myClosingLaneRerouteTable->setColumnText(2, toString(SUMO_ATTR_DISALLOW).c_str());
690  myClosingLaneRerouteTable->setColumnText(3, "");
691  myClosingLaneRerouteTable->setColumnText(4, "");
692  myClosingLaneRerouteTable->getRowHeader()->setWidth(0);
693  // Declare pointer to FXTableItem
694  FXTableItem* item = nullptr;
695  // iterate over values
696  for (int i = 0; i < (int)myClosingLaneReroutesEdited.size(); i++) {
697  // Set closing edge
698  item = new FXTableItem(myClosingLaneReroutesEdited.at(i)->getAttribute(SUMO_ATTR_LANE).c_str());
699  myClosingLaneRerouteTable->setItem(i, 0, item);
700  // set allow vehicles
701  item = new FXTableItem(myClosingLaneReroutesEdited.at(i)->getAttribute(SUMO_ATTR_ALLOW).c_str());
702  myClosingLaneRerouteTable->setItem(i, 1, item);
703  // set disallow vehicles
704  item = new FXTableItem(myClosingLaneReroutesEdited.at(i)->getAttribute(SUMO_ATTR_DISALLOW).c_str());
705  myClosingLaneRerouteTable->setItem(i, 2, item);
706  // set valid icon
707  item = new FXTableItem("");
709  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
710  item->setEnabled(false);
711  myClosingLaneRerouteTable->setItem(i, 3, item);
712  // set remove
713  item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE));
714  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
715  item->setEnabled(false);
716  myClosingLaneRerouteTable->setItem(i, 4, item);
717  }
718 }
719 
720 
721 void
723  // clear table
724  myClosingRerouteTable->clearItems();
725  // set number of rows
726  myClosingRerouteTable->setTableSize(int(myClosingReroutesEdited.size()), 5);
727  // Configure list
728  myClosingRerouteTable->setVisibleColumns(5);
729  myClosingRerouteTable->setColumnWidth(0, 83);
730  myClosingRerouteTable->setColumnWidth(1, 83);
731  myClosingRerouteTable->setColumnWidth(2, 82);
732  myClosingRerouteTable->setColumnWidth(3, GUIDesignHeight);
733  myClosingRerouteTable->setColumnWidth(4, GUIDesignHeight);
734  myClosingRerouteTable->setColumnText(0, toString(SUMO_ATTR_EDGE).c_str());
735  myClosingRerouteTable->setColumnText(1, toString(SUMO_ATTR_ALLOW).c_str());
736  myClosingRerouteTable->setColumnText(2, toString(SUMO_ATTR_DISALLOW).c_str());
737  myClosingRerouteTable->setColumnText(3, "");
738  myClosingRerouteTable->setColumnText(4, "");
739  myClosingRerouteTable->getRowHeader()->setWidth(0);
740  // Declare pointer to FXTableItem
741  FXTableItem* item = nullptr;
742  // iterate over values
743  for (int i = 0; i < (int)myClosingReroutesEdited.size(); i++) {
744  // Set closing edge
745  item = new FXTableItem(myClosingReroutesEdited.at(i)->getAttribute(SUMO_ATTR_EDGE).c_str());
746  myClosingRerouteTable->setItem(i, 0, item);
747  // set allow vehicles
748  item = new FXTableItem(myClosingReroutesEdited.at(i)->getAttribute(SUMO_ATTR_ALLOW).c_str());
749  myClosingRerouteTable->setItem(i, 1, item);
750  // set disallow vehicles
751  item = new FXTableItem(myClosingReroutesEdited.at(i)->getAttribute(SUMO_ATTR_DISALLOW).c_str());
752  myClosingRerouteTable->setItem(i, 2, item);
753  // set valid icon
754  item = new FXTableItem("");
756  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
757  item->setEnabled(false);
758  myClosingRerouteTable->setItem(i, 3, item);
759  // set remove
760  item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE));
761  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
762  item->setEnabled(false);
763  myClosingRerouteTable->setItem(i, 4, item);
764  }
765 }
766 
767 
768 void
770  // clear table
771  myDestProbRerouteTable->clearItems();
772  // set number of rows
773  myDestProbRerouteTable->setTableSize(int(myDestProbReroutesEdited.size()), 4);
774  // Configure list
775  myDestProbRerouteTable->setVisibleColumns(4);
776  myDestProbRerouteTable->setColumnWidth(0, 124);
777  myDestProbRerouteTable->setColumnWidth(1, 124);
778  myDestProbRerouteTable->setColumnWidth(2, GUIDesignHeight);
779  myDestProbRerouteTable->setColumnWidth(3, GUIDesignHeight);
780  myDestProbRerouteTable->setColumnText(0, toString(SUMO_ATTR_EDGE).c_str());
781  myDestProbRerouteTable->setColumnText(1, toString(SUMO_ATTR_PROB).c_str());
782  myDestProbRerouteTable->setColumnText(2, "");
783  myDestProbRerouteTable->setColumnText(3, "");
784  myDestProbRerouteTable->getRowHeader()->setWidth(0);
785  // Declare pointer to FXTableItem
786  FXTableItem* item = nullptr;
787  // iterate over values
788  for (int i = 0; i < (int)myDestProbReroutesEdited.size(); i++) {
789  // Set new destination
790  item = new FXTableItem(myDestProbReroutesEdited.at(i)->getAttribute(SUMO_ATTR_EDGE).c_str());
791  myDestProbRerouteTable->setItem(i, 0, item);
792  // Set probability
793  item = new FXTableItem(myDestProbReroutesEdited.at(i)->getAttribute(SUMO_ATTR_PROB).c_str());
794  myDestProbRerouteTable->setItem(i, 1, item);
795  // set valid icon
796  item = new FXTableItem("");
798  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
799  item->setEnabled(false);
800  myDestProbRerouteTable->setItem(i, 2, item);
801  // set remove
802  item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE));
803  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
804  item->setEnabled(false);
805  myDestProbRerouteTable->setItem(i, 3, item);
806  }
807 }
808 
809 
810 void
812  // clear table
813  myRouteProbRerouteTable->clearItems();
814  // set number of rows
815  myRouteProbRerouteTable->setTableSize(int(myRouteProbReroutesEdited.size()), 4);
816  // Configure list
817  myRouteProbRerouteTable->setVisibleColumns(4);
818  myRouteProbRerouteTable->setColumnWidth(0, 124);
819  myRouteProbRerouteTable->setColumnWidth(1, 124);
820  myRouteProbRerouteTable->setColumnWidth(2, GUIDesignHeight);
821  myRouteProbRerouteTable->setColumnWidth(3, GUIDesignHeight);
822  myRouteProbRerouteTable->setColumnText(0, toString(SUMO_ATTR_ROUTE).c_str());
823  myRouteProbRerouteTable->setColumnText(1, toString(SUMO_ATTR_PROB).c_str());
824  myRouteProbRerouteTable->setColumnText(2, "");
825  myRouteProbRerouteTable->setColumnText(3, "");
826  myRouteProbRerouteTable->getRowHeader()->setWidth(0);
827  // Declare pointer to FXTableItem
828  FXTableItem* item = nullptr;
829  // iterate over values
830  for (int i = 0; i < (int)myRouteProbReroutesEdited.size(); i++) {
831  // Set new route
832  item = new FXTableItem(myRouteProbReroutesEdited.at(i)->getAttribute(SUMO_ATTR_ROUTE).c_str());
833  myRouteProbRerouteTable->setItem(i, 0, item);
834  // Set probability
835  item = new FXTableItem(myRouteProbReroutesEdited.at(i)->getAttribute(SUMO_ATTR_PROB).c_str());
836  myRouteProbRerouteTable->setItem(i, 1, item);
837  // set valid icon
838  item = new FXTableItem("");
840  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
841  item->setEnabled(false);
842  myRouteProbRerouteTable->setItem(i, 2, item);
843  // set remove
844  item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE));
845  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
846  item->setEnabled(false);
847  myRouteProbRerouteTable->setItem(i, 3, item);
848  }
849 }
850 
851 
852 void
854  // clear table
855  myParkingAreaRerouteTable->clearItems();
856  // set number of rows
857  myParkingAreaRerouteTable->setTableSize(int(myParkingAreaRerouteEdited.size()), 5);
858  // Configure list
859  myParkingAreaRerouteTable->setVisibleColumns(4);
860  myParkingAreaRerouteTable->setColumnWidth(0, 124);
861  myParkingAreaRerouteTable->setColumnWidth(1, 90);
862  myParkingAreaRerouteTable->setColumnWidth(2, 35);
863  myParkingAreaRerouteTable->setColumnWidth(3, GUIDesignHeight);
864  myParkingAreaRerouteTable->setColumnWidth(4, GUIDesignHeight);
865  myParkingAreaRerouteTable->setColumnText(0, toString(SUMO_ATTR_PARKING).c_str());
866  myParkingAreaRerouteTable->setColumnText(1, toString(SUMO_ATTR_PROB).c_str());
867  myParkingAreaRerouteTable->setColumnText(2, "vis.");
868  myParkingAreaRerouteTable->setColumnText(3, "");
869  myParkingAreaRerouteTable->setColumnText(4, "");
870  myParkingAreaRerouteTable->getRowHeader()->setWidth(0);
871  // Declare pointer to FXTableItem
872  FXTableItem* item = nullptr;
873  // iterate over values
874  for (int i = 0; i < (int)myParkingAreaRerouteEdited.size(); i++) {
875  // Set new destination
876  item = new FXTableItem(myParkingAreaRerouteEdited.at(i)->getAttribute(SUMO_ATTR_PARKING).c_str());
877  myParkingAreaRerouteTable->setItem(i, 0, item);
878  // Set probability
879  item = new FXTableItem(myParkingAreaRerouteEdited.at(i)->getAttribute(SUMO_ATTR_PROB).c_str());
880  myParkingAreaRerouteTable->setItem(i, 1, item);
881  // Set visible
882  item = new FXTableItem(myParkingAreaRerouteEdited.at(i)->getAttribute(SUMO_ATTR_VISIBLE) == "1" ? "true" : "false");
883  myParkingAreaRerouteTable->setItem(i, 2, item);
884  // set valid icon
885  item = new FXTableItem("");
887  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
888  item->setEnabled(false);
889  myParkingAreaRerouteTable->setItem(i, 3, item);
890  // set remove
891  item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE));
892  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
893  item->setEnabled(false);
894  myParkingAreaRerouteTable->setItem(i, 4, item);
895  }
896 }
897 
898 
899 /****************************************************************************/
FXDEFMAP(GNERerouterIntervalDialog) GNERerouterIntervalDialogMap[]
@ MID_GNE_REROUTEDIALOG_EDIT_INTERVAL
edit interval
Definition: GUIAppEnum.h:1249
@ MID_GNE_REROUTEDIALOG_TABLE_PARKINGAREAREROUTE
change table parkingAreaReroute
Definition: GUIAppEnum.h:1233
@ MID_GNE_REROUTEDIALOG_ADD_CLOSINGREROUTE
add closing reroute
Definition: GUIAppEnum.h:1241
@ MID_GNE_REROUTEDIALOG_TABLE_CLOSINGLANEREROUTE
change table closing lane reroute reroute
Definition: GUIAppEnum.h:1225
@ MID_GNE_REROUTEDIALOG_ADD_CLOSINGLANEREROUTE
add closing lane reroute
Definition: GUIAppEnum.h:1239
@ MID_GNE_REROUTEDIALOG_TABLE_ROUTEPROBREROUTE
change table route probability reroute
Definition: GUIAppEnum.h:1231
@ MID_GNE_REROUTEDIALOG_ADD_PARKINGAREAREROUTE
add parkingAreaReroute
Definition: GUIAppEnum.h:1247
@ MID_GNE_REROUTEDIALOG_ADD_DESTPROBREROUTE
add destiny probability route
Definition: GUIAppEnum.h:1243
@ MID_GNE_REROUTEDIALOG_TABLE_DESTPROBREROUTE
change table destiny probability reroute
Definition: GUIAppEnum.h:1229
@ MID_GNE_REROUTEDIALOG_TABLE_CLOSINGREROUTE
change table route closing reroute
Definition: GUIAppEnum.h:1227
@ MID_GNE_REROUTEDIALOG_ADD_ROUTEPROBREROUTE
add route probability route
Definition: GUIAppEnum.h:1245
#define GUIDesignButtonIcon
button only with icon
Definition: GUIDesigns.h:77
#define GUIDesignTableAdditionals
design for tables used in additional dialogs
Definition: GUIDesigns.h:559
#define GUIDesignHeight
define a standard height for all elements (Change it carefully)
Definition: GUIDesigns.h:37
#define GUIDesignTextField
Definition: GUIDesigns.h:42
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:343
#define GUIDesignLabelLeftThick
label extended over frame with thick and with text justify to left
Definition: GUIDesigns.h:205
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:60
#define GUIDesignUniformHorizontalFrame
design for horizontal frame used to pack another frames with a uniform width
Definition: GUIDesigns.h:349
#define GUIDesignLabelIcon32x32Thicked
label ticked filled only with an icon of 32x32
Definition: GUIDesigns.h:229
#define GUIDesignLabelThick
label extended over frame with thick and with text justify to left
Definition: GUIDesigns.h:202
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions
Definition: GUIDesigns.h:340
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:290
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:280
const SVCPermissions SVCAll
all VClasses are allowed
@ SUMO_TAG_CLOSING_REROUTE
reroute of type closing
@ SUMO_TAG_PARKING_AREA_REROUTE
entry for an alternative parking zone
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_ROUTE_PROB_REROUTE
probability of route of a reroute
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ SUMO_TAG_DEST_PROB_REROUTE
probability of destiny of a reroute
@ SUMO_TAG_CLOSING_LANE_REROUTE
lane of a reroute of type closing
@ SUMO_ATTR_PARKING
@ SUMO_ATTR_DISALLOW
@ SUMO_ATTR_ALLOW
@ SUMO_ATTR_LANE
@ SUMO_ATTR_EDGE
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_PROB
@ SUMO_ATTR_ROUTE
@ SUMO_ATTR_VISIBLE
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
Dialog to edit sequences, parameters, etc.. of Additionals.
bool myUpdatingElement
flag to indicate if additional are being created or modified (cannot be changed after open dialog)
void acceptChanges()
Accept changes did in this dialog.
void cancelChanges()
Cancel changes did in this dialog.
GNEAdditional * myEditedAdditional
pointer to edited aditional
void resetChanges()
reset changes did in this dialog.
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
virtual std::string getAttribute(SumoXMLAttr key) const =0
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
method for checking if the key and their conrrespond attribute are valids
const std::string & getTagStr() const
get tag assigned to this object in string format
GNENet * getNet() const
get pointer to net
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
const std::map< SumoXMLTag, std::set< GNEDemandElement * > > & getDemandElements() const
get demand elements
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
const std::map< SumoXMLTag, std::set< GNEAdditional * > > & getAdditionals() const
get additionals
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:125
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1964
Dialog for edit rerouter intervals.
long onCmdAddDestProbReroute(FXObject *, FXSelector, void *)
add dest prob reroute
long onCmdClickedClosingReroute(FXObject *, FXSelector, void *)
remove closing reroute
bool myRouteProbReroutesValid
flag to check if route prob reroutes are valid
long onCmdAddClosingReroute(FXObject *, FXSelector, void *)
add closing reroute
void updateRouteProbReroutesTable()
update data of probabilitry reroutes table
std::vector< GNEAdditional * > myRouteProbReroutesEdited
Route Prob Reroutes edited.
long onCmdClickedClosingLaneReroute(FXObject *, FXSelector, void *)
remove closing lane reroute
void updateClosingLaneReroutesTable()
update data of closing lane reroute table
FXTable * myDestProbRerouteTable
list with destiny probability reroutes
bool myDestProbReroutesValid
flag to check if Destiny probability reroutes are valid
long onCmdClickedRouteProbReroute(FXObject *, FXSelector, void *)
remove route prob reroute
FXTable * myClosingRerouteTable
list with closing reroutes
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
FXTextField * myEndTextField
end time text field
long onCmdEditClosingLaneReroute(FXObject *, FXSelector, void *)
/edit closing lane reroute
std::vector< GNEAdditional * > myClosingReroutesEdited
closing Reroutes edited
void updateClosingReroutesTable()
update data of closing reroute table
long onCmdEditRouteProbReroute(FXObject *, FXSelector, void *)
/edit route prob reroute
void updateDestProbReroutesTable()
update data of destiny probabilitry reroute table
FXLabel * myCheckLabel
begin/end time check label
FXTextField * myBeginTextField
begin time text field
std::vector< GNEAdditional * > myClosingLaneReroutesEdited
closing Lane Reroutes edited
FXTable * myParkingAreaRerouteTable
list with parkingAreaReroutes
bool myClosingReroutesValid
flag to check if closing reroutes are valid
long onCmdAddRouteProbReroute(FXObject *, FXSelector, void *)
add route prob reroute
long onCmdChangeBeginEnd(FXObject *, FXSelector, void *)
called when begin or endis changed
long onCmdAddParkingAreaReroute(FXObject *, FXSelector, void *)
add parkingAreaReroute
bool myParkingAreaReroutesValid
flag to check if parkingAreaReroutes are valid
long onCmdAddClosingLaneReroute(FXObject *, FXSelector, void *)
add closing lane reroute
FXTable * myClosingLaneRerouteTable
list with closing lane reroutes
bool myBeginEndValid
flag to check if begin an end are valid
FXTable * myRouteProbRerouteTable
list with route probability reroute
long onCmdEditClosingReroute(FXObject *, FXSelector, void *)
/edit closing reroute
long onCmdClickedParkingAreaReroute(FXObject *, FXSelector, void *)
remove parkingAreaReroute
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
std::vector< GNEAdditional * > myParkingAreaRerouteEdited
Parking Area reroute edited.
long onCmdEditDestProbReroute(FXObject *, FXSelector, void *)
/edit dest prob reroute
bool myClosingLaneReroutesValid
flag to check if closing lane reroutes are valid
long onCmdClickedDestProbReroute(FXObject *, FXSelector, void *)
remove dest prob reroute
long onCmdAccept(FXObject *, FXSelector, void *)
long onCmdEditParkingAreaReroute(FXObject *, FXSelector, void *)
/edit parkingAreaReroute
std::vector< GNEAdditional * > myDestProbReroutesEdited
Dest Prob Reroutes edited.
void updateParkingAreaReroutesTable()
update data of parkingAreaReroute table
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
GNEUndoList * getUndoList() const
get the undoList object
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element