Ignore:
Timestamp:
Jul 14, 2016 12:19:22 PM (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:
1aad14e
Parents:
de0df2c
Message:

Start adding sample metadata window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/file_converter/converter_panel.py

    rde0df2c r2a7722b  
    1212from sas.sasgui.perspectives.file_converter.meta_panels import MetadataWindow 
    1313from sas.sasgui.perspectives.file_converter.meta_panels import DetectorPanel 
     14from sas.sasgui.perspectives.file_converter.meta_panels import SamplePanel 
    1415from sas.sasgui.guiframe.events import StatusEvent 
    1516from sas.sasgui.guiframe.dataFitting import Data1D 
     
    1718from sas.sascalc.dataloader.readers.cansas_reader import Reader as CansasReader 
    1819from sas.sascalc.dataloader.data_info import Detector 
     20from sas.sascalc.dataloader.data_info import Sample 
    1921from sas.sascalc.dataloader.data_info import Vector 
    2022 
     
    5557            'run_name': None, 
    5658            'instrument': None, 
    57             'detector': [Detector()] 
     59            'detector': [Detector()], 
     60            'sample': Sample() 
    5861        } 
    5962        self.vectors = ['offset', 'orientation', 'pixel_size', 'beam_center'] 
     
    194197        detector_frame.Show(True) 
    195198 
     199    def show_sample_window(self, event): 
     200        if self.meta_frames != []: 
     201            for frame in self.meta_frames: 
     202                frame.panel.on_close() 
     203        sample_frame = MetadataWindow(SamplePanel, 
     204            parent=self.parent.manager.parent, manager=self, 
     205            metadata=self.metadata['sample'], title='Sample Metadata') 
     206        self.meta_frames.append(sample_frame) 
     207        self.parent.manager.put_icon(sample_frame) 
     208        sample_frame.Show(True) 
     209 
    196210    def metadata_changed(self, event): 
    197211        event.Skip() 
     
    300314        y += 1 
    301315 
     316        sample_label = wx.StaticText(metadata_pane, -1, "Sample: ") 
     317        metadata_grid.Add(sample_label, (y,0), (1,1), wx.ALL | wx.EXPAND, 5) 
     318        sample_btn = wx.Button(metadata_pane, -1, "Enter Sample Metadata") 
     319        metadata_grid.Add(sample_btn, (y,1), (1,1), wx.ALL | wx.EXPAND, 5) 
     320        sample_btn.Bind(wx.EVT_BUTTON, self.show_sample_window) 
     321        y += 1 
     322 
    302323        metadata_pane.SetSizer(metadata_grid) 
    303324 
Note: See TracChangeset for help on using the changeset viewer.