Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyAmak - IHM
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
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
SMAC
AMAK
Python
PyAMAK
pyAmak - IHM
Commits
8f9d1f01
Commit
8f9d1f01
authored
4 years ago
by
Jdrezen
Browse files
Options
Downloads
Patches
Plain Diff
Ajout d'une barre de menu pour sauvegarder l'état du système
parent
655da331
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pyAmakIHM/classes/controleur.py
+3
-3
3 additions, 3 deletions
pyAmakIHM/classes/controleur.py
pyAmakIHM/classes/fenetre.py
+20
-1
20 additions, 1 deletion
pyAmakIHM/classes/fenetre.py
pyAmakIHM/classes/panelCommandes.py
+0
-10
0 additions, 10 deletions
pyAmakIHM/classes/panelCommandes.py
with
23 additions
and
14 deletions
pyAmakIHM/classes/controleur.py
+
3
−
3
View file @
8f9d1f01
...
@@ -237,11 +237,11 @@ class Controleur:
...
@@ -237,11 +237,11 @@ class Controleur:
"""
"""
Save the current state
Save the current state
"""
"""
def
updateSave
(
self
)
->
None
:
def
updateSave
(
self
,
filename
:
str
)
->
None
:
self
.
__scheduler
.
save
()
if
not
(
filename
is
None
):
self
.
__scheduler
.
save
()
def
updateCycle
(
self
)
->
None
:
def
updateCycle
(
self
)
->
None
:
self
.
updateWindow
()
try
:
try
:
self
.
updateWindow
()
self
.
updateWindow
()
except
:
except
:
...
...
This diff is collapsed.
Click to expand it.
pyAmakIHM/classes/fenetre.py
+
20
−
1
View file @
8f9d1f01
...
@@ -5,7 +5,8 @@ Class Fenetre
...
@@ -5,7 +5,8 @@ Class Fenetre
import
os
,
sys
import
os
,
sys
import
pathlib
import
pathlib
from
tkinter.ttk
import
LabelFrame
from
tkinter.ttk
import
LabelFrame
from
tkinter
import
ttk
,
Tk
,
PanedWindow
,
BOTTOM
from
tkinter
import
ttk
,
Tk
,
PanedWindow
,
BOTTOM
,
Menu
from
tkinter.filedialog
import
askopenfilename
sys
.
path
.
insert
(
0
,
str
(
pathlib
.
Path
(
__file__
).
parent
))
sys
.
path
.
insert
(
0
,
str
(
pathlib
.
Path
(
__file__
).
parent
))
...
@@ -39,6 +40,15 @@ class Fenetre :
...
@@ -39,6 +40,15 @@ class Fenetre :
self
.
__root
.
geometry
(
"
1000x700
"
)
self
.
__root
.
geometry
(
"
1000x700
"
)
menubar
=
Menu
(
self
.
__root
)
filemenu
=
Menu
(
menubar
,
tearoff
=
0
)
filemenu
.
add_command
(
label
=
"
Save
"
,
command
=
self
.
notifyAboutSave
)
menubar
.
add_cascade
(
label
=
"
File
"
,
menu
=
filemenu
)
self
.
__root
.
config
(
menu
=
menubar
)
self
.
__panelCommandes
=
PanelCommandes
(
self
.
__root
)
self
.
__panelCommandes
=
PanelCommandes
(
self
.
__root
)
self
.
__division
=
PanedWindow
(
self
.
__root
,
orient
=
'
vertical
'
,
showhandle
=
True
,
handlesize
=
10
)
self
.
__division
=
PanedWindow
(
self
.
__root
,
orient
=
'
vertical
'
,
showhandle
=
True
,
handlesize
=
10
)
...
@@ -293,6 +303,9 @@ class Fenetre :
...
@@ -293,6 +303,9 @@ class Fenetre :
self
.
__observer
.
updateClosing
()
self
.
__observer
.
updateClosing
()
for
pan
in
self
.
__panelGraphiques
:
for
pan
in
self
.
__panelGraphiques
:
pan
.
quit
()
pan
.
quit
()
self
.
__panelVue
.
quit
()
self
.
__panelCommandes
.
quit
()
self
.
__panel_log
.
quit
()
self
.
__root
.
quit
()
self
.
__root
.
quit
()
"""
"""
...
@@ -309,3 +322,9 @@ class Fenetre :
...
@@ -309,3 +322,9 @@ class Fenetre :
"""
"""
def
errorDisplay
(
self
,
typeError
:
str
,
message
:
str
)
->
None
:
def
errorDisplay
(
self
,
typeError
:
str
,
message
:
str
)
->
None
:
self
.
__panel_log
.
errorDisplay
(
typeError
,
message
)
self
.
__panel_log
.
errorDisplay
(
typeError
,
message
)
"""
"""
def
notifyAboutSave
(
self
):
fileName
=
askopenfilename
(
filetypes
=
[(
'
Pickle Files
'
,
'
*.pickle
'
)])
self
.
__observer
.
updateSave
(
fileName
)
This diff is collapsed.
Click to expand it.
pyAmakIHM/classes/panelCommandes.py
+
0
−
10
View file @
8f9d1f01
...
@@ -24,19 +24,12 @@ class PanelCommandes(LabelFrame):
...
@@ -24,19 +24,12 @@ class PanelCommandes(LabelFrame):
bouttonStartStop
=
Button
(
self
,
text
=
'
start/stop
'
,
height
=
2
,
command
=
self
.
notifyObserverAboutStartStop
)
bouttonStartStop
=
Button
(
self
,
text
=
'
start/stop
'
,
height
=
2
,
command
=
self
.
notifyObserverAboutStartStop
)
bouttonStartStop
.
pack
(
side
=
'
top
'
,
fill
=
'
x
'
)
bouttonStartStop
.
pack
(
side
=
'
top
'
,
fill
=
'
x
'
)
bouttonSaveState
=
Button
(
self
,
text
=
'
save state
'
,
height
=
2
,
command
=
self
.
notifyObserverAboutSave
)
bouttonSaveState
.
pack
(
side
=
'
top
'
,
fill
=
'
x
'
)
frameBoutons
=
Frame
(
self
)
frameBoutons
=
Frame
(
self
)
frameBoutons
.
pack
(
side
=
'
bottom
'
,
fill
=
'
x
'
)
frameBoutons
.
pack
(
side
=
'
bottom
'
,
fill
=
'
x
'
)
frameBoutonAux
=
Frame
(
self
)
frameBoutonAux
=
Frame
(
self
)
frameBoutonAux
.
pack
(
side
=
'
top
'
)
frameBoutonAux
.
pack
(
side
=
'
top
'
)
for
i
in
range
(
20
):
Button
(
self
,
text
=
'
Aux
'
,
height
=
2
).
pack
(
fill
=
'
x
'
)
self
.
__slider
=
Scale
(
frameBoutons
,
orient
=
'
horizontal
'
,
from_
=
1
,
to
=
10
,
command
=
self
.
notifyObserverAboutScale
)
self
.
__slider
=
Scale
(
frameBoutons
,
orient
=
'
horizontal
'
,
from_
=
1
,
to
=
10
,
command
=
self
.
notifyObserverAboutScale
)
self
.
__slider
.
pack
(
side
=
'
bottom
'
,
fill
=
'
x
'
)
self
.
__slider
.
pack
(
side
=
'
bottom
'
,
fill
=
'
x
'
)
...
@@ -65,9 +58,6 @@ class PanelCommandes(LabelFrame):
...
@@ -65,9 +58,6 @@ class PanelCommandes(LabelFrame):
def
notifyObserverAboutStartStop
(
self
)
->
None
:
def
notifyObserverAboutStartStop
(
self
)
->
None
:
self
.
__observer
.
updateStartStop
()
self
.
__observer
.
updateStartStop
()
def
notifyObserverAboutSave
(
self
)
->
None
:
self
.
__observer
.
updateSave
()
"""
"""
Notify the observer that the scale has change its value and give the current value
Notify the observer that the scale has change its value and give the current value
"""
"""
...
...
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