Line data Source code
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 : /****************************************************************************/ 14 : /// @file GUIDialog_Breakpoints.h 15 : /// @author Daniel Krajzewicz 16 : /// @author Jakob Erdmann 17 : /// @date Thu, 17 Jun 2004 18 : /// 19 : // Editor for simulation breakpoints 20 : /****************************************************************************/ 21 : #pragma once 22 : #include <config.h> 23 : 24 : #include <string> 25 : #include <vector> 26 : #include <utils/foxtools/fxheader.h> 27 : #include <utils/gui/div/GUIPersistentWindowPos.h> 28 : 29 : 30 : // =========================================================================== 31 : // class definition 32 : // =========================================================================== 33 : /** 34 : * @class GUIDialog_Breakpoints 35 : * @brief Editor for simulation breakpoints 36 : * 37 : * This dialog shows and lets the user edit the list of breakpoints - simulation 38 : * time steps where the simulation halts. 39 : * @todo Use a LineReader instead of >> while reading 40 : */ 41 : class GUIDialog_Breakpoints : public FXMainWindow, public GUIPersistentWindowPos { 42 : // FOX-declarations 43 0 : FXDECLARE(GUIDialog_Breakpoints) 44 : 45 : public: 46 : /** @brief Constructor 47 : * @param[in] parent The parent window 48 : */ 49 : GUIDialog_Breakpoints(GUIApplicationWindow* parent, std::vector<SUMOTime>& breakpoints, FXMutex& breakpointLock, const SUMOTime simBegin); 50 : 51 : /// @brief Destructor 52 : ~GUIDialog_Breakpoints(); 53 : 54 : /// @brief sets the focus after the window is created 55 : void show(); 56 : 57 : /// @name FOX-callbacks 58 : /// @{ 59 : 60 : /// @brief Called when the user presses the Load-button 61 : long onCmdLoad(FXObject*, FXSelector, void*); 62 : 63 : /// @brief Called when the user presses the Save-button 64 : long onCmdSave(FXObject*, FXSelector, void*); 65 : 66 : /// @brief Called when the user presses the Clear-button 67 : long onCmdClear(FXObject*, FXSelector, void*); 68 : 69 : /// @brief Called when the user clicks a time link in the message window 70 : long onCmdUpdateBreakpoints(FXObject*, FXSelector, void*); 71 : 72 : /// @brief Called when the user presses the Close-button 73 : long onCmdClose(FXObject*, FXSelector, void*); 74 : 75 : /// @brief Called when the table was changed 76 : long onCmdEditTable(FXObject*, FXSelector, void*); 77 : /// @} 78 : 79 : virtual void layout(); 80 : 81 : /// @brief Rebuilds the entire list 82 : void rebuildList(); 83 : 84 : protected: 85 : /// @brief FOX need this 86 0 : FOX_CONSTRUCTOR(GUIDialog_Breakpoints) 87 : 88 : private: 89 : 90 : /** @brief Builds a text representation of the items in the list 91 : * @return Breakpoints encoded as a string 92 : */ 93 : std::string encode2TXT(); 94 : 95 : /// @brief The list that holds the ids 96 : FXTable* myTable; 97 : 98 : /// @brief The parent window 99 : GUIApplicationWindow* myParent; 100 : 101 : /// @brief List of breakpoints 102 : std::vector<SUMOTime>* myBreakpoints; 103 : 104 : /// @brief Lock for modifying the list of breakpoints 105 : FXMutex* myBreakpointLock; 106 : 107 : /// @brief simulation begin 108 : SUMOTime mySimBegin; 109 : };