Commit cd27c20d authored by eric pellegrini's avatar eric pellegrini
Browse files

Bug fix in instrument resolution dialog

parent 4d86026e
......@@ -48,7 +48,7 @@ class ConfigurationPanel(wx.Panel):
w.Refresh()
try:
self._configuration.parameters = self.get_value()
self._configurable.parameters = self.get_value()
except ConfiguratorError as e:
d = wx.MessageDialog(self, str(e), style=wx.ICON_ERROR|wx.STAY_ON_TOP|wx.CENTRE)
d.ShowModal()
......
......@@ -73,7 +73,7 @@ class InstrumentResolutionDialog(wx.Dialog):
sb = wx.StaticBox(self, wx.ID_ANY, label="kernel")
sbSizer = wx.StaticBoxSizer(sb, wx.HORIZONTAL)
self._kernelChoice = wx.Choice(self, wx.ID_ANY, choices=REGISTRY["instrumentresolution"].keys())
self._kernelChoice = wx.Choice(self, wx.ID_ANY, choices=REGISTRY["instrument_resolution"].keys())
self._kernelChoice.SetSelection(0)
sbSizer.Add(self._kernelChoice, 1, wx.ALL|wx.EXPAND, 5)
sizer.Add(sbSizer, (0,0), flag=wx.EXPAND)
......@@ -142,11 +142,13 @@ class InstrumentResolutionDialog(wx.Dialog):
if not self._parametersPanel.validate():
return
kernelClass = REGISTRY["instrumentresolution"][self._currentKernel]
kernelClass = REGISTRY["instrument_resolution"][self._currentKernel]
resolution = kernelClass()
resolution.set_kernel(self._frequencies, self._timeStep,self._parametersPanel.get_value())
resolution.setup(self._parametersPanel.get_value())
resolution.set_kernel(self._frequencies, self._timeStep)
self._axis.clear()
......@@ -169,11 +171,11 @@ class InstrumentResolutionDialog(wx.Dialog):
self._parametersSizer.Clear(deleteWindows=True)
resolution = REGISTRY["instrumentresolution"][kernelName]()
resolution = REGISTRY["instrument_resolution"][kernelName]()
self.Freeze()
self._parametersPanel = ConfigurationPanel(self, resolution.configuration)
self._parametersPanel = ConfigurationPanel(self, resolution)
self._parametersSizer.Add(self._parametersPanel, 0, wx.ALL|wx.EXPAND, 5)
......
......@@ -54,7 +54,7 @@ class IInstrumentResolution(Configurable):
self._timeWindow = None
@abc.abstractmethod
def set_kernel(self, frequencies, dt, parameters=None):
def set_kernel(self, frequencies, dt):
pass
@property
......
......@@ -107,9 +107,9 @@ class UserDefinitionsStore(dict):
self.setdefault(target,{}).setdefault(section,{})[name] = value
def filter(self,target,typ):
def filter(self,target,section):
return [k for k,v in self.iteritems() if (v.target==target and v.type==typ)]
return self.get(target,{}).get(section,{}).keys()
def has_definition(self,target,section,name):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment