def show( self ): MenuPage.show( self ) line0 = " GPS ||| " line1 = " 3G |||| " line2 = "" line3 = "Server: ok " self._displayLines = [line0, line1, line2, line3] self._updateLine(0) self._updateLine(1) self._updateLine(2) self._updateLine(3)
def show( self ): MenuPage.show( self ) line0 = " CPU: " + getCPUtemperature() + "'C "+getCPULoad()+"%" line1 = "Batt: XY.ZV" line2 = " MAC: " + getMacAddress("eth0") line3 = " IP: " + getIpAddress("eth0") self._displayLines = [line0, line1, line2, line3] self._updateLine(0) self._updateLine(1) self._updateLine(2) self._updateLine(3)
def show( self ): MenuPage.show( self ) line0 = " " line1 = " 1 2 3 4 5 6 7 8 " line2 = " - - * - - - * - " line3 = " " self._displayLines = [line0, line1, line2, line3] self._updateLine(0) self._updateLine(1) self._updateLine(2) self._updateLine(3)
def show( self ): MenuPage.show( self ) line0 = " s%d 0x00 s%d 0x00 " % (self._sensors[0], self._sensors[1] ) line1 = " s%d 0x00 s%d 0x00 " % (self._sensors[2], self._sensors[3] ) line2 = " s%d 0x00 s%d 0x00 " % (self._sensors[4], self._sensors[5] ) line3 = " s%d 0x00 s%d 0x00 " % (self._sensors[6], self._sensors[7] ) self._displayLines = [line0, line1, line2, line3] self._updateLine(0) self._updateLine(1) self._updateLine(2) self._updateLine(3)
def show( self ): MenuPage.show( self ) self._displayLines[2] = "CPU: " + getCPUtemperature() + "'C"; self._updateLine(2)
from menupage import MenuPage import os class CpuTempPage(MenuPage): def __init__( self, display ): MenuPage.__init__(self,display) def show( self ): MenuPage.show( self ) self._displayLines[2] = "CPU: " + getCPUtemperature() + "'C"; self._updateLine(2) def getCPUtemperature(): res = os.popen('vcgencmd measure_temp').readline() return(res.replace("temp=","").replace("'C\n","")) #Unit tests below! if __name__ == '__main__': display = Display() menupage = MenuPage(display) menupage.show() raw_input("...") debugpage = CpuTempPage(display) debugpage.show() raw_input("done!");