Example #1
0
	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
Example #2
0
	def FrontAnimate(self):
		if (self.frontturnonoff==0):
			eSctest.getInstance().turnon_VFD()
			self.frontturnonoff = 1
		else:
			self.frontturnonoff = 0
			eSctest.getInstance().turnoff_VFD()
		self.fronttimer.start(1000,True)
Example #3
0
	def keyCancel(self):
		global fronttest
		if self.step==4:
			fronttest = 1
		else:
			fronttest = 0
		eSctest.getInstance().VFD_Close()
		self.close()
Example #4
0
	def keyOk(self):
		if self.step == 3:
			self.step =4
			self.fronttimer.start(1000,True)
			self["text"].setText(("Front Test OK!"))
		elif self.step==4:
			global fronttest
			self.fronttimer.stop()
			eSctest.getInstance().VFD_Close()
			fronttest = 1
			self.close()
Example #5
0
	def __init__(self, session):
		self["actions"] = ActionMap(["DirectionActions", "OkCancelActions"],
		{
			"ok": self.keyOk,
			"up":self.keyUp,
			"down":self.keyDown,			
			"cancel": self.keyCancel,
		}, -2)

		Screen.__init__(self, session)
		self["text"]=Label(("Wheel LEFT"))
		self.step = 1
		
		self.fronttimer= eTimer()
		self.fronttimer.callback.append(self.FrontAnimate)
		self.frontturnonoff = 0
		eSctest.getInstance().VFD_Open()
Example #6
0
	def check_smart_card(self):
		global smartcardtest
		index = self.smartcard
		result  = 0
		if index==0:
			result = eSctest.getInstance().check_smart_card("/dev/sci0")
		elif index ==1:
			result = eSctest.getInstance().check_smart_card("/dev/sci1")
		else:
			result = -1

		print result			
		
		if result == 0:
			print 'pass'
			if(index== 0):
				self.smartcard = 1
				self["text"].setText(_("Testing Smartcard 2..."))
				self.smartcardtimer.start(100,True)
				return
			elif (index==1):
				smartcardtest = 1
				self.session.open( MessageBox, _("Smart Card OK!!"), MessageBox.TYPE_INFO,2)
				self.step = 1
				self["text"].setText(_("Smart Card OK!!"))
				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)
			elif result == -2:
				self.session.open( MessageBox, _("%d:SC_NOT_INSERTED"%(index+1)), MessageBox.TYPE_ERROR)
			elif result == -3:
				self.session.open( MessageBox, _("%d:SC_NOT_VALID_ATR"%(index+1)), MessageBox.TYPE_ERROR)
			elif result == -5:
				self.session.open( MessageBox, _("%d:SC_READ_TIMEOUT"%(index+1)), MessageBox.TYPE_ERROR)
			if(index==0):
				self["text"].setText(_("Smart Card 1 Error!"))
			elif (index==1):
				self["text"].setText(_("Smart Card 2 Error!"))
			self.smartcardtimer.stop()
Example #7
0
	def updateStatus(self):
		index = self["testlist"].getCurrent()[1]
		if index ==2 or index==3:
			tunno = 1
			result = eSctest.getInstance().getFrontendstatus(0)
		else:
			tunno = 2
			result = eSctest.getInstance().getFrontendstatus(1)		
		if index == 2 or index==4:
			hv = "Hor"
		else:
			hv = "Ver"
			
		print "eSctest.getInstance().getFrontendstatus - %d"%result
		if result == 0:
			self.tunerlock = 0
			self.tunemsgtimer.stop()
			self.session.nav.stopService()
			self.session.open( MessageBox, _("Tune%d %s Locking Fail..."%(tunno,hv)), MessageBox.TYPE_ERROR)	
			self.rlist[self["testlist"].getCurrent()[1]]="fail"
		else :
			self.tunerlock = 1
Example #8
0
	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