main.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:CoPilot-InfotainmentSystem 作者: Joelzeller 项目源码 文件源码
def build(self):
        global root
        root = ROOT() #set root widget (does nothing)


        clockwidget = CLOCK() #sets clock widget
        messagewidget = MESSAGE() #sets the message widget
        analogclock = MyClockWidget() #sets the analog clock widget
        cabintempwidget = CabinTempWidget() #sets the temp widget in upper right corner on main screen
        obdgaugewidget = OBDGaugeWidget() #sets the gauge widget in the middle of the screen


        Clock.schedule_interval(clockwidget.update, .1) #updates the main menu clock

        Clock.schedule_interval(analogclock.ticks.update_clock, .1) #updates the analog clock

        Clock.schedule_interval(messagewidget.update, .104556) #updates the message display

        #Clock.schedule_once(cabintempwidget.update) #call once to get initial temp
        Clock.schedule_interval(cabintempwidget.update, .1) #updates the temp every 10th second

        Clock.schedule_interval(obdgaugewidget.update, .1) #updates the temp every 10th second

        #add the widgets

        root.add_widget(KVFILE) #adds the main GUI

        root.add_widget(clockwidget) #main digital clock
        root.add_widget(analogclock) #analog clock
        root.add_widget(messagewidget) #adds message widget

        root.add_widget(cabintempwidget) #adds temp widget
        root.add_widget(obdgaugewidget) #adds obd gauge widget

        return root
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号