当前位置: 首页>>代码示例>>Python>>正文


Python Navigation.moveUp方法代码示例

本文整理汇总了Python中navigation.Navigation.moveUp方法的典型用法代码示例。如果您正苦于以下问题:Python Navigation.moveUp方法的具体用法?Python Navigation.moveUp怎么用?Python Navigation.moveUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在navigation.Navigation的用法示例。


在下文中一共展示了Navigation.moveUp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Interface

# 需要导入模块: from navigation import Navigation [as 别名]
# 或者: from navigation.Navigation import moveUp [as 别名]
class Interface(object):
    def __init__(self):
        self._lcd_plate = LcdPlate()

        self._navigation = Navigation()

        self.initScreen()

    def initScreen(self):
        self._lcd_plate.clear()

        self._lcd_plate.setBackLightCyan()

        # Set the screen to the top of the menu
        self._lcd_plate.message(self._navigation.currentItem())

    def pressedDown(self):
        self._navigation.moveDown()

    def pressedLeft(self):
        self._navigation.moveLeft()

    def pressedRight(self):
        self._navigation.moveRight()

    def pressedSelect(self):
        # TODO: Actually run the process that the navigation items expects
        self._lcd_plate.clear()
        self._lcd_plate.message("In Select")

    def pressedUp(self):
        self._navigation.moveUp()

    def run(self):
        while True:
            for button in self._lcd_plate.buttons():
                # Check if a button is pressed & there has been pause in pressing the buttons
                if self._lcd_plate.pressedSinceLastCheck(button):
                    # Call function of the button pressed
                    getattr(self, 'pressed' + self._lcd_plate.titleOfButton(button))()

                    self.initScreen()
开发者ID:sjacres,项目名称:iot-chicken-coop,代码行数:44,代码来源:interface.py


注:本文中的navigation.Navigation.moveUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。