예제 #1
0
        private void _ValidateStatus()
        {
            // Validates the legacy translation of this Symbol.  If there
            // are issues with the conversion then those issues are logged externally.

            string s = Convert.ToString(0 - _librarian.StatusCode, 2);

            char[] bits = s.PadLeft(17, '0').ToCharArray();

            Array.Reverse(bits);

            if (bits[(int)StatusCodeEnum.statusCodeNoLegacySymbol] == '0' && bits[(int)StatusCodeEnum.statusCodeNoEntity] == '1')
            {
                // Retired symbol.  Everything was found, including a LegacySymbol
                // but there was no Entity found for that symbol.
                // Confirm retirement with Remarks check.
                if (_legacySymbol.Remarks == "Retired")
                {
                    //_SetInvalidSymbolProps();
                    _entity     = _librarian.Entity(_symbolSet, 1, 1);
                    _symbolStat = SymbolStatusEnum.statusEnumRetired;
                }
                else
                {
                    // Remarks double check is missing
                    logger.Warn("Symbol retirement in question - check XML instance data");
                    _symbolStat = SymbolStatusEnum.statusEnumInvalid;
                }
            }
            else
            {
                if (bits[(int)StatusCodeEnum.statusCodeNoVersion] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoContext] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoDimension] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoStandardIdentity] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoSymbolSet] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoStatus] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoHQTFDummy] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoAmplifierGroup] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoAmplifier] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoAffiliation] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoContextAmplifier] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoEntity] == '1')
                {
                    _symbolStat = SymbolStatusEnum.statusEnumInvalid;
                }
                else
                {
                    if (_legacySymbol != null)
                    {
                        _symbolStat = SymbolStatusEnum.statusEnumOld;
                    }
                    else
                    {
                        _symbolStat = SymbolStatusEnum.statusEnumNew;
                    }
                }
            }
        }
        private void _ValidateStatus()
        {
            // Validates the legacy translation of this Symbol.  If there
            // are issues with the conversion then those issues are logged externally.

            string s = Convert.ToString(0 - _librarian.StatusCode, 2);
            char[] bits = s.PadLeft(17, '0').ToCharArray();

            Array.Reverse(bits);

            if (bits[(int)StatusCodeEnum.statusCodeNoLegacySymbol] == '0' && bits[(int)StatusCodeEnum.statusCodeNoEntity] == '1')
            {
                // Retired symbol.  Everything was found, including a LegacySymbol
                // but there was no Entity found for that symbol.
                // Confirm retirement with Remarks check.
                if (_legacySymbol.Remarks == "Retired")
                {
                    _SetInvalidSymbolProps();
                    _symbolStat = SymbolStatusEnum.statusEnumRetired;
                }
                else
                {
                    // Remarks double check is missing
                    logger.Warn("Symbol retirement in question - check XML instance data");
                    _symbolStat = SymbolStatusEnum.statusEnumInvalid;
                }
            }
            else
            {
                if (bits[(int)StatusCodeEnum.statusCodeNoVersion] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoContext] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoDimension] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoStandardIdentity] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoSymbolSet] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoStatus] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoHQTFDummy] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoAmplifierGroup] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoAmplifier] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoAffiliation] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoContextAmplifier] == '1' ||
                    bits[(int)StatusCodeEnum.statusCodeNoEntity] == '1')
                {
                    _symbolStat = SymbolStatusEnum.statusEnumInvalid;
                }
                else
                {
                    if(_legacySymbol != null)
                    {
                        _symbolStat = SymbolStatusEnum.statusEnumOld;
                    }
                    else
                    {
                        _symbolStat = SymbolStatusEnum.statusEnumNew;
                    }
                }
            }
        }