Changeset f0a16d5 in sasview for src/sas/sasgui/perspectives


Ignore:
Timestamp:
Aug 23, 2017 8:37:28 AM (7 years ago)
Author:
Tim Snow <tim.snow@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
af1187a
Parents:
6300dfe
Message:

Incorporated changes

In addition to the new logic, a copy operation was also required as
without it the objects were lost causing SasView? to crash.

File:
1 edited

Legend:

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

    r367a31c rf0a16d5  
    17061706        :param chisqr: update chisqr value [bool] 
    17071707        """ 
    1708         # Get the time 
    1709         current_time = time.time() 
    1710  
    1711         # When loading we slam a number of fits through here 
    1712         # let's filter these out to start with 
    1713         if current_time > (self.last_time_fit_submitted + 0.1): 
    1714             # Submitting the rest 
    1715             self.threaded_draw_queue.put([update_chisqr, source]) 
    1716         else: 
    1717             pass 
    1718  
    1719         self.last_time_fit_submitted = current_time 
     1708        print (dir(update_chisqr)) 
     1709        print (dir(source)) 
     1710        self.threaded_draw_queue.put([copy.copy(update_chisqr), copy.copy(source)]) 
    17201711 
    17211712    def _threaded_draw_worker(self, threaded_draw_queue): 
    17221713        while True: 
    1723             # Check to see is a manager is running and a calc is running 
    1724             if ((self._manager.calc_1D is not None 
    1725                  and self._manager.calc_1D.isrunning()) or 
    1726                 (self._manager.calc_2D is not None 
    1727                  and self._manager.calc_2D.isrunning())): 
    1728                 # If a manager is running a calculation 
    1729                 # then trim the queue 
    1730                 if self.threaded_draw_queue.qsize() > 1: 
    1731                     for loopIter in range(threaded_draw_queue.qsize() - 1): 
    1732                         dump = self.threaded_draw_queue.get() 
    1733                         self.threaded_draw_queue.task_done() 
    1734             else: 
    1735                 # Otherwise, just run 
    1736                 input_variables = threaded_draw_queue.get() 
    1737                 self._draw_model_after(input_variables[0], input_variables[1]) 
    1738                 event = StatusEvent(status="Computation is in progress...", 
    1739                                     type="progress") 
    1740                 wx.PostEvent(self._manager.parent, event) 
    1741                 threaded_draw_queue.task_done() 
     1714            # sit and wait for the next task 
     1715            next_task = threaded_draw_queue.get() 
     1716 
     1717            # sleep for 1/10th second in case some other tasks accumulate 
     1718            time.sleep(0.1) 
     1719 
     1720            # skip all intermediate tasks 
     1721            while self.threaded_draw_queue.qsize() > 0: 
     1722                self.threaded_draw_queue.task_done() 
     1723                next_task = self.threaded_draw_queue.get() 
     1724 
     1725            # and finally, do the task 
     1726            self._draw_model_after(*next_task) 
     1727            threaded_draw_queue.task_done() 
    17421728 
    17431729    def _draw_model_after(self, update_chisqr=True, source='model'): 
Note: See TracChangeset for help on using the changeset viewer.