Changeset 574adc7 in sasview for src/sas/sascalc/data_util/calcthread.py
- Timestamp:
- Sep 22, 2017 4:01:32 PM (7 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:
- 34d7b35
- Parents:
- 9706d88
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/data_util/calcthread.py
ra1b8fee r574adc7 6 6 from __future__ import print_function 7 7 8 import thread9 8 import traceback 10 9 import sys 11 10 import logging 11 try: 12 import _thread as thread 13 except ImportError: # CRUFT: python 2 support 14 import thread 12 15 13 16 if sys.platform.count("darwin") > 0: 14 17 import time 15 18 stime = time.time() 16 19 17 20 def clock(): 18 21 return time.time() - stime 19 22 20 23 def sleep(t): 21 24 return time.sleep(t) … … 35 38 CalcThread.__init__, passing it the keyword arguments for 36 39 yieldtime, worktime, update and complete. 37 40 38 41 When defining the compute() method you need to include code which 39 42 allows the GUI to run. They are as follows: :: … … 211 214 self._lock.release() 212 215 self._time_for_update += 1e6 # No more updates 213 216 214 217 self.updatefn(**kwargs) 215 218 sleep(self.yieldtime)
Note: See TracChangeset
for help on using the changeset viewer.