Skip to content

Commit cd31775

Browse files
committed
support serial number with leading zeros
1 parent 1fa1e15 commit cd31775

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/navigate/model/device_startup_functions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,9 +1234,13 @@ def load_devices(configuration, is_synthetic=False, plugin_devices={}) -> dict:
12341234
)
12351235

12361236
if (not is_synthetic) and device["type"].startswith("Hamamatsu"):
1237+
camera_serial_number = str(camera._serial_number)
12371238
device_ref_name = build_ref_name(
1238-
"_", device["type"], str(camera._serial_number)
1239+
"_", device["type"], camera_serial_number
12391240
)
1241+
# if the serial number is with leading zeros, the yaml reader will convert it to a octal number
1242+
if camera_serial_number.startswith("0"):
1243+
devices["camera"][build_ref_name("_", device["type"], int(camera_serial_number, 8))]
12401244
else:
12411245
device_ref_name = build_ref_name(
12421246
"_", device["type"], device["serial_number"]

0 commit comments

Comments
 (0)