Eclipse SUMO - Simulation of Urban MObility
GUILoadThread.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2002-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 /****************************************************************************/
21 // Class describing the thread that performs the loading of a simulation
22 /****************************************************************************/
23 #pragma once
24 #include <config.h>
25 
26 #include <utils/common/SUMOTime.h>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
37 class GUINet;
38 class GUIEvent;
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
48 public:
51  FXEX::MFXThreadEvent& ev, const bool isLibsumo);
52 
54  virtual ~GUILoadThread();
55 
58  FXint run();
59 
61  void loadConfigOrNet(const std::string& file);
62 
64  void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);
65 
66  const std::string& getFileName() const;
67 
68 protected:
74  void submitEndAndCleanup(GUINet* net, const SUMOTime simStartTime, const SUMOTime simEndTime,
75  const std::vector<std::string>& guiSettingsFiles = std::vector<std::string>(),
76  const bool osgView = false,
77  const bool viewportFromRegistry = false);
78 
79 protected:
82 
84  std::string myFile;
85 
87  std::string myTitle;
88 
92 
94 
96 
98  const bool myAmLibsumo;
99 
100 };
long long int SUMOTime
Definition: GUI.h:35
The main window of the SUMO-gui.
void submitEndAndCleanup(GUINet *net, const SUMOTime simStartTime, const SUMOTime simEndTime, const std::vector< std::string > &guiSettingsFiles=std::vector< std::string >(), const bool osgView=false, const bool viewportFromRegistry=false)
Closes the loading process.
OutputDevice * myWarningRetriever
Definition: GUILoadThread.h:91
std::string myFile
the path to load the simulation from
Definition: GUILoadThread.h:84
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on.
Definition: GUILoadThread.h:91
virtual ~GUILoadThread()
destructor
void loadConfigOrNet(const std::string &file)
begins the loading of the given file
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
const std::string & getFileName() const
std::string myTitle
the title string for the application
Definition: GUILoadThread.h:87
OutputDevice * myMessageRetriever
Definition: GUILoadThread.h:91
GUILoadThread(FXApp *app, GUIApplicationWindow *mw, MFXSynchQue< GUIEvent * > &eq, FXEX::MFXThreadEvent &ev, const bool isLibsumo)
constructor
GUIApplicationWindow * myParent
the parent window to inform about the loading
Definition: GUILoadThread.h:81
FXEX::MFXThreadEvent & myEventThrow
Definition: GUILoadThread.h:95
const bool myAmLibsumo
whether we are running in libsumo
Definition: GUILoadThread.h:98
MFXSynchQue< GUIEvent * > & myEventQue
Definition: GUILoadThread.h:93
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:82
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61