Changeset 8662a58 in sasview for src


Ignore:
Timestamp:
Oct 10, 2016 4:01:05 PM (8 years ago)
Author:
ajj
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:
3bec50a, f22b43c, 199b515e
Parents:
68669da
Message:

Updating basepage and fitpage to pass is_modified flag out of helper functions so that _onDraw can correctly determine that there is a change and recalculate/redraw

Fixes #753 compute button no longer seems to work

Location:
src/sas/sasgui/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/basepage.py

    r4109bd5 r8662a58  
    13821382        self.state.npts = self.npts_x 
    13831383 
    1384     def _onparamEnter_helper(self): 
     1384    def _onparamEnter_helper(self, is_modified=False): 
    13851385        """ 
    13861386        check if values entered by the user are changed and valid to replot 
     
    13881388        """ 
    13891389        # Flag to register when a parameter has changed. 
    1390         is_modified = False 
     1390        #is_modified = False 
    13911391        self.fitrange = True 
    13921392        is_2Ddata = False 
     
    13961396            is_2Ddata = True 
    13971397        if self.model != None: 
    1398             is_modified = (self._check_value_enter(self.fittable_param) 
    1399                            or self._check_value_enter(self.fixed_param) 
    1400                            or self._check_value_enter(self.parameters)) 
     1398            #Either we get a is_modified = True passed in because 
     1399            #_update_paramv_on_fit() has been called already or 
     1400            # we need to check here ourselves. 
     1401            if not is_modified: 
     1402                is_modified = (self._check_value_enter(self.fittable_param) 
     1403                               or self._check_value_enter(self.fixed_param) 
     1404                               or self._check_value_enter(self.parameters)) 
    14011405 
    14021406            # Here we should check whether the boundaries have been modified. 
     
    14361440                self.Refresh() 
    14371441 
    1438         logging.info("is_modified flag set to %g",is_modified) 
     1442        #logging.info("is_modified flag set to %g",is_modified) 
    14391443        return is_modified 
    14401444 
     
    14461450        flag = True 
    14471451        self.fitrange = True 
     1452        is_modified = False 
    14481453 
    14491454        #wx.PostEvent(self._manager.parent, StatusEvent(status=" \ 
     
    14581463                                                                [self.data]) 
    14591464            ##Check the values 
    1460             self._check_value_enter(self.fittable_param) 
    1461             self._check_value_enter(self.fixed_param) 
    1462             self._check_value_enter(self.parameters) 
     1465            is_modified = (self._check_value_enter(self.fittable_param) 
     1466                            or self._check_value_enter(self.fixed_param) 
     1467                            or self._check_value_enter(self.parameters)) 
    14631468 
    14641469            # If qmin and qmax have been modified, update qmin and qmax and 
     
    15421547            logging.error(traceback.format_exc()) 
    15431548 
    1544         return flag 
     1549        return flag,is_modified 
    15451550 
    15461551    def _reset_parameters_state(self, listtorestore, statelist): 
  • src/sas/sasgui/perspectives/fitting/fitpage.py

    rb4818d9 r8662a58  
    996996            self.create_default_data() 
    997997        """ 
    998         flag = self._update_paramv_on_fit() 
    999  
    1000         wx.CallAfter(self._onparamEnter_helper) 
     998        flag,is_modified = self._update_paramv_on_fit() 
     999 
     1000        wx.CallAfter(self._onparamEnter_helper(is_modified)) 
    10011001        if not flag: 
    10021002            msg = "The parameters are invalid" 
Note: See TracChangeset for help on using the changeset viewer.