Changeset 9c90cf3 in sasview


Ignore:
Timestamp:
Jul 11, 2016 2:36:55 AM (8 years ago)
Author:
lewis
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:
b564ea2
Parents:
e02d8f6
git-author:
Lewis O'Driscoll <lewis.o'driscoll@…> (07/06/16 09:35:07)
git-committer:
Lewis O'Driscoll <lewis.o'driscoll@…> (07/11/16 02:36:55)
Message:

Minor refactor and add some comments

Location:
src/sas/sasgui/perspectives/corfunc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/corfunc/corfunc.py

    re02d8f6 r9c90cf3  
    3232        logging.info("Correlation function plug-in started") 
    3333        self._always_active = True 
    34  
    3534        self.state_reader = Reader(self.set_state) 
    3635        self._extensions = '.cor' 
     
    138137        new_plot.id = self.data_id 
    139138        new_plot.title = "I(q)" 
     139        # Show data on a linear scale 
    140140        new_plot.xtransform = 'x' 
    141141        new_plot.ytransform = 'y' 
  • src/sas/sasgui/perspectives/corfunc/corfunc_panel.py

    re02d8f6 r9c90cf3  
    5252 
    5353    def set_state(self, state=None, data=None): 
     54        """ 
     55        Set the state of the panel. If no state is provided, the panel will 
     56        be set to the default state. 
     57 
     58        :param state: A CorfuncState object 
     59        :param data: A Data1D object 
     60        """ 
    5461        if state is None: 
    5562            self.state = CorfuncState() 
     
    109116        """ 
    110117        Return an XML node containing the state of the panel 
     118 
     119        :param doc: Am xml node to attach the project state to (optional) 
    111120        """ 
    112121        data = self._data 
     
    123132                    doc = new_doc 
    124133        return doc 
     134 
     135    def set_qmin(self, qmin): 
     136        self.qmin = qmin 
     137        self._qmin_input.SetValue(str(qmin)) 
     138 
     139    def set_qmax(self, qmax): 
     140        self.qmax = qmax 
     141        self._qmax1_input.SetValue(str(qmax[0])) 
     142        self._qmax2_input.SetValue(str(qmax[1])) 
    125143 
    126144 
     
    145163                active=event.GetEventObject(), id=data_id, group_id=group_id, 
    146164                leftdown=False)) 
    147  
    148     def set_qmin(self, qmin): 
    149         self.qmin = qmin 
    150         self._qmin_input.SetValue(str(qmin)) 
    151  
    152     def set_qmax(self, qmax): 
    153         self.qmax = qmax 
    154         self._qmax1_input.SetValue(str(qmax[0])) 
    155         self._qmax2_input.SetValue(str(qmax[1])) 
    156165 
    157166    def _validate_qrange(self): 
  • src/sas/sasgui/perspectives/corfunc/corfunc_state.py

    re02d8f6 r9c90cf3  
    1 """ 
    2 State class for the corfunc UI 
    3 """ 
    41import time 
    52import sys 
     
    3532 
    3633class CorfuncState(object): 
     34    """ 
     35    Stores information about the state of CorfuncPanel 
     36    """ 
    3737 
    3838    def __init__(self): 
     
    206206class Reader(CansasReader): 
    207207    """ 
    208     Class to read a CanSAS file containing the state of the CorfuncPanel 
     208    Reads a CanSAS file containing the state of a CorfuncPanel 
    209209    """ 
    210210 
Note: See TracChangeset for help on using the changeset viewer.