Beispiel #1
0
        internal SymbolSetEntity Entity(SymbolSet symbolSet, string entityID)
        {
            SymbolSetEntity retObj = null;

            if (symbolSet != null)
            {
                if (symbolSet.Entities != null)
                {
                    foreach (SymbolSetEntity lObj in symbolSet.Entities)
                    {
                        if (lObj.ID == entityID)
                        {
                            return(lObj);
                        }
                    }
                }
            }

            _statusFlag -= 2048;

            return(retObj);
        }
        internal SymbolSetEntityEntityType EntityType(SymbolSetEntity entity, string entityTypeID)
        {
            SymbolSetEntityEntityType retObj = null;

            if (entity != null)
            {
                if (entity.EntityTypes != null)
                {
                    foreach (SymbolSetEntityEntityType lObj in entity.EntityTypes)
                    {
                        if (lObj.ID == entityTypeID)
                        {
                            return(lObj);
                        }
                    }
                }
            }

            _statusFlag -= 4096;

            return(retObj);
        }
Beispiel #3
0
        protected string BuildEntityItemName(SymbolSet ss,
                                             SymbolSetEntity e,
                                             SymbolSetEntityEntityType eType,
                                             SymbolSetEntityEntityTypeEntitySubType eSubType)
        {
            // Constructs a string containing the name of an entity, where each label value
            // is seperated by a DomainSeparator (usually a colon).  Builds this for each group
            // of related SymbolSet and entity.

            string result = ss.Label.Replace(',', '-') + _configHelper.DomainSeparator + e.Label.Replace(',', '-');

            if (eType != null)
            {
                result = result + _configHelper.DomainSeparator + eType.Label.Replace(',', '-');
            }

            if (eSubType != null)
            {
                result = result + _configHelper.DomainSeparator + eSubType.Label.Replace(',', '-');
            }

            return(result);
        }
        internal SymbolSetEntityEntityType EntityType(SymbolSetEntity entity, ushort entityTypeCodeOne, ushort entityTypeCodeTwo)
        {
            SymbolSetEntityEntityType retObj = null;

            if (entity != null)
            {
                if (entity.EntityTypes != null)
                {
                    foreach (SymbolSetEntityEntityType lObj in entity.EntityTypes)
                    {
                        if (lObj.EntityTypeCode.DigitOne == entityTypeCodeOne &&
                            lObj.EntityTypeCode.DigitTwo == entityTypeCodeTwo)
                        {
                            return(lObj);
                        }
                    }
                }
            }

            _statusFlag -= 4096;

            return(retObj);
        }
        internal SymbolSetEntity Entity(SymbolSet symbolSet, ushort entityCodeOne, ushort entityCodeTwo)
        {
            SymbolSetEntity retObj = null;

            if (symbolSet != null)
            {
                if (symbolSet.Entities != null)
                {
                    foreach (SymbolSetEntity lObj in symbolSet.Entities)
                    {
                        if (lObj.EntityCode.DigitOne == entityCodeOne &&
                            lObj.EntityCode.DigitTwo == entityCodeTwo)
                        {
                            return(lObj);
                        }
                    }
                }
            }

            _statusFlag -= 2048;

            return(retObj);
        }
        protected string BuildLegacySIDCTag(LibraryStandardIdentityGroup sig,
                                            SymbolSet ss,
                                            SymbolSetEntity e,
                                            SymbolSetEntityEntityType eType,
                                            EntitySubTypeType eSubType)
        {
            string result = _configHelper.SIDCIsNew;

            if (ss != null && e != null)
            {
                uint partA = 1000000000 + (ss.SymbolSetCode.DigitOne * (uint)100000) + (ss.SymbolSetCode.DigitTwo * (uint)10000);

                if (sig != null)
                {
                    partA = partA + (sig.StandardIdentityGroupCode * (uint)1000000);
                }

                uint partB = (e.EntityCode.DigitOne * (uint)1000000000) + (e.EntityCode.DigitTwo * (uint)100000000);

                if (eType != null)
                {
                    partB = partB + (eType.EntityTypeCode.DigitOne * (uint)10000000) + (eType.EntityTypeCode.DigitTwo * (uint)1000000);
                }

                if (eSubType != null)
                {
                    partB = partB + (eSubType.EntitySubTypeCode.DigitOne * (uint)100000) + (eSubType.EntitySubTypeCode.DigitTwo * (uint)10000);
                }

                Symbol symbol = _configHelper.Librarian.MakeSymbol(new SIDC(partA, partB));

                //
                // If the symbol has a 2525C equivalent, return it
                //

                if (symbol != null)
                {
                    if (symbol.SymbolStatus == SymbolStatusEnum.statusEnumOld)
                    {
                        result = symbol.LegacySIDC;

                        if (sig == null && result.Substring(1, 1) == "P")
                        {
                            result = result.Substring(0, 1) + "*" + result.Substring(2);
                        }

                        if (result.Substring(14, 1) == "X")
                        {
                            result = result.Substring(0, 10) + "****X";
                        }

                        else if (result.Substring(0, 1) == "W")
                        {
                            result = result.Substring(0, 13) + "**";
                        }

                        else if (result.Substring(10, 5) == "-----")
                        {
                            result = result.Substring(0, 10) + "*****";
                        }

                        else if (result.Substring(11, 4) == "----")
                        {
                            result = result.Substring(0, 11) + "****";
                        }
                    }
                }
                else
                {
                    logger.Warn("Symbol could not be built from: " + partA + ":" + partB);
                }
            }

            return(result);
        }
        protected string BuildEntityItemTags(LibraryStandardIdentityGroup sig,
                                             SymbolSet ss,
                                             SymbolSetEntity e,
                                             SymbolSetEntityEntityType eType,
                                             EntitySubTypeType eSubType,
                                             bool omitSource,
                                             bool omitLegacy)
        {
            // Constructs a string of semicolon delimited tags that users can utilize to search
            // for or find a given symbol.

            // The information concatenated together for this comes from a given SymbolSet and
            // entity (type and sub type).  Information includes the Label attributes, geometry
            // type, location of the original graphic file, the code, etc.

            string result   = ss.Label.Replace(',', '-');
            string graphic  = "";
            string geometry = "";
            string iType    = "NO_ICON";

            string[] xmlTags = null;

            if (e == null && eType == null && eSubType != null)
            {
                result = result + ";" + "Special Entity Subtypes";
            }

            if (e != null)
            {
                result = result + ";" + e.Label.Replace(',', '-');
                iType  = Convert.ToString(e.Icon);
            }

            if (eType != null)
            {
                result = result + ";" + eType.Label.Replace(',', '-');
                iType  = Convert.ToString(eType.Icon);
            }

            if (eSubType != null)
            {
                result = result + ";" + eSubType.Label.Replace(',', '-');
                iType  = Convert.ToString(eSubType.Icon);

                // Add the type of geometry

                geometry = _geometryList[(int)eSubType.GeometryType];

                if (eSubType.Icon == IconType.FULL_FRAME)
                {
                    if (sig != null)
                    {
                        graphic = GrabGraphic(eSubType.CloverGraphic, eSubType.RectangleGraphic, eSubType.SquareGraphic, eSubType.DiamondGraphic, sig.GraphicSuffix);
                    }

                    _notes = _notes + "icon touches frame;";
                }
                else if (eSubType.Icon == IconType.NA)
                {
                    graphic = "";
                }
                else
                {
                    graphic = eSubType.Graphic;
                }

                // Grab any custom XML tags that might exist

                xmlTags = eSubType.Tags;
            }
            else if (eType != null)
            {
                // Add the type of geometry

                geometry = _geometryList[(int)eType.GeometryType];

                if (eType.Icon == IconType.FULL_FRAME)
                {
                    if (sig != null)
                    {
                        graphic = GrabGraphic(eType.CloverGraphic, eType.RectangleGraphic, eType.SquareGraphic, eType.DiamondGraphic, sig.GraphicSuffix);
                    }

                    _notes = _notes + "icon touches frame;";
                }
                else if (eType.Icon == IconType.NA)
                {
                    graphic = "";
                }
                else
                {
                    graphic = eType.Graphic;
                }

                // Grab any custom XML tags that might exist

                xmlTags = eType.Tags;
            }
            else if (e != null)
            {
                // Add the type of geometry

                geometry = _geometryList[(int)e.GeometryType];

                if (e.Icon == IconType.FULL_FRAME)
                {
                    if (sig != null)
                    {
                        graphic = GrabGraphic(e.CloverGraphic, e.RectangleGraphic, e.SquareGraphic, e.DiamondGraphic, sig.GraphicSuffix);
                    }

                    _notes = _notes + "icon touches frame;";
                }
                else if (e.Icon == IconType.NA)
                {
                    graphic = "";
                }
                else
                {
                    graphic = e.Graphic;
                }

                // Grab any custom XML tags that might exist

                xmlTags = e.Tags;
            }

            // Create the unique ID/code for this object

            string code = BuildEntityCode(sig, ss, e, eType, eSubType);

            // If there is a standard identity group, add it

            if (sig != null)
            {
                result = result + ";" + sig.Label;
            }

            // Add any custom XML or export tags that might exist

            result = _configHelper.AddCustomTags(result, code, xmlTags);

            // Add an equivalent 2525C SIDC tag, if one exists

            if (!omitLegacy)
            {
                string sidcTag = BuildLegacySIDCTag(sig, ss, e, eType, eSubType);
                if (sidcTag != "")
                {
                    result = result + ";" + sidcTag;
                }
            }

            // Add the icon's type

            result = result + ";" + iType;

            // Add the svg source

            if (!omitSource)
            {
                result = result + ";" + _configHelper.GetPath(ss.ID, FindEnum.FindEntities, true) + "\\" + graphic;
            }

            // Add the three most important pieces of information

            result = result + ";" + geometry;
            result = result + ";" + BuildEntityItemName(sig, ss, e, eType, eSubType);
            result = result + ";" + code;

            if (result.Length > 255)
            {
                // Can't have a tag string greater than 255 in length.
                // Human interaction will be required to resolve these on a case by case basis.

                _notes = _notes + "styleItemTags > 255;";
            }

            return(result);
        }
