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 if (myViewNet->getViewParent()->getInspectorFrame()->shown()) {
2274 // get inspected AC
2275 GNEAttributeCarrier* inspectedAC = (myViewNet->getInspectedAttributeCarriers().size() == 1) ? myViewNet->getInspectedAttributeCarriers().front() : nullptr;
2276 // set or clear front attribute
2277 if (myViewNet->getFrontAttributeCarrier() == inspectedAC) {
2279 } else {
2280 myViewNet->setFrontAttributeCarrier(inspectedAC);
2281 }
2283 } else {
2285 }
2286 update();
2287 }
2288 return 1;
2289}
2290
2291
2292long
2293GNEApplicationWindow::onCmdToggleEditOptions(FXObject* sender, FXSelector sel, void* /* ptr */) {
2294 // first check that we have a ViewNet
2295 if (myViewNet) {
2296 // first check what selector was called
2297 int numericalKeyPressed = sel - FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_0_TOGGLEEDITOPTION) - 1;
2298 // check that numericalKeyPressed is valid
2299 if ((numericalKeyPressed < 0) || (numericalKeyPressed > 10)) {
2300 return 1;
2301 }
2302 // declare a vector in which save visible menu commands
2303 std::vector<MFXCheckableButton*> visibleMenuCommands;
2304 // get common, network and demand visible menu commands
2308 // now check that numericalKeyPressed isn't greater than visible view options
2309 if (numericalKeyPressed >= (int)visibleMenuCommands.size()) {
2310 return 1;
2311 }
2312 // toggle edit options
2314 visibleMenuCommands.at(numericalKeyPressed), numericalKeyPressed, sender, sel)) {
2315 return 1;
2317 visibleMenuCommands.at(numericalKeyPressed), numericalKeyPressed, sender, sel)) {
2318 return 1;
2320 visibleMenuCommands.at(numericalKeyPressed), numericalKeyPressed, sender, sel)) {
2321 return 1;
2322 }
2323 }
2324 return 1;
2325}
2326
2327
2328long
2329GNEApplicationWindow::onCmdHelp(FXObject*, FXSelector, void*) {
2330 MFXLinkLabel::fxexecute("https://sumo.dlr.de/docs/netedit.html");
2331 return 1;
2332}
2333
2334
2335long
2336GNEApplicationWindow::onCmdChangelog(FXObject*, FXSelector, void*) {
2337 // update in every version
2338 MFXLinkLabel::fxexecute("https://sumo.dlr.de/docs/ChangeLog.html");
2339 return 1;
2340}
2341
2342
2343long
2344GNEApplicationWindow::onCmdHotkeys(FXObject*, FXSelector, void*) {
2345 MFXLinkLabel::fxexecute("https://sumo.dlr.de/docs/Netedit/shortcuts.html");
2346 return 1;
2347}
2348
2349
2350long
2353 return getApp()->reg().writeBoolEntry("NETEDIT", "RecomputeData", true);
2354 } else {
2355 return getApp()->reg().writeBoolEntry("NETEDIT", "RecomputeData", false);
2356 }
2357}
2358
2359
2360long
2361GNEApplicationWindow::onCmdToggleUndoRedo(FXObject*, FXSelector, void*) {
2363 myAllowUndoRedo = true;
2364 return getApp()->reg().writeBoolEntry("NETEDIT", "AllowUndoRedo", true);
2365 } else {
2366 myAllowUndoRedo = false;
2367 // drop undo-redo list after changing flag
2368 myUndoList->clear();
2369 return getApp()->reg().writeBoolEntry("NETEDIT", "AllowUndoRedo", false);
2370 }
2371}
2372
2373
2374long
2378 return getApp()->reg().writeBoolEntry("NETEDIT", "AllowUndoRedoLoading", true);
2379 } else {
2380 myAllowUndoRedoLoading = false;
2381 return getApp()->reg().writeBoolEntry("NETEDIT", "AllowUndoRedoLoading", false);
2382 }
2383}
2384
2385
2386long
2387GNEApplicationWindow::onCmdTutorial(FXObject*, FXSelector, void*) {
2388 MFXLinkLabel::fxexecute("https://sumo.dlr.de/docs/Tutorials/index.html");
2389 return 1;
2390}
2391
2392
2393long
2394GNEApplicationWindow::onCmdFeedback(FXObject*, FXSelector, void*) {
2395 // write warning if netedit is running in testing mode
2396 WRITE_DEBUG("Opening feedback dialog");
2397 // create and open feedback dialog
2398 GUIDialog_Feedback* feedback = new GUIDialog_Feedback(this);
2399 feedback->create();
2400 feedback->show(PLACEMENT_OWNER);
2401 // write warning if netedit is running in testing mode
2402 WRITE_DEBUG("Closed feedback dialog");
2403 return 1;
2404}
2405
2406
2407long
2409 auto& neteditOptions = OptionsCont::getOptions();
2410 const auto dialog = GNEOptionsDialog::Options(this, GUIIcon::OPTIONS, neteditOptions, myOriginalNeteditOptions, TL("Netedit options"));
2411 if (dialog.first == TRUE) {
2412 NIFrame::checkOptions(neteditOptions); // needed to set projection parameters
2413 NBFrame::checkOptions(neteditOptions);
2414 NWFrame::checkOptions(neteditOptions);
2415 SystemFrame::checkOptions(neteditOptions); // needed to set precision
2416 // check if mar netedit config as unsaved
2417 if (dialog.second && myNet) {
2419 }
2420 }
2421 return 1;
2422}
2423
2424
2425long
2427 const auto dialog = GNEOptionsDialog::Options(this, GUIIcon::SUMO_MINI, mySumoOptions, myOriginalSumoOptions, TL("Sumo options"));
2428 // check if mark sumoConfig as unsaved
2429 if ((dialog.first == TRUE) && dialog.second && myNet) {
2431 }
2432 return 1;
2433}
2434
2435
2436long
2440
2441
2442long
2446
2447
2448long
2449GNEApplicationWindow::onCmdUndo(FXObject*, FXSelector, void*) {
2450 WRITE_DEBUG("Keys Ctrl+Z (Undo) pressed");
2451 // Check conditions
2452 if (myViewNet == nullptr) {
2453 return 0;
2454 } else if (!myEditMenuCommands.undoLastChange->isEnabled()) {
2455 return 0;
2456 } else {
2457 // check supermode (currently ignore supermode data)
2460 // abort if user doesn't press "yes"
2462 return 0;
2463 }
2464 }
2466 // update current show frame after undo
2469 }
2470 // update manually undo/redo menu commands (see #6005)
2473 // update toolbar undo-redo buttons
2475 return 1;
2476 }
2477}
2478
2479
2480long
2481GNEApplicationWindow::onCmdRedo(FXObject*, FXSelector, void*) {
2482 WRITE_DEBUG("Keys Ctrl+Y (Redo) pressed");
2483 // Check conditions
2484 if (myViewNet == nullptr) {
2485 return 0;
2486 } else if (!myEditMenuCommands.redoLastChange->isEnabled()) {
2487 return 0;
2488 } else {
2489 // check supermode (currently ignore supermode data)
2492 // abort if user doesn't press "yes"
2494 return 0;
2495 }
2496 }
2498 // update current show frame after redo
2501 }
2502 // update manually undo/redo menu commands (see #6005)
2505 // update toolbar undo-redo buttons
2507 return 1;
2508 }
2509}
2510
2511
2512long
2514 // avoid open two dialogs
2515 if (myUndoListDialog->shown()) {
2517 } else {
2519 }
2520 return 1;
2521}
2522
2523
2524long
2525GNEApplicationWindow::onUpdOpenUndoListDialog(FXObject* sender, FXSelector, void*) {
2526 // check if net exist and there is something to undo/redo
2527 if (myNet && (myEditMenuCommands.undoLastChange->isEnabled() || myEditMenuCommands.redoLastChange->isEnabled())) {
2528 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2529 } else {
2530 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2531 if (myUndoListDialog->shown()) {
2533 }
2534 }
2535 return 1;
2536}
2537
2538
2539long
2541 // first check viewNet
2543 // update demand path calculator
2545 }
2546 return 1;
2547}
2548
2549
2550long
2551GNEApplicationWindow::onCmdCut(FXObject*, FXSelector, void*) {
2552 WRITE_DEBUG("Key Ctrl+X (Cut) pressed");
2553 // Prepared for #6042
2554 return 1;
2555}
2556
2557
2558long
2559GNEApplicationWindow::onCmdCopy(FXObject*, FXSelector, void*) {
2560 WRITE_DEBUG("Key Ctrl+C (Copy) pressed");
2561 // Prepared for #6042
2562 return 1;
2563}
2564
2565
2566long
2567GNEApplicationWindow::onCmdPaste(FXObject*, FXSelector, void*) {
2568 WRITE_DEBUG("Key Ctrl+V (Paste) pressed");
2569 // Prepared for #6042
2570 return 1;
2571}
2572
2573
2574long
2575GNEApplicationWindow::onCmdSetTemplate(FXObject*, FXSelector, void*) {
2576 WRITE_DEBUG("Key Ctrl+F1 (Set Template) pressed");
2577 // first check if myViewNet exist
2578 if (myViewNet) {
2579 // call set template in inspector frame
2581 }
2582 return 1;
2583}
2584
2585
2586long
2587GNEApplicationWindow::onCmdCopyTemplate(FXObject*, FXSelector, void*) {
2588 WRITE_DEBUG("Key Ctrl+F2 (Copy Template) pressed");
2589 // first check if myViewNet exist
2590 if (myViewNet) {
2591 // call copy template in inspector frame
2593 }
2594 return 1;
2595}
2596
2597
2598long
2599GNEApplicationWindow::onCmdClearTemplate(FXObject*, FXSelector, void*) {
2600 WRITE_DEBUG("Key Ctrl+F3 (Clear Template) pressed");
2601 // first check if myViewNet exist
2602 if (myViewNet) {
2603 // call clear template in inspector frame
2605 }
2606 return 1;
2607}
2608
2609
2610long
2611GNEApplicationWindow::onUpdNeedsNetwork(FXObject* sender, FXSelector, void*) {
2612 // check if net exist
2613 if (myNet) {
2615 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2616 } else {
2618 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2619 }
2620}
2621
2622
2623long
2624GNEApplicationWindow::onUpdNeedsNetworkElement(FXObject* sender, FXSelector, void*) {
2625 // check if at least there is one edge in the network
2626 if (myNet && (myNet->getAttributeCarriers()->getEdges().size() > 0)) {
2627 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2628 } else {
2629 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2630 }
2631}
2632
2633
2634long
2635GNEApplicationWindow::onUpdNeedsFrontElement(FXObject* sender, FXSelector, void*) {
2636 // check if net, viewnet and front attribute exist
2638 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2639 } else {
2640 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2641 }
2642}
2643
2644
2645long
2646GNEApplicationWindow::onUpdSaveNetwork(FXObject* sender, FXSelector, void*) {
2647 if (myNet == nullptr) {
2648 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2649 } else if (myNet->getSavingStatus()->isNetworkSaved()) {
2650 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2651 } else {
2652 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2653 }
2654}
2655
2656
2657long
2658GNEApplicationWindow::onUpdSaveAdditionals(FXObject* sender, FXSelector, void*) {
2659 if (myNet == nullptr) {
2660 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2662 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2663 } else {
2664 return sender->handle(this, myNet->getSavingStatus()->isAdditionalsSaved() ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2665 }
2666}
2667
2668
2669long
2670GNEApplicationWindow::onUpdSaveAdditionalsAs(FXObject* sender, FXSelector, void*) {
2671 if (myNet == nullptr) {
2672 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2673 } else if (myNet->getAttributeCarriers()->getNumberOfAdditionals() == 0) {
2674 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2675 } else {
2676 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2677 }
2678}
2679
2680
2681long
2682GNEApplicationWindow::onUpdSaveJuPedSimElementsAs(FXObject* sender, FXSelector, void*) {
2683 if (myNet == nullptr) {
2684 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2685 } else if (myNet->getAttributeCarriers()->getAdditionals().at(GNE_TAG_JPS_WALKABLEAREA).size() > 0) {
2686 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2687 } else if (myNet->getAttributeCarriers()->getAdditionals().at(GNE_TAG_JPS_OBSTACLE).size() > 0) {
2688 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2689 } else {
2690 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2691 }
2692}
2693
2694
2695long
2696GNEApplicationWindow::onUpdSaveDemandElements(FXObject* sender, FXSelector, void*) {
2697 if (myNet == nullptr) {
2698 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2699 } else if (myNet->getSavingStatus()->isDemandElementsSaved()) {
2700 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2701 } else {
2702 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2703 }
2704
2705}
2706
2707
2708long
2709GNEApplicationWindow::onUpdSaveDemandElementsAs(FXObject* sender, FXSelector, void*) {
2710 if (myNet == nullptr) {
2711 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2713 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2714 } else {
2715 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2716 }
2717}
2718
2719
2720long
2721GNEApplicationWindow::onUpdSaveDataElements(FXObject* sender, FXSelector, void*) {
2722 if (myNet == nullptr) {
2723 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2724 } else if (myNet->getSavingStatus()->isDataElementsSaved()) {
2725 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2726 } else {
2727 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2728 }
2729
2730}
2731
2732
2733long
2734GNEApplicationWindow::onUpdSaveDataElementsAs(FXObject* sender, FXSelector, void*) {
2735 if (myNet == nullptr) {
2736 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2737 } else if (myNet->getAttributeCarriers()->getDataSets().size() == 0) {
2738 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2739 } else {
2740 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2741 }
2742
2743}
2744
2745
2746long
2747GNEApplicationWindow::onUpdSaveMeanDatas(FXObject* sender, FXSelector, void*) {
2748 if (myNet == nullptr) {
2749 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2750 } else if (myNet->getSavingStatus()->isMeanDatasSaved()) {
2751 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2752 } else {
2753 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2754 }
2755}
2756
2757
2758long
2759GNEApplicationWindow::onUpdSaveMeanDatasAs(FXObject* sender, FXSelector, void*) {
2760 if (myNet == nullptr) {
2761 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2762 } else if (myNet->getAttributeCarriers()->getNumberOfMeanDatas() == 0) {
2763 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2764 } else {
2765 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2766 }
2767
2768}
2769
2770
2771long
2772GNEApplicationWindow::onUpdUndo(FXObject* sender, FXSelector sel, void* ptr) {
2773 return myUndoList->onUpdUndo(sender, sel, ptr);
2774}
2775
2776
2777long
2778GNEApplicationWindow::onUpdRedo(FXObject* sender, FXSelector sel, void* ptr) {
2779 return myUndoList->onUpdRedo(sender, sel, ptr);
2780}
2781
2782
2783long
2784GNEApplicationWindow::onUpdComputePathManager(FXObject* sender, FXSelector /*sel*/, void* /*ptr*/) {
2785 // first check viewNet
2786 if (myViewNet) {
2787 // check supermode network
2789 // disable
2790 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2792 // disable
2793 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2794 } else {
2795 // enable
2796 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2797 }
2798 } else {
2799 // disable
2800 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2801 }
2802}
2803
2804
2805long
2806GNEApplicationWindow::onCmdToggleViewOption(FXObject* sender, FXSelector sel, void* ptr) {
2807 // check viewNet
2808 if (myViewNet) {
2809 // continue depending of selector
2810 switch (FXSELID(sel)) {
2811 // Network
2813 return myViewNet->onCmdToggleShowGrid(sender, sel, ptr);
2815 return myViewNet->onCmdToggleDrawJunctionShape(sender, sel, ptr);
2817 return myViewNet->onCmdToggleDrawSpreadVehicles(sender, sel, ptr);
2819 return myViewNet->onCmdToggleShowDemandElementsNetwork(sender, sel, ptr);
2821 return myViewNet->onCmdToggleSelectEdges(sender, sel, ptr);
2823 return myViewNet->onCmdToggleShowConnections(sender, sel, ptr);
2825 return myViewNet->onCmdToggleHideConnections(sender, sel, ptr);
2827 return myViewNet->onCmdToggleShowAdditionalSubElements(sender, sel, ptr);
2829 return myViewNet->onCmdToggleShowTAZElements(sender, sel, ptr);
2831 return myViewNet->onCmdToggleExtendSelection(sender, sel, ptr);
2833 return myViewNet->onCmdToggleChangeAllPhases(sender, sel, ptr);
2835 return myViewNet->onCmdToggleWarnAboutMerge(sender, sel, ptr);
2837 return myViewNet->onCmdToggleShowJunctionBubbles(sender, sel, ptr);
2839 return myViewNet->onCmdToggleMoveElevation(sender, sel, ptr);
2841 return myViewNet->onCmdToggleChainEdges(sender, sel, ptr);
2843 return myViewNet->onCmdToggleAutoOppositeEdge(sender, sel, ptr);
2844 // Demand
2846 return myViewNet->onCmdToggleShowGrid(sender, sel, ptr);
2848 return myViewNet->onCmdToggleDrawJunctionShape(sender, sel, ptr);
2850 return myViewNet->onCmdToggleDrawSpreadVehicles(sender, sel, ptr);
2852 return myViewNet->onCmdToggleHideNonInspecteDemandElements(sender, sel, ptr);
2854 return myViewNet->onCmdToggleHideShapes(sender, sel, ptr);
2856 return myViewNet->onCmdToggleShowTrips(sender, sel, ptr);
2858 return myViewNet->onCmdToggleShowAllPersonPlans(sender, sel, ptr);
2860 return myViewNet->onCmdToggleLockPerson(sender, sel, ptr);
2862 return myViewNet->onCmdToggleShowAllContainerPlans(sender, sel, ptr);
2864 return myViewNet->onCmdToggleLockContainer(sender, sel, ptr);
2866 return myViewNet->onCmdToggleShowOverlappedRoutes(sender, sel, ptr);
2867 // Data
2869 return myViewNet->onCmdToggleDrawJunctionShape(sender, sel, ptr);
2871 return myViewNet->onCmdToggleShowAdditionals(sender, sel, ptr);
2873 return myViewNet->onCmdToggleShowShapes(sender, sel, ptr);
2875 return myViewNet->onCmdToggleShowDemandElementsData(sender, sel, ptr);
2877 return myViewNet->onCmdToggleTAZRelDrawing(sender, sel, ptr);
2879 return myViewNet->onCmdToggleTAZRelDrawing(sender, sel, ptr);
2881 return myViewNet->onCmdToggleTAZRelOnlyFrom(sender, sel, ptr);
2883 return myViewNet->onCmdToggleTAZRelOnlyTo(sender, sel, ptr);
2884 default:
2885 return 0;
2886 }
2887 } else {
2888 return 0;
2889 }
2890}
2891
2892
2893long
2894GNEApplicationWindow::onUpdToggleViewOption(FXObject* sender, FXSelector sel, void* /*ptr*/) {
2895 // get menuCheck
2896 MFXMenuCheckIcon* menuCheck = dynamic_cast<MFXMenuCheckIcon*>(sender);
2897 // check viewNet
2898 if (myViewNet && menuCheck) {
2899 // continue depending of selector
2900 switch (FXSELID(sel)) {
2901 // Network
2904 menuCheck->setCheck(TRUE);
2905 } else {
2906 menuCheck->setCheck(FALSE);
2907 }
2908 break;
2911 menuCheck->setCheck(TRUE);
2912 } else {
2913 menuCheck->setCheck(FALSE);
2914 }
2915 break;
2918 menuCheck->setCheck(TRUE);
2919 } else {
2920 menuCheck->setCheck(FALSE);
2921 }
2922 break;
2925 menuCheck->setCheck(TRUE);
2926 } else {
2927 menuCheck->setCheck(FALSE);
2928 }
2929 break;
2932 menuCheck->setCheck(TRUE);
2933 } else {
2934 menuCheck->setCheck(FALSE);
2935 }
2936 break;
2939 menuCheck->setCheck(TRUE);
2940 } else {
2941 menuCheck->setCheck(FALSE);
2942 }
2943 break;
2946 menuCheck->setCheck(TRUE);
2947 } else {
2948 menuCheck->setCheck(FALSE);
2949 }
2950 break;
2953 menuCheck->setCheck(TRUE);
2954 } else {
2955 menuCheck->setCheck(FALSE);
2956 }
2957 break;
2960 menuCheck->setCheck(TRUE);
2961 } else {
2962 menuCheck->setCheck(FALSE);
2963 }
2964 break;
2967 menuCheck->setCheck(TRUE);
2968 } else {
2969 menuCheck->setCheck(FALSE);
2970 }
2971 break;
2974 menuCheck->setCheck(TRUE);
2975 } else {
2976 menuCheck->setCheck(FALSE);
2977 }
2978 break;
2981 menuCheck->setCheck(TRUE);
2982 } else {
2983 menuCheck->setCheck(FALSE);
2984 }
2985 break;
2988 menuCheck->setCheck(TRUE);
2989 } else {
2990 menuCheck->setCheck(FALSE);
2991 }
2992 break;
2995 menuCheck->setCheck(TRUE);
2996 } else {
2997 menuCheck->setCheck(FALSE);
2998 }
2999 break;
3002 menuCheck->setCheck(TRUE);
3003 } else {
3004 menuCheck->setCheck(FALSE);
3005 }
3006 break;
3009 menuCheck->setCheck(TRUE);
3010 } else {
3011 menuCheck->setCheck(FALSE);
3012 }
3013 break;
3014 // Demand
3017 menuCheck->setCheck(TRUE);
3018 } else {
3019 menuCheck->setCheck(FALSE);
3020 }
3021 break;
3024 menuCheck->setCheck(TRUE);
3025 } else {
3026 menuCheck->setCheck(FALSE);
3027 }
3028 break;
3031 menuCheck->setCheck(TRUE);
3032 } else {
3033 menuCheck->setCheck(FALSE);
3034 }
3035 break;
3038 menuCheck->setCheck(TRUE);
3039 } else {
3040 menuCheck->setCheck(FALSE);
3041 }
3042 break;
3045 menuCheck->setCheck(TRUE);
3046 } else {
3047 menuCheck->setCheck(FALSE);
3048 }
3049 break;
3052 menuCheck->setCheck(TRUE);
3053 } else {
3054 menuCheck->setCheck(FALSE);
3055 }
3056 break;
3059 menuCheck->setCheck(TRUE);
3060 } else {
3061 menuCheck->setCheck(FALSE);
3062 }
3063 // special case for lock persons
3065 menuCheck->enable();
3066 } else {
3067 menuCheck->disable();
3068 }
3069 break;
3072 menuCheck->setCheck(TRUE);
3073 } else {
3074 menuCheck->setCheck(FALSE);
3075 }
3076 break;
3079 menuCheck->setCheck(TRUE);
3080 } else {
3081 menuCheck->setCheck(FALSE);
3082 }
3083 // special case for lock containers
3085 menuCheck->enable();
3086 } else {
3087 menuCheck->disable();
3088 }
3089 break;
3092 menuCheck->setCheck(TRUE);
3093 } else {
3094 menuCheck->setCheck(FALSE);
3095 }
3096 break;
3099 menuCheck->setCheck(TRUE);
3100 } else {
3101 menuCheck->setCheck(FALSE);
3102 }
3103 break;
3104 // Data
3107 menuCheck->setCheck(TRUE);
3108 } else {
3109 menuCheck->setCheck(FALSE);
3110 }
3111 break;
3114 menuCheck->setCheck(TRUE);
3115 } else {
3116 menuCheck->setCheck(FALSE);
3117 }
3118 break;
3121 menuCheck->setCheck(TRUE);
3122 } else {
3123 menuCheck->setCheck(FALSE);
3124 }
3125 break;
3128 menuCheck->setCheck(TRUE);
3129 } else {
3130 menuCheck->setCheck(FALSE);
3131 }
3132 break;
3135 menuCheck->setCheck(TRUE);
3136 } else {
3137 menuCheck->setCheck(FALSE);
3138 }
3139 break;
3142 menuCheck->setCheck(TRUE);
3143 } else {
3144 menuCheck->setCheck(FALSE);
3145 }
3146 break;
3147
3150 menuCheck->setCheck(TRUE);
3151 } else {
3152 menuCheck->setCheck(FALSE);
3153 }
3154 break;
3157 menuCheck->setCheck(TRUE);
3158 } else {
3159 menuCheck->setCheck(FALSE);
3160 }
3161 break;
3162 default:
3163 break;
3164 }
3165 }
3166 return 0;
3167}
3168
3169
3170long
3171GNEApplicationWindow::onCmdSaveNetwork(FXObject* sender, FXSelector sel, void* ptr) {
3172 auto& neteditOptions = OptionsCont::getOptions();
3173 // first check if we have to set the output filename
3174 if ((sel == MID_GNE_FORCESAVE) && neteditOptions.getString("net-file").empty()) {
3175 neteditOptions.set("net-file", *(static_cast<std::string*>(ptr)) + ".net.xml");
3176 }
3177 // function onCmdSaveNetworkAs must be executed if this is the first save
3178 if (neteditOptions.getString("net-file").empty()) {
3179 return onCmdSaveNetworkAs(sender, sel, ptr);
3180 } else {
3181 // always recompute before saving
3182 myNet->computeNetwork(this);
3183 // se net file in SUMO options
3185 mySumoOptions.set("net-file", neteditOptions.getString("net-file"));
3186 // begin save network
3187 getApp()->beginWaitCursor();
3188 bool saved = false;
3189 try {
3190 // obtain invalid networkElements (currently only edges or crossings
3191 std::vector<GNENetworkElement*> invalidNetworkElements;
3192 // iterate over crossings and edges
3193 for (const auto& edge : myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
3194 if (!edge.second->isNetworkElementValid()) {
3195 invalidNetworkElements.push_back(edge.second);
3196 }
3197 }
3198 for (const auto& crossing : myViewNet->getNet()->getAttributeCarriers()->getCrossings()) {
3199 if (!crossing.second->isNetworkElementValid()) {
3200 invalidNetworkElements.push_back(crossing.second);
3201 }
3202 }
3203 // if there are invalid network elements, open GNEFixNetworkElements
3204 if (invalidNetworkElements.size() > 0) {
3205 // 0 -> Canceled Saving, with or without selecting invalid network elements
3206 // 1 -> Invalid network elements fixed, friendlyPos enabled, or saved with invalid positions
3207 GNEFixNetworkElements fixNetworkElementsDialog(myViewNet, invalidNetworkElements);
3208 if (fixNetworkElementsDialog.execute() == 0) {
3209 // show debug information
3210 WRITE_DEBUG("network elements saving aborted");
3211 // stop
3212 return 1;
3213 } else {
3214 // Save network
3215 myNet->saveNetwork();
3216 saved = true;
3217 // show debug information
3218 WRITE_DEBUG("network elements saved after dialog");
3219 }
3220 } else {
3221 // Save network
3222 myNet->saveNetwork();
3223 saved = true;
3224 // show debug information
3225 WRITE_DEBUG("network elements saved");
3226 }
3227 } catch (IOError& e) {
3228 // write warning if netedit is running in testing mode
3229 WRITE_DEBUG("Opening FXMessageBox 'error saving network'");
3230 // open error message box
3231 FXMessageBox::error(this, MBOX_OK, TL("Saving Network failed!"), "%s", e.what());
3232 // write warning if netedit is running in testing mode
3233 WRITE_DEBUG("Closed FXMessageBox 'error saving network' with 'OK'");
3234 }
3235 if (saved) {
3236 // write info
3237 WRITE_MESSAGE(TL("Network saved in '") + neteditOptions.getString("net-file") + "'.");
3238 // After saving a net successfully, add it into Recent Nets list.
3239 myMenuBarFile.myRecentNetworks.appendFile(neteditOptions.getString("net-file").c_str());
3241 } else {
3243 WRITE_ERROR(TL("Could not save network in '") + neteditOptions.getString("net-file") + "'");
3244 }
3245 // end save network
3246 getApp()->endWaitCursor();
3247 // set focus again in net
3248 myViewNet->setFocus();
3249 return 1;
3250 }
3251}
3252
3253
3254long
3255GNEApplicationWindow::onCmdSaveNetworkAs(FXObject*, FXSelector, void*) {
3256 // get network file file
3257 const auto networkFile = GNEApplicationWindowHelper::openNetworkFileDialog(this, true);
3258 if (!networkFile.empty()) {
3259 // set ouput file in netedit configs
3260 auto& neteditOptions = OptionsCont::getOptions();
3261 neteditOptions.resetWritable();
3262 neteditOptions.set("net-file", networkFile);
3263 // update netedit title with the network name
3264 setTitle(MFXUtils::getTitleText(myTitlePrefix, networkFile.c_str()));
3265 // save network
3266 onCmdSaveNetwork(nullptr, 0, nullptr);
3267 }
3268 return 1;
3269}
3270
3271
3272long
3273GNEApplicationWindow::onCmdSavePlainXMLAs(FXObject*, FXSelector, void*) {
3274 // get neteditConfig filename
3276 // Remove extension
3277 if (!plainXMLFile.empty()) {
3278 // adjust file
3279 if (plainXMLFile.back() == '.') {
3280 plainXMLFile.pop_back();
3281 } else {
3282 plainXMLFile = StringUtils::replace(plainXMLFile, ".edg.xml", "");
3283 plainXMLFile = StringUtils::replace(plainXMLFile, ".nod.xml", "");
3284 plainXMLFile = StringUtils::replace(plainXMLFile, ".con.xml", "");
3285 plainXMLFile = StringUtils::replace(plainXMLFile, ".typ.xml", "");
3286 plainXMLFile = StringUtils::replace(plainXMLFile, ".tll.xml", "");
3287 plainXMLFile = StringUtils::replace(plainXMLFile, ".xml", "");
3288 }
3289 }
3290 // continue depending of file
3291 if (!plainXMLFile.empty()) {
3292 // start saving plain XML
3293 getApp()->beginWaitCursor();
3294 try {
3295 myNet->savePlain(plainXMLFile);
3296 // write info
3297 WRITE_MESSAGE(TL("Plain XML saved with prefix '") + plainXMLFile + "'");
3298 } catch (IOError& e) {
3299 // write warning if netedit is running in testing mode
3300 WRITE_DEBUG("Opening FXMessageBox 'Error saving plainXML'");
3301 // open message box
3302 FXMessageBox::error(this, MBOX_OK, TL("Saving plain xml failed!"), "%s", e.what());
3303 // write warning if netedit is running in testing mode
3304 WRITE_DEBUG("Closed FXMessageBox 'Error saving plainXML' with 'OK'");
3305 }
3306 // end saving plain XML
3307 getApp()->endWaitCursor();
3308
3309 // restore focus
3310 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
3337 // restore focus
3338 setFocus();
3339 }
3340 return 1;
3341}
3342
3343
3344long
3346 // obtain netedit option container
3347 auto& neteditOptions = OptionsCont::getOptions();
3348 neteditOptions.resetWritable();
3349 // Check if configuration file was already set at start of netedit or with a previous save
3350 if (neteditOptions.getString("configuration-file").empty()) {
3351 return onCmdSaveNeteditConfigAs(nullptr, 0, nullptr);
3352 } else {
3353 // get config file
3354 const auto neteditConfigFile = neteditOptions.getString("configuration-file");
3355 // get file path
3356 const auto filePath = FileHelpers::getFilePath(neteditConfigFile);
3357 // get patter file
3358 auto patterFile = StringUtils::replace(neteditConfigFile, ".netecfg", "");
3359 // save all elements giving automatic names based on patter if their file isn't defined
3360 onCmdSaveNetwork(nullptr, MID_GNE_FORCESAVE, &patterFile);
3361 onCmdSaveAdditionals(nullptr, MID_GNE_FORCESAVE, &patterFile);
3362 onCmdSaveDemandElements(nullptr, MID_GNE_FORCESAVE, &patterFile);
3363 onCmdSaveDataElements(nullptr, MID_GNE_FORCESAVE, &patterFile);
3364 onCmdSaveMeanDatas(nullptr, MID_GNE_FORCESAVE, &patterFile);
3365 // configuration
3366 std::ofstream out(StringUtils::transcodeToLocal(neteditConfigFile));
3367 if (out.good()) {
3368 // write netedit config
3369 neteditOptions.writeConfiguration(out, true, false, false, filePath, true);
3370 // write info
3371 WRITE_MESSAGE(TL("Netedit configuration saved in '") + neteditConfigFile + "'");
3372 // config saved
3374 // After saving a config successfully, add it into recent configs
3375 myMenuBarFile.myRecentConfigs.appendFile(neteditOptions.getString("configuration-file").c_str());
3376 } else {
3377 WRITE_ERROR(TL("Could not save netedit configuration in '") + neteditConfigFile + "'");
3378 }
3379 out.close();
3380 return 1;
3381 }
3382}
3383
3384
3385long
3386GNEApplicationWindow::onCmdSaveNeteditConfigAs(FXObject* sender, FXSelector sel, void* ptr) {
3387 auto& neteditOptions = OptionsCont::getOptions();
3388 // get neteditConfig filename
3389 const auto neteditConfigFile = GNEApplicationWindowHelper::openNeteditConfigFileDialog(this, true);
3390 // continue depending of file
3391 if (!neteditConfigFile.empty()) {
3392 neteditOptions.resetWritable();
3393 neteditOptions.set("configuration-file", neteditConfigFile);
3394 // continue saving netedit config
3395 return onCmdSaveNeteditConfig(sender, sel, ptr);
3396 } else {
3397 return 0;
3398 }
3399}
3400
3401
3402long
3403GNEApplicationWindow::onUpdSaveNeteditConfig(FXObject* sender, FXSelector, void*) {
3404 // check if enable or disable save netedit config button
3405 if (myNet == nullptr) {
3406 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3407 } else if (OptionsCont::getOptions().getString("configuration-file").empty()) {
3408 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3409 } else if (!myNet->getSavingStatus()->isNeteditConfigSaved()) {
3410 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3411 } else {
3412 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3413 }
3414 // check if enable/disable save individual files
3415 if (myNet) {
3419 } else {
3421 }
3422 }
3423 return 1;
3424}
3425
3426
3427long
3428GNEApplicationWindow::onCmdSaveSumoConfig(FXObject* sender, FXSelector sel, void* ptr) {
3429 // obtain netedit option container
3430 auto& neteditOptions = OptionsCont::getOptions();
3431 // reset containers
3432 neteditOptions.resetWritable();
3434 // Check if configuration file was already set at start of netedit or with a previous save
3435 if (neteditOptions.getString("sumocfg-file").empty()) {
3436 return onCmdSaveSumoConfigAs(sender, sel, ptr);
3437 } else {
3438 // check if ignore additionals and demand elements (only used open SUMO-GUI from netedit)
3439 const FXSelector openSUMO = FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_T_OPENNETEDIT_OPENSUMO);
3440 const bool ignoreAdditionals = (sel == openSUMO) ? (myEditMenuCommands.loadAdditionalsInSUMOGUI->getCheck() == FALSE) : false;
3441 const bool ignoreDemandElements = (sel == openSUMO) ? (myEditMenuCommands.loadDemandInSUMOGUI->getCheck() == FALSE) : false;
3442 // get SumoConfig file
3443 const auto sumoConfigFile = neteditOptions.getString("sumocfg-file");
3444 // get config file without extension
3445 auto patterFile = StringUtils::replace(sumoConfigFile, ".sumocfg", "");
3446 // save all elements giving automatic names based on patter in their file isn't defined
3447 onCmdSaveNetwork(nullptr, MID_GNE_FORCESAVE, &patterFile);
3448 onCmdSaveAdditionals(nullptr, MID_GNE_FORCESAVE, &patterFile);
3449 onCmdSaveDemandElements(nullptr, MID_GNE_FORCESAVE, &patterFile);
3450 onCmdSaveMeanDatas(nullptr, MID_GNE_FORCESAVE, &patterFile);
3451 // set input in sumo options
3452 setInputInSumoOptions(ignoreAdditionals, ignoreDemandElements);
3453 // if we have trips or flow over junctions, add option junction-taz
3456 mySumoOptions.set("junction-taz", "true");
3457 }
3458 std::ofstream out(StringUtils::transcodeToLocal(sumoConfigFile));
3459 if (out.good()) {
3460 // write SUMO config
3461 mySumoOptions.writeConfiguration(out, true, false, false, sumoConfigFile, true);
3462 // write info
3463 WRITE_MESSAGE(TL("SUMO configuration saved in '") + sumoConfigFile + "'");
3464 // if ignoreAdditionals or ignoreDemandElements is enabled, don't mark SumoConfig as saved
3465 if (!ignoreAdditionals && !ignoreDemandElements) {
3467 }
3468 // After saving a config successfully, add it into recent configs
3469 myMenuBarFile.myRecentConfigs.appendFile(neteditOptions.getString("sumocfg-file").c_str());
3470 } else {
3471 WRITE_MESSAGE(TL("Could not save SUMO configuration in '") + sumoConfigFile + "'");
3472 }
3473 out.close();
3474 return 1;
3475 }
3476}
3477
3478
3479long
3480GNEApplicationWindow::onCmdSaveSumoConfigAs(FXObject* sender, FXSelector sel, void* ptr) {
3481 auto& neteditOptions = OptionsCont::getOptions();
3482 // get sumoConfig filename
3483 const auto sumoConfigFile = GNEApplicationWindowHelper::openSumoConfigFileDialog(this, true);
3484 // continue depending of file
3485 if (!sumoConfigFile.empty()) {
3486 // save file in netedit options
3487 neteditOptions.resetWritable();
3488 neteditOptions.set("sumocfg-file", sumoConfigFile);
3489 // continue saving SUMO Config
3490 return onCmdSaveSumoConfig(sender, sel, ptr);
3491 } else {
3492 return 0;
3493 }
3494}
3495
3496
3497long
3498GNEApplicationWindow::onUpdSaveSumoConfig(FXObject* sender, FXSelector, void*) {
3499 if (myNet == nullptr) {
3500 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3501 } else if (OptionsCont::getOptions().getString("sumocfg-file").empty()) {
3502 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3503 } else if (!myNet->getSavingStatus()->isSumoConfigSaved()) {
3504 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3505 } else {
3506 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3507 }
3508}
3509
3510
3511long
3512GNEApplicationWindow::onCmdSaveTLSPrograms(FXObject* obj, FXSelector sel, void* ptr) {
3513 // get option container
3514 auto& neteditOptions = OptionsCont::getOptions();
3515 // Check if TLS Programs file was already set at start of netedit or with a previous save
3516 if (neteditOptions.getString("tls-file").empty()) {
3517 return onCmdSaveTLSProgramsAs(obj, sel, ptr);
3518 } else {
3519 // Start saving TLS Programs
3520 getApp()->beginWaitCursor();
3521 try {
3522 myNet->computeNetwork(this, true); // GNEChange_TLS does not triggere GNENet:requireRecompute
3523 myNet->saveTLSPrograms(neteditOptions.getString("tls-file"));
3524 // write info
3525 WRITE_MESSAGE(TL("TLS Programs saved in '") + neteditOptions.getString("tls-file") + "'");
3526 } catch (IOError& e) {
3527 // write warning if netedit is running in testing mode
3528 WRITE_DEBUG("Opening FXMessageBox 'error saving TLS Programs'");
3529 // open error message box
3530 FXMessageBox::error(this, MBOX_OK, TL("Saving TLS Programs failed!"), "%s", e.what());
3531 // write warning if netedit is running in testing mode
3532 WRITE_DEBUG("Closed FXMessageBox 'error saving TLS Programs' with 'OK'");
3533 }
3535 getApp()->endWaitCursor();
3536 // restore focus
3537 setFocus();
3538 }
3539 return 1;
3540}
3541
3542
3543long
3544GNEApplicationWindow::onUpdSaveTLSPrograms(FXObject* sender, FXSelector, void*) {
3545 if (myNet == nullptr) {
3546 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3547 } else {
3548 // check if there is at least one TLS
3549 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
3550 if (junction.second->getNBNode()->getControllingTLS().size() > 0) {
3551 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3552 }
3553 }
3554 // no TLS, then disable
3555 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3556 }
3557}
3558
3559
3560long
3561GNEApplicationWindow::onCmdSaveEdgeTypes(FXObject* obj, FXSelector sel, void* ptr) {
3562 // get option container
3563 auto& neteditOptions = OptionsCont::getOptions();
3564 // Check if edgeType file was already set at start of netedit or with a previous save
3565 if (neteditOptions.getString("edgetypes-file").empty()) {
3566 return onCmdSaveEdgeTypesAs(obj, sel, ptr);
3567 } else {
3568 // Start saving edgeTypes
3569 getApp()->beginWaitCursor();
3570 try {
3571 myNet->saveEdgeTypes(neteditOptions.getString("edgetypes-file"));
3572 // write info
3573 WRITE_MESSAGE(TL("EdgeType saved in '") + neteditOptions.getString("edgetypes-file") + "'");
3574 } catch (IOError& e) {
3575 // write warning if netedit is running in testing mode
3576 WRITE_DEBUG("Opening FXMessageBox 'error saving edgeTypes'");
3577 // open error message box
3578 FXMessageBox::error(this, MBOX_OK, TL("Saving edgeTypes failed!"), "%s", e.what());
3579 // write warning if netedit is running in testing mode
3580 WRITE_DEBUG("Closed FXMessageBox 'error saving edgeTypes' with 'OK'");
3581 }
3583 getApp()->endWaitCursor();
3584 // restore focus
3585 setFocus();
3586 }
3587 return 1;
3588}
3589
3590
3591long
3592GNEApplicationWindow::onUpdSaveEdgeTypes(FXObject* sender, FXSelector, void*) {
3593 // check if net exist and there are edge types
3594 if (myNet && (myNet->getAttributeCarriers()->getEdgeTypes().size() > 0)) {
3595 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3596 } else {
3597 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3598 }
3599 return 1;
3600}
3601
3602
3603long
3605 // get option container
3606 auto& neteditOptions = OptionsCont::getOptions();
3607 // get TLS file
3608 const auto TLSFile = GNEApplicationWindowHelper::openTLSFileDialog(this, true);
3609 // check tat file is valid
3610 if (!TLSFile.empty()) {
3611 // change value of "tls-file"
3612 neteditOptions.resetWritable();
3613 neteditOptions.set("tls-file", TLSFile);
3614 // save TLS Programs
3615 return onCmdSaveTLSPrograms(nullptr, 0, nullptr);
3616 } else {
3617 return 1;
3618 }
3619}
3620
3621
3622long
3623GNEApplicationWindow::onCmdSaveEdgeTypesAs(FXObject*, FXSelector, void*) {
3624 // get option container
3625 auto& neteditOptions = OptionsCont::getOptions();
3626 // get network file file
3627 const auto edgeTypesFile = GNEApplicationWindowHelper::openEdgeTypeFileDialog(this, true);
3628 // check tat file is valid
3629 if (!edgeTypesFile.empty()) {
3630 // change value of "edgetypes-file"
3631 neteditOptions.resetWritable();
3632 neteditOptions.set("edgetypes-file", edgeTypesFile);
3633 // save edgeTypes
3634 return onCmdSaveEdgeTypes(nullptr, 0, nullptr);
3635 } else {
3636 return 1;
3637 }
3638}
3639
3640
3641long
3642GNEApplicationWindow::onUpdSaveEdgeTypesAs(FXObject* sender, FXSelector, void*) {
3643 // check if net exist and there are edge types
3644 if (myNet && (myNet->getAttributeCarriers()->getEdgeTypes().size() > 0)) {
3645 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3646 } else {
3647 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3648 }
3649 return 1;
3650}
3651
3652
3653long
3654GNEApplicationWindow::onCmdOpenAdditionals(FXObject*, FXSelector, void*) {
3655 auto& neteditOptions = OptionsCont::getOptions();
3656 // get file
3657 const auto additionalFile = GNEApplicationWindowHelper::openAdditionalFileDialog(this, false);
3658 // check file
3659 if (!additionalFile.empty()) {
3660 // declare overwrite flag
3661 bool overwriteElements = false;
3662 // check if open question dialog box
3663 if (additionalFile == neteditOptions.getString("additional-files")) {
3664 // open overwrite dialog
3665 GNEOverwriteElementsDialog overwriteDialog(this, "additional");
3666 // continue depending of result
3667 if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::CANCEL) {
3668 // abort load
3669 return 0;
3670 } else if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::OVERWRITE) {
3671 // enable overwriteElements
3672 overwriteElements = true;
3673 }
3674 }
3675 // flag for save current saving status
3676 const auto previouslySaved = myNet->getSavingStatus()->isAdditionalsSaved();
3677 // disable validation for additionals
3678 XMLSubSys::setValidation("never", "auto", "auto");
3679 // Create additional handler
3680 GNEGeneralHandler generalHandler(myNet, additionalFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, overwriteElements);
3681 // begin undoList operation
3682 myUndoList->begin(Supermode::NETWORK, GUIIcon::SUPERMODENETWORK, TL("load additionals from '") + additionalFile + "'");
3683 // Run parser
3684 if (!generalHandler.parse()) {
3685 // write error
3686 WRITE_ERROR(TL("Loading of additional file failed: ") + additionalFile);
3687 } else {
3688 // change value of "additional-files"
3689 neteditOptions.resetWritable();
3690 neteditOptions.set("additional-files", additionalFile);
3691 // write info
3692 WRITE_MESSAGE(TL("Loading of additional file successfully: ") + additionalFile);
3693 // enable save if there is errors loading additionals
3694 if (previouslySaved && !generalHandler.isErrorCreatingElement()) {
3696 }
3697 }
3698 // end undoList operation
3699 myUndoList->end();
3700 // restore validation for additionals
3701 XMLSubSys::setValidation("auto", "auto", "auto");
3702 // check if clear undoList
3704 myUndoList->clear();
3705 }
3706 update();
3707 }
3708 return 1;
3709}
3710
3711
3712long
3714 // get additionalFile
3715 const std::string additionalFile = OptionsCont::getOptions().getString("additional-files");
3716 // disable validation for additionals
3717 XMLSubSys::setValidation("never", "auto", "auto");
3718 // Create general handler
3719 GNEGeneralHandler generalHandler(myNet, additionalFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, true);
3720 // begin undoList operation
3721 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODENETWORK, TL("reloading additionals from '") + additionalFile + "'");
3722 // clear additionals
3724 // Run parser
3725 if (!generalHandler.parse()) {
3726 WRITE_ERROR(TL("Reloading of additional file failed: ") + additionalFile);
3727 }
3728 // end undoList operation
3729 myUndoList->end();
3730 // restore validation for additionals
3731 XMLSubSys::setValidation("auto", "auto", "auto");
3732 // check if clear undoList
3734 myUndoList->clear();
3735 }
3736 update();
3737 return 1;
3738}
3739
3740
3741long
3742GNEApplicationWindow::onUpdReloadAdditionals(FXObject* sender, FXSelector, void*) {
3743 // check if file exist
3744 if (myViewNet && OptionsCont::getOptions().getString("additional-files").empty()) {
3745 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3746 } else {
3747 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3748 }
3749}
3750
3751
3752long
3753GNEApplicationWindow::onCmdSaveAdditionals(FXObject* sender, FXSelector sel, void* ptr) {
3754 // get option container
3755 auto& neteditOptions = OptionsCont::getOptions();
3756 // check if we have to set the output filename
3757 if ((sel == MID_GNE_FORCESAVE) && neteditOptions.getString("additional-files").empty()) {
3758 neteditOptions.set("additional-files", *(static_cast<std::string*>(ptr)) + ".add.xml");
3759 }
3761 // nothing to save
3762 return 1;
3763 } else if (neteditOptions.getString("additional-files").empty()) {
3764 // choose file to save
3765 return onCmdSaveAdditionalsAs(sender, sel, ptr);
3766 } else {
3767 // Start saving additionals
3768 getApp()->beginWaitCursor();
3769 try {
3770 // compute before saving (for detectors positions)
3771 myNet->computeNetwork(this);
3772 // save additionals
3774 // show info
3775 WRITE_MESSAGE(TL("Additionals saved in '") + neteditOptions.getString("additional-files") + "'");
3776 // end saving additionals
3777 getApp()->endWaitCursor();
3778 // restore focus
3779 setFocus();
3780 } catch (IOError& e) {
3781 // write warning if netedit is running in testing mode
3782 WRITE_DEBUG("Opening FXMessageBox 'error saving additionals'");
3783 // open error message box
3784 FXMessageBox::error(this, MBOX_OK, TL("Saving additionals failed!"), "%s", e.what());
3785 // write warning if netedit is running in testing mode
3786 WRITE_DEBUG("Closed FXMessageBox 'error saving additionals' with 'OK'");
3787 }
3788 getApp()->endWaitCursor();
3789 return 1;
3790 }
3791}
3792
3793
3794long
3796 // get option container
3797 auto& neteditOptions = OptionsCont::getOptions();
3798 // declare current folder
3799 FXString currentFolder = gCurrentFolder;
3800 // set current folder
3801 if (neteditOptions.getString("configuration-file").size() > 0) {
3802 currentFolder = getFolder(neteditOptions.getString("configuration-file"));
3803 } else if (neteditOptions.getString("net-file").size() > 0) {
3804 currentFolder = getFolder(neteditOptions.getString("net-file"));
3805 }
3806 // get additional file
3807 const auto additionalFile = GNEApplicationWindowHelper::openAdditionalFileDialog(this, true);
3808 // check that file is valid
3809 if (!additionalFile.empty()) {
3810 // reset writtable flag
3811 neteditOptions.resetWritable();
3812 // change value of "additional-files"
3813 neteditOptions.set("additional-files", additionalFile);
3814 // enable save additionals
3816 // save additionals
3817 return onCmdSaveAdditionals(nullptr, 0, nullptr);
3818 } else {
3819 return 1;
3820 }
3821}
3822
3823
3824long
3826 // declare current folder
3827 FXString currentFolder = gCurrentFolder;
3828 // get juPedSim file
3829 const auto juPedSimFile = GNEApplicationWindowHelper::openAdditionalFileDialog(this, true);
3830 // check that file is valid
3831 if (!juPedSimFile.empty()) {
3832 try {
3833 // Start saving additionals
3834 getApp()->beginWaitCursor();
3835 // save additionals
3836 myNet->saveJuPedSimElements(juPedSimFile);
3837 // show info
3838 WRITE_MESSAGE(TL("JuPedSim elements saved in '") + juPedSimFile + "'");
3839 // end saving additionals
3840 getApp()->endWaitCursor();
3841 // restore focus
3842 setFocus();
3843 } catch (IOError& e) {
3844 // write warning if netedit is running in testing mode
3845 WRITE_DEBUG("Opening FXMessageBox 'error saving JuPedSim elements'");
3846 // open error message box
3847 FXMessageBox::error(this, MBOX_OK, TL("Saving JuPedSim elements failed!"), "%s", e.what());
3848 // write warning if netedit is running in testing mode
3849 WRITE_DEBUG("Closed FXMessageBox 'error saving JuPedSim elements' with 'OK'");
3850 }
3851 }
3852 return 1;
3853}
3854
3855
3856long
3858 // get option container
3859 auto& neteditOptions = OptionsCont::getOptions();
3860 // get file
3861 const auto routeFile = GNEApplicationWindowHelper::openRouteFileDialog(this, false);
3862 // check file
3863 if (!routeFile.empty()) {
3864 // declare overwrite flag
3865 bool overwriteElements = false;
3866 // check if open question dialog box
3867 if (routeFile == neteditOptions.getString("route-files")) {
3868 // open overwrite dialog
3869 GNEOverwriteElementsDialog overwriteDialog(this, "route");
3870 // continue depending of result
3871 if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::CANCEL) {
3872 // abort load
3873 return 0;
3874 } else if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::OVERWRITE) {
3875 // enable overwriteElements
3876 overwriteElements = true;
3877 }
3878 }
3879 // save previous demand element status saving
3880 const auto previouslySaved = myNet->getSavingStatus()->isDemandElementsSaved();
3881 // disable validation for additionals
3882 XMLSubSys::setValidation("never", "auto", "auto");
3883 // Create generic handler
3884 GNEGeneralHandler handler(myNet, routeFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, overwriteElements);
3885 // begin undoList operation
3886 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODEDEMAND, TL("loading demand elements from '") + routeFile + "'");
3887 // Run parser for additionals
3888 if (!handler.parse()) {
3889 // write error
3890 WRITE_ERROR(TL("Loading of route file failed: ") + routeFile);
3891 } else {
3892 // change value of "route-files"
3893 neteditOptions.resetWritable();
3894 neteditOptions.set("route-files", routeFile);
3895 // show info
3896 WRITE_MESSAGE(TL("Loading of route file successfully: ") + routeFile);
3897 // enable demand elements if there is an error creating element
3898 if (previouslySaved && !handler.isErrorCreatingElement()) {
3900 }
3901 }
3902 // end undoList operation
3903 myUndoList->end();
3904 // restore validation
3905 XMLSubSys::setValidation("auto", "auto", "auto");
3906 // check if clear undoList
3908 myUndoList->clear();
3909 }
3910 update();
3911 }
3912 return 1;
3913}
3914
3915
3916long
3918 // get file
3919 const std::string routeFile = OptionsCont::getOptions().getString("route-files");
3920 // disable validation for additionals
3921 XMLSubSys::setValidation("never", "auto", "auto");
3922 // Create handler
3923 GNEGeneralHandler handler(myNet, routeFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, true);
3924 // begin undoList operation
3925 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODEDEMAND, TLF("reloading demand elements from '%'", routeFile));
3926 // clear demand elements
3928 // Run parser for additionals
3929 if (!handler.parse()) {
3930 WRITE_ERROR(TL("Reloading of route file failed: ") + routeFile);
3931 }
3932 // end undoList operation and update view
3933 myUndoList->end();
3934 // restore validation for demand
3935 XMLSubSys::setValidation("auto", "auto", "auto");
3936 // check if clear undoList
3938 myUndoList->clear();
3939 }
3940 update();
3941 return 1;
3942}
3943
3944
3945long
3946GNEApplicationWindow::onUpdReloadDemandElements(FXObject* sender, FXSelector, void*) {
3947 // check if file exist
3948 if (myViewNet && OptionsCont::getOptions().getString("route-files").empty()) {
3949 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3950 } else {
3951 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3952 }
3953}
3954
3955
3956long
3957GNEApplicationWindow::onCmdSaveDemandElements(FXObject* sender, FXSelector sel, void* ptr) {
3958 // get option container
3959 auto& neteditOptions = OptionsCont::getOptions();
3960 // check if we have to set the output filename
3961 if ((sel == MID_GNE_FORCESAVE) && neteditOptions.getString("route-files").empty()) {
3962 neteditOptions.set("route-files", *(static_cast<std::string*>(ptr)) + ".rou.xml");
3963 }
3964 // check saving conditions
3966 return 1;
3967 } else if (neteditOptions.getString("route-files").empty()) {
3968 return onCmdSaveDemandElementsAs(sender, sel, ptr);
3969 } else {
3970 // Start saving demand elements
3971 getApp()->beginWaitCursor();
3972 try {
3973 // compute before saving
3974 myNet->computeNetwork(this);
3975 // save demand elements
3977 // show info
3978 WRITE_MESSAGE(TL("Demand elements saved in '") + neteditOptions.getString("route-files") + "'");
3979 // end saving demand elements
3980 getApp()->endWaitCursor();
3981 // restore focus
3982 setFocus();
3983 } catch (IOError& e) {
3984 // write warning if netedit is running in testing mode
3985 WRITE_DEBUG("Opening FXMessageBox 'error saving demand elements'");
3986 // open error message box
3987 FXMessageBox::error(this, MBOX_OK, TL("Saving demand elements failed!"), "%s", e.what());
3988 // write warning if netedit is running in testing mode
3989 WRITE_DEBUG("Closed FXMessageBox 'error saving demand elements' with 'OK'");
3990 }
3991 getApp()->endWaitCursor();
3992 return 1;
3993 }
3994}
3995
3996
3997long
3998GNEApplicationWindow::onCmdSaveDemandElementsAs(FXObject* sender, FXSelector sel, void* ptr) {
3999 // get option container
4000 auto& neteditOptions = OptionsCont::getOptions();
4001 // declare current folder
4002 FXString currentFolder = gCurrentFolder;
4003 // set current folder
4004 if (neteditOptions.getString("configuration-file").size() > 0) {
4005 currentFolder = getFolder(neteditOptions.getString("configuration-file"));
4006 } else if (neteditOptions.getString("net-file").size() > 0) {
4007 currentFolder = getFolder(neteditOptions.getString("net-file"));
4008 }
4009 // get route file
4010 const auto routeFile = GNEApplicationWindowHelper::openRouteFileDialog(this, true);
4011 // check that file is correct
4012 if (!routeFile.empty()) {
4013 // reset writtable flag
4014 neteditOptions.resetWritable();
4015 // change value of "route-files"
4016 neteditOptions.set("route-files", routeFile);
4017 // requiere save demand elements
4019 // save demand elements
4020 return onCmdSaveDemandElements(sender, sel, ptr);
4021 } else {
4022 return 1;
4023 }
4024}
4025
4026
4027long
4028GNEApplicationWindow::onCmdOpenDataElements(FXObject*, FXSelector, void*) {
4029 // get option container
4030 auto& neteditOptions = OptionsCont::getOptions();
4031 // get file
4032 const auto dataFile = GNEApplicationWindowHelper::openDataFileDialog(this, false);
4033 // check file
4034 if (!dataFile.empty()) {
4035 // declare overwrite flag
4036 bool overwriteElements = false;
4037 // check if open question dialog box
4038 if (dataFile == neteditOptions.getString("data-files")) {
4039 // open overwrite dialog
4040 GNEOverwriteElementsDialog overwriteDialog(this, "data");
4041 // continue depending of result
4042 if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::CANCEL) {
4043 // abort load
4044 return 0;
4045 } else if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::OVERWRITE) {
4046 // enable overwriteElements
4047 overwriteElements = true;
4048 }
4049 }
4050 // save previous demand element status saving
4051 const auto previouslySaved = myNet->getSavingStatus()->isDataElementsSaved();
4052 // disable update data
4054 // disable validation for data elements
4055 XMLSubSys::setValidation("never", "auto", "auto");
4056 // Create data handler
4057 GNEDataHandler dataHandler(myNet, dataFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, overwriteElements);
4058 // begin undoList operation
4059 myUndoList->begin(Supermode::DATA, GUIIcon::SUPERMODEDATA, TL("loading data elements from '") + dataFile + "'");
4060 // Run data parser
4061 if (!dataHandler.parse()) {
4062 // write error
4063 WRITE_ERROR(TL("Loading of data file failed: ") + dataFile);
4064 } else {
4065 // change value of "data-files"
4066 neteditOptions.resetWritable();
4067 neteditOptions.set("data-files", dataFile);
4068 // show info
4069 WRITE_MESSAGE(TL("Loading of data file successfully: ") + dataFile);
4070 // enable demand elements if there is an error creating element
4071 if (previouslySaved && !dataHandler.isErrorCreatingElement()) {
4073 }
4074 }
4075 // end undoList operation
4076 myUndoList->end();
4077 // enable update data
4079 // restore validation for data
4080 XMLSubSys::setValidation("auto", "auto", "auto");
4081 // check if clear undoList
4083 myUndoList->clear();
4084 }
4085 update();
4086 }
4087 return 1;
4088}
4089
4090
4091long
4093 // get file
4094 const std::string dataFile = OptionsCont::getOptions().getString("data-files");
4095 // disable update data
4097 // disable validation for additionals
4098 XMLSubSys::setValidation("never", "auto", "auto");
4099 // Create additional handler
4100 GNEDataHandler dataHandler(myNet, dataFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
4101 // begin undoList operation
4102 myUndoList->begin(Supermode::DATA, GUIIcon::SUPERMODEDATA, TL("reloading data elements from '") + dataFile + "'");
4103 // clear data elements
4105 // Run data parser
4106 if (!dataHandler.parse()) {
4107 WRITE_ERROR(TL("Reloading of data file failed: ") + dataFile);
4108 }
4109 // restore validation for data
4110 XMLSubSys::setValidation("auto", "auto", "auto");
4111 // end undoList operation and update view
4112 myUndoList->end();
4113 // enable update data
4115 // check if clear undoList
4117 myUndoList->clear();
4118 }
4119 update();
4120 return 1;
4121}
4122
4123
4124long
4125GNEApplicationWindow::onUpdReloadDataElements(FXObject* sender, FXSelector, void*) {
4126 // check if file exist
4127 if (myViewNet && OptionsCont::getOptions().getString("data-files").empty()) {
4128 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
4129 } else {
4130 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
4131 }
4132}
4133
4134
4135long
4136GNEApplicationWindow::onCmdSaveDataElements(FXObject* sender, FXSelector sel, void* ptr) {
4137 // get option container
4138 auto& neteditOptions = OptionsCont::getOptions();
4139 // check if we have to set the output filename
4140 if ((sel == MID_GNE_FORCESAVE) && neteditOptions.getString("data-files").empty()) {
4141 neteditOptions.set("data-files", *(static_cast<std::string*>(ptr)) + ".dat.xml");
4142 }
4144 // nothing to save
4145 return 1;
4146 } else if (neteditOptions.getString("data-files").empty()) {
4147 return onCmdSaveDataElementsAs(sender, sel, ptr);
4148 } else {
4149 // Start saving data elements
4150 getApp()->beginWaitCursor();
4151 try {
4152 // save data elements
4154 // write einfo
4155 WRITE_MESSAGE(TL("Data elements saved in '") + neteditOptions.getString("data-files") + "'");
4156 } catch (IOError& e) {
4157 // write warning if netedit is running in testing mode
4158 WRITE_DEBUG("Opening FXMessageBox 'error saving data elements'");
4159 // open error message box
4160 FXMessageBox::error(this, MBOX_OK, TL("Saving data elements failed!"), "%s", e.what());
4161 // write warning if netedit is running in testing mode
4162 WRITE_DEBUG("Closed FXMessageBox 'error saving data elements' with 'OK'");
4163 }
4164 // end saving
4165 getApp()->endWaitCursor();
4166 // restore focus
4167 setFocus();
4168 return 1;
4169 }
4170}
4171
4172
4173long
4174GNEApplicationWindow::onCmdSaveDataElementsAs(FXObject* sender, FXSelector sel, void* ptr) {
4175 // get option container
4176 auto& neteditOptions = OptionsCont::getOptions();
4177 // declare current folder
4178 FXString currentFolder = gCurrentFolder;
4179 // set current folder
4180 if (neteditOptions.getString("configuration-file").size() > 0) {
4181 currentFolder = getFolder(neteditOptions.getString("configuration-file"));
4182 } else if (neteditOptions.getString("net-file").size() > 0) {
4183 currentFolder = getFolder(neteditOptions.getString("net-file"));
4184 }
4185 // get data file
4186 const auto dataFile = GNEApplicationWindowHelper::openDataFileDialog(this, true);
4187 // check that file is correct
4188 if (!dataFile.empty()) {
4189 // reset writtable flag
4190 neteditOptions.resetWritable();
4191 // change value of "data-files"
4192 neteditOptions.set("data-files", dataFile);
4193 // mark data elements as unsaved
4195 // save data elements
4196 return onCmdSaveDataElements(sender, sel, ptr);
4197 } else {
4198 return 1;
4199 }
4200}
4201
4202
4203long
4204GNEApplicationWindow::onCmdOpenMeanDatas(FXObject*, FXSelector, void*) {
4205 auto& neteditOptions = OptionsCont::getOptions();
4206 // get file
4207 const auto meanDataFile = GNEApplicationWindowHelper::openMeanDataDialog(this, false);
4208 // check file
4209 if (!meanDataFile.empty()) {
4210 // declare overwrite flag
4211 bool overwriteElements = false;
4212 // check if open question dialog box
4213 if (meanDataFile == neteditOptions.getString("meandata-files")) {
4214 // open overwrite dialog
4215 GNEOverwriteElementsDialog overwriteDialog(this, "meanData");
4216 // continue depending of result
4217 if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::CANCEL) {
4218 // abort load
4219 return 0;
4220 } else if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::OVERWRITE) {
4221 // enable overwriteElements
4222 overwriteElements = true;
4223 }
4224 }
4225 // save previous demand element status saving
4226 const auto previouslySaved = myNet->getSavingStatus()->isMeanDatasSaved();
4227 // disable validation for meanDatas
4228 XMLSubSys::setValidation("never", "auto", "auto");
4229 // Create meanData handler
4230 GNEGeneralHandler generalHandler(myNet, meanDataFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, overwriteElements);
4231 // begin undoList operation
4232 myUndoList->begin(Supermode::DATA, GUIIcon::SUPERMODEDATA, TL("load meanDatas from '") + meanDataFile + "'");
4233 // Run parser
4234 if (!generalHandler.parse()) {
4235 // write error
4236 WRITE_ERROR(TL("Loading of meandata file failed: ") + meanDataFile);
4237 } else {
4238 // change value of "meandata-files"
4239 neteditOptions.resetWritable();
4240 neteditOptions.set("meandata-files", meanDataFile);
4241 // show info
4242 WRITE_MESSAGE(TL("Loading of meandata file successfully: ") + meanDataFile);
4243 // enable demand elements if there is an error creating element
4244 if (previouslySaved && !generalHandler.isErrorCreatingElement()) {
4246 }
4247 }
4248 // end undoList operation
4249 myUndoList->end();
4250 // restore validation for meanDatas
4251 XMLSubSys::setValidation("auto", "auto", "auto");
4252 // check if clear undoList
4254 myUndoList->clear();
4255 }
4256 update();
4257 }
4258 return 1;
4259}
4260
4261
4262long
4263GNEApplicationWindow::onCmdReloadMeanDatas(FXObject*, FXSelector, void*) {
4264 // get file
4265 const std::string meanDataFile = OptionsCont::getOptions().getString("meandata-files");
4266 // disable validation for meanDatas
4267 XMLSubSys::setValidation("never", "auto", "auto");
4268 // Create general handler
4269 GNEGeneralHandler generalHandler(myNet, meanDataFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, true);
4270 // begin undoList operation
4271 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODENETWORK, TL("reloading meanDatas from '") + meanDataFile + "'");
4272 // clear meanDatas
4274 // Run parser
4275 if (!generalHandler.parse()) {
4276 WRITE_MESSAGE(TL("Loading of meandata file successfully: ") + meanDataFile);
4277 }
4278 // end undoList operation and update view
4279 myUndoList->end();
4280 // restore validation for meanDatas
4281 XMLSubSys::setValidation("auto", "auto", "auto");
4282 // check if clear undoList
4284 myUndoList->clear();
4285 }
4286 update();
4287 return 1;
4288}
4289
4290
4291long
4292GNEApplicationWindow::onUpdReloadMeanDatas(FXObject* sender, FXSelector, void*) {
4293 // check if file exist
4294 if (myViewNet && OptionsCont::getOptions().getString("meandata-files").empty()) {
4295 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
4296 } else {
4297 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
4298 }
4299}
4300
4301
4302long
4303GNEApplicationWindow::onCmdSaveMeanDatas(FXObject* sender, FXSelector sel, void* ptr) {
4304 // get option container
4305 auto& neteditOptions = OptionsCont::getOptions();
4306 // check saving conditions
4308 // nothing to save
4309 return 1;
4310 } else {
4311 // first check if we have to set the output filename
4312 if ((sel == MID_GNE_FORCESAVE) && neteditOptions.getString("meandata-files").empty()) {
4313 neteditOptions.set("meandata-files", *(static_cast<std::string*>(ptr)) + ".med.add.xml");
4314 }
4316 // nothing to save
4317 return 1;
4318 } else if (neteditOptions.getString("meandata-files").empty()) {
4319 return onCmdSaveMeanDatasAs(sender, sel, ptr);
4320 } else {
4321 // Start saving meanDatas
4322 getApp()->beginWaitCursor();
4323 try {
4324 // save mean datas
4326 // write info
4327 WRITE_MESSAGE(TL("MeanDatas saved in '") + neteditOptions.getString("meandata-files") + "'");
4328 } catch (IOError& e) {
4329 // write warning if netedit is running in testing mode
4330 WRITE_DEBUG("Opening FXMessageBox 'error saving meanData'");
4331 // open error message box
4332 FXMessageBox::error(this, MBOX_OK, TL("Saving meanData failed!"), "%s", e.what());
4333 // write warning if netedit is running in testing mode
4334 WRITE_DEBUG("Closed FXMessageBox 'error saving meanDara' with 'OK'");
4335 }
4336 // end saving
4337 getApp()->endWaitCursor();
4338 // restore focus
4339 setFocus();
4340 return 1;
4341 }
4342 }
4343}
4344
4345
4346long
4347GNEApplicationWindow::onCmdSaveMeanDatasAs(FXObject* sender, FXSelector sel, void* ptr) {
4348 // get option container
4349 auto& neteditOptions = OptionsCont::getOptions();
4350 // declare current folder
4351 FXString currentFolder = gCurrentFolder;
4352 // set current folder
4353 if (neteditOptions.getString("configuration-file").size() > 0) {
4354 currentFolder = getFolder(neteditOptions.getString("configuration-file"));
4355 } else if (neteditOptions.getString("net-file").size() > 0) {
4356 currentFolder = getFolder(neteditOptions.getString("net-file"));
4357 }
4358 // get meanData file
4359 const auto meanDataFile = GNEApplicationWindowHelper::openMeanDataDialog(this, true);
4360 // check that file is valid
4361 if (!meanDataFile.empty()) {
4362 // reset writtable flag
4363 neteditOptions.resetWritable();
4364 // change value of "meandata-files"
4365 neteditOptions.set("meandata-files", meanDataFile);
4366 // mark mean datas as unsaved
4368 // save meanDatas
4369 return onCmdSaveMeanDatas(sender, sel, ptr);
4370 } else {
4371 return 1;
4372 }
4373}
4374
4375
4376bool
4378 if (myNet && !myNet->getSavingStatus()->isNetworkSaved()) {
4379 // write warning if netedit is running in testing mode
4380 WRITE_DEBUG("Opening FXMessageBox 'Confirm close network'");
4381 // open question box
4382 const std::string header = TL("Confirm close Network");
4383 const std::string contentsA = TL("You have unsaved changes in the network.");
4384 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4385 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4386 // restore focus to view net
4387 myViewNet->setFocus();
4388 // if user close dialog box, check additionals and demand elements
4389 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4390 // write warning if netedit is running in testing mode
4391 WRITE_DEBUG("Closed FXMessageBox 'Confirm close network' with 'Quit'");
4396 // clear undo list
4397 clearUndoList();
4398 return true;
4399 } else {
4400 return false;
4401 }
4402 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4403 // save network
4404 onCmdSaveNetwork(nullptr, 0, nullptr);
4405 // check
4410 // clear undo list
4411 clearUndoList();
4412 return true;
4413 } else {
4414 return false;
4415 }
4416 } else {
4417 // write warning if netedit is running in testing mode
4418 if (answer == 2) {
4419 WRITE_DEBUG("Closed FXMessageBox 'Confirm close network' with 'No'");
4420 } else if (answer == 4) {
4421 WRITE_DEBUG("Closed FXMessageBox 'Confirm close network' with 'ESC'");
4422 }
4423 // return false to stop closing/reloading
4424 return false;
4425 }
4426 } else {
4431 // clear undo list
4432 clearUndoList();
4433 return true;
4434 } else {
4435 // return false to stop closing/reloading
4436 return false;
4437 }
4438 }
4439}
4440
4441
4442bool
4444 // Check if there are non saved additionals
4446 WRITE_DEBUG("Opening FXMessageBox 'Save additionals before close'");
4447 // open question box
4448 const std::string header = TL("Save additional elements before close");
4449 const std::string contentsA = TL("You have unsaved additional elements.");
4450 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4451 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4452 // restore focus to view net
4453 myViewNet->setFocus();
4454 // if answer was affirmative, but there was an error during saving additionals, return false to stop closing/reloading
4455 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4456 WRITE_DEBUG("Closed FXMessageBox 'Save additionals before close' with 'Quit'");
4457 // nothing to save, return true
4458 return true;
4459 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4460 // write warning if netedit is running in testing mode
4461 WRITE_DEBUG("Closed FXMessageBox 'Save additionals before close' with 'Yes'");
4462 if (onCmdSaveAdditionals(nullptr, 0, nullptr) == 1) {
4463 // additionals successfully saved
4464 return true;
4465 } else {
4466 // error saving additionals, abort saving
4467 return false;
4468 }
4469 } else {
4470 // write warning if netedit is running in testing mode
4471 if (answer == 2) {
4472 WRITE_DEBUG("Closed FXMessageBox 'Save additionals before close' with 'No'");
4473 } else if (answer == 4) {
4474 WRITE_DEBUG("Closed FXMessageBox 'Save additionals before close' with 'ESC'");
4475 }
4476 // abort saving
4477 return false;
4478 }
4479 } else {
4480 // nothing to save, return true
4481 return true;
4482 }
4483}
4484
4485
4486bool
4488 // Check if there are non saved demand elements
4490 WRITE_DEBUG("Opening FXMessageBox 'Save demand elements before close'");
4491 // open question box
4492 const std::string header = TL("Save demand elements before close");
4493 const std::string contentsA = TL("You have unsaved demand elements.");
4494 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4495 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4496 // restore focus to view net
4497 myViewNet->setFocus();
4498 // if answer was affirmative, but there was an error during saving demand elements, return false to stop closing/reloading
4499 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4500 WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before close' with 'Quit'");
4501 // nothing to save, return true
4502 return true;
4503 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4504 // write warning if netedit is running in testing mode
4505 WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before close' with 'Yes'");
4506 if (onCmdSaveDemandElements(nullptr, MID_GNE_FORCESAVE, nullptr) == 1) {
4507 // demand elements successfully saved
4508 return true;
4509 } else {
4510 // error saving demand elements, abort saving
4511 return false;
4512 }
4513 } else {
4514 // write warning if netedit is running in testing mode
4515 if (answer == 2) {
4516 WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before close' with 'No'");
4517 } else if (answer == 4) {
4518 WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before close' with 'ESC'");
4519 }
4520 // abort saving
4521 return false;
4522 }
4523 } else {
4524 // nothing to save, return true
4525 return true;
4526 }
4527}
4528
4529
4530bool
4532 // Check if there are non saved data elements
4534 WRITE_DEBUG("Opening FXMessageBox 'Save data elements before close'");
4535 // open question box
4536 const std::string header = TL("Save data elements before close");
4537 const std::string contentsA = TL("You have unsaved data elements.");
4538 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4539 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4540 // restore focus to view net
4541 myViewNet->setFocus();
4542 // if answer was affirmative, but there was an error during saving data elements, return false to stop closing/reloading
4543 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4544 WRITE_DEBUG("Closed FXMessageBox 'Save data elements before close' with 'Quit'");
4545 // nothing to save, return true
4546 return true;
4547 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4548 // write warning if netedit is running in testing mode
4549 WRITE_DEBUG("Closed FXMessageBox 'Save data elements before close' with 'Yes'");
4550 if (onCmdSaveDataElements(nullptr, MID_GNE_FORCESAVE, nullptr) == 1) {
4551 // data elements successfully saved
4552 return true;
4553 } else {
4554 // error saving data elements, abort saving
4555 return false;
4556 }
4557 } else {
4558 // write warning if netedit is running in testing mode
4559 if (answer == 2) {
4560 WRITE_DEBUG("Closed FXMessageBox 'Save data elements before close' with 'No'");
4561 } else if (answer == 4) {
4562 WRITE_DEBUG("Closed FXMessageBox 'Save data elements before close' with 'ESC'");
4563 }
4564 // abort saving
4565 return false;
4566 }
4567 } else {
4568 // nothing to save, return true
4569 return true;
4570 }
4571}
4572
4573
4574bool
4576 // Check if there are non saved data elements
4578 WRITE_DEBUG("Opening FXMessageBox 'Save meanData elements before close'");
4579 // open question box
4580 const std::string header = TL("Save meanData elements before close");
4581 const std::string contentsA = TL("You have unsaved meanData elements.");
4582 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4583 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4584 // restore focus to view net
4585 myViewNet->setFocus();
4586 // if answer was affirmative, but there was an error during saving meanData elements, return false to stop closing/reloading
4587 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4588 WRITE_DEBUG("Closed FXMessageBox 'Save meanData elements before close' with 'Quit'");
4589 // nothing to save, return true
4590 return true;
4591 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4592 // write warning if netedit is running in testing mode
4593 WRITE_DEBUG("Closed FXMessageBox 'Save meanData elements before close' with 'Yes'");
4594 if (onCmdSaveMeanDatas(nullptr, MID_GNE_FORCESAVE, nullptr) == 1) {
4595 // meanData elements successfully saved
4596 return true;
4597 } else {
4598 // error saving meanData elements, abort saving
4599 return false;
4600 }
4601 } else {
4602 // write warning if netedit is running in testing mode
4603 if (answer == 2) {
4604 WRITE_DEBUG("Closed FXMessageBox 'Save meanData elements before close' with 'No'");
4605 } else if (answer == 4) {
4606 WRITE_DEBUG("Closed FXMessageBox 'Save meanData elements before close' with 'ESC'");
4607 }
4608 // abort saving
4609 return false;
4610 }
4611 } else {
4612 // nothing to save, return true
4613 return true;
4614 }
4615}
4616
4617
4618void
4619GNEApplicationWindow::setInputInSumoOptions(const bool ignoreAdditionals, const bool ignoreRoutes) {
4620 // obtain netedit option container
4621 auto& neteditOptions = OptionsCont::getOptions();
4623 // set network
4624 mySumoOptions.set("net-file", neteditOptions.getString("net-file"));
4625 // set routes
4626 if (ignoreRoutes || neteditOptions.getString("route-files").empty()) {
4627 mySumoOptions.resetDefault("route-files");
4628 } else {
4629 mySumoOptions.set("route-files", neteditOptions.getString("route-files"));
4630 }
4631 // set SumoOptions depending of additionalFiles and meanData files
4632 if (ignoreAdditionals) {
4633 if (neteditOptions.getString("meandata-files").empty()) {
4634 mySumoOptions.resetDefault("additional-files");
4635 } else {
4636 mySumoOptions.set("additional-files", neteditOptions.getString("meandata-files"));
4637 }
4638 } else {
4639 if ((neteditOptions.getString("additional-files").size() > 0) && (neteditOptions.getString("meandata-files").size())) {
4640 mySumoOptions.set("additional-files", neteditOptions.getString("additional-files") + "," + neteditOptions.getString("meandata-files"));
4641 } else if (neteditOptions.getString("additional-files").size() > 0) {
4642 mySumoOptions.set("additional-files", neteditOptions.getString("additional-files"));
4643 } else if (neteditOptions.getString("meandata-files").size() > 0) {
4644 mySumoOptions.set("additional-files", neteditOptions.getString("meandata-files"));
4645 } else {
4646 mySumoOptions.resetDefault("additional-files");
4647 }
4648 }
4649}
4650
4651
4652FXString
4653GNEApplicationWindow::getFolder(const std::string& folder) const {
4654 // declare folder
4655 std::string newFolder = folder;
4656 // declare stop flag
4657 bool stop = false;
4658 // continue while stop is false
4659 while (!stop) {
4660 if (newFolder.empty()) {
4661 // new folder empty, then stop
4662 stop = true;
4663 } else if ((newFolder.back() == '\'') || (newFolder.back() == '\\') ||
4664 (newFolder.back() == '/') /* || (newFolder.back() == '//') */) {
4665 // removed file, then stop
4666 stop = true;
4667 } else {
4668 newFolder.pop_back();
4669 }
4670 }
4671 // if is empty, return gCurrentFolder
4672 if (newFolder.empty()) {
4673 return gCurrentFolder;
4674 }
4675 return FXString(newFolder.c_str());
4676}
4677
4678
4679void
4681 // check that view exists
4682 if (myViewNet) {
4684 }
4685 // update require recomputing
4687}
4688
4689
4690void
4692 // remove lock hotkeys
4694 // check supermode
4695 if (supermode == Supermode::NETWORK) {
4696 // menu commands
4700 // lock
4704 // processing
4709 } else if (supermode == Supermode::DEMAND) {
4710 // menu commands
4714 // lock
4718 // processing
4723 } else if (supermode == Supermode::DATA) {
4724 // menu commands
4728 // lock
4732 // processing
4737 } else {
4738 // menu commands
4743 // lock
4747 // processing
4751 }
4752 // continue depending of view
4753 if (myViewNet) {
4757 } else if (myViewNet->getEditModes().isJuPedSimView()) {
4760 }
4761 }
4762}
4763
4764
4765bool
4769
4770
4771void
4775
4776
4777void
4779 myUndoRedoListEnabled = reason;
4780}
4781
4782
4783const std::string&
4787
4788
4789void
4791 if (myViewNet) {
4792 // destroy Popup (to avoid crashes)
4794 }
4795 // clear undo list and return true to continue with closing/reload
4796 myUndoList->clear();
4797}
4798
4799
4804
4805
4810
4811
4816
4817
4822
4823
4828
4829
4834
4835
4840
4841
4842void
4844 // get option container
4845 auto& neteditOptions = OptionsCont::getOptions();
4846 // get additional files
4847 const auto additionalFiles = neteditOptions.getStringVector("additional-files");
4848 // check if ignore loading of additional files
4849 const auto ignoreLoadAdditionalFiles = neteditOptions.getBool("ignore.additionalelements");
4850 // check conditions
4851 if (ignoreLoadAdditionalFiles) {
4852 // reset flag
4853 neteditOptions.resetWritable();
4854 neteditOptions.set("ignore.additionalelements", "false");
4855 } else if (myNet && (additionalFiles.size() > 0)) {
4856 // use first file as output
4857 neteditOptions.resetWritable();
4858 neteditOptions.set("additional-files", additionalFiles.front());
4859 // begin undolist
4860 myUndoList->begin(Supermode::NETWORK, GUIIcon::SUPERMODENETWORK, TL("loading additional elements from '") + toString(additionalFiles) + "'");
4861 // iterate over every additional file
4862 bool setSaved = additionalFiles.size() == 1;
4863 for (const auto& file : additionalFiles) {
4864 // check if ignore missing imputs
4865 if (FileHelpers::isReadable(file) || !neteditOptions.getBool("ignore-missing-inputs")) {
4866 WRITE_MESSAGE(TL("loading additionals from '") + file + "'");
4867 // declare general handler
4868 GNEGeneralHandler handler(myNet, file, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
4869 // disable validation for additionals
4870 XMLSubSys::setValidation("never", "auto", "auto");
4871 // Run parser
4872 if (!handler.parse()) {
4873 WRITE_ERRORF(TL("Loading of % failed."), file);
4874 }
4875 setSaved &= !handler.isErrorCreatingElement();
4876 // set additionals in SumoConfig
4877 setInputInSumoOptions(false, false);
4878 // disable validation for additionals
4879 XMLSubSys::setValidation("auto", "auto", "auto");
4880 }
4881 }
4882 if (setSaved) {
4884 }
4885 // end undo list
4886 myUndoList->end();
4887 // check if clear undoList
4889 myUndoList->clear();
4890 }
4891 }
4892}
4893
4894
4895void
4897 // get option container
4898 auto& neteditOptions = OptionsCont::getOptions();
4899 // get demand files
4900 const auto demandFiles = neteditOptions.getStringVector("route-files");
4901 // check if ignore loading of additional files
4902 const auto ignoreLoadDemandFiles = neteditOptions.getBool("ignore.routeelements");
4903 // check conditions
4904 if (ignoreLoadDemandFiles) {
4905 // reset flag
4906 neteditOptions.resetWritable();
4907 neteditOptions.set("ignore.routeelements", "false");
4908 } else if (myNet && (demandFiles.size() > 0)) {
4909 // use first file as output
4910 neteditOptions.resetWritable();
4911 neteditOptions.set("route-files", demandFiles.front());
4912 // begin undolist
4913 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODEDEMAND, TL("loading demand elements from '") + toString(demandFiles) + "'");
4914 // iterate over every additional file
4915 for (const auto& file : demandFiles) {
4916 // check if ignore missing imputs
4917 if (FileHelpers::isReadable(file) || !neteditOptions.getBool("ignore-missing-inputs")) {
4918 WRITE_MESSAGE(TL("loading demand elements from '") + file + "'");
4919 // declare general handler
4920 GNEGeneralHandler handler(myNet, file, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
4921 // disable validation for additionals
4922 XMLSubSys::setValidation("never", "auto", "auto");
4923 // Run parser
4924 if (!handler.parse()) {
4925 WRITE_ERRORF(TL("Loading of % failed."), file);
4926 }
4927 // set additionals in SumoConfig
4928 setInputInSumoOptions(false, false);
4929 // disable validation for additionals
4930 XMLSubSys::setValidation("auto", "auto", "auto");
4931 }
4932 }
4933 // end undo list
4934 myUndoList->end();
4935 // check if clear undoList
4937 myUndoList->clear();
4938 }
4939 }
4940}
4941
4942
4943void
4945 // get option container
4946 auto& neteditOptions = OptionsCont::getOptions();
4947 // get meanData files
4948 const auto meanDataFiles = neteditOptions.getStringVector("meandata-files");
4949 // continue depending of network and additional files
4950 if (myNet && (meanDataFiles.size() > 0)) {
4951 // use first file as output
4952 neteditOptions.resetWritable();
4953 neteditOptions.set("meandata-files", meanDataFiles.front());
4954 // begin undolist
4955 myUndoList->begin(Supermode::DATA, GUIIcon::MODEMEANDATA, TL("loading meanDatas from '") + toString(meanDataFiles) + "'");
4956 // iterate over every additional file
4957 for (const auto& file : meanDataFiles) {
4958 // check if ignore missing imputs
4959 if (FileHelpers::isReadable(file) || !neteditOptions.getBool("ignore-missing-inputs")) {
4960 WRITE_MESSAGE(TL("loading meandatas from '") + file + "'");
4961 // declare general handler
4962 GNEGeneralHandler handler(myNet, file, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
4963 // disable validation for additionals
4964 XMLSubSys::setValidation("never", "auto", "auto");
4965 // Run parser
4966 if (!handler.parse()) {
4967 WRITE_ERRORF(TL("Loading of % failed."), file);
4968 }
4969 // set additionals in sumo options
4970 setInputInSumoOptions(false, false);
4971 // disable validation for additionals
4972 XMLSubSys::setValidation("auto", "auto", "auto");
4973 }
4974 }
4975 // end undo list
4976 myUndoList->end();
4977 // check if clear undoList
4979 myUndoList->clear();
4980 }
4981 }
4982}
4983
4984
4985void
4987 // get option container
4988 auto& neteditOptions = OptionsCont::getOptions();
4989 // get data files
4990 const auto dataFiles = neteditOptions.getStringVector("data-files");
4991 // continue depending of network and data files
4992 if (myNet && (dataFiles.size() > 0)) {
4993 // disable update data
4995 // begin undolist
4996 myUndoList->begin(Supermode::DATA, GUIIcon::SUPERMODEDATA, TL("loading data elements from '") + toString(dataFiles) + "'");
4997 // iterate over every data file
4998 for (const auto& file : dataFiles) {
4999 // check if ignore missing imputs
5000 if (FileHelpers::isReadable(file) || !neteditOptions.getBool("ignore-missing-inputs")) {
5001 WRITE_MESSAGE(TL("Loading data elements from '") + file + "'");
5002 GNEDataHandler dataHandler(myNet, file, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
5003 // disable validation for data elements
5004 XMLSubSys::setValidation("never", "auto", "auto");
5005 if (!dataHandler.parse()) {
5006 WRITE_ERRORF(TL("Loading of % failed."), file);
5007 }
5008 // set first dataElementsFiles as default file
5009 neteditOptions.resetWritable();
5010 neteditOptions.set("data-files", file);
5011 // disable validation for data elements
5012 XMLSubSys::setValidation("auto", "auto", "auto");
5013
5014 }
5015 }
5016 // end undolist
5017 myUndoList->end();
5018 // check if clear undoList
5020 myUndoList->clear();
5021 }
5022 // enable update data
5024 }
5025}
5026
5027// ---------------------------------------------------------------------------
5028// GNEApplicationWindow - protected methods
5029// ---------------------------------------------------------------------------
5030
5032 myToolbarsGrip(this),
5033 myMenuBarFile(this),
5034 myFileMenuCommands(this),
5035 myModesMenuCommands(this),
5036 myEditMenuCommands(this),
5037 myLockMenuCommands(this),
5038 myProcessingMenuCommands(this),
5039 myLocateMenuCommands(this),
5040 myToolsMenuCommands(this),
5041 myWindowsMenuCommands(this),
5042 myHelpMenuCommands(this),
5043 mySupermodeCommands(this) {
5044}
5045
5046
5047long
5048GNEApplicationWindow::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
5049 const long handled = FXMainWindow::onKeyPress(o, sel, eventData);
5050 if (handled == 0 && myMDIClient->numChildren() > 0) {
5051 GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
5052 if (w != nullptr) {
5053 w->onKeyPress(nullptr, sel, eventData);
5054 }
5055 }
5056 return 0;
5057}
5058
5059
5060long
5061GNEApplicationWindow::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
5062 const long handled = FXMainWindow::onKeyRelease(o, sel, eventData);
5063 if (handled == 0 && myMDIClient->numChildren() > 0) {
5064 GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
5065 if (w != nullptr) {
5066 w->onKeyRelease(nullptr, sel, eventData);
5067 }
5068 }
5069 return 0;
5070}
5071
5072
5073/****************************************************************************/
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_GNE_FORCESAVE
force save elements (using for saving netedit and sumo configs)
@ 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_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:112
#define GUIDesignHorizontalFrameStatusBar
Horizontal frame used in status bar.
Definition GUIDesigns.h:346
#define GUIDesignLabelStatusBar
label used in statusBar
Definition GUIDesigns.h:288
#define GUIDesignSplitter
Definition GUIDesigns.h:477
#define GUIDesignSplitterMDI
MDI Splitter.
Definition GUIDesigns.h:480
#define GUIDesignStatusBar
design used in status bar
Definition GUIDesigns.h:449
@ 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 parse()
parse
bool isErrorCreatingElement() const
get flag for check if a element wasn't created
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:671
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 refreshAttributesCreator()
refresh attribute creator
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
bool isSelectingParent() const
check if we're selecting a new parent
void refreshNeteditAttributesEditor(bool forceRefresh)
refresh netedit attributes
void clearTemplate()
clear template (used by shortcut)
void setTemplate()
set template (used by shortcut)
void copyTemplate()
copy template (used by shortcut)
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
TemplateEditor * getTemplateEditor() const
get template editor
GNEInspectorFrame::NeteditAttributesEditor * getNeteditAttributesEditor() const
get Netedit Attributes editor
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
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
int getNumberOfMeanDatas() const
get number of meanDatas
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEAdditional * > > & getAdditionals() const
get additionals
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
const std::map< const GUIGlObject *, GNECrossing * > & getCrossings() const
get crossings
int getNumberOfDemandElements() const
Return the number of demand elements.
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
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEDemandElement * > > & getDemandElements() const
get demand elements
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:2088
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
Definition GNENet.cpp:1737
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
Definition GNENet.cpp:1557
void saveTLSPrograms(const std::string &filename)
save TLS Programs elements of the network
Definition GNENet.cpp:2733
void saveJoined(const std::string &filename)
save log of joined junctions (and nothing else)
Definition GNENet.cpp:1352
GNENetHelper::SavingStatus * getSavingStatus() const
get saving status
Definition GNENet.cpp:131
void enableUpdateData()
Definition GNENet.cpp:2800
void saveEdgeTypes(const std::string &filename)
save edgeTypes elements of the network
Definition GNENet.cpp:2754
void saveAdditionals()
save additional elements
Definition GNENet.cpp:2177
void clearDemandElements(GNEUndoList *undoList)
clear demand elements
Definition GNENet.cpp:2101
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:142
void adjustPersonPlans(GNEUndoList *undoList)
adjust person plans
Definition GNENet.cpp:1843
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:1398
void cleanInvalidDemandElements(GNEUndoList *undoList)
clean invalid demand elements
Definition GNENet.cpp:1888
void cleanUnusedRoutes(GNEUndoList *undoList)
clean unused routes
Definition GNENet.cpp:1753
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:125
void saveDemandElements()
save demand element elements of the network
Definition GNENet.cpp:2230
void clearMeanDataElements(GNEUndoList *undoList)
clear meanDatas
Definition GNENet.cpp:2125
void disableUpdateData()
disable update data elements after inserting or removing an element in net
Definition GNENet.cpp:2811
void saveDataElements()
save data set elements of the network
Definition GNENet.cpp:2270
void saveJuPedSimElements(const std::string &file)
save JuPedSim elements
Definition GNENet.cpp:2216
void saveNetwork()
save the network
Definition GNENet.cpp:1309
bool isNetRecomputed() const
check if net require recomputing
Definition GNENet.cpp:1539
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
Definition GNENet.cpp:1684
void joinRoutes(GNEUndoList *undoList)
join routes
Definition GNENet.cpp:1779
void savePlain(const std::string &prefix)
save plain xml representation of the network (and nothing else)
Definition GNENet.cpp:1343
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2147
void saveMeanDatas()
save meanData elements of the network
Definition GNENet.cpp:2315
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1482
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
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
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
void hotkeyBackSpace()
handle backspace keypress
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
void setFrontAttributeCarrier(GNEAttributeCarrier *AC)
set front attributeCarrier
long onCmdToggleShowDemandElementsData(FXObject *, FXSelector, void *)
toggle show demand elements (data)
void abortOperation(bool clearSelection=true)
abort current edition operation
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
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
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
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:744
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