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
d9aaca3e
Commit
d9aaca3e
authored
5 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
replace values['_DEVICE_'] with device after selection
parent
82ae38ea
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
+8
-7
8 additions, 7 deletions
oceano.py
with
8 additions
and
7 deletions
oceano.py
+
8
−
7
View file @
d9aaca3e
...
@@ -90,7 +90,7 @@ def defineGUI():
...
@@ -90,7 +90,7 @@ def defineGUI():
tooltip
=
'
Choose one or more files
'
)],
tooltip
=
'
Choose one or more files
'
)],
[
sg
.
Combo
(
list
(
ti
.
keys
()),
enable_events
=
True
,
size
=
(
8
,
1
),
# row 2
[
sg
.
Combo
(
list
(
ti
.
keys
()),
enable_events
=
True
,
size
=
(
8
,
1
),
# row 2
default_value
=
instrument_default_value
,
default_value
=
instrument_default_value
,
key
=
'
_
COMBO
_
'
,
tooltip
=
'
Select the instrument
'
)],
key
=
'
_
DEVICE
_
'
,
tooltip
=
'
Select the instrument
'
)],
[
sg
.
Frame
(
d
,
frameLayout
[
d
],
key
=
'
_FRAME_{:s}
'
.
format
(
d
)
,
visible
=
True
)
# row 3
[
sg
.
Frame
(
d
,
frameLayout
[
d
],
key
=
'
_FRAME_{:s}
'
.
format
(
d
)
,
visible
=
True
)
# row 3
for
d
in
devices
],
for
d
in
devices
],
[
sg
.
OK
(),
sg
.
CloseButton
(
'
Cancel
'
)]])
# row 4
[
sg
.
OK
(),
sg
.
CloseButton
(
'
Cancel
'
)]])
# row 4
...
@@ -185,7 +185,7 @@ if __name__ == "__main__":
...
@@ -185,7 +185,7 @@ if __name__ == "__main__":
# setup the GUI windows Layout
# setup the GUI windows Layout
window
=
defineGUI
()
window
=
defineGUI
()
device
=
window
.
FindElement
(
'
_
COMBO
_
'
).
DefaultValue
device
=
window
.
FindElement
(
'
_
DEVICE
_
'
).
DefaultValue
keys
=
cfg
[
'
split
'
][
device
.
lower
()].
keys
()
keys
=
cfg
[
'
split
'
][
device
.
lower
()].
keys
()
# can't update combo with FindElement('_HIDDEN_').Update(), we use this function
# can't update combo with FindElement('_HIDDEN_').Update(), we use this function
...
@@ -224,11 +224,12 @@ if __name__ == "__main__":
...
@@ -224,11 +224,12 @@ if __name__ == "__main__":
continue
continue
break
break
if
event
==
'
_
COMBO
_
'
:
if
event
==
'
_
DEVICE
_
'
:
# you have to go into the bowels of the pygi code, to get the instance of the 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.
# by the line and column number of the window to update its "fileType" property.
device
=
values
[
'
_DEVICE_
'
]
updateFilesBrowseCombo
(
updateFilesBrowseCombo
(
ti
[
values
[
'
_COMBO_
'
]
],
filesBrowsePosition_column
,
filesBrowsePosition_row
)
ti
[
device
],
filesBrowsePosition_column
,
filesBrowsePosition_row
)
# update the Multilines instance from FilesBrowse return
# update the Multilines instance from FilesBrowse return
if
event
==
'
_HIDDEN_
'
:
if
event
==
'
_HIDDEN_
'
:
...
@@ -246,14 +247,14 @@ if __name__ == "__main__":
...
@@ -246,14 +247,14 @@ if __name__ == "__main__":
for
k
in
values
.
keys
():
for
k
in
values
.
keys
():
if
k
[
0
]
==
'
_
'
or
values
[
k
]
==
False
:
if
k
[
0
]
==
'
_
'
or
values
[
k
]
==
False
:
continue
continue
# check if
values['_COMBO_']
== device
# check if
device
== device
if
not
values
[
'
_COMBO_
'
]
in
k
:
if
not
device
in
k
:
continue
continue
else
:
else
:
args
.
keys
.
append
(
re
.
sub
(
'
_\w+$
'
,
''
,
k
))
args
.
keys
.
append
(
re
.
sub
(
'
_\w+$
'
,
''
,
k
))
# process of files start here
# process of files start here
fe
=
process
(
args
,
cfg
,
values
[
'
_COMBO_
'
]
)
fe
=
process
(
args
,
cfg
,
device
)
# display result in popup GUI
# display result in popup GUI
dims
=
"
Dimensions: {} x {}
"
.
format
(
fe
.
n
,
fe
.
m
)
dims
=
"
Dimensions: {} x {}
"
.
format
(
fe
.
n
,
fe
.
m
)
...
...
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