Author: bugman Date: Thu Jan 28 13:24:28 2010 New Revision: 10499 URL: http://svn.gna.org/viewcvs/relax?rev=10499&view=rev Log: Shifted the RedirectText class from execution.calc_modelfree into the controller module. Modified: branches/bieri_gui/gui_bieri/controller.py branches/bieri_gui/gui_bieri/execution/calc_modelfree.py Modified: branches/bieri_gui/gui_bieri/controller.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/controller.py?rev=10499&r1=10498&r2=10499&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/controller.py (original) +++ branches/bieri_gui/gui_bieri/controller.py Thu Jan 28 13:24:28 2010 @@ -177,5 +177,34 @@ event.Skip() + +class RedirectText(object): + """Class to redirect relax output to relaxGUI - log panel and progress bar.""" + + def __init__(self,aWxTextCtrl): + self.out=aWxTextCtrl + + + def write(self,string): + global progress + + wx.CallAfter(self.out.log_panel.WriteText, string) + time.sleep(0.001) # allow relaxGUI log panel to get refreshed + + # split print out into list + a = str(string) + check = [] + check = a.split() + + # update progress bar + if 'Simulation' in string: + add = round(progress) + add_int = int(add) + wx.CallAfter(self.out.progress_bar.SetValue, add_int) + progress = ( (int(check[1]) * 100) / float(montecarlo + 6)) + 5 + time.sleep(0.001) # allow relaxGUI progressbar to get refreshed + + + class Thread_container: """Storage object for the calculation threads.""" Modified: branches/bieri_gui/gui_bieri/execution/calc_modelfree.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/execution/calc_modelfree.py?rev=10499&r1=10498&r2=10499&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/execution/calc_modelfree.py (original) +++ branches/bieri_gui/gui_bieri/execution/calc_modelfree.py Thu Jan 28 13:24:28 2010 @@ -69,29 +69,3 @@ # Return the float. return result - - -class RedirectText(object): - """Class to redirect relax output to relaxGUI - log panel and progress bar.""" - - def __init__(self,aWxTextCtrl): - self.out=aWxTextCtrl - - def write(self,string): - global progress - - wx.CallAfter(self.out.log_panel.WriteText, string) - time.sleep(0.001) # allow relaxGUI log panel to get refreshed - - # split print out into list - a = str(string) - check = [] - check = a.split() - - # update progress bar - if 'Simulation' in string: - add = round(progress) - add_int = int(add) - wx.CallAfter(self.out.progress_bar.SetValue, add_int) - progress = ( (int(check[1]) * 100) / float(montecarlo + 6)) + 5 - time.sleep(0.001) # allow relaxGUI progressbar to get refreshed