Beispiel #8
0
        string IEntityExport.Line(SymbolSet ss, SymbolSetEntity e, SymbolSetEntityEntityType eType, SymbolSetEntityEntityTypeEntitySubType eSubType)
        {
            _notes = "";

            string   result  = "";
            string   graphic = "";
            IconType iType   = IconType.MAIN;

            string graphicPath = _configHelper.GetPath(ss.ID, FindEnum.FindEntities);

            if (eSubType != null)
            {
                // TODO: handle this differently, but for now, we export the square
                // graphic if there are in fact multiple files.

                if (eSubType.Graphic != "" && eSubType.Icon != IconType.FULL_FRAME)
                {
                    graphic = eSubType.Graphic;
                }
                else
                {
                    graphic = eSubType.SquareGraphic;
                }

                iType = eSubType.Icon;
            }
            else if (eType != null)
            {
                if (eType.Graphic != "" && eType.Icon != IconType.FULL_FRAME)
                {
                    graphic = eType.Graphic;
                }
                else
                {
                    graphic = eType.SquareGraphic;
                }

                iType = eType.Icon;
            }
            else if (e != null)
            {
                if (e.Graphic != "" && e.Icon != IconType.FULL_FRAME)
                {
                    graphic = e.Graphic;
                }
                else
                {
                    graphic = e.SquareGraphic;
                }

                iType = e.Icon;
            }

            if (iType == IconType.NA)
            {
                _notes = _notes + "icon is NA - entity is never to be drawn;";
            }
            else
            {
                _notes = _notes + "icon is " + Convert.ToString(iType) + ";";
            }

            string itemRootedPath = _configHelper.BuildRootedPath(graphicPath, graphic);
            string itemActualPath = _configHelper.BuildActualPath(graphicPath, graphic);

            if (!File.Exists(itemActualPath))
            {
                _notes = _notes + "image file does not exist;";
            }

            string itemName     = BuildEntityItemName(ss, e, eType, eSubType);
            string itemCategory = BuildEntityItemCategory(ss, iType);
            string itemTags     = BuildEntityItemTags(ss, e, eType, eSubType, _omitSource);

            result = itemRootedPath + "," +
                     Convert.ToString(_configHelper.PointSize) + "," +
                     itemName + "," +
                     itemCategory + "," +
                     itemTags + "," +
                     _notes;

            return(result);
        }
Beispiel #9
0
        protected string BuildEntityCode(LibraryStandardIdentityGroup sig,
                                         SymbolSet ss,
                                         SymbolSetEntity e,
                                         SymbolSetEntityEntityType eType,
                                         EntitySubTypeType eSubType)
        {
            // Constructs a string containing the symbol set and entity codes for a given
            // set of those objects.

            string code = "";

            if (ss != null)
            {
                code = code + Convert.ToString(ss.SymbolSetCode.DigitOne) + Convert.ToString(ss.SymbolSetCode.DigitTwo);
            }

            if (e == null && eType == null && eSubType != null)
            {
                // Deal with the special entity sub types as a special case

                code = code + eSubType.EntityCode + eSubType.EntityTypeCode + Convert.ToString(eSubType.EntitySubTypeCode.DigitOne) + Convert.ToString(eSubType.EntitySubTypeCode.DigitTwo);
            }
            else
            {
                // Almost everything is dealt with below

                if (e != null)
                {
                    code = code + Convert.ToString(e.EntityCode.DigitOne) + Convert.ToString(e.EntityCode.DigitTwo);
                }
                else
                {
                    code = code + "00";
                }

                if (eType != null)
                {
                    code = code + Convert.ToString(eType.EntityTypeCode.DigitOne) + Convert.ToString(eType.EntityTypeCode.DigitTwo);
                }
                else
                {
                    code = code + "00";
                }

                if (eSubType != null)
                {
                    code = code + Convert.ToString(eSubType.EntitySubTypeCode.DigitOne) + Convert.ToString(eSubType.EntitySubTypeCode.DigitTwo);
                }
                else
                {
                    code = code + "00";
                }
            }

            if (sig != null)
            {
                code = code + sig.GraphicSuffix;
            }

            return(code);
        }
        private string _buildName(SymbolSet ss, SymbolSetLegacySymbol legacySymbol)
        {
            // Builds a seperated string of components names for all the 2525D elements
            // used to make this legacy symbol

            string result = "";

            Librarian lib = _configHelper.Librarian;

            if (legacySymbol.EntityID != "")
            {
                _entity = lib.Entity(ss, legacySymbol.EntityID);
            }
            else
            {
                _entity = null;
            }

            if (_entity != null && legacySymbol.EntityTypeID != "")
            {
                _entityType = lib.EntityType(_entity, legacySymbol.EntityTypeID);
            }
            else
            {
                _entityType = null;
            }

            if (_entityType != null && legacySymbol.EntitySubTypeID != "")
            {
                _entitySubType = lib.EntitySubType(ss, _entityType, legacySymbol.EntitySubTypeID);
            }
            else
            {
                _entitySubType = null;
            }

            if (legacySymbol.ModifierOneID != "")
            {
                _modifier1 = lib.ModifierOne(ss, legacySymbol.ModifierOneID);
            }
            else
            {
                _modifier1 = null;
            }

            if (legacySymbol.ModifierTwoID != "")
            {
                _modifier2 = lib.ModifierTwo(ss, legacySymbol.ModifierTwoID);
            }
            else
            {
                _modifier2 = null;
            }

            result = _entityExport.NameIt(null, ss, _entity, _entityType, _entitySubType);

            if (_modifier1 != null && _modifier1.Label != "Unspecified" && _modifier1.Label != "Not Applicable")
            {
                result = result + _configHelper.DomainSeparator + _modifierExport.NameIt(ss, "1", _modifier1);
            }

            if (_modifier2 != null && _modifier2.Label != "Unspecified" && _modifier2.Label != "Not Applicable")
            {
                result = result + _configHelper.DomainSeparator + _modifierExport.NameIt(ss, "2", _modifier2);
            }

            return(result);
        }
