Milsymbol Mapping: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 45: | Line 45: | ||
var milSymMapper = new MilSymMapper(mappingDrawObjectTypeLoader, activesymbolset); | var milSymMapper = new MilSymMapper(mappingDrawObjectTypeLoader, activesymbolset); | ||
</source> | </source> | ||
=== Handling Mismatches Between MilSym Versions === | |||
Some objects cannot be mapped directly between APP6D and MIL-STD2525C. Either because of different representation of primitives or because of objects are not present in one of the versions. | |||
To handle this a configuration file MilSymVersionMappings.json (located in the Data folder of the application output), sets up how these objects (SIDCs) should be mapped. | |||
Entries in this file looks like this: | |||
<source lang="json"> | |||
{ | |||
"SourceVersion": "APP6D", | |||
"TargetVersion": "MILSTD2525C", | |||
"Name": "Minimum Safe Distance Zones", | |||
"Source": "30002500002721000000", | |||
"Target": "GENERIC.ELLIPSE", | |||
"ObjectType": "MultiFanArea" | |||
} | |||
</source> | |||
The values in a entry are: | |||
{| class="wikitable" | |||
! 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 a best match for the client application. | |||
[[Category:GDK5]] | [[Category:GDK5]] |
Revision as of 15:00, 11 March 2025
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.
Examples of Usage
These examples maps the Battle Position type.
Get Mapped SIDC from SIDC
var factory = new DrawObjectCommonFactory();
// Get APP6D sidc from MIL-STD-2525C SIDC
var id_d = factory.MilSymMapper.GetMilSymSIDCFromMilSymSIDC("TACGRP.C2GM.DEF.ARS.BTLPSN", Mapping.MilSymType.APP6D);
// Get MIL-STD-2525C sidc from APP6D sidc
var id_c = factory.MilSymMapper.GetMilSymSIDCFromMilSymSIDC("30002500001512000000", Mapping.MilSymType.MILSTD2525C);
Get Mapped TypeId from SIDC
var factory = new DrawObjectCommonFactory();
// Get APP6D TypeId from MIL-STD-2525C sidc
var typeId_d = factory.MilSymMapper.GetDrawObjectTypeId("TACGRP.C2GM.DEF.ARS.BTLPSN", Mapping.MilSymType.APP6D);
// Get MIL-STD-2525C TypeId from APP6D sidc
var typeId_c = factory.MilSymMapper.GetDrawObjectTypeId("30002500001512000000", Mapping.MilSymType.MILSTD2525C);
Get Mapped SIDC from TypeId
var factory = new DrawObjectCommonFactory();
// Get APP6D sidc from TypeId
var id_d = factory.MilSymMapper.GetMilSymSIDCFromTypeId(new Guid("88784e27-c8d4-46d8-a72f-4fc433c759ee"), Mapping.MilSymType.APP6D);
// Get MIL-STD-2525C sidc from TypeId
var id_c = factory.MilSymMapper.GetMilSymSIDCFromTypeId(new Guid("88784e27-c8d4-46d8-a72f-4fc433c759ee"), Mapping.MilSymType.MILSTD2525C);
How to Create MilSymMapper Without Factory
var mappingDrawObjectTypeXmlParser = new MappingDrawObjectTypeXmlParser();
var mappingDrawObjectTypeLoader = new MappingDrawObjectTypeLoader(mappingDrawObjectTypeXmlParser);
var activesymbolset = "APP6D";
var milSymMapper = new MilSymMapper(mappingDrawObjectTypeLoader, activesymbolset);
Handling Mismatches Between MilSym Versions
Some objects cannot be mapped directly between APP6D and MIL-STD2525C. Either because of different representation of primitives or because of objects are not present in one of the versions. To handle this a configuration file MilSymVersionMappings.json (located in the Data folder of the application output), sets up how these objects (SIDCs) should be mapped.
Entries in this file looks like this:
{
"SourceVersion": "APP6D",
"TargetVersion": "MILSTD2525C",
"Name": "Minimum Safe Distance Zones",
"Source": "30002500002721000000",
"Target": "GENERIC.ELLIPSE",
"ObjectType": "MultiFanArea"
}
The values in a entry are:
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 a best match for the client application.