Exemplo n.º 1
0
        /// <summary>
        /// 특보 데이터 처리
        /// </summary>
        /// <param name="baseCmd"></param>
        /// <param name="autoFlag"></param>
        /// <param name="waitTime"></param>
        /// <param name="areaCode"></param>
        /// <param name="mainForm"></param>
        public void SetAutoAlarmFormWeather(NCasTwcProtocolCmd1 cmd1, bool autoFlag, int waitTime, string areaCode, MainForm mainForm)
        {
            this.cmd1              = cmd1;
            this.autoFlag          = autoFlag;
            this.waitTime          = waitTime * 60;
            this.areaCode          = areaCode;
            this.mainForm          = mainForm;
            this.isWeather         = true;
            this.commonLabel1.Text = this.GetWeatherKindName(cmd1);
            this.commonLabel2.Text = cmd1.StartTimeByDateTime.ToString();
            this.commonLabel3.Text = this.GetWeatherAreaName(cmd1);
            this.commonLabel4.Text = this.GetWeatherTermName(areaCode);
            this.commonLabel5.Text = string.Format("{0} ({1})", this.mainForm.GetWeatherKindData(cmd1).StoMsg.Title,
                                                   this.mainForm.GetWeatherKindData(cmd1).StoMsg.MsgNum);

            if (autoFlag)
            {
                this.oklBtn_Click(this, new EventArgs());
            }
            else
            {
                this.timer          = new Timer();
                this.timer.Interval = 1000;
                this.timer.Tick    += new EventHandler(timer_Tick);
                this.timer.Start();
            }
        }
Exemplo n.º 2
0
        private string GetWeatherKindName(NCasTwcProtocolCmd1 weatherProto)
        {
            string tmpLog = string.Empty;

            if (weatherProto.SpcKind == NCasDefineSpcKind.StrongWind)
            {
                tmpLog += "강풍";
            }
            else if (weatherProto.SpcKind == NCasDefineSpcKind.HeavyRain)
            {
                tmpLog += "호우";
            }
            else if (weatherProto.SpcKind == NCasDefineSpcKind.ColdWave)
            {
                tmpLog += "한파";
            }
            else if (weatherProto.SpcKind == NCasDefineSpcKind.Dry)
            {
                tmpLog += "건조";
            }
            else if (weatherProto.SpcKind == NCasDefineSpcKind.Tsunami)
            {
                tmpLog += "해일";
            }
            else if (weatherProto.SpcKind == NCasDefineSpcKind.HighSeas)
            {
                tmpLog += "풍랑";
            }
            else if (weatherProto.SpcKind == NCasDefineSpcKind.Typhoon)
            {
                tmpLog += "태풍";
            }
            else if (weatherProto.SpcKind == NCasDefineSpcKind.HeavySnow)
            {
                tmpLog += "대설";
            }
            else if (weatherProto.SpcKind == NCasDefineSpcKind.YellowDust)
            {
                tmpLog += "황사";
            }

            if (weatherProto.SpcStress == NCasDefineSpcStress.Watch)
            {
                tmpLog += " 주의보";
            }
            else if (weatherProto.SpcStress == NCasDefineSpcStress.Warning)
            {
                tmpLog += " 경보";
            }

            return(tmpLog);
        }
Exemplo n.º 3
0
        private string GetWeatherAreaName(NCasTwcProtocolCmd1 weatherProto)
        {
            string tmpLog = string.Empty;

            for (int i = 0; i < weatherProto.LstAreaName.Count; i++)
            {
                tmpLog += weatherProto.LstAreaName[i];

                if (i != weatherProto.LstAreaName.Count - 1)
                {
                    tmpLog += "/";
                }
            }

            return(tmpLog);
        }