Skip to content

Commit 68b4062

Browse files
Merge branch 'develop' into pr/896
2 parents fdade7b + e33ed34 commit 68b4062

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
lines changed

src/navigate/controller/controller.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,9 @@ def populate_experiment_setting(self, file_name=None, in_initialize=False):
415415
)
416416
self.channels_tab_controller.populate_experiment_values()
417417
self.camera_setting_controller.populate_experiment_values()
418+
self.waveform_tab_controller.set_waveform_template(
419+
self.configuration["experiment"]["MicroscopeState"]["waveform_template"]
420+
)
418421

419422
# autofocus popup
420423
if hasattr(self, "af_popup_controller"):

src/navigate/controller/sub_controllers/plugins_controller.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ def load_plugins(self):
9595
plugins_config_path = os.path.join(
9696
get_navigate_path(), "config", "plugins_config.yml"
9797
)
98-
if not os.path.exists(plugins_config_path):
98+
plugins_config = load_yaml_file(plugins_config_path)
99+
if plugins_config is None:
100+
plugins_config = {}
99101
save_yaml_file(get_navigate_path(), {}, "plugins_config.yml")
100102
else:
101-
plugins_config = load_yaml_file(plugins_config_path)
102103
for plugin_name, plugin_path in plugins_config.items():
103104
if plugin_path and os.path.exists(plugin_path):
104105
installed_plugins[plugin_name] = plugin_path

src/navigate/model/device_startup_functions.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,26 +1368,22 @@ def load_devices(configuration, is_synthetic=False, plugin_devices={}) -> dict:
13681368
camera = plugin_devices["camera"]["load_device"](
13691369
configuration, id, is_synthetic
13701370
)
1371+
else:
1372+
raise e
13711373

13721374
if (not is_synthetic) and device["type"].startswith("Hamamatsu"):
13731375
camera_serial_number = str(camera._serial_number)
1374-
device_ref_name = build_ref_name(
1375-
"_", device["type"], camera_serial_number
1376-
)
1376+
device_ref_name = camera_serial_number
13771377
# if the serial number has leading zeros,
13781378
# the yaml reader will convert it to an octal number
13791379
if camera_serial_number.startswith("0"):
13801380
try:
13811381
oct_num = int(camera_serial_number, 8)
1382-
devices["camera"][
1383-
build_ref_name("_", device["type"], oct_num)
1384-
] = camera
1382+
device_ref_name = str(oct_num)
13851383
except ValueError:
13861384
pass
13871385
else:
1388-
device_ref_name = build_ref_name(
1389-
"_", device["type"], device["serial_number"]
1390-
)
1386+
device_ref_name = str(device["serial_number"])
13911387
devices["camera"][device_ref_name] = camera
13921388

13931389
# load mirror

src/navigate/model/microscope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def __init__(
115115
return
116116

117117
device_ref_dict = {
118-
"camera": ["type", "serial_number"],
118+
"camera": ["serial_number"],
119119
"filter_wheel": ["type"],
120120
"zoom": ["type", "servo_id"],
121121
"shutter": ["type", "channel"],

src/navigate/model/model.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,11 +1424,9 @@ def load_feature_records(self):
14241424
os.makedirs(feature_lists_path)
14251425
return
14261426
# get __sequence.yml
1427-
if not os.path.exists(f"{feature_lists_path}/__sequence.yml"):
1427+
feature_records = load_yaml_file(f"{feature_lists_path}/__sequence.yml")
1428+
if feature_records is None:
14281429
feature_records = []
1429-
else:
1430-
feature_records = load_yaml_file(f"{feature_lists_path}/__sequence.yml")
1431-
14321430
# add non added feature lists
14331431
feature_list_files = [
14341432
temp
@@ -1440,6 +1438,8 @@ def load_feature_records(self):
14401438
if item == "__sequence.yml":
14411439
continue
14421440
temp = load_yaml_file(f"{feature_lists_path}/{item}")
1441+
if temp is None:
1442+
continue
14431443
add_flag = True
14441444
for feature in feature_records:
14451445
if feature["feature_list_name"] == temp["feature_list_name"]:
@@ -1460,6 +1460,9 @@ def load_feature_records(self):
14601460
del feature_records[i]
14611461
continue
14621462
item = load_yaml_file(f"{feature_lists_path}/{temp['yaml_file_name']}")
1463+
if item is None:
1464+
i += 1
1465+
continue
14631466

14641467
if item["module_name"]:
14651468
try:

src/navigate/model/plugins_model.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,13 @@ def load_plugins(self):
8181
plugins_config_path = os.path.join(
8282
get_navigate_path(), "config", "plugins_config.yml"
8383
)
84-
if not os.path.exists(plugins_config_path):
84+
plugins_config = load_yaml_file(plugins_config_path)
85+
if plugins_config is None:
86+
plugins_config = {}
8587
save_yaml_file(
8688
os.path.join(get_navigate_path(), "config"), {}, "plugins_config.yml"
8789
)
8890
else:
89-
plugins_config = load_yaml_file(plugins_config_path)
9091
verified_plugins_config = {}
9192
for plugin_name, plugin_path in plugins_config.items():
9293
if not plugin_path:

0 commit comments

Comments
 (0)