Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Oceano2python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
US191
Oceano2python
Commits
6a18ae74
Commit
6a18ae74
authored
5 years ago
by
jacques Grelet
Browse files
Options
Downloads
Patches
Plain Diff
add extention as lower and upper
use a list for ti next time
parent
a1515006
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
oceano.py
+16
-7
16 additions, 7 deletions
oceano.py
with
16 additions
and
7 deletions
oceano.py
+
16
−
7
View file @
6a18ae74
...
...
@@ -11,7 +11,7 @@ import os
import
distutils.util
as
du
# typeInstrument is a dictionary as key: files extension
typeInstrument
=
{
'
CTD
'
:
'
cnv
'
,
'
XBT
'
:
'
edf
'
,
'
LADCP
'
:
'
lad
'
,
'
TSG
'
:
'
COLCOR
'
}
typeInstrument
=
{
'
CTD
'
:
'
CNV
'
,
'
XBT
'
:
'
EDF
'
,
'
LADCP
'
:
'
LAD
'
,
'
TSG
'
:
'
COLCOR
'
}
ti
=
typeInstrument
# an alias
...
...
@@ -51,8 +51,10 @@ def defineGUI():
enable_events
=
True
),
sg
.
FilesBrowse
(
key
=
'
_HIDDEN_
'
,
tooltip
=
'
Choose one or more files
'
,
initial_folder
=
'
data/{}
'
.
format
(
ti
[
device
]),
file_types
=
((
"
{} files
"
.
format
(
ti
[
device
]),
"
*.{}
"
.
format
(
ti
[
device
])),))],
initial_folder
=
'
data/{}
'
.
format
(
ti
[
device
].
lower
()),
)],
# file_types=(("{} files".format(ti[device]), "*.{}".format(ti[device])),))],
[
sg
.
Combo
(
list
(
ti
.
keys
()),
enable_events
=
True
,
key
=
'
_COMBO_
'
,
tooltip
=
'
Select the instrument
'
)],
*
[[
sg
.
Checkbox
(
k
,
key
=
k
,
...
...
@@ -67,6 +69,14 @@ def defineGUI():
return
window
def
updateFilesBrowseCombo
(
extention
):
e
=
window
.
Rows
[
1
][
2
]
e
.
FileTypes
=
((
"
{} files
"
.
format
(
extention
),
"
*.{}
"
.
format
(
extention
)),
(
"
{} files
"
.
format
(
extention
.
lower
()),
"
*.{}
"
.
format
(
extention
.
lower
())))
window
.
Finalize
def
process
(
args
,
cfg
,
ti
):
'''
Extract data from ASCII files and return FileExtractor instannce and array size of extracted data
...
...
@@ -127,7 +137,9 @@ if __name__ == "__main__":
# test arguements from sys.argv, args is never to None with default option set
if
args
.
gui
or
len
(
sys
.
argv
)
==
1
:
# setup the GUI windows Layout
window
=
defineGUI
()
updateFilesBrowseCombo
(
ti
[
device
])
# main GUI loop
while
True
:
...
...
@@ -144,10 +156,7 @@ if __name__ == "__main__":
if
event
is
'
_COMBO_
'
:
# you have to go into the bowels of the pygi code, to get the instance of the Combo
# by the line and column number of the window to update its "fileType" property.
e
=
window
.
Rows
[
1
][
2
]
e
.
FileTypes
=
((
"
{} files
"
.
format
(
ti
[
values
[
'
_COMBO_
'
]]),
"
*.{}
"
.
format
(
ti
[
values
[
'
_COMBO_
'
]])),)
window
.
Finalize
updateFilesBrowseCombo
(
ti
[
values
[
'
_COMBO_
'
]])
# update the Multilines instance from FilesBrowse return
if
event
is
'
_HIDDEN_
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment