42 FXIMPLEMENT(
GNEFixDemandElements, FXDialogBox, GNEFixDemandElementsMap, ARRAYNUMBER(GNEFixDemandElementsMap))
56 myDemandList =
new DemandList(
this, invalidDemandElements);
66 if (myDemandList->myInvalidRoutes.empty()) {
67 myFixRouteOptions->disableFixRouteOptions();
70 if (myDemandList->myInvalidVehicles.empty()) {
71 myFixVehicleOptions->disableFixVehicleOptions();
74 if (myDemandList->myInvalidStops.empty()) {
75 myFixStopOptions->disableFixStopOptions();
78 if (myDemandList->myInvalidPersonPlans.empty()) {
79 myFixPersonPlanOptions->disableFixPersonPlanOptions();
88 myAcceptButton->setFocus();
108 bool continueSaving =
true;
130 continueSaving =
false;
154 continueSaving =
false;
171 i->fixDemandElementProblem();
183 continueSaving =
false;
207 continueSaving =
false;
210 if (continueSaving) {
212 getApp()->stopModal(
this, TRUE);
215 getApp()->stopModal(
this, FALSE);
224 getApp()->stopModal(
this, FALSE);
236 myTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
237 myTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
240 for (
const auto& i : invalidDemandElements) {
241 if (i->getTagProperty().isVehicle()) {
243 }
else if (i->getTagProperty().isStop() || i->getTagProperty().isPersonStop()) {
245 }
else if (i->getTagProperty().isPersonPlan()) {
258 myTable->setColumnWidth(1, 160);
259 myTable->setColumnWidth(2, 280);
262 myTable->setColumnText(2,
"Conflict");
263 myTable->getRowHeader()->setWidth(0);
266 FXTableItem* item =
nullptr;
270 item =
new FXTableItem(
"", invalidRoute->getIcon());
271 item->setIconPosition(FXTableItem::CENTER_X);
272 myTable->setItem(indexRow, 0, item);
274 item =
new FXTableItem(invalidRoute->getID().c_str());
275 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
276 myTable->setItem(indexRow, 1, item);
278 item =
new FXTableItem(invalidRoute->getDemandElementProblem().c_str());
279 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
280 myTable->setItem(indexRow, 2, item);
287 item =
new FXTableItem(
"", invalidVehicle->getIcon());
288 item->setIconPosition(FXTableItem::CENTER_X);
289 myTable->setItem(indexRow, 0, item);
291 item =
new FXTableItem(invalidVehicle->getID().c_str());
292 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
293 myTable->setItem(indexRow, 1, item);
295 item =
new FXTableItem(invalidVehicle->getDemandElementProblem().c_str());
296 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
297 myTable->setItem(indexRow, 2, item);
304 item =
new FXTableItem(
"", invalidStop->getIcon());
305 item->setIconPosition(FXTableItem::CENTER_X);
306 myTable->setItem(indexRow, 0, item);
308 item =
new FXTableItem(invalidStop->getID().c_str());
309 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
310 myTable->setItem(indexRow, 1, item);
312 item =
new FXTableItem(invalidStop->getDemandElementProblem().c_str());
313 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
314 myTable->setItem(indexRow, 2, item);
321 item =
new FXTableItem(
"", invalidPersonPlan->getIcon());
322 item->setIconPosition(FXTableItem::CENTER_X);
323 myTable->setItem(indexRow, 0, item);
325 item =
new FXTableItem(invalidPersonPlan->getID().c_str());
326 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
327 myTable->setItem(indexRow, 1, item);
329 item =
new FXTableItem(invalidPersonPlan->getDemandElementProblem().c_str());
330 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
331 myTable->setItem(indexRow, 2, item);
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);
380 removeInvalidRoutes->enable();
381 saveInvalidRoutes->enable();
382 selectInvalidRoutesAndCancel->enable();
388 removeInvalidRoutes->disable();
389 saveInvalidRoutes->disable();
390 selectInvalidRoutesAndCancel->disable();
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);
435 removeInvalidVehicles->enable();
436 saveInvalidVehicles->enable();
437 selectInvalidVehiclesAndCancel->enable();
443 removeInvalidVehicles->disable();
444 saveInvalidVehicles->disable();
445 selectInvalidVehiclesAndCancel->disable();
460 saveInvalid =
new FXRadioButton(RadioButtonsLeft,
"Save invalid positions",
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);
501 activateFriendlyPositionAndSave->enable();
502 fixPositionsAndSave->enable();
503 saveInvalid->enable();
504 selectInvalidStopsAndCancel->enable();
510 activateFriendlyPositionAndSave->disable();
511 fixPositionsAndSave->disable();
512 saveInvalid->disable();
513 selectInvalidStopsAndCancel->disable();
526 deletePersonPlan =
new FXRadioButton(RadioButtonsLeft,
"Delete person plan",
528 saveInvalid =
new FXRadioButton(RadioButtonsLeft,
"Save invalid person plans",
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);
560 deletePersonPlan->enable();
561 saveInvalid->enable();
562 selectInvalidPersonPlansAndCancel->enable();
568 deletePersonPlan->disable();
569 saveInvalid->disable();
570 selectInvalidPersonPlansAndCancel->disable();
FXDEFMAP(GNEFixDemandElements) GNEFixDemandElementsMap[]
@ MID_GNE_BUTTON_CANCEL
cancel button
@ MID_CHOOSEN_OPERATION
set type of selection
@ MID_GNE_FIXSTOPPINGPLACES_CHANGE
FixStoppingPlaces dialog.
@ MID_GNE_BUTTON_ACCEPT
accept button
#define GUIDesignDialogBoxExplicit(width, height)
design for dialog box with specift width and height (for example, additional dialogs)
#define GUIDesignTableAdditionals
design for tables used in additional dialogs
#define GUIDesignButtonAccept
Accept Button.
#define GUIDesignButtonCancel
Cancel Button.
#define GUIDesignHeight
define a standard height for all elements (Change it carefully)
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
#define GUIDesignAuxiliarVerticalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignGroupBoxFrameFill
Group box design extended over frame (X and Y)
#define GUIDesignRadioButton
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions
#define GUIDesignHorizontalFrame
@ GNE_ATTR_SELECTED
element is selected
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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
~GNEFixDemandElements()
destructor
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
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...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
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