Skip to content

Commit 03fbe1b

Browse files
committed
load configuration file
1 parent 4b906ca commit 03fbe1b

File tree

4 files changed

+380
-138
lines changed

4 files changed

+380
-138
lines changed

src/navigate/config/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,10 @@ def verify_configuration(manager, configuration):
982982
if "mirror" in device_config[microscope_name].keys() and "mirror" not in hardware_dict:
983983
hardware_dict["mirror"] = device_config[microscope_name]["mirror"]["hardware"]
984984

985+
if "daq" not in hardware_dict:
986+
hardware_dict["daq"] = {
987+
"type": "synthetic"
988+
}
985989
update_config_dict(manager, configuration["configuration"], "hardware", hardware_dict)
986990

987991
update_config_dict(manager, configuration["configuration"], "gui", {"channels": {"count": channel_count}})

src/navigate/config/configuration_database.py

Lines changed: 89 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
}
88

99
camera_hardware_widgets = {
10-
"hardware/type": ["Device Type", "Combobox", "string", camera_device_types],
11-
"hardware/serial_number": ["Serial Number", "Input", "string", None],
12-
"hardware/camera_connection": ["Camera Connection", "Input", "string",],
13-
"defect_correct_mode": ["Defect Correct Mode", "Combobox", "string", {"On": 2.0, "Off": 1.0}],
14-
"delay": ["Delay (ms)", "Spinbox", "float", None],
15-
"flip_x": ["Flip X", "Checkbutton", "bool", None],
16-
"flip_y": ["Flip Y", "Checkbutton", "bool", None],
17-
"count": ["Microscope Channel Count", "Spinbox", "int", {"from": 1, "to": 10, "step": 1}]
10+
"hardware/type": ["Device Type", "Combobox", "string", camera_device_types, None],
11+
"hardware/serial_number": ["Serial Number", "Input", "string", None, 'Example: "302352"'],
12+
"hardware/camera_connection": ["Camera Connection", "Input", "string", None, "*Photometrics Iris 15B only"],
13+
"defect_correct_mode": ["Defect Correct Mode", "Combobox", "string", {"On": 2.0, "Off": 1.0}, None],
14+
"delay": ["Delay (ms)", "Spinbox", "float", None, None],
15+
"flip_x": ["Flip X", "Checkbutton", "bool", None, None],
16+
"flip_y": ["Flip Y", "Checkbutton", "bool", None, None],
17+
"count": ["Microscope Channel Count", "Spinbox", "int", {"from": 5, "to": 10, "step": 1}, None]
1818
}
1919

2020
filter_wheel_device_types = {
@@ -24,18 +24,18 @@
2424
}
2525

2626
filter_wheel_widgets = {
27-
"filter_name": ["Filter Name", "Input", "string", None],
28-
"filter_value": ["Filter Value", "Input", "string", None],
27+
"filter_name": ["Filter Name", "Input", "string", None, "Example: Empty-Alignment"],
28+
"filter_value": ["Filter Value", "Input", "string", None, "Example: 0"],
2929
"button_1": ["Delete", "Button", {"delete": True}],
30-
"frame_config": {"format": "item(filter_name,filter_value)"}
30+
"frame_config": {"ref": "available_filters", "format": "item(filter_name,filter_value),", "direction": "horizon"}
3131
}
3232

3333
filter_wheel_hardware_widgets = {
34-
"hardware/type": ["Device Type", "Combobox", "string", filter_wheel_device_types,],
35-
"hardware/wheel_number": ["Number of Wheels", "Spinbox", "int", None],
36-
"hardware/port": ["Serial Port", "Input", "string", None],
37-
"hardware/baudrate": ["Baudrate", "Input", "int", None],
38-
"filter_wheel_delay": ["Filter Wheel Delay (s)", "Input", "float", None],
34+
"hardware/type": ["Device Type", "Combobox", "string", filter_wheel_device_types, None],
35+
"hardware/wheel_number": ["Number of Wheels", "Spinbox", "int", None, "Example: 1"],
36+
"hardware/port": ["Serial Port", "Input", "string", None, "Example: COM1"],
37+
"hardware/baudrate": ["Baudrate", "Input", "int", None, "Example: 9200"],
38+
"filter_wheel_delay": ["Filter Wheel Delay (s)", "Input", "float", None, "Example: 0.03"],
3939
"button_1": ["Add Available Filters", "Button", {"widgets":filter_wheel_widgets, "ref": "available_filters", "direction": "horizon"}]
4040
}
4141

