Example #1
0
        // Echelon/Mobility/Towed Array Amplifier Icon
        // = StandardIdentityAffiliationType + EchelonMobilityType
        // "Amplifier (Echelon): Uses SIDC positions 4 and 9-10."
        // ex. Friend, Team Crew = 311
        //      --> 3 (Friend) + 11 (Echelon = Team/Crew)
        //
        public static string GetEchelonIconNameWithFolder(
            SymbolSetType symbolSet,
            StandardIdentityAffiliationType affiliation,
            EchelonMobilityType echelonMobility)
        {
            if (echelonMobility == EchelonMobilityType.NoEchelonMobility)
            {
                return(string.Empty);
            }

            StringBuilder sb = new StringBuilder();

            if (echelonMobility < EchelonMobilityType.Wheeled_Limited_Cross_Country)
            {
                sb.Append("Echelon");
            }
            else
            {
                sb.Append("Amplifier");
            }

            sb.Append(System.IO.Path.DirectorySeparatorChar);

            StandardIdentityAffiliationType mappedAffiliation =
                TypeUtilities.AffiliationToAffiliationFrameMapping[affiliation];

            string affiliationString =
                TypeUtilities.EnumHelper.getEnumValAsString(mappedAffiliation, 1);

            sb.Append(affiliationString);

            // IMPORTANT NOTE:
            // Only Land Symbol Sets (Unit, Civilian, Equipment, Installation)
            // have echelon symbols so they only match/line up with those frames

            string echelonString = TypeUtilities.EnumHelper.getEnumValAsString(echelonMobility, 2);

            sb.Append(echelonString);

            sb.Append(ImageSuffix);

            return(sb.ToString());
        }
