def _loadGroupBox3(self, pmGroupBox): """ Load widgets in group box. """ self.enableMaterialPropertiesComboBox = \ PM_CheckBox( pmGroupBox, text = "On") self.finishDoubleSpinBox = \ PM_DoubleSpinBox(pmGroupBox, maximum = 1.0, minimum = 0.0, decimals = 2, singleStep = .1, label = "Finish:") self.shininessDoubleSpinBox = \ PM_DoubleSpinBox(pmGroupBox, maximum = 60, minimum = 15, decimals = 2, label = "Shininess:") self.brightnessDoubleSpinBox = \ PM_DoubleSpinBox(pmGroupBox, maximum = 1.0, minimum = 0.0, decimals = 2, singleStep = .1, label = "Brightness:") return
def _loadGroupBox2(self, pmGroupBox): """ Load widgets in group box 4. """ self.conformationComboBox = \ PM_ComboBox( pmGroupBox, label = "Conformation:", choices = ["B-DNA"], setAsDefault = True) dnaModelChoices = ['PAM3', 'PAM5'] self.dnaModelComboBox = \ PM_ComboBox( pmGroupBox, label = "Model:", choices = dnaModelChoices, setAsDefault = True) self.basesPerTurnDoubleSpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Bases per turn:", value = env.prefs[bdnaBasesPerTurn_prefs_key], setAsDefault = True, minimum = 8.0, maximum = 20.0, decimals = 2, singleStep = 0.1 ) self.duplexRiseDoubleSpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Rise:", value = env.prefs[bdnaRise_prefs_key], setAsDefault = True, minimum = 2.0, maximum = 4.0, decimals = 3, singleStep = 0.01 ) # Strand Length (i.e. the number of bases) self.numberOfBasePairsSpinBox = \ PM_SpinBox( pmGroupBox, label = "Base pairs:", value = self._numberOfBases, setAsDefault = False, minimum = 0, maximum = 10000 ) self.numberOfBasePairsSpinBox.setDisabled(True) # Duplex Length self.duplexLengthLineEdit = \ PM_LineEdit( pmGroupBox, label = "Duplex length: ", text = "0.0 Angstroms", setAsDefault = False) self.duplexLengthLineEdit.setDisabled(True)
def _loadGroupBox1(self, pmGroupBox): """ Load widgets in 1st group box. @param pmGroupBox: The 1st group box in the PM. @type pmGroupBox: L{PM_GroupBox} """ self.widthDblSpinBox = \ PM_DoubleSpinBox(pmGroupBox, label = "Width:", value = 16.0, setAsDefault = True, minimum = 1.0, maximum = 10000.0, # 1000 nm singleStep = 1.0, decimals = 1, suffix = ' Angstroms') self.heightDblSpinBox = \ PM_DoubleSpinBox(pmGroupBox, label =" Height:", value = 16.0, setAsDefault = True, minimum = 1.0, maximum = 10000.0, # 1000 nm singleStep = 1.0, decimals = 1, suffix = ' Angstroms') self.aspectRatioCheckBox = \ PM_CheckBox(pmGroupBox, text = 'Maintain Aspect Ratio of:' , widgetColumn = 1, state = Qt.Unchecked ) self.aspectRatioSpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "", value = 1.0, setAsDefault = True, minimum = 0.1, maximum = 10.0, singleStep = 0.1, decimals = 2, suffix = " to 1.00") if self.aspectRatioCheckBox.isChecked(): self.aspectRatioSpinBox.setEnabled(True) else: self.aspectRatioSpinBox.setEnabled(False)
def _loadGroupBox2(self, pmGroupBox): """ Load widgets in groubox 2. """ if self.editCommand and self.editCommand.struct: length = self.editCommand.struct.length width = self.editCommand.struct.width spoke_radius = self.editCommand.struct.sradius normcolor = self.editCommand.struct.normcolor else: length = 10 width = 1 spoke_radius = 0.2 normcolor = gray self.motorLengthDblSpinBox = \ PM_DoubleSpinBox(pmGroupBox, label = "Motor length :", value = length, setAsDefault = True, minimum = 0.5, maximum = 500.0, singleStep = 0.5, decimals = 1, suffix = ' Angstroms') self.motorWidthDblSpinBox = \ PM_DoubleSpinBox(pmGroupBox, label="Motor width :", value = width, setAsDefault = True, minimum = 0.1, maximum = 50.0, singleStep = 0.1, decimals = 1, suffix = ' Angstroms') self.spokeRadiusDblSpinBox = \ PM_DoubleSpinBox(pmGroupBox, label = "Spoke radius :", value = spoke_radius, setAsDefault = True, minimum = 0.1, maximum = 50.0, singleStep = 0.1, decimals = 1, suffix = ' Angstroms') self.motorColorComboBox = \ PM_ColorComboBox(pmGroupBox, color = normcolor) return
def _loadGroupBox1(self, pmGroupBox): """ Load widgets in group box 4. """ self.nameLineEdit = PM_LineEdit(pmGroupBox, label="Strand name:", text="", setAsDefault=False) self.numberOfBasesSpinBox = \ PM_SpinBox( pmGroupBox, label = "Number of bases:", value = self._numberOfBases, setAsDefault = False, minimum = 2, maximum = 10000 ) self.basesPerTurnDoubleSpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Bases per turn:", value = self.basesPerTurn, setAsDefault = True, minimum = 8.0, maximum = 20.0, decimals = 2, singleStep = 0.1 ) self.duplexRiseDoubleSpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Rise:", value = self.duplexRise, setAsDefault = True, minimum = 2.0, maximum = 4.0, decimals = 3, singleStep = 0.01 ) self.disableStructHighlightingCheckbox = \ PM_CheckBox( pmGroupBox, text = "Don't highlight while editing DNA", widgetColumn = 0, state = Qt.Unchecked, setAsDefault = True, spanWidth = True ) #As of 2008-03-31, the properties such as number of bases will be #editable only by using the resize handles. post FNANO we will support #the self.numberOfBasesSpinBox.setEnabled(False) self.basesPerTurnDoubleSpinBox.setEnabled(False) self.duplexRiseDoubleSpinBox.setEnabled(False)
def _loadGroupBox2(self, pmGroupBox): """ Load widgets in group box. @param pmGroupBox: group box that contains protein display choices @see: L{PM_GroupBox} """ proteinStyleChoices = [ 'CA trace (wire)', 'CA trace (cylinders)', 'CA trace (ball and stick)', 'Tube', 'Ladder', 'Zigzag', 'Flat ribbon', 'Solid ribbon', 'Cartoons', 'Fancy cartoons', 'Peptide tiles' ] self.proteinStyleComboBox = \ PM_ComboBox( pmGroupBox, label = "Style:", choices = proteinStyleChoices, setAsDefault = True) scaleChoices = ['Constant', 'Secondary structure', 'B-factor'] self.scaleComboBox = \ PM_ComboBox( pmGroupBox, label = "Scaling:", choices = scaleChoices, setAsDefault = True) self.scaleFactorDoubleSpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Scaling factor:", value = 1.00, setAsDefault = True, minimum = 0.1, maximum = 3.0, decimals = 1, singleStep = 0.1 ) self.splineDoubleSpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Resolution:", value = 3, setAsDefault = True, minimum = 2, maximum = 8, decimals = 0, singleStep = 1 ) self.smoothingCheckBox = \ PM_CheckBox( pmGroupBox, text = "Smoothing", setAsDefault = True)
def _loadOffsetSpecsGroupBox(self, inPmGroupBox): """ Load widgets in the Offset specs groupbox (which is a groupbox within the B{Advanced Options group box}). @param inPmGroupBox: The Offset Specs gropbox box @type inPmGroupBox: L{PM_GroupBox} """ self.extrudeSpinBox_length = \ PM_DoubleSpinBox( inPmGroupBox, label = "Total offset", value = 7.0, setAsDefault = True, minimum = 0.1, maximum = 2000.0, singleStep = 1, decimals = 3, suffix = ' Angstroms' ) self.extrudeSpinBox_x = \ PM_DoubleSpinBox( inPmGroupBox, label = "X offset", value = 0, minimum = -1000.0, maximum = 1000.0, singleStep = 1, decimals = 3, suffix = ' Angstroms' ) self.extrudeSpinBox_y = \ PM_DoubleSpinBox( inPmGroupBox, label = "Y offset", value = 0, minimum = -1000.0, maximum = 1000.0, singleStep = 1, decimals = 3, suffix = ' Angstroms' ) self.extrudeSpinBox_z = \ PM_DoubleSpinBox( inPmGroupBox, label = "Z offset", value = 0, minimum = -1000.0, maximum = 1000.0, singleStep = 1, decimals = 3, suffix = ' Angstroms' )
def _loadGroupBox1(self, pmGroupBox): """ Load widgets in group box 4. """ self.nameLineEdit = PM_LineEdit(pmGroupBox, label="Segment name:", text="", setAsDefault=False) # Strand Length (i.e. the number of bases) self.numberOfBasePairsSpinBox = \ PM_SpinBox( pmGroupBox, label = "Base pairs:", value = self._numberOfBases, setAsDefault = False, minimum = 2, maximum = 10000 ) self.basesPerTurnDoubleSpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Bases per turn:", value = self.basesPerTurn, setAsDefault = True, minimum = 8.0, maximum = 20.0, decimals = 2, singleStep = 0.1 ) self.basesPerTurnDoubleSpinBox.setDisabled(True) self.duplexRiseDoubleSpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Rise:", value = self.duplexRise, setAsDefault = True, minimum = 2.0, maximum = 4.0, decimals = 3, singleStep = 0.01 ) self.duplexRiseDoubleSpinBox.setDisabled(True) # Duplex Length self.duplexLengthLineEdit = \ PM_LineEdit( pmGroupBox, label = "Duplex length: ", text = "0.0 Angstroms", setAsDefault = False) self.duplexLengthLineEdit.setDisabled(True)
def _loadGroupBox1(self, inPmGroupBox): """ Load widgets into group box 1. """ # User input to specify what type of element/atom to generate elementComboBoxItems = self._sElementSymbolList self.elementComboBox = \ PM_ComboBox( inPmGroupBox, label = "Elements :", choices = elementComboBoxItems, index = 0, setAsDefault = True, spanWidth = False ) # User input to specify x-coordinate # of the generated atom's position. self.xCoordinateField = \ PM_DoubleSpinBox( inPmGroupBox, label = "x :", value = 0.0, setAsDefault = True, minimum = self._sMinCoordinateValue, maximum = self._sMaxCoordinateValue, singleStep = self._sStepCoordinateValue, decimals = self._sCoordinateDecimals, suffix = ' ' + self._sCoordinateUnits ) return
def _loadGroupBox4(self, inPmGroupBox): """ Load widgets in group box 4. """ # "Number of Nanotubes" SpinBox self.mwntCountSpinBox = \ PM_SpinBox( inPmGroupBox, label = "Number:", value = 1, setAsDefault = True, minimum = 1, maximum = 10, suffix = " nanotubes" ) self.mwntCountSpinBox.setSpecialValueText("SWNT") # "Spacing" lineedit. self.mwntSpacingDoubleSpinBox = \ PM_DoubleSpinBox( inPmGroupBox, label = "Spacing:", value = 2.46, setAsDefault = True, minimum = 1.0, maximum = 10.0, singleStep = 0.1, decimals = 3, suffix = " Angstroms" )
def _loadGroupBox1(self, pmGroupBox): """ Load widgets in MotorParamsGroupBox. """ if self.editCommand and self.editCommand.struct: force = self.editCommand.struct.force stiffness = self.editCommand.struct.stiffness enable_minimize = self.editCommand.struct.enable_minimize else: force = 0.0 stiffness = 0.0 enable_minimize = False self.forceDblSpinBox = \ PM_DoubleSpinBox(pmGroupBox, label = "Force:", value = force, setAsDefault = True, minimum = 0.0, maximum = 5000.0, singleStep = 1.0, decimals = 1, suffix =' pN') self.stiffnessDblSpinBox = \ PM_DoubleSpinBox(pmGroupBox, label = "Stiffness:", value = stiffness, setAsDefault = True, minimum = 0.0, maximum = 1000.0, singleStep = 1.0, decimals = 1, suffix =' N/m') self.enableMinimizeCheckBox = \ PM_CheckBox(pmGroupBox, text ="Enable in minimize", widgetColumn = 1 ) self.enableMinimizeCheckBox.setChecked(enable_minimize) self.directionPushButton = \ PM_PushButton(pmGroupBox, label = "Direction :", text = "Reverse", spanWidth = False) return
def loadGroupBox1(self, inPmGroupBox): """ Load widgets into groupbox 1. """ # User input to specify x-coordinate # of the generated atom's position. self.xCoordinateField = \ PM_DoubleSpinBox( inPmGroupBox, label = \ "ui/actions/Properties Manager/X_Coordinate.png", value = 0.0, setAsDefault = True, minimum = self._sMinCoordinateValue, maximum = self._sMaxCoordinateValue, singleStep = self._sStepCoordinateValue, decimals = self._sCoordinateDecimals, suffix = ' ' + self._sCoordinateUnits ) # User input to specify y-coordinate # of the generated atom's position. self.yCoordinateField = \ PM_DoubleSpinBox( inPmGroupBox, label = \ "ui/actions/Properties Manager/Y_Coordinate.png", value = 0.0, setAsDefault = True, minimum = self._sMinCoordinateValue, maximum = self._sMaxCoordinateValue, singleStep = self._sStepCoordinateValue, decimals = self._sCoordinateDecimals, suffix = ' ' + self._sCoordinateUnits ) # User input to specify z-coordinate # of the generated atom's position. self.zCoordinateField = \ PM_DoubleSpinBox( inPmGroupBox, label = \ "ui/actions/Properties Manager/Z_Coordinate.png", value = 0.0, setAsDefault = True, minimum = self._sMinCoordinateValue, maximum = self._sMaxCoordinateValue, singleStep = self._sStepCoordinateValue, decimals = self._sCoordinateDecimals, suffix = ' ' + self._sCoordinateUnits )
def _loadGroupBox1(self, pmGroupBox): """ Load widgets in groubox 1. """ self.heightField = \ PM_DoubleSpinBox( pmGroupBox, label = "Height :", value = 20.0, setAsDefault = True, minimum = 1.0, maximum = 100.0, singleStep = 1.0, decimals = 3, suffix = ' Angstroms') self.widthField = \ PM_DoubleSpinBox( pmGroupBox, label = "Width :", value = 20.0, setAsDefault = True, minimum = 1.0, maximum = 100.0, singleStep = 1.0, decimals = 3, suffix = ' Angstroms') self.bondLengthField = \ PM_DoubleSpinBox( pmGroupBox, label = "Bond Length :", value = CC_GRAPHITIC_BONDLENGTH, setAsDefault = True, minimum = 1.0, maximum = 3.0, singleStep = 0.1, decimals = 3, suffix = ' Angstroms') endingChoices = ["None", "Hydrogen", "Nitrogen"] self.endingsComboBox= \ PM_ComboBox( pmGroupBox, label = "Endings :", choices = endingChoices, index = 0, setAsDefault = True, spanWidth = False )
def _loadGroupBox2(self, inPmGroupBox): """ Load widgets in group box 2. """ self.zDistortionField = \ PM_DoubleSpinBox( inPmGroupBox, label = "Z-distortion :", value = 0.0, setAsDefault = True, minimum = 0.0, maximum = 10.0, singleStep = 0.1, decimals = 3, suffix = " Angstroms" ) self.xyDistortionField = \ PM_DoubleSpinBox( inPmGroupBox, label = "XY-distortion :", value = 0.0, setAsDefault = True, minimum = 0.0, maximum = 2.0, singleStep = 0.1, decimals = 3, suffix = " Angstroms" ) self.twistSpinBox = \ PM_SpinBox( inPmGroupBox, label = "Twist :", value = 0, setAsDefault = True, minimum = 0, maximum = 100, # What should maximum be? suffix = " deg/A" ) self.bendSpinBox = \ PM_SpinBox( inPmGroupBox, label = "Bend :", value = 0, setAsDefault = True, minimum = 0, maximum = 360, suffix = " deg" )
def _loadGroupBox2(self, pmGroupBox): """ Load widgets in group box. """ self.discreteStepsCheckBox = \ PM_CheckBox( pmGroupBox, text = "Use discrete steps", setAsDefault = True, state = Qt.Unchecked) self.chi1SpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Chi1 angle:", value = 0.000, setAsDefault = True, minimum = -180.0, maximum = 180.0, decimals = 1, singleStep = 1.0, spanWidth = False) self.chi2SpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Chi2 angle:", value = 0.000, setAsDefault = True, minimum = -180.0, maximum = 180.0, decimals = 1, singleStep = 1.0, spanWidth = False) self.chi3SpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Chi3 angle:", value = 0.000, setAsDefault = True, minimum = -180.0, maximum = 180.0, decimals = 1, singleStep = 1.0, spanWidth = False)
def _loadCoordinateSpinBoxes(self): """ Load the coordinateSpinboxes groupbox with the x, y, z spinboxes """ # User input to specify x-coordinate self.xSpinBox = \ PM_DoubleSpinBox( self, label = \ "ui/actions/Properties Manager/X_Coordinate.png", value = 0.0, setAsDefault = True, minimum = - 9999999, maximum = 9999999, singleStep = 1, decimals = 3, suffix = " A") # User input to specify y-coordinate self.ySpinBox = \ PM_DoubleSpinBox( self, label = \ "ui/actions/Properties Manager/Y_Coordinate.png", value = 0.0, setAsDefault = True, minimum = - 9999999, maximum = 9999999, singleStep = 1, decimals = 3, suffix = " A") # User input to specify z-coordinate self.zSpinBox = \ PM_DoubleSpinBox( self, label = \ "ui/actions/Properties Manager/Z_Coordinate.png", value = 0.0, setAsDefault = True, minimum = - 9999999, maximum = 9999999, singleStep = 1, decimals = 3, suffix = " A")
def _loadAxisGroupBox(self): """ Load the Axis group box. """ axisGroupBox = PM_GroupBox( None ) self.axisGroupBox = axisGroupBox axisShapeChoices = ['None', 'Wide tube', 'Narrow tube'] self.axisShapeComboBox = \ PM_ComboBox( axisGroupBox , label = "Shape:", choices = axisShapeChoices, setAsDefault = True) self.axisScaleDoubleSpinBox = \ PM_DoubleSpinBox( axisGroupBox, label = "Scale:", value = 1.00, setAsDefault = True, minimum = 0.1, maximum = 2.0, decimals = 2, singleStep = 0.1 ) axisColorChoices = ['Same as chunk', 'Base order', 'Base order (discrete)', 'Base type', 'Strand order'] self.axisColorComboBox = \ PM_ComboBox( axisGroupBox , label = "Color:", choices = axisColorChoices, setAsDefault = True) endingTypeChoices = ['Flat', 'Taper start', 'Taper end', 'Taper both', 'Spherical'] self.axisEndingStyleComboBox = \ PM_ComboBox( axisGroupBox , label = "Ending style:", choices = endingTypeChoices, setAsDefault = True)
def _loadStrandsGroupBox(self): """ Load the Strands group box. """ strandsGroupBox = PM_GroupBox( None ) self.strandsGroupBox = strandsGroupBox strandsShapeChoices = ['None', 'Cylinders', 'Tube'] self.strandsShapeComboBox = \ PM_ComboBox( strandsGroupBox , label = "Shape:", choices = strandsShapeChoices, setAsDefault = True) self.strandsScaleDoubleSpinBox = \ PM_DoubleSpinBox( strandsGroupBox, label = "Scale:", value = 1.00, setAsDefault = True, minimum = 0.1, maximum = 5.0, decimals = 2, singleStep = 0.1 ) strandsColorChoices = ['Same as chunk', 'Base order', 'Strand order'] self.strandsColorComboBox = \ PM_ComboBox( strandsGroupBox , label = "Color:", choices = strandsColorChoices, setAsDefault = True) strandsArrowsChoices = ['None', '5\'', '3\'', '5\' and 3\''] self.strandsArrowsComboBox = \ PM_ComboBox( strandsGroupBox , label = "Arrows:", choices = strandsArrowsChoices, setAsDefault = True)
def _loadNucleotidesGroupBox(self): """ Load the Nucleotides group box. """ nucleotidesGroupBox = PM_GroupBox( None ) self.nucleotidesGroupBox = nucleotidesGroupBox nucleotidesShapeChoices = ['None', 'Sugar spheres', 'Base cartoons'] self.nucleotidesShapeComboBox = \ PM_ComboBox( nucleotidesGroupBox , label = "Shape:", choices = nucleotidesShapeChoices, setAsDefault = True) self.nucleotidesScaleDoubleSpinBox = \ PM_DoubleSpinBox( nucleotidesGroupBox, label = "Scale:", value = 1.00, setAsDefault = True, minimum = 0.1, maximum = 3.0, decimals = 2, singleStep = 0.1 ) nucleotidesColorChoices = ['Same as strand', 'Base order', 'Strand order', 'Base type'] self.nucleotidesColorComboBox = \ PM_ComboBox( nucleotidesGroupBox , label = "Color:", choices = nucleotidesColorChoices, setAsDefault = True) self.dnaStyleBasesDisplayLettersCheckBox = \ PM_CheckBox(nucleotidesGroupBox , text = 'Display base letters', widgetColumn = 1 )
def _loadPM_DoubleSpinBox(self, inPmGroupBox): """ PM_DoubleSpinBox widgets. """ self.doubleSpinBox = \ PM_DoubleSpinBox( inPmGroupBox, #label="Spanning DoubleSpinBox :", label = "", # No label value = 5.0, setAsDefault = True, minimum = 1.0, maximum = 10.0, singleStep = 1.0, decimals = 1, suffix = ' Suffix', spanWidth = True ) # Add a prefix example. self.doubleSpinBox.setPrefix("Prefix ")
def _loadStrutsGroupBox(self): """ Load the Struts group box. """ strutsGroupBox = PM_GroupBox( None ) self.strutsGroupBox = strutsGroupBox strutsShapeChoices = ['None', 'Base-axis-base cylinders', 'Straight cylinders'] self.strutsShapeComboBox = \ PM_ComboBox( strutsGroupBox , label = "Shape:", choices = strutsShapeChoices, setAsDefault = True) self.strutsScaleDoubleSpinBox = \ PM_DoubleSpinBox( strutsGroupBox, label = "Scale:", value = 1.00, setAsDefault = True, minimum = 0.1, maximum = 3.0, decimals = 2, singleStep = 0.1 ) strutsColorChoices = ['Same as strand', 'Base order', 'Strand order', 'Base type'] self.strutsColorComboBox = \ PM_ComboBox( strutsGroupBox , label = "Color:", choices = strutsColorChoices, setAsDefault = True)
def _loadGroupBox1(self, pmGroupBox): """ Load widgets in group box. """ self.structure1LineEdit = \ PM_LineEdit( pmGroupBox, label = "First structure:", setAsDefault = False) self.structure1LineEdit.setEnabled(False) self.structure2LineEdit = \ PM_LineEdit( pmGroupBox, label = "Second structure:", setAsDefault = False) self.structure2LineEdit.setEnabled(False) self.thresholdDoubleSpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Threshold:", value = self.threshold, setAsDefault = True, minimum = 0.0, maximum = 360.0, decimals = 1, singleStep = 30.0, suffix = " deg", spanWidth = False) self.comparePushButton = \ PM_PushButton( pmGroupBox, text = "Compare", setAsDefault = True) self.hidePushButton = \ PM_PushButton( pmGroupBox, text = "Hide differences", setAsDefault = True) return
def _loadByDeltaGroupBox(self, inPmGroupBox): """ Load widgets in the translate By Delta group box, which is present within the Translate groupbox. @param inPmGroupBox: The Translate By Delta group box in the translate group box. @type inPmGroupBox: L{PM_GroupBox} """ self.moveDeltaXSpinBox = \ PM_DoubleSpinBox( inPmGroupBox, label = "ui/actions/Properties Manager/Delta_X.png", value = 0.0, setAsDefault = True, minimum = -100.0, maximum = 100.0, singleStep = 1.0, decimals = 3, suffix = ' Angstroms', spanWidth = False ) self.moveDeltaYSpinBox = \ PM_DoubleSpinBox( inPmGroupBox, label = "ui/actions/Properties Manager/Delta_Y.png", value = 0.0, setAsDefault = True, minimum = -100.0, maximum = 100.0, singleStep = 1.0, decimals = 3, suffix = ' Angstroms', spanWidth = False ) self.moveDeltaZSpinBox = \ PM_DoubleSpinBox( inPmGroupBox, label = "ui/actions/Properties Manager/Delta_Z.png", value = 0.0, setAsDefault = True, minimum = -100.0, maximum = 100.0, singleStep = 1.0, decimals = 3, suffix = ' Angstroms', spanWidth = False ) DELTA_BUTTONS = [ ("QToolButton", 1, "Delta Plus", "ui/actions/Properties Manager/Move_Delta_Plus.png", "", "+", 0), ("QToolButton", 2, "Delta Minus", "ui/actions/Properties Manager/Move_Delta_Minus.png", "", "-", 1) ] self.translateDeltaButtonRow = \ PM_ToolButtonRow( inPmGroupBox, title = "", buttonList = DELTA_BUTTONS, label = 'Translate:', isAutoRaise = True, isCheckable = False ) self.transDeltaPlusButton = \ self.translateDeltaButtonRow.getButtonById(1) self.transDeltaMinusButton = \ self.translateDeltaButtonRow.getButtonById(2)
def loadTestWidgets1(self, inPmGroupBox): """ Adds widgets to <inPmGroupBox>. Used for testing purposes. Mark 2007-05-24 """ # I intend to create a special PropMgr to display all widget types # for testing purposes. For now, I just add them to the end of the # Graphene Sheet property manager. Mark 2007-05-22 self.spinBox = \ PM_SpinBox( inPmGroupBox, label = "Spinbox:", value = 5, setAsDefault = True, minimum = 2, maximum = 10, suffix = ' things', spanWidth = True ) self.doubleSpinBox = \ PM_DoubleSpinBox( inPmGroupBox, #label="Spanning DoubleSpinBox :", label = "", # No label value = 5.0, setAsDefault = True, minimum = 1.0, maximum = 10.0, singleStep = 1.0, decimals = 1, suffix = ' Suffix', spanWidth = True ) # Add a prefix example. self.doubleSpinBox.setPrefix("Prefix ") choices = [ "First", "Second", "Third (Default)", "Forth" ] self.comboBox1= \ PM_ComboBox( inPmGroupBox, label = 'Choices: ', choices = choices, index = 2, setAsDefault = True, spanWidth = False ) self.comboBox2= \ PM_ComboBox( inPmGroupBox, label = ' :Choices', labelColumn = 1, choices = choices, index = 2, setAsDefault = True, spanWidth = False ) self.comboBox3= \ PM_ComboBox( inPmGroupBox, label = ' Choices (SpanWidth = True):', labelColumn = 1, choices = choices, index = 2, setAsDefault = True, spanWidth = True ) self.textEdit = \ PM_TextEdit( inPmGroupBox, label = "TextEdit:", spanWidth = False ) self.spanTextEdit = \ PM_TextEdit( inPmGroupBox, label = "", spanWidth = True ) self.groupBox = \ PM_GroupBox( inPmGroupBox, title = "Group Box Title" ) self.comboBox2= \ PM_ComboBox( self.groupBox, label = "Choices:", choices = choices, index = 2, setAsDefault = True, spanWidth = False ) self.groupBox2 = \ PM_GroupBox( inPmGroupBox, title = "Group Box Title" ) self.comboBox3= \ PM_ComboBox( self.groupBox2, label = "Choices:", choices = choices, index = 2, setAsDefault = True, spanWidth = True ) self.pushButton1 = \ PM_PushButton( inPmGroupBox, label = "", text = "PushButton1" ) self.pushButton2 = \ PM_PushButton( inPmGroupBox, label = "", text = "PushButton2", spanWidth = True )
def _loadBySpecifiedAngleGroupBox(self, inPmGroupBox): """ Load widgets in the Rotate By Specified Angle group box, which is present within the Rotate groupbox. @param inPmGroupBox: Rotate By Specified Angle group box in the Rotate group box. @type inPmGroupBox: L{PM_GroupBox} """ # Button list to create a toolbutton row. # Format: # - buttonId, # - buttonText , # - iconPath # - tooltip # - shortcut # - column BUTTON_LIST = [ ("QToolButton", 1, "ROTATEX", "ui/actions/Properties Manager/RotateX.png", "Rotate about X axis", "X", 0), ("QToolButton", 2, "ROTATEY", "ui/actions/Properties Manager/RotateY.png", "Rotate about Y axis", "Y", 1), ("QToolButton", 3, "ROTATEZ", "ui/actions/Properties Manager/RotateZ.png", "Rotate about Z axis", "Z", 2), ] self.rotateAroundAxisButtonRow = \ PM_ToolButtonRow( inPmGroupBox, title = "", buttonList = BUTTON_LIST, alignment = 'Right', label = 'Rotate Around:' ) self.rotXaxisButton = \ self.rotateAroundAxisButtonRow.getButtonById(1) self.rotYaxisButton = \ self.rotateAroundAxisButtonRow.getButtonById(2) self.rotZaxisButton = \ self.rotateAroundAxisButtonRow.getButtonById(3) self.rotateThetaSpinBox = \ PM_DoubleSpinBox(inPmGroupBox, label = "Rotate By:", value = 0.0, setAsDefault = True, minimum = 0, maximum = 360.0, singleStep = 1.0, decimals = 2, suffix = ' Degrees') THETA_BUTTONS = [ ("QToolButton", 1, "Theta Plus", "ui/actions/Properties Manager/Move_Theta_Plus.png", "", "+", 0), ("QToolButton", 2, "Theta Minus", "ui/actions/Properties Manager/Move_Theta_Minus.png", "", "-", 1) ] self.rotateThetaButtonRow = \ PM_ToolButtonRow( inPmGroupBox, title = "", buttonList = THETA_BUTTONS, label = 'Direction:', isAutoRaise = True, isCheckable = False ) self.rotateThetaPlusButton = self.rotateThetaButtonRow.getButtonById(1) self.rotateThetaMinusButton = self.rotateThetaButtonRow.getButtonById( 2)
def _loadGroupBox1(self, pmGroupBox): """ Load widgets in group box 1. """ # Duplex Length self.duplexLengthSpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Duplex Length: ", value = 0, setAsDefault = False, minimum = 0, maximum = 34000, singleStep = self.getDuplexRise("B-DNA"), decimals = 3, suffix = ' Angstroms') self.connect(self.duplexLengthSpinBox, SIGNAL("valueChanged(double)"), self.duplexLengthChanged) # Strand Length self.strandLengthSpinBox = \ PM_SpinBox( pmGroupBox, label = "Strand Length :", value = 0, setAsDefault = False, minimum = 0, maximum = 10000, suffix = ' bases' ) self.connect(self.strandLengthSpinBox, SIGNAL("valueChanged(int)"), self.strandLengthChanged) # New Base choices newBaseChoices = [] for theBase in basesDict.keys(): newBaseChoices = newBaseChoices \ + [ theBase + ' (' \ + basesDict[theBase]['Name'] + ')' ] try: defaultBaseChoice = basesDict.keys().index('N') except: defaultBaseChoice = 0 # Strand Sequence self.sequenceTextEdit = \ PM_TextEdit( pmGroupBox, label = "", spanWidth = True ) self.sequenceTextEdit.setCursorWidth(2) self.sequenceTextEdit.setWordWrapMode(QTextOption.WrapAnywhere) self.connect(self.sequenceTextEdit, SIGNAL("textChanged()"), self.sequenceChanged) self.connect(self.sequenceTextEdit, SIGNAL("cursorPositionChanged()"), self.cursorPosChanged) # Actions self.actionsComboBox = \ PM_ComboBox( pmGroupBox, label = '', choices = self._actionChoices, index = 0, setAsDefault = True, spanWidth = True ) # If SIGNAL("activate(const QString&)") is used, we get a TypeError. # This is a bug that needs Bruce. Using currentIndexChanged(int) as # a workaround, but there is still a bug when the "Reverse" action # is selected. Mark 2007-08-15 self.connect(self.actionsComboBox, SIGNAL("currentIndexChanged(int)"), self.actionsComboBoxChanged)
def _loadGroupBox2(self, pmGroupBox): """ Load widgets in group box 2. """ _ntTypeChoices = ['Carbon', 'Boron Nitride'] self.ntTypeComboBox = \ PM_ComboBox( pmGroupBox, label = "Type:", choices = _ntTypeChoices, setAsDefault = True) self.ntRiseDoubleSpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Rise:", value = self.nanotube.getRise(), setAsDefault = True, minimum = 2.0, maximum = 4.0, decimals = 3, singleStep = 0.01 ) self.ntRiseDoubleSpinBox.hide() # Nanotube Length self.ntLengthLineEdit = \ PM_LineEdit( pmGroupBox, label = "Nanotube Length: ", text = "0.0 Angstroms", setAsDefault = False) self.ntLengthLineEdit.setDisabled(True) self.ntLengthLineEdit.hide() # Nanotube diameter self.ntDiameterLineEdit = \ PM_LineEdit( pmGroupBox, label = "Diameter: ", setAsDefault = False) self.ntDiameterLineEdit.setDisabled(True) self.updateNanotubeDiameter() self.chiralityNSpinBox = \ PM_SpinBox( pmGroupBox, label = "Chirality (n):", value = self.nanotube.getChiralityN(), minimum = 2, maximum = 100, setAsDefault = True ) self.chiralityMSpinBox = \ PM_SpinBox( pmGroupBox, label = "Chirality (m):", value = self.nanotube.getChiralityM(), minimum = 0, maximum = 100, setAsDefault = True ) # How about having user prefs for CNT and BNNT bond lengths? # I'm guessing that if the user wants to set these values, they will # do it once and would like those bond length values persist forever. # Need to discuss with others to determine if this spinbox comes out. # --Mark 2008-03-29 self.bondLengthDoubleSpinBox = \ PM_DoubleSpinBox( pmGroupBox, label = "Bond length:", value = self.nanotube.getBondLength(), setAsDefault = True, minimum = 1.0, maximum = 3.0, singleStep = 0.1, decimals = 3, suffix = " Angstroms" ) #self.bondLengthDoubleSpinBox.hide() endingChoices = ["Hydrogen", "None"] # Removed:, "Nitrogen"] self.endingsComboBox= \ PM_ComboBox( pmGroupBox, label = "Endings:", choices = endingChoices, index = 0, setAsDefault = True, spanWidth = False )
def _loadGroupBox3(self, pmGroupBox): """ Load widgets in group box 3. """ self._endPoint1GroupBox = PM_GroupBox(pmGroupBox, title="Endpoint1") self._endPoint2GroupBox = PM_GroupBox(pmGroupBox, title="Endpoint2") # Point 1 self.x1SpinBox = \ PM_DoubleSpinBox( self._endPoint1GroupBox, label = \ "ui/actions/Properties Manager/X_Coordinate.png", value = 0, setAsDefault = True, minimum = -100.0, maximum = 100.0, decimals = 3, suffix = ' Angstroms') self.y1SpinBox = \ PM_DoubleSpinBox( self._endPoint1GroupBox, label = \ "ui/actions/Properties Manager/Y_Coordinate.png", value = 0, setAsDefault = True, minimum = -100.0, maximum = 100.0, decimals = 3, suffix = ' Angstroms') self.z1SpinBox = \ PM_DoubleSpinBox( self._endPoint1GroupBox, label = \ "ui/actions/Properties Manager/Z_Coordinate.png", value = 0, setAsDefault = True, minimum = -100.0, maximum = 100.0, decimals = 3, suffix = ' Angstroms') # Point 2 self.x2SpinBox = \ PM_DoubleSpinBox( self._endPoint2GroupBox, label = \ "ui/actions/Properties Manager/X_Coordinate.png", value = 10.0, setAsDefault = True, minimum = -100.0, maximum = 100.0, decimals = 3, suffix = ' Angstroms') self.y2SpinBox = \ PM_DoubleSpinBox( self._endPoint2GroupBox, label = \ "ui/actions/Properties Manager/Y_Coordinate.png", value = 0, setAsDefault = True, minimum = -100.0, maximum = 100.0, decimals = 3, suffix = ' Angstroms') self.z2SpinBox = \ PM_DoubleSpinBox( self._endPoint2GroupBox, label = \ "ui/actions/Properties Manager/Z_Coordinate.png", value = 0, setAsDefault = True, minimum = -100.0, maximum = 100.0, decimals = 3, suffix = ' Angstroms')
def _loadGroupBox2(self, pmGroupBox): """ Load widgets in group box. """ self.bondAngleWeightSimSpinBox = PM_DoubleSpinBox( pmGroupBox, labelColumn=0, label="Bond angle weight:", minimum=0.01, decimals=2, maximum=1.0, singleStep=0.01, value=1.0, setAsDefault=False, spanWidth=False) bond_angle_param_list = ['Amber', 'Charmm'] self.bondAngleParamComboBox = PM_ComboBox( pmGroupBox, label="Bond angle parameters:", choices=bond_angle_param_list, setAsDefault=False) self.onlybbSpinBox = PM_DoubleSpinBox(pmGroupBox, labelColumn=0, label="Only backbone rotation:", minimum=0.01, maximum=1.0, value=0.75, decimals=2, singleStep=0.01, setAsDefault=False, spanWidth=False) self.onlyrotSpinBox = PM_DoubleSpinBox(pmGroupBox, labelColumn=0, label="Only rotamer rotation:", minimum=0.01, maximum=1.0, decimals=2, value=0.25, singleStep=0.01, setAsDefault=False, spanWidth=False) self.mctempSpinBox = PM_DoubleSpinBox( pmGroupBox, labelColumn=0, label="MC simulation temperature:", minimum=0.1, value=0.6, maximum=1.0, decimals=2, singleStep=0.1, setAsDefault=False, spanWidth=False) numResidues = self._getNumResiduesForCurrentProtein() self.minresSpinBox = PM_SpinBox(pmGroupBox, labelColumn=0, label="Minimum number of residues:", minimum=2, maximum=numResidues, singleStep=1, setAsDefault=False, spanWidth=False) self.maxresSpinBox = PM_SpinBox(pmGroupBox, labelColumn=0, label="Maximum number of residues:", minimum=2, maximum=numResidues, singleStep=1, setAsDefault=False, spanWidth=False) if numResidues == 0: self.minresSpinBox.setMaximum(numResidues + 2) self.maxresSpinBox.setMaximum(numResidues + 2) return
def _loadGroupBox1(self, inPmGroupBox): """ Load widgets in the group box. """ memberChoices = [ "Custom", "Alpha helix", "Beta strand", "Pi helix", "3_10 helix", "Polyproline-II helix", "Fully extended" ] self.aaTypeComboBox= \ PM_ComboBox( inPmGroupBox, label = "Conformation:", choices = memberChoices, index = 1, setAsDefault = True, spanWidth = False ) self.connect(self.aaTypeComboBox, SIGNAL("currentIndexChanged(int)"), self._aaTypeChanged) self.phiAngleField = \ PM_DoubleSpinBox( inPmGroupBox, label = "Phi angle:", value = self.phi, setAsDefault = True, minimum = -180.0, maximum = 180.0, singleStep = 1.0, decimals = 1, suffix = " degrees") self.connect(self.phiAngleField, SIGNAL("valueChanged(double)"), self._aaPhiAngleChanged) self.phiAngleField.setEnabled(False) self.psiAngleField = \ PM_DoubleSpinBox( inPmGroupBox, label = "Psi angle:", value = self.psi, setAsDefault = True, minimum = -180.0, maximum = 180.0, singleStep = 1.0, decimals = 1, suffix = " degrees" ) self.connect(self.psiAngleField, SIGNAL("valueChanged(double)"), self._aaPsiAngleChanged) self.psiAngleField.setEnabled(False) self.aaTypesButtonGroup = \ PM_ToolButtonGrid( inPmGroupBox, buttonList = AA_BUTTON_LIST, label = "Amino acids", checkedId = self.current_amino_acid, # Glycine setAsDefault = True ) self.connect(self.aaTypesButtonGroup.buttonGroup, SIGNAL("buttonClicked(int)"), self._setAminoAcidType) return