예제 #1
0
파일: Switch.py 프로젝트: diegohrey/ramstk
    def __init__(self, controller, **kwargs):
        """
        Initialize an instance of the Switch assessment input view.

        :param controller: the hardware data controller instance.
        :type controller: :class:`ramstk.hardware.Controller.HardwareBoMDataController`
        """
        AssessmentInputs.__init__(self, controller, **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.
        self._lst_labels.append(_(u"Application:"))
        self._lst_labels.append(_(u"Construction:"))
        self._lst_labels.append(_(u"Contact Form:"))
        self._lst_labels.append(_(u"Number of Cycles/Hour:"))
        self._lst_labels.append(_(u"Number of Active Contacts:"))

        # Initialize private scalar attributes.

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        self.cmbApplication = ramstk.RAMSTKComboBox(
            index=0, simple=True, tooltip=_(u"The application of the switch."))
        self.cmbConstruction = ramstk.RAMSTKComboBox(
            index=0,
            simple=False,
            tooltip=_(u"The construction method for "
                      u"the switch."))
        self.cmbContactForm = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The contact form and quantity of the switch."))
        self.txtNCycles = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The number of cycles per hour of the switch."))
        self.txtNElements = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The number of active contacts in the switch."))

        self._make_page()
        self.show_all()

        self._lst_handler_id.append(
            self.cmbQuality.connect('changed', self._on_combo_changed, 0))
        self._lst_handler_id.append(
            self.cmbApplication.connect('changed', self._on_combo_changed, 1))
        self._lst_handler_id.append(
            self.cmbConstruction.connect('changed', self._on_combo_changed, 2))
        self._lst_handler_id.append(
            self.cmbContactForm.connect('changed', self._on_combo_changed, 3))
        self._lst_handler_id.append(
            self.txtNCycles.connect('changed', self._on_focus_out, 4))
        self._lst_handler_id.append(
            self.txtNElements.connect('changed', self._on_focus_out, 5))
예제 #2
0
    def __init__(self, controller, **kwargs):
        """
        Initialize an instance of the Miscellaneous assessment input view.

        :param controller: the hardware data controller instance.
        :type controller: :class:`ramstk.hardware.Controller.HardwareBoMDataController`
        """
        AssessmentInputs.__init__(self, controller, **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.
        self._lst_labels.append(_(u"Application:"))
        self._lst_labels.append(_(u"Type:"))
        self._lst_labels.append(_(u"Operating Frequency:"))
        self._lst_labels.append(_(u"Utilization:"))

        # Initialize private scalar attributes.

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        self.cmbApplication = ramstk.RAMSTKComboBox(
            index=0, simple=True, tooltip=_(u"The application of the lamp."))
        self.cmbType = ramstk.RAMSTKComboBox(
            index=0, simple=True, tooltip=_(u"The type of electronic filter."))

        self.txtFrequency = ramstk.RAMSTKEntry(
            width=125, tooltip=_(u"The operating frequency of the crystal."))
        self.txtUtilization = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The utilization factor (illuminate hours / equipment "
                      u"operate hours) of the lamp."))

        self._make_page()
        self.show_all()

        self._lst_handler_id.append(
            self.cmbQuality.connect('changed', self._on_combo_changed, 0))
        self._lst_handler_id.append(
            self.cmbApplication.connect('changed', self._on_combo_changed, 1))
        self._lst_handler_id.append(
            self.cmbType.connect('changed', self._on_combo_changed, 2))
        self._lst_handler_id.append(
            self.txtFrequency.connect('changed', self._on_focus_out, 3))
        self._lst_handler_id.append(
            self.txtUtilization.connect('changed', self._on_focus_out, 4))
예제 #3
0
    def __init__(self, controller, **kwargs):
        """
        Initialize an instance of the Meter assessment input view.

        :param controller: the meter data controller instance.
        :type controller: :class:`ramstk.meter.Controller.MeterBoMDataController`
        :param int hardware_id: the hardware ID of the currently selected meter.
        :param int subcategory_id: the ID of the meter subcategory.
        """
        AssessmentInputs.__init__(self, controller, **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.
        self._lst_labels.append(_(u"Meter Type:"))
        self._lst_labels.append(_(u"Meter Function:"))

        # Initialize private scalar attributes.

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        self.cmbApplication = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The appliction of the panel meter."))
        self.cmbType = ramstk.RAMSTKComboBox(index=0,
                                             simple=False,
                                             tooltip=_(u"The type of meter."))

        self._make_page()
        self.show_all()

        self._lst_handler_id.append(
            self.cmbQuality.connect('changed', self._on_combo_changed, 0))
        self._lst_handler_id.append(
            self.cmbApplication.connect('changed', self._on_combo_changed, 1))
        self._lst_handler_id.append(
            self.cmbType.connect('changed', self._on_combo_changed, 2))
예제 #4
0
    def __init__(self, controller, **kwargs):
        """
        Initialize an instance of the Hardware assessment input view.

        :param controller: the hardware data controller instance.
        :type controller: :class:`ramstk.hardware.Controller.HardwareBoMDataController`
        :param int hardware_id: the hardware ID of the currently selected
                                hardware item.
        :param int subcategory_id: the ID of the hardware item subcategory.
        """
        gtk.Fixed.__init__(self)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.
        self._lst_handler_id = []
        self._lst_labels = [
            _(u"Quality Level:"),
        ]

        # Initialize private scalar attributes.
        self._dtc_data_controller = controller
        self._hardware_id = kwargs['hardware_id']
        self._subcategory_id = kwargs['subcategory_id']

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        self.fmt = None

        self.cmbQuality = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The quality level of the hardware item."))
예제 #5
0
    def __init__(self, controller, **kwargs):
        """
        Initialize an instance of the Capacitor assessment input view.

        :param controller: the Hardware data controller instance.
        :type controller: :class:`ramstk.hardware.Controller.HardwareBoMDataController`
        """
        AssessmentInputs.__init__(self, controller, **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.
        self._lst_labels.append(_(u"Capacitance (F):"))
        self._lst_labels.append(_(u"Specification:"))
        self._lst_labels.append(_(u"Style:"))
        self._lst_labels.append(_(u"Configuration:"))
        self._lst_labels.append(_(u"Construction:"))
        self._lst_labels.append(_(u"Equivalent Series Resistance (\u03A9):"))

        # Initialize private scalar attributes.

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        self.fmt = None

        self.cmbSpecification = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The governing specification for the capacitor."))
        self.cmbStyle = ramstk.RAMSTKComboBox(
            index=0, simple=False, tooltip=_(u"The style of the capacitor."))
        self.cmbConfiguration = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The configuration of the capacitor."))
        self.cmbConstruction = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The method of construction of the capacitor."))

        self.txtCapacitance = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The capacitance rating (in farads) of the capacitor."))
        self.txtESR = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The equivalent series resistance of the capcaitor."))

        self._make_page()
        self.show_all()

        self._lst_handler_id.append(
            self.cmbQuality.connect('changed', self._on_combo_changed, 0))
        self._lst_handler_id.append(
            self.cmbSpecification.connect('changed', self._on_combo_changed,
                                          1))
        self._lst_handler_id.append(
            self.cmbStyle.connect('changed', self._on_combo_changed, 2))
        self._lst_handler_id.append(
            self.cmbConfiguration.connect('changed', self._on_combo_changed,
                                          3))
        self._lst_handler_id.append(
            self.cmbConstruction.connect('changed', self._on_combo_changed, 4))
        self._lst_handler_id.append(
            self.txtCapacitance.connect('changed', self._on_focus_out, 5))
        self._lst_handler_id.append(
            self.txtESR.connect('changed', self._on_focus_out, 6))
예제 #6
0
    def __init__(self, controller, **kwargs):  # pylint: disable=unused-argument
        """
        Initialize the Work View for the Similar Item.

        :param controller: the RAMSTK master data controller instance.
        :type controller: :class:`ramstk.RAMSTK.RAMSTK`
        """
        RAMSTKWorkView.__init__(self, controller, module='SimilarItem')

        # Initialize private dictionary attributes.
        self._dic_icons['edit'] = (
            controller.RAMSTK_CONFIGURATION.RAMSTK_ICON_DIR +
            '/32x32/edit.png')
        self._dic_quality = {
            'Space': 1,
            'Full Military': 2,
            'Ruggedized': 3,
            'Commercial': 4
        }
        self._dic_environment = {
            'Ground, Benign': 1,
            'Ground,Mobile': 2,
            'Naval, Sheltered': 3,
            'Airborne, Inhabited, Cargo': 4,
            'Airborne, Rotary Wing': 5,
            'Space, Flight': 6
        }

        # Initialize private list attributes.

        # Initialize private scalar attributes.
        self._revision_id = None
        self._parent_id = None
        self._hardware_id = None
        self._method_id = None
        self._dtc_hw_controller = None

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        _bg_color = '#FFFFFF'
        _fg_color = '#000000'
        _fmt_file = (
            controller.RAMSTK_CONFIGURATION.RAMSTK_CONF_DIR + '/layouts/' +
            controller.RAMSTK_CONFIGURATION.RAMSTK_FORMAT_FILE['similaritem'])
        _fmt_path = "/root/tree[@name='SimilarItem']/column"
        _tooltip = _(u"Displays the Similar Item Analysis for the currently "
                     u"selected Hardware item.")

        self.treeview = ramstk.RAMSTKTreeView(_fmt_path,
                                              0,
                                              _fmt_file,
                                              _bg_color,
                                              _fg_color,
                                              pixbuf=False)
        self._lst_col_order = self.treeview.order
        self.treeview.set_tooltip_text(_tooltip)

        self.cmbSimilarItemMethod = ramstk.RAMSTKComboBox(
            tooltip=_(u"Select the similar item analysis method."))

        self._lst_handler_id.append(
            self.treeview.connect('cursor_changed', self._do_change_row))
        self._lst_handler_id.append(
            self.treeview.connect('button_press_event', self._on_button_press))
        self._lst_handler_id.append(
            self.cmbSimilarItemMethod.connect('changed',
                                              self._on_combo_changed, 2))

        for _idx in self._lst_col_order[3:]:
            _cell = self.treeview.get_column(
                self._lst_col_order[_idx]).get_cell_renderers()
            try:
                _cell[0].connect('edited', self._do_edit_cell, _idx,
                                 self.treeview.get_model())
            except TypeError:
                _cell[0].connect('toggled', self._do_edit_cell, 'new text',
                                 _idx, self.treeview.get_model())

        _label = ramstk.RAMSTKLabel(
            _(u"SimilarItem"),
            height=30,
            width=-1,
            justify=gtk.JUSTIFY_CENTER,
            tooltip=_(u"Displays the Similar Item analysis for the selected "
                      u"hardware item."))
        self.hbx_tab_label.pack_start(_label)

        self.pack_start(self._make_buttonbox(), False, True)
        _hbox = gtk.HBox()
        _hbox.pack_start(self._make_methodbox(), False, True)
        _hbox.pack_end(self._make_page(), True, True)
        self.pack_end(_hbox, True, True)
        self.show_all()

        pub.subscribe(self._on_select, 'selectedHardware')
        pub.subscribe(self._do_clear_page, 'closedProgram')
예제 #7
0
    def __init__(self, controller, **kwargs):
        """
        Initialize an instance of the Integrated Circuit assessment input view.

        :param controller: the hardware data controller instance.
        :type controller: :class:`ramstk.hardware.IntegratedCircuitDataController`
        """
        AssessmentInputs.__init__(self, controller, **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.
        self._lst_labels.append(_(u"Package:"))
        self._lst_labels.append(_(u"Die Area:"))
        self._lst_labels.append(_(u"N Elements:"))
        self._lst_labels.append(_(u"\u0398<sub>JC</sub>:"))
        self._lst_labels.append(_(u"Active Pins:"))
        self._lst_labels.append(_(u"Technology:"))
        self._lst_labels.append(_(u"Years in Production:"))
        self._lst_labels.append(_(u"Construction"))
        self._lst_labels.append(_(u"Programming Cycles:"))
        self._lst_labels.append(_(u"Operating Life:"))
        self._lst_labels.append(_(u"Error Correction Code:"))
        self._lst_labels.append(_(u"Application:"))
        self._lst_labels.append(_(u"Device Type:"))
        self._lst_labels.append(_(u"Feature Size:"))
        self._lst_labels.append(_(u"Manufacturing Process:"))
        self._lst_labels.append(_(u"ESD Threshold Voltage:"))

        # Initialize private scalar attributes.

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        self.cmbApplication = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The application of the integrated circuit."))
        self.cmbConstruction = ramstk.RAMSTKComboBox(
            index=0,
            simple=False,
            tooltip=_(u"The integrated circuit method "
                      u"of construction."))
        self.cmbECC = ramstk.RAMSTKComboBox(
            index=0,
            simple=False,
            tooltip=_(u"The error correction code used by the EEPROM."))
        self.cmbManufacturing = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The manufacturing process for the VLSI device."))
        self.cmbPackage = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The method of construction of the integrated "
                      u"circuit."))
        self.cmbTechnology = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The technology used to construct the integrated "
                      u"circuit."))
        self.cmbType = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The type of GaAs or VLSI device."))

        self.txtArea = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The die area (in mil<sup>2</sup>) of the integrated "
                      u"circuit."))
        self.txtFeatureSize = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The feature size (in microns) of the VLSI device."))
        self.txtNActivePins = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The number of active pins on the integrated circuit."))
        self.txtNCycles = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The total number of programming cycles over the "
                      u"EEPROM life."))
        self.txtNElements = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The number of active elements in the integrated "
                      u"circuit."))
        self.txtOperatingLife = ramstk.RAMSTKEntry(
            width=125, tooltip=_(u"The system lifetime operating hours."))
        self.txtThetaJC = ramstk.RAMSTKEntry(
            width=125, tooltip=_(u"The junction to case thermal resistance."))
        self.txtVoltageESD = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The ESD susceptibility threshold voltage of the VLSI "
                      u"device."))
        self.txtYearsInProduction = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The number of years the generic device type has been "
                      u"in production."))

        self._make_page()
        self.show_all()

        self._lst_handler_id.append(
            self.cmbQuality.connect('changed', self._on_combo_changed, 0))
        self._lst_handler_id.append(
            self.cmbApplication.connect('changed', self._on_combo_changed, 1))
        self._lst_handler_id.append(
            self.cmbConstruction.connect('changed', self._on_combo_changed, 2))
        self._lst_handler_id.append(
            self.cmbECC.connect('changed', self._on_combo_changed, 3))
        self._lst_handler_id.append(
            self.cmbManufacturing.connect('changed', self._on_combo_changed,
                                          4))
        self._lst_handler_id.append(
            self.cmbPackage.connect('changed', self._on_combo_changed, 5))
        self._lst_handler_id.append(
            self.cmbTechnology.connect('changed', self._on_combo_changed, 6))
        self._lst_handler_id.append(
            self.cmbType.connect('changed', self._on_combo_changed, 7))

        self._lst_handler_id.append(
            self.txtArea.connect('changed', self._on_focus_out, 8))
        self._lst_handler_id.append(
            self.txtFeatureSize.connect('changed', self._on_focus_out, 9))
        self._lst_handler_id.append(
            self.txtNActivePins.connect('changed', self._on_focus_out, 10))
        self._lst_handler_id.append(
            self.txtNCycles.connect('changed', self._on_focus_out, 11))
        self._lst_handler_id.append(
            self.txtNElements.connect('changed', self._on_focus_out, 12))
        self._lst_handler_id.append(
            self.txtOperatingLife.connect('changed', self._on_focus_out, 13))
        self._lst_handler_id.append(
            self.txtThetaJC.connect('changed', self._on_focus_out, 14))
        self._lst_handler_id.append(
            self.txtVoltageESD.connect('changed', self._on_focus_out, 15))
        self._lst_handler_id.append(
            self.txtYearsInProduction.connect('changed', self._on_focus_out,
                                              16))
