Skip to content

Commit ca8e772

Browse files
committed
reload NICE XML config every time NICE is run
1 parent 53221e0 commit ca8e772

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

waveform_editor/gui/shape_editor.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,6 @@ def __init__(self, main_gui):
4646
)
4747
self.nice_settings = settings.nice
4848

49-
self.xml_params_inv = ET.fromstring(
50-
importlib.resources.files("waveform_editor.shape_editor.xml_param")
51-
.joinpath("inverse_param.xml")
52-
.read_text()
53-
)
54-
self.xml_params_dir = ET.fromstring(
55-
importlib.resources.files("waveform_editor.shape_editor.xml_param")
56-
.joinpath("direct_param.xml")
57-
.read_text()
58-
)
59-
6049
# UI Configuration
6150
button_start = pn.widgets.Button(name="Run", on_click=self.submit)
6251
button_start.disabled = (
@@ -205,9 +194,17 @@ async def submit(self, event=None):
205194

206195
self.coil_currents.fill_pf_active(self.pf_active)
207196
if self.nice_settings.is_direct_mode:
208-
xml_params = self.xml_params_dir
197+
xml_params = ET.fromstring(
198+
importlib.resources.files("waveform_editor.shape_editor.xml_param")
199+
.joinpath("direct_param.xml")
200+
.read_text()
201+
)
209202
else:
210-
xml_params = self.xml_params_inv
203+
xml_params = ET.fromstring(
204+
importlib.resources.files("waveform_editor.shape_editor.xml_param")
205+
.joinpath("inverse_param.xml")
206+
.read_text()
207+
)
211208
self.coil_currents.update_fixed_coils_in_xml(xml_params)
212209

213210
# Update XML parameters:

0 commit comments

Comments
 (0)