@armyc2.c5isr.renderer/mil-sym-ts-web 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +57 -0
  3. package/buildNode.bat +2 -0
  4. package/buildWeb.bat +2 -0
  5. package/dist/C5Ren.d.ts +6970 -0
  6. package/dist/C5Ren.js +2 -0
  7. package/dist/C5Ren.js.map +1 -0
  8. package/dist/LICENSE +201 -0
  9. package/dist/README.md +57 -0
  10. package/dist/armyc2.c5isr.renderer-mil-sym-ts-web-2.2.0.tgz +0 -0
  11. package/dist/manifest.json +4 -0
  12. package/dist/package.json +16 -0
  13. package/index.ts +169 -0
  14. package/package.bak +50 -0
  15. package/package.json +40 -0
  16. package/package.node.json +43 -0
  17. package/package.pack.json +19 -0
  18. package/package.packWeb.json +16 -0
  19. package/package.web.json +40 -0
  20. package/src/main/ts/android/graphics/Bitmap.ts +7 -0
  21. package/src/main/ts/android/graphics/Paint.ts +26 -0
  22. package/src/main/ts/android/graphics/Path.ts +78 -0
  23. package/src/main/ts/android/graphics/PointF.ts +14 -0
  24. package/src/main/ts/android/graphics/Rect.ts +18 -0
  25. package/src/main/ts/android/graphics/RectF.ts +50 -0
  26. package/src/main/ts/android/graphics/Region.ts +36 -0
  27. package/src/main/ts/android/graphics/Typeface.ts +11 -0
  28. package/src/main/ts/armyc2/c5isr/JavaLineArray/BasicShapes.ts +99 -0
  29. package/src/main/ts/armyc2/c5isr/JavaLineArray/CChannelPoints2.ts +34 -0
  30. package/src/main/ts/armyc2/c5isr/JavaLineArray/CELineArray.ts +193 -0
  31. package/src/main/ts/armyc2/c5isr/JavaLineArray/Channels.ts +2971 -0
  32. package/src/main/ts/armyc2/c5isr/JavaLineArray/DISMSupport.ts +4008 -0
  33. package/src/main/ts/armyc2/c5isr/JavaLineArray/POINT2.ts +93 -0
  34. package/src/main/ts/armyc2/c5isr/JavaLineArray/Shape2.ts +89 -0
  35. package/src/main/ts/armyc2/c5isr/JavaLineArray/TacticalLines.ts +515 -0
  36. package/src/main/ts/armyc2/c5isr/JavaLineArray/arraysupport.ts +5403 -0
  37. package/src/main/ts/armyc2/c5isr/JavaLineArray/countsupport.ts +1084 -0
  38. package/src/main/ts/armyc2/c5isr/JavaLineArray/flot.ts +2173 -0
  39. package/src/main/ts/armyc2/c5isr/JavaLineArray/lineutility.ts +4934 -0
  40. package/src/main/ts/armyc2/c5isr/JavaLineArray/ref.ts +7 -0
  41. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/Modifier2.ts +5601 -0
  42. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/P1.ts +14 -0
  43. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/TGLight.ts +648 -0
  44. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsChannelUtility.ts +647 -0
  45. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsMETOC.ts +2994 -0
  46. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsUtility.ts +2663 -0
  47. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/mdlGeodesic.ts +669 -0
  48. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipPolygon2.ts +971 -0
  49. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipQuad.ts +871 -0
  50. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer.ts +3507 -0
  51. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer2.ts +500 -0
  52. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtility.ts +1089 -0
  53. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityCPOF.ts +2656 -0
  54. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityGE.ts +1419 -0
  55. package/src/main/ts/armyc2/c5isr/data/genc.json +1407 -0
  56. package/src/main/ts/armyc2/c5isr/data/msd.json +17311 -0
  57. package/src/main/ts/armyc2/c5isr/data/mse.json +18500 -0
  58. package/src/main/ts/armyc2/c5isr/data/svgd.json +31214 -0
  59. package/src/main/ts/armyc2/c5isr/data/svge.json +30558 -0
  60. package/src/main/ts/armyc2/c5isr/graphics2d/AffineTransform.ts +10 -0
  61. package/src/main/ts/armyc2/c5isr/graphics2d/Area.ts +437 -0
  62. package/src/main/ts/armyc2/c5isr/graphics2d/BasicStroke.ts +429 -0
  63. package/src/main/ts/armyc2/c5isr/graphics2d/BasicTypes.ts +7 -0
  64. package/src/main/ts/armyc2/c5isr/graphics2d/BufferedImage.ts +35 -0
  65. package/src/main/ts/armyc2/c5isr/graphics2d/Font.ts +111 -0
  66. package/src/main/ts/armyc2/c5isr/graphics2d/FontMetrics.ts +29 -0
  67. package/src/main/ts/armyc2/c5isr/graphics2d/FontRenderContext.ts +18 -0
  68. package/src/main/ts/armyc2/c5isr/graphics2d/GeneralPath.ts +211 -0
  69. package/src/main/ts/armyc2/c5isr/graphics2d/Graphics2D.ts +80 -0
  70. package/src/main/ts/armyc2/c5isr/graphics2d/IPathIterator.ts +33 -0
  71. package/src/main/ts/armyc2/c5isr/graphics2d/ImageIO.ts +16 -0
  72. package/src/main/ts/armyc2/c5isr/graphics2d/Line2D.ts +726 -0
  73. package/src/main/ts/armyc2/c5isr/graphics2d/PathIterator.ts +141 -0
  74. package/src/main/ts/armyc2/c5isr/graphics2d/Point.ts +112 -0
  75. package/src/main/ts/armyc2/c5isr/graphics2d/Point2D.ts +261 -0
  76. package/src/main/ts/armyc2/c5isr/graphics2d/Polygon.ts +391 -0
  77. package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle.ts +567 -0
  78. package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle2D.ts +445 -0
  79. package/src/main/ts/armyc2/c5isr/graphics2d/Shape.ts +31 -0
  80. package/src/main/ts/armyc2/c5isr/graphics2d/Stroke.ts +18 -0
  81. package/src/main/ts/armyc2/c5isr/graphics2d/TextLayout.ts +45 -0
  82. package/src/main/ts/armyc2/c5isr/graphics2d/TexturePaint.ts +25 -0
  83. package/src/main/ts/armyc2/c5isr/renderer/IIconRenderer.ts +15 -0
  84. package/src/main/ts/armyc2/c5isr/renderer/IconRenderer.ts +22 -0
  85. package/src/main/ts/armyc2/c5isr/renderer/MilStdIconRenderer.ts +269 -0
  86. package/src/main/ts/armyc2/c5isr/renderer/ModifierRenderer.ts +9882 -0
  87. package/src/main/ts/armyc2/c5isr/renderer/PatternFillRenderer.ts +146 -0
  88. package/src/main/ts/armyc2/c5isr/renderer/SinglePointSVGRenderer.ts +1265 -0
  89. package/src/main/ts/armyc2/c5isr/renderer/shapes/arc.ts +64 -0
  90. package/src/main/ts/armyc2/c5isr/renderer/shapes/bcurve.ts +95 -0
  91. package/src/main/ts/armyc2/c5isr/renderer/shapes/ellipse.ts +93 -0
  92. package/src/main/ts/armyc2/c5isr/renderer/shapes/line.ts +114 -0
  93. package/src/main/ts/armyc2/c5isr/renderer/shapes/path.ts +555 -0
  94. package/src/main/ts/armyc2/c5isr/renderer/shapes/pathiterator.ts +62 -0
  95. package/src/main/ts/armyc2/c5isr/renderer/shapes/point.ts +120 -0
  96. package/src/main/ts/armyc2/c5isr/renderer/shapes/rectangle.ts +431 -0
  97. package/src/main/ts/armyc2/c5isr/renderer/shapes/roundedrectangle.ts +99 -0
  98. package/src/main/ts/armyc2/c5isr/renderer/shapes/types.ts +25 -0
  99. package/src/main/ts/armyc2/c5isr/renderer/shapes/utilities.ts +203 -0
  100. package/src/main/ts/armyc2/c5isr/renderer/utilities/AffiliationColors.ts +104 -0
  101. package/src/main/ts/armyc2/c5isr/renderer/utilities/Color.ts +481 -0
  102. package/src/main/ts/armyc2/c5isr/renderer/utilities/DistanceUnit.ts +40 -0
  103. package/src/main/ts/armyc2/c5isr/renderer/utilities/DrawRules.ts +1323 -0
  104. package/src/main/ts/armyc2/c5isr/renderer/utilities/EntityCode.ts +51 -0
  105. package/src/main/ts/armyc2/c5isr/renderer/utilities/ErrorLogger.ts +736 -0
  106. package/src/main/ts/armyc2/c5isr/renderer/utilities/GENCLookup.ts +106 -0
  107. package/src/main/ts/armyc2/c5isr/renderer/utilities/GeoPixelConversion3D.ts +84 -0
  108. package/src/main/ts/armyc2/c5isr/renderer/utilities/IMultiPointRenderer.ts +87 -0
  109. package/src/main/ts/armyc2/c5isr/renderer/utilities/IPointConversion.ts +34 -0
  110. package/src/main/ts/armyc2/c5isr/renderer/utilities/ImageInfo.ts +324 -0
  111. package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUCache.ts +127 -0
  112. package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUEntry.ts +18 -0
  113. package/src/main/ts/armyc2/c5isr/renderer/utilities/LogLevel.ts +111 -0
  114. package/src/main/ts/armyc2/c5isr/renderer/utilities/MODrawRules.ts +219 -0
  115. package/src/main/ts/armyc2/c5isr/renderer/utilities/MSInfo.ts +1008 -0
  116. package/src/main/ts/armyc2/c5isr/renderer/utilities/MSLookup.ts +882 -0
  117. package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdAttributes.ts +380 -0
  118. package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdSymbol.ts +797 -0
  119. package/src/main/ts/armyc2/c5isr/renderer/utilities/Modifiers.ts +1699 -0
  120. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversion.ts +178 -0
  121. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversionDummy.ts +45 -0
  122. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConverter3D.ts +126 -0
  123. package/src/main/ts/armyc2/c5isr/renderer/utilities/RectUtilities.ts +118 -0
  124. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererException.ts +11 -0
  125. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererSettings.ts +1201 -0
  126. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererUtilities.ts +591 -0
  127. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGInfo.ts +29 -0
  128. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGLookup.ts +753 -0
  129. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGSymbolInfo.ts +137 -0
  130. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGTextInfo.ts +438 -0
  131. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEvent.ts +19 -0
  132. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEventListener.ts +10 -0
  133. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsEventListener.ts +5 -0
  134. package/src/main/ts/armyc2/c5isr/renderer/utilities/Shape2SVG.ts +404 -0
  135. package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeInfo.ts +525 -0
  136. package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeUtilities.ts +55 -0
  137. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolDimensionInfo.ts +36 -0
  138. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolID.ts +1055 -0
  139. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolUtilities.ts +2085 -0
  140. package/src/main/ts/armyc2/c5isr/renderer/utilities/TextInfo.ts +157 -0
  141. package/src/main/ts/armyc2/c5isr/web/render/GeoPixelConversion.ts +86 -0
  142. package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandler.ts +3798 -0
  143. package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandlerSVG.ts +412 -0
  144. package/src/main/ts/armyc2/c5isr/web/render/PointConverter.ts +124 -0
  145. package/src/main/ts/armyc2/c5isr/web/render/SymbolModifiers.ts +26 -0
  146. package/src/main/ts/armyc2/c5isr/web/render/WebRenderer.ts +677 -0
  147. package/src/main/ts/armyc2/c5isr/web/render/utilities/JavaRendererUtilities.ts +484 -0
  148. package/src/main/ts/armyc2/c5isr/web/render/utilities/LineInfo.ts +62 -0
  149. package/src/main/ts/armyc2/c5isr/web/render/utilities/SymbolInfo.ts +46 -0
  150. package/src/main/ts/armyc2/c5isr/web/render/utilities/TextInfo.ts +51 -0
  151. package/src/main/ts/org/gavaghan/geodesy/Angle.ts +31 -0
  152. package/src/main/ts/org/gavaghan/geodesy/Ellipsoid.ts +71 -0
  153. package/src/main/ts/org/gavaghan/geodesy/GeodeticCalculator.ts +200 -0
  154. package/src/main/ts/org/gavaghan/geodesy/GeodeticCurve.ts +55 -0
  155. package/src/main/ts/org/gavaghan/geodesy/GeodeticMeasurement.ts +68 -0
  156. package/src/main/ts/org/gavaghan/geodesy/GlobalCoordinates.ts +103 -0
  157. package/src/main/ts/org/gavaghan/geodesy/GlobalPosition.ts +90 -0
  158. package/test/ExportSPImages.js +692 -0
  159. package/test/MPWW.html +556 -0
  160. package/test/MPWorker.js +318 -0
  161. package/test/SPWorker.js +233 -0
  162. package/test/SVGWW.html +363 -0
  163. package/test/singlePointTester3.html +751 -0
  164. package/tsconfig.json +54 -0
  165. package/typedoc.json +30 -0
  166. package/updateVersion.js +21 -0
  167. package/webpack.config.js +34 -0
  168. package/webpackn.config.js +28 -0
  169. package/webpackr.config.js +47 -0
  170. package/webpackw.config.js +23 -0
