}, -2)
Screen.__init__(self, session)
- TESTPROGRAM_DATE = "2010-03-02"
- TESTPROGRAM_VERSION = "Version 00.01"
+ TESTPROGRAM_DATE = "2010-04-28"
+ TESTPROGRAM_VERSION = "Version 01.10"
self.model = 0
self.getModelInfo()
self.rlist = []
for x in range(self.menulength):
self.rlist.append((".."))
-# self.rlist.append((" "))
self["resultlist"] = TestResultList(self.rlist)
-# self.NetworkState = 0
-# self.first = 0
-
self.avswitch = AVSwitch()
-# self.memTest = eMemtest()
self.scTest= eSctest()
-# self.feid=0
-# self.agingmode=0
self.testing = 0
self.servicelist = ServiceList()
self.tunemsgtimer = eTimer()
self.tunemsgtimer.callback.append(self.tunemsg)
-# chang : use "self.tuner_test_last_index" instead of cam_index
-# if self.model == 0:
-# self.cam_index = 7
-# elif self.model == 1:
-# self.cam_index = 4
-# elif self.model == 2:
-# self.cam_index = 6
-
self.camstep = 1
self.camtimer = eTimer()
self.camtimer.callback.append(self.cam_state)
self.agingtimer = eTimer()
self.agingtimer.callback.append(self.agingCheck)
+ self.setSourceVar()
def createConfig(self):
tlist = []
AspectRatio=["4:3", "16:9"]
ColorFormat=["CVBS","RGB","YC","CVBS","CVBS","CVBS","CVBS","CVBS"]
self.tuneInfo={}
- if self.model == 3 or self.model == 4:
- for (key, val) in self.NimType.items():
- if val["type"].startswith("DVB-S"):
+ for (key, val) in self.NimType.items():
+ if val["type"].startswith("DVB-S"):
# Chang : DVB -S setting diseqc A
- getRatio = AspectRatio.pop(0) # ratio
- AspectRatio.append(getRatio)
- getColorFormat=ColorFormat.pop(0) # colorFormat
- menuname=" %d. T%d %s H 22k 0 %s %s" % (current_index, key+1, val["type"], getRatio, getColorFormat) #menuname
- print current_index
+ getRatio = AspectRatio.pop(0) # ratio
+ AspectRatio.append(getRatio)
+ getColorFormat=ColorFormat.pop(0) # colorFormat
+ menuname=" %d. T%d %s H 22k 0 %s %s" % (current_index, key+1, val["type"], getRatio, getColorFormat) #menuname
+ print current_index
# current_index=4
- self.setTuneInfo(index=current_index, slot=key, type=val["type"], sat=val["sat1"], pol="H", tone=True, ratio=getRatio, color=getColorFormat, cam=False) # setTuneInfo
+ self.setTuneInfo(index=current_index, slot=key, type=val["type"], sat=val["sat1"], pol="H", tone=True, ratio=getRatio, color=getColorFormat, cam=False) # setTuneInfo
# self.setTuneInfo(current_index, key, val["type"], val["sat1"], "H", True, getRatio, getColorFormat, False) # setTuneInfo
- tlist.append((menuname,current_index))
- current_index+=1
+ tlist.append((menuname,current_index))
+ current_index+=1
# Chang : DVB -S setting diseqc B
- getRatio = AspectRatio.pop(0)
- AspectRatio.append(getRatio)
- getColorFormat=ColorFormat.pop(0)
- menuname=" %d. T%d %s V 22k x %s %s" % (current_index, key+1, val["type"], getRatio, getColorFormat)
- if len(self.NimType) == key+1: # CAM test on/off
- menuname+=" CAM"
- camtest = True
- else:
- camtest = False
- self.setTuneInfo( index=current_index, slot=key, type=val["type"], sat=val["sat2"], pol="V", tone=False, ratio=getRatio, color=getColorFormat, cam=camtest)
- tlist.append((menuname,current_index))
- current_index+=1
+ getRatio = AspectRatio.pop(0)
+ AspectRatio.append(getRatio)
+ getColorFormat=ColorFormat.pop(0)
+ menuname=" %d. T%d %s V 22k x %s %s" % (current_index, key+1, val["type"], getRatio, getColorFormat)
+ if len(self.NimType) == key+1: # CAM test on/off
+ menuname+=" CAM"
+ camtest = True
+ else:
+ camtest = False
+ self.setTuneInfo( index=current_index, slot=key, type=val["type"], sat=val["sat2"], pol="V", tone=False, ratio=getRatio, color=getColorFormat, cam=camtest)
+ tlist.append((menuname,current_index))
+ current_index+=1
# Chang : DVB -T or DVB-C
- elif val["type"].startswith("DVB-T") or val["type"].startswith("DVB-C"):
+ elif val["type"].startswith("DVB-T") or val["type"].startswith("DVB-C"):
+ additionalMenu = None
+ menulen = 1
+ if len(self.NimType) == 1:
+ additionalMenu = True
+ menulen +=1
+ for x in range(menulen):
getRatio = AspectRatio.pop(0)
AspectRatio.append(getRatio)
getColorFormat=ColorFormat.pop(0)
menuname=" %d. T%d %s %s %s" % (current_index, key+1, val["type"], getRatio, getColorFormat)
- if len(self.NimType) == key+1: # CAM test on/off
+ if len(self.NimType) == key+1 and (additionalMenu is None or x != 0): # CAM test on/off
menuname+=" CAM"
camtest = True
else:
- camtest = False
+ camtest = False
self.setTuneInfo( index=current_index, slot=key, type=val["type"], sat=None, pol=None, tone=None, ratio=getRatio, color=getColorFormat, cam=camtest)
tlist.append((menuname,current_index))
current_index+=1
def getModelInfo(self):
getmodel = 0
-# if fileExists("/proc/stb/info/vumodel"):
-# info = open("/proc/stb/info/vumodel").read().strip()
- if fileExists("/test/vumodel"):
- info = open("/test/vumodel").read().strip()
+ if fileExists("/proc/stb/info/vumodel"):
+ info = open("/proc/stb/info/vumodel").read().strip()
if info == "duo":
self.model = 0
getmodel = 1
print "getModelInfo : ultimo"
if getmodel == 0 and fileExists("/proc/stb/info/version"):
info = open("/proc/stb/info/version").read()
-# print info,info[:2]
if info[:2] == "14":
self.model = 1
print "getModelInfo : solo_"
def numberaction(self, number):
if self.testing==1:
return
- if number > self.menulength:
+ if number >= self.menulength:
return
index = int(number)
self["testlist"].moveToIndex(index)
if not servicelist is None:
ref = servicelist.getNext()
else:
- ref = self.getCurrentSelection()
+ ref = self.getCurrentSelection() # raise error
print "servicelist none"
else:
ref = self.oldref
self.tunemsgtimer.start(3000, True)
elif self.model == 3 or self.model == 4:
getTuneInfo=self.tuneInfo[index]
+ if getTuneInfo["cam"] is True:
+ self.camstep = 1
+ self.camtimer.start(100,True)
if getTuneInfo["type"].startswith("DVB-S"):
if getTuneInfo["pol"] == "H":
ref.setData(0,1)
ref.setData(1,0x1325)
ref.setData(2,0x3ef)
ref.setData(3,0x1)
- ref.setData(4,0x64af79)
if getTuneInfo["sat"] == "160": # Eutelsat W2
ref.setData(4,0xA00000)
elif getTuneInfo["sat"] == "100": # Eutelsat
ref.setData(2,0x3ef)
ref.setData(3,0x1)
ref.setData(4,-286391716) # eeee025c
-
self.session.nav.playService(ref)
if getTuneInfo["color"]=="CVBS":
self.avswitch.setColorFormat(0)
self.avswitch.setAspectRatio(0)
elif getTuneInfo["ratio"] == "16:9":
self.avswitch.setAspectRatio(6)
- if getTuneInfo["cam"] is True:
- self.camstep = 1
- self.camtimer.start(100,True)
self.tuningtimer.start(2000,True)
self.tunemsgtimer.start(3000, True)
self.session.open( MessageBox, _("CAM1_NOT_INSERTED\nPress exit!"), MessageBox.TYPE_ERROR)
self.rlist[current_index]="fail"
self.tunemsgtimer.stop()
-# self.rlist[index]="fail"
-# self["resultlist"].updateList(self.rlist)
elif self.camstep == 2:
slot = 0
appname = eDVBCI_UI.getInstance().getAppName(slot)
self.session.open( MessageBox, _("CAM2_NOT_INSERTED\nPress exit!"), MessageBox.TYPE_ERROR)
self.rlist[current_index]="fail"
self.tunemsgtimer.stop()
-# self.rlist[index]="fail"
-# self["resultlist"].updateList(self.rlist)
elif self.camstep == 4:
slot = 1
appname = eDVBCI_UI.getInstance().getAppName(slot)
else:
self.setSource()
self.camstep = 5
-# self.session.open( MessageBox, _("CAM OK!"), MessageBox.TYPE_INFO,2)
def updateStatus(self):
current_index = self.currentindex
current_index=self.currentindex
self.session.nav.stopService() # try to disable foreground service
if yesno and self.tunerlock == 1:
- if current_index == self.tuner_test_last_index and self.camstep < 5:
+ if current_index == self.tuner_test_last_index and self.camstep < 5: # need fix to depending about CAM exist
self.rlist[current_index]="fail"
else :
self.rlist[current_index]="pass"
self.tuningtimer.stop()
self.session.openWithCallback(self.tuneback, MessageBox, _("%s ok?" %(self["testlist"].getCurrent()[0])), MessageBox.TYPE_YESNO)
+ def setSourceVar(self):
+ if self.model == 0:
+ self.input_pad_num=1
+ self.setTuner = 'B'
+ elif self.model == 1:
+ self.input_pad_num=0
+ self.setTuner = 'A'
+ else:
+ self.input_pad_num=len(self.NimType)-1
+ if self.input_pad_num == 0:
+ self.setTuner = 'A'
+ elif self.input_pad_num == 1:
+ self.setTuner = 'B'
+ elif self.input_pad_num == 2:
+ self.setTuner = 'C'
+
# ikseong - for 22000 tp
def setSource(self):
+# fix input source
+ inputname = ("/proc/stb/tsmux/input%d" % self.input_pad_num)
+ print "<setsource> inputname : ",inputname
+ fd=open(inputname,"w")
+ fd.write("CI0")
+ fd.close()
+# fix ci_input Tuner
filename = ("/proc/stb/tsmux/ci0_input")
fd = open(filename,'w')
- fd.write('B')
-# fd.write('A')
- fd.close()
-# filename = ("/proc/stb/tsmux/ci1_input")
-# fd = open(filename,'w')
-# fd.write('CI0')
-# fd.close()
- fd=open("/proc/stb/tsmux/input1","w")
-# fd=open("/proc/stb/tsmux/input0","w")
- fd.write("CI0")
+ fd.write(self.setTuner)
+ print "setTuner(CI0) : ",self.setTuner
fd.close()
print "CI loop test!!!!!!!!!!!!!!"
def resetSource(self):
- fd=open("/proc/stb/tsmux/input1","w")
- fd.write("B")
+ inputname = ("/proc/stb/tsmux/input%d" % self.input_pad_num)
+ print "<resetsource> inputname : ",inputname
+ fd=open(inputname,"w")
+ fd.write(self.setTuner)
fd.close()
print "CI loop test end!!!!!!!!!!!!!!"
else:
ref = self.oldref
self.session.nav.stopService() # try to disable foreground service
- ref.setData(0,0x19)
- ref.setData(1,0x1325)
- ref.setData(2,0x3ef)
- ref.setData(3,0x1)
- ref.setData(4,0x64af79)
+ 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)
if data == 1:
ethtest = 1
print "success"
-# self.session.open( MessageBox, _("Ping test pass"), MessageBox.TYPE_INFO,2)
self.session.openWithCallback(self.openMacConfig ,MessageBox, _("Ping test pass"), MessageBox.TYPE_INFO,2)
else:
global ethtest
if ethtest == 1:
self.rlist[self.ethernettestIndex]="pass"
-# self.rlist[self["testlist"].getCurrent()[1]]="pass"
else:
self.rlist[self.ethernettestIndex]="fail"
-# self.rlist[self["testlist"].getCurrent()[1]]="fail"
self.getmacaddr()
self.testing = 0
self.mactry = mactry
self.model = 0
self.getModelInfo()
-# self.result = 0
self.macfd = 0
self.macaddr = "000000000000"
self.ReadMacinfo = 0
ethtest = 0
self.close()
-
-sccitest = 0
-
-class ScCiTest(Screen):
- skin = """
- <screen position="120,225" size="440,200" title="CI Smartcard Test" >
- <widget name="testlist" position="10,0" size="340,120" />
- <widget name="resultlist" position="370,0" size="60,120" />
- <eLabel text=" " position="5,125" zPosition="-1" size="430,5" backgroundColor="#02e1e8e6" />
- <widget name="text" position="10,140" size="420,50" font="Regular;25" />
- </screen>"""
- step=1
- def __init__(self, session):
- self["actions"] = ActionMap(["DirectionActions","OkCancelActions"],
- {
- "ok": self.keyOk,
- "up": self.up,
- "down":self.down,
- "cancel": self.keyCancel,
- }, -2)
-
- Screen.__init__(self, session)
- tlist = []
- tlist.append(("Smartcard 1 Test",0))
- tlist.append(("Smartcard 2 Test",1))
- tlist.append(("CI 1 Test",2))
- tlist.append(("CI 2 Test",3))
- self["testlist"] = MenuList(tlist)
- self.rlist = []
- for x in range(4):
- self.rlist.append((".."))
- self["resultlist"] = TestResultList(self.rlist)
- self.result = 0
- self.removecard = eTimer()
- self.removecard.callback.append(self.remove_card)
- self["text"]=Label(("Press OK Key"))
- self.camstate= eTimer()
- self.camstate.callback.append(self.cam_state)
- self.camtry = 5
- self.camstep = 0
-
- def keyCancel(self):
- global sccitest
- print "result ", self.result
- if self.result==15:
- sccitest=1
- self.resetSource()
- self.close()
-
- def up(self):
- self["text"].setText(_("Press OK Key"))
- self["testlist"].instance.moveSelection(self["testlist"].instance.moveUp)
-
- def down(self):
- self["text"].setText(_("Press OK Key"))
- self["testlist"].instance.moveSelection(self["testlist"].instance.moveDown)
-
- def keyOk(self):
- print "line - ",self["testlist"].getCurrent()[1]
- index = self["testlist"].getCurrent()[1]
- result = 0
- if index==0 or index==1:
- self["text"].setText(_("Insert Card?"))
- self.ScTest(True)
- elif index ==2 or index==3:
- self["text"].setText(_("Insert Cam"))
- self.CamTest()
-
- def CamTest(self):
- self.camtry = 10
- self.camstep = 1
- self.camstate.start(1000,True)
-
- def setSource(self, cislot):
- filename = ("/proc/stb/tsmux/ci%d_input"%cislot)
- fd = open(filename,'w')
- fd.write('A')
- fd.close()
-
- def setInputSource(self, cislot):
- fd=open("/proc/stb/tsmux/input0","w")
- if cislot==0:
- fd.write("CI0")
- else:
- fd.write("CI1")
- fd.close()
-
- def resetSource(self):
- fd=open("/proc/stb/tsmux/input0","w")
- fd.write("A")
- fd.close()
-# fd = open("/proc/stb/tsmux/ci0_input","w")
-# fd.write("CI0")
-# fd.close()
-# fd = open("/proc/stb/tsmux/ci1_input","w")
-# fd.write("CI1")
-# fd.close()
-
- def channelstart(self):
- ref = eServiceReference("1:0:19:1324:3EF:1:C00000:0:0:0")
- ref.setData(0,0x19)
- ref.setData(1,0x83)
- ref.setData(2,0x6)
- ref.setData(3,0x85)
- ref.setData(4,0x640000)
- self.session.nav.playService(ref)
-
- def channelstop(self):
- self.session.nav.stopService() # try to disable foreground service
-
- def cam_state(self):
- index = self["testlist"].getCurrent()[1]
- if (index-2)==0:
- slot = 1
- else:
- slot = 0
- print 'cam_state', self.camstep,self.camtry
- if self.camstep == 1:
- state = eDVBCI_UI.getInstance().getState(slot)
- print 'stat',state
- if state == 1:
- self.camstep=2
- self.camtry=10
- self["text"].setText(_("Getting Cam name...."))
- self.camstate.start(5000,True)
- else:
- self.camtry-=1
- if self.camtry>0:
- self.camstate.start(1000,True)
- else:
- self.session.open( MessageBox, _("NO_NOT_INSERTED"), MessageBox.TYPE_ERROR)
- self.rlist[index]="fail"
- self["resultlist"].updateList(self.rlist)
-
- elif self.camstep == 2:
- appname = eDVBCI_UI.getInstance().getAppName(slot)
- print 'appname',appname
- if appname is None:
- self.camtry-=1
- if self.camtry>0:
- self.camstate.start(1000,True)
- else:
- self.session.open( MessageBox, _("NO_GET_APPNAME"), MessageBox.TYPE_ERROR)
- self.rlist[index]="fail"
- self["resultlist"].updateList(self.rlist)
- else:
- self["text"].setText(_("Get Cam name : %s"%appname+". \n Remove Cam!"))
- self.channelstart()
- self.setInputSource(slot)
- self.setSource(slot)
- self.camstep=3
- self.camtry=30
- self.camstate.start(1000,True)
- elif self.camstep==3:
- state = eDVBCI_UI.getInstance().getState(slot)
- print 'stat', state
- if state == 0:
- self.channelstop()
- self.result += (1<<index)
- print self.result
- self.rlist[index]="pass"
- self["text"].setText(_("Press OK Key"))
- self["resultlist"].updateList(self.rlist)
- if index==2:
- self.down()
- elif index == 3:
- self.keyCancel()
- else:
- self.camtry-=1
- if self.camtry>0:
- self.camstate.start(1000,True)
- else:
- self.channelstop()
- self.session.open( MessageBox, _("NO_REMOVE_CAM"), MessageBox.TYPE_ERROR)
- self.rlist[index]="fail"
- self["resultlist"].updateList(self.rlist)
-
- def check_smart_card(self,which):
- index = which
- result = 0
- if which==0:
- result = eSctest.getInstance().check_smart_card("/dev/sci0")
- elif which ==1:
- result = eSctest.getInstance().check_smart_card("/dev/sci1")
- else:
- result = -1
-
- print result
-
- if result == 0:
- print 'pass'
- else:
- if result ==-1:
- self.session.open( MessageBox, _("1:NO_DEV_FOUND"), MessageBox.TYPE_ERROR)
- elif result == -2:
- self.session.open( MessageBox, _("1:SC_NOT_INSERTED"), MessageBox.TYPE_ERROR)
- elif result == -3:
- self.session.open( MessageBox, _("1:SC_NOT_VALID_ATR"), MessageBox.TYPE_ERROR)
- elif result == -5:
- self.session.open( MessageBox, _("1:SC_READ_TIMEOUT"), MessageBox.TYPE_ERROR)
- self.rlist[which]="fail"
- self["resultlist"].updateList(self.rlist)
- return result
-
- def remove_card(self):
- index = self["testlist"].getCurrent()[1]
- if index==0:
- result = eSctest.getInstance().eject_smart_card("/dev/sci0")
- elif index==1:
- result = eSctest.getInstance().eject_smart_card("/dev/sci1")
- print 'remove result' ,result
- if result == 0:
- self.rlist[index]="pass"
- self.result += (1<<index)
- else:
- if result ==-1:
- self.session.open( MessageBox, _("2:NO_DEV_FOUND"), MessageBox.TYPE_ERROR)
- elif result == -2:
- self.session.open( MessageBox, _("2:SC_NOT_INSERTED"), MessageBox.TYPE_ERROR)
- elif result == -3:
- self.session.open( MessageBox, _("2:SC_NOT_VALID_ATR"), MessageBox.TYPE_ERROR)
- elif result == -4:
- self.session.open( MessageBox, _("2:SC_NOT_REMOVED"), MessageBox.TYPE_ERROR)
- self.rlist[index]="fail"
- self["resultlist"].updateList(self.rlist)
- self["text"].setText(_("Press OK Key"))
- self.down()
- return result
-
-
- def ScTest(self, yesno):
- if yesno==False:
- return
- index = self["testlist"].getCurrent()[1]
- result = self.check_smart_card(index)
- if result==0:
- self.removecard.start(100,True)
- self["text"].setText(_("Read Ok. Remove Card!"))
- else:
- return
-
smartcardtest = 0
-
class SmartCardTest(Screen):
skin = """
<screen position="300,240" size="160,120" title="SmartCard Test" >
}, -2)
Screen.__init__(self, session)
-# self["text"]=Label(("Press Key LEFT"))
self["text"]=Label(("Testing Smartcard 1..."))
self.step = 0
self.smartcardtimer = eTimer()
return
elif (index==1 or self.model==1):
smartcardtest = 1
-# self.session.open( MessageBox, _("Smart Card OK!!"), MessageBox.TYPE_INFO,2)
self.step = 1
self["text"].setText(_("Smart Card OK!!"))
self.closetimer.start(2000,True)
self["text"].setText(_("Smart Card model type error"))
self.closetimer.start(2000,True)
self.smartcardtimer.stop()
-# self.session.openWithCallback(self.check6, MessageBox, _("Scart loop ok?"), MessageBox.TYPE_INFO)
else:
# if result ==-1:
# self.session.open( MessageBox, _("%d:NO_DEV_FOUND"%(index+1)), MessageBox.TYPE_ERROR)
self.keytimeout.start(5000,True)
self.step=2
self["text"].setText(_("Wheel RIGHT"))
-# else:
-# print ""
def keyOk(self):
if self.step == 3:
if r:
input = rs.read(1)
if input == "\n":
-# if input == "m":
rstest = 1
else:
rstest = 0
</screen>"""
step=1
def __init__(self, session):
- self["actions"] = ActionMap(["WizardActions","GlobalActions"],
+ self["actions"] = ActionMap(["MediaPlayerActions","GlobalActions"],
{
- "agingend": self.keyEnd,
- "agingfinish": self.keyFinish,
+ "pause": self.keyEnd,
+ "stop": self.keyFinish,
"volumeUp": self.nothing,
"volumeDown": self.nothing,
"volumeMute": self.nothing,
#def Plugins(**kwargs):
# return PluginDescriptor(name=_("Factory Test"), description="Test App for Factory", where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main)
+
+def Plugins(**kwargs):
+ return []