Changeset fc6ea43 in sasview


Ignore:
Timestamp:
Apr 17, 2009 5:06:31 PM (15 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:
da594d0
Parents:
41340860
Message:

disable and enable dispersity change

Location:
sansview/perspectives/fitting
Files:
4 edited

Legend:

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

    rc16557c rfc6ea43  
    332332            return  
    333333        if hasattr(self,"enable_disp"): 
    334             self.state.enable_disp = self.enable_disp.GetValue() 
     334            self.state.enable_disp = copy.deepcopy(self.enable_disp.GetValue()) 
    335335        if hasattr(self, "disp_box"): 
    336             self.state.disp_box = self.disp_box.GetSelection() 
     336            self.state.disp_box = copy.deepcopy(self.disp_box.GetSelection()) 
    337337         
    338338        self.state.model = self.model.clone() 
     
    345345         
    346346        ## Add item in the context menu 
    347         year, month, day,hour,minute,second,tda,ty,tm_isdst= time.gmtime() 
    348         my_time= str(hour)+"hrs "+str(minute)+"min "+str(second)+"s" 
     347         
     348        year, month, day,hour,minute,second,tda,ty,tm_isdst= time.localtime() 
     349        my_time= str(hour)+" : "+str(minute)+" : "+str(second)+" " 
    349350        date= str( month)+"|"+str(day)+"|"+str(year) 
    350351        msg=  "Model saved at %s on %s"%(my_time, date) 
     
    443444        if hasattr(self,"enable_disp"): 
    444445            self.state.enable_disp= self.enable_disp.GetValue() 
    445          
     446            self.state.disable_disp = self.disable_disp.GetValue() 
     447             
    446448        self.state.smearer = copy.deepcopy(self.smearer) 
    447449        if hasattr(self,"enable_smearer"): 
    448450            self.state.enable_smearer = copy.deepcopy(self.enable_smearer.GetValue()) 
     451            self.state.disable_smearer = copy.deepcopy(self.disable_smearer.GetValue()) 
     452             
    449453             
    450454        if hasattr(self,"disp_box"): 
     
    453457       
    454458        ## save checkbutton state and txtcrtl values 
    455         self.state.parameters=[] 
    456         self.state.fittable_param=[] 
    457         self.state.fixed_param=[] 
    458459        
    459460        self._copy_parameters_state(self.parameters, self.state.parameters) 
    460461        self._copy_parameters_state(self.fittable_param, self.state.fittable_param) 
    461462        self._copy_parameters_state(self.fixed_param, self.state.fixed_param) 
     463        self._copy_parameters_state(self.orientation_params, 
     464                                     self.state.orientation_params) 
     465        self._copy_parameters_state(self.orientation_params_disp, 
     466                                     self.state.orientation_params_disp) 
    462467         
    463468        ## post state to fit panel 
     
    483488        ## display dispersion info layer 
    484489        self.enable_disp.SetValue(self.state.enable_disp) 
     490        self.disable_disp.SetValue(self.state.disable_disp) 
    485491        if hasattr(self, "disp_box"): 
    486492            self.disp_box.SetSelection(self.state.disp_box)   
     
    492498            ## set smearing value whether or not the data contain the smearing info 
    493499            self.enable_smearer.SetValue(state.enable_smearer) 
     500            self.disable_smearer.SetValue(state.disable_smearer) 
    494501            self.compute_chisqr(smearer= self.smearer)   
    495502             
     
    500507        self._reset_parameters_state(self.fittable_param,state.fittable_param) 
    501508        self._reset_parameters_state(self.fixed_param,state.fixed_param) 
     509        self._reset_parameters_state(self.orientation_params_disp, 
     510                                     state.orientation_params_disp) 
     511        self._reset_parameters_state(self.orientation_params, 
     512                                     state.orientation_params) 
    502513         
    503514        ## draw the model with previous parameters value 
     
    9991010         
    10001011        ## post state to fit panel 
    1001         self.save_current_state() 
     1012        self.state.model =self.model 
     1013        ## post state to fit panel 
     1014        event = PageInfoEvent(page = self) 
     1015        wx.PostEvent(self.parent, event) 
     1016         
    10021017        self.sizer4_4.Layout() 
    10031018        self.sizer4.Layout() 
  • sansview/perspectives/fitting/fitting.py

    r41340860 rfc6ea43  
    10091009            theory.detector= data.detector 
    10101010            theory.source= data.source 
    1011              
     1011        
    10121012            ## plot boundaries 
    10131013            theory.ymin= data.ymin 
  • sansview/perspectives/fitting/modelpage.py

    rd1e0473 rfc6ea43  
    227227                        ctl1.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) 
    228228                        ctl1.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter) 
    229                         ctl1.Disable() 
     229                        if not self.enable2D: 
     230                            ctl1.Disable() 
     231                        else: 
     232                            ctl1.Enable() 
    230233                        self.sizer4_4.Add(ctl1, (iy,ix),(1,1), wx.EXPAND) 
    231234                        self.fittable_param.append([None,name1,ctl1,None, 
     
    242245                            Tctl1.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) 
    243246                            Tctl1.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter) 
    244                             Tctl1.Disable() 
     247                            if not self.enable2D: 
     248                                Tctl1.Disable() 
     249                            else: 
     250                                Tctl1.Enable() 
    245251                            self.sizer4_4.Add(Tctl1, (iy,ix),(1,1), 
    246252                                               wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     
    258264                            Tctl2.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) 
    259265                            Tctl2.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter) 
    260                             Tctl2.Disable() 
     266                            if not self.enable2D: 
     267                                Tctl2.Disable() 
     268                            else: 
     269                                Tctl2.Enable() 
    261270                            self.sizer4_4.Add(Tctl2, (iy,ix),(1,1), 
    262271                                               wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
  • sansview/perspectives/fitting/pagestate.py

    r3370922 rfc6ea43  
    4242        ## orientation parameters 
    4343        self.orientation_params=[] 
     44        ## orientation parmaters for gaussian dispersity 
     45        self.orientation_params_disp=[] 
    4446        ## smearer info 
    4547        self.smearer=None 
     
    6466        ## enable smearering state 
    6567        self.enable_smearer = False 
     68        self.disable_smearer = True 
    6669        ## disperity selection 
    6770        self.enable_disp= False 
     71        self.disable_disp= True 
    6872        ## state of selected all check button 
    6973        self.cb1 = False 
     
    8791        obj.manager = self.manager 
    8892        obj.event_owner = self.event_owner 
     93         
    8994        obj.parameters = copy.deepcopy(self.parameters) 
    9095        obj.fixed_param = copy.deepcopy(self.fixed_param) 
    9196        obj.fittable_param = copy.deepcopy(self.fittable_param) 
    9297        obj.orientation_params =  copy.deepcopy(self.orientation_params) 
     98        obj.orientation_params_disp =  copy.deepcopy(self.orientation_params_disp) 
     99         
    93100        obj.enable_disp = copy.deepcopy(self.enable_disp) 
     101        obj.disable_disp = copy.deepcopy(self.disable_disp) 
     102         
    94103        obj.enable_smearer = copy.deepcopy(self.enable_smearer) 
     104        obj.disable_smearer = copy.deepcopy(self.disable_smearer) 
     105         
    95106        obj.disp_box = copy.deepcopy(self.disp_box) 
    96107        obj.qmin = copy.deepcopy(self.qmin) 
Note: See TracChangeset for help on using the changeset viewer.