Changeset 9b18735 in sasview for invariantview


Ignore:
Timestamp:
Aug 11, 2010 5:35:03 PM (14 years ago)
Author:
Jae Cho <jhjcho@…>
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:
b63dc6e
Parents:
3eb2811
Message:

now all panels are reset when opening svs files: except prview

Location:
invariantview/perspectives/invariant
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • invariantview/perspectives/invariant/invariant.py

    r4da35bc r9b18735  
    265265        """ 
    266266        Call-back method for the state reader. 
    267         This method is called when a .inv file is loaded. 
     267        This method is called when a .inv/.svs file is loaded. 
    268268         
    269269        :param state: State object 
     
    271271        self.temp_state = None 
    272272        try: 
     273             
    273274            if datainfo is None: 
    274275                raise RuntimeError, "invariant.set_state: datainfo parameter cannot be None in standalone mode" 
     276             
    275277            datainfo.meta_data['invstate'].file = datainfo.meta_data['invstate'].file 
    276278            datainfo.name = datainfo.meta_data['invstate'].file 
     
    283285            # set state 
    284286            self.invariant_panel.is_state_data = True 
    285             # Load the invariant states 
     287             
    286288            # Make sure the user sees the invariant panel after loading 
    287289            self.parent.set_perspective(self.perspective) 
     290            # Load the invariant states 
    288291            self.temp_state = temp_state 
    289292            #self.invariant_panel.set_state(state=temp_state,data=self.__data)          
    290  
     293             
    291294        except: 
    292295            logging.error("invariant.set_state: %s" % sys.exc_value) 
    293296             
    294     def on_set_state_helper(self,event=None): 
    295         """ 
     297    def on_set_state_helper(self, event=None): 
     298        """ 
     299        Set the state when called by EVT_STATE_UPDATE event from guiframe 
     300        after a .inv/.svs file is loaded  
    296301        """ 
    297302        self.invariant_panel.set_state(state=self.temp_state,data=self.__data) 
    298303        self.temp_state = None 
     304         
     305         
    299306         
    300307    def plot_theory(self, data=None, name=None): 
  • invariantview/perspectives/invariant/invariant_panel.py

    r085bf4c r9b18735  
    123123        if self._data is not None: 
    124124            self.err_check_on_data() 
     125            self.get_state_by_num(0) 
    125126            data_name = self._data.name 
    126127            data_qmin = min (self._data.x) 
     
    132133            self.compute_invariant(event=None) 
    133134            self.state.file = self._data.name 
     135            #Reset the list of states 
     136            self.state.data = copy.deepcopy(data) 
     137            self._reset_state_list() 
    134138        return True   
    135139    def set_message(self): 
     
    159163    def set_state(self,state=None,data=None): 
    160164        """ 
    161         set state when loading it from a .inv file 
     165        set state when loading it from a .inv/.svs file 
    162166        """ 
    163167        if state == None or data == None: 
     
    197201            self.is_state_data = False 
    198202 
    199              
     203    def clear_panel(self, format='.svs'): 
     204        """ 
     205        Clear panel to defaults, used by set_state of manager 
     206        """ 
     207        if format == '.svs': 
     208            self._data = None 
     209            # default data testctrl 
     210            self.hint_msg_txt.SetLabel('') 
     211            data_name = '' 
     212            data_qmin = '' 
     213            data_qmax = '' 
     214            self.data_name_tcl.SetValue(str(data_name)) 
     215            self.data_min_tcl.SetLabel(str(data_qmin)) 
     216            self.data_max_tcl.SetLabel(str(data_qmax)) 
     217            #reset output textctrl 
     218            self._reset_output() 
     219            #reset panel 
     220            self.reset_panel() 
     221            #reset state w/o data 
     222            self.set_state() 
     223            # default flags for state 
     224            self.new_state = False 
     225            self.is_state_data = False 
     226            self.is_power_out = False 
    200227 
    201228    def get_background(self): 
     
    744771        self.button_bookmark.Disable() 
    745772        self.button_report.Disable() 
     773        self.button_save.Disable()  
    746774        self.button_calculate.SetFocus() 
    747775        #self.SetupScrolling() 
Note: See TracChangeset for help on using the changeset viewer.