Changeset edc7852 in sasview for src/sas/sasgui/guiframe


Ignore:
Timestamp:
May 22, 2017 2:03:30 PM (7 years ago)
Author:
krzywon
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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
47d93073
Parents:
324e0bf
Message:

Incorporate log binning into sector parameter window.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_slicer.py

    r324e0bf redc7852  
    2020                "BoxInteractorX": "SlabX", 
    2121                "BoxInteractorY": "SlabY"} 
     22BINNING_OPTIONS = {"Linear" : 0, 
     23                   "Logarithmic" : 10,} 
    2224 
    2325 
     
    4749        self.path = None 
    4850        self.fitting_options = None 
     51        self.bin_ctl = None 
    4952        self.type_list = [] 
    5053        self.loaded_data = [] 
     
    101104            keys.sort() 
    102105            for item in keys: 
     106                ix = 0 
    103107                iy += 1 
    104                 ix = 0 
    105                 if item not in ["count", "errors"]: 
     108                if item not in ["count", "errors", "binning base"]: 
    106109                    text = wx.StaticText(self, -1, item, style=wx.ALIGN_LEFT) 
    107110                    self.bck.Add(text, (iy, ix), (1, 1), 
     
    121124                    self.bck.Add((20, 20), (iy, ix), (1, 1), 
    122125                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     126                elif item == 'binning base': 
     127                    text = wx.StaticText(self, -1, item, style=wx.ALIGN_LEFT) 
     128                    self.bck.Add(text, (iy, ix), (1, 1), 
     129                                 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
     130                    options = BINNING_OPTIONS.keys() 
     131                    self.bin_ctl = wx.ComboBox(parent=self, choices=options) 
     132                    hint_msg = "Modify the value of %s to change" % item 
     133                    hint_msg += " the 2D slicer" 
     134                    self.bin_ctl.SetToolTipString(hint_msg) 
     135                    ix = 1 
     136                    result = "" 
     137                    value = 0 
     138                    for name, value in BINNING_OPTIONS.items(): 
     139                        if value == params[item]: 
     140                            result = name 
     141                            break 
     142                    index = self.bin_ctl.FindString(result) 
     143                    self.bin_ctl.SetSelection(index) 
     144                    self.parameters.append([item, self.bin_ctl]) 
     145                    self.Bind(wx.EVT_COMBOBOX, self.on_text_enter) 
     146                    self.bck.Add(self.bin_ctl, (iy, ix), (1, 1), 
     147                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     148                    ix = 3 
     149                    self.bck.Add((20, 20), (iy, ix), (1, 1), 
     150                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    123151                else: 
    124152                    text = wx.StaticText(self, -1, item + " : ", 
     
    251279        for item in self.parameters: 
    252280            try: 
     281                if item[0] == "binning base": 
     282                    title = self.bin_ctl.GetValue() 
     283                    params["binning base"] = BINNING_OPTIONS.get(title) 
     284                    continue 
    253285                params[item[0]] = float(item[1].GetValue()) 
    254286                item[1].SetBackgroundColour( 
Note: See TracChangeset for help on using the changeset viewer.