Rev 219 | Rev 266 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 219 | Rev 265 | ||
---|---|---|---|
Line 10... | Line 10... | ||
10 | package org.ligi.ufo; |
10 | package org.ligi.ufo; |
Line 11... | Line 11... | ||
11 | 11 | ||
Line 12... | Line 12... | ||
12 | public class MKStatistics |
12 | public class MKStatistics |
13 | - | ||
14 | { |
13 | |
15 | 14 | { |
|
Line -... | Line 15... | ||
- | 15 | public int bytes_in=0; |
|
16 | public int bytes_in=0; |
16 | public int bytes_out=0; |
Line 17... | Line 17... | ||
17 | public int bytes_out=0; |
17 | |
18 | 18 | ||
19 | 19 | ||
Line 40... | Line 40... | ||
40 | public int stick_data_request_count=0; |
40 | public int stick_data_request_count=0; |
41 | public int motortest_request_count=0; |
41 | public int motortest_request_count=0; |
42 | public int external_control_request_count=0; |
42 | public int external_control_request_count=0; |
Line -... | Line 43... | ||
- | 43 | ||
- | 44 | ||
- | 45 | ||
- | 46 | public long flying_start=-1; |
|
- | 47 | ||
- | 48 | public int heading_start=0; |
|
- | 49 | public int last_heading=0; |
|
- | 50 | ||
- | 51 | public void process_mkflags(int flags) |
|
- | 52 | { |
|
- | 53 | if (flags==0) |
|
- | 54 | ||
- | 55 | flying_start=-1; |
|
- | 56 | ||
- | 57 | else |
|
- | 58 | ||
- | 59 | if (flying_start==-1) |
|
- | 60 | { |
|
- | 61 | flying_start=System.currentTimeMillis(); |
|
- | 62 | heading_start=last_heading; |
|
- | 63 | } |
|
- | 64 | ||
- | 65 | } |
|
- | 66 | ||
- | 67 | public void process_compas(int heading) |
|
- | 68 | { |
|
- | 69 | last_heading=heading; |
|
- | 70 | } |
|
- | 71 | ||
- | 72 | public int flying_time() |
|
- | 73 | { |
|
- | 74 | if (flying_start!=-1) |
|
- | 75 | return (int)((System.currentTimeMillis()-flying_start)/1000); |
|
- | 76 | else |
|
- | 77 | return 0; |
|
- | 78 | } |
|
43 | 79 | ||
44 | 80 | ||
Line 45... | Line 81... | ||
45 | public void reset() |
81 | public void reset() |
46 | { |
82 | { |