Changeset 484faf7 in sasview


Ignore:
Timestamp:
Jan 4, 2010 8:11:56 PM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
6e0e2d85
Parents:
0277d084
Message:

adding invarant panel

Location:
sansview/perspectives/fitting
Files:
1 added
3 deleted
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/basepage.py

    r918fcb1 r484faf7  
    12291229                if self.enable_smearer.GetValue(): 
    12301230                    temp_smear= self.smearer 
     1231             
    12311232            self.manager.draw_model(self.model, data=self.data, 
    12321233                                    smearer= temp_smear, 
    1233                                     qmin=float(self.qmin_x), qmax=float(self.qmax_x), 
     1234                                    qmin=float(self.qmin_x),  
     1235                                    qmax=float(self.qmax_x), 
    12341236                                    qstep= float(self.num_points), 
    12351237                                    enable2D=self.enable2D)  
     
    14421444 
    14431445                # If qmin and qmax have been modified, update qmin and qmax 
    1444                 if check_value( self.qmin, self.qmax): 
     1446                if self._validate_qrange( self.qmin, self.qmax): 
    14451447                    tempmin = float(self.qmin.GetValue()) 
    14461448                    if tempmin != self.qmin_x: 
     
    14811483        wx.PostEvent(self.parent, event) 
    14821484        self.state_change= False 
    1483    
     1485        #Draw the model for a different range 
     1486        self._draw_model() 
    14841487                    
    14851488    def _on_select_model_helper(self):  
     
    20122015        #On 'More details' button 
    20132016        """ 
    2014         from helpPanel import  HelpWindow 
     2017        from help_panel import  HelpWindow 
    20152018         
    20162019        if self.model == None: 
  • sansview/perspectives/fitting/fitting.py

    r7975f2b r484faf7  
    102102        self.sim_page=None 
    103103        #dictionary containing data name and error on dy of that data  
    104         self.err_dy={} 
     104        self.err_dy = {} 
    105105         
    106106    
     
    136136        wx.EVT_MENU(owner, id1, self.on_add_sim_page) 
    137137        #menu for SLD Calculator 
    138         self.tool_menu = wx.Menu() 
    139         id_tool_menu = wx.NewId() 
    140         sld_id = wx.NewId() 
    141         sld_help= "Compute the scattering length density of molecules" 
    142         self.tool_menu.Append(sld_id, "SLD Calculator",sld_help) 
    143         wx.EVT_MENU(owner,sld_id,  self.onCalculateSld) 
     138        #self.tool_menu = wx.Menu() 
     139        #id_tool_menu = wx.NewId() 
     140        #sld_id = wx.NewId() 
     141        #sld_help= "Compute the scattering length density of molecules" 
     142        #self.tool_menu.Append(sld_id, "SLD Calculator",sld_help) 
     143        #wx.EVT_MENU(owner,sld_id,  self.onCalculateSld) 
    144144     
    145145        #menu for model 
     
    154154       
    155155        #create  menubar items 
    156         return [(id, self.menu1, "Fitting"), 
    157                 (id_tool_menu, self.tool_menu,"Tools" ), 
    158                 (id2, menu2, "Model")] 
     156        return [(id, self.menu1, "Fitting")] 
     157                #(id_tool_menu, self.tool_menu,"Tools" ), 
     158                #(id2, menu2, "Model")] 
    159159        
    160160     
     
    178178            TODO: replace the text with a nice image 
    179179        """ 
    180         from helpPanel import  HelpWindow 
     180         
     181        from help_panel import  HelpWindow 
    181182        frame = HelpWindow(None, -1, 'HelpWindow')     
    182183        frame.Show(True) 
     
    194195        """ 
    195196        self.graph = graph 
    196         fitOption = "Select data for fitting" 
    197         fitOpenHint =  "Dialog with fitting parameters " 
    198                 
     197        fit_option = "Select data for fitting" 
     198        fit_hint =  "Dialog with fitting parameters " 
     199        invariant_option = "Compute Invariant" 
     200        invariant_hint =  "A dialog will appears for further computation" 
    199201        for item in graph.plottables: 
    200202            if item.__class__.__name__ is "Data2D": 
     
    202204                if hasattr(item,"is_data"): 
    203205                    if item.is_data: 
    204                         return [[fitOption, fitOpenHint, self._onSelect]] 
     206                        return [[fit_option, fit_hint, self._onSelect]] 
    205207                    else: 
    206208                        return []  
    207                 return [[fitOption, fitOpenHint, self._onSelect]] 
     209                return [[fit_option, fit_hint, self._onSelect]] 
    208210            else: 
    209211                if item.name==graph.selected_plottable : 
     
    214216                            if hasattr(item,"is_data"): 
    215217                                if item.is_data: 
    216                                     return [[fitOption, fitOpenHint, self._onSelect]] 
     218                                    return [[fit_option, fit_hint, 
     219                                              self._onSelect], 
     220                                            [invariant_option,  
     221                                    invariant_hint, self._compute_invariant]] 
    217222                                else: 
    218223                                    return []  
    219224                            else: 
    220                                return [[fitOption, fitOpenHint, self._onSelect]]  
     225                               return [[fit_option, fit_hint, self._onSelect], 
     226                                       [invariant_option,  
     227                                        invariant_hint, self._compute_invariant]] 
    221228        return []    
    222229 
     
    548555                
    549556             
    550              
     557    def _compute_invariant(self, event):     
     558        """ 
     559            Open the invariant panel to invariant computation 
     560        """ 
     561         
     562         
    551563    def _closed_fitpage(self, event):    
    552564        """ 
     
    848860            set engine to park 
    849861        """ 
     862        Plugin.on_perspective(self,event=event) 
    850863        self._on_change_engine('park') 
    851864        
     
    908921            @param engine: the key work of the engine 
    909922        """ 
     923        
    910924        ## saving fit engine name 
    911925        self._fit_engine = engine 
     
    10901104            
    10911105            title= new_plot.name 
    1092              
     1106            new_plot. perspective = self.get_perspective() 
    10931107            # Pass the reset flag to let the plotting event handler 
    10941108            # know that we are replacing the whole plot 
Note: See TracChangeset for help on using the changeset viewer.