mech.html 11.1 KB
Newer Older
Jeroen Vreeken's avatar
Jeroen Vreeken committed
1
2
3
4
5
6
7
8
9
10
11
12
13
<html>

<head>
 <title>
  Dwingeloo Mech console interface
 </title>
</head>

<body background="achtergrond.jpg">

 <table border="0">
  <tr>
   <td width="300">
Jeroen Vreeken's avatar
Jeroen Vreeken committed
14
    <div id="azimuth_software"></div>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
15
16
17
18
19
   </td>
   
   <td width="50"><hr></td>
   
   <td>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
20
    <div id="azimuth_drive"></div>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
21
22
23
24
   </td>

   <td width="50"><hr></td>
   
Jeroen Vreeken's avatar
Jeroen Vreeken committed
25
   <td width="300">
Jeroen Vreeken's avatar
Jeroen Vreeken committed
26
    <div id="azimuth_mechanics"></div>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
27
28
29
30
31
32
   </td>

  </tr>

  <tr>
   <td width="250">
Jeroen Vreeken's avatar
Jeroen Vreeken committed
33
    <div id="focusbox"></div>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
34
35
36
37
38
   </td>
   
   <td></td>

   <td>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
39
    <div id="ethercat"></div>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
40
41
   </td>

Jeroen Vreeken's avatar
Jeroen Vreeken committed
42
   <td></td>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
43
    
Jeroen Vreeken's avatar
Jeroen Vreeken committed
44
45
   <td width="250">
    <div id="weather"></div>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
46
47
48
49
50
51
52
   </td>

  </tr>

  <tr>

   <td>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
53
    <div id="elevation_software"></div>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
54
55
   </td>

Jeroen Vreeken's avatar
Jeroen Vreeken committed
56
   <td width="50"><hr><hr></td>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
57
58
   
   <td>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
59
    <div id="elevation_drive"></div>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
60
61
   </td>

Jeroen Vreeken's avatar
Jeroen Vreeken committed
62
   <td width="60"><hr><hr></td>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
63
64
   
   <td>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
65
    <div id="elevation_mechanics"></div>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
66
67
68
69
70
71
72
73
74
   </td>

  </tr>

</table>

</body>


Jeroen Vreeken's avatar
Jeroen Vreeken committed
75

Jeroen Vreeken's avatar
Jeroen Vreeken committed
76
<script src="js/load.js"></script>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
77

Jeroen Vreeken's avatar
Jeroen Vreeken committed
78
<script type="application/javascript">
Jeroen Vreeken's avatar
Jeroen Vreeken committed
79

Jeroen Vreeken's avatar
Jeroen Vreeken committed
80
81
82
83
84
eval(load("js/dt_ui.js"));
eval(load("js/dt_websocket.js"));
eval(load("js/trace.js"));
eval(load("js/utils.js"));
eval(load("js/status.js"));
85

86
new dt_websocket("ws://"+ window.location.host +"/dt");
Jeroen Vreeken's avatar
Jeroen Vreeken committed
87
88
89
90
91
92


function one(val)
{
	return val;
}
Jeroen Vreeken's avatar
Jeroen Vreeken committed
93

Jeroen Vreeken's avatar
Jeroen Vreeken committed
94
var azimuth_software = new dt_ui_window_trace("azimuth_software", "Azimuth Software Control", [
Jeroen Vreeken's avatar
Jeroen Vreeken committed
95
	{
Jeroen Vreeken's avatar
Jeroen Vreeken committed
96
97
98
99
100
101
102
		name:		"Azimuth_Safe",
		frequency:	0,
		label:		"Safe",
		func:		one,
		is_bool:	true,
		is_number:	false,
		highlight:	false,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
103
104
	},
	{
Jeroen Vreeken's avatar
Jeroen Vreeken committed
105
106
107
		name: 		"Azimuth_Position",
		frequency:	4,
		label:		"Position",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
108
109
		func:		rad2deg,
		suffix:		"deg",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
110
111
		is_bool:	false,
		is_number:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
112
		decimals:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
113
		highlight:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
114
115
116
	},
	{
		name: 		"Azimuth_Setpoint",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
117
		frequency:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
118
119
120
		label:		"Setpoint",
		func:		rad2deg,
		suffix:		"deg",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
121
122
		is_bool:	false,
		is_number:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
123
		decimals:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
124
		highlight:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
125
126
127
	},
	{
		name: 		"Azimuth_Setpoint_Error",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
128
		frequency:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
129
130
131
		label:		"Setpoint Error",
		func:		rad2deg,
		suffix:		"deg",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
132
133
		is_bool:	false,
		is_number:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
134
		decimals:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
135
		highlight:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
136
137
	},
	{
Jeroen Vreeken's avatar
Jeroen Vreeken committed
138
139
140
		name: 		"Azimuth_Spg0",
		frequency:	4,
		label:		"Spg",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
141
142
		func:		rad2deg,
		suffix:		"deg",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
143
144
		is_bool:	false,
		is_number:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
145
		decimals:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
146
		highlight:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
147
148
	},
	{
Jeroen Vreeken's avatar
Jeroen Vreeken committed
149
150
		name: 		"Azimuth_Error",
		frequency:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
151
152
153
		label:		"Error",
		func:		rad2deg,
		suffix:		"deg",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
154
155
		is_bool:	false,
		is_number:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
156
		decimals:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
157
		highlight:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
158
	},
Jeroen Vreeken's avatar
Jeroen Vreeken committed
159
160
161
]);

