Subversion Repositories Projects

Rev

Rev 258 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
206 ligi 1
/**************************************************
2
 *                                            
3
 * class representing the Params Structure    
4
 *                                            
5
 * Author:        Marcus -LiGi- Bueschleb      
6
 *
7
 * see README for further Infos
8
 *
9
 *************************************************/
10
 
11
package org.ligi.ufo;
12
 
13
 
14
 
220 ligi 15
public class MKParamsParser  extends ParamsClass
255 ligi 16
    implements MKParamDefinitions,org.ligi.ufo.DUBwiseLangDefs
206 ligi 17
 
18
{
255 ligi 19
 
206 ligi 20
// -- start generated code --
381 ligi 21
    public final static int[][] all_tab_stringids={{STRINGID_ALTITUDE,STRINGID_CAMERA,STRINGID_CHANNELS,STRINGID_CONFIGURATION,STRINGID_COUPLING,STRINGID_GYRO,STRINGID_LOOP,STRINGID_NAVI,STRINGID_OTHER,STRINGID_OUTPUT,STRINGID_STICK,STRINGID_USERPARAMS},{STRINGID_ALTITUDE,STRINGID_CAMERA,STRINGID_CHANNELS,STRINGID_CONFIGURATION,STRINGID_COUPLING,STRINGID_GYRO,STRINGID_LOOP,STRINGID_NAVI,STRINGID_OTHER,STRINGID_OUTPUT,STRINGID_STICK,STRINGID_USERPARAMS},{STRINGID_ALTITUDE,STRINGID_CAMERA,STRINGID_CHANNELS,STRINGID_CONFIGURATION,STRINGID_COUPLING,STRINGID_GYRO,STRINGID_LOOP,STRINGID_NAVI,STRINGID_OTHER,STRINGID_OUTPUT,STRINGID_STICK,STRINGID_USERPARAMS}};
22
    public final static int[][][] all_field_stringids={{{STRINGID_MINACCELERATE,STRINGID_BAROD,STRINGID_SETPOINT,STRINGID_ALTITUDEP,STRINGID_GAIN,STRINGID_ZACC,STRINGID_SWITCH3},{STRINGID_SERVOCONTROL,STRINGID_NICKCOMP,STRINGID_SERVOMIN,STRINGID_SERVOMAX,STRINGID_REFRESHRATE,STRINGID_INVERTDIRECTION},{STRINGID_NICK,STRINGID_ROLL,STRINGID_ACCELERATE,STRINGID_GIER,STRINGID_POTI1,STRINGID_POTI2,STRINGID_POTI3,STRINGID_POTI4},{STRINGID_ALTITUDECONTROL,STRINGID_SWITCHFORSETPOINT,STRINGID_HEADINGHOLD,STRINGID_COMPASACTIVE,STRINGID_COMPASFIX,STRINGID_GPS,STRINGID_COUPLING,STRINGID_YAWRATELIMITER},{STRINGID_YAWPOSFEEDBACK,STRINGID_YAWNEGFEEDBACK},{STRINGID_ACCGYROFACTOR,STRINGID_PRATE,STRINGID_IRATE,STRINGID_ACCGYROCOMP,STRINGID_DRIFTCOMP,STRINGID_DYNAMICSTABILITY},{STRINGID_GASLIMIT,STRINGID_THRESHOLD,STRINGID_HYSTERESE,STRINGID_TURNOVERNICK,STRINGID_TURNOVERROLL,STRINGID_UP,STRINGID_DOWN,STRINGID_LEFT,STRINGID_RIGHT},{STRINGID_MODECONTROL,STRINGID_GPSGAIN,STRINGID_GPSP,STRINGID_GPSI,STRINGID_GPSD,STRINGID_GPSACC,STRINGID_SATMIN,STRINGID_STICKTHRESHOLD,STRINGID_WINDCORRECT,STRINGID_SPEEDCOMP,STRINGID_OPERATIONRADIUS,STRINGID_ANGLELIMIT},{STRINGID_MINGAS,STRINGID_MAXGAS,STRINGID_COMPASEFFECT,STRINGID_VOLTAGEWARNING,STRINGID_DISTRESSGAS,STRINGID_DISTRESSGASTIME},{STRINGID_J16BITMASK,STRINGID_J16TIMING,STRINGID_J17BITMASK,STRINGID_J17TIMING},{STRINGID_NICKROLLP,STRINGID_NICKROLLD,STRINGID_GIERP,STRINGID_EXTERNCONTROL},{STRINGID_PARAM1,STRINGID_PARAM2,STRINGID_PARAM3,STRINGID_PARAM4,STRINGID_PARAM5,STRINGID_PARAM6,STRINGID_PARAM7,STRINGID_PARAM8}},{{STRINGID_MINACCELERATE,STRINGID_BAROD,STRINGID_SETPOINT,STRINGID_ALTITUDEP,STRINGID_GAIN,STRINGID_ZACC,STRINGID_SWITCH3},{STRINGID_SERVOCONTROL,STRINGID_NICKCOMP,STRINGID_SERVOMIN,STRINGID_SERVOMAX,STRINGID_REFRESHRATE,STRINGID_INVERTDIRECTION},{STRINGID_NICK,STRINGID_ROLL,STRINGID_ACCELERATE,STRINGID_GIER,STRINGID_POTI1,STRINGID_POTI2,STRINGID_POTI3,STRINGID_POTI4},{STRINGID_ALTITUDECONTROL,STRINGID_SWITCHFORSETPOINT,STRINGID_HEADINGHOLD,STRINGID_COMPASACTIVE,STRINGID_COMPASFIX,STRINGID_GPS,STRINGID_COUPLING,STRINGID_YAWRATELIMITER},{STRINGID_YAWPOSFEEDBACK,STRINGID_COUPLING2,STRINGID_COUPLINGYAWCORRECT},{STRINGID_ACCGYROFACTOR,STRINGID_PRATE,STRINGID_IRATE,STRINGID_DRATE,STRINGID_ACCGYROCOMP,STRINGID_DRIFTCOMP,STRINGID_DYNAMICSTABILITY},{STRINGID_GASLIMIT,STRINGID_THRESHOLD,STRINGID_HYSTERESE,STRINGID_TURNOVERNICK,STRINGID_TURNOVERROLL,STRINGID_UP,STRINGID_DOWN,STRINGID_LEFT,STRINGID_RIGHT},{STRINGID_MODECONTROL,STRINGID_GPSGAIN,STRINGID_GPSP,STRINGID_GPSI,STRINGID_GPSD,STRINGID_GPSPLIMIT,STRINGID_GPSILIMIT,STRINGID_GPSDLIMIT,STRINGID_GPSACC,STRINGID_SATMIN,STRINGID_STICKTHRESHOLD,STRINGID_WINDCORRECT,STRINGID_SPEEDCOMP,STRINGID_OPERATIONRADIUS,STRINGID_ANGLELIMIT,STRINGID_PHLOGINTIME},{STRINGID_MINGAS,STRINGID_MAXGAS,STRINGID_COMPASEFFECT,STRINGID_VOLTAGEWARNING,STRINGID_DISTRESSGAS,STRINGID_DISTRESSGASTIME},{STRINGID_J16BITMASK,STRINGID_J16TIMING,STRINGID_J17BITMASK,STRINGID_J17TIMING},{STRINGID_NICKROLLP,STRINGID_NICKROLLD,STRINGID_GIERP,STRINGID_EXTERNCONTROL},{STRINGID_PARAM1,STRINGID_PARAM2,STRINGID_PARAM3,STRINGID_PARAM4,STRINGID_PARAM5,STRINGID_PARAM6,STRINGID_PARAM7,STRINGID_PARAM8}},{{STRINGID_MINACCELERATE,STRINGID_BAROD,STRINGID_SETPOINT,STRINGID_ALTITUDEP,STRINGID_GAIN,STRINGID_ZACC,STRINGID_SWITCH3},{STRINGID_SERVOCONTROL,STRINGID_NICKCOMP,STRINGID_SERVOMIN,STRINGID_SERVOMAX,STRINGID_REFRESHRATE,STRINGID_INVERTDIRECTION},{STRINGID_NICK,STRINGID_ROLL,STRINGID_ACCELERATE,STRINGID_GIER,STRINGID_POTI1,STRINGID_POTI2,STRINGID_POTI3,STRINGID_POTI4},{STRINGID_ALTITUDECONTROL,STRINGID_SWITCHFORSETPOINT,STRINGID_HEADINGHOLD,STRINGID_COMPASACTIVE,STRINGID_COMPASFIX,STRINGID_GPS,STRINGID_COUPLING,STRINGID_YAWRATELIMITER},{STRINGID_YAWPOSFEEDBACK,STRINGID_COUPLING2,STRINGID_COUPLINGYAWCORRECT},{STRINGID_ACCGYROFACTOR,STRINGID_PRATE,STRINGID_IRATE,STRINGID_DRATE,STRINGID_ACCGYROCOMP,STRINGID_DRIFTCOMP,STRINGID_DYNAMICSTABILITY},{STRINGID_GASLIMIT,STRINGID_THRESHOLD,STRINGID_HYSTERESE,STRINGID_TURNOVERNICK,STRINGID_TURNOVERROLL,STRINGID_UP,STRINGID_DOWN,STRINGID_LEFT,STRINGID_RIGHT},{STRINGID_MODECONTROL,STRINGID_GPSGAIN,STRINGID_GPSP,STRINGID_GPSI,STRINGID_GPSD,STRINGID_GPSPLIMIT,STRINGID_GPSILIMIT,STRINGID_GPSDLIMIT,STRINGID_GPSACC,STRINGID_SATMIN,STRINGID_STICKTHRESHOLD,STRINGID_WINDCORRECT,STRINGID_SPEEDCOMP,STRINGID_OPERATIONRADIUS,STRINGID_ANGLELIMIT,STRINGID_PHLOGINTIME},{STRINGID_MINGAS,STRINGID_MAXGAS,STRINGID_COMPASEFFECT,STRINGID_VOLTAGEWARNING,STRINGID_DISTRESSGAS,STRINGID_DISTRESSGASTIME},{STRINGID_J16BITMASK,STRINGID_J16TIMING,STRINGID_J17BITMASK,STRINGID_J17TIMING},{STRINGID_NICKROLLP,STRINGID_NICKROLLD,STRINGID_GIERP,STRINGID_EXTERNCONTROL},{STRINGID_PARAM1,STRINGID_PARAM2,STRINGID_PARAM3,STRINGID_PARAM4,STRINGID_PARAM5,STRINGID_PARAM6,STRINGID_PARAM7,STRINGID_PARAM8}}};
23
    public final static int[][][] all_field_positions={{{9,10,11,12,13,14,556},{33,34,35,36,37,560},{0,1,2,3,4,5,6,7},{64,65,66,67,68,69,70,71},{41,42},{20,22,23,45,46,47},{38,39,40,43,44,552,553,554,555},{56,57,58,59,60,61,62,63,64,65,66,67},{18,19,21,24,25,26},{52,53,54,55},{15,16,17,68},{29,30,31,32,48,49,50,51}},{{9,10,11,12,13,14,604},{34,35,36,37,38,608},{0,1,2,3,4,5,6,7},{64,65,66,67,68,69,70,71},{42,43,44},{20,22,23,24,47,48,49},{39,40,41,45,46,600,601,602,603},{58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73},{18,19,21,25,26,27},{54,55,56,57},{15,16,17,74},{30,31,32,33,50,51,52,53}},{{9,10,11,12,13,14,604},{34,35,36,37,38,608},{0,1,2,3,4,5,6,7},{64,65,66,67,68,69,70,71},{42,43,44},{20,22,23,24,47,48,49},{39,40,41,45,46,600,601,602,603},{58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73},{18,19,21,25,26,27},{54,55,56,57},{15,16,17,74},{30,31,32,33,50,51,52,53}}};
24
    public final static int[][][] all_field_types={{{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH},{PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK},{PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_BITMASK,PARAMTYPE_MKBYTE,PARAMTYPE_BITMASK,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE}},{{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH},{PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK},{PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_BITMASK,PARAMTYPE_MKBYTE,PARAMTYPE_BITMASK,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE}},{{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH},{PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK},{PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_BITMASK,PARAMTYPE_MKBYTE,PARAMTYPE_BITMASK,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE}}};
25
    public final static int[] all_name_positions={75,81,81};
26
    public final static int[] all_lengths={87,93,93};
206 ligi 27
// -- end generated code --
28
 
252 ligi 29
 
206 ligi 30
    public final static int MAX_PARAMSETS=5;
31
    //    public final static int MAX_PARAMLENGTH=100;
32
 
33
    public int[][] field;
34
    public int[][] field_bak;
223 ligi 35
    //    public String[] names={"","","","",""};
206 ligi 36
 
37
    public int act_paramset=0;
38
 
39
 
40
    public int params_version=-1;
41
    public int last_parsed_paramset=-1;
42
    public int active_paramset=-1;
43
 
44
    public boolean found_incompatible=false;
45
 
258 ligi 46
    public int[] stick_stringids;
206 ligi 47
 
48
    public int get_field_from_act(int pos)
49
    {       return field[act_paramset][pos];    }
50
 
51
    public void set_field_from_act(int pos,int val)
52
    {
53
        if (val>255) val=255;
54
        if (val<0) val=255;
55
        field[act_paramset][pos]=val;
56
    }
57
 
58
 
220 ligi 59
    /*    public void field_from_act_add(int pos,int val)
206 ligi 60
    {
61
        set_field_from_act(pos , get_field_from_act(pos)+val);
220 ligi 62
        }
206 ligi 63
 
64
    // for boolean Flags
65
    public void field_from_act_xor(int pos,int val)
66
    {
67
        field[act_paramset][pos]^=val;
68
    }
69
 
220 ligi 70
    */
213 ligi 71
 
72
    public void set_name(String nme)
73
    {
74
        if (nme.length()>10)
75
            nme=nme.substring(0,10);
223 ligi 76
        //      names[act_paramset]=nme;
213 ligi 77
        int nme_pos=0;
78
        while(nme_pos<nme.length())
79
            {
80
                field[act_paramset][name_start+nme_pos]=(byte)nme.charAt(nme_pos);
81
                nme_pos++;
82
            }
83
        field[act_paramset][name_start+nme_pos]=0;
84
    }
85
 
206 ligi 86
    public MKParamsParser()
87
    {
88
        field=new int[MAX_PARAMSETS][];
89
        field_bak=new int[MAX_PARAMSETS][];
90
 
91
        for (int ii=0;ii<MAX_PARAMSETS;ii++)
92
                {
93
                   field[ii]=null;
94
                   field_bak[ii]=null;
95
 
96
                }
97
 
258 ligi 98
        stick_stringids=new int[10];
206 ligi 99
        for (int i=0;i<10;i++)
258 ligi 100
            stick_stringids[i]=STRINGID_NOTREADYET;
206 ligi 101
    }
102
 
220 ligi 103
    public  int length=0;
104
    public  int name_start=0;
105
    /*
206 ligi 106
    public int[] param_type;
107
    public int[] param_pos;
108
    public int[] param_innerpos;
109
 
110
    public  String[] tab_names;
111
    public  String[][] field_names;
112
    public  int[][] field_positions;
113
    public  int[][] field_types;
114
 
115
    public  int length;
116
    public  int name_start;
220 ligi 117
    */
206 ligi 118
 
119
 
120
    public void use_backup()
121
    {
122
        set_by_mk_data(field_bak[act_paramset]);
123
    }
124
 
223 ligi 125
    public void update_backup(int to)
206 ligi 126
    {  
127
        for ( int i=0 ; i<field[act_paramset].length;i++)
223 ligi 128
 
129
            {
130
                field_bak[to][i+2]=field[act_paramset][i];
131
                field[to][i]=field[act_paramset][i];
132
            }
206 ligi 133
 
223 ligi 134
        field_bak[to][0]=to+1;
135
        field_bak[to][1]=params_version;
206 ligi 136
 
137
    }
138
 
229 ligi 139
    public void reset()
140
    {
141
        last_parsed_paramset=-1;
142
 
143
        for (int ii=0;ii<MAX_PARAMSETS;ii++)
144
            field[ii]=null;
145
    }
146
 
223 ligi 147
    public String getParamName(int paramset)
148
    {
149
        String res="";
150
        for ( int i=name_start;i<length;i++)
151
            {
152
                if(field[paramset][i]==0)break;
153
                res+=(char)field[paramset][i];
154
            }
155
        return res;
156
    }
157
 
206 ligi 158
    public void set_by_mk_data(int[] in_arr)
159
    {
160
        params_version=in_arr[1];
161
        int definition_pos=params_version-73;
162
 
163
 
255 ligi 164
        if ((definition_pos<0)||( (definition_pos>=all_tab_stringids.length)))
206 ligi 165
            {
166
                found_incompatible=true;
167
                return;
168
            }
169
 
170
 
171
 
172
        last_parsed_paramset=in_arr[0]-1;
173
 
174
        if (active_paramset==-1)active_paramset=last_parsed_paramset;
175
 
255 ligi 176
        tab_stringids=all_tab_stringids[definition_pos];
258 ligi 177
        field_stringids=all_field_stringids[definition_pos];
206 ligi 178
        field_positions=all_field_positions[definition_pos];
179
        field_types=all_field_types[definition_pos];
180
 
181
        name_start=all_name_positions[definition_pos];
182
        length=all_lengths[definition_pos];
183
 
184
        field[last_parsed_paramset]=new int[length];
185
        field_bak[last_parsed_paramset]=new int[length+2];
186
 
223 ligi 187
        //      names[last_parsed_paramset]="";
206 ligi 188
        for ( int i=0;i<length+2;i++)
189
            {
190
            if (i<length)
191
                field[last_parsed_paramset][i]=in_arr[i+2];
192
            field_bak[last_parsed_paramset][i]=in_arr[i];
193
            }
194
 
195
 
196
        for (int i=0;i<10;i++)
258 ligi 197
            stick_stringids[i]=STRINGID_NONE_ASSIGNED;
206 ligi 198
 
255 ligi 199
        for (int tab=0;tab<tab_stringids.length;tab++)
206 ligi 200
            for (int item=0;item<field_types[tab].length;item++)
201
                if (field_types[tab][item]==PARAMTYPE_STICK)
258 ligi 202
                    stick_stringids[ field[last_parsed_paramset][field_positions[tab][item]] ] = field_stringids[tab][item];
206 ligi 203
 
204
    }
205
 
206
 
207
 
208
}