string IEntityExport.Line(SymbolSet ss, SymbolSetEntity e, SymbolSetEntityEntityType eType, SymbolSetEntityEntityTypeEntitySubType eSubType) { string code = Convert.ToString(ss.SymbolSetCode.DigitOne) + Convert.ToString(ss.SymbolSetCode.DigitTwo); code = code + Convert.ToString(e.EntityCode.DigitOne) + Convert.ToString(e.EntityCode.DigitTwo); 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"; } return(BuildEntityItemName(ss, e, eType, eSubType) + "," + code); }
protected string BuildEntityCode(SymbolSet ss, SymbolSetEntity e, SymbolSetEntityEntityType eType, SymbolSetEntityEntityTypeEntitySubType eSubType) { // Constructs a string containing the symbol set and entity codes for a given // set of those objects. string code = Convert.ToString(ss.SymbolSetCode.DigitOne) + Convert.ToString(ss.SymbolSetCode.DigitTwo); code = code + Convert.ToString(e.EntityCode.DigitOne) + Convert.ToString(e.EntityCode.DigitTwo); 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"; } return(code); }
private void _UpdateFromLegacy() { // Search for the appropriate JMSML Library elements, given the older/legacy (2525C, 2525B, etc.) // SIDC for this Symbol. _librarian.ResetStatusCode(); _version = _librarian.Version(1, 0); _affiliation = _librarian.Affiliation(_legacySIDC.Substring(1, 1), _legacySIDC.Substring(2, 1)); if (_affiliation != null) { _context = _librarian.Context(_affiliation.ContextID); _standardIdentity = _librarian.StandardIdentity(_affiliation.StandardIdentityID); } _dimension = _librarian.DimensionByLegacyCode(_legacySIDC.Substring(2, 1)); if (_dimension != null) { _symbolSet = _librarian.SymbolSet(_dimension.ID, _legacySIDC.Substring(4, 6)); } _status = _librarian.Status(_legacySIDC.Substring(3, 1)); _hqTFDummy = _librarian.HQTFDummy(_legacySIDC.Substring(10, 1)); if (_context != null && _affiliation != null) { _contextAmplifier = _librarian.ContextAmplifier(_context, _affiliation.Shape); } _amplifier = _librarian.Amplifier(_legacySIDC.Substring(11, 1)); if (_amplifier != null) { _amplifierGroup = _librarian.AmplifierGroup(_amplifier); } if (_symbolSet != null) { _legacySymbol = _librarian.LegacySymbol(_symbolSet, _legacySIDC.Substring(4, 6), _legacySIDC.Substring(0, 1), _legacySIDC.Substring(2, 1)); } if (_legacySymbol != null) { _entity = _librarian.Entity(_symbolSet, _legacySymbol.EntityID); _entityType = _librarian.EntityType(_entity, _legacySymbol.EntityTypeID); _entitySubType = _librarian.EntitySubType(_entityType, _legacySymbol.EntitySubTypeID); _modifierOne = _librarian.ModifierOne(_symbolSet, _legacySymbol.ModifierOneID); _modifierTwo = _librarian.ModifierTwo(_symbolSet, _legacySymbol.ModifierTwoID); } _librarian.LogConversionResult(_legacySIDC); _ValidateStatus(); }
internal SymbolSetEntityEntityTypeEntitySubType EntitySubType(SymbolSetEntityEntityType entityType, string entitySubTypeID) { SymbolSetEntityEntityTypeEntitySubType retObj = null; if (entityType != null) { if (entityType.EntitySubTypes != null) { foreach (SymbolSetEntityEntityTypeEntitySubType lObj in entityType.EntitySubTypes) { if (lObj.ID == entitySubTypeID) { return(lObj); } } } } _statusFlag -= 8192; return(retObj); }
private void _SetInvalidSymbolProps() { // If a symbol can't be recognized, this method sets up // the current symbol to represent the special Invalid symbol. _version = _librarian.Version(1, 0); _context = _librarian.Context(0); _dimension = _librarian.Dimension("I"); _standardIdentity = _librarian.StandardIdentity(0); _symbolSet = _librarian.SymbolSet(8, 8); _status = _librarian.Status(0); _hqTFDummy = _librarian.HQTFDummy(0); _amplifierGroup = _librarian.AmplifierGroup(0); _amplifier = _librarian.Amplifier(_amplifierGroup, 0); _affiliation = _librarian.Affiliation("REALITY", "INTERNAL", "SI_PENDING"); _contextAmplifier = _librarian.ContextAmplifier(_context, _affiliation.Shape); _entityType = null; _entitySubType = null; _modifierOne = null; _modifierTwo = null; }
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 SymbolSetEntityEntityTypeEntitySubType EntitySubType(SymbolSetEntityEntityType entityType, ushort entitySubTypeCodeOne, ushort entitySubTypeCodeTwo) { SymbolSetEntityEntityTypeEntitySubType retObj = null; if (entityType != null) { if (entityType.EntitySubTypes != null) { foreach (SymbolSetEntityEntityTypeEntitySubType lObj in entityType.EntitySubTypes) { if (lObj.EntitySubTypeCode.DigitOne == entitySubTypeCodeOne && lObj.EntitySubTypeCode.DigitTwo == entitySubTypeCodeTwo) { return(lObj); } } } } _statusFlag -= 8192; return(retObj); }
string IEntityExport.Line(SymbolSet ss, SymbolSetEntity e, SymbolSetEntityEntityType eType, SymbolSetEntityEntityTypeEntitySubType eSubType) { GeometryType geoType = GeometryType.POINT; string result = Convert.ToString(ss.SymbolSetCode.DigitOne) + Convert.ToString(ss.SymbolSetCode.DigitTwo); string code = ""; result = result + ","; result = result + e.Label.Replace(',', '-'); code = code + Convert.ToString(e.EntityCode.DigitOne) + Convert.ToString(e.EntityCode.DigitTwo); geoType = e.GeometryType; result = result + ","; if (eType != null) { result = result + eType.Label.Replace(',', '-'); code = code + Convert.ToString(eType.EntityTypeCode.DigitOne) + Convert.ToString(eType.EntityTypeCode.DigitTwo); geoType = eType.GeometryType; } else { code = code + "00"; } result = result + ","; if (eSubType != null) { result = result + eSubType.Label.Replace(',', '-'); code = code + Convert.ToString(eSubType.EntitySubTypeCode.DigitOne) + Convert.ToString(eSubType.EntitySubTypeCode.DigitTwo); geoType = eSubType.GeometryType; } else { code = code + "00"; } result = result + "," + code + "," + _geometryList[(int)geoType]; return(result); }
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); }
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); }
internal SymbolSetLegacySymbol LegacySymbol(SymbolSet symbolSet, SymbolSetEntity entity, SymbolSetEntityEntityType entityType, SymbolSetEntityEntityTypeEntitySubType 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); }
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))); _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 (_context != null && _affiliation != null) { _contextAmplifier = _librarian.ContextAmplifier(_context, _affiliation.Shape); } 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))); } _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(); }