@@ -44,13 +44,13 @@
4444
}
4545

4646
daq_hardware_widgets = {
47-
"hardware/type": ["Device Type", "Combobox", "string", daq_device_types,],
48-
"sample_rate": ["Sample Rate", "Input", "int", None],
49-
"master_trigger_out_line": ["Master Trigger Out", "Input", "string", None],
50-
"camera_trigger_out_line": ["Camera Trigger Out", "Input", "string", None],
51-
"trigger_source": ["Trigger Source", "Input", "string", None],
52-
"laser_port_switcher": ["Laser Switcher Port", "Input", "string", None],
53-
"laser_switch_state": ["Laser Switch On State", "Combobox", "bool", [True, False]],
47+
"hardware/type": ["Device Type", "Combobox", "string", daq_device_types, None],
48+
"sample_rate": ["Sample Rate", "Input", "int", None, "Example: 9600"],
49+
"master_trigger_out_line": ["Master Trigger Out", "Input", "string", None, "Example: PXI6259/port0/line1"],
50+
"camera_trigger_out_line": ["Camera Trigger Out", "Input", "string", None, "Example: /PXI6259/ctr0"],
51+
"trigger_source": ["Trigger Source", "Input", "string", None, "Example: /PXI6259/PFI0"],
52+
"laser_port_switcher": ["Laser Switcher Port", "Input", "string", None, "Example: PXI6733/port0/line0"],
53+
"laser_switch_state": ["Laser Switch On State", "Combobox", "bool", [True, False], None],
5454
}
5555

5656
shutter_device_types = {
@@ -59,10 +59,10 @@
5959
}
6060

6161
shutter_hardware_widgets = {
62-
"type": ["Device Type", "Combobox", "string", shutter_device_types,],
63-
"channel": ["NI Channel", "Input", "string", None],
64-
"min": ["Minimum Voltage", "Spinbox", "float", None],
65-
"max": ["Maximum Voltage", "Spinbox", "float", None],
62+
"type": ["Device Type", "Combobox", "string", shutter_device_types, None],
63+
"channel": ["NI Channel", "Input", "string", None, "Example: PXI6259/port0/line0"],
64+
"min": ["Minimum Voltage", "Spinbox", "float", None, "Example: 0"],
65+
"max": ["Maximum Voltage", "Spinbox", "float", None, "Example: 5"],
6666
"frame_config": {"ref": "hardware"}
6767
}
6868

@@ -77,18 +77,18 @@
7777
}
7878

7979
stage_hardware_widgets = {
80-
"type": ["Device Type", "Combobox", "string", stage_device_types,],
81-
"serial_number": ["Serial Number", "Input", "string", None],
82-
"axes": ["Axes", "Input", "string", None,],
83-
"axes_mapping": ["Axes Mapping", "Input", "string", None],
84-
"volts_per_micron": ["Volts Per Micron", "Spinbox", "float", {"from": 0, "to": 100, "step":0.1}, ("type", "GalvoNIStage")],
85-
"min": ["Minimum Volts", "Spinbox", "float", {"from": 0, "to": 5, "step": 0.1}, ("type", "GalvoNIStage")],
86-
"max": ["Maximum Volts", "Spinbox", "float", {"from": 1, "to": 100, "step": 0.1}, ("type", "GalvoNIStage")],
87-
"controllername": ["Controller Name", "Input", "string", None, ("type", "PI")],
88-
"stages": ["PI Stages", "Input", "string", None, ("type", "PI")],
89-
"refmode": ["REF Modes", "Input", "string", None, ("type", "PI")],
90-
"port": ["Serial Port", "Input", "string", None],
91-
"baudrate": ["Baudrate", "Input", "int", None],
80+
"type": ["Device Type", "Combobox", "string", stage_device_types, None],
81+
"serial_number": ["Serial Number", "Input", "string", None, None],
82+
"axes": ["Axes", "Input", "string", None, "Example: [x, y, z]"],
83+
"axes_mapping": ["Axes Mapping", "Input", "string", None, "Example: [X, M, Y]"],
84+
"volts_per_micron": ["Volts Per Micron", "Spinbox", "float", {"from": 0, "to": 100, "step":0.1}, "*Analog/Digital Device only"],
85+
"min": ["Minimum Volts", "Spinbox", "float", {"from": 0, "to": 5, "step": 0.1}, "*Analog/Digital Device only",],
86+
"max": ["Maximum Volts", "Spinbox", "float", {"from": 1, "to": 100, "step": 0.1}, "*Analog/Digital Device only",],
87+
"controllername": ["Controller Name", "Input", "string", None, "*Physik Instrumente only. Example: 'C-884'"],
88+
"stages": ["PI Stages", "Input", "string", None, "*Physik Instrumente only. Example: L-509.20DG10 L-509.40DG10"],
89+
"refmode": ["REF Modes", "Input", "string", None, "*Physik Instrumente only. Example: FRF FRF"],
90+
"port": ["Serial Port", "Input", "string", None, "Example: COM1"],
91+
"baudrate": ["Baudrate", "Input", "int", None, "Example: 9200"],
9292
"button_2": ["Delete", "Button", {"delete": True}],
9393
"frame_config": {"collapsible": True, "title": "Stage", "ref": "hardware", "format": "list-dict"}
9494
}
@@ -98,22 +98,22 @@
9898
}
9999

