1+ camera_device_types = {
2+ "Hamamatsu ORCA Lightning" : "HamamatsuOrcaLightning" ,
3+ "Hamamatsu ORCA Fire" : "HamamatsuOrcaFire" ,
4+ "Hamamatsu Flash 4.0" : "HamamatsuOrca" ,
5+ "Photometrics Iris 15B" : "Photometrics" ,
6+ "Virtual Device" : "synthetic"
7+ }
8+
9+ camera_hardware_widgets = {
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 ]
18+ }
19+
20+ filter_wheel_device_types = {
21+ "Sutter Instruments" : "SutterFilterWheel" ,
22+ "Applied Scientific Instrumentation" : "ASI" ,
23+ "Virtual Device" : "synthetic" ,
24+ }
25+
26+ filter_wheel_widgets = {
27+ "filter_name" : ["Filter Name" , "Input" , "string" , None , "Example: Empty-Alignment" ],
28+ "filter_value" : ["Filter Value" , "Input" , "string" , None , "Example: 0" ],
29+ "button_1" : ["Delete" , "Button" , {"delete" : True }],
30+ "frame_config" : {"ref" : "available_filters" , "format" : "item(filter_name,filter_value)," , "direction" : "horizon" }
31+ }
32+
33+ filter_wheel_hardware_widgets = {
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" ],
39+ "button_1" : ["Add Available Filters" , "Button" , {"widgets" :filter_wheel_widgets , "ref" : "available_filters" , "direction" : "horizon" }]
40+ }
41+
42+ daq_device_types = {
43+ "National Instruments" : "NI" ,
44+ }
45+
46+ daq_hardware_widgets = {
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 ],
54+ }
55+
56+ shutter_device_types = {
57+ "Analog/Digital Device" : "NI" ,
58+ "Virtual Device" : "synthetic" ,
59+ }
60+
61+ shutter_hardware_widgets = {
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" ],
66+ "frame_config" : {"ref" : "hardware" }
67+ }
68+
69+ stage_device_types = {
70+ "Applied Scientific Instrumentation" : "ASI" ,
71+ "Analog/Digital Device" : "GalvoNIStage" ,
72+ "Mad City Labs" : "MCL" ,
73+ "Physik Instrumente" : "PI" ,
74+ "Sutter Instruments" : "MP285" ,
75+ "ThorLabs KCube Inertial Device" : "Thorlabs" ,
76+ "Virtual Device" : "synthetic" ,
77+ }
78+
79+ stage_hardware_widgets = {
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" ],
92+ "button_2" : ["Delete" , "Button" , {"delete" : True }],
93+ "frame_config" : {"collapsible" : True , "title" : "Stage" , "ref" : "hardware" , "format" : "list-dict" }
94+ }
95+
96+ stage_top_widgets = {
97+ "button_1" : ["Add New Stage Device" , "Button" , {"widgets" : stage_hardware_widgets , "ref" : "hardware" , "parent" : "hardware" }],
98+ }
99+
100+ stage_constants_widgets = {
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" ],
117+ "frame_config" : {"collapsible" : True , "title" : "Stage Constants" }
118+ }
119+
120+ remote_focus_device_types = {
121+ "Equipment Solutions" : "EquipmentSolutions" ,
122+ "Analog Device" : "NI" ,
123+ "Virtual Device" : "synthetic"
124+ }
125+
126+ remote_focus_hardware_widgets = {
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" ],
133+ "frame_config" : {"ref" : "hardware" }
134+ }
135+
136+ galvo_device_types = {
137+ "Analog Device" : "NI" ,
138+ "Virtual Device" : "synthetic"
139+ }
140+
141+ waveform_types = {
142+ "Sine" : "sine" ,
143+ "Sawtooth" : "sawtooth" ,
144+ "Square" : "square" ,
145+ }
146+
147+ galvo_hardware_widgets = {
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" ],
154+ "button_1" : ["Delete" , "Button" , {"delete" : True }],
155+ "frame_config" : {"collapsible" : True , "title" : "Galvo Device" , "ref" : "None" , "format" : "list-dict" }
156+ }
157+
158+ galvo_top_widgets = {
159+ "button_1" : ["Add New Device" , "Button" , {"widgets" : galvo_hardware_widgets , "parent" : "hardware" }],
160+ }
161+
162+ zoom_device_types = {
163+ "Dynamixel" : "DynamixelZoom" ,
164+ "Virtual Device" : "synthetic"
165+ }
166+
167+ zoom_position_widgets = {
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" ],
171+ "button_1" : ["Delete" , "Button" , {"delete" : True }],
172+ "frame_config" : {"ref" : "position;pixel_size" , "format" : "item(zoom_value, position);item(zoom_value, pixel_size)" , "direction" : "horizon" }
173+ }
174+
175+ zoom_hardware_widgets = {
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" ],
180+ "button_1" : ["Add Zoom Value" , "Button" , {"widgets" :zoom_position_widgets , "ref" : "position;pixel_size" , "direction" : "horizon" }],
181+ "frame_config" : {"ref" : "hardware" }
182+ }
183+
184+ mirror_device_types = {
185+ "Imagine Optics" : "ImagineOpticsMirror" ,
186+ "Virtual Device" : "SyntheticMirror"
187+ }
188+
189+ mirror_hardware_widgets = {
190+ "type" : ["Device Type" , "Combobox" , "string" , mirror_device_types , None ],
191+ "frame_config" : {"ref" : "hardware" }
192+ }
193+
194+ laser_device_types = {
195+ "Analog Device" : "NI" ,
196+ "Virtual Device" : "synthetic"
197+ }
198+
199+ laser_hardware_widgets = {
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 ],
211+ "button_1" : ["Delete" , "Button" , {"delete" : True }],
212+ "frame_config" : {"collapsible" : True , "title" : "Wavelength" , "format" : "list-dict" , "ref" : "None" }
213+ }
214+
215+ laser_top_widgets = {
216+ "button_1" : ["Add Wavelength" , "Button" , {"widgets" : laser_hardware_widgets , "parent" : "hardware" }],
217+ }
218+
219+ hardwares_dict = {
220+ "Camera" : camera_hardware_widgets ,
221+ "Data Acquisition Card" : daq_hardware_widgets ,
222+ "Filter Wheel" : (None , filter_wheel_hardware_widgets , filter_wheel_widgets ),
223+ "Galvo" : (galvo_top_widgets , galvo_hardware_widgets , None ),
224+ "Lasers" : (laser_top_widgets , laser_hardware_widgets , None ),
225+ "Remote Focus Devices" : remote_focus_hardware_widgets ,
226+ "Adaptive Optics" : mirror_hardware_widgets ,
227+ "Shutters" : shutter_hardware_widgets ,
228+ "Stages" : (stage_top_widgets , stage_hardware_widgets , stage_constants_widgets ),
229+ "Zoom Device" : (None , zoom_hardware_widgets , zoom_position_widgets )
230+ }
231+
232+ hardwares_config_name_dict = {
233+ "Camera" : "camera" ,
234+ "Data Acquisition Card" : "daq" ,
235+ "Filter Wheel" : "filter_wheel" ,
236+ "Galvo" : "galvo" ,
237+ "Lasers" : "lasers" ,
238+ "Remote Focus Devices" : "remote_focus_device" ,
239+ "Adaptive Optics" : "mirror" ,
240+ "Shutters" : "shutter" ,
241+ "Stages" : "stage" ,
242+ "Zoom Device" : "zoom" ,
243+ }
0 commit comments