xmarte 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. xmarte-0.1.0/LICENSE +5 -0
  2. xmarte-0.1.0/MANIFEST.in +8 -0
  3. xmarte-0.1.0/PKG-INFO +98 -0
  4. xmarte-0.1.0/README.md +71 -0
  5. xmarte-0.1.0/pyproject.toml +94 -0
  6. xmarte-0.1.0/setup.cfg +4 -0
  7. xmarte-0.1.0/test.xmt +0 -0
  8. xmarte-0.1.0/xmarte/__init__.py +0 -0
  9. xmarte-0.1.0/xmarte/__main__.py +43 -0
  10. xmarte-0.1.0/xmarte/nodeeditor/node_edge.py +31 -0
  11. xmarte-0.1.0/xmarte/nodeeditor/node_edge_dragging.py +79 -0
  12. xmarte-0.1.0/xmarte/nodeeditor/node_edge_validators.py +32 -0
  13. xmarte-0.1.0/xmarte/nodeeditor/node_editor_widget.py +35 -0
  14. xmarte-0.1.0/xmarte/nodeeditor/node_graphics_edge.py +218 -0
  15. xmarte-0.1.0/xmarte/nodeeditor/node_graphics_edge_path.py +77 -0
  16. xmarte-0.1.0/xmarte/nodeeditor/node_graphics_node.py +49 -0
  17. xmarte-0.1.0/xmarte/nodeeditor/node_graphics_scene.py +7 -0
  18. xmarte-0.1.0/xmarte/nodeeditor/node_graphics_socket.py +64 -0
  19. xmarte-0.1.0/xmarte/nodeeditor/node_graphics_view.py +74 -0
  20. xmarte-0.1.0/xmarte/nodeeditor/node_node.py +93 -0
  21. xmarte-0.1.0/xmarte/nodeeditor/node_scene.py +250 -0
  22. xmarte-0.1.0/xmarte/nodeeditor/node_socket.py +70 -0
  23. xmarte-0.1.0/xmarte/qt.py +263 -0
  24. xmarte-0.1.0/xmarte/qt5/__init__.py +5 -0
  25. xmarte-0.1.0/xmarte/qt5/exception_hook.py +46 -0
  26. xmarte-0.1.0/xmarte/qt5/icons/__init__.py +0 -0
  27. xmarte-0.1.0/xmarte/qt5/icons/back_to_start.png +0 -0
  28. xmarte-0.1.0/xmarte/qt5/icons/delete.png +0 -0
  29. xmarte-0.1.0/xmarte/qt5/icons/step_back.png +0 -0
  30. xmarte-0.1.0/xmarte/qt5/libraries/__init__.py +0 -0
  31. xmarte-0.1.0/xmarte/qt5/libraries/functions.py +129 -0
  32. xmarte-0.1.0/xmarte/qt5/nodes/__init__.py +10 -0
  33. xmarte-0.1.0/xmarte/qt5/nodes/marte2_base.py +89 -0
  34. xmarte-0.1.0/xmarte/qt5/nodes/marte2_node.py +474 -0
  35. xmarte-0.1.0/xmarte/qt5/nodes/node_factory.py +75 -0
  36. xmarte-0.1.0/xmarte/qt5/nodes/node_graphics.py +334 -0
  37. xmarte-0.1.0/xmarte/qt5/nodes/node_handler.py +491 -0
  38. xmarte-0.1.0/xmarte/qt5/nodes/nodes.json +3 -0
  39. xmarte-0.1.0/xmarte/qt5/plugins/__init__.py +5 -0
  40. xmarte-0.1.0/xmarte/qt5/plugins/base_plugin.py +226 -0
  41. xmarte-0.1.0/xmarte/qt5/plugins/marte2/file_handlers/__init__.py +0 -0
  42. xmarte-0.1.0/xmarte/qt5/plugins/marte2/file_handlers/cfg.py +175 -0
  43. xmarte-0.1.0/xmarte/qt5/plugins/marte2/file_handlers/json.py +2 -0
  44. xmarte-0.1.0/xmarte/qt5/plugins/marte2/file_handlers/python.py +2 -0
  45. xmarte-0.1.0/xmarte/qt5/plugins/marte2/marte2.py +179 -0
  46. xmarte-0.1.0/xmarte/qt5/plugins/marte2/services/__init__.py +0 -0
  47. xmarte-0.1.0/xmarte/qt5/plugins/widgets/__init__.py +0 -0
  48. xmarte-0.1.0/xmarte/qt5/plugins/widgets/hover_button.py +51 -0
  49. xmarte-0.1.0/xmarte/qt5/services/__init__.py +29 -0
  50. xmarte-0.1.0/xmarte/qt5/services/api_manager/__init__.py +0 -0
  51. xmarte-0.1.0/xmarte/qt5/services/api_manager/api_manager.py +603 -0
  52. xmarte-0.1.0/xmarte/qt5/services/api_manager/widgets/__init__.py +0 -0
  53. xmarte-0.1.0/xmarte/qt5/services/api_manager/widgets/error_widget.py +44 -0
  54. xmarte-0.1.0/xmarte/qt5/services/api_manager/windows/__init__.py +0 -0
  55. xmarte-0.1.0/xmarte/qt5/services/api_manager/windows/error_check_wnd.py +63 -0
  56. xmarte-0.1.0/xmarte/qt5/services/app_def/__init__.py +0 -0
  57. xmarte-0.1.0/xmarte/qt5/services/app_def/app_def.py +106 -0
  58. xmarte-0.1.0/xmarte/qt5/services/app_def/widgets/__init__.py +0 -0
  59. xmarte-0.1.0/xmarte/qt5/services/app_def/widgets/gam_datasources.py +121 -0
  60. xmarte-0.1.0/xmarte/qt5/services/app_def/widgets/project_properties.py +106 -0
  61. xmarte-0.1.0/xmarte/qt5/services/app_def/windows/__init__.py +0 -0
  62. xmarte-0.1.0/xmarte/qt5/services/compilation/__init__.py +0 -0
  63. xmarte-0.1.0/xmarte/qt5/services/compilation/compile.py +258 -0
  64. xmarte-0.1.0/xmarte/qt5/services/compilation/widgets/__init__.py +0 -0
  65. xmarte-0.1.0/xmarte/qt5/services/compilation/widgets/compilation_settings.py +129 -0
  66. xmarte-0.1.0/xmarte/qt5/services/config_manager.py +151 -0
  67. xmarte-0.1.0/xmarte/qt5/services/data_handler/__init__.py +0 -0
  68. xmarte-0.1.0/xmarte/qt5/services/data_handler/data_handler.py +96 -0
  69. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/__init__.py +0 -0
  70. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/data/__init__.py +0 -0
  71. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/data/data_graphics_node.py +51 -0
  72. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/data/data_node.py +58 -0
  73. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/data/data_node_content.py +66 -0
  74. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/data/data_socket.py +33 -0
  75. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/data/nodes.json +3 -0
  76. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/graph/__init__.py +0 -0
  77. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/graph/graph_node.py +31 -0
  78. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/graph/graph_scene.py +63 -0
  79. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/graph_window.py +234 -0
  80. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/node_picker.py +215 -0
  81. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/plot/__init__.py +0 -0
  82. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/plot/plot_chart.py +38 -0
  83. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/plot/plot_graphics_node.py +17 -0
  84. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/plot/plot_node.py +188 -0
  85. xmarte-0.1.0/xmarte/qt5/services/data_handler/graph_window/plot/plot_socket.py +31 -0
  86. xmarte-0.1.0/xmarte/qt5/services/data_handler/icons/__init__.py +0 -0
  87. xmarte-0.1.0/xmarte/qt5/services/data_handler/icons/back-faster.png +0 -0
  88. xmarte-0.1.0/xmarte/qt5/services/data_handler/icons/back.png +0 -0
  89. xmarte-0.1.0/xmarte/qt5/services/data_handler/icons/forward-faster.png +0 -0
  90. xmarte-0.1.0/xmarte/qt5/services/data_handler/icons/forward.png +0 -0
  91. xmarte-0.1.0/xmarte/qt5/services/data_handler/icons/pause.png +0 -0
  92. xmarte-0.1.0/xmarte/qt5/services/data_handler/icons/play.png +0 -0
  93. xmarte-0.1.0/xmarte/qt5/services/data_handler/icons/restart.png +0 -0
  94. xmarte-0.1.0/xmarte/qt5/services/data_handler/icons/stop.png +0 -0
  95. xmarte-0.1.0/xmarte/qt5/services/data_handler/widgets/__init__.py +0 -0
  96. xmarte-0.1.0/xmarte/qt5/services/data_handler/widgets/playback_widget.py +248 -0
  97. xmarte-0.1.0/xmarte/qt5/services/deployment/__init__.py +0 -0
  98. xmarte-0.1.0/xmarte/qt5/services/deployment/deployment.py +48 -0
  99. xmarte-0.1.0/xmarte/qt5/services/deployment/windows/__init__.py +0 -0
  100. xmarte-0.1.0/xmarte/qt5/services/deployment/windows/deploy_window.py +326 -0
  101. xmarte-0.1.0/xmarte/qt5/services/file_support/__init__.py +0 -0
  102. xmarte-0.1.0/xmarte/qt5/services/file_support/file_support.py +257 -0
  103. xmarte-0.1.0/xmarte/qt5/services/recovery.py +45 -0
  104. xmarte-0.1.0/xmarte/qt5/services/service.py +53 -0
  105. xmarte-0.1.0/xmarte/qt5/services/split_view.py +89 -0
  106. xmarte-0.1.0/xmarte/qt5/services/state_service/__init__.py +0 -0
  107. xmarte-0.1.0/xmarte/qt5/services/state_service/functions.py +14 -0
  108. xmarte-0.1.0/xmarte/qt5/services/state_service/states.py +288 -0
  109. xmarte-0.1.0/xmarte/qt5/services/state_service/widgets/__init__.py +0 -0
  110. xmarte-0.1.0/xmarte/qt5/services/state_service/widgets/state_edge.py +223 -0
  111. xmarte-0.1.0/xmarte/qt5/services/state_service/widgets/state_message_preview.py +51 -0
  112. xmarte-0.1.0/xmarte/qt5/services/state_service/widgets/state_node.py +155 -0
  113. xmarte-0.1.0/xmarte/qt5/services/state_service/widgets/state_scene.py +178 -0
  114. xmarte-0.1.0/xmarte/qt5/services/state_service/windows/__init__.py +0 -0
  115. xmarte-0.1.0/xmarte/qt5/services/state_service/windows/state_machine_window.py +896 -0
  116. xmarte-0.1.0/xmarte/qt5/services/test_engine/__init__.py +0 -0
  117. xmarte-0.1.0/xmarte/qt5/services/test_engine/exceptions.py +11 -0
  118. xmarte-0.1.0/xmarte/qt5/services/test_engine/test_engine.py +43 -0
  119. xmarte-0.1.0/xmarte/qt5/services/test_engine/test_run_thread.py +361 -0
  120. xmarte-0.1.0/xmarte/qt5/services/test_engine/widgets/__init__.py +0 -0
  121. xmarte-0.1.0/xmarte/qt5/services/test_engine/widgets/remote.py +120 -0
  122. xmarte-0.1.0/xmarte/qt5/services/test_engine/widgets/test_settings_panel.py +76 -0
  123. xmarte-0.1.0/xmarte/qt5/services/test_engine/widgets/test_tab_panel.py +123 -0
  124. xmarte-0.1.0/xmarte/qt5/services/test_engine/windows/__init__.py +0 -0
  125. xmarte-0.1.0/xmarte/qt5/services/test_engine/windows/progress_window.py +189 -0
  126. xmarte-0.1.0/xmarte/qt5/services/test_engine/windows/test_window.py +561 -0
  127. xmarte-0.1.0/xmarte/qt5/services/type_db/__init__.py +0 -0
  128. xmarte-0.1.0/xmarte/qt5/services/type_db/type_db.py +50 -0
  129. xmarte-0.1.0/xmarte/qt5/services/type_db/widgets/__init__.py +0 -0
  130. xmarte-0.1.0/xmarte/qt5/services/type_db/windows/__init__.py +0 -0
  131. xmarte-0.1.0/xmarte/qt5/services/type_db/windows/types_window.py +406 -0
  132. xmarte-0.1.0/xmarte/qt5/styles.css +21 -0
  133. xmarte-0.1.0/xmarte/qt5/widgets/__init__.py +5 -0
  134. xmarte-0.1.0/xmarte/qt5/widgets/base_menu.py +265 -0
  135. xmarte-0.1.0/xmarte/qt5/widgets/base_scene.py +223 -0
  136. xmarte-0.1.0/xmarte/qt5/widgets/close_save.py +22 -0
  137. xmarte-0.1.0/xmarte/qt5/widgets/mainpanel_widget.py +114 -0
  138. xmarte-0.1.0/xmarte/qt5/widgets/menubar_widget.py +59 -0
  139. xmarte-0.1.0/xmarte/qt5/widgets/node_editor_viewer.py +130 -0
  140. xmarte-0.1.0/xmarte/qt5/widgets/nodeditor.py +240 -0
  141. xmarte-0.1.0/xmarte/qt5/widgets/path_browser.py +82 -0
  142. xmarte-0.1.0/xmarte/qt5/widgets/project_widget.py +33 -0
  143. xmarte-0.1.0/xmarte/qt5/widgets/scene.py +106 -0
  144. xmarte-0.1.0/xmarte/qt5/widgets/settings/__init__.py +15 -0
  145. xmarte-0.1.0/xmarte/qt5/widgets/settings/defaults.py +98 -0
  146. xmarte-0.1.0/xmarte/qt5/widgets/settings/general.py +108 -0
  147. xmarte-0.1.0/xmarte/qt5/widgets/settings/panel.py +60 -0
  148. xmarte-0.1.0/xmarte/qt5/widgets/toolbar_widget.py +166 -0
  149. xmarte-0.1.0/xmarte/qt5/windows/__init__.py +0 -0
  150. xmarte-0.1.0/xmarte/qt5/windows/base_window.py +82 -0
  151. xmarte-0.1.0/xmarte/qt5/windows/help_window.py +73 -0
  152. xmarte-0.1.0/xmarte/qt5/windows/settings_window.py +146 -0
  153. xmarte-0.1.0/xmarte.egg-info/PKG-INFO +98 -0
  154. xmarte-0.1.0/xmarte.egg-info/SOURCES.txt +155 -0
  155. xmarte-0.1.0/xmarte.egg-info/dependency_links.txt +1 -0
  156. xmarte-0.1.0/xmarte.egg-info/requires.txt +18 -0
  157. xmarte-0.1.0/xmarte.egg-info/top_level.txt +1 -0
