Ejemplo n.º 1
0
 def on_update_instrument(self, instrument):
     self.instrument = instrument
     component_list = get_detector_strings_for_gui(self.instrument)
     self.set_component_options(component_list)
     if len(component_list) < 2:
         self.hab_pos_1_line_edit.setEnabled(False)
         self.hab_pos_2_line_edit.setEnabled(False)
         self.update_hab_check_box.setEnabled(False)
     else:
         self.hab_pos_1_line_edit.setEnabled(True)
         self.hab_pos_2_line_edit.setEnabled(True)
         self.update_hab_check_box.setEnabled(True)
Ejemplo n.º 2
0
    def component(self, value):
        # There are two types of values that can be passed:
        # String: we look for string and we set it
        # Convert the value to the correct GUI string

        # Set the correct selection of reduction modes which are available
        component_list = get_detector_strings_for_gui(self.instrument)
        self.set_component_options(component_list)

        component_as_string = get_string_for_gui_from_reduction_mode(value, self.instrument)
        if component_as_string:
            index = self.reduction_mode_combo_box.findText(component_as_string)
            if index != -1:
                self.component_combo_box.setCurrentIndex(index)
Ejemplo n.º 3
0
    def component(self, value):
        # There are two types of values that can be passed:
        # String: we look for string and we set it
        # Convert the value to the correct GUI string

        # Set the correct selection of reduction modes which are available
        component_list = get_detector_strings_for_gui(self.instrument)
        self.set_component_options(component_list)

        component_as_string = get_string_for_gui_from_reduction_mode(value, self.instrument)
        if component_as_string:
            index = self.reduction_mode_combo_box.findText(component_as_string)
            if index != -1:
                self.component_combo_box.setCurrentIndex(index)
Ejemplo n.º 4
0
 def on_update_instrument(self, instrument):
     self.instrument = instrument
     component_list = get_detector_strings_for_gui(self.instrument)
     self.set_component_options(component_list)
     self.lab_centre_label.setText('Centre Position {}'.format(component_list[0]))
     self.update_lab_check_box.setText('Update {}'.format(component_list[0]))
     if len(component_list) < 2:
         self.hab_pos_1_line_edit.setEnabled(False)
         self.hab_pos_2_line_edit.setEnabled(False)
         self.update_hab_check_box.setEnabled(False)
         self.hab_centre_label.setText('Centre Position HAB')
         self.update_hab_check_box.setText('Update HAB')
     else:
         self.hab_pos_1_line_edit.setEnabled(True)
         self.hab_pos_2_line_edit.setEnabled(True)
         self.update_hab_check_box.setEnabled(True)
         self.hab_centre_label.setText('Centre Position {}'.format(component_list[1]))
         self.update_hab_check_box.setText('Update {}'.format(component_list[1]))
Ejemplo n.º 5
0
 def on_update_instrument(self, instrument):
     self.instrument = instrument
     component_list = get_detector_strings_for_gui(self.instrument)
     self.set_component_options(component_list)
     self.lab_centre_label.setText('Centre Position {}'.format(component_list[0]))
     self.update_lab_check_box.setText('Update {}'.format(component_list[0]))
     if len(component_list) < 2:
         self.hab_pos_1_line_edit.setEnabled(False)
         self.hab_pos_2_line_edit.setEnabled(False)
         self.update_hab_check_box.setEnabled(False)
         self.hab_centre_label.setText('Centre Position HAB')
         self.update_hab_check_box.setText('Update HAB')
     else:
         self.hab_pos_1_line_edit.setEnabled(True)
         self.hab_pos_2_line_edit.setEnabled(True)
         self.update_hab_check_box.setEnabled(True)
         self.hab_centre_label.setText('Centre Position {}'.format(component_list[1]))
         self.update_hab_check_box.setText('Update {}'.format(component_list[1]))