- Timestamp:
- Jul 20, 2010 2:36:35 PM (14 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- cb19af9f
- Parents:
- 1b17a64
- Location:
- sansview
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
re3d1423 r3c44c66 44 44 #Set window's font size 45 45 self.SetWindowVariant(variant=FONT_VARIANT) 46 46 47 ## parent of the page 47 48 self.parent = parent … … 160 161 ## layout 161 162 self.set_layout() 162 163 163 164 class ModelTextCtrl(wx.TextCtrl): 164 165 """ … … 233 234 def _silent_kill_focus(self,event): 234 235 """ 235 do nothing to kill focus236 Save the state of the page 236 237 """ 238 237 239 event.Skip() 238 240 pass … … 803 805 self._copy_parameters_state(self.fittable_param, self.state.fittable_param) 804 806 self._copy_parameters_state(self.fixed_param, self.state.fixed_param) 805 806 807 #save chisqr 808 self.state.tcChi = self.tcChi.GetValue() 809 807 810 def save_current_state_fit(self): 808 811 """ … … 1008 1011 ## draw the model with previous parameters value 1009 1012 self._onparamEnter_helper() 1013 #reset the value of chisqr when not consistent with the value computed 1014 self.tcChi.SetValue(str(self.state.tcChi)) 1010 1015 ## reset context menu items 1011 1016 self._reset_context_menu() 1017 1012 1018 ## set the value of the current state to the state given as parameter 1013 1019 self.state = state.clone() -
sansview/perspectives/fitting/fitpage.py
r0b12abb5 r3c44c66 1936 1936 self.tcChi.SetValue(str(format_number(output))) 1937 1937 1938 self.state.tcChi = self.tcChi1938 self.state.tcChi = self.tcChi.GetValue() 1939 1939 except: 1940 1940 pass -
sansview/perspectives/fitting/fitpanel.py
r0b12abb5 r3c44c66 200 200 self.Center() 201 201 202 def set_data(self, list=[]): 203 """ 204 Receive a list of data and create new 205 """ 206 if list==[]: 207 msg = "Please select data for Fitting perspective.\n" 208 dial = wx.MessageDialog(None, msg, 'Error Loading File', 209 wx.OK | wx.ICON_EXCLAMATION) 210 dial.ShowModal() 211 return 212 for data, path in list: 213 self.manager.add_fit_page(data=data) 214 202 215 def set_state(self, state): 203 216 """ … … 415 428 return panel 416 429 else: 417 for name, panelin self.opened_pages.values():418 #Don't return any panel is the exact same page is created419 if name == page_info.window_name:430 for value in self.opened_pages.values(): 431 if page_info.window_name == str(value[0]): 432 #Don't return any panel is the exact same page is created 420 433 return None 421 else: 422 panel = self.add_page(page_info=page_info) 423 return panel 434 panel = self.add_page(page_info=page_info) 435 return panel 424 436 else: 425 437 #a new type of page is created -
sansview/perspectives/fitting/pagestate.py
r3ad91de r3c44c66 362 362 rep += "model : %s\n\n"% str(self.model) 363 363 rep += "number parameters(self.parameters): %s\n"%len(self.parameters) 364 rep += self._repr_helper( list=self.parameters, rep=rep)364 rep = self._repr_helper( list=self.parameters, rep=rep) 365 365 rep += "number orientation parameters" 366 366 rep += "(self.orientation_params): %s\n"%len(self.orientation_params) 367 rep += self._repr_helper( list=self.orientation_params, rep=rep)367 rep = self._repr_helper( list=self.orientation_params, rep=rep) 368 368 rep += "number dispersity parameters" 369 369 rep += "(self.orientation_params_disp): %s\n"%len(self.orientation_params_disp) 370 rep += self._repr_helper( list=self.orientation_params_disp, rep=rep)370 rep = self._repr_helper( list=self.orientation_params_disp, rep=rep) 371 371 372 372 return rep … … 1138 1138 output[0].filename = state.file 1139 1139 state.data = output[0] 1140 state.data.name = state.data_name1140 state.data.name = output[0].filename #state.data_name 1141 1141 state.data.id = state.data_id 1142 1142 state.data.id = state.data_id … … 1182 1182 fitstate.toXML(file=filename) 1183 1183 1184 """ 1185 Example: :: 1184 1186 1185 1187 1188 1189 1190 print "state", state1186 if __name__ == "__main__": 1187 state = PageState(parent=None) 1188 #state.toXML() 1189 """ 1191 1190 1192 """ 1191 file = open("test_state", "w") 1192 pickle.dump(state, file) 1193 print pickle.dumps(state) 1194 state.data_name = "hello---->" 1195 pickle.dump(state, file) 1196 file = open("test_state", "r") 1197 new_state= pickle.load(file) 1198 print "new state", new_state 1199 new_state= pickle.load(file) 1200 print "new state", new_state 1201 #print "state", state 1202 """ 1203 import bsddb 1204 import pickle 1205 db= bsddb.btopen('file_state.db', 'c') 1206 val = (pickle.dumps(state), "hello", "hi") 1207 db['state1']= pickle.dumps(val) 1208 print pickle.loads(db['state1']) 1209 state.data_name = "hello---->22" 1210 db['state2']= pickle.dumps(state) 1211 state.data_name = "hello---->2" 1212 db['state3']= pickle.dumps(state) 1213 del db['state3'] 1214 state.data_name = "hello---->3" 1215 db['state4']= pickle.dumps(state) 1216 new_state = pickle.loads(db['state1']) 1217 #print db.last() 1218 db.set_location('state2') 1219 state.data_name = "hello---->5" 1220 db['aastate5']= pickle.dumps(state) 1221 db.keys().sort() 1222 print pickle.loads(db['state2']) 1223 1224 db.close() -
sansview/welcome_panel.py
refea0bd r3c44c66 66 66 self.parent.on_close_welcome_panel() 67 67 event.Veto() 68 68 69 def set_data(self, list=[]): 70 """ 71 """ 72 pass 73 74 69 75 class WelcomePage(wx.Panel): 70 76 """ … … 127 133 self.SetSizer(sizer_main) 128 134 self.Fit() 129 135 136 def set_data(self, list=[]): 137 """ 138 """ 139 pass 130 140 131 141 class ViewApp(wx.App):
Note: See TracChangeset
for help on using the changeset viewer.