var elevation_software = new dt_ui_window_trace("elevation_software", "Elevation Software Control", [
Jeroen Vreeken's avatar
Jeroen Vreeken committed
162
	{
Jeroen Vreeken's avatar
Jeroen Vreeken committed
163
164
165
166
167
168
169
170
171
172
173
174
		name:		"Elevation_Safe",
		frequency:	0,
		label:		"Safe",
		func:		one,
		is_bool:	true,
		is_number:	false,
		highlight:	false,
	},
	{
		name: 		"Elevation_Position",
		frequency:	4,
		label:		"Position",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
175
176
		func:		rad2deg,
		suffix:		"deg",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
177
178
		is_bool:	false,
		is_number:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
179
		decimals:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
180
		highlight:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
181
182
183
	},
	{
		name: 		"Elevation_Setpoint",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
184
		frequency:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
185
186
187
		label:		"Setpoint",
		func:		rad2deg,
		suffix:		"deg",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
188
189
		is_bool:	false,
		is_number:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
190
		decimals:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
191
		highlight:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
192
193
194
	},
	{
		name: 		"Elevation_Setpoint_Error",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
195
		frequency:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
196
197
198
		label:		"Setpoint Error",
		func:		rad2deg,
		suffix:		"deg",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
199
200
		is_bool:	false,
		is_number:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
201
		decimals:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
202
		highlight:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
203
204
	},
	{
Jeroen Vreeken's avatar
Jeroen Vreeken committed
205
206
207
		name: 		"Elevation_Spg0",
		frequency:	4,
		label:		"Spg",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
208
209
		func:		rad2deg,
		suffix:		"deg",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
210
211
		is_bool:	false,
		is_number:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
212
		decimals:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
213
		highlight:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
214
	},
Jeroen Vreeken's avatar
Jeroen Vreeken committed
215
216
217
218
219
220
221
222
223
224
225
226
227
228
	{
		name: 		"Elevation_Error",
		frequency:	4,
		label:		"Error",
		func:		rad2deg,
		suffix:		"deg",
		is_bool:	false,
		is_number:	true,
		decimals:	4,
		highlight:	true,
	},
]);

var azimuth_mechanics = new dt_ui_window_trace("azimuth_mechanics", "Azimuth Mechanics", [
Jeroen Vreeken's avatar
Jeroen Vreeken committed
229
230
	{
		name: 		"Azimuth_Speed",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
231
		frequency:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
232
233
234
		label:		"Speed",
		func:		rads2rpm,
		suffix:		"rpm",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
235
236
237
238
239
240
241
242
243
244
245
246
247
		is_bool:	false,
		is_number:	true,
		decimals:	4,
		highlight:	true,
	},
	{
		name: 		"Azimuth_Torque",
		frequency:	4,
		label:		"Torque",
		func:		one,
		suffix:		"Nm ",
		is_bool:	false,
		is_number:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
248
249
250
		decimals:	4,
		highlight:	true
	},
Jeroen Vreeken's avatar
Jeroen Vreeken committed
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
	{
		name:		"Azimuth_Drive_Safety_p270",
		frequency:	0,
		label:		"Endstop Positive",
		func:		one,
		is_bool:	true,
		is_number:	false,
		highlight:	false,
	},
	{
		name:		"Azimuth_Drive_Safety_m270",
		frequency:	0,
		label:		"Endstop Negative",
		func:		one,
		is_bool:	true,
		is_number:	false,
		highlight:	false,
	},
]);