예제 #8
0
    def __init__(self, controller, **kwargs):
        """
        Initialize an instance of the Semiconductor assessment input view.

        :param controller: the hardware data controller instance.
        :type controller: :class:`ramstk.hardware.Controller.HardwareBoMDataController`
        """
        AssessmentInputs.__init__(self, controller, **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.
        self._lst_labels.append(_(u"Package:"))
        self._lst_labels.append(_(u"Type:"))
        self._lst_labels.append(_(u"Application:"))
        self._lst_labels.append(_(u"Construction:"))
        self._lst_labels.append(_(u"Matching Network:"))
        self._lst_labels.append(_(u"Operating Frequency (GHz):"))
        self._lst_labels.append(_(u"Number of Characters:"))
        self._lst_labels.append(u"\u03B8<sub>JC</sub>:")

        # Initialize private scalar attributes.

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        self.cmbPackage = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The package type for the semiconductor."))
        self.cmbType = ramstk.RAMSTKComboBox(
            index=0, simple=False, tooltip=_(u"The type of semiconductor."))
        self.cmbApplication = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The application of the semiconductor."))
        self.cmbConstruction = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The method of construction of the semiconductor."))
        self.cmbMatching = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The matching network of the semiconductor."))

        self.txtFrequencyOperating = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The operating frequency of the semiconductor."))
        self.txtNElements = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(
                u"The number of characters in the optoelectronic display."))
        self.txtThetaJC = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(
                u"The junction-case thermal resistance of the semiconductor."))

        self._make_page()
        self.show_all()

        self._lst_handler_id.append(
            self.cmbQuality.connect('changed', self._on_combo_changed, 0))
        self._lst_handler_id.append(
            self.cmbApplication.connect('changed', self._on_combo_changed, 1))
        self._lst_handler_id.append(
            self.cmbConstruction.connect('changed', self._on_combo_changed, 2))
        self._lst_handler_id.append(
            self.cmbMatching.connect('changed', self._on_combo_changed, 3))
        self._lst_handler_id.append(
            self.cmbPackage.connect('changed', self._on_combo_changed, 4))
        self._lst_handler_id.append(
            self.cmbType.connect('changed', self._on_combo_changed, 5))
        self._lst_handler_id.append(
            self.txtFrequencyOperating.connect('changed', self._on_focus_out,
                                               6))
        self._lst_handler_id.append(
            self.txtNElements.connect('changed', self._on_focus_out, 7))
        self._lst_handler_id.append(
            self.txtThetaJC.connect('changed', self._on_focus_out, 8))
