Changeset 9e6aeaf in sasview for src/sas/sasgui
- Timestamp:
- Sep 25, 2017 5:35:29 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:
- 3cb3a51
- Parents:
- 9efdb29 (diff), 0315b63 (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:
-
- 5 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
r9706d88 r0315b63 2049 2049 # Save state_fit 2050 2050 self.save_current_state_fit() 2051 self.onSmear(None) 2052 self._onDraw(None) 2051 2053 except: 2052 2054 self._show_combox_helper() -
src/sas/sasgui/perspectives/fitting/simfitpage.py
r69363c7 r0315b63 163 163 :return: None 164 164 """ 165 model_map = {} 165 init_map = {} 166 final_map = {} 166 167 # Process each model and associate old M# with new M# 167 168 i = 0 … … 175 176 model_map[saved_model.pop('fit_page_source')] = \ 176 177 model[3].name 178 check = bool(saved_model.pop('checked')) 179 self.model_list[i][0].SetValue(check) 180 inter_id = str(i)*5 181 init_map[saved_model.pop('fit_page_source')] = inter_id 182 final_map[inter_id] = model[3].name 177 183 check = bool(saved_model.pop('checked')) 178 184 self.model_list[i][0].SetValue(check) … … 1099 1105 cbox.Append(name, value) 1100 1106 cbox.SetStringSelection(selected) 1107 <<<<<<< HEAD 1108 ======= 1109 1110 1111 class SimFitPageState: 1112 """ 1113 State of the simultaneous fit page for saving purposes 1114 """ 1115 1116 def __init__(self): 1117 # Sim Fit Page Number 1118 self.fit_page_no = None 1119 # Select all data 1120 self.select_all = False 1121 # Data sets sent to fit page 1122 self.model_list = [] 1123 # Data sets to be fit 1124 self.model_to_fit = [] 1125 # Number of constraints 1126 self.no_constraint = 0 1127 # Dictionary of constraints 1128 self.constraint_dict = {} 1129 # List of constraints 1130 self.constraints_list = [] 1131 1132 def load_from_save_state(self, fit): 1133 """ 1134 Load in a simultaneous/constrained fit from a save state 1135 :param fit: Fitpanel object 1136 :return: None 1137 """ 1138 1139 init_map = {} 1140 final_map = {} 1141 if fit.fit_panel.sim_page is None: 1142 fit.fit_panel.add_sim_page() 1143 sim_page = fit.fit_panel.sim_page 1144 1145 # Process each model and associate old M# with new M# 1146 i = 0 1147 for model in sim_page.model_list: 1148 model_id = self._format_id(model[1].keys()[0]) 1149 for saved_model in self.model_list: 1150 save_id = saved_model.pop('name') 1151 saved_model['name'] = save_id 1152 save_id = self._format_id(save_id) 1153 if save_id == model_id: 1154 inter_id = str(i) + str(i) + str(i) + str(i) + str(i) 1155 init_map[saved_model.pop('fit_page_source')] = inter_id 1156 final_map[inter_id] = model[3].name 1157 check = bool(saved_model.pop('checked')) 1158 sim_page.model_list[i][0].SetValue(check) 1159 break 1160 i += 1 1161 sim_page.check_model_name(None) 1162 1163 if len(self.constraints_list) > 0: 1164 sim_page.hide_constraint.SetValue(False) 1165 sim_page.show_constraint.SetValue(True) 1166 sim_page._display_constraint(None) 1167 1168 for index, item in enumerate(self.constraints_list): 1169 model_cbox = item.pop('model_cbox') 1170 if model_cbox != "": 1171 constraint_value = item.pop('constraint') 1172 param = item.pop('param_cbox') 1173 equality = item.pop('egal_txt') 1174 for key, value in init_map.items(): 1175 model_cbox = model_cbox.replace(key, value) 1176 constraint_value = constraint_value.replace(key, value) 1177 for key, value in final_map.items(): 1178 model_cbox = model_cbox.replace(key, value) 1179 constraint_value = constraint_value.replace(key, value) 1180 1181 sim_page.constraints_list[index][0].SetValue(model_cbox) 1182 sim_page._on_select_model(None) 1183 sim_page.constraints_list[index][1].SetValue(param) 1184 sim_page.constraints_list[index][2].SetLabel(equality) 1185 sim_page.constraints_list[index][3].SetValue(constraint_value) 1186 sim_page._on_add_constraint(None) 1187 sim_page._manager.sim_page = sim_page 1188 1189 def _format_id(self, original_id): 1190 original_id = original_id.rstrip('1234567890.') 1191 new_id_list = original_id.split() 1192 new_id = ' '.join(new_id_list) 1193 return new_id 1194 >>>>>>> ticket-887-reorg -
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
Note: See TracChangeset
for help on using the changeset viewer.