var elevation_mechanics = new dt_ui_window_trace("elevation_mechanics", "Elevation Mechanics", [
Jeroen Vreeken's avatar
Jeroen Vreeken committed
272
273
	{
		name: 		"Elevation_Speed_Right",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
274
		frequency:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
275
276
277
		label:		"Speed Right",
		func:		rads2rpm,
		suffix:		"rpm",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
278
279
280
281
282
283
284
285
286
287
288
289
290
		is_bool:	false,
		is_number:	true,
		decimals:	4,
		highlight:	true,
	},
	{
		name: 		"Elevation_Torque_Right",
		frequency:	4,
		label:		"Torque Right",
		func:		one,
		suffix:		"Nm ",
		is_bool:	false,
		is_number:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
291
292
293
294
295
		decimals:	4,
		highlight:	true
	},
	{
		name: 		"Elevation_Speed_Left",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
296
		frequency:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
297
298
299
		label:		"Speed Left",
		func:		rads2rpm,
		suffix:		"rpm",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
300
301
		is_bool:	false,
		is_number:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
302
		decimals:	4,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
303
		highlight:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
304
305
	},
	{
Jeroen Vreeken's avatar
Jeroen Vreeken committed
306
307
308
		name: 		"Elevation_Torque_Left",
		frequency:	4,
		label:		"Torque Left",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
309
310
		func:		one,
		suffix:		"Nm ",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
311
312
		is_bool:	false,
		is_number:	true,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
313
314
315
316
		decimals:	4,
		highlight:	true
	},
	{
Jeroen Vreeken's avatar
Jeroen Vreeken committed
317
318
319
		name:		"Elevation_Top_Safe",
		frequency:	0,
		label:		"Endstop Top",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
320
		func:		one,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
321
322
323
		is_bool:	true,
		is_number:	false,
		highlight:	false,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
324
325
	},
	{
Jeroen Vreeken's avatar
Jeroen Vreeken committed
326
327
328
		name:		"Elevation_Bottom_Safe",
		frequency:	0,
		label:		"Endstop Bottom",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
329
		func:		one,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
330
331
332
		is_bool:	true,
		is_number:	false,
		highlight:	false,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
333
	},
Jeroen Vreeken's avatar
Jeroen Vreeken committed
334
335
336
337
]);


var azimuth_drive = new dt_ui_window_trace("azimuth_drive", "Azimuth Drive", [
Jeroen Vreeken's avatar
Jeroen Vreeken committed
338
	{
Jeroen Vreeken's avatar
Jeroen Vreeken committed
339
340
341
		name:		"Azimuth_Enabled",
		frequency:	0,
		label:		"Enabled",
Jeroen Vreeken's avatar
Jeroen Vreeken committed
342
		func:		one,
Jeroen Vreeken's avatar
Jeroen Vreeken committed
343
344
345
346
347
348
349
350
351
352
353
354
355
356
		is_bool:	true,
		is_number:	false,
		highlight:	false,
	},
	{
		name:		"dt_az.external_enable",
		frequency:	0,
		label:		"External enable",
		func:		one,
		is_bool:	true,
		is_number:	false,
		highlight:	false,
	},
]);
Jeroen Vreeken's avatar
Jeroen Vreeken committed
357

Jeroen Vreeken's avatar
Jeroen Vreeken committed
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
var ethercat = new dt_ui_window_trace("ethercat", "Ethercat", [
	{
		name:		"ethercat.operational",
		frequency:	0,
		label:		"Operational",
		func:		one,
		is_bool:	true,
		is_number:	false,
		highlight:	false,
	},
	{
		name:		"ethercat.pdo_data",
		frequency:	0,
		label:		"PDO data",
		func:		one,
		is_bool:	true,
		is_number:	false,
		highlight:	false,
	},
]);
Jeroen Vreeken's avatar
Jeroen Vreeken committed
378

Jeroen Vreeken's avatar
Jeroen Vreeken committed
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
var elevation_drive = new dt_ui_window_trace("elevation_drive", "Elevation Drive", [
	{
		name:		"Elevation_Enabled",
		frequency:	0,
		label:		"Enabled",
		func:		one,
		is_bool:	true,
		is_number:	false,
		highlight:	false,
	},
	{
		name:		"dt_el_r.external_enable",
		frequency:	0,
		label:		"External enable Right",
		func:		one,
		is_bool:	true,
		is_number:	false,
		highlight:	false,
	},
	{
		name:		"dt_el_l.external_enable",
		frequency:	0,
		label:		"External enable Left",
		func:		one,
		is_bool:	true,
		is_number:	false,
		highlight:	false,
	},
]);
Jeroen Vreeken's avatar
Jeroen Vreeken committed
408
409