예제 #9
0
    def __init__(self, controller, **kwargs):  # pylint: disable=unused-argument
        """
        Initialize the Work View for the Allocation.

        :param controller: the RAMSTK master data controller instance.
        :type controller: :class:`ramstk.RAMSTK.RAMSTK`
        """
        RAMSTKWorkView.__init__(self, controller, module='Allocation')

        # Initialize private dictionary attributes.

        # Initialize private list attributes.

        # Initialize private scalar attributes.
        self._parent_id = None
        self._allocation_id = None

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        _bg_color = '#FFFFFF'
        _fg_color = '#000000'
        _fmt_file = (
            controller.RAMSTK_CONFIGURATION.RAMSTK_CONF_DIR + '/layouts/' +
            controller.RAMSTK_CONFIGURATION.RAMSTK_FORMAT_FILE['allocation'])
        _fmt_path = "/root/tree[@name='Allocation']/column"
        _tooltip = _(u"Displays the Allocation Analysis for the "
                     u"currently selected Hardware item.")

        self.treeview = ramstk.RAMSTKTreeView(_fmt_path,
                                              0,
                                              _fmt_file,
                                              _bg_color,
                                              _fg_color,
                                              pixbuf=False)
        self._lst_col_order = self.treeview.order
        self.treeview.set_tooltip_text(_tooltip)

        self.cmbAllocationGoal = ramstk.RAMSTKComboBox(tooltip=_(
            u"Selects the goal measure for the selected hardware assembly."))
        self.cmbAllocationMethod = ramstk.RAMSTKComboBox(tooltip=_(
            u"Selects the method for allocating the reliability goal for "
            u"the selected hardware assembly."))
        self.txtHazardRateGoal = ramstk.RAMSTKEntry(
            width=125,
            tooltip=(
                u"Displays the hazard rate goal for the selected hardware "
                u"item."))
        self.txtMTBFGoal = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(
                u"Displays the MTBF goal for the selected hardware item."))
        self.txtReliabilityGoal = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(
                u"Displays the reliability goal for the selected hardware "
                u"item."))

        self._lst_handler_id.append(
            self.treeview.connect('cursor_changed', self._do_change_row))
        self._lst_handler_id.append(
            self.treeview.connect('button_press_event', self._on_button_press))
        self._lst_handler_id.append(
            self.cmbAllocationMethod.connect('changed', self._on_combo_changed,
                                             2))
        self._lst_handler_id.append(
            self.cmbAllocationGoal.connect('changed', self._on_combo_changed,
                                           3))
        self._lst_handler_id.append(
            self.txtReliabilityGoal.connect('focus_out_event',
                                            self._on_focus_out, 4))
        self._lst_handler_id.append(
            self.txtHazardRateGoal.connect('focus_out_event',
                                           self._on_focus_out, 5))
        self._lst_handler_id.append(
            self.txtMTBFGoal.connect('focus_out_event', self._on_focus_out, 6))

        for i in [
                self._lst_col_order[3], self._lst_col_order[5],
                self._lst_col_order[6], self._lst_col_order[7],
                self._lst_col_order[8], self._lst_col_order[9],
                self._lst_col_order[10], self._lst_col_order[11]
        ]:
            _cell = self.treeview.get_column(
                self._lst_col_order[i]).get_cell_renderers()
            try:
                _cell[0].connect('edited', self._do_edit_cell, i,
                                 self.treeview.get_model())
            except TypeError:
                _cell[0].connect('toggled', self._do_edit_cell, 'new text', i,
                                 self.treeview.get_model())

        _label = ramstk.RAMSTKLabel(
            _(u"Allocation"),
            height=30,
            width=-1,
            justify=gtk.JUSTIFY_CENTER,
            tooltip=_(u"Displays the Allocation analysis for the selected "
                      u"hardware item."))
        self.hbx_tab_label.pack_start(_label)

        self.pack_start(self._make_buttonbox(), False, True)
        _hbox = gtk.HBox()
        _hbox.pack_start(self._make_goalbox(), False, True)
        _hbox.pack_end(self._make_page(), True, True)
        self.pack_end(_hbox, True, True)
        self.show_all()

        pub.subscribe(self._on_select, 'selectedHardware')
        pub.subscribe(self._do_clear_page, 'closedProgram')
