Subversion Repositories Projects

Rev

Rev 267 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 267 Rev 269
Line 43... Line 43...
43
    public boolean do_sound=true;
43
    public boolean do_sound=true;
44
    public boolean do_volts_sound=true;
44
    public boolean do_volts_sound=true;
45
    public boolean do_altimeter_sound=true;
45
    public boolean do_altimeter_sound=true;
Line -... Line 46...
-
 
46
 
-
 
47
 
46
 
48
    public byte altsteps;
47
 
49
 
48
    public boolean horizon_invert_nick=true;
50
    public boolean horizon_invert_nick=true;
49
    public boolean horizon_invert_roll=true;
51
    public boolean horizon_invert_roll=true;
Line 50... Line 52...
50
    public boolean horizon_display_altitude=true;
52
    public boolean horizon_display_altitude=true;
51
    public boolean horizon_display_flytime=true;
53
    public boolean horizon_display_flytime=true;
52
 
54
 
53
    public boolean fullscreen=false;
55
    public boolean fullscreen=false;
Line -... Line 56...
-
 
56
    public boolean do_scrollbg=false;
-
 
57
    public boolean expert_mode=false;
54
    public boolean do_scrollbg=false;
58
    public boolean dev_mode=false;
55
    public boolean expert_mode=false;
59
 
Line 56... Line 60...
56
    public boolean dev_mode=false;
60
 
57
 
61
 
Line 87... Line 91...
87
        //      fullscreen=!fullscreen;
91
        //      fullscreen=!fullscreen;
88
         set_field_from_act(1,settings_field[1]^1);
92
         set_field_from_act(1,settings_field[1]^1);
89
         //     if (fullscreen)canvas.setFullScreenMode(true);
93
         //     if (fullscreen)canvas.setFullScreenMode(true);
90
    }
94
    }
Line 91... Line 95...
91
 
95
 
92
    public final static int SETTINGS_POS_SKIN=0;
96
    public final static int SETTINGS_POS_SKIN           =0;
93
    public final static int SETTINGS_POS_BITFIELD1=1;
97
    public final static int SETTINGS_POS_BITFIELD1      =1;
94
    public final static int SETTINGS_POS_GPS_FORMAT=2;
98
    public final static int SETTINGS_POS_GPS_FORMAT     =2;
95
    public final static int SETTINGS_POS_SPEED_FORMAT=3;
99
    public final static int SETTINGS_POS_SPEED_FORMAT   =3;
96
    public final static int SETTINGS_POS_EXTERN_NICK=4;
100
    public final static int SETTINGS_POS_EXTERN_NICK    =4;
97
    public final static int SETTINGS_POS_EXTERN_ROLL=5;
101
    public final static int SETTINGS_POS_EXTERN_ROLL    =5;
98
    public final static int SETTINGS_POS_EXTERN_GIER=6;
102
    public final static int SETTINGS_POS_EXTERN_GIER    =6;
99
    public final static int SETTINGS_POS_EXTERN_GAS=7;
103
    public final static int SETTINGS_POS_EXTERN_GAS     =7;
100
    public final static int SETTINGS_POS_EXTERN_HIGHT=8;
104
    public final static int SETTINGS_POS_EXTERN_HIGHT   =8;
101
    public final static int SETTINGS_POS_KEY_BACK=9;
105
    public final static int SETTINGS_POS_KEY_BACK       =9;
102
    public final static int SETTINGS_POS_KEY_FULL=10;
106
    public final static int SETTINGS_POS_KEY_FULL       =10;
103
    public final static int SETTINGS_POS_KEY_CLEAR=11;
107
    public final static int SETTINGS_POS_KEY_CLEAR      =11;
104
    public final static int SETTINGS_POS_VOICEVOLUME=12;
108
    public final static int SETTINGS_POS_VOICEVOLUME    =12;
105
    public final static int SETTINGS_POS_VOICEDELAY=13;
109
    public final static int SETTINGS_POS_VOICEDELAY     =13;
106
    public final static int SETTINGS_POS_BITFIELD2=14;
110
    public final static int SETTINGS_POS_BITFIELD2      =14;
107
    public final static int SETTINGS_POS_LANG=15;
111
    public final static int SETTINGS_POS_LANG           =15;
