Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/dialogs/tools/GNERunPythonToolDialog.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 GNERunPythonToolDialog.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Mar 2023
17
///
18
// 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 GNERunPythonTool;
32
class GNEPythonTool;
33
class GUIEvent;
34
35
// ===========================================================================
36
// class definitions
37
// ===========================================================================
38
39
class GNERunPythonToolDialog : public GNEDialog {
40
/// @brief FOX-declaration
41
FXDECLARE(GNERunPythonToolDialog)
42
43
public:
44
/// @brief Constructor
45
GNERunPythonToolDialog(GNEApplicationWindow* applicationWindow, GNEPythonTool* tool);
46
47
/// @brief destructor
48
~GNERunPythonToolDialog();
49
50
/// @brief run internal test
51
void runInternalTest(const InternalTestStep::DialogArgument* dialogArgument);
52
53
/// @name FOX-callbacks
54
/// @{
55
56
/// @brief event after press save button
57
long onCmdSaveLog(FXObject*, FXSelector, void*);
58
59
/// @brief event after press abort button
60
long onCmdAbort(FXObject*, FXSelector, void*);
61
62
/// @brief event after press rerun button
63
long onCmdRerun(FXObject*, FXSelector, void*);
64
65
/// @brief event after press back button
66
long onCmdBack(FXObject*, FXSelector, void*);
67
68
/// @brief event after press cancel button
69
long onCmdCancel(FXObject*, FXSelector, void*);
70
71
/// @brief event after press close button
72
long onCmdAccept(FXObject*, FXSelector, void*);
73
74
/// @brief called when the thread signals an event
75
long onThreadEvent(FXObject*, FXSelector, void*);
76
77
/// @}
78
79
protected:
80
/// @brief FOX needs this
81
FOX_CONSTRUCTOR(GNERunPythonToolDialog);
82
83
/// @brief update toolDialog
84
void updateDialog();
85
86
private:
87
/// @brief tool
88
GNEPythonTool* myPythonTool = nullptr;
89
90
/// @brief thread for running tool
91
GNERunPythonTool* myRunTool = nullptr;
92
93
/// @brief text
94
FXText* myText = nullptr;
95
96
/// @brief List of received events
97
MFXSynchQue<GUIEvent*> myEvents;
98
99
/// @brief io-event with the runner thread
100
FXEX::MFXThreadEvent myThreadEvent;
101
102
/// @brief Invalidated copy constructor.
103
GNERunPythonToolDialog(const GNERunPythonToolDialog&) = delete;
104
105
/// @brief Invalidated assignment operator.
106
GNERunPythonToolDialog& operator=(const GNERunPythonToolDialog&) = delete;
107
};
108
109