private string _buildSIDCKey(SymbolSet ss, SymbolSetLegacySymbol legacySymbol)
        {
            // Builds a unique key from a select number of characters from an SIDC.
            // The pattern for this is:
            //
            // S-D-FFFFFF
            //
            // Where:
            //
            // S = Schema code
            // D = Dimension code
            // FFFFFF = Function code

            string result = "";

            LegacyFunctionCodeType functionCode = _configHelper.LegacyFunction(legacySymbol.LegacyFunctionCode, _standard);

            if (functionCode != null)
            {
                if (functionCode.SchemaOverride == "")
                {
                    LegacyLetterCodeType letterCode = _configHelper.LegacyLetter(ss.LegacyCodingSchemeCode, _standard);
                    if (letterCode != null)
                    {
                        result = letterCode.Value;
                    }
                }
                else
                {
                    result = functionCode.SchemaOverride;
                }

                result = result + "-";

                Librarian        lib       = _configHelper.Librarian;
                LibraryDimension dimension = lib.Dimension(ss.DimensionID);

                if (functionCode.DimensionOverride == "")
                {
                    LegacyLetterCodeType letterCode = _configHelper.LegacyLetter(dimension.LegacyDimensionCode, _standard);
                    if (letterCode != null)
                    {
                        result = result + letterCode.Value;
                    }
                }
                else
                {
                    result = result + functionCode.DimensionOverride;
                }

                result = result + "-";
                result = result + functionCode.Value;
            }

            return(result);
        }
        private int _exportFrames(StreamWriter w, bool isFirst, string standard, int id)
        {
            IFrameExport frameEx = new LegacyFrameExport(_helper, standard);

            if (isFirst)
            {
                string headers = frameEx.Headers;
                headers = "id," + headers;

                w.WriteLine(headers);
                w.Flush();
            }

            foreach (LibraryAffiliation affiliation in _lib.Library.Affiliations)
            {
                if (affiliation.LegacyFrames != null)
                {
                    LegacyFrameExport fe = (LegacyFrameExport)frameEx;
                    fe.Affiliation = affiliation;

                    foreach (LegacyLetterCodeType legacyFrame in affiliation.LegacyFrames)
                    {
                        if (legacyFrame.Name == standard && legacyFrame.Function == "")
                        {
                            fe.LegacyFrame = legacyFrame;

                            LibraryContext          context   = _lib.Context(affiliation.ContextID);
                            LibraryStandardIdentity identity  = _lib.StandardIdentity(affiliation.StandardIdentityID);
                            LibraryDimension        dimension = _lib.Dimension(affiliation.DimensionID);

                            string line = id.ToString() + "," + frameEx.Line(_lib, context, identity, dimension, _lib.Status(0), false, false);
                            id++;

                            w.WriteLine(line);
                            w.Flush();

                            if (legacyFrame.IsPlanned)
                            {
                                LibraryStatus status = _lib.Status(1);
                                status.LabelAlias = "Planned";
                                line = id.ToString() + "," + frameEx.Line(_lib, context, identity, dimension, status, false, false);
                                status.LabelAlias = "";
                                id++;

                                w.WriteLine(line);
                                w.Flush();
                            }
                        }
                    }
                }
            }

            return(id);
        }
예제 #3
0
        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("INTERNAL");
            _standardIdentity = _librarian.StandardIdentity(1);
            _symbolSet        = _librarian.SymbolSet(9, 8);
            _status           = _librarian.Status(0);
            _hqTFDummy        = _librarian.HQTFDummy(0);
            _amplifierGroup   = _librarian.AmplifierGroup(0);
            _amplifier        = _librarian.Amplifier(_amplifierGroup, 0);
            _affiliation      = _librarian.Affiliation("REALITY", "INTERNAL", "SI_UNKNOWN");
            _entity           = _librarian.Entity(_symbolSet, "INVALID");
            _entityType       = null;
            _entitySubType    = null;
            _modifierOne      = null;
            _modifierTwo      = null;
        }