Beispiel #11
0
        protected string BuildEntityItemTags(SymbolSet ss,
                                             SymbolSetEntity e,
                                             SymbolSetEntityEntityType eType,
                                             SymbolSetEntityEntityTypeEntitySubType eSubType,
                                             bool omitSource)
        {
            // Constructs a string of semicolon delimited tags that users can utilize to search
            // for or find a given symbol.

            // The information concatenated together for this comes from a given SymbolSet and
            // entity (type and sub type).  Information includes the Label attributes, geometry
            // type, location of the original graphic file, the code, etc.

            string result   = ss.Label.Replace(',', '-') + ";" + e.Label.Replace(',', '-');
            string graphic  = "";
            string geometry = "";

            if (eType != null)
            {
                result = result + ";" + eType.Label.Replace(',', '-');
            }

            if (eSubType != null)
            {
                result = result + ";" + eSubType.Label.Replace(',', '-');

                // Add the type of geometry

                geometry = _geometryList[(int)eSubType.GeometryType];

                // The following is a work around because our symbol system doesn't
                // need the export of multiple SVG files for the same symbol.
                // TODO: handle this differently, but for now, we export the square
                // graphic if there are in fact multiple files.

                if (eSubType.Icon == IconType.FULL_FRAME)
                {
                    graphic = eSubType.SquareGraphic;
                    _notes  = _notes + "icon touches frame;";
                }
                else if (eSubType.Icon == IconType.NA)
                {
                    graphic = "";
                }
                else
                {
                    graphic = eSubType.Graphic;
                }
            }
            else if (eType != null)
            {
                // Add the type of geometry

                geometry = _geometryList[(int)eType.GeometryType];

                // TODO: handle this differently, but for now, we export the square
                // graphic if there are in fact multiple files.

                if (eType.Icon == IconType.FULL_FRAME)
                {
                    graphic = eType.SquareGraphic;
                    _notes  = _notes + "icon touches frame;";
                }
                else if (eType.Icon == IconType.NA)
                {
                    graphic = "";
                }
                else
                {
                    graphic = eType.Graphic;
                }
            }
            else if (e != null)
            {
                // Add the type of geometry

                geometry = _geometryList[(int)e.GeometryType];

                // TODO: handle this differently, but for now, we export the square
                // graphic if there are in fact multiple files.

                if (e.Icon == IconType.FULL_FRAME)
                {
                    graphic = e.SquareGraphic;
                    _notes  = _notes + "icon touches frame;";
                }
                else if (e.Icon == IconType.NA)
                {
                    graphic = "";
                }
                else
                {
                    graphic = e.Graphic;
                }
            }

            if (!omitSource)
            {
                result = result + ";" + _configHelper.GetPath(ss.ID, FindEnum.FindEntities, true) + "\\" + graphic;
            }

            result = result + ";" + geometry;
            result = result + ";" + BuildEntityItemName(ss, e, eType, eSubType);
            result = result + ";" + BuildEntityCode(ss, e, eType, eSubType);

            if (result.Length > 255)
            {
                // Can't have a tag string greater than 255 in length.
                // Human interaction will be required to resolve these on a case by case basis.

                _notes = _notes + "styleItemTags > 255;";
            }

            return(result);
        }
