Changes in / [835937b5:cfd27dd] in sasview


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/basepage.py

    raf1187a ra1b8fee  
    1515import traceback 
    1616 
    17 from Queue import Queue 
    18 from threading import Thread 
    1917from collections import defaultdict 
    2018from wx.lib.scrolledpanel import ScrolledPanel 
     
    243241        self.set_layout() 
    244242 
    245         # Setting up a thread for the fitting 
    246         self.threaded_draw_queue = Queue() 
    247  
    248         self.draw_worker_thread = Thread(target = self._threaded_draw_worker, 
    249                                          args = (self.threaded_draw_queue,)) 
    250         self.draw_worker_thread.setDaemon(True) 
    251         self.draw_worker_thread.start() 
    252  
    253         # And a home for the thread submission times 
    254         self.last_time_fit_submitted = 0.00 
    255  
    256243    def set_index_model(self, index): 
    257244        """ 
     
    17061693        :param chisqr: update chisqr value [bool] 
    17071694        """ 
    1708         self.threaded_draw_queue.put([copy.copy(update_chisqr), copy.copy(source)]) 
    1709  
    1710     def _threaded_draw_worker(self, threaded_draw_queue): 
    1711         while True: 
    1712             # sit and wait for the next task 
    1713             next_task = threaded_draw_queue.get() 
    1714  
    1715             # sleep for 1/10th second in case some other tasks accumulate 
    1716             time.sleep(0.1) 
    1717  
    1718             # skip all intermediate tasks 
    1719             while self.threaded_draw_queue.qsize() > 0: 
    1720                 self.threaded_draw_queue.task_done() 
    1721                 next_task = self.threaded_draw_queue.get() 
    1722  
    1723             # and finally, do the task 
    1724             self._draw_model_after(*next_task) 
    1725             threaded_draw_queue.task_done() 
     1695        wx.CallAfter(self._draw_model_after, update_chisqr, source) 
    17261696 
    17271697    def _draw_model_after(self, update_chisqr=True, source='model'): 
     
    17461716            toggle_mode_on = self.model_view.IsEnabled() 
    17471717            is_2d = self._is_2D() 
    1748  
    17491718            self._manager.draw_model(self.model, 
    17501719                                     data=self.data, 
Note: See TracChangeset for help on using the changeset viewer.