예제 #10
0
    def __init__(self, controller, **kwargs):
        """
        Initialize an instance of the Resistor assessment input view.

        :param controller: the hardware data controller instance.
        :type controller: :class:`ramstk.hardware.Controller.HardwareBoMDataController`
        """
        AssessmentInputs.__init__(self, controller, **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.
        self._lst_labels.append(_(u"Resistance (\u03A9):"))
        self._lst_labels.append(_(u"Specification:"))
        self._lst_labels.append(_(u"Type:"))
        self._lst_labels.append(_(u"Style:"))
        self._lst_labels.append(_(u"Construction:"))
        self._lst_labels.append(_(u"Number of Elements:"))

        # Initialize private scalar attributes.

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        self.cmbSpecification = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The governing specification for the resistor."))
        self.cmbType = ramstk.RAMSTKComboBox(
            index=0, simple=False, tooltip=_(u"The type of thermistor."))
        self.cmbStyle = ramstk.RAMSTKComboBox(
            index=0, simple=True, tooltip=_(u"The style of resistor."))
        self.cmbConstruction = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The method of construction of the resistor."))
        self.txtResistance = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The resistance (in \u03A9) of the resistor."))
        self.txtNElements = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The number of active resistors in a resistor network "
                      u"or the number of potentiometer taps."))

        self._make_page()
        self.show_all()

        self._lst_handler_id.append(
            self.cmbQuality.connect('changed', self._on_combo_changed, 0))
        self._lst_handler_id.append(
            self.cmbSpecification.connect('changed', self._on_combo_changed,
                                          1))
        self._lst_handler_id.append(
            self.cmbType.connect('changed', self._on_combo_changed, 2))
        self._lst_handler_id.append(
            self.cmbStyle.connect('changed', self._on_combo_changed, 3))
        self._lst_handler_id.append(
            self.cmbConstruction.connect('changed', self._on_combo_changed, 4))
        self._lst_handler_id.append(
            self.txtResistance.connect('changed', self._on_focus_out, 5))
        self._lst_handler_id.append(
            self.txtNElements.connect('changed', self._on_focus_out, 6))
