本文整理汇总了Python中BAL.Devices.Relay.Relay.getName方法的典型用法代码示例。如果您正苦于以下问题:Python Relay.getName方法的具体用法?Python Relay.getName怎么用?Python Relay.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BAL.Devices.Relay.Relay
的用法示例。
在下文中一共展示了Relay.getName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWindow
# 需要导入模块: from BAL.Devices.Relay import Relay [as 别名]
# 或者: from BAL.Devices.Relay.Relay import getName [as 别名]
#.........这里部分代码省略.........
self.currentShowDev = UsbCam(self.DevFrame, self.data)
self.currentShowDev.fromDict(dev)
elif dev["type"] == ROBOT_MODEL:
self.currentShowDev = RobotModel(self.DevFrame, self.data)
self.currentShowDev.fromDict(dev)
elif dev["type"] == SLAM:
self.currentShowDev = Slam(self.DevFrame, self.data)
self.currentShowDev.fromDict(dev)
elif dev["type"] == PPMReader:
self.currentShowDev = PPMReader(self.DevFrame, self.data)
self.currentShowDev.fromDict(dev)
elif dev["type"] == Keyboard:
self.currentShowDev = KeyboardTeleop(self.DevFrame, self.data)
self.currentShowDev.fromDict(dev)
elif dev["type"] == JOYSTICK:
self.currentShowDev = JoystickTeleop(self.DevFrame, self.data)
self.currentShowDev.fromDict(dev)
elif dev["type"] == SMOOTHER:
self.currentShowDev = VelocitySmoother(self.DevFrame, self.data)
self.currentShowDev.fromDict(dev)
if self.currentShowDev.getDevType() == BATTERY:
self.haveBattery = True
if self.currentShowDev.getDevType() == IMU:
self.haveIMU = True
if self.currentShowDev.getDevType() == PPM:
self.havePPM = True
if self.currentShowDev.getDevType() == GPS:
self.haveGPS = True
if (self.currentShowDev.getDevType() == CLOSE_LOP_ONE) or (
self.currentShowDev.getDevType() == CLOSE_LOP_TWO
):
self.haveCloseLoop = True
self.motors.append(self.currentShowDev.getName())
if self.currentShowDev.getDevType() == OPEN_LOP:
self.haveOpenLoop = True
self.motors.append(self.currentShowDev.getName())
if (
self.currentShowDev.getDevType() == DIFF_CLOSE
or self.currentShowDev.getDevType() == DIFF_OPEN
or self.currentShowDev.getDevType() == DIFF_CLOSE_FOUR
):
self.haveDiff = True
self.diffEnable = True
self.devList.addItem(QListWidgetItem(self.currentShowDev.getName()))
self.data.append(self.currentShowDev)
self.currentShowDev = None
self.pushButton_2.setEnabled(True)
def save(self):
pkg = rospkg.RosPack().get_path("ric_board")
if len(self.data) == 0:
QMessageBox.critical(self, "File error", "Can not save a empty file.")
return
if self._fileName == "":
QMessageBox.critical(self, "File error", "Can not save file without a name.")
return
if not self.override:
ans = QMessageBox.question(
self, "Override", "Do you want to override this file", QMessageBox.Yes | QMessageBox.No
)
if ans == QMessageBox.Yes:
self.override = True
else:
return