本文整理汇总了Python中cfclient.ui.widgets.ai.AttitudeIndicator.setFreefall方法的典型用法代码示例。如果您正苦于以下问题:Python AttitudeIndicator.setFreefall方法的具体用法?Python AttitudeIndicator.setFreefall怎么用?Python AttitudeIndicator.setFreefall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cfclient.ui.widgets.ai.AttitudeIndicator
的用法示例。
在下文中一共展示了AttitudeIndicator.setFreefall方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FlightTab
# 需要导入模块: from cfclient.ui.widgets.ai import AttitudeIndicator [as 别名]
# 或者: from cfclient.ui.widgets.ai.AttitudeIndicator import setFreefall [as 别名]
#.........这里部分代码省略.........
self.doubleSpinBox_ff_max.hide()
self.doubleSpinBox_ff_min.hide()
self.doubleSpinBox_ff_time.hide()
self.label_ff4.hide()
self.label_ff1.hide()
self.label_ff2.hide()
self.label_ff3.hide()
else:
self.pushButton_plot.show()
self.doubleSpinBox_ff_falloff.show()
self.doubleSpinBox_ff_max.show()
self.doubleSpinBox_ff_min.show()
self.doubleSpinBox_ff_time.show()
self.label_ff4.show()
self.label_ff1.show()
self.label_ff2.show()
self.label_ff3.show()
else:
self.pushButton_ff.hide()
self.pushButton_crash.hide()
self.pushButton_plot.hide()
self.doubleSpinBox_ff_falloff.hide()
self.doubleSpinBox_ff_max.hide()
self.doubleSpinBox_ff_min.hide()
self.doubleSpinBox_ff_time.hide()
self.label_ff4.hide()
self.label_ff1.hide()
self.label_ff2.hide()
self.label_ff3.hide()
@pyqtSlot()
def freefallDetected(self):
self.ai.setFreefall()
if self.checkBox_ffr.isChecked() and self.checkBox_ffr.isEnabled():
self.ffr.startRecovery()
self.ai.setRecovery(True)
self.helper.inputDeviceReader.setAuto(True)
self.checkBox_ffr.setChecked(False)
# self.emergency_stop_label.setText("Recovering Freefall")
# self.checkBox_ffr.setEnabled(False)
@pyqtSlot(float)
def crashDetected(self, badness):
self.ai.setRecovery(False, 'Landed / Crashed')
self.ai.setCrash(badness)
self.helper.inputDeviceReader.setAuto(False)
self.ffr.setLanded()
# self.emergency_stop_label.setText("")
self.checkBox_ffr.setChecked(True)
@pyqtSlot()
def recoveryAborted(self):
self.ai.setRecovery(False, 'Recovery Aborted / Timed out')
self.helper.inputDeviceReader.setAuto(False)
# self.emergency_stop_label.setText("")
# self.checkBox_ffr.setEnabled(True)
pass
def ffGuiSync(self, id, on):
""" Keeps freefall gui elements in sync"""
if id == 0: # freefall detection click
self.ffd.setEnabled(on) # detect freefall on/off
elif id == 1: # landing detection click
self.ffd.setEnabledLanding(on) # detect crashing on/off