예제 #11
0
    def __init__(self, controller, **kwargs):
        """
        Initialize an instance of the Connection assessment input view.

        :param controller: the Hardware data controller instance.
        :type controller: :class:`ramstk.hardware.Controller.HardwareBoMDataController`
        """
        AssessmentInputs.__init__(self, controller, **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.
        self._lst_labels.append(_(u"Connector Type:"))
        self._lst_labels.append(_(u"Specification:"))
        self._lst_labels.append(_(u"Insert Material:"))
        self._lst_labels.append(_(u"Contact Gauge:"))
        self._lst_labels.append(_(u"Active Pins:"))
        self._lst_labels.append(_(u"Amperes/Contact:"))
        self._lst_labels.append(_(u"Mating/Unmating Cycles (per 1000 hours):"))
        self._lst_labels.append(_(u"Number of Wave Soldered PTH:"))
        self._lst_labels.append(_(u"Number of Hand Soldered PTH:"))
        self._lst_labels.append(_(u"Number of Circuit Planes:"))

        # Initialize private scalar attributes.

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        self.cmbType = ramstk.RAMSTKComboBox(
            index=0,
            simple=False,
            tooltip=_(u"The type of connector/connection."))
        self.cmbSpecification = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The governing specification for the connection."))
        self.cmbInsert = ramstk.RAMSTKComboBox(
            index=0, simple=True, tooltip=_(u"The connector insert material."))

        self.txtContactGauge = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The gauge of the contacts in the connector."))
        self.txtActivePins = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The number of active pins in the connector."))
        self.txtAmpsContact = ramstk.RAMSTKEntry(
            width=125, tooltip=_(u"The amperes per active contact."))
        self.txtMating = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The number of connector mate and unmate cycles per "
                      u"1000 hours of operation."))
        self.txtNWave = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The number of wave soldered PTH connections."))
        self.txtNHand = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The number of hand soldered PTH connections."))
        self.txtNPlanes = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The number of circuit planes for wave soldered "
                      u"connections."))

        self._make_page()
        self.show_all()

        self._lst_handler_id.append(
            self.cmbQuality.connect('changed', self._on_combo_changed, 0))
        self._lst_handler_id.append(
            self.cmbType.connect('changed', self._on_combo_changed, 1))
        self._lst_handler_id.append(
            self.cmbSpecification.connect('changed', self._on_combo_changed,
                                          2))
        self._lst_handler_id.append(
            self.cmbInsert.connect('changed', self._on_combo_changed, 3))
        self._lst_handler_id.append(
            self.txtContactGauge.connect('changed', self._on_focus_out, 4))
        self._lst_handler_id.append(
            self.txtActivePins.connect('changed', self._on_focus_out, 5))
        self._lst_handler_id.append(
            self.txtAmpsContact.connect('changed', self._on_focus_out, 6))
        self._lst_handler_id.append(
            self.txtMating.connect('changed', self._on_focus_out, 7))
        self._lst_handler_id.append(
            self.txtNWave.connect('changed', self._on_focus_out, 8))
        self._lst_handler_id.append(
            self.txtNHand.connect('changed', self._on_focus_out, 9))
        self._lst_handler_id.append(
            self.txtNPlanes.connect('changed', self._on_focus_out, 10))