Jeroen Vreeken's avatar
Jeroen Vreeken committed
410
411
412
413
414
415
416
417
418
419
420
421
422
var focusbox = new dt_ui_window_trace("focusbox", "Focusbox", [
	{
		name: 		"Focusbox_Position",
		frequency:	2,
		label:		"Focusbox Position",
		func:		one,
		suffix:		"V",
		is_bool:	false,
		is_number:	true,
		decimals:	2,
		highlight:	true,
	},
]);
Jeroen Vreeken's avatar
Jeroen Vreeken committed
423

Jeroen Vreeken's avatar
Jeroen Vreeken committed
424
var weather_url = "status.cgi";
Jeroen Vreeken's avatar
Jeroen Vreeken committed
425

Jeroen Vreeken's avatar
Jeroen Vreeken committed
426
var azimuth_enable_command = new controller_command("azimuth_servo_state", "bool");
427
var azimuth_recover_command = new controller_command("azimuth_recover", "bool");
Jeroen Vreeken's avatar
Jeroen Vreeken committed
428
429
var elevation_enable_command = new controller_command("elevation_servo_state", "bool");
var elevation_recover_command = new controller_command("elevation_safety", "bool");
430

Jeroen Vreeken's avatar
Jeroen Vreeken committed
431

Jeroen Vreeken's avatar
Jeroen Vreeken committed
432
433
434
435
var button_azimuth_enable = new dt_ui_button("button_azimuth_enable");
var button_azimuth_disable = new dt_ui_button("button_azimuth_disable");
var button_azimuth_override = new dt_ui_button("button_azimuth_override");
var button_azimuth_normal = new dt_ui_button("button_azimuth_normal");
Jeroen Vreeken's avatar
Jeroen Vreeken committed
436

Jeroen Vreeken's avatar
Jeroen Vreeken committed
437
438
439
azimuth_software.add([
	button_azimuth_enable, button_azimuth_disable,
	button_azimuth_override, button_azimuth_normal, ]);
Jeroen Vreeken's avatar
Jeroen Vreeken committed
440

Jeroen Vreeken's avatar
Jeroen Vreeken committed
441
442
443
444
445
446
button_azimuth_enable.text_set("Enable");
button_azimuth_enable.color_set("darkgreen");
button_azimuth_enable.onclick = function azimuth_enable() { 
	azimuth_enable_command.send(1);
	azimuth_recover_command.send(0);
}
Jeroen Vreeken's avatar
Jeroen Vreeken committed
447

Jeroen Vreeken's avatar
Jeroen Vreeken committed
448
449
450
451
452
453
button_azimuth_disable.text_set("Disable");
button_azimuth_disable.color_set("red");
button_azimuth_disable.onclick = function azimuth_disable() { 
	azimuth_enable_command.send(0);
	azimuth_recover_command.send(0);
}
Jeroen Vreeken's avatar
Jeroen Vreeken committed
454

Jeroen Vreeken's avatar
Jeroen Vreeken committed
455
456
457
458
459
button_azimuth_normal.text_set("Normal");
button_azimuth_normal.color_set("darkgreen");
button_azimuth_normal.onclick = function azimuth_normal() { 
	azimuth_recover_command.send(0);
}
Jeroen Vreeken's avatar
Jeroen Vreeken committed
460

Jeroen Vreeken's avatar
Jeroen Vreeken committed
461
462
463
464
465
button_azimuth_override.text_set("Override");
button_azimuth_override.color_set("#e08000");
button_azimuth_override.onclick = function azimuth_override() {
	azimuth_recover_command.send(1);
}
Jeroen Vreeken's avatar
Jeroen Vreeken committed
466
467


Jeroen Vreeken's avatar
Jeroen Vreeken committed
468
469
470
471
472
473
azimuth_software.resize_equal([
	button_azimuth_enable, button_azimuth_disable,
	button_azimuth_override, button_azimuth_normal, ]);