Example #2
0
        // same as ImageFilesHome + GetEchelonIconNameWithFolder
        public static string GetEchelonIconNameWithFullPath(
            SymbolSetType symbolSet,
            StandardIdentityAffiliationType affiliation,
            EchelonMobilityType echelonMobility)
        {
            if (echelonMobility == EchelonMobilityType.NoEchelonMobility)
            {
                return(string.Empty);
            }

            StringBuilder sb = new StringBuilder();

            sb.Append(ImageFilesHome);

            string echelonIconNameWithoutImageFilesHome =
                GetEchelonIconNameWithFolder(symbolSet, affiliation, echelonMobility);

            sb.Append(echelonIconNameWithoutImageFilesHome);

            return(sb.ToString());
        }
        // Echelon/Mobility/Towed Array Amplifier Icon
        // = StandardIdentityAffiliationType + EchelonMobilityType
        // "Amplifier (Echelon): Uses SIDC positions 4 and 9-10."
        // ex. Friend, Team Crew = 311
        //      --> 3 (Friend) + 11 (Echelon = Team/Crew)
        //
        public static string GetEchelonIconNameWithFolder(
            SymbolSetType symbolSet,
            StandardIdentityAffiliationType affiliation,
            EchelonMobilityType echelonMobility)
        {
            if (echelonMobility == EchelonMobilityType.NoEchelonMobility)
            {
                return(string.Empty);
            }

            StringBuilder sb = new StringBuilder();

            if (echelonMobility < EchelonMobilityType.Wheeled_Limited_Cross_Country)
            {
                sb.Append("Echelon");
            }
            else
            {
                sb.Append("Amplifier");
            }

            sb.Append(System.IO.Path.DirectorySeparatorChar);

            StandardIdentityAffiliationType mappedAffiliation =
                TypeUtilities.AffiliationToAffiliationFrameMapping[affiliation];

            string affiliationString =
                TypeUtilities.EnumHelper.getEnumValAsString(mappedAffiliation, 1);

            sb.Append(affiliationString);

            sb.Append(TypeUtilities.EnumHelper.getEnumValAsString(echelonMobility, 2));
            sb.Append(ImageSuffix);

            return(sb.ToString());
        }
        void setSymbolState(string valueSelected = "")
        {
            // TODO: Figure out a way to set this consistent naming scheme better
            string symbolSetName = currentSymbol.Id.SymbolSet.ToString().Replace("_", " ");

            if (string.IsNullOrEmpty(valueSelected))
            {
                // this is a special state (i.e. hack) to simulate a button press, to force
                // into the next state, when the previous panel is empty
            }
            else if (currentPane == PaneSequenceType.AffiliationPane)
            {
                string affiliationSelectedString = valueSelected;

                StandardIdentityAffiliationType affiliationSelection =
                    (StandardIdentityAffiliationType)
                    TypeUtilities.EnumHelper.getEnumFromString(
                        typeof(StandardIdentityAffiliationType), affiliationSelectedString);

                currentSymbol.Id.Affiliation = affiliationSelection;

                currentPane = PaneSequenceType.SymbolSetPane;
            }
            else if (currentPane == PaneSequenceType.SymbolSetPane)
            {
                string symbolSetSelectedString = valueSelected;

                SymbolSetType symbolSetSelection = (SymbolSetType)
                                                   TypeUtilities.EnumHelper.getEnumFromString(
                    typeof(SymbolSetType), symbolSetSelectedString);

                currentSymbol.Id.SymbolSet = symbolSetSelection;

                currentPane = PaneSequenceType.EntityPane;
            }
            else if (currentPane == PaneSequenceType.EntityPane)
            {
                if (valueSelected == NOT_SET)
                {
                    currentPane = PaneSequenceType.Modifier1Pane;
                }
                else
                {
                    currentEntityName = valueSelected;

                    string entityCode = symbolLookup.GetEntityCode(currentSymbol.Id.SymbolSet, currentEntityName);

                    currentSymbol.Id.EntityCode = entityCode;

                    currentPane = PaneSequenceType.EntityTypePane;
                }
            }
            else if (currentPane == PaneSequenceType.EntityTypePane)
            {
                if (valueSelected == NOT_SET)
                {
                    currentPane = PaneSequenceType.Modifier1Pane;
                }
                else
                {
                    currentEntityTypeName = valueSelected;

                    string entityCode = symbolLookup.GetEntityCode(currentSymbol.Id.SymbolSet,
                                                                   currentEntityName, currentEntityTypeName);

                    currentSymbol.Id.EntityCode = entityCode;

                    currentPane = PaneSequenceType.EntitySubTypePane;
                }
            }
            else if (currentPane == PaneSequenceType.EntitySubTypePane)
            {
                if (valueSelected == NOT_SET)
                {
                    currentPane = PaneSequenceType.Modifier1Pane;
                }
                else
                {
                    currentEntitySubTypeName = valueSelected;

                    string entityCode = symbolLookup.GetEntityCode(currentSymbol.Id.SymbolSet,
                                                                   currentEntityName, currentEntityTypeName, currentEntitySubTypeName);

                    currentSymbol.Id.EntityCode = entityCode;

                    currentPane = PaneSequenceType.Modifier1Pane;
                }
            }
            else if (currentPane == PaneSequenceType.Modifier1Pane)
            {
                string currentModifier1Name = valueSelected;

                string modifier1Code = symbolLookup.GetModifierCodeFromName(
                    currentSymbol.Id.SymbolSet, 1, currentModifier1Name);

                currentSymbol.Id.ModifierOne = modifier1Code;

                currentPane = PaneSequenceType.Modifier2Pane;
            }
            else if (currentPane == PaneSequenceType.Modifier2Pane)
            {
                string currentModifier2Name = valueSelected;

                string modifier2Code = symbolLookup.GetModifierCodeFromName(
                    currentSymbol.Id.SymbolSet, 2, currentModifier2Name);

                currentSymbol.Id.ModifierTwo = modifier2Code;

                currentPane = PaneSequenceType.EchelonMobilityPane;
            }
            else if (currentPane == PaneSequenceType.EchelonMobilityPane)
            {
                string currentEchelonMobilityName = valueSelected;

                EchelonMobilityType echelonMobilitySelection =
                    (EchelonMobilityType)
                    TypeUtilities.EnumHelper.getEnumFromString(
                        typeof(EchelonMobilityType), currentEchelonMobilityName);

                currentSymbol.Id.EchelonMobility = echelonMobilitySelection;

                currentPane = PaneSequenceType.HqTfFdPane;
            }
            else if (currentPane == PaneSequenceType.HqTfFdPane)
            {
                string currentHqTfFdName = valueSelected;

                HeadquartersTaskForceDummyType hqTfFdSelection =
                    (HeadquartersTaskForceDummyType)
                    TypeUtilities.EnumHelper.getEnumFromString(
                        typeof(HeadquartersTaskForceDummyType), currentHqTfFdName);

                currentSymbol.Id.HeadquartersTaskForceDummy = hqTfFdSelection;

                currentPane = PaneSequenceType.StatusPane;
            }
            else if (currentPane == PaneSequenceType.StatusPane)
            {
                string currentStatusName = valueSelected;

                StatusType statusSelection =
                    (StatusType)TypeUtilities.EnumHelper.getEnumFromString(
                        typeof(StatusType), currentStatusName);

                currentSymbol.Id.Status = statusSelection;

                currentPane = PaneSequenceType.StartOver;
            }
            else if (currentPane == PaneSequenceType.StartOver)
            {
                // Reset the other values
                resetSymbolState();

                // Go back when we are done
                currentPane = PaneSequenceType.SymbolSetPane;
            }

            setTagLabel();

            updatePictureBox();

            // Go To Next Pane
            SetPaneState();
        }