Changeset dafc36f in sasview for fittingview/src
- Timestamp:
- Oct 16, 2011 10:59:57 AM (13 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:
- e7281fd
- Parents:
- a490860
- Location:
- fittingview/src/sans/perspectives/fitting
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/basepage.py
r70e439f rdafc36f 294 294 def on_set_focus(self, event): 295 295 """ 296 On Set Focus, update guimanger and menu 296 297 """ 297 298 if self._manager is not None: 298 299 wx.PostEvent(self._manager.parent, PanelOnFocusEvent(panel=self)) 299 chain_menu = self._manager.menu1.FindItemById(self._manager.id_reset_flag) 300 chain_menu.Enable(self.batch_on) 300 if self._manager.menu1 != None: 301 chain_menu = self._manager.menu1.FindItemById(\ 302 self._manager.id_reset_flag) 303 chain_menu.Enable(self.batch_on) 304 sim_menu = self._manager.menu1.FindItemById(self._manager.id_simfit) 305 sim_menu.Enable(not self.batch_on and self.data.is_data\ 306 and (self.model!=None)) 307 301 308 302 309 class ModelTextCtrl(wx.TextCtrl): … … 2132 2139 return self.model 2133 2140 2134 2135 2141 ## post state to fit panel 2136 2142 self.state.parameters =[] -
fittingview/src/sans/perspectives/fitting/fitpage.py
r1363416 rdafc36f 78 78 fill sizer 0 with data info 79 79 """ 80 box_description= wx.StaticBox(self, -1, 'I(q) Data Source') 81 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 80 self.data_box_description = wx.StaticBox(self, -1, 'I(q) Data Source') 81 if check_data_validity(self.data): 82 dname_color = wx.BLUE 83 else: 84 dname_color = wx.RED 85 self.data_box_description.SetForegroundColour(dname_color) 86 boxsizer1 = wx.StaticBoxSizer(self.data_box_description, wx.VERTICAL) 82 87 #---------------------------------------------------------- 83 88 sizer_data = wx.BoxSizer(wx.HORIZONTAL) … … 123 128 self.state.qmin = self.qmin_x 124 129 self.state.qmax = self.qmax_x 125 130 is_data = False 126 131 for data in self.data_list: 127 132 if data is not None: 128 133 self.dataSource.Append(str(data.name), clientData=data) 134 if not is_data: 135 is_data = check_data_validity(data) 129 136 self.dataSource.SetSelection(0) 130 137 self.on_select_data(event=None) … … 212 219 #Sizers 213 220 box_description_range = wx.StaticBox(self, -1,str(title)) 221 box_description_range.SetForegroundColour(wx.BLUE) 214 222 boxsizer_range = wx.StaticBoxSizer(box_description_range, wx.VERTICAL) 215 223 self.sizer_set_smearer = wx.BoxSizer(wx.VERTICAL) … … 571 579 self.mbox_description= wx.StaticBox(self, -1,str(title)) 572 580 boxsizer1 = wx.StaticBoxSizer(self.mbox_description, wx.VERTICAL) 573 581 self.mbox_description.SetForegroundColour(wx.RED) 574 582 id = wx.NewId() 575 583 self.model_help =wx.Button(self,id,'Details', size=(80,23)) … … 1270 1278 1271 1279 self._manager._on_model_panel(evt=evt) 1272 self.mbox_description.SetLabel("Model [%s]" % str(self.model.name)) 1280 self.mbox_description.SetLabel("Model [ %s ]" % str(self.model.name)) 1281 self.mbox_description.SetForegroundColour(wx.BLUE) 1273 1282 self.state.model = self.model.clone() 1274 1283 self.state.model.name = self.model.name … … 1919 1928 self.btEditMask.Enable() 1920 1929 self.EditMask_title.Enable() 1930 1921 1931 self.Npts_total.SetValue(str(npts)) 1922 1932 #default:number of data points selected to fit … … 1932 1942 # send graph_id to page_finder 1933 1943 self._manager.set_graph_id(uid=self.uid, graph_id=self.graph_id) 1944 #focus the page 1945 if check_data_validity(data): 1946 self.data_box_description.SetForegroundColour(wx.BLUE) 1947 self.on_set_focus(None) 1948 self.Refresh() 1934 1949 #update model plot with new data information 1935 1950 if flag: -
fittingview/src/sans/perspectives/fitting/fitpanel.py
r2ada16c rdafc36f 364 364 self._manager.page_finder[panel.uid].add_data(panel.get_data()) 365 365 self.enable_close_button() 366 panel.on_set_focus(None) 366 367 return panel 367 368 … … 426 427 for p in self.opened_pages.values(): 427 428 #check if there is an empty page to fill up 428 if not check_data_validity(p.get_data()) :429 if not check_data_validity(p.get_data()) and p.batch_on: 429 430 page = p 430 self.batch_page_index += 1431 #self.batch_page_index += 1 431 432 break 432 433 if data_1d_list and data_2d_list: … … 496 497 #check if the selected data existing in the fitpanel 497 498 pos = self.GetPageIndex(page) 498 if not check_data_validity(page.get_data()) :499 if not check_data_validity(page.get_data()) and not page.batch_on: 499 500 #make sure data get placed in 1D empty tab if data is 1D 500 501 #else data get place on 2D tab empty tab … … 505 506 page._set_save_flag(not page.batch_on) 506 507 page.fill_data_combobox(data_list) 507 caption = "FitPage" + str(self.fit_page_index)508 self.SetPageText(pos, caption)508 #caption = "FitPage" + str(self.fit_page_index) 509 self.SetPageText(pos, page.window_caption) 509 510 self.SetSelection(pos) 510 511 return page -
fittingview/src/sans/perspectives/fitting/fitting.py
r70e439f rdafc36f 105 105 self.scipy_id = wx.NewId() 106 106 self.park_id = wx.NewId() 107 self.menu1 = None 107 108 108 109 self.temp_state = [] … … 165 166 wx.EVT_MENU(owner, id1, self.on_add_new_page) 166 167 self.menu1.AppendSeparator() 167 id1= wx.NewId()168 self.id_simfit = wx.NewId() 168 169 simul_help = "Simultaneous Fit" 169 self.menu1.Append(id1, '&Simultaneous Fit',simul_help) 170 wx.EVT_MENU(owner, id1, self.on_add_sim_page) 170 self.menu1.Append(self.id_simfit, '&Simultaneous Fit',simul_help) 171 wx.EVT_MENU(owner, self.id_simfit, self.on_add_sim_page) 172 sim_menu = self.menu1.FindItemById(self.id_simfit) 173 sim_menu.Enable(False) 174 171 175 self.menu1.AppendSeparator() 172 176 #Set park engine 173 174 177 scipy_help= "Scipy Engine: Perform Simple fit. More in Help window...." 175 178 self.menu1.AppendCheckItem(self.scipy_id, "Simple FitEngine [LeastSq]", … … 585 588 ftol_help = "Change the current FTolerance (=%s) " % str(self.ftol) 586 589 ftol_help += "of Simple FitEngine..." 587 self.menu1.SetHelpString(self.id_tol, ftol_help) 590 if self.menu1 != None: 591 self.menu1.SetHelpString(self.id_tol, ftol_help) 588 592 589 593 def show_ftol_dialog(self, event=None): … … 1343 1347 """ 1344 1348 event.Skip() 1349 if self.menu1 == None: 1350 return 1345 1351 menu_item = self.menu1.FindItemById(self.id_reset_flag) 1346 1352 flag = menu_item.IsChecked() -
fittingview/src/sans/perspectives/fitting/simfitpage.py
r9e9be13 rdafc36f 795 795 sizer.Clear(True) 796 796 797 new_name = wx.StaticText(self, -1, ' New Model Name',797 new_name = wx.StaticText(self, -1, ' Model Title ', 798 798 style=wx.ALIGN_CENTER) 799 799 new_name.SetBackgroundColour('orange') 800 new_name.SetForegroundColour(wx.WHITE) 800 801 sizer.Add(new_name,(iy, ix),(1,1), 801 802 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 802 803 ix += 2 803 model_type = wx.StaticText(self, -1, ' Model Type')804 model_type = wx.StaticText(self, -1, ' Model ') 804 805 model_type.SetBackgroundColour('grey') 806 model_type.SetForegroundColour(wx.WHITE) 805 807 sizer.Add(model_type,(iy, ix),(1,1), 806 808 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 807 809 ix += 1 808 data_used = wx.StaticText(self, -1, ' Used Data')810 data_used = wx.StaticText(self, -1, ' Data ') 809 811 data_used.SetBackgroundColour('grey') 812 data_used.SetForegroundColour(wx.WHITE) 810 813 sizer.Add(data_used,(iy, ix),(1,1), 811 814 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 812 815 ix += 1 813 tab_used = wx.StaticText(self, -1, ' Fit Tab')816 tab_used = wx.StaticText(self, -1, ' FitPage ') 814 817 tab_used.SetBackgroundColour('grey') 818 tab_used.SetForegroundColour(wx.WHITE) 815 819 sizer.Add(tab_used,(iy, ix),(1,1), 816 820 wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 821 825 ix = 0 822 826 for fitproblem in value.get_fit_problem(): 823 if not self.parent.get_page_by_id(id).batch_on: 824 iy += 1 825 data = fitproblem.get_fit_data() 826 model = fitproblem.get_model() 827 name = '_' 828 if model is not None: 829 name = str(model.name) 830 cb = wx.CheckBox(self, -1, name) 831 cb.SetValue(False) 832 cb.Enable(model is not None and data.is_data) 833 sizer.Add(cb, (iy, ix), (1, 1), 834 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 835 wx.EVT_CHECKBOX(self, cb.GetId(), self.check_model_name) 836 ix += 2 837 type = model.__class__.__name__ 838 model_type = wx.StaticText(self, -1, str(type)) 839 sizer.Add(model_type, (iy, ix), (1, 1), 840 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 841 name = '-' 842 if data is not None and data.is_data: 843 name = str(data.name) 844 data_used = wx.StaticText(self, -1, name) 845 ix += 1 846 sizer.Add(data_used, (iy, ix), (1, 1), 847 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 848 ix += 1 849 caption = value.get_fit_tab_caption() 850 tab_caption_used= wx.StaticText(self, -1, str(caption)) 851 sizer.Add(tab_caption_used, (iy, ix), (1, 1), 852 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 853 854 self.model_list.append([cb,value,id,model]) 827 if self.parent.get_page_by_id(id).batch_on: 828 continue 829 data = fitproblem.get_fit_data() 830 if not data.is_data: 831 continue 832 model = fitproblem.get_model() 833 if model == None: 834 continue 835 iy += 1 836 name = '_' 837 if model is not None: 838 name = str(model.name) 839 cb = wx.CheckBox(self, -1, name) 840 cb.SetValue(False) 841 cb.Enable(model is not None and data.is_data) 842 sizer.Add(cb, (iy, ix), (1, 1), 843 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 844 wx.EVT_CHECKBOX(self, cb.GetId(), self.check_model_name) 845 ix += 2 846 type = model.__class__.__name__ 847 model_type = wx.StaticText(self, -1, str(type)) 848 sizer.Add(model_type, (iy, ix), (1, 1), 849 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 850 name = '-' 851 if data is not None and data.is_data: 852 name = str(data.name) 853 data_used = wx.StaticText(self, -1, name) 854 ix += 1 855 sizer.Add(data_used, (iy, ix), (1, 1), 856 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 857 ix += 1 858 caption = value.get_fit_tab_caption() 859 tab_caption_used= wx.StaticText(self, -1, str(caption)) 860 sizer.Add(tab_caption_used, (iy, ix), (1, 1), 861 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 855 862 863 self.model_list.append([cb,value,id,model]) 856 864 except: 857 865 raise
Note: See TracChangeset
for help on using the changeset viewer.