Beispiel #12
0
        string IEntityExport.Line(LibraryStandardIdentityGroup sig, SymbolSet ss, SymbolSetEntity e, SymbolSetEntityEntityType eType, EntitySubTypeType eSubType)
        {
            _notes = "";

            string   result  = "";
            string   graphic = "";
            IconType iType   = IconType.MAIN;

            string graphicPath = _configHelper.GetPath(ss.ID, FindEnum.FindEntities);

            if (eSubType != null)
            {
                if (eSubType.Graphic != "" && eSubType.Icon != IconType.FULL_FRAME)
                {
                    graphic = eSubType.Graphic;
                }
                else
                if (sig != null)
                {
                    graphic = GrabGraphic(eSubType.CloverGraphic, eSubType.RectangleGraphic, eSubType.SquareGraphic, eSubType.DiamondGraphic, sig.GraphicSuffix);
                }

                iType = eSubType.Icon;
            }
            else if (eType != null)
            {
                if (eType.Graphic != "" && eType.Icon != IconType.FULL_FRAME)
                {
                    graphic = eType.Graphic;
                }
                else
                if (sig != null)
                {
                    graphic = GrabGraphic(eType.CloverGraphic, eType.RectangleGraphic, eType.SquareGraphic, eType.DiamondGraphic, sig.GraphicSuffix);
                }

                iType = eType.Icon;
            }
            else if (e != null)
            {
                if (e.Graphic != "" && e.Icon != IconType.FULL_FRAME)
                {
                    graphic = e.Graphic;
                }
                else
                if (sig != null)
                {
                    graphic = GrabGraphic(e.CloverGraphic, e.RectangleGraphic, e.SquareGraphic, e.DiamondGraphic, sig.GraphicSuffix);
                }

                iType = e.Icon;
            }

            // Suppressed as considered redundant information

            //if (iType == IconType.NA)
            //    _notes = _notes + "icon is NA - entity is never to be drawn;";
            //else if(iType != IconType.MAIN)
            //    _notes = _notes + "icon is " + Convert.ToString(iType) + ";";

            string itemRootedPath   = _configHelper.BuildRootedPath(graphicPath, graphic);
            string itemOriginalPath = _configHelper.BuildOriginalPath(graphicPath, graphic);

            if (!File.Exists(itemOriginalPath))
            {
                _notes = _notes + "image file does not exist;";
            }

            string itemName     = BuildEntityItemName(sig, ss, e, eType, eSubType);
            string itemTags     = BuildEntityItemTags(sig, ss, e, eType, eSubType, _omitSource, _omitLegacy);
            string itemID       = BuildEntityCode(sig, ss, e, eType, eSubType);
            string itemGeometry = GeometryIs(e, eType, eSubType);
            string itemCategory = BuildEntityItemCategory(ss, iType, itemGeometry);

            result = itemRootedPath + "," +
                     Convert.ToString(_configHelper.PointSize) + "," +
                     itemName + "," +
                     itemCategory + "," +
                     itemTags + "," +
                     itemID + "," +
                     itemGeometry + "," +
                     _notes;

            return(result);
        }
        private void _UpdateFromCurrent()
        {
            // Search for the appropriate JMSML Library elements, given the current (2525D)
            // SIDC for this Symbol.

            string first10  = _sidc.PartAString;
            string second10 = _sidc.PartBString;

            _librarian.ResetStatusCode();

            _version = _librarian.Version(Convert.ToUInt16(first10.Substring(0, 1)),
                                          Convert.ToUInt16(first10.Substring(1, 1)));

            _context          = _librarian.Context(Convert.ToUInt16(first10.Substring(2, 1)));
            _standardIdentity = _librarian.StandardIdentity(Convert.ToUInt16(first10.Substring(3, 1)));
            _sig       = _librarian.StandardIdentityGroup(_standardIdentity);
            _symbolSet = _librarian.SymbolSet(Convert.ToUInt16(first10.Substring(4, 1)), Convert.ToUInt16(first10.Substring(5, 1)));

            if (_symbolSet != null)
            {
                _dimension = _librarian.DimensionBySymbolSet(_symbolSet.ID);
            }

            if (_context != null && _dimension != null && _standardIdentity != null)
            {
                _affiliation = _librarian.Affiliation(_context.ID, _dimension.ID, _standardIdentity.ID);
            }

            _status         = _librarian.Status(Convert.ToUInt16(first10.Substring(6, 1)));
            _hqTFDummy      = _librarian.HQTFDummy(Convert.ToUInt16(first10.Substring(7, 1)));
            _amplifierGroup = _librarian.AmplifierGroup(Convert.ToUInt16(first10.Substring(8, 1)));

            if (_amplifierGroup != null)
            {
                _amplifier = _librarian.Amplifier(_amplifierGroup, Convert.ToUInt16(first10.Substring(9, 1)));
            }

            if (_symbolSet != null)
            {
                _entity = _librarian.Entity(_symbolSet, Convert.ToUInt16(second10.Substring(0, 1)), Convert.ToUInt16(second10.Substring(1, 1)));

                if (_entity != null)
                {
                    _entityType = _librarian.EntityType(_entity, Convert.ToUInt16(second10.Substring(2, 1)), Convert.ToUInt16(second10.Substring(3, 1)));
                }

                if (_entityType != null)
                {
                    _entitySubType = _librarian.EntitySubType(_entityType, Convert.ToUInt16(second10.Substring(4, 1)), Convert.ToUInt16(second10.Substring(5, 1)));

                    if (_entitySubType == null)
                    {
                        _entitySubType = _librarian.EntitySubType(_symbolSet, Convert.ToUInt16(second10.Substring(4, 1)), Convert.ToUInt16(second10.Substring(5, 1)));
                    }
                }

                _modifierOne = _librarian.ModifierOne(_symbolSet, Convert.ToUInt16(second10.Substring(6, 1)), Convert.ToUInt16(second10.Substring(7, 1)));
                _modifierTwo = _librarian.ModifierTwo(_symbolSet, Convert.ToUInt16(second10.Substring(8, 1)), Convert.ToUInt16(second10.Substring(9, 1)));

                _legacySymbol = _librarian.LegacySymbol(_symbolSet, _entity, _entityType, _entitySubType, _modifierOne, _modifierTwo);
            }

            _librarian.LogConversionResult(_sidc.PartAString + ", " + _sidc.PartBString);

            _ValidateStatus();
        }
        internal SymbolSetLegacySymbol LegacySymbol(SymbolSet symbolSet,
                                                    SymbolSetEntity entity,
                                                    SymbolSetEntityEntityType entityType,
                                                    EntitySubTypeType entitySubType,
                                                    ModifiersTypeModifier modifierOne,
                                                    ModifiersTypeModifier modifierTwo)
        {
            SymbolSetLegacySymbol retObj = null;

            if (symbolSet != null)
            {
                if (symbolSet.LegacySymbols != null)
                {
                    int match = 0;

                    foreach (SymbolSetLegacySymbol lObj in symbolSet.LegacySymbols)
                    {
                        if (entity != null)
                        {
                            if (lObj.EntityID != "NA")
                            {
                                if (lObj.EntityID == entity.ID)
                                {
                                    match++;
                                }
                            }
                        }
                        else if (lObj.EntityID == "NA")
                        {
                            match++;
                        }

                        if (entityType != null)
                        {
                            if (lObj.EntityTypeID != "NA")
                            {
                                if (lObj.EntityTypeID == entityType.ID)
                                {
                                    match++;
                                }
                            }
                        }
                        else if (lObj.EntityTypeID == "NA")
                        {
                            match++;
                        }

                        if (entitySubType != null)
                        {
                            if (lObj.EntitySubTypeID != "NA")
                            {
                                if (lObj.EntitySubTypeID == entitySubType.ID)
                                {
                                    match++;
                                }
                            }
                        }
                        else if (lObj.EntitySubTypeID == "NA")
                        {
                            match++;
                        }

                        if (modifierOne != null)
                        {
                            if (lObj.ModifierOneID != "NA")
                            {
                                if (lObj.ModifierOneID == modifierOne.ID)
                                {
                                    match++;
                                }
                            }
                        }
                        else if (lObj.ModifierOneID == "NA")
                        {
                            match++;
                        }

                        if (modifierTwo != null)
                        {
                            if (lObj.ModifierTwoID != "NA")
                            {
                                if (lObj.ModifierTwoID == modifierTwo.ID)
                                {
                                    match++;
                                }
                            }
                        }
                        else if (lObj.ModifierTwoID == "NA")
                        {
                            match++;
                        }

                        if (match == 5)
                        {
                            return(lObj);
                        }

                        match = 0;
                    }
                }
            }

            _statusFlag -= 65536;

            return(retObj);
        }
        internal SymbolSetLegacySymbol LegacySymbol(SymbolSet symbolSet,
                                                    SymbolSetEntity entity,
                                                    SymbolSetEntityEntityType entityType,
                                                    EntitySubTypeType entitySubType,
                                                    ModifiersTypeModifier modifierOne,
                                                    ModifiersTypeModifier modifierTwo)
        {
            SymbolSetLegacySymbol retObj = null;

            // Account now for non-null modifiers that are effectively treated like null (00)

            if (modifierOne != null)
            {
                if (modifierOne.ModifierCode.DigitOne == 0 &&
                    modifierOne.ModifierCode.DigitTwo == 0)
                {
                    modifierOne = null;
                }
            }

            if (modifierTwo != null)
            {
                if (modifierTwo.ModifierCode.DigitOne == 0 &&
                    modifierTwo.ModifierCode.DigitTwo == 0)
                {
                    modifierTwo = null;
                }
            }

            // Now build a legacy 15 character SIDC from the 2525D symbol objects

            if (symbolSet != null)
            {
                if (symbolSet.LegacySymbols != null)
                {
                    int match = 0;

                    foreach (SymbolSetLegacySymbol lObj in symbolSet.LegacySymbols)
                    {
                        if (entity != null)
                        {
                            if (lObj.EntityID != "NA")
                            {
                                if (lObj.EntityID == entity.ID)
                                {
                                    match++;
                                }
                            }
                        }
                        else if (lObj.EntityID == "NA")
                        {
                            match++;
                        }

                        if (entityType != null)
                        {
                            if (lObj.EntityTypeID != "NA")
                            {
                                if (lObj.EntityTypeID == entityType.ID)
                                {
                                    match++;
                                }
                            }
                        }
                        else if (lObj.EntityTypeID == "NA")
                        {
                            match++;
                        }

                        if (entitySubType != null)
                        {
                            if (lObj.EntitySubTypeID != "NA")
                            {
                                if (lObj.EntitySubTypeID == entitySubType.ID)
                                {
                                    match++;
                                }
                            }
                        }
                        else if (lObj.EntitySubTypeID == "NA")
                        {
                            match++;
                        }

                        if (modifierOne != null)
                        {
                            if (lObj.ModifierOneID != "NA")
                            {
                                if (lObj.ModifierOneID == modifierOne.ID)
                                {
                                    match++;
                                }
                            }
                        }
                        else if (lObj.ModifierOneID == "NA")
                        {
                            match++;
                        }

                        if (modifierTwo != null)
                        {
                            if (lObj.ModifierTwoID != "NA")
                            {
                                if (lObj.ModifierTwoID == modifierTwo.ID)
                                {
                                    match++;
                                }
                            }
                        }
                        else if (lObj.ModifierTwoID == "NA")
                        {
                            match++;
                        }

                        if (match == 5)
                        {
                            return(lObj);
                        }

                        match = 0;
                    }
                }
            }

            _statusFlag -= 65536;

            return(retObj);
        }