本文整理汇总了Python中PySide.QtGui.QSlider.blockSignals方法的典型用法代码示例。如果您正苦于以下问题:Python QSlider.blockSignals方法的具体用法?Python QSlider.blockSignals怎么用?Python QSlider.blockSignals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QSlider
的用法示例。
在下文中一共展示了QSlider.blockSignals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: EegCarDashboardWindow
# 需要导入模块: from PySide.QtGui import QSlider [as 别名]
# 或者: from PySide.QtGui.QSlider import blockSignals [as 别名]
class EegCarDashboardWindow(QWidget):
def setSliderMaxThrottle(self, x):
self.setMaxThrottle(x)
# self.dashboard.set_throttle(x)
# self.dashboard.wheel.forward(x)
def setSteeringValue(self, x):
# x range is 1-9 need to scale (10-90)
x = x*10
self.dashboard.set_steering(x)
# self.dashboard.steering.turn_by_position(x)
pot = 1.5
self.dashboard.steering.turn_by_position(x, pot)
def setSteeringTurnRangeValue(self, x):
ticks = int(100000 * (x/10.0)) # max is 100000
# print "STEERING TURN TICKS %d" % ticks
self.dashboard.set_steering_eeg_turn_ticks(ticks)
def steering_update_current_pos(self):
# x = int(self.steering_current_pos.text()) + delta_x
# while check busy
## read position
## print 'current pos %d' % x
ticks = int(self.steering_move_ticks.text())
seconds = int(ticks/(DEFAULT_STEERING_SPEED*7))
seconds = seconds + 1 # at least one second
ending_time = time.time() + seconds
while time.time() < ending_time:
# print "ENDNIG: %d" % ending_time
# print "CURRENT: %d" % time.time()
self.steering_set_current_pos(self.dashboard.steering.get_current_location())
def steering_set_current_pos(self, x):
self.steering_current_pos.setText(str(x))
def steering_move_left(self):
ticks = int(self.steering_move_ticks.text())
# Stepping Motor MOVE!
self.dashboard.steering.stepping_driver.forward(ticks)
self.setMessage('Steering left')
self.steering_update_current_pos()
def steering_move_right(self):
ticks = int(self.steering_move_ticks.text())
# Stepping Motor MOVE!
self.dashboard.steering.stepping_driver.backward(ticks)
self.setMessage('Steering right')
self.steering_update_current_pos()
def set_steering_move_ticks_value(self):
self.steering_move_ticks.blockSignals(True) # update line edit
ticks = int(self.steering_move_ticks.text())
self.steering_move_ticks.setText(str(ticks))
self.steering_move_ticks.blockSignals(False)
self.steering_move_ticks.setModified(True)
if self.steering_move_ticks.isModified():
self.steering_move_ticks.clearFocus()
self.maxThrottle.setModified(False)
def steering_reset_position(self):
# RESET
self.setMessage('Steering Controller Reset')
self.dashboard.steering.stepping_driver.reset() # reset
self.dashboard.steering.stepping_driver.set_speed(DEFAULT_STEERING_SPEED) # set speed
self.steering_update_current_pos()
def setMessage(self, msg):
self.statusBar.showMessage(msg, 2000)
def remote_control(self, state):
if state == QtCore.Qt.Checked:
self.dashboard.set_rc_mode(True)
self.setMessage('SET RC MODE')
else:
self.dashboard.set_rc_mode(False)
self.setMessage('CLEAR RC MODE')
def keep_mode_control(self, state):
if state == QtCore.Qt.Checked:
self.keep_mode = True
self.setMessage('Keep Mode (EEG)')
else:
self.keep_mode = False
self.setMessage('Keyboard Mode')
def power_handle_mode_control(self, state):
if state == QtCore.Qt.Checked:
self.dashboard.set_power_handle_mode(True)
self.setMessage('Power Handle (Auto Steering Middle)')
else:
self.dashboard.set_power_handle_mode(False)
self.setMessage('Turn Off Power Handle')
def ignore_eeg_input_control(self, state):
if state == QtCore.Qt.Checked:
self.dashboard.set_ignore_eeg_input(True)
#.........这里部分代码省略.........