Rev 266 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 266 | Rev 381 | ||
---|---|---|---|
Line 222... | Line 222... | ||
222 | /* public void next_gps_format() |
222 | /* public void next_gps_format() |
223 | { |
223 | { |
224 | act_gps_format=(byte)((act_gps_format+1)%GPS_FORMAT_COUNT); |
224 | act_gps_format=(byte)((act_gps_format+1)%GPS_FORMAT_COUNT); |
225 | }*/ |
225 | }*/ |
Line -... | Line 226... | ||
- | 226 | ||
- | 227 | ||
226 | 228 | ||
227 | public String act_gps_format_str(int val) |
229 | public String gps_format_str(int val,int format) |
228 | { |
230 | { |
229 | switch(act_gps_format) |
231 | switch(format) |
230 | { |
232 | { |
231 | case GPS_FORMAT_DECIMAL: |
233 | case GPS_FORMAT_DECIMAL: |
232 | return "" + val/10000000 + "." +val%10000000 ; |
234 | return "" + val/10000000 + "." +val%10000000 ; |
233 | case GPS_FORMAT_MINSEC: |
235 | case GPS_FORMAT_MINSEC: |
234 | return "" + val/10000000 + "^" + ((val%10000000)*60)/10000000 + "'" + ((((val%10000000)*60)%10000000)*60)/10000000 + "." + ((((val%10000000)*60)%10000000)*60)%10000000; |
236 | return "" + val/10000000 + "^" + ((val%10000000)*60)/10000000 + "'" + ((((val%10000000)*60)%10000000)*60)/10000000 + "." + ((((val%10000000)*60)%10000000)*60)%10000000; |
235 | default: |
237 | default: |
236 | return "invalid format" + act_gps_format; |
238 | return "invalid format" + act_gps_format; |
237 | } |
239 | } |
- | 240 | } |
|
- | 241 | public String act_gps_format_str(int val) |
|
- | 242 | { |
|
- | 243 | return gps_format_str(val,act_gps_format); |
|
- | 244 | ||
Line 238... | Line 245... | ||
238 | } |
245 | } |
239 | 246 | ||
Line 350... | Line 357... | ||
350 | 357 | ||
351 | 358 | ||
- | 359 | ||
- | 360 | public void set_by_mk_data(int[] in_arr,MKVersion version) |
|
- | 361 | { |
|
352 | 362 | int off=0; |
|
353 | public void set_by_mk_data(int[] in_arr,MKVersion version) |
363 | if (version.proto_minor>0) // fixme |
354 | { |
364 | off++; |
355 | Longitude=parse_arr_4(0,in_arr); |
365 | Longitude=parse_arr_4(off+0,in_arr); |
Line 356... | Line 366... | ||
356 | Latitude=parse_arr_4(4,in_arr); |
366 | Latitude=parse_arr_4(off+4,in_arr); |
357 | Altitude=parse_arr_4(8,in_arr); |
367 | Altitude=parse_arr_4(off+8,in_arr); |
358 | //status=in_arr[12]; |
368 | //status=in_arr[12]; |
359 | 369 | ||
Line 360... | Line 370... | ||
360 | TargetLongitude=parse_arr_4(13,in_arr); |
370 | TargetLongitude=parse_arr_4(off+13,in_arr); |
361 | TargetLatitude=parse_arr_4(17,in_arr); |
371 | TargetLatitude=parse_arr_4(off+17,in_arr); |
Line 362... | Line 372... | ||
362 | TargetAltitude=parse_arr_4(21,in_arr); |
372 | TargetAltitude=parse_arr_4(off+21,in_arr); |
363 | //Targetstatus=in_arr[25]; |
373 | //Targetstatus=in_arr[25]; |
364 | 374 | ||
365 | Distance2Target=parse_arr_2(26,in_arr); |
375 | Distance2Target=parse_arr_2(off+26,in_arr); |
Line 366... | Line 376... | ||
366 | Angle2Target=parse_arr_2(28,in_arr); |
376 | Angle2Target=parse_arr_2(off+28,in_arr); |
367 | 377 | ||
Line 368... | Line 378... | ||
368 | HomeLongitude=parse_arr_4(30,in_arr); |
378 | HomeLongitude=parse_arr_4(off+30,in_arr); |
369 | HomeLatitude=parse_arr_4(34,in_arr); |
379 | HomeLatitude=parse_arr_4(off+34,in_arr); |
Line 370... | Line 380... | ||
370 | HomeAltitude=parse_arr_4(38,in_arr); |
380 | HomeAltitude=parse_arr_4(off+38,in_arr); |
Line 371... | Line 381... | ||
371 | //Targetstatus=in_arr[42]; |
381 | //Targetstatus=in_arr[42]; |
372 | 382 | ||
373 | Distance2Home=parse_arr_2(43,in_arr); |
383 | Distance2Home=parse_arr_2(off+43,in_arr); |
Line 374... | Line 384... | ||
374 | Angle2Home=parse_arr_2(45,in_arr); |
384 | Angle2Home=parse_arr_2(off+45,in_arr); |
Line 375... | Line 385... | ||
375 | 385 | ||
376 | WayPointIndex=(byte)in_arr[47]; |
386 | WayPointIndex=(byte)in_arr[off+47]; |
377 | WayPointNumber=(byte)in_arr[48]; |
387 | WayPointNumber=(byte)in_arr[off+48]; |
Line 378... | Line 388... | ||
378 | 388 | ||
379 | SatsInUse=(byte)in_arr[49]; |
389 | SatsInUse=(byte)in_arr[off+49]; |
380 | 390 | ||
Line 381... | Line 391... | ||
381 | 391 | ||
382 | Altimeter=parse_arr_2(50,in_arr); // hight according to air pressure |
392 | Altimeter=parse_arr_2(off+50,in_arr); // hight according to air pressure |
Line 383... | Line 393... | ||
383 | Variometer=parse_arr_2(52,in_arr);; // climb(+) and sink(-) rate |
393 | Variometer=parse_arr_2(off+52,in_arr);; // climb(+) and sink(-) rate |
Line 384... | Line 394... | ||
384 | FlyingTime=parse_arr_2(54,in_arr);; |
394 | FlyingTime=parse_arr_2(off+54,in_arr);; |