/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2002-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GUILoadThread.h14/// @author Daniel Krajzewicz15/// @author Sascha Krieg16/// @author Michael Behrisch17/// @author Jakob Erdmann18/// @date Sept 200219///20// Class describing the thread that performs the loading of a simulation21/****************************************************************************/22#pragma once23#include <config.h>2425#include <utils/common/SUMOTime.h>26#include <utils/common/MsgHandler.h>27#include <utils/foxtools/MFXSingleEventThread.h>28#include <utils/foxtools/MFXThreadEvent.h>29#include <utils/foxtools/MFXSynchQue.h>303132// ===========================================================================33// class declarations34// ===========================================================================35class GUIApplicationWindow;36class GUINet;37class GUIEvent;383940// ===========================================================================41// class definitions42// ===========================================================================43/**44* @class GUILoadThread45*/46class GUILoadThread : public MFXSingleEventThread {47public:48/// constructor49GUILoadThread(FXApp* app, GUIApplicationWindow* mw, MFXSynchQue<GUIEvent*>& eq,50FXEX::MFXThreadEvent& ev, const bool isLibsumo);5152/// destructor53virtual ~GUILoadThread();5455/** starts the thread56the thread ends after the net has been loaded */57FXint run();5859/// begins the loading of the given file60void loadConfigOrNet(const std::string& file);6162/// Retrieves messages from the loading module63void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);6465const std::string& getFileName() const;6667protected:68/** @brief Closes the loading process69*70* This method is called both on success and failure.71* All message callbacks to this instance are removed and the parent72* application is informed about the loading */73void submitEndAndCleanup(GUINet* net, const SUMOTime simStartTime, const SUMOTime simEndTime,74const std::vector<std::string>& guiSettingsFiles = std::vector<std::string>(),75const bool osgView = false,76const bool viewportFromRegistry = false);7778protected:79/// the parent window to inform about the loading80GUIApplicationWindow* myParent;8182/// the path to load the simulation from83std::string myFile;8485/// the title string for the application86std::string myTitle;8788/** @brief The instances of message retriever encapsulations89Needed to be deleted from the handler later on */90OutputDevice* myErrorRetriever, *myMessageRetriever, *myWarningRetriever;9192MFXSynchQue<GUIEvent*>& myEventQue;9394FXEX::MFXThreadEvent& myEventThrow;9596/// whether we are running in libsumo97const bool myAmLibsumo;9899};100101102