private void OnWMessageUpdateMainTD(WMessage _wmsg)
        {
            Thread mainTD = new Thread(new ParameterizedThreadStart(this.OnWMessageUpdate));

            mainTD.IsBackground = true;
            mainTD.Start((object)_wmsg);
        }
        private void OnWMessageUpdateTD(object _wmsg)
        {
            WMessage wmessage = (WMessage)_wmsg;

            this.secession.TcpSendWmsg(wmessage);
            this.PrintSendMsg("편성으로 전송 직후 현재시각 - " + DateTime.Now);
        }
Exemple #3
0
        /// <summary>
        /// WMessage 만든다.
        /// </summary>
        /// <param name="controlflag">
        /// 제어명령이면 1, 일반 메시지면 0
        /// </param>
        /// <param name="tkpriority">
        /// 재난 우선순위 ID
        /// </param>
        /// <param name="tkdisaster">
        /// 재난 코드 ID
        /// </param>
        /// <param name="tkregion">
        /// 재난 지역 지정 코드
        /// </param>
        /// <param name="rcount">
        /// 재난 지역의 수
        /// </param>
        /// <param name="message">
        /// 메시지
        /// </param>
        /// <param name="fkuser">
        /// 발령한 사용자
        /// </param>
        /// <param name="processing">
        /// 현재 진행 상태(진행 중 : 1, 종료 상황 : 0)
        /// </param>
        /// <param name="ttsmsg">
        /// TTS용 메시지
        /// </param>
        /// <param name="smsmsg">
        /// SMS용 메시지
        /// </param>
        public void MakeWMSG(bool controlflag, uint tkpriority, uint tkdisaster, uint tkregion, uint rcount, string message, uint fkuser,
                             bool processing, string ttsmsg, string smsmsg, DateTime datetime, uint id, List <mapMessageRegion> mapmessageregion)
        {
            try
            {
                wmsg = new WMessage();

                wmsg.BoolControl    = controlflag;
                wmsg.TkPriority     = tkpriority;
                wmsg.TkDisaster     = tkdisaster;
                wmsg.TkRegion       = tkregion;
                wmsg.RCount         = rcount;
                wmsg.Message        = message;
                wmsg.FkUser         = fkuser;
                wmsg.BoolProcessing = processing;
                wmsg.TTSMsg         = ttsmsg;
                wmsg.SMSMsg         = smsmsg;
                wmsg.DDateTime      = datetime;
                wmsg.ID             = id;
                wmsg.MapTarget      = mapmessageregion;
            }
            catch (Exception ex)
            {
                Console.WriteLine("MakeWMSG - " + ex.Message);
            }
        }