108
    public final static int SETTINGS_POS_GRAPHINTERVAL=16;
112
    public final static int SETTINGS_POS_GRAPHINTERVAL  =16;
109
    public final static int SETTINGS_POS_BITFIELD3=17;
-
 
-
 
113
    public final static int SETTINGS_POS_BITFIELD3      =17;
Line 110... Line 114...
110
 
114
    public final static int SETTINGS_POS_ALTSTEPS       =18;
111
 
115
 
112
    public void field2setting(int pos,int val)
-
 
113
    {
116
    public void field2setting(int pos,int val)
114
       
117
    {
-
 
118
        switch (pos)
-
 
119
            {
-
 
120
            case SETTINGS_POS_ALTSTEPS:
-
 
121
                altsteps=(byte)val;
115
        if (pos==SETTINGS_POS_GRAPHINTERVAL)
122
                break;
116
            {
123
            case SETTINGS_POS_GRAPHINTERVAL:
117
                if (val<1)
124
                if (val<1)
118
                    graph_interval=1;
125
                    graph_interval=1;
-
 
126
                else
-
 
127
                    graph_interval=(byte)val;
119
                else
128
                break;
Line 120... Line 129...
120
                    graph_interval=(byte)val;
129
 
121
            }
130
            }
122
 
131
 
Line 256... Line 265...
256
           dev_mode=((val&128)!=0);
265
           dev_mode=((val&128)!=0);
Line 257... Line 266...
257
 
266
 
258
 
267
 
-
 
268
        if (pos==SETTINGS_POS_BITFIELD3)
-
 
269
           instant_error_show=((val&1)!=0);
-
 
270
 
-
 
271
        /*
-
 
272
        String ts="";
-
 
273
        for ( int i=0;i<SETTINGS_FIELD_LENGTH;i++)
-
 
274
            ts+=","+settings_field[i];
-
 
275
 
-
 
276
        System.out.println(ts);
-
 
277
        */
259
        if (pos==SETTINGS_POS_BITFIELD3)
278
 
Line -... Line 279...
-
 
279
 
-
 
280
    }
-
 
281
 
-
 
282
    public int[] plain_defaults={0,0,0,0,42,42,42,1,1,-4242,-4242,-4242,0,10,0,0,7,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
 
283
    public int[] fancy_defaults={0,255,0,0,42,42,42,1,1,-4242,-4242,-4242,150,10,5,0,7,1,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
 
284
 
-
 
285
 
-
 
286
 
-
 
287
    public void process_all_settings()
-
 
288
    {
-
 
289
        for ( int i=0;i<SETTINGS_FIELD_LENGTH;i++)
-
 
290
            field2setting(i,settings_field[i]);
-
 
291
    }
-
 
292
 
-
 
293
    public void load_plain_defaults()
-
 
294
    {
-
 
295
        settings_field=plain_defaults;
-
 
296
        process_all_settings();
-
 
297
    }
-
 
298
 
-
 
299
    public void load_fancy_defaults()
-
 
300
    {
Line 260... Line 301...
260
           instant_error_show=((val&1)!=0);
301
        settings_field=fancy_defaults;
Line 261... Line 302...
261
    }
302
        process_all_settings();
Line 284... Line 325...
284
        },
325
        },
285
        {STRINGID_SPEEDFORMAT,STRINGID_GPSFORMAT},
326
        {STRINGID_SPEEDFORMAT,STRINGID_GPSFORMAT},
286
        {STRINGID_NICK ,STRINGID_ROLL,STRINGID_GIER,STRINGID_GASINCREASE,STRINGID_HEIGHTINCREASE },
327
        {STRINGID_NICK ,STRINGID_ROLL,STRINGID_GIER,STRINGID_GASINCREASE,STRINGID_HEIGHTINCREASE },
287
        {STRINGID_BACKTOMAINMENU,STRINGID_FULLSCREEN,STRINGID_CLEAR },
328
        {STRINGID_BACKTOMAINMENU,STRINGID_FULLSCREEN,STRINGID_CLEAR },
288
        {STRINGID_LEGEND,STRINGID_SCALEGRID,STRINGID_GRAPHINTERVAL},
329
        {STRINGID_LEGEND,STRINGID_SCALEGRID,STRINGID_GRAPHINTERVAL},
289
        {STRINGID_SOUND,STRINGID_VOLTS,STRINGID_DELAYINS,STRINGID_ALTIMETER,STRINGID_VOLUME},
330
        {STRINGID_SOUND,STRINGID_VOLTS,STRINGID_DELAYINS,STRINGID_ALTIMETER,STRINGID_ALTSTEPS,STRINGID_VOLUME},
290
        {STRINGID_SHOWALTITUDE,STRINGID_SHOWFLIGHTTIME,STRINGID_INVERTROLL,STRINGID_INVERTNICK},
331
        {STRINGID_SHOWALTITUDE,STRINGID_SHOWFLIGHTTIME,STRINGID_INVERTROLL,STRINGID_INVERTNICK},
291
        {STRINGID_INSTANTERRORSHOW,STRINGID_VIBRA,STRINGID_REMOTECAMSTICK,STRINGID_ALWAYSRELOADPARAMS,STRINGID_EXPERTMODE,STRINGID_DEVMODE}};
