-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·125 lines (104 loc) · 3.8 KB
/
index.html
File metadata and controls
executable file
·125 lines (104 loc) · 3.8 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
<!--
Flight Indicators plugin
Based on Sébastien Matton's plugin
Published under GPLv3 License.
https://github.com/sebmatton/jQuery-Flight-Indicators
-->
<html lang="en" dir="ltr">
<head>
<!-- Importing jQuery library -->
<script src="js/jquery.min.js"></script> <!-- Was: src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js" -->
<script>
$(function(){
$("#menu").load("menu.html");
});
</script>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/flightindicators.css" />
<title>Classic</title>
</head>
<body style="background-color:#000000">
<div id="menu"></div>
<div class="container">
<span class="EFIS">
<div>
<span id="airspeed"></span>
<span id="attitude"></span>
<span id="altimeter"></span>
</div><div>
<span id="turn_coordinator"></span>
<span id="heading"></span>
<span id="variometer"></span>
</div>
</span>
<span class="EMS">
<div id="clock" style="color:#FFFFFF;"></div>
<div id="tacho"></div>
<div id="oil"></div>
</span>
</div>
<!-- Importing the FlightIndicators library -->
<script src="js/jquery.flightindicators.js"></script>
<!-- Let start our scripts -->
<script type="text/javascript">
var attitude = $.flightIndicator('#attitude', 'attitude', {size:300, roll:0, pitch:0, showBox : true});
var heading = $.flightIndicator('#heading', 'heading', {size:300, heading:150, showBox:true});
var variometer = $.flightIndicator('#variometer', 'variometer', {size:300, vario:-5, showBox:false});
var airspeed = $.flightIndicator('#airspeed', 'airspeed', {size:300, showBox:true});
var altimeter = $.flightIndicator('#altimeter', 'altimeter', {size:300, showBox:true});
var turn_coordinator = $.flightIndicator('#turn_coordinator', 'turn_coordinator', {size:300, turn:0, showBox:false});
// var clock = $.flightIndicator('#clock', 'clock', {size:300});
// var tacho = $.flightIndicator('#tacho', 'tacho', {size:300, RPM:0});
// var oil = flightIndicator('#oil', 'oil', {size:300, temp:0, pressure:0});
</script>
<script src="js/socket.io.js"></script> <!-- include socket.io client side script. was src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.3/socket.io.js" -->
<script>
//var socket = io(); //load socket.io-client and connect to the host that serves the page
var socket = io({transport: ['websocket'], upgrade: false});
// stuff to send events from the screen to the client
//window.addEventListener("load", function(){ //when page loads
// var lightbox = document.getElementById("light");
// lightbox.addEventListener("change", function() { //add event listener for when checkbox changes
// socket.emit("light", Number(this.checked)); //send button status to server (as 1 or 0)
// });
//});
socket.on('Vario', function (data) {
variometer.setVario(data);
});
socket.on('Heading', function (data) {
heading.setHeading(data);
});
socket.on('Turn', function (data) {
turn_coordinator.setTurn(data);
});
socket.on('QNH', function (data) {
altimeter.setPressure(data);
//document.getElementById("clock").innerHTML = data;
});
socket.on('Altitude', function (data) {
altimeter.setAltitude(data);
});
socket.on('Airspeed', function (data) {
airspeed.setAirSpeed(data);
});
socket.on('AH_Roll', function (data) {
attitude.setRoll(data);
});
socket.on('AH_Pitch', function (data) {
attitude.setPitch(data);
});
socket.on('TimeUTC', function (data) {
document.getElementById("clock").innerHTML = data;
});
socket.on('TachoRPM', function (data) {
tacho.setTachoRPM(data);
});
socket.on('OilTemperature', function (data) {
document.getElementById("oil").innerHTML = data;
});
socket.on('OilPressure', function (data) {
document.getElementById("oil").innerHTML = data;
});
</script>
</body>
</html>