-
Notifications
You must be signed in to change notification settings - Fork 0
/
firstTimeScreen.go
55 lines (38 loc) · 1.28 KB
/
firstTimeScreen.go
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
package main
import (
"time"
"github.com/ajstarks/openvg"
touchscreen "github.com/electrocatstudios/FTXXXX_Touchscreen_Driver"
)
func RunFirstTimeScreen(s ScreenDetails, t *touchscreen.TouchScreen) bool {
for {
openvg.Start(s.Width, s.Height) // Start the picture
openvg.BackgroundColor("black")
count, _ := t.GetTouchesCount()
if count > 0 {
break
}
// Default fill color
openvg.FillColor("rgb(255,255,255)") // White text
line1 := DisplayLine{Type: "text", Value: "Welcome", Color: ""}
line2 := DisplayLine{Type: "text", Value: "Touch Screen to Perform Setup", Color: ""}
DrawLine(s, line1, 400, nil)
DrawLine(s, line2, 160, nil)
openvg.End()
time.Sleep(5 * time.Millisecond)
}
// Start the command to get the screens - TODO: Check the file exists
RunCommand("/bin/bash /home/pi/menecs/get_screens.sh", false)
for {
openvg.Start(s.Width, s.Height) // Start the picture
openvg.BackgroundColor("black")
// Default fill color
openvg.FillColor("rgb(255,255,255)") // White text
line1 := DisplayLine{Type: "text", Value: "Downloading", Color: ""}
line2 := DisplayLine{Type: "text", Value: "App will restart when complete", Color: ""}
DrawLine(s, line1, 400, nil)
DrawLine(s, line2, 160, nil)
openvg.End()
time.Sleep(5 * time.Millisecond)
}
}