- Timestamp:
- Aug 18, 2010 5:30:03 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:
- a706353b
- Parents:
- 645f9b6
- Location:
- sansview/perspectives/fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
r3c44c66 r4523b68 929 929 self.formfactorbox.Select(int(state.formfactorcombobox)) 930 930 self.structurebox.SetSelection(state.structurecombobox ) 931 931 if state.multi_factor != None: 932 self.multifactorbox.SetSelection(state.multi_factor-1) 933 932 934 #reset the fitting engine type 933 935 self.engine_type = state.engine_type … … 1584 1586 else: 1585 1587 boxsizer1 = box_sizer 1586 1588 sizer_buttons = wx.BoxSizer(wx.HORIZONTAL) 1587 1589 #-------------------------------------------------------- 1588 1590 self.shape_rbutton = wx.RadioButton(self, -1, 'Shapes', style=wx.RB_GROUP) … … 1605 1607 sizer_radiobutton.Add(self.shape_rbutton) 1606 1608 sizer_radiobutton.Add(self.shape_indep_rbutton) 1609 1607 1610 sizer_radiobutton.Add(self.plugin_rbutton) 1608 1611 sizer_radiobutton.Add(self.struct_rbutton) 1612 sizer_buttons.Add(sizer_radiobutton) 1613 # detail button 1614 if object !=None: 1615 sizer_buttons.Add((50,0)) 1616 sizer_buttons.Add(object) 1609 1617 1610 1618 sizer_selection = wx.BoxSizer(wx.HORIZONTAL) 1619 mutifactor_selection = wx.BoxSizer(wx.HORIZONTAL) 1611 1620 1612 1621 self.text1 = wx.StaticText( self,-1,"" ) 1613 1622 self.text2 = wx.StaticText( self,-1,"P(Q)*S(Q)" ) 1614 1623 self.mutifactor_text = wx.StaticText( self,-1,"No. of Shells: " ) 1615 1624 1616 1625 self.formfactorbox = wx.ComboBox(self, -1,style=wx.CB_READONLY) … … 1619 1628 1620 1629 self.structurebox = wx.ComboBox(self, -1,style=wx.CB_READONLY) 1621 1630 self.multifactorbox = wx.ComboBox(self, -1,style=wx.CB_READONLY) 1622 1631 self.initialize_combox() 1623 1632 1624 1633 wx.EVT_COMBOBOX(self.formfactorbox,-1, self._on_select_model) 1625 1634 wx.EVT_COMBOBOX(self.structurebox,-1, self._on_select_model) 1626 1627 1635 wx.EVT_COMBOBOX(self.multifactorbox,-1, self._on_select_model) 1636 1628 1637 ## check model type to show sizer 1629 1638 if self.model !=None: … … 1637 1646 sizer_selection.Add((5,5)) 1638 1647 sizer_selection.Add(self.structurebox) 1639 sizer_selection.Add((5,5)) 1640 1641 boxsizer1.Add( sizer_radiobutton ) 1642 boxsizer1.Add( (20,20)) 1648 #sizer_selection.Add((5,5)) 1649 mutifactor_selection.Add((10,5)) 1650 mutifactor_selection.Add(self.mutifactor_text) 1651 mutifactor_selection.Add(self.multifactorbox) 1652 1653 boxsizer1.Add( sizer_buttons ) 1654 boxsizer1.Add( (15,15)) 1643 1655 boxsizer1.Add( sizer_selection ) 1644 if object !=None: 1645 boxsizer1.Add( (-72,-72)) 1646 boxsizer1.Add( object, 0, wx.ALIGN_RIGHT| wx.RIGHT, 35) 1647 boxsizer1.Add( (60,60)) 1656 boxsizer1.Add( (10,10)) 1657 boxsizer1.Add(mutifactor_selection) 1658 1659 self._set_multfactor_combobox() 1660 1648 1661 #-------------------------------------------------------- 1649 1662 sizer.Add(boxsizer1,0, wx.EXPAND | wx.ALL, 10) 1650 1663 sizer.Layout() 1651 1664 self.SetScrollbars(20,20,25,65) 1665 1666 def _set_multfactor_combobox(self): 1667 """ 1668 Set comboBox for muitfactor of CoreMultiShellModel 1669 """ 1670 for idx in range(1,5): 1671 self.multifactorbox.Append(str(idx),int(idx)) 1672 self.multifactorbox.SetSelection(0) 1673 self._hide_multfactor_combobox() 1674 1675 def _show_multfactor_combobox(self): 1676 """ 1677 Show the comboBox of muitfactor of CoreMultiShellModel 1678 """ 1679 if not self.mutifactor_text.IsShown(): 1680 self.mutifactor_text.Show(True) 1681 if not self.multifactorbox.IsShown(): 1682 self.multifactorbox.Show(True) 1683 1684 def _hide_multfactor_combobox(self): 1685 """ 1686 Hide the comboBox of muitfactor of CoreMultiShellModel 1687 """ 1688 if self.mutifactor_text.IsShown(): 1689 self.mutifactor_text.Hide() 1690 if self.multifactorbox.IsShown(): 1691 self.multifactorbox.Hide() 1692 1652 1693 1653 1694 def _show_combox_helper(self): … … 1797 1838 self.structurebox.Enable() 1798 1839 self.text2.Enable() 1840 1841 if form_factor != None: 1842 # set multifactor for Mutifunctional models 1843 if form_factor().name == 'CoreMultiShellModel': 1844 self._show_multfactor_combobox() 1845 m_id = self.multifactorbox.GetCurrentSelection() 1846 self.multi_factor = self.multifactorbox.GetClientData(m_id) 1847 if self.multi_factor == None: self.multi_factor =0 1848 form_factor = form_factor(int(self.multi_factor)) 1849 else: 1850 self._hide_multfactor_combobox() 1851 form_factor = form_factor() 1852 self.multi_factor = None 1853 else: 1854 self._hide_multfactor_combobox() 1855 self.multi_factor = None 1856 1799 1857 s_id = self.structurebox.GetCurrentSelection() 1800 1858 struct_factor = self.structurebox.GetClientData( s_id ) 1801 1859 1802 1860 if struct_factor !=None: 1803 1861 from sans.models.MultiplicationModel import MultiplicationModel 1804 self.model= MultiplicationModel(form_factor (),struct_factor())1862 self.model= MultiplicationModel(form_factor,struct_factor()) 1805 1863 1806 1864 else: 1807 1865 if form_factor != None: 1808 self.model= form_factor ()1866 self.model= form_factor 1809 1867 else: 1810 1868 self.model = None 1811 1869 return self.model 1870 1871 1812 1872 ## post state to fit panel 1813 1873 self.state.parameters =[] 1814 1874 self.state.model =self.model 1875 self.state.qmin = self.qmin_x 1876 self.state.multi_factor = self.multi_factor 1815 1877 self.disp_list =self.model.getDispParamList() 1816 1878 self.state.disp_list = self.disp_list -
sansview/perspectives/fitting/models.py
r5062bbf r4523b68 182 182 self.shape_list.append(CoreShellModel) 183 183 self.multiplication_factor.append(CoreShellModel) 184 185 from sans.models.Core FourShellModel import CoreFourShellModel186 self.shape_list.append(Core FourShellModel)187 self.multiplication_factor.append(Core FourShellModel)184 185 from sans.models.CoreMultiShellModel import CoreMultiShellModel 186 self.shape_list.append(CoreMultiShellModel) 187 self.multiplication_factor.append(CoreMultiShellModel) 188 188 189 189 from sans.models.VesicleModel import VesicleModel -
sansview/perspectives/fitting/pagestate.py
rb63dc6e r4523b68 223 223 self.npts = None 224 224 self.name = "" 225 self.multi_factor = None 225 226 ## enable smearering state 226 227 self.enable_smearer = False … … 297 298 obj.qmin = copy.deepcopy(self.qmin) 298 299 obj.qmax = copy.deepcopy(self.qmax) 300 obj.multi_factor = copy.deepcopy(self.multi_factor) 299 301 obj.npts = copy.deepcopy(self.npts ) 300 302 obj.cb1 = copy.deepcopy(self.cb1)
Note: See TracChangeset
for help on using the changeset viewer.