Ignore:
Timestamp:
Jul 20, 2016 10:41:34 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:
3ea9371
Parents:
13b9a63
Message:

Move radiation type to required inputs

Location:
src/sas/sasgui/perspectives/file_converter
Files:
2 edited

Legend:

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

    r13b9a63 r55775e8  
    6767 
    6868        self.metadata['detector'][0].name = '' 
     69        self.metadata['source'].radiation = 'neutron' 
    6970 
    7071        self._do_layout() 
     
    218219        self.data_type = dtype 
    219220 
     221    def radiationtype_changed(self, event): 
     222        event.Skip() 
     223        rtype = event.GetEventObject().GetValue().lower() 
     224        self.metadata['source'].radiation = rtype 
     225 
    220226    def metadata_changed(self, event): 
    221227        event.Skip() 
     
    283289        y += 1 
    284290 
     291        radiation_label = wx.StaticText(self, -1, "Radiation Type: ") 
     292        input_grid.Add(radiation_label, (y,0), (1,1), wx.ALL, 5) 
     293        radiation_input = wx.ComboBox(self, -1, 
     294            choices=["Neutron", "X-Ray", "Muon", "Electron"], 
     295            name="radiation", style=wx.CB_READONLY, value="Neutron") 
     296        radiation_input.Bind(wx.EVT_COMBOBOX, self.radiationtype_changed) 
     297        input_grid.Add(radiation_input, (y,1), (1,1)) 
     298        y += 1 
     299 
    285300        output_label = wx.StaticText(self, -1, "Output File: ") 
    286301        input_grid.Add(output_label, (y,0), (1,1), wx.ALIGN_CENTER_VERTICAL, 5) 
     
    288303        self.output = wx.FilePickerCtrl(self, -1, 
    289304            size=(_STATICBOX_WIDTH-80, -1), 
    290             message="Chose the Intensity data file.", 
     305            message="Chose where to save the output file.", 
    291306            style=wx.FLP_SAVE | wx.FLP_OVERWRITE_PROMPT | wx.FLP_USE_TEXTCTRL, 
    292307            wildcard="*.xml") 
     
    317332        windows = ['detector', 'sample', 'source'] 
    318333        for item in self.metadata.keys(): 
     334            # Don't make fields for properties that have their own windows 
    319335            if item in windows: continue 
    320336            label_txt = item.replace('_', ' ').capitalize() 
  • src/sas/sasgui/perspectives/file_converter/meta_panels.py

    r55bc56bc r55775e8  
    333333        y += 1 
    334334 
    335         radiation_label = wx.StaticText(self, -1, "Radiation: ") 
    336         input_grid.Add(radiation_label, (y,0), (1,1), wx.ALL, 5) 
    337         radiation_input = wx.ComboBox(self, -1, 
    338             choices=["neutron", "x-ray", "muon", "electron"], 
    339             name="radiation", style=wx.CB_READONLY) 
    340         radiation_input.Bind(wx.EVT_COMBOBOX, self.on_change) 
    341         input_grid.Add(radiation_input, (y,1), (1,1)) 
    342         y += 1 
    343  
    344335        size_label = wx.StaticText(self, -1, "Beam Size (mm): ") 
    345336        input_grid.Add(size_label, (y,0), (1,1), wx.ALL, 5) 
     
    393384        y += 1 
    394385 
    395  
    396386        name_input.SetValue(self.get_property_string("name")) 
    397         radiation_input.SetValue(self.get_property_string("radiation")) 
    398387        size_input.SetValue(self.metadata.beam_size) 
    399388        shape_input.SetValue(self.get_property_string("beam_shape")) 
Note: See TracChangeset for help on using the changeset viewer.