Changeset aaa801e in sasview for src/sas/sasgui/perspectives/fitting
- Timestamp:
- Sep 23, 2017 4:33:43 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:
- b796c72
- Parents:
- 1cdbcd8 (diff), d3b0c77 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- src/sas/sasgui/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/__init__.py
r959eb01 r12d3e0e 13 13 # Check for data path next to exe/zip file. 14 14 # If we are inside a py2exe zip file, we need to go up 15 # to get to the directory containing 15 # to get to the directory containing 16 16 # the media for this module 17 17 path = os.path.dirname(__file__) … … 26 26 return module_media_path 27 27 return media_path 28 28 29 29 raise RuntimeError('Could not find models media files') 30 30 … … 32 32 """ 33 33 Return the data files associated with media. 34 34 35 35 The format is a list of (directory, [files...]) pairs which can be 36 36 used directly in setup(...,data_files=...) for setup.py. … … 38 38 """ 39 39 data_files = [] 40 path = os.path.dirname(__file__) 41 p_path = os.path.join(path, 'plugin_models') 42 for f in findall(p_path): 43 data_files.append(('plugin_models', [f])) 44 # path = get_data_path(media="media") 45 for f in findall(path): 46 data_files.append(('media/fitting_media', [f])) 47 40 # Note: windows installer requires the plugin_models directory 41 plugin_models = os.path.join(os.path.dirname(__file__), "plugin_models") 42 data_files.append(('plugin_models', findall(plugin_models))) 43 data_files.append(('media/fitting_media', findall(get_data_path("media")))) 44 48 45 return data_files -
src/sas/sasgui/perspectives/fitting/basepage.py
r69363c7 rd3b0c77 12 12 import logging 13 13 import traceback 14 from Queue import Queue 15 from threading import Thread 14 16 from collections import defaultdict 15 17 … … 248 250 self.set_layout() 249 251 252 # Setting up a thread for the fitting 253 self.threaded_draw_queue = Queue() 254 255 self.draw_worker_thread = Thread(target = self._threaded_draw_worker, 256 args = (self.threaded_draw_queue,)) 257 self.draw_worker_thread.setDaemon(True) 258 self.draw_worker_thread.start() 259 260 # And a home for the thread submission times 261 self.last_time_fit_submitted = 0.00 262 250 263 def set_index_model(self, index): 251 264 """ … … 1735 1748 :param chisqr: update chisqr value [bool] 1736 1749 """ 1737 wx.CallAfter(self._draw_model_after, update_chisqr, source) 1750 self.threaded_draw_queue.put([copy.copy(update_chisqr), copy.copy(source)]) 1751 1752 def _threaded_draw_worker(self, threaded_draw_queue): 1753 while True: 1754 # sit and wait for the next task 1755 next_task = threaded_draw_queue.get() 1756 1757 # sleep for 1/10th second in case some other tasks accumulate 1758 time.sleep(0.1) 1759 1760 # skip all intermediate tasks 1761 while self.threaded_draw_queue.qsize() > 0: 1762 self.threaded_draw_queue.task_done() 1763 next_task = self.threaded_draw_queue.get() 1764 1765 # and finally, do the task 1766 self._draw_model_after(*next_task) 1767 threaded_draw_queue.task_done() 1738 1768 1739 1769 def _draw_model_after(self, update_chisqr=True, source='model'): … … 1757 1787 toggle_mode_on = self.model_view.IsEnabled() 1758 1788 is_2d = self._is_2D() 1789 1759 1790 self._manager.draw_model(self.model, 1760 1791 data=self.data,
Note: See TracChangeset
for help on using the changeset viewer.