100100
stage_constants_widgets = {
101-
"joystick_axes": ["Joystick Axes", "Input", "string", None],
102-
"x_min": ["Min X", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
103-
"x_max": ["Max X", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
104-
"y_min": ["Min Y", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
105-
"y_max": ["Max Y", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
106-
"z_min": ["Min Z", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
107-
"z_max": ["Max Z", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
108-
"theta_min": ["Min Theta", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
109-
"theta_max": ["Max Theta", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
110-
"f_min": ["Min Focus", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
111-
"f_max": ["Max Focus", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
112-
"x_offset": ["Offset of X", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
113-
"y_offset": ["Offset of Y", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
114-
"z_offset": ["Offset of Z", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
115-
"theta_offset": ["Offset of Theta", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
116-
"f_offset": ["Offset of Focus", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}],
101+
"joystick_axes": ["Joystick Axes", "Input", "string", None, "Example: [x, y, z]"],
102+
"x_min": ["Min X", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}, None],
103+
"x_max": ["Max X", "Spinbox", "float", {"from": 0, "to": 10000, "step": 1000}, None],
104+
"y_min": ["Min Y", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}, None],
105+
"y_max": ["Max Y", "Spinbox", "float", {"from": 0, "to": 10000, "step": 1000}, None],
106+
"z_min": ["Min Z", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}, None],
107+
"z_max": ["Max Z", "Spinbox", "float", {"from": 0, "to": 10000, "step": 1000}, None],
108+
"theta_min": ["Min Theta", "Spinbox", "float", {"from": 0, "to": 360, "step": 1000}, None],
109+
"theta_max": ["Max Theta", "Spinbox", "float", {"from": 0, "to": 360, "step": 1000}, None],
110+
"f_min": ["Min Focus", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}, None],
111+
"f_max": ["Max Focus", "Spinbox", "float", {"from": 0, "to": 10000, "step": 1000}, None],
112+
"x_offset": ["Offset of X", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}, "Example: 0"],
113+
"y_offset": ["Offset of Y", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}, "Example: 0"],
114+
"z_offset": ["Offset of Z", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}, "Example: 0"],
115+
"theta_offset": ["Offset of Theta", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}, "Example: 0"],
116+
"f_offset": ["Offset of Focus", "Spinbox", "float", {"from": -100000, "to": 10000, "step": 1000}, "Example: 0"],
117117
"frame_config": {"collapsible": True, "title": "Stage Constants"}
118118
}
119119

@@ -124,12 +124,12 @@
124124
}
125125

126126
remote_focus_hardware_widgets = {
127-
"type": ["Device Type", "Combobox", "string", remote_focus_device_types],
128-
"channel": ["DAQ Channel", "Input", "string", None],
129-
"min": ["Minimum Voltage", "Spinbox", "float", {"from": -10, "to": 10, "step": 1}],
130-
"max": ["Maximum Voltage", "Spinbox", "float", {"from": 0, "to": 10, "step": 1}],
131-
"comport": ["Serial Port", "Input", "string", None],
132-
"baudrate": ["Baudrate", "Input", "int", None],
127+
"type": ["Device Type", "Combobox", "string", remote_focus_device_types, None],
128+
"channel": ["DAQ Channel", "Input", "string", None, "Example: PXI6259/ao3"],
129+
"min": ["Minimum Voltage", "Spinbox", "float", {"from": -10, "to": 10, "step": 1}, None],
130+
"max": ["Maximum Voltage", "Spinbox", "float", {"from": 0, "to": 10, "step": 1}, None],
131+
"comport": ["Serial Port", "Input", "string", None, "*Equipment Solutions only"],
132+
"baudrate": ["Baudrate", "Input", "int", None, "*Equipment Solutions only. Example: 9200"],
133133
"frame_config": {"ref": "hardware"}
134134
}
135135

@@ -145,12 +145,12 @@
145145
}
146146

147147
galvo_hardware_widgets = {
148-
"hardware/type": ["Device Type", "Combobox", "string", galvo_device_types],
149-
"hardware/channel": ["DAQ Channel", "Input", "string", None],
150-
"hardware/min": ["Minimum Voltage", "Spinbox", "float", {"from": -10, "to": 10, "step": 0.1}],
151-
"hardware/max": ["Maximum Voltage", "Spinbox", "float", {"from": 0, "to": 10, "step": 0.1}],
152-
"waveform": ["Waveform", "Combobox", "string", waveform_types],
153-
"phase": ["Phase", "Input", "string", None],
148+
"hardware/type": ["Device Type", "Combobox", "string", galvo_device_types, None],
149+
"hardware/channel": ["DAQ Channel", "Input", "string", None, "Example: PXI6259/ao1"],
150+
"hardware/min": ["Minimum Voltage", "Spinbox", "float", {"from": -10, "to": 10, "step": 0.1}, None],
151+
"hardware/max": ["Maximum Voltage", "Spinbox", "float", {"from": 0, "to": 10, "step": 0.1}, None],
152+
"waveform": ["Waveform", "Combobox", "string", waveform_types, None],
153+
"phase": ["Phase", "Input", "string", None, "Example: 1.57"],
154154
"button_1": ["Delete", "Button", {"delete": True}],
155155
"frame_config": {"collapsible": True, "title": "Galvo Device", "ref": "None", "format": "list-dict"}
156156
}
@@ -165,18 +165,18 @@
165165
}
166166

167167
zoom_position_widgets = {
168-
"zoom_value": ["Zoom Value", "Input", "string", None],
169-
"position": ["Position", "Input", "float", None],
170-
"pixel_size": ["Pixel Size (um)", "Input", "float", None],
168+
"zoom_value": ["Zoom Value", "Input", "string", None, "Example: 16x"],
169+
"position": ["Position", "Input", "float", None, "Example: 1000"],
170+
"pixel_size": ["Pixel Size (um)", "Input", "float", None, "Example: 0.5"],
171171
"button_1": ["Delete", "Button", {"delete": True}],
172-
"frame_config": {"ref": "position;pixel_size", "format": "item(zoom_value, position);item(zoom_value, pixel_size)"}
172+
"frame_config": {"ref": "position;pixel_size", "format": "item(zoom_value, position);item(zoom_value, pixel_size)", "direction": "horizon"}
173173
}
174174

175175
zoom_hardware_widgets = {
176-
"type": ["Device Type", "Combobox", "string", zoom_device_types,],
177-
"servo_id": ["Servo ID", "Input", "string", None],
178-
"port": ["Serial Port", "Input", "string", None],
179-
"baudrate": ["Baudrate", "Input", "int", None],
176+
"type": ["Device Type", "Combobox", "string", zoom_device_types, None],
177+
"servo_id": ["Servo ID", "Input", "string", None, "Example: 1"],
178+
"port": ["Serial Port", "Input", "string", None, "Example: COM1"],
179+
"baudrate": ["Baudrate", "Input", "int", None, "Example: 9600"],
180180
"button_1": ["Add Zoom Value", "Button", {"widgets":zoom_position_widgets, "ref": "position;pixel_size", "direction": "horizon"}],
181181
"frame_config": {"ref": "hardware"}
182182
}
@@ -187,7 +187,7 @@
187187
}
188188

189189
mirror_hardware_widgets = {
190-
"type": ["Device Type", "Combobox", "string", mirror_device_types,],
190+
"type": ["Device Type", "Combobox", "string", mirror_device_types, None],
191191
"frame_config": {"ref": "hardware"}
192192
}
193193

@@ -197,17 +197,17 @@
197197
}
198198