예제 #12
0
파일: Import.py 프로젝트: diegohrey/ramstk
    def __init__(self, __widget, controller):
        """
        Initialize an instance of the Import Assistant.

        :param __widget: the gtk.Widget() that called this class.
        :type __widget: :class:`gtk.Widget`
        :param controller: the RAMSTK master data controller.
        :type controller: :class:`ramstk.RAMSTK.RAMSTK`
        """
        gtk.Assistant.__init__(self)

        # Initialize private dict variables.
        self._dic_icons = {
            'error':
            controller.RAMSTK_CONFIGURATION.RAMSTK_ICON_DIR +
            '/32x32/error.png',
            'information':
            controller.RAMSTK_CONFIGURATION.RAMSTK_ICON_DIR +
            '/32x32/information.png',
        }

        # Initialize private list variables.

        # Initialize private scalar variables.
        self._mdcRAMSTK = controller
        self._dtc_data_controller = self._mdcRAMSTK.dic_controllers['imports']
        self._cmb_select_module = ramstk.RAMSTKComboBox(
            tooltip=_(u"Select the RAMSTK module to map."))
        self._module = None

        # Initialize public dict variables.

        # Initialize public list variables.

        # Initialize public scalar variables.
        self._tvw_field_map = gtk.TreeView()

        # Build the assistant.
        _page = self._make_introduction_page()
        self.append_page(_page)
        self.set_page_type(_page, gtk.ASSISTANT_PAGE_INTRO)
        self.set_page_title(_page, _(u"RAMSTK Import Assistant"))
        self.set_page_complete(_page, True)
        _page = self._make_input_file_select_page()
        self.append_page(_page)
        self.set_page_type(_page, gtk.ASSISTANT_PAGE_CONTENT)
        self.set_page_title(_page, _(u"Select Input File"))
        _page = self._make_map_field_page()
        self.append_page(_page)
        self.set_page_type(_page, gtk.ASSISTANT_PAGE_CONTENT)
        self.set_page_title(
            _page, _(u"Map Input File Fields to RAMSTK Database Fields"))
        _page = self._make_confirm_page()
        self.append_page(_page)
        self.set_page_type(_page, gtk.ASSISTANT_PAGE_CONFIRM)
        self.set_page_complete(_page, True)

        self.set_property('title', _(u"RAMSTK Import Assistant"))

        self.resize(800, 400)
        self.move(200, 100)

        self.connect('cancel', self._do_quit)
        self.connect('close', self._do_quit)
        self.connect('apply', self._do_request_insert)

        self.show_all()