332
        {STRINGID_INSTANTERRORSHOW,STRINGID_VIBRA,STRINGID_REMOTECAMSTICK,STRINGID_ALWAYSRELOADPARAMS,STRINGID_EXPERTMODE,STRINGID_DEVMODE}};
Line 302... Line 343...
302
//#if devicecontrol=="on"
343
//#if devicecontrol=="on"
Line 303... Line 344...
303
 
344
 
304
       ,13
345
       ,13
305
//#endif
346
//#endif
306
} , {2,3 } , {4,5,6,7,8} , {9,10,11},{SETTINGS_POS_BITFIELD1*8 +6,SETTINGS_POS_BITFIELD1*8 +7, SETTINGS_POS_GRAPHINTERVAL} ,
347
} , {2,3 } , {4,5,6,7,8} , {9,10,11},{SETTINGS_POS_BITFIELD1*8 +6,SETTINGS_POS_BITFIELD1*8 +7, SETTINGS_POS_GRAPHINTERVAL} ,
307
        {10,SETTINGS_POS_BITFIELD2*8+0,SETTINGS_POS_VOICEDELAY,SETTINGS_POS_BITFIELD2*8+2,SETTINGS_POS_VOICEVOLUME },
348
        {10,SETTINGS_POS_BITFIELD2*8+0,SETTINGS_POS_VOICEDELAY,SETTINGS_POS_BITFIELD2*8+2,SETTINGS_POS_ALTSTEPS,SETTINGS_POS_VOICEVOLUME },
308
        {SETTINGS_POS_BITFIELD2*8+6,SETTINGS_POS_BITFIELD2*8+5,SETTINGS_POS_BITFIELD2*8+3,SETTINGS_POS_BITFIELD2*8+4},
349
        {SETTINGS_POS_BITFIELD2*8+6,SETTINGS_POS_BITFIELD2*8+5,SETTINGS_POS_BITFIELD2*8+3,SETTINGS_POS_BITFIELD2*8+4},
309
        {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}
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}
310
    };
351
    };
311
    public int[][] _field_types={ {PARAMTYPE_CHOICE+0,PARAMTYPE_CHOICE+1,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH
352
    public int[][] _field_types={ {PARAMTYPE_CHOICE+0,PARAMTYPE_CHOICE+1,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH
312
//#if devicecontrol=="on"
353
//#if devicecontrol=="on"
313
                 ,PARAMTYPE_BITSWITCH
354
                 ,PARAMTYPE_BITSWITCH
314
//#endif
355
//#endif
315
} , {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},
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},
316
  {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE,PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE} ,
357
  {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE,PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE,PARAMTYPE_BYTE} ,
317
  {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH},
358
  {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH},
318
  {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_STICK,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH}
359
  {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_STICK,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH}
319
    };
360
    };
Line 400... Line 441...
400
            }
441
            }
401
        catch (Exception e)
442
        catch (Exception e)
402
            {       }
443
            {       }
Line 403... Line -...
403
 
-
 
404
 
444
 
-
 
445
 
Line 405... Line 446...
405
        for ( int i=0;i<SETTINGS_FIELD_LENGTH;i++)
446
        process_all_settings();
Line 406... Line 447...
406
            field2setting(i,settings_field[i]);
447