From 3bf8b7f18df965ddec6c5376a419536142153e35 Mon Sep 17 00:00:00 2001 From: "Chang.H.S" Date: Fri, 2 Dec 2011 13:55:44 +0900 Subject: [PATCH] FactoryTest : 1. fix agingtest (auto mode ,VFD display) 2. fix agingtest2 (auto mode, VFD display and log) 3. add VFD display on front test(for ultimo) --- .../Plugins/SystemPlugins/FactoryTest/plugin.py | 814 ++++++++++++++++++--- .../Plugins/SystemPlugins/FactoryTest/testdb | 5 +- 2 files changed, 703 insertions(+), 116 deletions(-) diff --git a/lib/python/Plugins/SystemPlugins/FactoryTest/plugin.py b/lib/python/Plugins/SystemPlugins/FactoryTest/plugin.py index 1a36c3e..38ac2f5 100755 --- a/lib/python/Plugins/SystemPlugins/FactoryTest/plugin.py +++ b/lib/python/Plugins/SystemPlugins/FactoryTest/plugin.py @@ -93,6 +93,18 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y())) def __init__(self, session, text, type = MessageBox.TYPE_YESNO): MessageBox.__init__(self, session, text, type) +class FactoryTestSummary(Screen): + skin = """ + + + """ + +class FactoryTestSummary_VFD(Screen): + skin = """ + + + """ + class FactoryTest(Screen): skin = """ @@ -103,6 +115,12 @@ class FactoryTest(Screen): """ + def createSummary(self): + if self.model == 4: + return FactoryTestSummary_VFD + else: + return FactoryTestSummary + def __init__(self, session): self["actions"] = NumberActionMap(["OkCancelActions","WizardActions","NumberActions","ColorActions",], @@ -125,11 +143,12 @@ class FactoryTest(Screen): "8": self.numberaction, "9": self.numberaction, "red": self.shutdownaction, + "blue": self.Agingmode2, }, -2) Screen.__init__(self, session) - TESTPROGRAM_DATE = self.getImageVersion() +" (v1.10)" - TESTPROGRAM_VERSION = "Version 01.10" + TESTPROGRAM_DATE = self.getImageVersion() +" (v1.20)" + TESTPROGRAM_VERSION = "Version 01.20" self.model = 0 self.getModelInfo() @@ -155,7 +174,16 @@ class FactoryTest(Screen): pass if self.model == 3 or self.model == 4: self.NimType = {} - sat_list = ["160","100","130","192","620","642"] + sat_list = ["160","100","130","192","620","642","685","720"] +# ' sat ' : namespace , # satname +# '160' : '0xA00000', # Eutelsat W2 +# '100' : '0x64af79', # Eutelsat +# '130' : '0x820000', # Hotbird +# '192' : '0xC00000', # Astra +# '620' : '0x26c0000', # Intelsat 902 +# '642' : '0x282AF79' # Intelsat 906 +# '685' : '02ad0000' # Panamsat 7,10 (68.5E) +# '720' : '02d0af79' # Panamsat 4 (72.0E) try: nimfile = open("/proc/bus/nim_sockets") except IOError: @@ -243,8 +271,6 @@ class FactoryTest(Screen): self.usbtimer = eTimer() self.usbtimer.callback.append(self.usbCheck) - self.agingtimer = eTimer() - self.agingtimer.callback.append(self.agingCheck) self.setSourceVar() self.FanSpeedUp(255) @@ -826,9 +852,13 @@ class FactoryTest(Screen): elif getTuneInfo["sat"] == "192": # Astra ref.setData(4,0xC00000) elif getTuneInfo["sat"] == "620": # Intelsat 902 - ref.setData(4,0x26c0000) # need to fix later + ref.setData(4,0x26c0000) elif getTuneInfo["sat"] == "642": # Intelsat 906 - ref.setData(4,0x282AF79) # need to fix later + ref.setData(4,0x282AF79) + elif getTuneInfo["sat"] == "685": # Panamsat 7,10 (68.5E) + ref.setData(4,0x02ad0000) + elif getTuneInfo["sat"] == "720": # Panamsat 4 (72.0E) + ref.setData(4,0x02d0af79) elif getTuneInfo["type"].startswith("DVB-C"): ref.setData(0,0x19) ref.setData(1,0x1325) @@ -1027,62 +1057,21 @@ class FactoryTest(Screen): self.session.openWithCallback(self.check7,RS232Test) def Agingmode(self): - if self.testing==1: - return - if self.oldref is None: - eref = eServiceReference("1:0:19:1324:3EF:1:C00000:0:0:0") - serviceHandler = eServiceCenter.getInstance() - servicelist = serviceHandler.list(eref) - if not servicelist is None: - ref = servicelist.getNext() - else: - ref = self.getCurrentSelection() - print "servicelist none" - else: - ref = self.oldref - self.session.nav.stopService() # try to disable foreground service - if self.model == 0 or self.model == 1 or self.NimType[0]["type"].startswith("DVB-S"): - ref.setData(0,0x19) - ref.setData(1,0x1325) - ref.setData(2,0x3ef) - ref.setData(3,0x1) - ref.setData(4,0x64af79) - elif self.NimType[0]["type"].startswith("DVB-C"): - ref.setData(0,0x19) - ref.setData(1,0x1325) - ref.setData(2,0x3ef) - ref.setData(3,0x1) - ref.setData(4,-64870) # ffff029a - elif self.NimType[0]["type"].startswith("DVB-T"): - ref.setData(0,0x19) - ref.setData(1,0x1325) - ref.setData(2,0x3ef) - ref.setData(3,0x1) - ref.setData(4,-286391716) # eeee025c - self.session.nav.playService(ref) - self.avswitch.setColorFormat(0) - self.avswitch.setAspectRatio(0) - self.agingtimer.start(2000,True) + self.session.openWithCallback(self.AgingmodeCallback,AgingTest, self.model) - def agingCheck(self): - result = eSctest.getInstance().getFrontendstatus(0) - hv = "Ver" - print "eSctest.getInstance().getFrontendstatus - %d"%result - if result == 0: - self.session.nav.stopService() - self.session.open( MessageBox, _("Tune 1 Ver Locking Fail..."), MessageBox.TYPE_ERROR) - elif result == 1 : - self.session.openWithCallback(self.agingResult,AgingTest) - else: - self.session.nav.stopService() - self.session.open( MessageBox, _("Tune 1 Ver Error %d..."%result), MessageBox.TYPE_ERROR) - - def agingResult(self): - global Agingresult - if(Agingresult ==1): + def AgingmodeCallback(self,ret): + if ret == 1: self["testlist"].moveToIndex(self.fdefaultIndex) self.Test14() self["testlist"].moveToIndex(self.shutdownIndex) + + def Agingmode2(self): + self.session.openWithCallback(self.Agingmode2Callback,AgingTest_mode2, self.model) + + def Agingmode2Callback(self): + self["testlist"].moveToIndex(self.fdefaultIndex) + self.Test14() + self["testlist"].moveToIndex(self.shutdownIndex) def Test8(self): self.usbtry = 9 @@ -1883,12 +1872,99 @@ class FrontTest_uno(Screen): eSctest.getInstance().turnoff_VFD() self.fronttimer.start(1000,True) +class FrontTest_ultimo_Summary(Screen): + skin = """ + + + + """ + + def __init__(self, session, parent): + Screen.__init__(self, session, parent = parent) + self["text"] = Label("Press Front STANDBY") + + def setText(self, text = ""): + if not isinstance(text, str): + text = str(text) + self["text"].setText(text) + class FrontTest_ultimo(FrontTest_solo): skin = """ """ + def createSummary(self): + return FrontTest_ultimo_Summary + + def KeyTimeOut(self): + if self.step == 1: + self["text"].setText(("Front STANDBY ERROR\nPress exit!")) + self.summaries.setText("Front STANDBY ERROR\nPress exit!") + elif self.step == 2 : + self["text"].setText(("Front CH - ERROR\nPress exit!")) + self.summaries.setText("Front CH - ERROR\nPress exit!") + elif self.step == 3: + self["text"].setText(("Front CH + ERROR\nPress exit!")) + self.summaries.setText("Front CH + ERROR\nPress exit!") + elif self.step == 4 : + self["text"].setText(("Front VOL - ERROR\nPress exit!")) + self.summaries.setText("Front VOL - ERROR\nPress exit!") + elif self.step == 5: + self["text"].setText(("Front VOL + ERROR\nPress exit!")) + self.summaries.setText("Front VOL + ERROR\nPress exit!") + self.step = 0 + + def keypower(self): + if self.step== 1: + self.keytimeout.stop() + self.keytimeout.start(5000,True) + self.step = 2 + self["text"].setText(_("Press Front CH -")) + self.summaries.setText(_("Press Front CH -")) + + def keyright(self): + if self.step== 3: + self.keytimeout.stop() + self.keytimeout.start(5000,True) + self.step = 4 + self["text"].setText(_("Press Front VOL -")) + self.summaries.setText(_("Press Front VOL -")) + + def keyleft(self): + if self.step== 2: + self.keytimeout.stop() + self.keytimeout.start(5000,True) + self.step = 3 + self["text"].setText(_("Press Front CH +")) + self.summaries.setText(_("Press Front CH +")) + + def keyvolup(self): + if self.step== 5: + self.keytimeout.stop() + self.step = 6 + self.fronttimer.start(1000,True) + self["text"].setText(_("Front LED OK?\n\nyes-ok\nno-exit")) + self.summaries.setText(_("Front LED OK?")) + + def keyvoldown(self): + if self.step== 4: + self.keytimeout.stop() + self.keytimeout.start(5000,True) + self.step = 5 + self["text"].setText(_("Press Front VOL +")) + self.summaries.setText(_("Press Front VOL +")) + + def FrontAnimate(self): + if (self.frontturnonoff==0): + eSctest.getInstance().turnon_VFD() + self.frontturnonoff = 1 + self.fronttimer.start(1500,True) + else: + self.frontturnonoff = 0 + eSctest.getInstance().turnoff_VFD() + self.fronttimer.start(500,True) + rstest = 0 import select @@ -1941,13 +2017,50 @@ class RS232Test(Screen): def keyCancel(self): self.close() -Agingresult = 0 +class AgingTestSummary(Screen): + skin = """ + + + """ + +class AgingTestSummaryVFD(Screen): + skin = """ + + + + + + + + + + SNRdB + + + + + AGC + + + """ + + def __init__(self, session, parent): + Screen.__init__(self, session) + self["zapmode"] = Label("") + self["timer"] = Label("") + self["curtuner"] = Label("") + self["error"] = Label("") + + def setText(self, label = "zapmode",text = ""): + if not isinstance(text,str): + text = str(text) + self[label].setText(text) class AgingTest(Screen): skin = """ - - - + + + @@ -1958,84 +2071,555 @@ class AgingTest(Screen): AGC + + """ step=1 - def __init__(self, session): - self["actions"] = ActionMap(["MediaPlayerActions","GlobalActions"], + def __init__(self, session, model): + Screen.__init__(self, session) + self["actions"] = ActionMap(["MediaPlayerActions","GlobalActions", "MediaPlayerSeekActions", "ChannelSelectBaseActions"], { "pause": self.keyEnd, "stop": self.keyFinish, - "volumeUp": self.nothing, - "volumeDown": self.nothing, - "volumeMute": self.nothing, + "volumeUp": self.keyVolumeup, + "volumeDown": self.keyVolumedown, + "volumeMute": self.nothing, + "seekFwd" : self.keyFFW, }, -2) - - Screen.__init__(self, session) + self.model = model self["text1"]=Label(("Exit - Press Pause Key")) self["text2"]=Label(("Reset - Press Stop Key")) -# self.servicelist = ServiceList() -# self.oldref = session.nav.getCurrentlyPlayingServiceReference() -# print "oldref",self.oldref -# session.nav.stopService() # try to disable foreground service -# self.chstart() - self.tunerlock = 0 - self.tuningtimer = eTimer() - self.tuningtimer.callback.append(self.updateStatus) -# self.tuningtimer.start(200,True) + self["text3"]=Label(("Manual zapping")) + self["text4"]=Label((" ")) + self.avswitch = AVSwitch() + self.curzappingmode = 'manual' + self.zapping_interval = 300 + self.error = 0 + self.timeout = self.zapping_interval + self.tunelist = [] + self.zappinglist = { + 'DVB-S2' : [ + ('S-1','1:0:19:1325:3EF:1:0x64af79:0:0:0:'), # astra hd + ('S-2','1:0:19:1324:3EF:1:0x64af79:0:0:0:'), # anixe hd + ('S-3','1:0:19:1331:3EF:1:0x64af79:0:0:0:') # servus hd + ], + 'DVB-C': [ + ('C-1','1:0:19:1325:3EF:1:FFFF029A:0:0:0:'), # astra hd (DVB-C) + ('C-2','1:0:19:1324:3EF:1:FFFF029A:0:0:0:') # anixe hd (DVB-C) + ] + } + self.LockCheckTimer = eTimer() + self.LockCheckTimer.callback.append(self.LockCheck) + self.nextzappingtimer = eTimer() + self.nextzappingtimer.callback.append(self.checktimeout) + self.checkTunerType() + self.makeTunelList() + self.playservice(service = self.tunelist[0][1]) +# self.logmessage("AGING TEST START") + + def createSummary(self): + if self.model == 4: + self.onShown.append(self.VFDinit) + return AgingTestSummaryVFD + else: + return AgingTestSummary + def setTextVFD(self, name ,text): + if self.model == 4: + self.summaries.setText(name ,text) - def updateStatus(self): - result = eSctest.getInstance().getFrontendstatus(0) - hv = "Ver" - - print "eSctest.getInstance().getFrontendstatus - %d"%result - if result == 0: - self.tunerlock = 0 - self.session.nav.stopService() - self.session.open( MessageBox, _("Tune 1 Ver Locking Fail..."), MessageBox.TYPE_ERROR) - elif result==1 : - self.tunerlock = 1 + def VFDinit(self): + if self.curzappingmode == 'manual' : + self.summaries.setText("zapmode", 'MANUAL') else: - self.tunerlock = 0 - self.session.nav.stopService() - self.session.open( MessageBox, _("Tune 1 Ver Error %d..."%result), MessageBox.TYPE_ERROR) + self.summaries.setText("zapmode", 'AUTO') + self.summaries.setText("timer", "Timer %d sec"%self.timeout) + self.summaries.setText("curtuner", "%s, CHANNEL - %s)"%(self.NimType[0], self.tunelist[0][0])) + + def checkTunerType(self): + self.NimType={} + nimfile = open("/proc/bus/nim_sockets") + for line in nimfile.readlines(): + print line + if line == "": + break + if line.strip().startswith("NIM Socket"): + parts = line.strip().split(" ") + current_slot = int(parts[2][:-1]) + elif line.strip().startswith("Type:"): + self.NimType[current_slot]= str(line.strip()[6:]) + elif line.strip().startswith("empty"): + self.NimType.pop(current_slot) + nimfile.close() + + def makeTunelList(self): + if self.NimType[0].startswith("DVB-S"): + tunetype = "DVB-S2" + elif self.NimType[0].startswith("DVB-C"): + tunetype = "DVB-C" + elif self.NimType[0].startswith("DVB-T"): +# tunetype = "DVB-T" + pass # fix later.. + try : + self.tunelist = self.zappinglist[tunetype] + except: + print "[FactoryTest] ERROR, index error (%s)"%tunetype + def nextZapping(self, zap_rev = False): + if zap_rev: + tunelistlen = len(self.tunelist) + nextservice = self.tunelist.pop(tunelistlen-1) + self.tunelist.insert(0,nextservice) + else: + currentservice = self.tunelist.pop(0) + self.tunelist.append(currentservice) + self.playservice(service=self.tunelist[0][1]) + if self.curzappingmode == 'auto': + self.timeout = self.zapping_interval + self.setTextVFD("curtuner", "%s, CHANNEL - %s)"%(self.NimType[0], self.tunelist[0][0])) + + def checktimeout(self): + if self.timeout == 0: + self.nextZapping() + else: + self.timeout -=1 + self["text4"].setText("remain %d sec for next tuning" %self.timeout) + self.setTextVFD("timer", "Timer %d sec"%self.timeout) + + def playservice(self,service = '1:0:19:1325:3EF:1:0x64af79:0:0:0:'): + ref = eServiceReference(service) + self.session.nav.playService(ref) + self.avswitch.setAspectRatio(6) + self.avswitch.setColorFormat(0) + self.LockCheckTimer.start(2000,True) + + def LockCheck(self): + result = eSctest.getInstance().getFrontendstatus(0) + if result == 0 or result == -1: + if self.model == 4: + self.error +=1 + print "AGINGTEST - LOCK FAIL(%d)"%self.error + self.setTextVFD("error", "LOCK FAIL(%d)"%self.error) + # logmsg = "[LOCKFAIL][%d] TYPE : %s, CH : %s, ZAPMODE: %s"%(self.error,self.NimType[0],self.tunelist[0][0],self.curzappingmode) + # self.logmessage(logmsg) + else: + self.session.open( MessageBox, _("Locking Fail Error"), MessageBox.TYPE_ERROR) + + def logmessage(self,msg): + pass def nothing(self): print "nothing" - def chstart(self): - if self.oldref is None: - eref = eServiceReference("1:0:19:1324:3EF:1:C00000:0:0:0") - serviceHandler = eServiceCenter.getInstance() - servicelist = serviceHandler.list(eref) - if not servicelist is None: - ref = servicelist.getNext() + def keyFFW(self): + if self.curzappingmode == 'auto': + self.curzappingmode = 'manual' + self.nextzappingtimer.stop() + self.timeout = self.zapping_interval + self["text3"].setText("Manual zapping") + self["text4"].setText("") + self.setTextVFD("zapmode", 'MANUAL') + self.setTextVFD("timer", "") + + elif self.curzappingmode == 'manual': + self.curzappingmode = 'auto' + self["text3"].setText("Auto zapping") + self["text4"].setText("remain %d sec for next tuning" %self.timeout) + self.setTextVFD("zapmode", 'AUTO') + self.setTextVFD("timer", "Timer %d sec"%self.timeout) +# self.timeout = self.zapping_interval + self.nextzappingtimer.start(1000) + + def keyVolumeup(self): + self.nextZapping(zap_rev = False) + + def keyVolumedown(self): + self.nextZapping(zap_rev = True) + + def nothing(self): + print "nothing" + + def keyEnd(self): + self.session.nav.stopService() + self.close(0) # exit + + def keyFinish(self): + self.session.nav.stopService() + self.close(1) # exit and reset + +class AgingTest_mode2_Summary(Screen): + skin = """ + + + """ + +class AgingTest_mode2_Summary_VFD(Screen): + skin = """ + + + + + + + + + + SNRdB + + + + + AGC + + + """ + + def __init__(self, session, parent): + Screen.__init__(self, session) + self["zapmode"] = Label("") + self["timer"] = Label("") + self["curtuner"] = Label("") + self["error"] = Label("") + + def setText(self, label = "zapmode",text = ""): + if not isinstance(text,str): + text = str(text) + self[label].setText(text) + +from Components.Input import Input +from Screens.InputBox import InputBox +class AgingTest_mode2(Screen): + skin = """ + + + + + + + SNRdB + + + + + AGC + + + + """ + step=1 + def __init__(self, session,model = 4): + self["actions"] = ActionMap(["MediaPlayerActions","GlobalActions","InfobarMenuActions","ChannelSelectBaseActions"], + { + "pause": self.keyEnd, + "stop": self.keyFinish, + "volumeUp": self.keyVolumeup, + "volumeDown": self.keyVolumedown, + "volumeMute": self.nothing, + "mainMenu" : self.keyMenu, + "nextBouquet" : self.keyChannelup, + "prevBouquet" : self.keyChannelDown, + "showFavourites" : self.keyBlue, + }, -2) + + Screen.__init__(self, session) + self.model = model + self.slotindex = { 0 : 'A', 1 : 'B', 2 : 'C', 3: 'D'} + self.curtuner = 0 + self.isChangeTuner = True + self.isChangeChannel = False + self.zapping_interval = 300 + self.timeout = self.zapping_interval + self.avswitch = AVSwitch() + self.error = 0 + self.LockCheckTimer = eTimer() + self.LockCheckTimer.callback.append(self.LockCheck) + self.nextzappingtimer = eTimer() + self.nextzappingtimer.callback.append(self.checktimeout) + self.tunelist_db = { + 'DVB-S2' : [ + [ + ('1-1','1:0:19:1325:3EF:1:0x64af79:0:0:0:'), # astra hd + ('1-2','1:0:19:1324:3EF:1:0x64af79:0:0:0:'), # anixe hd + ('1-3','1:0:19:1331:3EF:1:0x64af79:0:0:0:') # servus hd + ], + [ + ('2-1','1:0:19:1325:3EF:1:0xC00000:0:0:0:'), # astra hd + ('2-2','1:0:19:1324:3EF:1:0xC00000:0:0:0:'), # anixe hd + ('2-3','1:0:19:1331:3EF:1:0xC00000:0:0:0:') # servus hd + ], + [ + ('3-1','1:0:19:1325:3EF:1:0x282AF79:0:0:0:'), # astra hd + ('3-2','1:0:19:1324:3EF:1:0x282AF79:0:0:0:'), # anixe hd + ('3-3','1:0:19:1331:3EF:1:0x282AF79:0:0:0:') # servus hd + ], + [ + ('4-1','1:0:19:1325:3EF:1:0x02d0af79:0:0:0:'), # astra hd, Panamsat 4 (72.0E) + ('4-2','1:0:19:1324:3EF:1:0x02d0af79:0:0:0:'), # anixe hd + ('4-3','1:0:19:1331:3EF:1:0x02d0af79:0:0:0:') # servus hd + ] +# namespace : 0x02d0af79, 720 # Panamsat 7,10 (68.5E) + ], + 'DVB-C': [ + [ + ('C-1','1:0:19:1325:3EF:1:FFFF029A:0:0:0:'), # astra hd (DVB-C) + ('C-2','1:0:19:1324:3EF:1:FFFF029A:0:0:0:') # anixe hd (DVB-C) + ] + ] + } + self.tunelist = {} + self.NimType={} + self.checkTunerType() + self.makeTunelList() + self.playservice(service = self.tunelist[self.curtuner][0][1]) + self.curzappingmode = 'auto' + self["text1"]=Label("ZAPPING MODE : AUTO") + self["text2"]=Label("CURRENT TUNER : %s (%s)"%(self.slotindex[self.curtuner], self.NimType[self.curtuner])) + self["text3"]=Label("remain %d sec for next tuning" %self.timeout) + self["text4"]=Label("Press 'stop' key for exit") + self.nextzappingtimer.start(1000) + self.logmessage("AGING TEST START") + + def createSummary(self): + if self.model == 4: + self.onShown.append(self.VFDinit) + return AgingTest_mode2_Summary_VFD + else: + return AgingTest_mode2_Summary + + def VFDinit(self): + if self.curzappingmode == 'manual' : + self.summaries.setText("zapmode", 'MANUAL') + else: + self.summaries.setText("zapmode", 'AUTO') + self.summaries.setText("timer", "Timer %d sec"%self.timeout) + self.summaries.setText("curtuner", "%s (%s, CHANNEL - %s)"%(self.slotindex[self.curtuner], self.NimType[self.curtuner], self.tunelist[self.curtuner][0][0])) + + def setTextVFD(self,name ,text): + if self.model == 4: + self.summaries.setText(name, text) + + def checkTunerType(self): + nimfile = open("/proc/bus/nim_sockets") + for line in nimfile.readlines(): + print line + if line == "": + break + if line.strip().startswith("NIM Socket"): + parts = line.strip().split(" ") + current_slot = int(parts[2][:-1]) + elif line.strip().startswith("Type:"): + self.NimType[current_slot]= str(line.strip()[6:]) + elif line.strip().startswith("empty"): + self.NimType.pop(current_slot) + nimfile.close() + + def makeTunelList(self): + for slot, type in self.NimType.items(): + if type.startswith('DVB-S'): + tunelist_type = 'DVB-S2' + elif type.startswith('DVB-C'): + tunelist_type = 'DVB-C' + elif type.startswith('DVB-T'): + tunelist_type = 'DVB-T' + try : + self.tunelist[slot] = self.tunelist_db[tunelist_type].pop(0) + except: + print "[FactoryTest] ERROR, pop from empty list (%s)"%tunelist_type + print "tunelist : " + print self.tunelist + + def nextZapping(self, mode = 'auto', changeTuner = True, changeService = False, reverse_tuner = False, reverse_service = False): + if mode == 'manual' and changeTuner or mode == 'auto' and self.isChangeTuner: + if reverse_tuner: + self.curtuner -=1 else: - ref = self.getCurrentSelection() - print "servicelist none" + self.curtuner +=1 + if self.curtuner >= len(self.tunelist): + self.curtuner = 0 + if self.curtuner < 0: + self.curtuner = len(self.tunelist)-1 + if mode == 'manual' and changeService or mode == 'auto' and self.isChangeChannel: + if reverse_service: + tunelistlen = len(self.tunelist[self.curtuner]) + nextservice = self.tunelist[self.curtuner].pop(tunelistlen-1) + self.tunelist[self.curtuner].insert(0,nextservice) + else: + currentservice = self.tunelist[self.curtuner].pop(0) + self.tunelist[self.curtuner].append(currentservice) + self.playservice(service=self.tunelist[self.curtuner][0][1]) + if self.curzappingmode == 'auto': + self.timeout = self.zapping_interval + self["text2"].setText("CURRENT TUNER : %s (%s)"%(self.slotindex[self.curtuner], self.NimType[self.curtuner])) + self.setTextVFD("curtuner", "%s (%s, CHANNEL - %s)"%(self.slotindex[self.curtuner], self.NimType[self.curtuner], self.tunelist[self.curtuner][0][0])) + + + def checktimeout(self): + if self.timeout == 0: + self.nextZapping(mode = 'auto') else: - ref = self.oldref - self.session.nav.stopService() # try to disable foreground service - ref.setData(0,0x19) - ref.setData(1,0x83) - ref.setData(2,0x6) - ref.setData(3,0x85) - ref.setData(4,0x640000) + self.timeout -=1 + self["text3"].setText("remain %d sec for next tuning" %self.timeout) + self.setTextVFD("timer", "Timer %d sec"%self.timeout) + + def playservice(self,service = '1:0:19:1325:3EF:1:0x64af79:0:0:0:'): + ref = eServiceReference(service) self.session.nav.playService(ref) + self.avswitch.setAspectRatio(6) + self.avswitch.setColorFormat(0) + self.LockCheckTimer.start(2000,True) + + def LockCheck(self): + result = eSctest.getInstance().getFrontendstatus(self.curtuner) + if result == 0 or result == -1: + if self.model == 4: + self.error +=1 + print "AGINGTEST - LOCK FAIL(%d)"%self.error + self.summaries.setText("error", "LOCK FAIL(%d)"%self.error) + logmsg = "[LOCKFAIL][%d] SLOT : %d, TYPE : %s, CH : %s, ZAPMODE: %s"%(self.error,self.curtuner,self.NimType[self.curtuner],self.tunelist[self.curtuner][0][0],self.curzappingmode) + self.logmessage(logmsg) + else: + self.error +=1 + print "AGINGTEST - LOCK FAIL(%d)"%self.error + logmsg = "[LOCKFAIL][%d] SLOT : %d, TYPE : %s, CH : %s, ZAPMODE: %s"%(self.error,self.curtuner,self.NimType[self.curtuner],self.tunelist[self.curtuner][0][0],self.curzappingmode) + self.logmessage(logmsg) + self.session.open( MessageBox, _("Locking Fail Error"), MessageBox.TYPE_ERROR) + + def logmessage(self,msg): + print "[logmessage]",msg + devpath = None + checklist = ["/autofs/sda1", "/autofs/sdb1", "/autofs/sdc1", "/autofs/sdd1", "/autofs/sde1"] + for dev in checklist: + try: + if fileExists(dev): + if access(dev,F_OK|R_OK|W_OK): + dummy=open(dev+"/dummy03","w") + dummy.write("check") + dummy.close() + dummy=open(dev+"/dummy03","r") + if dummy.readline()=="check": + print dev," - rw check ok" + devpath = dev + break + else: + print dev," - read check error" + dummy.close() + system("rm "+dev+"/dummy03") + else: + print dev," - rw access error" + else: + pass + except: + print dev," - exceptional error" + if devpath: + cmd = "echo %s >> %s/agingTest.log" % (msg,devpath) + print "[logmessage] %s(%s)"%(cmd,devpath) + system(cmd) + + def nothing(self): + print "nothing" + + def keyBlue(self): + if self.curzappingmode == 'auto': + self.curzappingmode = 'manual' + self["text1"].setText("ZAPPING MODE : MANUAL") + self["text3"].setText("Press 'stop' key for exit") + self["text4"].setText("") + self.setTextVFD("zapmode", 'MANUAL') + self.setTextVFD("timer", "") + self.nextzappingtimer.stop() + self.timeout = self.zapping_interval + elif self.curzappingmode == 'manual': + self.curzappingmode = 'auto' + self["text1"].setText("ZAPPING MODE : AUTO") + self["text3"].setText("remain %d sec for next tuning" %self.timeout) + self["text4"].setText("Press 'stop' key for exit") + self.setTextVFD("zapmode", 'AUTO') + self.setTextVFD("timer", "Timer %d sec"%self.timeout) + self.timeout = self.zapping_interval + self.nextzappingtimer.start(1000) + + def keyVolumeup(self): + self.nextZapping(mode = 'manual', changeTuner = False, changeService = True) + + def keyVolumedown(self): + self.nextZapping(mode = 'manual', changeTuner = False, changeService = True, reverse_service = True) + + def keyChannelup(self): + self.nextZapping(mode = 'manual', changeTuner = True, changeService = False) + + def keyChannelDown(self): + self.nextZapping(mode = 'manual', changeTuner = True, changeService = False, reverse_tuner = True) + + def keyMenu(self): + self.session.openWithCallback(self.menuCallback, AgingTest_mode2_setmenu, tuner = self.isChangeTuner, channel = self.isChangeChannel, interval = self.zapping_interval) + + def menuCallback(self, tuner, channel, interval): + if tuner is not None: + self.isChangeTuner = tuner + if channel is not None: + self.isChangeChannel = channel + if interval is not None: + self.zapping_interval = interval + self.timeout = self.zapping_interval def keyEnd(self): - global Agingresult - Agingresult = 0 - self.session.nav.stopService() # try to disable foreground service + self.session.nav.stopService() self.close() def keyFinish(self): - global Agingresult - Agingresult = 1 - self.session.nav.stopService() # try to disable foreground service + self.session.nav.stopService() self.close() +from Components.ConfigList import ConfigListScreen +from Components.config import ConfigInteger, ConfigYesNo, getConfigListEntry, NoSave +class AgingTest_mode2_setmenu(Screen,ConfigListScreen): + skin = """ + + + + + + + """ + def __init__(self,session, tuner = True, channel = False, interval = 300): + Screen.__init__(self,session) + self.session = session + self.tuner = tuner + self.channel = channel + self.zap_interval = interval + self["key_red"] = StaticText(_("Save")) + self["key_green"] = StaticText(_("Cancel")) + self["shortcuts"] = ActionMap(["ShortcutActions", "SetupActions" ], + { + "ok": self.keySave, + "cancel": self.keyCancel, + "red": self.keyCancel, + "green": self.keySave, + }, -2) + self.list = [] + ConfigListScreen.__init__(self, self.list,session = self.session) + self.config_tuner = NoSave(ConfigYesNo(default = self.tuner)) + self.config_channel = NoSave(ConfigYesNo(default = self.channel)) + self.config_zap_interval = NoSave(ConfigInteger(default = self.zap_interval, limits=(5, 9999) ) ) + self.configSetup() + + def configSetup(self): + self.list = [] + self.setupEntryTuner = getConfigListEntry(_("change tuner on timeout"), self.config_tuner ) + self.setupEntryChannel = getConfigListEntry(_("change channel on timeout"), self.config_channel ) + self.setupEntryZapInterval = getConfigListEntry(_("zapping interval (sec) "), self.config_zap_interval ) + self.list.append( self.setupEntryTuner ) + self.list.append( self.setupEntryChannel ) + self.list.append( self.setupEntryZapInterval ) + self["config"].list = self.list + self["config"].l.setList(self.list) + + def keySave(self): + self.close(self.config_tuner.value, self.config_channel.value, self.config_zap_interval.value) + + def keyCancel(self): + self.close(None, None, None) + class TestTuneMenu(Screen): skin = """ diff --git a/lib/python/Plugins/SystemPlugins/FactoryTest/testdb b/lib/python/Plugins/SystemPlugins/FactoryTest/testdb index 71dee33..3ad1cdd 100755 --- a/lib/python/Plugins/SystemPlugins/FactoryTest/testdb +++ b/lib/python/Plugins/SystemPlugins/FactoryTest/testdb @@ -13,7 +13,7 @@ transponders s 12153000:22000000:1:2:192:2:0:1:2:0:2 / ffff029a:03ef:0001 - c 666000:6900000:2:3:0:0 + c 666000:6900000:2:4:0:0 / eeee025c:03ef:0001 t 604000000:1:5:5:3:2:4:4:2:0 @@ -41,6 +41,9 @@ p:BetaDigital,f:40 1325:ffff029a:03ef:0001:25:0 ASTRA HD+ p:BetaDigital,f:40 +1324:ffff029a:03ef:0001:25:0 +ANIXE HD+ +p:BetaDigital,f:40 06d3:026c0000:0003:00a4:1:0 747 Channel [V] China p:STAR,c:000203,c:01028c,c:031ffe,f:40 -- 2.7.4