def __init__(self): super().__init__(title="Webserver") self._enabled_checkbox = ui.CheckBox( text="Enable Server" ) self._host_text = ui.Text() self._port_number = ui.Number( minimum=0, maximum=99999, step=1 ) self.layout = ui.Column( ui.GroupBox( title="JSON API", layout=ui.Column( self._enabled_checkbox, ui.Row( ui.Column( ui.Label("Host"), ui.Label("Port"), ), ui.Column( self._host_text, self._port_number, ), ui.Spacer() ), ui.Spacer(), stretch=(0, 0, 1) ) ), ui.Spacer(), stretch=(0, 1) )
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.matrix_enable = ui.CheckBox(text="Enable Switching") self.matrix_channels = MatrixChannelsText( tool_tip="Matrix card switching channels, comma separated list." ) self.bind("matrix_enable", self.matrix_enable, False) self.bind("matrix_channels", self.matrix_channels, []) self.control_tabs.append(ui.Tab( title="Matrix", layout=ui.Column( ui.GroupBox( title="Matrix", layout=ui.Column( self.matrix_enable, ui.Label(text="Channels"), ui.Row( self.matrix_channels, # ui.Button(text="Load from Matrix", clicked=self.load_matrix_channels) ) ) ), ui.Spacer(), stretch=(0, 1) ) ))
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.title = "4 Wire IV Ramp" self.register_hvsource() self.register_environment() self.plot = ui.Plot(height=300, legend="right") self.plot.add_axis("x", align="bottom", text="Current [uA] (abs)") self.plot.add_axis("y", align="right", text="Voltage [V]") self.plot.add_series("vsrc", "x", "y", text="V Source", color="blue") self.plot.add_series("xfit", "x", "y", text="Fit", color="magenta") self.data_tabs.insert(0, ui.Tab(title="IV Curve", layout=self.plot)) self.current_start = ui.Number(decimals=3, suffix="uA") self.current_stop = ui.Number(decimals=3, suffix="uA") self.current_step = ui.Number(minimum=0, decimals=3, suffix="uA") self.waiting_time = ui.Number(minimum=0, decimals=2, suffix="s") self.vsrc_voltage_compliance = ui.Number(decimals=3, suffix="V") self.vsrc_accept_compliance = ui.CheckBox("Accept Compliance") self.bind("current_start", self.current_start, 0, unit="uA") self.bind("current_stop", self.current_stop, 0, unit="uA") self.bind("current_step", self.current_step, 0, unit="uA") self.bind("waiting_time", self.waiting_time, 1, unit="s") self.bind("vsrc_voltage_compliance", self.vsrc_voltage_compliance, 0, unit="V") self.bind("vsrc_accept_compliance", self.vsrc_accept_compliance, False) self.general_tab.layout = ui.Row( ui.GroupBox(title="Ramp", layout=ui.Column(ui.Label(text="Start"), self.current_start, ui.Label(text="Stop"), self.current_stop, ui.Label(text="Step"), self.current_step, ui.Label(text="Waiting Time"), self.waiting_time, ui.Spacer())), ui.GroupBox(title="V Source", layout=ui.Column(ui.Label(text="Compliance"), self.vsrc_voltage_compliance, self.vsrc_accept_compliance, ui.Spacer())), ui.Spacer(), stretch=(1, 1, 1)) ampere = comet.ureg('A') volt = comet.ureg('V') self.series_transform['vsrc'] = lambda x, y: ((x * ampere).to('uA').m, (y * volt).to('V').m) self.series_transform['xfit'] = self.series_transform.get('vsrc')
def __init__(self): super().__init__(title="Options") self._png_plots_checkbox = ui.CheckBox("Save plots as PNG") self._points_in_plots_checkbox = ui.CheckBox("Show points in plots") self._png_analysis_checkbox = ui.CheckBox( "Add analysis preview to PNG") self._export_json_checkbox = ui.CheckBox("Write JSON data (*.json)") self._export_txt_checkbox = ui.CheckBox( "Write plain text data (*.txt)") self._write_logfiles_checkbox = ui.CheckBox( "Write measurement log files (*.log)") self._vsrc_instrument_combobox = ui.ComboBox( ["K2410", "K2470", "K2657A"]) self._hvsrc_instrument_combobox = ui.ComboBox( ["K2410", "K2470", "K2657A"]) self._retry_measurement_number = ui.Number( minimum=0, suffix="x", tool_tip="Number of retries for measurements with failed analysis." ) self._retry_contact_number = ui.Number( minimum=0, suffix="x", tool_tip= "Number of re-contact retries for measurements with failed analysis." ) self.layout = ui.Column( ui.Row(ui.GroupBox(title="Plots", layout=ui.Column( self._png_plots_checkbox, self._points_in_plots_checkbox, )), ui.GroupBox(title="Analysis", layout=ui.Column(self._png_analysis_checkbox, ui.Spacer())), stretch=(0, 1)), ui.Row(ui.GroupBox(title="Formats", layout=ui.Column(self._export_json_checkbox, self._export_txt_checkbox)), ui.GroupBox(title="Log files", layout=ui.Column(self._write_logfiles_checkbox, ui.Spacer())), stretch=(0, 1)), ui.GroupBox(title="Instruments", layout=ui.Row(ui.Column(ui.Label("V Source"), ui.Label("HV Source")), ui.Column( self._vsrc_instrument_combobox, self._hvsrc_instrument_combobox), ui.Spacer(vertical=False), stretch=(0, 0, 1))), ui.GroupBox(title="Auto Retry", layout=ui.Row( ui.Column(ui.Label("Retry Measurements"), ui.Label("Retry Contact")), ui.Column(self._retry_measurement_number, self._retry_contact_number), ui.Spacer())), ui.Spacer(), stretch=(0, 0, 0, 0, 1))
def __init__(self, context, table_enabled): super().__init__() self.title = "Start Sequence" self._contact_checkbox = ui.CheckBox( text="Move table and contact with Probe Card", checked=True, enabled=table_enabled) self._position_checkbox = ui.CheckBox( text="Move table after measurements", checked=False, enabled=table_enabled, changed=self.on_position_checkbox_toggled) self._positions_combobox = PositionsComboBox(enabled=False) self._operator_combobox = OperatorWidget() self._output_combobox = WorkingDirectoryWidget() self._button_box = ui.DialogButtonBox(buttons=("yes", "no"), accepted=self.accept, rejected=self.reject) self._button_box.qt.button( self._button_box.QtClass.Yes).setAutoDefault(False) self._button_box.qt.button( self._button_box.QtClass.No).setDefault(True) self.layout = ui.Column( ui.Label(text=self._create_message(context)), ui.GroupBox(title="Table", layout=ui.Column( self._contact_checkbox, ui.Row(self._position_checkbox, self._positions_combobox), ui.Spacer())), ui.Row(ui.GroupBox(title="Operator", layout=self._operator_combobox), ui.GroupBox(title="Working Directory", layout=self._output_combobox), stretch=(2, 3)), self._button_box, stretch=(1, 0, 0, 0))
def __init__(self): super().__init__(title="Table") self.temporary_z_limit_changed = None self._steps_tree = ui.Tree(header=("Size", "Z-Limit", "Color"), root_is_decorated=False) # Hide Z-Limit column self._steps_tree.qt.setColumnHidden(1, True) self._steps_tree.selected = self.on_position_selected self._steps_tree.double_clicked = self.on_steps_tree_double_clicked self._steps_tree.qt.setItemDelegateForColumn( 0, ItemDelegate(self._steps_tree.qt)) self._steps_tree.qt.setItemDelegateForColumn( 1, ItemDelegate(self._steps_tree.qt)) self._add_step_button = ui.Button(text="&Add", tool_tip="Add table step", clicked=self.on_add_step_clicked) self._edit_step_button = ui.Button(text="&Edit", tool_tip="Edit selected table step", enabled=False, clicked=self.on_edit_step_clicked) self._remove_step_button = ui.Button( text="&Remove", tool_tip="Remove selected table step", enabled=False, clicked=self.on_remove_step_clicked) self._z_limit_movement_number = ui.Number( minimum=0, maximum=128.0, decimals=3, suffix="mm", changed=self.on_z_limit_movement_changed) def create_number(): return ui.Number(minimum=0, maximum=1000.0, decimals=3, suffix="mm") self._probecard_limit_x_maximum_number = create_number() self._probecard_limit_y_maximum_number = create_number() self._probecard_limit_z_maximum_number = create_number() self._probecard_limit_z_maximum_checkbox = ui.CheckBox( text="Temporary Z-Limit", tool_tip="Select to show temporary Z-Limit notice.") self._joystick_limit_x_maximum_number = create_number() self._joystick_limit_y_maximum_number = create_number() self._joystick_limit_z_maximum_number = create_number() self._probecard_contact_delay_number = ui.Number(minimum=0, maximum=3600, decimals=2, step=.1, suffix="s") self._recontact_overdrive_number = ui.Number(minimum=0, maximum=0.025, decimals=3, step=.001, suffix="mm") self.layout = ui.Column( ui.GroupBox(title="Control Steps (mm)", layout=ui.Row(self._steps_tree, ui.Column(self._add_step_button, self._edit_step_button, self._remove_step_button, ui.Spacer()), stretch=(1, 0))), ui.GroupBox(title="Movement Z-Limit", layout=ui.Column(self._z_limit_movement_number)), ui.GroupBox(title="Probe Card Limts", layout=ui.Row( ui.Column(ui.Label("X"), self._probecard_limit_x_maximum_number), ui.Column(ui.Label("Y"), self._probecard_limit_y_maximum_number), ui.Column(ui.Label("Z"), self._probecard_limit_z_maximum_number), ui.Column( ui.Label(), ui.Label("Maximum"), ), ui.Spacer(), ui.Column( ui.Label(), self._probecard_limit_z_maximum_checkbox, ))), ui.GroupBox(title="Joystick Limits", layout=ui.Row( ui.Column(ui.Label("X"), self._joystick_limit_x_maximum_number), ui.Column(ui.Label("Y"), self._joystick_limit_y_maximum_number), ui.Column(ui.Label("Z"), self._joystick_limit_z_maximum_number), ui.Column( ui.Label(), ui.Label("Maximum"), ), ui.Spacer())), ui.Row(ui.GroupBox(title="Probecard Contact Delay", layout=ui.Row( self._probecard_contact_delay_number)), ui.GroupBox(title="Re-Contact Z-Overdrive (1x)", layout=ui.Row( self._recontact_overdrive_number)), stretch=(0, 1)), stretch=(1, 0, 0, 0, 0))
def main(): app = comet.Application() app.title = "UI Demo" values = ["Chapman", "Cleese", "Gilliam", "Idle", "Jones", "Palin"] tab1 = ui.Tab(title="Tab 1", layout=ui.Column( ui.Row(ui.Column( ui.GroupBox(title="Numbers", layout=ui.Column( ui.Label(text="Number 1"), ui.Number(value=1, minimum=0, maximum=10, step=1, prefix="#"), ui.Label(text="Number 2"), ui.Number(value=2.345, minimum=0, maximum=10, step=.1, decimals=3, suffix="mV"), ui.Label(text="Number 3"), ui.Number(value=1.23, minimum=0, maximum=10, decimals=2, suffix="mA", readonly=True), ui.Label(text="Number 4"), ui.Number(value=4.2, minimum=0, maximum=10, decimals=1, suffix="dB", enabled=False)))), ui.Column( ui.GroupBox(title="Text", layout=ui.Column( ui.Label(text="Text 1"), ui.Text(value="Chapman"), ui.Label(text="Text 2"), ui.Text(value="Cleese", clearable=True), ui.Label(text="Text 3"), ui.Text(value="Idle", readonly=True), ui.Label(text="Text 4"), ui.Text(value="Palin", enabled=False)))), ui.Spacer(), stretch=(2, 2, 3)), ui.Spacer(), stretch=(0, 1))) def on_append(): list1.append(f"Spam {len(list1)}") list1.current = list1[0] def on_remove(): if list1.current is not None: list1.remove(list1.current) list1 = ui.List() tab2 = ui.Tab(title="Tab 2", layout=ui.Column(ui.Row( ui.GroupBox(title="List 1", layout=ui.Column( list1, ui.Button(text="&Add", clicked=on_append), ui.Button(text="&Remove", clicked=on_remove))), ui.GroupBox(title="List 2", layout=ui.List(values)), ui.GroupBox(title="List 3", layout=ui.List(values, enabled=False))), ui.Spacer(), stretch=(0, 1))) table1 = ui.Table(header=["Key", "Value"]) tab3 = ui.Tab(title="Tab 3", layout=ui.Column(table1)) tree1 = ui.Tree(header=["Key", "Value"]) tab4 = ui.Tab(title="Tab 4", layout=ui.Column(tree1)) first = ui.Button(text="Click") scroll = ui.ScrollArea(layout=ui.Column(*[ ui.CheckBox(text=f"Option {i+1}", checked=random.choice([True, False])) for i in range(64) ])) second = ui.Column(scroll) tab5 = ui.Tab(title="Tab 5", layout=first) tab5.layout = second del first tab6 = ui.Tab(title="Tab 6", layout=ui.Row(ui.Column( ui.Label("Metric 1"), ui.Metric('V', decimals=3, changed=lambda value: print(value)), ui.Label("Metric 2"), ui.Metric('A', prefixes='munp', changed=lambda value: print(value)), ui.Spacer()), ui.Spacer(), stretch=(1, 2))) def on_changed(value): app.message = value def on_click(): app.message = combobox1.current tabs = ui.Tabs(tab1, tab2, tab3, tab4, tab5, tab6) combobox1 = ui.ComboBox(values) app.layout = ui.Row(ui.Column( ui.GroupBox(title="GroupBox 1", layout=ui.Column( ui.Button(text="Button 1", clicked=on_click), ui.Button(text="Button 2", enabled=False), ui.Button(text="Button 3", checkable=True), ui.Button(text="Button 4", checkable=True, enabled=False), ui.Button(text="Button 5", checkable=True, checked=True))), ui.GroupBox(title="GroupBox 2", layout=ui.Column( ui.CheckBox(text="CheckBox 1"), ui.CheckBox(text="CheckBox 2", enabled=False), ui.CheckBox(text="CheckBox 3", checked=True, enabled=False), ui.CheckBox(text="CheckBox 4", checked=True))), ui.GroupBox(title="GroupBox 3", layout=ui.Column( ui.ComboBox(), combobox1, ui.ComboBox(values, current="Cleese", changed=on_changed), ui.ComboBox(values, current="Idle", enabled=False))), ui.Spacer()), tabs, stretch=(2, 7)) # Populate table spam = table1.append(["Spam", 42]) spam[0].checked = True #spam[0].enabled = False ham = table1.append(["Ham", 41]) ham[0].checked = True #ham[0].enabled = False # Populate tree spam = tree1.append(["Spam", 42]) spam[0].checked = True spam.append(["Ham", 41]) spam.append(["Eggs", 40]) # Add an remove tab tab = ui.Tab() tabs.insert(0, tab) tab.title = "Spam" tabs.remove(tab) app.message = "Notification message..." app.progress = 3, 4 return app.run()
def register_lcr(self): def change_lcr_open_correction_mode(mode): self.lcr_open_correction_channel.enabled = mode == "multi" self.lcr_integration_time = ui.ComboBox(["short", "medium", "long"]) self.lcr_averaging_rate = ui.Number(minimum=1, maximum=256, decimals=0) self.lcr_auto_level_control = ui.CheckBox(text="Auto Level Control") self.lcr_soft_filter = ui.CheckBox(text="Filter STD/mean < 0.005") self.lcr_open_correction_mode = ui.ComboBox( ["single", "multi"], changed=change_lcr_open_correction_mode) self.lcr_open_correction_channel = ui.Number(minimum=0, maximum=127, decimals=0) change_lcr_open_correction_mode(self.lcr_open_correction_mode.current) self.bind("lcr_integration_time", self.lcr_integration_time, "medium") self.bind("lcr_averaging_rate", self.lcr_averaging_rate, 1) self.bind("lcr_auto_level_control", self.lcr_auto_level_control, True) self.bind("lcr_soft_filter", self.lcr_soft_filter, True) self.bind("lcr_open_correction_mode", self.lcr_open_correction_mode, "single") self.bind("lcr_open_correction_channel", self.lcr_open_correction_channel, 0) self.status_lcr_voltage = ui.Text(value=NO_VALUE, readonly=True) self.status_lcr_current = ui.Text(value=NO_VALUE, readonly=True) self.status_lcr_output = ui.Text(value=NO_VALUE, readonly=True) self.bind("status_lcr_voltage", self.status_lcr_voltage, NO_VALUE) self.bind("status_lcr_current", self.status_lcr_current, NO_VALUE) self.bind("status_lcr_output", self.status_lcr_output, NO_VALUE) self.status_panel.append( ui.GroupBox(title="LCR Status", layout=ui.Row( ui.Column(ui.Label("Voltage"), self.status_lcr_voltage), ui.Column(ui.Label("Current"), self.status_lcr_current), ui.Column(ui.Label("Output"), self.status_lcr_output)))) self.control_tabs.append( ui.Tab(title="LCR", layout=ui.Row( ui.GroupBox(title="Open Correction", layout=ui.Column( ui.Label(text="Method"), self.lcr_open_correction_mode, ui.Label(text="Channel"), self.lcr_open_correction_channel, ui.Spacer())), ui.GroupBox(title="Options", layout=ui.Column( ui.Label(text="Integration Time"), self.lcr_integration_time, ui.Label(text="Averaging Rate"), self.lcr_averaging_rate, self.lcr_auto_level_control, self.lcr_soft_filter, ui.Spacer())), ui.Spacer(), stretch=(1, 1, 1)))) def handler(state): if 'lcr_voltage' in state: value = state.get('lcr_voltage') self.status_lcr_voltage.value = format_metric(value, "V") if 'lcr_current' in state: value = state.get('lcr_current') self.status_lcr_current.value = format_metric(value, "A") if 'lcr_output' in state: value = state.get('lcr_output') self.status_lcr_output.value = format_switch(value, default=NO_VALUE) self.state_handlers.append(handler)
def register_electrometer(self): def toggle_elm_filter(enabled): self.elm_filter_count.enabled = enabled self.elm_filter_count_label.enabled = enabled self.elm_filter_type.enabled = enabled self.elm_filter_type_label.enabled = enabled self.elm_filter_enable = ui.CheckBox(text="Enable", changed=toggle_elm_filter) self.elm_filter_count = ui.Number(minimum=0, maximum=100, decimals=0) self.elm_filter_count_label = ui.Label(text="Count") self.elm_filter_type = ui.ComboBox(["repeat", "moving"]) self.elm_filter_type_label = ui.Label(text="Type") self.elm_zero_correction = ui.CheckBox(text="Zero Correction") self.elm_integration_rate = ui.Number(minimum=0, maximum=100.0, decimals=2, suffix="Hz") def toggle_elm_current_autorange(enabled): self.elm_current_range.enabled = not enabled self.elm_current_autorange_minimum.enabled = enabled self.elm_current_autorange_maximum.enabled = enabled self.elm_current_range = ui.Metric(minimum=0, decimals=3, prefixes='munp', unit="A") self.elm_current_autorange_enable = ui.CheckBox( text="Enable", changed=toggle_elm_current_autorange) self.elm_current_autorange_minimum = ui.Metric(minimum=0, decimals=3, prefixes='munp', unit="A") self.elm_current_autorange_maximum = ui.Metric(minimum=0, decimals=3, prefixes='munp', unit="A") toggle_elm_filter(False) toggle_elm_current_autorange(False) self.bind("elm_filter_enable", self.elm_filter_enable, False) self.bind("elm_filter_count", self.elm_filter_count, 10) self.bind("elm_filter_type", self.elm_filter_type, "repeat") self.bind("elm_zero_correction", self.elm_zero_correction, False) self.bind("elm_integration_rate", self.elm_integration_rate, 50.0) self.bind("elm_current_range", self.elm_current_range, 20e-12, unit="A") self.bind("elm_current_autorange_enable", self.elm_current_autorange_enable, False) self.bind("elm_current_autorange_minimum", self.elm_current_autorange_minimum, 2.0E-11, unit="A") self.bind("elm_current_autorange_maximum", self.elm_current_autorange_maximum, 2.0E-2, unit="A") self.status_elm_current = ui.Text(value=NO_VALUE, readonly=True) self.bind("status_elm_current", self.status_elm_current, NO_VALUE) self.status_panel.append( ui.GroupBox(title="Electrometer Status", layout=ui.Column( ui.Row(ui.Column(ui.Label("Current"), self.status_elm_current), ui.Spacer(), stretch=(1, 2))))) self.control_tabs.append( ui.Tab( title="Electrometer", layout=ui.Row( ui.GroupBox(title="Filter", layout=ui.Column(self.elm_filter_enable, self.elm_filter_count_label, self.elm_filter_count, self.elm_filter_type_label, self.elm_filter_type, ui.Spacer())), ui.Column( ui.GroupBox(title="Range", layout=ui.Column( ui.Label(text="Current Range"), self.elm_current_range, )), ui.GroupBox(title="Auto Range", layout=ui.Column( self.elm_current_autorange_enable, ui.Label(text="Minimum Current"), self.elm_current_autorange_minimum, ui.Label(text="Maximum Current"), self.elm_current_autorange_maximum, ui.Spacer()))), ui.GroupBox(title="Options", layout=ui.Column( self.elm_zero_correction, ui.Label(text="Integration Rate"), self.elm_integration_rate, ui.Spacer())), ui.Spacer(), stretch=(1, 1, 1)))) def handler(state): if 'elm_current' in state: value = state.get('elm_current') self.status_elm_current.value = format_metric(value, "A") self.state_handlers.append(handler)
def register_vsource(self): self.hvsrc_sense_mode = ui.ComboBox(["local", "remote"]) self.hvsrc_route_terminal = ui.ComboBox(["front", "rear"]) def toggle_hvsrc_filter(enabled): self.hvsrc_filter_count.enabled = enabled self.hvsrc_filter_count_label.enabled = enabled self.hvsrc_filter_type.enabled = enabled self.hvsrc_filter_type_label.enabled = enabled self.hvsrc_filter_enable = ui.CheckBox(text="Enable", changed=toggle_hvsrc_filter) self.hvsrc_filter_count = ui.Number(minimum=0, maximum=100, decimals=0) self.hvsrc_filter_count_label = ui.Label(text="Count") self.hvsrc_filter_type = ui.ComboBox(["repeat", "moving"]) self.hvsrc_filter_type_label = ui.Label(text="Type") def toggle_hvsrc_source_voltage_autorange(enabled): self.hvsrc_source_voltage_range.enabled = not enabled self.hvsrc_source_voltage_autorange_enable = ui.CheckBox( text="Autorange", changed=toggle_hvsrc_source_voltage_autorange) self.hvsrc_source_voltage_range = ui.Number(minimum=-1100, maximum=1100, decimals=1, suffix="V") toggle_hvsrc_filter(False) toggle_hvsrc_source_voltage_autorange(False) self.bind("hvsrc_sense_mode", self.hvsrc_sense_mode, "local") self.bind("hvsrc_route_terminal", self.hvsrc_route_terminal, "rear") self.bind("hvsrc_filter_enable", self.hvsrc_filter_enable, False) self.bind("hvsrc_filter_count", self.hvsrc_filter_count, 10) self.bind("hvsrc_filter_type", self.hvsrc_filter_type, "repeat") self.bind("hvsrc_source_voltage_autorange_enable", self.hvsrc_source_voltage_autorange_enable, True) self.bind("hvsrc_source_voltage_range", self.hvsrc_source_voltage_range, 20, unit="V") self.status_hvsrc_voltage = ui.Text(value=NO_VALUE, readonly=True) self.status_hvsrc_current = ui.Text(value=NO_VALUE, readonly=True) self.status_hvsrc_output = ui.Text(value=NO_VALUE, readonly=True) self.bind("status_hvsrc_voltage", self.status_hvsrc_voltage, NO_VALUE) self.bind("status_hvsrc_current", self.status_hvsrc_current, NO_VALUE) self.bind("status_hvsrc_output", self.status_hvsrc_output, NO_VALUE) self.status_panel.append( ui.GroupBox(title="HV Source Status", layout=ui.Column( ui.Row( ui.Column(ui.Label("Voltage"), self.status_hvsrc_voltage), ui.Column(ui.Label("Current"), self.status_hvsrc_current), ui.Column(ui.Label("Output"), self.status_hvsrc_output))))) self.control_tabs.append( ui.Tab( title="HV Source", layout=ui.Row( ui.GroupBox(title="Filter", layout=ui.Column(self.hvsrc_filter_enable, self.hvsrc_filter_count_label, self.hvsrc_filter_count, self.hvsrc_filter_type_label, self.hvsrc_filter_type, ui.Spacer())), ui.GroupBox(title="Source Voltage Range", layout=ui.Column( self.hvsrc_source_voltage_autorange_enable, ui.Label(text="Range"), self.hvsrc_source_voltage_range, ui.Spacer())), ui.GroupBox(title="Options", layout=ui.Column( ui.Label(text="Sense Mode"), self.hvsrc_sense_mode, ui.Label(text="Route Terminal"), self.hvsrc_route_terminal, ui.Spacer())), stretch=(1, 1, 1)))) def handler(state): if 'hvsrc_voltage' in state: value = state.get('hvsrc_voltage') self.status_hvsrc_voltage.value = format_metric(value, "V") if 'hvsrc_current' in state: value = state.get('hvsrc_current') self.status_hvsrc_current.value = format_metric(value, "A") if 'hvsrc_output' in state: value = state.get('hvsrc_output') self.status_hvsrc_output.value = format_switch( value, default=NO_VALUE) self.state_handlers.append(handler)
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.title = "CV Ramp (V Source)" self.register_hvsource() self.register_lcr() self.register_environment() self.plot = ui.Plot(height=300, legend="right") self.plot.add_axis("x", align="bottom", text="Voltage [V] (abs)") self.plot.add_axis("y", align="right", text="Capacitance [pF]") self.plot.add_series("lcr", "x", "y", text="LCR Cp", color="blue") self.data_tabs.insert(0, ui.Tab(title="CV Curve", layout=self.plot)) self.plot2 = ui.Plot(height=300, legend="right") self.plot2.add_axis("x", align="bottom", text="Voltage [V] (abs)") self.plot2.add_axis("y", align="right", text="1/Capacitance² [1/F²]") self.plot2.axes.get("y").qt.setLabelFormat("%G") self.plot2.add_series("lcr2", "x", "y", text="LCR Cp", color="blue") self.data_tabs.insert(1, ui.Tab(title="1/C² Curve", layout=self.plot2)) self.voltage_start = ui.Number(decimals=3, suffix="V") self.voltage_stop = ui.Number(decimals=3, suffix="V") self.voltage_step = ui.Number(minimum=0, maximum=200, decimals=3, suffix="V") self.waiting_time = ui.Number(minimum=0, decimals=2, suffix="s") self.vsrc_current_compliance = ui.Number(decimals=3, suffix="uA") self.vsrc_accept_compliance = ui.CheckBox("Accept Compliance") self.lcr_frequency = ui.Number(value=1, minimum=0.020, maximum=20e3, decimals=3, suffix="kHz") self.lcr_amplitude = ui.Number(minimum=0, decimals=3, suffix="mV") self.bind("bias_voltage_start", self.voltage_start, 0, unit="V") self.bind("bias_voltage_stop", self.voltage_stop, 100, unit="V") self.bind("bias_voltage_step", self.voltage_step, 1, unit="V") self.bind("waiting_time", self.waiting_time, 1, unit="s") self.bind("vsrc_current_compliance", self.vsrc_current_compliance, 0, unit="uA") self.bind("vsrc_accept_compliance", self.vsrc_accept_compliance, False) self.bind("lcr_frequency", self.lcr_frequency, 1.0, unit="kHz") self.bind("lcr_amplitude", self.lcr_amplitude, 250, unit="mV") self.general_tab.layout = ui.Row( ui.GroupBox(title="V Source Ramp", layout=ui.Column(ui.Label(text="Start"), self.voltage_start, ui.Label(text="Stop"), self.voltage_stop, ui.Label(text="Step"), self.voltage_step, ui.Label(text="Waiting Time"), self.waiting_time, ui.Spacer())), ui.GroupBox(title="V Source", layout=ui.Column(ui.Label(text="Compliance"), self.vsrc_current_compliance, self.vsrc_accept_compliance, ui.Spacer())), ui.GroupBox(title="LCR", layout=ui.Column(ui.Label(text="AC Frequency"), self.lcr_frequency, ui.Label(text="AC Amplitude"), self.lcr_amplitude, ui.Spacer())), stretch=(1, 1, 1)) fahrad = comet.ureg('F') volt = comet.ureg('V') self.series_transform['lcr'] = lambda x, y: ((x * volt).to('V').m, (y * fahrad).to('pF').m)
def __init__(self, process, lcr_process): super().__init__() self.lcr_process = lcr_process self.lcr_process.finished = self.on_lcr_finished self.lcr_process.failed = self.on_lcr_failed self.lcr_process.reading = self.on_lcr_reading self.mount(process) self.resize(640, 480) self.title = "Table Control" self.add_x_button = KeypadButton(text="+X", clicked=self.on_add_x) self.sub_x_button = KeypadButton(text="-X", clicked=self.on_sub_x) self.add_y_button = KeypadButton(text="+Y", clicked=self.on_add_y) self.sub_y_button = KeypadButton(text="-Y", clicked=self.on_sub_y) self.add_z_button = KeypadButton(text="+Z", clicked=self.on_add_z) self.sub_z_button = KeypadButton(text="-Z", clicked=self.on_sub_z) self.step_up_button = KeypadButton( text="↑⇵", tool_tip= "Step up, move single step up then double step down and double step up (experimental).", clicked=self.on_step_up) self.control_buttons = (self.add_x_button, self.sub_x_button, self.add_y_button, self.sub_y_button, self.add_z_button, self.sub_z_button, self.step_up_button) self._lcr_prim_text = ui.Text(readonly=True) self._lcr_sec_text = ui.Text(readonly=True) self._lcr_chart = LCRChart() self._lcr_groupbox = ui.GroupBox( title="Contact Quality (LCR)", checkable=True, checked=False, toggled=self.on_lcr_toggled, layout=ui.Column(ui.Row(ui.Label("Cp"), self._lcr_prim_text), ui.Row(ui.Label("Rp"), self._lcr_sec_text), self._lcr_chart)) self.probecard_light_button = ToggleButton( text="PC Light", tool_tip="Toggle probe card light", checkable=True, checked=False, enabled=False, toggled=self.on_probecard_light_clicked) self.microscope_light_button = ToggleButton( text="Mic Light", tool_tip="Toggle microscope light", checkable=True, checked=False, enabled=False, toggled=self.on_microscope_light_clicked) self.box_light_button = ToggleButton(text="Box Light", tool_tip="Toggle box light", checkable=True, checked=False, enabled=False, toggled=self.on_box_light_clicked) # Create movement radio buttons self.step_width_buttons = ui.Column() for item in self.load_table_step_sizes(): step_size = item.get('step_size') * comet.ureg('um') step_color = item.get('step_color') step_size_label = format_metric(step_size.to('m').m, 'm', decimals=1) button = ui.RadioButton( text=step_size_label, tool_tip=f"Move in {step_size_label} steps.", stylesheet=f"QRadioButton:enabled{{color:{step_color};}}", checked=len(self.step_width_buttons) == 0, toggled=self.on_step_toggled) button.movement_width = step_size.to('mm').m button.movement_color = step_color self.step_width_buttons.append(button) self.control_layout = ui.Column(ui.Row(ui.Row( ui.Column(KeypadSpacer(), self.sub_y_button, KeypadSpacer()), ui.Column( self.sub_x_button, KeypadSpacer(), self.add_x_button, ), ui.Column( KeypadSpacer(), self.add_y_button, KeypadSpacer(), ), KeypadSpacer(), ui.Column(ui.Row(self.add_z_button, self.step_up_button), KeypadSpacer(), self.sub_z_button)), ui.Spacer(), stretch=(0, 1)), ui.Spacer(), stretch=(0, 1)) self.positions_widget = TablePositionsWidget( enabled=False, position_picked=self.on_position_picked, absolute_move=self.on_absolute_move) self.contacts_widget = TableContactsWidget( enabled=False, position_picked=self.on_position_picked, absolute_move=self.on_absolute_move) self._position_widget = PositionWidget() self._calibration_widget = CalibrationWidget() self.z_limit_label = PositionLabel() self.x_hard_limit_label = PositionLabel() self.y_hard_limit_label = PositionLabel() self.z_hard_limit_label = PositionLabel() self.laser_label = SwitchLabel() self._calibrate_button = ui.Button(text="Calibrate", clicked=self.on_calibrate) self._update_interval_number = ui.Number( value=settings.table_control_update_interval, minimum=.5, maximum=10.0, decimals=2, step=0.25, suffix="s", changed=self.on_update_interval_changed) self._interval_groupbox = ui.GroupBox(title="Update Interval", layout=ui.Row( self._update_interval_number, ui.Spacer(), stretch=(0, 1))) self._dodge_height_number = ui.Number( tool_tip="Doge height in microns.", minimum=0, maximum=10000, decimals=0, step=1, suffix="um") self._dodge_groupbox = ui.GroupBox( title="X/Y Dodge", tool_tip="Enables -/+ Z dodge for XY movements.", checkable=True, layout=ui.Row(ui.Label("Height"), self._dodge_height_number, ui.Spacer(), stretch=(0, 0, 1))) self._lcr_reset_on_move_checkbox = ui.CheckBox( text="Reset graph on X/Y move") self._contact_quality_groupbox = ui.GroupBox( title="Contact Quality (LCR)", layout=ui.Row(self._lcr_reset_on_move_checkbox, ui.Spacer(), stretch=(0, 1))) self._step_up_delay_number = ui.Number(minimum=0, maximum=1000, decimals=0, step=25, suffix="ms") self._step_up_multiply_number = ui.Number(minimum=1, maximum=10, decimals=0, suffix="x") self._step_up_groubox = ui.GroupBox( title="Step Up (↑⇵)", layout=ui.Row( ui.Column(ui.Label("Delay"), ui.Label("Multiplicator (⇵)")), ui.Column(self._step_up_delay_number, self._step_up_multiply_number), ui.Spacer())) self._lcr_update_interval_number = ui.Number(minimum=0, maximum=1000, decimals=0, step=25, suffix="ms") self._lcr_matrix_channels_text = ui.Text() self._lcr_options_groupbox = ui.GroupBox( title="Contact Quality (LCR)", layout=ui.Row( ui.Column( ui.Label("Reading Interval"), ui.Label("Matrix Channels"), ), ui.Column( ui.Row(self._lcr_update_interval_number, ui.Spacer()), self._lcr_matrix_channels_text))) self.progress_bar = ui.ProgressBar(visible=False) self.message_label = ui.Label() self.stop_button = ui.Button(text="&Stop", default=False, auto_default=False, enabled=False, clicked=self.on_stop) self.close_button = ui.Button(text="&Close", default=False, auto_default=False, clicked=self.on_close) self.layout = ui.Column( ui.Row( ui.Column( ui.Row( ui.GroupBox( title="Control", layout=ui.Column( ui.Spacer(horizontal=False), self.control_layout, ui.Spacer(horizontal=False) ) ), ui.GroupBox( title="Step Width", layout=self.step_width_buttons ), self._lcr_groupbox, ui.Column( ui.GroupBox( title="Lights", layout=ui.Column( self.probecard_light_button, self.microscope_light_button, self.box_light_button, ui.Spacer() ) ) ), stretch=(0, 0, 1, 0) ), ui.Tabs( ui.Tab( title="Move", layout=self.positions_widget ), ui.Tab( title="Contacts", layout=self.contacts_widget ), ui.Tab( title="Calibrate", layout=ui.Column( ui.GroupBox( title="Table Calibration", layout=ui.Column( ui.Row( self._calibrate_button, ui.Label("Calibrate table by moving into cal/rm switches\nof every axis in" \ " a safe manner to protect the probe card."), stretch=(0, 1) ) ) ), ui.Spacer(), stretch=(0, 1) ) ), ui.Tab( title="Options", layout=ui.Column( ui.Row( self._interval_groupbox, self._dodge_groupbox, self._contact_quality_groupbox, stretch=(0, 0, 1) ), self._step_up_groubox, self._lcr_options_groupbox, ui.Spacer(), stretch=(0, 0, 0, 1) ) ) ), stretch=(0, 1) ), ui.Column( self._position_widget, self._calibration_widget, ui.GroupBox( title="Soft Limits", layout=ui.Row( ui.Column( ui.Label("Z") ), ui.Column( self.z_limit_label ) ) ), ui.GroupBox( title="Hard Limits", layout=ui.Row( ui.Column( ui.Label("X"), ui.Label("Y"), ui.Label("Z") ), ui.Column( self.x_hard_limit_label, self.y_hard_limit_label, self.z_hard_limit_label ) ) ), ui.GroupBox( title="Safety", layout=ui.Row( ui.Label( text="Laser Sensor" ), self.laser_label ) ), ui.Spacer() ), stretch=(1, 0) ), ui.Row( self.progress_bar, self.message_label, ui.Spacer(), self.stop_button, self.close_button ), stretch=(1, 0) ) self.close_event = self.on_close_event self.reset_position() self.reset_caldone() self.update_limits() self.reset_safety() self.update_control_buttons()