class BootloaderGUIMain(wx.App): def __init__(self,opt): wx.App.__init__(self,opt) self.Bootloader = SerialLoader() self.Uploading = False self.Status = 'OK' self.Percent = 0 self.timer = wx.Timer() self.timer.Start(500,False) self.Bind(wx.EVT_TIMER,self.on_timer) def OnInit(self): wx.InitAllImageHandlers() self.mainframe = BootloaderGUI(self,None) self.SetTopWindow(self.mainframe) self.mainframe.Show(1) return 1 def finishUpload(self): self.mainframe.finishUpload() self.Bootloader.releasePort() self.Uploading = False def on_timer(self,event): self.mainframe.status_update()
def __init__(self,opt): wx.App.__init__(self,opt) self.Bootloader = SerialLoader() self.Uploading = False self.Status = 'OK' self.Percent = 0 self.timer = wx.Timer() self.timer.Start(500,False) self.Bind(wx.EVT_TIMER,self.on_timer)
# You should have received a copy of the GNU Lesser General Public License # along with Skybotix API. If not, see <http://www.gnu.org/licenses/>. # import traceback import os import re import BaseHTTPServer import threading import SimpleHTTPServer from SerialLoader import * bootloader = SerialLoader() bootloader.portname="/dev/ttyS0" bootloader.uploading = False logqueue = ['Log started'] class LogReport(ProgressReport): def report_percent(self,percent): pass def report_string(self,s): logqueue.append(s) class UploadThread(threading.Thread): def __init__(self,filename): threading.Thread.__init__(self) self.filename = filename