Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEApplicationWindow.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-2024 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/****************************************************************************/
19// Functions from main window of netedit
20/****************************************************************************/
21
23#include <netbuild/NBFrame.h>
43#include <netedit/templates.h>
44#include <netimport/NIFrame.h>
47#include <netwrite/NWFrame.h>
64#include <utils/xml/XMLSubSys.h>
65
68#include "GNELoadThread.h"
69#include "GNENet.h"
70#include "GNEViewNet.h"
71#include "GNEUndoList.h"
72#include "GNEViewParent.h"
73
74#ifdef HAVE_VERSION_H
75#include <version.h>
76#endif
77
78// ===========================================================================
79// FOX-declarations
80// ===========================================================================
81
82FXDEFMAP(GNEApplicationWindow) GNEApplicationWindowMap[] = {
83 // quit calls
87 FXMAPFUNC(SEL_CLOSE, MID_WINDOW, GNEApplicationWindow::onCmdQuit),
88 // toolbar file
95 FXMAPFUNC(SEL_UPDATE, MID_RECENTFILE, GNEApplicationWindow::onUpdOpen),
100 // network
115 // NeteditConfig
123 // SumoConfig
131 // TLS
138 // edge types
147 // additionals
158 // demand elements
167 // data elements
176 // meanDatas
185 // other
190 // Toolbar supermode
194 // Toolbar modes
211 // Toolbar edit
220 // Network view options
253 // Demand view options
276 // Data view options
293 // view
310 /* Prepared for #6042
311 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_X_CUT, GNEApplicationWindow::onCmdCut),
312 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_C_COPY, GNEApplicationWindow::onCmdCopy),
313 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_V_PASTE, GNEApplicationWindow::onCmdPaste),
314 */
315 // toolbar lock
321 // Toolbar processing
340 // Toolbar locate
365 // toolbar python tools
370 // toolbar windows
372 // toolbar help
375 FXMAPFUNC(SEL_COMMAND, MID_HOTKEYS, GNEApplicationWindow::onCmdHotkeys),
376 FXMAPFUNC(SEL_COMMAND, MID_TUTORIAL, GNEApplicationWindow::onCmdTutorial),
377 FXMAPFUNC(SEL_COMMAND, MID_FEEDBACK, GNEApplicationWindow::onCmdFeedback),
379 // alt + <number>
400 // key events
401 FXMAPFUNC(SEL_KEYPRESS, 0, GNEApplicationWindow::onKeyPress),
402 FXMAPFUNC(SEL_KEYRELEASE, 0, GNEApplicationWindow::onKeyRelease),
403 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_ESC, GNEApplicationWindow::onCmdAbort),
404 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_DEL, GNEApplicationWindow::onCmdDel),
405 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_ENTER, GNEApplicationWindow::onCmdEnter),
407 // threads events
410 // edge template functions
414 // languages
433 // tools
436 // other
437 FXMAPFUNC(SEL_CLIPBOARD_REQUEST, 0, GNEApplicationWindow::onClipboardRequest),
444};
445
446// Object implementation
447FXIMPLEMENT(GNEApplicationWindow, FXMainWindow, GNEApplicationWindowMap, ARRAYNUMBER(GNEApplicationWindowMap))
448
449
450// ===========================================================================
451// GNEApplicationWindow method definitions
452// ===========================================================================
453
454GNEApplicationWindow::GNEApplicationWindow(FXApp* a, const std::string& configPattern) :
455 GUIMainWindow(a),
456 myUndoList(new GNEUndoList(this)),
457 myConfigPattern(configPattern),
458 myToolbarsGrip(this),
459 myMenuBarFile(this),
460 myFileMenuCommands(this),
461 myModesMenuCommands(this),
462 myEditMenuCommands(this),
463 myLockMenuCommands(this),
464 myProcessingMenuCommands(this),
465 myLocateMenuCommands(this),
466 myToolsMenuCommands(this),
467 myWindowsMenuCommands(this),
468 myHelpMenuCommands(this),
469 mySupermodeCommands(this),
470 myTitlePrefix("netedit " VERSION_STRING),
471 myAllowUndoRedo(getApp()->reg().readBoolEntry("NETEDIT", "AllowUndoRedo", true) == TRUE),
472 myAllowUndoRedoLoading(getApp()->reg().readBoolEntry("NETEDIT", "AllowUndoRedoLoading", true) == TRUE) {
473 // init icons
475 // init Textures
477 // init cursors
479 // create undoList dialog (after initCursors)
480 myUndoListDialog = new GNEUndoListDialog(this);
481 a->setTooltipTime(1000000000);
482 a->setTooltipPause(1000000000);
483 // set SUMO Options descriptions
484 mySumoOptions.setApplicationDescription(TL("A microscopic, multi-modal traffic simulation."));
485 mySumoOptions.setApplicationName("sumo", "Eclipse SUMO sumo Version " VERSION_STRING);
486 // set default netedit options
487 GNELoadThread::fillOptions(myOriginalNeteditOptions);
488 GNELoadThread::setDefaultOptions(myOriginalNeteditOptions);
489 // parse options
490 TemplateHandler::parseTemplate(mySumoOptions, sumoTemplate);
491 TemplateHandler::parseTemplate(myOriginalSumoOptions, sumoTemplate);
492 TemplateHandler::parseTemplate(myNetgenerateOptions, netgenerateTemplate);
493 TemplateHandler::parseTemplate(myOriginalNetgenerateOptions, netgenerateTemplate);
494}
495
496void
498 // do this not twice
500 // do not translate debug messages
501 WRITE_ERROR("DEBUG: GNEApplicationWindow::dependentBuild called twice");
502 return;
503 }
504 myHadDependentBuild = true;
505 setTarget(this);
506 setSelector(MID_WINDOW);
507 // build toolbar menu
509 // build the thread - io
512 // build the status bar
513 myStatusbar = new FXStatusBar(this, GUIDesignStatusBar);
514 // build geo coordinates label
515 auto requireRecomputingFrame = new FXHorizontalFrame(myStatusbar, GUIDesignHorizontalFrameStatusBar);
517 TL("Recomputing"), nullptr, this, MID_GNE_RECOMPUTINGNEEDED, GUIDesignButtonStatusBarFixed);
518 myRequireRecomputingButton->setHelpText(TL("Recomputing is needed"));
519 // build geo coordinates label
521 myGeoCoordinate = new FXLabel(myGeoFrame, TL("N/A"), nullptr, GUIDesignLabelStatusBar);
522 myGeoCoordinate->setHelpText(TL("Original coordinate (before coordinate transformation in netconvert)"));
523 // build cartesian coordinates label
525 myCartesianCoordinate = new FXLabel(myCartesianFrame, TL("N/A"), nullptr, GUIDesignLabelStatusBar);
526 myCartesianCoordinate->setHelpText(TL("Network coordinate"));
527 // build test coordinates label (only if gui-testing is enabled)
529 myTestCoordinate = new FXLabel(myTestFrame, TL("N/A"), nullptr, GUIDesignLabelStatusBar);
530 myTestCoordinate->setHelpText(TL("Test coordinate"));
531 myTestCoordinate->setTextColor(FXRGB(255, 0, 0));
532 myTestFrame->hide();
533 // make the window a mdi-window
534 myMainSplitter = new FXSplitter(this, GUIDesignSplitter | SPLITTER_VERTICAL | SPLITTER_REVERSED);
536 myMDIMenu = new FXMDIMenu(this, myMDIClient);
537 // build the message window
539 myMainSplitter->setSplit(1, 65);
540 // fill menu and tool bar
541 fillMenuBar();
542 // build additional threads
544 // set the status bar
545 setStatusBarText(TL("Ready."));
546 // set the caption
547 setTitle(myTitlePrefix);
548 // set Netedit ICON
551 // build netedit Accelerators (hotkeys)
552 GUIShortcutsSubSys::buildAccelerators(getAccelTable(), this, false);
553}
554
555
556void
558 // set windows size and position
560 // set current folder
561 gCurrentFolder = getApp()->reg().readStringEntry("SETTINGS", "basedir", "");
562 // Create main window
563 FXMainWindow::create();
564 // get text width
565 const auto textWidth = getApp()->getNormalFont()->getTextWidth("8", 1) * 22;
566 // adjust cartesian and geo frame
567 myCartesianFrame->setWidth(textWidth);
568 myGeoFrame->setWidth(textWidth);
569 // fill online maps
570 if (myOnlineMaps.empty()) {
571 myOnlineMaps["GeoHack"] = "https://geohack.toolforge.org/geohack.php?params=%lat;%lon_scale:1000";
572 myOnlineMaps["Google Maps"] = "https://www.google.com/maps?ll=%lat,%lon&t=h&z=18";
573 myOnlineMaps["OSM"] = "https://www.openstreetmap.org/?mlat=%lat&mlon=%lon&zoom=18&layers=M";
574 }
575 // show application windows
576 show(PLACEMENT_DEFAULT);
577 // check if maximice
578 if (!OptionsCont::getOptions().isSet("window-size")) {
579 if (getApp()->reg().readIntEntry("SETTINGS", "maximized", 0) == 1) {
580 maximize();
581 }
582 }
583}
584
585
588 // Close icons
590 // Close gifs (Textures)
593 // delete visuals
594 delete myGLVisual;
595 // must delete menus to avoid segfault on removing accelerators
596 // (http://www.fox-toolkit.net/faq#TOC-What-happens-when-the-application-s)
599 delete myFileMenuTLS;
600 delete myFileMenuEdgeTypes;
607 delete myFileMenu;
608 delete myModesMenu;
609 delete myEditMenu;
610 delete myLockMenu;
611 delete myProcessingMenu;
612 delete myLocatorMenu;
613 delete myToolsMenu;
614 delete myToolsDetectorMenu;
615 delete myToolsDistrictMenu;
616 delete myToolsDRTMenu;
618 delete myToolsImportMenu;
621 delete myToolsImportVissim;
622 delete myToolsImportVisum;
623 delete myToolsNetMenu;
624 delete myToolsRouteMenu;
625 delete myToolsOutputMenu;
626 delete myToolsShapes;
627 delete myToolsTLS;
628 delete myToolsTurnDefs;
630 delete myToolsXML;
631 delete myWindowMenu;
632 delete myHelpMenu;
633 delete myLanguageMenu;
634 // Delete load thread
635 delete myLoadThread;
636 // drop all events
637 while (!myEvents.empty()) {
638 // get the next event
639 GUIEvent* e = myEvents.top();
640 myEvents.pop();
641 delete e;
642 }
643 // delete undoList and dialog
644 delete myUndoList;
645 delete myUndoListDialog;
646}
647
648
649long
650GNEApplicationWindow::onCmdQuit(FXObject*, FXSelector, void*) {
653 getApp()->reg().writeStringEntry("SETTINGS", "basedir", gCurrentFolder.text());
654 if (isMaximized()) {
655 getApp()->reg().writeIntEntry("SETTINGS", "maximized", 1);
656 } else {
657 getApp()->reg().writeIntEntry("SETTINGS", "maximized", 0);
658 }
659 getApp()->exit(0);
660 }
661 return 1;
662}
663
664
665long
666GNEApplicationWindow::onCmdEditChosen(FXObject*, FXSelector, void*) {
667 GUIDialog_GLChosenEditor* chooser =
669 chooser->create();
670 chooser->show();
671 return 1;
672}
673
674
675long
676GNEApplicationWindow::onCmdNewNetwork(FXObject*, FXSelector, void*) {
677 // check if close current simulation
678 if (onCmdClose(0, 0, 0) == 1) {
679 // create new network
681 }
682 return 1;
683}
684
685
686long
688 // get netconvert filename
689 const auto netconvertFile = GNEApplicationWindowHelper::openNetconvertFileDialog(this);
690 // continue depending of netconvertFile
691 if (!netconvertFile.empty() && (onCmdClose(0, 0, 0) == 1)) {
692 // load configuration
693 loadConfiguration(netconvertFile);
694 }
695 return 1;
696}
697
698
699long
700GNEApplicationWindow::onCmdOpenNetwork(FXObject*, FXSelector, void*) {
701 // get netconvert filename
702 const auto networkFile = GNEApplicationWindowHelper::openNetworkFileDialog(this, false);
703 // continue depending of netconvertFile
704 if (!networkFile.empty() && (onCmdClose(0, 0, 0) == 1)) {
705 // load network
706 loadNetwork(networkFile);
707 }
708 return 0;
709}
710
711
712long
713GNEApplicationWindow::onCmdOpenForeign(FXObject*, FXSelector, void*) {
714 // get netconvert filename
715 const auto OSMFile = GNEApplicationWindowHelper::openOSMFileDialog(this);
716 // continue depending of netconvertFile
717 if (!OSMFile.empty() && (onCmdClose(0, 0, 0) == 1)) {
718 loadOSM(OSMFile);
719 }
720 return 1;
721}
722
723
724long
725GNEApplicationWindow::onCmdOpenNeteditConfig(FXObject*, FXSelector, void*) {
726 auto& neteditOptions = OptionsCont::getOptions();
727 // get netconvert filename
728 const auto neteditConfigFile = GNEApplicationWindowHelper::openNeteditConfigFileDialog(this, false);
729 // continue depending of netconvertFile
730 if (!neteditConfigFile.empty() && (onCmdClose(0, 0, 0) == 1)) {
731 // reset netedit options
732 myLoadThread->fillOptions(neteditOptions);
733 myLoadThread->setDefaultOptions(neteditOptions);
734 // set netedit configuration file to load
735 neteditOptions.resetWritable();
736 neteditOptions.set("configuration-file", neteditConfigFile);
737 // run load thread
739 // update view
740 update();
741 }
742 return 1;
743}
744
745
746long
747GNEApplicationWindow::onCmdOpenSumoConfig(FXObject*, FXSelector, void*) {
748 auto& neteditOptions = OptionsCont::getOptions();
749 // get netconvert filename
750 const auto sumoConfigFile = GNEApplicationWindowHelper::openSumoConfigFileDialog(this, false);
751 // continue depending of netconvertFile
752 if (!sumoConfigFile.empty() && (onCmdClose(0, 0, 0) == 1)) {
753 // reset options
754 myLoadThread->fillOptions(neteditOptions);
755 myLoadThread->setDefaultOptions(neteditOptions);
756 // set sumo configuration file to load
757 neteditOptions.resetWritable();
758 neteditOptions.set("sumocfg-file", sumoConfigFile);
759 // run load thread
761 // update view
762 update();
763 }
764 return 1;
765}
766
767
768long
770 // check if close current simulation
771 if (onCmdClose(0, 0, 0) == 1) {
772 auto& neteditOptions = OptionsCont::getOptions();
773 // get existent configuration file
774 const auto neteditConfigFile = neteditOptions.getString("configuration-file");
775 // reset options
776 myLoadThread->fillOptions(neteditOptions);
777 myLoadThread->setDefaultOptions(neteditOptions);
778 // set configuration file to load
779 neteditOptions.resetWritable();
780 neteditOptions.set("configuration-file", neteditConfigFile);
781 // run load thread
783 // update view
784 update();
785 }
786 return 1;
787}
788
789
790long
791GNEApplicationWindow::onCmdReloadSumoConfig(FXObject*, FXSelector, void*) {
792 auto& neteditOptions = OptionsCont::getOptions();
793 // check if close current simulation
794 if (onCmdClose(0, 0, 0) == 1) {
795 const auto sumoConfigFile = neteditOptions.getString("sumocfg-file");
796 // reset options
797 myLoadThread->fillOptions(neteditOptions);
798 myLoadThread->setDefaultOptions(neteditOptions);
799 // set configuration file to load
800 neteditOptions.resetWritable();
801 neteditOptions.set("sumocfg-file", sumoConfigFile);
802 // run load thread
804 // update view
805 update();
806 }
807 return 1;
808}
809
810
811long
812GNEApplicationWindow::onUpdReloadNeteditConfig(FXObject* sender, FXSelector, void*) {
813 // check if file exist
814 if (myViewNet && !OptionsCont::getOptions().getString("configuration-file").empty()) {
815 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
816 } else {
817 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
818 }
819}
820
821
822long
823GNEApplicationWindow::onUpdReloadSumoConfig(FXObject* sender, FXSelector, void*) {
824 // check if file exist
825 if (myViewNet && !OptionsCont::getOptions().getString("sumocfg-file").empty()) {
826 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
827 } else {
828 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
829 }
830}
831
832
833long
834GNEApplicationWindow::onCmdOpenTLSPrograms(FXObject*, FXSelector, void*) {
835 auto& neteditOptions = OptionsCont::getOptions();
836 // get netconvert filename
837 const auto TLSFile = GNEApplicationWindowHelper::openTLSFileDialog(this, false);
838 // continue depending of netconvertFile
839 if (!TLSFile.empty()) {
840 // set file to load
841 neteditOptions.resetWritable();
842 neteditOptions.set("tls-file", TLSFile);
843 // Run parser
844 myUndoList->begin(Supermode::NETWORK, GUIIcon::MODETLS, TL("loading TLS Programs from '") + TLSFile + "'");
845 myNet->computeNetwork(this);
846 if (myNet->getViewNet()->getViewParent()->getTLSEditorFrame()->parseTLSPrograms(TLSFile) == false) {
847 // Abort undo/redo
849 } else {
850 // commit undo/redo operation
851 myUndoList->end();
852 update();
853 }
854 } else {
855 // write debug information
856 WRITE_DEBUG("Cancel TLSProgram dialog");
857 }
858 return 1;
859}
860
861
862long
863GNEApplicationWindow::onCmdReloadTLSPrograms(FXObject*, FXSelector, void*) {
864 // get option container
865 auto& neteditOptions = OptionsCont::getOptions();
866 // Run parser
867 myUndoList->begin(Supermode::NETWORK, GUIIcon::MODETLS, TL("loading TLS Programs from '") + neteditOptions.getString("tls-file") + "'");
868 myNet->computeNetwork(this);
869 if (myNet->getViewNet()->getViewParent()->getTLSEditorFrame()->parseTLSPrograms(neteditOptions.getString("tls-file")) == false) {
870 // Abort undo/redo
872 } else {
873 // commit undo/redo operation
874 myUndoList->end();
875 update();
876 }
877 return 1;
878}
879
880
881long
882GNEApplicationWindow::onUpdReloadTLSPrograms(FXObject* sender, FXSelector, void*) {
883 // check if file exist
884 if (myViewNet && OptionsCont::getOptions().getString("tls-file").empty()) {
885 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
886 } else {
887 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
888 }
889}
890
891
892long
893GNEApplicationWindow::onCmdOpenEdgeTypes(FXObject*, FXSelector, void*) {
894 auto& neteditOptions = OptionsCont::getOptions();
895 // get netconvert filename
896 const auto edgeTypeFile = GNEApplicationWindowHelper::openEdgeTypeFileDialog(this, false);
897 // continue depending of netconvertFile
898 if (!edgeTypeFile.empty()) {
899 // set file to load
900 neteditOptions.resetWritable();
901 neteditOptions.set("edgetypes-file", edgeTypeFile);
902 // declare type container
903 NBTypeCont typeContainerAux;
904 // declare type handler
905 NIXMLTypesHandler handler(typeContainerAux);
906 // load edge types
907 NITypeLoader::load(handler, {edgeTypeFile}, "types");
908 // write information
909 WRITE_MESSAGE(TL("Loaded edge types from '") + toString(typeContainerAux.size()) + "'");
910 // now create GNETypes based on typeContainerAux
912 // iterate over typeContainerAux
913 for (const auto& auxEdgeType : typeContainerAux) {
914 // create new edge type
915 GNEEdgeType* edgeType = new GNEEdgeType(myNet, auxEdgeType.first, auxEdgeType.second);
916 // add lane types
917 for (const auto& laneType : auxEdgeType.second->laneTypeDefinitions) {
918 edgeType->addLaneType(new GNELaneType(edgeType, laneType));
919 }
920 // add it using undoList
921 myViewNet->getUndoList()->add(new GNEChange_EdgeType(edgeType, true), true);
922
923 }
924 // end undo list
926 // refresh edge type selector
928 }
929 return 1;
930}
931
932
933long
934GNEApplicationWindow::onCmdReloadEdgeTypes(FXObject*, FXSelector, void*) {
935 // declare type container
936 NBTypeCont typeContainerAux;
937 // declare type handler
938 NIXMLTypesHandler handler(typeContainerAux);
939 // load edge types
940 NITypeLoader::load(handler, {OptionsCont::getOptions().getString("edgetypes-file")}, "types");
941 // write information
942 WRITE_MESSAGE(TL("Reloaded edge types from '") + toString(typeContainerAux.size()) + ".");
943 // now create GNETypes based on typeContainerAux
945 // iterate over typeContainerAux
946 for (const auto& auxEdgeType : typeContainerAux) {
947 // create new edge type
948 GNEEdgeType* edgeType = new GNEEdgeType(myNet, auxEdgeType.first, auxEdgeType.second);
949 // add lane types
950 for (const auto& laneType : auxEdgeType.second->laneTypeDefinitions) {
951 edgeType->addLaneType(new GNELaneType(edgeType, laneType));
952 }
953 // add it using undoList
954 myViewNet->getUndoList()->add(new GNEChange_EdgeType(edgeType, true), true);
955
956 }
957 // end undo list
959 // refresh edge type selector
961 return 0;
962}
963
964
965long
966GNEApplicationWindow::onUpdReloadEdgeTypes(FXObject* sender, FXSelector, void*) {
967 // check if file exist
968 if (myViewNet && OptionsCont::getOptions().getString("edgetypes-file").empty()) {
969 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
970 } else {
971 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
972 }
973}
974
975
976long
977GNEApplicationWindow::onCmdSmartReload(FXObject*, FXSelector, void*) {
978 auto& neteditOptions = OptionsCont::getOptions();
979 // check if close current file
980 if (onCmdClose(0, 0, 0) == 1) {
981 // store size, position and viewport
983 gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view
984 // set flag
985 myAmLoading = true;
986 // get files
987 const auto neteditConfig = neteditOptions.getString("configuration-file");
988 const auto sumoConfig = neteditOptions.getString("sumocfg-file");
989 const auto networkFile = neteditOptions.getString("net-file");
990 // fill (reset) all options
991 myLoadThread->fillOptions(neteditOptions);
992 // set default options defined in GNELoadThread::setDefaultOptions(...)
993 myLoadThread->setDefaultOptions(neteditOptions);
994 // set file to load
995 neteditOptions.resetWritable();
996 if (neteditConfig.size() > 0) {
997 neteditOptions.set("configuration-file", neteditConfig);
998 // set status bar
999 setStatusBarText(TL("Reloading netedit config file '") + neteditConfig + "'");
1000 } else if (sumoConfig.size() > 0) {
1001 neteditOptions.set("sumocfg-file", sumoConfig);
1002 // set status bar
1003 setStatusBarText(TL("Reloading sumo config file '") + sumoConfig + "'");
1004 } else if (networkFile.size() > 0) {
1005 neteditOptions.set("net-file", networkFile);
1006 // set status bar
1007 setStatusBarText(TL("Reloading network file '") + networkFile + "'");
1008 } else {
1009 // nothing to load
1010 return 0;
1011 }
1012 // load network
1014 }
1015 return 1;
1016}
1017
1018
1019long
1020GNEApplicationWindow::onUpdSmartReload(FXObject* sender, FXSelector, void*) {
1021 auto& neteditOptions = OptionsCont::getOptions();
1022 // declare strings
1023 FXString neteditConfig = TL("&Reload Netedit config");
1024 FXString sumoConfig = TL("&Reload Sumo config");
1025 FXString netFile = TL("&Reload Network");
1026 FXString reload = TL("&Reload");
1027 // check options
1028 if (myNet == nullptr) {
1029 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
1030 sender->handle(this, FXSEL(SEL_COMMAND, ID_SETSTRINGVALUE), &reload);
1031 } else if (neteditOptions.getString("configuration-file").size() > 0) {
1032 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
1033 sender->handle(this, FXSEL(SEL_COMMAND, ID_SETSTRINGVALUE), &neteditConfig);
1034 } else if (neteditOptions.getString("sumocfg-file").size() > 0) {
1035 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
1036 sender->handle(this, FXSEL(SEL_COMMAND, ID_SETSTRINGVALUE), &sumoConfig);
1037 } else if (neteditOptions.getString("net-file").size() > 0) {
1038 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
1039 sender->handle(this, FXSEL(SEL_COMMAND, ID_SETSTRINGVALUE), &netFile);
1040 } else {
1041 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
1042 sender->handle(this, FXSEL(SEL_COMMAND, ID_SETSTRINGVALUE), &reload);
1043 }
1044 return 1;
1045}
1046
1047
1048long
1049GNEApplicationWindow::onCmdReloadNetwork(FXObject*, FXSelector, void*) {
1050 auto& neteditOptions = OptionsCont::getOptions();
1051 // check if close current file
1052 if (onCmdClose(0, 0, 0) == 1) {
1053 // store size, position and viewport
1055 gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view
1056 // set flag
1057 myAmLoading = true;
1058 // get network
1059 const auto networkFile = neteditOptions.getString("net-file");
1060 // fill (reset) all options
1061 myLoadThread->fillOptions(neteditOptions);
1062 // set default options defined in GNELoadThread::setDefaultOptions(...)
1063 myLoadThread->setDefaultOptions(neteditOptions);
1064 // set file to load
1065 neteditOptions.resetWritable();
1066 neteditOptions.set("net-file", networkFile);
1067 // set status bar
1068 setStatusBarText(TL("Reloading network file '") + networkFile + "'");
1069 // loaad network
1071 }
1072 return 1;
1073}
1074
1075
1076long
1077GNEApplicationWindow::onUpdReloadNetwork(FXObject* sender, FXSelector, void*) {
1078 auto& neteditOptions = OptionsCont::getOptions();
1079 if (myNet == nullptr) {
1080 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
1081 sender->handle(this, FXSEL(SEL_COMMAND, ID_HIDE), nullptr);
1082 } else if ((neteditOptions.getString("net-file").size() > 0) &&
1083 ((neteditOptions.getString("configuration-file").size() > 0) || (neteditOptions.getString("sumocfg-file").size() > 0))) {
1084 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
1085 sender->handle(this, FXSEL(SEL_COMMAND, ID_SHOW), nullptr);
1086 } else {
1087 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
1088 sender->handle(this, FXSEL(SEL_COMMAND, ID_HIDE), nullptr);
1089 }
1090 return 1;
1091}
1092
1093
1094long
1095GNEApplicationWindow::onCmdOpenRecent(FXObject*, FXSelector, void* fileData) {
1096 // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
1097 if (myAmLoading) {
1098 myStatusbar->getStatusLine()->setText(TL("Already loading!"));
1099 } else if (onCmdClose(0, 0, 0) == 1) {
1100 // get filedata
1101 const std::string recentFile = ((const char*)fileData);
1102 // check if we're loading a network o a config
1103 if ((recentFile.find(".neteditcfg") != std::string::npos) || // neteditcfg deprecated
1104 (recentFile.find(".netecfg") != std::string::npos) ||
1105 (recentFile.find(".sumocfg") != std::string::npos) ||
1106 (recentFile.find(".netccfg") != std::string::npos)) {
1107 // load config
1108 loadConfiguration(recentFile);
1109 } else {
1110 // load network
1111 loadNetwork(recentFile);
1112 }
1113 }
1114 return 1;
1115}
1116
1117
1118long
1119GNEApplicationWindow::onCmdClose(FXObject*, FXSelector, void*) {
1120 if (myViewNet == nullptr) {
1121 return 1;
1122 } else if (continueWithUnsavedChanges()) {
1124 // add a separator to the log
1126 // hide all menu commands
1130 // hide view options
1134 return 1;
1135 } else {
1136 return 0;
1137 }
1138}
1139
1140
1141long
1142GNEApplicationWindow::onCmdLocate(FXObject*, FXSelector sel, void*) {
1143 if (myMDIClient->numChildren() > 0) {
1144 GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
1145 if (w != nullptr) {
1146 w->onCmdLocate(nullptr, sel, nullptr);
1147 }
1148 }
1149 return 1;
1150}
1151
1152
1153long
1154GNEApplicationWindow::onCmdOpenPythonToolDialog(FXObject* obj, FXSelector, void*) {
1155 return myToolsMenuCommands.showTool(obj);
1156}
1157
1158
1159long
1160GNEApplicationWindow::onCmdRunPythonTool(FXObject* obj, FXSelector, void*) {
1162}
1163
1164
1165long
1168}
1169
1170
1171long
1172GNEApplicationWindow::onUpdPythonTool(FXObject*, FXSelector, void*) {
1173 // currently always enabled
1174 return 1;
1175}
1176
1177
1178long
1179GNEApplicationWindow::onUpdOpen(FXObject* sender, FXSelector, void*) {
1180 sender->handle(this, myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
1181 return 1;
1182}
1183
1184
1185long
1186GNEApplicationWindow::onCmdClearMsgWindow(FXObject*, FXSelector, void*) {
1188 return 1;
1189}
1190
1191
1192long
1194 // write warning if netedit is running in testing mode
1195 WRITE_DEBUG("Toggle load additionals in sumo-gui");
1196 return 1;
1197}
1198
1199
1200long
1202 // write warning if netedit is running in testing mode
1203 WRITE_DEBUG("Toggle load demand in sumo-gui");
1204 return 1;
1205}
1206
1207
1208long
1209GNEApplicationWindow::onCmdAbout(FXObject*, FXSelector, void*) {
1210 // write warning if netedit is running in testing mode
1211 WRITE_DEBUG("Opening about dialog");
1212 // create and open about dialog
1213 GNEAbout* about = new GNEAbout(this);
1214 about->create();
1215 about->show(PLACEMENT_OWNER);
1216 // write warning if netedit is running in testing mode
1217 WRITE_DEBUG("Closed about dialog");
1218 return 1;
1219}
1220
1221
1222long GNEApplicationWindow::onClipboardRequest(FXObject*, FXSelector, void* ptr) {
1223 FXEvent* event = (FXEvent*)ptr;
1224 FXString string = GUIUserIO::clipped.c_str();
1225 setDNDData(FROM_CLIPBOARD, event->target, string);
1226 return 1;
1227}
1228
1229
1230long
1231GNEApplicationWindow::onLoadThreadEvent(FXObject*, FXSelector, void*) {
1232 eventOccurred();
1233 return 1;
1234}
1235
1236
1237void
1239 while (!myEvents.empty()) {
1240 // get the next event
1241 GUIEvent* e = myEvents.top();
1242 myEvents.pop();
1243 // process
1244 switch (e->getOwnType()) {
1247 break;
1254 break;
1255 default:
1256 break;
1257 }
1258 delete e;
1259 }
1260}
1261
1262
1263void
1265 myAmLoading = false;
1266 GNEEvent_NetworkLoaded* ec = static_cast<GNEEvent_NetworkLoaded*>(e);
1267 // check whether the loading was successfull
1268 if (ec->net == nullptr) {
1269 // report failure
1270 setStatusBarText(TL("Loading of '") + ec->file + "' failed!");
1271 } else {
1272 // set new Net
1273 myNet = ec->net;
1274 // report success
1275 setStatusBarText(TL("'") + ec->file + TL("' loaded."));
1277 // build viewparent toolbar grips before creating view parent
1279 // initialise netedit View
1280 GNEViewParent* viewParent = new GNEViewParent(myMDIClient, myMDIMenu, "netedit VIEW", this, nullptr, myNet, myUndoList, nullptr, MDI_TRACKING, 10, 10, 300, 200);
1281 // create it maximized
1282 viewParent->maximize();
1283 // mark it as Active child
1284 myMDIClient->setActiveChild(viewParent);
1285 // cast pointer myViewNet
1286 myViewNet = dynamic_cast<GNEViewNet*>(viewParent->getView());
1287 // set settings in view
1288 if (viewParent->getView() && ec->settingsFile != "") {
1289 GUISettingsHandler settings(ec->settingsFile, true, true);
1290 settings.addSettings(viewParent->getView());
1291 viewParent->getView()->addDecals(settings.getDecals());
1292 settings.applyViewport(viewParent->getView());
1293 settings.setSnapshots(viewParent->getView());
1294 }
1295 // set network name on the caption
1296 setTitle(MFXUtils::getTitleText(myTitlePrefix, ec->file.c_str()));
1297 // force supermode network
1298 if (myViewNet) {
1300 }
1301 if (myViewNet && ec->viewportFromRegistry) {
1302 Position off;
1303 off.set(getApp()->reg().readRealEntry("viewport", "x"), getApp()->reg().readRealEntry("viewport", "y"), getApp()->reg().readRealEntry("viewport", "z"));
1304 Position p(off.x(), off.y(), 0);
1305 myViewNet->setViewportFromToRot(off, p, 0);
1306 }
1307 }
1309 // load elements
1314 // load selection
1315 if (!OptionsCont::getOptions().isDefault("selection-file")) {
1317 }
1318 // after loading net shouldn't be saved
1319 if (myNet) {
1321 }
1322 // update app
1323 update();
1324 // restore focus
1325 setFocus();
1326}
1327
1328
1329void
1334
1335// ---------------------------------------------------------------------------
1336// private methods
1337// ---------------------------------------------------------------------------
1338
1339void
1341 // build file menu
1342 myFileMenu = new FXMenuPane(this, LAYOUT_FIX_HEIGHT);
1344 myFileMenuNeteditConfig = new FXMenuPane(this);
1345 myFileMenuSumoConfig = new FXMenuPane(this);
1346 myFileMenuTLS = new FXMenuPane(this);
1347 myFileMenuEdgeTypes = new FXMenuPane(this);
1348 myFileMenuAdditionals = new FXMenuPane(this);
1349 myFileMenuDemandElements = new FXMenuPane(this);
1350 myFileMenuDataElements = new FXMenuPane(this);
1351 myFileMenuMeanDataElements = new FXMenuPane(this);
1352 myFileMenuRecentNetworks = new FXMenuPane(this);
1353 myFileMenuRecentConfigs = new FXMenuPane(this);
1357 // add separator for recent files
1358 new FXMenuSeparator(myFileMenu);
1359 // build recent files
1362 new FXMenuSeparator(myFileMenu);
1364 TL("&Quit"), "Ctrl+Q", TL("Quit the Application."),
1365 nullptr, this, MID_HOTKEY_CTRL_Q_CLOSE);
1366 // build modes menu
1367 myModesMenu = new FXMenuPane(this);
1369 myModesMenuTitle->setTarget(this);
1371 // build Supermode commands and hide it
1373 // add separator
1374 new FXSeparator(myModesMenu);
1375 // build modes menu commands
1377 // build edit menu
1378 myEditMenu = new FXMenuPane(this);
1380 // build edit menu commands
1382 // build separator
1383 new FXMenuSeparator(myEditMenu);
1384 // build view options
1388 // hide view options
1392 // build view menu commands
1394 // build separator
1395 new FXMenuSeparator(myEditMenu);
1396 // build front element menu commands
1398 // build separator
1399 new FXMenuSeparator(myEditMenu);
1400 // build open in sumo menu commands
1402 // build lock menu
1403 myLockMenu = new FXMenuPane(this);
1405 myLockMenuTitle->setTarget(this);
1407 // build lock menu commands
1409 // build processing menu (trigger netbuild computations)
1410 myProcessingMenu = new FXMenuPane(this);
1413 // build locate menu
1414 myLocatorMenu = new FXMenuPane(this);
1417 // build tools menu
1418 myToolsMenu = new FXMenuPane(this);
1419 myToolsDetectorMenu = new FXMenuPane(this);
1420 myToolsDistrictMenu = new FXMenuPane(this);
1421 myToolsDRTMenu = new FXMenuPane(this);
1422 myToolsEmissionsMenu = new FXMenuPane(this);
1423 myToolsImportMenu = new FXMenuPane(this);
1424 myToolsImportCityBrainMenu = new FXMenuPane(this);
1425 myToolsImportGTFSMenu = new FXMenuPane(this);
1426 myToolsImportVissim = new FXMenuPane(this);
1427 myToolsImportVisum = new FXMenuPane(this);
1428 myToolsNetMenu = new FXMenuPane(this);
1429 myToolsRouteMenu = new FXMenuPane(this);
1430 myToolsOutputMenu = new FXMenuPane(this);
1431 myToolsShapes = new FXMenuPane(this);
1432 myToolsTLS = new FXMenuPane(this);
1433 myToolsTurnDefs = new FXMenuPane(this);
1434 myToolsVisualizationMenu = new FXMenuPane(this);
1435 myToolsXML = new FXMenuPane(this);
1437 // build tools menu cascasde
1438 new FXMenuCascade(myToolsMenu, TL("Detectors"), GUIIconSubSys::getIcon(GUIIcon::E1), myToolsDetectorMenu);
1439 new FXMenuCascade(myToolsMenu, TL("Districts"), GUIIconSubSys::getIcon(GUIIcon::TAZ), myToolsDistrictMenu);
1441 //new FXMenuCascade(myToolsMenu, TL("Emissions"), GUIIconSubSys::getIcon(GUIIcon::TOOL_EMISSIONS), myToolsEmissionsMenu);
1450 //new FXMenuCascade(myToolsMenu, TL("Shapes"), GUIIconSubSys::getIcon(GUIIcon::MODESHAPE), myToolsShapes);
1451 new FXMenuCascade(myToolsMenu, TL("TLS"), GUIIconSubSys::getIcon(GUIIcon::MODETLS), myToolsTLS);
1455 // add separators between folders
1456 new FXMenuSeparator(myToolsMenu);
1457 new FXMenuSeparator(myToolsImportMenu);
1458 // create map with tool Menu panes and their associated folder
1464 myMenuPaneToolMaps["import/citybrain"] = myToolsImportCityBrainMenu;
1466 myMenuPaneToolMaps["import/vissim"] = myToolsImportVissim;
1467 myMenuPaneToolMaps["import/visum"] = myToolsImportVisum;
1473 myMenuPaneToolMaps["turn-defs"] = myToolsTurnDefs;
1476 // build tools
1478 // build windows menu
1479 myWindowMenu = new FXMenuPane(this);
1482 // build language menu
1484 // build help menu
1485 myHelpMenu = new FXMenuPane(this);
1488}
1489
1490
1491FXGLCanvas*
1493 // netedit uses only a single View, then return nullptr
1494 return nullptr;
1495}
1496
1497
1500 return 0;
1501}
1502
1503
1504double
1506 return 1;
1507}
1508
1509
1514
1515
1520
1521
1526
1527
1532
1533
1534void
1536 if (myViewNet && myViewNet->getNet()) {
1537 // show
1539 // set label depending of recomputing
1541 myRequireRecomputingButton->setText("");
1542 myRequireRecomputingButton->setTipText(TL("Network computed"));
1544 myRequireRecomputingButton->setBackColor(FXRGBA(240, 255, 205, 255));
1545 } else {
1546 myRequireRecomputingButton->setText(TL("Press F5"));
1547 myRequireRecomputingButton->setTipText(TL("Network requires recomputing"));
1549 myRequireRecomputingButton->setBackColor(FXRGBA(253, 255, 206, 255));
1550 }
1551 } else {
1552 // hide
1554 }
1555}
1556
1557
1558void
1560 // first check if net must be deleted
1561 if (myNet != nullptr) {
1562 delete myNet;
1563 myNet = nullptr;
1565 }
1566 // check if view has to be saved
1567 if (myViewNet) {
1569 // clear decals
1570 myViewNet->getDecals().clear();
1571 }
1572 // lock tracker
1573 myTrackerLock.lock();
1574 // remove trackers and other external windows
1575 while (!myGLWindows.empty()) {
1576 delete myGLWindows.front();
1577 }
1578 myViewNet = nullptr;
1579 for (FXMainWindow* const window : myTrackerWindows) {
1580 window->destroy();
1581 delete window;
1582 }
1583 myTrackerWindows.clear();
1584 // reset the caption
1585 setTitle(myTitlePrefix);
1586 // unlock tracker
1587 myTrackerLock.unlock();
1588 // remove coordinate information
1589 myGeoCoordinate->setText(TL("N/A"));
1590 myCartesianCoordinate->setText(TL("N/A"));
1591 myTestCoordinate->setText(TL("N/A"));
1592 myTestFrame->hide();
1594 // Reset textures
1596 // reset fonts
1598}
1599
1600
1601FXCursor*
1603 return getApp()->getDefaultCursor(DEF_ARROW_CURSOR);
1604}
1605
1606
1607void
1609 auto& neteditOptions = OptionsCont::getOptions();
1610 if (neteditOptions.getBool("new")) {
1612 } else {
1613 // set flag
1614 myAmLoading = true;
1615 // set status bar
1616 setStatusBarText(TL("Loading console arguments"));
1617 // load console arguments
1619 // add it into recent networks and configs
1620 if (neteditOptions.getString("net-file").size() > 0) {
1621 myMenuBarFile.myRecentNetworks.appendFile(neteditOptions.getString("net-file").c_str());
1622 }
1623 if (neteditOptions.getString("configuration-file").size() > 0) {
1624 myMenuBarFile.myRecentConfigs.appendFile(neteditOptions.getString("configuration-file").c_str());
1625 }
1626 }
1627}
1628
1629
1630void
1632 auto& neteditOptions = OptionsCont::getOptions();
1633 // save windows size and position
1635 // enable loading flag and disable reloading flag
1636 myAmLoading = true;
1637 // recenter view
1638 gSchemeStorage.saveViewport(0, 0, -1, 0);
1639 // fill (reset) all options
1640 GNELoadThread::fillOptions(neteditOptions);
1641 // set default options defined in GNELoadThread::setDefaultOptions(...)
1642 GNELoadThread::setDefaultOptions(neteditOptions);
1643 // update status bar
1644 setStatusBarText(TL("Creating new network."));
1645 // create new network
1647 // update window
1648 update();
1649}
1650
1651
1652void
1653GNEApplicationWindow::loadNetwork(const std::string& networkFile) {
1654 if (networkFile.empty()) {
1655 WRITE_ERROR(TL("Trying to load an empty network"));
1656 } else {
1657 auto& neteditOptions = OptionsCont::getOptions();
1658 // store size, position and viewport
1660 gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view
1661 // set flag
1662 myAmLoading = true;
1663 // fill (reset) all options
1664 myLoadThread->fillOptions(neteditOptions);
1665 // set default options defined in GNELoadThread::setDefaultOptions(...)
1666 myLoadThread->setDefaultOptions(neteditOptions);
1667 // set file to load
1668 neteditOptions.resetWritable();
1669 neteditOptions.set("net-file", networkFile);
1670 // set status bar
1671 setStatusBarText(TL("Loading network file '") + networkFile + "'");
1672 // load network
1674 // add it into recent nets
1675 myMenuBarFile.myRecentNetworks.appendFile(networkFile.c_str());
1676 }
1677}
1678
1679
1680void
1681GNEApplicationWindow::loadConfiguration(const std::string& configurationFile) {
1682 if (configurationFile.empty()) {
1683 WRITE_ERROR(TL("Trying to load an empty configuration"));
1684 } else {
1685 auto& neteditOptions = OptionsCont::getOptions();
1686 // store size, position and viewport
1688 gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view
1689 // set flag
1690 myAmLoading = true;
1691 // fill (reset) all options
1692 myLoadThread->fillOptions(neteditOptions);
1693 // set default options defined in GNELoadThread::setDefaultOptions(...)
1694 myLoadThread->setDefaultOptions(neteditOptions);
1695 // set file to load
1696 neteditOptions.resetWritable();
1697 neteditOptions.set("configuration-file", configurationFile);
1698 // set status bar
1699 setStatusBarText(TL("Loading configuration file '") + configurationFile + "'");
1700 // load config
1702 // add it into recent configs
1703 myMenuBarFile.myRecentConfigs.appendFile(configurationFile.c_str());
1704 }
1705}
1706
1707
1708void
1709GNEApplicationWindow::loadOSM(const std::string& OSMFile) {
1710 auto& neteditOptions = OptionsCont::getOptions();
1711 // store size, position and viewport
1713 gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view
1714 // set flag
1715 myAmLoading = true;
1716 // fill (reset) all options
1717 myLoadThread->fillOptions(neteditOptions);
1718 // set default options defined in GNELoadThread::setDefaultOptions(...)
1719 myLoadThread->setDefaultOptions(neteditOptions);
1720 // recommended osm options
1721 // https://sumo.dlr.de/wiki/Networks/Import/OpenStreetMap#Recommended_NETCONVERT_Options
1722 neteditOptions.set("osm-files", OSMFile);
1723 neteditOptions.set("geometry.remove", "true");
1724 neteditOptions.set("ramps.guess", "true");
1725 neteditOptions.set("junctions.join", "true");
1726 neteditOptions.set("tls.guess-signals", "true");
1727 neteditOptions.set("tls.discard-simple", "true");
1728 // open wizard dialog
1729 if (GNEOptionsDialog::Options(this, GUIIcon::SUPERMODENETWORK, OptionsCont::getOptions(), myOriginalNeteditOptions, TL("Select Import Options")).first == TRUE) {
1730 NIFrame::checkOptions(neteditOptions); // needed to set projection parameters
1731 // set file to load
1732 neteditOptions.resetWritable();
1733 neteditOptions.set("configuration-file", OSMFile);
1734 // set status bar
1735 setStatusBarText(TL("Loading OSM file '") + OSMFile + "'");
1736 // load config
1738 }
1739}
1740
1741void
1742GNEApplicationWindow::setStatusBarText(const std::string& statusBarText) {
1743 myStatusbar->getStatusLine()->setText(statusBarText.c_str());
1744 myStatusbar->getStatusLine()->setNormalText(statusBarText.c_str());
1745}
1746
1747
1748long
1750 // declare variable to save FXMessageBox outputs.
1751 FXuint answer = 0;
1752 // write warning if netedit is running in testing mode
1753 WRITE_DEBUG("Opening FXMessageBox 'Volatile Recomputing'");
1754 // open question dialog box
1755 answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, TL("Recompute with volatile options"),
1756 TL("Changes produced in the net due a recomputing with volatile options cannot be undone. Continue?"));
1757 if (answer != 1) { //1:yes, 2:no, 4:esc
1758 // write warning if netedit is running in testing mode
1759 if (answer == 2) {
1760 WRITE_DEBUG("Closed FXMessageBox 'Volatile Recomputing' with 'No'");
1761 } else if (answer == 4) {
1762 WRITE_DEBUG("Closed FXMessageBox 'Volatile Recomputing' with 'ESC'");
1763 }
1764 // abort recompute with volatile options
1765 return 0;
1766 } else {
1767 // write warning if netedit is running in testing mode
1768 WRITE_DEBUG("Closed FXMessageBox 'Volatile Recomputing' with 'Yes'");
1769 // save all elements
1770 onCmdSaveAdditionals(nullptr, 0, nullptr);
1771 onCmdSaveDemandElements(nullptr, 0, nullptr);
1772 onCmdSaveDataElements(nullptr, 0, nullptr);
1773 onCmdSaveMeanDatas(nullptr, 0, nullptr);
1774 // compute with volatile options
1775 myNet->computeNetwork(this, true, true);
1777 return 1;
1778 }
1779}
1780
1781
1782bool
1785 myConsoleOptionsLoaded = false;
1786 return true;
1787 } else {
1788 return false;
1789 }
1790}
1791
1792
1793long
1794GNEApplicationWindow::onCmdSetSuperMode(FXObject* sender, FXSelector sel, void* ptr) {
1795 // check that currently there is a View
1796 if (myViewNet) {
1797 myViewNet->onCmdSetSupermode(sender, sel, ptr);
1798 }
1799 return 1;
1800}
1801
1802
1803long
1804GNEApplicationWindow::onCmdSetMode(FXObject* sender, FXSelector sel, void* ptr) {
1805 // check that currently there is a View
1806 if (myViewNet) {
1807 myViewNet->onCmdSetMode(sender, sel, ptr);
1808 }
1809 return 1;
1810}
1811
1812
1813long
1814GNEApplicationWindow::onCmdLockElements(FXObject*, FXSelector, void*) {
1815 if (myViewNet) {
1817 }
1818 return 1;
1819}
1820
1821
1822long
1823GNEApplicationWindow::onCmdLockAllElements(FXObject*, FXSelector, void*) {
1824 // lock all
1827 return 1;
1828}
1829
1830
1831long
1833 // unlock all
1836 return 1;
1837}
1838
1839
1840long
1842 if (myViewNet) {
1843 myViewNet->update();
1844 }
1845 return 1;
1846}
1847
1848
1849long
1850GNEApplicationWindow::onUpdLockMenuTitle(FXObject*, FXSelector, void*) {
1851 if (myViewNet) {
1853 // supermode network
1859 myLockMenuTitle->enable();
1860 } else {
1861 myLockMenuTitle->disable();
1862 }
1864 // supermode demand
1869 myLockMenuTitle->enable();
1870 } else {
1871 myLockMenuTitle->disable();
1872 }
1874 // supermode data
1878 myLockMenuTitle->enable();
1879 } else {
1880 myLockMenuTitle->disable();
1881 }
1882 } else {
1883 myLockMenuTitle->disable();
1884 }
1885 } else {
1886 myLockMenuTitle->disable();
1887 }
1888 return 1;
1889}
1890
1891long
1892GNEApplicationWindow::onCmdProcessButton(FXObject*, FXSelector sel, void*) {
1893 // first check if there is a view
1894 if (myViewNet) {
1895 // process depending of supermode
1897 // check what FXMenuCommand was called
1898 switch (FXSELID(sel)) {
1900 // show extra information for tests
1901 WRITE_DEBUG("Key F5 (Compute) pressed");
1902 myNet->computeNetwork(this, true, false);
1904 break;
1906 // show extra information for tests
1907 WRITE_DEBUG("Keys Shift + F5 (Compute with volatile options) pressed");
1909 break;
1911 // show extra information for tests
1912 WRITE_DEBUG("Key F6 (Clean junction) pressed");
1914 break;
1916 // show extra information for tests
1917 WRITE_DEBUG("Key F7 (Join junctions) pressed");
1919 break;
1921 // show extra information for tests
1922 WRITE_DEBUG("Key F8 (Clean invalid crossings) pressed");
1924 break;
1925 default:
1926 break;
1927 }
1929 // check what FXMenuCommand was called
1930 switch (FXSELID(sel)) {
1932 // show extra information for tests
1933 WRITE_DEBUG("Key F5 (Compute) pressed");
1936 break;
1938 // show extra information for tests
1939 WRITE_DEBUG("Key F6 (RemoveUnusedRoutes) pressed");
1941 break;
1943 // show extra information for tests
1944 WRITE_DEBUG("Key F7 (JoinRoutes) pressed");
1946 break;
1948 // show extra information for tests
1949 WRITE_DEBUG("Key F7 (AdjustPersonPlans) pressed");
1951 break;
1953 // show extra information for tests
1954 WRITE_DEBUG("Key F8 (CleanInvalidDemandElements) pressed");
1956 break;
1957 default:
1958 break;
1959 }
1960 }
1961 }
1962 // refresh to update undo-redo button
1963 myViewNet->getViewParent()->getGNEAppWindows()->forceRefresh();
1964 return 1;
1965}
1966
1967
1968long
1969GNEApplicationWindow::onCmdNewWindow(FXObject*, FXSelector sel, void* /*ptr*/) {
1970 // get extra arguments
1971 std::string extraArg;
1973 extraArg = " -s " + myNetgenerateOptions.getValueString("output-file");
1974 }
1975 FXRegistry reg("SUMO netedit", "netedit");
1976 std::string netedit = "netedit";
1977 const char* sumoPath = getenv("SUMO_HOME");
1978 if (sumoPath != nullptr) {
1979#ifdef DEBUG
1980 std::string newPath = std::string(sumoPath) + "/bin/neteditD";
1981#else
1982 std::string newPath = std::string(sumoPath) + "/bin/netedit";
1983#endif
1984 if (FileHelpers::isReadable(newPath) || FileHelpers::isReadable(newPath + ".exe")) {
1985 netedit = "\"" + newPath + "\"";
1986 }
1987 }
1988 std::string cmd = netedit + extraArg;
1989 // start in background
1990#ifndef WIN32
1991 cmd = cmd + " &";
1992#else
1993 // see "help start" for the parameters
1994 cmd = "start /B \"\" " + cmd;
1995#endif
1996 WRITE_MESSAGE(TL("Running ") + cmd + ".");
1997 // yay! fun with dangerous commands... Never use this over the internet
1999 return 1;
2000}
2001
2002
2003long
2004GNEApplicationWindow::onCmdOpenSUMOGUI(FXObject* obj, FXSelector sel, void* ptr) {
2005 // get option container
2006 auto& neteditOptions = OptionsCont::getOptions();
2007 // input parameters
2008 std::string inputParameters;
2009 // if we have only a network, then load directly without creating a SumoConfig
2011 ((myEditMenuCommands.loadAdditionalsInSUMOGUI->getCheck() == FALSE) && (myEditMenuCommands.loadDemandInSUMOGUI->getCheck() == FALSE))) {
2012 // force save network
2013 if (onCmdSaveNetwork(obj, sel, ptr) == 0) {
2014 // network wasn't saved, then stop
2015 return 0;
2016 }
2017 inputParameters = " --registry-viewport -n \"" + neteditOptions.getString("net-file") + "\"";
2018 // write info
2019 WRITE_MESSAGE(TL("Loading network '") + neteditOptions.getString("net-file") + TL("' in SUMO-GUI"));
2020 } else {
2021 // force save SumoConfig
2022 if (onCmdSaveSumoConfig(obj, sel, ptr) == 0) {
2023 // SumoConfig wasn't saved, then stop
2024 return 0;
2025 }
2026 inputParameters = " --registry-viewport -c \"" + neteditOptions.getString("sumocfg-file") + "\"";
2027 // write info
2028 WRITE_MESSAGE(TL("Loading sumo config '") + neteditOptions.getString("sumocfg-file") + TL("' in SUMO-GUI"));
2029 }
2030 // save current viewport in registry
2031 FXRegistry reg("SUMO GUI", "sumo-gui");
2032 reg.read();
2033 reg.writeRealEntry("viewport", "x", myViewNet->getChanger().getXPos());
2034 reg.writeRealEntry("viewport", "y", myViewNet->getChanger().getYPos());
2035 reg.writeRealEntry("viewport", "z", myViewNet->getChanger().getZPos());
2036 reg.write();
2037 // declare executable
2038 std::string sumoGuiExecutable = "sumo-gui";
2039 // if SUMO_HOME is defined, update executable
2040 const char* sumoHome = getenv("SUMO_HOME");
2041 if (sumoHome != nullptr) {
2042 std::string newPath = std::string(sumoHome) + "/bin/sumo-gui";
2043 if (FileHelpers::isReadable(newPath) || FileHelpers::isReadable(newPath + ".exe")) {
2044 sumoGuiExecutable = "\"" + newPath + "\"";
2045 }
2046 }
2047 // declare command
2048 std::string cmd = sumoGuiExecutable + inputParameters;
2049 // start in background
2050#ifndef WIN32
2051 cmd = cmd + " &";
2052#else
2053 // see "help start" for the parameters
2054 cmd = "start /B \"\" " + cmd;
2055#endif
2056 WRITE_MESSAGE(TL("Running ") + cmd + ".");
2057 // yay! fun with dangerous commands... Never use this over the internet
2059 return 1;
2060}
2061
2062
2063long
2064GNEApplicationWindow::onCmdAbort(FXObject*, FXSelector, void*) {
2065 // check that view exists
2066 if (myViewNet) {
2067 // show extra information for tests
2068 WRITE_DEBUG("Key ESC (abort) pressed");
2069 // first check if we're selecting a subset of edges in TAZ Frame
2071 // show extra information for tests
2072 WRITE_DEBUG("Cleaning current selected edges");
2073 // clear current selection
2075 } else if (myViewNet->getViewParent()->getInspectorFrame()->shown()) {
2076 // check if stop select parent
2078 // show extra information for tests
2079 WRITE_DEBUG("Stop select new parent");
2080 // and stop select paretn
2082 } else {
2083 // show extra information for tests
2084 WRITE_DEBUG("Cleaning inspected elements");
2085 // clear inspected elements
2087 }
2088 } else {
2089 // abort current operation
2091 }
2092 }
2093 return 1;
2094}
2095
2096
2097long
2098GNEApplicationWindow::onCmdDel(FXObject*, FXSelector, void*) {
2099 // check that view exists
2100 if (myViewNet) {
2101 // show extra information for tests
2102 WRITE_DEBUG("Key DEL (delete) pressed");
2104 }
2105 return 1;
2106}
2107
2108
2109long
2110GNEApplicationWindow::onCmdEnter(FXObject*, FXSelector, void*) {
2111 // check that view exists
2112 if (myViewNet) {
2113 // show extra information for tests
2114 WRITE_DEBUG("Key ENTER pressed");
2116 }
2117 return 1;
2118}
2119
2120
2121long
2122GNEApplicationWindow::onCmdBackspace(FXObject*, FXSelector, void*) {
2123 // check that view exists
2124 if (myViewNet) {
2125 // show extra information for tests
2126 WRITE_DEBUG("Key BACKSPACE pressed");
2128 }
2129 return 1;
2130}
2131
2132
2133long
2134GNEApplicationWindow::onCmdFocusFrame(FXObject*, FXSelector, void*) {
2135 // check that view exists
2136 if (myViewNet) {
2138 }
2139 return 1;
2140}
2141
2142
2143long
2145 // check that view exists
2146 if (myViewNet) {
2148 }
2149 return 1;
2150}
2151
2152
2153long
2154GNEApplicationWindow::onCmdToggleTimeFormat(FXObject*, FXSelector, void*) {
2155 // check that view exists
2156 if (myViewNet) {
2158 // refresh flow frames
2159 if (myViewNet->getViewParent()->getVehicleFrame()->shown()) {
2161 }
2162 if (myViewNet->getViewParent()->getPersonFrame()->shown()) {
2164 }
2165 if (myViewNet->getViewParent()->getContainerFrame()->shown()) {
2167 }
2168 // refresh inspector frame
2169 if (myViewNet->getViewParent()->getInspectorFrame()->shown()) {
2171 }
2172 }
2173 return 1;
2174}
2175
2176
2177long
2178GNEApplicationWindow::onUpdToggleTimeFormat(FXObject*, FXSelector, void*) {
2179 // check that view exists
2180 if (myViewNet) {
2182 }
2183 return 1;
2184}
2185
2186long
2187GNEApplicationWindow::onUpdRequireViewNet(FXObject* sender, FXSelector, void*) {
2188 // enable or disable sender element depending of viewNet
2189 return sender->handle(this, myViewNet ? FXSEL(SEL_COMMAND, ID_ENABLE) : FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2190}
2191
2192
2193long
2196 return 1;
2197}
2198
2199
2200long
2204
2205
2206long
2207GNEApplicationWindow::onCmdPostprocessingNetgenerate(FXObject* obj, FXSelector, void* ptr) {
2209}
2210
2211
2212long
2213GNEApplicationWindow::onCmdEditViewport(FXObject*, FXSelector, void*) {
2214 // check that view exists
2215 if (myViewNet) {
2217 }
2218 return 1;
2219}
2220
2221
2222long
2223GNEApplicationWindow::onCmdEditViewScheme(FXObject*, FXSelector, void*) {
2224 // check that view exists
2225 if (myViewNet) {
2227 }
2228 return 1;
2229}
2230
2231
2232long
2233GNEApplicationWindow::onCmdToggleGrid(FXObject* sender, FXSelector sel, void* ptr) {
2234 // check that view exists
2235 if (myViewNet) {
2236 // show debug info
2238 // show extra information for tests
2239 WRITE_DEBUG("Disabled grid through Ctrl+g hotkey");
2240 } else {
2241 // show extra information for tests
2242 WRITE_DEBUG("Enabled grid through Ctrl+g hotkey");
2243 }
2244 // Call manually toggle grid function
2245 myViewNet->onCmdToggleShowGrid(sender, sel, ptr);
2246 }
2247 return 1;
2248}
2249
2250
2251long
2252GNEApplicationWindow::onCmdToggleDrawJunctionShape(FXObject* sender, FXSelector sel, void* ptr) {
2253 // check that view exists
2254 if (myViewNet) {
2255 // show debug info
2257 // show extra information for tests
2258 WRITE_DEBUG("Disabled draw junction shape through Ctrl+j hotkey");
2259 } else {
2260 // show extra information for tests
2261 WRITE_DEBUG("Enabled draw junction shape through Ctrl+j hotkey");
2262 }
2263 // Call manually toggle junction shape function
2264 myViewNet->onCmdToggleDrawJunctionShape(sender, sel, ptr);
2265 }
2266 return 1;
2267}
2268
2269
2270long
2271GNEApplicationWindow::onCmdSetFrontElement(FXObject*, FXSelector, void*) {
2272 if (myViewNet) {
2273 // get first inspected AC
2274 auto inspectedAC = myViewNet->getInspectedElements().getFirstAC();
2275 if (inspectedAC) {
2276 // set or clear front attribute
2277 if (inspectedAC->isMarkedForDrawingFront()) {
2278 inspectedAC->unmarkForDrawingFront();
2279 } else {
2280 inspectedAC->markForDrawingFront();
2281 }
2282 } else {
2284 }
2285 myViewNet->update();
2286 }
2287 return 1;
2288}
2289
2290
2291long
2292GNEApplicationWindow::onCmdToggleEditOptions(FXObject* sender, FXSelector sel, void* /* ptr */) {
2293 // first check that we have a ViewNet
2294 if (myViewNet) {
2295 // first check what selector was called
2296 int numericalKeyPressed = sel - FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_0_TOGGLEEDITOPTION) - 1;
2297 // check that numericalKeyPressed is valid
2298 if ((numericalKeyPressed < 0) || (numericalKeyPressed > 10)) {
2299 return 1;
2300 }
2301 // declare a vector in which save visible menu commands
2302 std::vector<MFXCheckableButton*> visibleMenuCommands;
2303 // get common, network and demand visible menu commands
2307 // now check that numericalKeyPressed isn't greater than visible view options
2308 if (numericalKeyPressed >= (int)visibleMenuCommands.size()) {
2309 return 1;
2310 }
2311 // toggle edit options
2313 visibleMenuCommands.at(numericalKeyPressed), numericalKeyPressed, sender, sel)) {
2314 return 1;
2316 visibleMenuCommands.at(numericalKeyPressed), numericalKeyPressed, sender, sel)) {
2317 return 1;
2319 visibleMenuCommands.at(numericalKeyPressed), numericalKeyPressed, sender, sel)) {
2320 return 1;
2321 }
2322 }
2323 return 1;
2324}
2325
2326
2327long
2328GNEApplicationWindow::onCmdHelp(FXObject*, FXSelector, void*) {
2329 MFXLinkLabel::fxexecute("https://sumo.dlr.de/docs/netedit.html");
2330 return 1;
2331}
2332
2333
2334long
2335GNEApplicationWindow::onCmdChangelog(FXObject*, FXSelector, void*) {
2336 // update in every version
2337 MFXLinkLabel::fxexecute("https://sumo.dlr.de/docs/ChangeLog.html");
2338 return 1;
2339}
2340
2341
2342long
2343GNEApplicationWindow::onCmdHotkeys(FXObject*, FXSelector, void*) {
2344 MFXLinkLabel::fxexecute("https://sumo.dlr.de/docs/Netedit/shortcuts.html");
2345 return 1;
2346}
2347
2348
2349long
2352 return getApp()->reg().writeBoolEntry("NETEDIT", "RecomputeData", true);
2353 } else {
2354 return getApp()->reg().writeBoolEntry("NETEDIT", "RecomputeData", false);
2355 }
2356}
2357
2358
2359long
2360GNEApplicationWindow::onCmdToggleUndoRedo(FXObject*, FXSelector, void*) {
2362 myAllowUndoRedo = true;
2363 return getApp()->reg().writeBoolEntry("NETEDIT", "AllowUndoRedo", true);
2364 } else {
2365 myAllowUndoRedo = false;
2366 // drop undo-redo list after changing flag
2367 myUndoList->clear();
2368 return getApp()->reg().writeBoolEntry("NETEDIT", "AllowUndoRedo", false);
2369 }
2370}
2371
2372
2373long
2377 return getApp()->reg().writeBoolEntry("NETEDIT", "AllowUndoRedoLoading", true);
2378 } else {
2379 myAllowUndoRedoLoading = false;
2380 return getApp()->reg().writeBoolEntry("NETEDIT", "AllowUndoRedoLoading", false);
2381 }
2382}
2383
2384
2385long
2386GNEApplicationWindow::onCmdTutorial(FXObject*, FXSelector, void*) {
2387 MFXLinkLabel::fxexecute("https://sumo.dlr.de/docs/Tutorials/index.html");
2388 return 1;
2389}
2390
2391
2392long
2393GNEApplicationWindow::onCmdFeedback(FXObject*, FXSelector, void*) {
2394 // write warning if netedit is running in testing mode
2395 WRITE_DEBUG("Opening feedback dialog");
2396 // create and open feedback dialog
2397 GUIDialog_Feedback* feedback = new GUIDialog_Feedback(this);
2398 feedback->create();
2399 feedback->show(PLACEMENT_OWNER);
2400 // write warning if netedit is running in testing mode
2401 WRITE_DEBUG("Closed feedback dialog");
2402 return 1;
2403}
2404
2405
2406long
2408 auto& neteditOptions = OptionsCont::getOptions();
2409 const auto dialog = GNEOptionsDialog::Options(this, GUIIcon::OPTIONS, neteditOptions, myOriginalNeteditOptions, TL("Netedit options"));
2410 if (dialog.first == TRUE) {
2411 NIFrame::checkOptions(neteditOptions); // needed to set projection parameters
2412 NBFrame::checkOptions(neteditOptions);
2413 NWFrame::checkOptions(neteditOptions);
2414 SystemFrame::checkOptions(neteditOptions); // needed to set precision
2415 // check if mar netedit config as unsaved
2416 if (dialog.second && myNet) {
2418 }
2419 }
2420 return 1;
2421}
2422
2423
2424long
2426 const auto dialog = GNEOptionsDialog::Options(this, GUIIcon::SUMO_MINI, mySumoOptions, myOriginalSumoOptions, TL("Sumo options"));
2427 // check if mark sumoConfig as unsaved
2428 if ((dialog.first == TRUE) && dialog.second && myNet) {
2430 }
2431 return 1;
2432}
2433
2434
2435long
2439
2440
2441long
2445
2446
2447long
2448GNEApplicationWindow::onCmdUndo(FXObject*, FXSelector, void*) {
2449 WRITE_DEBUG("Keys Ctrl+Z (Undo) pressed");
2450 // Check conditions
2451 if (myViewNet == nullptr) {
2452 return 0;
2453 } else if (!myEditMenuCommands.undoLastChange->isEnabled()) {
2454 return 0;
2455 } else {
2456 // check supermode (currently ignore supermode data)
2459 // abort if user doesn't press "yes"
2461 return 0;
2462 }
2463 }
2465 // update current show frame after undo
2468 }
2469 // update manually undo/redo menu commands (see #6005)
2472 // update toolbar undo-redo buttons
2474 return 1;
2475 }
2476}
2477
2478
2479long
2480GNEApplicationWindow::onCmdRedo(FXObject*, FXSelector, void*) {
2481 WRITE_DEBUG("Keys Ctrl+Y (Redo) pressed");
2482 // Check conditions
2483 if (myViewNet == nullptr) {
2484 return 0;
2485 } else if (!myEditMenuCommands.redoLastChange->isEnabled()) {
2486 return 0;
2487 } else {
2488 // check supermode (currently ignore supermode data)
2491 // abort if user doesn't press "yes"
2493 return 0;
2494 }
2495 }
2497 // update current show frame after redo
2500 }
2501 // update manually undo/redo menu commands (see #6005)
2504 // update toolbar undo-redo buttons
2506 return 1;
2507 }
2508}
2509
2510
2511long
2513 // avoid open two dialogs
2514 if (myUndoListDialog->shown()) {
2516 } else {
2518 }
2519 return 1;
2520}
2521
2522
2523long
2524GNEApplicationWindow::onUpdOpenUndoListDialog(FXObject* sender, FXSelector, void*) {
2525 // check if net exist and there is something to undo/redo
2526 if (myNet && (myEditMenuCommands.undoLastChange->isEnabled() || myEditMenuCommands.redoLastChange->isEnabled())) {
2527 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2528 } else {
2529 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2530 if (myUndoListDialog->shown()) {
2532 }
2533 }
2534 return 1;
2535}
2536
2537
2538long
2540 // first check viewNet
2542 // update demand path calculator
2544 }
2545 return 1;
2546}
2547
2548
2549long
2550GNEApplicationWindow::onCmdCut(FXObject*, FXSelector, void*) {
2551 WRITE_DEBUG("Key Ctrl+X (Cut) pressed");
2552 // Prepared for #6042
2553 return 1;
2554}
2555
2556
2557long
2558GNEApplicationWindow::onCmdCopy(FXObject*, FXSelector, void*) {
2559 WRITE_DEBUG("Key Ctrl+C (Copy) pressed");
2560 // Prepared for #6042
2561 return 1;
2562}
2563
2564
2565long
2566GNEApplicationWindow::onCmdPaste(FXObject*, FXSelector, void*) {
2567 WRITE_DEBUG("Key Ctrl+V (Paste) pressed");
2568 // Prepared for #6042
2569 return 1;
2570}
2571
2572
2573long
2574GNEApplicationWindow::onCmdSetTemplate(FXObject*, FXSelector, void*) {
2575 WRITE_DEBUG("Key Ctrl+F1 (Set Template) pressed");
2576 // first check if myViewNet exist
2577 if (myViewNet) {
2578 // call set template in inspector frame
2580 }
2581 return 1;
2582}
2583
2584
2585long
2586GNEApplicationWindow::onCmdCopyTemplate(FXObject*, FXSelector, void*) {
2587 WRITE_DEBUG("Key Ctrl+F2 (Copy Template) pressed");
2588 // first check if myViewNet exist
2589 if (myViewNet) {
2590 // call copy template in inspector frame
2592 }
2593 return 1;
2594}
2595
2596
2597long
2598GNEApplicationWindow::onCmdClearTemplate(FXObject*, FXSelector, void*) {
2599 WRITE_DEBUG("Key Ctrl+F3 (Clear Template) pressed");
2600 // first check if myViewNet exist
2601 if (myViewNet) {
2602 // call clear template in inspector frame
2604 }
2605 return 1;
2606}
2607
2608
2609long
2610GNEApplicationWindow::onUpdNeedsNetwork(FXObject* sender, FXSelector, void*) {
2611 // check if net exist
2612 if (myNet) {
2614 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2615 } else {
2617 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2618 }
2619}
2620
2621
2622long
2623GNEApplicationWindow::onUpdNeedsNetworkElement(FXObject* sender, FXSelector, void*) {
2624 // check if at least there is one edge in the network
2625 if (myNet && (myNet->getAttributeCarriers()->getEdges().size() > 0)) {
2626 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2627 } else {
2628 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2629 }
2630}
2631
2632
2633long
2634GNEApplicationWindow::onUpdNeedsFrontElement(FXObject* sender, FXSelector, void*) {
2635 // check if net, viewnet and front attribute exist
2636 if (myViewNet && (myViewNet->getMarkFrontElements().getACs().size() > 0)) {
2637 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2638 } else {
2639 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2640 }
2641}
2642
2643
2644long
2645GNEApplicationWindow::onUpdSaveNetwork(FXObject* sender, FXSelector, void*) {
2646 if (myNet == nullptr) {
2647 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2648 } else if (myNet->getSavingStatus()->isNetworkSaved()) {
2649 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2650 } else {
2651 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2652 }
2653}
2654
2655
2656long
2657GNEApplicationWindow::onUpdSaveAdditionals(FXObject* sender, FXSelector, void*) {
2658 if (myNet == nullptr) {
2659 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2661 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2662 } else {
2663 return sender->handle(this, myNet->getSavingStatus()->isAdditionalsSaved() ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2664 }
2665}
2666
2667
2668long
2669GNEApplicationWindow::onUpdSaveAdditionalsAs(FXObject* sender, FXSelector, void*) {
2670 if (myNet == nullptr) {
2671 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2672 } else if (myNet->getAttributeCarriers()->getNumberOfAdditionals() == 0) {
2673 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2674 } else {
2675 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2676 }
2677}
2678
2679
2680long
2681GNEApplicationWindow::onUpdSaveJuPedSimElementsAs(FXObject* sender, FXSelector, void*) {
2682 if (myNet == nullptr) {
2683 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2684 } else if (myNet->getAttributeCarriers()->getAdditionals().at(GNE_TAG_JPS_WALKABLEAREA).size() > 0) {
2685 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2686 } else if (myNet->getAttributeCarriers()->getAdditionals().at(GNE_TAG_JPS_OBSTACLE).size() > 0) {
2687 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2688 } else {
2689 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2690 }
2691}
2692
2693
2694long
2695GNEApplicationWindow::onUpdSaveDemandElements(FXObject* sender, FXSelector, void*) {
2696 if (myNet == nullptr) {
2697 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2698 } else if (myNet->getSavingStatus()->isDemandElementsSaved()) {
2699 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2700 } else {
2701 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2702 }
2703
2704}
2705
2706
2707long
2708GNEApplicationWindow::onUpdSaveDemandElementsAs(FXObject* sender, FXSelector, void*) {
2709 if (myNet == nullptr) {
2710 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2712 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2713 } else {
2714 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2715 }
2716}
2717
2718
2719long
2720GNEApplicationWindow::onUpdSaveDataElements(FXObject* sender, FXSelector, void*) {
2721 if (myNet == nullptr) {
2722 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2723 } else if (myNet->getSavingStatus()->isDataElementsSaved()) {
2724 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2725 } else {
2726 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2727 }
2728
2729}
2730
2731
2732long
2733GNEApplicationWindow::onUpdSaveDataElementsAs(FXObject* sender, FXSelector, void*) {
2734 if (myNet == nullptr) {
2735 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2736 } else if (myNet->getAttributeCarriers()->getDataSets().size() == 0) {
2737 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2738 } else {
2739 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2740 }
2741
2742}
2743
2744
2745long
2746GNEApplicationWindow::onUpdSaveMeanDatas(FXObject* sender, FXSelector, void*) {
2747 if (myNet == nullptr) {
2748 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2749 } else if (myNet->getSavingStatus()->isMeanDatasSaved()) {
2750 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2751 } else {
2752 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2753 }
2754}
2755
2756
2757long
2758GNEApplicationWindow::onUpdSaveMeanDatasAs(FXObject* sender, FXSelector, void*) {
2759 if (myNet == nullptr) {
2760 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2761 } else if (myNet->getAttributeCarriers()->getNumberOfMeanDatas() == 0) {
2762 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2763 } else {
2764 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2765 }
2766
2767}
2768
2769
2770long
2771GNEApplicationWindow::onUpdUndo(FXObject* sender, FXSelector sel, void* ptr) {
2772 return myUndoList->onUpdUndo(sender, sel, ptr);
2773}
2774
2775
2776long
2777GNEApplicationWindow::onUpdRedo(FXObject* sender, FXSelector sel, void* ptr) {
2778 return myUndoList->onUpdRedo(sender, sel, ptr);
2779}
2780
2781
2782long
2783GNEApplicationWindow::onUpdComputePathManager(FXObject* sender, FXSelector /*sel*/, void* /*ptr*/) {
2784 // first check viewNet
2785 if (myViewNet) {
2786 // check supermode network
2788 // disable
2789 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2791 // disable
2792 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2793 } else {
2794 // enable
2795 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2796 }
2797 } else {
2798 // disable
2799 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2800 }
2801}
2802
2803
2804long
2805GNEApplicationWindow::onCmdToggleViewOption(FXObject* sender, FXSelector sel, void* ptr) {
2806 // check viewNet
2807 if (myViewNet) {
2808 // continue depending of selector
2809 switch (FXSELID(sel)) {
2810 // Network
2812 return myViewNet->onCmdToggleShowGrid(sender, sel, ptr);
2814 return myViewNet->onCmdToggleDrawJunctionShape(sender, sel, ptr);
2816 return myViewNet->onCmdToggleDrawSpreadVehicles(sender, sel, ptr);
2818 return myViewNet->onCmdToggleShowDemandElementsNetwork(sender, sel, ptr);
2820 return myViewNet->onCmdToggleSelectEdges(sender, sel, ptr);
2822 return myViewNet->onCmdToggleShowConnections(sender, sel, ptr);
2824 return myViewNet->onCmdToggleHideConnections(sender, sel, ptr);
2826 return myViewNet->onCmdToggleShowAdditionalSubElements(sender, sel, ptr);
2828 return myViewNet->onCmdToggleShowTAZElements(sender, sel, ptr);
2830 return myViewNet->onCmdToggleExtendSelection(sender, sel, ptr);
2832 return myViewNet->onCmdToggleChangeAllPhases(sender, sel, ptr);
2834 return myViewNet->onCmdToggleWarnAboutMerge(sender, sel, ptr);
2836 return myViewNet->onCmdToggleShowJunctionBubbles(sender, sel, ptr);
2838 return myViewNet->onCmdToggleMoveElevation(sender, sel, ptr);
2840 return myViewNet->onCmdToggleChainEdges(sender, sel, ptr);
2842 return myViewNet->onCmdToggleAutoOppositeEdge(sender, sel, ptr);
2843 // Demand
2845 return myViewNet->onCmdToggleShowGrid(sender, sel, ptr);
2847 return myViewNet->onCmdToggleDrawJunctionShape(sender, sel, ptr);
2849 return myViewNet->onCmdToggleDrawSpreadVehicles(sender, sel, ptr);
2851 return myViewNet->onCmdToggleHideNonInspecteDemandElements(sender, sel, ptr);
2853 return myViewNet->onCmdToggleHideShapes(sender, sel, ptr);
2855 return myViewNet->onCmdToggleShowTrips(sender, sel, ptr);
2857 return myViewNet->onCmdToggleShowAllPersonPlans(sender, sel, ptr);
2859 return myViewNet->onCmdToggleLockPerson(sender, sel, ptr);
2861 return myViewNet->onCmdToggleShowAllContainerPlans(sender, sel, ptr);
2863 return myViewNet->onCmdToggleLockContainer(sender, sel, ptr);
2865 return myViewNet->onCmdToggleShowOverlappedRoutes(sender, sel, ptr);
2866 // Data
2868 return myViewNet->onCmdToggleDrawJunctionShape(sender, sel, ptr);
2870 return myViewNet->onCmdToggleShowAdditionals(sender, sel, ptr);
2872 return myViewNet->onCmdToggleShowShapes(sender, sel, ptr);
2874 return myViewNet->onCmdToggleShowDemandElementsData(sender, sel, ptr);
2876 return myViewNet->onCmdToggleTAZRelDrawing(sender, sel, ptr);
2878 return myViewNet->onCmdToggleTAZRelDrawing(sender, sel, ptr);
2880 return myViewNet->onCmdToggleTAZRelOnlyFrom(sender, sel, ptr);
2882 return myViewNet->onCmdToggleTAZRelOnlyTo(sender, sel, ptr);
2883 default:
2884 return 0;
2885 }
2886 } else {
2887 return 0;
2888 }
2889}
2890
2891
2892long
2893GNEApplicationWindow::onUpdToggleViewOption(FXObject* sender, FXSelector sel, void* /*ptr*/) {
2894 // get menuCheck
2895 MFXMenuCheckIcon* menuCheck = dynamic_cast<MFXMenuCheckIcon*>(sender);
2896 // check viewNet
2897 if (myViewNet && menuCheck) {
2898 // continue depending of selector
2899 switch (FXSELID(sel)) {
2900 // Network
2903 menuCheck->setCheck(TRUE);
2904 } else {
2905 menuCheck->setCheck(FALSE);
2906 }
2907 break;
2910 menuCheck->setCheck(TRUE);
2911 } else {
2912 menuCheck->setCheck(FALSE);
2913 }
2914 break;
2917 menuCheck->setCheck(TRUE);
2918 } else {
2919 menuCheck->setCheck(FALSE);
2920 }
2921 break;
2924 menuCheck->setCheck(TRUE);
2925 } else {
2926 menuCheck->setCheck(FALSE);
2927 }
2928 break;
2931 menuCheck->setCheck(TRUE);
2932 } else {
2933 menuCheck->setCheck(FALSE);
2934 }
2935 break;
2938 menuCheck->setCheck(TRUE);
2939 } else {
2940 menuCheck->setCheck(FALSE);
2941 }
2942 break;
2945 menuCheck->setCheck(TRUE);
2946 } else {
2947 menuCheck->setCheck(FALSE);
2948 }
2949 break;
2952 menuCheck->setCheck(TRUE);
2953 } else {
2954 menuCheck->setCheck(FALSE);
2955 }
2956 break;
2959 menuCheck->setCheck(TRUE);
2960 } else {
2961 menuCheck->setCheck(FALSE);
2962 }
2963 break;
2966 menuCheck->setCheck(TRUE);
2967 } else {
2968 menuCheck->setCheck(FALSE);
2969 }
2970 break;
2973 menuCheck->setCheck(TRUE);
2974 } else {
2975 menuCheck->setCheck(FALSE);
2976 }
2977 break;
2980 menuCheck->setCheck(TRUE);
2981 } else {
2982 menuCheck->setCheck(FALSE);
2983 }
2984 break;
2987 menuCheck->setCheck(TRUE);
2988 } else {
2989 menuCheck->setCheck(FALSE);
2990 }
2991 break;
2994 menuCheck->setCheck(TRUE);
2995 } else {
2996 menuCheck->setCheck(FALSE);
2997 }
2998 break;
3001 menuCheck->setCheck(TRUE);
3002 } else {
3003 menuCheck->setCheck(FALSE);
3004 }
3005 break;
3008 menuCheck->setCheck(TRUE);
3009 } else {
3010 menuCheck->setCheck(FALSE);
3011 }
3012 break;
3013 // Demand
3016 menuCheck->setCheck(TRUE);
3017 } else {
3018 menuCheck->setCheck(FALSE);
3019 }
3020 break;
3023 menuCheck->setCheck(TRUE);
3024 } else {
3025 menuCheck->setCheck(FALSE);
3026 }
3027 break;
3030 menuCheck->setCheck(TRUE);
3031 } else {
3032 menuCheck->setCheck(FALSE);
3033 }
3034 break;
3037 menuCheck->setCheck(TRUE);
3038 } else {
3039 menuCheck->setCheck(FALSE);
3040 }
3041 break;
3044 menuCheck->setCheck(TRUE);
3045 } else {
3046 menuCheck->setCheck(FALSE);
3047 }
3048 break;
3051 menuCheck->setCheck(TRUE);
3052 } else {
3053 menuCheck->setCheck(FALSE);
3054 }
3055 break;
3058 menuCheck->setCheck(TRUE);
3059 } else {
3060 menuCheck->setCheck(FALSE);
3061 }
3062 // special case for lock persons
3064 menuCheck->enable();
3065 } else {
3066 menuCheck->disable();
3067 }
3068 break;
3071 menuCheck->setCheck(TRUE);
3072 } else {
3073 menuCheck->setCheck(FALSE);
3074 }
3075 break;
3078 menuCheck->setCheck(TRUE);
3079 } else {
3080 menuCheck->setCheck(FALSE);
3081 }
3082 // special case for lock containers
3084 menuCheck->enable();
3085 } else {
3086 menuCheck->disable();
3087 }
3088 break;
3091 menuCheck->setCheck(TRUE);
3092 } else {
3093 menuCheck->setCheck(FALSE);
3094 }
3095 break;
3098 menuCheck->setCheck(TRUE);
3099 } else {
3100 menuCheck->setCheck(FALSE);
3101 }
3102 break;
3103 // Data
3106 menuCheck->setCheck(TRUE);
3107 } else {
3108 menuCheck->setCheck(FALSE);
3109 }
3110 break;
3113 menuCheck->setCheck(TRUE);
3114 } else {
3115 menuCheck->setCheck(FALSE);
3116 }
3117 break;
3120 menuCheck->setCheck(TRUE);
3121 } else {
3122 menuCheck->setCheck(FALSE);
3123 }
3124 break;
3127 menuCheck->setCheck(TRUE);
3128 } else {
3129 menuCheck->setCheck(FALSE);
3130 }
3131 break;
3134 menuCheck->setCheck(TRUE);
3135 } else {
3136 menuCheck->setCheck(FALSE);
3137 }
3138 break;
3141 menuCheck->setCheck(TRUE);
3142 } else {
3143 menuCheck->setCheck(FALSE);
3144 }
3145 break;
3146
3149 menuCheck->setCheck(TRUE);
3150 } else {
3151 menuCheck->setCheck(FALSE);
3152 }
3153 break;
3156 menuCheck->setCheck(TRUE);
3157 } else {
3158 menuCheck->setCheck(FALSE);
3159 }
3160 break;
3161 default:
3162 break;
3163 }
3164 }
3165 return 0;
3166}
3167
3168
3169long
3170GNEApplicationWindow::onCmdSaveNetwork(FXObject* sender, FXSelector sel, void* ptr) {
3171 auto& neteditOptions = OptionsCont::getOptions();
3172 if (myNet->getSavingStatus()->isNetworkSaved() && !neteditOptions.getBool("force-saving")) {
3173 // nothing to save
3174 return 1;
3175 }
3176 // first check if we have to set the output filename
3177 if ((sel == MID_GNE_AUTOMATICFILENAME) && neteditOptions.getString("net-file").empty()) {
3178 neteditOptions.set("net-file", *(static_cast<std::string*>(ptr)) + ".net.xml");
3179 }
3180 // function onCmdSaveNetworkAs must be executed if this is the first save
3181 if (neteditOptions.getString("net-file").empty()) {
3182 return onCmdSaveNetworkAs(sender, sel, ptr);
3183 } else {
3184 // always recompute before saving
3185 myNet->computeNetwork(this);
3186 // se net file in SUMO options
3188 mySumoOptions.set("net-file", neteditOptions.getString("net-file"));
3189 bool saved = false;
3190 try {
3191 // obtain invalid networkElements (currently only edges or crossings
3192 std::vector<GNENetworkElement*> invalidNetworkElements;
3193 // iterate over crossings and edges
3194 for (const auto& edge : myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
3195 if (!edge.second->isNetworkElementValid()) {
3196 invalidNetworkElements.push_back(edge.second);
3197 }
3198 }
3199 for (const auto& crossing : myViewNet->getNet()->getAttributeCarriers()->getCrossings()) {
3200 if (!crossing.second->isNetworkElementValid()) {
3201 invalidNetworkElements.push_back(crossing.second);
3202 }
3203 }
3204 // if there are invalid network elements, open GNEFixNetworkElements
3205 if (invalidNetworkElements.size() > 0) {
3206 // 0 -> Canceled Saving, with or without selecting invalid network elements
3207 // 1 -> Invalid network elements fixed, friendlyPos enabled, or saved with invalid positions
3208 GNEFixNetworkElements fixNetworkElementsDialog(myViewNet, invalidNetworkElements);
3209 if (fixNetworkElementsDialog.execute() == 0) {
3210 // show debug information
3211 WRITE_DEBUG("network elements saving aborted");
3212 // stop
3213 return 0;
3214 } else {
3215 // Save network
3216 myNet->saveNetwork();
3217 saved = true;
3218 // show debug information
3219 WRITE_DEBUG("network elements saved after dialog");
3220 }
3221 } else {
3222 // Save network
3223 myNet->saveNetwork();
3224 saved = true;
3225 // show debug information
3226 WRITE_DEBUG("network elements saved");
3227 }
3228 } catch (IOError& e) {
3229 // write warning if netedit is running in testing mode
3230 WRITE_DEBUG("Opening FXMessageBox 'error saving network'");
3231 // open error message box
3232 FXMessageBox::error(this, MBOX_OK, TL("Saving Network failed!"), "%s", e.what());
3233 // write warning if netedit is running in testing mode
3234 WRITE_DEBUG("Closed FXMessageBox 'error saving network' with 'OK'");
3235 }
3236 if (saved) {
3237 // write info
3238 WRITE_MESSAGE(TL("Network saved in '") + neteditOptions.getString("net-file") + "'.");
3239 // After saving a net successfully, add it into Recent Nets list.
3240 myMenuBarFile.myRecentNetworks.appendFile(neteditOptions.getString("net-file").c_str());
3242 } else {
3244 WRITE_ERROR(TL("Could not save network in '") + neteditOptions.getString("net-file") + "'");
3245 return 0;
3246 }
3247 return 1;
3248 }
3249}
3250
3251
3252long
3253GNEApplicationWindow::onCmdSaveNetworkAs(FXObject*, FXSelector, void*) {
3254 // get network file file
3255 const auto networkFile = GNEApplicationWindowHelper::openNetworkFileDialog(this, true);
3256 if (!networkFile.empty()) {
3257 // set ouput file in netedit configs
3258 auto& neteditOptions = OptionsCont::getOptions();
3259 neteditOptions.resetWritable();
3260 neteditOptions.set("net-file", networkFile);
3261 // update netedit title with the network name
3262 setTitle(MFXUtils::getTitleText(myTitlePrefix, networkFile.c_str()));
3263 // set focus again in viewNet
3264 myViewNet->setFocus();
3265 // save network
3266 return onCmdSaveNetwork(nullptr, 0, nullptr);
3267 } else {
3268 return 0;
3269 }
3270}
3271
3272
3273long
3274GNEApplicationWindow::onCmdSavePlainXMLAs(FXObject*, FXSelector, void*) {
3275 // get neteditConfig filename
3277 // Remove extension
3278 if (!plainXMLFile.empty()) {
3279 // adjust file
3280 if (plainXMLFile.back() == '.') {
3281 plainXMLFile.pop_back();
3282 } else {
3283 plainXMLFile = StringUtils::replace(plainXMLFile, ".edg.xml", "");
3284 plainXMLFile = StringUtils::replace(plainXMLFile, ".nod.xml", "");
3285 plainXMLFile = StringUtils::replace(plainXMLFile, ".con.xml", "");
3286 plainXMLFile = StringUtils::replace(plainXMLFile, ".typ.xml", "");
3287 plainXMLFile = StringUtils::replace(plainXMLFile, ".tll.xml", "");
3288 plainXMLFile = StringUtils::replace(plainXMLFile, ".xml", "");
3289 }
3290 }
3291 // continue depending of file
3292 if (!plainXMLFile.empty()) {
3293 // start saving plain XML
3294 getApp()->beginWaitCursor();
3295 try {
3296 myNet->savePlain(plainXMLFile);
3297 // write info
3298 WRITE_MESSAGE(TL("Plain XML saved with prefix '") + plainXMLFile + "'");
3299 } catch (IOError& e) {
3300 // write warning if netedit is running in testing mode
3301 WRITE_DEBUG("Opening FXMessageBox 'Error saving plainXML'");
3302 // open message box
3303 FXMessageBox::error(this, MBOX_OK, TL("Saving plain xml failed!"), "%s", e.what());
3304 // write warning if netedit is running in testing mode
3305 WRITE_DEBUG("Closed FXMessageBox 'Error saving plainXML' with 'OK'");
3306 }
3307 // end saving plain XML
3308 getApp()->endWaitCursor();
3309 // set focus again in viewNet
3310 myViewNet->setFocus();
3311 }
3312 return 1;
3313}
3314
3315
3316long
3318 // get neteditConfig filename
3319 const auto joinedJunctionsFile = GNEApplicationWindowHelper::saveJoinedJunctionsFileDialog(this);
3320 // continue depending of file
3321 if (joinedJunctionsFile.size() > 0) {
3322 getApp()->beginWaitCursor();
3323 try {
3324 myNet->saveJoined(joinedJunctionsFile);
3325 // write info
3326 WRITE_MESSAGE(TL("Joined junctions saved to '") + joinedJunctionsFile + "'");
3327 } catch (IOError& e) {
3328 // write warning if netedit is running in testing mode
3329 WRITE_DEBUG("Opening FXMessageBox 'error saving joined'");
3330 // opening error message
3331 FXMessageBox::error(this, MBOX_OK, TL("Saving joined junctions failed!"), "%s", e.what());
3332 // write warning if netedit is running in testing mode
3333 WRITE_DEBUG("Closed FXMessageBox 'error saving joined' with 'OK'");
3334 }
3335 getApp()->endWaitCursor();
3336 // set focus again in viewNet
3337 myViewNet->setFocus();
3338 }
3339 return 1;
3340}
3341
3342
3343long
3345 // obtain netedit option container
3346 auto& neteditOptions = OptionsCont::getOptions();
3347 neteditOptions.resetWritable();
3348 // Check if configuration file was already set at start of netedit or with a previous save
3349 if (neteditOptions.getString("configuration-file").empty()) {
3350 return onCmdSaveNeteditConfigAs(nullptr, 0, nullptr);
3351 } else {
3352 // get config file
3353 const auto neteditConfigFile = neteditOptions.getString("configuration-file");
3354 // get file path
3355 const auto filePath = FileHelpers::getFilePath(neteditConfigFile);
3356 // get patter file
3357 auto patterFile = StringUtils::replace(neteditConfigFile, ".netecfg", "");
3358 // save all elements giving automatic names based on patter if their file isn't defined
3359 if (onCmdSaveNetwork(nullptr, MID_GNE_AUTOMATICFILENAME, &patterFile) != 1) {
3360 WRITE_MESSAGE(TL("Saving of Netedit configuration aborted"));
3361 return 0;
3362 }
3363 if (onCmdSaveAdditionals(nullptr, MID_GNE_AUTOMATICFILENAME, &patterFile) != 1) {
3364 WRITE_MESSAGE(TL("Saving of Netedit configuration aborted"));
3365 return 0;
3366 }
3367 if (onCmdSaveDemandElements(nullptr, MID_GNE_AUTOMATICFILENAME, &patterFile) != 1) {
3368 WRITE_MESSAGE(TL("Saving of Netedit configuration aborted"));
3369 return 0;
3370 }
3371 if (onCmdSaveDataElements(nullptr, MID_GNE_AUTOMATICFILENAME, &patterFile) != 1) {
3372 WRITE_MESSAGE(TL("Saving of Netedit configuration aborted"));
3373 return 0;
3374 }
3375 if (onCmdSaveMeanDatas(nullptr, MID_GNE_AUTOMATICFILENAME, &patterFile) != 1) {
3376 WRITE_MESSAGE(TL("Saving of Netedit configuration aborted"));
3377 return 0;
3378 }
3379 // configuration
3380 std::ofstream out(StringUtils::transcodeToLocal(neteditConfigFile));
3381 if (out.good()) {
3382 // write netedit config
3383 neteditOptions.writeConfiguration(out, true, false, false, filePath, true);
3384 // write info
3385 WRITE_MESSAGE(TL("Netedit configuration saved in '") + neteditConfigFile + "'");
3386 // config saved
3388 // After saving a config successfully, add it into recent configs
3389 myMenuBarFile.myRecentConfigs.appendFile(neteditOptions.getString("configuration-file").c_str());
3390 } else {
3391 WRITE_ERROR(TL("Could not save netedit configuration in '") + neteditConfigFile + "'");
3392 }
3393 out.close();
3394 return 1;
3395 }
3396}
3397
3398
3399long
3400GNEApplicationWindow::onCmdSaveNeteditConfigAs(FXObject* sender, FXSelector sel, void* ptr) {
3401 auto& neteditOptions = OptionsCont::getOptions();
3402 // get neteditConfig filename
3403 const auto neteditConfigFile = GNEApplicationWindowHelper::openNeteditConfigFileDialog(this, true);
3404 // continue depending of file
3405 if (!neteditConfigFile.empty()) {
3406 neteditOptions.resetWritable();
3407 neteditOptions.set("configuration-file", neteditConfigFile);
3408 // continue saving netedit config
3409 return onCmdSaveNeteditConfig(sender, sel, ptr);
3410 } else {
3411 return 0;
3412 }
3413}
3414
3415
3416long
3417GNEApplicationWindow::onUpdSaveNeteditConfig(FXObject* sender, FXSelector, void*) {
3418 // check if enable or disable save netedit config button
3419 if (myNet == nullptr) {
3420 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3421 } else if (OptionsCont::getOptions().getString("configuration-file").empty()) {
3422 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3423 } else if (!myNet->getSavingStatus()->isNeteditConfigSaved()) {
3424 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3425 } else {
3426 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3427 }
3428 // check if enable/disable save individual files
3429 if (myNet) {
3433 } else {
3435 }
3436 }
3437 return 1;
3438}
3439
3440
3441long
3442GNEApplicationWindow::onCmdSaveSumoConfig(FXObject* sender, FXSelector sel, void* ptr) {
3443 // obtain netedit option container
3444 auto& neteditOptions = OptionsCont::getOptions();
3445 // reset containers
3446 neteditOptions.resetWritable();
3448 // Check if configuration file was already set at start of netedit or with a previous save
3449 if (neteditOptions.getString("sumocfg-file").empty()) {
3450 return onCmdSaveSumoConfigAs(sender, sel, ptr);
3451 } else {
3452 // check if ignore additionals and demand elements (only used open SUMO-GUI from netedit)
3453 const FXSelector openSUMO = FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_T_OPENNETEDIT_OPENSUMO);
3454 const bool ignoreAdditionals = (sel == openSUMO) ? (myEditMenuCommands.loadAdditionalsInSUMOGUI->getCheck() == FALSE) : false;
3455 const bool ignoreDemandElements = (sel == openSUMO) ? (myEditMenuCommands.loadDemandInSUMOGUI->getCheck() == FALSE) : false;
3456 // get SumoConfig file
3457 const auto sumoConfigFile = neteditOptions.getString("sumocfg-file");
3458 // get config file without extension
3459 auto patterFile = StringUtils::replace(sumoConfigFile, ".sumocfg", "");
3460 // save all elements giving automatic names based on patter in their file isn't defined
3461 if (onCmdSaveNetwork(nullptr, MID_GNE_AUTOMATICFILENAME, &patterFile) != 1) {
3462 WRITE_MESSAGE(TL("Saving of SUMO configuration aborted"));
3463 return 0;
3464 }
3465 if (onCmdSaveAdditionals(nullptr, MID_GNE_AUTOMATICFILENAME, &patterFile) != 1) {
3466 WRITE_MESSAGE(TL("Saving of SUMO configuration aborted"));
3467 return 0;
3468 }
3469 if (onCmdSaveDemandElements(nullptr, MID_GNE_AUTOMATICFILENAME, &patterFile) != 1) {
3470 WRITE_MESSAGE(TL("Saving of SUMO configuration aborted"));
3471 return 0;
3472 }
3473 if (onCmdSaveDataElements(nullptr, MID_GNE_AUTOMATICFILENAME, &patterFile) != 1) {
3474 WRITE_MESSAGE(TL("Saving of SUMO configuration aborted"));
3475 return 0;
3476 }
3477 if (onCmdSaveMeanDatas(nullptr, MID_GNE_AUTOMATICFILENAME, &patterFile) != 1) {
3478 WRITE_MESSAGE(TL("Saving of SUMO configuration aborted"));
3479 return 0;
3480 }
3481 // set input in sumo options
3482 setInputInSumoOptions(ignoreAdditionals, ignoreDemandElements);
3483 // if we have trips or flow over junctions, add option junction-taz
3486 mySumoOptions.set("junction-taz", "true");
3487 }
3488 std::ofstream out(StringUtils::transcodeToLocal(sumoConfigFile));
3489 if (out.good()) {
3490 // write SUMO config
3491 mySumoOptions.writeConfiguration(out, true, false, false, sumoConfigFile, true);
3492 // write info
3493 WRITE_MESSAGE(TL("SUMO configuration saved in '") + sumoConfigFile + "'");
3494 // if ignoreAdditionals or ignoreDemandElements is enabled, don't mark SumoConfig as saved
3495 if (!ignoreAdditionals && !ignoreDemandElements) {
3497 }
3498 // After saving a config successfully, add it into recent configs
3499 myMenuBarFile.myRecentConfigs.appendFile(neteditOptions.getString("sumocfg-file").c_str());
3500 } else {
3501 WRITE_MESSAGE(TL("Could not save SUMO configuration in '") + sumoConfigFile + "'");
3502 }
3503 out.close();
3504 return 1;
3505 }
3506}
3507
3508
3509long
3510GNEApplicationWindow::onCmdSaveSumoConfigAs(FXObject* sender, FXSelector sel, void* ptr) {
3511 auto& neteditOptions = OptionsCont::getOptions();
3512 // get sumoConfig filename
3513 const auto sumoConfigFile = GNEApplicationWindowHelper::openSumoConfigFileDialog(this, true);
3514 // continue depending of file
3515 if (!sumoConfigFile.empty()) {
3516 // save file in netedit options
3517 neteditOptions.resetWritable();
3518 neteditOptions.set("sumocfg-file", sumoConfigFile);
3519 // continue saving SUMO Config
3520 return onCmdSaveSumoConfig(sender, sel, ptr);
3521 } else {
3522 return 0;
3523 }
3524}
3525
3526
3527long
3528GNEApplicationWindow::onUpdSaveSumoConfig(FXObject* sender, FXSelector, void*) {
3529 if (myNet == nullptr) {
3530 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3531 } else if (OptionsCont::getOptions().getString("sumocfg-file").empty()) {
3532 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3533 } else if (!myNet->getSavingStatus()->isSumoConfigSaved()) {
3534 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3535 } else {
3536 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3537 }
3538}
3539
3540
3541long
3542GNEApplicationWindow::onCmdSaveTLSPrograms(FXObject* obj, FXSelector sel, void* ptr) {
3543 // get option container
3544 auto& neteditOptions = OptionsCont::getOptions();
3545 // Check if TLS Programs file was already set at start of netedit or with a previous save
3546 if (neteditOptions.getString("tls-file").empty()) {
3547 return onCmdSaveTLSProgramsAs(obj, sel, ptr);
3548 } else {
3549 // Start saving TLS Programs
3550 getApp()->beginWaitCursor();
3551 try {
3552 myNet->computeNetwork(this, true); // GNEChange_TLS does not triggere GNENet:requireRecompute
3553 myNet->saveTLSPrograms(neteditOptions.getString("tls-file"));
3554 // write info
3555 WRITE_MESSAGE(TL("TLS Programs saved in '") + neteditOptions.getString("tls-file") + "'");
3556 } catch (IOError& e) {
3557 // write warning if netedit is running in testing mode
3558 WRITE_DEBUG("Opening FXMessageBox 'error saving TLS Programs'");
3559 // open error message box
3560 FXMessageBox::error(this, MBOX_OK, TL("Saving TLS Programs failed!"), "%s", e.what());
3561 // write warning if netedit is running in testing mode
3562 WRITE_DEBUG("Closed FXMessageBox 'error saving TLS Programs' with 'OK'");
3563 }
3565 getApp()->endWaitCursor();
3566 // set focus again in viewNet
3567 myViewNet->setFocus();
3568 }
3569 return 1;
3570}
3571
3572
3573long
3574GNEApplicationWindow::onUpdSaveTLSPrograms(FXObject* sender, FXSelector, void*) {
3575 if (myNet == nullptr) {
3576 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3577 } else {
3578 // check if there is at least one TLS
3579 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
3580 if (junction.second->getNBNode()->getControllingTLS().size() > 0) {
3581 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3582 }
3583 }
3584 // no TLS, then disable
3585 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3586 }
3587}
3588
3589
3590long
3591GNEApplicationWindow::onCmdSaveEdgeTypes(FXObject* obj, FXSelector sel, void* ptr) {
3592 // get option container
3593 auto& neteditOptions = OptionsCont::getOptions();
3594 // Check if edgeType file was already set at start of netedit or with a previous save
3595 if (neteditOptions.getString("edgetypes-file").empty()) {
3596 return onCmdSaveEdgeTypesAs(obj, sel, ptr);
3597 } else {
3598 // Start saving edgeTypes
3599 getApp()->beginWaitCursor();
3600 try {
3601 myNet->saveEdgeTypes(neteditOptions.getString("edgetypes-file"));
3602 // write info
3603 WRITE_MESSAGE(TL("EdgeType saved in '") + neteditOptions.getString("edgetypes-file") + "'");
3604 } catch (IOError& e) {
3605 // write warning if netedit is running in testing mode
3606 WRITE_DEBUG("Opening FXMessageBox 'error saving edgeTypes'");
3607 // open error message box
3608 FXMessageBox::error(this, MBOX_OK, TL("Saving edgeTypes failed!"), "%s", e.what());
3609 // write warning if netedit is running in testing mode
3610 WRITE_DEBUG("Closed FXMessageBox 'error saving edgeTypes' with 'OK'");
3611 }
3613 getApp()->endWaitCursor();
3614 }
3615 return 1;
3616}
3617
3618
3619long
3620GNEApplicationWindow::onUpdSaveEdgeTypes(FXObject* sender, FXSelector, void*) {
3621 // check if net exist and there are edge types
3622 if (myNet && (myNet->getAttributeCarriers()->getEdgeTypes().size() > 0)) {
3623 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3624 } else {
3625 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3626 }
3627 return 1;
3628}
3629
3630
3631long
3633 // get option container
3634 auto& neteditOptions = OptionsCont::getOptions();
3635 // get TLS file
3636 const auto TLSFile = GNEApplicationWindowHelper::openTLSFileDialog(this, true);
3637 // check tat file is valid
3638 if (!TLSFile.empty()) {
3639 // change value of "tls-file"
3640 neteditOptions.resetWritable();
3641 neteditOptions.set("tls-file", TLSFile);
3642 // set focus again in viewNet
3643 myViewNet->setFocus();
3644 // save TLS Programs
3645 return onCmdSaveTLSPrograms(nullptr, 0, nullptr);
3646 } else {
3647 return 1;
3648 }
3649}
3650
3651
3652long
3653GNEApplicationWindow::onCmdSaveEdgeTypesAs(FXObject*, FXSelector, void*) {
3654 // get option container
3655 auto& neteditOptions = OptionsCont::getOptions();
3656 // get network file file
3657 const auto edgeTypesFile = GNEApplicationWindowHelper::openEdgeTypeFileDialog(this, true);
3658 // check tat file is valid
3659 if (!edgeTypesFile.empty()) {
3660 // change value of "edgetypes-file"
3661 neteditOptions.resetWritable();
3662 neteditOptions.set("edgetypes-file", edgeTypesFile);
3663 // set focus again in viewNet
3664 myViewNet->setFocus();
3665 // save edgeTypes
3666 return onCmdSaveEdgeTypes(nullptr, 0, nullptr);
3667 } else {
3668 return 1;
3669 }
3670}
3671
3672
3673long
3674GNEApplicationWindow::onUpdSaveEdgeTypesAs(FXObject* sender, FXSelector, void*) {
3675 // check if net exist and there are edge types
3676 if (myNet && (myNet->getAttributeCarriers()->getEdgeTypes().size() > 0)) {
3677 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3678 } else {
3679 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3680 }
3681 return 1;
3682}
3683
3684
3685long
3686GNEApplicationWindow::onCmdOpenAdditionals(FXObject*, FXSelector, void*) {
3687 auto& neteditOptions = OptionsCont::getOptions();
3688 // get file
3689 const auto additionalFile = GNEApplicationWindowHelper::openAdditionalFileDialog(this, false);
3690 // check file
3691 if (!additionalFile.empty()) {
3692 // declare overwrite flag
3693 bool overwriteElements = false;
3694 // check if open question dialog box
3695 if (additionalFile == neteditOptions.getString("additional-files")) {
3696 // open overwrite dialog
3697 GNEKeepElementsDialog keepElementsDialog(this, "additional");
3698 // continue depending of result
3699 if (keepElementsDialog.getResult() == GNEKeepElementsDialog::Result::CANCEL) {
3700 // abort load
3701 return 0;
3702 } else if (keepElementsDialog.getResult() == GNEKeepElementsDialog::Result::OVERWRITE) {
3703 // enable overwriteElements
3704 overwriteElements = true;
3705 }
3706 }
3707 // flag for save current saving status
3708 const auto previouslySaved = myNet->getSavingStatus()->isAdditionalsSaved();
3709 // disable validation for additionals
3710 XMLSubSys::setValidation("never", "auto", "auto");
3711 // Create additional handler
3712 GNEGeneralHandler generalHandler(myNet, additionalFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, overwriteElements);
3713 // begin undoList operation
3714 myUndoList->begin(Supermode::NETWORK, GUIIcon::SUPERMODENETWORK, TL("load additionals from '") + additionalFile + "'");
3715 // Run parser
3716 if (!generalHandler.parse()) {
3717 // write error
3718 WRITE_ERROR(TL("Loading of additional file failed: ") + additionalFile);
3719 } else {
3720 // change value of "additional-files"
3721 neteditOptions.resetWritable();
3722 neteditOptions.set("additional-files", additionalFile);
3723 // write info
3724 WRITE_MESSAGE(TL("Loading of additional file successfully: ") + additionalFile);
3725 // enable save if there is errors loading additionals
3726 if (previouslySaved && !generalHandler.isErrorCreatingElement()) {
3728 }
3729 }
3730 // end undoList operation
3731 myUndoList->end();
3732 // restore validation for additionals
3733 XMLSubSys::setValidation("auto", "auto", "auto");
3734 // check if clear undoList
3736 myUndoList->clear();
3737 }
3738 update();
3739 }
3740 return 1;
3741}
3742
3743
3744long
3746 // get additionalFile
3747 const std::string additionalFile = OptionsCont::getOptions().getString("additional-files");
3748 // disable validation for additionals
3749 XMLSubSys::setValidation("never", "auto", "auto");
3750 // Create general handler
3751 GNEGeneralHandler generalHandler(myNet, additionalFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, true);
3752 // begin undoList operation
3753 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODENETWORK, TL("reloading additionals from '") + additionalFile + "'");
3754 // clear additionals
3756 // Run parser
3757 if (!generalHandler.parse()) {
3758 WRITE_ERROR(TL("Reloading of additional file failed: ") + additionalFile);
3759 }
3760 // end undoList operation
3761 myUndoList->end();
3762 // restore validation for additionals
3763 XMLSubSys::setValidation("auto", "auto", "auto");
3764 // check if clear undoList
3766 myUndoList->clear();
3767 }
3768 update();
3769 return 1;
3770}
3771
3772
3773long
3774GNEApplicationWindow::onUpdReloadAdditionals(FXObject* sender, FXSelector, void*) {
3775 // check if file exist
3776 if (myViewNet && OptionsCont::getOptions().getString("additional-files").empty()) {
3777 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3778 } else {
3779 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3780 }
3781}
3782
3783
3784long
3785GNEApplicationWindow::onCmdSaveAdditionals(FXObject* sender, FXSelector sel, void* ptr) {
3786 // get option container
3787 auto& neteditOptions = OptionsCont::getOptions();
3788 if (myNet->getSavingStatus()->isAdditionalsSaved() && !neteditOptions.getBool("force-saving")) {
3789 // nothing to save
3790 return 1;
3791 }
3792 // check if we have to set the output filename
3793 if ((sel == MID_GNE_AUTOMATICFILENAME) && neteditOptions.getString("additional-files").empty()) {
3794 neteditOptions.set("additional-files", *(static_cast<std::string*>(ptr)) + ".add.xml");
3795 }
3796 // check if we have to open save as dialog
3797 if (neteditOptions.getString("additional-files").empty()) {
3798 // choose file to save
3799 return onCmdSaveAdditionalsAs(sender, sel, ptr);
3800 } else {
3801 // always recompute before saving
3802 myNet->computeNetwork(this);
3803 try {
3804 // compute before saving (for detectors positions)
3805 myNet->computeNetwork(this);
3806 // save additionals
3807 const bool savingResult = myNet->saveAdditionals();
3808 // show info
3809 if (savingResult) {
3810 WRITE_MESSAGE(TL("Additionals saved in '") + neteditOptions.getString("additional-files") + "'");
3811 return 1;
3812 } else {
3813 WRITE_MESSAGE(TL("Saving additional aborted"));
3814 return 0;
3815 }
3816 } catch (IOError& e) {
3817 // write warning if netedit is running in testing mode
3818 WRITE_DEBUG("Opening FXMessageBox 'error saving additionals'");
3819 // open error message box
3820 FXMessageBox::error(this, MBOX_OK, TL("Saving additionals failed!"), "%s", e.what());
3821 // write warning if netedit is running in testing mode
3822 WRITE_DEBUG("Closed FXMessageBox 'error saving additionals' with 'OK'");
3823 }
3824 return 0;
3825 }
3826}
3827
3828
3829long
3831 // get option container
3832 auto& neteditOptions = OptionsCont::getOptions();
3833 // declare current folder
3834 FXString currentFolder = gCurrentFolder;
3835 // set current folder
3836 if (neteditOptions.getString("configuration-file").size() > 0) {
3837 currentFolder = getFolder(neteditOptions.getString("configuration-file"));
3838 } else if (neteditOptions.getString("net-file").size() > 0) {
3839 currentFolder = getFolder(neteditOptions.getString("net-file"));
3840 }
3841 // get additional file
3842 const auto additionalFile = GNEApplicationWindowHelper::openAdditionalFileDialog(this, true);
3843 // check that file is valid
3844 if (!additionalFile.empty()) {
3845 // reset writtable flag
3846 neteditOptions.resetWritable();
3847 // change value of "additional-files"
3848 neteditOptions.set("additional-files", additionalFile);
3849 // enable save additionals
3851 // save additionals
3852 return onCmdSaveAdditionals(nullptr, 0, nullptr);
3853 } else {
3854 return 0;
3855 }
3856}
3857
3858
3859long
3861 // declare current folder
3862 FXString currentFolder = gCurrentFolder;
3863 // get juPedSim file
3864 const auto juPedSimFile = GNEApplicationWindowHelper::openAdditionalFileDialog(this, true);
3865 // check that file is valid
3866 if (!juPedSimFile.empty()) {
3867 try {
3868 // save additionals
3869 const bool savingResult = myNet->saveJuPedSimElements(juPedSimFile);
3870 // set focus again in viewNet
3871 myViewNet->setFocus();
3872 // show info
3873 if (savingResult) {
3874 WRITE_MESSAGE(TL("JuPedSim elements saved in '") + juPedSimFile + "'");
3875 return 1;
3876 } else {
3877 WRITE_MESSAGE(TL("Saving JuPedSim aborted"));
3878
3879 return 0;
3880 }
3881 } catch (IOError& e) {
3882 // write warning if netedit is running in testing mode
3883 WRITE_DEBUG("Opening FXMessageBox 'error saving JuPedSim elements'");
3884 // open error message box
3885 FXMessageBox::error(this, MBOX_OK, TL("Saving JuPedSim elements failed!"), "%s", e.what());
3886 // write warning if netedit is running in testing mode
3887 WRITE_DEBUG("Closed FXMessageBox 'error saving JuPedSim elements' with 'OK'");
3888 }
3889 }
3890 return 0;
3891}
3892
3893
3894long
3896 // get option container
3897 auto& neteditOptions = OptionsCont::getOptions();
3898 // get file
3899 const auto routeFile = GNEApplicationWindowHelper::openRouteFileDialog(this, false);
3900 // check file
3901 if (!routeFile.empty()) {
3902 // declare overwrite flag
3903 bool overwriteElements = false;
3904 // check if open question dialog box
3905 if (routeFile == neteditOptions.getString("route-files")) {
3906 // open overwrite dialog
3907 GNEKeepElementsDialog keepElementsDialog(this, "route");
3908 // continue depending of result
3909 if (keepElementsDialog.getResult() == GNEKeepElementsDialog::Result::CANCEL) {
3910 // abort load
3911 return 0;
3912 } else if (keepElementsDialog.getResult() == GNEKeepElementsDialog::Result::OVERWRITE) {
3913 // enable overwriteElements
3914 overwriteElements = true;
3915 }
3916 }
3917 // save previous demand element status saving
3918 const auto previouslySaved = myNet->getSavingStatus()->isDemandElementsSaved();
3919 // disable validation for additionals
3920 XMLSubSys::setValidation("never", "auto", "auto");
3921 // Create generic handler
3922 GNEGeneralHandler handler(myNet, routeFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, overwriteElements);
3923 // begin undoList operation
3924 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODEDEMAND, TL("loading demand elements from '") + routeFile + "'");
3925 // Run parser for additionals
3926 if (!handler.parse()) {
3927 // write error
3928 WRITE_ERROR(TL("Loading of route file failed: ") + routeFile);
3929 } else {
3930 // change value of "route-files"
3931 neteditOptions.resetWritable();
3932 neteditOptions.set("route-files", routeFile);
3933 // show info
3934 WRITE_MESSAGE(TL("Loading of route file successfully: ") + routeFile);
3935 // enable demand elements if there is an error creating element
3936 if (previouslySaved && !handler.isErrorCreatingElement()) {
3938 }
3939 }
3940 // end undoList operation
3941 myUndoList->end();
3942 // restore validation
3943 XMLSubSys::setValidation("auto", "auto", "auto");
3944 // check if clear undoList
3946 myUndoList->clear();
3947 }
3948 update();
3949 }
3950 return 1;
3951}
3952
3953
3954long
3956 // get file
3957 const std::string routeFile = OptionsCont::getOptions().getString("route-files");
3958 // disable validation for additionals
3959 XMLSubSys::setValidation("never", "auto", "auto");
3960 // Create handler
3961 GNEGeneralHandler handler(myNet, routeFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, true);
3962 // begin undoList operation
3963 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODEDEMAND, TLF("reloading demand elements from '%'", routeFile));
3964 // clear demand elements
3966 // Run parser for additionals
3967 if (!handler.parse()) {
3968 WRITE_ERROR(TL("Reloading of route file failed: ") + routeFile);
3969 }
3970 // end undoList operation and update view
3971 myUndoList->end();
3972 // restore validation for demand
3973 XMLSubSys::setValidation("auto", "auto", "auto");
3974 // check if clear undoList
3976 myUndoList->clear();
3977 }
3978 update();
3979 return 1;
3980}
3981
3982
3983long
3984GNEApplicationWindow::onUpdReloadDemandElements(FXObject* sender, FXSelector, void*) {
3985 // check if file exist
3986 if (myViewNet && OptionsCont::getOptions().getString("route-files").empty()) {
3987 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3988 } else {
3989 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3990 }
3991}
3992
3993
3994long
3995GNEApplicationWindow::onCmdSaveDemandElements(FXObject* sender, FXSelector sel, void* ptr) {
3996 // get option container
3997 auto& neteditOptions = OptionsCont::getOptions();
3998 // check saving conditions
3999 if (myNet->getSavingStatus()->isDemandElementsSaved() && !neteditOptions.getBool("force-saving")) {
4000 // nothing to save
4001 return 1;
4002 }
4003 // check if we have to set the output filename
4004 if ((sel == MID_GNE_AUTOMATICFILENAME) && neteditOptions.getString("route-files").empty()) {
4005 neteditOptions.set("route-files", *(static_cast<std::string*>(ptr)) + ".rou.xml");
4006 }
4007 // check if we have to open save as dialog
4008 if (neteditOptions.getString("route-files").empty()) {
4009 return onCmdSaveDemandElementsAs(sender, sel, ptr);
4010 } else {
4011 // always recompute before saving
4012 myNet->computeNetwork(this);
4013 try {
4014 // save demand elements
4015 const bool savingResult = myNet->saveDemandElements();
4016 // show info
4017 if (savingResult) {
4018 WRITE_MESSAGE(TL("Demand elements saved in '") + neteditOptions.getString("route-files") + "'");
4019 return 1;
4020 } else {
4021 WRITE_MESSAGE(TL("Saving demand elements aborted"));
4022 return 0;
4023 }
4024 } catch (IOError& e) {
4025 // write warning if netedit is running in testing mode
4026 WRITE_DEBUG("Opening FXMessageBox 'error saving demand elements'");
4027 // open error message box
4028 FXMessageBox::error(this, MBOX_OK, TL("Saving demand elements failed!"), "%s", e.what());
4029 // write warning if netedit is running in testing mode
4030 WRITE_DEBUG("Closed FXMessageBox 'error saving demand elements' with 'OK'");
4031 }
4032 }
4033 return 0;
4034}
4035
4036
4037long
4038GNEApplicationWindow::onCmdSaveDemandElementsAs(FXObject* sender, FXSelector sel, void* ptr) {
4039 // get option container
4040 auto& neteditOptions = OptionsCont::getOptions();
4041 // declare current folder
4042 FXString currentFolder = gCurrentFolder;
4043 // set current folder
4044 if (neteditOptions.getString("configuration-file").size() > 0) {
4045 currentFolder = getFolder(neteditOptions.getString("configuration-file"));
4046 } else if (neteditOptions.getString("net-file").size() > 0) {
4047 currentFolder = getFolder(neteditOptions.getString("net-file"));
4048 }
4049 // get route file
4050 const auto routeFile = GNEApplicationWindowHelper::openRouteFileDialog(this, true);
4051 // check that file is correct
4052 if (!routeFile.empty()) {
4053 // reset writtable flag
4054 neteditOptions.resetWritable();
4055 // change value of "route-files"
4056 neteditOptions.set("route-files", routeFile);
4057 // requiere save demand elements
4059 // set focus again in viewNet
4060 myViewNet->setFocus();
4061 // save demand elements
4062 return onCmdSaveDemandElements(sender, sel, ptr);
4063 } else {
4064 return 0;
4065 }
4066}
4067
4068
4069long
4070GNEApplicationWindow::onCmdOpenDataElements(FXObject*, FXSelector, void*) {
4071 // get option container
4072 auto& neteditOptions = OptionsCont::getOptions();
4073 // get file
4074 const auto dataFile = GNEApplicationWindowHelper::openDataFileDialog(this, false);
4075 // check file
4076 if (!dataFile.empty()) {
4077 // declare overwrite flag
4078 bool overwriteElements = false;
4079 // check if open question dialog box
4080 if (dataFile == neteditOptions.getString("data-files")) {
4081 // open overwrite dialog
4082 GNEKeepElementsDialog keepElementsDialog(this, "data");
4083 // continue depending of result
4084 if (keepElementsDialog.getResult() == GNEKeepElementsDialog::Result::CANCEL) {
4085 // abort load
4086 return 0;
4087 } else if (keepElementsDialog.getResult() == GNEKeepElementsDialog::Result::OVERWRITE) {
4088 // enable overwriteElements
4089 overwriteElements = true;
4090 }
4091 }
4092 // save previous demand element status saving
4093 const auto previouslySaved = myNet->getSavingStatus()->isDataElementsSaved();
4094 // disable update data
4096 // disable validation for data elements
4097 XMLSubSys::setValidation("never", "auto", "auto");
4098 // Create data handler
4099 GNEDataHandler dataHandler(myNet, dataFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, overwriteElements);
4100 // begin undoList operation
4101 myUndoList->begin(Supermode::DATA, GUIIcon::SUPERMODEDATA, TL("loading data elements from '") + dataFile + "'");
4102 // Run data parser
4103 if (!dataHandler.parse()) {
4104 // write error
4105 WRITE_ERROR(TL("Loading of data file failed: ") + dataFile);
4106 } else {
4107 // change value of "data-files"
4108 neteditOptions.resetWritable();
4109 neteditOptions.set("data-files", dataFile);
4110 // show info
4111 WRITE_MESSAGE(TL("Loading of data file successfully: ") + dataFile);
4112 // enable demand elements if there is an error creating element
4113 if (previouslySaved && !dataHandler.isErrorCreatingElement()) {
4115 }
4116 }
4117 // end undoList operation
4118 myUndoList->end();
4119 // enable update data
4121 // restore validation for data
4122 XMLSubSys::setValidation("auto", "auto", "auto");
4123 // check if clear undoList
4125 myUndoList->clear();
4126 }
4127 update();
4128 }
4129 return 1;
4130}
4131
4132
4133long
4135 // get file
4136 const std::string dataFile = OptionsCont::getOptions().getString("data-files");
4137 // disable update data
4139 // disable validation for additionals
4140 XMLSubSys::setValidation("never", "auto", "auto");
4141 // Create additional handler
4142 GNEDataHandler dataHandler(myNet, dataFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
4143 // begin undoList operation
4144 myUndoList->begin(Supermode::DATA, GUIIcon::SUPERMODEDATA, TL("reloading data elements from '") + dataFile + "'");
4145 // clear data elements
4147 // Run data parser
4148 if (!dataHandler.parse()) {
4149 WRITE_ERROR(TL("Reloading of data file failed: ") + dataFile);
4150 }
4151 // restore validation for data
4152 XMLSubSys::setValidation("auto", "auto", "auto");
4153 // end undoList operation and update view
4154 myUndoList->end();
4155 // enable update data
4157 // check if clear undoList
4159 myUndoList->clear();
4160 }
4161 update();
4162 return 1;
4163}
4164
4165
4166long
4167GNEApplicationWindow::onUpdReloadDataElements(FXObject* sender, FXSelector, void*) {
4168 // check if file exist
4169 if (myViewNet && OptionsCont::getOptions().getString("data-files").empty()) {
4170 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
4171 } else {
4172 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
4173 }
4174}
4175
4176
4177long
4178GNEApplicationWindow::onCmdSaveDataElements(FXObject* sender, FXSelector sel, void* ptr) {
4179 // get option container
4180 auto& neteditOptions = OptionsCont::getOptions();
4181 // check saving conditions
4182 if (myNet->getSavingStatus()->isDataElementsSaved() && !neteditOptions.getBool("force-saving")) {
4183 // nothing to save
4184 return 1;
4185 }
4186 // check if we have to set the output filename
4187 if ((sel == MID_GNE_AUTOMATICFILENAME) && neteditOptions.getString("data-files").empty()) {
4188 neteditOptions.set("data-files", *(static_cast<std::string*>(ptr)) + ".dat.xml");
4189 }
4190 // check if we have to open save as dialog
4191 if (neteditOptions.getString("data-files").empty()) {
4192 return onCmdSaveDataElementsAs(sender, sel, ptr);
4193 } else {
4194 try {
4195 // save data elements
4196 const bool savingResult = myNet->saveDataElements();
4197 // show info
4198 if (savingResult) {
4199 WRITE_MESSAGE(TL("Data elements saved in '") + neteditOptions.getString("data-files") + "'");
4200 return 1;
4201 } else {
4202 WRITE_MESSAGE(TL("Saving demand elements aborted"));
4203 return 0;
4204 }
4205 } catch (IOError& e) {
4206 // write warning if netedit is running in testing mode
4207 WRITE_DEBUG("Opening FXMessageBox 'error saving data elements'");
4208 // open error message box
4209 FXMessageBox::error(this, MBOX_OK, TL("Saving data elements failed!"), "%s", e.what());
4210 // write warning if netedit is running in testing mode
4211 WRITE_DEBUG("Closed FXMessageBox 'error saving data elements' with 'OK'");
4212 }
4213 }
4214 return 0;
4215}
4216
4217
4218long
4219GNEApplicationWindow::onCmdSaveDataElementsAs(FXObject* sender, FXSelector sel, void* ptr) {
4220 // get option container
4221 auto& neteditOptions = OptionsCont::getOptions();
4222 // declare current folder
4223 FXString currentFolder = gCurrentFolder;
4224 // set current folder
4225 if (neteditOptions.getString("configuration-file").size() > 0) {
4226 currentFolder = getFolder(neteditOptions.getString("configuration-file"));
4227 } else if (neteditOptions.getString("net-file").size() > 0) {
4228 currentFolder = getFolder(neteditOptions.getString("net-file"));
4229 }
4230 // get data file
4231 const auto dataFile = GNEApplicationWindowHelper::openDataFileDialog(this, true);
4232 // check that file is correct
4233 if (!dataFile.empty()) {
4234 // reset writtable flag
4235 neteditOptions.resetWritable();
4236 // change value of "data-files"
4237 neteditOptions.set("data-files", dataFile);
4238 // mark data elements as unsaved
4240 // set focus again in viewNet
4241 myViewNet->setFocus();
4242 // save data elements
4243 return onCmdSaveDataElements(sender, sel, ptr);
4244 } else {
4245 return 0;
4246 }
4247}
4248
4249
4250long
4251GNEApplicationWindow::onCmdOpenMeanDatas(FXObject*, FXSelector, void*) {
4252 auto& neteditOptions = OptionsCont::getOptions();
4253 // get file
4254 const auto meanDataFile = GNEApplicationWindowHelper::openMeanDataDialog(this, false);
4255 // check file
4256 if (!meanDataFile.empty()) {
4257 // declare overwrite flag
4258 bool overwriteElements = false;
4259 // check if open question dialog box
4260 if (meanDataFile == neteditOptions.getString("meandata-files")) {
4261 // open overwrite dialog
4262 GNEKeepElementsDialog keepElementsDialog(this, "meanData");
4263 // continue depending of result
4264 if (keepElementsDialog.getResult() == GNEKeepElementsDialog::Result::CANCEL) {
4265 // abort load
4266 return 0;
4267 } else if (keepElementsDialog.getResult() == GNEKeepElementsDialog::Result::OVERWRITE) {
4268 // enable overwriteElements
4269 overwriteElements = true;
4270 }
4271 }
4272 // save previous demand element status saving
4273 const auto previouslySaved = myNet->getSavingStatus()->isMeanDatasSaved();
4274 // disable validation for meanDatas
4275 XMLSubSys::setValidation("never", "auto", "auto");
4276 // Create meanData handler
4277 GNEGeneralHandler generalHandler(myNet, meanDataFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, overwriteElements);
4278 // begin undoList operation
4279 myUndoList->begin(Supermode::DATA, GUIIcon::SUPERMODEDATA, TL("load meanDatas from '") + meanDataFile + "'");
4280 // Run parser
4281 if (!generalHandler.parse()) {
4282 // write error
4283 WRITE_ERROR(TL("Loading of meandata file failed: ") + meanDataFile);
4284 } else {
4285 // change value of "meandata-files"
4286 neteditOptions.resetWritable();
4287 neteditOptions.set("meandata-files", meanDataFile);
4288 // show info
4289 WRITE_MESSAGE(TL("Loading of meandata file successfully: ") + meanDataFile);
4290 // enable demand elements if there is an error creating element
4291 if (previouslySaved && !generalHandler.isErrorCreatingElement()) {
4293 }
4294 }
4295 // end undoList operation
4296 myUndoList->end();
4297 // restore validation for meanDatas
4298 XMLSubSys::setValidation("auto", "auto", "auto");
4299 // check if clear undoList
4301 myUndoList->clear();
4302 }
4303 update();
4304 }
4305 return 1;
4306}
4307
4308
4309long
4310GNEApplicationWindow::onCmdReloadMeanDatas(FXObject*, FXSelector, void*) {
4311 // get file
4312 const std::string meanDataFile = OptionsCont::getOptions().getString("meandata-files");
4313 // disable validation for meanDatas
4314 XMLSubSys::setValidation("never", "auto", "auto");
4315 // Create general handler
4316 GNEGeneralHandler generalHandler(myNet, meanDataFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, true);
4317 // begin undoList operation
4318 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODENETWORK, TL("reloading meanDatas from '") + meanDataFile + "'");
4319 // clear meanDatas
4321 // Run parser
4322 if (!generalHandler.parse()) {
4323 WRITE_MESSAGE(TL("Loading of meandata file successfully: ") + meanDataFile);
4324 }
4325 // end undoList operation and update view
4326 myUndoList->end();
4327 // restore validation for meanDatas
4328 XMLSubSys::setValidation("auto", "auto", "auto");
4329 // check if clear undoList
4331 myUndoList->clear();
4332 }
4333 update();
4334 return 1;
4335}
4336
4337
4338long
4339GNEApplicationWindow::onUpdReloadMeanDatas(FXObject* sender, FXSelector, void*) {
4340 // check if file exist
4341 if (myViewNet && OptionsCont::getOptions().getString("meandata-files").empty()) {
4342 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
4343 } else {
4344 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
4345 }
4346}
4347
4348
4349long
4350GNEApplicationWindow::onCmdSaveMeanDatas(FXObject* sender, FXSelector sel, void* ptr) {
4351 // get option container
4352 auto& neteditOptions = OptionsCont::getOptions();
4353 // check saving conditions
4354 if (myNet->getSavingStatus()->isMeanDatasSaved() && !neteditOptions.getBool("force-saving")) {
4355 // nothing to save
4356 return 1;
4357 }
4358 // check if we have to set the output filename
4359 if ((sel == MID_GNE_AUTOMATICFILENAME) && neteditOptions.getString("meandata-files").empty()) {
4360 neteditOptions.set("meandata-files", *(static_cast<std::string*>(ptr)) + ".med.add.xml");
4361 }
4362 // check if we have to open save as dialog
4363 if (neteditOptions.getString("meandata-files").empty()) {
4364 return onCmdSaveMeanDatasAs(sender, sel, ptr);
4365 } else {
4366 try {
4367 // compute before saving
4368 myNet->computeNetwork(this);
4369 // save demand elements
4370 const bool savingResult = myNet->saveMeanDatas();
4371 // show info
4372 if (savingResult) {
4373 WRITE_MESSAGE(TL("MeanDatas elements saved in '") + neteditOptions.getString("meandata-files") + "'");
4374 return 1;
4375 } else {
4376 WRITE_MESSAGE(TL("Saving MeanData elements aborted"));
4377 return 0;
4378 }
4379 } catch (IOError& e) {
4380 // write warning if netedit is running in testing mode
4381 WRITE_DEBUG("Opening FXMessageBox 'error saving demand elements'");
4382 // open error message box
4383 FXMessageBox::error(this, MBOX_OK, TL("Saving demand elements failed!"), "%s", e.what());
4384 // write warning if netedit is running in testing mode
4385 WRITE_DEBUG("Closed FXMessageBox 'error saving demand elements' with 'OK'");
4386 }
4387 }
4388 return 0;
4389}
4390
4391
4392long
4393GNEApplicationWindow::onCmdSaveMeanDatasAs(FXObject* sender, FXSelector sel, void* ptr) {
4394 // get option container
4395 auto& neteditOptions = OptionsCont::getOptions();
4396 // declare current folder
4397 FXString currentFolder = gCurrentFolder;
4398 // set current folder
4399 if (neteditOptions.getString("configuration-file").size() > 0) {
4400 currentFolder = getFolder(neteditOptions.getString("configuration-file"));
4401 } else if (neteditOptions.getString("net-file").size() > 0) {
4402 currentFolder = getFolder(neteditOptions.getString("net-file"));
4403 }
4404 // get meanData file
4405 const auto meanDataFile = GNEApplicationWindowHelper::openMeanDataDialog(this, true);
4406 // check that file is valid
4407 if (!meanDataFile.empty()) {
4408 // reset writtable flag
4409 neteditOptions.resetWritable();
4410 // change value of "meandata-files"
4411 neteditOptions.set("meandata-files", meanDataFile);
4412 // mark mean datas as unsaved
4414 // set focus again in viewNet
4415 myViewNet->setFocus();
4416 // save meanDatas
4417 return onCmdSaveMeanDatas(sender, sel, ptr);
4418 } else {
4419 return 0;
4420 }
4421}
4422
4423
4424bool
4426 if (myNet && !myNet->getSavingStatus()->isNetworkSaved()) {
4427 // write warning if netedit is running in testing mode
4428 WRITE_DEBUG("Opening FXMessageBox 'Confirm close network'");
4429 // open question box
4430 const std::string header = TL("Confirm close Network");
4431 const std::string contentsA = TL("You have unsaved changes in the network.");
4432 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4433 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4434 // restore focus to view net
4435 myViewNet->setFocus();
4436 // if user close dialog box, check additionals and demand elements
4437 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4438 // write warning if netedit is running in testing mode
4439 WRITE_DEBUG("Closed FXMessageBox 'Confirm close network' with 'Quit'");
4444 // clear undo list
4445 clearUndoList();
4446 return true;
4447 } else {
4448 return false;
4449 }
4450 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4451 // save network
4452 onCmdSaveNetwork(nullptr, 0, nullptr);
4453 // check
4458 // clear undo list
4459 clearUndoList();
4460 return true;
4461 } else {
4462 return false;
4463 }
4464 } else {
4465 // write warning if netedit is running in testing mode
4466 if (answer == 2) {
4467 WRITE_DEBUG("Closed FXMessageBox 'Confirm close network' with 'No'");
4468 } else if (answer == 4) {
4469 WRITE_DEBUG("Closed FXMessageBox 'Confirm close network' with 'ESC'");
4470 }
4471 // return false to stop closing/reloading
4472 return false;
4473 }
4474 } else {
4479 // clear undo list
4480 clearUndoList();
4481 return true;
4482 } else {
4483 // return false to stop closing/reloading
4484 return false;
4485 }
4486 }
4487}
4488
4489
4490bool
4492 // Check if there are non saved additionals
4494 WRITE_DEBUG("Opening FXMessageBox 'Save additionals before close'");
4495 // open question box
4496 const std::string header = TL("Save additional elements before close");
4497 const std::string contentsA = TL("You have unsaved additional elements.");
4498 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4499 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4500 // restore focus to view net
4501 myViewNet->setFocus();
4502 // if answer was affirmative, but there was an error during saving additionals, return false to stop closing/reloading
4503 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4504 WRITE_DEBUG("Closed FXMessageBox 'Save additionals before close' with 'Quit'");
4505 // nothing to save, return true
4506 return true;
4507 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4508 // write warning if netedit is running in testing mode
4509 WRITE_DEBUG("Closed FXMessageBox 'Save additionals before close' with 'Yes'");
4510 if (onCmdSaveAdditionals(nullptr, 0, nullptr) == 1) {
4511 // additionals successfully saved
4512 return true;
4513 } else {
4514 // error saving additionals, abort saving
4515 return false;
4516 }
4517 } else {
4518 // write warning if netedit is running in testing mode
4519 if (answer == 2) {
4520 WRITE_DEBUG("Closed FXMessageBox 'Save additionals before close' with 'No'");
4521 } else if (answer == 4) {
4522 WRITE_DEBUG("Closed FXMessageBox 'Save additionals before close' with 'ESC'");
4523 }
4524 // abort saving
4525 return false;
4526 }
4527 } else {
4528 // nothing to save, return true
4529 return true;
4530 }
4531}
4532
4533
4534bool
4536 // Check if there are non saved demand elements
4538 WRITE_DEBUG("Opening FXMessageBox 'Save demand elements before close'");
4539 // open question box
4540 const std::string header = TL("Save demand elements before close");
4541 const std::string contentsA = TL("You have unsaved demand elements.");
4542 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4543 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4544 // restore focus to view net
4545 myViewNet->setFocus();
4546 // if answer was affirmative, but there was an error during saving demand elements, return false to stop closing/reloading
4547 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4548 WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before close' with 'Quit'");
4549 // nothing to save, return true
4550 return true;
4551 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4552 // write warning if netedit is running in testing mode
4553 WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before close' with 'Yes'");
4554 if (onCmdSaveDemandElements(nullptr, MID_GNE_AUTOMATICFILENAME, nullptr) == 1) {
4555 // demand elements successfully saved
4556 return true;
4557 } else {
4558 // error saving demand elements, abort saving
4559 return false;
4560 }
4561 } else {
4562 // write warning if netedit is running in testing mode
4563 if (answer == 2) {
4564 WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before close' with 'No'");
4565 } else if (answer == 4) {
4566 WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before close' with 'ESC'");
4567 }
4568 // abort saving
4569 return false;
4570 }
4571 } else {
4572 // nothing to save, return true
4573 return true;
4574 }
4575}
4576
4577
4578bool
4580 // Check if there are non saved data elements
4582 WRITE_DEBUG("Opening FXMessageBox 'Save data elements before close'");
4583 // open question box
4584 const std::string header = TL("Save data elements before close");
4585 const std::string contentsA = TL("You have unsaved data elements.");
4586 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4587 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4588 // restore focus to view net
4589 myViewNet->setFocus();
4590 // if answer was affirmative, but there was an error during saving data elements, return false to stop closing/reloading
4591 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4592 WRITE_DEBUG("Closed FXMessageBox 'Save data elements before close' with 'Quit'");
4593 // nothing to save, return true
4594 return true;
4595 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4596 // write warning if netedit is running in testing mode
4597 WRITE_DEBUG("Closed FXMessageBox 'Save data elements before close' with 'Yes'");
4598 if (onCmdSaveDataElements(nullptr, MID_GNE_AUTOMATICFILENAME, nullptr) == 1) {
4599 // data elements successfully saved
4600 return true;
4601 } else {
4602 // error saving data elements, abort saving
4603 return false;
4604 }
4605 } else {
4606 // write warning if netedit is running in testing mode
4607 if (answer == 2) {
4608 WRITE_DEBUG("Closed FXMessageBox 'Save data elements before close' with 'No'");
4609 } else if (answer == 4) {
4610 WRITE_DEBUG("Closed FXMessageBox 'Save data elements before close' with 'ESC'");
4611 }
4612 // abort saving
4613 return false;
4614 }
4615 } else {
4616 // nothing to save, return true
4617 return true;
4618 }
4619}
4620
4621
4622bool
4624 // Check if there are non saved data elements
4626 WRITE_DEBUG("Opening FXMessageBox 'Save meanData elements before close'");
4627 // open question box
4628 const std::string header = TL("Save meanData elements before close");
4629 const std::string contentsA = TL("You have unsaved meanData elements.");
4630 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4631 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4632 // restore focus to view net
4633 myViewNet->setFocus();
4634 // if answer was affirmative, but there was an error during saving meanData elements, return false to stop closing/reloading
4635 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4636 WRITE_DEBUG("Closed FXMessageBox 'Save meanData elements before close' with 'Quit'");
4637 // nothing to save, return true
4638 return true;
4639 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4640 // write warning if netedit is running in testing mode
4641 WRITE_DEBUG("Closed FXMessageBox 'Save meanData elements before close' with 'Yes'");
4642 if (onCmdSaveMeanDatas(nullptr, MID_GNE_AUTOMATICFILENAME, nullptr) == 1) {
4643 // meanData elements successfully saved
4644 return true;
4645 } else {
4646 // error saving meanData elements, abort saving
4647 return false;
4648 }
4649 } else {
4650 // write warning if netedit is running in testing mode
4651 if (answer == 2) {
4652 WRITE_DEBUG("Closed FXMessageBox 'Save meanData elements before close' with 'No'");
4653 } else if (answer == 4) {
4654 WRITE_DEBUG("Closed FXMessageBox 'Save meanData elements before close' with 'ESC'");
4655 }
4656 // abort saving
4657 return false;
4658 }
4659 } else {
4660 // nothing to save, return true
4661 return true;
4662 }
4663}
4664
4665
4666void
4667GNEApplicationWindow::setInputInSumoOptions(const bool ignoreAdditionals, const bool ignoreRoutes) {
4668 // obtain netedit option container
4669 auto& neteditOptions = OptionsCont::getOptions();
4671 // set network
4672 mySumoOptions.set("net-file", neteditOptions.getString("net-file"));
4673 // set routes
4674 if (ignoreRoutes || neteditOptions.getString("route-files").empty()) {
4675 mySumoOptions.resetDefault("route-files");
4676 } else {
4677 mySumoOptions.set("route-files", neteditOptions.getString("route-files"));
4678 }
4679 // set SumoOptions depending of additionalFiles and meanData files
4680 if (ignoreAdditionals) {
4681 if (neteditOptions.getString("meandata-files").empty()) {
4682 mySumoOptions.resetDefault("additional-files");
4683 } else {
4684 mySumoOptions.set("additional-files", neteditOptions.getString("meandata-files"));
4685 }
4686 } else {
4687 if ((neteditOptions.getString("additional-files").size() > 0) && (neteditOptions.getString("meandata-files").size())) {
4688 mySumoOptions.set("additional-files", neteditOptions.getString("additional-files") + "," + neteditOptions.getString("meandata-files"));
4689 } else if (neteditOptions.getString("additional-files").size() > 0) {
4690 mySumoOptions.set("additional-files", neteditOptions.getString("additional-files"));
4691 } else if (neteditOptions.getString("meandata-files").size() > 0) {
4692 mySumoOptions.set("additional-files", neteditOptions.getString("meandata-files"));
4693 } else {
4694 mySumoOptions.resetDefault("additional-files");
4695 }
4696 }
4697}
4698
4699
4700FXString
4701GNEApplicationWindow::getFolder(const std::string& folder) const {
4702 // declare folder
4703 std::string newFolder = folder;
4704 // declare stop flag
4705 bool stop = false;
4706 // continue while stop is false
4707 while (!stop) {
4708 if (newFolder.empty()) {
4709 // new folder empty, then stop
4710 stop = true;
4711 } else if ((newFolder.back() == '\'') || (newFolder.back() == '\\') ||
4712 (newFolder.back() == '/') /* || (newFolder.back() == '//') */) {
4713 // removed file, then stop
4714 stop = true;
4715 } else {
4716 newFolder.pop_back();
4717 }
4718 }
4719 // if is empty, return gCurrentFolder
4720 if (newFolder.empty()) {
4721 return gCurrentFolder;
4722 }
4723 return FXString(newFolder.c_str());
4724}
4725
4726
4727void
4729 // check that view exists
4730 if (myViewNet) {
4732 }
4733 // update require recomputing
4735}
4736
4737
4738void
4740 // remove lock hotkeys
4742 // check supermode
4743 if (supermode == Supermode::NETWORK) {
4744 // menu commands
4748 // lock
4752 // processing
4757 } else if (supermode == Supermode::DEMAND) {
4758 // menu commands
4762 // lock
4766 // processing
4771 } else if (supermode == Supermode::DATA) {
4772 // menu commands
4776 // lock
4780 // processing
4785 } else {
4786 // menu commands
4791 // lock
4795 // processing
4799 }
4800 // continue depending of view
4801 if (myViewNet) {
4805 } else if (myViewNet->getEditModes().isJuPedSimView()) {
4808 }
4809 }
4810}
4811
4812
4813bool
4817
4818
4819void
4823
4824
4825void
4827 myUndoRedoListEnabled = reason;
4828}
4829
4830
4831const std::string&
4835
4836
4837void
4839 if (myViewNet) {
4840 // destroy Popup (to avoid crashes)
4842 }
4843 // clear undo list and return true to continue with closing/reload
4844 myUndoList->clear();
4845}
4846
4847
4852
4853
4858
4859
4864
4865
4870
4871
4876
4877
4882
4883
4888
4889
4890void
4892 // get option container
4893 auto& neteditOptions = OptionsCont::getOptions();
4894 // get additional files
4895 const auto additionalFiles = neteditOptions.getStringVector("additional-files");
4896 // check if ignore loading of additional files
4897 const auto ignoreLoadAdditionalFiles = neteditOptions.getBool("ignore.additionalelements");
4898 // check conditions
4899 if (ignoreLoadAdditionalFiles) {
4900 // reset flag
4901 neteditOptions.resetWritable();
4902 neteditOptions.set("ignore.additionalelements", "false");
4903 } else if (myNet && (additionalFiles.size() > 0)) {
4904 // use first file as output
4905 neteditOptions.resetWritable();
4906 neteditOptions.set("additional-files", additionalFiles.front());
4907 // begin undolist
4908 myUndoList->begin(Supermode::NETWORK, GUIIcon::SUPERMODENETWORK, TL("loading additional elements from '") + toString(additionalFiles) + "'");
4909 // use this flag for mark all elements as saved after loading, if it was sucessfully
4910 bool setSaved = additionalFiles.size() == 1;
4911 // iterate over every additional file
4912 for (const auto& file : additionalFiles) {
4913 // check if ignore missing imputs
4914 if (FileHelpers::isReadable(file) || !neteditOptions.getBool("ignore-missing-inputs")) {
4915 WRITE_MESSAGE(TL("loading additionals from '") + file + "'");
4916 // declare general handler
4917 GNEGeneralHandler handler(myNet, file, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
4918 // disable validation for additionals
4919 XMLSubSys::setValidation("never", "auto", "auto");
4920 // Run parser
4921 if (!handler.parse()) {
4922 WRITE_ERRORF(TL("Loading of % failed."), file);
4923 }
4924 setSaved &= !handler.isErrorCreatingElement();
4925 // set additionals in SumoConfig
4926 setInputInSumoOptions(false, false);
4927 // disable validation for additionals
4928 XMLSubSys::setValidation("auto", "auto", "auto");
4929 }
4930 }
4931 if (setSaved) {
4933 }
4934 // end undo list
4935 myUndoList->end();
4936 // check if clear undoList
4938 myUndoList->clear();
4939 }
4940 }
4941}
4942
4943
4944void
4946 // get option container
4947 auto& neteditOptions = OptionsCont::getOptions();
4948 // get demand files
4949 const auto demandFiles = neteditOptions.getStringVector("route-files");
4950 // check if ignore loading of additional files
4951 const auto ignoreLoadDemandFiles = neteditOptions.getBool("ignore.routeelements");
4952 // check conditions
4953 if (ignoreLoadDemandFiles) {
4954 // reset flag
4955 neteditOptions.resetWritable();
4956 neteditOptions.set("ignore.routeelements", "false");
4957 } else if (myNet && (demandFiles.size() > 0)) {
4958 // use first file as output
4959 neteditOptions.resetWritable();
4960 neteditOptions.set("route-files", demandFiles.front());
4961 // begin undolist
4962 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODEDEMAND, TL("loading demand elements from '") + toString(demandFiles) + "'");
4963 // use this flag for mark all elements as saved after loading, if it was sucessfully
4964 bool setSaved = demandFiles.size() == 1;
4965 // iterate over every demand file
4966 for (const auto& file : demandFiles) {
4967 // check if ignore missing imputs
4968 if (FileHelpers::isReadable(file) || !neteditOptions.getBool("ignore-missing-inputs")) {
4969 WRITE_MESSAGE(TL("loading demand elements from '") + file + "'");
4970 // declare general handler
4971 GNEGeneralHandler handler(myNet, file, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
4972 // disable validation for additionals
4973 XMLSubSys::setValidation("never", "auto", "auto");
4974 // Run parser
4975 if (!handler.parse()) {
4976 WRITE_ERRORF(TL("Loading of % failed."), file);
4977 }
4978 setSaved &= !handler.isErrorCreatingElement();
4979 // set additionals in SumoConfig
4980 setInputInSumoOptions(false, false);
4981 // disable validation for additionals
4982 XMLSubSys::setValidation("auto", "auto", "auto");
4983 }
4984 }
4985 // end undo list
4986 myUndoList->end();
4987 if (setSaved) {
4989 }
4990 // check if clear undoList
4992 myUndoList->clear();
4993 }
4994 }
4995}
4996
4997
4998void
5000 // get option container
5001 auto& neteditOptions = OptionsCont::getOptions();
5002 // get meanData files
5003 const auto meanDataFiles = neteditOptions.getStringVector("meandata-files");
5004 // continue depending of network and additional files
5005 if (myNet && (meanDataFiles.size() > 0)) {
5006 // use first file as output
5007 neteditOptions.resetWritable();
5008 neteditOptions.set("meandata-files", meanDataFiles.front());
5009 // begin undolist
5010 myUndoList->begin(Supermode::DATA, GUIIcon::MODEMEANDATA, TL("loading meanDatas from '") + toString(meanDataFiles) + "'");
5011 // use this flag for mark all elements as saved after loading, if it was sucessfully
5012 bool setSaved = meanDataFiles.size() == 1;
5013 // iterate over every meanData file
5014 for (const auto& file : meanDataFiles) {
5015 // check if ignore missing imputs
5016 if (FileHelpers::isReadable(file) || !neteditOptions.getBool("ignore-missing-inputs")) {
5017 WRITE_MESSAGE(TL("loading meandatas from '") + file + "'");
5018 // declare general handler
5019 GNEGeneralHandler handler(myNet, file, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
5020 // disable validation for additionals
5021 XMLSubSys::setValidation("never", "auto", "auto");
5022 // Run parser
5023 if (!handler.parse()) {
5024 WRITE_ERRORF(TL("Loading of % failed."), file);
5025 }
5026 setSaved &= !handler.isErrorCreatingElement();
5027 // set additionals in sumo options
5028 setInputInSumoOptions(false, false);
5029 // disable validation for additionals
5030 XMLSubSys::setValidation("auto", "auto", "auto");
5031 }
5032 }
5033 // end undo list
5034 myUndoList->end();
5035 if (setSaved) {
5037 }
5038 // check if clear undoList
5040 myUndoList->clear();
5041 }
5042 }
5043}
5044
5045
5046void
5048 // get option container
5049 auto& neteditOptions = OptionsCont::getOptions();
5050 // get data files
5051 const auto dataFiles = neteditOptions.getStringVector("data-files");
5052 // continue depending of network and data files
5053 if (myNet && (dataFiles.size() > 0)) {
5054 // disable update data
5056 // begin undolist
5057 myUndoList->begin(Supermode::DATA, GUIIcon::SUPERMODEDATA, TL("loading data elements from '") + toString(dataFiles) + "'");
5058 // use this flag for mark all elements as saved after loading, if it was sucessfully
5059 bool setSaved = dataFiles.size() == 1;
5060 // iterate over every data file
5061 for (const auto& file : dataFiles) {
5062 // check if ignore missing imputs
5063 if (FileHelpers::isReadable(file) || !neteditOptions.getBool("ignore-missing-inputs")) {
5064 WRITE_MESSAGE(TL("Loading data elements from '") + file + "'");
5065 GNEDataHandler dataHandler(myNet, file, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
5066 // disable validation for data elements
5067 XMLSubSys::setValidation("never", "auto", "auto");
5068 if (!dataHandler.parse()) {
5069 WRITE_ERRORF(TL("Loading of % failed."), file);
5070 }
5071 setSaved &= !dataHandler.isErrorCreatingElement();
5072 // set first dataElementsFiles as default file
5073 neteditOptions.resetWritable();
5074 neteditOptions.set("data-files", file);
5075 // disable validation for data elements
5076 XMLSubSys::setValidation("auto", "auto", "auto");
5077
5078 }
5079 }
5080 // end undolist
5081 myUndoList->end();
5082 if (setSaved) {
5084 }
5085 // check if clear undoList
5087 myUndoList->clear();
5088 }
5089 // enable update data
5091 }
5092}
5093
5094// ---------------------------------------------------------------------------
5095// GNEApplicationWindow - protected methods
5096// ---------------------------------------------------------------------------
5097
5099 myToolbarsGrip(this),
5100 myMenuBarFile(this),
5101 myFileMenuCommands(this),
5102 myModesMenuCommands(this),
5103 myEditMenuCommands(this),
5104 myLockMenuCommands(this),
5105 myProcessingMenuCommands(this),
5106 myLocateMenuCommands(this),
5107 myToolsMenuCommands(this),
5108 myWindowsMenuCommands(this),
5109 myHelpMenuCommands(this),
5110 mySupermodeCommands(this) {
5111}
5112
5113
5114long
5115GNEApplicationWindow::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
5116 const long handled = FXMainWindow::onKeyPress(o, sel, eventData);
5117 if (handled == 0 && myMDIClient->numChildren() > 0) {
5118 GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
5119 if (w != nullptr) {
5120 w->onKeyPress(nullptr, sel, eventData);
5121 }
5122 }
5123 return 0;
5124}
5125
5126
5127long
5128GNEApplicationWindow::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
5129 const long handled = FXMainWindow::onKeyRelease(o, sel, eventData);
5130 if (handled == 0 && myMDIClient->numChildren() > 0) {
5131 GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
5132 if (w != nullptr) {
5133 w->onKeyRelease(nullptr, sel, eventData);
5134 }
5135 }
5136 return 0;
5137}
5138
5139
5140/****************************************************************************/
FXDEFMAP(GNEApplicationWindow) GNEApplicationWindowMap[]
@ DATA_SELECT
mode for selecting data elements
@ DATA_INSPECT
mode for inspecting data elements
@ DATA_DELETE
mode for deleting data elements
Supermode
@brie enum for supermodes
@ NETWORK
Network mode (Edges, junctions, etc..)
@ DATA
Data mode (edgeData, LaneData etc..)
@ DEMAND
Demand mode (Routes, Vehicles etc..)
@ NETWORK_DELETE
mode for deleting network elements
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_SELECT
mode for selecting network elements
@ NETWORK_INSPECT
mode for inspecting network elements
@ NETWORK_CONNECT
mode for connecting lanes
@ DEMAND_INSPECT
mode for inspecting demand elements
@ DEMAND_DELETE
mode for deleting demand elements
@ DEMAND_SELECT
mode for selecting demand elements
@ DEMAND_MOVE
mode for moving demand elements
long long int SUMOTime
Definition GUI.h:36
@ MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES
automatically create opposite edge
Definition GUIAppEnum.h:847
@ MID_GNE_NETGENERATE
netgenerate dialog
Definition GUIAppEnum.h:761
@ MID_HOTKEY_SHIFT_F10_SUMOOPTIONSMENU
open SUMO options menu (used in netedit)
Definition GUIAppEnum.h:272
@ MID_HOTKEY_SHIFT_F7_ADJUST_PERSON_PLANS
Adjust person plans (start und end positions, arrival positions, etc.)
Definition GUIAppEnum.h:270
@ MID_HOTKEY_CTRL_Q_CLOSE
Main window closes.
Definition GUIAppEnum.h:115
@ MID_HOTKEY_SHIFT_F5_COMPUTEJUNCTIONS_VOLATILE
compute junctions with volatile options
Definition GUIAppEnum.h:268
@ MID_HOTKEY_CTRL_SHIFT_B_SAVEDATAELEMENTS
save Data Elements
Definition GUIAppEnum.h:204
@ MID_HOTKEY_F3_SUPERMODE_DEMAND
select demand supermode in netedit
Definition GUIAppEnum.h:234
@ MID_GNE_UNDOLISTDIALOG
open undo list dialog
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS
show all person plans
Definition GUIAppEnum.h:879
@ MID_GNE_UNLOCK_ALLELEMENTS
unlock all element
Definition GUIAppEnum.h:857
@ MID_GNE_NETGENERATEOPTIONS
netgenerate options
Definition GUIAppEnum.h:763
@ MID_HOTKEY_SHIFT_S_LOCATESTOP
Locate stop - button.
Definition GUIAppEnum.h:188
@ MID_HOTKEY_CTRL_T_OPENNETEDIT_OPENSUMO
Open current SUMO simulation/network in netedit, or current netedit simulation/network in SUMO.
Definition GUIAppEnum.h:123
@ MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING
toggle TAZRel drawing
Definition GUIAppEnum.h:903
@ MID_GNE_TOGGLE_COMPUTE_NETWORK_DATA
enable/disable computing after switchin between supermodes
Definition GUIAppEnum.h:795
@ MID_TOOLBAREDIT_LOADADDITIONALS
load additionals in sumo-gui/netedit after press ctrl+T
Definition GUIAppEnum.h:681
@ MID_HOTKEY_U_MODE_DECAL_TYPEDISTRIBUTION
hotkey for mode decal AND type distribution
Definition GUIAppEnum.h:69
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:821
@ MID_HOTKEY_CTRL_Y_REDO
Undo.
Definition GUIAppEnum.h:133
@ MID_GNE_RUNNETGENERATE
run netgenerate tool
Definition GUIAppEnum.h:773
@ MID_HOTKEY_CTRL_SHIFT_H_SAVEEDGETYPES
save Edge Types
Definition GUIAppEnum.h:212
@ MID_GNE_OPENPYTHONTOOLDIALOG
call tool
Definition GUIAppEnum.h:755
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition GUIAppEnum.h:843
@ MID_HOTKEY_ALT_9_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:161
@ MID_GNE_TOOLBARFILE_RELOAD_EDGETYPES
reload edge types
Definition GUIAppEnum.h:733
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition GUIAppEnum.h:829
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition GUIAppEnum.h:827
@ MID_HOTKEY_ALT_5_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:153
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition GUIAppEnum.h:909
@ MID_HOTKEY_CTRL_W_CLOSESIMULATION
Close simulation - ID.
Definition GUIAppEnum.h:129
@ MID_HOTKEY_ALT_2_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:147
@ MID_GNE_LOCK_ALLELEMENTS
lock all element
Definition GUIAppEnum.h:855
@ MID_HOTKEY_F7_JOIN_SELECTEDJUNCTIONS_ROUTES
join selected junctions in network mode and normalice demand element ids in demand mode
Definition GUIAppEnum.h:242
@ MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS
Perform a single simulation step in SUMO and open Demand Elements in netedit.
Definition GUIAppEnum.h:89
@ MID_HOTKEY_F5_COMPUTE_NETWORK_DEMAND
compute Network in network mode and Demand elements in demand mode
Definition GUIAppEnum.h:238
@ MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:895
@ MID_HOTKEY_CTRL_O_OPENSIMULATION_OPENNETWORK
Open simulation in SUMO and open network in netedit.
Definition GUIAppEnum.h:111
@ MID_GNE_LOCK_MENUTITLE
selector for LockMenuTitle
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition GUIAppEnum.h:833
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition GUIAppEnum.h:881
@ MID_HOTKEY_Z_MODE_TAZ_TAZREL
hotkey for mode editing TAZ and TAZRel
Definition GUIAppEnum.h:75
@ MID_HOTKEY_F9_EDIT_VIEWSCHEME
open edit scheme menu
Definition GUIAppEnum.h:246
@ MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:869
@ MID_HOTKEY_SHIFT_ESC_CLEARSELECTION
clear selection
Definition GUIAppEnum.h:276
@ MID_GNE_LOCK_SELECTEDELEMENTS
lock selected element
Definition GUIAppEnum.h:859
@ MID_HOTKEY_CTRL_J_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:101
@ MID_GNE_TOOLBARFILE_SAVESUMOCONFIG_AS
save SUMOConfig as
Definition GUIAppEnum.h:717
@ MID_GNE_TOOLBARFILE_RELOAD_TLSPROGRAMS
reload TLS Programs
Definition GUIAppEnum.h:729
@ MID_HOTKEY_DEL
hot key delete selections or elements
Definition GUIAppEnum.h:286
@ MID_HOTKEY_A_MODE_STARTSIMULATION_ADDITIONALS_STOPS
hotkey for start simulation in SUMO and set editing mode additionals AND stops in netedit
Definition GUIAppEnum.h:43
@ MID_LANGUAGE_TR
change language to turkish
@ MID_CHANGELOG
changelog button
Definition GUIAppEnum.h:655
@ MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE
ask before merging junctions
Definition GUIAppEnum.h:839
@ MID_GNE_TOOLBARFILE_OPENFOREIGN
open foreign network
Definition GUIAppEnum.h:707
@ MID_GNE_TOGGLE_TIMEFORMAT
switch time format
Definition GUIAppEnum.h:801
@ MID_GNE_TOOLBARFILE_RELOAD_NETEDITCONFIG
reload neteditConfig
Definition GUIAppEnum.h:711
@ MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS
Edit simulation breakpoints in SUMO and open Data Elements in netedit.
Definition GUIAppEnum.h:85
@ MID_TOOLBAREDIT_LOADDEMAND
load demand in sumo-gui/netedit after press ctrl+T
Definition GUIAppEnum.h:683
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition GUIAppEnum.h:867
@ MID_HOTKEY_ALT_3_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:149
@ MID_HOTKEY_F1_ONLINEDOCUMENTATION
open online documentation
Definition GUIAppEnum.h:230
@ MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS
Save Demand Elements.
Definition GUIAppEnum.h:208
@ MID_GNE_POSTPROCESSINGPYTHONTOOL
call tool for post processing
Definition GUIAppEnum.h:759
@ MID_HOTKEY_CTRL_R_RELOAD
Reload the previously loaded simulation.
Definition GUIAppEnum.h:119
@ MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK
Stop the simulation in SUMO and save network in netedit.
Definition GUIAppEnum.h:117
@ MID_GNE_TOOLBARFILE_RELOAD_MEANDATAS
reload meanDatas
Definition GUIAppEnum.h:747
@ MID_HOTKEY_D_MODE_SINGLESIMULATIONSTEP_DELETE
hotkey for perform a single simulation step in SUMO and set delete mode in netedit
Definition GUIAppEnum.h:49
@ MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES
create edges in chain mode
Definition GUIAppEnum.h:845
@ MID_HOTKEY_ESC
hot key <ESC> abort current edit operation
Definition GUIAppEnum.h:284
@ MID_GNE_TOOLBARFILE_SAVEDATA_AS
save data elements as
Definition GUIAppEnum.h:739
@ MID_HOTKEY_F10_OPTIONSMENU
open options menu
Definition GUIAppEnum.h:248
@ MID_HOTKEY_F11_FRONTELEMENT
set/clear front element
Definition GUIAppEnum.h:250
@ MID_HOTKEY_F8_CLEANINVALID_CROSSINGS_DEMANDELEMENTS
clean invalid crossings in network mode and demand elements in demand mode
Definition GUIAppEnum.h:244
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:901
@ MID_HOTKEY_C_MODE_CONNECT_CONTAINER
hotkey for mode connecting lanes AND container
Definition GUIAppEnum.h:45
@ MID_HOTKEY_H_MODE_PROHIBITION_CONTAINERPLAN
hotkey for mode prohibition AND container plan
Definition GUIAppEnum.h:53
@ MID_HOTKEY_SHIFT_O_LOCATEPOI
Locate poi - button.
Definition GUIAppEnum.h:182
@ MID_HOTKEY_W_MODE_WIRE_ROUTEDISTRIBUTION
hotkey for mode editing overhead wires AND route distributions
Definition GUIAppEnum.h:73
@ MID_HOTKEY_T_MODE_TLS_TYPE
hotkey for mode editing TLS AND Vehicle Types
Definition GUIAppEnum.h:67
@ MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES
hide shapes
Definition GUIAppEnum.h:875
@ MID_GNE_TOGGLE_UNDOREDO
enable/disable undo-redo
Definition GUIAppEnum.h:797
@ MID_LANGUAGE_ZHT
change language to chinese (traditional)
@ MID_LANGUAGE_ES
change language to spanish
@ MID_HOTKEY_SHIFT_A_LOCATEADDITIONAL
Locate additional structure - button.
Definition GUIAppEnum.h:172
@ MID_HOTKEY_ALT_4_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:151
@ MID_GNE_TOOLBARFILE_SAVETLSPROGRAMS_AS
save TLS Programs as
Definition GUIAppEnum.h:727
@ MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS
show additionals
Definition GUIAppEnum.h:897
@ MID_HOTKEY_SHIFT_R_LOCATEROUTE
Locate route - button.
Definition GUIAppEnum.h:186
@ MID_GNE_RUNPYTHONTOOL
run python
Definition GUIAppEnum.h:757
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition GUIAppEnum.h:841
@ MID_HOTKEY_SHIFT_W_LOCATEWALKINGAREA
Locate edge - button.
Definition GUIAppEnum.h:194
@ MID_GNE_TOOLBARFILE_RELOAD_DEMANDELEMENTS
reload demand elements
Definition GUIAppEnum.h:737
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition GUIAppEnum.h:835
@ MID_HOTKEY_CTRL_I_EDITVIEWPORT
Open viewport editor.
Definition GUIAppEnum.h:99
@ MID_RECENTFILE
Loads a file previously loaded.
Definition GUIAppEnum.h:318
@ MID_HOTKEY_S_MODE_STOPSIMULATION_SELECT
hotkey for stop simulation in SUMO and set select mode in netedit
Definition GUIAppEnum.h:63
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS
show sub-additionals
Definition GUIAppEnum.h:831
@ MID_HOTKEY_SHIFT_C_LOCATECONTAINER
Locate container - button.
Definition GUIAppEnum.h:174
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS
show all container plans
Definition GUIAppEnum.h:883
@ MID_HOTKEY_CTRL_SHIFT_N_NEWWINDOW
open a new window (SUMO AND netedit)
Definition GUIAppEnum.h:218
@ MID_HOTKEY_SHIFT_V_LOCATEVEHICLE
Locate vehicle - button.
Definition GUIAppEnum.h:192
@ MID_LANGUAGE_HU
change language to hungarian
@ MID_HOTKEY_F4_SUPERMODE_DATA
select data supermode in netedit
Definition GUIAppEnum.h:236
@ MID_HOTKEY_SHIFT_L_LOCATEPOLY
Locate polygons - button.
Definition GUIAppEnum.h:180
@ MID_HOTKEY_F6_CLEAN_SOLITARYJUNCTIONS_UNUSEDROUTES
clean junctions without edges in network mode and unused routes in demand mode
Definition GUIAppEnum.h:240
@ MID_HOTKEY_ALT_1_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:145
@ MID_HOTKEY_CTRL_K_OPENTLSPROGRAMS
Load file with TLS Programs.
Definition GUIAppEnum.h:103
@ MID_LANGUAGE_IT
change language to italian
@ MID_GNE_LOCK_ELEMENT
lock element
Definition GUIAppEnum.h:853
@ MID_GNE_TOOLBARFILE_SAVENETEDITCONFIG_AS
save neteditConfig as
Definition GUIAppEnum.h:713
@ MID_HOTKEY_SHIFT_E_LOCATEEDGE
Locate edge - button.
Definition GUIAppEnum.h:176
@ MID_CLEARMESSAGEWINDOW
Clear simulation output.
Definition GUIAppEnum.h:367
@ MID_GNE_TOOLBARFILE_OPENMEANDATAS
open meanData file
Definition GUIAppEnum.h:743
@ MID_HOTKEY_R_MODE_CROSSING_ROUTE_EDGERELDATA
hotkey for mode editing crossing, routes and edge rel datas
Definition GUIAppEnum.h:65
@ MID_TUTORIAL
tutorial button
Definition GUIAppEnum.h:659
@ MID_GNE_TOGGLE_UNDOREDO_LOADING
enable/disable undo-redo during loading
Definition GUIAppEnum.h:799
@ MID_HOTKEY_CTRL_G_GAMINGMODE_TOGGLEGRID
Toggle Gaming mode in SUMO and grid in netedit.
Definition GUIAppEnum.h:95
@ MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL
toggle draw TAZ fill
Definition GUIAppEnum.h:905
@ MID_HOTKEY_ALT_6_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:155
@ MID_HOTKEY_CTRL_SHIFT_M_SAVEMEANDATAS
save Mean Datas
Definition GUIAppEnum.h:216
@ ID_LOADTHREAD_EVENT
The loading thread.
Definition GUIAppEnum.h:346
@ MID_HOTKEY_L_MODE_PERSONPLAN
hotkey for mode person plan
Definition GUIAppEnum.h:57
@ MID_GNE_TOOLBARFILE_SAVEMEANDATAS_AS
save meanDatas as
Definition GUIAppEnum.h:745
@ MID_GNE_TOOLBARFILE_RELOAD_ADDITIONALS
reload additionals
Definition GUIAppEnum.h:725
@ MID_HOTKEY_V_MODE_VEHICLE
hotkey for mode create vehicles
Definition GUIAppEnum.h:71
@ MID_HOTKEY_SHIFT_P_LOCATEPERSON
Locate person - button.
Definition GUIAppEnum.h:184
@ MID_HOTKEY_I_MODE_INSPECT
hotkey for mode inspecting object attributes
Definition GUIAppEnum.h:55
@ MID_LANGUAGE_EN
change language to english
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:823
@ MID_HOTKEY_SHIFT_J_LOCATEJUNCTION
Locate junction - button.
Definition GUIAppEnum.h:178
@ MID_HOTKEY_ALT_0_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:143
@ MID_HOTKEY_CTRL_SHIFT_E_SAVENETEDITCONFIG
save netedit Config
Definition GUIAppEnum.h:210
@ MID_GNE_TOOLBARFILE_SAVEADDITIONALS_AS
save additionals as
Definition GUIAppEnum.h:721
@ MID_GNE_TOOLBARFILE_SAVEEDGETYPES_AS
save edgeTypes as
Definition GUIAppEnum.h:731
@ MID_HOTKEYS
hotkeys button
Definition GUIAppEnum.h:657
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition GUIAppEnum.h:873
@ MID_LANGUAGE_DE
change language to german
@ MID_HOTKEY_ALT_F4_CLOSE
Main window closes.
Definition GUIAppEnum.h:163
@ MID_HOTKEY_CTRL_SHIFT_A_SAVEADDITIONALS
Save Additional Elements.
Definition GUIAppEnum.h:202
@ MID_GNE_TOOLBARFILE_RELOADNETWORK
reload only network
Definition GUIAppEnum.h:705
@ MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY
copy template
Definition GUIAppEnum.h:264
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition GUIAppEnum.h:837
@ MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS
Start the simulation in SUMO and open Additionals Elements in netedit.
Definition GUIAppEnum.h:83
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition GUIAppEnum.h:899
@ MID_GNE_POSTPROCESSINGNETGENERATE
postprocesing netgenerate
Definition GUIAppEnum.h:775
@ MID_HOTKEY_E_MODE_EDGE_EDGEDATA
hotkey for mode adding edges AND edgeDatas
Definition GUIAppEnum.h:51
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM
toggle draw TAZRel only from
Definition GUIAppEnum.h:907
@ MID_HOTKEY_ALT_8_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:159
@ MID_GNE_TOOLBARFILE_RELOAD_SUMOCONFIG
reload SUMOConfig
Definition GUIAppEnum.h:715
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:819
@ MID_HOTKEY_CTRL_SHIFT_O_OPENNETCONVERTFILE
open Netconvert file
Definition GUIAppEnum.h:220
@ MID_GNE_RECOMPUTINGNEEDED
check if recomputing is needed
@ MID_HOTKEY_CTRL_M_OPENSUMOCONFIG
open sumo config
Definition GUIAppEnum.h:107
@ MID_GNE_TOOLBARFILE_SAVEDEMAND_AS
save demand elements as
Definition GUIAppEnum.h:735
@ MID_GNE_TOOLBARFILE_SAVENETWORK_AS
save network as
Definition GUIAppEnum.h:719
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:871
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition GUIAppEnum.h:887
@ MID_HOTKEY_CTRL_Z_UNDO
Redo.
Definition GUIAppEnum.h:135
@ MID_GNE_MODESMENUTITLE
selector for ModesMenuTitle
@ MID_FEEDBACK
feedback button
Definition GUIAppEnum.h:661
@ MID_HOTKEY_CTRL_H_APPSETTINGS_OPENEDGETYPES
open app setting dialog in SUMO and open edge type files in netedit
Definition GUIAppEnum.h:97
@ MID_HOTKEY_BACKSPACE
hot key <Backspace> remove last sub-operation
Definition GUIAppEnum.h:290
@ MID_HOTKEY_CTRL_SHIFT_S_SAVESUMOCONFIG
save SUMOConfig (SUMO AND netedit)
Definition GUIAppEnum.h:222
@ MID_HOTKEY_ALT_7_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:157
@ MID_HOTKEY_F12_ABOUT
open about dialog
Definition GUIAppEnum.h:254
@ MID_HOTKEY_CTRL_E_EDITSELECTION_LOADNETEDITCONFIG
Edit selection in SUMO and load neteditConfig in netedit.
Definition GUIAppEnum.h:91
@ MID_HOTKEY_ENTER
hot key <ENTER> accept current operation
Definition GUIAppEnum.h:288
@ MID_GNE_TOOLBARFILE_RELOAD_DATAELEMENTS
reload data elements
Definition GUIAppEnum.h:741
@ MID_HOTKEY_CTRL_SHIFT_K_SAVETLS
save TLS Programs
Definition GUIAppEnum.h:214
@ MID_HOTKEY_SHIFT_F1_TEMPLATE_SET
set template
Definition GUIAppEnum.h:262
@ MID_HOTKEY_SHIFT_T_LOCATETLS
Locate TLS - button.
Definition GUIAppEnum.h:190
@ MID_HOTKEY_M_MODE_MOVE_MEANDATA
hotkey for mode moving element AND mean data
Definition GUIAppEnum.h:59
@ MID_HOTKEY_F2_SUPERMODE_NETWORK
select network supermode in netedit
Definition GUIAppEnum.h:232
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER
lock container
Definition GUIAppEnum.h:885
@ MID_HOTKEY_SHIFT_F12_FOCUSUPPERELEMENT
focus upper element of current frame (only used in netedit)
Definition GUIAppEnum.h:274
@ MID_GNE_AUTOMATICFILENAME
create automatic filename if it was not defined previously
@ MID_HOTKEY_CTRL_N_OPENNETWORK_NEWNETWORK
open network in SUMO and create new empty network in netedit
Definition GUIAppEnum.h:109
@ MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR
clear template
Definition GUIAppEnum.h:266
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition GUIAppEnum.h:825
@ MID_LANGUAGE_ZH
change language to chinese (simplified)
@ MID_GNE_SAVEJOINEDJUNCTIONS
save joined junctions
Definition GUIAppEnum.h:709
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition GUIAppEnum.h:877
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition GUIAppEnum.h:817
@ MID_LANGUAGE_FR
change language to french
@ MID_GNE_TOOLBARFILE_SAVEJUPEDSIMELEMENTS_AS
save JuPedSim as
Definition GUIAppEnum.h:723
@ MID_HOTKEY_P_MODE_POLYGON_PERSON
hotkey for mode creating polygons
Definition GUIAppEnum.h:61
@ MID_HOTKEY_CTRL_L_SAVEASPLAINXML
save network as plain XML
Definition GUIAppEnum.h:105
@ MID_GNE_TOOLBAREDIT_COMPUTEPATHMANAGER
compute path manager
Definition GUIAppEnum.h:793
@ MID_WINDOW
Main window-ID.
Definition GUIAppEnum.h:298
GUICompleteSchemeStorage gSchemeStorage
#define GUIDesignButtonStatusBarFixed
button rectangular with thick and raise frame with a width of 100
Definition GUIDesigns.h:106
#define GUIDesignHorizontalFrameStatusBar
Horizontal frame used in status bar.
Definition GUIDesigns.h:340
#define GUIDesignLabelStatusBar
label used in statusBar
Definition GUIDesigns.h:282
#define GUIDesignSplitter
Definition GUIDesigns.h:474
#define GUIDesignSplitterMDI
MDI Splitter.
Definition GUIDesigns.h:477
#define GUIDesignStatusBar
design used in status bar
Definition GUIDesigns.h:446
@ MESSAGE_OCCURRED
send when a message occured
@ GLDEBUG_OCCURRED
send when a gldebug occured
@ ERROR_OCCURRED
send when a error occured
@ SIMULATION_LOADED
send when a simulation has been loaded
@ DEBUG_OCCURRED
send when a debug occured
@ WARNING_OCCURRED
send when a warning occured
GUISelectedStorage gSelected
A global holder of selected objects.
FXString gCurrentFolder
The folder used as last.
@ MODEMEANDATA
@ MODEADDITIONAL
@ SUPERMODEDEMAND
@ NETEDIT_MINI
@ VCLASS_SMALL_TAXI
@ MODECREATEEDGE
@ TOOL_TURNDEFS
@ SUPERMODENETWORK
@ SUPERMODEDATA
@ TOOL_CITYBRAIN
#define WRITE_DEBUG(msg)
Definition MsgHandler.h:306
#define WRITE_ERRORF(...)
Definition MsgHandler.h:305
#define WRITE_MESSAGE(msg)
Definition MsgHandler.h:297
#define WRITE_ERROR(msg)
Definition MsgHandler.h:304
#define TL(string)
Definition MsgHandler.h:315
#define TLF(string,...)
Definition MsgHandler.h:317
#define PROGRESS_FAILED_MESSAGE()
Definition MsgHandler.h:303
@ GNE_TAG_TRIP_JUNCTIONS
a trip between junctions
@ GNE_TAG_FLOW_JUNCTIONS
a flow between junctions
@ GNE_TAG_JPS_OBSTACLE
polygon used for draw juPedSim obstacles
@ GNE_TAG_JPS_WALKABLEAREA
polygon used for draw juPedSim walkable areas
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
bool isErrorCreatingElement() const
get flag for mark if a element wasn't created
bool parse()
parse
void setSelector(FXSelector sel)
set the selector
void setTarget(FXObject *tgt)
set the target
static bool isReadable(std::string path)
Checks whether the given file is readable.
static std::string getFilePath(const std::string &path)
Removes the file information from the given path.
static void resetFont()
to be called when the font context is invalidated
Definition GLHelper.cpp:666
The application's "About" - dialog.
Definition GNEAbout.h:33
void create()
Creates the widget.
Definition GNEAbout.cpp:86
The main window of Netedit.
long onCmdSaveAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals is executed
long onCmdOpenNetgenerateDialog(FXObject *, FXSelector, void *)
called when user press "netgenerate" button
FXMenuPane * myFileMenuMeanDataElements
GNEApplicationWindowHelper::SupermodeCommands mySupermodeCommands
Supermode Commands.
long onCmdToggleUndoRedoLoading(FXObject *, FXSelector, void *)
called when toggle checkbox disable undo redo during loading (file)
FXMenuPane * myToolsImportCityBrainMenu
long onCmdSaveTLSProgramsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save TLSPrograms as is executed
FXMenuTitle * myModesMenuTitle
menu title for modes
const std::string & isUndoRedoEnabledTemporally() const
check if undo-redo is enabled temporally
void create()
Creates the main window (required by FOX)
long onCmdToggleDrawJunctionShape(FXObject *, FXSelector, void *)
called if the user press key combination Ctrl + J to toggle draw junction shape
GNEApplicationWindowHelper::WindowsMenuCommands myWindowsMenuCommands
Windows Menu Commands.
GNELoadThread * myLoadThread
the thread that loads the network
void enableUndoRedoTemporally()
enable undo-redo temporally (for example, after creating an edge)
void clearUndoList()
clear undo list
GNENet * myNet
we are responsible for the net
long onCmdSaveEdgeTypes(FXObject *, FXSelector, void *)
called when the command/FXCall save edge types is executed
long onCmdOpenUndoListDialog(FXObject *, FXSelector, void *)
long onCmdReloadSumoConfig(FXObject *, FXSelector, void *)
called when the command/FXCall reload SumoConfig is executed
void handleEvent_Message(GUIEvent *e)
handle event of type message
void setInputInSumoOptions(const bool ignoreAdditionals, const bool ignoreRoutes)
set input files in sumo options
long onCmdReloadDataElements(FXObject *, FXSelector, void *)
called when the command/FXCall reload data elements is executed
bool continueWithUnsavedAdditionalChanges()
warns about unsaved changes in additionals and gives the user the option to abort
long onCmdLoadAdditionalsInSUMOGUI(FXObject *, FXSelector, void *)
called when user toggle windows checkbox "load additionals"
long onCmdOpenTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall open TLS programs is executed
bool continueWithUnsavedChanges()
warns about unsaved changes and gives the user the option to abort
long onUpdComputePathManager(FXObject *obj, FXSelector sel, void *ptr)
called when the update/FXCall compute path manager is executed
void updateControls()
update control contents after undo/redo or recompute
GNEApplicationWindowHelper::LockMenuCommands myLockMenuCommands
Lock Menu Commands.
long computeJunctionWithVolatileOptions()
called if the user selects Processing->compute junctions with volatile options
long onCmdFeedback(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->feedback
long onCmdNewNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall new network is executed
long onCmdSavePlainXMLAs(FXObject *, FXSelector, void *)
called when the command/FXCall save as plain xml is executed
long onCmdOpenOptionsDialog(FXObject *, FXSelector, void *)
called when user press "options" button
GNEApplicationWindowHelper::HelpMenuCommands myHelpMenuCommands
Help Menu Commands.
GNEApplicationWindow()
FOX needs this for static members.
long onClipboardRequest(FXObject *sender, FXSelector sel, void *ptr)
called when the command/FXCall clipboard request is executed
long onCmdToggleUndoRedo(FXObject *, FXSelector, void *)
called when toggle checkbox disable undo redo (processing)
long onCmdSaveNeteditConfigAs(FXObject *, FXSelector, void *)
called when the command/FXCall save netedit config as is executed
long onUpdSaveNetwork(FXObject *, FXSelector, void *)
called when the update/FXCall save network is executed
std::string myUndoRedoListEnabled
string to check if undo/redo list is enabled (a String is used to keep the disabling reason)
long onUpdSaveEdgeTypesAs(FXObject *, FXSelector, void *)
called when the command/FXCall save edgeTypes as is updated
std::map< std::string, FXMenuPane * > myMenuPaneToolMaps
map with menu pane tools and strings
long onCmdSaveSumoConfig(FXObject *, FXSelector, void *)
called when the command/FXCall save SumoConfig is executed
long onUpdReloadDataElements(FXObject *, FXSelector, void *)
called when the command/FXCall reload data elements is updated
long onCmdClose(FXObject *, FXSelector, void *)
called when the command/FXCall close is executed
long onCmdEditViewport(FXObject *, FXSelector, void *)
Called on menu Edit->Viewport.
long onCmdToggleViewOption(FXObject *, FXSelector, void *)
toggle viewOption
FXEX::MFXThreadEvent myLoadThreadEvent
io-event with the load-thread
OptionsCont myOriginalNetgenerateOptions
original netgenerate options container
long onCmdToggleEditOptions(FXObject *, FXSelector, void *)
called if the user press key combination Alt + <0-9>
GNEApplicationWindowHelper::MenuBarFile myMenuBarFile
MenuBarFile.
OptionsCont myOriginalNeteditOptions
original netedit options container
long onCmdOpenAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall open additionals is executed
long onUpdRedo(FXObject *obj, FXSelector sel, void *ptr)
called when the update/FXCall redo is executed
GNEApplicationWindowHelper::ModesMenuCommands & getModesMenuCommands()
get modes Menu Commands (needed for show/hide menu commands)
long onCmdToggleTimeFormat(FXObject *sender, FXSelector sel, void *ptr)
called if the user press the toggle time format button
long onCmdRunNetgenerate(FXObject *sender, FXSelector sel, void *ptr)
called when run netgenerate is called
GNEApplicationWindowHelper::ProcessingMenuCommands myProcessingMenuCommands
Processing Menu Commands.
OptionsCont & getSumoOptions()
get SUMO options container
long onUpdSaveAdditionalsAs(FXObject *, FXSelector, void *)
called when the update/FXCall save additionals as is executed
GNEApplicationWindowHelper::EditMenuCommands & getEditMenuCommands()
get Edit Menu Commands (needed for show/hide menu commands)
void setStatusBarText(const std::string &statusBarText)
set text of the statusBar
GNEUndoList * myUndoList
the one and only undo list
FXMenuPane * myToolsVisualizationMenu
long onUpdSaveDataElements(FXObject *, FXSelector, void *)
called when the update/FXCall save data elements is executed
long onCmdSmartReload(FXObject *, FXSelector, void *)
called when the command/FXCall smart reload is executed
long onCmdPaste(FXObject *, FXSelector, void *)
long onUpdSaveDemandElementsAs(FXObject *, FXSelector, void *)
called when the update/FXCall save demand elements as is executed
long onUpdPythonTool(FXObject *, FXSelector, void *)
called when the command/FXCall python tool is updated
long onCmdOpenNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall open network is executed
void closeAllWindows()
this method closes all windows and deletes the current simulation *‍/
long onCmdComputePathManager(FXObject *, FXSelector, void *)
long onCmdToggleComputeNetworkData(FXObject *, FXSelector, void *)
called when toggle checkbox compute network when switching between supermodes
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
long onUpdReloadMeanDatas(FXObject *, FXSelector, void *)
called when the command/FXCall reload meanDatas is updated
FXString getFolder(const std::string &folder) const
extract folder
long onLoadThreadEvent(FXObject *, FXSelector, void *)
called when the command/FXCall load thread is executed
long onUpdRequireRecomputing(FXObject *sender, FXSelector sel, void *ptr)
update label for require recomputing
FXMDIMenu * myMDIMenu
The menu used for the MDI-windows.
long onCmdReloadDemandElements(FXObject *, FXSelector, void *)
called when the command/FXCall reload demand elements is executed
long onUpdSaveDemandElements(FXObject *, FXSelector, void *)
called when the update/FXCall save demand elements is executed
OptionsCont myOriginalSumoOptions
original sumo options container
OptionsCont myNetgenerateOptions
netgenerate options container
long onUpdReloadAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall reload additionals is updated
SUMOTime getCurrentSimTime() const
get current simulation time (pure virtual but we don't need it)
long onCmdReloadEdgeTypes(FXObject *, FXSelector, void *)
called when the command/FXCall reload edge types is executed
long onCmdLockAllElements(FXObject *, FXSelector sel, void *)
called when user press lock all elements button
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when a key is pressed
long onCmdQuit(FXObject *, FXSelector, void *)
Called by FOX if the application shall be closed.
long onCmdSaveEdgeTypesAs(FXObject *, FXSelector, void *)
called when the command/FXCall save edgeTypes as is executed
long onCmdClearSelectionShortcut(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits key combination for clear selection
long onCmdClearMsgWindow(FXObject *, FXSelector, void *)
called when the command/FXCall clear message windows is executed
long onCmdLockElements(FXObject *, FXSelector sel, void *)
called when user press a lock menu check
MFXButtonTooltip * myRequireRecomputingButton
Button used for show if recomputing is needed.
long onCmdClearTemplate(FXObject *, FXSelector, void *)
MFXSynchQue< GUIEvent * > myEvents
List of got requests.
GNEUndoList * getUndoList()
get pointer to undoList
long onUpdSaveNeteditConfig(FXObject *, FXSelector, void *)
called when the command/FXCall save netedit config is updated
long onUpdNeedsFrontElement(FXObject *, FXSelector, void *)
called when the update/FXCall needs front element is executed
long onCmdProcessButton(FXObject *, FXSelector sel, void *)
called when user press a process button (or a shortcut)
FXMenuTitle * myLockMenuTitle
menu title for lock
void loadOptionOnStartup()
load net on startup
GNEViewNet * getViewNet()
get pointer to viewNet
long onUpdSaveMeanDatasAs(FXObject *, FXSelector, void *)
called when the update/FXCall save meanDatas as is executed
long onCmdOpenSumoConfig(FXObject *, FXSelector, void *)
called when the command/FXCall open SumoConfig is executed
long onCmdSaveAdditionalsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals as is executed
GNEUndoListDialog * getUndoListDialog()
get pointer to undoList dialog
GNEApplicationWindowHelper::LocateMenuCommands myLocateMenuCommands
Locate Menu Commands.
long onCmdUndo(FXObject *, FXSelector, void *)
called when user press Ctrl+Z
long onCmdAbout(FXObject *, FXSelector, void *)
called when the command/FXCall show about dialog is executed
long onUpdReloadEdgeTypes(FXObject *, FXSelector, void *)
called when the command/FXCall reload edge types is updated
void disableUndoRedoTemporally(const std::string &reason)
disable undo-redo temporally giving a string with the reason (for example, if we're creating an edge)
long onCmdToggleGrid(FXObject *, FXSelector, void *)
called if the user press key combination Ctrl + G to toggle grid
void loadDataElements()
load data elements
void dependentBuild()
build dependent
long onUpdSaveDataElementsAs(FXObject *, FXSelector, void *)
called when the update/FXCall save data elements as is executed
FXMenuPane * myFileMenuDemandElements
long onCmdEditChosen(FXObject *, FXSelector, void *)
called when the command/FXCall edit chosen is executed
long onUpdReloadTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall reload TLS programs is updated
long onCmdOpenSumoOptionsDialog(FXObject *, FXSelector, void *)
called when user press "sumo options" button
GNEApplicationWindowHelper::EditMenuCommands myEditMenuCommands
Edit Menu Commands.
long onCmdSetSuperMode(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits an edit-supermode hotkey
long onUpdSaveSumoConfig(FXObject *, FXSelector, void *)
called when the command/FXCall save SumoConfig is updated
long onCmdAbort(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits esc
void loadDemandElements()
load demand elements
void loadAdditionalElements()
load additional elements
GNEViewNet * myViewNet
pointer to current view net
long onCmdReloadAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall reload additionals is executed
long onUpdOpenUndoListDialog(FXObject *, FXSelector, void *)
long onUpdNeedsNetworkElement(FXObject *, FXSelector, void *)
called when the update/FXCall needs at least one network element is executed
const FXString myTitlePrefix
the prefix for the window title
long onCmdSaveMeanDatasAs(FXObject *, FXSelector, void *)
called when the command/FXCall save meanDatas as is executed
long onCmdSaveNetworkAs(FXObject *, FXSelector, void *)
called when the command/FXCall save network as is executed
double getTrackerInterval() const
get current tracker interval (pure virtual but we don't need it)
void fillMenuBar()
Builds the menu bar.
long onCmdFocusFrame(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits key combination for focus on frame
void loadConfiguration(const std::string &configurationFile)
starts to load a configuration
GNEApplicationWindowHelper::LockMenuCommands & getLockMenuCommands()
get lock Menu Commands
long onCmdOpenMeanDatas(FXObject *, FXSelector, void *)
called when the command/FXCall open meanDatas is executed
long onCmdPostprocessingNetgenerate(FXObject *sender, FXSelector sel, void *ptr)
postprocessing netgenerate
long onCmdHelp(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Documentation
long onCmdSaveNeteditConfig(FXObject *, FXSelector, void *)
called when the command/FXCall save netedit config is executed
long onUpdRequireViewNet(FXObject *sender, FXSelector sel, void *ptr)
enable or disable sender object depending if viewNet exist
bool continueWithUnsavedDemandElementChanges()
warns about unsaved changes in demand elements and gives the user the option to abort
long onUpdReloadNeteditConfig(FXObject *, FXSelector, void *)
called when the command/FXCall reload netedit config is updated
OptionsCont & getNetgenerateOptions()
get netgenerate options container
long onCmdSaveDemandElements(FXObject *, FXSelector, void *)
called when the command/FXCall save demand elements is executed
bool continueWithUnsavedDataElementChanges()
warns about unsaved changes in data elements and gives the user the option to abort
long onCmdCut(FXObject *, FXSelector, void *)
called when user press Ctrl+Z
long onCmdNewWindow(FXObject *, FXSelector, void *)
long onCmdSaveJoinedJunctionsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save joined is executed
long onCmdOpenEdgeTypes(FXObject *, FXSelector, void *)
called when the command/FXCall open edgeType is executed
long onCmdSaveJuPedSimElementsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save JuPedSim elements as is executed
long onCmdLoadDemandInSUMOGUI(FXObject *, FXSelector, void *)
called when user toggle windows checkbox "load demand"
long onUpdLockMenuTitle(FXObject *, FXSelector sel, void *)
enable or disable lock menu title
bool myAmLoading
information whether the gui is currently loading and the load-options shall be greyed out
long onUpdSaveAdditionals(FXObject *, FXSelector, void *)
called when the update/FXCall save additionals is executed
long onCmdSaveDemandElementsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save demand elements as is executed
long onCmdReloadTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall reload TLS programs is executed
long onCmdSaveDataElementsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save data elements as is executed
GNEApplicationWindowHelper::FileMenuCommands myFileMenuCommands
File Menu Commands.
void loadMeanDataElements()
load meanData elements
void loadOSM(const std::string &OSMFile)
starts to load a OSM File
long onCmdOpenNeteditConfig(FXObject *, FXSelector, void *)
called when the command/FXCall open netedit config is executed
bool myAllowUndoRedoLoading
allow undo-redo loading (read from registry)
long onCmdOpenRecent(FXObject *, FXSelector, void *)
called when the command/FXCall open recent is executed
bool myAllowUndoRedo
allow undo-redo (read from registry)
long onCmdChangelog(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Changelog
long onUpdOpen(FXObject *, FXSelector, void *)
called when the command/FXCall on update open executed
long onCmdSetMode(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits an edit-mode hotkey
bool myHadDependentBuild
check if had dependent build
long onCmdBackspace(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits backspace
void updateRecomputingLabel()
update recomputing label
void handleEvent_NetworkLoaded(GUIEvent *e)
handle event of type Network loaded
long onCmdCopy(FXObject *, FXSelector, void *)
long onCmdSaveMeanDatas(FXObject *, FXSelector, void *)
called when the command/FXCall save meanDatas is executed
long onCmdReloadMeanDatas(FXObject *, FXSelector, void *)
called when the command/FXCall reload meanDatas is executed
long onCmdOpenSUMOGUI(FXObject *sender, FXSelector sel, void *ptr)
called if the user hints ctrl + T
long onCmdOpenDemandElements(FXObject *, FXSelector, void *)
called when the command/FXCall open demand is executed
void loadNetwork(const std::string &networkFile)
load network
long onUpdToggleViewOption(FXObject *, FXSelector, void *)
update viewOption
GNEApplicationWindowHelper::ToolsMenuCommands myToolsMenuCommands
Tools Menu Commands.
long onCmdUnlockAllElements(FXObject *, FXSelector sel, void *)
called when user press unlock all elements button
long onUpdReloadSumoConfig(FXObject *, FXSelector, void *)
called when the command/FXCall reload SumoConfig is updated
long onUpdNeedsNetwork(FXObject *, FXSelector, void *)
called when the update/FXCall needs network is executed
GNEApplicationWindowHelper::ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
long onUpdSaveJuPedSimElementsAs(FXObject *, FXSelector, void *)
called when the update/FXCall save juPedSim as is executed
long onUpdReloadNetwork(FXObject *, FXSelector, void *)
called when the update/FXCall network reload is executed
OptionsCont mySumoOptions
sumo options container
bool consoleOptionsLoaded()
check if console options was already loaded
long onCmdSaveDataElements(FXObject *, FXSelector, void *)
called when the command/FXCall save data elements is executed
long onCmdOpenPythonToolDialog(FXObject *obj, FXSelector, void *)
called when user press over a tool dialog button
long onCmdLocate(FXObject *, FXSelector, void *)
called when the command/FXCall locate is executed
long onCmdDel(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits del
long onCmdHotkeys(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Hotkeys
long onCmdOpenDataElements(FXObject *, FXSelector, void *)
called when the command/FXCall open data is executed
long onCmdRunPythonTool(FXObject *obj, FXSelector, void *)
called when user run a tool
void updateSuperModeMenuCommands(const Supermode supermode)
update FXMenuCommands depending of supermode
FXMenuPane * myFileMenuRecentNetworks
bool myConsoleOptionsLoaded
flag for check if console options was already loaded
long onCmdSetFrontElement(FXObject *, FXSelector, void *)
called if the user call set front element
GNEUndoListDialog * myUndoListDialog
undoList dialog
long onUpdReloadDemandElements(FXObject *, FXSelector, void *)
called when the command/FXCall reload demand elements is updated
void createNewNetwork()
create new network
long onCmdEnter(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits enter
FXCursor * getDefaultCursor()
get default cursor
long onCmdSetTemplate(FXObject *, FXSelector, void *)
GNEApplicationWindowHelper::FileMenuCommands & getFileMenuCommands()
get file Menu Commands (needed for show/hide menu commands)
long onUpdSaveMeanDatas(FXObject *, FXSelector, void *)
called when the update/FXCall save meanDatas is executed
long onCmdTutorial(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Tutorial
long onCmdRedo(FXObject *, FXSelector, void *)
long onCmdOpenNetgenerateOptionsDialog(FXObject *, FXSelector, void *)
called when user press "netgenerate options" button
bool continueWithUnsavedMeanDataElementChanges()
warns about unsaved changes in meanData elements and gives the user the option to abort
long onUpdUndo(FXObject *obj, FXSelector sel, void *ptr)
called when the update/FXCall undo is executed
const GNEApplicationWindowHelper::ProcessingMenuCommands & getProcessingMenuCommands() const
get processing Menu Commands
long onCmdPostProcessingPythonTool(FXObject *obj, FXSelector, void *)
post processing after run tool
GUIMessageWindow * myMessageWindow
A window to display messages, warnings and error in.
long onCmdReloadNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall network reload is executed
long onUpdSmartReload(FXObject *, FXSelector, void *)
called when the update/FXCall smart reload is executed
FXSplitter * myMainSplitter
The splitter that divides the main window into view and the log window.
long onCmdLockSelectElements(FXObject *, FXSelector sel, void *)
called when user press lock select elements button
long onCmdOpenNetconvertConfig(FXObject *, FXSelector, void *)
called when the command/FXCall open netconvertconfiguration is executed
long onCmdSaveTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall save TLSPrograms is executed
long onUpdSaveEdgeTypes(FXObject *, FXSelector, void *)
called when the command/FXCall save edge types is updated
long onCmdReloadNeteditConfig(FXObject *, FXSelector, void *)
called when the command/FXCall reload netedit config is executed
long onCmdSaveNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall save network is executed
FXMenuPane * myFileMenu
the submenus
GNEApplicationWindowHelper::ToolbarsGrip myToolbarsGrip
Toolbars Grip.
long onUpdToggleTimeFormat(FXObject *sender, FXSelector sel, void *ptr)
update toggle time format button
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when a key is released
GNEApplicationWindowHelper::ModesMenuCommands myModesMenuCommands
Modes Menu Commands.
long onUpdSaveTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall save TLSPrograms is updated
FXGLCanvas * getBuildGLCanvas() const
get build GL Canvas (must be implemented in all children)
long onCmdEditViewScheme(FXObject *, FXSelector, void *)
Called on menu Edit->Visualization.
long onCmdSaveSumoConfigAs(FXObject *, FXSelector, void *)
called when the command/FXCall save SumoConfig as is executed
long onCmdOpenForeign(FXObject *, FXSelector, void *)
called when the command/FXCall open foreign is executed
void unmarkForDrawingFront()
unmark for drawing front
void refreshAttributesCreator()
refresh attribute creator
void abortReparenting()
abort selecting parent
GNEAttributesCreator * getContainerAttributes() const
get attributes creator
void refreshEdgeTypeSelector()
refresh edge type selector
EdgeTypeSelector * getEdgeTypeSelector() const
get edgeType selector
void addLaneType(GNELaneType *laneType)
add laneType
GNENet * net
the loaded net
const bool viewportFromRegistry
whether loading viewport from registry
const std::string file
the name of the loaded file
const std::string settingsFile
the name of the settings file to load
Dialog fix network elements.
virtual void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame (can be reimplemented in frame children)
Definition GNEFrame.cpp:252
bool isErrorCreatingElement() const
get flag for check if a element wasn't created
void clearTemplate()
clear template (used by shortcut)
void setTemplate()
set template (used by shortcut)
void copyTemplate()
copy template (used by shortcut)
TemplateEditor * getTemplateEditor() const
get template editor
void clearInspection()
clear inspection
void refreshInspection()
refresh current inspection
GNEAttributesEditor * getNeteditAttributesEditor() const
get Netedit Attributes editor
Dialog for edit rerouters.
Result getResult() const
get result
void newNetwork()
begins the creation of an empty network
static void fillOptions(OptionsCont &neteditOptions)
clears and initializes the OptionsCont
void loadNetworkOrConfig()
begins the loading of an existent network or config
static void setDefaultOptions(OptionsCont &neteditOptions)
sets required options for proper functioning
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * > > & getDemandElements() const
get demand elements
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEAdditional * > > & getAdditionals() const
get additionals
const std::unordered_map< const GUIGlObject *, GNECrossing * > & getCrossings() const
get crossings
int getNumberOfMeanDatas() const
get number of meanDatas
const std::map< const std::string, GNEDataSet * > & getDataSets() const
get demand elements
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
int getNumberOfDemandElements() const
get number of current demand elements saved in AttributeCarriers (default vTypes are NOT included)
int getNumberOfAdditionals() const
get number of additionals
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
const std::map< std::string, GNEEdgeType * > & getEdgeTypes() const
map with the ID and pointer to edgeTypes of net
void dataElementsSaved()
mark demand elements as saved
void demandElementsSaved()
mark demand elements as saved
void SumoConfigSaved()
mark SumoConfig as saved
void additionalsSaved()
mark additionals as saved
void requireSaveNeteditConfig()
inform that netedit config has to be saved
void requireSaveSumoConfig()
inform that SumoConfig has to be saved
bool isSumoConfigSaved() const
check if SumoConfig is saved
void neteditConfigSaved()
mark netedit config as saved
void requireSaveMeanDatas()
inform that mean data elements has to be saved
void meanDatasSaved()
mark mean data elements as saved
bool isDemandElementsSaved() const
check if demand elements are saved
void requireSaveAdditionals()
inform that additionals has to be saved
bool isDataElementsSaved() const
check if data elements are saved
bool isNetworkSaved() const
check if network is saved
bool isMeanDatasSaved() const
check if mean data elements are saved
void requireSaveDataElements()
inform that data elements has to be saved
bool isNeteditConfigSaved() const
check if netedit config is saved
void networkSaved()
mark network as saved
bool isAdditionalsSaved() const
check if additionals are saved
void requireSaveDemandElements()
inform that demand elements has to be saved
void clearAdditionalElements(GNEUndoList *undoList)
clear additionals
Definition GNENet.cpp:2104
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
Definition GNENet.cpp:1749
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
Definition GNENet.cpp:1569
bool saveMeanDatas()
save meanData elements of the network
Definition GNENet.cpp:2345
void saveTLSPrograms(const std::string &filename)
save TLS Programs elements of the network
Definition GNENet.cpp:2782
void saveJoined(const std::string &filename)
save log of joined junctions (and nothing else)
Definition GNENet.cpp:1364
GNENetHelper::SavingStatus * getSavingStatus() const
get saving status
Definition GNENet.cpp:133
void enableUpdateData()
Definition GNENet.cpp:2849
void saveEdgeTypes(const std::string &filename)
save edgeTypes elements of the network
Definition GNENet.cpp:2803
void clearDataElements(GNEUndoList *undoList)
clear data elements
Definition GNENet.cpp:2130
bool saveDataElements()
save data set elements of the network
Definition GNENet.cpp:2297
void clearDemandElements(GNEUndoList *undoList)
clear demand elements
Definition GNENet.cpp:2117
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:145
void adjustPersonPlans(GNEUndoList *undoList)
adjust person plans
Definition GNENet.cpp:1855
void computeNetwork(GNEApplicationWindow *window, bool force=false, bool volatileOptions=false)
trigger full netbuild computation param[in] window The window to inform about delay param[in] force W...
Definition GNENet.cpp:1410
void cleanInvalidDemandElements(GNEUndoList *undoList)
clean invalid demand elements
Definition GNENet.cpp:1900
void cleanUnusedRoutes(GNEUndoList *undoList)
clean unused routes
Definition GNENet.cpp:1765
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:127
void clearMeanDataElements(GNEUndoList *undoList)
clear meanDatas
Definition GNENet.cpp:2141
void disableUpdateData()
disable update data elements after inserting or removing an element in net
Definition GNENet.cpp:2860
bool saveAdditionals()
save additional elements
Definition GNENet.cpp:2193
void saveNetwork()
save the network
Definition GNENet.cpp:1317
bool isNetRecomputed() const
check if net require recomputing
Definition GNENet.cpp:1551
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
Definition GNENet.cpp:1696
void joinRoutes(GNEUndoList *undoList)
join routes
Definition GNENet.cpp:1791
void savePlain(const std::string &prefix)
save plain xml representation of the network (and nothing else)
Definition GNENet.cpp:1355
bool saveDemandElements()
save demand element elements of the network
Definition GNENet.cpp:2254
bool saveJuPedSimElements(const std::string &file)
save JuPedSim elements
Definition GNENet.cpp:2235
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2163
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1494
static std::pair< int, bool > Run(GNEApplicationWindow *GNEApp, GUIIcon icon, OptionsCont &optionsContainer, const OptionsCont &originalOptionsContainer, const char *titleName)
Constructor for run dialogs.
static std::pair< int, bool > Options(GNEApplicationWindow *GNEApp, GUIIcon icon, OptionsCont &optionsContainer, const OptionsCont &originalOptionsContainer, const char *titleName)
Constructor for options dialogs.
void updatePathCalculator()
update DijkstraRouter (needed a good calculation of dijkstra path after modifying network)
bool isPathCalculatorUpdated() const
check if pathCalculator is updated
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
GNEAttributesCreator * getPersonAttributes() const
get attributes creator
void loadFromFile(const std::string &file) const
load from file
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
GNESelectorFrame::SelectionOperation * getSelectionOperationModul() const
get selection operation modul
bool isChangesPending() const
return true if there is changes to save
const std::vector< CurrentTAZ::TAZEdgeColor > & getEdgeAndTAZChildrenSelected() const
get map with edge and TAZChildren
void clearSelectedEdges()
clear current TAZ children
TAZSelectionStatistics * getTAZSelectionStatisticsModule() const
get TAZ Selection Statistics modul
TAZSaveChanges * getTAZSaveChangesModule() const
get TAZ Save Changes modul
bool parseTLSPrograms(const std::string &file)
parse TLS Programs from a file
Dialog for edit rerouters.
void show()
show window
bool shown() const
check if dialog is shown
void setFocus()
Move the focus to this window.
void hide()
hide window
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void undo()
undo the last command group
long onUpdUndo(FXObject *, FXSelector, void *)
event after Undo
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...
void abortAllChangeGroups()
reverts and discards ALL active chained change groups
Supermode getRedoSupermode() const
get redo supermode
long onUpdRedo(FXObject *, FXSelector, void *)
event after Redo
Supermode getUndoSupermode() const
get undo supermode
void redo()
redo the last command group
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
GNEAttributesCreator * getVehicleAttributes() const
get attributes creator
GNEAttributeCarrier * getFirstAC() const
const std::unordered_set< GNEAttributeCarrier * > & getACs() const
get hash table with all fronted ACs
long onCmdToggleShowDemandElementsNetwork(FXObject *, FXSelector, void *)
toggle show demand elements (network)
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
GNENet * getNet() const
get the net object
void hotkeyBackSpace()
handle backspace keypress
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
long onCmdToggleShowDemandElementsData(FXObject *, FXSelector, void *)
toggle show demand elements (data)
void abortOperation(bool clearSelection=true)
abort current edition operation
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
long onCmdToggleWarnAboutMerge(FXObject *, FXSelector, void *)
toggle warn for merge
long onCmdToggleDrawSpreadVehicles(FXObject *, FXSelector, void *)
toggle draw vehicles in begin position or spread in lane
long onCmdToggleShowConnections(FXObject *, FXSelector, void *)
toggle show connections
long onCmdToggleShowTAZElements(FXObject *, FXSelector, void *)
toggle show TAZ elements
long onCmdToggleMoveElevation(FXObject *, FXSelector, void *)
toggle move elevation
long onCmdToggleShowAllPersonPlans(FXObject *, FXSelector, void *)
toggle show all person plans in super mode demand
long onCmdToggleTAZRelOnlyTo(FXObject *, FXSelector, void *)
toggle TAZRez only to
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
void hotkeyFocusFrame()
handle focus frame keypress
long onCmdToggleChainEdges(FXObject *, FXSelector, void *)
toggle chain edges
long onCmdToggleLockContainer(FXObject *, FXSelector, void *)
toggle lock container in super mode demand
long onCmdToggleShowGrid(FXObject *, FXSelector, void *)
toggle show grid
GNEViewNetHelper::MarkFrontElements & getMarkFrontElements()
get marked for drawing front elements
long onCmdToggleHideNonInspecteDemandElements(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
GNEViewParent * getViewParent() const
get the net object
long onCmdToggleDrawJunctionShape(FXObject *, FXSelector, void *)
toggle draw junction shape
long onCmdToggleShowShapes(FXObject *, FXSelector, void *)
toggle show shapes in super mode data
GNEViewNetHelper::SaveElements & getSaveElements()
get variable used to save elements
GNEUndoList * getUndoList() const
get the undoList object
void saveVisualizationSettings() const
long onCmdSetSupermode(FXObject *, FXSelector sel, void *)
long onCmdToggleExtendSelection(FXObject *, FXSelector, void *)
toggle extend selection
bool aksChangeSupermode(const std::string &operation, Supermode expectedSupermode)
ask about change supermode
long onCmdSetMode(FXObject *, FXSelector sel, void *)
called when user press a mode button (Network or demand)
void hotkeyEnter()
handle enter keypress
long onCmdToggleShowOverlappedRoutes(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
long onCmdToggleAutoOppositeEdge(FXObject *, FXSelector, void *)
toggle autoOpposite edge
GNEViewNetHelper::LockManager & getLockManager()
get lock manager
void updateControls()
update control contents after undo/redo or recompute
void hotkeyDel()
handle del keypress
long onCmdToggleChangeAllPhases(FXObject *, FXSelector, void *)
toggle change all phases
long onCmdToggleTAZRelDrawing(FXObject *, FXSelector, void *)
toggle TAZRel drawing
long onCmdToggleShowJunctionBubbles(FXObject *, FXSelector, void *)
toggle show junction bubbles
long onCmdToggleShowAdditionalSubElements(FXObject *, FXSelector, void *)
toggle show additional sub-elements
long onCmdToggleShowAllContainerPlans(FXObject *, FXSelector, void *)
toggle show all container plans in super mode demand
long onCmdToggleTAZRelOnlyFrom(FXObject *, FXSelector, void *)
toggle TAZRez only from
long onCmdToggleShowAdditionals(FXObject *, FXSelector, void *)
toggle show additionals in super mode data
long onCmdToggleLockPerson(FXObject *, FXSelector, void *)
toggle lock person in super mode demand
GNEViewNetHelper::TimeFormat & getTimeFormat()
get variable used to switch between time formats
long onCmdToggleSelectEdges(FXObject *, FXSelector, void *)
toggle select edges
long onCmdToggleShowTrips(FXObject *, FXSelector, void *)
toggle show all trips in super mode demand
long onCmdToggleHideShapes(FXObject *, FXSelector, void *)
toggle hide shapes in super mode demand
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
long onCmdToggleHideConnections(FXObject *, FXSelector, void *)
toggle hide connections
void forceSupemodeNetwork()
force supermode network(used after load/create new network)
A single child window which contains a view of the simulation area.
void updateUndoRedoButtons()
update toolbar undo/redo buttons (called when user press Ctrl+Z/Y)
long onKeyPress(FXObject *o, FXSelector sel, void *data)
Called when user press a key.
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
GNETAZFrame * getTAZFrame() const
get frame for NETWORK_TAZ
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for NETWORK_TLS
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEContainerFrame * getContainerFrame() const
get frame for DEMAND_CONTAINER
GNEPersonFrame * getPersonFrame() const
get frame for DEMAND_PERSON
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
GNEFrame * getCurrentShownFrame() const
get current frame (note: it can be null)
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
Called when user releases a key.
void saveViewport(const double x, const double y, const double z, const double rot)
Makes the given viewport the default.
static void close()
close GUICursorSubSys
static void initCursors(FXApp *a)
Initiate GUICursorSubSys.
static FXMenuTitle * buildFXMenuTitle(FXComposite *p, const std::string &text, FXIcon *icon, FXMenuPane *menuPane)
build menu title
static FXMenuCommand * buildFXMenuCommandShortcut(FXComposite *p, const std::string &text, const std::string &shortcut, const std::string &info, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
The application's "Feedback" dialog.
void create()
Creates the widget.
Editor for the list of chosen objects.
const std::string & getMsg() const
Returns the message.
GUIEventType getOwnType() const
returns the event type
Definition GUIEvent.h:89
GUISUMOAbstractView * getView() const
return GUISUMOAbstractView
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static void initIcons(FXApp *a)
Initiate GUIIconSubSys.
static void close()
close GUIIconSubSys
void setWindowSizeAndPos()
perform initial window positioning and sizing according to user options / previous call
std::vector< FXMainWindow * > myTrackerWindows
list of tracker windows
FXMenuPane * myLanguageMenu
Language menu common to all applications.
FXLabel * myCartesianCoordinate
Labels for the current cartesian, geo-coordinate and test coordinates.
std::map< std::string, std::string > myOnlineMaps
online mapping services for the context menu
MFXStaticToolTip * myStaticTooltipMenu
static toolTip used in menus
FXMDIClient * myMDIClient
The multi view panel.
void buildLanguageMenu(FXMenuBar *menuBar)
long onCmdChangeLanguage(FXObject *, FXSelector, void *)
FXHorizontalFrame * myGeoFrame
FXHorizontalFrame * myTestFrame
FXHorizontalFrame * myCartesianFrame
FXLabel * myTestCoordinate
FXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
void storeWindowSizeAndPos()
record window position and size in registry
FXLabel * myGeoCoordinate
FXStatusBar * myStatusbar
The status bar.
FXGLVisual * myGLVisual
The gl-visual used.
std::vector< GUIGlChildWindow * > myGLWindows
list of GLWindows
long onUpdChangeLanguage(FXObject *, FXSelector, void *)
A logging window for the gui.
void addSeparator()
Adds a a separator to this log window.
void unregisterMsgHandlers()
unregister message handlers
void clear()
Clears the window.
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
void registerMsgHandlers()
register message handlers
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
virtual double getZPos() const =0
Returns the camera height corresponding to the current zoom factor.
void addDecals(const std::vector< Decal > &decals)
add decals
void showViewschemeEditor()
show viewsscheme editor
virtual void showViewportEditor()
show viewport editor
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
GUIPerspectiveChanger & getChanger() const
get changer
std::vector< Decal > & getDecals()
The list of decals to show.
virtual void setViewportFromToRot(const Position &lookFrom, const Position &lookAt, double rotation)
applies the given viewport settings
void destroyPopup()
destroys the popup
static FXuint question(FXApp *app, const char *caption, const char *message,...)
Show modal question message, in free floating window.
An XML-handler for visualisation schemes.
const std::vector< std::string > & addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
void setSnapshots(GUISUMOAbstractView *view) const
Makes a snapshot if it has been parsed.
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
static void buildAccelerators(FXAccelTable *accelTable, FXObject *target, const bool sumogui)
build accelerators
static void close()
close GUITextureSubSys
static void resetTextures()
Reset textures.
static void initTextures(FXApp *a)
Initiate GUITextureSubSys for textures.
static std::string clipped
Definition GUIUserIO.h:58
bool drawJunctionShape
whether the shape of the junction should be drawn
bool showGrid
Information whether a grid shall be shown.
bool parse()
parse
static void resetLoaded()
resets loaded location elements
bool amChecked() const
check if this MFXCheckableButton is checked
FXbool getCheck() const
Get check state (TRUE, FALSE or MAYBE)
void setCheck(FXbool s=TRUE)
Set check state (TRUE, FALSE or MAYBE)
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependence to an optional file name.
Definition MFXUtils.cpp:60
static bool checkOptions(OptionsCont &oc)
Checks set options from the OptionsCont-singleton for being valid.
Definition NBFrame.cpp:748
A storage for available edgeTypes of edges.
Definition NBTypeCont.h:52
int size() const
Returns the number of known edgeTypes.
static bool checkOptions(OptionsCont &oc)
Checks set options for being valid.
Definition NIFrame.cpp:391
static bool load(SUMOSAXHandler &handler, const std::vector< std::string > &files, const std::string &type, const bool stringParse=false)
Importer for edge type information stored in XML.
static bool checkOptions(OptionsCont &oc)
Checks set options for being valid.
Definition NWFrame.cpp:139
A storage for options typed value containers)
Definition OptionsCont.h:89
void resetDefault()
Resets all options to default.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool set(const std::string &name, const std::string &value, const bool append=false)
Sets the given value for the named option.
void writeConfiguration(std::ostream &os, const bool filled, const bool complete, const bool addComments, const std::string &relativeTo="", const bool forceRelative=false, const bool inComment=false) const
Writes the configuration.
std::string getValueString(const std::string &name) const
Returns the string-value of the named option (all options)
void resetWritable()
Resets all options to be writeable.
static OptionsCont & getOptions()
Retrieves the options.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
void set(double x, double y)
set positions x and y
Definition Position.h:85
double x() const
Returns the x-position.
Definition Position.h:55
double y() const
Returns the y-position.
Definition Position.h:60
static std::string replace(std::string str, const std::string &what, const std::string &by)
Replaces all occurrences of the second string by the third string within the first string.
static std::string transcodeToLocal(const std::string &utf8String)
convert a string from UTF-8 to the local codepage
static unsigned long runHiddenCommand(const std::string &cmd)
run a shell command without popping up any windows (particuarly on win32)
Definition SysUtils.cpp:69
static bool checkOptions(OptionsCont &oc)
checks shared options and sets StdDefs
static void parseTemplate(OptionsCont &options, const std::string &templateString)
run parser
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme, const std::string &routeValidationScheme)
Enables or disables validation.
Definition XMLSubSys.cpp:83
@ SEL_THREAD_EVENT
Definition fxexdefs.h:173
@ SEL_THREAD
Definition fxexdefs.h:155
Definition json.hpp:4471
DemandViewOptions demandViewOptions
demand view options
NetworkViewOptions networkViewOptions
network view options
void buildUndoRedoMenuCommands(FXMenuPane *editMenu)
build undo-redo menu commands
void buildViewMenuCommands(FXMenuPane *editMenu)
build view menu commands
FXMenuCheck * loadAdditionalsInSUMOGUI
menu check for load additionals in SUMO GUI
FXMenuCommand * undoLastChange
FXMenuCommand for undo last change.
FXMenuCheck * loadDemandInSUMOGUI
menu check for load demand in SUMO GUI
MFXMenuCheckIcon * menuCheckAllowUndoRedo
checkBox for allow undo-redo
FXMenuCommand * redoLastChange
FXMenuCommand for redo last change.
void buildOpenSUMOMenuCommands(FXMenuPane *editMenu)
build open sumo menu commands
void buildFrontElementMenuCommand(FXMenuPane *editMenu)
build front element commands
MFXMenuCheckIcon * menuCheckAllowUndoRedoLoading
checkBox for allow undo-redo loading
void buildFileMenuCommands(FXMenuPane *fileMenu, FXMenuPane *fileMenuNEEDITConfig, FXMenuPane *fileMenuSumoConfig, FXMenuPane *fileMenuTLS, FXMenuPane *fileMenuEdgeTypes, FXMenuPane *fileMenuAdditionals, FXMenuPane *fileMenuDemandElements, FXMenuPane *fileMenuDataElements, FXMenuPane *fileMenuMeanDataElements)
build menu commands
void buildHelpMenuCommands(FXMenuPane *helpMenu)
build menu commands
void buildLocateMenuCommands(FXMenuPane *locateMenu)
build menu commands
void buildLockMenuCommands(FXMenuPane *editMenu)
build menu commands
void hideNetworkLockMenuCommands()
show network processing menu commands
void hideDemandLockMenuCommands()
show demand processing menu commands
void hideDataLockMenuCommands()
show data processing menu commands
void showDataLockMenuCommands()
show data processing menu commands
void showNetworkLockMenuCommands()
show network processing menu commands
void showDemandLockMenuCommands()
show demand processing menu commands
void buildRecentConfigFiles(FXMenuPane *fileMenu, FXMenuPane *fileMenuRecentConfigFiles)
build recent config
MFXRecentNetworks myRecentConfigs
List of recent configs.
MFXRecentNetworks myRecentNetworks
List of recent networks.
void buildRecentNetworkFiles(FXMenuPane *fileMenu, FXMenuPane *fileMenuRecentNetworkFiles)
build recent network
void buildModesMenuCommands(FXMenuPane *modesMenu)
build modes menu commands
DemandMenuCommands demandMenuCommands
Demand Menu Commands.
void setDefaultView(Supermode supermode)
set default view
void setJuPedSimView(Supermode supermode)
set JuPedSim view
NetworkMenuCommands networkMenuCommands
Network Menu Commands.
void showDataProcessingMenuCommands()
show data processing menu commands
MFXMenuCheckIcon * menuCheckRecomputeDataMode
checkBox for recomputing when changing data mode
void showDemandProcessingMenuCommands()
show demand processing menu commands
void hideDemandProcessingMenuCommands()
show demand processing menu commands
void hideDataProcessingMenuCommands()
show data processing menu commands
void buildProcessingMenuCommands(FXMenuPane *processingMenu)
build menu commands
void showNetworkProcessingMenuCommands()
show network processing menu commands
void hideNetworkProcessingMenuCommands()
show network processing menu commands
void buildSupermodeCommands(FXMenuPane *editMenu)
build menu commands
FXMenuBar * menu
The application menu bar (for file, edit, processing...)
long postProcessing(FXObject *menuCommand) const
run postprocessing
void buildTools(FXMenuPane *toolsMenu, const std::map< std::string, FXMenuPane * > &menuPaneToolMaps)
build tools (and menu commands)
long showTool(FXObject *menuCommand) const
show tool
long runNetgenerateDialog(const OptionsCont *netgenerateOptions) const
run netgenerate dialog
long runToolDialog(FXObject *menuCommand) const
run tool dialog
void buildWindowsMenuCommands(FXMenuPane *windowsMenu, FXStatusBar *statusbar, GUIMessageWindow *messageWindow)
build menu commands
static bool toggleEditOptionsData(GNEViewNet *viewNet, const MFXCheckableButton *menuCheck, const int numericalKeyPressed, FXObject *obj, FXSelector sel)
toggle edit options Data menu commands (called in GNEApplicationWindow::onCmdToggleEditOptions)
static std::string openRouteFileDialog(FXWindow *window, bool save, bool multi=false)
open route file dialog
static std::string openMeanDataDialog(FXWindow *window, bool save, bool multi=false)
open meandata filename dialog
static std::string openAdditionalFileDialog(FXWindow *window, bool save, bool multi=false)
open additional dialog
static std::string openOSMFileDialog(FXWindow *window)
open OSM file dialog
static bool toggleEditOptionsDemand(GNEViewNet *viewNet, const MFXCheckableButton *menuCheck, const int numericalKeyPressed, FXObject *obj, FXSelector sel)
toggle edit options Demand menu commands (called in GNEApplicationWindow::onCmdToggleEditOptions)
static std::string saveJoinedJunctionsFileDialog(FXWindow *window)
open joined junctions file dialog
static bool toggleEditOptionsNetwork(GNEViewNet *viewNet, const MFXCheckableButton *menuCheck, const int numericalKeyPressed, FXObject *obj, FXSelector sel)
toggle edit options Network menu commands (called in GNEApplicationWindow::onCmdToggleEditOptions)
static std::string openTLSFileDialog(FXWindow *window, bool save)
open TLS file dialog
static std::string openDataFileDialog(FXWindow *window, bool save, bool multi=false)
open data file dialog
static std::string openNeteditConfigFileDialog(FXWindow *window, bool save)
open netedit config file dialog
static std::string savePlainXMLFileDialog(FXWindow *window)
open plain xml file dialog
static std::string openSumoConfigFileDialog(FXWindow *window, bool save, bool multi=false)
open SUMO config file dialog
static std::string openEdgeTypeFileDialog(FXWindow *window, bool save)
open edgeType file dialog
static std::string openNetworkFileDialog(FXWindow *window, bool save, bool multi=false)
open netconvert file dialog
static std::string openNetconvertFileDialog(FXWindow *window)
open netconvert file dialog
MFXCheckableButton * menuCheckToggleTAZDrawFill
menu check to toggle TAZ draw fill
MFXCheckableButton * menuCheckShowAdditionals
menu check to show Additionals
MFXCheckableButton * menuCheckShowShapes
menu check to show Shapes
MFXCheckableButton * menuCheckToggleTAZRelOnlyFrom
menu check to toggle TAZRel only from
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void getVisibleDataMenuCommands(std::vector< MFXCheckableButton * > &commands) const
get visible demand menu commands
MFXCheckableButton * menuCheckToggleTAZRelDrawing
menu check to toggle TAZ Rel drawing
MFXCheckableButton * menuCheckShowDemandElements
menu check to show Demand Elements
MFXCheckableButton * menuCheckToggleTAZRelOnlyTo
menu check to toggle TAZRel only to
MFXCheckableButton * menuCheckShowAllTrips
show all trips
MFXCheckableButton * menuCheckToggleGrid
menu check to show grid button
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
MFXCheckableButton * menuCheckDrawSpreadVehicles
menu check to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowOverlappedRoutes
show overlapped routes
MFXCheckableButton * menuCheckShowAllPersonPlans
show all person plans
MFXCheckableButton * menuCheckShowAllContainerPlans
show all container plans
MFXCheckableButton * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
MFXCheckableButton * menuCheckHideShapes
Hide shapes (Polygons and POIs)
MFXCheckableButton * menuCheckLockPerson
Lock Person.
void getVisibleDemandMenuCommands(std::vector< MFXCheckableButton * > &commands) const
get visible demand menu commands
MFXCheckableButton * menuCheckLockContainer
Lock Container.
DataEditMode dataEditMode
the current Data edit mode
bool isDefaultView() const
check if default view is enabled
DemandEditMode demandEditMode
the current Demand edit mode
Supermode currentSupermode
the current supermode
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
bool isJuPedSimView() const
check if default view is enabled
MFXCheckableButton * menuCheckSelectEdges
checkable button to select only edges
MFXCheckableButton * menuCheckChainEdges
checkable button to the endpoint for a created edge should be set as the new source
MFXCheckableButton * menuCheckShowDemandElements
checkable button to show Demand Elements
MFXCheckableButton * menuCheckMoveElevation
checkable button to apply movement to elevation
MFXCheckableButton * menuCheckShowTAZElements
checkable button to show TAZ elements
void getVisibleNetworkMenuCommands(std::vector< MFXCheckableButton * > &commands) const
get visible network menu commands
MFXCheckableButton * menuCheckAutoOppositeEdge
check checkable to create auto create opposite edge
MFXCheckableButton * menuCheckDrawSpreadVehicles
checkable button to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowConnections
checkable button to show connections
MFXCheckableButton * menuCheckHideConnections
checkable button to hide connections in connect mode
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
MFXCheckableButton * menuCheckToggleGrid
checkable button to show grid button
MFXCheckableButton * menuCheckShowJunctionBubble
checkable button to show connection as bubble in "Move" mode.
MFXCheckableButton * menuCheckWarnAboutMerge
checkable button to we should warn about merging junctions
MFXCheckableButton * menuCheckShowAdditionalSubElements
checkable button to show additional sub-elements
MFXCheckableButton * menuCheckChangeAllPhases
checkable button to set change all phases
MFXCheckableButton * menuCheckExtendSelection
checkable button to extend to edge nodes
void setSaveIndividualFiles(bool value)
enable or disable save individual files
void switchTimeFormat()
switch time format
void updateButtonLabel()
update button label