Skip to content

Commit 7183d73

Browse files
added altitude profile
1 parent fd63e58 commit 7183d73

File tree

6 files changed

+49
-25
lines changed

6 files changed

+49
-25
lines changed

cache.manifest

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CACHE MANIFEST
2-
# version 25
2+
# version 26
33

44
# gogole maps files
55
http://maps.google.com/maps/api/js?v=3.10&sensor=false&key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg
@@ -17,6 +17,7 @@ http://maps.gstatic.com/mapfiles/arrow-down.png
1717

1818
# app files
1919
img/logo.png
20+
img/blank.png
2021
img/marker-you.png
2122
img/markers/antenna-green.png
2223
img/markers/balloon-blue.png

css/main.css

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,17 @@ header > div {
121121
float: right;
122122
color: #aaa;
123123
}
124-
#main .header span {
125-
overflow: hidden;
126-
display: block;
127-
width: 90%;
128-
float: left;
124+
#main .header {
125+
height: 20px;
126+
padding: 10px;
127+
border-bottom: 2px solid #33b5e5;
128+
position: relative;
129+
z-index: 4;
130+
cursor: pointer;
131+
background-color: #fff;
132+
}
133+
#main .vehicle0 .header {
134+
border-top: 2px solid #33b5e5;
129135
}
130136
#main .header.empty {
131137
text-align: center;
@@ -134,6 +140,12 @@ header > div {
134140
line-height: 100px;
135141
border: 0;
136142
}
143+
#main .header span {
144+
overflow: hidden;
145+
display: block;
146+
width: 90%;
147+
float: left;
148+
}
137149
.row .header .arrow:after { content: "▲"; }
138150
.row.active .header .arrow:after { content: "▼"; }
139151

@@ -144,10 +156,6 @@ header > div {
144156
position: relative;
145157
}
146158
#main .row .header {
147-
position: relative;
148-
z-index: 4;
149-
cursor: pointer;
150-
background-color: #fff;
151159
}
152160
#main .row:hover .header { color: #33b5e5; font-weight: bold; }
153161
#main .row .data { display: none; width: 100%; }
@@ -159,11 +167,18 @@ header > div {
159167
}
160168
#main .row .data img {
161169
position: absolute;
162-
z-index: 3;
170+
z-index: 2;
163171
bottom: 40%;
164172
right: 25%;
165173
opacity: 0.6;
166174
}
175+
#main .row .header .graph {
176+
position: absolute;
177+
bottom: -1px;
178+
right: 25px;
179+
width: 60px;
180+
height: 40px;
181+
}
167182
#main .row .data dt > i {
168183
font-size: 12px;
169184
}
@@ -315,11 +330,6 @@ header > div {
315330
border-right: 1px solid #ddd;
316331
overflow: hidden;
317332
}
318-
#main .header {
319-
height: 20px;
320-
padding: 10px;
321-
border-bottom: 2px solid #33b5e5;
322-
}
323333
#main .data {
324334
height: 100%;
325335
padding-bottom: 5px;
@@ -364,11 +374,6 @@ header > div {
364374
#main {
365375
height: 180px;
366376
}
367-
#main .header {
368-
height: 20px;
369-
padding: 10px;
370-
border-bottom: 2px solid #33b5e5;
371-
}
372377
#main .data {
373378
height: 140px;
374379
}
@@ -404,5 +409,8 @@ header > div {
404409
#main .data dl > dd.receivers {
405410
font-size: 10px;
406411
}
412+
#main .row .header .graph {
413+
width: 150px;
414+
}
407415
}
408416

css/mobile.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

img/blank.png

103 Bytes
Loading

js/mobile.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/tracker.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ var markers_url = "img/markers/";
88
var vehicle_names = [];
99
var vehicles = [];
1010

11+
var graph_url = "http://chart.googleapis.com/chart?chf=bg,s,67676700&chxr=0,0,46|1,0,0|2,0,45&chxs=0,676767,0,0,_,000000|1,676767,0,0,t,676767|2,676767,0,0,_,676767&chxt=r,y,x&chs=150x40&cht=lc&chco=33B5E5&chds=0,{AA}&chls=2&chm=B,33B5E533,0,0,0,-1&chd=t:";
12+
1113
var receiver_names = [];
1214
var receivers = [];
1315

@@ -362,7 +364,10 @@ function updateVehicleInfo(index, position) {
362364

363365

364366
// start
365-
var a = '<div class="header"><span>' + vehicle_names[index] + '</span><i class="arrow"></i></div>'
367+
var a = '<div class="header">'
368+
+ '<span>' + vehicle_names[index] + '</span>'
369+
+ '<img class="graph" src="img/blank.png">'
370+
+ '<i class="arrow"></i></div>'
366371
+ '<div class="data">'
367372
+ '<img src="'+image+'" />'
368373
+ '<div class="left">'
@@ -675,12 +680,13 @@ function addPosition(position) {
675680
prediction: null,
676681
ascent_rate: 0.0,
677682
max_alt: parseFloat(position.gps_alt),
678-
alt_data: new Array(),
679683
path_enabled: vehicle_type == "balloon" && position.vehicle.toLowerCase().indexOf("iss") == -1,
680684
follow: false,
681685
color_index: c,
682686
prediction_traget: null,
683687
prediction_burst: null,
688+
alt_list: [0],
689+
alt_rate: 0
684690
};
685691
vehicles.push(vehicle_info);
686692
}
@@ -708,6 +714,13 @@ function addPosition(position) {
708714
rate = (position.gps_alt - vehicle.curr_position.gps_alt) / dt;
709715
vehicle.ascent_rate = 0.7 * rate
710716
+ 0.3 * vehicles[vehicle_index].ascent_rate;
717+
718+
if(Math.abs(vehicle.alt_rate - rate) >= 0.5) {
719+
vehicle.alt_rate = rate;
720+
vehicle.alt_list.push(parseInt(vehicle.curr_position.gps_alt));
721+
} else {
722+
vehicle.alt_list[vehicle.alt_list.length-1] = parseInt(vehicle.curr_position.gps_alt);
723+
}
711724
}
712725

713726
if(vehicle.curr_position.gps_lat != position.gps_lat
@@ -946,6 +959,8 @@ function update(response) {
946959
for (vehicle_index = 0; vehicle_index < vehicle_names.length; vehicle_index++) {
947960
updatePolyline(vehicle_index);
948961
updateVehicleInfo(vehicle_index, vehicles[vehicle_index].curr_position);
962+
963+
$('.vehicle'+vehicle_index+' .graph').attr('src', graph_url.replace("{AA}",vehicles[vehicle_index].max_alt) + vehicles[vehicle_index].alt_list.join(','));
949964

950965
// remember last position for each vehicle
951966
lastPPointer.push(vehicles[vehicle_index].curr_position);

0 commit comments

Comments
 (0)