001/*
002 * To change this template, choose Tools | Templates
003 * and open the template in the editor.
004 */
005
006package armyc2.c2sd.renderer.utilities;
007
008import java.util.ArrayList;
009
010import android.util.SparseArray;
011
012/**
013 * This class contains keys to the modifiers.  A number of these we feed off of
014 * the symbol code instead of using the property.  But those modifiers remain
015 * for completeness.
016 *
017 * Tactical Graphics:
018 * P = points, L = lines, A = areas, BL = boundary lines, N = nuclear, B/C = bio/chem.
019 * G = graphic modifier so there is no length.  Most of these we feed off of the symbol
020 * code so they aren't actually used.
021 * @author michael.spinelli
022 */
023public class ModifiersTG {
024
025        //public static final int SYMBOL_ID = "Symbol ID";
026    //public static final int SOURCE = "Source";
027    //public static final int EDITOR_CLASS_TYPE = "Editor Class Type";
028    //public static final int URN = "URN";
029    //public static final int UIC = "UIC";
030    //public static final int ANGLE_OF_ROTATION = "Angle of Rotation";
031    /**
032     * The innermost part of a symbol that represents a warfighting object
033     * Here for completeness, not actually used as this comes from the
034     * symbol code.
035     * SIDC positions 3, 5-104
036     * TG: P,L,A,BL,N,B/C
037     * Length: G
038     */
039    public static final int A_SYMBOL_ICON = 0;
040    /**
041     * The basic graphic (see 5.5.1).
042     * We feed off of the symbol code so this isn't used
043     * SIDC positions 11 and 12
044     * TG: L,A,BL
045     * Length: G
046     */
047    public static final int B_ECHELON = 1;
048    /**
049     * A graphic modifier in a boundary graphic that
050     * identifies command level (see 5.5.2.2, table V, and
051     * figures 10 and 12).
052     * TG: N
053     * Length: 6
054     */
055    public static final int C_QUANTITY = 2;
056    /**
057     * A text modifier for tactical graphics; content is
058     * implementation specific.
059     * TG: P,L,A,N,B/C
060     * Length: 20
061     */
062    public static final int H_ADDITIONAL_INFO_1 = 3;
063    /**
064     * A text modifier for tactical graphics; content is
065     * implementation specific.
066     * TG: P,L,A,N,B/C
067     * Length: 20
068     */
069    public static final int H1_ADDITIONAL_INFO_2 = 4;
070    /**
071     * A text modifier for tactical graphics; content is
072     * implementation specific.
073     * TG: P,L,A,N,B/C
074     * Length: 20
075     */
076    public static final int H2_ADDITIONAL_INFO_3 = 5;
077    /**
078     * A text modifier for tactical graphics; letters "ENY" denote hostile symbols.
079     * TG: P,L,A,BL,N,B/C
080     * Length: 3
081     */
082    public static final int N_HOSTILE = 6;
083    /**
084     * A graphic modifier for CBRN events that
085     * identifies the direction of movement (see 5.5.2.1
086     * and figure 11).
087     * TG: N,B/C
088     * Length: G
089     */
090    public static final int Q_DIRECTION_OF_MOVEMENT = 7;
091    /**
092     * A graphic modifier for points and CBRN events
093     * used when placing an object away from its actual
094     * location (see 5.5.2.3 and figures 10, 11, and 12).
095     * TG: P,N,B/C
096     * Length: G
097     */
098    public static final int S_OFFSET_INDICATOR = 8;
099    /**
100     * A text modifier that uniquely identifies a particular
101     * tactical graphic; track number.
102     * Nuclear: delivery unit (missile, aircraft, satellite,
103     * etc.)
104     * TG:P,L,A,BL,N,B/C
105     * Length: 15 (35 for BL)
106     */
107    public static final int T_UNIQUE_DESIGNATION_1 = 9;
108    /**
109     * A text modifier that uniquely identifies a particular
110     * tactical graphic; track number.
111     * Nuclear: delivery unit (missile, aircraft, satellite,
112     * etc.)
113     * TG:P,L,A,BL,N,B/C
114     * Length: 15 (35 for BL)
115     */
116    public static final int T1_UNIQUE_DESIGNATION_2 = 10;
117    /**
118     * A text modifier that indicates nuclear weapon type.
119     * TG: N
120     * Length: 20
121     */
122    public static final int V_EQUIP_TYPE = 11;
123    /**
124     * A text modifier for units, equipment, and installations that displays DTG format:
125     * DDHHMMSSZMONYYYY or “O/O� for on order (see 5.5.2.6).
126     * TG:P,L,A,N,B/C
127     * Length: 16
128     */
129    public static final int W_DTG_1 = 12;
130    /**
131     * A text modifier for units, equipment, and installations that displays DTG format:
132     * DDHHMMSSZMONYYYY or “O/O� for on order (see 5.5.2.6).
133     * TG:P,L,A,N,B/C
134     * Length: 16
135     */
136    public static final int W1_DTG_2 = 13;
137    /**
138     * A text modifier that displays the minimum,
139     * maximum, and/or specific altitude (in feet or
140     * meters in relation to a reference datum), flight
141     * level, or depth (for submerged objects in feet
142     * below sea level). See 5.5.2.5 for content.
143     * TG:P,L,A,N,B/C
144     * Length: 14
145     */
146    public static final int X_ALTITUDE_DEPTH = 14;
147    /**
148     * A text modifier that displays a graphic’s location
149     * in degrees, minutes, and seconds (or in UTM or
150     * other applicable display format).
151     *  Conforms to decimal
152     *  degrees format:
153     *  xx.dddddhyyy.dddddh
154     *  where
155     *  xx = degrees latitude
156     *  yyy = degrees longitude
157     *  .ddddd = decimal degrees
158     *  h = direction (N, E, S, W)
159     * TG:P,L,A,BL,N,B/C
160     * Length: 19
161     */
162    public static final int Y_LOCATION = 15;
163
164    /**
165     * For Tactical Graphics
166     * A numeric modifier that displays a minimum,
167     * maximum, or a specific distance (range, radius,
168     * width, length, etc.), in meters.
169     * 0 - 999,999 meters
170     * TG: P.L.A
171     * Length: 6
172     */
173    public static final int AM_DISTANCE = 16;
174    /**
175     * For Tactical Graphics
176     * A numeric modifier that displays an angle
177     * measured from true north to any other line in
178     * degrees.
179     * 0 - 359 degrees
180     * TG: P.L.A
181     * Length: 3
182     */
183    public static final int AN_AZIMUTH = 17;
184
185    public static final int SYMBOL_FILL_IDS = 90;
186
187
188    public static final int LENGTH = 30;
189    public static final int WIDTH = 31;
190    public static final int RADIUS = 32;
191    public static final int ANGLE = 33;
192    //public static final int SEGMENT_DATA = "Segment Data";
193    
194    
195
196    /**
197     * Returns an Arraylist of the modifer names for tactical graphics
198     * @return
199     */
200    public synchronized static ArrayList<Integer> GetModifierList()
201    {
202        ArrayList<Integer> list = new ArrayList<Integer>();
203
204        //list.add(ModifierType.A_SYMBOL_ICON);//graphical, feeds off of symbol code
205        //list.add(ModifierType.B_ECHELON);//graphical, feeds off of symbol code
206        list.add(C_QUANTITY);
207        list.add(H_ADDITIONAL_INFO_1);
208        list.add(H1_ADDITIONAL_INFO_2);
209        list.add(H2_ADDITIONAL_INFO_3);
210        list.add(N_HOSTILE);
211        list.add(Q_DIRECTION_OF_MOVEMENT);
212        list.add(T_UNIQUE_DESIGNATION_1);
213        list.add(T1_UNIQUE_DESIGNATION_2);
214        list.add(V_EQUIP_TYPE);
215        list.add(W_DTG_1);
216        list.add(W1_DTG_2);
217        list.add(X_ALTITUDE_DEPTH);
218        list.add(Y_LOCATION);
219
220        list.add(AM_DISTANCE);//2525C
221        //list.add(AM1_DISTANCE);//2525C
222        list.add(AN_AZIMUTH);//2525C
223        //list.add(AN1_AZIMUTH);//2525C
224
225        //back compat
226        list.add(LENGTH);
227        list.add(WIDTH);
228        list.add(RADIUS);
229        list.add(ANGLE);
230
231
232
233        return list;
234    }
235
236    /**
237     *
238     * @param modifier like ModifiersTG.C_QUANTITY
239     * @return modifier name based on mofidier constants
240     */
241    public static String getModifierName(int modifier)
242    {
243        switch(modifier)
244        {
245            //case A_SYMBOL_ICON:
246            //    return "Symbol Icon";
247            case B_ECHELON:
248                return "Echelon";
249            case C_QUANTITY:
250                return "Quantity";
251            case H_ADDITIONAL_INFO_1:
252                return "Additional Info 1";
253            case H1_ADDITIONAL_INFO_2:
254                return "Additional Info 2";
255            case H2_ADDITIONAL_INFO_3:
256                return "Additional Info 3";
257            case N_HOSTILE:
258                return "Hostile";
259            case Q_DIRECTION_OF_MOVEMENT:
260                return "Direction of Movement";
261            //case S_OFFSET_INDICATOR:
262            //    return "Offset Indicator";
263            case T_UNIQUE_DESIGNATION_1:
264                return "Unique Designation 1";
265            case T1_UNIQUE_DESIGNATION_2:
266                return "Unique Designation 2";
267            case V_EQUIP_TYPE:
268                return "Equipment Type";
269            case W_DTG_1:
270                return "Date Time Group 1";
271            case W1_DTG_2:
272                return "Date Time Group 2";
273            case X_ALTITUDE_DEPTH:
274                return "Altitude Depth";
275            case Y_LOCATION:
276                return "Location";
277            case AM_DISTANCE:
278                return "Distance";
279            case AN_AZIMUTH:
280                return "Azimuth";
281            default:
282                return "";
283
284        }
285    }
286
287    /**
288     *
289     * @param modifier like ModifiersTG.C_QUANTITY
290     * @return modifier name based on mofidier constants
291     */
292    public static String getModifierLetterCode(int modifier) {
293        switch (modifier) {
294            //case A_SYMBOL_ICON:
295            //    return "Symbol Icon";
296            case B_ECHELON:
297                return "B";
298            case C_QUANTITY:
299                return "C";
300            case H_ADDITIONAL_INFO_1:
301                return "H";
302            case H1_ADDITIONAL_INFO_2:
303                return "H1";
304            case H2_ADDITIONAL_INFO_3:
305                return "H2";
306            case N_HOSTILE:
307                return "N";
308            case Q_DIRECTION_OF_MOVEMENT:
309                return "Q";
310            //case S_OFFSET_INDICATOR:
311            //    return "Offset Indicator";
312            case T_UNIQUE_DESIGNATION_1:
313                return "T";
314            case T1_UNIQUE_DESIGNATION_2:
315                return "T1";
316            case V_EQUIP_TYPE:
317                return "V";
318            case W_DTG_1:
319                return "W";
320            case W1_DTG_2:
321                return "W1";
322            case X_ALTITUDE_DEPTH:
323                return "X";
324            case Y_LOCATION:
325                return "Y";
326            case AM_DISTANCE:
327                return "AM";
328            case AN_AZIMUTH:
329                return "AN";
330            default:
331                return "";
332
333        }
334    }
335
336    /**
337     * go from "T" or "T1" to integer constant values 9 and 10
338     * @param modLetter
339     * @return
340     */
341    public static int getModifierKey(String modLetter) {
342        switch (modLetter) {
343            //case A_SYMBOL_ICON:
344            //    return "Symbol Icon";
345            case "B":
346                return B_ECHELON;
347            case "C":
348                return C_QUANTITY;
349            case "H":
350                return H_ADDITIONAL_INFO_1;
351            case "H1":
352                return H1_ADDITIONAL_INFO_2;
353            case "H2":
354                return H2_ADDITIONAL_INFO_3;
355            case "N":
356                return N_HOSTILE;
357            case "Q":
358                return Q_DIRECTION_OF_MOVEMENT;
359            case "S":
360                return S_OFFSET_INDICATOR;
361            case "T":
362                return T_UNIQUE_DESIGNATION_1;
363            case "T1":
364                return T1_UNIQUE_DESIGNATION_2;
365            case "V":
366                return V_EQUIP_TYPE;
367            case "W":
368                return W_DTG_1;
369            case "W1":
370                return W1_DTG_2;
371            case "X":
372                return X_ALTITUDE_DEPTH;
373            case "Y":
374                return Y_LOCATION;
375            case "AM":
376                return AM_DISTANCE;
377            case "AN":
378                return AN_AZIMUTH;
379            default:
380                return -1;
381
382        }
383    }
384}