Rev 269 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 269 | Rev 382 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | public class DUBwiseSettings |
15 | public class DUBwiseSettings |
16 | extends org.ligi.ufo.ParamsClass |
16 | extends org.ligi.ufo.ParamsClass |
17 | implements org.ligi.ufo.DUBwiseDefinitions,DUBwiseUIDefinitions,org.ligi.ufo.DUBwiseLangDefs |
17 | implements org.ligi.ufo.DUBwiseDefinitions,DUBwiseUIDefinitions,org.ligi.ufo.DUBwiseLangDefs |
18 | { |
18 | { |
19 | // name/handle for the recordStore to memorize some stuff |
19 | // name/handle for the recordStore to memorize some stuff |
20 | private final static String RECORD_STORE_NAME="DUBSETT_V4"; |
20 | private final static String RECORD_STORE_NAME="DUBSETT_V5"; |
Line 21... | Line 21... | ||
21 | 21 | ||
22 | /* all settings hold here */ |
- | |
23 | //holds id of actual skin |
22 | /* all settings hold here */ |
Line 24... | Line 23... | ||
24 | public byte act_skin=SKINID_DARK; |
23 | public byte act_skin=SKINID_DARK; |
25 | 24 | ||
26 | public int key_back; |
25 | public int key_back; |
Line 27... | Line 26... | ||
27 | public int key_fullscreen; |
26 | public int key_fullscreen; |
28 | public int key_clear; |
27 | public int key_clear; |
29 | - | ||
30 | public int voice_delay; |
- | |
31 | public int voice_volume; |
28 | |
32 | - | ||
33 | - | ||
34 | public byte graph_interval=1; |
29 | public int voice_delay; |
35 | - | ||
36 | 30 | public int voice_volume; |
|
37 | public int remote_cam_stick; |
31 | public byte graph_interval; |
Line 38... | Line 32... | ||
38 | 32 | public int remote_cam_stick; |
|
39 | public String connection_name=""; |
33 | public String connection_name=""; |
40 | public String connection_url=""; |
34 | public String connection_url=""; |
41 | 35 | ||
Line -... | Line 36... | ||
- | 36 | public boolean do_vibra; |
|
Line 42... | Line 37... | ||
42 | public boolean do_vibra=true; |
37 | public boolean do_sound; |
Line 43... | Line 38... | ||
43 | public boolean do_sound=true; |
38 | public boolean do_volts_sound; |
44 | public boolean do_volts_sound=true; |
39 | public boolean do_altimeter_sound; |
45 | public boolean do_altimeter_sound=true; |
40 | |
46 | 41 | public boolean big_fonts; |
|
- | 42 | ||
- | 43 | public byte altsteps; |
|
- | 44 | ||
- | 45 | public boolean horizon_invert_nick; |
|
- | 46 | public boolean horizon_invert_roll; |
|
- | 47 | public boolean horizon_display_altitude; |
|
Line 47... | Line 48... | ||
47 | 48 | public boolean horizon_display_flytime; |
|
48 | public byte altsteps; |
- | |
49 | 49 | ||
50 | public boolean horizon_invert_nick=true; |
- | |
Line -... | Line 50... | ||
- | 50 | public boolean fullscreen; |
|
- | 51 | public boolean do_scrollbg; |
|
Line 51... | Line -... | ||
51 | public boolean horizon_invert_roll=true; |
- | |
52 | public boolean horizon_display_altitude=true; |
- | |
Line 53... | Line -... | ||
53 | public boolean horizon_display_flytime=true; |
- | |
54 | - | ||
Line 55... | Line 52... | ||
55 | public boolean fullscreen=false; |
52 | public boolean expert_mode; |
56 | public boolean do_scrollbg=false; |
53 | public boolean dev_mode; |
57 | public boolean expert_mode=false; |
54 | public boolean betatester_mode; |
Line 58... | Line 55... | ||
58 | public boolean dev_mode=false; |
55 | |
59 | 56 | public boolean reload_settings; |
|
Line 60... | Line -... | ||
60 | - | ||
61 | - | ||
62 | public boolean reload_settings=false; |
- | |
63 | public boolean instant_error_show=false; |
- | |
64 | 57 | public boolean instant_error_show; |
|
65 | public boolean graph_legend; |
- | |
66 | public boolean graph_scale; |
- | |
67 | - | ||
68 | //#if devicecontrol=="on" |
- | |
69 | public boolean keep_lighton=false; |
- | |
70 | //#endif |
- | |
71 | - | ||
Line 72... | Line -... | ||
72 | int[] act_proxy_ip=default_ip; // { ip , ip , ip , ip , port } |
- | |
73 | int[] act_conn_ip=default_ip; // { ip , ip , ip , ip , port } |
- | |
74 | - | ||
75 | - | ||
76 | // public byte gps_format=GPS_FORMAT_DECIMAL; |
- | |
77 | // public byte speed_format=SPEED_FORMAT_KMH; |
- | |
Line 78... | Line 58... | ||
78 | 58 | ||
79 | 59 | public boolean graph_legend; |
|
80 | int[] settings_field; |
60 | public boolean graph_scale; |
81 | 61 | ||
Line 110... | Line 90... | ||
110 | public final static int SETTINGS_POS_BITFIELD2 =14; |
90 | public final static int SETTINGS_POS_BITFIELD2 =14; |
111 | public final static int SETTINGS_POS_LANG =15; |
91 | public final static int SETTINGS_POS_LANG =15; |
112 | public final static int SETTINGS_POS_GRAPHINTERVAL =16; |
92 | public final static int SETTINGS_POS_GRAPHINTERVAL =16; |
113 | public final static int SETTINGS_POS_BITFIELD3 =17; |
93 | public final static int SETTINGS_POS_BITFIELD3 =17; |
114 | public final static int SETTINGS_POS_ALTSTEPS =18; |
94 | public final static int SETTINGS_POS_ALTSTEPS =18; |
- | 95 | public final static int SETTINGS_POS_CAMSTICK =19; |
|
- | 96 | ||
- | 97 | public final static int SETTINGS_POS_PRIMARYABO =20; |
|
- | 98 | public final static int SETTINGS_POS_SECONDARYABO =21; |
|
- | 99 | public final static int SETTINGS_POS_DEFAULTABO =22; |
|
- | 100 | public final static int SETTINGS_FIELD_LENGTH =23; |
|
- | 101 | ||
- | 102 | ||
- | 103 | ||
- | 104 | int[] settings_field; |
|
- | 105 | ||
- | 106 | public int get_field_from_act(int pos) { return settings_field[pos];} |
|
- | 107 | public void set_field_from_act(int pos,int val){ |
|
- | 108 | ||
- | 109 | settings_field[pos]=val; |
|
- | 110 | field2setting(pos,val); |
|
- | 111 | } |
|
- | 112 | ||
- | 113 | public void toggle_fullscreen() |
|
- | 114 | { |
|
- | 115 | // fullscreen=!fullscreen; |
|
- | 116 | set_field_from_act(1,settings_field[1]^1); |
|
- | 117 | // if (fullscreen)canvas.setFullScreenMode(true); |
|
- | 118 | } |
|
- | 119 | ||
- | 120 | public void set_betatester() |
|
- | 121 | { |
|
- | 122 | settings_field[SETTINGS_POS_BITFIELD3]|=2; |
|
- | 123 | } |
|
Line 115... | Line 124... | ||
115 | 124 | ||
116 | public void field2setting(int pos,int val) |
125 | public void field2setting(int pos,int val) |
- | 126 | { |
|
- | 127 | try { |
|
- | 128 | boolean new_fullscreen=fullscreen; |
|
- | 129 | boolean new_do_scrollbg=do_scrollbg; |
|
117 | { |
130 | |
118 | switch (pos) |
131 | switch (pos) |
119 | { |
132 | { |
120 | case SETTINGS_POS_ALTSTEPS: |
133 | case SETTINGS_POS_ALTSTEPS: |
121 | altsteps=(byte)val; |
134 | altsteps=(byte)val; |
Line 125... | Line 138... | ||
125 | graph_interval=1; |
138 | graph_interval=1; |
126 | else |
139 | else |
127 | graph_interval=(byte)val; |
140 | graph_interval=(byte)val; |
128 | break; |
141 | break; |
Line 129... | Line -... | ||
129 | - | ||
130 | } |
- | |
131 | - | ||
132 | if (pos==SETTINGS_POS_LANG) |
- | |
133 | { |
- | |
134 | canvas.act_lang=(byte)val; |
- | |
135 | canvas.load_strings(); |
- | |
136 | } |
- | |
137 | - | ||
138 | - | ||
139 | if (pos==SETTINGS_POS_SKIN) |
- | |
140 | { |
- | |
141 | act_skin=(byte)val; |
- | |
142 | canvas.load_skin_images(); |
- | |
143 | } |
- | |
144 | - | ||
145 | if ((pos==SETTINGS_POS_BITFIELD1)&&((val&1)==1)&&(!fullscreen)) |
- | |
146 | { |
- | |
147 | fullscreen=true; |
- | |
148 | canvas.setFullScreenMode(fullscreen); |
- | |
149 | } |
- | |
150 | - | ||
151 | if ((pos==SETTINGS_POS_BITFIELD1)&&((val&1)==0)&&(fullscreen)) |
- | |
152 | { |
- | |
153 | fullscreen=false; |
- | |
154 | canvas.setFullScreenMode(fullscreen); |
- | |
155 | } |
- | |
156 | - | ||
157 | if ((pos==SETTINGS_POS_BITFIELD1)&&((val&2)==2)&&(!do_scrollbg)) |
- | |
158 | { |
- | |
159 | do_scrollbg=true; |
- | |
160 | canvas.load_skin_images(); |
- | |
161 | } |
- | |
162 | - | ||
163 | if ((pos==SETTINGS_POS_BITFIELD1)&&((val&2)==0)&&(do_scrollbg)) |
- | |
164 | { |
- | |
165 | do_scrollbg=false; |
- | |
166 | canvas.load_skin_images(); |
- | |
167 | } |
- | |
168 | - | ||
169 | - | ||
170 | if (pos==SETTINGS_POS_BITFIELD1) |
- | |
Line 171... | Line 142... | ||
171 | do_sound=((val&4)!=0); |
142 | |
- | 143 | ||
172 | 144 | case SETTINGS_POS_BITFIELD1: |
|
173 | if (pos==SETTINGS_POS_BITFIELD1) |
145 | new_fullscreen=((val&1)!=0); |
- | 146 | new_do_scrollbg=((val&2)!=0); |
|
174 | do_vibra=((val&8)!=0); |
147 | |
175 | 148 | do_sound=((val&4)!=0); |
|
176 | if (pos==SETTINGS_POS_BITFIELD1) |
- | |
177 | expert_mode=((val&16)!=0); |
149 | do_vibra=((val&8)!=0); |
178 | 150 | expert_mode=((val&16)!=0); |
|
179 | if (pos==SETTINGS_POS_BITFIELD1) |
151 | //#if devicecontrol=="on" |
180 | keep_lighton=((val&32)!=0); |
- | |
181 | 152 | keep_lighton=((val&32)!=0); |
|
182 | if (pos==SETTINGS_POS_BITFIELD1) |
- | |
183 | graph_legend=((val&64)!=0); |
- | |
184 | 153 | //#endif |
|
185 | if (pos==SETTINGS_POS_BITFIELD1) |
- | |
186 | graph_scale=((val&128)!=0); |
- | |
187 | - | ||
188 | - | ||
189 | - | ||
190 | if (pos==SETTINGS_POS_GPS_FORMAT) |
- | |
191 | canvas.mk.gps_position.act_gps_format=(byte)val; |
- | |
192 | - | ||
193 | if (pos==SETTINGS_POS_SPEED_FORMAT) |
- | |
194 | canvas.mk.gps_position.act_speed_format=(byte)val; |
- | |
195 | - | ||
Line 196... | Line 154... | ||
196 | if (pos==SETTINGS_POS_EXTERN_NICK) |
154 | graph_legend=((val&64)!=0); |
197 | default_extern_control[EXTERN_CONTROL_NICK]=(byte)val; |
- | |
Line 198... | Line 155... | ||
198 | 155 | graph_scale=((val&128)!=0); |
|
- | 156 | ||
- | 157 | break; |
|
199 | if (pos==SETTINGS_POS_EXTERN_ROLL) |
158 | |
- | 159 | case SETTINGS_POS_BITFIELD2: |
|
- | 160 | do_volts_sound=((val&1)!=0); |
|
- | 161 | reload_settings=((val&2)!=0); |
|
- | 162 | do_altimeter_sound=((val&4)!=0); |
|
- | 163 | horizon_invert_roll=((val&8)!=0); |
|
- | 164 | horizon_invert_nick=((val&16)!=0); |
|
Line 200... | Line 165... | ||
200 | default_extern_control[EXTERN_CONTROL_ROLL]=(byte)val; |
165 | horizon_display_flytime=((val&32)!=0); |
- | 166 | horizon_display_altitude=((val&64)!=0); |
|
201 | 167 | dev_mode=((val&128)!=0); |
|
- | 168 | break; |
|
- | 169 | ||
- | 170 | case SETTINGS_POS_BITFIELD3: |
|
Line -... | Line 171... | ||
- | 171 | instant_error_show=((val&1)!=0); |
|
- | 172 | betatester_mode=((val&2)!=0); |
|
- | 173 | big_fonts=((val&4)!=0); |
|
- | 174 | canvas.regenerate_fonts=true; |
|
- | 175 | break; |
|
- | 176 | ||
- | 177 | case SETTINGS_POS_GPS_FORMAT: |
|
- | 178 | canvas.mk.gps_position.act_gps_format=(byte)val; |
|
- | 179 | break; |
|
- | 180 | case SETTINGS_POS_SPEED_FORMAT: |
|
- | 181 | canvas.mk.gps_position.act_speed_format=(byte)val; |
|
- | 182 | break; |
|
- | 183 | case SETTINGS_POS_EXTERN_NICK: |
|
- | 184 | default_extern_control[EXTERN_CONTROL_NICK]=(byte)val; |
|
- | 185 | break; |
|
- | 186 | case SETTINGS_POS_EXTERN_ROLL: |
|
- | 187 | default_extern_control[EXTERN_CONTROL_ROLL]=(byte)val; |
|
- | 188 | break; |
|
202 | if (pos==SETTINGS_POS_EXTERN_GIER) |
189 | case SETTINGS_POS_EXTERN_GIER: |
203 | default_extern_control[EXTERN_CONTROL_GIER]=(byte)val; |
190 | default_extern_control[EXTERN_CONTROL_GIER]=(byte)val; |
- | 191 | break; |
|
Line -... | Line 192... | ||
- | 192 | case SETTINGS_POS_EXTERN_GAS: |
|
- | 193 | default_extern_control[EXTERN_CONTROL_GAS]=(byte)val; |
|
- | 194 | break; |
|
- | 195 | case SETTINGS_POS_EXTERN_HIGHT: |
|
- | 196 | default_extern_control[EXTERN_CONTROL_HIGHT]=(byte)val; |
|
- | 197 | break; |
|
- | 198 | ||
- | 199 | case SETTINGS_POS_KEY_BACK: |
|
- | 200 | key_back=val; |
|
- | 201 | break; |
|
- | 202 | case SETTINGS_POS_KEY_FULL: |
|
- | 203 | key_fullscreen=val; |
|
Line 204... | Line 204... | ||
204 | 204 | break; |
|
205 | if (pos==SETTINGS_POS_EXTERN_GAS) |
205 | case SETTINGS_POS_KEY_CLEAR: |
- | 206 | key_clear=val; |
|
- | 207 | break; |
|
Line 206... | Line 208... | ||
206 | default_extern_control[EXTERN_CONTROL_GAS]=(byte)val; |
208 | case SETTINGS_POS_CAMSTICK: |
207 | 209 | remote_cam_stick=val; |
|
- | 210 | break; |
|
- | 211 | ||
Line 208... | Line -... | ||
208 | if (pos==SETTINGS_POS_EXTERN_HIGHT) |
- | |
209 | default_extern_control[EXTERN_CONTROL_HIGHT]=(byte)val; |
- | |
Line 210... | Line -... | ||
210 | - | ||
211 | - | ||
Line 212... | Line 212... | ||
212 | if (pos==SETTINGS_POS_KEY_BACK) |
212 | case SETTINGS_POS_LANG: |
213 | key_back=val; |
213 | canvas.act_lang=(byte)val; |
214 | 214 | canvas.load_strings(); |
|
215 | if (pos==SETTINGS_POS_KEY_FULL) |
215 | break; |
216 | key_fullscreen=val; |
216 | |
Line 217... | Line 217... | ||
217 | 217 | case SETTINGS_POS_SKIN: |
|
218 | if (pos==SETTINGS_POS_KEY_CLEAR) |
218 | act_skin=(byte)val; |
- | 219 | canvas.load_skin_images(); |
|
219 | key_clear=val; |
220 | break; |
220 | - | ||
221 | if (pos==12) |
221 | |
222 | remote_cam_stick=val; |
222 | |
223 | 223 | ||
Line 224... | Line 224... | ||
224 | 224 | ||
225 | if(pos==SETTINGS_POS_VOICEVOLUME) |
225 | case SETTINGS_POS_VOICEVOLUME: |
226 | { |
- | |
227 | voice_volume=val; |
- | |
228 | //#if voice_mode!="no_voice" |
- | |
229 | canvas.status_voice.volume=voice_volume; |
- | |
230 | - | ||
231 | //#endif |
- | |
232 | } |
- | |
233 | if(pos==SETTINGS_POS_VOICEDELAY) |
- | |
234 | { |
- | |
235 | voice_delay=val; |
- | |
236 | //#if voice_mode!="no_voice" |
- | |
237 | canvas.status_voice.delay=voice_delay; |
- | |
238 | - | ||
Line 239... | Line -... | ||
239 | //#endif |
- | |
240 | } |
- | |
Line 241... | Line 226... | ||
241 | 226 | ||
- | 227 | voice_volume=val; |
|
- | 228 | //#if voice_mode!="no_voice" |
|
- | 229 | canvas.status_voice.volume=voice_volume; |
|
- | 230 | ||
- | 231 | //#endif |
|
- | 232 | break; |
|
242 | if (pos==SETTINGS_POS_BITFIELD2) |
233 | |
- | 234 | case SETTINGS_POS_VOICEDELAY: |
|
Line 243... | Line 235... | ||
243 | do_volts_sound=((val&1)!=0); |
235 | voice_delay=val; |
244 | - | ||
Line 245... | Line 236... | ||
245 | if (pos==SETTINGS_POS_BITFIELD2) |
236 | //#if voice_mode!="no_voice" |
- | 237 | canvas.status_voice.delay=voice_delay; |
|
246 | reload_settings=((val&2)!=0); |
238 | |
- | 239 | //#endif |
|
- | 240 | break; |
|
Line 247... | Line 241... | ||
247 | 241 | ||
- | 242 | ||
- | 243 | case SETTINGS_POS_PRIMARYABO: |
|
248 | if (pos==SETTINGS_POS_BITFIELD2) |
244 | canvas.mk.primary_abo=val; |
- | 245 | break; |
|
Line -... | Line 246... | ||
- | 246 | case SETTINGS_POS_SECONDARYABO: |
|
249 | do_altimeter_sound=((val&4)!=0); |
247 | canvas.mk.secondary_abo=val; |
250 | 248 | break; |
|
251 | 249 | case SETTINGS_POS_DEFAULTABO: |
|
252 | if (pos==SETTINGS_POS_BITFIELD2) |
250 | canvas.mk.default_abo=val; |
Line 253... | Line 251... | ||
253 | horizon_invert_roll=((val&8)!=0); |
251 | break; |
254 | 252 | ||
255 | if (pos==SETTINGS_POS_BITFIELD2) |
253 | } |
- | 254 | ||
Line 256... | Line 255... | ||
256 | horizon_invert_nick=((val&16)!=0); |
255 | if (new_fullscreen!=fullscreen) |
Line 257... | Line 256... | ||
257 | 256 | { |
|
258 | if (pos==SETTINGS_POS_BITFIELD2) |
257 | fullscreen=new_fullscreen; |
259 | horizon_display_flytime=((val&32)!=0); |
- | |
Line 260... | Line 258... | ||
260 | 258 | canvas.setFullScreenMode(fullscreen); |
|
261 | if (pos==SETTINGS_POS_BITFIELD2) |
259 | } |
262 | horizon_display_altitude=((val&64)!=0); |
260 | |
Line 303... | Line 301... | ||
303 | } |
301 | } |
Line 304... | Line 302... | ||
304 | 302 | ||
Line 305... | Line -... | ||
305 | public byte[] default_extern_control;//=default_extern_keycontrol ; |
- | |
306 | - | ||
307 | - | ||
308 | /* end of all settings hold here */ |
- | |
309 | - | ||
310 | // public String[] _tab_names={"User Interface","GPS","Keycontrol","Special Keys","Graph","Voice","Other" }; |
303 | public byte[] default_extern_control;//=default_extern_keycontrol ; |
Line 311... | Line 304... | ||
311 | 304 | ||
312 | 305 | ||
313 | public int[] _tab_stringids={STRINGID_USERINTERFACE,STRINGID_UNITS,STRINGID_KEYCONTROL,STRINGID_SPECIALKEYS,STRINGID_GRAPH,STRINGID_SOUND,STRINGID_COCKPIT,STRINGID_OTHER}; |
306 | public int[] _tab_stringids={STRINGID_USERINTERFACE,STRINGID_UNITS,STRINGID_KEYCONTROL,STRINGID_SPECIALKEYS,STRINGID_GRAPH,STRINGID_SOUND,STRINGID_COCKPIT,STRINGID_TIMING,STRINGID_OTHER}; |
314 | 307 | ||
315 | 308 | ||
316 | public int[][] _field_stringids ={ |
309 | public int[][] _field_stringids ={ |
317 | { |
310 | { |
318 | STRINGID_LANGUAGE, |
311 | STRINGID_LANGUAGE, |
319 | STRINGID_SKIN, |
312 | STRINGID_SKIN, |
- | 313 | STRINGID_FULLSCREEN, |
|
320 | STRINGID_FULLSCREEN, |
314 | STRINGID_SCROLLBG |
321 | STRINGID_SCROLLBG |
315 | //#if devicecontrol=="on" |
322 | //#if devicecontrol=="on" |
316 | ,STRINGID_PERMALIGHT |
323 | ,STRINGID_PERMALIGHT |
317 | //#endif |
324 | //#endif |
318 | ,STRINGID_BIGFONTS |
325 | }, |
319 | }, |
326 | {STRINGID_SPEEDFORMAT,STRINGID_GPSFORMAT}, |
320 | {STRINGID_SPEEDFORMAT,STRINGID_GPSFORMAT}, |
- | 321 | {STRINGID_NICK ,STRINGID_ROLL,STRINGID_GIER,STRINGID_GASINCREASE,STRINGID_HEIGHTINCREASE }, |
|
327 | {STRINGID_NICK ,STRINGID_ROLL,STRINGID_GIER,STRINGID_GASINCREASE,STRINGID_HEIGHTINCREASE }, |
322 | {STRINGID_BACKTOMAINMENU,STRINGID_FULLSCREEN,STRINGID_CLEAR }, |
Line 328... | Line 323... | ||
328 | {STRINGID_BACKTOMAINMENU,STRINGID_FULLSCREEN,STRINGID_CLEAR }, |
323 | {STRINGID_LEGEND,STRINGID_SCALEGRID,STRINGID_GRAPHINTERVAL}, |
Line 329... | Line 324... | ||
329 | {STRINGID_LEGEND,STRINGID_SCALEGRID,STRINGID_GRAPHINTERVAL}, |
324 | {STRINGID_SOUND,STRINGID_VOLTS,STRINGID_DELAYINS,STRINGID_ALTIMETER,STRINGID_ALTSTEPS,STRINGID_VOLUME}, |
330 | {STRINGID_SOUND,STRINGID_VOLTS,STRINGID_DELAYINS,STRINGID_ALTIMETER,STRINGID_ALTSTEPS,STRINGID_VOLUME}, |
325 | {STRINGID_SHOWALTITUDE,STRINGID_SHOWFLIGHTTIME,STRINGID_INVERTROLL,STRINGID_INVERTNICK}, |
331 | {STRINGID_SHOWALTITUDE,STRINGID_SHOWFLIGHTTIME,STRINGID_INVERTROLL,STRINGID_INVERTNICK}, |
326 | {STRINGID_PRIMARYABO,STRINGID_SECONDARYABO,STRINGID_DEFAULTABO}, //// |
332 | {STRINGID_INSTANTERRORSHOW,STRINGID_VIBRA,STRINGID_REMOTECAMSTICK,STRINGID_ALWAYSRELOADPARAMS,STRINGID_EXPERTMODE,STRINGID_DEVMODE}}; |
- | |
333 | 327 | {STRINGID_INSTANTERRORSHOW,STRINGID_VIBRA,STRINGID_REMOTECAMSTICK,STRINGID_ALWAYSRELOADPARAMS,STRINGID_EXPERTMODE,STRINGID_DEVMODE}}; |
|
334 | 328 | ||
- | 329 | ||
335 | 330 | ||
336 | 331 | ||
337 | public int[][] _choice_stringids={ {STRINGID_LANG0,STRINGID_LANG1}, /* FIXME - make dynamic */{ STRINGID_DARK,STRINGID_LIGHT } , {STRINGID_KMH,STRINGID_MPH,STRINGID_CMS},{STRINGID_DECIMAL,STRINGID_MINSEC} } ; |
332 | public int[][] _choice_stringids={ {STRINGID_LANG0,STRINGID_LANG1,STRINGID_LANG2}, /* FIXME - make dynamic */{ STRINGID_DARK,STRINGID_LIGHT } , {STRINGID_KMH,STRINGID_MPH,STRINGID_CMS},{STRINGID_DECIMAL,STRINGID_MINSEC} } ; |
- | 333 | ||
- | 334 | ||
338 | 335 | ||
339 | 336 | public int[][] _field_positions= { |
|
340 | 337 | {SETTINGS_POS_LANG,SETTINGS_POS_SKIN,8,9 |
|
341 | public int[][] _field_positions= { |
338 | //#if devicecontrol=="on" |
342 | {SETTINGS_POS_LANG,SETTINGS_POS_SKIN,8,9 |
339 | ,13 |
343 | //#if devicecontrol=="on" |
340 | //#endif |
- | 341 | , SETTINGS_POS_BITFIELD3*8+2 |
|
344 | 342 | } , {2,3} , {4,5,6,7,8} , {9,10,11},{SETTINGS_POS_BITFIELD1*8 +6,SETTINGS_POS_BITFIELD1*8 +7, SETTINGS_POS_GRAPHINTERVAL} , |
|
345 | ,13 |
343 | {SETTINGS_POS_BITFIELD1*8+2,SETTINGS_POS_BITFIELD2*8+0,SETTINGS_POS_VOICEDELAY,SETTINGS_POS_BITFIELD2*8+2,SETTINGS_POS_ALTSTEPS,SETTINGS_POS_VOICEVOLUME }, |
346 | //#endif |
344 | {SETTINGS_POS_BITFIELD2*8+6,SETTINGS_POS_BITFIELD2*8+5,SETTINGS_POS_BITFIELD2*8+3,SETTINGS_POS_BITFIELD2*8+4}, |
- | 345 | ||
347 | } , {2,3 } , {4,5,6,7,8} , {9,10,11},{SETTINGS_POS_BITFIELD1*8 +6,SETTINGS_POS_BITFIELD1*8 +7, SETTINGS_POS_GRAPHINTERVAL} , |
346 | {SETTINGS_POS_PRIMARYABO,SETTINGS_POS_SECONDARYABO,SETTINGS_POS_DEFAULTABO}, |
348 | {10,SETTINGS_POS_BITFIELD2*8+0,SETTINGS_POS_VOICEDELAY,SETTINGS_POS_BITFIELD2*8+2,SETTINGS_POS_ALTSTEPS,SETTINGS_POS_VOICEVOLUME }, |
347 | {SETTINGS_POS_BITFIELD3*8+0,SETTINGS_POS_BITFIELD1*8+3,SETTINGS_POS_CAMSTICK,SETTINGS_POS_BITFIELD2*8+1,SETTINGS_POS_BITFIELD1*8+4,SETTINGS_POS_BITFIELD2*8+7} |
349 | {SETTINGS_POS_BITFIELD2*8+6,SETTINGS_POS_BITFIELD2*8+5,SETTINGS_POS_BITFIELD2*8+3,SETTINGS_POS_BITFIELD2*8+4}, |
348 | }; |
Line 350... | Line -... | ||
350 | {SETTINGS_POS_BITFIELD3*8+0,SETTINGS_POS_BITFIELD1*8+3,12,SETTINGS_POS_BITFIELD2*8+1,SETTINGS_POS_BITFIELD1*8+4,SETTINGS_POS_BITFIELD2*8+7} |
- | |
351 | }; |
- | |
352 | public int[][] _field_types={ {PARAMTYPE_CHOICE+0,PARAMTYPE_CHOICE+1,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH |
349 | public int[][] _field_types={ {PARAMTYPE_CHOICE+0,PARAMTYPE_CHOICE+1,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH |
353 | //#if devicecontrol=="on" |
350 | //#if devicecontrol=="on" |
354 | ,PARAMTYPE_BITSWITCH |
351 | ,PARAMTYPE_BITSWITCH |
355 | //#endif |
352 | //#endif |
356 | } , {PARAMTYPE_CHOICE+2,PARAMTYPE_CHOICE+3} , {PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE}, {PARAMTYPE_KEY,PARAMTYPE_KEY,PARAMTYPE_KEY} , {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE}, |
353 | ,PARAMTYPE_BITSWITCH |
357 | {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE,PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE,PARAMTYPE_BYTE} , |
354 | } , {PARAMTYPE_CHOICE+2,PARAMTYPE_CHOICE+3} , {PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE}, {PARAMTYPE_KEY,PARAMTYPE_KEY,PARAMTYPE_KEY} , {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE}, |
358 | {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH}, |
- | |
359 | {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_STICK,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH} |
- | |
360 | }; |
- | |
361 | DUBwiseCanvas canvas; |
355 | {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE,PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE,PARAMTYPE_BYTE} , |
362 | - | ||
363 | - | ||
364 | - | ||
365 | public final static int SETTINGS_FIELD_LENGTH=42; |
- | |
366 | public DUBwiseSettings(DUBwiseCanvas _canvas) |
- | |
367 | { |
- | |
368 | canvas= _canvas; |
356 | {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH}, |
Line 369... | Line 357... | ||
369 | settings_field=new int[SETTINGS_FIELD_LENGTH]; |
357 | {PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE}, |
370 | default_extern_control=new byte[11]; |
358 | {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_STICK,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH} |
371 | // set defaults |
359 | }; |
Line 372... | Line -... | ||
372 | settings_field[4]=42; // nick |
- | |
373 | settings_field[5]=42; // roll |
- | |
374 | settings_field[6]=42; // gier |
360 | DUBwiseCanvas canvas; |
375 | settings_field[7]=1; // gas |
361 | |
Line 376... | Line 362... | ||
376 | settings_field[8]=1; // hight |
362 | |
Line 377... | Line 363... | ||
377 | 363 | public DUBwiseSettings(DUBwiseCanvas _canvas) |
|
378 | settings_field[9]=-4242; // no key |
- | |
379 | settings_field[10]=-4242; // no key |
364 | { |
380 | settings_field[11]=-4242; // no key |
- | |
381 | - | ||
382 | } |
- | |
383 | - | ||
384 | public void load() |
- | |
385 | { |
- | |
386 | tab_stringids=_tab_stringids; |
- | |
387 | - | ||
388 | // tab_names=_tab_names; |
- | |
389 | - | ||
390 | field_positions=_field_positions; |
- | |
391 | field_types=_field_types; |
- | |
392 | 365 | canvas= _canvas; |
|
393 | choice_stringids=_choice_stringids; |
366 | settings_field=new int[SETTINGS_FIELD_LENGTH]; |
394 | 367 | default_extern_control=new byte[11]; |
|
Line 395... | Line 368... | ||
395 | field_stringids=_field_stringids; |
368 | // set defaults |
396 | //choice_strings=new String[_choice_strings.length+1][]; |
369 | settings_field=plain_defaults; |
397 | /* |
- | |
398 | // FIXME |
- | |
399 | choice_strings[0]=new String[2]; |
- | |
400 | choice_strings[0][0]="English"; |
- | |
401 | choice_strings[0][1]="Deutsch"; |
- | |
402 | for ( int i=1; i<_choice_strings.length+1;i++) |
- | |
403 | { |
- | |
404 | choice_strings[i]=new String[_choice_strings[i-1].length+1]; |
- | |
405 | for ( int ii=0; ii<_choice_strings[i-1].length;ii++) |
- | |
406 | choice_strings[i][ii]=canvas.l(_choice_strings[i-1][ii]); |
- | |
407 | } |
- | |
Line -... | Line 370... | ||
- | 370 | } |
|
Line -... | Line 371... | ||
- | 371 | ||
- | 372 | public void load() |
|
408 | */ |
373 | { |
- | 374 | tab_stringids=_tab_stringids; |
|
- | 375 | ||
- | 376 | field_positions=_field_positions; |
|
- | 377 | field_types=_field_types; |
|
- | 378 | ||
- | 379 | choice_stringids=_choice_stringids; |
|
- | 380 | ||
- | 381 | field_stringids=_field_stringids; |
|
- | 382 | ||
- | 383 | try |
|
- | 384 | { |
|
- | 385 | RecordStore recStore= RecordStore.openRecordStore(RECORD_STORE_NAME, false); |
|
409 | // choice_strings=_choice_strings; |
386 | |
Line 410... | Line 387... | ||
410 | try |
387 | if (recStore.getNumRecords()==1) |
411 | { |
- | |
412 | RecordStore recStore = RecordStore.openRecordStore(RECORD_STORE_NAME , true ); |
388 | { |
413 | 389 | ||
414 | if (recStore.getNumRecords()==1) |
390 | DataInputStream din = new DataInputStream( new ByteArrayInputStream(recStore.getRecord(1)) ); |
415 | { |
391 | |
Line 462... | Line 438... | ||
462 | RecordStore recStore = RecordStore.openRecordStore(RECORD_STORE_NAME, true ); |
438 | RecordStore recStore = RecordStore.openRecordStore(RECORD_STORE_NAME, true ); |
Line 463... | Line 439... | ||
463 | 439 | ||
464 | ByteArrayOutputStream bout = new ByteArrayOutputStream(); |
440 | ByteArrayOutputStream bout = new ByteArrayOutputStream(); |
Line -... | Line 441... | ||
- | 441 | DataOutputStream dout = new DataOutputStream( bout ); |
|
465 | DataOutputStream dout = new DataOutputStream( bout ); |
442 | |
466 | 443 | dout.writeByte(2); |
|
Line 467... | Line -... | ||
467 | dout.writeUTF(connection_url); |
- | |
468 | dout.writeUTF(connection_name); |
- | |
469 | 444 | dout.writeUTF(connection_url); |
|
470 | dout.writeUTF(""); |
- | |
471 | dout.writeUTF(""); |
- | |
472 | dout.writeUTF(""); |
445 | dout.writeUTF(connection_name); |
473 | 446 | ||
- | 447 | dout.writeByte(SETTINGS_FIELD_LENGTH); |
|
474 | 448 | for ( int i=0;i<SETTINGS_FIELD_LENGTH;i++) |
|
475 | for ( int i=0;i<SETTINGS_FIELD_LENGTH;i++) |
449 | dout.writeInt(settings_field[i]); |
476 | dout.writeInt(settings_field[i]); |
450 | |
477 | for ( int i=0;i<5;i++) |
451 | for ( int i=0;i<5;i++) |
478 | { |
452 | { |