mailRe: r10916 - /branches/bieri_gui/gui_bieri/controller.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on February 25, 2010 - 09:23:
Hi,

Again, this is very much the wrong way to do this!  This string
parsing is slow, and will break the GUI horribly once Gary's
multi-processor branch has been merged.  If anything manipulates
STDOUT before the relax controller can catch it, then the relax
controller is dead.

I will create the status singleton object today (in the 1.3 line so
you will need to svnmerge).  I will also place the global iteration
counter for the dAuvernge_protocol into there.  Each user function (in
the 1.3 line code only) can then start putting information into this
object.  The relax controller can then do something like:

from status import Status

status = Status()
while 1:
    sleep(1)
    print status.dAuvergne_protocol_iter
    print status.dAuvergne_protocol_global_model

with the calculation running in a thread, the relax controller will
then get the counter number and the global model ('local_tm',
'ellipsoid', etc.) that the thread itself updates.

Regards,

Edward



On 25 February 2010 04:10,  <michael.bieri@xxxxxx> wrote:
Author: michaelbieri
Date: Thu Feb 25 04:10:44 2010
New Revision: 10916

URL: http://svn.gna.org/viewcvs/relax?rev=10916&view=rev
Log:
The relaxGUI log window reads Progress output and updates progress bar.

The automatic calculation scripts have to prompt a message like 'Progress: 
10'. The relaxGUI controller recognizes a progress of 10% and updates the 
prohgress bar.

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=10916&r1=10915&r2=10916&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/controller.py (original)
+++ branches/bieri_gui/gui_bieri/controller.py Thu Feb 25 04:10:44 2010
@@ -213,7 +213,7 @@
        global progress

        # Limit panle entries to max_entries Lines.
-        wx.CallAfter(self.limit_entries)
+        #wx.CallAfter(self.limit_entries)

        # Add new output.
        wx.CallAfter(self.out.log_panel.AppendText, string)
@@ -225,6 +225,7 @@
        check = a.split()

        # update progress bar
+        # Monte Carlo Simulation.
        if 'Simulation' in string:
            add = round(progress)
            add_int = int(add)
@@ -232,6 +233,12 @@
            progress = ( (int(check[1]) * 100) / float(montecarlo + 6)) + 5
            time.sleep(0.001)  # allow relaxGUI progressbar to get refreshed

+        # Other calculations.
+        if 'Progress:' in string:
+            progress = check[1]
+            progress = progress.replace('&', '')
+            wx.CallAfter(self.out.progress_bar.SetValue, int(progress))
+            time.sleep(0.001)  # allow relaxGUI progressbar to get 
refreshed


 class Thread_container:


_______________________________________________
relax (http://nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits




Related Messages


Powered by MHonArc, Updated Thu Feb 25 09:40:18 2010