예제 #13
0
    def __init__(self, controller, **kwargs):
        """
        Initialize an instance of the Inductor assessment input view.

        :param controller: the Hardware data controller instance.
        :type controller: :class:`ramstk.hardware.Controller.HardwareBoMDataController`
        """
        AssessmentInputs.__init__(self, controller, **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.
        self._lst_labels.append(_(u"Specification:"))
        self._lst_labels.append(_(u"Insulation Class:"))
        self._lst_labels.append(_(u"Area:"))
        self._lst_labels.append(_(u"Weight:"))
        self._lst_labels.append(_(u"Family:"))
        self._lst_labels.append(_(u"Construction:"))

        # Initialize private scalar attributes.

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        self.cmbInsulation = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The insulation class of the inductive device."))
        self.cmbSpecification = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The governing specification for the inductive "
                      u"device."))
        self.cmbFamily = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The application family of the transformer."))
        self.cmbConstruction = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The method of construction of the coil."))

        self.txtArea = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The case radiating surface (in square inches) of the "
                      u"inductive device."))
        self.txtWeight = ramstk.RAMSTKEntry(
            width=125, tooltip=_(u"The transformer weight (in lbf)."))

        self._make_page()
        self.show_all()

        self._lst_handler_id.append(
            self.cmbQuality.connect('changed', self._on_combo_changed, 0))
        self._lst_handler_id.append(
            self.cmbSpecification.connect('changed', self._on_combo_changed,
                                          1))
        self._lst_handler_id.append(
            self.cmbInsulation.connect('changed', self._on_combo_changed, 2))
        self._lst_handler_id.append(
            self.cmbFamily.connect('changed', self._on_combo_changed, 3))
        self._lst_handler_id.append(
            self.cmbConstruction.connect('changed', self._on_combo_changed, 4))
        self._lst_handler_id.append(
            self.txtArea.connect('changed', self._on_focus_out, 5))
        self._lst_handler_id.append(
            self.txtWeight.connect('changed', self._on_focus_out, 6))
예제 #14
0
파일: Relay.py 프로젝트: diegohrey/ramstk
    def __init__(self, controller, **kwargs):
        """
        Initialize an instance of the Relay assessment input view.

        :param controller: the hardware data controller instance.
        :type controller: :class:`ramstk.hardware.Controller.HardwareBoMDataController`
        """
        AssessmentInputs.__init__(self, controller, **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.
        self._lst_labels.append(_(u"Type:"))
        self._lst_labels.append(_(u"Load Type"))
        self._lst_labels.append(_(u"Contact Form:"))
        self._lst_labels.append(_(u"Contact Rating:"))
        self._lst_labels.append(_(u"Application:"))
        self._lst_labels.append(_(u"Construction:"))
        self._lst_labels.append(_(u"Number of Cycles/Hour:"))

        # Initialize private scalar attributes.

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        self.cmbType = ramstk.RAMSTKComboBox(index=0,
                                             simple=True,
                                             tooltip=_(u"The relay type."))
        self.cmbLoadType = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The type of load the relay is switching."))
        self.cmbContactForm = ramstk.RAMSTKComboBox(
            index=0, simple=True, tooltip=_(u"The contact form of the relay."))
        self.cmbContactRating = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The rating of the relay contacts."))
        self.cmbApplication = ramstk.RAMSTKComboBox(
            index=0, simple=True, tooltip=_(u"The type of relay appliction."))
        self.cmbConstruction = ramstk.RAMSTKComboBox(
            index=0,
            simple=True,
            tooltip=_(u"The method of construction of the relay."))
        self.txtCycles = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"The number of relay on/off cycles per hour."))

        self._make_page()
        self.show_all()

        self._lst_handler_id.append(
            self.cmbQuality.connect('changed', self._on_combo_changed, 0))
        self._lst_handler_id.append(
            self.cmbType.connect('changed', self._on_combo_changed, 1))
        self._lst_handler_id.append(
            self.cmbLoadType.connect('changed', self._on_combo_changed, 2))
        self._lst_handler_id.append(
            self.cmbContactForm.connect('changed', self._on_combo_changed, 3))
        self._lst_handler_id.append(
            self.cmbContactRating.connect('changed', self._on_combo_changed,
                                          4))
        self._lst_handler_id.append(
            self.cmbApplication.connect('changed', self._on_combo_changed, 5))
        self._lst_handler_id.append(
            self.cmbConstruction.connect('changed', self._on_combo_changed, 6))

        self._lst_handler_id.append(
            self.txtCycles.connect('changed', self._on_focus_out, 7))
예제 #15
0
    def __init__(self, controller, **kwargs):  # pylint: disable=unused-argument
        """
        Initialize the Requirement Work View.

        :param controller: the RAMSTK master data controller instance.
        :type controller: :class:`ramstk.RAMSTK.RAMSTK`
        """
        RAMSTKWorkView.__init__(self, controller, module='Requirement')

        # Initialize private dictionary attributes.

        # Initialize private list attributes.
        self._lst_gendata_labels = [
            _(u"Requirement Code:"),
            _(u"Requirement Description:"),
            _(u"Requirement Type:"), "",
            _(u"Specification:"),
            _(u"Page Number:"),
            _(u"Figure Number:"),
            _(u"Priority:"),
            _(u"Owner:"), "",
            _(u"Validated Date:")
        ]

        # Initialize private scalar attributes.
        self._requirement_id = None

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.
        self.btnValidateDate = ramstk.RAMSTKButton(height=25,
                                                   width=25,
                                                   label="...")

        self.chkDerived = ramstk.RAMSTKCheckButton(
            label=_(u"Requirement is derived."),
            tooltip=_(u"Indicates whether or not the selected requirement is "
                      u"derived."))
        self.chkValidated = ramstk.RAMSTKCheckButton(
            label=_(u"Requirement is validated."),
            tooltip=_(u"Indicates whether or not the selected requirement is "
                      u"validated."))

        self.cmbOwner = ramstk.RAMSTKComboBox()
        self.cmbRequirementType = ramstk.RAMSTKComboBox(index=1, simple=False)
        self.cmbPriority = ramstk.RAMSTKComboBox(width=50)

        self.txtCode = ramstk.RAMSTKEntry(
            width=125,
            tooltip=_(u"A unique code for the selected requirement."))
        self.txtFigNum = ramstk.RAMSTKEntry()
        self.txtName = ramstk.RAMSTKEntry(
            width=800,
            tooltip=_(u"The description of the selected requirement."))
        self.txtPageNum = ramstk.RAMSTKEntry()
        self.txtSpecification = ramstk.RAMSTKEntry()
        self.txtValidatedDate = ramstk.RAMSTKEntry()

        # Connect to callback requirements for editable gtk.Widgets().
        self._lst_handler_id.append(
            self.txtCode.connect('changed', self._on_focus_out, 0))
        self._lst_handler_id.append(
            self.txtName.connect('changed', self._on_focus_out, 1))
        self._lst_handler_id.append(
            self.cmbRequirementType.connect('changed', self._on_combo_changed,
                                            2))
        self._lst_handler_id.append(
            self.chkDerived.connect('toggled', self._on_toggled, 3))
        self._lst_handler_id.append(
            self.txtSpecification.connect('changed', self._on_focus_out, 4))
        self._lst_handler_id.append(
            self.txtPageNum.connect('changed', self._on_focus_out, 5))
        self._lst_handler_id.append(
            self.txtFigNum.connect('changed', self._on_focus_out, 6))
        self._lst_handler_id.append(
            self.cmbPriority.connect('changed', self._on_combo_changed, 7))
        self._lst_handler_id.append(
            self.cmbOwner.connect('changed', self._on_combo_changed, 8))
        self._lst_handler_id.append(
            self.chkValidated.connect('toggled', self._on_toggled, 9))
        self._lst_handler_id.append(
            self.txtValidatedDate.connect('changed', self._on_focus_out, 10))
        self._lst_handler_id.append(
            self.btnValidateDate.connect('button-release-event',
                                         self._do_select_date,
                                         self.txtValidatedDate))

        self.pack_start(self._make_buttonbox(), expand=False, fill=False)
        self.pack_start(self._make_page(), expand=True, fill=True)
        self.show_all()

        pub.subscribe(self._on_select, 'selectedRequirement')
        pub.subscribe(self._on_edit, 'mvwEditedRequirement')
        pub.subscribe(self._on_edit, 'calculatedRequirement')
        pub.subscribe(self._do_clear_page, 'closedProgram')