예제 #1
0
        public MilitarySymbol CreateSymbolFromStringProperties(
            SymbolSetType symbolSet,
            StandardIdentityAffiliationType affiliation,
            string symbolSetString, string entityCode, string geoType,
            string entityPart, string entityTypePart, string entitySubTypePart)
        {
            MilitarySymbol retSymbol = new MilitarySymbol();

            SymbolIdCode sidc = new SymbolIdCode();

            sidc.Affiliation       = affiliation;
            sidc.SymbolSetAsString = symbolSetString;
            sidc.FullEntityCode    = entityCode;

            sidc.Name = GetWellFormedName(symbolSet, entityPart, entityTypePart, entitySubTypePart);

            retSymbol.Id    = sidc;
            retSymbol.Shape = (ShapeType)TypeUtilities.EnumHelper.getEnumFromString(typeof(ShapeType), geoType);

            return(retSymbol);
        }
예제 #2
0
        private static void MyAdHocTest()
        {
            SymbolIdCode sidc = new SymbolIdCode();

            System.Diagnostics.Trace.WriteLine("SIDC=" + sidc);

            SymbolLookup symbolLookup = new SymbolLookup();

            symbolLookup.Initialize();

            if (!symbolLookup.Initialized)
            {
                System.Diagnostics.Trace.WriteLine("Fail");
            }

            MilitarySymbol ms = symbolLookup.CreateSymbolByEntityName("Fighter/Bomber");

            MilitarySymbolToGraphicLayersMaker.SetMilitarySymbolGraphicLayers(ref ms);

            System.Diagnostics.Trace.WriteLine("MilitarySymbol: " + ms);

            List <MilitarySymbol> matchingSymbols =
                symbolLookup.GetMilitarySymbols(SymbolSetType.Space);

            int matchCount = 0;

            foreach (MilitarySymbol matchSymbol in matchingSymbols)
            {
                matchCount++;
                System.Diagnostics.Trace.WriteLine("Match: " + matchCount
                                                   + ", MilitarySymbol: " + matchSymbol);;
            }

            List <MilitarySymbol> matchingSymbols2 =
                symbolLookup.GetMilitarySymbols(SymbolSetType.Space, StandardIdentityAffiliationType.Friend,
                                                "Military");

            matchCount = 0;
            foreach (MilitarySymbol matchSymbol in matchingSymbols2)
            {
                matchCount++;
                System.Diagnostics.Trace.WriteLine("Match: " + matchCount
                                                   + ", MilitarySymbol: " + matchSymbol);;
            }

            List <string> matchingStrings = symbolLookup.GetDistinctEntries(SymbolSetType.Space);

            matchCount = 0;
            foreach (string distinctMatch in matchingStrings)
            {
                matchCount++;
                System.Diagnostics.Trace.WriteLine("Distinct Match: " + distinctMatch);
            }

            matchingStrings = symbolLookup.GetDistinctEntries(SymbolSetType.Air, "Military",
                                                              "Fixed Wing");

            matchCount = 0;
            foreach (string distinctMatch in matchingStrings)
            {
                matchCount++;
                System.Diagnostics.Trace.WriteLine("Distinct Match: " + distinctMatch);
            }

            matchingStrings = symbolLookup.GetDistinctModifierNames(SymbolSetType.Air, 1);

            matchCount = 0;
            foreach (string distinctMatch in matchingStrings)
            {
                matchCount++;
                System.Diagnostics.Trace.WriteLine("Modifiers: Distinct Match: " + distinctMatch);
            }

            string modifierName = "Government";

            string modifierCode = symbolLookup.GetModifierCodeFromName(SymbolSetType.Air, 1, modifierName);
        }