Eclipse SUMO - Simulation of Urban MObility
GNEFixDemandElements.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-2020 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 used to fix demand elements during saving
19 /****************************************************************************/
20 #include <config.h>
21 
24 #include <netedit/GNENet.h>
25 #include <netedit/GNEViewNet.h>
26 #include <netedit/GNEUndoList.h>
27 
28 #include "GNEFixDemandElements.h"
29 
30 
31 // ===========================================================================
32 // FOX callback mapping
33 // ===========================================================================
34 
35 FXDEFMAP(GNEFixDemandElements) GNEFixDemandElementsMap[] = {
39 };
40 
41 // Object implementation
42 FXIMPLEMENT(GNEFixDemandElements, FXDialogBox, GNEFixDemandElementsMap, ARRAYNUMBER(GNEFixDemandElementsMap))
43 
44 // ===========================================================================
45 // member method definitions
46 // ===========================================================================
47 
48 GNEFixDemandElements::GNEFixDemandElements(GNEViewNet* viewNet, const std::vector<GNEDemandElement*>& invalidDemandElements) :
49  FXDialogBox(viewNet->getApp(), "Fix demand elements problems", GUIDesignDialogBoxExplicit(500, 450)),
50  myViewNet(viewNet) {
51  // set busStop icon for this dialog
53  // create main frame
54  myMainFrame = new FXVerticalFrame(this, GUIDesignAuxiliarFrame);
55  // create demand list
56  myDemandList = new DemandList(this, invalidDemandElements);
57  // create fix route options
58  myFixRouteOptions = new FixRouteOptions(this);
59  // create fix vehicle options
60  myFixVehicleOptions = new FixVehicleOptions(this);
61  // create fix stops options
62  myFixStopOptions = new FixStopOptions(this);
63  // create fix person plans options
64  myFixPersonPlanOptions = new FixPersonPlanOptions(this);
65  // check if fix route options has to be disabled
66  if (myDemandList->myInvalidRoutes.empty()) {
67  myFixRouteOptions->disableFixRouteOptions();
68  }
69  // check if fix vehicle options has to be disabled
70  if (myDemandList->myInvalidVehicles.empty()) {
71  myFixVehicleOptions->disableFixVehicleOptions();
72  }
73  // check if fix stop options has to be disabled
74  if (myDemandList->myInvalidStops.empty()) {
75  myFixStopOptions->disableFixStopOptions();
76  }
77  // check if fix person plan options has to be disabled
78  if (myDemandList->myInvalidPersonPlans.empty()) {
79  myFixPersonPlanOptions->disableFixPersonPlanOptions();
80  }
81  // create dialog buttons bot centered
82  FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(myMainFrame, GUIDesignHorizontalFrame);
83  new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame);
84  myAcceptButton = new FXButton(buttonsFrame, FXWindow::tr("&Accept"), GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, MID_GNE_BUTTON_ACCEPT, GUIDesignButtonAccept);
85  myCancelButton = new FXButton(buttonsFrame, FXWindow::tr("&Cancel"), GUIIconSubSys::getIcon(GUIIcon::CANCEL), this, MID_GNE_BUTTON_CANCEL, GUIDesignButtonCancel);
86  new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame);
87  // set focus in accept button
88  myAcceptButton->setFocus();
89 }
90 
91 
93 }
94 
95 
96 long
97 GNEFixDemandElements::onCmdSelectOption(FXObject* obj, FXSelector, void*) {
102  return 1;
103 }
104 
105 
106 long
107 GNEFixDemandElements::onCmdAccept(FXObject*, FXSelector, void*) {
108  bool continueSaving = true;
109  // check options for invalid routes
110  if (myDemandList->myInvalidRoutes.size() > 0) {
111  if (myFixRouteOptions->removeInvalidRoutes->getCheck() == TRUE) {
112  // begin undo list
113  myViewNet->getUndoList()->p_begin("delete invalid routes");
114  // iterate over invalid routes to delete it
115  for (auto i : myDemandList->myInvalidRoutes) {
117  }
118  // end undo list
120  } else if (myFixRouteOptions->selectInvalidRoutesAndCancel->getCheck() == TRUE) {
121  // begin undo list
122  myViewNet->getUndoList()->p_begin("select invalid routes");
123  // iterate over invalid single lane elements to select all elements
124  for (auto i : myDemandList->myInvalidRoutes) {
125  i->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList());
126  }
127  // end undo list
129  // abort saving
130  continueSaving = false;
131  }
132  }
133  // check options for invalid vehicles
134  if (myDemandList->myInvalidVehicles.size() > 0) {
135  if (myFixVehicleOptions->removeInvalidVehicles->getCheck() == TRUE) {
136  // begin undo list
137  myViewNet->getUndoList()->p_begin("delete invalid vehicles");
138  // iterate over invalid stops to delete it
139  for (auto i : myDemandList->myInvalidVehicles) {
141  }
142  // end undo list
144  } else if (myFixVehicleOptions->selectInvalidVehiclesAndCancel->getCheck() == TRUE) {
145  // begin undo list
146  myViewNet->getUndoList()->p_begin("select invalid vehicles");
147  // iterate over invalid single lane elements to select all elements
148  for (auto i : myDemandList->myInvalidVehicles) {
149  i->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList());
150  }
151  // end undo list
153  // abort saving
154  continueSaving = false;
155  }
156  }
157  // check options for stops
158  if (myDemandList->myInvalidStops.size() > 0) {
159  if (myFixStopOptions->activateFriendlyPositionAndSave->getCheck() == TRUE) {
160  // begin undo list
161  myViewNet->getUndoList()->p_begin("change " + toString(SUMO_ATTR_FRIENDLY_POS) + " of invalid stops");
162  // iterate over invalid stops to enable friendly position
163  for (auto i : myDemandList->myInvalidStops) {
164  i->setAttribute(SUMO_ATTR_FRIENDLY_POS, "true", myViewNet->getUndoList());
165  }
167  } else if (myFixStopOptions->fixPositionsAndSave->getCheck() == TRUE) {
168  myViewNet->getUndoList()->p_begin("fix positions of invalid stops");
169  // iterate over invalid stops to fix positions
170  for (auto i : myDemandList->myInvalidStops) {
171  i->fixDemandElementProblem();
172  }
174  } else if (myFixStopOptions->selectInvalidStopsAndCancel->getCheck() == TRUE) {
175  myViewNet->getUndoList()->p_begin("select invalid stops");
176  // iterate over invalid stops to select all elements
177  for (auto i : myDemandList->myInvalidStops) {
178  i->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList());
179  }
180  // end undo list
182  // abort saving
183  continueSaving = false;
184  }
185  }
186  // check options for person plans
187  if (myDemandList->myInvalidPersonPlans.size() > 0) {
188  if (myFixPersonPlanOptions->deletePersonPlan->getCheck() == TRUE) {
189  /*
190  // begin undo list
191  myViewNet->getUndoList()->p_begin("change " + toString(SUMO_ATTR_FRIENDLY_POS) + " of invalid person plans");
192  // iterate over invalid person plans to enable friendly position
193  for (auto i : myDemandList->myInvalidPersonPlans) {
194  i->setAttribute(SUMO_ATTR_FRIENDLY_POS, "true", myViewNet->getUndoList());
195  }
196  myViewNet->getUndoList()->p_end();
197  */
198  } else if (myFixPersonPlanOptions->selectInvalidPersonPlansAndCancel->getCheck() == TRUE) {
199  myViewNet->getUndoList()->p_begin("select invalid person plans");
200  // iterate over invalid person plans to select all elements
201  for (auto i : myDemandList->myInvalidPersonPlans) {
202  i->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList());
203  }
204  // end undo list
206  // abort saving
207  continueSaving = false;
208  }
209  }
210  if (continueSaving) {
211  // stop modal with TRUE (continue saving)
212  getApp()->stopModal(this, TRUE);
213  } else {
214  // stop modal with TRUE (abort saving)
215  getApp()->stopModal(this, FALSE);
216  }
217  return 1;
218 }
219 
220 
221 long
222 GNEFixDemandElements::onCmdCancel(FXObject*, FXSelector, void*) {
223  // Stop Modal (abort saving)
224  getApp()->stopModal(this, FALSE);
225  return 1;
226 }
227 
228 // ---------------------------------------------------------------------------
229 // GNEFixDemandElements::DemandList - methods
230 // ---------------------------------------------------------------------------
231 
232 GNEFixDemandElements::DemandList::DemandList(GNEFixDemandElements* fixDemandElementsDialogParents, const std::vector<GNEDemandElement*>& invalidDemandElements) :
233  FXGroupBox(fixDemandElementsDialogParents->myMainFrame, "Routes and Vehicles with conflicts", GUIDesignGroupBoxFrameFill) {
234  // Create table, copy intervals and update table
236  myTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
237  myTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
238  myTable->setEditable(false);
239  // separate demand elements in three groups
240  for (const auto& i : invalidDemandElements) {
241  if (i->getTagProperty().isVehicle()) {
242  myInvalidVehicles.push_back(i);
243  } else if (i->getTagProperty().isStop() || i->getTagProperty().isPersonStop()) {
244  myInvalidStops.push_back(i);
245  } else if (i->getTagProperty().isPersonPlan()) {
246  myInvalidPersonPlans.push_back(i);
247  } else {
248  myInvalidRoutes.push_back(i);
249  }
250  }
251  // clear table
252  myTable->clearItems();
253  // set number of rows
254  myTable->setTableSize((int)(myInvalidRoutes.size() + myInvalidVehicles.size() + myInvalidStops.size() + myInvalidPersonPlans.size()), 3);
255  // Configure list
256  myTable->setVisibleColumns(4);
257  myTable->setColumnWidth(0, GUIDesignHeight);
258  myTable->setColumnWidth(1, 160);
259  myTable->setColumnWidth(2, 280);
260  myTable->setColumnText(0, "");
261  myTable->setColumnText(1, toString(SUMO_ATTR_ID).c_str());
262  myTable->setColumnText(2, "Conflict");
263  myTable->getRowHeader()->setWidth(0);
264  // Declare index for rows and pointer to FXTableItem
265  int indexRow = 0;
266  FXTableItem* item = nullptr;
267  // iterate over invalid routes
268  for (const auto& invalidRoute : myInvalidRoutes) {
269  // Set icon
270  item = new FXTableItem("", invalidRoute->getIcon());
271  item->setIconPosition(FXTableItem::CENTER_X);
272  myTable->setItem(indexRow, 0, item);
273  // Set ID
274  item = new FXTableItem(invalidRoute->getID().c_str());
275  item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
276  myTable->setItem(indexRow, 1, item);
277  // Set conflict
278  item = new FXTableItem(invalidRoute->getDemandElementProblem().c_str());
279  item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
280  myTable->setItem(indexRow, 2, item);
281  // Update index
282  indexRow++;
283  }
284  // iterate over invalid vehicles
285  for (const auto& invalidVehicle : myInvalidVehicles) {
286  // Set icon
287  item = new FXTableItem("", invalidVehicle->getIcon());
288  item->setIconPosition(FXTableItem::CENTER_X);
289  myTable->setItem(indexRow, 0, item);
290  // Set ID
291  item = new FXTableItem(invalidVehicle->getID().c_str());
292  item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
293  myTable->setItem(indexRow, 1, item);
294  // Set conflict
295  item = new FXTableItem(invalidVehicle->getDemandElementProblem().c_str());
296  item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
297  myTable->setItem(indexRow, 2, item);
298  // Update index
299  indexRow++;
300  }
301  // iterate over invalid stops
302  for (const auto& invalidStop : myInvalidStops) {
303  // Set icon
304  item = new FXTableItem("", invalidStop->getIcon());
305  item->setIconPosition(FXTableItem::CENTER_X);
306  myTable->setItem(indexRow, 0, item);
307  // Set ID
308  item = new FXTableItem(invalidStop->getID().c_str());
309  item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
310  myTable->setItem(indexRow, 1, item);
311  // Set conflict
312  item = new FXTableItem(invalidStop->getDemandElementProblem().c_str());
313  item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
314  myTable->setItem(indexRow, 2, item);
315  // Update index
316  indexRow++;
317  }
318  // iterate over invalid person plans
319  for (const auto& invalidPersonPlan : myInvalidPersonPlans) {
320  // Set icon
321  item = new FXTableItem("", invalidPersonPlan->getIcon());
322  item->setIconPosition(FXTableItem::CENTER_X);
323  myTable->setItem(indexRow, 0, item);
324  // Set ID
325  item = new FXTableItem(invalidPersonPlan->getID().c_str());
326  item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
327  myTable->setItem(indexRow, 1, item);
328  // Set conflict
329  item = new FXTableItem(invalidPersonPlan->getDemandElementProblem().c_str());
330  item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
331  myTable->setItem(indexRow, 2, item);
332  // Update index
333  indexRow++;
334  }
335 }
336 
337 
338 // ---------------------------------------------------------------------------
339 // GNEFixDemandElements::FixRouteOptions - methods
340 // ---------------------------------------------------------------------------
341 
343  FXGroupBox(fixDemandElementsDialogParents->myMainFrame, "Solution for routes", GUIDesignGroupBoxFrame) {
344  // create horizontal frames for radio buttons
345  FXHorizontalFrame* radioButtonsFrame = new FXHorizontalFrame(this, GUIDesignHorizontalFrame);
346  // create radio button for remove invalid routes
347  removeInvalidRoutes = new FXRadioButton(radioButtonsFrame, "Remove invalid routes",
348  fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
349  // create radio button for save invalid routes
350  saveInvalidRoutes = new FXRadioButton(radioButtonsFrame, "Save invalid routes",
351  fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
352  // create radio button for select invalid routes
353  selectInvalidRoutesAndCancel = new FXRadioButton(radioButtonsFrame, "Select invalid routes",
354  fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
355  // leave option "removeInvalidRoutes" as default
356  removeInvalidRoutes->setCheck(true);
357 }
358 
359 
360 void
362  if (option == removeInvalidRoutes) {
363  removeInvalidRoutes->setCheck(true);
364  saveInvalidRoutes->setCheck(false);
365  selectInvalidRoutesAndCancel->setCheck(false);
366  } else if (option == saveInvalidRoutes) {
367  removeInvalidRoutes->setCheck(false);
368  saveInvalidRoutes->setCheck(true);
369  selectInvalidRoutesAndCancel->setCheck(false);
370  } else if (option == selectInvalidRoutesAndCancel) {
371  removeInvalidRoutes->setCheck(false);
372  saveInvalidRoutes->setCheck(false);
373  selectInvalidRoutesAndCancel->setCheck(true);
374  }
375 }
376 
377 
378 void
380  removeInvalidRoutes->enable();
381  saveInvalidRoutes->enable();
382  selectInvalidRoutesAndCancel->enable();
383 }
384 
385 
386 void
388  removeInvalidRoutes->disable();
389  saveInvalidRoutes->disable();
390  selectInvalidRoutesAndCancel->disable();
391 }
392 
393 // ---------------------------------------------------------------------------
394 // GNEFixDemandElements::FixVehicleOptions - methods
395 // ---------------------------------------------------------------------------
396 
398  FXGroupBox(fixDemandElementsDialogParents->myMainFrame, "Solution for vehicles", GUIDesignGroupBoxFrame) {
399  // create horizontal frames for radio buttons
400  FXHorizontalFrame* radioButtonsFrame = new FXHorizontalFrame(this, GUIDesignHorizontalFrame);
401  // create radio button for remove invalid vehicles
402  removeInvalidVehicles = new FXRadioButton(radioButtonsFrame, "Remove invalid vehicles",
403  fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
404  // create radio button for save invalid vehicles
405  saveInvalidVehicles = new FXRadioButton(radioButtonsFrame, "Save invalid vehicles",
406  fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
407  // create radio button for select invalid vehicles
408  selectInvalidVehiclesAndCancel = new FXRadioButton(radioButtonsFrame, "Select invalid vehicle",
409  fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
410  // leave option "buildConnectionBetweenLanes" and "removeInvalidRoutes" as default
411  removeInvalidVehicles->setCheck(true);
412 }
413 
414 
415 void
417  if (option == removeInvalidVehicles) {
418  removeInvalidVehicles->setCheck(true);
419  saveInvalidVehicles->setCheck(false);
420  selectInvalidVehiclesAndCancel->setCheck(false);
421  } else if (option == saveInvalidVehicles) {
422  removeInvalidVehicles->setCheck(false);
423  saveInvalidVehicles->setCheck(true);
424  selectInvalidVehiclesAndCancel->setCheck(false);
425  } else if (option == selectInvalidVehiclesAndCancel) {
426  removeInvalidVehicles->setCheck(false);
427  saveInvalidVehicles->setCheck(false);
428  selectInvalidVehiclesAndCancel->setCheck(true);
429  }
430 }
431 
432 
433 void
435  removeInvalidVehicles->enable();
436  saveInvalidVehicles->enable();
437  selectInvalidVehiclesAndCancel->enable();
438 }
439 
440 
441 void
443  removeInvalidVehicles->disable();
444  saveInvalidVehicles->disable();
445  selectInvalidVehiclesAndCancel->disable();
446 }
447 
448 // ---------------------------------------------------------------------------
449 // GNEFixDemandElements::FixStopOptions - methods
450 // ---------------------------------------------------------------------------
451 
453  FXGroupBox(fixDemandElementsDialogParents->myMainFrame, "Select a solution for stops", GUIDesignGroupBoxFrame) {
454  // create horizontal frames for radio buttons
455  FXHorizontalFrame* RadioButtons = new FXHorizontalFrame(this, GUIDesignHorizontalFrame);
456  // create Vertical Frame for left options
457  FXVerticalFrame* RadioButtonsLeft = new FXVerticalFrame(RadioButtons, GUIDesignAuxiliarVerticalFrame);
458  activateFriendlyPositionAndSave = new FXRadioButton(RadioButtonsLeft, "Activate friendlyPos and save",
459  fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
460  saveInvalid = new FXRadioButton(RadioButtonsLeft, "Save invalid positions",
461  fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
462  // create Vertical Frame for right options
463  FXVerticalFrame* RadioButtonsRight = new FXVerticalFrame(RadioButtons, GUIDesignAuxiliarVerticalFrame);
464  selectInvalidStopsAndCancel = new FXRadioButton(RadioButtonsRight, "Select invalid Stops",
465  fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
466  fixPositionsAndSave = new FXRadioButton(RadioButtonsRight, "Fix positions and save",
467  fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
468  // leave option "activateFriendlyPositionAndSave" as default
469  activateFriendlyPositionAndSave->setCheck(true);
470 }
471 
472 
473 void
475  if (option == activateFriendlyPositionAndSave) {
476  activateFriendlyPositionAndSave->setCheck(true);
477  fixPositionsAndSave->setCheck(false);
478  saveInvalid->setCheck(false);
479  selectInvalidStopsAndCancel->setCheck(false);
480  } else if (option == fixPositionsAndSave) {
481  activateFriendlyPositionAndSave->setCheck(false);
482  fixPositionsAndSave->setCheck(true);
483  saveInvalid->setCheck(false);
484  selectInvalidStopsAndCancel->setCheck(false);
485  } else if (option == saveInvalid) {
486  activateFriendlyPositionAndSave->setCheck(false);
487  fixPositionsAndSave->setCheck(false);
488  saveInvalid->setCheck(true);
489  selectInvalidStopsAndCancel->setCheck(false);
490  } else if (option == selectInvalidStopsAndCancel) {
491  activateFriendlyPositionAndSave->setCheck(false);
492  fixPositionsAndSave->setCheck(false);
493  saveInvalid->setCheck(false);
494  selectInvalidStopsAndCancel->setCheck(true);
495  }
496 }
497 
498 
499 void
501  activateFriendlyPositionAndSave->enable();
502  fixPositionsAndSave->enable();
503  saveInvalid->enable();
504  selectInvalidStopsAndCancel->enable();
505 }
506 
507 
508 void
510  activateFriendlyPositionAndSave->disable();
511  fixPositionsAndSave->disable();
512  saveInvalid->disable();
513  selectInvalidStopsAndCancel->disable();
514 }
515 
516 // ---------------------------------------------------------------------------
517 // GNEFixDemandElements::FixPersonPlanOptions - methods
518 // ---------------------------------------------------------------------------
519 
521  FXGroupBox(fixDemandElementsDialogParents->myMainFrame, "Select a solution for person plans", GUIDesignGroupBoxFrame) {
522  // create horizontal frames for radio buttons
523  FXHorizontalFrame* RadioButtons = new FXHorizontalFrame(this, GUIDesignHorizontalFrame);
524  // create Vertical Frame for left options
525  FXVerticalFrame* RadioButtonsLeft = new FXVerticalFrame(RadioButtons, GUIDesignAuxiliarVerticalFrame);
526  deletePersonPlan = new FXRadioButton(RadioButtonsLeft, "Delete person plan",
527  fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
528  saveInvalid = new FXRadioButton(RadioButtonsLeft, "Save invalid person plans",
529  fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
530  // create Vertical Frame for right options
531  FXVerticalFrame* RadioButtonsRight = new FXVerticalFrame(RadioButtons, GUIDesignAuxiliarVerticalFrame);
532  selectInvalidPersonPlansAndCancel = new FXRadioButton(RadioButtonsRight, "Select invalid person plans",
533  fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
534  // leave option "activateFriendlyPositionAndSave" as default
535  deletePersonPlan->setCheck(true);
536 }
537 
538 
539 void
541  if (option == deletePersonPlan) {
542  deletePersonPlan->setCheck(true);
543  saveInvalid->setCheck(false);
544  selectInvalidPersonPlansAndCancel->setCheck(false);
545  selectInvalidPersonPlansAndCancel->setCheck(false);
546  } else if (option == saveInvalid) {
547  deletePersonPlan->setCheck(false);
548  saveInvalid->setCheck(true);
549  selectInvalidPersonPlansAndCancel->setCheck(false);
550  } else if (option == selectInvalidPersonPlansAndCancel) {
551  deletePersonPlan->setCheck(false);
552  saveInvalid->setCheck(false);
553  selectInvalidPersonPlansAndCancel->setCheck(true);
554  }
555 }
556 
557 
558 void
560  deletePersonPlan->enable();
561  saveInvalid->enable();
562  selectInvalidPersonPlansAndCancel->enable();
563 }
564 
565 
566 void
568  deletePersonPlan->disable();
569  saveInvalid->disable();
570  selectInvalidPersonPlansAndCancel->disable();
571 }
572 
573 /****************************************************************************/
FXDEFMAP(GNEFixDemandElements) GNEFixDemandElementsMap[]
@ MID_GNE_BUTTON_CANCEL
cancel button
Definition: GUIAppEnum.h:1094
@ MID_CHOOSEN_OPERATION
set type of selection
Definition: GUIAppEnum.h:535
@ MID_GNE_FIXSTOPPINGPLACES_CHANGE
FixStoppingPlaces dialog.
Definition: GUIAppEnum.h:1189
@ MID_GNE_BUTTON_ACCEPT
accept button
Definition: GUIAppEnum.h:1092
#define GUIDesignDialogBoxExplicit(width, height)
design for dialog box with specift width and height (for example, additional dialogs)
Definition: GUIDesigns.h:506
#define GUIDesignTableAdditionals
design for tables used in additional dialogs
Definition: GUIDesigns.h:526
#define GUIDesignButtonAccept
Accept Button.
Definition: GUIDesigns.h:118
#define GUIDesignButtonCancel
Cancel Button.
Definition: GUIDesigns.h:121
#define GUIDesignHeight
define a standard height for all elements (Change it carefully)
Definition: GUIDesigns.h:31
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:313
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:278
#define GUIDesignAuxiliarVerticalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:316
#define GUIDesignGroupBoxFrameFill
Group box design extended over frame (X and Y)
Definition: GUIDesigns.h:281
#define GUIDesignRadioButton
Definition: GUIDesigns.h:164
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions
Definition: GUIDesigns.h:310
#define GUIDesignHorizontalFrame
Definition: GUIDesigns.h:263
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_ID
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:44
An Element which don't belongs to GNENet but has influency in the simulation.
DemandList(GNEFixDemandElements *fixDemandElementsDialogParents, const std::vector< GNEDemandElement * > &invalidDemandElements)
constructor
std::vector< GNEDemandElement * > myInvalidVehicles
vector with the invalid vehicles
std::vector< GNEDemandElement * > myInvalidRoutes
vector with the invalid routes
std::vector< GNEDemandElement * > myInvalidPersonPlans
vector with the invalid person plans
std::vector< GNEDemandElement * > myInvalidStops
vector with the invalid stops
FXTable * myTable
list with the demand elements
groupbox for all radio buttons related with fix person plan options
FXRadioButton * deletePersonPlan
Option "delete person plan".
void selectOption(FXObject *option)
select option
FXRadioButton * selectInvalidPersonPlansAndCancel
Option "Select invalid person plans and cancel".
void enableFixPersonPlanOptions()
enable position options
FixPersonPlanOptions(GNEFixDemandElements *fixDemandElementsDialogParents)
build Position Options
void disableFixPersonPlanOptions()
disable position options
FXRadioButton * saveInvalid
Option "Save invalid".
groupbox for all radio buttons related with fix route options
void selectOption(FXObject *option)
select option
void disableFixRouteOptions()
disable position options
FXRadioButton * removeInvalidRoutes
Option "Remove invalid routes".
FXRadioButton * saveInvalidRoutes
Option "Save invalid routes".
void enableFixRouteOptions()
enable position options
FXRadioButton * selectInvalidRoutesAndCancel
Option "Select invalid routes and cancel".
FixRouteOptions(GNEFixDemandElements *fixDemandElementsDialogParents)
constructor
groupbox for all radio buttons related with fix stop options
void disableFixStopOptions()
disable position options
void selectOption(FXObject *option)
select option
FXRadioButton * saveInvalid
Option "Save invalid".
FixStopOptions(GNEFixDemandElements *fixDemandElementsDialogParents)
build Position Options
FXRadioButton * fixPositionsAndSave
Option "Fix Positions and save".
FXRadioButton * selectInvalidStopsAndCancel
Option "Select invalid stops and cancel".
FXRadioButton * activateFriendlyPositionAndSave
Option "Activate friendlyPos and save".
void enableFixStopOptions()
enable position options
groupbox for all radio buttons related with fix vehicle options
FXRadioButton * saveInvalidVehicles
Option "save invalid vehicles".
void disableFixVehicleOptions()
disable consecutive lane options
void selectOption(FXObject *option)
select option
FXRadioButton * selectInvalidVehiclesAndCancel
Option "Select invalid vehicles and cancel".
FixVehicleOptions(GNEFixDemandElements *fixDemandElementsDialogParents)
constructor
void enableFixVehicleOptions()
enable consecutive lane options
FXRadioButton * removeInvalidVehicles
Option "remove invalid elements".
Dialog for edit rerouters.
DemandList * myDemandList
list with the demand elements
long onCmdSelectOption(FXObject *obj, FXSelector, void *)
FixStopOptions * myFixStopOptions
fix stop options
FixRouteOptions * myFixRouteOptions
fix route options
FXVerticalFrame * myMainFrame
main frame
FixVehicleOptions * myFixVehicleOptions
fix vehicle options
GNEViewNet * myViewNet
view net
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
FixPersonPlanOptions * myFixPersonPlanOptions
fix person plan options
long onCmdAccept(FXObject *, FXSelector, void *)
event after press accept button
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:578
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
Definition: GNEUndoList.cpp:71
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Definition: GNEUndoList.cpp:78
GNENet * getNet() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon