Пример #1
0
        /// <summary>
        /// [표준경보시스템 종류]
        /// </summary>
        /// <param name="warnKindCode"></param>
        /// <returns></returns>
        public static SASKind FindSASKindByCode(string kindCode)
        {
            System.Diagnostics.Debug.Assert(kindCode != null);

            SASKind result = null;

            if (stdAlertSystemKindInfo == null || stdAlertSystemKindInfo.Values == null)
            {
                return(null);
            }
            foreach (SASKind info in stdAlertSystemKindInfo.Values)
            {
                if (info == null)
                {
                    continue;
                }

                if (info.Code.ToUpper() == kindCode.ToUpper())
                {
                    SASKind copy = new SASKind();
                    copy.DeepCopyFrom(info);
                    return(copy);
                }
            }

            return(result);
        }
Пример #2
0
        /// <summary>
        /// CAP 메시지로부터 시스템 종류 정보를 추출.
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public List <SASKind> ExtractTargetKindsFromCAP(CAP msg)
        {
            System.Diagnostics.Debug.Assert(msg != null);

            if (msg.Scope != CAPLib.ScopeType.Restricted)
            {
                return(null);
            }
            if (string.IsNullOrEmpty(msg.Restriction))
            {
                return(null);
            }

            string[] stringSeperators = new string[] { "," };
            string[] dividedArray     = msg.Restriction.Split(stringSeperators, StringSplitOptions.RemoveEmptyEntries);
            if (dividedArray == null || dividedArray.Count() <= 0)
            {
                return(null);
            }

            List <SASKind> targets = new List <SASKind>();

            foreach (string systemKindCode in dividedArray)
            {
                SASKind kindInfo = BasisData.FindSASKindByCode(systemKindCode);
                if (kindInfo != null)
                {
                    targets.Add(kindInfo);
                }
            }

            return(targets);
        }
Пример #3
0
 public void DeepCopyFrom(SASKind src)
 {
     if (src == null)
     {
         return;
     }
     this.code = src.code;
     this.name = src.name;
 }