def __init__(self, tuning_parameter_collection, modulator_proxy, generators,
                 height_adapter, sampling_rate, advanced = False):
        QtGui.QMainWindow.__init__(self)
        Logging.__init__(self)

        self.tuning_collection = tuning_parameter_collection  # The collection of all stored tuning parameters
        # self.tuning_parameters = tuning_parameter_collection.tuning_parameters[0]  # The current tuning parameters
        self.modulator_proxy = modulator_proxy
        self.generators = generators
        self.generator = None
        self.height_adapter = height_adapter
        self.sampling_rate = sampling_rate
        self.test_height = 0.0
        self.calibrate_test_mode = self.CALIBRATE_MODE
        self.laser_enabled = True
        self.setupUi(self)

        # NOTE: Have to manually add button group because pyside-uic fails to compile them
        self.modulation_buttonGroup = QtGui.QButtonGroup(self)
        self.modulation_buttonGroup.setExclusive(True)
        self.modulation_buttonGroup.addButton(self.modulation_radioButton_AM, self.MODULATION_ID_BY_TYPE[ModulationTypes.AM])
        self.modulation_buttonGroup.addButton(self.modulation_radioButton_DC, self.MODULATION_ID_BY_TYPE[ModulationTypes.DC])
        self.laser_power_buttonGroup = QtGui.QButtonGroup(self)
        self.laser_power_buttonGroup.setExclusive(True)
        self.laser_power_buttonGroup.addButton(self.laser_power_radioButton_On, self.LASER_POWER_ON_ID)
        self.laser_power_buttonGroup.addButton(self.laser_power_radioButton_Off, self.LASER_POWER_OFF_ID)

        self.generator_list_model = QtGui.QStringListModel()
        self.generator_list_model.setStringList(sorted(self.generators.keys()))
        self.calibrations_list_model = TuningParameterListModel(self.tuning_collection)
        # Set model now so selection model will be ready for signal creation
        self.calibrations_listview.setModel(self.calibrations_list_model)
        
        self.test_height_edit.setText(str(self.test_height))
        self.calibrate_test_tab_widget.setCurrentWidget(self.calibrate_test_tab_widget.widget(self.calibrate_test_mode))
        self.update_build_parameters()
        index = self.calibrations_list_model.index(0)
        self.calibrations_listview.setCurrentIndex(index)
        
        # Wait until after connecting signals to connect this model so that signals fire
        self.pattern_combobox.setModel(self.generator_list_model)
        self.pattern_combobox.setCurrentIndex(0)
        self.modulation_radioButton_AM.setChecked(True)
        self.laser_power_radioButton_On.setChecked(True)

        self._add_tuning_parameters(0.0)
        self.set_initial_generator()
        self.connect_ui_elements()

        if (not advanced):
            self.hide_advanced_ui()
 def __init__(self, tuning_parameter_collection):
     QtCore.QAbstractListModel.__init__(self)
     Logging.__init__(self)
     self._collection = tuning_parameter_collection