How to use the hardware.component.Component.Model.set_attributes function in hardware

To help you get started, we’ve selected a few hardware examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ReliaQualAssociates / ramstk / rtk / hardware / component / capacitor / Capacitor.py View on Github external
def set_attributes(self, values):
        """
        Method to set the Capacitor data model attributes.

        :param tuple values: tuple of values to assign to the instance
                             attributes.
        :return: (_code, _msg); the error code and error message.
        :rtype: tuple
        """

        _code = 0
        _msg = ''

        (_code, _msg) = Component.set_attributes(self, values[:127])

        try:
            self.q_override = float(values[127])
            self.acvapplied = float(values[128])
            self.capacitance = float(values[129])
            self.base_hr = float(values[130])
            self.piQ = float(values[131])
            self.piE = float(values[132])
            self.piCV = float(values[133])
            self.quality = int(values[134])
            self.specification = int(values[135])
            self.spec_sheet = int(values[136])
            self.reason = str(values[137])
        except IndexError as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Insufficient input values."
github ReliaQualAssociates / ramstk / rtk / hardware / component / miscellaneous / Crystal.py View on Github external
def set_attributes(self, values):
        """
        Method to set the Crystal data model attributes.

        :param tuple values: tuple of values to assign to the instance
                             attributes.
        :return: (_code, _msg); the error code and error message.
        :rtype: tuple
        """

        _code = 0
        _msg = ''

        (_code, _msg) = Component.set_attributes(self, values[:127])

        try:
            self.q_override = float(values[127])
            self.frequency = float(values[128])
            self.base_hr = float(values[129])
            self.piQ = float(values[130])
            self.piE = float(values[131])
            self.quality = int(values[132])
            self.reason = str(values[133])
        except IndexError as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Insufficient input values."
        except(TypeError, ValueError) as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Converting one or more inputs to correct data type."
github ReliaQualAssociates / ramstk / rtk / hardware / component / miscellaneous / Filter.py View on Github external
def set_attributes(self, values):
        """
        Method to set the Filter data model attributes.

        :param tuple values: tuple of values to assign to the instance
                             attributes.
        :return: (_code, _msg); the error code and error message.
        :rtype: tuple
        """

        _code = 0
        _msg = ''

        (_code, _msg) = Component.set_attributes(self, values[:127])

        try:
            self.q_override = float(values[127])
            self.base_hr = float(values[128])
            self.piQ = float(values[129])
            self.piE = float(values[130])
            self.quality = int(values[131])
            self.specification = int(values[132])
            self.style = int(values[133])
            self.reason = str(values[134])
        except IndexError as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Insufficient input values."
        except(TypeError, ValueError) as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Converting one or more inputs to correct data type."
github ReliaQualAssociates / ramstk / rtk / hardware / component / relay / Relay.py View on Github external
def set_attributes(self, values):
        """
        Method to set the Relay data model attributes.

        :param tuple values: tuple of values to assign to the instance
                             attributes.
        :return: (_code, _msg); the error code and error message.
        :rtype: tuple
        """

        _code = 0
        _msg = ''

        (_code, _msg) = Component.set_attributes(self, values[:127])

        try:
            self.quality = int(values[116])
            self.construction = int(values[117])
            self.q_override = float(values[127])
            self.base_hr = float(values[128])
            self.piQ = float(values[129])
            self.piE = float(values[130])
            self.reason = str(values[131])
        except IndexError as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Insufficient input values."
        except(TypeError, ValueError) as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Converting one or more inputs to correct data type."
github ReliaQualAssociates / ramstk / rtk / hardware / component / inductor / Inductor.py View on Github external
def set_attributes(self, values):
        """
        Method to set the Inductor data model attributes.

        :param tuple values: tuple of values to assign to the instance
                             attributes.
        :return: (_code, _msg); the error code and error message.
        :rtype: tuple
        """

        _code = 0
        _msg = ''

        (_code, _msg) = Component.set_attributes(self, values[:127])

        try:
            self.q_override = float(values[127])
            self.base_hr = float(values[128])
            self.piQ = float(values[129])
            self.piE = float(values[130])
            self.hot_spot_temperature = float(values[131])
            self.quality = int(values[132])
            self.specification = int(values[133])
            self.insulation_class = int(values[134])
            self.reason = str(values[135])
        except IndexError as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Insufficient input values."
        except(TypeError, ValueError) as _err:
            _code = Utilities.error_handler(_err.args)
github ReliaQualAssociates / ramstk / rtk / hardware / component / resistor / Resistor.py View on Github external
def set_attributes(self, values):
        """
        Method to set the Resistor data model attributes.

        :param tuple values: tuple of values to assign to the instance
                             attributes.
        :return: (_code, _msg); the error code and error message.
        :rtype: tuple
        """

        _code = 0
        _msg = ''

        (_code, _msg) = Component.set_attributes(self, values[:127])

        try:
            self.quality = int(values[116])
            self.q_override = float(values[96])
            self.resistance = float(values[97])
            self.base_hr = float(values[98])
            self.piQ = float(values[99])
            self.piE = float(values[100])
            self.piR = float(values[101])
            self.reason = str(values[133])
        except IndexError as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Insufficient input values."
        except(TypeError, ValueError) as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Converting one or more inputs to correct data type."
github ReliaQualAssociates / ramstk / rtk / hardware / component / connection / Connection.py View on Github external
def set_attributes(self, values):
        """
        Method to set the Connection data model attributes.

        :param tuple values: tuple of values to assign to the instance
                             attributes.
        :return: (_code, _msg); the error code and error message.
        :rtype: tuple
        """

        _code = 0
        _msg = ''

        (_code, _msg) = Component.set_attributes(self, values[:127])

        try:
            self.q_override = float(values[127])
            self.base_hr = float(values[128])
            self.piQ = float(values[129])
            self.piE = float(values[130])
            self.quality = int(values[131])
            self.reason = str(values[132])
        except IndexError as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Insufficient input values."
        except(TypeError, ValueError) as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Converting one or more inputs to correct data type."

        return(_code, _msg)
github ReliaQualAssociates / ramstk / rtk / hardware / component / miscellaneous / Lamp.py View on Github external
def set_attributes(self, values):
        """
        Method to set the Lamp data model attributes.

        :param tuple values: tuple of values to assign to the instance
                             attributes.
        :return: (_code, _msg); the error code and error message.
        :rtype: tuple
        """

        _code = 0
        _msg = ''

        (_code, _msg) = Component.set_attributes(self, values[:127])

        try:
            self.application = int(values[116])
            self.illuminate_hours = float(values[127])
            self.operate_hours = float(values[128])
            self.base_hr = float(values[129])
            self.piU = float(values[130])
            self.piA = float(values[131])
            self.piE = float(values[132])
            self.reason = str(values[133])
        except IndexError as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Insufficient input values."
        except(TypeError, ValueError) as _err:
            _code = Utilities.error_handler(_err.args)
            _msg = "ERROR: Converting one or more inputs to correct data type."