Line 30... |
Line 30... |
# Propiedades de la la lista de dispositivos detectados
|
# Propiedades de la la lista de dispositivos detectados
|
self.list_box_dispositivos_conectados.SetFont(font1)
|
self.list_box_dispositivos_conectados.SetFont(font1)
|
|
|
|
|
def menu_item_ayuda_acerca_de_handler(self, event): # wxGlade: wg_parent_class.<event_handler>
|
def menu_item_ayuda_acerca_de_handler(self, event): # wxGlade: wg_parent_class.<event_handler>
|
description = """
|
description = u"""
|
PHR GUI es una interfaz gráfica que permite interactuar con
|
PHR GUI es una interfaz gráfica que permite interactuar con
|
la Plataforma de Hardware Reconfigurable (CUDAR) a través
|
la Plataforma de Hardware Reconfigurable (CUDAR) a través
|
del software xc3sprog.
|
del software xc3sprog.
|
|
|
$Rev: 336 $
|
$Rev: 337 $
|
$Date: 2014-06-11 03:58:02 +0200 (Wed, 11 Jun 2014) $
|
$Date: 2014-06-13 04:58:39 +0200 (Fri, 13 Jun 2014) $
|
"""
|
"""
|
licence = """
|
licence = """
|
PHR GUI is free software; you can redistribute it and/or modify
|
PHR GUI is free software; you can redistribute it and/or modify
|
it under the terms of the GNU General Public License as
|
it under the terms of the GNU General Public License as
|
published by the Free Software Foundation; either version 2
|
published by the Free Software Foundation; either version 2
|
Line 69... |
Line 69... |
wx.AboutBox(info)
|
wx.AboutBox(info)
|
event.Skip()
|
event.Skip()
|
|
|
|
|
def menu_item_ayuda_hint_handler(self, event): # wxGlade: guiParent.<event_handler>
|
def menu_item_ayuda_hint_handler(self, event): # wxGlade: guiParent.<event_handler>
|
mensaje = """
|
mensaje = u"""
|
Procedimiento general para utilizar este programa:
|
Procedimiento general para utilizar este programa:
|
|
|
1. Conecte el programador y presione en el botón \"Detectar\".
|
1. Conecte el programador y presione en el botón \"Detectar\".
|
Se listaran los dispositivos encontrados en la cadena JTAG.
|
Se listaran los dispositivos encontrados en la cadena JTAG.
|
2. Seleccione el dispositivo que desea programar o configurar.
|
2. Seleccione el dispositivo que desea programar o configurar.
|
Line 124... |
Line 124... |
self.boton_detectar.Enable()
|
self.boton_detectar.Enable()
|
self.boton_borrar_salida.Enable()
|
self.boton_borrar_salida.Enable()
|
self.statusbar.SetFields(["Listo"])
|
self.statusbar.SetFields(["Listo"])
|
|
|
|
|
def boton_transferir_thread(self):
|
def boton_transferir_thread(self, position):
|
## preparar entorno
|
## preparar entorno
|
wx.CallAfter(self.before_run)
|
wx.CallAfter(self.before_run)
|
|
|
device_list_selection = self.list_box_dispositivos_conectados.GetSelections()
|
position = str (position)
|
if len (device_list_selection) > 0:
|
|
position = str(device_list_selection[0])
|
|
else:
|
|
position = ""
|
|
|
|
if _platform == "linux" or _platform == "linux2":
|
if _platform == "linux" or _platform == "linux2":
|
# linux
|
# linux
|
command = "./xc3sprog/xc3sprog -v -c ftdi -p " + position + " \""+ self.text_ctrl_fichero.GetValue() + "\""
|
command = "./xc3sprog/lin/xc3sprog -v -c ftdi -p " + position + " \""+ self.text_ctrl_fichero.GetValue() + "\""
|
else:
|
else:
|
# windows
|
# windows
|
subprocess.call ("copy \"" + self.text_ctrl_fichero.GetValue() + "\" fpgaFile", shell=True)
|
subprocess.call ("copy \"" + self.text_ctrl_fichero.GetValue() + "\" fpgaFile", shell=True)
|
command = "xc3sprog\\xc3sprog.exe -v -L -c ftdi -p " + position + " fpgaFile:w:0:BIT"
|
command = "xc3sprog\\win\\xc3sprog -v -L -c ftdi -p " + position + " fpgaFile:w:0:BIT"
|
|
|
wx.CallAfter(self.text_ctrl_console.AppendText, command + "\n")
|
wx.CallAfter(self.text_ctrl_console.AppendText, command + "\n")
|
|
|
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
|
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
|
|
|
Line 172... |
Line 168... |
## restaurar entorno
|
## restaurar entorno
|
wx.CallAfter(self.after_run)
|
wx.CallAfter(self.after_run)
|
|
|
|
|
def boton_transferir_handler(self, event): # wxGlade: wg_parent_class.<event_handler>
|
def boton_transferir_handler(self, event): # wxGlade: wg_parent_class.<event_handler>
|
thread.start_new_thread(self.boton_transferir_thread, ())
|
|
|
device_list_selection = self.list_box_dispositivos_conectados.GetSelections()
|
|
|
|
if len (device_list_selection) > 0:
|
|
position = device_list_selection[0]
|
|
else:
|
|
position = 0
|
|
|
|
thread.start_new_thread(self.boton_transferir_thread, (position,))
|
event.Skip()
|
event.Skip()
|
|
|
|
|
def boton_detectar_thread (self):
|
def boton_detectar_thread (self):
|
## preparar entorno
|
## preparar entorno
|
Line 185... |
Line 189... |
|
|
## accion
|
## accion
|
|
|
if _platform == "linux" or _platform == "linux2":
|
if _platform == "linux" or _platform == "linux2":
|
# linux
|
# linux
|
command = "./xc3sprog/xc3sprog -c ftdi"
|
command = "./xc3sprog/lin/xc3sprog -c ftdi"
|
else:
|
else:
|
# windows
|
# windows
|
command = "xc3sprog\\xc3sprog -c ftdi -L -j -v"
|
command = "xc3sprog\\win\\xc3sprog -c ftdi -L -j -v"
|
|
|
wx.CallAfter(self.text_ctrl_console.AppendText, command + "\n")
|
wx.CallAfter(self.text_ctrl_console.AppendText, command + "\n")
|
|
|
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
|
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
|
|
|
Line 212... |
Line 216... |
|
|
wx.CallAfter(self.list_box_dispositivos_conectados.Append, appendStr)
|
wx.CallAfter(self.list_box_dispositivos_conectados.Append, appendStr)
|
|
|
process.stdout.close()
|
process.stdout.close()
|
|
|
|
if self.list_box_dispositivos_conectados.GetCount() >= 1:
|
wx.CallAfter(self.list_box_dispositivos_conectados.SetSelection, 0)
|
wx.CallAfter(self.list_box_dispositivos_conectados.SetSelection, 0)
|
|
|
wx.CallAfter(self.text_ctrl_console.AppendText, "\nPHR>>> ")
|
wx.CallAfter(self.text_ctrl_console.AppendText, "\nPHR>>> ")
|
|
|
## restaurar entorno
|
## restaurar entorno
|
Line 227... |
Line 232... |
event.Skip()
|
event.Skip()
|
|
|
# end of class phrgui
|
# end of class phrgui
|
|
|
if __name__ == "__main__":
|
if __name__ == "__main__":
|
app = wx.PySimpleApp(0)
|
app = wx.App(False)
|
wx.InitAllImageHandlers()
|
|
frame = phrgui(None, -1, "")
|
frame = phrgui(None, -1, "")
|
app.SetTopWindow(frame)
|
app.SetTopWindow(frame)
|
frame.Show()
|
frame.Show()
|
app.MainLoop()
|
app.MainLoop()
|
|
|
|
|
No newline at end of file
|
No newline at end of file
|