Changeset 72d3f1e in sasview for src/sas/sasgui/perspectives
- Timestamp:
- Sep 25, 2017 2:39:00 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:
- fca1f50, 38a1e63
- Parents:
- 53b8266 (diff), 48154abb (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
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/corfunc/corfunc_state.py
r2a399ca r1fa4f736 289 289 namespaces={'ns': CANSAS_NS}) 290 290 for entry in entry_list: 291 sas_entry, _ = self._parse_entry(entry)292 291 corstate = self._parse_state(entry) 293 292 294 293 if corstate is not None: 294 sas_entry, _ = self._parse_entry(entry) 295 295 sas_entry.meta_data['corstate'] = corstate 296 296 sas_entry.filename = corstate.file -
src/sas/sasgui/perspectives/fitting/fitpage.py
r13374be r48154abb 2042 2042 # Save state_fit 2043 2043 self.save_current_state_fit() 2044 self.onSmear(None) 2045 self._onDraw(None) 2044 2046 except: 2045 2047 self._show_combox_helper() -
src/sas/sasgui/perspectives/fitting/pagestate.py
rda9b239 r1fa4f736 1297 1297 namespaces={'ns': CANSAS_NS}) 1298 1298 for entry in entry_list: 1299 try:1300 sas_entry, _ = self._parse_save_state_entry(entry)1301 except:1302 raise1303 1299 fitstate = self._parse_state(entry) 1304 1305 1300 # state could be None when .svs file is loaded 1306 1301 # in this case, skip appending to output 1307 1302 if fitstate is not None: 1303 try: 1304 sas_entry, _ = self._parse_save_state_entry( 1305 entry) 1306 except: 1307 raise 1308 1308 sas_entry.meta_data['fitstate'] = fitstate 1309 1309 sas_entry.filename = fitstate.file -
src/sas/sasgui/perspectives/fitting/simfitpage.py
ra9f9ca4 r9804394 1073 1073 """ 1074 1074 1075 model_map = {} 1075 init_map = {} 1076 final_map = {} 1076 1077 if fit.fit_panel.sim_page is None: 1077 1078 fit.fit_panel.add_sim_page() … … 1087 1088 save_id = self._format_id(save_id) 1088 1089 if save_id == model_id: 1089 model_map[saved_model.pop('fit_page_source')] = \ 1090 model[3].name 1090 inter_id = str(i) + str(i) + str(i) + str(i) + str(i) 1091 init_map[saved_model.pop('fit_page_source')] = inter_id 1092 final_map[inter_id] = model[3].name 1091 1093 check = bool(saved_model.pop('checked')) 1092 1094 sim_page.model_list[i][0].SetValue(check) … … 1106 1108 param = item.pop('param_cbox') 1107 1109 equality = item.pop('egal_txt') 1108 for key, value in model_map.iteritems(): 1109 model_cbox.replace(key, value) 1110 constraint_value.replace(key, value) 1110 for key, value in init_map.items(): 1111 model_cbox = model_cbox.replace(key, value) 1112 constraint_value = constraint_value.replace(key, value) 1113 for key, value in final_map.items(): 1114 model_cbox = model_cbox.replace(key, value) 1115 constraint_value = constraint_value.replace(key, value) 1111 1116 1112 1117 sim_page.constraints_list[index][0].SetValue(model_cbox) -
src/sas/sasgui/perspectives/invariant/invariant_state.py
r7432acb r1fa4f736 728 728 729 729 for entry in entry_list: 730 731 sas_entry, _ = self._parse_entry(entry)732 730 invstate = self._parse_state(entry) 733 734 731 # invstate could be None when .svs file is loaded 735 732 # in this case, skip appending to output 736 733 if invstate is not None: 734 sas_entry, _ = self._parse_entry(entry) 737 735 sas_entry.meta_data['invstate'] = invstate 738 736 sas_entry.filename = invstate.file -
src/sas/sasgui/perspectives/pr/inversion_state.py
ra0e6b1b r1fa4f736 472 472 473 473 for entry in entry_list: 474 sas_entry, _ = self._parse_entry(entry)475 474 prstate = self._parse_prstate(entry) 476 475 #prstate could be None when .svs file is loaded 477 476 #in this case, skip appending to output 478 477 if prstate is not None: 478 sas_entry, _ = self._parse_entry(entry) 479 479 sas_entry.meta_data['prstate'] = prstate 480 480 sas_entry.filename = prstate.file -
src/sas/sasgui/perspectives/fitting/basepage.py
rf80b416e r53b8266 15 15 import traceback 16 16 17 from Queue import Queue 18 from threading import Thread 17 19 from collections import defaultdict 18 20 from wx.lib.scrolledpanel import ScrolledPanel … … 241 243 self.set_layout() 242 244 245 # Setting up a thread for the fitting 246 self.threaded_draw_queue = Queue() 247 248 self.draw_worker_thread = Thread(target = self._threaded_draw_worker, 249 args = (self.threaded_draw_queue,)) 250 self.draw_worker_thread.setDaemon(True) 251 self.draw_worker_thread.start() 252 253 # And a home for the thread submission times 254 self.last_time_fit_submitted = 0.00 255 243 256 def set_index_model(self, index): 244 257 """ … … 1693 1706 :param chisqr: update chisqr value [bool] 1694 1707 """ 1695 wx.CallAfter(self._draw_model_after, update_chisqr, source) 1708 self.threaded_draw_queue.put([copy.copy(update_chisqr), copy.copy(source)]) 1709 1710 def _threaded_draw_worker(self, threaded_draw_queue): 1711 while True: 1712 # sit and wait for the next task 1713 next_task = threaded_draw_queue.get() 1714 1715 # sleep for 1/10th second in case some other tasks accumulate 1716 time.sleep(0.1) 1717 1718 # skip all intermediate tasks 1719 while self.threaded_draw_queue.qsize() > 0: 1720 self.threaded_draw_queue.task_done() 1721 next_task = self.threaded_draw_queue.get() 1722 1723 # and finally, do the task 1724 self._draw_model_after(*next_task) 1725 threaded_draw_queue.task_done() 1696 1726 1697 1727 def _draw_model_after(self, update_chisqr=True, source='model'): … … 1716 1746 toggle_mode_on = self.model_view.IsEnabled() 1717 1747 is_2d = self._is_2D() 1748 1718 1749 self._manager.draw_model(self.model, 1719 1750 data=self.data,
Note: See TracChangeset
for help on using the changeset viewer.