def EventMethods_DiskInfo(self): blackGridNum = (10 * SysInfo.getDiskInfo()['use%'] + 50) / 100 line_2 = '' for i in range(0, blackGridNum): line_2 = line_2 + chr(5) for i in range(0, 10 - blackGridNum): line_2 = line_2 + chr(6) self.message('Disk used: ' + str(SysInfo.getDiskInfo()['used']) + 'GB\n' + line_2 + ' ' + str(SysInfo.getDiskInfo()['use%']) + '%')
def showNetworkInfo(self, networkInfo): if len(networkInfo) > 0: self.message( chr(2) + SysInfo.getNetInfo()[self.NetworkPageId]['name'] + ':\n' + chr(3) + SysInfo.getNetInfo()[self.NetworkPageId]['ip']) else: self.message('NONE')
def EventMethods_Temperature(self): cpuTemperature = SysInfo.getCpuTemperature() cursor = int(cpuTemperature * 10) if cursor <= 300: cursor = 2 elif cursor >= 500: cursor = 13 else: cursor = int((cursor - 300) * 12 / 200) + 2 # Use private charset self.loadCharset('TemperatureExtend') line_2 = 'L-' + chr(4) + chr(3) + chr(3) + chr(3) + chr(2) + chr(2) + chr(2) + chr(2) + chr(1) + chr(1) + chr(1) + chr(5) + '-H' self.message('CPU: ' + str(cpuTemperature) + chr(6) + 'C\n' + line_2) self.blink(cursor, 1) self.lcd.noCursor() self.AutoRefreshMethod = 'EventMethods_2_1' if(self.debug): print 'Temperature bar: ' + str(cursor)
def EventMethods_Temperature(self): cpuTemperature = SysInfo.getCpuTemperature() cursor = int(cpuTemperature * 10) if cursor <= 300: cursor = 2 elif cursor >= 500: cursor = 13 else: cursor = int((cursor - 300) * 12 / 200) + 2 # Use private charset self.loadCharset('TemperatureExtend') line_2 = 'L-' + chr(4) + chr(3) + chr(3) + chr(3) + chr(2) + chr( 2) + chr(2) + chr(2) + chr(1) + chr(1) + chr(1) + chr(5) + '-H' self.message('CPU: ' + str(cpuTemperature) + chr(6) + 'C\n' + line_2) self.blink(cursor, 1) self.lcd.noCursor() self.AutoRefreshMethod = 'EventMethods_2_1' if (self.debug): print 'Temperature bar: ' + str(cursor)
def EventMethods_NetworkInfo_Down(self): networkInfo = SysInfo.getNetInfo() self.NetworkPageId = (self.NetworkPageId - 1) % len(networkInfo) self.showNetworkInfo(networkInfo)
def EventMethods_NetworkInfo(self): self.NetworkPageId = 0 self.showNetworkInfo(SysInfo.getNetInfo())
def showNetworkInfo(self, networkInfo): if len(networkInfo) > 0: self.message(chr(2) + SysInfo.getNetInfo()[self.NetworkPageId ]['name'] + ':\n' + chr(3) + SysInfo.getNetInfo()[self.NetworkPageId ]['ip']) else: self.message('NONE')
def EventMethods_SystemInfo(self): self.AutoRefreshMethod = 'EventMethods_0_1' self.message('CPU Used: ' + str(SysInfo.getCpuInfo()['used']) + '%\nMEM Free: ' + str(SysInfo.getMemInfo()['free']/1024) + 'MB')
def EventMethods_SystemInfo(self): self.AutoRefreshMethod = 'EventMethods_0_1' self.message('CPU Used: ' + str(SysInfo.getCpuInfo()['used']) + '%\nMEM Free: ' + str(SysInfo.getMemInfo()['free'] / 1024) + 'MB')