-
Notifications
You must be signed in to change notification settings - Fork 1
/
monitor.kv
131 lines (128 loc) · 4.41 KB
/
monitor.kv
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
<TextInputS@TextInput>:
background_color:1,1,1,.1
foreground_color:0,1,1,1
halign:"center"
valign:"middle"
text_size:self.size
multiline:False
<GarisTegak@Label>:
size_hint:None,.8
pos_hint:{"center_x":.5,"center_y":.5}
width:"2sp"
canvas:
Color:
rgba:0,1,1,1
Rectangle:
size:self.size
pos:self.pos
<Monitor>:
pos_hint:{"center_x":.5,"top":1}
size_hint:1,None
height:"90sp"
status_color:[.5,1,0,1]
ScreenManager:
pos_hint:{"center_x":.5,"center_y":.5}
id:sm
Screen:
name:"idle"
BoxLayout
canvas.before:
Color:
rgba:.3,.3,.3,.3
Rectangle:
size:self.size
pos:self.pos
pos_hint:{"center_x":.5,"center_y":.5}
BtnImg:
source:"img/setting.png"
size_hint:.15,1
color:0,1,1,1
on_release:
sm.current="edit"
root.height="140sp"
FloatLayout
Label
pos_hint:{"center_x":.5,"center_y":.5}
text:root.device_name
font_name:"fonts/modern.ttf"
color:0,1,1,1
font_size:self.height
size_hint:1,.3
GarisTegak
Label:
size_hint:.4,1
text:root.status
color:root.status_color
font_name:"fonts/modern.ttf"
font_size:self.height/3
Screen:
name:"edit"
BoxLayout
canvas:
Color:
rgba:.3,.3,.3,.3
Rectangle:
size:self.size
pos:self.pos
pos_hint:{"center_x":.5,"center_y":.5}
BoxLayout:
orientation:"vertical"
size_hint:.2,1
BtnImg:
source:"img/3btn.png"
color:0,1,1,1
on_release:
sm.current="idle"
root.height="90sp"
app.subscribe(root.topic)
BtnImg:
source:"img/dell.png"
color:0,1,1,1
on_release:root.parent.remove_widget(root)
BoxLayout
size_hint:.45,1
orientation:"vertical"
Label
text:"device name"
color:0,1,1,1
Label
text:"topic"
color:0,1,1,1
Label
text:"min value"
color:0,1,1,1
Label
text:"max value"
color:0,1,1,1
BoxLayout
size_hint:.05,1
orientation:"vertical"
Label
text:":"
color:0,1,1,1
Label
text:":"
color:0,1,1,1
Label
text:":"
color:0,1,1,1
Label
text:":"
color:0,1,1,1
BoxLayout
orientation:"vertical"
TextInputS:
text:root.device_name
on_text:root.device_name=self.text
TextInputS
text:root.topic
on_text:root.topic=self.text
TextInputS
text:root.message1
on_text:root.message1=self.text #if self.text !="" else "0"
input_filter:"float"
TextInputS
text:root.message2
on_text:
root.message2=self.text #if self.text !="" else "0"
input_filter:"float"