2021-07-17 19:30:16 +02:00
|
|
|
@startuml Architecture_projet
|
|
|
|
package "HAL" {
|
2021-04-09 18:04:15 +02:00
|
|
|
interface "CAN Joystick" as CAN
|
|
|
|
interface "Ecran" as LCD
|
2021-07-17 19:30:16 +02:00
|
|
|
interface "GPIO" as gpio
|
|
|
|
interface "rng" as rng
|
|
|
|
}
|
2021-07-08 08:30:16 +02:00
|
|
|
Queue "Queue_J\nchoc joueur" as Queue_J
|
|
|
|
Queue "Queue_E\nchoc ennemie" as Queue_E
|
|
|
|
Queue "Queue_F\nfin du jeu" as Queue_F
|
|
|
|
Queue "Queue_N\nnouveau projectile" as Queue_N
|
2021-07-17 19:30:16 +02:00
|
|
|
|
|
|
|
package "Varriables partagées" {
|
|
|
|
component "Table_ennemis" as table <<black board>>
|
|
|
|
component "joueur" as J <<black board>>
|
|
|
|
component "Charge" as charge <<black board>>
|
|
|
|
component "LCD" as mut_lcd <<Mutex>>
|
|
|
|
}
|
|
|
|
|
|
|
|
package "Fonctions globales"{
|
|
|
|
component "Probabilité" as proba <<functions>>
|
|
|
|
component "Encapsulation LCD" as emc_lcd <<functions>>
|
|
|
|
component "Remplissage ennemis" as rempli <<function>>
|
|
|
|
component "Mise à jour des leds" as update_led <<function>>
|
|
|
|
}
|
2021-04-09 18:04:15 +02:00
|
|
|
component t_gm[
|
|
|
|
Thread : game_master
|
|
|
|
===
|
2021-07-17 19:30:16 +02:00
|
|
|
Bloqué en attente de messages
|
2021-04-09 18:04:15 +02:00
|
|
|
---
|
|
|
|
gère l'apparition des porjectiles,
|
|
|
|
gère les autres Thread,
|
|
|
|
fait l'affichage des scores
|
|
|
|
]
|
2021-07-17 19:30:16 +02:00
|
|
|
|
|
|
|
component t_HUD[
|
|
|
|
Thread : HUD
|
|
|
|
===
|
|
|
|
T = 100 ms
|
|
|
|
---
|
|
|
|
Affiche :
|
|
|
|
- La vie,
|
|
|
|
- Le numéro de la vague,
|
|
|
|
- Le nombre de monstre tué.
|
|
|
|
]
|
|
|
|
|
|
|
|
component t_chargeur[
|
|
|
|
Thread : Chargeur
|
|
|
|
===
|
|
|
|
T = 5/8 s
|
|
|
|
---
|
|
|
|
Incremente la charge
|
|
|
|
]
|
|
|
|
|
2021-04-09 18:04:15 +02:00
|
|
|
component t_j1[
|
|
|
|
Tread : joueur_1
|
|
|
|
===
|
2021-07-17 19:30:16 +02:00
|
|
|
T = 5 ms
|
2021-04-09 18:04:15 +02:00
|
|
|
---
|
|
|
|
gère le joystick,
|
|
|
|
la vie du joueur,
|
|
|
|
la position du joueur 1,
|
|
|
|
et l'affichage du joueur
|
|
|
|
]
|
|
|
|
component t_ennemie[
|
|
|
|
Tread : Ennemies
|
|
|
|
===
|
2021-07-17 19:30:16 +02:00
|
|
|
T = 200 ms
|
2021-04-09 18:04:15 +02:00
|
|
|
---
|
|
|
|
gère les ennemies
|
|
|
|
]
|
|
|
|
component t_proj[
|
|
|
|
Tread : projectile
|
|
|
|
===
|
2021-07-17 19:30:16 +02:00
|
|
|
T = 10 ms
|
2021-04-09 18:04:15 +02:00
|
|
|
---
|
|
|
|
gère les projectiles
|
|
|
|
gère les colisions
|
|
|
|
]
|
2021-07-08 08:30:16 +02:00
|
|
|
[t_j1] --( CAN : lit la valeur
|
2021-04-09 18:04:15 +02:00
|
|
|
[t_proj] --> Queue_E : touché
|
|
|
|
[t_proj] --> Queue_J : touché
|
|
|
|
Queue_E --> [t_ennemie]
|
|
|
|
Queue_J --> [t_j1]
|
|
|
|
[t_j1] --> Queue_F : plus de vie
|
|
|
|
[t_ennemie] --> Queue_F : plus d'ennemie
|
|
|
|
Queue_F --> [t_gm]
|
|
|
|
[t_gm] --> Queue_N : nouveau tire du joueur
|
|
|
|
[t_j1] --> Queue_N : nouveau tire des ennemie
|
|
|
|
Queue_N --> [t_proj]
|
|
|
|
|
2021-07-17 19:30:16 +02:00
|
|
|
[t_j1] ..> emc_lcd : use
|
|
|
|
[t_ennemie] ..> emc_lcd : use
|
|
|
|
[t_proj] ..> emc_lcd : use
|
|
|
|
[t_gm] ..> emc_lcd : use
|
2021-04-09 18:04:15 +02:00
|
|
|
|
2021-07-17 19:30:16 +02:00
|
|
|
emc_lcd .> mut_lcd : use
|
|
|
|
emc_lcd --( LCD
|
2021-04-09 18:04:15 +02:00
|
|
|
|
|
|
|
[t_gm]..>[t_j1] : suspend
|
|
|
|
[t_gm]..>[t_ennemie] : suspend
|
|
|
|
[t_gm]..>[t_proj] : suspend
|
|
|
|
|
2021-07-12 13:31:43 +02:00
|
|
|
[t_j1] ..> J : ecris
|
|
|
|
[t_ennemie] ..> table : ecris
|
|
|
|
[t_proj] ..> J : lis
|
|
|
|
[t_proj] ..> table : lis
|
2021-07-17 19:30:16 +02:00
|
|
|
|
|
|
|
t_gm ..> rempli : use
|
|
|
|
rempli ..> table : ecris
|
|
|
|
rempli ..> proba : use
|
|
|
|
|
|
|
|
t_ennemie ..> proba : use
|
|
|
|
|
|
|
|
t_j1 ..> charge : lis/ecrit
|
|
|
|
t_chargeur ..> charge : lis/ecrit
|
|
|
|
|
|
|
|
t_j1 ..> update_led : use
|
|
|
|
t_chargeur ..> update_led : use
|
|
|
|
|
|
|
|
t_j1 --( gpio
|
|
|
|
update_led --( gpio
|
|
|
|
|
|
|
|
t_HUD ..> emc_lcd : use
|
|
|
|
|
|
|
|
proba --( rng
|
2021-04-13 14:28:33 +02:00
|
|
|
@enduml
|