Rev 229 | Rev 269 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 229 | Rev 265 | ||
---|---|---|---|
Line 105... | Line 105... | ||
105 | 105 | ||
Line 106... | Line 106... | ||
106 | 106 | ||
- | 107 | } |
|
- | 108 | ||
- | 109 | int info_from_debug_set=-1; |
|
- | 110 | int volt_timeout=0; |
|
107 | } |
111 | |
108 | 112 | public int last_alt=-1; |
|
109 | int info_from_debug_set=-1; |
113 | |
110 | public void run() |
114 | public void run() |
111 | { |
115 | { |
112 | while(true) |
116 | while(true) |
113 | { |
- | |
114 | if (mk.connected&&(canvas.settings.do_sound)&&(mk.debug_data.UBatt()!=-1)&&(!mk.force_disconnect)) |
117 | { |
115 | { |
118 | if (mk.connected&&(canvas.settings.do_sound)&&(mk.UBatt()!=-1)&&(!mk.force_disconnect)) |
116 | int ubatt=mk.debug_data.UBatt(); |
- | |
117 | - | ||
118 | if (info_from_debug_set!=mk.stats.debug_data_count) |
- | |
119 | { |
119 | { |
Line 120... | Line 120... | ||
120 | info_from_debug_set=mk.stats.debug_data_count; |
120 | |
121 | start_playing(""+(ubatt/10)); |
121 | if (info_from_debug_set!=mk.stats.debug_data_count) |
- | 122 | { // only when newdata |
|
- | 123 | ||
- | 124 | if (canvas.settings.do_volts_sound&&(volt_timeout--<0)) |
|
122 | wait_for_end(); |
125 | { |
123 | 126 | volt_timeout=delay*10; |
|
- | 127 | int ubatt=mk.UBatt(); |
|
- | 128 | info_from_debug_set=mk.stats.debug_data_count; |
|
- | 129 | start_playing(""+(ubatt/10)); |
|
- | 130 | wait_for_end(); |
|
- | 131 | ||
124 | if((ubatt%10)!=0) |
132 | if((ubatt%10)!=0) |
- | 133 | { |
|
- | 134 | start_playing("komma"); |
|
- | 135 | wait_for_end(); |
|
125 | { |
136 | start_playing(""+(ubatt%10)); |
126 | start_playing("komma"); |
137 | wait_for_end(); |
- | 138 | } |
|
- | 139 | start_playing("volt"); |
|
- | 140 | wait_for_end(); |
|
- | 141 | } |
|
- | 142 | ||
- | 143 | ||
- | 144 | ||
- | 145 | if (canvas.settings.do_altimeter_sound) |
|
- | 146 | { |
|
- | 147 | if (last_alt==-1) last_alt=mk.Alt(); |
|
127 | wait_for_end(); |
148 | int alt_diff=10; |
- | 149 | ||
- | 150 | if (last_alt>mk.Alt()+alt_diff) |
|
- | 151 | { |
|
- | 152 | start_playing("down"); |
|
- | 153 | wait_for_end(); |
|
- | 154 | last_alt-=alt_diff; |
|
- | 155 | } |
|
- | 156 | if (last_alt<mk.Alt()-alt_diff) |
|
- | 157 | ||
- | 158 | { |
|
- | 159 | start_playing("up"); |
|
- | 160 | wait_for_end(); |
|
- | 161 | last_alt+=alt_diff; |
|
128 | start_playing(""+(ubatt%10)); |
162 | } |
Line 129... | Line 163... | ||
129 | wait_for_end(); |
163 | } |
Line 130... | Line 164... | ||
130 | } |
164 | else |
- | 165 | last_alt=-1; |
|
- | 166 | } |
|
131 | start_playing("volt"); |
167 | |
132 | } |
168 | } |
133 | 169 | ||
134 | } |
170 | try { |
- | 171 | Thread.sleep(100); |
|
135 | 172 | /* |
|
136 | try { |
173 | if (delay<1) |
Line 137... | Line 174... | ||
137 | if (delay<1) |
174 | Thread.sleep(1000); |
138 | Thread.sleep(1000); |
175 | else |