class FPGAUpgrade(Screen):
skin = """
<screen position="center,center" size="560,440" title="FPGA Upgrade" >
- <ePixmap pixmap="Vu_HD/buttons/red.png" position="0,7" size="140,40" alphatest="blend" />
- <ePixmap pixmap="Vu_HD/buttons/green.png" position="140,7" size="140,40" alphatest="blend" />
- <ePixmap pixmap="Vu_HD/buttons/yellow.png" position="280,7" size="140,40" alphatest="blend" />
- <ePixmap pixmap="Vu_HD/buttons/blue.png" position="420,7" size="140,40" alphatest="blend" />
+ <ePixmap pixmap="Vu_HD/buttons/red.png" position="0,7" size="80,40" alphatest="blend" />
+ <ePixmap pixmap="Vu_HD/buttons/green.png" position="186,7" size="80,40" alphatest="blend" />
+ <ePixmap pixmap="Vu_HD/buttons/blue.png" position="372,7" size="80,40" alphatest="blend" />
- <widget source="key_red" render="Label" position="20,0" zPosition="1" size="115,40" font="Regular;20" halign="center" valign="center" transparent="1" />
- <widget source="key_green" render="Label" position="160,0" zPosition="1" size="115,40" font="Regular;20" halign="center" valign="center" transparent="1" />
- <widget source="key_yellow" render="Label" position="300,0" zPosition="1" size="115,40" font="Regular;20" halign="center" valign="center" transparent="1" />
- <widget source="key_blue" render="Label" position="440,0" zPosition="1" size="115,40" font="Regular;20" halign="center" valign="center" transparent="1" />
+ <widget source="key_red" render="Label" position="28,0" zPosition="1" size="160,40" font="Regular;20" halign="center" valign="center" transparent="1"/>
+ <widget source="key_green" render="Label" position="213,0" zPosition="1" size="160,40" font="Regular;20" halign="center" valign="center" transparent="1"/>
+ <widget source="key_blue" render="Label" position="400,0" zPosition="1" size="160,40" font="Regular;20" halign="center" valign="center" transparent="1"/>
<widget source="status" render="Label" position="15,45" zPosition="1" size="540,40" font="Regular;18" halign="left" valign="center" backgroundColor="#a08500" transparent="1" />
<widget name="file_list" position="0,100" size="555,325" scrollbarMode="showOnDemand" />
self.session = session
self["key_red"] = StaticText(_("Close"))
- self["key_green"] = StaticText(_("Ugrade"))
- self["key_yellow"] = StaticText(_(" "))
+ self["key_green"] = StaticText(_("Upgrade"))
self["key_blue"] = StaticText(_("Download"))
- #self["key_blue"] = StaticText(_(" "))
+
self["status"] = StaticText(_(" "))
self["file_list"] = FileList("/", matchingPattern = "^.*")
self.STATUS_BAR = self["status"]
self.STATUS_BAR.setText(_(self.SOURCELIST.getCurrentDirectory()))
- self.DEVICE_PATH = '/dev/misc/dp'
+ self.DEVICE_LIST = '/dev/fpga_dp;/dev/misc/dp;'
self.DOWNLOAD_TAR_PATH = '/tmp/'
self.DOWNLOAD_FILE_NAME = 'TS_PRO.dat'
self.DOWNLOAD_URL = ''
self.doLoadConf()
self.FPGA = fpga.Fpga()
- print self.DEVICE_PATH
+ print self.DEVICE_LIST
print self.DOWNLOAD_TAR_PATH
print self.DOWNLOAD_FILE_NAME
print self.DOWNLOAD_URL
if confirmed:
self.doExit()
-
-
def doUpgradeHandler(self, confirmed):
if confirmed == False:
return
#self.session.open(MessageBox, _("Can't select directory."), MessageBox.TYPE_INFO, timeout = 5)
return
- self.ERROR_CODE = self.FPGA.fpga_upgrade(path, self.DEVICE_PATH)
+ device = ""
+ device_list = self.DEVICE_LIST.split(";")
+
+ for d in device_list:
+ if os.path.exists(d):
+ device = d
+ break
+
+ if device == None or len(device) == 0:
+ message = "Fail to upgrade.\nCause : Can't found device.\nDo you want to exit?"
+ self.session.openWithCallback(self.onCallbackHandler, MessageBox, _(message), MessageBox.TYPE_YESNO, timeout = 10, default = True)
+ print "DEVICE_LIST : ", device_list
+
+ print "DEVICE : ", device
+ self.ERROR_CODE = self.FPGA.fpga_upgrade(path, device)
if self.ERROR_CODE > 0:
self.ERROR_MSG = self.FPGA.get_error_msg(self.ERROR_CODE, self.ERROR_MSG)
message = "Fail to upgrade.\nCause : " + self.ERROR_MSG + "\nDo you want to exit?"
self.session.openWithCallback(self.onCallbackHandler, MessageBox, _(message), MessageBox.TYPE_YESNO, timeout = 10, default = True)
-
- print "DEVICE_PATH : ", self.DEVICE_PATH
- print "FILE_PATH : ", path
+ print "DEVICE : ", device
+ print "FILE : ", path
else:
#self.session.open(MessageBox, _("Success!!"), MessageBox.TYPE_INFO, timeout = 5)
self.session.open(UpgradeStatus, self, timeout = 10)