def _on_combo_changed(self, combo, index): """ Retrieve RAMSTKCombo() changes and assign to Integrated Circuit attribute. This method is called by: * gtk.Combo() 'changed' signal :param combo: the RAMSTKCombo() that called this method. :type combo: :class:`ramstk.gui.gtk.ramstk.RAMSTKCombo` :param int index: the position in the signal handler list associated with the calling RAMSTKComboBox(). Indices are: +-------+------------------+-------+------------------+ | Index | Widget | Index | Widget | +=======+==================+=======+==================+ | 1 | cmbApplication | 5 | cmbPackage | +-------+------------------+-------+------------------+ | 2 | cmbConstruction | 6 | cmbTechnology | +-------+------------------+-------+------------------+ | 3 | cmbECC | 7 | cmbType | +-------+------------------+-------+------------------+ | 4 | cmbManufacturing | | | +-------+------------------+-------+------------------+ :return: False if successful or True if an error is encountered. :rtype: bool """ _return = False combo.handler_block(self._lst_handler_id[index]) _attributes = AssessmentInputs.on_combo_changed(self, combo, index) if _attributes: if index == 1: _attributes['application_id'] = int(combo.get_active()) elif index == 2: _attributes['construction_id'] = int(combo.get_active()) elif index == 3: _attributes['type_id'] = int(combo.get_active()) elif index == 4: _attributes['manufacturing_id'] = int(combo.get_active()) elif index == 5: _attributes['package_id'] = int(combo.get_active()) elif index == 6: _attributes['technology_id'] = int(combo.get_active()) elif index == 7: _attributes['type_id'] = int(combo.get_active()) self._dtc_data_controller.request_set_attributes( self._hardware_id, _attributes) combo.handler_unblock(self._lst_handler_id[index]) return _return
def _on_combo_changed(self, combo, index): """ Retrieve RAMSTKCombo() changes and assign to Inductor attribute. This method is called by: * gtk.Combo() 'changed' signal :param combo: the RAMSTKCombo() that called this method. :type combo: :class:`ramstk.gui.gtk.ramstk.RAMSTKCombo` :param int index: the position in the signal handler list associated with the calling RAMSTKComboBox(). Indices are: +---------+------------------+---------+------------------+ | Index | Widget | Index | Widget | +=========+==================+=========+==================+ | 1 | cmbSpecification | 3 | cmbFamily | +---------+------------------+---------+------------------+ | 2 | cmbInsulation | 4 | cmbConstruction | +---------+------------------+---------+------------------+ :return: False if successful or True if an error is encountered. :rtype: bool """ _return = False combo.handler_block(self._lst_handler_id[index]) _attributes = AssessmentInputs.on_combo_changed(self, combo, index) if _attributes: if index == 1: _attributes['specification_id'] = int(combo.get_active()) elif index == 2: _attributes['insulation_id'] = int(combo.get_active()) elif index == 3: _attributes['family_id'] = int(combo.get_active()) elif index == 4: _attributes['construction_id'] = int(combo.get_active()) self._dtc_data_controller.request_set_attributes( self._hardware_id, _attributes) combo.handler_unblock(self._lst_handler_id[index]) return _return
def _on_combo_changed(self, combo, index): """ Retrieve RAMSTKCombo() changes and assign to Capacitor attribute. This method is called by: * gtk.Combo() 'changed' signal :param combo: the RAMSTKCombo() that called this method. :type combo: :class:`ramstk.gui.gtk.ramstk.RAMSTKCombo` :param int index: the position in the signal handler list associated with the calling RAMSTKComboBox(). Indices are: +---------+------------------+---------+------------------+ | Index | Widget | Index | Widget | +=========+==================+=========+==================+ | 1 | cmbSpecification | 3 | cmbConfiguration | +---------+------------------+---------+------------------+ | 2 | cmbStyle | 4 | cmbConstruction | +---------+------------------+---------+------------------+ :return: False if successful or True if an error is encountered. :rtype: bool """ _return = False combo.handler_block(self._lst_handler_id[index]) _attributes = AssessmentInputs.on_combo_changed(self, combo, index) if _attributes: if index == 1: _attributes['specification_id'] = int(combo.get_active()) # Load the capacitor style RAMSTKComboBox(). _index = _attributes['specification_id'] - 1 if self._subcategory_id in [1, 3, 4, 7, 9, 10, 11, 13]: try: _data = self._dic_styles[self._subcategory_id][_index] except KeyError: _data = [] else: try: _data = self._dic_styles[self._subcategory_id] except KeyError: _data = [] self.cmbStyle.do_load_combo(_data) elif index == 2: _attributes['type_id'] = int(combo.get_active()) elif index == 3: _attributes['configuration_id'] = int(combo.get_active()) elif index == 4: _attributes['construction_id'] = int(combo.get_active()) self._dtc_data_controller.request_set_attributes( self._hardware_id, _attributes) combo.handler_unblock(self._lst_handler_id[index]) return _return
def _on_combo_changed(self, combo, index): """ Retrieve RAMSTKCombo() changes and assign to Connection attribute. This method is called by: * gtk.Combo() 'changed' signal :param combo: the RAMSTKCombo() that called this method. :type combo: :class:`ramstk.gui.gtk.ramstk.RAMSTKCombo` :param int index: the position in the signal handler list associated with the calling RAMSTKComboBox(). Indices are: +---------+------------------+---------+------------------+ | Index | Widget | Index | Widget | +=========+==================+=========+==================+ | 1 | cmbType | 3 | cmbInsert | +---------+------------------+---------+------------------+ | 2 | cmbSpecification | | | +---------+------------------+---------+------------------+ :return: False if successful or True if an error is encountered. :rtype: bool """ _return = False combo.handler_block(self._lst_handler_id[index]) _attributes = AssessmentInputs.on_combo_changed(self, combo, index) if _attributes: if index == 1: _attributes['type_id'] = int(combo.get_active()) # Load the specification RAMSTKComboBox(). try: _data = self._dic_specification[_attributes['type_id']] except KeyError: _data = [] self.cmbSpecification.do_load_combo(_data) elif index == 2: _attributes['specification_id'] = int(combo.get_active()) # Load the connector insert material RAMSTKComboBox(). try: _data = self._dic_insert[_attributes['type_id']][ _attributes['specification_id']] except KeyError: _data = [] self.cmbInsert.do_load_combo(_data) elif index == 3: _attributes['insert_id'] = int(combo.get_active()) self._dtc_data_controller.request_set_attributes( self._hardware_id, _attributes) combo.handler_unblock(self._lst_handler_id[index]) return _return
def _on_combo_changed(self, combo, index): """ Retrieve RAMSTKCombo() changes and assign to Relay attribute. This method is called by: * gtk.Combo() 'changed' signal :param combo: the RAMSTKCombo() that called this method. :type combo: :class:`ramstk.gui.gtk.ramstk.RAMSTKCombo` :param int index: the position in the signal handler list associated with the calling RAMSTKComboBox(). Indices are: +-------+------------------+-------+------------------+ | Index | Widget | Index | Widget | +=======+==================+=======+==================+ | 1 | cmbType | 4 | cmbContactRating | +-------+------------------+-------+------------------+ | 2 | cmbLoadType | 5 | cmbApplication | +-------+------------------+-------+------------------+ | 3 | cmbContactForm | 6 | cmbConstruction | +-------+------------------+-------+------------------+ :return: False if successful or True if an error is encountered. :rtype: bool """ _return = False combo.handler_block(self._lst_handler_id[index]) _attributes = AssessmentInputs.on_combo_changed(self, combo, index) if _attributes: if index == 1: _attributes['type_id'] = int(combo.get_active()) elif index == 2: _attributes['technology_id'] = int(combo.get_active()) elif index == 3: _attributes['contact_form_id'] = int(combo.get_active()) elif index == 4: _attributes['contact_rating_id'] = int(combo.get_active()) # Load the application RAMSTKComboBox(). try: _data = self._dic_application[ _attributes['contact_rating_id']] except KeyError: _data = [] self.cmbApplication.do_load_combo(_data) elif index == 5: _attributes['application_id'] = int(combo.get_active()) # Load the construction RAMSTKComboBox(). try: _data = self._dic_construction[_attributes[ 'contact_rating_id']][_attributes['application_id']] except KeyError: _data = [] self.cmbConstruction.do_load_combo(_data) elif index == 6: _attributes['construction_id'] = int(combo.get_active()) self._dtc_data_controller.request_set_attributes( self._hardware_id, _attributes) combo.handler_unblock(self._lst_handler_id[index]) return _return