From da17e1056c97392afbbad5db42c2513449767e57 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Sun, 7 May 2017 12:18:25 +0000 Subject: [PATCH] Due a invalid call to isTestingModeEnabled() during closing of netedit, changed all "isTestingModeEnabled()" calls for "getOptions().getBool("gui-testing")". Refs #3045 git-svn-id: file:///home/behr_mi/git/sumo_synched/trunk@24224 afbd958f-9f77-42d5-a016-97a22340ccf4 --- sumo/src/netedit/GNEAdditionalFrame.cpp | 2 +- sumo/src/netedit/GNEApplicationWindow.cpp | 50 +++++++++---------- sumo/src/netedit/GNEBusStop.cpp | 10 ++-- sumo/src/netedit/GNECalibrator.cpp | 2 +- sumo/src/netedit/GNECalibratorDialog.cpp | 15 +++--- sumo/src/netedit/GNECalibratorFlowDialog.cpp | 4 +- sumo/src/netedit/GNECalibratorRouteDialog.cpp | 4 +- .../GNECalibratorVehicleTypeDialog.cpp | 4 +- sumo/src/netedit/GNEChange_Additional.cpp | 10 ++-- sumo/src/netedit/GNEChange_Attribute.cpp | 13 +++-- sumo/src/netedit/GNEChange_Attribute.h | 4 -- sumo/src/netedit/GNEChange_Connection.cpp | 8 +-- sumo/src/netedit/GNEChange_Crossing.cpp | 8 +-- sumo/src/netedit/GNEChange_Edge.cpp | 12 ++--- sumo/src/netedit/GNEChange_Junction.cpp | 12 ++--- sumo/src/netedit/GNEChange_Lane.cpp | 16 +++--- sumo/src/netedit/GNEChange_TLS.cpp | 12 ++--- sumo/src/netedit/GNEChargingStation.cpp | 10 ++-- sumo/src/netedit/GNEConnection.cpp | 2 +- sumo/src/netedit/GNEContainerStop.cpp | 10 ++-- sumo/src/netedit/GNECrossing.cpp | 2 +- sumo/src/netedit/GNEDeleteFrame.cpp | 12 ++--- sumo/src/netedit/GNEDetector.cpp | 2 +- sumo/src/netedit/GNEDetectorE1.cpp | 2 +- sumo/src/netedit/GNEDetectorE2.cpp | 2 +- sumo/src/netedit/GNEDetectorE3.cpp | 6 +-- sumo/src/netedit/GNEDetectorEntry.cpp | 2 +- sumo/src/netedit/GNEDetectorExit.cpp | 2 +- sumo/src/netedit/GNEEdge.cpp | 16 +++--- sumo/src/netedit/GNEInspectorFrame.cpp | 2 +- sumo/src/netedit/GNEJunction.cpp | 14 +++--- sumo/src/netedit/GNELane.cpp | 2 +- sumo/src/netedit/GNERerouter.cpp | 4 +- .../src/netedit/GNERerouterIntervalDialog.cpp | 24 ++++----- sumo/src/netedit/GNERouteProbe.cpp | 2 +- sumo/src/netedit/GNESelectorFrame.cpp | 8 +-- sumo/src/netedit/GNEStoppingPlace.cpp | 4 +- sumo/src/netedit/GNEVaporizer.cpp | 2 +- sumo/src/netedit/GNEVariableSpeedSign.cpp | 4 +- sumo/src/netedit/GNEViewNet.cpp | 5 -- sumo/src/netedit/GNEViewNet.h | 3 -- 41 files changed, 161 insertions(+), 167 deletions(-) diff --git a/sumo/src/netedit/GNEAdditionalFrame.cpp b/sumo/src/netedit/GNEAdditionalFrame.cpp index db0d88b0cdb..6965f70fc80 100644 --- a/sumo/src/netedit/GNEAdditionalFrame.cpp +++ b/sumo/src/netedit/GNEAdditionalFrame.cpp @@ -1103,7 +1103,7 @@ GNEAdditionalFrame::AdditionalAttributes::showWarningMessage(std::string extra) // set message in status bar myViewNet->setStatusBarText(errorMessage); // Write Warning in console if we're in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING(errorMessage); } } diff --git a/sumo/src/netedit/GNEApplicationWindow.cpp b/sumo/src/netedit/GNEApplicationWindow.cpp index 343ee635e9e..1f7ae67afcb 100644 --- a/sumo/src/netedit/GNEApplicationWindow.cpp +++ b/sumo/src/netedit/GNEApplicationWindow.cpp @@ -797,7 +797,7 @@ GNEApplicationWindow::onCmdClearMsgWindow(FXObject*, FXSelector, void*) { long GNEApplicationWindow::onCmdAbout(FXObject*, FXSelector, void*) { // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening about dialog"); } // create and open about dialog @@ -805,7 +805,7 @@ GNEApplicationWindow::onCmdAbout(FXObject*, FXSelector, void*) { about->create(); about->show(PLACEMENT_OWNER); // write warning if netedit is running in testing mode - if ((myNet != 0) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed about dialog"); } return 1; @@ -1115,7 +1115,7 @@ GNEApplicationWindow::onCmdComputeJunctions(FXObject*, FXSelector, void*) { long GNEApplicationWindow::onCmdComputeJunctionsVolatile(FXObject*, FXSelector, void*) { // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'question'"); } // open question dialog box @@ -1123,9 +1123,9 @@ GNEApplicationWindow::onCmdComputeJunctionsVolatile(FXObject*, FXSelector, void* "Changes produced in the net due a recomputing with volatile options cannot be undone. Continue?)"); if (answer != 1) { //1:yes, 2:no, 4:esc // write warning if netedit is running in testing mode - if ((answer == 2) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if ((answer == 2) && (OptionsCont::getOptions().getBool("gui-testing") == true == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'No'"); - } else if ((answer == 4) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + } else if ((answer == 4) && (OptionsCont::getOptions().getBool("gui-testing") == true == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'ESC'"); } // abort recompute with volatile options @@ -1134,7 +1134,7 @@ GNEApplicationWindow::onCmdComputeJunctionsVolatile(FXObject*, FXSelector, void* myNet->computeEverything(this, true, true); updateControls(); // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'Yes'"); } return 1; @@ -1212,13 +1212,13 @@ GNEApplicationWindow::onCmdSaveAsPlainXML(FXObject*, FXSelector, void*) { myUndoList->mark(); } catch (IOError& e) { // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'error'"); } // open message box FXMessageBox::error(this, MBOX_OK, "Saving plain xml failed!", "%s", e.what()); // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'error' with 'OK'"); } } @@ -1255,13 +1255,13 @@ GNEApplicationWindow::onCmdSaveJoined(FXObject*, FXSelector, void*) { myNet->saveJoined(oc); } catch (IOError& e) { // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'error'"); } // opening error message FXMessageBox::error(this, MBOX_OK, "Saving joined junctions failed!", "%s", e.what()); // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'error' with 'OK'"); } } @@ -1294,13 +1294,13 @@ GNEApplicationWindow::onCmdSavePois(FXObject*, FXSelector, void*) { GNEPOI::saveToFile(filename); } catch (IOError& e) { // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'error'"); } // open error dialog box FXMessageBox::error(this, MBOX_OK, "Saving POIs failed!", "%s", e.what()); // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'error' with 'OK'"); } } @@ -1338,13 +1338,13 @@ GNEApplicationWindow::onCmdSaveNetwork(FXObject*, FXSelector, void*) { myUndoList->mark(); } catch (IOError& e) { // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'error'"); } // open error message box FXMessageBox::error(this, MBOX_OK, "Saving Network failed!", "%s", e.what()); // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'error' with 'OK'"); } } @@ -1378,13 +1378,13 @@ GNEApplicationWindow::onCmdSaveAdditionals(FXObject*, FXSelector, void*) { myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURED, "Additionals saved in " + myAdditionalsFile + ".\n"); } catch (IOError& e) { // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'error'"); } // open error message box FXMessageBox::error(this, MBOX_OK, "Saving additionals failed!", "%s", e.what()); // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'error' with 'OK'"); } } @@ -1440,7 +1440,7 @@ GNEApplicationWindow::continueWithUnsavedChanges() { FXuint answer = 0; if (myUndoList->canUndo() && !myUndoList->marked()) { // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'question'"); } // open question box @@ -1449,7 +1449,7 @@ GNEApplicationWindow::continueWithUnsavedChanges() { "You have unsaved changes in the network. Do you wish to quit and discard all changes?"); if (answer == MBOX_CLICKED_QUIT) { // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'Quit'"); } return continueWithUnsavedAdditionalChanges(); @@ -1462,9 +1462,9 @@ GNEApplicationWindow::continueWithUnsavedChanges() { return continueWithUnsavedAdditionalChanges(); } else { // write warning if netedit is running in testing mode - if ((answer == 2) && ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true))) { + if ((answer == 2) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'No'"); - } else if ((answer == 4) && ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true))) { + } else if ((answer == 4) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'ESC'"); } // return false to stop closing/reloading @@ -1479,7 +1479,7 @@ bool GNEApplicationWindow::continueWithUnsavedAdditionalChanges() { // Check if there are non saved additionals if ((myNet != NULL) && (myNet->getNumberOfAdditionals() > 0) && (myNet->isAdditionalsSaved() == false)) { - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'question'"); } // open question box @@ -1488,13 +1488,13 @@ GNEApplicationWindow::continueWithUnsavedAdditionalChanges() { "You have unsaved additionals. Do you wish to quit and discard all changes?"); // if answer was affirmative, but there was an error during saving additional, return false to stop closing/reloading if (answer == MBOX_CLICKED_QUIT) { - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'Quit'"); } return true; } else if (answer == MBOX_CLICKED_SAVE) { // write warning if netedit is running in testing mode - if ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true)) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'Yes'"); } if (onCmdSaveAdditionals(0, 0, 0) == 0) { @@ -1502,9 +1502,9 @@ GNEApplicationWindow::continueWithUnsavedAdditionalChanges() { } } else { // write warning if netedit is running in testing mode - if ((answer == 2) && ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true))) { + if ((answer == 2) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'No'"); - } else if ((answer == 4) && ((myNet != NULL) && (myNet->getViewNet()->isTestingModeEnabled() == true))) { + } else if ((answer == 4) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'ESC'"); } return false; diff --git a/sumo/src/netedit/GNEBusStop.cpp b/sumo/src/netedit/GNEBusStop.cpp index ec5b44c3779..9cc20b2fe97 100644 --- a/sumo/src/netedit/GNEBusStop.cpp +++ b/sumo/src/netedit/GNEBusStop.cpp @@ -332,7 +332,7 @@ GNEBusStop::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* case SUMO_ATTR_ENDPOS: case SUMO_ATTR_LINES: case GNE_ATTR_BLOCK_MOVEMENT: - undoList->p_add(new GNEChange_Attribute(this, key, value, myViewNet->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); updateGeometry(); break; default: @@ -363,7 +363,7 @@ GNEBusStop::isValid(SumoXMLAttr key, const std::string& value) { // If extension is larger than Lane if (parse(value) > myLane->getLaneParametricLength()) { // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'question'"); } // Ask user if want to assign the length of lane as endPosition @@ -373,15 +373,15 @@ GNEBusStop::isValid(SumoXMLAttr key, const std::string& value) { ". Do you want to assign the length of the " + toString(SUMO_TAG_LANE) + " as " + toString(SUMO_ATTR_ENDPOS) + "?").c_str()); if (answer == 1) { //1:yes, 2:no, 4:esc // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'Yes'"); } return true; } else { // write warning if netedit is running in testing mode - if ((answer == 2) && (myViewNet->isTestingModeEnabled() == true)) { + if ((answer == 2) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'No'"); - } else if ((answer == 4) && (myViewNet->isTestingModeEnabled() == true)) { + } else if ((answer == 4) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'ESC'"); } return false; diff --git a/sumo/src/netedit/GNECalibrator.cpp b/sumo/src/netedit/GNECalibrator.cpp index 2d44ebd2d89..7276f3d61c5 100644 --- a/sumo/src/netedit/GNECalibrator.cpp +++ b/sumo/src/netedit/GNECalibrator.cpp @@ -517,7 +517,7 @@ GNECalibrator::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoLi case SUMO_ATTR_FREQUENCY: case SUMO_ATTR_OUTPUT: case SUMO_ATTR_ROUTEPROBE: - undoList->p_add(new GNEChange_Attribute(this, key, value, myViewNet->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); updateGeometry(); break; default: diff --git a/sumo/src/netedit/GNECalibratorDialog.cpp b/sumo/src/netedit/GNECalibratorDialog.cpp index 515cf5541e5..81db0e3e103 100644 --- a/sumo/src/netedit/GNECalibratorDialog.cpp +++ b/sumo/src/netedit/GNECalibratorDialog.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include "GNECalibratorDialog.h" #include "GNECalibrator.h" @@ -198,7 +199,7 @@ GNECalibratorDialog::onCmdClickedRoute(FXObject*, FXSelector, void*) { // if there are flows that has route to remove as "route" parameter if (calibratorFlowsToErase.size() > 0) { // write warning if netedit is running in testing mode - if (myCalibratorParent->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'question'"); } // open question dialog box @@ -208,16 +209,16 @@ GNECalibratorDialog::onCmdClickedRoute(FXObject*, FXSelector, void*) { ". Continue?").c_str()); if (answer != 1) { //1:yes, 2:no, 4:esc // write warning if netedit is running in testing mode - if ((answer == 2) && (myCalibratorParent->getViewNet()->isTestingModeEnabled() == true)) { + if ((answer == 2) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'No'"); - } else if ((answer == 4) && (myCalibratorParent->getViewNet()->isTestingModeEnabled() == true)) { + } else if ((answer == 4) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'ESC'"); } // abort deletion of route return 0; } else { // write warning if netedit is running in testing mode - if (myCalibratorParent->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'Yes'"); } // remove flows with route to delete @@ -348,16 +349,16 @@ GNECalibratorDialog::onCmdClickedVehicleType(FXObject*, FXSelector, void*) { ". Continue?").c_str()); if (answer != 1) { //1:yes, 2:no, 4:esc // write warning if netedit is running in testing mode - if ((answer == 2) && (myCalibratorParent->getViewNet()->isTestingModeEnabled() == true)) { + if ((answer == 2) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'No'"); - } else if ((answer == 4) && (myCalibratorParent->getViewNet()->isTestingModeEnabled() == true)) { + } else if ((answer == 4) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'ESC'"); } // abort deletion of vehicle type return 0; } else { // write warning if netedit is running in testing mode - if (myCalibratorParent->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'Yes'"); } // remove flows with vehicle type to delete diff --git a/sumo/src/netedit/GNECalibratorFlowDialog.cpp b/sumo/src/netedit/GNECalibratorFlowDialog.cpp index 2763d106b8a..339c8fafec7 100644 --- a/sumo/src/netedit/GNECalibratorFlowDialog.cpp +++ b/sumo/src/netedit/GNECalibratorFlowDialog.cpp @@ -179,7 +179,7 @@ long GNECalibratorFlowDialog::onCmdAccept(FXObject*, FXSelector, void*) { if (myCalibratorFlowValid == false) { // write warning if netedit is running in testing mode - if (myCalibratorDialogParent->getCalibratorParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'warning'"); } // open warning dialog box @@ -190,7 +190,7 @@ GNECalibratorFlowDialog::onCmdAccept(FXObject*, FXSelector, void*) { " cannot be " + std::string((myUpdatingElement == true) ? ("updated") : ("created")) + " because parameter " + toString(myInvalidAttr) + " is invalid.").c_str()); // write warning if netedit is running in testing mode - if (myCalibratorDialogParent->getCalibratorParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'"); } return 0; diff --git a/sumo/src/netedit/GNECalibratorRouteDialog.cpp b/sumo/src/netedit/GNECalibratorRouteDialog.cpp index 4d35da1758f..4797cbdeb75 100644 --- a/sumo/src/netedit/GNECalibratorRouteDialog.cpp +++ b/sumo/src/netedit/GNECalibratorRouteDialog.cpp @@ -122,7 +122,7 @@ long GNECalibratorRouteDialog::onCmdAccept(FXObject*, FXSelector, void*) { if (myCalibratorRouteValid == false) { // write warning if netedit is running in testing mode - if (myCalibratorDialogParent->getCalibratorParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'warning'"); } FXMessageBox::warning(getApp(), MBOX_OK, @@ -132,7 +132,7 @@ GNECalibratorRouteDialog::onCmdAccept(FXObject*, FXSelector, void*) { " cannot be " + std::string((myUpdatingElement == true) ? ("updated") : ("created")) + " because parameter " + toString(myInvalidAttr) + " is invalid.").c_str()); // write warning if netedit is running in testing mode - if (myCalibratorDialogParent->getCalibratorParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'"); } return 0; diff --git a/sumo/src/netedit/GNECalibratorVehicleTypeDialog.cpp b/sumo/src/netedit/GNECalibratorVehicleTypeDialog.cpp index de075f85125..e7c431ba4d0 100644 --- a/sumo/src/netedit/GNECalibratorVehicleTypeDialog.cpp +++ b/sumo/src/netedit/GNECalibratorVehicleTypeDialog.cpp @@ -223,7 +223,7 @@ long GNECalibratorVehicleTypeDialog::onCmdAccept(FXObject*, FXSelector, void*) { if (myCalibratorVehicleTypeValid == false) { // write warning if netedit is running in testing mode - if (myCalibratorDialogParent->getCalibratorParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'warning'"); } // open warning dialogBox @@ -234,7 +234,7 @@ GNECalibratorVehicleTypeDialog::onCmdAccept(FXObject*, FXSelector, void*) { " cannot be " + std::string((myUpdatingElement == true) ? ("updated") : ("created")) + " because parameter " + toString(myInvalidAttr) + " is invalid.").c_str()); // write warning if netedit is running in testing mode - if (myCalibratorDialogParent->getCalibratorParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'"); } return 0; diff --git a/sumo/src/netedit/GNEChange_Additional.cpp b/sumo/src/netedit/GNEChange_Additional.cpp index 9ddb4533eb4..43806063dc1 100644 --- a/sumo/src/netedit/GNEChange_Additional.cpp +++ b/sumo/src/netedit/GNEChange_Additional.cpp @@ -89,7 +89,7 @@ GNEChange_Additional::~GNEChange_Additional() { myAdditional->decRef("GNEChange_Additional"); if (myAdditional->unreferenced()) { // show extra information for tests - if (myNet->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting unreferenced " + toString(myAdditional->getTag()) + " '" + myAdditional->getID() + "'"); } delete myAdditional; @@ -101,7 +101,7 @@ void GNEChange_Additional::undo() { if (myForward) { // show extra information for tests - if (myNet->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting " + toString(myAdditional->getTag()) + " '" + myAdditional->getID() + "'"); } // delete additional of test @@ -152,7 +152,7 @@ GNEChange_Additional::undo() { } } else { // show extra information for tests - if (myNet->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Inserting " + toString(myAdditional->getTag()) + " '" + myAdditional->getID() + "'"); } // insert additional of test @@ -209,7 +209,7 @@ void GNEChange_Additional::redo() { if (myForward) { // show extra information for tests - if (myNet->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Inserting " + toString(myAdditional->getTag()) + " '" + myAdditional->getID() + "'"); } // insert additional into net @@ -260,7 +260,7 @@ GNEChange_Additional::redo() { } } else { // show extra information for tests - if (myNet->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting " + toString(myAdditional->getTag()) + " '" + myAdditional->getID() + "'"); } myNet->deleteAdditional(myAdditional); diff --git a/sumo/src/netedit/GNEChange_Attribute.cpp b/sumo/src/netedit/GNEChange_Attribute.cpp index 02326a6b076..ee1689df93a 100644 --- a/sumo/src/netedit/GNEChange_Attribute.cpp +++ b/sumo/src/netedit/GNEChange_Attribute.cpp @@ -29,6 +29,8 @@ #include #include +#include + #include "GNEChange_Attribute.h" #include "GNEAttributeCarrier.h" @@ -43,12 +45,11 @@ FXIMPLEMENT_ABSTRACT(GNEChange_Attribute, GNEChange, NULL, 0) // =========================================================================== GNEChange_Attribute::GNEChange_Attribute(GNEAttributeCarrier* ac, - SumoXMLAttr key, const std::string& value, bool testingMode, + SumoXMLAttr key, const std::string& value, bool customOrigValue, const std::string& origValue) : GNEChange(0, true), myAC(ac), myKey(key), - myTestingMode(testingMode), myOrigValue(customOrigValue ? origValue : ac->getAttribute(key)), myNewValue(value) { myAC->incRef("GNEChange_Attribute " + toString(myKey)); @@ -59,6 +60,10 @@ GNEChange_Attribute::~GNEChange_Attribute() { assert(myAC); myAC->decRef("GNEChange_Attribute " + toString(myKey)); if (myAC->unreferenced()) { + // show extra information for tests + if (OptionsCont::getOptions().getBool("gui-testing") == true) { + WRITE_WARNING("Deleting unreferenced " + toString(myAC->getTag()) + " '" + myAC->getID() + "' into GNEChange_Attribute"); + } delete myAC; } } @@ -67,7 +72,7 @@ GNEChange_Attribute::~GNEChange_Attribute() { void GNEChange_Attribute::undo() { // show extra information for tests - if (myTestingMode == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Setting previous attribute " + toString(myKey) + " '" + myOrigValue + "' into " + toString(myAC->getTag()) + " '" + myAC->getID() + "'"); } // set original value @@ -78,7 +83,7 @@ GNEChange_Attribute::undo() { void GNEChange_Attribute::redo() { // show extra information for tests - if (myTestingMode == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Setting new attribute " + toString(myKey) + " '" + myNewValue + "' into " + toString(myAC->getTag()) + " '" + myAC->getID() + "'"); } // set new value diff --git a/sumo/src/netedit/GNEChange_Attribute.h b/sumo/src/netedit/GNEChange_Attribute.h index d97bb7427c0..c7f4e2ad107 100644 --- a/sumo/src/netedit/GNEChange_Attribute.h +++ b/sumo/src/netedit/GNEChange_Attribute.h @@ -60,7 +60,6 @@ class GNEChange_Attribute : public GNEChange { GNEChange_Attribute(GNEAttributeCarrier* ac, const SumoXMLAttr key, const std::string& value, - bool testingMode, bool customOrigValue = false, const std::string& origValue = ""); @@ -100,9 +99,6 @@ class GNEChange_Attribute : public GNEChange { /// @brief the original value std::string myNewValue; - - /// @brief flag for testing mode - bool myTestingMode; }; #endif diff --git a/sumo/src/netedit/GNEChange_Connection.cpp b/sumo/src/netedit/GNEChange_Connection.cpp index 47550c163e9..a1a0a825f3a 100644 --- a/sumo/src/netedit/GNEChange_Connection.cpp +++ b/sumo/src/netedit/GNEChange_Connection.cpp @@ -65,7 +65,7 @@ void GNEChange_Connection::undo() { if (myForward) { // show extra information for tests - if (myEdge->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting " + toString(SUMO_TAG_CONNECTION) + " '" + myEdge->getNBEdge()->getLaneID(myNBEdgeConnection.fromLane) + "->" + myNBEdgeConnection.toEdge->getLaneID(myNBEdgeConnection.toLane) + "' from " + toString(SUMO_TAG_EDGE) + " '" + myEdge->getID() + "'"); @@ -74,7 +74,7 @@ GNEChange_Connection::undo() { myEdge->removeConnection(myNBEdgeConnection); } else { // show extra information for tests - if (myEdge->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { std::string selected = (mySelected == true)? ("a previously selected ") : (""); WRITE_WARNING("Adding " + selected + toString(SUMO_TAG_CONNECTION) + " '" + myEdge->getNBEdge()->getLaneID(myNBEdgeConnection.fromLane) + "->" + myNBEdgeConnection.toEdge->getLaneID(myNBEdgeConnection.toLane) + "' from " + @@ -90,7 +90,7 @@ void GNEChange_Connection::redo() { if (myForward) { // show extra information for tests - if (myEdge->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { std::string selected = (mySelected == true)? ("a previously selected ") : (""); WRITE_WARNING("Adding " + selected + toString(SUMO_TAG_CONNECTION) + " '" + myEdge->getNBEdge()->getLaneID(myNBEdgeConnection.fromLane) + "->" + myNBEdgeConnection.toEdge->getLaneID(myNBEdgeConnection.toLane) + "' from " + @@ -100,7 +100,7 @@ GNEChange_Connection::redo() { myEdge->addConnection(myNBEdgeConnection, mySelected); } else { // show extra information for tests - if (myEdge->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting " + toString(SUMO_TAG_CONNECTION) + " '" + myEdge->getNBEdge()->getLaneID(myNBEdgeConnection.fromLane) + "->" + myNBEdgeConnection.toEdge->getLaneID(myNBEdgeConnection.toLane) + "' from " + toString(SUMO_TAG_EDGE) + " '" + myEdge->getID() + "'"); diff --git a/sumo/src/netedit/GNEChange_Crossing.cpp b/sumo/src/netedit/GNEChange_Crossing.cpp index 53a1f110408..9204eec9d94 100644 --- a/sumo/src/netedit/GNEChange_Crossing.cpp +++ b/sumo/src/netedit/GNEChange_Crossing.cpp @@ -67,7 +67,7 @@ GNEChange_Crossing::~GNEChange_Crossing() { void GNEChange_Crossing::undo() { if (myForward) { // show extra information for tests - if (myJunctionParent->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting " + toString(SUMO_TAG_CROSSING) + " from " + toString(myJunctionParent->getTag()) + " '" + myJunctionParent->getID() + "'"); } // remove crossing of NBNode @@ -76,7 +76,7 @@ void GNEChange_Crossing::undo() { myNet->getViewNet()->update(); } else { // show extra information for tests - if (myJunctionParent->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { std::string selected = (mySelected == true)? ("a previously selected ") : (""); WRITE_WARNING("Adding " + selected + toString(SUMO_TAG_CROSSING) + " into " + toString(myJunctionParent->getTag()) + " '" + myJunctionParent->getID() + "'"); } @@ -101,7 +101,7 @@ void GNEChange_Crossing::undo() { void GNEChange_Crossing::redo() { if (myForward) { // show extra information for tests - if (myJunctionParent->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { std::string selected = (mySelected == true)? ("a previously selected ") : (""); WRITE_WARNING("Adding " + selected + toString(SUMO_TAG_CROSSING) + " into " + toString(myJunctionParent->getTag()) + " '" + myJunctionParent->getID() + "'"); } @@ -122,7 +122,7 @@ void GNEChange_Crossing::redo() { myNet->getViewNet()->update(); } else { // show extra information for tests - if (myJunctionParent->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting " + toString(SUMO_TAG_CROSSING) + " from " + toString(myJunctionParent->getTag()) + " '" + myJunctionParent->getID() + "'"); } // remove crossing of NBNode and update geometry diff --git a/sumo/src/netedit/GNEChange_Edge.cpp b/sumo/src/netedit/GNEChange_Edge.cpp index 6e6fc3e760e..63517e2171a 100644 --- a/sumo/src/netedit/GNEChange_Edge.cpp +++ b/sumo/src/netedit/GNEChange_Edge.cpp @@ -65,8 +65,8 @@ GNEChange_Edge::~GNEChange_Edge() { myEdge->decRef("GNEChange_Edge"); if (myEdge->unreferenced()) { // show extra information for tests - if (myEdge->getNet()->getViewNet()->isTestingModeEnabled()) { - WRITE_WARNING("Deleting unreferenced " + toString(myEdge->getTag()) + " '" + myEdge->getID() + "'"); + if (OptionsCont::getOptions().getBool("gui-testing") == true) { + WRITE_WARNING("Deleting unreferenced " + toString(myEdge->getTag()) + " '" + myEdge->getID() + "' GNEChange_Edge"); } delete myEdge; } @@ -77,7 +77,7 @@ void GNEChange_Edge::undo() { if (myForward) { // show extra information for tests - if (myEdge->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting " + toString(myEdge->getTag()) + " '" + myEdge->getID() + "'"); } // delete edge from net @@ -92,7 +92,7 @@ GNEChange_Edge::undo() { } } else { // show extra information for tests - if (myEdge->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Adding " + toString(myEdge->getTag()) + " '" + myEdge->getID() + "'"); } // insert edge into net @@ -113,7 +113,7 @@ void GNEChange_Edge::redo() { if (myForward) { // show extra information for tests - if (myEdge->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Adding " + toString(myEdge->getTag()) + " '" + myEdge->getID() + "'"); } // insert edge into net @@ -128,7 +128,7 @@ GNEChange_Edge::redo() { } } else { // show extra information for tests - if (myEdge->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting " + toString(myEdge->getTag()) + " '" + myEdge->getID() + "'"); } // delte edge from net diff --git a/sumo/src/netedit/GNEChange_Junction.cpp b/sumo/src/netedit/GNEChange_Junction.cpp index 1808bdbd6c9..a25a64415db 100644 --- a/sumo/src/netedit/GNEChange_Junction.cpp +++ b/sumo/src/netedit/GNEChange_Junction.cpp @@ -59,8 +59,8 @@ GNEChange_Junction::~GNEChange_Junction() { myJunction->decRef("GNEChange_Junction"); if (myJunction->unreferenced()) { // show extra information for tests - if (myJunction->getNet()->getViewNet()->isTestingModeEnabled()) { - WRITE_WARNING("Deleting unreferenced " + toString(myJunction->getTag()) + " '" + myJunction->getID() + "'"); + if (OptionsCont::getOptions().getBool("gui-testing") == true) { + WRITE_WARNING("Deleting unreferenced " + toString(myJunction->getTag()) + " '" + myJunction->getID() + "' in GNEChange_Junction"); } delete myJunction; } @@ -71,14 +71,14 @@ void GNEChange_Junction::undo() { if (myForward) { // show extra information for tests - if (myJunction->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting " + toString(myJunction->getTag()) + " '" + myJunction->getID() + "'"); } // add junction to net myNet->deleteSingleJunction(myJunction); } else { // show extra information for tests - if (myJunction->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Adding " + toString(myJunction->getTag()) + " '" + myJunction->getID() + "'"); } // delete junction from net @@ -91,14 +91,14 @@ void GNEChange_Junction::redo() { if (myForward) { // show extra information for tests - if (myJunction->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Adding " + toString(myJunction->getTag()) + " '" + myJunction->getID() + "'"); } // add junction into net myNet->insertJunction(myJunction); } else { // show extra information for tests - if (myJunction->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting " + toString(myJunction->getTag()) + " '" + myJunction->getID() + "'"); } // delete junction from net diff --git a/sumo/src/netedit/GNEChange_Lane.cpp b/sumo/src/netedit/GNEChange_Lane.cpp index 83f2d4521e8..7d53a1c8f56 100644 --- a/sumo/src/netedit/GNEChange_Lane.cpp +++ b/sumo/src/netedit/GNEChange_Lane.cpp @@ -70,8 +70,8 @@ GNEChange_Lane::~GNEChange_Lane() { myEdge->decRef("GNEChange_Lane"); if (myEdge->unreferenced()) { // show extra information for tests - if (myNet->getViewNet()->isTestingModeEnabled()) { - WRITE_WARNING("Deleting unreferenced " + toString(myEdge->getTag()) + " '" + myEdge->getID() + "'"); + if (OptionsCont::getOptions().getBool("gui-testing") == true) { + WRITE_WARNING("Deleting unreferenced " + toString(myEdge->getTag()) + " '" + myEdge->getID() + "' in GNEChange_Lane"); } delete myEdge; } @@ -79,8 +79,8 @@ GNEChange_Lane::~GNEChange_Lane() { myLane->decRef("GNEChange_Lane"); if (myLane->unreferenced()) { // show extra information for tests - if (myNet->getViewNet()->isTestingModeEnabled()) { - WRITE_WARNING("Deleting unreferenced " + toString(myLane->getTag()) + " '" + myLane->getID() + "'"); + if (OptionsCont::getOptions().getBool("gui-testing") == true) { + WRITE_WARNING("Deleting unreferenced " + toString(myLane->getTag()) + " '" + myLane->getID() + "' in GNEChange_Lane"); } delete myLane; } @@ -92,7 +92,7 @@ void GNEChange_Lane::undo() { if (myForward) { // show extra information for tests - if (myEdge->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { if (myLane != NULL) { WRITE_WARNING("Deleting " + toString(myLane->getTag()) + " '" + myLane->getID() + "'"); } else { @@ -107,7 +107,7 @@ GNEChange_Lane::undo() { } } else { // show extra information for tests - if (myEdge->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { if (myLane != NULL) { WRITE_WARNING("Adding " + toString(myLane->getTag()) + " '" + myLane->getID() + "'"); } else { @@ -128,7 +128,7 @@ void GNEChange_Lane::redo() { if (myForward) { // show extra information for tests - if (myEdge->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { if (myLane != NULL) { WRITE_WARNING("Adding " + toString(myLane->getTag()) + " '" + myLane->getID() + "'"); } else { @@ -143,7 +143,7 @@ GNEChange_Lane::redo() { } } else { // show extra information for tests - if (myEdge->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { if (myLane != NULL) { WRITE_WARNING("Deleting " + toString(myLane->getTag()) + " '" + myLane->getID() + "'"); } else { diff --git a/sumo/src/netedit/GNEChange_TLS.cpp b/sumo/src/netedit/GNEChange_TLS.cpp index 077cb1a900e..63204e47c37 100644 --- a/sumo/src/netedit/GNEChange_TLS.cpp +++ b/sumo/src/netedit/GNEChange_TLS.cpp @@ -71,8 +71,8 @@ GNEChange_TLS::~GNEChange_TLS() { myJunction->decRef("GNEChange_TLS"); if (myJunction->unreferenced()) { // show extra information for tests - if (myNet->getViewNet()->isTestingModeEnabled()) { - WRITE_WARNING("Deleting unreferenced " + toString(myJunction->getTag()) + " '" + myJunction->getID() + "'"); + if (OptionsCont::getOptions().getBool("gui-testing") == true) { + WRITE_WARNING("Deleting unreferenced " + toString(myJunction->getTag()) + " '" + myJunction->getID() + "' in GNEChange_TLS"); } delete myJunction; } @@ -83,14 +83,14 @@ void GNEChange_TLS::undo() { if (myForward) { // show extra information for tests - if (myJunction->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting " + toString(myJunction->getTag()) + " '" + myJunction->getID() + "'"); } // remove traffic light from junction myJunction->removeTrafficLight(myTlDef); } else { // show extra information for tests - if (myJunction->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Adding " + toString(myJunction->getTag()) + " '" + myJunction->getID() + "'"); } // add traffic light to junction @@ -103,14 +103,14 @@ void GNEChange_TLS::redo() { if (myForward) { // show extra information for tests - if (myJunction->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Adding " + toString(myJunction->getTag()) + " '" + myJunction->getID() + "'"); } // add traffic light to junction myJunction->addTrafficLight(myTlDef, myForceInsert); } else { // show extra information for tests - if (myJunction->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting " + toString(myJunction->getTag()) + " '" + myJunction->getID() + "'"); } // remove traffic light from junction diff --git a/sumo/src/netedit/GNEChargingStation.cpp b/sumo/src/netedit/GNEChargingStation.cpp index 07d3cbdbd1f..8476b62b3a5 100644 --- a/sumo/src/netedit/GNEChargingStation.cpp +++ b/sumo/src/netedit/GNEChargingStation.cpp @@ -398,7 +398,7 @@ GNEChargingStation::setAttribute(SumoXMLAttr key, const std::string& value, GNEU case SUMO_ATTR_CHARGEINTRANSIT: case SUMO_ATTR_CHARGEDELAY: case GNE_ATTR_BLOCK_MOVEMENT: - undoList->p_add(new GNEChange_Attribute(this, key, value, myViewNet->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); break; default: throw InvalidArgument(toString(getTag()) + " doesn't have an attribute of type '" + toString(key) + "'"); @@ -428,7 +428,7 @@ GNEChargingStation::isValid(SumoXMLAttr key, const std::string& value) { // If extension is larger than Lane if (parse(value) > myLane->getLaneParametricLength()) { // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'question'"); } // Ask user if want to assign the length of lane as endPosition @@ -438,15 +438,15 @@ GNEChargingStation::isValid(SumoXMLAttr key, const std::string& value) { ". Do you want to assign the length of the " + toString(SUMO_TAG_LANE) + " as " + toString(SUMO_ATTR_ENDPOS) + "?").c_str()); if (answer == 1) { //1:yes, 2:no, 4:esc // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'Yes'"); } return true; } else { // write warning if netedit is running in testing mode - if ((answer == 2) && (myViewNet->isTestingModeEnabled() == true)) { + if ((answer == 2) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'No'"); - } else if ((answer == 4) && (myViewNet->isTestingModeEnabled() == true)) { + } else if ((answer == 4) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'ESC'"); } return false; diff --git a/sumo/src/netedit/GNEConnection.cpp b/sumo/src/netedit/GNEConnection.cpp index 34d08388238..8224bb8f217 100644 --- a/sumo/src/netedit/GNEConnection.cpp +++ b/sumo/src/netedit/GNEConnection.cpp @@ -331,7 +331,7 @@ GNEConnection::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoLi case SUMO_ATTR_UNCONTROLLED: case SUMO_ATTR_VISIBILITY_DISTANCE: // no special handling - undoList->p_add(new GNEChange_Attribute(this, key, value, myNet->getViewNet()->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); break; default: throw InvalidArgument(toString(getTag()) + " doesn't have an attribute of type '" + toString(key) + "'"); diff --git a/sumo/src/netedit/GNEContainerStop.cpp b/sumo/src/netedit/GNEContainerStop.cpp index f8e07977535..15b3694474d 100644 --- a/sumo/src/netedit/GNEContainerStop.cpp +++ b/sumo/src/netedit/GNEContainerStop.cpp @@ -332,7 +332,7 @@ GNEContainerStop::setAttribute(SumoXMLAttr key, const std::string& value, GNEUnd case SUMO_ATTR_ENDPOS: case SUMO_ATTR_LINES: case GNE_ATTR_BLOCK_MOVEMENT: - undoList->p_add(new GNEChange_Attribute(this, key, value, myViewNet->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); updateGeometry(); break; default: @@ -363,7 +363,7 @@ GNEContainerStop::isValid(SumoXMLAttr key, const std::string& value) { // If extension is larger than Lane if (parse(value) > myLane->getLaneParametricLength()) { // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'question'"); } // Ask user if want to assign the length of lane as endPosition @@ -373,15 +373,15 @@ GNEContainerStop::isValid(SumoXMLAttr key, const std::string& value) { ". Do you want to assign the length of the " + toString(SUMO_TAG_LANE) + " as " + toString(SUMO_ATTR_ENDPOS) + "?").c_str()); if (answer == 1) { //1:yes, 2:no, 4:esc // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'Yes'"); } return true; } else { // write warning if netedit is running in testing mode - if ((answer == 2) && (myViewNet->isTestingModeEnabled() == true)) { + if ((answer == 2) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'No'"); - } else if ((answer == 4) && (myViewNet->isTestingModeEnabled() == true)) { + } else if ((answer == 4) && (OptionsCont::getOptions().getBool("gui-testing") == true)) { WRITE_WARNING("Closed FXMessageBox of type 'question' with 'ESC'"); } return false; diff --git a/sumo/src/netedit/GNECrossing.cpp b/sumo/src/netedit/GNECrossing.cpp index db81c6202d5..b3f29f0f91e 100644 --- a/sumo/src/netedit/GNECrossing.cpp +++ b/sumo/src/netedit/GNECrossing.cpp @@ -220,7 +220,7 @@ GNECrossing::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList case SUMO_ATTR_EDGES: case SUMO_ATTR_WIDTH: case SUMO_ATTR_PRIORITY: - undoList->add(new GNEChange_Attribute(this, key, value, myNet->getViewNet()->isTestingModeEnabled()), true); + undoList->add(new GNEChange_Attribute(this, key, value), true); break; default: throw InvalidArgument(toString(getTag()) + " doesn't have an attribute of type '" + toString(key) + "'"); diff --git a/sumo/src/netedit/GNEDeleteFrame.cpp b/sumo/src/netedit/GNEDeleteFrame.cpp index b5d99778e1d..94b0ce90e9b 100644 --- a/sumo/src/netedit/GNEDeleteFrame.cpp +++ b/sumo/src/netedit/GNEDeleteFrame.cpp @@ -366,7 +366,7 @@ GNEDeleteFrame::removeAttributeCarrier(GNEAttributeCarrier* ac) { } else { if (numberOfAdditionals > 0) { // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'warning'"); } std::string plural = numberOfAdditionals > 1 ? "s" : ""; @@ -375,12 +375,12 @@ GNEDeleteFrame::removeAttributeCarrier(GNEAttributeCarrier* ac) { (toString(edge->getTag()) + " '" + edge->getID() + "' cannot be deleted because owns " + toString(numberOfAdditionals) + " additional child" + plural + ".\n Check 'Force deletion of additionals' to force deletion.").c_str()); // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'"); } } else if (numberOfRerouters > 0) { // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'warning'"); } std::string plural = numberOfRerouters > 1 ? "s" : ""; @@ -389,7 +389,7 @@ GNEDeleteFrame::removeAttributeCarrier(GNEAttributeCarrier* ac) { (toString(edge->getTag()) + " '" + edge->getID() + "' cannot be deleted because is part of " + toString(numberOfRerouters) + " " + toString(SUMO_TAG_REROUTER) + plural + ".\n Check 'Force deletion of additionals' to force deletion.").c_str()); // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'"); } } else { @@ -408,7 +408,7 @@ GNEDeleteFrame::removeAttributeCarrier(GNEAttributeCarrier* ac) { myViewNet->getNet()->deleteLane(lane, myViewNet->getUndoList()); } else { // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'warning'"); } // open warning box @@ -416,7 +416,7 @@ GNEDeleteFrame::removeAttributeCarrier(GNEAttributeCarrier* ac) { (toString(lane->getTag()) + " '" + lane->getID() + "' cannot be deleted because it has " + toString(lane->getAdditionalChilds().size()) + " additional childs.\n Check 'Force deletion of Additionals' to force deletion.").c_str()); // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'"); } } diff --git a/sumo/src/netedit/GNEDetector.cpp b/sumo/src/netedit/GNEDetector.cpp index 15f33a1d06d..bdb505ff79d 100644 --- a/sumo/src/netedit/GNEDetector.cpp +++ b/sumo/src/netedit/GNEDetector.cpp @@ -96,7 +96,7 @@ GNEDetector::moveAdditionalGeometry(double offsetx, double offsety) { void GNEDetector::commmitAdditionalGeometryMoved(double oldPosx, double, GNEUndoList* undoList) { undoList->p_begin("position of " + toString(getTag())); - undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPosition.x()), myViewNet->isTestingModeEnabled(), true, toString(oldPosx))); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPosition.x()), true, toString(oldPosx))); undoList->p_end(); // Refresh element myViewNet->getNet()->refreshAdditional(this); diff --git a/sumo/src/netedit/GNEDetectorE1.cpp b/sumo/src/netedit/GNEDetectorE1.cpp index 1c03985f417..49b602eada2 100644 --- a/sumo/src/netedit/GNEDetectorE1.cpp +++ b/sumo/src/netedit/GNEDetectorE1.cpp @@ -242,7 +242,7 @@ GNEDetectorE1::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoLi case SUMO_ATTR_FILE: case SUMO_ATTR_SPLIT_VTYPE: case GNE_ATTR_BLOCK_MOVEMENT: - undoList->p_add(new GNEChange_Attribute(this, key, value, myViewNet->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); updateGeometry(); break; default: diff --git a/sumo/src/netedit/GNEDetectorE2.cpp b/sumo/src/netedit/GNEDetectorE2.cpp index e5127c451b4..03644c68aec 100644 --- a/sumo/src/netedit/GNEDetectorE2.cpp +++ b/sumo/src/netedit/GNEDetectorE2.cpp @@ -257,7 +257,7 @@ GNEDetectorE2::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoLi case SUMO_ATTR_HALTING_SPEED_THRESHOLD: case SUMO_ATTR_JAM_DIST_THRESHOLD: case GNE_ATTR_BLOCK_MOVEMENT: - undoList->p_add(new GNEChange_Attribute(this, key, value, myViewNet->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); updateGeometry(); break; default: diff --git a/sumo/src/netedit/GNEDetectorE3.cpp b/sumo/src/netedit/GNEDetectorE3.cpp index 03ab102a758..674a73c003b 100644 --- a/sumo/src/netedit/GNEDetectorE3.cpp +++ b/sumo/src/netedit/GNEDetectorE3.cpp @@ -138,8 +138,8 @@ GNEDetectorE3::moveAdditionalGeometry(double offsetx, double offsety) { void GNEDetectorE3::commmitAdditionalGeometryMoved(double oldPosx, double oldPosy, GNEUndoList* undoList) { undoList->p_begin("position of " + toString(getTag())); - undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_X, toString(myPosition.x()), myViewNet->isTestingModeEnabled(), true, toString(oldPosx))); - undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_Y, toString(myPosition.y()), myViewNet->isTestingModeEnabled(), true, toString(oldPosy))); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_X, toString(myPosition.x()), true, toString(oldPosx))); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_Y, toString(myPosition.y()), true, toString(oldPosy))); undoList->p_end(); // Refresh element myViewNet->getNet()->refreshAdditional(this); @@ -349,7 +349,7 @@ GNEDetectorE3::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoLi case SUMO_ATTR_HALTING_TIME_THRESHOLD: case SUMO_ATTR_HALTING_SPEED_THRESHOLD: case GNE_ATTR_BLOCK_MOVEMENT: - undoList->p_add(new GNEChange_Attribute(this, key, value, myViewNet->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); updateGeometry(); break; default: diff --git a/sumo/src/netedit/GNEDetectorEntry.cpp b/sumo/src/netedit/GNEDetectorEntry.cpp index 9f67a5a742c..642e524e173 100644 --- a/sumo/src/netedit/GNEDetectorEntry.cpp +++ b/sumo/src/netedit/GNEDetectorEntry.cpp @@ -221,7 +221,7 @@ GNEDetectorEntry::setAttribute(SumoXMLAttr key, const std::string& value, GNEUnd case SUMO_ATTR_LANE: case SUMO_ATTR_POSITION: case GNE_ATTR_BLOCK_MOVEMENT: - undoList->p_add(new GNEChange_Attribute(this, key, value, myViewNet->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); updateGeometry(); break; default: diff --git a/sumo/src/netedit/GNEDetectorExit.cpp b/sumo/src/netedit/GNEDetectorExit.cpp index cb7afe19c2f..5d805a0a6ba 100644 --- a/sumo/src/netedit/GNEDetectorExit.cpp +++ b/sumo/src/netedit/GNEDetectorExit.cpp @@ -222,7 +222,7 @@ GNEDetectorExit::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndo case SUMO_ATTR_LANE: case SUMO_ATTR_POSITION: case GNE_ATTR_BLOCK_MOVEMENT: - undoList->p_add(new GNEChange_Attribute(this, key, value, myViewNet->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); updateGeometry(); break; default: diff --git a/sumo/src/netedit/GNEEdge.cpp b/sumo/src/netedit/GNEEdge.cpp index 34d90d2e36e..86ab72fb4ba 100644 --- a/sumo/src/netedit/GNEEdge.cpp +++ b/sumo/src/netedit/GNEEdge.cpp @@ -98,7 +98,7 @@ GNEEdge::~GNEEdge() { (*i)->decRef("GNEEdge::~GNEEdge"); if ((*i)->unreferenced()) { // show extra information for tests - if ((*i)->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting unreferenced " + toString((*i)->getTag()) + " '" + (*i)->getID() + "' in GNEEdge destructor"); } delete *i; @@ -109,7 +109,7 @@ GNEEdge::~GNEEdge() { (*i)->decRef("GNEEdge::~GNEEdge"); if ((*i)->unreferenced()) { // show extra information for tests - if ((*i)->getNet()->getViewNet()->isTestingModeEnabled()) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Deleting unreferenced " + toString((*i)->getTag()) + " '" + (*i)->getID() + "' in GNEEdge destructor"); } delete(*i); @@ -653,13 +653,13 @@ GNEEdge::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* un (*it)->setAttribute(key, value, undoList); } // ensure that the edge value is also changed. Actually this sets the lane attributes again but it does not matter - undoList->p_add(new GNEChange_Attribute(this, key, value, myNet->getViewNet()->isTestingModeEnabled(), true, origValue)); + undoList->p_add(new GNEChange_Attribute(this, key, value, true, origValue)); undoList->p_end(); break; } case SUMO_ATTR_FROM: { undoList->p_begin("change " + toString(getTag()) + " attribute"); - undoList->p_add(new GNEChange_Attribute(this, key, value, myNet->getViewNet()->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); myGNEJunctionSource->setLogicValid(false, undoList); myNet->retrieveJunction(value)->setLogicValid(false, undoList); setAttribute(GNE_ATTR_SHAPE_START, toString(myGNEJunctionSource->getNBNode()->getPosition()), undoList); @@ -669,7 +669,7 @@ GNEEdge::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* un } case SUMO_ATTR_TO: { undoList->p_begin("change " + toString(getTag()) + " attribute"); - undoList->p_add(new GNEChange_Attribute(this, key, value, myNet->getViewNet()->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); myGNEJunctionDestiny->setLogicValid(false, undoList); myNet->retrieveJunction(value)->setLogicValid(false, undoList); setAttribute(GNE_ATTR_SHAPE_END, toString(myGNEJunctionDestiny->getNBNode()->getPosition()), undoList); @@ -685,13 +685,13 @@ GNEEdge::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* un case GNE_ATTR_MODIFICATION_STATUS: case GNE_ATTR_SHAPE_START: case GNE_ATTR_SHAPE_END: - undoList->p_add(new GNEChange_Attribute(this, key, value, myNet->getViewNet()->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); break; case SUMO_ATTR_NAME: // user cares about street names. Make sure they appear in the output OptionsCont::getOptions().resetWritable(); OptionsCont::getOptions().set("output.street-names", "true"); - undoList->p_add(new GNEChange_Attribute(this, key, value, myNet->getViewNet()->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); break; case SUMO_ATTR_NUMLANES: if (value != getAttribute(key)) { @@ -704,7 +704,7 @@ GNEEdge::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* un // during mouse movement). We set the restore point to the end // of the last change-set myNBEdge.setGeometry(myOrigShape, true); - undoList->p_add(new GNEChange_Attribute(this, key, value, myNet->getViewNet()->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); break; default: throw InvalidArgument(toString(getTag()) + " doesn't have an attribute of type '" + toString(key) + "'"); diff --git a/sumo/src/netedit/GNEInspectorFrame.cpp b/sumo/src/netedit/GNEInspectorFrame.cpp index f7764fc7ede..815d4be24d3 100644 --- a/sumo/src/netedit/GNEInspectorFrame.cpp +++ b/sumo/src/netedit/GNEInspectorFrame.cpp @@ -968,7 +968,7 @@ GNEInspectorFrame::AttributeInput::onCmdSetAttribute(FXObject*, FXSelector, void } // Write Warning in console if we're in testing mode - if (myInspectorFrameParent->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Value '" + newVal + "' for attribute " + toString(myAttr) + " of " + toString(myTag) + " isn't valid"); } } diff --git a/sumo/src/netedit/GNEJunction.cpp b/sumo/src/netedit/GNEJunction.cpp index cb3c3ff8183..46af574dd45 100644 --- a/sumo/src/netedit/GNEJunction.cpp +++ b/sumo/src/netedit/GNEJunction.cpp @@ -418,7 +418,7 @@ GNEJunction::registerMove(GNEUndoList* undoList) { // set the restore point to the end of the last change-set setPosition(myOrigPos); // do not execute the command to avoid changing the edge geometry twice - undoList->add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, newPosValue, myNet->getViewNet()->isTestingModeEnabled()), false); + undoList->add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, newPosValue), false); setPosition(newPos); // Refresh element to avoid grabbing problems myNet->refreshElement(this); @@ -500,9 +500,9 @@ GNEJunction::setLogicValid(bool valid, GNEUndoList* undoList, const std::string& myNet->addExplicitTurnaround(srcNBE->getID()); } } - undoList->add(new GNEChange_Attribute(srcEdge, GNE_ATTR_MODIFICATION_STATUS, status, myNet->getViewNet()->isTestingModeEnabled()), true); + undoList->add(new GNEChange_Attribute(srcEdge, GNE_ATTR_MODIFICATION_STATUS, status), true); } - undoList->add(new GNEChange_Attribute(this, GNE_ATTR_MODIFICATION_STATUS, status, myNet->getViewNet()->isTestingModeEnabled()), true); + undoList->add(new GNEChange_Attribute(this, GNE_ATTR_MODIFICATION_STATUS, status), true); invalidateTLS(undoList); } else { rebuildGNECrossings(); @@ -516,7 +516,7 @@ GNEJunction::markAsModified(GNEUndoList* undoList) { for (EdgeVector::iterator it = incoming.begin(); it != incoming.end(); it++) { NBEdge* srcNBE = *it; GNEEdge* srcEdge = myNet->retrieveEdge(srcNBE->getID()); - undoList->add(new GNEChange_Attribute(srcEdge, GNE_ATTR_MODIFICATION_STATUS, MODIFIED, myNet->getViewNet()->isTestingModeEnabled()), true); + undoList->add(new GNEChange_Attribute(srcEdge, GNE_ATTR_MODIFICATION_STATUS, MODIFIED), true); } } @@ -632,7 +632,7 @@ GNEJunction::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList case SUMO_ATTR_RADIUS: case SUMO_ATTR_TLTYPE: case SUMO_ATTR_KEEP_CLEAR: - undoList->add(new GNEChange_Attribute(this, key, value, myNet->getViewNet()->isTestingModeEnabled()), true); + undoList->add(new GNEChange_Attribute(this, key, value), true); break; case SUMO_ATTR_TYPE: { undoList->p_begin("change " + toString(getTag()) + " type"); @@ -656,11 +656,11 @@ GNEJunction::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList // make a copy because we will modify the original const std::set tls = myNBNode.getControllingTLS(); for (std::set::iterator it = tls.begin(); it != tls.end(); it++) { - undoList->add(new GNEChange_TLS(this, *it, false, myNet->getViewNet()->isTestingModeEnabled()), true); + undoList->add(new GNEChange_TLS(this, *it, false, OptionsCont::getOptions().getBool("gui-testing") == true), true); } } // must be the final step, otherwise we do not know which traffic lights to remove via GNEChange_TLS - undoList->add(new GNEChange_Attribute(this, key, value, myNet->getViewNet()->isTestingModeEnabled()), true); + undoList->add(new GNEChange_Attribute(this, key, value), true); undoList->p_end(); break; } diff --git a/sumo/src/netedit/GNELane.cpp b/sumo/src/netedit/GNELane.cpp index 818aae40d38..caed6cbd650 100644 --- a/sumo/src/netedit/GNELane.cpp +++ b/sumo/src/netedit/GNELane.cpp @@ -821,7 +821,7 @@ GNELane::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* un case SUMO_ATTR_ACCELERATION: case SUMO_ATTR_INDEX: // no special handling - undoList->p_add(new GNEChange_Attribute(this, key, value, myNet->getViewNet()->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); break; default: throw InvalidArgument(toString(getTag()) + " doesn't have an attribute of type '" + toString(key) + "'"); diff --git a/sumo/src/netedit/GNERerouter.cpp b/sumo/src/netedit/GNERerouter.cpp index 7feb698e6ff..61b38c36a11 100644 --- a/sumo/src/netedit/GNERerouter.cpp +++ b/sumo/src/netedit/GNERerouter.cpp @@ -137,7 +137,7 @@ GNERerouter::moveAdditionalGeometry(double offsetx, double offsety) { void GNERerouter::commmitAdditionalGeometryMoved(double oldPosx, double oldPosy, GNEUndoList* undoList) { undoList->p_begin("position of " + toString(getTag())); - undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPosition), myViewNet->isTestingModeEnabled(), true, toString(Position(oldPosx, oldPosy)))); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPosition), true, toString(Position(oldPosx, oldPosy)))); undoList->p_end(); // Refresh element myViewNet->getNet()->refreshAdditional(this); @@ -409,7 +409,7 @@ GNERerouter::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList case SUMO_ATTR_PROB: case SUMO_ATTR_OFF: case GNE_ATTR_BLOCK_MOVEMENT: - undoList->p_add(new GNEChange_Attribute(this, key, value, myViewNet->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); updateGeometry(); break; default: diff --git a/sumo/src/netedit/GNERerouterIntervalDialog.cpp b/sumo/src/netedit/GNERerouterIntervalDialog.cpp index 0700d1080a6..9708c0fbf88 100644 --- a/sumo/src/netedit/GNERerouterIntervalDialog.cpp +++ b/sumo/src/netedit/GNERerouterIntervalDialog.cpp @@ -168,7 +168,7 @@ long GNERerouterIntervalDialog::onCmdAccept(FXObject*, FXSelector, void*) { if (myBeginEndValid == false) { // write warning if netedit is running in testing mode - if (myRerouterDialogParent->getRerouterParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'warning'"); } // open warning Box @@ -179,13 +179,13 @@ GNERerouterIntervalDialog::onCmdAccept(FXObject*, FXSelector, void*) { // write warning if netedit is running in testing mode - if (myRerouterDialogParent->getRerouterParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'"); } return 0; } else if (myCopyOfClosingLaneReroutes.empty() && myCopyOfClosingReroutes.empty() && myCopyOfDestProbReroutes.empty() && myCopyOfRouteProbReroutes.empty()) { // write warning if netedit is running in testing mode - if (myRerouterDialogParent->getRerouterParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'warning'"); } // open warning Box @@ -194,13 +194,13 @@ GNERerouterIntervalDialog::onCmdAccept(FXObject*, FXSelector, void*) { (toString(myRerouterInterval->getRerouterParent()->getTag()) + "'s " + toString(myRerouterInterval->getTag()) + " cannot be updated because at least one " + toString(myRerouterInterval->getTag()) + "'s element must be defined.").c_str()); // write warning if netedit is running in testing mode - if (myRerouterDialogParent->getRerouterParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'"); } return 0; } else if (myClosingLaneReroutesValid == false) { // write warning if netedit is running in testing mode - if (myRerouterDialogParent->getRerouterParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'warning'"); } // open warning Box @@ -209,13 +209,13 @@ GNERerouterIntervalDialog::onCmdAccept(FXObject*, FXSelector, void*) { (toString(myRerouterInterval->getRerouterParent()->getTag()) + "'s " + toString(myRerouterInterval->getTag()) + " cannot be updated because there are invalid " + toString(SUMO_TAG_CLOSING_LANE_REROUTE) + "s.").c_str()); // write warning if netedit is running in testing mode - if (myRerouterDialogParent->getRerouterParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'"); } return 0; } else if (myClosingReroutesValid == false) { // write warning if netedit is running in testing mode - if (myRerouterDialogParent->getRerouterParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'warning'"); } // open warning Box @@ -224,13 +224,13 @@ GNERerouterIntervalDialog::onCmdAccept(FXObject*, FXSelector, void*) { (toString(myRerouterInterval->getRerouterParent()->getTag()) + "'s " + toString(myRerouterInterval->getTag()) + " cannot be updated because there are invalid " + toString(SUMO_TAG_CLOSING_REROUTE) + "s.").c_str()); // write warning if netedit is running in testing mode - if (myRerouterDialogParent->getRerouterParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'"); } return 0; } else if (myDestProbReroutesValid == false) { // write warning if netedit is running in testing mode - if (myRerouterDialogParent->getRerouterParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'warning'"); } // open warning Box @@ -239,13 +239,13 @@ GNERerouterIntervalDialog::onCmdAccept(FXObject*, FXSelector, void*) { (toString(myRerouterInterval->getRerouterParent()->getTag()) + "'s " + toString(myRerouterInterval->getTag()) + " cannot be updated because there are invalid " + toString(SUMO_TAG_DEST_PROB_REROUTE) + "s.").c_str()); // write warning if netedit is running in testing mode - if (myRerouterDialogParent->getRerouterParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'"); } return 0; } else if (myRouteProbReroutesValid == false) { // write warning if netedit is running in testing mode - if (myRerouterDialogParent->getRerouterParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'warning'"); } // open warning Box @@ -254,7 +254,7 @@ GNERerouterIntervalDialog::onCmdAccept(FXObject*, FXSelector, void*) { (toString(myRerouterInterval->getRerouterParent()->getTag()) + "'s " + toString(myRerouterInterval->getTag()) + " cannot be updated because there are invalid " + toString(SUMO_TAG_ROUTE_PROB_REROUTE) + "s.").c_str()); // write warning if netedit is running in testing mode - if (myRerouterDialogParent->getRerouterParent()->getViewNet()->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'"); } return 0; diff --git a/sumo/src/netedit/GNERouteProbe.cpp b/sumo/src/netedit/GNERouteProbe.cpp index 4941de16ec4..45578359681 100644 --- a/sumo/src/netedit/GNERouteProbe.cpp +++ b/sumo/src/netedit/GNERouteProbe.cpp @@ -308,7 +308,7 @@ GNERouteProbe::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoLi case SUMO_ATTR_FILE: case SUMO_ATTR_FREQUENCY: case SUMO_ATTR_BEGIN: - undoList->p_add(new GNEChange_Attribute(this, key, value, myViewNet->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); updateGeometry(); break; default: diff --git a/sumo/src/netedit/GNESelectorFrame.cpp b/sumo/src/netedit/GNESelectorFrame.cpp index 47c025b3229..077d866dea9 100644 --- a/sumo/src/netedit/GNESelectorFrame.cpp +++ b/sumo/src/netedit/GNESelectorFrame.cpp @@ -234,13 +234,13 @@ GNESelectorFrame::onCmdLoad(FXObject*, FXSelector, void*) { handleIDs(std::vector(ids.begin(), ids.end()), false); if (errors != "") { // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'error'"); } // open message box error FXMessageBox::error(this, MBOX_OK, "Errors while loading Selection", "%s", errors.c_str()); // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'error' with 'OK'"); } } @@ -261,13 +261,13 @@ GNESelectorFrame::onCmdSave(FXObject*, FXSelector, void*) { gSelected.save(file.text()); } catch (IOError& e) { // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Opening FXMessageBox of type 'error'"); } // open message box error FXMessageBox::error(this, MBOX_OK, "Storing Selection failed", "%s", e.what()); // write warning if netedit is running in testing mode - if (myViewNet->isTestingModeEnabled() == true) { + if (OptionsCont::getOptions().getBool("gui-testing") == true) { WRITE_WARNING("Closed FXMessageBox of type 'error' with 'OK'"); } } diff --git a/sumo/src/netedit/GNEStoppingPlace.cpp b/sumo/src/netedit/GNEStoppingPlace.cpp index 9cea93265c6..3f83502bf71 100644 --- a/sumo/src/netedit/GNEStoppingPlace.cpp +++ b/sumo/src/netedit/GNEStoppingPlace.cpp @@ -104,8 +104,8 @@ GNEStoppingPlace::moveAdditionalGeometry(double offsetx, double offsety) { void GNEStoppingPlace::commmitAdditionalGeometryMoved(double oldPosx, double oldPosy, GNEUndoList* undoList) { undoList->p_begin("position of " + toString(getTag())); - undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_STARTPOS, toString(getStartPosition()), myViewNet->isTestingModeEnabled(), true, toString(oldPosx))); - undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_ENDPOS, toString(getEndPosition()), myViewNet->isTestingModeEnabled(), true, toString(oldPosy))); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_STARTPOS, toString(getStartPosition()), true, toString(oldPosx))); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_ENDPOS, toString(getEndPosition()), true, toString(oldPosy))); undoList->p_end(); // Refresh element myViewNet->getNet()->refreshAdditional(this); diff --git a/sumo/src/netedit/GNEVaporizer.cpp b/sumo/src/netedit/GNEVaporizer.cpp index 4d04cf86d98..ba8464b8d65 100644 --- a/sumo/src/netedit/GNEVaporizer.cpp +++ b/sumo/src/netedit/GNEVaporizer.cpp @@ -287,7 +287,7 @@ GNEVaporizer::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoLis case SUMO_ATTR_EDGE: case SUMO_ATTR_STARTTIME: case SUMO_ATTR_END: - undoList->p_add(new GNEChange_Attribute(this, key, value, myViewNet->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); updateGeometry(); break; default: diff --git a/sumo/src/netedit/GNEVariableSpeedSign.cpp b/sumo/src/netedit/GNEVariableSpeedSign.cpp index 1dd41b4617a..560b46ffe5b 100644 --- a/sumo/src/netedit/GNEVariableSpeedSign.cpp +++ b/sumo/src/netedit/GNEVariableSpeedSign.cpp @@ -131,7 +131,7 @@ GNEVariableSpeedSign::moveAdditionalGeometry(double offsetx, double offsety) { void GNEVariableSpeedSign::commmitAdditionalGeometryMoved(double oldPosx, double oldPosy, GNEUndoList* undoList) { undoList->p_begin("position of " + toString(getTag())); - undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPosition), myViewNet->isTestingModeEnabled(), true, toString(Position(oldPosx, oldPosy)))); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPosition), true, toString(Position(oldPosx, oldPosy)))); undoList->p_end(); // Refresh element myViewNet->getNet()->refreshAdditional(this); @@ -340,7 +340,7 @@ GNEVariableSpeedSign::setAttribute(SumoXMLAttr key, const std::string& value, GN case SUMO_ATTR_POSITION: case SUMO_ATTR_FILE: case GNE_ATTR_BLOCK_MOVEMENT: - undoList->p_add(new GNEChange_Attribute(this, key, value, myViewNet->isTestingModeEnabled())); + undoList->p_add(new GNEChange_Attribute(this, key, value)); updateGeometry(); break; default: diff --git a/sumo/src/netedit/GNEViewNet.cpp b/sumo/src/netedit/GNEViewNet.cpp index 8de6f4e497f..a71271b2c31 100644 --- a/sumo/src/netedit/GNEViewNet.cpp +++ b/sumo/src/netedit/GNEViewNet.cpp @@ -401,11 +401,6 @@ GNEViewNet::showJunctionAsBubbles() const { } -bool -GNEViewNet::isTestingModeEnabled() const { - return myTestingMode; -} - int GNEViewNet::doPaintGL(int mode, const Boundary& bound) { // init view settings diff --git a/sumo/src/netedit/GNEViewNet.h b/sumo/src/netedit/GNEViewNet.h index 3bed1fb1331..db72820989e 100644 --- a/sumo/src/netedit/GNEViewNet.h +++ b/sumo/src/netedit/GNEViewNet.h @@ -302,9 +302,6 @@ class GNEViewNet : public GUISUMOAbstractView { /// @brief return true if junction must be showed as bubbles bool showJunctionAsBubbles() const; - /// @brief check if netedit is running in testing mode - bool isTestingModeEnabled() const; - protected: /// @brief FOX needs this GNEViewNet() {}