Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
MDANSE
Commits
cd27c20d
Commit
cd27c20d
authored
Jun 11, 2015
by
eric pellegrini
Browse files
Bug fix in instrument resolution dialog
parent
4d86026e
Changes
4
Hide whitespace changes
Inline
Side-by-side
MDANSE/App/GUI/ComboWidgets/ConfigurationPanel.py
View file @
cd27c20d
...
...
@@ -48,7 +48,7 @@ class ConfigurationPanel(wx.Panel):
w
.
Refresh
()
try
:
self
.
_configura
tion
.
parameters
=
self
.
get_value
()
self
.
_configura
ble
.
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
()
...
...
MDANSE/App/GUI/Framework/Widgets/InstrumentResolutionWidget.py
View file @
cd27c20d
...
...
@@ -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
)
...
...
MDANSE/Framework/InstrumentResolutions/IInstrumentResolution.py
View file @
cd27c20d
...
...
@@ -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
...
...
MDANSE/Framework/UserDefinitionsStore.py
View file @
cd27c20d
...
...
@@ -107,10 +107,10 @@ 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
):
if
not
self
.
has_key
(
target
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment