def _make_page(self): """ Create the Revision Work View general data page. :return: False if successful or True if an error is encountered. :rtype: bool """ _fixed = gtk.Fixed() _scrollwindow = ramstk.RAMSTKScrolledWindow(_fixed) _frame = ramstk.RAMSTKFrame(label=_(u"General Information")) _frame.add(_scrollwindow) _x_pos, _y_pos = ramstk.make_label_group(self._lst_gendata_labels, _fixed, 5, 5) _x_pos += 50 _fixed.put(self.txtCode, _x_pos, _y_pos[0]) _fixed.put(self.txtName, _x_pos, _y_pos[1]) _fixed.put(self.txtRemarks.scrollwindow, _x_pos, _y_pos[2]) _fixed.show_all() _label = ramstk.RAMSTKLabel( _(u"General\nData"), height=30, width=-1, justify=gtk.JUSTIFY_CENTER, tooltip=_(u"Displays general information for the selected " u"revision.")) self.hbx_tab_label.pack_start(_label) return _frame
def _make_page(self): """ Make the Hardware gtk.Notebook() assessment results page. :return: False if successful or True if an error is encountered. :rtype: bool """ _return = False # Create the left side. _fixed = gtk.Fixed() self.pack1(_fixed, True, True) _x_pos, _y_pos = ramstk.make_label_group(self._lst_labels, _fixed, 5, 35) _x_pos += 50 _fixed.put(self.txtCurrentRatio, _x_pos, _y_pos[0]) _fixed.put(self.txtPowerRatio, _x_pos, _y_pos[1]) _fixed.put(self.txtVoltageRatio, _x_pos, _y_pos[2]) _fixed.put(self.chkOverstress, _x_pos, _y_pos[3]) _fixed.put(self.txtReason.scrollwindow, _x_pos, _y_pos[4]) _fixed.show_all() # Create the derating plot. _frame = ramstk.RAMSTKFrame( label=_(u"Derating Curve and Operating Point")) _frame.add(self.pltDerate.plot) _frame.show_all() self.pack2(_frame, True, True) return _return
def make_page(self): """ Make the Hardware gtk.Notebook() assessment results page. :return: _x_pos, _y_pos :rtype: tuple """ _attributes = self._dtc_data_controller.request_get_attributes( self._hardware_id) if _attributes['hazard_rate_method_id'] == 1: self._lblModel.set_markup( u"<span foreground=\"blue\">\u03BB<sub>EQUIP</sub> = " u"\u03BB<sub>g</sub>\u03C0<sub>Q</sub></span>") self._lst_labels[0] = u"\u03BB<sub>g</sub>:" else: try: self._lblModel.set_markup( self._dic_part_stress[self._subcategory_id]) except KeyError: self._lblModel.set_markup(_(u"Missing Model")) self._lst_labels[0] = u"\u03BB<sub>b</sub>:" _x_pos, _y_pos = ramstk.make_label_group(self._lst_labels, self, 5, 35) _x_pos += 50 self.put(self._lblModel, _x_pos, 5) self.put(self.txtLambdaB, _x_pos, _y_pos[0]) self.put(self.txtPiQ, _x_pos, _y_pos[1]) self.put(self.txtPiE, _x_pos, _y_pos[2]) return _x_pos, _y_pos
def make_page(self): """ Make the Hardware class gtk.Notebook() assessment input page. :return: _x_pos, _y_pos :rtype: tuple """ self.do_load_comboboxes(subcategory_id=self._subcategory_id) self.do_set_sensitive() # Build the assessment input container for hardware items. _x_pos, _y_pos = ramstk.make_label_group(self._lst_labels, self, 5, 5) _x_pos += 50 self.put(self.cmbQuality, _x_pos, _y_pos[0]) return _x_pos, _y_pos
def _make_page(self): """ Make the Hardware module stress input container. :return: False if successful or True if an error is encountered. :rtype: bool """ _x_pos, _y_pos = ramstk.make_label_group(self._lst_labels, self, 5, 5) _x_pos += 50 self.put(self.txtTemperatureRatedMin, _x_pos, _y_pos[0]) self.put(self.txtTemperatureKnee, _x_pos, _y_pos[1]) self.put(self.txtTemperatureRatedMax, _x_pos, _y_pos[2]) self.put(self.txtCurrentRated, _x_pos, _y_pos[3]) self.put(self.txtCurrentOperating, _x_pos, _y_pos[4]) self.put(self.txtPowerRated, _x_pos, _y_pos[5]) self.put(self.txtPowerOperating, _x_pos, _y_pos[6]) self.put(self.txtVoltageRated, _x_pos, _y_pos[7]) self.put(self.txtVoltageAC, _x_pos, _y_pos[8]) self.put(self.txtVoltageDC, _x_pos, _y_pos[9]) self.show_all() return None
def _make_assessment_results_page(self): """ Create the gtk.Notebook() page for displaying assessment results. :return: False if successful or True if an error is encountered. :rtype: boolean """ _hbox = gtk.HBox() # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # # Build the left half of the page. # # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # _fxd_left = gtk.Fixed() _scrollwindow = ramstk.RAMSTKScrolledWindow(_fxd_left) _frame = ramstk.RAMSTKFrame(label=_(u"Reliability Results")) _frame.add(_scrollwindow) _hbox.pack_start(_frame) _x_pos_l, _y_pos_l = ramstk.make_label_group( self._lst_assess_labels[0], _fxd_left, 5, 5) _x_pos_l += 50 _fxd_left.put(self.txtActiveHt, _x_pos_l, _y_pos_l[0]) _fxd_left.put(self.txtDormantHt, _x_pos_l, _y_pos_l[1]) _fxd_left.put(self.txtSoftwareHt, _x_pos_l, _y_pos_l[2]) _fxd_left.put(self.txtPredictedHt, _x_pos_l, _y_pos_l[3]) _fxd_left.put(self.txtMissionHt, _x_pos_l, _y_pos_l[4]) _fxd_left.put(self.txtMTBF, _x_pos_l, _y_pos_l[5]) _fxd_left.put(self.txtMissionMTBF, _x_pos_l, _y_pos_l[6]) _fxd_left.put(self.txtReliability, _x_pos_l, _y_pos_l[7]) _fxd_left.put(self.txtMissionRt, _x_pos_l, _y_pos_l[8]) _fxd_left.put(self.txtPartCount, _x_pos_l, _y_pos_l[9]) _fxd_left.show_all() # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # # Build the right half of the page. # # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # _fxd_right = gtk.Fixed() _scrollwindow = ramstk.RAMSTKScrolledWindow(_fxd_right) _frame = ramstk.RAMSTKFrame(label=_(u"Maintainability Results")) _frame.add(_scrollwindow) _hbox.pack_end(_frame) _x_pos_r, _y_pos_r = ramstk.make_label_group( self._lst_assess_labels[1], _fxd_right, 5, 5) _x_pos_r += 55 _fxd_right.put(self.txtMPMT, _x_pos_r, _y_pos_r[0]) _fxd_right.put(self.txtMCMT, _x_pos_r, _y_pos_r[1]) _fxd_right.put(self.txtMTTR, _x_pos_r, _y_pos_r[2]) _fxd_right.put(self.txtMMT, _x_pos_r, _y_pos_r[3]) _fxd_right.put(self.txtAvailability, _x_pos_r, _y_pos_r[4]) _fxd_right.put(self.txtMissionAt, _x_pos_r, _y_pos_r[5]) _fxd_right.put(self.txtTotalCost, _x_pos_r, _y_pos_r[6]) _fxd_right.put(self.txtCostFailure, _x_pos_r, _y_pos_r[7]) _fxd_right.put(self.txtCostHour, _x_pos_r, _y_pos_r[8]) _fxd_right.show_all() _label = ramstk.RAMSTKLabel( _(u"Assessment\nResults"), height=30, width=-1, justify=gtk.JUSTIFY_CENTER, tooltip=_(u"Displays reliability, " u"maintainability, and availability " u"assessment results for the selected " u"{0:s}.").format(self._module)) self.hbx_tab_label.pack_start(_label) return (_hbox, _fxd_left, _fxd_right, _x_pos_l, _x_pos_r, _y_pos_l, _y_pos_r)
def _make_page(self): """ Make the Requirement Work View General Data gtk.Notebook() page. :return: False if successful or True if an error is encountered. :rtype: bool """ # Load the requirement type gtk.ComboBox(); each _type is # (Code, Description, Type). _types = [] for _index, _key in enumerate( self._mdcRAMSTK.RAMSTK_CONFIGURATION.RAMSTK_REQUIREMENT_TYPE): _types.append(self._mdcRAMSTK.RAMSTK_CONFIGURATION. RAMSTK_REQUIREMENT_TYPE[_key]) self.cmbRequirementType.do_load_combo(list(_types), index=1, simple=False) # Load the owner gtk.ComboBox(); each _owner is # (Description, Group Type). _owners = [] for _index, _key in enumerate( self._mdcRAMSTK.RAMSTK_CONFIGURATION.RAMSTK_WORKGROUPS): _owners.append( self._mdcRAMSTK.RAMSTK_CONFIGURATION.RAMSTK_WORKGROUPS[_key]) self.cmbOwner.do_load_combo(list(_owners)) # Load the priority gtk.Combo(). _priorities = [["1"], ["2"], ["3"], ["4"], ["5"]] self.cmbPriority.do_load_combo(_priorities) # Build the General Data page. _fixed = gtk.Fixed() _scrollwindow = ramstk.RAMSTKScrolledWindow(_fixed) _frame = ramstk.RAMSTKFrame(label=_(u"General Information")) _frame.add(_scrollwindow) _x_pos, _y_pos = ramstk.make_label_group(self._lst_gendata_labels, _fixed, 5, 5) _x_pos += 50 _fixed.put(self.txtCode, _x_pos, _y_pos[0]) _fixed.put(self.txtName, _x_pos, _y_pos[1]) _fixed.put(self.cmbRequirementType, _x_pos, _y_pos[2]) _fixed.put(self.chkDerived, _x_pos, _y_pos[3] + 5) _fixed.put(self.txtSpecification, _x_pos, _y_pos[4]) _fixed.put(self.txtPageNum, _x_pos, _y_pos[5]) _fixed.put(self.txtFigNum, _x_pos, _y_pos[6]) _fixed.put(self.cmbPriority, _x_pos, _y_pos[7]) _fixed.put(self.cmbOwner, _x_pos, _y_pos[8]) _fixed.put(self.chkValidated, _x_pos, _y_pos[9] + 5) _fixed.put(self.txtValidatedDate, _x_pos, _y_pos[10]) _fixed.put(self.btnValidateDate, _x_pos + 205, _y_pos[10]) _fixed.show_all() # Create the label for the gtk.Notebook() tab. _label = ramstk.RAMSTKLabel( _(u"General\nData"), height=30, width=-1, justify=gtk.JUSTIFY_CENTER, tooltip=_(u"Displays general information for the selected " u"requirement.")) self.hbx_tab_label.pack_start(_label) return _frame