本文整理汇总了Python中valslider.ValSlider.setLabel方法的典型用法代码示例。如果您正苦于以下问题:Python ValSlider.setLabel方法的具体用法?Python ValSlider.setLabel怎么用?Python ValSlider.setLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类valslider.ValSlider
的用法示例。
在下文中一共展示了ValSlider.setLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from valslider import ValSlider [as 别名]
# 或者: from valslider.ValSlider import setLabel [as 别名]
#.........这里部分代码省略.........
self.hbl_trans.addWidget(self.x_trans)
self.hbl_trans.addWidget(self.y_label)
self.hbl_trans.addWidget(self.y_trans)
self.hbl_trans.addWidget(self.z_label)
self.hbl_trans.addWidget(self.z_trans)
target.addLayout(self.hbl_trans)
self.hbl_src = QtGui.QHBoxLayout()
self.hbl_src.setMargin(0)
self.hbl_src.setSpacing(6)
self.hbl_src.setObjectName("hbl")
self.hbl_src.addWidget(self.label_src)
self.hbl_src.addWidget(self.src)
target.addLayout(self.hbl_src)
target.addWidget(self.az)
target.addWidget(self.alt)
target.addWidget(self.phi)
def set_src(self, val):
t3d = self.get_current_rotation()
if (self.n3_showing) :
self.parent().get_transform_layout().removeWidget(self.n3)
self.n3.deleteLater()
self.n3_showing = False
self.az.setRange(-360,360)
self.alt.setRange(-180,180)
self.phi.setRange(-360,660)
if ( self.src_map[str(val)] == "spider" ):
self.az.setLabel('phi')
self.alt.setLabel('theta')
self.phi.setLabel('psi')
elif ( self.src_map[str(val)] == "eman" ):
self.az.setLabel('az')
self.alt.setLabel('alt')
self.phi.setLabel('phi')
elif ( self.src_map[str(val)] == "imagic"):
self.az.setLabel('alpha')
self.alt.setLabel('beta')
self.phi.setLabel('gamma')
elif ( self.src_map[str(val)] == "xyz"):
self.az.setLabel('xtilt')
self.alt.setLabel('ytilt')
self.phi.setLabel('ztilt')
elif ( self.src_map[str(val)] == "mrc" ):
self.az.setLabel('phi')
self.alt.setLabel('theta')
self.phi.setLabel('omega')
elif ( self.src_map[str(val)] == "spin" ):
self.az.setLabel('Omega')
self.alt.setRange(-1,1)
self.phi.setRange(-1,1)
self.alt.setLabel('n1')
self.phi.setLabel('n2')
self.n3 = ValSlider(self.parent(),(-360.0,360.0),"n3",-1)
self.n3.setRange(-1,1)
self.n3.setObjectName("n3")
self.parent().get_transform_layout().addWidget(self.n3)
QtCore.QObject.connect(self.n3, QtCore.SIGNAL("valueChanged"), self.slider_rotate)
self.n3_showing = True
示例2: EMGLPlotInspector
# 需要导入模块: from valslider import ValSlider [as 别名]
# 或者: from valslider.ValSlider import setLabel [as 别名]
#.........这里部分代码省略.........
n1 = self.alt.getValue()
n2 = self.phi.getValue()
n3 = self.n3.getValue()
norm = sqrt(n1*n1 + n2*n2 + n3*n3)
n1 /= norm
n2 /= norm
n3 /= norm
rot[self.alt.getLabel()] = n1
rot[self.phi.getLabel()] = n2
rot[self.n3.getLabel()] = n3
else:
rot[self.az.getLabel()] = self.az.getValue()
rot[self.alt.getLabel()] = self.alt.getValue()
rot[self.phi.getLabel()] = self.phi.getValue()
return Transform3D(self.current_src, rot)
def set_src(self, val):
t3d = self.get_current_rotation()
if (self.n3_showing) :
self.vbl.removeWidget(self.n3)
self.n3.deleteLater()
self.n3_showing = False
self.az.setRange(-360,360)
self.alt.setRange(-180,180)
self.phi.setRange(-360,660)
if ( self.src_map[str(val)] == EULER_SPIDER ):
self.az.setLabel('phi')
self.alt.setLabel('theta')
self.phi.setLabel('psi')
elif ( self.src_map[str(val)] == EULER_EMAN ):
self.az.setLabel('az')
self.alt.setLabel('alt')
self.phi.setLabel('phi')
elif ( self.src_map[str(val)] == EULER_IMAGIC ):
self.az.setLabel('alpha')
self.alt.setLabel('beta')
self.phi.setLabel('gamma')
elif ( self.src_map[str(val)] == EULER_XYZ ):
self.az.setLabel('xtilt')
self.alt.setLabel('ytilt')
self.phi.setLabel('ztilt')
elif ( self.src_map[str(val)] == EULER_MRC ):
self.az.setLabel('phi')
self.alt.setLabel('theta')
self.phi.setLabel('omega')
elif ( self.src_map[str(val)] == EULER_SPIN ):
self.az.setLabel('Omega')
self.alt.setRange(-1,1)
self.phi.setRange(-1,1)
self.alt.setLabel('n1')
self.phi.setLabel('n2')
self.n3 = ValSlider(self,(-360.0,360.0),"n3",-1)
self.n3.setRange(-1,1)
self.n3.setObjectName("n3")
self.vbl.addWidget(self.n3)
QtCore.QObject.connect(self.n3, QtCore.SIGNAL("valueChanged"), self.slider_rotate)
self.n3_showing = True