Ignore:
Timestamp:
Apr 14, 2009 7:57:49 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:
74ad4b1
Parents:
7b35808
Message:

checking value of textcrtl, hide add button for simul fit
hide error of fit param in None

File:
1 edited

Legend:

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

    r780d095 r69bee6d  
    55import time 
    66 
    7 from sans.guiframe.utils import format_number 
     7from sans.guiframe.utils import format_number,check_float 
    88from sans.guicomm.events import StatusEvent    
    99import pagestate 
     
    565565            # If qmin and qmax have been modified, update qmin and qmax and  
    566566            # set the is_modified flag to True 
    567             from sans.guiframe.utils import check_value 
     567            from sans.guiframe.utils import check_value  
    568568            if check_value( self.qmin, self.qmax): 
    569569                if float(self.qmin.GetValue()) != self.qmin_x: 
     
    577577                self.fitrange = False 
    578578            if self.npts != None: 
    579                 if float(self.npts.GetValue()) !=  self.num_points: 
    580                     self.num_points = float(self.npts.GetValue()) 
    581                     is_modified = True 
    582             
     579                if check_float(self.npts): 
     580                    if float(self.npts.GetValue()) !=  self.num_points: 
     581                        self.num_points = float(self.npts.GetValue()) 
     582                        is_modified = True 
     583                else: 
     584                    msg= "Cannot Plot :Must enter a number!!!  " 
     585                    wx.PostEvent(self.parent.parent, StatusEvent(status = msg )) 
     586                     
    583587             
    584588            ## if any value is modify draw model with new value 
     
    988992            when enter value on panel redraw model according to changed 
    989993        """ 
    990         self._onparamEnter_helper() 
     994        tcrtl= event.GetEventObject() 
     995        if check_float(tcrtl): 
     996            self._onparamEnter_helper() 
     997        else: 
     998            msg= "Cannot Plot :Must enter a number!!!  " 
     999            wx.PostEvent(self.parent.parent, StatusEvent(status = msg )) 
     1000            return  
    9911001         
    9921002         
     
    10341044                    item[4].Clear() 
    10351045                    item[4].Hide() 
     1046                     
     1047            
     1048                value= float(item[2].GetValue()) 
    10361049                 
    1037                 value= float(item[2].GetValue()) 
    10381050                # If the value of the parameter has changed, 
    10391051                # +update the model and set the is_modified flag 
    10401052                if value != self.model.getParam(name): 
    10411053                    self.model.setParam(name,value) 
    1042                     is_modified = True     
     1054                    is_modified = True    
     1055             
    10431056            except: 
    10441057                msg= "Model Drawing  Error:wrong value entered : %s"% sys.exc_value 
Note: See TracChangeset for help on using the changeset viewer.