-
Notifications
You must be signed in to change notification settings - Fork 0
/
HomeAutomation.tcl.bak4
373 lines (355 loc) · 16.2 KB
/
HomeAutomation.tcl.bak4
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
#############################################################################
# Generated by PAGE version 4.22
# in conjunction with Tcl version 8.6
# Apr 25, 2019 04:13:45 PM +0530 platform: Windows NT
set vTcl(timestamp) ""
#############################################################################
## vTcl Code to Load User Images see vTcl:save2 in file.tcl
catch {package require Img}
foreach img {
{{[file join D:/ {Algorithmic Electronics Projects} {Python Home Automation} images mic1.png]} {user image} user {}}
{{[file join D:/ {Algorithmic Electronics Projects} {Python Home Automation} images mic.png]} {user image} user {}}
} {
# from vTcl:image:dump_create_image_footer
eval set _file [lindex $img 0]
vTcl:image:create_new_image\
$_file [lindex $img 1] [lindex $img 2] [lindex $img 3]
}
if {!$vTcl(borrow)} {
set vTcl(actual_gui_bg) #d9d9d9
set vTcl(actual_gui_fg) #000000
set vTcl(actual_gui_analog) #ececec
set vTcl(actual_gui_menu_analog) #ececec
set vTcl(actual_gui_menu_bg) #d9d9d9
set vTcl(actual_gui_menu_fg) #000000
set vTcl(complement_color) #d9d9d9
set vTcl(analog_color_p) #d9d9d9
set vTcl(analog_color_m) #ececec
set vTcl(active_fg) #000000
set vTcl(actual_gui_menu_active_bg) #ececec
set vTcl(active_menu_fg) #000000
}
# vTcl Code to Load User Fonts
vTcl:font:add_font \
"-family {Segoe UI} -size 14 -weight bold -slant roman -underline 0 -overstrike 0" \
user \
vTcl:font10
vTcl:font:add_font \
"-family {Segoe UI Symbol} -size 22 -weight bold -slant roman -underline 0 -overstrike 0" \
user \
vTcl:font9
#################################
#LIBRARY PROCEDURES
#
if {[info exists vTcl(sourcing)]} {
proc vTcl:project:info {} {
set base .top42
global vTcl
set base $vTcl(btop)
if {$base == ""} {
set base .top42
}
namespace eval ::widgets::$base {
set dflt,origin 0
set runvisible 1
}
namespace eval ::widgets_bindings {
set tagslist _TopLevel
}
namespace eval ::vTcl::modules::main {
set procs {
}
set compounds {
}
set projectType single
}
}
}
#################################
# GENERATED GUI PROCEDURES
#
proc vTclWindow.top42 {base} {
if {$base == ""} {
set base .top42
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
set top $base
###################
# CREATING WIDGETS
###################
vTcl::widgets::core::toplevel::createCmd $top -class Toplevel \
-background {#d9d9d9} -highlightcolor {#63131e}
wm focusmodel $top passive
wm geometry $top 600x450+497+136
update
# set in toplevel.wgt.
global vTcl
global img_list
set vTcl(save,dflt,origin) 0
wm maxsize $top 1370 750
wm minsize $top 116 1
wm overrideredirect $top 0
wm resizable $top 1 1
wm deiconify $top
wm title $top "Home Automation"
vTcl:DefineAlias "$top" "Toplevel1" vTcl:Toplevel:WidgetProc "" 1
frame $top.fra43 \
-borderwidth 2 -relief groove -background {#d9d9d9} -height 75 \
-width 895
vTcl:DefineAlias "$top.fra43" "Frame1" vTcl:WidgetProc "Toplevel1" 1
set site_3_0 $top.fra43
label $site_3_0.lab44 \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI Symbol} -size 22 -weight bold} \
-foreground {#000000} \
-text {Home Automation Using Google Speech to Text Conversion}
vTcl:DefineAlias "$site_3_0.lab44" "Label1" vTcl:WidgetProc "Toplevel1" 1
place $site_3_0.lab44 \
-in $site_3_0 -x 30 -y 10 -width 843 -relwidth 0 -height 50 \
-relheight 0 -anchor nw -bordermode ignore
frame $top.fra45 \
-borderwidth 2 -relief groove -background {#d9d9d9} -height 185 \
-width 305
vTcl:DefineAlias "$top.fra45" "Frame2" vTcl:WidgetProc "Toplevel1" 1
set site_3_0 $top.fra45
label $site_3_0.lab50 \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -text {Bed Room}
vTcl:DefineAlias "$site_3_0.lab50" "Label2" vTcl:WidgetProc "Toplevel1" 1
button $site_3_0.but54 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -pady 0 -text ON
vTcl:DefineAlias "$site_3_0.but54" "bed_on" vTcl:WidgetProc "Toplevel1" 1
button $site_3_0.but55 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -pady 0 -text OFF
vTcl:DefineAlias "$site_3_0.but55" "bed_off" vTcl:WidgetProc "Toplevel1" 1
place $site_3_0.lab50 \
-in $site_3_0 -x 90 -y 20 -width 104 -relwidth 0 -height 31 \
-relheight 0 -anchor nw -bordermode ignore
place $site_3_0.but54 \
-in $site_3_0 -x 20 -y 100 -width 107 -relwidth 0 -height 54 \
-relheight 0 -anchor nw -bordermode ignore
place $site_3_0.but55 \
-in $site_3_0 -x 180 -y 100 -width 107 -height 54 -anchor nw \
-bordermode ignore
frame $top.fra46 \
-borderwidth 2 -relief groove -background {#d9d9d9} -height 185 \
-highlightbackground {#d9d9d9} -highlightcolor black -width 305
vTcl:DefineAlias "$top.fra46" "Frame2_1" vTcl:WidgetProc "Toplevel1" 1
set site_3_0 $top.fra46
frame $site_3_0.fra47 \
-borderwidth 2 -relief groove -background {#d9d9d9} -height 125 \
-highlightbackground {#d9d9d9} -highlightcolor black -width 295
vTcl:DefineAlias "$site_3_0.fra47" "Frame2_2" vTcl:WidgetProc "Toplevel1" 1
label $site_3_0.lab51 \
-activebackground {#f9f9f9} -activeforeground black \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -text {Living Room}
vTcl:DefineAlias "$site_3_0.lab51" "Label2_5" vTcl:WidgetProc "Toplevel1" 1
button $site_3_0.but58 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -pady 0 -text ON
vTcl:DefineAlias "$site_3_0.but58" "living_on" vTcl:WidgetProc "Toplevel1" 1
button $site_3_0.but59 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -pady 0 -text OFF
vTcl:DefineAlias "$site_3_0.but59" "living_off" vTcl:WidgetProc "Toplevel1" 1
place $site_3_0.fra47 \
-in $site_3_0 -x 64 -y 182 -width 295 -relwidth 0 -height 125 \
-relheight 0 -anchor nw -bordermode ignore
place $site_3_0.lab51 \
-in $site_3_0 -x 80 -y 10 -width 124 -relwidth 0 -height 31 \
-relheight 0 -anchor nw -bordermode ignore
place $site_3_0.but58 \
-in $site_3_0 -x 20 -y 100 -width 107 -height 54 -anchor nw \
-bordermode ignore
place $site_3_0.but59 \
-in $site_3_0 -x 180 -y 100 -width 107 -height 54 -anchor nw \
-bordermode ignore
frame $top.fra48 \
-borderwidth 2 -relief groove -background {#d9d9d9} -height 185 \
-highlightbackground {#d9d9d9} -highlightcolor black -width 305
vTcl:DefineAlias "$top.fra48" "Frame2_2" vTcl:WidgetProc "Toplevel1" 1
set site_3_0 $top.fra48
frame $site_3_0.fra47 \
-borderwidth 2 -relief groove -background {#d9d9d9} -height 115 \
-highlightbackground {#d9d9d9} -highlightcolor black -width 295
vTcl:DefineAlias "$site_3_0.fra47" "Frame2_3" vTcl:WidgetProc "Toplevel1" 1
label $site_3_0.lab52 \
-activebackground {#f9f9f9} -activeforeground black \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -text Kitchen
vTcl:DefineAlias "$site_3_0.lab52" "Label2_6" vTcl:WidgetProc "Toplevel1" 1
button $site_3_0.but56 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -pady 0 -text ON
vTcl:DefineAlias "$site_3_0.but56" "kitchen_on" vTcl:WidgetProc "Toplevel1" 1
button $site_3_0.but57 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -pady 0 -text OFF
vTcl:DefineAlias "$site_3_0.but57" "kitchen_off" vTcl:WidgetProc "Toplevel1" 1
place $site_3_0.fra47 \
-in $site_3_0 -x 64 -y 192 -width 295 -relwidth 0 -height 115 \
-relheight 0 -anchor nw -bordermode ignore
place $site_3_0.lab52 \
-in $site_3_0 -x 90 -y 10 -width 104 -height 31 -anchor nw \
-bordermode ignore
place $site_3_0.but56 \
-in $site_3_0 -x 20 -y 100 -width 107 -height 54 -anchor nw \
-bordermode ignore
place $site_3_0.but57 \
-in $site_3_0 -x 180 -y 100 -width 107 -height 54 -anchor nw \
-bordermode ignore
frame $top.fra49 \
-borderwidth 2 -relief groove -background {#d9d9d9} -height 185 \
-highlightbackground {#d9d9d9} -highlightcolor black -width 305
vTcl:DefineAlias "$top.fra49" "Frame2_3" vTcl:WidgetProc "Toplevel1" 1
set site_3_0 $top.fra49
frame $site_3_0.fra47 \
-borderwidth 2 -relief groove -background {#d9d9d9} -height 115 \
-highlightbackground {#d9d9d9} -highlightcolor black -width 295
vTcl:DefineAlias "$site_3_0.fra47" "Frame2_4" vTcl:WidgetProc "Toplevel1" 1
label $site_3_0.lab53 \
-activebackground {#f9f9f9} -activeforeground black \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -text Balcony
vTcl:DefineAlias "$site_3_0.lab53" "Label2_7" vTcl:WidgetProc "Toplevel1" 1
button $site_3_0.but60 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -pady 0 -text ON
vTcl:DefineAlias "$site_3_0.but60" "balcony_on" vTcl:WidgetProc "Toplevel1" 1
button $site_3_0.but61 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -pady 0 -text OFF
vTcl:DefineAlias "$site_3_0.but61" "balcony_off" vTcl:WidgetProc "Toplevel1" 1
place $site_3_0.fra47 \
-in $site_3_0 -x 64 -y 192 -width 295 -relwidth 0 -height 115 \
-relheight 0 -anchor nw -bordermode ignore
place $site_3_0.lab53 \
-in $site_3_0 -x 90 -y 10 -width 104 -height 31 -anchor nw \
-bordermode ignore
place $site_3_0.but60 \
-in $site_3_0 -x 20 -y 90 -width 107 -height 54 -anchor nw \
-bordermode ignore
place $site_3_0.but61 \
-in $site_3_0 -x 180 -y 90 -width 107 -height 54 -anchor nw \
-bordermode ignore
frame $top.fra62 \
-borderwidth 2 -relief groove -background {#d9d9d9} -height 405 \
-width 305
vTcl:DefineAlias "$top.fra62" "Frame3" vTcl:WidgetProc "Toplevel1" 1
set site_3_0 $top.fra62
label $site_3_0.lab68 \
-activebackground {#f9f9f9} -activeforeground black \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -text {Voice Control}
vTcl:DefineAlias "$site_3_0.lab68" "Label2_7" vTcl:WidgetProc "Toplevel1" 1
label $site_3_0.lab71 \
-activebackground {#f9f9f9} -activeforeground black \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor {#000000} \
-image [vTcl:image:get_image [file join D:/ {Algorithmic Electronics Projects} {Python Home Automation} images mic.png]] \
-text {Voice Control}
vTcl:DefineAlias "$site_3_0.lab71" "result" vTcl:WidgetProc "Toplevel1" 1
button $site_3_0.but72 \
-activebackground {#ececec} -activeforeground {#000000} \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black \
-image [vTcl:image:get_image [file join D:/ {Algorithmic Electronics Projects} {Python Home Automation} images mic1.png]] \
-pady 0 -text OFF
vTcl:DefineAlias "$site_3_0.but72" "speak" vTcl:WidgetProc "Toplevel1" 1
label $site_3_0.lab73 \
-activebackground {#f9f9f9} -activeforeground black \
-background {#d9d9d9} -disabledforeground {#a3a3a3} \
-font {-family {Segoe UI} -size 14 -weight bold} \
-foreground {#000000} -highlightbackground {#d9d9d9} \
-highlightcolor black -text {Not Recognized}
vTcl:DefineAlias "$site_3_0.lab73" "recognized" vTcl:WidgetProc "Toplevel1" 1
place $site_3_0.lab68 \
-in $site_3_0 -x 60 -y 10 -width 164 -relwidth 0 -height 31 \
-relheight 0 -anchor nw -bordermode ignore
place $site_3_0.lab71 \
-in $site_3_0 -x -170 -y 420 -width 164 -height 31 -anchor nw \
-bordermode ignore
place $site_3_0.but72 \
-in $site_3_0 -x 80 -y 70 -width 147 -relwidth 0 -height 204 \
-relheight 0 -anchor nw -bordermode ignore
place $site_3_0.lab73 \
-in $site_3_0 -x 80 -y 330 -width 164 -height 31 -anchor nw \
-bordermode ignore
###################
# SETTING GEOMETRY
###################
place $top.fra43 \
-in $top -x 200 -y 50 -width 895 -relwidth 0 -height 75 -relheight 0 \
-anchor nw -bordermode ignore
place $top.fra45 \
-in $top -x 150 -y 160 -width 305 -relwidth 0 -height 185 \
-relheight 0 -anchor nw -bordermode ignore
place $top.fra46 \
-in $top -x 150 -y 380 -width 305 -relwidth 0 -height 185 \
-relheight 0 -anchor nw -bordermode ignore
place $top.fra48 \
-in $top -x 540 -y 160 -width 305 -height 185 -anchor nw \
-bordermode ignore
place $top.fra49 \
-in $top -x 540 -y 380 -width 305 -height 185 -anchor nw \
-bordermode ignore
place $top.fra62 \
-in $top -x 910 -y 160 -width 305 -relwidth 0 -height 405 \
-relheight 0 -anchor nw -bordermode ignore
vTcl:FireEvent $base <<Ready>>
}
set btop ""
if {$vTcl(borrow)} {
set btop .bor[expr int([expr rand() * 100])]
while {[lsearch $btop $vTcl(tops)] != -1} {
set btop .bor[expr int([expr rand() * 100])]
}
}
set vTcl(btop) $btop
Window show .
Window show .top42 $btop
if {$vTcl(borrow)} {
$btop configure -background plum
}