@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.
- package/LICENSE +201 -0
- package/README.md +57 -0
- package/buildNode.bat +2 -0
- package/buildWeb.bat +2 -0
- package/dist/C5Ren.d.ts +6970 -0
- package/dist/C5Ren.js +2 -0
- package/dist/C5Ren.js.map +1 -0
- package/dist/LICENSE +201 -0
- package/dist/README.md +57 -0
- package/dist/armyc2.c5isr.renderer-mil-sym-ts-web-2.2.0.tgz +0 -0
- package/dist/manifest.json +4 -0
- package/dist/package.json +16 -0
- package/index.ts +169 -0
- package/package.bak +50 -0
- package/package.json +40 -0
- package/package.node.json +43 -0
- package/package.pack.json +19 -0
- package/package.packWeb.json +16 -0
- package/package.web.json +40 -0
- package/src/main/ts/android/graphics/Bitmap.ts +7 -0
- package/src/main/ts/android/graphics/Paint.ts +26 -0
- package/src/main/ts/android/graphics/Path.ts +78 -0
- package/src/main/ts/android/graphics/PointF.ts +14 -0
- package/src/main/ts/android/graphics/Rect.ts +18 -0
- package/src/main/ts/android/graphics/RectF.ts +50 -0
- package/src/main/ts/android/graphics/Region.ts +36 -0
- package/src/main/ts/android/graphics/Typeface.ts +11 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/BasicShapes.ts +99 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/CChannelPoints2.ts +34 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/CELineArray.ts +193 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/Channels.ts +2971 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/DISMSupport.ts +4008 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/POINT2.ts +93 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/Shape2.ts +89 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/TacticalLines.ts +515 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/arraysupport.ts +5403 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/countsupport.ts +1084 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/flot.ts +2173 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/lineutility.ts +4934 -0
- package/src/main/ts/armyc2/c5isr/JavaLineArray/ref.ts +7 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/Modifier2.ts +5601 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/P1.ts +14 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/TGLight.ts +648 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsChannelUtility.ts +647 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsMETOC.ts +2994 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsUtility.ts +2663 -0
- package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/mdlGeodesic.ts +669 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipPolygon2.ts +971 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipQuad.ts +871 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer.ts +3507 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer2.ts +500 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtility.ts +1089 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityCPOF.ts +2656 -0
- package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityGE.ts +1419 -0
- package/src/main/ts/armyc2/c5isr/data/genc.json +1407 -0
- package/src/main/ts/armyc2/c5isr/data/msd.json +17311 -0
- package/src/main/ts/armyc2/c5isr/data/mse.json +18500 -0
- package/src/main/ts/armyc2/c5isr/data/svgd.json +31214 -0
- package/src/main/ts/armyc2/c5isr/data/svge.json +30558 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/AffineTransform.ts +10 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Area.ts +437 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/BasicStroke.ts +429 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/BasicTypes.ts +7 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/BufferedImage.ts +35 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Font.ts +111 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/FontMetrics.ts +29 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/FontRenderContext.ts +18 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/GeneralPath.ts +211 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Graphics2D.ts +80 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/IPathIterator.ts +33 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/ImageIO.ts +16 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Line2D.ts +726 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/PathIterator.ts +141 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Point.ts +112 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Point2D.ts +261 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Polygon.ts +391 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle.ts +567 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle2D.ts +445 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Shape.ts +31 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/Stroke.ts +18 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/TextLayout.ts +45 -0
- package/src/main/ts/armyc2/c5isr/graphics2d/TexturePaint.ts +25 -0
- package/src/main/ts/armyc2/c5isr/renderer/IIconRenderer.ts +15 -0
- package/src/main/ts/armyc2/c5isr/renderer/IconRenderer.ts +22 -0
- package/src/main/ts/armyc2/c5isr/renderer/MilStdIconRenderer.ts +269 -0
- package/src/main/ts/armyc2/c5isr/renderer/ModifierRenderer.ts +9882 -0
- package/src/main/ts/armyc2/c5isr/renderer/PatternFillRenderer.ts +146 -0
- package/src/main/ts/armyc2/c5isr/renderer/SinglePointSVGRenderer.ts +1265 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/arc.ts +64 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/bcurve.ts +95 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/ellipse.ts +93 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/line.ts +114 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/path.ts +555 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/pathiterator.ts +62 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/point.ts +120 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/rectangle.ts +431 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/roundedrectangle.ts +99 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/types.ts +25 -0
- package/src/main/ts/armyc2/c5isr/renderer/shapes/utilities.ts +203 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/AffiliationColors.ts +104 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/Color.ts +481 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/DistanceUnit.ts +40 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/DrawRules.ts +1323 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/EntityCode.ts +51 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/ErrorLogger.ts +736 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/GENCLookup.ts +106 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/GeoPixelConversion3D.ts +84 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/IMultiPointRenderer.ts +87 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/IPointConversion.ts +34 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/ImageInfo.ts +324 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUCache.ts +127 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUEntry.ts +18 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/LogLevel.ts +111 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MODrawRules.ts +219 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MSInfo.ts +1008 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MSLookup.ts +882 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdAttributes.ts +380 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdSymbol.ts +797 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/Modifiers.ts +1699 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversion.ts +178 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversionDummy.ts +45 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConverter3D.ts +126 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/RectUtilities.ts +118 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererException.ts +11 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererSettings.ts +1201 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererUtilities.ts +591 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGInfo.ts +29 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGLookup.ts +753 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGSymbolInfo.ts +137 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGTextInfo.ts +438 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEvent.ts +19 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEventListener.ts +10 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsEventListener.ts +5 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/Shape2SVG.ts +404 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeInfo.ts +525 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeUtilities.ts +55 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolDimensionInfo.ts +36 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolID.ts +1055 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolUtilities.ts +2085 -0
- package/src/main/ts/armyc2/c5isr/renderer/utilities/TextInfo.ts +157 -0
- package/src/main/ts/armyc2/c5isr/web/render/GeoPixelConversion.ts +86 -0
- package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandler.ts +3798 -0
- package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandlerSVG.ts +412 -0
- package/src/main/ts/armyc2/c5isr/web/render/PointConverter.ts +124 -0
- package/src/main/ts/armyc2/c5isr/web/render/SymbolModifiers.ts +26 -0
- package/src/main/ts/armyc2/c5isr/web/render/WebRenderer.ts +677 -0
- package/src/main/ts/armyc2/c5isr/web/render/utilities/JavaRendererUtilities.ts +484 -0
- package/src/main/ts/armyc2/c5isr/web/render/utilities/LineInfo.ts +62 -0
- package/src/main/ts/armyc2/c5isr/web/render/utilities/SymbolInfo.ts +46 -0
- package/src/main/ts/armyc2/c5isr/web/render/utilities/TextInfo.ts +51 -0
- package/src/main/ts/org/gavaghan/geodesy/Angle.ts +31 -0
- package/src/main/ts/org/gavaghan/geodesy/Ellipsoid.ts +71 -0
- package/src/main/ts/org/gavaghan/geodesy/GeodeticCalculator.ts +200 -0
- package/src/main/ts/org/gavaghan/geodesy/GeodeticCurve.ts +55 -0
- package/src/main/ts/org/gavaghan/geodesy/GeodeticMeasurement.ts +68 -0
- package/src/main/ts/org/gavaghan/geodesy/GlobalCoordinates.ts +103 -0
- package/src/main/ts/org/gavaghan/geodesy/GlobalPosition.ts +90 -0
- package/test/ExportSPImages.js +692 -0
- package/test/MPWW.html +556 -0
- package/test/MPWorker.js +318 -0
- package/test/SPWorker.js +233 -0
- package/test/SVGWW.html +363 -0
- package/test/singlePointTester3.html +751 -0
- package/tsconfig.json +54 -0
- package/typedoc.json +30 -0
- package/updateVersion.js +21 -0
- package/webpack.config.js +34 -0
- package/webpackn.config.js +28 -0
- package/webpackr.config.js +47 -0
- package/webpackw.config.js +23 -0
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
const SymbolID = C5Ren.SymbolID
|
|
2
|
+
const SymbolUtilities = C5Ren.SymbolUtilities
|
|
3
|
+
const MSLookup = C5Ren.MSLookup
|
|
4
|
+
const MilStdIconRenderer = C5Ren.MilStdIconRenderer
|
|
5
|
+
const MilStdAttributes = C5Ren.MilStdAttributes
|
|
6
|
+
const RendererSettings = C5Ren.RendererSettings
|
|
7
|
+
const MSInfo = C5Ren.MSInfo
|
|
8
|
+
|
|
9
|
+
const unitTestIDs = ["01110000", "02110000", "05110000", "06110000", "10110000", "11110000", "15110000", "20110000", "30110000", "35110000", "36110000", "40130500", "50110100", "51110100", "52110100", "53110100", "54110100", "60110100"];
|
|
10
|
+
const VERSION = SymbolID.Version_2525Dch1;
|
|
11
|
+
|
|
12
|
+
// Relies on module jszip
|
|
13
|
+
async function exportTestImages(filename) {
|
|
14
|
+
const zip = new JSZip();
|
|
15
|
+
let toZip = []
|
|
16
|
+
|
|
17
|
+
toZip.push(...createUnitModTestImages());
|
|
18
|
+
toZip.push(...createTGModTestImages());
|
|
19
|
+
toZip.push(...createAffiliationTestImages());
|
|
20
|
+
toZip.push(...createContextTestImages());
|
|
21
|
+
toZip.push(...createStatusTestImages());
|
|
22
|
+
toZip.push(...createAmplifierTestImages());
|
|
23
|
+
toZip.push(...createHQTFDTestImages());
|
|
24
|
+
toZip.push(...createCustomColorTestImages());
|
|
25
|
+
toZip.push(...createSPImages());
|
|
26
|
+
toZip.push(...createSector1TestImages());
|
|
27
|
+
toZip.push(...createSector2TestImages());
|
|
28
|
+
|
|
29
|
+
for (const file of toZip) {
|
|
30
|
+
zip.file(file.filename, file.file);
|
|
31
|
+
}
|
|
32
|
+
const content = await zip.generateAsync({ type: "blob" });
|
|
33
|
+
const contentUrl = URL.createObjectURL(content);
|
|
34
|
+
var a = document.createElement("a");
|
|
35
|
+
a.href = contentUrl;
|
|
36
|
+
a.download = filename;
|
|
37
|
+
document.body.appendChild(a);
|
|
38
|
+
a.click();
|
|
39
|
+
setTimeout(function () {
|
|
40
|
+
document.body.removeChild(a);
|
|
41
|
+
window.URL.revokeObjectURL(contentUrl);
|
|
42
|
+
}, 0);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function createUnitModTestImages() {
|
|
46
|
+
let res = []
|
|
47
|
+
const modifiers = new Map();
|
|
48
|
+
const attributes = new Map();
|
|
49
|
+
populateModifiersForUnits(modifiers);
|
|
50
|
+
|
|
51
|
+
// Mine warfare
|
|
52
|
+
var id = VERSION + "0336272611000000000000000840";
|
|
53
|
+
let modFolder = "Modifiers/No Modifiers/";
|
|
54
|
+
res.push({ filename: modFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id, modifiers, attributes) })
|
|
55
|
+
|
|
56
|
+
// Other symbol sets
|
|
57
|
+
for (const basicID of unitTestIDs) {
|
|
58
|
+
if (basicID.startsWith("36"))
|
|
59
|
+
continue;
|
|
60
|
+
|
|
61
|
+
id = VERSION + "0300272600000000000000000840";
|
|
62
|
+
|
|
63
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
64
|
+
id = SymbolID.setSymbolSet(id, Number.parseInt(basicID.substring(0, 2)));
|
|
65
|
+
|
|
66
|
+
msi = MSLookup.getInstance().getMSLInfo(basicID, SymbolID.getVersion(id));
|
|
67
|
+
if (msi.getModifiers().includes(Modifiers.R_MOBILITY_INDICATOR)) {
|
|
68
|
+
id = SymbolID.setAmplifierDescriptor(id, 31);
|
|
69
|
+
} else if (msi.getModifiers().includes(Modifiers.AG_AUX_EQUIP_INDICATOR)) {
|
|
70
|
+
id = SymbolID.setAmplifierDescriptor(id, 61);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
modFolder = "Modifiers/Unit/";
|
|
74
|
+
res.push({ filename: modFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id, modifiers, attributes) });
|
|
75
|
+
}
|
|
76
|
+
return res
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function createTGModTestImages() {
|
|
80
|
+
let res = []
|
|
81
|
+
modifiers = new Map();
|
|
82
|
+
attributes = new Map();
|
|
83
|
+
populateModifiersForTGs(modifiers);
|
|
84
|
+
|
|
85
|
+
const idList = MSLookup.getInstance().getIDList(VERSION);
|
|
86
|
+
|
|
87
|
+
// Control measures
|
|
88
|
+
for (const basicID of idList) {
|
|
89
|
+
let id = VERSION + "0325000000000000000000000840";
|
|
90
|
+
|
|
91
|
+
if (basicID.size < 8 || !basicID.startsWith("25"))
|
|
92
|
+
continue;
|
|
93
|
+
|
|
94
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
95
|
+
|
|
96
|
+
if (SymbolUtilities.isMultiPoint(id) || !canRender(id))
|
|
97
|
+
continue;
|
|
98
|
+
|
|
99
|
+
let msi = MSLookup.getInstance().getMSLInfo(basicID, SymbolID.getVersion(id));
|
|
100
|
+
if (msi.getModifiers().length == 0)
|
|
101
|
+
continue;
|
|
102
|
+
|
|
103
|
+
let symbolSetFolder = "Modifiers/Control Measure/";
|
|
104
|
+
res.push({ filename: symbolSetFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id, modifiers, attributes) });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// METOC - no list of modifiers in msd. List of symbols with modifiers made by hand
|
|
108
|
+
for (const basicID of ["45110102", "45110202", "45162200", "45162300"]) {
|
|
109
|
+
id = VERSION + "0345000000000000000000000840";
|
|
110
|
+
|
|
111
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
112
|
+
|
|
113
|
+
symbolSetFolder = "Modifiers/Atmospheric/";
|
|
114
|
+
res.push({ filename: symbolSetFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id, modifiers, attributes) });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return res;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function createAffiliationTestImages() {
|
|
121
|
+
let res = []
|
|
122
|
+
|
|
123
|
+
// Test units
|
|
124
|
+
modifiers = new Map();
|
|
125
|
+
attributes = new Map();
|
|
126
|
+
modifiers.set(Modifiers.AO_ENGAGEMENT_BAR, "AO:AOA-AO");
|
|
127
|
+
for (const aff of [0, 1, 2, 3, 4, 5, 6]) {
|
|
128
|
+
for (const basicID of unitTestIDs) {
|
|
129
|
+
let id = VERSION + "0000000000000000000000000000";
|
|
130
|
+
|
|
131
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
132
|
+
id = SymbolID.setSymbolSet(id, Number.parseInt(basicID.substring(0, 2)));
|
|
133
|
+
id = SymbolID.setAffiliation(id, aff);
|
|
134
|
+
|
|
135
|
+
let affiliationName = parseAffiliation(aff);
|
|
136
|
+
const modFolder = "Affiliation/" + basicID + "/";
|
|
137
|
+
res.push({ filename: modFolder + affiliationName + ".svg", file: renderAndSave(id, modifiers, attributes) });
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Test all affiliations for a single control measure to check colors
|
|
142
|
+
for (const aff of [0, 1, 2, 3, 4, 5, 6]) {
|
|
143
|
+
let id = VERSION + "0025000013100300000000000000";
|
|
144
|
+
|
|
145
|
+
id = SymbolID.setAffiliation(id, aff);
|
|
146
|
+
|
|
147
|
+
let affiliationName = parseAffiliation(aff);
|
|
148
|
+
const symbolSetFolder = "Affiliation/Action Point/";
|
|
149
|
+
res.push({ filename: symbolSetFolder + affiliationName + ".svg", file: renderAndSave(id, modifiers, attributes) });
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Test all control measures with hostile to check full symbol changes color
|
|
153
|
+
idList = MSLookup.getInstance().getIDList(VERSION);
|
|
154
|
+
for (const basicID of idList) {
|
|
155
|
+
let id = VERSION + "0625000000000000000000000000";
|
|
156
|
+
|
|
157
|
+
if (basicID.length < 8 || !basicID.startsWith("25"))
|
|
158
|
+
continue;
|
|
159
|
+
|
|
160
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
161
|
+
|
|
162
|
+
if (SymbolUtilities.isMultiPoint(id) || !canRender(id))
|
|
163
|
+
continue;
|
|
164
|
+
|
|
165
|
+
const symbolSetFolder = "Affiliation/Hostile Control Measure/";
|
|
166
|
+
res.push({ filename: symbolSetFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id, modifiers, attributes) });
|
|
167
|
+
}
|
|
168
|
+
return res
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function createContextTestImages() {
|
|
172
|
+
let res = []
|
|
173
|
+
for (const context of [0, 1, 2]) {
|
|
174
|
+
for (const basicID of unitTestIDs) {
|
|
175
|
+
let id = VERSION + "0300000000000000000000000000";
|
|
176
|
+
|
|
177
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
178
|
+
id = SymbolID.setSymbolSet(id, Number.parseInt(basicID.substring(0, 2)));
|
|
179
|
+
id = SymbolID.setContext(id, context);
|
|
180
|
+
|
|
181
|
+
const modFolder = "Context/" + context + " " + parseContext(context) + "/";
|
|
182
|
+
res.push({ filename: modFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id) });
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Test J and K outside frame for joker and hostile affiliations
|
|
187
|
+
for (const aff of [SymbolID.StandardIdentity_Affiliation_Hostile_Faker, SymbolID.StandardIdentity_Affiliation_Suspect_Joker]) {
|
|
188
|
+
for (const basicID of unitTestIDs) {
|
|
189
|
+
if (basicID.startsWith("50")) // No exercise for unknown frame
|
|
190
|
+
continue;
|
|
191
|
+
|
|
192
|
+
let id = VERSION + "1000000000000000000000000000";
|
|
193
|
+
|
|
194
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
195
|
+
id = SymbolID.setSymbolSet(id, Number.parseInt(basicID.substring(0, 2)));
|
|
196
|
+
id = SymbolID.setAffiliation(id, aff);
|
|
197
|
+
|
|
198
|
+
const modFolder = "Context/" + "1 Exercise - " + parseAffiliation(aff) + "/";
|
|
199
|
+
res.push({ filename: modFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id) });
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return res
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function createStatusTestImages() {
|
|
206
|
+
let res = []
|
|
207
|
+
for (const status of [0, 1, 2, 3, 4, 5]) {
|
|
208
|
+
for (const basicID of unitTestIDs) {
|
|
209
|
+
let id = VERSION + "0300000000000000000000000000";
|
|
210
|
+
|
|
211
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
212
|
+
id = SymbolID.setSymbolSet(id, Number.parseInt(basicID.substring(0, 2)));
|
|
213
|
+
id = SymbolID.setStatus(id, status);
|
|
214
|
+
|
|
215
|
+
let statusName = status + " " + parseStatus(status) + " - " + parseAffiliation(3);
|
|
216
|
+
|
|
217
|
+
let msi = MSLookup.getInstance().getMSLInfo(basicID, SymbolID.getVersion(id));
|
|
218
|
+
if (status > 1) {
|
|
219
|
+
if (!(msi.getModifiers().includes(Modifiers.AL_OPERATIONAL_CONDITION))) {
|
|
220
|
+
if (status == 2)
|
|
221
|
+
statusName = "2 no operational condition Expected";
|
|
222
|
+
else
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
RendererSettings.getInstance().setOperationalConditionModifierType(RendererSettings.OperationalConditionModifierType_BAR);
|
|
228
|
+
let modFolder = "Status (Bar)/" + statusName + "/";
|
|
229
|
+
res.push({ filename: modFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id) });
|
|
230
|
+
|
|
231
|
+
if (status >= 2 && status <= 4) {
|
|
232
|
+
RendererSettings.getInstance().setOperationalConditionModifierType(RendererSettings.OperationalConditionModifierType_SLASH);
|
|
233
|
+
modFolder = "Status (Slash)/" + statusName + "/";
|
|
234
|
+
res.push({ filename: modFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id) });
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Test assumed friend with status - want to confirm dotted frame overrides planned frame
|
|
238
|
+
// Also check that dotted frame is there with operational condition
|
|
239
|
+
if (status <= 2) {
|
|
240
|
+
if (status == 2 && !msi.getModifiers().includes(Modifiers.AL_OPERATIONAL_CONDITION))
|
|
241
|
+
continue;
|
|
242
|
+
id = SymbolID.setStandardIdentity(id, 2);
|
|
243
|
+
|
|
244
|
+
statusName = status + " " + parseStatus(status) + " - " + parseAffiliation(2);
|
|
245
|
+
modFolder = "Assumed friend Status/" + statusName + "/";
|
|
246
|
+
res.push({ filename: modFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id) });
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return res
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function createAmplifierTestImages() {
|
|
254
|
+
let res = []
|
|
255
|
+
for (const amp of [11, 12, 13, 14, 15, 16, 17, 18, 21, 22, 23, 24, 25, 26, 31, 32, 33, 34, 35, 36, 37, 41, 42, 51, 52, 61, 62]) {
|
|
256
|
+
for (const basicID of unitTestIDs) {
|
|
257
|
+
let id = VERSION + "0300000000000000000000000000";
|
|
258
|
+
|
|
259
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
260
|
+
id = SymbolID.setSymbolSet(id, Number.parseInt(basicID.substring(0, 2)));
|
|
261
|
+
id = SymbolID.setAmplifierDescriptor(id, amp);
|
|
262
|
+
|
|
263
|
+
let ampName = amp + " " + parseAmp(amp);
|
|
264
|
+
|
|
265
|
+
let msi = MSLookup.getInstance().getMSLInfo(basicID, SymbolID.getVersion(id));
|
|
266
|
+
|
|
267
|
+
if (amp < 30) {
|
|
268
|
+
// echelon
|
|
269
|
+
if (!msi.getModifiers().includes(Modifiers.B_ECHELON)) {
|
|
270
|
+
if (amp == 11) {
|
|
271
|
+
// Confirm not added
|
|
272
|
+
ampName = "11 no echelon expected";
|
|
273
|
+
} else {
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
} else if (amp < 60) {
|
|
278
|
+
// mobility indicator
|
|
279
|
+
if (!(msi.getModifiers().includes(Modifiers.R_MOBILITY_INDICATOR))) {
|
|
280
|
+
if (amp == 31) {
|
|
281
|
+
// Confirm not added
|
|
282
|
+
ampName = "31 no mobility expected";
|
|
283
|
+
} else {
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
} else {
|
|
288
|
+
// auxiliary equipment indicator
|
|
289
|
+
if (!msi.getModifiers().includes(Modifiers.AG_AUX_EQUIP_INDICATOR)) {
|
|
290
|
+
if (amp == 61) {
|
|
291
|
+
// Confirm not added
|
|
292
|
+
ampName = "61 no tow array expected";
|
|
293
|
+
} else {
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
const modFolder = "Amplifier/" + ampName + "/";
|
|
299
|
+
res.push({ filename: modFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id) });
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return res
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function createHQTFDTestImages() {
|
|
306
|
+
let res = []
|
|
307
|
+
for (const HQTFD of [0, 1, 2, 3, 4, 5, 6, 7]) {
|
|
308
|
+
for (const basicID of unitTestIDs) {
|
|
309
|
+
let id = VERSION + "0300000000000000000000000000";
|
|
310
|
+
|
|
311
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
312
|
+
id = SymbolID.setSymbolSet(id, Number.parseInt(basicID.substring(0, 2)));
|
|
313
|
+
id = SymbolID.setHQTFD(id, HQTFD);
|
|
314
|
+
|
|
315
|
+
let HQTFDName = HQTFD + " " + parseHQTFD(HQTFD);
|
|
316
|
+
|
|
317
|
+
let msi = MSLookup.getInstance().getMSLInfo(basicID, SymbolID.getVersion(id));
|
|
318
|
+
let HQTFD_bin = (HQTFD >>> 0).toString(2); // Convert to binary
|
|
319
|
+
if (HQTFD > 0) {
|
|
320
|
+
if (!(msi.getModifiers().includes(Modifiers.D_TASK_FORCE_INDICATOR)
|
|
321
|
+
|| msi.getModifiers().includes(Modifiers.AB_FEINT_DUMMY_INDICATOR)
|
|
322
|
+
|| msi.getModifiers().includes(Modifiers.S_HQ_STAFF_INDICATOR))) {
|
|
323
|
+
if (HQTFD == 7)
|
|
324
|
+
// Confirm not added
|
|
325
|
+
HQTFDName = "7 no HQTFD expected";
|
|
326
|
+
else
|
|
327
|
+
continue;
|
|
328
|
+
} else if (HQTFD_bin.charAt(HQTFD_bin.length - 1) == '1'
|
|
329
|
+
&& !msi.getModifiers().includes(Modifiers.AB_FEINT_DUMMY_INDICATOR)) {
|
|
330
|
+
continue;
|
|
331
|
+
} else if (HQTFD >= 2 && HQTFD_bin.charAt(HQTFD_bin.length - 2) == '1'
|
|
332
|
+
&& !msi.getModifiers().includes(Modifiers.S_HQ_STAFF_INDICATOR)) {
|
|
333
|
+
continue;
|
|
334
|
+
} else if (HQTFD >= 4 && !msi.getModifiers().includes(Modifiers.D_TASK_FORCE_INDICATOR)) {
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
modFolder = "HQTFD/" + HQTFDName + "/";
|
|
340
|
+
res.push({ filename: modFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id) });
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return res
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function createSector1TestImages() {
|
|
347
|
+
let res = []
|
|
348
|
+
let sector1Mods = new Map();
|
|
349
|
+
sector1Mods.set("01", 41);
|
|
350
|
+
sector1Mods.set("02", 8);
|
|
351
|
+
sector1Mods.set("05", 7);
|
|
352
|
+
sector1Mods.set("06", 3);
|
|
353
|
+
sector1Mods.set("10", 98);
|
|
354
|
+
sector1Mods.set("11", 26);
|
|
355
|
+
sector1Mods.set("15", 24);
|
|
356
|
+
sector1Mods.set("20", 14);
|
|
357
|
+
sector1Mods.set("25", 50);
|
|
358
|
+
sector1Mods.set("30", 25);
|
|
359
|
+
sector1Mods.set("35", 22);
|
|
360
|
+
sector1Mods.set("36", -1);
|
|
361
|
+
sector1Mods.set("40", 20);
|
|
362
|
+
sector1Mods.set("45", -1);
|
|
363
|
+
sector1Mods.set("46", -1);
|
|
364
|
+
sector1Mods.set("47", -1);
|
|
365
|
+
sector1Mods.set("50", -1); // No need to test all sigint
|
|
366
|
+
sector1Mods.set("51", 65);
|
|
367
|
+
sector1Mods.set("52", -1); // No need to test all sigint
|
|
368
|
+
sector1Mods.set("53", -1); // No need to test all sigint
|
|
369
|
+
sector1Mods.set("54", -1); // No need to test all sigint
|
|
370
|
+
sector1Mods.set("60", -1);
|
|
371
|
+
|
|
372
|
+
for (const basicID of unitTestIDs) {
|
|
373
|
+
if (sector1Mods.get(basicID.substring(0, 2)) > 0)
|
|
374
|
+
for (const sector1Mod of Array(1 + sector1Mods.get(basicID.substring(0, 2))).keys()) {
|
|
375
|
+
let id = VERSION + "0300000000000000000000000000";
|
|
376
|
+
|
|
377
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
378
|
+
id = SymbolID.setSymbolSet(id, Number.parseInt(basicID.substring(0, 2)));
|
|
379
|
+
id = SymbolID.setModifier1(id, sector1Mod);
|
|
380
|
+
|
|
381
|
+
const modFolder = "Sector Mods/" + basicID + "/";
|
|
382
|
+
res.push({ filename: modFolder + SymbolID.getMod1ID(id) + ".svg", file: renderAndSave(id) });
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// Static Depiction
|
|
387
|
+
for (const sector1Mod of Array.from(new Array(1 + 50 - 13), (x, i) => i + 13)) {
|
|
388
|
+
let id = VERSION + "0325000027070100000000000000";
|
|
389
|
+
id = SymbolID.setModifier1(id, sector1Mod);
|
|
390
|
+
|
|
391
|
+
const modFolder = "Sector Mods/" + SymbolUtilities.getBasicSymbolID(id) + "/";
|
|
392
|
+
res.push({ filename: modFolder + SymbolID.getMod1ID(id) + ".svg", file: renderAndSave(id) });
|
|
393
|
+
|
|
394
|
+
}
|
|
395
|
+
return res
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
function createSector2TestImages() {
|
|
399
|
+
let res = []
|
|
400
|
+
let sector2Mods = new Map();
|
|
401
|
+
sector2Mods.set("01", 12);
|
|
402
|
+
sector2Mods.set("02", 16);
|
|
403
|
+
sector2Mods.set("05", 5);
|
|
404
|
+
sector2Mods.set("06", 15);
|
|
405
|
+
sector2Mods.set("10", 78);
|
|
406
|
+
sector2Mods.set("11", 2);
|
|
407
|
+
sector2Mods.set("15", 9);
|
|
408
|
+
sector2Mods.set("20", 9);
|
|
409
|
+
sector2Mods.set("25", -1);
|
|
410
|
+
sector2Mods.set("30", 16);
|
|
411
|
+
sector2Mods.set("35", 17);
|
|
412
|
+
sector2Mods.set("36", -1);
|
|
413
|
+
sector2Mods.set("40", 2);
|
|
414
|
+
sector2Mods.set("45", -1);
|
|
415
|
+
sector2Mods.set("46", -1);
|
|
416
|
+
sector2Mods.set("47", -1);
|
|
417
|
+
sector2Mods.set("50", -1); // No need to test all sigint
|
|
418
|
+
sector2Mods.set("51", 1);
|
|
419
|
+
sector2Mods.set("52", -1); // No need to test all sigint
|
|
420
|
+
sector2Mods.set("53", -1); // No need to test all sigint
|
|
421
|
+
sector2Mods.set("54", -1); // No need to test all sigint
|
|
422
|
+
sector2Mods.set("60", -1);
|
|
423
|
+
|
|
424
|
+
for (const basicID of unitTestIDs) {
|
|
425
|
+
if (sector2Mods.get(basicID.substring(0, 2)) > 0)
|
|
426
|
+
for (const sector2Mod of Array(1 + sector2Mods.get(basicID.substring(0, 2))).keys()) {
|
|
427
|
+
let id = VERSION + "0300000000000000000000000000";
|
|
428
|
+
|
|
429
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
430
|
+
id = SymbolID.setSymbolSet(id, Number.parseInt(basicID.substring(0, 2)));
|
|
431
|
+
id = SymbolID.setModifier2(id, sector2Mod);
|
|
432
|
+
|
|
433
|
+
modFolder = "Sector Mods/" + basicID + "/";
|
|
434
|
+
res.push({ filename: modFolder + SymbolID.getMod2ID(id) + ".svg", file: renderAndSave(id) });
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return res
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
function createCustomColorTestImages() {
|
|
441
|
+
let res = []
|
|
442
|
+
modifiers = new Map();
|
|
443
|
+
attributes = new Map();
|
|
444
|
+
populateModifiersForUnits(modifiers);
|
|
445
|
+
attributes.set(MilStdAttributes.TextColor, "00FFFF");
|
|
446
|
+
attributes.set(MilStdAttributes.LineColor, "FF00FF");
|
|
447
|
+
attributes.set(MilStdAttributes.FillColor, "FFFF00");
|
|
448
|
+
attributes.set(MilStdAttributes.EngagementBarColor, "0000FF");
|
|
449
|
+
|
|
450
|
+
for (const basicID of unitTestIDs) {
|
|
451
|
+
let id = VERSION + "0300272600000000000000000840";
|
|
452
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
453
|
+
id = SymbolID.setSymbolSet(id, Number.parseInt(basicID.substring(0, 2)));
|
|
454
|
+
|
|
455
|
+
let msi = MSLookup.getInstance().getMSLInfo(basicID, SymbolID.getVersion(id));
|
|
456
|
+
if (msi.getModifiers().includes(Modifiers.R_MOBILITY_INDICATOR)) {
|
|
457
|
+
id = SymbolID.setAmplifierDescriptor(id, 31);
|
|
458
|
+
} else if (msi.getModifiers().includes(Modifiers.AG_AUX_EQUIP_INDICATOR)) {
|
|
459
|
+
id = SymbolID.setAmplifierDescriptor(id, 61);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
modFolder = "Custom Color/Unit/";
|
|
463
|
+
res.push({ filename: modFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id, modifiers, attributes) });
|
|
464
|
+
}
|
|
465
|
+
return res
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
function createSPImages() {
|
|
469
|
+
let res = []
|
|
470
|
+
let idList = MSLookup.getInstance().getIDList(VERSION);
|
|
471
|
+
|
|
472
|
+
for (const basicID of idList) {
|
|
473
|
+
let id = VERSION + "0300000000000000000000000000";
|
|
474
|
+
|
|
475
|
+
if (basicID.length < 8)
|
|
476
|
+
continue;
|
|
477
|
+
|
|
478
|
+
id = SymbolID.setEntityCode(id, Number.parseInt(basicID.substring(2)));
|
|
479
|
+
id = SymbolID.setSymbolSet(id, Number.parseInt(basicID.substring(0, 2)));
|
|
480
|
+
|
|
481
|
+
if (SymbolUtilities.isMultiPoint(id) || !canRender(id))
|
|
482
|
+
continue;
|
|
483
|
+
|
|
484
|
+
let symbolSetName = MSInfo.parseSymbolSetName(id);
|
|
485
|
+
|
|
486
|
+
let symbolSetFolder = "svg/" + symbolSetName + "/";
|
|
487
|
+
res.push({ filename: symbolSetFolder + SymbolID.getMainIconID(id) + ".svg", file: renderAndSave(id) });
|
|
488
|
+
}
|
|
489
|
+
return res
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
function renderAndSave(id, modifiers = new Map(), attributes = new Map()) {
|
|
493
|
+
attributes.set(MilStdAttributes.PixelSize, "256");
|
|
494
|
+
mir = MilStdIconRenderer.getInstance();
|
|
495
|
+
|
|
496
|
+
if (!mir.CanRender(id, attributes))
|
|
497
|
+
console.error("CanRender() false: " + id);
|
|
498
|
+
ii = mir.RenderSVG(id, modifiers, attributes);
|
|
499
|
+
|
|
500
|
+
return new Blob([ii.getSVG()], { type: "image/svg+xml" });
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
function populateModifiersForUnits(modifiers) {
|
|
504
|
+
modifiers.set(Modifiers.H_ADDITIONAL_INFO_1, "Hj");
|
|
505
|
+
modifiers.set(Modifiers.H1_ADDITIONAL_INFO_2, "H1");
|
|
506
|
+
modifiers.set(Modifiers.X_ALTITUDE_DEPTH, "X");//X
|
|
507
|
+
modifiers.set(Modifiers.K_COMBAT_EFFECTIVENESS, "K");//K
|
|
508
|
+
modifiers.set(Modifiers.Q_DIRECTION_OF_MOVEMENT, "45");//Q
|
|
509
|
+
modifiers.set(Modifiers.W_DTG_1, SymbolUtilities.getDateLabel(new Date()));//W
|
|
510
|
+
modifiers.set(Modifiers.W1_DTG_2, SymbolUtilities.getDateLabel(new Date()));//W1
|
|
511
|
+
modifiers.set(Modifiers.J_EVALUATION_RATING, "J");
|
|
512
|
+
modifiers.set(Modifiers.M_HIGHER_FORMATION, "M");
|
|
513
|
+
modifiers.set(Modifiers.N_HOSTILE, "ENY");
|
|
514
|
+
modifiers.set(Modifiers.P_IFF_SIF_AIS, "P");
|
|
515
|
+
modifiers.set(Modifiers.Y_LOCATION, "Yj");
|
|
516
|
+
modifiers.set(Modifiers.C_QUANTITY, "C");
|
|
517
|
+
modifiers.set(Modifiers.F_REINFORCED_REDUCED, "RD");
|
|
518
|
+
modifiers.set(Modifiers.L_SIGNATURE_EQUIP, "!");
|
|
519
|
+
modifiers.set(Modifiers.AA_SPECIAL_C2_HQ, "AA");
|
|
520
|
+
modifiers.set(Modifiers.G_STAFF_COMMENTS, "Gj");
|
|
521
|
+
modifiers.set(Modifiers.V_EQUIP_TYPE, "Vj");
|
|
522
|
+
modifiers.set(Modifiers.T_UNIQUE_DESIGNATION_1, "Tj");
|
|
523
|
+
modifiers.set(Modifiers.T1_UNIQUE_DESIGNATION_2, "T1");
|
|
524
|
+
modifiers.set(Modifiers.Z_SPEED, "999");//Z
|
|
525
|
+
modifiers.set(Modifiers.R2_SIGNIT_MOBILITY_INDICATOR, "2");
|
|
526
|
+
modifiers.set(Modifiers.AD_PLATFORM_TYPE, "AD");
|
|
527
|
+
modifiers.set(Modifiers.AE_EQUIPMENT_TEARDOWN_TIME, "AE");
|
|
528
|
+
modifiers.set(Modifiers.AF_COMMON_IDENTIFIER, "AF");
|
|
529
|
+
modifiers.set(Modifiers.AO_ENGAGEMENT_BAR, "AO:AOA-AO");
|
|
530
|
+
modifiers.set(Modifiers.AR_SPECIAL_DESIGNATOR, "AR");
|
|
531
|
+
modifiers.set(Modifiers.AQ_GUARDED_UNIT, "AQ");
|
|
532
|
+
modifiers.set(Modifiers.AS_COUNTRY, "AS");
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
function populateModifiersForTGs(modifiers) {
|
|
536
|
+
modifiers.set(Modifiers.H_ADDITIONAL_INFO_1, "H");
|
|
537
|
+
modifiers.set(Modifiers.H1_ADDITIONAL_INFO_2, "H1");
|
|
538
|
+
modifiers.set(Modifiers.X_ALTITUDE_DEPTH, "X");//X
|
|
539
|
+
modifiers.set(Modifiers.Q_DIRECTION_OF_MOVEMENT, "45");//Q
|
|
540
|
+
modifiers.set(Modifiers.W_DTG_1, SymbolUtilities.getDateLabel(new Date()));//W
|
|
541
|
+
modifiers.set(Modifiers.W1_DTG_2, SymbolUtilities.getDateLabel(new Date()));//W1
|
|
542
|
+
modifiers.set(Modifiers.N_HOSTILE, "ENY");
|
|
543
|
+
modifiers.set(Modifiers.Y_LOCATION, "Y");
|
|
544
|
+
modifiers.set(Modifiers.C_QUANTITY, "C");
|
|
545
|
+
modifiers.set(Modifiers.L_SIGNATURE_EQUIP, "!");
|
|
546
|
+
modifiers.set(Modifiers.V_EQUIP_TYPE, "V");
|
|
547
|
+
modifiers.set(Modifiers.T_UNIQUE_DESIGNATION_1, "T");
|
|
548
|
+
modifiers.set(Modifiers.T1_UNIQUE_DESIGNATION_2, "T1");
|
|
549
|
+
modifiers.set(Modifiers.AP_TARGET_NUMBER, "AP");
|
|
550
|
+
modifiers.set(Modifiers.AP1_TARGET_NUMBER_EXTENSION, "AP1");
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
function canRender(symbolID) {
|
|
554
|
+
return MilStdIconRenderer.getInstance().CanRender(symbolID, null)
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
function parseAffiliation(affiliation) {
|
|
558
|
+
switch (affiliation) {
|
|
559
|
+
case SymbolID.StandardIdentity_Affiliation_Pending:
|
|
560
|
+
return "Pending";
|
|
561
|
+
case SymbolID.StandardIdentity_Affiliation_Unknown:
|
|
562
|
+
return "Unknown";
|
|
563
|
+
case SymbolID.StandardIdentity_Affiliation_AssumedFriend:
|
|
564
|
+
return "Assumed Friend";
|
|
565
|
+
case SymbolID.StandardIdentity_Affiliation_Friend:
|
|
566
|
+
return "Friend";
|
|
567
|
+
case SymbolID.StandardIdentity_Affiliation_Neutral:
|
|
568
|
+
return "Neutral";
|
|
569
|
+
case SymbolID.StandardIdentity_Affiliation_Suspect_Joker:
|
|
570
|
+
return "Suspect";
|
|
571
|
+
case SymbolID.StandardIdentity_Affiliation_Hostile_Faker:
|
|
572
|
+
return "Hostile";
|
|
573
|
+
default:
|
|
574
|
+
return "UNKNOWN";
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
function parseContext(context) {
|
|
579
|
+
switch (context) {
|
|
580
|
+
case SymbolID.StandardIdentity_Context_Reality:
|
|
581
|
+
return "Reality";
|
|
582
|
+
case SymbolID.StandardIdentity_Context_Exercise:
|
|
583
|
+
return "Exercise";
|
|
584
|
+
case SymbolID.StandardIdentity_Context_Simulation:
|
|
585
|
+
return "Simulation";
|
|
586
|
+
default:
|
|
587
|
+
return "UNKNOWN";
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
function parseStatus(status) {
|
|
592
|
+
switch (status) {
|
|
593
|
+
case SymbolID.Status_Present:
|
|
594
|
+
return "Present";
|
|
595
|
+
case SymbolID.Status_Planned_Anticipated_Suspect:
|
|
596
|
+
return "Planned";
|
|
597
|
+
case SymbolID.Status_Present_FullyCapable:
|
|
598
|
+
return "Fully capable";
|
|
599
|
+
case SymbolID.Status_Present_Damaged:
|
|
600
|
+
return "Damaged";
|
|
601
|
+
case SymbolID.Status_Present_Destroyed:
|
|
602
|
+
return "Destroyed";
|
|
603
|
+
case SymbolID.Status_Present_FullToCapacity:
|
|
604
|
+
return "Full to capacity";
|
|
605
|
+
default:
|
|
606
|
+
return "UNKNOWN";
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
function parseHQTFD(HQTFD) {
|
|
611
|
+
switch (HQTFD) {
|
|
612
|
+
case SymbolID.HQTFD_Unknown:
|
|
613
|
+
return "Unknown";
|
|
614
|
+
case SymbolID.HQTFD_FeintDummy:
|
|
615
|
+
return "Dummy";
|
|
616
|
+
case SymbolID.HQTFD_Headquarters:
|
|
617
|
+
return "Headquarters";
|
|
618
|
+
case SymbolID.HQTFD_FeintDummy_Headquarters:
|
|
619
|
+
return "Dummy Headquarters";
|
|
620
|
+
case SymbolID.HQTFD_TaskForce:
|
|
621
|
+
return "Task Force";
|
|
622
|
+
case SymbolID.HQTFD_FeintDummy_TaskForce:
|
|
623
|
+
return "Dummy Task Force";
|
|
624
|
+
case SymbolID.HQTFD_TaskForce_Headquarters:
|
|
625
|
+
return "Task Force Headquarters";
|
|
626
|
+
case SymbolID.HQTFD_FeintDummy_TaskForce_Headquarters:
|
|
627
|
+
return "Dummy Task Force Headquarters";
|
|
628
|
+
default:
|
|
629
|
+
return "UNKNOWN";
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
function parseAmp(amp) {
|
|
634
|
+
switch (amp) {
|
|
635
|
+
case SymbolID.Echelon_Team_Crew:
|
|
636
|
+
return "Team";
|
|
637
|
+
case SymbolID.Echelon_Squad:
|
|
638
|
+
return "Squad";
|
|
639
|
+
case SymbolID.Echelon_Section:
|
|
640
|
+
return "Section";
|
|
641
|
+
case SymbolID.Echelon_Platoon_Detachment:
|
|
642
|
+
return "Platoon";
|
|
643
|
+
case SymbolID.Echelon_Company_Battery_Troop:
|
|
644
|
+
return "Company";
|
|
645
|
+
case SymbolID.Echelon_Battalion_Squadron:
|
|
646
|
+
return "Battalion";
|
|
647
|
+
case SymbolID.Echelon_Regiment_Group:
|
|
648
|
+
return "Regiment";
|
|
649
|
+
case SymbolID.Echelon_Brigade:
|
|
650
|
+
return "Brigade";
|
|
651
|
+
case SymbolID.Echelon_Division:
|
|
652
|
+
return "Division";
|
|
653
|
+
case SymbolID.Echelon_Corps_MEF:
|
|
654
|
+
return "Corps";
|
|
655
|
+
case SymbolID.Echelon_Army:
|
|
656
|
+
return "Army";
|
|
657
|
+
case SymbolID.Echelon_ArmyGroup_Front:
|
|
658
|
+
return "Army Group";
|
|
659
|
+
case SymbolID.Echelon_Region_Theater:
|
|
660
|
+
return "Region";
|
|
661
|
+
case SymbolID.Echelon_Region_Command:
|
|
662
|
+
return "Command";
|
|
663
|
+
case SymbolID.Mobility_WheeledLimitedCrossCountry:
|
|
664
|
+
return "Wheeled limited cross country";
|
|
665
|
+
case SymbolID.Mobility_WheeledCrossCountry:
|
|
666
|
+
return "Wheeled cross country";
|
|
667
|
+
case SymbolID.Mobility_Tracked:
|
|
668
|
+
return "Tracked";
|
|
669
|
+
case SymbolID.Mobility_Wheeled_Tracked:
|
|
670
|
+
return "Wheeled and tracked combination";
|
|
671
|
+
case SymbolID.Mobility_Towed:
|
|
672
|
+
return "Towed";
|
|
673
|
+
case SymbolID.Mobility_Rail:
|
|
674
|
+
return "Rail";
|
|
675
|
+
case SymbolID.Mobility_PackAnimals:
|
|
676
|
+
return "Pack animals";
|
|
677
|
+
case SymbolID.Mobility_OverSnow:
|
|
678
|
+
return "Over snow";
|
|
679
|
+
case SymbolID.Mobility_Sled:
|
|
680
|
+
return "Sled";
|
|
681
|
+
case SymbolID.Mobility_Barge:
|
|
682
|
+
return "Barge";
|
|
683
|
+
case SymbolID.Mobility_Amphibious:
|
|
684
|
+
return "Amphibious";
|
|
685
|
+
case SymbolID.Mobility_ShortTowedArray:
|
|
686
|
+
return "Short towed array";
|
|
687
|
+
case SymbolID.Mobility_LongTowedArray:
|
|
688
|
+
return "Long towed Array";
|
|
689
|
+
default:
|
|
690
|
+
return "UNKNOWN";
|
|
691
|
+
}
|
|
692
|
+
}
|