199199
laser_hardware_widgets = {
200-
"wavelength": ["Wavelength", "Input", "int", None],
201-
"onoff": ["On/Off Setting", "Label", None, None],
202-
"onoff/hardware/type": ["Type", "Combobox", "string", laser_device_types],
203-
"onoff/hardware/channel": ["DAQ Channel", "Input", "string", None],
204-
"onoff/hardware/min": ["Minimum Voltage", "Spinbox", "float", {"from": 0, "to": 100, "step": 1}],
205-
"onoff/hardware/max": ["Maximum Voltage", "Spinbox", "float", {"from": 0, "to": 100, "step": 1}],
206-
"power": ["Power Setting", "Label", None, None],
207-
"power/hardware/type": ["Type", "Combobox", "string", laser_device_types],
208-
"power/hardware/channel": ["DAQ Channel", "Input", "string", None],
209-
"power/hardware/min": ["Minimum Voltage", "Spinbox", "float", {"from": 0, "to": 100, "step": 1}],
210-
"power/hardware/max": ["Maximum Voltage", "Spinbox", "float", {"from": 0, "to": 100, "step": 1}],
200+
"wavelength": ["Wavelength", "Input", "int", None, None, "Example: 488"],
201+
"onoff": ["On/Off Setting", "Label", None, None, None],
202+
"onoff/hardware/type": ["Type", "Combobox", "string", laser_device_types, None],
203+
"onoff/hardware/channel": ["DAQ Channel", "Input", "string", None, "Example: PXI6733/port0/line2"],
204+
"onoff/hardware/min": ["Minimum Voltage", "Spinbox", "float", {"from": 0, "to": 100, "step": 1}, None],
205+
"onoff/hardware/max": ["Maximum Voltage", "Spinbox", "float", {"from": 0, "to": 100, "step": 1}, None],
206+
"power": ["Power Setting", "Label", None, None, None],
207+
"power/hardware/type": ["Type", "Combobox", "string", laser_device_types, None],
208+
"power/hardware/channel": ["DAQ Channel", "Input", "string", None, "Example: PXI6733/ao0"],
209+
"power/hardware/min": ["Minimum Voltage", "Spinbox", "float", {"from": 0, "to": 100, "step": 1}, None],
210+
"power/hardware/max": ["Maximum Voltage", "Spinbox", "float", {"from": 0, "to": 100, "step": 1}, None],
211211
"button_1": ["Delete", "Button", {"delete": True}],
212212
"frame_config": {"collapsible": True, "title": "Wavelength", "format": "list-dict", "ref": "None"}
213213
}
@@ -219,14 +219,14 @@
219219
hardwares_dict = {
220220
"Camera": camera_hardware_widgets,
221221
"Data Acquisition Card": daq_hardware_widgets,
222-
"Filter Wheel": filter_wheel_hardware_widgets,
222+
"Filter Wheel": (None, filter_wheel_hardware_widgets, filter_wheel_widgets),
223223
"Galvo": (galvo_top_widgets, galvo_hardware_widgets, None),
224224
"Lasers": (laser_top_widgets, laser_hardware_widgets, None),
225225
"Remote Focus Devices": remote_focus_hardware_widgets,
226226
"Adaptive Optics": mirror_hardware_widgets,
227227
"Shutters": shutter_hardware_widgets,
228228
"Stages": (stage_top_widgets, stage_hardware_widgets, stage_constants_widgets),
229-
"Zoom Device": zoom_hardware_widgets
229+
"Zoom Device": (None, zoom_hardware_widgets, zoom_position_widgets)
230230
}
231231

232232
hardwares_config_name_dict = {

0 commit comments

Comments
 (0)