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
7a4102ec
Commit
7a4102ec
authored
Jun 20, 2018
by
Remi Perenon
Browse files
Adding automatic option in data loading popup
parent
1875a571
Pipeline
#3965
passed with stages
in 26 minutes and 27 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
7a4102ec
version 1.1.2
--------------
* ADDED issue #15 An automatic mode for data loading is added to compel with the fact that data filter does not appear in data loading popup on macOS
version 1.1.1
--------------
* FIXED issue #14 Package name was not valid for debian package in 1.1.0 version
...
...
MDANSE/GUI/MainFrame.py
View file @
7a4102ec
...
...
@@ -35,6 +35,7 @@ import os
import
sys
import
webbrowser
import
wx
import
wx.aui
as
aui
...
...
@@ -225,8 +226,20 @@ class MainFrame(wx.Frame):
self
.
Bind
(
wx
.
EVT_MENU
,
self
.
on_bug_report
,
bugButton
)
def
load_data
(
self
,
typ
,
filename
):
data
=
REGISTRY
[
"input_data"
][
typ
](
filename
)
if
typ
==
"automatic"
:
# if type is set on automatic, find data type
if
filename
[
-
4
:]
==
".mvi"
:
# File is mvi
typ
=
"molecular_viewer"
data
=
REGISTRY
[
"input_data"
][
"molecular_viewer"
](
filename
)
else
:
# File is either netcdf or mmtk
try
:
data
=
REGISTRY
[
"input_data"
][
"mmtk_trajectory"
](
filename
)
except
KeyError
:
data
=
REGISTRY
[
"input_data"
][
"netcdf_data"
](
filename
)
else
:
data
=
REGISTRY
[
"input_data"
][
typ
](
filename
)
DATA_CONTROLLER
[
data
.
filename
]
=
data
...
...
@@ -305,15 +318,18 @@ Authors:
def
on_load_data
(
self
,
event
=
None
):
wildcards
=
collections
.
OrderedDict
([
kls
.
_type
,
"%s (*.%s)|*.%s"
%
(
kls
.
_type
,
kls
.
extension
,
kls
.
extension
)]
for
kls
in
REGISTRY
[
"input_data"
].
values
()
if
kls
.
extension
is
not
None
)
dialog
=
wx
.
FileDialog
(
None
,
message
=
'Open data ...'
,
wildcard
=
"|"
.
join
(
wildcards
.
values
()),
style
=
wx
.
OPEN
)
dialog
=
wx
.
FileDialog
(
None
,
message
=
'Open data ...'
,
wildcard
=
"automatic (*.mvi,*.nc)|*.mvi;*.nc|"
+
"|"
.
join
(
wildcards
.
values
()),
style
=
wx
.
OPEN
)
if
dialog
.
ShowModal
()
==
wx
.
ID_CANCEL
:
return
""
idx
=
dialog
.
GetFilterIndex
()
dataType
=
wildcards
.
keys
()[
idx
]
# Check if automatic has been chosen
if
idx
<=
0
:
dataType
=
"automatic"
else
:
dataType
=
wildcards
.
keys
()[
idx
-
1
]
filename
=
dialog
.
GetPath
()
...
...
MDANSE/__pkginfo__.py
View file @
7a4102ec
...
...
@@ -25,9 +25,9 @@ __repo__ = "https://code.ill.fr/scientific-software/mdanse/"
__license__
=
"GPL 3"
__version__
=
"1.1.
1
"
__version__
=
"1.1.
2
"
__date__
=
"
14
-06-2018"
__date__
=
"
20
-06-2018"
__commit__
=
"undefined"
...
...
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