mg-pso-gui 0.1.238__py3-none-any.whl → 0.1.240__py3-none-any.whl
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.
- {mg_pso_gui-0.1.238.dist-info → mg_pso_gui-0.1.240.dist-info}/METADATA +1 -1
- {mg_pso_gui-0.1.238.dist-info → mg_pso_gui-0.1.240.dist-info}/RECORD +14 -12
- mgpsogui/gui/HomePage.py +4 -4
- mgpsogui/gui/OptionManager.py +48 -4
- mgpsogui/gui/PlatformTab/PlatformTab.py +13 -4
- mgpsogui/gui/PlatformTab/ServiceParametersView.py +61 -0
- mgpsogui/gui/SetupTab/BoundsList.py +2 -2
- mgpsogui/gui/SetupTab/OverrideParameterMetrics.py +77 -0
- mgpsogui/gui/SetupTab/OverrideParameterWindow.py +42 -0
- mgpsogui/gui/SetupTab/SetupTab.py +11 -11
- mgpsogui/gui/SetupTab/StepView.py +9 -5
- mgpsogui/gui/images/IGOW 4 Logo.png +0 -0
- {mg_pso_gui-0.1.238.dist-info → mg_pso_gui-0.1.240.dist-info}/WHEEL +0 -0
- {mg_pso_gui-0.1.238.dist-info → mg_pso_gui-0.1.240.dist-info}/entry_points.txt +0 -0
- {mg_pso_gui-0.1.238.dist-info → mg_pso_gui-0.1.240.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,16 @@
|
|
1
1
|
mgpsogui/__init__.py,sha256=q7AfBjeJABnFtbsZnsObpUwaXKPDVYtz46G6MKXLF74,42
|
2
2
|
mgpsogui/mgpsogui.py,sha256=NIZmyNcbwC8EgSwf1ubdMUSJscrIEgoD4jLYziqHQ-k,148
|
3
3
|
mgpsogui/start.yaml,sha256=ZjCVLb-MLqAxrGRm9kA7_SDpa-45EuKIELNQ2QqCAiU,4713
|
4
|
-
mgpsogui/gui/HomePage.py,sha256=
|
5
|
-
mgpsogui/gui/OptionManager.py,sha256=
|
4
|
+
mgpsogui/gui/HomePage.py,sha256=6Tt1dnSsuYk888Da0RLbJpxEgtgxk-dg72Qphi85Cns,23231
|
5
|
+
mgpsogui/gui/OptionManager.py,sha256=vLVwIvKMt08-Yr3BNYsWFxfrZcuiay_yZv6_o8_Qmmg,18111
|
6
6
|
mgpsogui/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
mgpsogui/gui/PlatformTab/PlatformTab.py,sha256
|
7
|
+
mgpsogui/gui/PlatformTab/PlatformTab.py,sha256=-YdSvNFr-ybTuvsB9WNTEy0rRmDuCTiVf9jBHu_8CNk,10939
|
8
|
+
mgpsogui/gui/PlatformTab/ServiceParametersView.py,sha256=jzv-kPNVo-aAflpi-xPz1yltv2P87wR0iOUf6b_fwMg,2760
|
8
9
|
mgpsogui/gui/PlatformTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
10
|
mgpsogui/gui/RunTab/RunTab.py,sha256=8FT7mdxNRQrftDuU0v4LoK1eyH8_RHwLOyM4dz8O_4A,1850
|
10
11
|
mgpsogui/gui/RunTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
12
|
mgpsogui/gui/SetupTab/BoundsEditorWindow.py,sha256=U64oaiDIOaimjbqKMz5rQNq2o1SrQtrRHDdTYQ9ux1s,2870
|
12
|
-
mgpsogui/gui/SetupTab/BoundsList.py,sha256=
|
13
|
+
mgpsogui/gui/SetupTab/BoundsList.py,sha256=yen8lUc5iVzUyNwRg1qAENJz-gzN9-UhTHx3jyc946c,12260
|
13
14
|
mgpsogui/gui/SetupTab/CalibrationParametersView.py,sha256=ppVBHG3nphku9-P6Z8az-HTpgk8vHxnj-A5m80BZTgA,2784
|
14
15
|
mgpsogui/gui/SetupTab/CustomFunctionEditorWindow.py,sha256=yx0dHSNa7fGy99Q6qFcI6j9r8p0DlV3iOBgyPMGd8pM,2884
|
15
16
|
mgpsogui/gui/SetupTab/CustomFunctionMetrics.py,sha256=hAVZSJMgHEQYrFsgUUnil17pWMFDA26Scio5DAlfdzE,5899
|
@@ -17,15 +18,16 @@ mgpsogui/gui/SetupTab/FunctionsList.py,sha256=cMBv87GeRACiJ1DPxFrPvZJOZ3fK6FUVAe
|
|
17
18
|
mgpsogui/gui/SetupTab/ListEditor.py,sha256=vlP0KDPu8J1_6KXuUTlE7OClgfF0Qk6cISsFm_SglUw,3232
|
18
19
|
mgpsogui/gui/SetupTab/ListParametersView.py,sha256=wYcDcaooYkw-y7XW6dJUwhTWxLuUUOK5tGUFVHBf3ck,7352
|
19
20
|
mgpsogui/gui/SetupTab/OptimalParameterView.py,sha256=H92S6ioJI2iTjFBspEzyDxluagCEgfFSW5AkqQFO-l8,1738
|
20
|
-
mgpsogui/gui/SetupTab/
|
21
|
+
mgpsogui/gui/SetupTab/OverrideParameterMetrics.py,sha256=Wf8zTLTm2XnKKp7O0l60HOle0cJK5YEiR98DtJyfhIo,3078
|
22
|
+
mgpsogui/gui/SetupTab/OverrideParameterWindow.py,sha256=qt3bHKBu-YYedvxx_BfQqZBiFvkSM85n_J1Qke-bq4w,1374
|
23
|
+
mgpsogui/gui/SetupTab/SetupTab.py,sha256=hbEUU1QYjEyLsLEOFTMLLiTK_7X6NFsXhmdYwnx2q5g,2812
|
21
24
|
mgpsogui/gui/SetupTab/StaticParameterView.py,sha256=iEG-UpBBlAJabZo3MG768oLqOROjUPc23tKOSd47IUc,2739
|
22
|
-
mgpsogui/gui/SetupTab/StepView.py,sha256=
|
25
|
+
mgpsogui/gui/SetupTab/StepView.py,sha256=wBWKOjGoc_CRqBjC_bXN2aq7gMg-tY0a-W5vldQWYmA,9049
|
23
26
|
mgpsogui/gui/SetupTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
27
|
mgpsogui/gui/VisualizeTab/MatrixEditor.py,sha256=JPQmfljdddIwHtTKpFqUdk7hRzVdX-IKl4neOk3DsjM,3132
|
25
28
|
mgpsogui/gui/VisualizeTab/SideBar.py,sha256=MtZfDScNFN0fQ8DyPm6bZGJSrFRgT14fZeUq-qc61O8,21936
|
26
29
|
mgpsogui/gui/VisualizeTab/VisualizeTab.py,sha256=JCm4qOe_l2vVTabBjGUHAK6fl21UQ4RhRLll_PIUFWI,6832
|
27
30
|
mgpsogui/gui/VisualizeTab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
28
|
-
mgpsogui/gui/images/IGOW 4 Logo.png,sha256=JixNXz5gOEj898VF-_PHthAlGU-6W-y9ucb4EVNPtjs,433752
|
29
31
|
mgpsogui/gui/images/collapse.png,sha256=yicb16LaY7Nl5q9V8HHlht-Fbg5xU-l4_LJ_Arfmu1c,2989
|
30
32
|
mgpsogui/gui/images/down.png,sha256=pspJkvUitD648C_2y8JLLD4Eagpk4MDEKQJGOO_yIaY,2654
|
31
33
|
mgpsogui/gui/images/expand.png,sha256=YQyxXipCiNiZpTok5Y4juNU5davxoK7MTlRQI4Id27w,2922
|
@@ -62,8 +64,8 @@ mgpsogui/util/recosu/utils/trace_writer.py,sha256=V9BJlOjCbNYGoXGEk3CF5wjifBxvar
|
|
62
64
|
mgpsogui/util/recosu/utils/utils.py,sha256=QB8vftq3142ekG0ORjz0ZBHU5YknXbR0oTsrxrPAsF0,3951
|
63
65
|
mgpsogui/util/recosu/utils/plot/__init__.py,sha256=h1KjM7_tNDv351pcwt8A6Ibb1jhwWyx5Gbu-zj-sI3Q,71
|
64
66
|
mgpsogui/util/recosu/utils/plot/cost_steps.py,sha256=1Ce11AJyweWkmvjXPxEygzS-h8yVLmQEDLS53yjPLqQ,3779
|
65
|
-
mg_pso_gui-0.1.
|
66
|
-
mg_pso_gui-0.1.
|
67
|
-
mg_pso_gui-0.1.
|
68
|
-
mg_pso_gui-0.1.
|
69
|
-
mg_pso_gui-0.1.
|
67
|
+
mg_pso_gui-0.1.240.dist-info/METADATA,sha256=F7xHFn6Tbj4ryic8_F6Wk_Ig0bElTIYNCniQM-M26gk,9456
|
68
|
+
mg_pso_gui-0.1.240.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
69
|
+
mg_pso_gui-0.1.240.dist-info/entry_points.txt,sha256=jg82VOFjR1XDGrchs1wJSCqKYE4Ozv12aBcCSp--koA,117
|
70
|
+
mg_pso_gui-0.1.240.dist-info/top_level.txt,sha256=y7JuS9xJN5YdxUsQ3PSVjN8MzQAnR146bP3ZN3PYWdE,9
|
71
|
+
mg_pso_gui-0.1.240.dist-info/RECORD,,
|
mgpsogui/gui/HomePage.py
CHANGED
@@ -262,8 +262,8 @@ class App(customtkinter.CTk):
|
|
262
262
|
|
263
263
|
self.steps_frame.clear()
|
264
264
|
self.steps_frame.render()
|
265
|
-
self.optimal_param_frame.clear()
|
266
|
-
self.optimal_param_frame.render()
|
265
|
+
#self.optimal_param_frame.clear()
|
266
|
+
#self.optimal_param_frame.render()
|
267
267
|
|
268
268
|
def open_new_window(self):
|
269
269
|
# Shell out and run ./main.py
|
@@ -313,8 +313,8 @@ class App(customtkinter.CTk):
|
|
313
313
|
self.calib_param_frame.clear()
|
314
314
|
self.calib_param_frame.render()
|
315
315
|
|
316
|
-
self.optimal_param_frame.clear()
|
317
|
-
self.optimal_param_frame.render()
|
316
|
+
#self.optimal_param_frame.clear()
|
317
|
+
#self.optimal_param_frame.render()
|
318
318
|
|
319
319
|
self.load_button.configure(text="Loaded!")
|
320
320
|
self.after(3000, lambda: self.load_button.configure(text="Load"))
|
mgpsogui/gui/OptionManager.py
CHANGED
@@ -15,6 +15,7 @@ class OptionManager():
|
|
15
15
|
"mode": sv(),
|
16
16
|
"files": {},
|
17
17
|
"calibration_parameters": [],
|
18
|
+
"service_parameters": [],
|
18
19
|
"figure_parameters": [],
|
19
20
|
"sensitivity_parameters": [],
|
20
21
|
"sensitivity_positiveBestMetrics": [],
|
@@ -35,6 +36,7 @@ class OptionManager():
|
|
35
36
|
self.arguments['mode'].set("Optimization")
|
36
37
|
self.arguments['files'] = {}
|
37
38
|
self.arguments['calibration_parameters'].clear()
|
39
|
+
self.arguments['service_parameters'].clear()
|
38
40
|
self.arguments['figure_parameters'].clear()
|
39
41
|
self.arguments['sensitivity_parameters'].clear()
|
40
42
|
self.arguments['sensitivity_positiveBestMetrics'].clear()
|
@@ -74,12 +76,23 @@ class OptionManager():
|
|
74
76
|
obj["name"].set(name)
|
75
77
|
obj["value"].set(value)
|
76
78
|
self.arguments["calibration_parameters"].append(obj)
|
79
|
+
|
80
|
+
for param in arguments["service_parameters"]:
|
81
|
+
name = param["name"]
|
82
|
+
value = param["value"]
|
83
|
+
obj = {"name": sv(), "value": sv()}
|
84
|
+
obj["name"].set(name)
|
85
|
+
obj["value"].set(value)
|
86
|
+
self.arguments["service_parameters"].append(obj)
|
77
87
|
|
78
88
|
def add_steps(self, steps):
|
79
89
|
for step in steps:
|
80
|
-
obj = {"param": [],
|
90
|
+
obj = {"param": [],
|
91
|
+
"overrideparam": [],
|
92
|
+
"objfunc": [],
|
93
|
+
"name": sv(),
|
94
|
+
"open": False}
|
81
95
|
obj["name"].set("Group " + str(len(self.steps) + 1))
|
82
|
-
obj["message"].set("Wow")
|
83
96
|
|
84
97
|
for param in step["param"]:
|
85
98
|
param_obj = {
|
@@ -120,6 +133,12 @@ class OptionManager():
|
|
120
133
|
|
121
134
|
obj["param"].append(param_obj)
|
122
135
|
|
136
|
+
for override in step["overrideparam"]:
|
137
|
+
override_obj = {"name": sv(), "value": sv()}
|
138
|
+
override_obj['name'].set(override['name'])
|
139
|
+
override_obj['value'].set(override['value'])
|
140
|
+
obj['overrideparam'].append(override_obj)
|
141
|
+
|
123
142
|
for objfunc in step["objfunc"]:
|
124
143
|
objfunc_obj = {"name": sv(),
|
125
144
|
"of": sv(),
|
@@ -221,6 +240,18 @@ class OptionManager():
|
|
221
240
|
def remove_bound(self, step_index, index):
|
222
241
|
self.steps[step_index]["param"].pop(index)
|
223
242
|
|
243
|
+
def add_override(self, step_index, name, value):
|
244
|
+
obj = {"name": sv(), "value": sv()}
|
245
|
+
obj["name"].set(name)
|
246
|
+
obj["value"].set(value)
|
247
|
+
self.steps[step_index]["overrideparam"].append(obj)
|
248
|
+
|
249
|
+
def remove_override(self, step_index, index):
|
250
|
+
self.steps[step_index]["overrideparam"].pop(index)
|
251
|
+
|
252
|
+
def get_override(self, step_index):
|
253
|
+
return self.steps[step_index]["overrideparam"]
|
254
|
+
|
224
255
|
def add_argument(self, key, value):
|
225
256
|
obj = {"name": sv(), "value": sv()}
|
226
257
|
obj["name"].set(key)
|
@@ -233,6 +264,12 @@ class OptionManager():
|
|
233
264
|
obj["value"].set(value)
|
234
265
|
self.arguments["calibration_parameters"].append(obj)
|
235
266
|
|
267
|
+
def add_service_param(self, key, value):
|
268
|
+
obj = {"name": sv(), "value": sv()}
|
269
|
+
obj["name"].set(key)
|
270
|
+
obj["value"].set(value)
|
271
|
+
self.arguments["service_parameters"].append(obj)
|
272
|
+
|
236
273
|
def add_figure_param(self, key, value):
|
237
274
|
obj = {"name": sv(), "value": sv()}
|
238
275
|
obj["name"].set(key)
|
@@ -282,6 +319,9 @@ class OptionManager():
|
|
282
319
|
def remove_calibration_parameter(self, index):
|
283
320
|
self.arguments["calibration_parameters"].pop(index)
|
284
321
|
|
322
|
+
def remove_service_parameter(self, index):
|
323
|
+
self.arguments["service_parameters"].pop(index)
|
324
|
+
|
285
325
|
def remove_figure_parameter(self, index):
|
286
326
|
self.arguments["figure_parameters"].pop(index)
|
287
327
|
|
@@ -311,8 +351,7 @@ class OptionManager():
|
|
311
351
|
|
312
352
|
def get_steps(self):
|
313
353
|
return self.steps
|
314
|
-
|
315
|
-
|
354
|
+
|
316
355
|
def get_all_as_json(self):
|
317
356
|
obj = {"arguments": self.arguments, "steps": self.steps}
|
318
357
|
return obj
|
@@ -330,6 +369,7 @@ class OptionManager():
|
|
330
369
|
result = {}
|
331
370
|
result['arguments'] = {}
|
332
371
|
result['calibration_parameters'] = []
|
372
|
+
result['service_parameters'] = []
|
333
373
|
result['service_parameters'] = {}
|
334
374
|
result['project_data'] = self.project_data
|
335
375
|
for key, value in self.arguments.items():
|
@@ -347,6 +387,10 @@ class OptionManager():
|
|
347
387
|
#result['calibration_parameters'][key] = []
|
348
388
|
for obj in value:
|
349
389
|
result['calibration_parameters'].append({'name': obj['name'].get(), 'value': obj['value'].get()})
|
390
|
+
elif key == "service_parameters":
|
391
|
+
#result['service_parameters'][key] = []
|
392
|
+
for obj in value:
|
393
|
+
result['service_parameters'].append({'name': obj['name'].get(), 'value': obj['value'].get()})
|
350
394
|
result['steps'] = []
|
351
395
|
for step in self.steps:
|
352
396
|
step_result = {}
|
@@ -5,6 +5,8 @@ import subprocess
|
|
5
5
|
import customtkinter
|
6
6
|
import platform
|
7
7
|
|
8
|
+
from . import ServiceParametersView as spv
|
9
|
+
|
8
10
|
import tkinter as tk
|
9
11
|
|
10
12
|
def create_tab(self, tab):
|
@@ -114,6 +116,7 @@ def create_tab(self, tab):
|
|
114
116
|
|
115
117
|
tab.grid_columnconfigure(0, weight=1)
|
116
118
|
tab.grid_columnconfigure(1, weight=1)
|
119
|
+
tab.grid_columnconfigure(2, weight=1)
|
117
120
|
tab.grid_rowconfigure(0, weight=1)
|
118
121
|
|
119
122
|
"""
|
@@ -131,9 +134,15 @@ def create_tab(self, tab):
|
|
131
134
|
self.load_parameters.grid(row=0, column=2, padx=(20, 20), pady=(20, 20), sticky="nsew")
|
132
135
|
|
133
136
|
"""
|
137
|
+
|
138
|
+
self.service_param_frame = spv.ServiceParametersView(tab, option_manager=self.option_manager, label_text="Service Parameters")
|
139
|
+
self.service_param_frame.grid(row=0, column=0, padx=(20, 20), pady=(20, 20), sticky="nsew")
|
140
|
+
self.service_param_frame.grid_columnconfigure(0, weight=1)
|
141
|
+
self.service_param_frame.grid_rowconfigure(0, weight=1)
|
142
|
+
|
134
143
|
|
135
|
-
self.service_editor = customtkinter.CTkScrollableFrame(tab, label_text="Service
|
136
|
-
self.service_editor.grid(row=0, column=
|
144
|
+
self.service_editor = customtkinter.CTkScrollableFrame(tab, label_text="Service Status")
|
145
|
+
self.service_editor.grid(row=0, column=1, padx=(20, 20), pady=(20, 20), sticky="nsew")
|
137
146
|
self.service_editor.grid_columnconfigure(0, weight=1)
|
138
147
|
self.service_editor.grid_rowconfigure(0, weight=1)
|
139
148
|
|
@@ -161,8 +170,8 @@ def create_tab(self, tab):
|
|
161
170
|
self.service_details = customtkinter.CTkTextbox(self.service_editor, height=480)
|
162
171
|
self.service_details.grid(row=8, column=0, padx=(20, 20), pady=(5, 5), sticky="ew")
|
163
172
|
|
164
|
-
self.environment_editor = customtkinter.CTkScrollableFrame(tab, label_text="Environment Editor")
|
165
|
-
self.environment_editor.grid(row=0, column=
|
173
|
+
self.environment_editor = customtkinter.CTkScrollableFrame(tab, label_text="Minikube Environment Editor")
|
174
|
+
self.environment_editor.grid(row=0, column=2, padx=(20, 20), pady=(20, 20), sticky="nsew")
|
166
175
|
self.environment_editor.grid_columnconfigure(0, weight=1)
|
167
176
|
self.environment_editor.grid_rowconfigure(0, weight=1)
|
168
177
|
|
@@ -0,0 +1,61 @@
|
|
1
|
+
from customtkinter import CTkScrollableFrame
|
2
|
+
from customtkinter import CTkFrame
|
3
|
+
from customtkinter import CTkLabel
|
4
|
+
from customtkinter import CTkButton
|
5
|
+
from customtkinter import CTkEntry
|
6
|
+
import tkinter as tk
|
7
|
+
|
8
|
+
global option_manager
|
9
|
+
|
10
|
+
class ServiceParametersView(CTkScrollableFrame):
|
11
|
+
def __init__(self, *args,
|
12
|
+
option_manager: None,
|
13
|
+
**kwargs):
|
14
|
+
super().__init__(*args, **kwargs)
|
15
|
+
|
16
|
+
self.option_manager = option_manager
|
17
|
+
self.key_values = option_manager.get_arguments()['service_parameters']
|
18
|
+
self.edit_mode = False
|
19
|
+
|
20
|
+
self.render()
|
21
|
+
|
22
|
+
def clear(self):
|
23
|
+
self.containerFrame.destroy()
|
24
|
+
|
25
|
+
def toggle_edit_mode(self):
|
26
|
+
self.clear()
|
27
|
+
self.edit_mode = not self.edit_mode
|
28
|
+
self.render()
|
29
|
+
|
30
|
+
def render(self):
|
31
|
+
row = 0
|
32
|
+
index = 0
|
33
|
+
|
34
|
+
self.containerFrame = CTkFrame(self)
|
35
|
+
self.containerFrame.grid(row=0, column=0, padx=(5, 5), pady=(5, 5), sticky="nsew")
|
36
|
+
self.containerFrame.grid_columnconfigure((0, 1), weight=1)
|
37
|
+
|
38
|
+
CTkLabel(self.containerFrame, text="Name:").grid(row=row, column=0, columnspan=1, padx=5, pady=5, sticky="")
|
39
|
+
CTkLabel(self.containerFrame, text="Value:").grid(row=row, column=1, columnspan=1, padx=5, pady=5, sticky="")
|
40
|
+
row += 1
|
41
|
+
|
42
|
+
for key_value_pair in self.key_values:
|
43
|
+
CTkEntry(self.containerFrame, textvariable=self.key_values[index]["name"]).grid(row=row, column=0, padx=(5, 5), pady=(5, 5), sticky="ew")
|
44
|
+
|
45
|
+
if self.edit_mode:
|
46
|
+
return_func = lambda index=index: (self.clear(), self.option_manager.remove_service_parameter(index), self.render())
|
47
|
+
CTkButton(self.containerFrame, text="Remove", command=return_func).grid(row=row, column=1, padx=(5, 5), pady=(5, 5), sticky="ew")
|
48
|
+
else:
|
49
|
+
bb = CTkEntry(self.containerFrame)
|
50
|
+
bb.grid(row=row, column=1, padx=(5, 5), pady=(5, 5), sticky="ew")
|
51
|
+
bb.configure(textvariable=self.key_values[index]["value"])
|
52
|
+
row += 1
|
53
|
+
index += 1
|
54
|
+
|
55
|
+
if self.edit_mode:
|
56
|
+
CTkButton(self.containerFrame, text="Exit", command=self.toggle_edit_mode).grid(row=row, column=0, padx=(5, 5), pady=(5, 5), sticky="ew")
|
57
|
+
else:
|
58
|
+
CTkButton(self.containerFrame, text="Edit", command=self.toggle_edit_mode).grid(row=row, column=0, padx=(5, 5), pady=(5, 5), sticky="ew")
|
59
|
+
|
60
|
+
add_key_func = lambda: (self.clear(), self.option_manager.add_service_param("name", "value"), self.render())
|
61
|
+
CTkButton(self.containerFrame, text="Add Parameter", command=add_key_func).grid(row=row, column=1, padx=(5, 5), pady=(5, 5), sticky="ew")
|
@@ -132,8 +132,8 @@ class BoundsList(CTkFrame):
|
|
132
132
|
|
133
133
|
if (bound_type == "list"):
|
134
134
|
def button_click_event(bound_index):
|
135
|
-
|
136
|
-
print("Number:", dialog.get_input())
|
135
|
+
BEW(title="Edit List Bound", step_index=self.step_index, bound_index=bound_index, option_manager=self.option_manager)
|
136
|
+
#print("Number:", dialog.get_input())
|
137
137
|
|
138
138
|
open_window = lambda event=None, bound_index=index: (button_click_event(bound_index))
|
139
139
|
expand_image = CTkImage(Image.open(os.path.join("./images", "expand.png")), size=(20, 20))
|
@@ -0,0 +1,77 @@
|
|
1
|
+
from customtkinter import CTkScrollableFrame
|
2
|
+
from customtkinter import CTkFrame
|
3
|
+
from customtkinter import CTkLabel
|
4
|
+
from customtkinter import CTkButton
|
5
|
+
from customtkinter import CTkEntry
|
6
|
+
from customtkinter import CTkOptionMenu
|
7
|
+
import tkinter as tk
|
8
|
+
import subprocess
|
9
|
+
import platform
|
10
|
+
import os
|
11
|
+
|
12
|
+
global option_manager
|
13
|
+
|
14
|
+
class OverrideParameterMetrics(CTkScrollableFrame):
|
15
|
+
def __init__(self, *args,
|
16
|
+
option_manager: None,
|
17
|
+
step_index: 0,
|
18
|
+
**kwargs):
|
19
|
+
super().__init__(*args, **kwargs)
|
20
|
+
|
21
|
+
self.option_manager = option_manager
|
22
|
+
self.step_index = step_index
|
23
|
+
self.key_values = option_manager.get_override(step_index)
|
24
|
+
|
25
|
+
self.edit_mode = False
|
26
|
+
|
27
|
+
self.render()
|
28
|
+
|
29
|
+
def clear(self):
|
30
|
+
self.containerFrame.destroy()
|
31
|
+
|
32
|
+
def toggle_edit_mode(self):
|
33
|
+
self.clear()
|
34
|
+
self.edit_mode = not self.edit_mode
|
35
|
+
self.render()
|
36
|
+
|
37
|
+
def add_key(self, key="", value=""):
|
38
|
+
self.option_manager.add_override(self.step_index, key, value)
|
39
|
+
|
40
|
+
def remove_key(self, index):
|
41
|
+
self.option_manager.remove_override(self.step_index, index)
|
42
|
+
|
43
|
+
def render(self):
|
44
|
+
row = 0
|
45
|
+
index = 0
|
46
|
+
|
47
|
+
self.containerFrame = CTkFrame(self)
|
48
|
+
self.containerFrame.grid(row=0, column=0, padx=(5, 5), pady=(5, 5), sticky="nsew")
|
49
|
+
self.containerFrame.grid_columnconfigure((0, 1), weight=1)
|
50
|
+
|
51
|
+
CTkLabel(self.containerFrame, text="Name:").grid(row=row, column=0, columnspan=1, padx=5, pady=5, sticky="")
|
52
|
+
CTkLabel(self.containerFrame, text="Value:").grid(row=row, column=1, columnspan=1, padx=5, pady=5, sticky="")
|
53
|
+
row += 1
|
54
|
+
|
55
|
+
for key_value_pair in self.key_values:
|
56
|
+
CTkEntry(self.containerFrame, textvariable=self.key_values[index]["name"]).grid(row=row, column=0, padx=(5, 5), pady=(5, 5), sticky="ew")
|
57
|
+
|
58
|
+
|
59
|
+
if self.edit_mode:
|
60
|
+
return_func = lambda index=index: (self.clear(), self.remove_key(index), self.render())
|
61
|
+
CTkButton(self.containerFrame, text="Remove", command=return_func).grid(row=row, column=1, padx=(5, 5), pady=(5, 5), sticky="ew")
|
62
|
+
else:
|
63
|
+
bb = CTkEntry(self.containerFrame)
|
64
|
+
bb.grid(row=row, column=1, padx=(5, 5), pady=(5, 5), sticky="ew")
|
65
|
+
bb.configure(textvariable=self.key_values[index]["value"])
|
66
|
+
row += 1
|
67
|
+
index += 1
|
68
|
+
|
69
|
+
if self.edit_mode:
|
70
|
+
CTkButton(self.containerFrame, text="Exit", command=self.toggle_edit_mode).grid(row=row, column=0, padx=(5, 5), pady=(5, 5), sticky="ew")
|
71
|
+
else:
|
72
|
+
CTkButton(self.containerFrame, text="Edit", command=self.toggle_edit_mode).grid(row=row, column=0, padx=(5, 5), pady=(5, 5), sticky="ew")
|
73
|
+
|
74
|
+
add_key_func = lambda: (self.clear(), self.add_key(), self.render())
|
75
|
+
CTkButton(self.containerFrame, text="Add", command=add_key_func).grid(row=row, column=1, padx=(5, 5), pady=(5, 5), sticky="ew")
|
76
|
+
|
77
|
+
row += 1
|
@@ -0,0 +1,42 @@
|
|
1
|
+
from typing import Union, Tuple, Optional
|
2
|
+
|
3
|
+
from customtkinter import CTkLabel
|
4
|
+
from customtkinter import CTkButton
|
5
|
+
from customtkinter import CTkEntry
|
6
|
+
from customtkinter import CTkInputDialog
|
7
|
+
from .OverrideParameterMetrics import OverrideParameterMetrics as ListView
|
8
|
+
|
9
|
+
class OverrideParameterWindow(CTkInputDialog):
|
10
|
+
"""
|
11
|
+
Dialog with extra window, message, entry widget, cancel and ok button.
|
12
|
+
For detailed information check out the documentation.
|
13
|
+
"""
|
14
|
+
|
15
|
+
def __init__(self, *args,
|
16
|
+
step_index: 0,
|
17
|
+
function_index: 0,
|
18
|
+
option_manager: None,
|
19
|
+
**kwargs):
|
20
|
+
super().__init__(*args, **kwargs)
|
21
|
+
|
22
|
+
self.geometry("400x800")
|
23
|
+
|
24
|
+
self.step_index = step_index
|
25
|
+
self.function_index = function_index
|
26
|
+
self.option_manager = option_manager
|
27
|
+
self.bounds = None
|
28
|
+
|
29
|
+
def _create_widgets(self):
|
30
|
+
|
31
|
+
self.grid_columnconfigure((0, 1), weight=1)
|
32
|
+
self.rowconfigure(0, weight=1)
|
33
|
+
|
34
|
+
self.bounds = ListView(
|
35
|
+
self, step_index=self.step_index, option_manager=self.option_manager)
|
36
|
+
self.bounds.grid(row=0, column=0, columnspan=2, padx=(10, 10),
|
37
|
+
pady=(10, 10), sticky="nsew")
|
38
|
+
self.bounds.grid_columnconfigure(0, weight=1)
|
39
|
+
|
40
|
+
def _on_closing(self):
|
41
|
+
self.grab_release()
|
42
|
+
self.destroy()
|
@@ -12,8 +12,8 @@ def setup_refresh(self):
|
|
12
12
|
self.static_param_frame.destroy()
|
13
13
|
self.calib_param_frame.clear()
|
14
14
|
self.calib_param_frame.destroy()
|
15
|
-
self.optimal_param_frame.clear()
|
16
|
-
self.optimal_param_frame.destroy()
|
15
|
+
#self.optimal_param_frame.clear()
|
16
|
+
#self.optimal_param_frame.destroy()
|
17
17
|
self.steps_frame.clear()
|
18
18
|
self.steps_frame.destroy()
|
19
19
|
self.paramtabview.destroy()
|
@@ -27,12 +27,12 @@ def create_tab(self, tab):
|
|
27
27
|
self.paramtabview = customtkinter.CTkTabview(tab, bg_color="transparent", fg_color="transparent")
|
28
28
|
self.paramtabview.grid(row=0, column=1, padx=(0, 0), pady=(10, 10), sticky="nsew")
|
29
29
|
|
30
|
-
tab1 = "
|
30
|
+
tab1 = "Model Parameters"
|
31
31
|
tab2 = "Hyperparameters"
|
32
|
-
tab3 = "Optimal"
|
32
|
+
#tab3 = "Optimal"
|
33
33
|
self.paramtabview.add(tab1)
|
34
34
|
self.paramtabview.add(tab2)
|
35
|
-
self.paramtabview.add(tab3)
|
35
|
+
#self.paramtabview.add(tab3)
|
36
36
|
|
37
37
|
self.paramtabview.tab(tab1).grid_columnconfigure(0, weight=1)
|
38
38
|
self.paramtabview.tab(tab1).grid_rowconfigure(0, weight=1)
|
@@ -40,8 +40,8 @@ def create_tab(self, tab):
|
|
40
40
|
self.paramtabview.tab(tab2).grid_columnconfigure(0, weight=1)
|
41
41
|
self.paramtabview.tab(tab2).grid_rowconfigure(0, weight=1)
|
42
42
|
|
43
|
-
self.paramtabview.tab(tab3).grid_columnconfigure(0, weight=1)
|
44
|
-
self.paramtabview.tab(tab3).grid_rowconfigure(0, weight=1)
|
43
|
+
#self.paramtabview.tab(tab3).grid_columnconfigure(0, weight=1)
|
44
|
+
#self.paramtabview.tab(tab3).grid_rowconfigure(0, weight=1)
|
45
45
|
|
46
46
|
self.static_param_frame = spv.StaticParameterView(self.paramtabview.tab(tab1), option_manager=self.option_manager)
|
47
47
|
self.static_param_frame.grid(row=0, column=0, padx=(10, 10), pady=(10, 0), sticky="nsew")
|
@@ -53,10 +53,10 @@ def create_tab(self, tab):
|
|
53
53
|
self.calib_param_frame.grid_columnconfigure(0, weight=1)
|
54
54
|
self.calib_param_frame.grid_rowconfigure(0, weight=1)
|
55
55
|
|
56
|
-
self.optimal_param_frame = opv.OptimalParameterView(self.paramtabview.tab(tab3), option_manager=self.option_manager)
|
57
|
-
self.optimal_param_frame.grid(row=0, column=0, padx=(10, 10), pady=(10, 0), sticky="nsew")
|
58
|
-
self.optimal_param_frame.grid_columnconfigure(0, weight=1)
|
59
|
-
self.optimal_param_frame.grid_rowconfigure(0, weight=1)
|
56
|
+
#self.optimal_param_frame = opv.OptimalParameterView(self.paramtabview.tab(tab3), option_manager=self.option_manager)
|
57
|
+
#self.optimal_param_frame.grid(row=0, column=0, padx=(10, 10), pady=(10, 0), sticky="nsew")
|
58
|
+
#self.optimal_param_frame.grid_columnconfigure(0, weight=1)
|
59
|
+
#self.optimal_param_frame.grid_rowconfigure(0, weight=1)
|
60
60
|
|
61
61
|
self.steps_frame = sv.StepView(tab, label_text="Group Editor", option_manager=self.option_manager, home_page=self)
|
62
62
|
self.steps_frame.grid(row=0, column=0, padx=(10, 10), pady=(10, 0), sticky="nsew")
|
@@ -6,6 +6,7 @@ from customtkinter import CTkEntry
|
|
6
6
|
from customtkinter import CTkTextbox
|
7
7
|
from customtkinter import CTkImage
|
8
8
|
from customtkinter import CTkOptionMenu
|
9
|
+
from .OverrideParameterWindow import OverrideParameterWindow as OPW
|
9
10
|
from PIL import Image
|
10
11
|
import os
|
11
12
|
|
@@ -135,13 +136,15 @@ class StepView(CTkScrollableFrame):
|
|
135
136
|
trash_image = CTkImage(Image.open(os.path.join("./images", "trash.png")), size=(20, 20))
|
136
137
|
expand_image = CTkImage(Image.open(os.path.join("./images", "expand.png")), size=(20, 20))
|
137
138
|
collapse_image = CTkImage(Image.open(os.path.join("./images", "collapse.png")), size=(20, 20))
|
139
|
+
override_image = CTkImage(Image.open(os.path.join("./images", "test.png")), size=(20, 20))
|
138
140
|
|
139
141
|
|
140
142
|
expand_func = lambda index=index: (self.clear(), self.option_manager.toggle_step_open(index), self.render())
|
141
143
|
up_func = lambda index=index: (self.clear(), self.option_manager.move_step_up(index), self.render())
|
142
144
|
down_func = lambda index=index: (self.clear(), self.option_manager.move_step_down(index), self.render())
|
143
145
|
remove_func = lambda index=index: (self.clear(), self.option_manager.remove_step(index), self.render())
|
144
|
-
|
146
|
+
open_override_window = lambda index=index: (OPW(title="Edit Override Parameters", step_index=index, option_manager=self.option_manager))
|
147
|
+
|
145
148
|
if (self.mode == "Optimization"):
|
146
149
|
button_container = CTkFrame(self.containerFrame, width=200)
|
147
150
|
button_container.grid(row=row, column=1, sticky="nse", padx=(10, 10), pady=(10, 10))
|
@@ -150,10 +153,11 @@ class StepView(CTkScrollableFrame):
|
|
150
153
|
|
151
154
|
CTkEntry(self.containerFrame, textvariable=step['name'], width=500).grid(row=row, column=0, padx=(20, 20), pady=(20, 20), sticky="nsw")
|
152
155
|
|
153
|
-
CTkButton(button_container, width=30, text=None, image=
|
154
|
-
CTkButton(button_container, width=30, text=None, image=
|
155
|
-
CTkButton(button_container, width=30, text=None, image=
|
156
|
-
CTkButton(button_container, width=30, text=None, image=
|
156
|
+
CTkButton(button_container, width=30, text=None, image=override_image, command=open_override_window).grid(row=0, column=0, padx=(10, 30), pady=(10, 10), sticky="nsew")
|
157
|
+
CTkButton(button_container, width=30, text=None, image=expand_image if not step['open'] else collapse_image, command=expand_func).grid(row=0, column=1, padx=(10, 10), pady=(10, 10), sticky="nsew")
|
158
|
+
CTkButton(button_container, width=30, text=None, image=up_image, state="disabled" if index==0 else "normal", fg_color="gray" if index==0 else None, command=up_func).grid(row=0, column=2, padx=(10, 10), pady=(10, 10), sticky="nsew")
|
159
|
+
CTkButton(button_container, width=30, text=None, image=down_image, state="disabled" if index==(len(self.steps)-1) else "normal", fg_color="gray" if index==(len(self.steps)-1) else None, command=down_func).grid(row=0, column=3, padx=(10, 10), pady=(10, 10), sticky="nsew")
|
160
|
+
CTkButton(button_container, width=30, text=None, image=trash_image, command=remove_func).grid(row=0, column=4, padx=(10, 10), pady=(10, 10), sticky="nsew")
|
157
161
|
|
158
162
|
row += 1
|
159
163
|
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|