Changeset a0469a1 in sasview for src/sas/sasgui/perspectives/fitting/basepage.py
- Timestamp:
- Apr 7, 2017 10:36:17 AM (8 years ago)
- 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:
- be7264f1
- Parents:
- 503eb52
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/basepage.py
r503eb52 ra0469a1 243 243 244 244 # Setting up a thread for the fitting 245 self.threaded DrawQueue = Queue()246 247 self. threadedDrawWorker= Thread(target = self._threaded_draw_worker,248 args = (self.threaded DrawQueue,))249 self. threadedDrawWorker.setDaemon(True)250 self. threadedDrawWorker.start()245 self.threaded_draw_queue = Queue() 246 247 self.draw_worker_thread = Thread(target = self._threaded_draw_worker, 248 args = (self.threaded_draw_queue,)) 249 self.draw_worker_thread.setDaemon(True) 250 self.draw_worker_thread.start() 251 251 252 252 # And a home for the thread submission times 253 self.last TimeFitSubmitted = 0.00253 self.last_time_fit_submitted = 0.00 254 254 255 255 def set_index_model(self, index): … … 1706 1706 """ 1707 1707 # Get the time 1708 current Time = time()1708 current_time = time() 1709 1709 1710 1710 # When loading we slam a number of fits through here 1711 1711 # let's filter these out to start with 1712 if current Time > (self.lastTimeFitSubmitted + 0.1):1712 if current_time > (self.last_time_fit_submitted + 0.1): 1713 1713 # Submitting the rest 1714 self.threaded DrawQueue.put([update_chisqr, source])1714 self.threaded_draw_queue.put([update_chisqr, source]) 1715 1715 else: 1716 1716 pass 1717 1717 1718 self.last TimeFitSubmitted = currentTime1719 1720 def _threaded_draw_worker(self, threaded DrawQueue):1718 self.last_time_fit_submitted = current_time 1719 1720 def _threaded_draw_worker(self, threaded_draw_queue): 1721 1721 while True: 1722 1722 # Check to see is a manager is running and a calc is running … … 1726 1726 # If a manager is running a calculation 1727 1727 # then trim the queue 1728 if self.threaded DrawQueue.qsize() > 1:1729 for loopIter in range(threaded DrawQueue.qsize() - 1):1730 dump = self.threaded DrawQueue.get()1731 self.threaded DrawQueue.task_done()1728 if self.threaded_draw_queue.qsize() > 1: 1729 for loopIter in range(threaded_draw_queue.qsize() - 1): 1730 dump = self.threaded_draw_queue.get() 1731 self.threaded_draw_queue.task_done() 1732 1732 else: 1733 1733 # Otherwise, just run 1734 input Variables = threadedDrawQueue.get()1735 self._draw_model_after(input Variables[0], inputVariables[1])1734 input_variables = threaded_draw_queue.get() 1735 self._draw_model_after(input_variables[0], input_variables[1]) 1736 1736 wx.PostEvent(self._manager.parent, StatusEvent(status = 1737 1737 "Computation is in progress...", type = "progress")) 1738 threaded DrawQueue.task_done()1738 threaded_draw_queue.task_done() 1739 1739 1740 1740 def _draw_model_after(self, update_chisqr=True, source='model'):
Note: See TracChangeset
for help on using the changeset viewer.