Changeset c5c247e in sasview


Ignore:
Timestamp:
Apr 6, 2017 11:14:03 AM (8 months ago)
Author:
Tim Snow <tim.snow@…>
Branches:
master, ESS_GUI, ESS_GUI_Pr, ESS_GUI_cns, ESS_GUI_corf, ESS_GUI_py2_OLD, SVCC-1, SasView-664, docs, ticket-873, ticket-993, unittest-saveload
Children:
922ef55
Parents:
d70f6d2
Message:

Put in a resubmission time constraint

In order to close ticket #14, if a fitting is put in for submission
within 0.1 sec of another fitting, and a fitting is already taking
place, then it will not be submitted to the fitting engine.

File:
1 edited

Legend:

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

    rd70f6d2 rc5c247e  
    1313import traceback 
    1414 
     15from time import time 
    1516from Queue import Queue 
    1617from threading import Thread 
    17  
    1818from collections import defaultdict 
    1919from wx.lib.scrolledpanel import ScrolledPanel 
     
    242242        self.set_layout() 
    243243 
    244         # Putting matplotlib in the background so as not to hang the interface 
     244        # Setting up a thread for the fitting 
    245245        self.threadedDrawQueue = Queue() 
    246246 
     
    249249        self.threadedDrawWorker.start() 
    250250 
     251        # And a home for the thread submission times 
     252        self.lastTimeFitSubmitted = None 
    251253 
    252254    def set_index_model(self, index): 
     
    17021704        :param chisqr: update chisqr value [bool] 
    17031705        """ 
    1704         self.threadedDrawQueue.put([update_chisqr, source]) 
     1706 
     1707        currentTime = time() 
     1708        # # So, if a whole pile of jobs are submitted in quick succession,  
     1709        # # let's say in less than 0.1 sec, we'll filter them out, assuming something is running! 
     1710        if ((self._manager.calc_1D is not None) and self._manager.calc_1D.isrunning()) or ((self._manager.calc_2D is not None) and self._manager.calc_2D.isrunning()): 
     1711            if currentTime > (self.lastTimeFitSubmitted + 0.1): 
     1712                self.threadedDrawQueue.put([update_chisqr, source]) 
     1713        else: 
     1714            self.threadedDrawQueue.put([update_chisqr, source]) 
     1715 
     1716        self.lastTimeFitSubmitted = currentTime 
    17051717 
    17061718    def _threaded_draw_worker(self, threadedDrawQueue): 
     
    17321744            toggle_mode_on = self.model_view.IsEnabled() 
    17331745            is_2d = self._is_2D() 
     1746 
    17341747            self._manager.draw_model(self.model, 
    17351748                                     data=self.data, 
Note: See TracChangeset for help on using the changeset viewer.