-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmonitorConfig
More file actions
executable file
·212 lines (155 loc) · 5.39 KB
/
Copy pathmonitorConfig
File metadata and controls
executable file
·212 lines (155 loc) · 5.39 KB
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
#monitor
port 4321
#
# First there's a block of variable declarations. There
# should be one of these for each key which appears in the
# data stream, except for "time".
# These are separated by commas.
var {
# Currently only float values are supported - we can emulate
# others with these.
# "heading" is a variable with range 0 to 359. We'll store 100 values
# for it in a cyclic buffer, so we can graph 100 values back.
float heading 100 range 0 to 359
# True Wind direction
float twd 100 range 0 to 359
# Course to the waypoint
float ctw 100 range 0 to 359
# Distance to the waypoint in metres
float dtw 100 range 0 to 200
float wpnum 1000 range 0 to 200
float speed 1000 range 0 to 5
float warn 100 range 0 to 3
float offline 1 range 0 to 1
float display 1 range 0 to 1
float rudderAV 1 range 3500 to 8000
float sailAV 1 range 3500 to 8000
# "lat" and "lon" should always be considered to be a pair,
# so we link them - if a lat ever arrives without a lon, a
# lon will be created at the same time with the same value
# it had previously.
# Lat has range -90 to 90, lon has range -180 to 180
# Being linked, they have the same buffer size - 1000 values.
linked (
float lat range -90 to 90,
float lon range -180 to 180) 1000
linked (
float wpLat range -90 to 90,
float wpLon range -180 to 180) 100
linked (
float obLat range -90 to 90,
float obLon range -180 to 180) 100
}
# That's the variables, now we can define the widgets.
# the only display (currently)
window {
# top left
frame 0,0,20,1 {
map 0,0 size 400, 400{
centre 60.10,19.92 height 10
point {
# For this point renderer,
# we render points at lat,lon, with a new point
# every time we get a new lat. Note that lat comes first.
location var lat,var lon on var lat
# we also render 40 of the previous points when new "lat" data arrived.
trail 40
}
point {
# For this point renderer,
# we render points at lat,lon, with a new point
# every time we get a new lat. Note that lat comes first.
location var wpLat,var wpLon on var wpLat
# we also render 40 of the previous points when new "lat" data arrived.
trail 40
colour green
hue var speed
}
point {
# For this point renderer,
# we render points at lat,lon, with a new point
# every time we get a new lat. Note that lat comes first.
location var obLat,var obLon on var obLat
# we also render 40 of the previous points when new "lat" data arrived.
trail 40
colour red
hue var speed
}
vector {
# we also draw a vector at each point - the same points.
location var lat, var lon on var lat
trail 1
# the width of the vector is set to 3 pixels
width 3
# the direction of the vector comes from the expression a*180.
degrees var heading
# and the vector is black (default is white, for technical reasons)
colour black
}
# waypoint renderer
waypoint {}
}
}
frame 20,0,20,1 { # top right
compass 0,1 {
title "Course"
expr "ctw" range auto
}
compass 1,1 {
title "Heading"
expr "heading" range auto
}
gauge 0,2 {
var speed
title "Speed"
subtitle "Metres Per Second"
fontscale 2
}
compass 1,2 {
title "True Wind"
expr "twd" range auto
}
number 0,3 { var wpnum title "Waypoint Number"}
number 1,3 { var dtw title "Waypoint Distance"}
gauge 0,4 {
var rudderAV
title "Rudder"
subtitle "PWM"
fontscale 2
}
gauge 1,4 {
var sailAV
title "Sail"
subtitle "PWM"
fontscale 2
}
status 0,0, 2,1 {
size 2,1
# bool requires a boolean expression source,
# which is actually a float in the range -1 to 1 (although
# you can specify "range auto".)
bool {
pos 0,0
title "Monitor Tool"
expr "display=0" range auto
false green
true red
}
bool {
pos 1,0
title "Connected"
expr "offline=1" range auto
false green
true red
}
}
}
# bottom frame, 2 cols wide
frame 0,1,40,80 {
graph 0,0 {
time 100
var speed { col red width 2}
var dtw { col blue width 2}
}
}
}