Changeset c5c247e in sasview for src/sas


Ignore:
Timestamp:
Apr 6, 2017 11:14:03 AM (8 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:
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.