1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
#Include
source chauffage.tcl
#Declaration des variables globales
#Tableau des jours
set tab_jour(lundi) "jour semaine"
set tab_jour(mardi) "jour semaine"
set tab_jour(mercredi) "jour semaine"
set tab_jour(jeudi) "jour semaine"
set tab_jour(vendredi) "jour semaine"
set tab_jour(samedi) "jour week-end"
set tab_jour(dimanche) "jour week-end"
#Liste des types_jour
set liste_types_jour [ list "jour semaine" "jour week end" ]
#Variables de NoNo
set est_prog_par_semaine t
set type_choisi vacance
set liste_types_semaine [ list "vacance" "periode_scolaire" ]
# Ecran d'accueil de l'application
wm title . Domotique
wm geometry . 1000x600+10+10
#Definition des proc
proc CreerFenetreOptions {} {
toplevel .option -background #bfd7ff
wm title .option Options
wm geometry .option 1000x600+10+10
label .option.text -text "Il n'y a rien de codé pour cette fenetre ..." -justify center -background #bfd7ff
place .option.text -relx 0.41 -rely 0.47
button .option.quit -text Quitter -command {destroy .option} -bg #93c2ff -activebackground #ffdb73
pack .option.quit -side bottom
}
#Definition des frames
frame .header -bd 2 -relief groove -background #bfd7ff
place .header -relx 0 -rely 0 -relheight 0.15 -relwidth 1
frame .ecran -bd 0
place .ecran -relx 0 -rely 0.15 -relheight 0.85 -relwidth 1
frame .ecran.chauffage -bd 0 -background #bfd7ff
place .ecran.chauffage -relx 0 -rely 0 -relheight 0.5 -relwidth 0.5
frame .ecran.jardin -bd 0 -background #bfd7ff
place .ecran.jardin -relx 0 -rely 0.5 -relheight 0.5 -relwidth 0.5
frame .ecran.app -bd 0 -background #bfd7ff
place .ecran.app -relx 0.5 -rely 0.5 -relheight 0.5 -relwidth 0.5
frame .ecran.comm -bd 0 -background #bfd7ff
place .ecran.comm -relx 0.5 -rely 0 -relheight 0.5 -relwidth 0.5
#Definition du Header
label .header.title -font {helvetica 15 bold} -text Accueil -bg #bfd7ff
place .header.title -relx 0.5 -rely 0.35
button .header.options -text " Options " -command { CreerFenetreOptions } -bg #93c2ff -activebackground #ffdb73
pack .header.options -side left
#Definition de la partie Chauffage
label .ecran.chauffage.title -text "Chauffage et luminosité" -font {helvetica 14} -background #bfd7ff
place .ecran.chauffage.title -relx 0.33 -rely 0.05
button .ecran.chauffage.prog -text " Programmation " -bg #93c2ff -activebackground #ffdb73 -command { CreerFenetreChauffage }
place .ecran.chauffage.prog -relx 0.4 -rely 0.20
button .ecran.chauffage.modif_temp -text " Modification temporaire " -bg #93c2ff -activebackground #ffdb73
place .ecran.chauffage.modif_temp -relx 0.35 -rely 0.32
button .ecran.chauffage.types_temp -text " Modification des types de température " -bg #93c2ff -activebackground #ffdb73
place .ecran.chauffage.types_temp -relx 0.28 -rely 0.44
#Definition de la partie Jardin
label .ecran.jardin.title -text " Arrosage du jardin " -font {helvetica 14} -background #bfd7ff
place .ecran.jardin.title -relx 0.35 -rely 0.05
button .ecran.jardin.prog -text " Programmation " -bg #93c2ff -activebackground #ffdb73
place .ecran.jardin.prog -relx 0.4 -rely 0.20
button .ecran.jardin.modif_temp -text " Modification temporaire " -bg #93c2ff -activebackground #ffdb73
place .ecran.jardin.modif_temp -relx 0.35 -rely 0.32
#Definition de la partie communication
label .ecran.comm.title -text "Communication" -font {helvetica 14} -background #bfd7ff
place .ecran.comm.title -relx 0.36 -rely 0.05
button .ecran.comm.visio -text " Visiophone " -bg #93c2ff -activebackground #ffdb73
place .ecran.comm.visio -relx 0.4 -rely 0.20
button .ecran.comm.inter -text " Interphone " -bg #93c2ff -activebackground #ffdb73
place .ecran.comm.inter -relx 0.4 -rely 0.32
#Definition de la partie Appareils menagers
label .ecran.app.title -text "Appareils ménagers" -font {helvetica 14} -background #bfd7ff
place .ecran.app.title -relx 0.35 -rely 0.05
button .ecran.app.prog -text " Programmation " -bg #93c2ff -activebackground #ffdb73
place .ecran.app.prog -relx 0.4 -rely 0.20
button .ecran.app.aff -text " Affichage des taches " -bg #93c2ff -activebackground #ffdb73
place .ecran.app.aff -relx 0.37 -rely 0.32
#Bouton Quitter, pour faciliter le codage :P
button .ecran.jardin.quit -text Quitter -command { exit }
pack .ecran.jardin.quit -side bottom |
Partager