-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgt_python_setup.h
More file actions
93 lines (77 loc) · 2.34 KB
/
gt_python_setup.h
File metadata and controls
93 lines (77 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/* GTlab - Gas Turbine laboratory
* Source File: gt_python_setup.h
*
* SPDX-License-Identifier: Apache-2.0
* SPDX-FileCopyrightText: 2024 German Aerospace Center (DLR)
*
* Created on: 17.10.2022
* Author: Marvin Nöthen (DLR AT-TWK)
*/
#ifndef GTPYTHON_H
#define GTPYTHON_H
#include "gt_moduleinterface.h"
class GtpsPythonInterpreter;
/**
* @brief The GtPythonModule class
*/
class GtPythonSetupModule: public QObject, public GtModuleInterface
{
Q_OBJECT
GT_MODULE("gt_python_setup.json")
Q_INTERFACES(GtModuleInterface)
public:
/**
* @brief Returns current version number of datamodel extension
* @return version number
*/
GtVersionNumber version() override;
/**
* @brief Returns module description
* @return description
*/
QString description() const override;
/**
* @brief Is called directly after loading the module.
* It validates the Python environment and suppresses the Python Module
* if the environment is not valid.
*/
void onLoad() override;
/**
* @brief To register the python preferences dialog
*/
void init() override;
private:
struct ErrorMsg
{
QString error;
QString task;
};
/// Error message
ErrorMsg m_errorMsg;
/**
* @brief It prepends the Python paths to the PATH environment variable.
* In addition, it sets the PYTHONHOME and the PYTHONPATH variable.
* @param interpreter Python interpreter.
*/
void setPythonPaths(const GtpsPythonInterpreter& interpreter);
/**
* @brief Opens a message box to ask the user to
* specify a Python interpreter.
* @param msg Message for the user.
*/
void showPythonErrorNotification(const ErrorMsg& error);
/**
* @brief Accepts the Python Module built with the specified Python
* version. That means it suppresses all supported Python Modules except
* the module built with the specified version.
* @param Python version to be accepted.
*/
void acceptPythonModule(const GtVersionNumber& version);
/**
* @brief Suppresses all Python Modules built with the Python versions
* specified in the vector of versions.
* @param Vector of Python versions to be suppressed.
*/
void suppressPythonModules(const QVector<GtVersionNumber>& pyVersions);
};
#endif // GTPYTHON_H