xmarte-0.1.0/LICENSE ADDED
@@ -0,0 +1,5 @@
1
+ Copyright 2024 UKAEA
2
+
3
+ Licensed under the EUPL, Version 1.1 or - subsequent versions of the EUPL (the "Licence"). You may not use this work except in compliance with the Licence. You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
4
+
5
+ Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licence permissions and limitations under the Licence.
@@ -0,0 +1,8 @@
1
+ include *.xmt
2
+ include *.png
3
+ include *.json
4
+ include *.css
5
+ recursive-include xmarte *.xmt
6
+ recursive-include xmarte *.png
7
+ recursive-include xmarte *.json
8
+ recursive-include xmarte *.css
xmarte-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,98 @@
1
+ Metadata-Version: 2.1
2
+ Name: xmarte
3
+ Version: 0.1.0
4
+ Summary: A GUI Application for configuration MARTe2 applications.
5
+ Author-email: Edward Jones <edward.jones1@ukaea.uk>
6
+ Requires-Python: >=3.9
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: PyQt5>=5.15.2
10
+ Requires-Dist: PyQt5-Qt5>=5.15.2
11
+ Requires-Dist: qdarkgraystyle>=1.0.2
12
+ Requires-Dist: pandas>=2.0.2
13
+ Requires-Dist: qtpy>=2.4.1
14
+ Requires-Dist: pyyaml>=6.0.1
15
+ Requires-Dist: pytest>=8.1.1
16
+ Requires-Dist: pytest-qt>=4.4.0
17
+ Requires-Dist: ruff>=0.3.5
18
+ Requires-Dist: fpdf>=1.7.2
19
+ Requires-Dist: pyqtchart>=5.15.2
20
+ Requires-Dist: pyqt-modern-slider>=0.0.5
21
+ Requires-Dist: matplotlib>=3.8.3
22
+ Requires-Dist: cryptography>=42.0.8
23
+ Requires-Dist: pytest-mock>=3.14.0
24
+ Requires-Dist: scipy>=1.13.1
25
+ Requires-Dist: nodeeditor
26
+ Requires-Dist: martepy
27
+
28
+ # Introduction
29
+
30
+ Welcome to the documentation for the XMARTe interface. A Graphical user interface for configuring, simulating and compiling MARTe2 Applications in a graphically based configuration method, mostly known as block based programming.
31
+
32
+ ## Intended Use
33
+
34
+ It is assumed that users have knowledge of MARTe2 prior to using this application.
35
+
36
+ The application is intended for end users to develop MARTe2 applications rather than text based config files, this gives the user the ability to define and manage configurations in a graphical user interface.
37
+
38
+ This application helps generate configuration files for MARTe2, to actually use the files you will need MARTe2 compiled alongside MARTe2-components and setup to be usable - namely with the [traditional marte shell script](https://vcis-gitlab.f4e.europa.eu/aneto/MARTe2-demos-padova/-/blob/master/Startup/Main.sh?ref_type=heads). Initial setup instructions for MARTe2 and it's dependencies can be [found here](https://vcis-gitlab.f4e.europa.eu/aneto/MARTe2-demos-padova/-/tree/master?ref_type=heads).
39
+
40
+ ## Contributing & Support
41
+
42
+ When you require support please open an issue, if you would like to make adjustments to behaviour, code or additions to features, please do so as an issue and merge request.
43
+
44
+ **Note: You must comply with our guidelines as per the below.**
45
+
46
+ [Repository Guidelines](./Guidelines.md)
47
+
48
+ ## Installation
49
+
50
+ This project can work in both Windows and Linux based systems, requiring access right now to our internal gitlab repository - however in future will be available publicly.
51
+
52
+ ``` bash
53
+ pip install xmarte
54
+ ```
55
+
56
+ ## Running
57
+
58
+ Running the GUI can be done via the command:
59
+
60
+ ``` bash
61
+ python -m xmarte
62
+ ```
63
+
64
+ For further guidance and documentation on using the GUI please refer to:
65
+
66
+ <h2><a href="https://ukaea.github.io/xMARTe/">Official Documentation</h2>
67
+
68
+ ## Current Features
69
+
70
+ - Define new and read pre-existing configurations.
71
+ - Manage the state machine: states, events and messages.
72
+ - Manage a HTTP Instance and messages included.
73
+ - Use the standard GAMs and DataSources.*
74
+ - Type Database for managing simple, complex and nested types.
75
+ - Simulation framework to test configurations.
76
+ - Graphing to view recorded data.
77
+
78
+ ## Support
79
+
80
+ For support on using this application you can refer to the documentation found here:
81
+
82
+ [User Documentation](https://ukaea.github.io/xMARTe/)
83
+
84
+ If you have found a bug or have a feature request then please submit an issue within this repository.
85
+
86
+ If you need additional support feel free to contact our team:
87
+
88
+ - [Edward Jones](mailto:edward.jones1@ukaea.uk)
89
+ - [Adam Stephen](mailto:adam.stephen@ukaea.uk)
90
+ - [Hudson Baker](mailto:hudson.baker@ukaea.uk)
91
+
92
+ Additionally you can utilise the MARTe Discord community server:
93
+
94
+ [MARTe Discord Server](https://discord.gg/anSXWtnprW)
95
+
96
+ ## License
97
+
98
+ This software repository is provided under the European Union Public Licence as it's rooted in the use of MARTe2. You can find further details on the license [here](https://wayback.archive-it.org/12090/20200210204548/https://ec.europa.eu/idabc/en/document/7774.html).
xmarte-0.1.0/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # Introduction
2
+
3
+ Welcome to the documentation for the XMARTe interface. A Graphical user interface for configuring, simulating and compiling MARTe2 Applications in a graphically based configuration method, mostly known as block based programming.
4
+
5
+ ## Intended Use
6
+
7
+ It is assumed that users have knowledge of MARTe2 prior to using this application.
8
+
9
+ The application is intended for end users to develop MARTe2 applications rather than text based config files, this gives the user the ability to define and manage configurations in a graphical user interface.
10
+
11
+ This application helps generate configuration files for MARTe2, to actually use the files you will need MARTe2 compiled alongside MARTe2-components and setup to be usable - namely with the [traditional marte shell script](https://vcis-gitlab.f4e.europa.eu/aneto/MARTe2-demos-padova/-/blob/master/Startup/Main.sh?ref_type=heads). Initial setup instructions for MARTe2 and it's dependencies can be [found here](https://vcis-gitlab.f4e.europa.eu/aneto/MARTe2-demos-padova/-/tree/master?ref_type=heads).
12
+
13
+ ## Contributing & Support
14
+
15
+ When you require support please open an issue, if you would like to make adjustments to behaviour, code or additions to features, please do so as an issue and merge request.
16
+
17
+ **Note: You must comply with our guidelines as per the below.**
18
+
19
+ [Repository Guidelines](./Guidelines.md)
20
+
21
+ ## Installation
22
+
23
+ This project can work in both Windows and Linux based systems, requiring access right now to our internal gitlab repository - however in future will be available publicly.
24
+
25
+ ``` bash
26
+ pip install xmarte
27
+ ```
28
+
29
+ ## Running
30
+
31
+ Running the GUI can be done via the command:
32
+
33
+ ``` bash
34
+ python -m xmarte
35
+ ```
36
+
37
+ For further guidance and documentation on using the GUI please refer to:
38
+
39
+ <h2><a href="https://ukaea.github.io/xMARTe/">Official Documentation</h2>
40
+
41
+ ## Current Features
42
+
43
+ - Define new and read pre-existing configurations.
44
+ - Manage the state machine: states, events and messages.
45
+ - Manage a HTTP Instance and messages included.
46
+ - Use the standard GAMs and DataSources.*
47
+ - Type Database for managing simple, complex and nested types.
48
+ - Simulation framework to test configurations.
49
+ - Graphing to view recorded data.
50
+
51
+ ## Support
52
+
53
+ For support on using this application you can refer to the documentation found here:
54
+
55
+ [User Documentation](https://ukaea.github.io/xMARTe/)
56
+
57
+ If you have found a bug or have a feature request then please submit an issue within this repository.
58
+
59
+ If you need additional support feel free to contact our team:
60
+
61
+ - [Edward Jones](mailto:edward.jones1@ukaea.uk)
62
+ - [Adam Stephen](mailto:adam.stephen@ukaea.uk)
63
+ - [Hudson Baker](mailto:hudson.baker@ukaea.uk)
64
+
65
+ Additionally you can utilise the MARTe Discord community server:
66
+
67
+ [MARTe Discord Server](https://discord.gg/anSXWtnprW)
68
+
69
+ ## License
70
+
71
+ This software repository is provided under the European Union Public Licence as it's rooted in the use of MARTe2. You can find further details on the license [here](https://wayback.archive-it.org/12090/20200210204548/https://ec.europa.eu/idabc/en/document/7774.html).
@@ -0,0 +1,94 @@
1
+ [project]
2
+ name = "xmarte"
3
+ version = "0.1.0"
4
+ description = "A GUI Application for configuration MARTe2 applications."
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "Edward Jones", email = "edward.jones1@ukaea.uk" }
8
+ ]
9
+ requires-python = ">=3.9"
10
+ dependencies = [
11
+ "PyQt5>=5.15.2",
12
+ "PyQt5-Qt5>=5.15.2",
13
+ "qdarkgraystyle>=1.0.2",
14
+ "pandas>=2.0.2",
15
+ "qtpy>=2.4.1",
16
+ "pyyaml>=6.0.1",
17
+ "pytest>=8.1.1",
18
+ "pytest-qt>=4.4.0",
19
+ "ruff>=0.3.5",
20
+ "fpdf>=1.7.2",
21
+ "pyqtchart>=5.15.2",
22
+ "pyqt-modern-slider>=0.0.5",
23
+ "matplotlib>=3.8.3",
24
+ "cryptography>=42.0.8",
25
+ "pytest-mock>=3.14.0",
26
+ "scipy>=1.13.1",
27
+ "nodeeditor",
28
+ "martepy"
29
+ ]
30
+
31
+ [tool.setuptools.packages.find]
32
+ # Specify the include pattern to discover specific packages in the root
33
+ include = ["xmarte","xmarte.*"]
34
+ exclude = ["marte2_python","marte2_python.*"]
35
+
36
+ [tool.setuptools.package-data]
37
+ "my_package" = ["*.xmt", "*.png", "*.json", "*.css", "**/*.xmt", "**/*.png", "**/*.json", "**/*.css"] # Include .xmt and .png files
38
+
39
+ [tool.pylint]
40
+ disable = [
41
+ "raw-checker-failed",
42
+ "bad-inline-option",
43
+ "locally-disabled",
44
+ "file-ignored",
45
+ "suppressed-message",
46
+ "useless-suppression",
47
+ "deprecated-pragma",
48
+ "use-symbolic-message-instead",
49
+ "C0413",
50
+ "R0902",
51
+ "W0102",
52
+ "R0903",
53
+ "R0913",
54
+ "W0401",
55
+ "C0302",
56
+ "R0917",
57
+ "duplicate-code"
58
+ ]
59
+ extension-pkg-whitelist="PyQt5"
60
+ max-line-length = 100
61
+ ignore = ["CVS","my_first_plugin","docker","build_system","build","test"]
62
+ method-naming-style="camelCase"
63
+ function-naming-style="camelCase"
64
+ variable-naming-style="any"
65
+ class-attribute-naming-style="any"
66
+ argument-naming-style="snake_case"
67
+ attr-naming-style="any"
68
+
69
+ [tool.coverage.run]
70
+ omit = ["test/*", ".github", "docs/*", "cov_html", "build", ".pytest_cache/*"]
71
+
72
+ [tool.coverage.report]
73
+ omit = ["test/*", ".github", "docs/*", "cov_html", "build", ".pytest_cache/*"]
74
+ show_missing = true
75
+ precision = 2
76
+
77
+ [tool.coverage.html]
78
+ directory = "cov_html"
79
+ title = "Coverage Report for xMARTe2"
80
+
81
+ [tool.pytest.ini_options]
82
+ qt_api = "pyqt5"
83
+ testpaths = ["test"]
84
+
85
+ addopts = [
86
+ "--ignore=xmarte",
87
+ "--ignore=test/marte2_python",
88
+ "--ignore=test/test_menus/test_deployment_menu.py",
89
+ "-W", "ignore::DeprecationWarning"
90
+ ]
91
+
92
+ [build-system]
93
+ requires = ["setuptools>=61.0"]
94
+ build-backend = "setuptools.build_meta"
xmarte-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
xmarte-0.1.0/test.xmt ADDED
Binary file
File without changes
@@ -0,0 +1,43 @@
1
+ '''
2
+ Main entry point to the application from the module instance in site-packages
3
+ '''
4
+
5
+ import os
6
+
7
+ from PyQt5.QtGui import QPixmap, QColor
8
+ from PyQt5.QtWidgets import QApplication, QSplashScreen
9
+ from PyQt5.QtCore import Qt
10
+
11
+ from xmarte import qt
12
+
13
+ qt.splash = None
14
+
15
+ if __name__ == "__main__":
16
+ app = QApplication([])
17
+ if hasattr(Qt, "AA_EnableHighDpiScaling"):
18
+ app.setAttribute(Qt.AA_EnableHighDpiScaling, True)
19
+
20
+ if hasattr(Qt, "AA_UseHighDpiPixmaps"):
21
+ app.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
22
+
23
+ pixmap_file = os.path.abspath(
24
+ os.path.join(os.path.dirname(__file__), "splashscreen.jpg")
25
+ )
26
+ pixmap = QPixmap(pixmap_file)
27
+ screen_resolution = QApplication.instance().desktop().screenGeometry().size()
28
+ SIZE_RATIO = 0.5
29
+ scaled_width = int(screen_resolution.width() * SIZE_RATIO)
30
+ scaled_height = int(screen_resolution.height() * SIZE_RATIO)
31
+ scaled_image = pixmap.scaled(scaled_width, scaled_height,
32
+ aspectRatioMode=Qt.KeepAspectRatio)
33
+
34
+ qt.splash = QSplashScreen(scaled_image)
35
+ qt.splash.show()
36
+ qt.splash.setStyleSheet("font-size: 15px; font-weight: bold;")
37
+
38
+ qt.splash.showMessage("<h1><font color='white'>Importing modules...</font></h1>",
39
+ Qt.AlignBottom | Qt.AlignLeft, QColor("white"))
40
+
41
+ win = qt.XMARTeTool(app)
42
+ win.show()
43
+ app.exec_()
@@ -0,0 +1,31 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ A module containing NodeEditor's class for representing Edge and Edge Type Constants.
4
+ """
5
+ from nodeeditor.node_edge import Edge
6
+
7
+ from xmarte.nodeeditor.node_graphics_edge import XMARTeQDMGraphicsEdge
8
+
9
+ class XMARTeEdge(Edge):
10
+
11
+ def createEdgeClassInstance(self):
12
+ """
13
+ Create instance of grEdge class
14
+ :return: Instance of `grEdge` class representing the Graphics Edge in the grScene
15
+ """
16
+ self.grEdge = self.getGraphicsEdgeClass()(self)
17
+ self.scene.grScene.addItem(self.grEdge)
18
+ if self.start_socket is not None:
19
+ self.updatePositions()
20
+ return self.grEdge
21
+
22
+ def getGraphicsEdgeClass(self):
23
+ """Returns the class representing Graphics Edge"""
24
+ return XMARTeQDMGraphicsEdge
25
+
26
+ def deserialize(self, data:dict, hashmap:dict={}, restore_id:bool=True, *args, **kwargs) -> bool:
27
+ if restore_id: self.id = data['id']
28
+ if data['start'] is not None:
29
+ self.start_socket = hashmap[data['start']]
30
+ self.end_socket = hashmap[data['end']]
31
+ self.edge_type = data['edge_type']
@@ -0,0 +1,79 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ A module containing the Edge Dragging functionality
4
+ """
5
+ from nodeeditor.node_graphics_socket import QDMGraphicsSocket
6
+ from nodeeditor.node_edge_dragging import EdgeDragging
7
+ from nodeeditor.utils import dumpException
8
+
9
+ from nodeeditor.node_edge import EDGE_TYPE_DEFAULT
10
+
11
+ DEBUG = False
12
+
13
+ class XMARTeEdgeDragging(EdgeDragging):
14
+ def edgeDragEnd(self, item:'QGraphicsItem'):
15
+ """Code handling the end of the dragging an `Edge` operation. If this code returns True then skip the
16
+ rest of the mouse event processing. Can be called with ``None`` to cancel the edge dragging mode
17
+
18
+ :param item: Item in the `Graphics Scene` where we ended dragging an `Edge`
19
+ :type item: ``QGraphicsItem``
20
+ """
21
+
22
+ # early out - clicked on something else than Socket
23
+ if not isinstance(item, QDMGraphicsSocket):
24
+ self.grView.resetMode()
25
+ if DEBUG: print('View::edgeDragEnd ~ End dragging edge early')
26
+ self.drag_edge.remove(silent=True) # don't notify sockets about removing drag_edge
27
+ self.drag_edge = None
28
+
29
+
30
+ # clicked on socket
31
+ if isinstance(item, QDMGraphicsSocket):
32
+
33
+ # check if edge would be valid
34
+ if not self.drag_edge.validateEdge(self.drag_start_socket, item.socket):
35
+ print("NOT VALID EDGE")
36
+ return False
37
+
38
+ # regular processing of drag edge
39
+ self.grView.resetMode()
40
+
41
+ if DEBUG: print('View::edgeDragEnd ~ End dragging edge')
42
+ self.drag_edge.remove(silent=True) # don't notify sockets about removing drag_edge
43
+ self.drag_edge = None
44
+
45
+ try:
46
+ if item.socket != self.drag_start_socket:
47
+ # if we released dragging on a socket (other then the beginning socket)
48
+
49
+ ## First remove old edges / send notifications
50
+ for socket in (item.socket, self.drag_start_socket):
51
+ if not socket.is_multi_edges:
52
+ if socket.is_input:
53
+ # print("removing SILENTLY edges from input socket (is_input and !is_multi_edges) [DragStart]:", item.socket.edges)
54
+ socket.removeAllEdges(silent=True)
55
+ else:
56
+ socket.removeAllEdges(silent=False)
57
+
58
+
59
+ ## Create new Edge
60
+ # Handle backwards setup
61
+ if item.socket.is_input:
62
+ new_edge = self.getEdgeClass()(item.socket.node.scene, self.drag_start_socket, item.socket, edge_type=EDGE_TYPE_DEFAULT)
63
+ if self.drag_start_socket.is_input:
64
+ new_edge = self.getEdgeClass()(item.socket.node.scene, item.socket, self.drag_start_socket, edge_type=EDGE_TYPE_DEFAULT)
65
+ if DEBUG: print("View::edgeDragEnd ~ created new edge:", new_edge, "connecting", new_edge.start_socket, "<-->", new_edge.end_socket)
66
+
67
+ ## Send notifications for the new edge
68
+ for socket in [self.drag_start_socket, item.socket]:
69
+ # @TODO: Add possibility (ie when an input edge was replaced) to be silent and don't trigger change
70
+ socket.node.onEdgeConnectionChanged(new_edge)
71
+ if socket.is_input: socket.node.onInputChanged(socket)
72
+
73
+ self.grView.grScene.scene.history.storeHistory("Created new edge by dragging", setModified=True)
74
+ return True
75
+ except Exception as e: dumpException(e)
76
+
77
+
78
+ if DEBUG: print('View::edgeDragEnd ~ everything done.')
79
+ return False
@@ -0,0 +1,32 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ A module containing the Edge Validator functions which can be registered as callbacks to
4
+ :class:`~nodeeditor.node_edge.Edge` class.
5
+
6
+ Example of registering Edge Validator callbacks:
7
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8
+
9
+ You can register validation callbacks once for example on the bottom of node_edge.py file or on the
10
+ application start with calling this:
11
+
12
+ .. code-block:: python
13
+
14
+ from nodeeditor.node_edge_validators import *
15
+
16
+ Edge.registerEdgeValidator(edge_validator_debug)
17
+ Edge.registerEdgeValidator(edge_cannot_connect_two_outputs_or_two_inputs)
18
+ Edge.registerEdgeValidator(edge_cannot_connect_input_and_output_of_same_node)
19
+ Edge.registerEdgeValidator(edge_cannot_connect_input_and_output_of_different_type)
20
+
21
+
22
+ """
23
+ from nodeeditor.node_edge_validators import print_error
24
+
25
+ DEBUG = False
26
+
27
+ def edge_start_socket_must_exist(input: 'Socket', output: 'Socket') -> bool:
28
+ """Edge is invalid if the node it started from was deleted whilst dragging"""
29
+ if input.node.grNode is None or output.node.grNode is None:
30
+ print_error("A connecting node has been deleted")
31
+ return False
32
+ return True
@@ -0,0 +1,35 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ A module containing ``NodeEditorWidget`` class
4
+ """
5
+ from nodeeditor.node_editor_widget import NodeEditorWidget
6
+ from nodeeditor.utils import dumpException
7
+ from nodeeditor.node_scene import InvalidFile
8
+ from qtpy.QtCore import Qt
9
+ from qtpy.QtWidgets import QMessageBox, QApplication
10
+
11
+ class XMARTeNodeEditorWidget(NodeEditorWidget):
12
+ def fileLoad(self, filename:str, *args, **kwargs):
13
+ """Load serialized graph from JSON file
14
+
15
+ :param filename: file to load
16
+ :type filename: ``str``
17
+ """
18
+ QApplication.setOverrideCursor(Qt.WaitCursor)
19
+ try:
20
+ self.scene.loadFromFile(filename, *args, **kwargs)
21
+ self.filename = filename
22
+ self.scene.history.clear()
23
+ self.scene.history.storeInitialHistoryStamp()
24
+ return True
25
+ except FileNotFoundError as e:
26
+ dumpException(e)
27
+ QMessageBox.warning(self, "Error loading %s" % os.path.basename(filename), str(e).replace('[Errno 2]',''))
28
+ return False
29
+ except InvalidFile as e:
30
+ dumpException(e)
31
+ # QApplication.restoreOverrideCursor()
32
+ QMessageBox.warning(self, "Error loading %s" % os.path.basename(filename), str(e))
33
+ return False
34
+ finally:
35
+ QApplication.restoreOverrideCursor()