Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/dialogs/run/GNERunDialog.h
169684 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 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 GNERunDialog.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Aug 2025
17
///
18
// Abstract dialog for running tools
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <netedit/dialogs/GNEDialog.h>
24
#include <utils/foxtools/MFXSynchQue.h>
25
#include <utils/foxtools/MFXThreadEvent.h>
26
27
// ===========================================================================
28
// class declarations
29
// ===========================================================================
30
31
class GUIEvent;
32
33
// ===========================================================================
34
// class definitions
35
// ===========================================================================
36
37
class GNERunDialog : public GNEDialog {
38
/// @brief FOX-declaration
39
FXDECLARE_ABSTRACT(GNERunDialog)
40
41
public:
42
/// @brief Constructor
43
GNERunDialog(GNEApplicationWindow* applicationWindow,
44
const std::string& name, GUIIcon titleIcon);
45
46
/// @brief destructor
47
~GNERunDialog();
48
49
/// @brief run internal test
50
virtual void runInternalTest(const InternalTestStep::DialogArgument* dialogArgument) = 0;
51
52
/// @brief get run command
53
virtual std::string getRunCommand() const = 0;
54
55
/// @brief add event in the queue
56
void addEvent(GUIEvent* event, const bool signal);
57
58
/// @name FOX-callbacks
59
/// @{
60
61
/// @brief event after press abort button
62
long onCmdAbort(FXObject*, FXSelector, void*);
63
64
/// @brief event after press rerun button
65
long onCmdRun(FXObject*, FXSelector, void*);
66
67
/// @brief event after press back button
68
virtual long onCmdBack(FXObject*, FXSelector, void*) = 0;
69
70
/// @brief event after press close button
71
virtual long onCmdAccept(FXObject*, FXSelector, void*) = 0;
72
73
/// @brief event after press save button
74
long onCmdSaveLog(FXObject*, FXSelector, void*);
75
76
/// @brief called when the thread signals an event
77
long onThreadEvent(FXObject*, FXSelector, void*);
78
79
/// @}
80
81
protected:
82
/// @brief FOX needs this
83
FOX_CONSTRUCTOR(GNERunDialog);
84
85
/// @brief text
86
FXText* myText = nullptr;
87
88
/// @brief List of received events
89
MFXSynchQue<GUIEvent*> myEvents;
90
91
/// @brief io-event with the runner thread
92
FXEX::MFXThreadEvent myThreadEvent;
93
94
/// @brief flag to check if there is an error
95
bool myError = false;
96
97
/// @brief update dialog buttons
98
void updateDialogButtons();
99
100
private:
101
/// @brief Invalidated copy constructor.
102
GNERunDialog(const GNERunDialog&) = delete;
103
104
/// @brief Invalidated assignment operator.
105
GNERunDialog& operator=(const GNERunDialog&) = delete;
106
};
107
108