Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEFixDemandElements.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 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
23#include <netedit/GNENet.h>
25#include <netedit/GNEUndoList.h>
26#include <netedit/GNEViewNet.h>
28
30
31// ===========================================================================
32// FOX callback mapping
33// ===========================================================================
34
40
41// Object implementation
42FXIMPLEMENT(GNEFixDemandElements, GNEFixElementsDialog, GNEFixDemandElementsMap, ARRAYNUMBER(GNEFixDemandElementsMap))
43
44// ===========================================================================
45// member method definitions
46// ===========================================================================
47
48// ---------------------------------------------------------------------------
49// GNEFixDemandElements - methods
50// ---------------------------------------------------------------------------
51
53 GNEFixElementsDialog(viewNet, TL("Fix demand elements problems"), GUIIcon::SUPERMODEDEMAND, 800, 620) {
54 // create frames for options
55 FXHorizontalFrame* optionsFrame = new FXHorizontalFrame(myMainFrame, GUIDesignAuxiliarFrame);
56 myLeftFrame = new FXVerticalFrame(optionsFrame, GUIDesignAuxiliarFrame);
57 myRightFrame = new FXVerticalFrame(optionsFrame, GUIDesignAuxiliarFrame);
58 // create fix route options
59 myFixRouteOptions = new FixRouteOptions(this, viewNet);
60 // create fix vehicle options
61 myFixVehicleOptions = new FixVehicleOptions(this, viewNet);
62 // create fix stops options
63 myFixStopPositionOptions = new FixStopPositionOptions(this, viewNet);
64 // create fix person plans options
65 myFixPersonPlanOptions = new FixPersonPlanOptions(this, viewNet);
66 // create buttons
67 myButtons = new Buttons(this);
68}
69
70
73
74
75FXuint
76GNEFixDemandElements::openDialog(const std::vector<GNEDemandElement*>& invalidDemandElements) {
77 // split invalidDemandElements in four groups
78 std::vector<GNEDemandElement*> invalidRoutes, invalidVehicles, invalidStops, invalidPlans;
79 // fill groups
80 for (const auto& invalidDemandElement : invalidDemandElements) {
81 if (invalidDemandElement->getTagProperty()->isRoute()) {
82 invalidRoutes.push_back(invalidDemandElement);
83 } else if (invalidDemandElement->getTagProperty()->isVehicle()) {
84 invalidVehicles.push_back(invalidDemandElement);
85 } else if (invalidDemandElement->getTagProperty()->isVehicleStop()) {
86 invalidStops.push_back(invalidDemandElement);
87 } else {
88 invalidPlans.push_back(invalidDemandElement);
89 }
90 }
91 // fill options
96 // set focus in accept button
97 myButtons->myAcceptButton->setFocus();
98 // open modal dialog
99 return openFixDialog();
100}
101
102
103void
105 // chooose solution
106 if (dialogTest->fixSolution == "saveRouteInvalids") {
107 myFixRouteOptions->saveInvalidRoutes->setCheck(TRUE, TRUE);
108 } else if (dialogTest->fixSolution == "removeRouteInvalids") {
109 myFixRouteOptions->removeInvalidRoutes->setCheck(TRUE, TRUE);
110 } else if (dialogTest->fixSolution == "selectRouteInvalids") {
111 myFixRouteOptions->selectRouteInvalids->setCheck(TRUE, TRUE);
112 }
113 // accept changes
114 onCmdAccept(nullptr, 0, nullptr);
115}
116
117
118long
119GNEFixDemandElements::onCmdSelectOption(FXObject* obj, FXSelector, void*) {
120 // select options
125 return 1;
126}
127
128
129long
130GNEFixDemandElements::onCmdAccept(FXObject*, FXSelector, void*) {
131 bool abortSaving = false;
132 // fix elements
133 myFixRouteOptions->fixElements(abortSaving);
134 myFixVehicleOptions->fixElements(abortSaving);
137 // stop dialog
138 return closeFixDialog(abortSaving);
139}
140
141
142long
143GNEFixDemandElements::onCmdCancel(FXObject*, FXSelector, void*) {
144 // stop dialog
145 return closeFixDialog(false);
146}
147
148// ---------------------------------------------------------------------------
149// GNEFixDemandElements::FixOptions - methods
150// ---------------------------------------------------------------------------
151
152GNEFixDemandElements::FixOptions::FixOptions(FXVerticalFrame* frameParent, const std::string& title, GNEViewNet* viewNet) :
153 MFXGroupBoxModule(frameParent, title, MFXGroupBoxModule::Options::SAVE),
154 myViewNet(viewNet) {
155 // Create table
156 myTable = new FXTable(this, this, MID_TABLE, GUIDesignTableFixElements);
157 myTable->disable();
158 // create horizontal frame
159 FXHorizontalFrame* horizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
160 // create vertical frames
161 myLeftFrame = new FXVerticalFrame(horizontalFrame, GUIDesignAuxiliarVerticalFrame);
162 myRightFrame = new FXVerticalFrame(horizontalFrame, GUIDesignAuxiliarVerticalFrame);
163}
164
165
166void
167GNEFixDemandElements::FixOptions::setInvalidElements(const std::vector<GNEDemandElement*>& invalidElements) {
168 // update invalid elements
169 myInvalidElements = invalidElements;
170 // configure table
171 myTable->setTableSize((int)(myInvalidElements.size()), 3);
172 myTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
173 myTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
174 myTable->setEditable(false);
175 // configure header
176 myTable->setVisibleColumns(4);
177 myTable->setColumnWidth(0, GUIDesignHeight);
178 myTable->setColumnWidth(1, 150);
179 myTable->setColumnWidth(2, 200);
180 myTable->setColumnText(0, "");
181 myTable->setColumnText(1, toString(SUMO_ATTR_ID).c_str());
182 myTable->setColumnText(2, "Conflict");
183 myTable->getRowHeader()->setWidth(0);
184 // Declare pointer to FXTableItem
185 FXTableItem* item = nullptr;
186 // iterate over invalid routes
187 for (int i = 0; i < (int)myInvalidElements.size(); i++) {
188 // Set icon
189 item = new FXTableItem("", myInvalidElements.at(i)->getACIcon());
190 item->setIconPosition(FXTableItem::CENTER_X);
191 myTable->setItem(i, 0, item);
192 // Set ID
193 item = new FXTableItem(myInvalidElements.at(i)->getID().c_str());
194 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
195 myTable->setItem(i, 1, item);
196 // Set conflict
197 item = new FXTableItem(myInvalidElements.at(i)->getDemandElementProblem().c_str());
198 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
199 myTable->setItem(i, 2, item);
200 }
201 // check if enable or disable options
202 if (invalidElements.size() > 0) {
203 enableOptions();
204 toggleSaveButton(true);
205 } else {
206 disableOptions();
207 toggleSaveButton(false);
208 }
209}
210
211bool
213 const FXString file = MFXUtils::getFilename2Write(myTable, TL("Save list of conflicted items"),
214 SUMOXMLDefinitions::TXTFileExtensions.getMultilineString().c_str(),
216 if (file == "") {
217 return false;
218 }
219 try {
220 // open output device
221 OutputDevice& dev = OutputDevice::getDevice(file.text());
222 // get invalid element ID and problem
223 for (const auto& invalidElement : myInvalidElements) {
224 dev << invalidElement->getID() << ":" << invalidElement->getDemandElementProblem() << "\n";
225 }
226 // close output device
227 dev.close();
228 // open message box error
229 FXMessageBox::information(myTable, MBOX_OK, "Saving successfully", "%s", "List of conflicted items was successfully saved");
230 } catch (IOError& e) {
231 // open message box error
232 FXMessageBox::error(myTable, MBOX_OK, "Saving list of conflicted items failed", "%s", e.what());
233 }
234 return true;
235}
236
237// ---------------------------------------------------------------------------
238// GNEFixDemandElements::FixRouteOptions - methods
239// ---------------------------------------------------------------------------
240
242 FixOptions(fixDemandElementsParent->myLeftFrame, "Routes", viewNet) {
243 // Remove invalid routes
244 removeInvalidRoutes = new FXRadioButton(myLeftFrame, TL("Remove invalid routes"),
245 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix);
246 // Save invalid routes
247 saveInvalidRoutes = new FXRadioButton(myLeftFrame, TL("Save invalid routes"),
248 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix);
249 // Select invalid routes
250 selectRouteInvalids = new FXRadioButton(myRightFrame, TL("Select conflicted routes"),
251 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix);
252 // Remove stops out of route
253 removeStopsOutOfRoute = new FXCheckButton(myRightFrame, TL("Remove stops out of route"),
254 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignCheckButtonFix);
255 // leave option "removeInvalidRoutes" as default
256 removeInvalidRoutes->setCheck(true);
257 // ... and remove stops out of route
258 removeStopsOutOfRoute->setCheck(TRUE);
259}
260
261
262void
264 if (option == removeInvalidRoutes) {
265 removeInvalidRoutes->setCheck(true);
266 saveInvalidRoutes->setCheck(false);
267 selectRouteInvalids->setCheck(false);
268 } else if (option == saveInvalidRoutes) {
269 removeInvalidRoutes->setCheck(false);
270 saveInvalidRoutes->setCheck(true);
271 selectRouteInvalids->setCheck(false);
272 } else if (option == selectRouteInvalids) {
273 removeInvalidRoutes->setCheck(false);
274 saveInvalidRoutes->setCheck(false);
275 selectRouteInvalids->setCheck(true);
276 }
277}
278
279
280void
282 if (myInvalidElements.size() > 0) {
283 if (removeInvalidRoutes->getCheck() == TRUE) {
284 // begin undo list
285 myViewNet->getUndoList()->begin(GUIIcon::ROUTE, "delete invalid routes");
286 // iterate over invalid routes to delete it
287 for (const auto& invalidRoute : myInvalidElements) {
288 // special case for embedded routes
289 if (invalidRoute->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED) {
290 myViewNet->getNet()->deleteDemandElement(invalidRoute->getParentDemandElements().front(), myViewNet->getUndoList());
291 } else {
293 }
294 }
295 // end undo list
297 } else if (selectRouteInvalids->getCheck() == TRUE) {
298 // begin undo list
299 myViewNet->getUndoList()->begin(GUIIcon::ROUTE, "select invalid routes");
300 // iterate over invalid single lane elements to select all elements
301 for (const auto& invalidRoute : myInvalidElements) {
302 invalidRoute->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList());
303 }
304 // end undo list
306 // abort saving
307 abortSaving = true;
308 }
309 // check if remove stops
310 if (removeStopsOutOfRoute->getCheck() == TRUE) {
311 // get all stops to remove
312 std::vector<GNEDemandElement*> stopsToRemove;
313 for (const auto& invalidRoute : myInvalidElements) {
314 const auto invaldstops = invalidRoute->getInvalidStops();
315 // append to stopsToRemove
316 stopsToRemove.insert(stopsToRemove.end(), invaldstops.begin(), invaldstops.end());
317 }
318 // begin undo list
319 myViewNet->getUndoList()->begin(GUIIcon::STOP, "delete invalid stops");
320 // remove all
321 for (const auto& stopToRemove : stopsToRemove) {
323 }
324 // end undo list
326 }
327 }
328}
329
330
331void
333 removeInvalidRoutes->enable();
334 saveInvalidRoutes->enable();
335 selectRouteInvalids->enable();
336 removeStopsOutOfRoute->enable();
337}
338
339
340void
342 removeInvalidRoutes->disable();
343 saveInvalidRoutes->disable();
344 selectRouteInvalids->disable();
345 removeStopsOutOfRoute->disable();
346}
347
348// ---------------------------------------------------------------------------
349// GNEFixDemandElements::FixVehicleOptions - methods
350// ---------------------------------------------------------------------------
351
353 FixOptions(fixDemandElementsParent->myLeftFrame, "Vehicles", viewNet) {
354 // Remove invalid vehicles
355 removeInvalidVehicles = new FXRadioButton(myLeftFrame, TL("Remove invalid vehicles"),
356 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix);
357 // Save invalid vehicles
358 saveInvalidVehicles = new FXRadioButton(myLeftFrame, TL("Save invalid vehicles"),
359 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix);
360 // Select invalid vehicle
361 selectInvalidVehiclesAndCancel = new FXRadioButton(myRightFrame, TL("Select conflicted vehicle"),
362 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix);
363 // Remove stops out of route
364 removeStopsOutOfVehicle = new FXCheckButton(myRightFrame, TL("Remove stops out of vehicle's route"),
365 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignCheckButtonFix);
366 // by default remove invalid vehicles
367 removeInvalidVehicles->setCheck(TRUE);
368 // ... and remove stops out of route
369 removeStopsOutOfVehicle->setCheck(TRUE);
370}
371
372
373void
375 if (option == removeInvalidVehicles) {
376 removeInvalidVehicles->setCheck(true);
377 saveInvalidVehicles->setCheck(false);
378 selectInvalidVehiclesAndCancel->setCheck(false);
379 } else if (option == saveInvalidVehicles) {
380 removeInvalidVehicles->setCheck(false);
381 saveInvalidVehicles->setCheck(true);
382 selectInvalidVehiclesAndCancel->setCheck(false);
383 } else if (option == selectInvalidVehiclesAndCancel) {
384 removeInvalidVehicles->setCheck(false);
385 saveInvalidVehicles->setCheck(false);
386 selectInvalidVehiclesAndCancel->setCheck(true);
387 }
388}
389
390
391void
393 if (myInvalidElements.size() > 0) {
394 if (removeInvalidVehicles->getCheck() == TRUE) {
395 // begin undo list
396 myViewNet->getUndoList()->begin(GUIIcon::VEHICLE, "delete invalid vehicles");
397 // iterate over invalid vehicles to delete it
398 for (const auto& invalidVehicle : myInvalidElements) {
399 // check that vehicle was not removed previously in cascade
400 if (myViewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(invalidVehicle->getTagProperty()->getTag(), invalidVehicle->getID(), false) != nullptr) {
402 }
403 }
404 // end undo list
406 } else if (selectInvalidVehiclesAndCancel->getCheck() == TRUE) {
407 // begin undo list
408 myViewNet->getUndoList()->begin(GUIIcon::ROUTE, "select invalid routes");
409 // iterate over invalid single lane elements to select all elements
410 for (const auto& invalidVehicle : myInvalidElements) {
411 invalidVehicle->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList());
412 }
413 // end undo list
415 // abort saving
416 abortSaving = true;
417 }
418 // check if remove stops
419 if (removeStopsOutOfVehicle->getCheck() == TRUE) {
420 // get all stops to remove
421 std::vector<GNEDemandElement*> stopsToRemove;
422 for (const auto& invalidVehicle : myInvalidElements) {
423 const auto invaldstops = invalidVehicle->getInvalidStops();
424 // append to stopsToRemove
425 stopsToRemove.insert(stopsToRemove.end(), invaldstops.begin(), invaldstops.end());
426 }
427 // begin undo list
428 myViewNet->getUndoList()->begin(GUIIcon::STOP, "delete invalid stops");
429 // remove all
430 for (const auto& stopToRemove : stopsToRemove) {
432 }
433 // end undo list
435 }
436 }
437}
438
439
440void
442 removeInvalidVehicles->enable();
443 saveInvalidVehicles->enable();
444 selectInvalidVehiclesAndCancel->enable();
445 removeStopsOutOfVehicle->enable();
446}
447
448
449void
451 removeInvalidVehicles->disable();
452 saveInvalidVehicles->disable();
453 selectInvalidVehiclesAndCancel->disable();
454 removeStopsOutOfVehicle->disable();
455}
456
457// ---------------------------------------------------------------------------
458// GNEFixDemandElements::FixStopPositionOptions - methods
459// ---------------------------------------------------------------------------
460
462 FixOptions(fixDemandElementsParent->myRightFrame, "Stop positions", viewNet) {
463 // Activate friendlyPos and save
464 activateFriendlyPositionAndSave = new FXRadioButton(myLeftFrame, TL("Activate friendlyPos and save"),
465 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix);
466 // Save invalid position
467 saveInvalid = new FXRadioButton(myLeftFrame, TL("Save invalid positions"),
468 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix);
469 // Select invalid Stops
470 selectInvalidStopsAndCancel = new FXRadioButton(myRightFrame, TL("Select conflicted Stops"),
471 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix);
472 // Fix positions and save
473 fixPositionsAndSave = new FXRadioButton(myRightFrame, TL("Fix positions and save"),
474 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix);
475 // leave option "activateFriendlyPositionAndSave" as default
476 activateFriendlyPositionAndSave->setCheck(true);
477}
478
479
480void
482 if (option == activateFriendlyPositionAndSave) {
483 activateFriendlyPositionAndSave->setCheck(true);
484 fixPositionsAndSave->setCheck(false);
485 saveInvalid->setCheck(false);
486 selectInvalidStopsAndCancel->setCheck(false);
487 } else if (option == fixPositionsAndSave) {
488 activateFriendlyPositionAndSave->setCheck(false);
489 fixPositionsAndSave->setCheck(true);
490 saveInvalid->setCheck(false);
491 selectInvalidStopsAndCancel->setCheck(false);
492 } else if (option == saveInvalid) {
493 activateFriendlyPositionAndSave->setCheck(false);
494 fixPositionsAndSave->setCheck(false);
495 saveInvalid->setCheck(true);
496 selectInvalidStopsAndCancel->setCheck(false);
497 } else if (option == selectInvalidStopsAndCancel) {
498 activateFriendlyPositionAndSave->setCheck(false);
499 fixPositionsAndSave->setCheck(false);
500 saveInvalid->setCheck(false);
501 selectInvalidStopsAndCancel->setCheck(true);
502 }
503}
504
505
506void
508 // check options for stops
509 if (myInvalidElements.size() > 0) {
510 if (activateFriendlyPositionAndSave->getCheck() == TRUE) {
511 // begin undo list
512 myViewNet->getUndoList()->begin(GUIIcon::STOP, "change " + toString(SUMO_ATTR_FRIENDLY_POS) + " of invalid stops");
513 // iterate over invalid stops to enable friendly position
514 for (const auto& stop : myInvalidElements) {
515 stop->setAttribute(SUMO_ATTR_FRIENDLY_POS, "true", myViewNet->getUndoList());
516 }
518 } else if (fixPositionsAndSave->getCheck() == TRUE) {
519 myViewNet->getUndoList()->begin(GUIIcon::STOP, "fix positions of invalid stops");
520 // iterate over invalid stops to fix positions
521 for (const auto& stop : myInvalidElements) {
522 stop->fixDemandElementProblem();
523 }
525 } else if (selectInvalidStopsAndCancel->getCheck() == TRUE) {
526 myViewNet->getUndoList()->begin(GUIIcon::STOP, "select invalid stops");
527 // iterate over invalid stops to select all elements
528 for (const auto& stop : myInvalidElements) {
529 stop->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList());
530 }
531 // end undo list
533 // abort saving
534 abortSaving = true;
535 }
536 }
537}
538
539
540void
542 activateFriendlyPositionAndSave->enable();
543 fixPositionsAndSave->enable();
544 saveInvalid->enable();
545 selectInvalidStopsAndCancel->enable();
546}
547
548
549void
551 activateFriendlyPositionAndSave->disable();
552 fixPositionsAndSave->disable();
553 saveInvalid->disable();
554 selectInvalidStopsAndCancel->disable();
555}
556
557// ---------------------------------------------------------------------------
558// GNEFixDemandElements::FixPersonPlanOptions - methods
559// ---------------------------------------------------------------------------
560
562 FixOptions(fixDemandElementsParent->myRightFrame, "Person/container plans", viewNet) {
563 // Delete person plan
564 deletePersonPlan = new FXRadioButton(myLeftFrame, TL("Delete person plan"),
565 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix);
566 // Save invalid person plans
567 saveInvalid = new FXRadioButton(myLeftFrame, TL("Save invalid person plans"),
568 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix);
569 // Select invalid person plans
570 selectInvalidPersonPlansAndCancel = new FXRadioButton(myRightFrame, TL("Select conflicted person plans"),
571 fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix);
572 // leave option "activateFriendlyPositionAndSave" as default
573 deletePersonPlan->setCheck(true);
574}
575
576
577void
579 if (option == deletePersonPlan) {
580 deletePersonPlan->setCheck(true);
581 saveInvalid->setCheck(false);
582 selectInvalidPersonPlansAndCancel->setCheck(false);
583 selectInvalidPersonPlansAndCancel->setCheck(false);
584 } else if (option == saveInvalid) {
585 deletePersonPlan->setCheck(false);
586 saveInvalid->setCheck(true);
587 selectInvalidPersonPlansAndCancel->setCheck(false);
588 } else if (option == selectInvalidPersonPlansAndCancel) {
589 deletePersonPlan->setCheck(false);
590 saveInvalid->setCheck(false);
591 selectInvalidPersonPlansAndCancel->setCheck(true);
592 }
593}
594
595
596void
598 // check options for person plans
599 if (myInvalidElements.size() > 0) {
600 if (deletePersonPlan->getCheck() == TRUE) {
601 // begin undo list
602 myViewNet->getUndoList()->begin(GUIIcon::MODEPERSONPLAN, "delete invalid person plans");
603 // remove all invalid person plans
604 for (const auto& personPlan : myInvalidElements) {
606 }
608 } else if (selectInvalidPersonPlansAndCancel->getCheck() == TRUE) {
609 myViewNet->getUndoList()->begin(GUIIcon::MODEPERSONPLAN, "select invalid person plans");
610 // iterate over invalid person plans to select all elements
611 for (const auto& personPlan : myInvalidElements) {
612 personPlan->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList());
613 }
614 // end undo list
616 // abort saving
617 abortSaving = false;
618 }
619 }
620}
621
622
623void
625 deletePersonPlan->enable();
626 saveInvalid->enable();
627 selectInvalidPersonPlansAndCancel->enable();
628}
629
630
631void
633 deletePersonPlan->disable();
634 saveInvalid->disable();
635 selectInvalidPersonPlansAndCancel->disable();
636}
637
638/****************************************************************************/
FXDEFMAP(GNEFixDemandElements) GNEFixDemandElementsMap[]
@ MID_GNE_BUTTON_CANCEL
cancel button
@ MID_TABLE
The Table.
Definition GUIAppEnum.h:539
@ MID_CHOOSEN_OPERATION
set type of selection
Definition GUIAppEnum.h:597
@ MID_GNE_BUTTON_ACCEPT
accept button
#define GUIDesignRadioButtonFix
design for radio button with fixed height (used in fix elements dialogs)
Definition GUIDesigns.h:235
#define GUIDesignCheckButtonFix
design for check button with fixed height (used in fix elements dialogs)
Definition GUIDesigns.h:210
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:399
#define GUIDesignAuxiliarVerticalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:408
#define GUIDesignTableFixElements
design for tables used in GNEFixDemandElements dialogs
Definition GUIDesigns.h:637
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
Definition GUIDesigns.h:390
FXString gCurrentFolder
The folder used as last.
GUIIcon
An enumeration of icons used by the gui applications.
Definition GUIIcons.h:33
@ MODEPERSONPLAN
@ SUPERMODEDEMAND
@ SAVE
save icons
#define TL(string)
Definition MsgHandler.h:305
@ GNE_TAG_ROUTE_EMBEDDED
embedded route
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_ID
int GUIDesignHeight
the default size for GUI elements
Definition StdDefs.cpp:36
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
FXVerticalFrame * myRightFrame
vertical right frame
FXTable * myTable
Table with the demand elements.
void setInvalidElements(const std::vector< GNEDemandElement * > &invalidElements)
set invalid demand elements
FXVerticalFrame * myLeftFrame
vertical left frame
FixOptions(FXVerticalFrame *frameParent, const std::string &title, GNEViewNet *viewNet)
constructor
groupbox for all radio buttons related with fix person plan options
FXRadioButton * deletePersonPlan
Option "delete person plan".
FixPersonPlanOptions(GNEFixDemandElements *fixDemandElementsParent, GNEViewNet *viewNet)
build Position Options
void disableOptions()
disable personPlan options
void selectOption(FXObject *option)
select option
FXRadioButton * selectInvalidPersonPlansAndCancel
Option "Select invalid person plans and cancel".
void fixElements(bool &abortSaving)
fix elements
FXRadioButton * saveInvalid
Option "Save invalid".
groupbox for all radio buttons related with fix route options
void selectOption(FXObject *option)
select option
void fixElements(bool &abortSaving)
fix elements
FXRadioButton * removeInvalidRoutes
Option "Remove invalid routes".
FXRadioButton * saveInvalidRoutes
Option "Save invalid routes".
FXRadioButton * selectRouteInvalids
Option "Select invalid routes and cancel".
FXCheckButton * removeStopsOutOfRoute
Option "Remove stops out of route".
FixRouteOptions(GNEFixDemandElements *fixDemandElementsParent, GNEViewNet *viewNet)
constructor
groupbox for all radio buttons related with fix stop options
FXRadioButton * saveInvalid
Option "Save invalid".
void fixElements(bool &abortSaving)
fix elements
FixStopPositionOptions(GNEFixDemandElements *fixDemandElementsParent, GNEViewNet *viewNet)
build Position Options
FXRadioButton * fixPositionsAndSave
Option "Fix Positions and save".
FXRadioButton * selectInvalidStopsAndCancel
Option "Select invalid stops and cancel".
void selectOption(FXObject *option)
select option
FXRadioButton * activateFriendlyPositionAndSave
Option "Activate friendlyPos and save".
groupbox for all radio buttons related with fix vehicle options
FXRadioButton * saveInvalidVehicles
Option "save invalid vehicles".
FXCheckButton * removeStopsOutOfVehicle
Option "Remove stops out of vehicle".
void selectOption(FXObject *option)
select option
FXRadioButton * selectInvalidVehiclesAndCancel
Option "Select invalid vehicles and cancel".
void fixElements(bool &abortSaving)
fix elements
FXRadioButton * removeInvalidVehicles
Option "remove invalid elements".
FixVehicleOptions(GNEFixDemandElements *fixDemandElementsParent, GNEViewNet *viewNet)
constructor
void runInternalTest(const InternalTestStep::DialogTest *dialogTest)
run internal test
FixStopPositionOptions * myFixStopPositionOptions
fix stop options
long onCmdSelectOption(FXObject *obj, FXSelector, void *)
event when user select a option
FixRouteOptions * myFixRouteOptions
fix route options
FXVerticalFrame * myRightFrame
vertical right frame
FixVehicleOptions * myFixVehicleOptions
fix vehicle options
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
FXuint openDialog(const std::vector< GNEDemandElement * > &invalidDemandElements)
open fix demand elements dialog
FXVerticalFrame * myLeftFrame
vertical left frame
FXButton * myAcceptButton
accept button
long openFixDialog()
open dialog
GNEViewNet * myViewNet
view net
long closeFixDialog(const bool success)
stop fix elements dialog accepting changes
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition GNENet.cpp:749
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:147
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
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
dialog arguments (used for certain functions that opens modal dialogs)
const std::string fixSolution
solution for fix dialogs
MFXGroupBoxModule (based on FXGroupBox)
Options
GroupBoxModule options.
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extensions, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition MFXUtils.cpp:116
Static storage of an output device and its base (abstract) implementation.
void close()
Closes the device and removes it from the dictionary.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
static StringBijection< TXTFileExtension > TXTFileExtensions
TXT file Extensions.