Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyAVA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor 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
Loic Lehnhoff
PyAVA
Commits
89f35aab
Commit
89f35aab
authored
1 year ago
by
Loïc Lehnhoff
Browse files
Options
Downloads
Patches
Plain Diff
Added saving of parameters & improved popup clarity
parent
3ea89a17
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
interface.py
+18
-3
18 additions, 3 deletions
interface.py
with
18 additions
and
3 deletions
interface.py
+
18
−
3
View file @
89f35aab
...
...
@@ -299,10 +299,10 @@ class App(object):
self
.
root
.
mainloop
()
def
on_close
(
self
):
save
=
Popup
(
prompt
=
"
Save and exit?
"
,
options
=
[
"
Yes
"
,
"
No
"
,
"
Cancel
"
]).
pressed
save
=
Popup
(
prompt
=
"
Save and exit?
"
,
options
=
[
"
Yes
"
,
"
Exit without saving
"
,
"
Cancel
"
]).
pressed
if
save
==
"
Yes
"
:
self
.
_quit
()
if
save
==
"
No
"
:
if
save
==
"
Exit without saving
"
:
self
.
root
.
quit
()
self
.
root
.
destroy
()
else
:
...
...
@@ -763,10 +763,25 @@ class App(object):
-------
None : Saves coords in a json file, quits and destroys root.
"""
# save results
save_dict
(
self
.
klicker
.
coords
,
self
.
DIR_OUT
,
os
.
path
.
basename
(
self
.
WAVEFILE
)[:
-
4
]
+
"
-contours.json
"
)
# save parameters
save_dict
(
{
"
PCEN
"
:
(
self
.
switch_view_button
[
'
text
'
]
==
"
Switch to PCEN
"
),
"
SR
"
:
self
.
NEW_SR
,
"
NFFT
"
:
self
.
NFFT
,
"
HOP_LENGTH
"
:
self
.
HOP_LENGTH
,
"
CLIPPING
"
:
self
.
CLIPPING
},
os
.
path
.
join
(
self
.
DIR_OUT
,
"
parameters
"
),
os
.
path
.
basename
(
self
.
WAVEFILE
)[:
-
4
]
+
"
-params.json
"
)
# quit window
self
.
root
.
quit
()
self
.
root
.
destroy
()
\ No newline at end of file
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