azimuth_software.align_vertical([ button_azimuth_enable, button_azimuth_normal ]);
azimuth_software.align_horizontal([ button_azimuth_enable, button_azimuth_disable ]);
azimuth_software.align_horizontal([ button_azimuth_normal, button_azimuth_override ]);
Jeroen Vreeken's avatar
Jeroen Vreeken committed
474
475
476
477
478





Jeroen Vreeken's avatar
Jeroen Vreeken committed
479
480
481
482
var button_elevation_enable = new dt_ui_button("button_elevation_enable");
var button_elevation_disable = new dt_ui_button("button_elevation_disable");
var button_elevation_override = new dt_ui_button("button_elevation_override");
var button_elevation_normal = new dt_ui_button("button_elevation_normal");
483

Jeroen Vreeken's avatar
Jeroen Vreeken committed
484
485
486
elevation_software.add([
	button_elevation_enable, button_elevation_disable,
	button_elevation_override, button_elevation_normal, ]);
Jeroen Vreeken's avatar
Jeroen Vreeken committed
487

Jeroen Vreeken's avatar
Jeroen Vreeken committed
488
489
490
491
492
493
button_elevation_enable.text_set("Enable");
button_elevation_enable.color_set("darkgreen");
button_elevation_enable.onclick = function elevation_enable() { 
	elevation_enable_command.send(1);
	elevation_recover_command.send(0);
}
Jeroen Vreeken's avatar
Jeroen Vreeken committed
494

Jeroen Vreeken's avatar
Jeroen Vreeken committed
495
496
497
498
499
500
button_elevation_disable.text_set("Disable");
button_elevation_disable.color_set("red");
button_elevation_disable.onclick = function elevation_disable() { 
	elevation_enable_command.send(0);
	elevation_recover_command.send(0);
}
Jeroen Vreeken's avatar
Jeroen Vreeken committed
501

Jeroen Vreeken's avatar
Jeroen Vreeken committed
502
503
504
505
506
button_elevation_normal.text_set("Normal");
button_elevation_normal.color_set("darkgreen");
button_elevation_normal.onclick = function elevation_normal() { 
	elevation_recover_command.send(0);
}
Jeroen Vreeken's avatar
Jeroen Vreeken committed
507

Jeroen Vreeken's avatar
Jeroen Vreeken committed
508
509
510
511
512
button_elevation_override.text_set("Override");
button_elevation_override.color_set("#e08000");
button_elevation_override.onclick = function elevation_override() {
	elevation_recover_command.send(1);
}
Jeroen Vreeken's avatar
Jeroen Vreeken committed
513
514


Jeroen Vreeken's avatar
Jeroen Vreeken committed
515
516
517
518
519
520
elevation_software.resize_equal([
	button_elevation_enable, button_elevation_disable,
	button_elevation_override, button_elevation_normal, ]);
elevation_software.align_vertical([ button_elevation_enable, button_elevation_normal ]);
elevation_software.align_horizontal([ button_elevation_enable, button_elevation_disable ]);
elevation_software.align_horizontal([ button_elevation_normal, button_elevation_override ]);
Jeroen Vreeken's avatar
Jeroen Vreeken committed
521
522
523
524
525
526
527
528
529
530



/******************************************************************
 *
 * Weather
 *
 ******************************************************************/


Jeroen Vreeken's avatar
Jeroen Vreeken committed
531
532
533
weather = new dt_ui_window("weather");
weather.title_set("Weather");
weather_status = new dt_ui_value("weather_value");
Jeroen Vreeken's avatar
Jeroen Vreeken committed
534

Jeroen Vreeken's avatar
Jeroen Vreeken committed
535
536
537
538
weather.add([ weather_status ]);
weather_status.value_set("??_C,_????_mbar");
weather.room(weather_status);
weather.align_vertical([ weather_status ], 0);
Jeroen Vreeken's avatar
Jeroen Vreeken committed
539

Jeroen Vreeken's avatar
Jeroen Vreeken committed
540
541
542
543
function dt_weather_callback(line)
{
	weather_status.value_set(line);
}
Jeroen Vreeken's avatar
Jeroen Vreeken committed
544

Jeroen Vreeken's avatar
Jeroen Vreeken committed
545
546
547
weatherstat = new status(weather_url, "weather");
weatherstat.callback = dt_weather_callback;
weatherstat.open();
Jeroen Vreeken's avatar
Jeroen Vreeken committed
548

Jeroen Vreeken's avatar
Jeroen Vreeken committed
549
550
551
552
</script>

</html>