@@ -0,0 +1,1055 @@
1
+
2
+ import { MSLookup } from "../../renderer/utilities/MSLookup"
3
+ import { SVGLookup } from "../../renderer/utilities/SVGLookup"
4
+ import { SymbolUtilities } from "./SymbolUtilities";
5
+
6
+ /**
7
+ * Utility class for helping to parse out parts of the symbol ID.
8
+ *
9
+ */
10
+ export class SymbolID {
11
+ /*
12
+ //Version, 1-2
13
+
14
+ //Standard Identity, First Digit (3)
15
+ public static final char StandardIdentity_Context_Reality = '0';
16
+ public static final char StandardIdentity_Context_Exercise = '1';
17
+ public static final char StandardIdentity_Context_Simulation = '2';
18
+
19
+ //Standard Identity, Second Digit (4)
20
+ public static final char StandardIdentity_Affiliation_Pending = '0';
21
+ public static final char StandardIdentity_Affiliation_Unknown = '1';
22
+ public static final char StandardIdentity_Affiliation_AssumedFriend = '2';
23
+ public static final char StandardIdentity_Affiliation_Friend = '3';
24
+ public static final char StandardIdentity_Affiliation_Neutral = '4';
25
+ public static final char StandardIdentity_Affiliation_Suspect_Joker = '5';
26
+ public static final char StandardIdentity_Affiliation_Hostile_Faker = '6';
27
+
28
+ //Symbol Set, 2 Digits (5-6)
29
+ public static final String SymbolSet_Unknown = "00";
30
+ public static final String SymbolSet_Air = "01";
31
+ public static final String SymbolSet_AirMissile = "02";
32
+ public static final String SymbolSet_Space = "05";
33
+ public static final String SymbolSet_SpaceMissile = "06";
34
+ public static final String SymbolSet_LandUnit = "10";
35
+ public static final String SymbolSet_LandCivilianUnit_Organization = "11";
36
+ public static final String SymbolSet_LandEquipment = "15";
37
+ public static final String SymbolSet_LandInstallation = "20";
38
+ public static final String SymbolSet_ControlMeasure = "25";
39
+ public static final String SymbolSet_SeaSurface = "30";
40
+ public static final String SymbolSet_SeaSubsurface = "35";
41
+ public static final String SymbolSet_MineWarfare = "36";
42
+ public static final String SymbolSet_Activities = "40";
43
+ public static final String SymbolSet_Atmospheric = "45";
44
+ public static final String SymbolSet_Oceanographic = "46";
45
+ public static final String SymbolSet_MeteorologicalSpace = "47";
46
+ public static final String SymbolSet_SignalsIntelligence_Space = "50";
47
+ public static final String SymbolSet_SignalsIntelligence_Air = "51";
48
+ public static final String SymbolSet_SignalsIntelligence_Land = "52";
49
+ public static final String SymbolSet_SignalsIntelligence_Surface = "53";
50
+ public static final String SymbolSet_SignalsIntelligence_Subsurface = "54";
51
+ public static final String SymbolSet_CyberSpace = "60";
52
+ public static final String SymbolSet_VersionExtensionFlag = "99";
53
+
54
+ //Status, 1 Digit
55
+ public static final char Status_Present = '0';
56
+ public static final char Status_Planned_Anticipated_Suspect = '1';
57
+ public static final char Status_Present_FullyCapable = '2';
58
+ public static final char Status_Present_Damaged = '3';
59
+ public static final char Status_Present_Destroyed = '4';
60
+ public static final char Status_Present_FullToCapacity = '5';
61
+ public static final char Status_Present_VersionExtensionFlag = '9';
62
+
63
+ //Headquarters/Task Force/Dummy
64
+ public static final char HQTFD_Unknown = '0';
65
+ public static final char HQTFD_FeintDummy = '1';
66
+ public static final char HQTFD_Headquarters = '2';
67
+ public static final char HQTFD_FeintDummy_Headquarters = '3';
68
+ public static final char HQTFD_TaskForce = '4';
69
+ public static final char HQTFD_FeintDummy_TaskForce = '5';
70
+ public static final char HQTFD_TaskForce_Headquarters = '6';
71
+ public static final char HQTFD_FeintDummy_TaskForce_Headquarters = '7';
72
+ public static final char HQTFD_VersionExtensionFlag = '9';
73
+
74
+ //Echelon/Mobility/Towed Array Amplifier
75
+ public static final String Echelon_Unknown = "00";
76
+ public static final String Echelon_Team_Crew = "11";
77
+ public static final String Echelon_Squad = "12";
78
+ public static final String Echelon_Section = "13";
79
+ public static final String Echelon_Platoon_Detachment = "14";
80
+ public static final String Echelon_Company_Battery_Troop = "15";
81
+ public static final String Echelon_Battalion_Squadron = "16";
82
+ public static final String Echelon_Regiment_Group = "17";
83
+ public static final String Echelon_Brigade = "18";
84
+ public static final String Echelon_VersionExtensionFlag = "19";
85
+ public static final String Echelon_Division = "21";
86
+ public static final String Echelon_Corps_MEF = "22";
87
+ public static final String Echelon_Army = "23";
88
+ public static final String Echelon_ArmyGroup_Front = "24";
89
+ public static final String Echelon_Region_Theater = "25";
90
+ public static final String Echelon_Region_Command = "26";
91
+ public static final String Echelon_VersionExtensionFlag2 = "29";
92
+
93
+ public static final String Mobility_Unknown = "00";
94
+ //equipment mobility on land
95
+ public static final String Mobility_WheeledLimitedCrossCountry = "31";
96
+ public static final String Mobility_WheeledCrossCountry = "32";
97
+ public static final String Mobility_Tracked = "33";
98
+ public static final String Mobility_Wheeled_Tracked = "34";
99
+ public static final String Mobility_Towed = "35";
100
+ public static final String Mobility_Rail = "36";
101
+ public static final String Mobility_PackAnimals = "37";
102
+ //equipment mobility on snow
103
+ public static final String Mobility_OverSnow = "41";
104
+ public static final String Mobility_Sled = "42";
105
+ //equipment mobility on water
106
+ public static final String Mobility_Barge = "51";
107
+ public static final String Mobility_Amphibious = "52";
108
+ //naval towed array
109
+ public static final String Mobility_ShortTowedArray = "61";
110
+ public static final String Mobility_LongTowedArray = "62";//*/
111
+
112
+
113
+ //Version, 1-2 (Can't start with zero, will be 10 at a minimum)
114
+ public static readonly Version_2525D: number = 10;
115
+ public static readonly Version_2525Dch1: number = 11;
116
+ /**
117
+ * @deprecated withdrawn from standard
118
+ */
119
+ public static readonly Version_APP6Dch2: number = 12;
120
+ public static readonly Version_2525E: number = 13;
121
+ public static readonly Version_APP6Ech1: number = 14;
122
+ public static readonly Version_2525Ech1: number = 15;
123
+ public static readonly Version_APP6Ech2: number = 16;
124
+
125
+ //Standard Identity, First Digit (3)
126
+ public static readonly StandardIdentity_Context_Reality: number = 0;
127
+ public static readonly StandardIdentity_Context_Exercise: number = 1;
128
+ public static readonly StandardIdentity_Context_Simulation: number = 2;
129
+
130
+ //Standard Identity, Second Digit (4)
131
+ public static readonly StandardIdentity_Affiliation_Pending: number = 0;
132
+ public static readonly StandardIdentity_Affiliation_Unknown: number = 1;
133
+ public static readonly StandardIdentity_Affiliation_AssumedFriend: number = 2;
134
+ public static readonly StandardIdentity_Affiliation_Friend: number = 3;
135
+ public static readonly StandardIdentity_Affiliation_Neutral: number = 4;
136
+ public static readonly StandardIdentity_Affiliation_Suspect_Joker: number = 5;
137
+ public static readonly StandardIdentity_Affiliation_Hostile_Faker: number = 6;
138
+
139
+ //Symbol Set, 2 Digits (5-6)
140
+ public static readonly SymbolSet_Unknown: number = 0;
141
+ public static readonly SymbolSet_Air: number = 1;
142
+ public static readonly SymbolSet_AirMissile: number = 2;
143
+ public static readonly SymbolSet_Space: number = 5;
144
+ public static readonly SymbolSet_SpaceMissile: number = 6;
145
+ public static readonly SymbolSet_LandUnit: number = 10;
146
+ public static readonly SymbolSet_LandCivilianUnit_Organization: number = 11;
147
+ public static readonly SymbolSet_LandEquipment: number = 15;
148
+ public static readonly SymbolSet_LandInstallation: number = 20;
149
+ public static readonly SymbolSet_ControlMeasure: number = 25;
150
+ public static readonly SymbolSet_DismountedIndividuals: number = 27;
151
+ public static readonly SymbolSet_SeaSurface: number = 30;
152
+ public static readonly SymbolSet_SeaSubsurface: number = 35;
153
+ public static readonly SymbolSet_MineWarfare: number = 36;
154
+ public static readonly SymbolSet_Activities: number = 40;
155
+ public static readonly SymbolSet_Atmospheric: number = 45;
156
+ public static readonly SymbolSet_Oceanographic: number = 46;
157
+ public static readonly SymbolSet_MeteorologicalSpace: number = 47;
158
+ public static readonly SymbolSet_SignalsIntelligence: number = 50;
159
+ public static readonly SymbolSet_SignalsIntelligence_Space: number = 50;
160
+ public static readonly SymbolSet_SignalsIntelligence_Air: number = 51;
161
+ public static readonly SymbolSet_SignalsIntelligence_Land: number = 52;
162
+ public static readonly SymbolSet_SignalsIntelligence_SeaSurface: number = 53;
163
+ public static readonly SymbolSet_SignalsIntelligence_SeaSubsurface: number = 54;
164
+ public static readonly SymbolSet_CyberSpace: number = 60;
165
+
166
+ public static readonly SymbolSet_InvalidSymbol: number = 98;
167
+ public static readonly SymbolSet_VersionExtensionFlag: number = 99;
168
+
169
+ //Status, 1 Digit
170
+ public static readonly Status_Present: number = 0;
171
+ public static readonly Status_Planned_Anticipated_Suspect: number = 1;
172
+ public static readonly Status_Present_FullyCapable: number = 2;
173
+ public static readonly Status_Present_Damaged: number = 3;
174
+ public static readonly Status_Present_Destroyed: number = 4;
175
+ public static readonly Status_Present_FullToCapacity: number = 5;
176
+ public static readonly Status_Present_VersionExtensionFlag: number = 9;
177
+
178
+ //Headquarters/Task Force/Dummy
179
+ public static readonly HQTFD_Unknown: number = 0;
180
+ public static readonly HQTFD_FeintDummy: number = 1;
181
+ public static readonly HQTFD_Headquarters: number = 2;
182
+ public static readonly HQTFD_FeintDummy_Headquarters: number = 3;
183
+ public static readonly HQTFD_TaskForce: number = 4;
184
+ public static readonly HQTFD_FeintDummy_TaskForce: number = 5;
185
+ public static readonly HQTFD_TaskForce_Headquarters: number = 6;
186
+ public static readonly HQTFD_FeintDummy_TaskForce_Headquarters: number = 7;
187
+ public static readonly HQTFD_VersionExtensionFlag: number = 9;
188
+
189
+ //Echelon/Mobility/Towed Array Amplifier
190
+ public static readonly Echelon_Unknown: number = 0;
191
+ public static readonly Echelon_Team_Crew: number = 11;
192
+ public static readonly Echelon_Squad: number = 12;
193
+ public static readonly Echelon_Section: number = 13;
194
+ public static readonly Echelon_Platoon_Detachment: number = 14;
195
+ public static readonly Echelon_Company_Battery_Troop: number = 15;
196
+ public static readonly Echelon_Battalion_Squadron: number = 16;
197
+ public static readonly Echelon_Regiment_Group: number = 17;
198
+ public static readonly Echelon_Brigade: number = 18;
199
+ public static readonly Echelon_VersionExtensionFlag: number = 19;
200
+ public static readonly Echelon_Division: number = 21;
201
+ public static readonly Echelon_Corps_MEF: number = 22;
202
+ public static readonly Echelon_Army: number = 23;
203
+ public static readonly Echelon_ArmyGroup_Front: number = 24;
204
+ public static readonly Echelon_Region_Theater: number = 25;
205
+ public static readonly Echelon_Region_Command: number = 26;
206
+ public static readonly Echelon_VersionExtensionFlag2: number = 29;
207
+
208
+ public static readonly Mobility_Unknown: number = 0;
209
+ //equipment mobility on land
210
+ public static readonly Mobility_WheeledLimitedCrossCountry: number = 31;
211
+ public static readonly Mobility_WheeledCrossCountry: number = 32;
212
+ public static readonly Mobility_Tracked: number = 33;
213
+ public static readonly Mobility_Wheeled_Tracked: number = 34;
214
+ public static readonly Mobility_Towed: number = 35;
215
+ public static readonly Mobility_Rail: number = 36;
216
+ public static readonly Mobility_PackAnimals: number = 37;
217
+ //equipment mobility on snow
218
+ public static readonly Mobility_OverSnow: number = 41;
219
+ public static readonly Mobility_Sled: number = 42;
220
+ //equipment mobility on water
221
+ public static readonly Mobility_Barge: number = 51;
222
+ public static readonly Mobility_Amphibious: number = 52;
223
+ //naval towed array
224
+ public static readonly Mobility_ShortTowedArray: number = 61;
225
+ public static readonly Mobility_LongTowedArray: number = 62;
226
+
227
+ public static readonly Leadership_Individual: number = 71;
228
+
229
+ //Frame Shape, 1 digit, position 23
230
+ public static readonly FrameShape_Unknown: string = '0';
231
+ public static readonly FrameShape_Space: string = '1';
232
+ public static readonly FrameShape_Air: string = '2';
233
+ public static readonly FrameShape_LandUnit: string = '3';
234
+ public static readonly FrameShape_LandEquipment_SeaSurface: string = '4';
235
+ public static readonly FrameShape_LandInstallation: string = '5';
236
+ public static readonly FrameShape_DismountedIndividuals: string = '6';
237
+ public static readonly FrameShape_SeaSubsurface: string = '7';
238
+ public static readonly FrameShape_Activity_Event: string = '8';
239
+ public static readonly FrameShape_Cyberspace: string = '9';
240
+
241
+
242
+ /**
243
+ * Attempts to resolve a bad symbol ID into a value that can be found in {@link MSLookup}.
244
+ * If it fails, it will return the symbol code for a invalid symbol which is displayed as
245
+ * an inverted question mark (110098000010000000000000000000)
246
+ * @param symbolID 30 character string
247
+ * @return 30 character string representing the resolved symbol ID.
248
+ * @deprecated See {@link SymbolUtilities.reconcileSymbolID()}
249
+ */
250
+ public static reconcileSymbolID(symbolID: string): string {
251
+ return SymbolUtilities.reconcileSymbolID(symbolID);
252
+ }
253
+
254
+ /**
255
+ * Gets the version number from the Symbol ID at positions 1-2
256
+ * @param symbolID 30 character string
257
+ * @return number like {@link SymbolID.Version_2525Dch1} (11)
258
+ */
259
+ public static getVersion(symbolID: string): number {
260
+ let v: number = 11;
261
+ if (symbolID != null && symbolID.length >= 20) {
262
+ v = parseInt(symbolID.substring(0, 2));
263
+
264
+ }
265
+ return v;
266
+ }
267
+
268
+ /**
269
+ * Sets the version number of the Symbol ID at positions 1-2
270
+ * @param symbolID 30 character string
271
+ * @param ver number like {@link SymbolID.Version_2525Dch1} (11)
272
+ * @return updated 30 character string symbol ID
273
+ */
274
+ public static setVersion(symbolID: string, ver: number): string {
275
+ let strVer: string = ver.toString();
276
+
277
+ if (symbolID != null && symbolID.length >= 20) {
278
+ if (strVer.length !== 2) {
279
+
280
+ strVer = "11";
281
+ }
282
+ //default to 2525Dch1
283
+
284
+ return strVer + symbolID.substring(2);
285
+ }
286
+ else {
287
+ return symbolID;
288
+ }
289
+ }
290
+
291
+
292
+ /**
293
+ * Gets the version number from the Symbol ID at positions 3-4.
294
+ * Restricted and No-Strike values are NATO only.
295
+ * @param symbolID 30 character string
296
+ * @return number, number will not be padded if it starts with a '0'
297
+ */
298
+ public static getStandardIdentity(symbolID: string): number {
299
+ if (symbolID != null && symbolID.length >= 20) {
300
+ return parseInt(symbolID.substring(2, 4));
301
+ }
302
+ else {
303
+ return 0;
304
+ }
305
+ }
306
+
307
+ /**
308
+ * Sets the version number of the Symbol ID at positions 3-4
309
+ * @param symbolID 30 character string
310
+ * @param si number If number is a single digit, will pad with a '0' before inserting into symbol ID
311
+ * @return updated 30 character string symbol ID
312
+ */
313
+ public static setStandardIdentity(symbolID: string, si: number): string {
314
+ let strSI: string = si.toString();
315
+
316
+ if (symbolID != null && symbolID.length >= 20) {
317
+ if (si < 10 && strSI.length === 1) {
318
+
319
+ strSI = "0" + strSI;
320
+ }
321
+
322
+ else {
323
+
324
+ strSI = si.toString();
325
+ }
326
+
327
+
328
+ return symbolID.substring(0, 2) + strSI + symbolID.substring(4);
329
+ }
330
+ else {
331
+ return symbolID;
332
+ }
333
+ }
334
+
335
+
336
+ /**
337
+ * Get Context (Reality (0), Exercise (1), Simulation (2)) at position 3
338
+ * Higher values are NATO only
339
+ * @param symbolID 30 Character string
340
+ * @return number
341
+ */
342
+ public static getContext(symbolID: string): number {
343
+ if (symbolID != null && symbolID.length >= 20) {
344
+ return parseInt(symbolID.substring(2, 3));
345
+ }
346
+ else {
347
+ return 0;
348
+ }
349
+ }
350
+
351
+ /**
352
+ * Set Context (Reality (0), Exercise (1), Simulation (2)) at position 3
353
+ * @param symbolID 30 Character string
354
+ * @param context number
355
+ * @return string updated Symbol ID.
356
+ */
357
+ public static setContext(symbolID: string, context: number): string {
358
+ if (symbolID != null && symbolID.length >= 20 && context < 4) {
359
+ return symbolID.substring(0, 2) + context.toString() + symbolID.substring(3);
360
+ }
361
+ else {
362
+ return symbolID;
363
+ }
364
+ }
365
+
366
+ /**
367
+ * Get Affiliation from position 4
368
+ * @param symbolID 30 Character string
369
+ * @return number like {@link SymbolID.StandardIdentity_Affiliation_Friend}
370
+ */
371
+ public static getAffiliation(symbolID: string): number {
372
+ if (symbolID != null && symbolID.length >= 20) {
373
+ return parseInt(symbolID.substring(3, 4));
374
+ }
375
+ else {
376
+ return 0;
377
+ }
378
+ }
379
+
380
+ /**
381
+ * Set Affiliation at position 4
382
+ * @param symbolID 30 Character string
383
+ * @param affiliation like {@link SymbolID.StandardIdentity_Affiliation_Friend}
384
+ * @return string updated Symbol ID.
385
+ */
386
+ public static setAffiliation(symbolID: string, affiliation: number): string {
387
+ if (symbolID != null && symbolID.length >= 20) {
388
+ return symbolID.substring(0, 3) + affiliation.toString() + symbolID.substring(4);
389
+ // return Integer.parseInt(symbolID.substring(2,4));
390
+ }
391
+ else {
392
+ return symbolID;
393
+ }
394
+ }
395
+
396
+ /**
397
+ * Get Symbol Set from positions 5-6
398
+ * @param symbolID 30 Character string
399
+ * @return number like {@link SymbolID.SymbolSet_LandCivilianUnit_Organization}
400
+ */
401
+ public static getSymbolSet(symbolID: string): number {
402
+ if (symbolID != null && symbolID.length >= 20) {
403
+ return parseInt(symbolID.substring(4, 6));
404
+ }
405
+ else {
406
+ return 0;
407
+ }
408
+ }
409
+
410
+ /**
411
+ * Set Symbol Set at positions 5-6
412
+ * @param symbolID 30 Character string
413
+ * @param ss like {@link SymbolID.SymbolSet_LandCivilianUnit_Organization}
414
+ * @return string updated Symbol ID.
415
+ */
416
+ public static setSymbolSet(symbolID: string, ss: number): string {
417
+ let strSS: string = ss.toString();
418
+ if (ss < 10 && strSS.length === 1) {
419
+
420
+ strSS = "0" + strSS;
421
+ }
422
+
423
+ if (symbolID != null && symbolID.length >= 20) {
424
+ return symbolID.substring(0, 4) + strSS + symbolID.substring(6);
425
+ }
426
+ else {
427
+ return symbolID;
428
+ }
429
+ }
430
+
431
+ /**
432
+ * Get Symbol Set from position 7
433
+ * @param symbolID 30 Character string
434
+ * @return number like {@link SymbolID.Status_Present}
435
+ */
436
+ public static getStatus(symbolID: string): number {
437
+ if (symbolID != null && symbolID.length >= 20) {
438
+ return parseInt(symbolID.substring(6, 7));
439
+ }
440
+ else {
441
+ return 0;
442
+ }
443
+ }
444
+
445
+ /**
446
+ * Set Symbol Set at position 7
447
+ * @param symbolID 30 Character string
448
+ * @param status like {@link SymbolID.Status_Present}
449
+ * @return string updated Symbol ID.
450
+ */
451
+ public static setStatus(symbolID: string, status: number): string {
452
+ let strStatus: string = status.toString();
453
+
454
+ if (symbolID != null && symbolID.length >= 20 && strStatus.length === 1) {
455
+ return symbolID.substring(0, 6) + strStatus + symbolID.substring(7);
456
+ }
457
+ else {
458
+ return symbolID;
459
+ }
460
+ }
461
+
462
+ /**
463
+ * Get Symbol Set from position 8
464
+ * @param symbolID 30 Character string
465
+ * @return number like {@link SymbolID.HQTFD_Headquarters}
466
+ */
467
+ public static getHQTFD(symbolID: string): number {
468
+ if (symbolID != null && symbolID.length >= 20) {
469
+ return parseInt(symbolID.substring(7, 8));
470
+ }
471
+ else {
472
+ return 0;
473
+ }
474
+ }
475
+
476
+ /**
477
+ * Set Symbol Set at position 8
478
+ * @param symbolID 30 Character string
479
+ * @param HQTFD like {@link SymbolID.HQTFD_Headquarters}
480
+ * @return string updated Symbol ID.
481
+ */
482
+ public static setHQTFD(symbolID: string, HQTFD: number): string {
483
+ let strHQTFD: string = HQTFD.toString();
484
+
485
+ if (symbolID != null && symbolID.length >= 20 && strHQTFD.length === 1) {
486
+ return symbolID.substring(0, 7) + strHQTFD + symbolID.substring(8);
487
+ }
488
+ else {
489
+ return symbolID;
490
+ }
491
+ }
492
+
493
+ /**
494
+ * Get Amplifier Descriptor which can describe things like
495
+ * Echelon / Mobility / Towed Array / Leadership Indicator from positions 9-10
496
+ * @param symbolID 30 Character string
497
+ * @return number
498
+ */
499
+ public static getAmplifierDescriptor(symbolID: string): number {
500
+ if (symbolID != null && symbolID.length >= 20) {
501
+ return parseInt(symbolID.substring(8, 10));
502
+ }
503
+ else {
504
+ return 0;
505
+ }
506
+ }
507
+
508
+ /**
509
+ * Set Amplifier Descriptor which can describe things like
510
+ * Echelon / Mobility / Towed Array / Leadership Indicator at positions 9-10
511
+ * @param symbolID 30 Character string
512
+ * @param ad
513
+ * @return string
514
+ */
515
+ public static setAmplifierDescriptor(symbolID: string, ad: number): string {
516
+ let strAD: string = ad.toString();
517
+ if (ad < 10 && strAD.length === 1) {
518
+
519
+ strAD = "0" + strAD;
520
+ }
521
+
522
+
523
+ if (symbolID != null && symbolID.length >= 20 && strAD.length === 2) {
524
+ return symbolID.substring(0, 8) + strAD + symbolID.substring(10);
525
+ }
526
+ else {
527
+ return symbolID;
528
+ }
529
+ }
530
+
531
+ /**
532
+ * Get Entity Code from positions 11-16.
533
+ * These six digits identify a unique symbol within a symbol set.
534
+ * @param symbolID 30 Character string
535
+ * @return number
536
+ */
537
+ public static getEntityCode(symbolID: string): number {
538
+ if (symbolID != null && symbolID.length >= 20) {
539
+ return parseInt(symbolID.substring(10, 16));
540
+ }
541
+ else {
542
+ return 0;
543
+ }
544
+ }
545
+
546
+ /**
547
+ * Set Entity Code at positions 11-16.
548
+ * These six digits identify a unique symbol within a symbol set.
549
+ * @param symbolID 30 Character string
550
+ * @param entityCode number
551
+ * @return string
552
+ */
553
+ public static setEntityCode(symbolID: string, entityCode: number): string {
554
+ let strSS: string = entityCode.toString();
555
+ while (strSS.length < 6)
556
+ strSS = "0" + strSS;
557
+ if (symbolID != null && symbolID.length >= 20) {
558
+ return symbolID.substring(0, 10) + strSS + symbolID.substring(16);
559
+ }
560
+ else {
561
+ return symbolID;
562
+ }
563
+ }
564
+
565
+ /**
566
+ * Get Entity from positions 11-12.
567
+ * @param symbolID 30 Character string
568
+ * @return number
569
+ */
570
+ public static getEntity(symbolID: string): number {
571
+ if (symbolID != null && symbolID.length >= 20) {
572
+ return parseInt(symbolID.substring(10, 12));
573
+ }
574
+ else {
575
+ return 0;
576
+ }
577
+ }
578
+
579
+ /**
580
+ * Get Entity Type from positions 13-14.
581
+ * @param symbolID 30 Character string
582
+ * @return number
583
+ */
584
+ public static getEntityType(symbolID: string): number {
585
+ if (symbolID != null && symbolID.length >= 20) {
586
+ return parseInt(symbolID.substring(12, 14));
587
+ }
588
+ else {
589
+ return 0;
590
+ }
591
+ }
592
+
593
+ /**
594
+ * Get Entity Subtype from positions 15-16.
595
+ * @param symbolID 30 Character string
596
+ * @return number
597
+ */
598
+ public static getEntitySubtype(symbolID: string): number {
599
+ if (symbolID != null && symbolID.length >= 20) {
600
+ return parseInt(symbolID.substring(14, 16));
601
+ }
602
+ else {
603
+ return 0;
604
+ }
605
+ }
606
+
607
+ /**
608
+ * Get Sector 1 Modifier from positions 17-18.
609
+ * @param symbolID 30 Character string
610
+ * @return number
611
+ */
612
+ public static getModifier1(symbolID: string): number {
613
+ if (symbolID != null && symbolID.length >= 20) {
614
+ return parseInt(symbolID.substring(16, 18));
615
+ }
616
+ else {
617
+ return 0;
618
+ }
619
+ }
620
+
621
+ /**
622
+ * Set Sector 1 Modifier at positions 17-18.
623
+ * @param symbolID 30 Character string
624
+ * @param mod1 number
625
+ * @return string
626
+ */
627
+ public static setModifier1(symbolID: string, mod1: number): string {
628
+ let newID: string = symbolID.toString();
629
+ let mod: string = mod1.toString();
630
+ if (mod.length === 1) {
631
+
632
+ mod = "0" + mod;
633
+ }
634
+
635
+ if (symbolID != null && symbolID.length >= 20) {
636
+ newID = newID.substring(0, 16) + mod + newID.substring(18);
637
+ }
638
+ return newID;
639
+ }
640
+
641
+ /**
642
+ * Get Common Sector 1 Modifier from position 21.
643
+ * @param symbolID 30 Character string
644
+ * @return number
645
+ */
646
+ public static getCommonModifier1(symbolID: string): number {
647
+ let m1: string = "";
648
+ if (symbolID != null && symbolID.length === 30) {
649
+ m1 += symbolID.substring(20, 21);
650
+ return parseInt(m1);
651
+ }
652
+ else {
653
+ return 0;
654
+ }
655
+ }
656
+
657
+ /**
658
+ * Set Common Sector 1 Modifier at position 21.
659
+ * @param symbolID 30 Character string
660
+ * @param mod1I number
661
+ * @return string
662
+ */
663
+ public static setCommonModifier1(symbolID: string, mod1I: number): string {
664
+ let newID: string = symbolID.toString();
665
+ let mod: string = mod1I.toString();
666
+ if (symbolID != null && symbolID.length === 30) {
667
+ newID = newID.substring(0, 20) + mod + newID.substring(21);
668
+ }
669
+ return newID;
670
+ }
671
+
672
+ /**
673
+ * Get Sector 2 Modifier from positions 17-18.
674
+ * @param symbolID 30 Character string
675
+ * @return number
676
+ */
677
+ public static getModifier2(symbolID: string): number {
678
+ if (symbolID != null && symbolID.length >= 20) {
679
+ return parseInt(symbolID.substring(18, 20));
680
+ }
681
+ else {
682
+ return 0;
683
+ }
684
+ }
685
+
686
+ /**
687
+ * Set Sector 2 Modifier at positions 17-18.
688
+ * @param symbolID 30 Character string
689
+ * @param mod1 number
690
+ * @return string
691
+ */
692
+ public static setModifier2(symbolID: string, mod1: number): string {
693
+ let newID: string = symbolID.toString();
694
+ let mod: string = mod1.toString();
695
+ if (mod.length === 1) {
696
+ mod = "0" + mod;
697
+ }
698
+
699
+ if (symbolID != null && symbolID.length >= 20) {
700
+ newID = newID.substring(0, 18) + mod + newID.substring(20);
701
+ }
702
+ return newID;
703
+ }
704
+
705
+ /**
706
+ * Get Common Sector 2 Modifier from position 22.
707
+ * @param symbolID 30 Character string
708
+ * @return number
709
+ */
710
+ public static getCommonModifier2(symbolID: string): number {
711
+ let m1: string = "";
712
+ if (symbolID != null && symbolID.length === 30) {
713
+ m1 += symbolID.substring(21, 22);
714
+ return parseInt(m1);
715
+ }
716
+ else {
717
+ return 0;
718
+ }
719
+ }
720
+
721
+ /**
722
+ * Set Common Sector 2 Modifier at position 22.
723
+ * @param symbolID 30 Character string
724
+ * @param mod1I number
725
+ * @return string
726
+ */
727
+ public static setCommonModifier2(symbolID: string, mod1I: number): string {
728
+ let newID: string = symbolID.toString();
729
+ let mod: string = mod1I.toString();
730
+ if (symbolID != null && symbolID.length === 30) {
731
+ newID = newID.substring(0, 21) + mod + newID.substring(22);
732
+ }
733
+ return newID;
734
+ }
735
+
736
+ /*
737
+ public static String getStandardIdentity(String symbolID)
738
+ {
739
+ if(symbolID != null && symbolID.length >= 20)
740
+ {
741
+ return symbolID.substring(2, 4);
742
+ }
743
+ else
744
+ {
745
+ return "00";
746
+ }
747
+ }
748
+
749
+ public static char getContext(String symbolID)
750
+ {
751
+ if(symbolID != null && symbolID.length >= 20)
752
+ {
753
+ return symbolID.charAt(3);
754
+ }
755
+ else
756
+ {
757
+ return '0';
758
+ }
759
+ }
760
+
761
+ public static char getAffiliation(String symbolID)
762
+ {
763
+ if(symbolID != null && symbolID.length >= 20)
764
+ {
765
+ return symbolID.charAt(4);
766
+ }
767
+ else
768
+ {
769
+ return '0';
770
+ }
771
+ }
772
+
773
+ public static String getSymbolSet(String symbolID)
774
+ {
775
+ if(symbolID != null && symbolID.length >= 20)
776
+ {
777
+ return symbolID.substring(4, 6);
778
+ }
779
+ else
780
+ {
781
+ return "00";
782
+ }
783
+ }
784
+
785
+ public static char getStatus(String symbolID)
786
+ {
787
+ if(symbolID != null && symbolID.length >= 20)
788
+ {
789
+ return symbolID.charAt(6);
790
+ }
791
+ else
792
+ {
793
+ return '0';
794
+ }
795
+ }
796
+
797
+ public static char getHQTFD(String symbolID)
798
+ {
799
+ if(symbolID != null && symbolID.length >= 20)
800
+ {
801
+ return symbolID.charAt(7);
802
+ }
803
+ else
804
+ {
805
+ return '0';
806
+ }
807
+ }
808
+
809
+
810
+ // get Echelon / Mobility / Towed Array
811
+ // @param symbolID
812
+ // @return
813
+
814
+ public static String getAmplifierDescriptor(String symbolID)
815
+ {
816
+ if(symbolID != null && symbolID.length >= 20)
817
+ {
818
+ return symbolID.substring(8, 10);
819
+ }
820
+ else
821
+ {
822
+ return "00";
823
+ }
824
+ }
825
+
826
+ public static String getEntityCode(String symbolID)
827
+ {
828
+ if(symbolID != null && symbolID.length >= 20)
829
+ {
830
+ return symbolID.substring(10, 16);
831
+ }
832
+ else
833
+ {
834
+ return "000000";
835
+ }
836
+ }
837
+
838
+ public static String getEntity(String symbolID)
839
+ {
840
+ if(symbolID != null && symbolID.length >= 20)
841
+ {
842
+ return symbolID.substring(10, 12);
843
+ }
844
+ else
845
+ {
846
+ return "00";
847
+ }
848
+ }
849
+
850
+ public static String getEntityType(String symbolID)
851
+ {
852
+ if(symbolID != null && symbolID.length >= 20)
853
+ {
854
+ return symbolID.substring(12, 14);
855
+ }
856
+ else
857
+ {
858
+ return "00";
859
+ }
860
+ }
861
+
862
+ public static String getEntitySubtype(String symbolID)
863
+ {
864
+ if(symbolID != null && symbolID.length >= 20)
865
+ {
866
+ return symbolID.substring(14, 16);
867
+ }
868
+ else
869
+ {
870
+ return "00";
871
+ }
872
+ }
873
+
874
+ public static String getModifier1(String symbolID)
875
+ {
876
+ if(symbolID != null && symbolID.length >= 20)
877
+ {
878
+ return symbolID.substring(16, 18);
879
+ }
880
+ else
881
+ {
882
+ return "00";
883
+ }
884
+ }
885
+
886
+ public static String getModifier2(String symbolID)
887
+ {
888
+ if(symbolID != null && symbolID.length >= 20)
889
+ {
890
+ return symbolID.substring(18, 20);
891
+ }
892
+ else
893
+ {
894
+ return "00";
895
+ }
896
+ }//*/
897
+
898
+ /**
899
+ * Returns true is symbol is of the Meteorological variety.
900
+ * @param symbolID 30 Character string
901
+ * @return boolean
902
+ * @deprecated See {@link SymbolUtilities.isWeather()}
903
+ */
904
+ public static isMETOC(symbolID: string): boolean {
905
+ return SymbolUtilities.isWeather(symbolID);
906
+ }
907
+
908
+ /**
909
+ * Build string to grab appropriate SVG file
910
+ * @param symbolID 30 Character string
911
+ * @return string
912
+ * @deprecated See {@link SVGLookup.getFrameID()}
913
+ */
914
+ public static getFrameID(symbolID: string): string {
915
+ //SIDC positions 3_456_7
916
+ return SVGLookup.getFrameID(symbolID);
917
+ }
918
+
919
+ /**
920
+ * Build string to grab appropriate SVG file
921
+ * @param symbolID 30 Character string
922
+ * @return string
923
+ * @deprecated See {@link SVGLookup.getMainIconID()}
924
+ */
925
+ public static getMainIconID(symbolID: string): string {
926
+ //SIDC positions 5-6 + 11-16
927
+ return SVGLookup.getMainIconID(symbolID);
928
+ }
929
+
930
+ /**
931
+ * Build string to grab appropriate SVG file
932
+ * @param symbolID 30 Character string
933
+ * @return string
934
+ * @deprecated See {@link SVGLookup.getMod2ID()} (String)}
935
+ */
936
+ public static getMod2ID(symbolID: string): string {
937
+ //SIDC positions 5-6 + 19-20 + "2"
938
+ return SVGLookup.getMod2ID(symbolID);
939
+ }
940
+
941
+ /**
942
+ * Build string to grab appropriate SVG file
943
+ * @param symbolID 30 Character string
944
+ * @return string
945
+ * @deprecated See {@link SVGLookup.getMod1ID()} (String)}
946
+ */
947
+ public static getMod1ID(symbolID: string): string {
948
+ //SIDC positions 5-6 + 17-18 + "1"
949
+ return SVGLookup.getMod1ID(symbolID);
950
+ }
951
+
952
+ /**
953
+ * Gets the 3 digit county code from positions 28-30
954
+ * @param symbolID 30 Character string
955
+ * @return number
956
+ */
957
+ public static getCountryCode(symbolID: string): number {
958
+ let scc: string = "0";
959
+ if (symbolID.length === 30) {
960
+
961
+ scc = symbolID.substring(27, 30);
962
+ }
963
+
964
+ return parseInt(scc);
965
+ }
966
+
967
+ /**
968
+ * In 2525E, position 23 of the symbol code has the Frame Shape modifier.
969
+ * This lets a user force a different frame shape than what a symbol would normally have.
970
+ * Like you could have Air Fixed Wing with a ground unit rectangle frame for when it's on the ground.
971
+ * This function returns the frame shape value for what the default frame would be for a specific symbol set.
972
+ * @param symbolID 30 Character string
973
+ * @return string (1 character)
974
+ */
975
+ public static getDefaultFrameShape(symbolID: string): string {
976
+ let ss: number = SymbolID.getSymbolSet(symbolID);
977
+
978
+ switch (ss) {
979
+ case SymbolID.SymbolSet_Air:
980
+ case SymbolID.SymbolSet_AirMissile:
981
+ case SymbolID.SymbolSet_SignalsIntelligence_Air: {
982
+ return SymbolID.FrameShape_Air;
983
+ }
984
+
985
+ case SymbolID.SymbolSet_Space:
986
+ case SymbolID.SymbolSet_SpaceMissile:
987
+ case SymbolID.SymbolSet_SignalsIntelligence_Space: {
988
+ if (ss === SymbolID.SymbolSet_SignalsIntelligence && SymbolID.getVersion(symbolID) >= SymbolID.Version_2525E) {
989
+
990
+ return SymbolID.FrameShape_LandEquipment_SeaSurface;
991
+ }
992
+
993
+ else {
994
+
995
+ return SymbolID.FrameShape_Space;
996
+ }
997
+
998
+ }
999
+
1000
+ case SymbolID.SymbolSet_LandUnit:
1001
+ case SymbolID.SymbolSet_LandCivilianUnit_Organization:
1002
+ case SymbolID.SymbolSet_SignalsIntelligence_Land: {
1003
+ return SymbolID.FrameShape_LandUnit;
1004
+ }
1005
+
1006
+ case SymbolID.SymbolSet_LandEquipment:
1007
+ case SymbolID.SymbolSet_SeaSurface:
1008
+ case SymbolID.SymbolSet_SignalsIntelligence_SeaSurface: {
1009
+ return SymbolID.FrameShape_LandEquipment_SeaSurface;
1010
+ }
1011
+
1012
+ case SymbolID.SymbolSet_LandInstallation: {
1013
+ return SymbolID.FrameShape_LandInstallation;
1014
+ }
1015
+
1016
+ case SymbolID.SymbolSet_SeaSubsurface:
1017
+ case SymbolID.SymbolSet_SignalsIntelligence_SeaSubsurface:
1018
+ case SymbolID.SymbolSet_MineWarfare: {
1019
+ return SymbolID.FrameShape_SeaSubsurface;
1020
+ }
1021
+
1022
+ case SymbolID.SymbolSet_DismountedIndividuals: {
1023
+ return SymbolID.FrameShape_DismountedIndividuals;
1024
+ }
1025
+
1026
+ case SymbolID.SymbolSet_Activities: {
1027
+ return SymbolID.FrameShape_Activity_Event;
1028
+ }
1029
+
1030
+ case SymbolID.SymbolSet_CyberSpace: {
1031
+ return SymbolID.FrameShape_Cyberspace;
1032
+ }
1033
+
1034
+ default: {
1035
+ return SymbolID.FrameShape_Unknown;
1036
+ }
1037
+
1038
+ }
1039
+ }
1040
+
1041
+
1042
+ /**
1043
+ * Gets the Frame Shape override from position 23.
1044
+ * @param symbolID 30 Character string
1045
+ * @return string (1 character)
1046
+ */
1047
+ public static getFrameShape(symbolID: string): string {
1048
+ if(symbolID != null && symbolID.length >= 23)
1049
+ return symbolID.charAt(22);
1050
+ else
1051
+ return "0";
1052
+ }
1053
+ }
1054
+
1055
+