Example #1
0
        /// <summary>
        /// 단밀 장비 정보 데이터 가져오기
        /// </summary>
        /// <param name="ipAddr"></param>
        /// <returns></returns>
        public static DeviceStatusData GetDeviceStatusData(string ipAddr)
        {
            DeviceStatusData deviceStatusData = new DeviceStatusData();

            foreach (DeviceStatusData eachDeviceData in lstDeviceStatusData.LstDeviceStatusData)
            {
                if (eachDeviceData.IpAddr == ipAddr)
                {
                    deviceStatusData = eachDeviceData;
                    break;
                }
            }

            return(deviceStatusData);
        }
Example #2
0
        /// <summary>
        /// 장비 정보 데이터 로드
        /// </summary>
        public static void LoadDeviceStatusDatas()
        {
            try
            {
                if (!File.Exists(filePath))
                {
                    #region 임시 장비정보 파일 생성
                    DeviceStatusData tmp = new DeviceStatusData();
                    tmp.IpAddr = "10.24.1.1";
                    tmp.Name   = "경보대#1";
                    lstDeviceStatusData.LstDeviceStatusData.Add(tmp);

                    tmp        = new DeviceStatusData();
                    tmp.IpAddr = "10.24.1.2";
                    tmp.Name   = "경보대#2";
                    lstDeviceStatusData.LstDeviceStatusData.Add(tmp);

                    tmp        = new DeviceStatusData();
                    tmp.IpAddr = "10.24.1.9";
                    tmp.Name   = "주제어";
                    lstDeviceStatusData.LstDeviceStatusData.Add(tmp);

                    tmp        = new DeviceStatusData();
                    tmp.IpAddr = "10.24.1.222";
                    tmp.Name   = "서해안운영대";
                    lstDeviceStatusData.LstDeviceStatusData.Add(tmp);

                    SaveDeviceStatusDatas();
                    #endregion

                    return;
                }

                using (Stream stream = new FileStream(filePath, FileMode.Open))
                {
                    XmlSerializer serializer = new XmlSerializer(typeof(DeviceStatusDataContainer));
                    lstDeviceStatusData = (DeviceStatusDataContainer)serializer.Deserialize(stream);
                }
            }
            catch (Exception ex)
            {
                NCasLoggingMng.ILoggingException.WriteException("DeviceStatusMng", "DeviceStatusMng.LoadDeviceStatusDatas() Method", ex);
            }
        }
Example #3
0
 /// <summary>
 /// 장비 정보 데이터 클래스 삭제
 /// </summary>
 /// <param name="statusData"></param>
 public static void RemoveDeviceStatusData(DeviceStatusData statusData)
 {
 }
Example #4
0
 /// <summary>
 /// 장비 정보 데이터 클래스 추가
 /// </summary>
 /// <param name="statusData"></param>
 public static void AddDeviceStatusData(DeviceStatusData statusData)
 {
 }