Author: michaelbieri Date: Mon Apr 12 03:02:19 2010 New Revision: 11061 URL: http://svn.gna.org/viewcvs/relax?rev=11061&view=rev Log: The relaxGUI controller updates its progress bar using informations from the status singleton during model-free analysis. Currently, there is a maximum of iterations set for models 1 - 5. This also has to be set in the dauvergne_protocol.py script. Edward, what do you think about limiting to 20 iterations? Modified: branches/bieri_gui/gui_bieri/controller.py Modified: branches/bieri_gui/gui_bieri/controller.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/controller.py?rev=11061&r1=11060&r2=11061&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/controller.py (original) +++ branches/bieri_gui/gui_bieri/controller.py Mon Apr 12 03:02:19 2010 @@ -142,13 +142,50 @@ def __init__(self,aWxTextCtrl): self.out=aWxTextCtrl + self.status = Status() + def limit_entries(self): + """ Function to overcome feedback problem of wx.CallAfter() command""" + + # Maximum allowed number of lines in log window. + max_entries = 10000 + + # read number of lines in log window. + total_entries = self.out.log_panel.GetNumberOfLines() + + # Shift entries backwards if maximum of line exeeded. + if total_entries > max_entries: + # Reset log window entries + new_entries = 'Refreshing log window...\n\n' + self.out.log_panel.SetValue(new_entries) def write(self,string): - global progress # Limit panle entries to max_entries Lines. wx.CallAfter(self.limit_entries) + + # Update Gauge (Progress bar). + # Local tm model: + if self.status.dAuvergne_protocol.diff_model == 'local_tm': + # Current model. + no = self.status.dAuvergne_protocol.current_model[2:] + no = int(no) + + # Total selected models. + total_models = len(self.status.dAuvergne_protocol.local_mf_models) + + # update Progress bar. + wx.CallAfter(self.out.progress_bar.SetValue, (100*no/total_models)) + + # Sphere to Ellipsoid Models. + if self.status.dAuvergne_protocol.diff_model in ['sphere', 'prolate', 'oblate', 'ellipsoid']: + # Determine actual round (maximum is 20). + wx.CallAfter(self.out.progress_bar.SetValue, (100*(self.status.dAuvergne_protocol.round-1)/20)) + + # Final analysis. + if self.status.dAuvergne_protocol.diff_model == 'final': + mc_simulation = self.status.mc_number + # Add new output. wx.CallAfter(self.out.log_panel.AppendText, string)