本文整理匯總了Python中PM.PM_SpinBox.PM_SpinBox.value方法的典型用法代碼示例。如果您正苦於以下問題:Python PM_SpinBox.value方法的具體用法?Python PM_SpinBox.value怎麽用?Python PM_SpinBox.value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PM.PM_SpinBox.PM_SpinBox
的用法示例。
在下文中一共展示了PM_SpinBox.value方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: FixedBBProteinSim_PropertyManager
# 需要導入模塊: from PM.PM_SpinBox import PM_SpinBox [as 別名]
# 或者: from PM.PM_SpinBox.PM_SpinBox import value [as 別名]
#.........這裏部分代碼省略.........
if self.ex4Checkbox.isChecked() == True:
otherOptionsText = otherOptionsText + ' -ex4 '
else:
otherOptionsText = otherOptionsText.replace(' -ex4 ', '')
self.otherCommandLineOptions.setText(otherOptionsText)
return
def update_rot_opt(self, state):
"""
Update the command text edit depending on the state of the update_rot_opt
checkbox
@param state:state of the update_rot_opt checkbox
@type state: int
"""
otherOptionsText = str(self.otherCommandLineOptions.toPlainText())
if self.rotOptCheckbox.isChecked() == True:
otherOptionsText = otherOptionsText + ' -rot_opt '
else:
otherOptionsText = otherOptionsText.replace(' -rot_opt ', '')
self.otherCommandLineOptions.setText(otherOptionsText)
return
def update_try_both_his_tautomers(self, state):
"""
Update the command text edit depending on the state of the update_try_both_his_tautomers
checkbox
@param state:state of the update_try_both_his_tautomers checkbox
@type state: int
"""
otherOptionsText = str(self.otherCommandLineOptions.toPlainText())
if self.tryBothHisTautomersCheckbox.isChecked() == True:
otherOptionsText = otherOptionsText + ' -try_both_his_tautomers '
else:
otherOptionsText = otherOptionsText.replace(' -try_both_his_tautomers ', '')
self.otherCommandLineOptions.setText(otherOptionsText)
return
def update_soft_rep_design(self, state):
"""
Update the command text edit depending on the state of the update_soft_rep_design
checkbox
@param state:state of the update_soft_rep_design checkbox
@type state: int
"""
otherOptionsText = str(self.otherCommandLineOptions.toPlainText())
if self.softRepDesignCheckbox.isChecked() == True:
otherOptionsText = otherOptionsText + ' -soft_rep_design '
else:
otherOptionsText = otherOptionsText.replace(' -soft_rep_design ', '')
self.otherCommandLineOptions.setText(otherOptionsText)
return
def update_use_elec_rep(self, state):
"""
Update the command text edit depending on the state of the update_use_elec_rep
checkbox
@param state:state of the update_use_elec_rep checkbox
@type state: int
"""
otherOptionsText = str(self.otherCommandLineOptions.toPlainText())
if self.useElecRepCheckbox.isChecked() == True:
otherOptionsText = otherOptionsText + ' -use_electrostatic_repulsion '
else:
otherOptionsText = otherOptionsText.replace(' -use_electrostatic_repulsion ', '')
self.otherCommandLineOptions.setText(otherOptionsText)
return
def update_norepack_disulf(self, state):
"""
Update the command text edit depending on the state of the update_no_repack
checkbox
@param state:state of the update_no_repack checkbox
@type state: int
"""
otherOptionsText = str(self.otherCommandLineOptions.toPlainText())
if self.norepackDisulfCheckbox.isChecked() == True:
otherOptionsText = otherOptionsText + ' -norepack_disulf '
else:
otherOptionsText = otherOptionsText.replace(' -norepack_disulf ', '')
self.otherCommandLineOptions.setText(otherOptionsText)
return
def runRosettaFixedBBSim(self):
"""
Get all the parameters from the PM and run a rosetta simulation.
"""
proteinChunk = self.win.assy.getSelectedProteinChunk()
if not proteinChunk:
msg = "You must select a single protein to run a Rosetta <i>Fixed Backbone</i> simulation."
self.updateMessage(msg)
return
otherOptionsText = str(self.otherCommandLineOptions.toPlainText())
numSim = self.numSimSpinBox.value()
argList = [numSim, otherOptionsText, proteinChunk.name]
from simulation.ROSETTA.rosetta_commandruns import rosettaSetup_CommandRun
if argList[0] > 0:
cmdrun = rosettaSetup_CommandRun(self.win, argList, "ROSETTA_FIXED_BACKBONE_SEQUENCE_DESIGN")
cmdrun.run()
return
示例2: DnaStrand_PropertyManager
# 需要導入模塊: from PM.PM_SpinBox import PM_SpinBox [as 別名]
# 或者: from PM.PM_SpinBox.PM_SpinBox import value [as 別名]
class DnaStrand_PropertyManager( DnaOrCnt_PropertyManager):
"""
The DnaStrand_PropertyManager class provides a Property Manager
for the DnaStrand_EditCommand.
@ivar title: The title that appears in the property manager header.
@type title: str
@ivar pmName: The name of this property manager. This is used to set
the name of the PM_Dialog object via setObjectName().
@type name: str
@ivar iconPath: The relative path to the PNG file that contains a
22 x 22 icon image that appears in the PM header.
@type iconPath: str
"""
title = "DnaStrand Properties"
pmName = title
iconPath = "ui/actions/Properties Manager/Strand.png"
def __init__( self, win, editCommand ):
"""
Constructor for the Build DNA property manager.
"""
#For model changed signal
self.previousSelectionParams = None
#see self.connect_or_disconnect_signals for comment about this flag
self.isAlreadyConnected = False
self.isAlreadyDisconnected = False
self.sequenceEditor = None
self._numberOfBases = 0
self._conformation = 'B-DNA'
self.duplexRise = 3.18
self.basesPerTurn = 10
self.dnaModel = 'PAM3'
_superclass.__init__( self,
win,
editCommand)
self.showTopRowButtons( PM_DONE_BUTTON | \
PM_WHATS_THIS_BUTTON)
self._loadSequenceEditor()
msg = "Use resize handles to resize the strand. Use sequence editor"\
"to assign a new sequence or the current one to a file."
self.updateMessage(msg)
def _addGroupBoxes( self ):
"""
Add the DNA Property Manager group boxes.
"""
self._pmGroupBox1 = PM_GroupBox( self, title = "Parameters" )
self._loadGroupBox1( self._pmGroupBox1 )
self._displayOptionsGroupBox = PM_GroupBox( self,
title = "Display Options" )
self._loadDisplayOptionsGroupBox( self._displayOptionsGroupBox )
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,
#.........這裏部分代碼省略.........
示例3: DnaStrand_PropertyManager
# 需要導入模塊: from PM.PM_SpinBox import PM_SpinBox [as 別名]
# 或者: from PM.PM_SpinBox.PM_SpinBox import value [as 別名]
class DnaStrand_PropertyManager( DnaOrCnt_PropertyManager):
"""
The DnaStrand_PropertyManager class provides a Property Manager
for the DnaStrand_EditCommand.
@ivar title: The title that appears in the property manager header.
@type title: str
@ivar pmName: The name of this property manager. This is used to set
the name of the PM_Dialog object via setObjectName().
@type name: str
@ivar iconPath: The relative path to the PNG file that contains a
22 x 22 icon image that appears in the PM header.
@type iconPath: str
"""
title = "DnaStrand Properties"
iconPath = "ui/actions/Properties Manager/Strand.png"
def __init__( self, command ):
"""
Constructor for the Build DNA property manager.
"""
self.sequenceEditor = None
self._numberOfBases = 0
self._conformation = 'B-DNA'
self.dnaModel = 'PAM3'
_superclass.__init__( self, command)
self.showTopRowButtons( PM_DONE_BUTTON | \
PM_WHATS_THIS_BUTTON)
return
def _addGroupBoxes( self ):
"""
Add group boxes to this PM.
"""
self._pmGroupBox1 = PM_GroupBox( self, title = "Parameters" )
self._loadGroupBox1( self._pmGroupBox1 )
self._displayOptionsGroupBox = PM_GroupBox( self,
title = "Display Options" )
self._loadDisplayOptionsGroupBox( self._displayOptionsGroupBox )
#Sequence Editor. This is NOT a groupbox, needs cleanup. Doing it here
#so that the sequence editor gets connected! Perhaps
#superclass should define _loadAdditionalWidgets. -- Ninad2008-10-03
self._loadSequenceEditor()
return
def _loadGroupBox1(self, pmGroupBox):
"""
Load widgets in group box 1.
"""
self.nameLineEdit = PM_LineEdit( pmGroupBox,
label = "Name:",
text = "",
setAsDefault = False)
self.numberOfBasesSpinBox = \
PM_SpinBox( pmGroupBox,
label = "Number of bases:",
value = self._numberOfBases,
setAsDefault = False,
minimum = 2,
maximum = 10000 )
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.
self.numberOfBasesSpinBox.setEnabled(False)
return
def _loadSequenceEditor(self):
"""
Temporary code that shows the Sequence editor ..a doc widget docked
at the bottom of the mainwindow. The implementation is going to change
before 'rattleSnake' product release.
As of 2007-11-20: This feature (sequence editor) is waiting
for the ongoing dna model work to complete.
"""
self.sequenceEditor = self.win.createDnaSequenceEditorIfNeeded()
self.sequenceEditor.hide()
return
def _loadDisplayOptionsGroupBox(self, pmGroupBox):
"""
#.........這裏部分代碼省略.........
示例4: BackrubProteinSim_PropertyManager
# 需要導入模塊: from PM.PM_SpinBox import PM_SpinBox [as 別名]
# 或者: from PM.PM_SpinBox.PM_SpinBox import value [as 別名]
#.........這裏部分代碼省略.........
else:
self.minresSpinBox.setMaximum(numResidues)
self.maxresSpinBox.setMaximum(numResidues)
_superclass.show(self)
return
def _addGroupBoxes( self ):
"""
Add the Property Manager group boxes.
"""
self._pmGroupBox2 = PM_GroupBox( self,
title = "Backrub Specific Parameters")
self._loadGroupBox2( self._pmGroupBox2 )
self._pmGroupBox1 = PM_GroupBox( self,
title = "Rosetta Sequence Design Parameters")
self._loadGroupBox1( self._pmGroupBox1 )
return
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)
示例5: NanotubeGeneratorPropertyManager
# 需要導入模塊: from PM.PM_SpinBox import PM_SpinBox [as 別名]
# 或者: from PM.PM_SpinBox.PM_SpinBox import value [as 別名]
class NanotubeGeneratorPropertyManager(PM_Dialog):
"""
The NanotubeGeneratorPropertyManager class provides a Property Manager
for the "Build > Nanotube" command.
"""
# The title that appears in the property manager header.
title = "Nanotube"
# The name of this property manager. This will be set to
# the name of the PropMgr (this) object via setObjectName().
pmName = title
# The relative path to PNG file that appears in the header.
iconPath = "ui/actions/Tools/Build Structures/Nanotube.png"
def __init__(self):
"""Construct the Graphene Property Manager.
"""
PM_Dialog.__init__(self, self.pmName, self.iconPath, self.title)
#@self.addGroupBoxes()
#@self.add_whats_this_text()
self.updateMessageGroupBox()
def updateMessageGroupBox(self):
msg = ""
# A (4, 4) tube is stable, but a (3, 3) has not been seen in
# isolation. Circumference of a (4, 4) tube is about 6.93.
xOffset = self.n + self.m * math.cos(math.pi/3.0)
yOffset = self.m * math.sin(math.pi/3.0)
circumference = math.sqrt(xOffset * xOffset + yOffset * yOffset)
if (circumference < 6.5):
msg = "Warning: Small diameter nanotubes may be unstable, \
and may give unexpected results when minimized.<p>"
msg = msg + "Edit the Nanotube parameters and select <b>Preview</b> to \
preview the structure. Click <b>Done</b> to insert it into the model."
# This causes the "Message" box to be displayed as well.
# setAsDefault=True causes this message to be reset whenever
# this PropMgr is (re)displayed via show(). Mark 2007-06-01.
self.MessageGroupBox.insertHtmlMessage(msg, setAsDefault=True)
def _addGroupBoxes(self):
"""
Add the 3 group boxes to the Nanotube Property Manager dialog.
"""
self.pmGroupBox1 = \
PM_GroupBox( self,
title = "Nanotube Parameters" )
self.pmGroupBox2 = \
PM_GroupBox( self,
title = "Nanotube Distortion" )
self.pmGroupBox3 = \
PM_GroupBox( self,
title = "Multi-Walled Nanotubes" )
# Add group box widgets.
self._loadGroupBox1(self.pmGroupBox1)
self._loadGroupBox2(self.pmGroupBox2)
self._loadGroupBox3(self.pmGroupBox3)
def _loadGroupBox1(self, inPmGroupBox):
"""
Load widgets in group box 1.
"""
memberChoices = ["Carbon", "Boron Nitride"]
self.typeComboBox= \
PM_ComboBox( inPmGroupBox,
label = "Type :",
choices = memberChoices,
index = 0,
setAsDefault = True,
spanWidth = False )
self.connect( self.typeComboBox,
SIGNAL("currentIndexChanged(int)"),
self.nt_type_changed)
self.lengthField = \
PM_DoubleSpinBox( inPmGroupBox,
label = "Length :",
value = 20.0,
setAsDefault = True,
minimum = 1.0,
maximum = 1000.0,
singleStep = 1.0,
decimals = 3,
suffix = " Angstroms" )
self.n = 5
self.chiralityNSpinBox = \
PM_SpinBox( inPmGroupBox,
label = "Chirality (n) :",
value = self.n,
setAsDefault = True )
#.........這裏部分代碼省略.........
示例6: InsertNanotube_PropertyManager
# 需要導入模塊: from PM.PM_SpinBox import PM_SpinBox [as 別名]
# 或者: from PM.PM_SpinBox.PM_SpinBox import value [as 別名]
class InsertNanotube_PropertyManager( DnaOrCnt_PropertyManager):
"""
The InsertNanotube_PropertyManager class provides a Property Manager
for the B{Build > Nanotube > CNT} command.
@ivar title: The title that appears in the property manager header.
@type title: str
@ivar pmName: The name of this property manager. This is used to set
the name of the PM_Dialog object via setObjectName().
@type name: str
@ivar iconPath: The relative path to the PNG file that contains a
22 x 22 icon image that appears in the PM header.
@type iconPath: str
"""
title = "Insert Nanotube"
pmName = title
iconPath = "ui/actions/Tools/Build Structures/InsertNanotube.png"
def __init__( self, win, editCommand ):
"""
Constructor for the Nanotube property manager.
"""
self.endPoint1 = None
self.endPoint2 = None
self.nanotube = Nanotube() # A 5x5 CNT.
_superclass.__init__( self,
win,
editCommand)
self.showTopRowButtons( PM_DONE_BUTTON | \
PM_CANCEL_BUTTON | \
PM_WHATS_THIS_BUTTON)
def connect_or_disconnect_signals(self, isConnect):
"""
Connect or disconnect widget signals sent to their slot methods.
This can be overridden in subclasses. By default it does nothing.
@param isConnect: If True the widget will send the signals to the slot
method.
@type isConnect: boolean
"""
if isConnect:
change_connect = self.win.connect
else:
change_connect = self.win.disconnect
change_connect( self.ntTypeComboBox,
SIGNAL("currentIndexChanged(const QString&)"),
self._ntTypeComboBoxChanged )
change_connect(self.chiralityNSpinBox,
SIGNAL("valueChanged(int)"),
self._chiralityFixup)
change_connect(self.chiralityMSpinBox,
SIGNAL("valueChanged(int)"),
self._chiralityFixup)
change_connect(self.endingsComboBox,
SIGNAL("currentIndexChanged(const QString&)"),
self._endingsComboBoxChanged )
# This spin box is currently hidden.
change_connect(self.bondLengthDoubleSpinBox,
SIGNAL("valueChanged(double)"),
self._bondLengthChanged)
change_connect(self.showCursorTextCheckBox,
SIGNAL('stateChanged(int)'),
self._update_state_of_cursorTextGroupBox)
def ok_btn_clicked(self):
"""
Slot for the OK button
"""
if self.editCommand:
self.editCommand.preview_or_finalize_structure(previewing = False)
##env.history.message(self.editCommand.logMessage)
self.win.toolsDone()
def cancel_btn_clicked(self):
"""
Slot for the Cancel button.
"""
if self.editCommand:
self.editCommand.cancelStructure()
self.win.toolsCancel()
def _update_widgets_in_PM_before_show(self):
"""
Update various widgets in this Property manager.
Overrides MotorPropertyManager._update_widgets_in_PM_before_show.
The various widgets , (e.g. spinboxes) will get values from the
structure for which this propMgr is constructed for
#.........這裏部分代碼省略.........
示例7: DnaDuplexPropertyManager
# 需要導入模塊: from PM.PM_SpinBox import PM_SpinBox [as 別名]
# 或者: from PM.PM_SpinBox.PM_SpinBox import value [as 別名]
class DnaDuplexPropertyManager( DnaOrCnt_PropertyManager ):
"""
The DnaDuplexPropertyManager class provides a Property Manager
for the B{Build > DNA > Duplex} command.
@ivar title: The title that appears in the property manager header.
@type title: str
@ivar pmName: The name of this property manager. This is used to set
the name of the PM_Dialog object via setObjectName().
@type name: str
@ivar iconPath: The relative path to the PNG file that contains a
22 x 22 icon image that appears in the PM header.
@type iconPath: str
"""
title = "Insert DNA"
pmName = title
iconPath = "ui/actions/Tools/Build Structures/InsertDsDna.png"
def __init__( self, win, editCommand ):
"""
Constructor for the DNA Duplex property manager.
"""
self.endPoint1 = None
self.endPoint2 = None
self._conformation = "B-DNA"
self._numberOfBases = 0
self._basesPerTurn = getDuplexBasesPerTurn(self._conformation)
self._duplexRise = getDuplexRise(self._conformation)
self._duplexLength = getDuplexLength(self._conformation,
self._numberOfBases)
_superclass.__init__( self,
win,
editCommand)
self.showTopRowButtons( PM_DONE_BUTTON | \
PM_CANCEL_BUTTON | \
PM_WHATS_THIS_BUTTON)
def connect_or_disconnect_signals(self, isConnect):
"""
Connect or disconnect widget signals sent to their slot methods.
This can be overridden in subclasses. By default it does nothing.
@param isConnect: If True the widget will send the signals to the slot
method.
@type isConnect: boolean
"""
if isConnect:
change_connect = self.win.connect
else:
change_connect = self.win.disconnect
change_connect(self._placementOptions.buttonGroup,
SIGNAL("buttonClicked(int)"),
self.activateSpecifyReferencePlaneTool)
change_connect( self.conformationComboBox,
SIGNAL("currentIndexChanged(int)"),
self.conformationComboBoxChanged )
change_connect( self.numberOfBasePairsSpinBox,
SIGNAL("valueChanged(int)"),
self.numberOfBasesChanged )
change_connect( self.basesPerTurnDoubleSpinBox,
SIGNAL("valueChanged(double)"),
self.basesPerTurnChanged )
change_connect( self.duplexRiseDoubleSpinBox,
SIGNAL("valueChanged(double)"),
self.duplexRiseChanged )
change_connect(self.showCursorTextCheckBox,
SIGNAL('stateChanged(int)'),
self._update_state_of_cursorTextGroupBox)
self.duplexRiseDoubleSpinBox.connectWithState(
Preferences_StateRef_double( bdnaRise_prefs_key,
env.prefs[bdnaRise_prefs_key] )
)
self.basesPerTurnDoubleSpinBox.connectWithState(
Preferences_StateRef_double( bdnaBasesPerTurn_prefs_key,
env.prefs[bdnaBasesPerTurn_prefs_key] )
)
def ok_btn_clicked(self):
"""
Slot for the OK button
"""
#.........這裏部分代碼省略.........