def create_widget_layout(self): layout = QtGui.QGridLayout() self.frequency_table = saved_frequencies_table(self.reactor, suffix = ' MHz', sig_figs = 4) self.entry_table = table_dropdowns_with_entry(self.reactor, limits = c.frequency_limit, suffix = ' MHz', sig_figs = 4, favorites = self.favorites) self.entry_button = QtGui.QPushButton("Submit") self.copy_clipboard_button = QtGui.QPushButton("Copy Info to Clipboard") self.remove_B_button = QtGui.QPushButton("Remove B") self.remove_line_center_button = QtGui.QPushButton("Remove Line Center") self.remove_B_count = QtGui.QSpinBox() self.remove_B_count.setRange(-20,20) self.remove_line_center_count = QtGui.QSpinBox() self.remove_line_center_count.setRange(-20,20) self.track_B_duration = QtGui.QSpinBox() self.track_B_duration.setKeyboardTracking(False) self.track_B_duration.setSuffix('min') self.track_B_duration.setRange(1, 1000) self.track_line_center_duration = QtGui.QSpinBox() self.track_line_center_duration.setKeyboardTracking(False) self.track_line_center_duration.setSuffix('min') self.track_line_center_duration.setRange(1, 1000) layout.addWidget(self.frequency_table, 0, 0, 1, 1) layout.addWidget(self.entry_table, 0, 1 , 1 , 1) layout.addWidget(self.entry_button, 1, 1, 1, 1) layout.addWidget(self.copy_clipboard_button, 1, 0, 1, 1) remove_B_layout = QtGui.QHBoxLayout() remove_B_layout.addWidget(self.remove_B_count) remove_B_layout.addWidget(self.remove_B_button) remove_line_center_layout = QtGui.QHBoxLayout() remove_line_center_layout.addWidget(self.remove_line_center_count) remove_line_center_layout.addWidget(self.remove_line_center_button) update_layout = QtGui.QHBoxLayout() keep_B_layout = QtGui.QHBoxLayout() keep_B_layout.addWidget(QtGui.QLabel("Tracking Duration (B)")) keep_B_layout.addWidget(self.track_B_duration) keep_line_center_layout = QtGui.QHBoxLayout() keep_line_center_layout.addWidget(QtGui.QLabel("Tracking Duration (Line Center)")) keep_line_center_layout.addWidget(self.track_line_center_duration) layout.addLayout(update_layout, 2, 1, 1, 1) layout.addLayout(remove_B_layout, 2, 0, 1, 1) layout.addLayout(remove_line_center_layout, 3, 0, 1, 1) layout.addLayout(keep_B_layout, 2, 1, 1, 1) layout.addLayout(keep_line_center_layout, 3, 1, 1, 1) return layout
def create_widget_layout(self): layout = QtGui.QGridLayout() self.frequency_table = saved_frequencies_table(self.reactor, suffix = ' MHz', sig_figs = 4) self.entry_table = table_dropdowns_with_entry(self.reactor, limits = c.frequency_limit, suffix = ' MHz', sig_figs = 4, favorites = self.favorites, initial_selection = self.initial_selection, initial_values = self.initial_values) self.Bfield_entry = QtGui.QDoubleSpinBox() self.Bfield_entry.setRange(0.0, 10000.0) self.Bfield_entry.setDecimals(6) self.Bfield_entry.setSuffix(' mGauss') self.linecenter_entry = QtGui.QDoubleSpinBox() self.linecenter_entry.setRange(-50000.0, 0.0) self.linecenter_entry.setDecimals(6) self.linecenter_entry.setSuffix(' kHz') self.entry_Bfield_and_center_button = QtGui.QPushButton("Submit B and Line Center") self.entry_button = QtGui.QPushButton("Submit Lines") self.copy_clipboard_button = QtGui.QPushButton("Copy Info to Clipboard") self.remove_all_B_and_lines_button = QtGui.QPushButton("Remove all B and Line Centers") #self.remove_all_B_and_lines_button.setDisabled(True) # not programmed yet self.remove_B_button = QtGui.QPushButton("Remove B") self.remove_line_center_button = QtGui.QPushButton("Remove Line Center") self.remove_B_count = QtGui.QSpinBox() self.remove_B_count.setRange(-20,20) self.remove_line_center_count = QtGui.QSpinBox() self.remove_line_center_count.setRange(-20,20) self.track_B_duration = QtGui.QSpinBox() self.track_B_duration.setKeyboardTracking(False) self.track_B_duration.setSuffix('min') self.track_B_duration.setRange(1, 1000) self.track_line_center_duration = QtGui.QSpinBox() self.track_line_center_duration.setKeyboardTracking(False) self.track_line_center_duration.setSuffix('min') self.track_line_center_duration.setRange(1, 1000) layout.addWidget(self.frequency_table, 0, 0, 6, 1) layout.addWidget(self.entry_table, 0, 1, 2, 1) layout.addWidget(self.entry_button, 2, 1, 1, 1) layout.addWidget(self.Bfield_entry, 3, 1, 1, 1) layout.addWidget(self.linecenter_entry, 4, 1, 1, 1) layout.addWidget(self.entry_Bfield_and_center_button, 5, 1, 1, 1) hlp_layout = QtGui.QHBoxLayout() hlp_layout.addWidget(self.copy_clipboard_button) hlp_layout.addWidget(self.remove_all_B_and_lines_button) remove_B_layout = QtGui.QHBoxLayout() remove_B_layout.addWidget(self.remove_B_count) remove_B_layout.addWidget(self.remove_B_button) remove_line_center_layout = QtGui.QHBoxLayout() remove_line_center_layout.addWidget(self.remove_line_center_count) remove_line_center_layout.addWidget(self.remove_line_center_button) keep_B_layout = QtGui.QHBoxLayout() keep_B_layout.addWidget(QtGui.QLabel("Tracking Duration (B)")) keep_B_layout.addWidget(self.track_B_duration) keep_line_center_layout = QtGui.QHBoxLayout() keep_line_center_layout.addWidget(QtGui.QLabel("Tracking Duration (Line Center)")) keep_line_center_layout.addWidget(self.track_line_center_duration) layout.addLayout(hlp_layout, 6, 0, 1, 1) layout.addLayout(remove_B_layout, 7, 0, 1, 1) layout.addLayout(remove_line_center_layout, 8, 0, 1, 1) layout.addLayout(keep_B_layout, 7, 1, 1, 1) layout.addLayout(keep_line_center_layout, 8, 1, 1, 1) return layout
def create_widget_layout(self): layout = QtGui.QGridLayout() self.frequency_table = saved_frequencies_table(self.reactor, suffix=' MHz', sig_figs=4) self.entry_table = table_dropdowns_with_entry( self.reactor, limits=c.frequency_limit, suffix=' MHz', sig_figs=4, favorites=self.favorites, initial_selection=self.initial_selection, initial_values=self.initial_values) self.last_B = 0.0 self.Bfield_entry = QtGui.QDoubleSpinBox() self.Bfield_entry.setRange(0.0, 10000.0) self.Bfield_entry.setDecimals(6) self.Bfield_entry.setSuffix(' mGauss') self.Bfield_entry.setValue(self.last_B) self.last_center = 0.0 self.linecenter_entry = QtGui.QDoubleSpinBox() self.linecenter_entry.setRange(-50000.0, 0.0) self.linecenter_entry.setDecimals(6) self.linecenter_entry.setSuffix(' kHz') self.linecenter_entry.setValue(self.last_center) self.entry_Bfield_and_center_button = QtGui.QPushButton("Submit All") self.entry_Bfield_button = QtGui.QPushButton("Submit B") self.entry_center_button = QtGui.QPushButton("Submit Center") entry_B_center = QtGui.QHBoxLayout() entry_B_center.addWidget(self.entry_Bfield_button) entry_B_center.addWidget(self.entry_center_button) entry_B_center.addWidget(self.entry_Bfield_and_center_button) self.entry_button = QtGui.QPushButton("Submit Lines") self.entry_line1_button = QtGui.QPushButton("Submit Line One") self.entry_line2_button = QtGui.QPushButton("Submit Line Two") entry_lines = QtGui.QHBoxLayout() entry_lines.addWidget(self.entry_line1_button) entry_lines.addWidget(self.entry_line2_button) entry_lines.addWidget(self.entry_button) self.copy_clipboard_button = QtGui.QPushButton( "Copy Info to Clipboard") self.remove_all_B_and_lines_button = QtGui.QPushButton( "Remove all B and Line Centers") #self.remove_all_B_and_lines_button.setDisabled(True) # not programmed yet self.remove_B_button = QtGui.QPushButton("Remove B") self.remove_line_center_button = QtGui.QPushButton( "Remove Line Center") self.remove_B_count = QtGui.QSpinBox() self.remove_B_count.setRange(-20, 20) self.remove_line_center_count = QtGui.QSpinBox() self.remove_line_center_count.setRange(-20, 20) self.bool_keep_last_button = TextChangingButton() self.track_B_duration = QtGui.QSpinBox() self.track_B_duration.setKeyboardTracking(False) self.track_B_duration.setSuffix('min') self.track_B_duration.setRange(1, 1000) self.track_line_center_duration = QtGui.QSpinBox() self.track_line_center_duration.setKeyboardTracking(False) self.track_line_center_duration.setSuffix('min') self.track_line_center_duration.setRange(1, 1000) self.track_global_line_center_duration = QtGui.QSpinBox() self.track_global_line_center_duration.setKeyboardTracking(False) self.track_global_line_center_duration.setSuffix('min') self.track_global_line_center_duration.setRange(1, 1000) self.global_checkbox = TextChangingButton() self.client_checkbox = dict.fromkeys(client_list) for client in client_list: self.client_checkbox[client] = QtGui.QCheckBox(client) self.current_line_center = QtGui.QLineEdit(readOnly=True) self.current_line_center.setAlignment(QtCore.Qt.AlignHCenter) self.current_B = QtGui.QLineEdit(readOnly=True) self.current_B.setAlignment(QtCore.Qt.AlignHCenter) self.current_time = QtGui.QLineEdit(readOnly=True) self.current_time.setAlignment(QtCore.Qt.AlignHCenter) layout.addWidget(self.frequency_table, 0, 0, 6, 1) layout.addWidget(self.entry_table, 0, 1, 2, 1) layout.addLayout(entry_lines, 2, 1, 1, 1) layout.addWidget(self.Bfield_entry, 3, 1, 1, 1) layout.addWidget(self.linecenter_entry, 4, 1, 1, 1) layout.addLayout(entry_B_center, 5, 1, 1, 1) hlp_layout = QtGui.QHBoxLayout() hlp_layout.addWidget(self.copy_clipboard_button) hlp_layout.addWidget(self.remove_all_B_and_lines_button) remove_B_layout = QtGui.QHBoxLayout() remove_B_layout.addWidget(self.remove_B_count) remove_B_layout.addWidget(self.remove_B_button) remove_line_center_layout = QtGui.QHBoxLayout() remove_line_center_layout.addWidget(self.remove_line_center_count) remove_line_center_layout.addWidget(self.remove_line_center_button) keep_local_B_layout = QtGui.QHBoxLayout() keep_local_B_layout.addWidget( QtGui.QLabel("Tracking Duration (Local B)")) keep_local_B_layout.addWidget(self.track_B_duration) keep_local_line_center_layout = QtGui.QHBoxLayout() keep_local_line_center_layout.addWidget( QtGui.QLabel("Tracking Duration (Local Line Center)")) keep_local_line_center_layout.addWidget( self.track_line_center_duration) keep_global_line_center_layout = QtGui.QHBoxLayout() keep_global_line_center_layout.addWidget( QtGui.QLabel("Tracking Duration (Global Line Center)")) keep_global_line_center_layout.addWidget( self.track_global_line_center_duration) global_line_center = QtGui.QHBoxLayout() global_line_center.addWidget(QtGui.QLabel("Global Line Center")) global_line_center.addWidget(self.global_checkbox) client_checkbox_layout = QtGui.QHBoxLayout() for client in client_list: client_checkbox_layout.addWidget(self.client_checkbox[client]) keep_last_point = QtGui.QHBoxLayout() keep_last_point.addWidget(QtGui.QLabel("Keep Last Point")) keep_last_point.addWidget(self.bool_keep_last_button) line_center_show = QtGui.QHBoxLayout() line_center_show.addWidget(QtGui.QLabel("Current Line Center: ")) line_center_show.addWidget(self.current_line_center) B_field_show = QtGui.QHBoxLayout() B_field_show.addWidget(QtGui.QLabel("Current B Field: ")) B_field_show.addWidget(self.current_B) time_show = QtGui.QHBoxLayout() time_show.addWidget(QtGui.QLabel("Current Time: ")) time_show.addWidget(self.current_time) layout.addLayout(hlp_layout, 6, 0, 1, 1) layout.addLayout(keep_last_point, 6, 1, 1, 1) layout.addLayout(remove_B_layout, 7, 0, 1, 1) layout.addLayout(global_line_center, 7, 1, 1, 1) layout.addLayout(client_checkbox_layout, 8, 1, 1, 1) layout.addLayout(remove_line_center_layout, 8, 0, 1, 1) layout.addLayout(keep_global_line_center_layout, 9, 1, 1, 1) layout.addLayout(line_center_show, 9, 0, 1, 1) layout.addLayout(keep_local_line_center_layout, 10, 1, 1, 1) layout.addLayout(B_field_show, 10, 0, 1, 1) layout.addLayout(keep_local_B_layout, 11, 1, 1, 1) layout.addLayout(time_show, 11, 0, 1, 1) return layout
def create_widget_layout(self): layout = QtGui.QGridLayout() self.frequency_table = saved_frequencies_table(self.reactor, suffix = ' MHz', sig_figs = 4) self.entry_table = table_dropdowns_with_entry(self.reactor, limits = c.frequency_limit, suffix = ' MHz', sig_figs = 4, favorites = self.favorites, initial_selection = self.initial_selection, initial_values = self.initial_values) self.last_B = 0.0 self.Bfield_entry = QtGui.QDoubleSpinBox() self.Bfield_entry.setRange(0.0, 10000.0) self.Bfield_entry.setDecimals(6) self.Bfield_entry.setSuffix(' mGauss') self.Bfield_entry.setValue(self.last_B) self.last_center = 0.0 self.linecenter_entry = QtGui.QDoubleSpinBox() self.linecenter_entry.setRange(-50000.0, 0.0) self.linecenter_entry.setDecimals(6) self.linecenter_entry.setSuffix(' kHz') self.linecenter_entry.setValue(self.last_center) self.entry_Bfield_and_center_button = QtGui.QPushButton("Submit All") self.entry_Bfield_button = QtGui.QPushButton("Submit B") self.entry_center_button = QtGui.QPushButton("Submit Center") entry_B_center = QtGui.QHBoxLayout() entry_B_center.addWidget(self.entry_Bfield_button) entry_B_center.addWidget(self.entry_center_button) entry_B_center.addWidget(self.entry_Bfield_and_center_button) self.entry_button = QtGui.QPushButton("Submit Lines") self.entry_line1_button = QtGui.QPushButton("Submit Line One") self.entry_line2_button = QtGui.QPushButton("Submit Line Two") entry_lines = QtGui.QHBoxLayout() entry_lines.addWidget(self.entry_line1_button) entry_lines.addWidget(self.entry_line2_button) entry_lines.addWidget(self.entry_button) self.copy_clipboard_button = QtGui.QPushButton("Copy Info to Clipboard") self.remove_all_B_and_lines_button = QtGui.QPushButton("Remove all B and Line Centers") #self.remove_all_B_and_lines_button.setDisabled(True) # not programmed yet self.remove_B_button = QtGui.QPushButton("Remove B") self.remove_line_center_button = QtGui.QPushButton("Remove Line Center") self.remove_B_count = QtGui.QSpinBox() self.remove_B_count.setRange(-20,20) self.remove_line_center_count = QtGui.QSpinBox() self.remove_line_center_count.setRange(-20,20) self.bool_keep_last_button = TextChangingButton() self.track_B_duration = QtGui.QSpinBox() self.track_B_duration.setKeyboardTracking(False) self.track_B_duration.setSuffix('min') self.track_B_duration.setRange(1, 1000) self.track_line_center_duration = QtGui.QSpinBox() self.track_line_center_duration.setKeyboardTracking(False) self.track_line_center_duration.setSuffix('min') self.track_line_center_duration.setRange(1, 1000) self.track_global_line_center_duration = QtGui.QSpinBox() self.track_global_line_center_duration.setKeyboardTracking(False) self.track_global_line_center_duration.setSuffix('min') self.track_global_line_center_duration.setRange(1, 1000) self.global_checkbox = TextChangingButton() self.client_checkbox = dict.fromkeys(client_list) for client in client_list: self.client_checkbox[client] = QtGui.QCheckBox(client) self.current_line_center = QtGui.QLineEdit(readOnly = True) self.current_line_center.setAlignment(QtCore.Qt.AlignHCenter) self.current_B = QtGui.QLineEdit(readOnly = True) self.current_B.setAlignment(QtCore.Qt.AlignHCenter) self.current_time = QtGui.QLineEdit(readOnly = True) self.current_time.setAlignment(QtCore.Qt.AlignHCenter) layout.addWidget(self.frequency_table, 0, 0, 6, 1) layout.addWidget(self.entry_table, 0, 1, 2, 1) layout.addLayout(entry_lines, 2, 1, 1, 1) layout.addWidget(self.Bfield_entry, 3, 1, 1, 1) layout.addWidget(self.linecenter_entry, 4, 1, 1, 1) layout.addLayout(entry_B_center, 5, 1, 1, 1) hlp_layout = QtGui.QHBoxLayout() hlp_layout.addWidget(self.copy_clipboard_button) hlp_layout.addWidget(self.remove_all_B_and_lines_button) remove_B_layout = QtGui.QHBoxLayout() remove_B_layout.addWidget(self.remove_B_count) remove_B_layout.addWidget(self.remove_B_button) remove_line_center_layout = QtGui.QHBoxLayout() remove_line_center_layout.addWidget(self.remove_line_center_count) remove_line_center_layout.addWidget(self.remove_line_center_button) keep_local_B_layout = QtGui.QHBoxLayout() keep_local_B_layout.addWidget(QtGui.QLabel("Tracking Duration (Local B)")) keep_local_B_layout.addWidget(self.track_B_duration) keep_local_line_center_layout = QtGui.QHBoxLayout() keep_local_line_center_layout.addWidget(QtGui.QLabel("Tracking Duration (Local Line Center)")) keep_local_line_center_layout.addWidget(self.track_line_center_duration) keep_global_line_center_layout = QtGui.QHBoxLayout() keep_global_line_center_layout.addWidget(QtGui.QLabel("Tracking Duration (Global Line Center)")) keep_global_line_center_layout.addWidget(self.track_global_line_center_duration) global_line_center = QtGui.QHBoxLayout() global_line_center.addWidget(QtGui.QLabel("Global Line Center")) global_line_center.addWidget(self.global_checkbox) client_checkbox_layout = QtGui.QHBoxLayout() for client in client_list: client_checkbox_layout.addWidget(self.client_checkbox[client]) keep_last_point = QtGui.QHBoxLayout() keep_last_point.addWidget(QtGui.QLabel("Keep Last Point")) keep_last_point.addWidget(self.bool_keep_last_button) line_center_show = QtGui.QHBoxLayout() line_center_show.addWidget(QtGui.QLabel("Current Line Center: ")) line_center_show.addWidget(self.current_line_center) B_field_show = QtGui.QHBoxLayout() B_field_show.addWidget(QtGui.QLabel("Current B Field: ")) B_field_show.addWidget(self.current_B) time_show = QtGui.QHBoxLayout() time_show.addWidget(QtGui.QLabel("Current Time: ")) time_show.addWidget(self.current_time) layout.addLayout(hlp_layout, 6, 0, 1, 1) layout.addLayout(keep_last_point, 6, 1, 1, 1) layout.addLayout(remove_B_layout, 7, 0, 1, 1) layout.addLayout(global_line_center, 7, 1, 1, 1) layout.addLayout(client_checkbox_layout, 8, 1, 1, 1) layout.addLayout(remove_line_center_layout, 8, 0, 1, 1) layout.addLayout(keep_global_line_center_layout, 9, 1, 1, 1) layout.addLayout(line_center_show, 9, 0, 1, 1) layout.addLayout(keep_local_line_center_layout, 10, 1, 1, 1) layout.addLayout(B_field_show, 10, 0, 1, 1) layout.addLayout(keep_local_B_layout, 11, 1, 1, 1) layout.addLayout(time_show, 11, 0, 1, 1) return layout