Milsymbol Mapping: Difference between revisions

From Maria GDK Wiki
Jump to navigation Jump to search
()
No edit summary
 
(29 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Milsymbol Mapping ==
== Milsymbol Mapping ==
The "MilSymMapper" class provides methods for mapping draw object SIDC and TypeId between the milsymbol versions: APP6D, MIL-STD-2525D, and MIL-STD-2525C.
The "MilSymMapper" class provides methods for mapping draw object SIDC between the milsymbol versions: APP6D and APP6C.


=== Examples of Usage ===
=== Examples of Usage ===
These examples maps the Battle Position type.


=== Get Mapped SIDC from SIDC ===
<source>
<source lang="c#">
var resources= new DrawObjectCommonResources(...);
var factory = new DrawObjectCommonFactory();


// Get APP6D sidc from MIL-STD-2525C SIDC
// Get APP6D sidc from 15 character MIL-STD-2525C sidc
var id_d = factory.MilSymMapper.GetMilSymSIDCFromMilSymSIDC("TACGRP.C2GM.DEF.ARS.BTLPSN", Mapping.MilSymType.APP6D);
var id_d = resources.MilSymMapper.MapAPP6CToAPP6D("SUGPUSTA--A----");


// Get MIL-STD-2525C sidc from APP6D sidc
// Get APP6D sidc from APP6C hierarchy code.
var id_c = factory.MilSymMapper.GetMilSymSIDCFromMilSymSIDC("30002500001512000000", Mapping.MilSymType.MILSTD2525C);
var id_d = MapAPP6CHierarchyCodeToAPP6D("TACGRP.CSS.PNT.SPT.GNL");
</source>


=== Get Mapped TypeId from SIDC ===
// Get 15 character MIL-STD-2525C sidc from APP6D sidc
<source lang="c#">
var id_c = resources.MilSymMapper.MapAPP6DToAPP6C("100301000011010400000000000000");
var factory = new DrawObjectCommonFactory();


// Get APP6D TypeId from MIL-STD-2525C sidc
// Get APP6C hierarchy code from APP6D sid.
var typeId_d = factory.MilSymMapper.GetDrawObjectTypeId("TACGRP.C2GM.DEF.ARS.BTLPSN", Mapping.MilSymType.APP6D);
var id_c = MapAPP6DToAPP6CHierarchyCode("100025000032050000000000000000");


// Get MIL-STD-2525C TypeId from APP6D sidc
var typeId_c = factory.MilSymMapper.GetDrawObjectTypeId("30002500001512000000", Mapping.MilSymType.MILSTD2525C);
</source>
</source>


=== Get Mapped SIDC from TypeId ===
The MilSymMapper can also be created without using the DrawObjectCommonResources:
<source lang="c#">
var factory = new DrawObjectCommonFactory();


// Get APP6D sidc from TypeId
<source>
var id_d = factory.MilSymMapper.GetMilSymSIDCFromTypeId(new Guid("88784e27-c8d4-46d8-a72f-4fc433c759ee"), Mapping.MilSymType.APP6D);
 
var milsymMapper = new MilSymMapper();


// Get MIL-STD-2525C sidc from TypeId
var id_c = factory.MilSymMapper.GetMilSymSIDCFromTypeId(new Guid("88784e27-c8d4-46d8-a72f-4fc433c759ee"), Mapping.MilSymType.MILSTD2525C);
</source>
</source>


=== How to Create MilSymMapper Without Factory ===
For compatible mapping between draw objects in MARIA GDK 4 and MARIA GDK 5 the following API can be used:
<source lang="c#">
var mappingDrawObjectTypeXmlParser = new MappingDrawObjectTypeXmlParser();
var mappingDrawObjectTypeLoader = new MappingDrawObjectTypeLoader(mappingDrawObjectTypeXmlParser);
var activesymbolset = "APP6D";
var milSymMapper = new MilSymMapper(mappingDrawObjectTypeLoader, activesymbolset);
</source>


=== Handling Mismatches Between APP6D and MIL-STD2525C ===
<source>


Some objects cannot be mapped directly between APP6D and MIL-STD2525C. Either because of different representation of primitives or because of objects not present in one of the versions.
// Get GDK 4 compliant hierarchy code from APP6D sidc.
To handle this, the configuration file MilSymVersionMappings.json (located in the Data folder of the application output), sets up how these objects (SIDCs) should be mapped.
var id_c = GetGDK4CompliantSIDC("100025000032050000000000000000");


Entries in the configuration file looks like this:
// Get GDK 5 compliant sidc from MIL-STD2525C hierarchy code.
var id_d = GetGDK5CompliantSIDC("TACGRP.CSS.PNT.SPT.GNL);


<source lang="json">
{
      "SourceVersion": "APP6D",
      "TargetVersion": "MILSTD2525C",
      "Name": "Minimum Safe Distance Zones",
      "Source": "30002500002721000000",
      "Target": "GENERIC.ELLIPSE",
      "ObjectType": "MultiFanArea"
}
</source>
</source>


The values in an entry are:
=== How to Update Mapping Between APP6D and APP6C ===
 
There are two files handeling mapping between APP6C and APP6D:
 
* C2DMapping.csv, handels mapping from APP6C to APP6D
* D2CMapping.csv, handels mapping from APP6D to APP6C


{| class="wikitable"
Each file contains one line per mapping and is a comma separated list of values. The first line in each file contains a descriptive name of each "column".
! Name
! Description
|-
| '''SourceVersion'''
| Version to map from.
|-
| '''TargetVersion'''
| Version to map to.
|-
| '''Name'''
| Name of object (for readability only, does not affect mapping).
|-
| '''Source'''
| SIDC to map from.
|-
| '''Target'''
| SIDC to map to.
|-
| '''ObjectType'''
| Primitive type of object (for readability only, does not affect mapping).
|}


These entries can be edited to whatever is the best match for the client application, as long as the primitive representation of the objects match.
==== The File C2DMapping.csv ====
<syntaxhighlight lang="csharp">
C_SymbolCode,D_Sidc,C_HierarchyCode,Status
S*A*M-----*****,100001000011000000000000000000,WAR.AIRTRK.MIL,
</syntaxhighlight>


==== The File D2CMapping.csv ====
<syntaxhighlight lang="csharp">
D_Sidc,C_SymbolCode,C_HierarchyCode,Status
100001000011000000000000000000,S*A*M-----*****,WAR.AIRTRK.MIL,
</syntaxhighlight>
[[Category:GDK5]]
[[Category:GDK5]]

Latest revision as of 15:22, 22 October 2025

Milsymbol Mapping

The "MilSymMapper" class provides methods for mapping draw object SIDC between the milsymbol versions: APP6D and APP6C.

Examples of Usage

var resources= new DrawObjectCommonResources(...);

// Get APP6D sidc from 15 character MIL-STD-2525C sidc
var id_d = resources.MilSymMapper.MapAPP6CToAPP6D("SUGPUSTA--A----");

// Get APP6D sidc from APP6C hierarchy code.
var id_d = MapAPP6CHierarchyCodeToAPP6D("TACGRP.CSS.PNT.SPT.GNL");

// Get 15 character MIL-STD-2525C sidc from APP6D sidc 
var id_c = resources.MilSymMapper.MapAPP6DToAPP6C("100301000011010400000000000000");

// Get APP6C hierarchy code from APP6D sid.
var id_c = MapAPP6DToAPP6CHierarchyCode("100025000032050000000000000000");

The MilSymMapper can also be created without using the DrawObjectCommonResources:

var milsymMapper = new MilSymMapper();

For compatible mapping between draw objects in MARIA GDK 4 and MARIA GDK 5 the following API can be used:

// Get GDK 4 compliant hierarchy code from APP6D sidc.
var id_c = GetGDK4CompliantSIDC("100025000032050000000000000000");

// Get GDK 5 compliant sidc from MIL-STD2525C hierarchy code.
var id_d = GetGDK5CompliantSIDC("TACGRP.CSS.PNT.SPT.GNL);

How to Update Mapping Between APP6D and APP6C

There are two files handeling mapping between APP6C and APP6D:

  • C2DMapping.csv, handels mapping from APP6C to APP6D
  • D2CMapping.csv, handels mapping from APP6D to APP6C

Each file contains one line per mapping and is a comma separated list of values. The first line in each file contains a descriptive name of each "column".

The File C2DMapping.csv

C_SymbolCode,D_Sidc,C_HierarchyCode,Status
S*A*M-----*****,100001000011000000000000000000,WAR.AIRTRK.MIL,

The File D2CMapping.csv

D_Sidc,C_SymbolCode,C_HierarchyCode,Status
100001000011000000000000000000,S*A*M-----*****,WAR.AIRTRK.MIL,