Changeset 2abe6bf in sasview for src/sas/sasgui
- Timestamp:
- Oct 8, 2016 9:45:52 AM (8 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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 3f9a18a, 47f2b5d
- Parents:
- 450c6f6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/basepage.py
r212bfc2 r2abe6bf 9 9 import copy 10 10 import math 11 import string12 11 import json 13 12 import logging … … 335 334 self.data.detector[index].beam_center.x = qmax 336 335 self.data.detector[index].beam_center.y = qmax 337 ## create x_bins and y_bins of the model 2D338 #pixel_width_x = self.data.detector[index].pixel_size.x339 #pixel_width_y = self.data.detector[index].pixel_size.y340 #center_x = self.data.detector[index].beam_center.x/pixel_width_x341 #center_y = self.data.detector[index].beam_center.y/pixel_width_y342 # theory default: assume the beam343 #center is located at the center of sqr detector344 336 xmax = qmax 345 337 xmin = -qmax … … 360 352 # set all True (standing for unmasked) as default 361 353 mask = numpy.ones(len(qx_data), dtype=bool) 362 # calculate the range of qx and qy: this way,363 # it is a little more independent364 #x_size = xmax - xmin365 #y_size = ymax - ymin366 354 # store x and y bin centers in q space 367 355 x_bins = x 368 356 y_bins = y 369 # bin size: x- & y-directions370 #xstep = x_size / len(x_bins - 1)371 #ystep = y_size / len(y_bins - 1)372 357 373 358 self.data.source = Source() … … 410 395 batch_menu.Enable(self.batch_on and flag) 411 396 412 def set_page_info(self, page_info):413 """414 set some page important information at once415 """416 # THIS METHOD/FUNCTION NO LONGE APPEARS TO BE CALLED. Started up program417 # and started new fit window and PR and Invariant and a fit in fitting418 # but never entered this routine which should be an initialization419 # routine. Leave for a while but probably something to clean up at420 # some point?421 #422 # PDB April 13 2014423 #424 ##window_name425 self.window_name = page_info.window_name426 ##window_caption427 self.window_caption = page_info.window_caption428 ## manager is the fitting plugin429 self._manager = page_info.manager430 ## owner of the page (fitting plugin)431 self.event_owner = page_info.event_owner432 ## current model433 self.model = page_info.model434 ## data435 self.data = page_info.data436 ## dictionary containing list of models437 self.model_list_box = page_info.model_list_box438 ## Data member to store the dispersion object created439 self.populate_box(model_dict=self.model_list_box)440 441 397 def onContextMenu(self, event): 442 398 """ 443 399 Retrieve the state selected state 444 400 """ 445 # Skipping the save state functionality for release 0.9.0446 #return447 448 401 pos = event.GetPosition() 449 402 pos = self.ScreenToClient(pos) 450 451 403 self.PopupMenu(self.popUpMenu, pos) 452 404 … … 568 520 return 569 521 if len(self.model_list_box) > 0: 570 ## This is obsolete code since form factor box is no longer static.571 ## It is now set dynamically through _show_combox and _show_combos_helper572 ## These are called for first time by formfactor_combo_init573 ## itself called from fitpanel only. If we find that I'm wrong and574 ## we DO need to initialize somehow here - do it by a call to575 ## formfactor_combo_init576 ## self.formfator_combo_init()577 ## BUT NOT HERE -- make it last line of this578 ## method so that structure box is populated before _show_comboox_helper579 ## is called. Otherwise wx will complain mightily:-)580 ##581 ## Also change the name to initiatlize_structurebox along with changes582 ## to other combobox methods (_populate_listbox --> _populate_categorybox583 ## etc )584 ##585 ## PDB 4/26/2014586 # self._populate_box(self.formfactorbox,587 # self.model_list_box["Shapes"])588 522 self._populate_box(self.structurebox, 589 523 self.model_list_box["Structure Factors"]) … … 600 534 self.structurebox.Enable() 601 535 self.text2.Enable() 602 603 536 604 537 def set_dispers_sizer(self): … … 738 671 else: 739 672 wx.CallAfter(self.get_copy) 740 741 673 742 674 def on_paste(self, event): … … 952 884 self.state.orientation_params) 953 885 self._copy_parameters_state(self.orientation_params_disp, 954 886 self.state.orientation_params_disp) 955 887 956 888 self._copy_parameters_state(self.parameters, self.state.parameters) 957 889 self._copy_parameters_state(self.fittable_param, 958 890 self.state.fittable_param) 959 891 self._copy_parameters_state(self.fixed_param, self.state.fixed_param) 960 892 #save chisqr … … 1044 976 self.disp_cb_dict = state.disp_cb_dict 1045 977 self.disp_list = state.disp_list 1046 1047 ## set the state of the radio box1048 #self.shape_rbutton.SetValue(state.shape_rbutton)1049 #self.shape_indep_rbutton.SetValue(state.shape_indep_rbutton)1050 #self.struct_rbutton.SetValue(state.struct_rbutton)1051 #self.plugin_rbutton.SetValue(state.plugin_rbutton)1052 978 1053 979 ## fill model combobox … … 1861 1787 if mod_cat == custom_model: 1862 1788 for model in self.model_list_box[mod_cat]: 1863 str_m = model.id if hasattr(model, 'id') else model.name 1864 m_list.append(self.model_dict[str_m]) 1789 m_list.append(self.model_dict[model.name]) 1865 1790 else: 1866 1791 cat_dic = self.master_category_dict[mod_cat] … … 1868 1793 if enabled: 1869 1794 m_list.append(self.model_dict[model]) 1870 #else:1871 # msg = "This model is disabled by Category Manager."1872 # wx.PostEvent(self.parent.parent,1873 # StatusEvent(status=msg, info="error"))1874 1795 except Exception: 1875 1796 msg = traceback.format_exc()
Note: See TracChangeset
for help on using the changeset viewer.