Exemple #4
0
        /// <summary>
        /// 발령 메시지가 종료되면 호출하는 메소드
        /// </summary>
        /// <param name="wmsg"></param>
        /// <returns></returns>
        public bool setWmessageFinish(WMessage wmsg, uint _broad)
        {
            try
            {
                bool b = false;

                if (sfConnection != null)
                {
                    b = this.sfConnection.remoteobject.setWMessageFinish(wmsg, _broad);

                    //if (b)
                    //{
                    //    lock (this.searchWMessageList)
                    //    {
                    //        this.searchWMessageList.Remove(wmsg);
                    //    }
                    //}
                }

                return(b);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Datamanager.setWmessageFinish : {0}", ex.Message);

                return(false);
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            this.controlset  = new ControlSet();
            this.datamanager = DataManager.getInstance();
            this.serialMng   = SerialMng.getInstance();
            this.InitCtrl();
            this.tmpwmsgList   = new List <WMessage>();
            this.wmsglistclone = new List <WMessage>();
            this.recvmng       = RecvMng.getInstance();
            this.tempWmsg      = new WMessage();
            this.orderlistset  = new OrderListSet();
            this.secession     = new Secession();
            this.eventLogMng   = new EventLogMng();
            this.logMng        = new LogManager();

            this.serialMng.onSerialRecv          += new SerialMng.DelegateSerialRecv(serialMng_onSerialRecv);
            this.datamanager.OnDSUseWMessageList += new DataManager.DelegateDSUseWMessageList(datamanager_OnDSUseWMessageList);

            this.datamanager.onWMessageUpdate   += new DataManager.DelegateWMessageUpdate(datamanager_onWMessageUpdate);     //이벤트 방식으로 변경
            this.datamanager.onWMessageFinished += new DataManager.DelegateWMessageFinished(datamanager_onWMessageFinished); //이벤트 방식으로 변경

            this.recvmng.MsgSuccessEvent    += new RecvMng.MsgSuccessEventHandle(recvmng_MsgSuccessEvent);
            this.recvmng.MsgSpcSuccessEvent += new RecvMng.MsgSpcSuccessEventHandle(recvmng_MsgSpcSuccessEvent);
            this.recvmng.SpcFinishedEvent   += new RecvMng.SpcFinishedEventHandle(recvmng_SpcFinishedEvent);
            this.recvmng.NorFinishedEvent   += new RecvMng.NorFinishedEventHandle(recvmng_NorFinishedEvent);
            this.recvmng.SpcMuxRcEvent      += new RecvMng.SpcMuxRcEventHandle(recvmng_SpcMuxRcEvent);
            this.recvmng.NorMuxRcEvent      += new RecvMng.NorMuxRcEventHandle(recvmng_NorMuxRcEvent);
            string tmpBroad = this.datamanager.getBroadName((uint)Properties.Settings.Default.cnfBroad);

            base.OnLoad(e);
        }
Exemple #6
0
 /// <summary>
 /// 강제 종료 후에 성공적이면 종류에 따라 - 시킴
 /// </summary>
 /// <param name="wm"></param>
 public void SetInglistNum(WMessage wm)
 {
     if (inglist[inglist.IndexOf(wm)].SOPT_TTS == true && inglist[inglist.IndexOf(wm)].SOPT_DMB == false)
     {
         inglistNum--;
     }
     else
     {
         inglistNum -= 2;
     }
 }
Exemple #7
0
        /// <summary>
        /// 관제/제어 발령 요청 실행
        /// </summary>
        public bool Processing(string title)
        {
            try
            {
                WMessage tempmsg = new WMessage();
                bool     tempdc;
                bool     state = false;

                //if (Properties.Settings.Default.totalityFlag == false)
                //{
                //    WaitBarMng.Start();
                //    WaitBarMng.Msg = "데이터 전송중 입니다...";
                //    System.Threading.Thread.Sleep(500);
                //}

                wmsg.MapTarget = this.mapmsgrgList;
                tempmsg        = controldatamng.sendWMessage(this.wmsg);

                if (tempmsg.ID != (uint)0)
                {
                    if (Properties.Settings.Default.totalityFlag == false)
                    {
                        //WaitBarMng.Close();
                        MessageBox.Show(title + " 요청을 성공하였습니다.", title, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    state = true;
                }
                else
                {
                    if (Properties.Settings.Default.totalityFlag == false)
                    {
                        //WaitBarMng.Close();
                        MessageBox.Show(title + " 요청을 실패하였습니다.", title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    state = false;
                }

                wmsg   = null;
                tempdc = false;
                mapmsgrgList.Clear();
                controldatamng.DeviceControlList.Clear();

                return(state);
            }
            catch (Exception ex)
            {
                WaitBarMng.Close();
                MessageBox.Show(title + " 요청을 실패하였습니다.", title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                Console.WriteLine("Processing - " + ex.Message);
                return(false);
            }
        }
Exemple #8
0
        /// <summary>
        /// 발령메시지의 Sendflag를 받아 1과 2로 구분한다.
        /// </summary>
        /// <param name="wm"></param>
        /// <remarks>
        /// 1은 TTS와 TTS/SMS, 나머지는 2를 반환한다.
        /// </remarks>
        /// <returns></returns>
        public int SendFlagNum(WMessage wm)
        {
            int sendflagNum = 0;

            if ((wm.SOPT_TTS == true) && (wm.SOPT_DMB == false))
            {
                sendflagNum = 1;
            }
            else
            {
                sendflagNum = 2;
            }

            return(sendflagNum);
        }
Exemple #9
0
        /// <summary>
        /// 관제/제어 발령 요청 실행
        /// </summary>
        public bool Processing(string title)
        {
            try
            {
                WMessage tempmsg = new WMessage();
                bool     state   = false;

                tempmsg = controldatamng.sendWMessage(this.wmsg);

                if (tempmsg == null)
                {
                    MessageBox.Show(title + " 요청을 실패하였습니다.", title, MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    return(false);
                }

                WaitBarMng.Start();
                WaitBarMng.Msg = "데이터 전송중 입니다...";
                System.Threading.Thread.Sleep(1000);

                if (tempmsg.ID != (uint)0)
                {
                    WaitBarMng.Close();
                    MessageBox.Show(title + " 요청을 성공하였습니다.", title, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    state = true;
                }
                else
                {
                    WaitBarMng.Close();
                    MessageBox.Show(title + " 요청을 실패하였습니다.", title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    state = false;
                }

                wmsg = null;

                return(state);
            }
            catch (Exception ex)
            {
                WaitBarMng.Close();
                MessageBox.Show(title + " 요청을 실패하였습니다.", title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                Console.WriteLine("Processing - " + ex.Message);
                return(false);
            }
        }
Exemple #10
0
 void recvmng_MsgSuccessEvent(WMessage _wmsg)
 {
     try
     {
         if (this.DmbIssuesLV.InvokeRequired)
         {
             this.Invoke(new InvokeWmsgsuccess(OnMsgSuccessEvent), new object[] { _wmsg });
         }
         else
         {
             this.OnMsgSuccessEvent(_wmsg);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("recvmng_MsgSuccessEvent : {0}", ex.Message);
     }
 }
Exemple #11
0
 void recvmng_SpcFinishedEvent(WMessage _wmsg)
 {
     try
     {
         if (this.DmbIssuesLV.InvokeRequired)
         {
             this.Invoke(new InvokeSpcWmsgFinish(this.OnSpcWmsgFinish), new object[] { _wmsg });
         }
         else
         {
             this.OnSpcWmsgFinish(_wmsg);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("MainViewForm.recvmng_SpcFinishedEvent" + ex.Message);
     }
 }
Exemple #12
0
        private void ProcessingUpdate(WMessage wmsg)
        {
            try
            {
                this.logMng.File_Mng(string.Format("ID - {0}, 발령시간 - {1}, 받은시간 - {2}, 편성이 송신한 종료 데이터 수신 후"
                                                   , wmsg.ID, wmsg.DDateTime, DateTime.Now));

                bool processingResult = false;

                string tmpBroad = this.datamanager.getBroadName((uint)Properties.Settings.Default.cnfBroad);

                //============박찬호 수정 - 2013/11/19========================================
                if (tmpBroad == "<KBS>" || tmpBroad == "<MBC>" || tmpBroad == "<SBS>" || tmpBroad == "<YTN>")
                //============================================================================
                {
                    if (wmsg.SendPart == wmsg.EndpointPart)
                    {
                        processingResult = datamanager.setWmessageFinish(wmsg, (uint)Properties.Settings.Default.cnfBroad);
                        //this.datamanager.BroadWmsgList.Remove(wmsg);
                        //this.tempWmsg = wmsg;

                        this.logMng.File_Mng(string.Format("ID - {0}, 발령시간 - {1}, 받은시간 - {2}, SF의 setWMessageFinish() 호출 후"
                                                           , wmsg.ID, wmsg.DDateTime, DateTime.Now));
                    }
                    else
                    {
                        return;
                    }
                }

                if (processingResult == false)
                {
                    tempWmsg = null;
                    Console.WriteLine("wmsg.SendPart와 wmsg.EndpointPart 같지 않거나 datamanager.setWmessageFinish가 False 리턴");
                    this.DmbIssuesLV.Items[wmsg.ID.ToString()].SubItems[6].Text = "종료실패";
                    return;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("MainViewForm.ProcessingUpdate - " + ex.Message);
            }
        }
Exemple #13
0
        /// <summary>
        /// 발령 리스트로 부터 해당 ID 의 Index를 반환한다.
        /// </summary>
        /// <param name="_id"></param>
        /// <returns></returns>
        public int getWMessageIndex(uint _id)
        {
            try
            {
                WMessage           srcComp = new WMessage();
                WMessageIDComparer tarComp = new WMessageIDComparer();
                srcComp.ID = _id;
                this.wMessageList.Sort(tarComp);

                int idx = this.wMessageList.BinarySearch(srcComp, tarComp);

                return(idx);
            }
            catch (Exception e)
            {
                Console.WriteLine("getWMessageIndex : {0}", e.Message);
                return(-1);
            }
        }
Exemple #14
0
 /// <summary>
 /// 새로 들어온 발령메시지를 발령리스트 리스트에 넣는다.
 /// </summary>
 /// <param name="wm"></param>
 /// <returns></returns>
 public void InsertWMsg(WMessage wm)
 {
     if ((wm.SOPT_TTS == true) && (wm.SOPT_DMB == false))
     {
         lock (inglist)
         {
             inglist.Add(wm);
         }
         inglistNum++;
     }
     else
     {
         lock (inglist)
         {
             inglist.Add(wm);
         }
         inglistNum += 2;
     }
 }
Exemple #15
0
        /// <summary>
        /// 재난경보 메시지를 송출에서 EWS로 송신한 후 전송 결과를 알려주는 메소드(특수수신기에만 유효)
        /// </summary>
        /// <param name="wmsg"></param>
        /// <returns></returns>
        public bool setWmessageSendID(WMessage wmsg, int sendid)
        {
            try
            {
                if (sfConnection != null)
                {
                    bool b = this.sfConnection.remoteobject.setWMessageSendID(wmsg, sendid);

                    return(b);
                }

                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Datamanager.setWmessageSendID : {0}", ex.Message);

                return(false);
            }
        }
Exemple #16
0
        /// <summary>
        /// WMessage 만든다.
        /// </summary>
        /// <param name="controlflag">
        /// 제어명령이면 1, 일반 메시지면 0
        /// </param>
        /// <param name="tkpriority">
        /// 재난 우선순위 ID
        /// </param>
        /// <param name="tkdisaster">
        /// 재난 코드 ID
        /// </param>
        /// <param name="tkregion">
        /// 재난 지역 지정 코드
        /// </param>
        /// <param name="rcount">
        /// 재난 지역의 수
        /// </param>
        /// <param name="message">
        /// 메시지
        /// </param>
        /// <param name="fkuser">
        /// 발령한 사용자
        /// </param>
        /// <param name="processing">
        /// 현재 진행 상태(진행 중 : 1, 종료 상황 : 0)
        /// </param>
        /// <param name="ttsmsg">
        /// TTS용 메시지
        /// </param>
        /// <param name="smsmsg">
        /// SMS용 메시지
        /// </param>
        public void MakeWMSG(bool controlflag, uint tkpriority, uint tkdisaster, uint tkregion, uint rcount, string message, uint fkuser,
                             bool processing, string ttsmsg, string smsmsg, bool dmb, bool tts, bool sms)
        {
            wmsg = new WMessage();

            wmsg.BoolControl    = controlflag;
            wmsg.TkPriority     = tkpriority;
            wmsg.TkDisaster     = tkdisaster;
            wmsg.TkRegion       = tkregion;
            wmsg.RCount         = rcount;
            wmsg.Message        = message;
            wmsg.FkUser         = fkuser;
            wmsg.BoolProcessing = processing;
            wmsg.TTSMsg         = ttsmsg;
            wmsg.SMSMsg         = smsmsg;
            wmsg.DDateTime      = DateTime.Now;
            wmsg.SendID         = 0; //송출까지 전송은 0으로, 후에 송출에서 조합하여 EWS로 전송함.
            wmsg.SOPT_DMB       = dmb;
            wmsg.SOPT_TTS       = tts;
            wmsg.SOPT_SMS       = sms;
        }
Exemple #17
0
        /// <summary>
        /// 이벤트 방식으로 발령메시지 업데이트 (이거야)
        /// </summary>
        /// <param name="_wMessage"></param>
        public void datamanager_onWMessageUpdate(WMessage wMessage)
        {
            this.PrintSendMsg("발령시각 - " + wMessage.DDateTime.ToString() + "\r\n이벤트 들어온 직후 현재시각 - " + DateTime.Now);

            try
            {
                WMessage _wMessage = wMessage;

                if (this.DmbIssuesLV.InvokeRequired)
                {
                    this.Invoke(new InvokeWmsgReceeied(this.OnWMessageUpdate), new object[] { _wMessage });
                }
                else
                {
                    this.OnWMessageUpdate(_wMessage);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("MainViewForm.datamanager_onWMessageUpdate - " + ex.Message);
            }
        }
Exemple #18
0
        private void OnMsgSuccessEvent(WMessage wmessage)
        {
            string userName = "******";

            eventLogMng.WriteLog("DMB_DS", EventLogEntryType.Information, "재난메시지 ID - " + wmessage.ID.ToString() + "파싱성공", userName);

            if (wmessage.SOPT_DMB != wmessage.SOPT_DMB_COMMIT)
            {
                if ((wmessage.SendPart == wmessage.CommitPart) && (wmessage.SOPT_SMS == wmessage.SOPT_SMS_COMMIT))
                {
                    this.DmbIssuesLV.Items[wmessage.ID.ToString()].SubItems[6].Text = "방송사(EWS)";

                    if (this.DmbIssuesLV.SelectedItems.Count > 0)
                    {
                        for (int j = 0; j < this.DmbIssuesLV.Items.Count; j++)
                        {
                            for (int i = 0; i < this.DmbIssuesLV.SelectedItems.Count; i++)
                            {
                                string key = this.DmbIssuesLV.SelectedItems[i].Name;

                                if (this.DmbIssuesLV.Items[key].Selected == true)
                                {
                                    this.DmbIssuesLV.Items[key].Selected = false;
                                }
                                if (this.DmbIssuesLV.Items[key].Focused == true)
                                {
                                    this.DmbIssuesLV.Items[key].Focused = false;
                                }
                            }
                        }
                    }

                    this.DmbIssuesLV.Items[wmessage.ID.ToString()].Selected = true;
                    this.DmbIssuesLV.Items[wmessage.ID.ToString()].Focused  = true;
                    this.DmbIssuesLV.Items[wmessage.ID.ToString()].EnsureVisible();
                    this.SetStatusLB();
                }
            }
        }
Exemple #19
0
        /// <summary>
        /// 이벤트 방식으로 발령메시지 종료(KBS만 해당)
        /// </summary>
        /// <param name="_wmsg"></param>
        private void datamanager_onWMessageFinished(WMessage _wmsg)
        {
            string tmpBroad = this.datamanager.getBroadName((uint)Properties.Settings.Default.cnfBroad);

            try
            {
                if (tmpBroad == "<KBS>" || tmpBroad == "<MBC>" || tmpBroad == "<SBS>" || tmpBroad == "<YTN>")
                {
                    if (this.DmbIssuesLV.InvokeRequired)
                    {
                        this.Invoke(new InvokeDMBFinishedList(this.WmsgFinished), new object[] { _wmsg });
                    }
                    else
                    {
                        this.WmsgFinished(_wmsg);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("MainViewForm.datamanager_onWMessageFinished - " + ex.Message);
            }
        }
Exemple #20
0
        /// <summary>
        /// 발령 정보를 서비스 프레임워크로 전송하고, ID 를 가지는 발령 정보를 업데이트 한다.
        /// </summary>
        /// <param name="_wMessage">발령정보 클래스</param>
        /// <returns>ID 가 포함된 발령 데이터</returns>
        public WMessage sendWMessage(WMessage _wMessage)
        {
            WMessage item = new WMessage();

            try
            {
                if (sfConnection != null)
                {
                    item = this.sfConnection.remoteobject.setwMessage(_wMessage);

                    lock (searchWMessageList)
                    {
                        this.searchWMessageList.Add(item);
                    }
                }
            }
            catch (Exception err)
            {
                Console.WriteLine("Datamanager.sendWMessage : {0}", err.Message);
            }

            return(item);
        }
Exemple #21
0
        private void BtnSaveClick(object sender, RoutedEventArgs e)
        {
            RepositoryClientInfo.Sync();
            if (ClientInfoControl.Validate())
            {
                if (_info == null)
                {
                    RepositoryClientInfo.Add(ClientInfoControl.GetClientInfo(_card, _info));
                }
                else
                {
                    RepositoryClientInfo.Update(ClientInfoControl.GetClientInfo(_card, _info));
                }

                RepositoryDiscountCard.Update(ClientInfoControl.GetDiscountCard(_card));

                Close();

                var messageWindow = new WMessage(Properties.Resources.BtnOk, Properties.Resources.LabelOperationComplete,
                                                 Properties.Resources.BtnOk);
                messageWindow.ShowDialog();
            }
        }
Exemple #22
0
        private void WmsgFinished(WMessage wmsg)
        {
            try
            {
                string tmpBroad = this.datamanager.getBroadName((uint)Properties.Settings.Default.cnfBroad);

                //============박찬호 수정 - 2013/11/19========================================
                if (tmpBroad == "<KBS>" || tmpBroad == "<MBC>" || tmpBroad == "<SBS>" || tmpBroad == "<YTN>")
                //============================================================================
                {
                    WMessage           tmpwmsg     = new WMessage();
                    WMessageIDComparer tmpcomparer = new WMessageIDComparer();
                    tmpwmsg.ID = wmsg.ID;
                    this.datamanager.BroadWmsgList.Sort(tmpcomparer);
                    WMessage w = this.datamanager.BroadWmsgList[this.datamanager.BroadWmsgList.BinarySearch(tmpwmsg, tmpcomparer)];

                    this.datamanager.BroadWmsgList.Remove(wmsg);
                }

                this.DmbIssuesLV.Items.RemoveByKey(wmsg.ID.ToString());
                this.controlset.SetListViewIndex(this.DmbIssuesLV);

                this.MainNotifyEffect.Stop();
                this.MainNotifyEffect.DeleteAllMsg();
                string tmpfact = string.Empty;
                tmpfact = (wmsg.SendMode == (byte)0) ? "시험" : (wmsg.SendMode == (byte)1) ? "훈련" : "실제";
                DateTime dt = DateTime.Now;
                this.notifyeffectstr        = "최근 " + dt.ToString("yyyy-MM-dd HH:mm:ss") + " 에 " + tmpfact + " 발령 종료되었습니다.";
                this.MainNotifyEffect.Blink = true;
                this.MainNotifyEffect.AddMsg(this.notifyeffectstr, Properties.Resources.megaphone_48x48_);
                this.MainNotifyEffect.Start();
            }
            catch (Exception ex)
            {
                Console.WriteLine("MainViewForm.WmsgFinished - " + ex.Message);
            }
        }
Exemple #23
0
        /// <summary>
        /// 이거야
        /// </summary>
        /// <param name="_wmessage"></param>
        private void OnWMessageUpdate(object _wmessage)
        {
            try
            {
                WMessage wmessage = (WMessage)_wmessage;

                this.PrintSendMsg("OnWMessageUpdate 메소드 들어온 직후 현재시각 - " + DateTime.Now);

                for (int i = 0; i < wmessage.BCenterList.Count; i++)
                {
                    if (wmessage.BCenterList[i].StageID != (uint)Properties.Settings.Default.cnfBroad)
                    {
                        continue;
                    }

                    if (wmessage.SendPart != WMessage.E_sendPart.SMS)
                    {
                        SocketClient soc = SocketClient.getInstance();

                        this.orderlistset.PkidIndex = this.DmbIssuesLV.Items.Count;
                        this.DmbIssuesLV.Items.Add(this.orderlistset.setWmsgCollection(wmessage));
                        this.orderlistset.PkidIndex = 0;
                        this.PrintSendMsg("리스트뷰에 추가 직후 현재시각 - " + DateTime.Now);

                        if (soc.ConState == true)
                        {
                            this.PrintSendMsg("편성으로 전송 직전 현재시각 - " + DateTime.Now);

                            Thread OnWMessageUpdateThread = new Thread(new ParameterizedThreadStart(OnWMessageUpdateTD));
                            OnWMessageUpdateThread.IsBackground = true;
                            OnWMessageUpdateThread.Start((object)wmessage);

                            //this.secession.TcpSendWmsg(wmessage);
                            //string userName = datamanager.GetUserName(Properties.Settings.Default.cnfUserId);
                            //eventLogMng.WriteLog("DMB_DS", EventLogEntryType.Information, wmessage.ID.ToString() + " 방송사 있는 재난메시지 발령 후", userName);
                            this.logMng.File_Mng(string.Format("ID - {0}, 발령시간 - {1}, 받은시간 - {2}, TCP연결상태 이므로 편성으로 전송하고 바로 직후(발령)"
                                                               , wmessage.ID, wmessage.DDateTime, DateTime.Now));
                        }
                        else
                        {
                            //string userName = datamanager.GetUserName(Properties.Settings.Default.cnfUserId);
                            //eventLogMng.WriteLog("DMB_DS", EventLogEntryType.Information, wmessage.ID.ToString() + " 방송사 있는 재난메시지 편성 연결되어 있지 않아 미전송", userName);
                            this.logMng.File_Mng(string.Format("ID - {0}, 발령시간 - {1}, 받은시간 - {2}, 방송사 있는 재난메시지 편성 연결되어 있지 않아 미전송"
                                                               , wmessage.ID, wmessage.DDateTime, DateTime.Now));
                        }

                        if (wmessage != null)
                        {
                            this.DmbIssuesLV.Items[wmessage.ID.ToString()].SubItems[6].Text = "방송사";
                        }

                        this.MainNotifyEffect.Stop();
                        this.MainNotifyEffect.DeleteAllMsg();
                        string tmpfact = string.Empty;
                        tmpfact = (wmessage.SendMode == (byte)0) ? "시험" : (wmessage.SendMode == (byte)1) ? "훈련" : "실제";
                        DateTime mdt = DateTime.Now;
                        this.notifyeffectstr        = "최근 " + mdt.ToString("yyyy-MM-dd HH:mm:ss") + " 에 " + tmpfact + " 발령되었습니다.";
                        this.MainNotifyEffect.Blink = true;
                        this.MainNotifyEffect.AddMsg(this.notifyeffectstr, Properties.Resources.megaphone_48x48_);
                        this.MainNotifyEffect.Start();
                        this.controlset.SetListViewIndex(this.DmbIssuesLV);
                    }
                }

                if (wmessage.BCenterList.Count == 0)
                {
                    if (wmessage.SendPart != WMessage.E_sendPart.SMS)
                    {
                        SocketClient soc = SocketClient.getInstance();

                        this.orderlistset.PkidIndex = this.DmbIssuesLV.Items.Count;
                        this.DmbIssuesLV.Items.Add(this.orderlistset.setWmsgCollection(wmessage));
                        this.orderlistset.PkidIndex = 0;
                        this.PrintSendMsg("방송사 0개인 곳의 리스트뷰에 추가 직후 현재시각 - " + DateTime.Now);

                        if (soc.ConState == true)
                        {
                            this.PrintSendMsg("방송사 0개인 곳의 편성으로 전송 직전 현재시각 - " + DateTime.Now);

                            Thread OnWMessageUpdateThread = new Thread(new ParameterizedThreadStart(OnWMessageUpdateTD));
                            OnWMessageUpdateThread.IsBackground = true;
                            OnWMessageUpdateThread.Start((object)wmessage);

                            this.logMng.File_Mng(string.Format("ID - {0}, 발령시간 - {1}, 받은시간 - {2}, TCP연결상태 이므로 편성으로 전송하고 바로 직후(제어)"
                                                               , wmessage.ID, wmessage.DDateTime, DateTime.Now));
                        }
                        else
                        {
                            this.logMng.File_Mng(string.Format("ID - {0}, 발령시간 - {1}, 받은시간 - {2}, 방송사 없는 재난메시지 편성 연결되어 있지 않아 미전송(제어)"
                                                               , wmessage.ID, wmessage.DDateTime, DateTime.Now));
                        }

                        if (wmessage != null)
                        {
                            this.DmbIssuesLV.Items[wmessage.ID.ToString()].SubItems[6].Text = "방송사";
                        }

                        this.MainNotifyEffect.Stop();
                        this.MainNotifyEffect.DeleteAllMsg();
                        string tmpfact = string.Empty;
                        tmpfact = (wmessage.SendMode == (byte)0) ? "시험" : (wmessage.SendMode == (byte)1) ? "훈련" : "실제";
                        DateTime mdt1 = DateTime.Now;
                        this.notifyeffectstr        = "최근 " + mdt1.ToString("yyyy-MM-dd HH:mm:ss") + " 에 " + tmpfact + " 발령되었습니다.";
                        this.MainNotifyEffect.Blink = true;
                        this.MainNotifyEffect.AddMsg(this.notifyeffectstr, Properties.Resources.megaphone_48x48_);
                        this.MainNotifyEffect.Start();
                        this.controlset.SetListViewIndex(this.DmbIssuesLV);
                    }
                }

                if (this.DmbIssuesLV.SelectedItems.Count > 0)
                {
                    for (int j = 0; j < this.DmbIssuesLV.Items.Count; j++)
                    {
                        for (int i = 0; i < this.DmbIssuesLV.SelectedItems.Count; i++)
                        {
                            string key = this.DmbIssuesLV.SelectedItems[i].Name;

                            if (this.DmbIssuesLV.Items[key].Selected == true)
                            {
                                this.DmbIssuesLV.Items[key].Selected = false;
                            }
                            if (this.DmbIssuesLV.Items[key].Focused == true)
                            {
                                this.DmbIssuesLV.Items[key].Focused = false;
                            }
                        }
                    }
                }

                if (this.DmbIssuesLV.Items.ContainsKey(wmessage.ID.ToString()))
                {
                    this.DmbIssuesLV.Items[wmessage.ID.ToString()].Selected = true;
                    this.DmbIssuesLV.Items[wmessage.ID.ToString()].Focused  = true;
                    this.DmbIssuesLV.Items[wmessage.ID.ToString()].EnsureVisible();
                }

                this.SetStatusLB();
            }
            catch (Exception ex)
            {
                this.wmsglistclone.Add((WMessage)_wmessage);
                Console.WriteLine("OnWMessageUpdate - " + ex.Message);
            }
        }
Exemple #24
0
        /// <summary>
        /// 메시지 항목 별 셋팅 후 ListViewItem 리턴
        /// </summary>
        /// <param name="wmessage"></param>
        /// <returns></returns>
        public ListViewItem setWmsgCollection(WMessage wmessage)
        {
            TypeDisaster           comparee = new TypeDisaster();
            TypeDisasterIDComparer comparer = new TypeDisasterIDComparer();
            ListViewItem           lvi      = new ListViewItem();
            bool state = false;

            datamanager.GetdisasterList.Sort(comparer);

            if (wmessage != null)
            {
                //Name
                lvi.Name = wmessage.ID.ToString();
                //번호
                pkidIndex = pkidIndex + 1;
                lvi.Text  = pkidIndex.ToString();
                //발령일시
                lvi.SubItems.Add(wmessage.DDateTime.ToString("yyyy-MM-dd HH:mm:ss"));
                //실제구분
                string tmpfact = string.Empty;
                tmpfact = (wmessage.SendMode == (byte)0) ? "시험" : (wmessage.SendMode == (byte)1) ? "훈련" : "실제";
                lvi.SubItems.Add(tmpfact);
                //재난종류
                if (wmessage.ProtoA.DisasterCode != string.Empty)
                {
                    lvi.SubItems.Add(wmessage.ProtoA.DisasterCode);
                }
                else
                {
                    lvi.SubItems.Add("재난종류 응답이상");
                }
                //지역형식
                if (wmessage.ProtoA.SectionCode == DMBBIZ.DmbDefine.DmbDefineSectionCode.National)
                {
                    lvi.SubItems.Add("전국");
                    state = true;
                }
                else if (wmessage.ProtoA.SectionCode == DMBBIZ.DmbDefine.DmbDefineSectionCode.Administrative)
                {
                    lvi.SubItems.Add("행정동");
                    state = true;
                }
                else if (wmessage.ProtoA.SectionCode == DMBBIZ.DmbDefine.DmbDefineSectionCode.Terminal)
                {
                    lvi.SubItems.Add("단말");
                    state = true;
                }
                else
                {
                    state = false;
                }

                if (state == false)
                {
                    lvi.SubItems.Add("지역형식 응답이상");
                }
                state = false;
                //발령대상 수
                if (wmessage.RCount.ToString() != null)
                {
                    lvi.SubItems.Add(wmessage.RCount.ToString());
                }
                else
                {
                    lvi.SubItems.Add("지역수 응답이상");
                }
                //발령상태
                string tmpsendstate = "방송사";

                if (!wmessage.BoolProcessing)
                {
                    tmpsendstate = "종료";
                }

                lvi.SubItems.Add(tmpsendstate);
                //발령구분
                if (wmessage.SendPart != 0)
                {
                    lvi.SubItems.Add(wmessage.SendPart.ToString());
                }
                else
                {
                    lvi.SubItems.Add("");
                }
                //방송사
                string tmp = string.Empty;
                for (int i = 0; i < wmessage.ProtoA.LstStage.Count; i++)
                {
                    if (wmessage.ProtoA.LstStage[i] == DMBBIZ.DmbDefine.DmbDefineStage.Kbs)
                    {
                        tmp += " KBS";
                    }
                    else if (wmessage.ProtoA.LstStage[i] == DMBBIZ.DmbDefine.DmbDefineStage.Mbc)
                    {
                        tmp += " MBC";
                    }
                    else if (wmessage.ProtoA.LstStage[i] == DMBBIZ.DmbDefine.DmbDefineStage.Sbs)
                    {
                        tmp += " SBS";
                    }
                    else if (wmessage.ProtoA.LstStage[i] == DMBBIZ.DmbDefine.DmbDefineStage.Ytn)
                    {
                        tmp += " YTN";
                    }
                }

                lvi.SubItems.Add(tmp);

                //DMB단문
                if (wmessage.Message != null)
                {
                    if (wmessage.BoolControl == true)
                    {
                        lvi.SubItems.Add("수신기 상태/제어 요청");
                    }
                    else if (wmessage.SendPart == WMessage.E_sendPart.STRD)
                    {
                        lvi.SubItems.Add("수신기 저장메시지 요청");
                    }
                    else if (wmessage.SendPart == WMessage.E_sendPart.WARN)
                    {
                        lvi.SubItems.Add("수신기 경보사이렌 요청");
                    }
                    else
                    {
                        lvi.SubItems.Add(wmessage.Message);
                    }
                }
                else
                {
                    lvi.SubItems.Add("");
                }
                //TTS단문
                if (wmessage.TTSMsg != null)
                {
                    if (wmessage.BoolControl == true)
                    {
                        lvi.SubItems.Add("수신기 상태/제어 요청");
                    }
                    else if (wmessage.SOPT_STOREDMESSAGE)
                    {
                        lvi.SubItems.Add("수신기 저장메시지 요청");
                    }
                    else if (wmessage.SendPart == WMessage.E_sendPart.WARN)
                    {
                        lvi.SubItems.Add("수신기 경보사이렌 요청");
                    }
                    else
                    {
                        lvi.SubItems.Add(wmessage.TTSMsg);
                    }
                }
                else
                {
                    lvi.SubItems.Add("");
                }
                //CBS단문
                if (wmessage.SMSMsg != null)
                {
                    lvi.SubItems.Add(wmessage.SMSMsg);
                }
                else
                {
                    lvi.SubItems.Add("");
                }
            }

            return(lvi);
        }
Exemple #25
0
 private void OnNorWmsgFinish(WMessage _wmsg)
 {
     this.ProcessingUpdate(_wmsg);
 }
Exemple #26
0
        /// <summary>
        /// 재난 메시지를 판단해 일반, 특수수신기, 저장메시지, 사이렌을 구분해 전송한다.
        /// </summary>
        /// <param name="wmessage"></param>
        public void TcpSendWmsg(WMessage _wmessage)
        {
            try
            {
                WMessage wmessage = _wmessage;
                this.PrintSendMsg("TcpSendWmsg 메소드 들어온 직후 - " + DateTime.Now);

                //logmanager.Dir_Mng();

                //#region 로그 etcData 셋팅
                //string sopt = string.Empty;

                //if (wmessage.SOPT_CONTROL) { sopt += "제어 "; }
                //if (wmessage.SOPT_DMB) { sopt += "일반메시지 "; }
                //if (wmessage.SOPT_LIVE) { sopt += "라이브 "; }
                //if (wmessage.SOPT_SMS) { sopt += "SMS "; }
                //if (wmessage.SOPT_STOREDMESSAGE) { sopt += "저장메시지 "; }
                //if (wmessage.SOPT_TTS) { sopt += "TTS "; }
                //if (wmessage.SOPT_WARNING) { sopt += "사이렌 "; }

                //string etcData = string.Format("메시지ID - {0}, 발령시간 - {1}, 송출이 받은시간 - {2}, 발령구분 - {3}",
                //wmessage.ID, wmessage.DDateTime, DateTime.Now, sopt);
                //#endregion

                if (((wmessage.SOPT_TTS) && (wmessage.SOPT_DMB)) || ((wmessage.SOPT_STOREDMESSAGE) && (wmessage.SOPT_DMB)))
                {
                    //일반 발령
                    this.PrintSendMsg("일반 만들기 직전 - " + DateTime.Now.ToString());
                    Proto02 p02      = ProtoMng.GetPObject("02") as Proto02;
                    byte[]  body     = p02.BodyMake(wmessage);
                    byte[]  totproto = p02.totMake(body);
                    this.PrintSendMsg("일반 만들기 직후 - " + DateTime.Now);

                    soc.tcpClientSndMsg(totproto);
                    this.PrintSendMsg("일반 만들기 후 전송 직후 - " + DateTime.Now);
                    //logmanager.File_Mng(etcData + ", EWS편성으로 전송하는 일반 발령메시지", this.LogFileWrite(totproto));

                    //특수수신기 발령
                    this.PrintSendMsg("특수 만들기 직전 - " + DateTime.Now);
                    Proto01 p01         = ProtoMng.GetPObject("01") as Proto01;
                    byte[]  devbody     = p01.BodyMake(wmessage);
                    byte[]  devtotproto = p01.totMake(devbody);
                    this.PrintSendMsg("특수 만들기 직후 - " + DateTime.Now);

                    soc.tcpClientSndMsg(devtotproto);
                    this.PrintSendMsg("특수 만들기 후 전송 직후 - " + DateTime.Now);
                    //logmanager.File_Mng(etcData + ", EWS편성으로 전송하는 특수수신기 발령메시지", this.LogFileWrite(devtotproto));
                }
                else if (wmessage.SOPT_DMB || ((wmessage.SOPT_SMS) && (wmessage.SOPT_DMB)) || ((wmessage.SOPT_WARNING) && (wmessage.SOPT_DMB)))
                {
                    //일반 발령
                    this.PrintSendMsg("일반 만들기 직전 - " + DateTime.Now);
                    Proto02 p02      = ProtoMng.GetPObject("02") as Proto02;
                    byte[]  body     = p02.BodyMake(wmessage);
                    byte[]  totproto = p02.totMake(body);
                    this.PrintSendMsg("일반 만들기 직후 - " + DateTime.Now);

                    soc.tcpClientSndMsg(totproto);
                    this.PrintSendMsg("일반 만들기 후 전송 직후 - " + DateTime.Now);
                    //logmanager.File_Mng(etcData + ", EWS편성으로 전송하는 일반 발령메시지", this.LogFileWrite(totproto));

                    if (wmessage.SOPT_WARNING)
                    {
                        Proto01 p01         = ProtoMng.GetPObject("01") as Proto01;
                        byte[]  devbody     = p01.BodyMake(wmessage);
                        byte[]  devtotproto = p01.totMake(devbody);

                        soc.tcpClientSndMsg(devtotproto);
                        //logmanager.File_Mng(etcData + ", EWS편성으로 전송하는 특수수신기 발령메시지", this.LogFileWrite(devtotproto));
                    }
                }
                else if (wmessage.SOPT_CONTROL || wmessage.SOPT_STOREDMESSAGE || wmessage.SOPT_WARNING || wmessage.SOPT_TTS)
                {
                    //특수수신기 발령
                    this.PrintSendMsg("특수 만들기 직전 - " + DateTime.Now);
                    Proto01 p01         = ProtoMng.GetPObject("01") as Proto01;
                    byte[]  devbody     = p01.BodyMake(wmessage);
                    byte[]  devtotproto = p01.totMake(devbody);
                    this.PrintSendMsg("특수 만들기 직후 - " + DateTime.Now);

                    soc.tcpClientSndMsg(devtotproto);
                    this.PrintSendMsg("특수 만들기 후 전송 직후 - " + DateTime.Now);
                    //logmanager.File_Mng(etcData + ", EWS편성으로 전송하는 특수수신기 발령메시지", this.LogFileWrite(devtotproto));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Secession.TcpSendWmsg(WMessage wmessage) - " + ex.Message);
            }
        }
Exemple #27
0
        private void OnSpcMsgSuccessEvent(WMessage wmessage)
        {
            if ((wmessage.SOPT_CONTROL != wmessage.SOPT_CONTROL_COMMIT) || (wmessage.SOPT_STOREDMESSAGE != wmessage.SOPT_STOREDMESSAGE_COMMIT) ||
                (wmessage.SOPT_WARNING != wmessage.SOPT_WARNING_COMMIT) || (wmessage.SOPT_TTS != wmessage.SOPT_TTS_COMMIT))
            {
                if (wmessage.SOPT_CONTROL)
                {
                    if ((wmessage.SendPart == wmessage.CommitPart) && (wmessage.SOPT_SMS == wmessage.SOPT_SMS_COMMIT))
                    {
                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].SubItems[6].Text = "방송사(EWS)";

                        if (this.DmbIssuesLV.SelectedItems.Count > 0)
                        {
                            for (int j = 0; j < this.DmbIssuesLV.Items.Count; j++)
                            {
                                for (int i = 0; i < this.DmbIssuesLV.SelectedItems.Count; i++)
                                {
                                    string key = this.DmbIssuesLV.SelectedItems[i].Name;

                                    if (this.DmbIssuesLV.Items[key].Selected == true)
                                    {
                                        this.DmbIssuesLV.Items[key].Selected = false;
                                    }
                                    if (this.DmbIssuesLV.Items[key].Focused == true)
                                    {
                                        this.DmbIssuesLV.Items[key].Focused = false;
                                    }
                                }
                            }
                        }

                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].Selected = true;
                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].Focused  = true;
                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].EnsureVisible();
                        this.SetStatusLB();
                    }
                }
                else if (wmessage.SOPT_STOREDMESSAGE)
                {
                    if ((wmessage.SendPart == wmessage.CommitPart) && (wmessage.SOPT_SMS == wmessage.SOPT_SMS_COMMIT))
                    {
                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].SubItems[6].Text = "방송사(EWS)";

                        if (this.DmbIssuesLV.SelectedItems.Count > 0)
                        {
                            for (int j = 0; j < this.DmbIssuesLV.Items.Count; j++)
                            {
                                for (int i = 0; i < this.DmbIssuesLV.SelectedItems.Count; i++)
                                {
                                    string key = this.DmbIssuesLV.SelectedItems[i].Name;

                                    if (this.DmbIssuesLV.Items[key].Selected == true)
                                    {
                                        this.DmbIssuesLV.Items[key].Selected = false;
                                    }
                                    if (this.DmbIssuesLV.Items[key].Focused == true)
                                    {
                                        this.DmbIssuesLV.Items[key].Focused = false;
                                    }
                                }
                            }
                        }

                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].Selected = true;
                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].Focused  = true;
                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].EnsureVisible();
                        this.SetStatusLB();
                    }
                }
                else if (wmessage.SOPT_WARNING)
                {
                    if ((wmessage.SendPart == wmessage.CommitPart) && (wmessage.SOPT_SMS == wmessage.SOPT_SMS_COMMIT))
                    {
                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].SubItems[6].Text = "방송사(EWS)";

                        if (this.DmbIssuesLV.SelectedItems.Count > 0)
                        {
                            for (int j = 0; j < this.DmbIssuesLV.Items.Count; j++)
                            {
                                for (int i = 0; i < this.DmbIssuesLV.SelectedItems.Count; i++)
                                {
                                    string key = this.DmbIssuesLV.SelectedItems[i].Name;

                                    if (this.DmbIssuesLV.Items[key].Selected == true)
                                    {
                                        this.DmbIssuesLV.Items[key].Selected = false;
                                    }
                                    if (this.DmbIssuesLV.Items[key].Focused == true)
                                    {
                                        this.DmbIssuesLV.Items[key].Focused = false;
                                    }
                                }
                            }
                        }

                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].Selected = true;
                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].Focused  = true;
                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].EnsureVisible();
                        this.SetStatusLB();
                    }
                }
                else if (wmessage.SOPT_TTS)
                {
                    if ((wmessage.SendPart == wmessage.CommitPart) && (wmessage.SOPT_SMS == wmessage.SOPT_SMS_COMMIT))
                    {
                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].SubItems[6].Text = "방송사(EWS)";

                        if (this.DmbIssuesLV.SelectedItems.Count > 0)
                        {
                            for (int j = 0; j < this.DmbIssuesLV.Items.Count; j++)
                            {
                                for (int i = 0; i < this.DmbIssuesLV.SelectedItems.Count; i++)
                                {
                                    string key = this.DmbIssuesLV.SelectedItems[i].Name;

                                    if (this.DmbIssuesLV.Items[key].Selected == true)
                                    {
                                        this.DmbIssuesLV.Items[key].Selected = false;
                                    }
                                    if (this.DmbIssuesLV.Items[key].Focused == true)
                                    {
                                        this.DmbIssuesLV.Items[key].Focused = false;
                                    }
                                }
                            }
                        }

                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].Selected = true;
                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].Focused  = true;
                        this.DmbIssuesLV.Items[wmessage.ID.ToString()].EnsureVisible();
                        this.SetStatusLB();
                    }
                }
            }
        }
Exemple #28
0
        void forNaviSoc_RecvNetSessionClient(object sender, DmbNetSessionRecvEventArgs e)
        {
            try
            {
                List <DmbProtocolBase> lstDmbProtoBase = new List <DmbProtocolBase>();
                DmbNetDataReceiver.ParseDmbPacket(e.Buff, e.Len, (this.forNaviSoc.GetDmbNetSessionContext(e.DmbProfile.IpAddr, e.DmbProfile.Port)).TcpClient, out lstDmbProtoBase);

                foreach (DmbProtocolBase protoBase in lstDmbProtoBase)
                {
                    if (protoBase.Cmd != DmbDefineCmd.CmdP)
                    {
                    }

                    switch (protoBase.Cmd)
                    {
                    case DmbDefineCmd.CmdA:     //발령
                        DmbProtocolCmdA protoA = protoBase as DmbProtocolCmdA;
                        WMessage        wMsg   = new WMessage();
                        wMsg.AbortStatus        = 0;
                        wMsg.BoolControl        = false;
                        wMsg.BoolProcessing     = true;
                        wMsg.CommitPart         = WMessage.E_sendPart.All;
                        wMsg.DDateTime          = protoA.OrderTime;
                        wMsg.EndpointPart       = WMessage.E_sendPart.None;
                        wMsg.ID                 = uint.Parse(protoA.MsgId);
                        wMsg.IntControl         = 0;
                        wMsg.IntProcessing      = 1;
                        wMsg.Message            = protoA.Message;
                        wMsg.ProtoA             = protoA;
                        wMsg.RCount             = (uint)protoA.RgnCount;
                        wMsg.Repeats            = 1;
                        wMsg.SDevice_ALL        = true;
                        wMsg.SDevice_마을앰프       = true;
                        wMsg.SDevice_모니터링       = true;
                        wMsg.SDevice_상황실        = true;
                        wMsg.SDevice_유관기관       = true;
                        wMsg.SendDevice         = WMessage.E_DeviceType.All;
                        wMsg.SendID             = 0;
                        wMsg.SendMode           = (protoA.Mode == DmbDefineOrderMode.Real) ? (byte)3 : (byte)0;
                        wMsg.SMSMsg             = protoA.CbsMsg;
                        wMsg.SOPT_CONTROL       = false;
                        wMsg.SOPT_DMB           = (protoA.MsgType == DmbDefineMsgType.Navi) ? true : false;
                        wMsg.SOPT_ETC           = false;
                        wMsg.SOPT_LIVE          = false;
                        wMsg.SOPT_SMS           = (protoA.CbsMsg == string.Empty) ? false : true;
                        wMsg.SOPT_STOREDMESSAGE = (protoA.MsgType == DmbDefineMsgType.Sto) ? true : false;
                        wMsg.SOPT_TTS           = (protoA.MsgType == DmbDefineMsgType.Tts) ? true : false;
                        wMsg.SOPT_WARNING       = false;
                        wMsg.StoMsg             = protoA.Message;
                        wMsg.TkPriority         = 2;
                        wMsg.TkRegion           = (protoA.SectionCode == DmbDefineSectionCode.National) ? (uint)1 :
                                                  (protoA.SectionCode == DmbDefineSectionCode.Administrative) ? (uint)3 :
                                                  (protoA.SectionCode == DmbDefineSectionCode.Terminal) ? (uint)4 : (uint)2;
                        wMsg.TTSMsg = protoA.Message;

                        broadcast broad = null;

                        for (int i = 0; i < protoA.LstStage.Count; i++)
                        {
                            broad             = new broadcast();
                            broad.BoolAborted = false;
                            broad.BoolProcess = true;
                            broad.WMessageID  = uint.Parse(protoA.MsgId);
                            broad.StageID     = (uint)protoA.LstStage[i] + 2;
                            wMsg.BCenterList.Add(broad);
                        }

                        mapMessageRegion mmr = null;

                        for (int i = 0; i < protoA.LstFullCode.Count; i++)
                        {
                            mmr          = new mapMessageRegion();
                            mmr.DestFlag = (protoA.SectionCode == DmbDefineSectionCode.Terminal) ? (uint)1 : 0;
                            //mmr.ParentID = protoA.LstFullCode[i];
                            mmr.ParentName = protoA.LstFullCode[i];
                            mmr.WMessageID = uint.Parse(protoA.MsgId);
                            wMsg.MapTarget.Add(mmr);
                        }

                        this.mainviewform.datamanager_onWMessageUpdate(wMsg);
                        break;
                    }
                }

                this.logMng.File_Mng(string.Format("중앙(일반수신기) 서비스 => 데이터 수신시각 : {0}\n데이터 : {1}",
                                                   DateTime.Now.ToString(), DMBBIZ.DmbUtility.DmbUtilityMng.IDmbEtcUtility.Bytes2HexString(e.Buff)));
            }
            catch (Exception ex)
            {
                DmbLoggingMng.ILoggingException.WriteException("MainForm", "forNaviSoc_RecvNetSessionClient - ", ex);
            }
        }
Exemple #29
0
        void forSpSoc_RecvNetSessionClient(object sender, DmbNetSessionRecvEventArgs e)
        {
            try
            {
                List <DmbProtocolBase> lstDmbProtoBase = new List <DmbProtocolBase>();
                DmbNetDataReceiver.ParseDmbPacket(e.Buff, e.Len, (this.forSpSoc.GetDmbNetSessionContext(e.DmbProfile.IpAddr, e.DmbProfile.Port)).TcpClient, out lstDmbProtoBase);

                foreach (DmbProtocolBase protoBase in lstDmbProtoBase)
                {
                    if (protoBase.Cmd != DmbDefineCmd.CmdP)
                    {
                    }

                    switch (protoBase.Cmd)
                    {
                    case DmbDefineCmd.CmdA:     //발령
                        DmbProtocolCmdA protoA = protoBase as DmbProtocolCmdA;
                        WMessage        wMsg   = new WMessage();
                        wMsg.AbortStatus        = 0;
                        wMsg.BoolControl        = false;
                        wMsg.BoolProcessing     = true;
                        wMsg.CommitPart         = WMessage.E_sendPart.All;
                        wMsg.DDateTime          = protoA.OrderTime;
                        wMsg.EndpointPart       = WMessage.E_sendPart.None;
                        wMsg.ID                 = uint.Parse(protoA.MsgId);
                        wMsg.IntControl         = 0;
                        wMsg.IntProcessing      = 1;
                        wMsg.Message            = protoA.Message;
                        wMsg.ProtoA             = protoA;
                        wMsg.RCount             = (uint)protoA.RgnCount;
                        wMsg.Repeats            = 1;
                        wMsg.Interval           = 0;
                        wMsg.SDevice_ALL        = false;
                        wMsg.SDevice_마을앰프       = true;
                        wMsg.SDevice_모니터링       = true;
                        wMsg.SDevice_상황실        = true;
                        wMsg.SDevice_유관기관       = true;
                        wMsg.SendID             = 0;
                        wMsg.SendMode           = (protoA.Mode == DmbDefineOrderMode.Real) ? (byte)3 : (byte)0;
                        wMsg.SMSMsg             = protoA.CbsMsg;
                        wMsg.SOPT_CONTROL       = false;
                        wMsg.SOPT_DMB           = (protoA.MsgType == DmbDefineMsgType.Navi) ? true : false;
                        wMsg.SOPT_ETC           = false;
                        wMsg.SOPT_LIVE          = false;
                        wMsg.SOPT_SMS           = (protoA.CbsMsg == string.Empty) ? false : true;
                        wMsg.SOPT_STOREDMESSAGE = (protoA.MsgType == DmbDefineMsgType.Sto) ? true : false;
                        wMsg.SOPT_TTS           = (protoA.MsgType == DmbDefineMsgType.Tts) ? true : false;
                        wMsg.SOPT_WARNING       = false;
                        wMsg.StoMsg             = protoA.Message;
                        wMsg.TkPriority         = 2;
                        wMsg.TkRegion           = (protoA.SectionCode == DmbDefineSectionCode.National) ? (uint)1 :
                                                  (protoA.SectionCode == DmbDefineSectionCode.Administrative) ? (uint)3 :
                                                  (protoA.SectionCode == DmbDefineSectionCode.Terminal) ? (uint)4 : (uint)2;
                        wMsg.TTSMsg = protoA.Message;

                        //AL1 = 공습
                        //AL2 = 경계
                        //AL3 = 재난위험
                        //ACL = 해제
                        if (protoA.DisasterCode == "AL1" || protoA.DisasterCode == "AL2" || protoA.DisasterCode == "AL3" || protoA.DisasterCode == "ACL")
                        {
                            wMsg.SOPT_DMB           = false;
                            wMsg.SOPT_SMS           = false;
                            wMsg.SOPT_STOREDMESSAGE = false;
                            wMsg.SOPT_TTS           = false;
                            wMsg.SOPT_WARNING       = true;
                        }

                        broadcast broad = null;

                        for (int i = 0; i < protoA.LstStage.Count; i++)
                        {
                            broad             = new broadcast();
                            broad.BoolAborted = false;
                            broad.BoolProcess = true;
                            broad.WMessageID  = uint.Parse(protoA.MsgId);
                            broad.StageID     = (uint)protoA.LstStage[i] + 2;
                            wMsg.BCenterList.Add(broad);
                        }

                        mapMessageRegion mmr = null;

                        for (int i = 0; i < protoA.LstFullCode.Count; i++)
                        {
                            mmr          = new mapMessageRegion();
                            mmr.DestFlag = (protoA.SectionCode == DmbDefineSectionCode.Terminal) ? (uint)1 : 0;
                            //mmr.ParentID = protoA.LstFullCode[i];
                            mmr.ParentName = protoA.LstFullCode[i];
                            mmr.WMessageID = uint.Parse(protoA.MsgId);
                            wMsg.MapTarget.Add(mmr);
                        }

                        this.mainviewform.datamanager_onWMessageUpdate(wMsg);
                        break;

                    case DmbDefineCmd.CmdF:     //제어
                        DmbProtocolCmdF protoF      = protoBase as DmbProtocolCmdF;
                        DmbProtocolCmdA subProtoA   = DmbProtocolFactory.CreateDmbProtocol(DmbDefineCmd.CmdA) as DmbProtocolCmdA;
                        string          ctrlMessage = string.Empty;

                        if (protoF.CtrlCode == DmbDefineControlCode.Reset)
                        {
                            P03 p = PMng.GetPObject("31", "1") as P03;
                            ctrlMessage = PMng.MakeFrame(p);
                        }
                        else if (protoF.CtrlCode == DmbDefineControlCode.AmpOutput)
                        {
                            //(0 : 0.1%, 1 : 25%, 2 : 50%, 3 : 75%, 4 : 90%, 5 : 100%)
                            if (protoF.LstCtrlData[0] == "1")
                            {
                                P03 p = PMng.GetPObject("38", "0") as P03;
                                ctrlMessage = PMng.MakeFrame(p);
                            }
                            else if (protoF.LstCtrlData[0] == "2")
                            {
                                P03 p = PMng.GetPObject("38", "2") as P03;
                                ctrlMessage = PMng.MakeFrame(p);
                            }
                            else if (protoF.LstCtrlData[0] == "3")
                            {
                                P03 p = PMng.GetPObject("38", "3") as P03;
                                ctrlMessage = PMng.MakeFrame(p);
                            }
                            else if (protoF.LstCtrlData[0] == "4")
                            {
                                P03 p = PMng.GetPObject("38", "5") as P03;
                                ctrlMessage = PMng.MakeFrame(p);
                            }
                        }
                        else if (protoF.CtrlCode == DmbDefineControlCode.Ars)
                        {
                            //프로토콜 없음
                        }
                        else if (protoF.CtrlCode == DmbDefineControlCode.SignBoard)
                        {
                        }

                        WMessage wMsgCtrl = new WMessage();
                        wMsgCtrl.AbortStatus        = 0;
                        wMsgCtrl.BoolControl        = true;
                        wMsgCtrl.BoolProcessing     = true;
                        wMsgCtrl.CommitPart         = WMessage.E_sendPart.All;
                        wMsgCtrl.DDateTime          = protoF.CtrlTime;
                        wMsgCtrl.EndpointPart       = WMessage.E_sendPart.None;
                        wMsgCtrl.ID                 = uint.Parse(protoF.MsgId);
                        wMsgCtrl.IntControl         = 1;
                        wMsgCtrl.IntProcessing      = 1;
                        wMsgCtrl.Message            = ctrlMessage;
                        wMsgCtrl.ProtoF             = protoF;
                        wMsgCtrl.RCount             = (uint)protoF.RgnCount;
                        wMsgCtrl.Repeats            = 1;
                        wMsgCtrl.Interval           = 5;
                        wMsgCtrl.SDevice_ALL        = true;
                        wMsgCtrl.SDevice_마을앰프       = true;
                        wMsgCtrl.SDevice_모니터링       = true;
                        wMsgCtrl.SDevice_상황실        = true;
                        wMsgCtrl.SDevice_유관기관       = true;
                        wMsgCtrl.SendDevice         = WMessage.E_DeviceType.All;
                        wMsgCtrl.SendID             = 0;
                        wMsgCtrl.SendMode           = (byte)0;
                        wMsgCtrl.SMSMsg             = string.Empty;
                        wMsgCtrl.SOPT_CONTROL       = true;
                        wMsgCtrl.SOPT_DMB           = false;
                        wMsgCtrl.SOPT_ETC           = false;
                        wMsgCtrl.SOPT_LIVE          = false;
                        wMsgCtrl.SOPT_SMS           = false;
                        wMsgCtrl.SOPT_STOREDMESSAGE = false;
                        wMsgCtrl.SOPT_TTS           = false;
                        wMsgCtrl.SOPT_WARNING       = false;
                        wMsgCtrl.StoMsg             = "특수수신기 제어";
                        wMsgCtrl.TkPriority         = 2;
                        wMsgCtrl.TkRegion           = (protoF.SectionCode == DmbDefineSectionCode.National) ? (uint)1 :
                                                      (protoF.SectionCode == DmbDefineSectionCode.Administrative) ? (uint)3 :
                                                      (protoF.SectionCode == DmbDefineSectionCode.Terminal) ? (uint)4 : (uint)2;
                        wMsgCtrl.TTSMsg = ctrlMessage;

                        broadcast broadCtrl = null;

                        for (int i = 0; i < this.datamanager.BroadList.Count; i++)
                        {
                            broadCtrl             = new broadcast();
                            broadCtrl.BoolAborted = false;
                            broadCtrl.BoolProcess = true;
                            broadCtrl.WMessageID  = uint.Parse(protoF.MsgId);
                            broadCtrl.StageID     = (uint)this.datamanager.BroadList[i].ID;
                            wMsgCtrl.BCenterList.Add(broadCtrl);
                        }

                        mapMessageRegion mmrCtrl = null;

                        for (int i = 0; i < protoF.LstFullCode.Count; i++)
                        {
                            mmrCtrl            = new mapMessageRegion();
                            mmrCtrl.DestFlag   = (protoF.SectionCode == DmbDefineSectionCode.Terminal) ? (uint)1 : 0;
                            mmrCtrl.ParentName = protoF.LstFullCode[i];
                            mmrCtrl.WMessageID = uint.Parse(protoF.MsgId);
                            wMsgCtrl.MapTarget.Add(mmrCtrl);
                        }

                        subProtoA.DisasterCode = "STT";
                        subProtoA.SectionCode  = protoF.SectionCode;
                        subProtoA.LstStage.Add(DmbDefineStage.Kbs);
                        subProtoA.LstStage.Add(DmbDefineStage.Mbc);
                        subProtoA.LstStage.Add(DmbDefineStage.Sbs);
                        subProtoA.LstStage.Add(DmbDefineStage.Ytn);
                        wMsgCtrl.ProtoA = subProtoA;

                        this.mainviewform.datamanager_onWMessageUpdate(wMsgCtrl);
                        break;

                    case DmbDefineCmd.CmdG:     //상태요청
                        P01             p01            = new P01();
                        string          allRequestData = this.AllDeviceStatusRequest(p01);
                        DmbProtocolCmdG protoG         = protoBase as DmbProtocolCmdG;
                        DmbProtocolCmdA subProtoA1     = DmbProtocolFactory.CreateDmbProtocol(DmbDefineCmd.CmdA) as DmbProtocolCmdA;
                        WMessage        wMsgCtrl1      = new WMessage();
                        wMsgCtrl1.AbortStatus        = 0;
                        wMsgCtrl1.BoolControl        = true;
                        wMsgCtrl1.BoolProcessing     = true;
                        wMsgCtrl1.CommitPart         = WMessage.E_sendPart.All;
                        wMsgCtrl1.DDateTime          = DateTime.Now;
                        wMsgCtrl1.EndpointPart       = WMessage.E_sendPart.None;
                        wMsgCtrl1.ID                 = 1;
                        wMsgCtrl1.IntControl         = 1;
                        wMsgCtrl1.IntProcessing      = 1;
                        wMsgCtrl1.Message            = allRequestData;
                        wMsgCtrl1.RCount             = 1;
                        wMsgCtrl1.Repeats            = 1;
                        wMsgCtrl1.Interval           = 5;
                        wMsgCtrl1.SDevice_ALL        = true;
                        wMsgCtrl1.SDevice_마을앰프       = true;
                        wMsgCtrl1.SDevice_모니터링       = true;
                        wMsgCtrl1.SDevice_상황실        = true;
                        wMsgCtrl1.SDevice_유관기관       = true;
                        wMsgCtrl1.SendDevice         = WMessage.E_DeviceType.All;
                        wMsgCtrl1.SendID             = 0;
                        wMsgCtrl1.SendMode           = (byte)0;
                        wMsgCtrl1.SMSMsg             = string.Empty;
                        wMsgCtrl1.SOPT_CONTROL       = true;
                        wMsgCtrl1.SOPT_DMB           = false;
                        wMsgCtrl1.SOPT_ETC           = false;
                        wMsgCtrl1.SOPT_LIVE          = false;
                        wMsgCtrl1.SOPT_SMS           = false;
                        wMsgCtrl1.SOPT_STOREDMESSAGE = false;
                        wMsgCtrl1.SOPT_TTS           = false;
                        wMsgCtrl1.SOPT_WARNING       = false;
                        wMsgCtrl1.StoMsg             = "특수수신기 상태요청";
                        wMsgCtrl1.TkPriority         = 2;
                        wMsgCtrl1.TkRegion           = 4;
                        wMsgCtrl1.TTSMsg             = allRequestData;

                        broadcast broadCtrl1 = null;

                        for (int i = 0; i < this.datamanager.BroadList.Count; i++)
                        {
                            broadCtrl1             = new broadcast();
                            broadCtrl1.BoolAborted = false;
                            broadCtrl1.BoolProcess = true;
                            broadCtrl1.WMessageID  = 1;
                            broadCtrl1.StageID     = (uint)this.datamanager.BroadList[i].ID;
                            wMsgCtrl1.BCenterList.Add(broadCtrl1);
                        }

                        mapMessageRegion mmrCtrl1 = null;
                        mmrCtrl1            = new mapMessageRegion();
                        mmrCtrl1.DestFlag   = 1;
                        mmrCtrl1.ParentName = protoG.CdmaNumber;
                        mmrCtrl1.WMessageID = 1;
                        wMsgCtrl1.MapTarget.Add(mmrCtrl1);

                        subProtoA1.DisasterCode = "STT";
                        subProtoA1.SectionCode  = DmbDefineSectionCode.Terminal;
                        subProtoA1.LstStage.Add(DmbDefineStage.Kbs);
                        subProtoA1.LstStage.Add(DmbDefineStage.Mbc);
                        subProtoA1.LstStage.Add(DmbDefineStage.Sbs);
                        subProtoA1.LstStage.Add(DmbDefineStage.Ytn);
                        wMsgCtrl1.ProtoA = subProtoA1;

                        this.mainviewform.datamanager_onWMessageUpdate(wMsgCtrl1);
                        break;
                    }
                }

                this.logMng.File_Mng(string.Format("시도(특수수신기) 서비스 => 데이터 수신시각 : {0}\n데이터 : {1}",
                                                   DateTime.Now.ToString(), DMBBIZ.DmbUtility.DmbUtilityMng.IDmbEtcUtility.Bytes2HexString(e.Buff)));
            }
            catch (Exception ex)
            {
                DmbLoggingMng.ILoggingException.WriteException("MainForm", "forSpSoc_RecvNetSessionClient - ", ex);
            }
        }
Exemple #30
0
        public void SetStatusLB()
        {
            try
            {
                if (this.DmbIssuesLV.SelectedItems.Count == 1)
                {
                    WMessage           wmsg     = new WMessage();
                    WMessageIDComparer comparer = new WMessageIDComparer();
                    wmsg.ID = uint.Parse(this.DmbIssuesLV.SelectedItems[0].Name);
                    datamanager.BroadWmsgList.Sort(comparer);
                    WMessage w = datamanager.BroadWmsgList[datamanager.BroadWmsgList.BinarySearch(wmsg, comparer)];

                    //발령일시
                    this.dateTB.Text = w.DDateTime.ToString("yyyy-MM-dd HH:mm:ss");
                    //실제구분
                    string tmpfact = string.Empty;
                    tmpfact            = (w.SendMode == (byte)0) ? "시험" : (w.SendMode == (byte)1) ? "훈련" : "실제";
                    this.disterTB.Text = tmpfact;
                    //발령상태
                    this.priTB.Text = this.DmbIssuesLV.SelectedItems[0].SubItems[6].Text;
                    //발령구분
                    if (w.SendPart != 0)
                    {
                        this.regionTB.Text = w.SendPart.ToString();
                    }
                    else
                    {
                        this.regionTB.Text = string.Empty;
                    }
                    //방송사
                    string tmp = string.Empty;
                    for (int i = 0; i < w.BCenterList.Count; i++)
                    {
                        tmp += datamanager.getBroadNameV2(w.BCenterList[i].StageID);
                    }
                    if (tmp != string.Empty)
                    {
                        this.partTB.Text = tmp.Substring(2, (tmp.Length - 2));
                    }
                    else
                    {
                        this.partTB.Text = tmp;
                    }
                    //DMB단문
                    if (w.BoolControl)
                    {
                        this.dmbmTB.Text = "수신기 상태/제어 요청";
                    }
                    else if (w.SendPart == WMessage.E_sendPart.STRD)
                    {
                        this.dmbmTB.Text = "수신기 저장메시지 요청";
                    }
                    else if (w.SendPart == WMessage.E_sendPart.WARN)
                    {
                        this.dmbmTB.Text = "수신기 경보사이렌 요청";
                    }
                    else
                    {
                        this.dmbmTB.Text = w.Message;
                    }
                    //TTS단문
                    if (w.BoolControl)
                    {
                        this.ttsmTB.Text = "수신기 상태/제어 요청";
                    }
                    else if (w.SOPT_STOREDMESSAGE)
                    {
                        this.ttsmTB.Text = "수신기 저장메시지 요청";
                    }
                    else if (w.SendPart == WMessage.E_sendPart.WARN)
                    {
                        this.ttsmTB.Text = "수신기 경보사이렌 요청";
                    }
                    else
                    {
                        this.ttsmTB.Text = w.TTSMsg;
                    }
                    //SMS단문
                    this.smsmTB.Text = w.SMSMsg;
                }
                else
                {
                    this.dateTB.Text   = string.Empty;
                    this.disterTB.Text = string.Empty;
                    this.priTB.Text    = string.Empty;
                    this.regionTB.Text = string.Empty;
                    this.partTB.Text   = string.Empty;
                    this.dmbmTB.Text   = string.Empty;
                    this.ttsmTB.Text   = string.Empty;
                    this.smsmTB.Text   = string.Empty;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("SetStatusLB - " + ex.Message);
            }
        }