Rev 266 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 266 | Rev 381 | ||
---|---|---|---|
Line 16... | Line 16... | ||
16 | public int bytes_out=0; |
16 | public int bytes_out=0; |
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
20 | public int resend_count=0; |
20 | public int resend_count=0; |
- | 21 | public int crc_fail=0; |
|
21 | 22 | ||
22 | public int debug_data_count=0; |
23 | public int debug_data_count=0; |
23 | public int debug_names_count=0; |
24 | public int debug_names_count=0; |
24 | public int angle_data_count=0; |
25 | public int angle_data_count=0; |
25 | public int version_data_count=0; |
26 | public int version_data_count=0; |
Line 53... | Line 54... | ||
53 | public long speed_sum=0; |
54 | public long speed_sum=0; |
54 | public int speed_cnt=1; |
55 | public int speed_cnt=1; |
55 | 56 | ||
56 | public int max_alt=0; |
57 | public int max_alt=0; |
57 | 58 | ||
- | 59 | ||
- | 60 | public MKStatistics() |
|
- | 61 | { |
|
- | 62 | reset(); |
|
- | 63 | } |
|
58 | public int avg_speed() |
64 | public int avg_speed() |
59 | { |
65 | { |
60 | return (int)(speed_sum/speed_cnt); |
66 | return (int)(speed_sum/speed_cnt); |
61 | } |
67 | } |
62 | public void process_speed(int speed) |
68 | public void process_speed(int speed) |
Line 74... | Line 80... | ||
74 | 80 | ||
75 | } |
81 | } |
76 | public void process_mkflags(int flags) |
82 | public void process_mkflags(int flags) |
77 | { |
83 | { |
78 | if (flags==0) |
84 | if (flags==0) |
79 | - | ||
80 | flying_start=-1; |
85 | flying_start=-1; |
81 | 86 | ||
82 | else |
87 | else |
83 | 88 | ||
84 | if (flying_start==-1) |
89 | if (flying_start==-1) |
Line 103... | Line 108... | ||
103 | } |
108 | } |
104 | 109 | ||
105 | 110 | ||
106 | public void reset() |
111 | public void reset() |
107 | { |
112 | { |
- | 113 | flying_start=-1; |
|
108 | 114 | crc_fail=0; |
|
109 | debug_data_count=0; |
115 | debug_data_count=0; |
110 | debug_names_count=0; |
116 | debug_names_count=0; |
111 | angle_data_count=0; |
117 | angle_data_count=0; |
112 | version_data_count=0; |
118 | version_data_count=0; |
113 | other_data_count=0; |
119 | other_data_count=0; |