Changeset a48842a2 in sasview for calculatorview/src/sans


Ignore:
Timestamp:
Jun 13, 2012 4:40:41 PM (12 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:
1a98ded
Parents:
9a14138
Message:

added data operation tool

File:
1 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/src/sans/perspectives/calculator/calculator.py

    r9520702 ra48842a2  
    1414 
    1515from sans.guiframe.plugin_base import PluginBase 
     16from sans.perspectives.calculator.data_operator import DataOperatorWindow 
    1617import logging 
    1718 
     
    2627        logging.info("Calculator plug-in started")    
    2728        self.sub_menu = "Tool"  
    28    
     29        # data operator use one frame all the time 
     30        self.data_operator_frame = None 
     31         
    2932    def help(self, evt): 
    3033        """ 
     
    6164        pyconsole_help = "Python Console." 
    6265        #data_editor_help = "Meta Data Editor" 
    63         return [("SLD Calculator", sld_help, self.on_calculate_sld), 
     66        return [("Data Operation",  
     67                        'Data operation', self.on_data_operation), 
     68                ("SLD Calculator", sld_help, self.on_calculate_sld), 
    6469                ("Density/Volume Calculator", mass_volume_help,  
    6570                                            self.on_calculate_dv), 
     
    7681        Edit meta data  
    7782        """ 
    78         from data_editor import DataEditorWindow 
     83        from sans.perspectives.calculator.data_editor import DataEditorWindow 
    7984        frame = DataEditorWindow(parent=self.parent, data=[], 
    8085                                  title="Data Editor") 
    8186        self.put_icon(frame) 
    8287        frame.Show(True) 
    83  
     88               
     89    def on_data_operation(self, event): 
     90        """ 
     91        Data operation 
     92        """ 
     93        if self.data_operator_frame == None: 
     94            # Use one frame all the time 
     95            self.data_operator_frame = DataOperatorWindow(parent=self.parent,  
     96                                                title="Data Operation") 
     97            self.put_icon(self.data_operator_frame) 
     98        self.data_operator_frame.Show(False) 
     99        self.data_operator_frame.Show(True) 
     100         
    84101    def on_calculate_kiessig(self, event): 
    85102        """ 
    86103        Compute the Kiessig thickness 
    87104        """ 
    88         from kiessig_calculator_panel import KiessigWindow 
     105        from sans.perspectives.calculator.kiessig_calculator_panel \ 
     106        import KiessigWindow 
    89107        frame = KiessigWindow() 
    90108        self.put_icon(frame) 
     
    95113        Compute the scattering length density of molecula 
    96114        """ 
    97         from sld_panel import SldWindow 
     115        from sans.perspectives.calculator.sld_panel import SldWindow 
    98116        frame = SldWindow(base=self.parent) 
    99117        self.put_icon(frame) 
     
    104122        Compute the mass density or molar voulme 
    105123        """ 
    106         from density_panel import DensityWindow 
     124        from sans.perspectives.calculator.density_panel import DensityWindow 
    107125        frame = DensityWindow(base=self.parent) 
    108126        self.put_icon(frame) 
     
    113131        Compute the slit size a given data 
    114132        """ 
    115         from slit_length_calculator_panel import SlitLengthCalculatorWindow 
     133        from sans.perspectives.calculator.slit_length_calculator_panel \ 
     134        import SlitLengthCalculatorWindow 
    116135        frame = SlitLengthCalculatorWindow(parent=self.parent)   
    117136        self.put_icon(frame)   
     
    122141        Estimate the instrumental resolution 
    123142        """ 
    124         from resolution_calculator_panel import ResolutionWindow 
     143        from sans.perspectives.calculator.resolution_calculator_panel \ 
     144        import ResolutionWindow 
    125145        frame = ResolutionWindow(parent=self.parent) 
    126146        self.put_icon(frame) 
     
    153173        :param filename: file name to open in editor 
    154174        """ 
    155         from pyconsole import PyConsole 
     175        from sans.perspectives.calculator.pyconsole import PyConsole 
    156176        frame = PyConsole(parent=self.parent, filename=filename) 
    157177        self.put_icon(frame) 
Note: See TracChangeset for help on using the changeset viewer.