Beispiel #1
0
        public override NCasObject CloneTo()
        {
            OrderBizData newObject = new OrderBizData();

            newObject.almProtocol               = this.almProtocol;
            newObject.allDestinationFlag        = this.allDestinationFlag;
            newObject.orderTermFlag             = this.orderTermFlag;
            newObject.orderTermAllFlag          = this.orderTermAllFlag;
            newObject.orderTermGroupFlag        = this.orderTermGroupFlag;
            newObject.orderDistGroupFlag        = this.orderDistGroupFlag;
            newObject.orderDistFlag             = this.orderDistFlag;
            newObject.orderDistTermFlag         = this.orderDistTermFlag;
            newObject.orderDistTermAllFlag      = this.orderDistTermAllFlag;
            newObject.selectedDisasterBroadKind = this.selectedDisasterBroadKind;
            newObject.lastOrderKind             = this.lastOrderKind;
            newObject.isLocal                  = this.isLocal;
            newObject.isEnd                    = this.isEnd;
            newObject.ttsOrderFlag             = this.ttsOrderFlag;
            newObject.selectedStoredMessage    = this.selectedStoredMessage;
            newObject.storedMessageRepeatCount = this.storedMessageRepeatCount;
            newObject.selectedTtsMessage       = this.selectedTtsMessage;
            newObject.groupName                = this.groupName;
            newObject.sendBuff                 = this.sendBuff;

            return(newObject);
        }
Beispiel #2
0
        public override void CloneFrom(NCasObject obj)
        {
            OrderBizData newObject = obj as OrderBizData;

            this.almProtocol               = newObject.almProtocol;
            this.allDestinationFlag        = newObject.allDestinationFlag;
            this.orderTermFlag             = newObject.orderTermFlag;
            this.orderTermAllFlag          = newObject.orderTermAllFlag;
            this.orderTermGroupFlag        = newObject.orderTermGroupFlag;
            this.orderDistGroupFlag        = newObject.orderDistGroupFlag;
            this.orderDistFlag             = newObject.orderDistFlag;
            this.orderDistTermFlag         = newObject.orderDistTermFlag;
            this.orderDistTermAllFlag      = newObject.orderDistTermAllFlag;
            this.selectedDisasterBroadKind = newObject.selectedDisasterBroadKind;
            this.lastOrderKind             = newObject.lastOrderKind;
            this.isLocal                  = newObject.isLocal;
            this.isEnd                    = newObject.isEnd;
            this.ttsOrderFlag             = newObject.ttsOrderFlag;
            this.selectedStoredMessage    = newObject.selectedStoredMessage;
            this.storedMessageRepeatCount = newObject.storedMessageRepeatCount;
            this.selectedTtsMessage       = newObject.selectedTtsMessage;
            this.groupName                = newObject.groupName;
            this.sendBuff                 = newObject.sendBuff;
        }
Beispiel #3
0
        /// <summary>
        /// 시도 전체 발령
        /// </summary>
        /// <param name="orderBizData"></param>
        private void OrderProvAll(OrderBizData orderBizData)
        {
            NCasProtocolBase baseProto = NCasProtocolFactory.ParseFrame(orderBizData.SendBuff);
            NCasProtocolTc1  tc1       = baseProto as NCasProtocolTc1;

            tc1.AlarmNetIdOrIpByString = NCasUtilityMng.INCasCommUtility.AddIpAddr(tc1.AlarmNetIdOrIpByString, 0, 7, 0, 0);
            byte[]            sendBuff   = NCasProtocolFactory.MakeUdpFrame(tc1);
            NCasProtocolBase  protoBase  = NCasProtocolFactory.CreateCasProtocol(NCasDefineTcCode.TcPublicAlarmOrder);
            NCasProtocolTc151 protoTc151 = protoBase as NCasProtocolTc151;

            if (orderBizData.SelectedDisasterBroadKind != OrderView19201080.DisasterBroadKind.StroredMessage)
            {
                string        teleServerIpAddr      = NCasUtilityMng.INCasCommUtility.AddIpAddr(NCasUtilityMng.INCasCommUtility.MakeNetIdByAnyIp(this.provInfo.NetIdToString), 0, 0, 1, 111);
                List <string> reptAlarmServerIpAddr = new List <string>();

                for (int i = 0; i < this.provInfo.LstRepts.Count; i++)
                {
                    reptAlarmServerIpAddr.Add(NCasUtilityMng.INCasCommUtility.AddIpAddr(this.provInfo.LstRepts[i].NetIdToString, 0, 0, 1, 1));
                }

                udpSoc.SendTo(teleServerIpAddr, (int)NCasPortID.PortIdExtCallPgServer, sendBuff);
                udpSoc.SendTo(NCasUtilityMng.INCasEtcUtility.GetIPv4(), (int)NCasPortID.PortIdExtCallPgMan, sendBuff);

                for (int i = 0; i < reptAlarmServerIpAddr.Count; i++)
                {
                    udpSoc.SendTo(reptAlarmServerIpAddr[i], (int)NCasPortID.PortIdIntTeleRAlarm, sendBuff);
                }
            }

            if (tc1.AlarmKind == NCasDefineOrderKind.AlarmBiochemist ||
                (tc1.AlarmKind == NCasDefineOrderKind.DisasterBroadcast && orderBizData.SelectedDisasterBroadKind == OrderView19201080.DisasterBroadKind.Mic) ||
                (tc1.AlarmKind == NCasDefineOrderKind.DisasterBroadcast && orderBizData.SelectedDisasterBroadKind == OrderView19201080.DisasterBroadKind.Tts))
            {
                Thread.Sleep(this.SendDelay);
            }

            byte[] tmpStoBuff = null;

            if (orderBizData.SelectedDisasterBroadKind == OrderView19201080.DisasterBroadKind.StroredMessage)
            {
                protoTc151.AlarmKind = NCasDefineOrderKind.BroadMessage;
                protoTc151.AlarmNetIdOrIpByString = tc1.AlarmNetIdOrIpByString;
                protoTc151.AuthenFlag             = tc1.AuthenFlag;
                protoTc151.CtrlKind            = tc1.CtrlKind;
                protoTc151.Media               = tc1.Media;
                protoTc151.Mode                = tc1.Mode;
                protoTc151.Source              = tc1.Source;
                protoTc151.Sector              = tc1.Sector;
                protoTc151.RespReqFlag         = tc1.RespReqFlag;
                protoTc151.OrderTimeByDateTime = tc1.OrderTimeByDateTime;
                protoTc151.MsgNum1             = GetStoredMsgHeaderNumber(int.Parse(orderBizData.SelectedStoredMessage.MsgNum));
                protoTc151.MsgNum2             = int.Parse(orderBizData.SelectedStoredMessage.MsgNum);
                protoTc151.MsgNum3             = GetStoredMsgTailNumber(int.Parse(orderBizData.SelectedStoredMessage.MsgNum));
                protoTc151.RepeatNum           = (byte)orderBizData.StoredMessageRepeatCount;

                tmpStoBuff = NCasProtocolFactory.MakeUdpFrame(protoTc151);
            }

            this.mainForm.MmfMng.WriteOrder(tc1);

            if (orderBizData.SelectedDisasterBroadKind == OrderView19201080.DisasterBroadKind.StroredMessage) //저장메시지 발령인 경우..
            {
                this.udpSoc.SendTo(this.LoopBackIP, (int)NCasPortID.PortIdIntAuthorityDAlarm, tmpStoBuff);
                this.udpSoc.SendTo(this.LoopBackIP, (int)NCasPortID.PortIdExtCasMonitor, tmpStoBuff);
                this.udpSoc.SendTo(this.LoopBackIP, (int)NCasPipes.PipePdaProvAlm, tmpStoBuff);
                this.udpSoc.SendTo(this.LoopBackIP, (int)NCasPipes.PipePdaProvPDMain, tmpStoBuff);
                this.udpSoc.SendTo(this.LoopBackIP, (int)NCasPipes.PipePdaTermTerm, tmpStoBuff);
                this.udpSoc.SendTo(this.LoopBackIP, (int)NCasPipes.PipePdaCentSate, tmpStoBuff);
            }
            else
            {
                this.udpSoc.SendTo(this.LoopBackIP, (int)NCasPortID.PortIdIntAuthorityDAlarm, sendBuff);
                this.udpSoc.SendTo(this.LoopBackIP, (int)NCasPortID.PortIdExtCasMonitor, sendBuff);
                this.udpSoc.SendTo(this.LoopBackIP, (int)NCasPipes.PipePdaProvAlm, sendBuff);
                this.udpSoc.SendTo(this.LoopBackIP, (int)NCasPipes.PipePdaProvPDMain, sendBuff);
                this.udpSoc.SendTo(this.LoopBackIP, (int)NCasPipes.PipePdaTermTerm, sendBuff);
                this.udpSoc.SendTo(this.LoopBackIP, (int)NCasPipes.PipePdaCentSate, sendBuff);
            }

            if (tc1.AlarmKind == NCasDefineOrderKind.DisasterBroadcast && orderBizData.SelectedDisasterBroadKind == OrderView19201080.DisasterBroadKind.Tts)
            {
                byte[] tmpBuff          = TtsControlDataMng.GetTtsPlayData();
                string teleServerIpAddr = NCasUtilityMng.INCasCommUtility.AddIpAddr(NCasUtilityMng.INCasCommUtility.MakeNetIdByAnyIp(this.provInfo.NetIdToString), 0, 0, 1, 111);
                udpSoc.SendTo(teleServerIpAddr, (int)NCasPortID.PortIdExtCallPgServer, tmpBuff);
                udpSoc.SendTo(NCasUtilityMng.INCasEtcUtility.GetIPv4(), (int)NCasPortID.PortIdExtCallPgMan, tmpBuff);
                udpSoc.SendTo(this.LoopBackIP, (int)NCasPortID.PortIdTtsControl, Encoding.Default.GetBytes("RES"));
                Thread.Sleep(this.TtsDelay);

                string ttsData = "TTS" + NCasContentsMng.ttsOption.SpeechSpeed.ToString().PadLeft(3, '0') +
                                 NCasContentsMng.ttsOption.RepeatCount.ToString().PadLeft(2, '0') +
                                 NCasContentsMng.ttsOption.SentenceInterval.ToString().PadLeft(4, '0') +
                                 NCasContentsMng.ttsOption.RestInterval.ToString().PadLeft(4, '0') +
                                 orderBizData.SelectedTtsMessage.Text;

                udpSoc.SendTo(this.LoopBackIP, (int)NCasPortID.PortIdTtsMessage, Encoding.Default.GetBytes(ttsData));
            }
            else if (tc1.AlarmKind == NCasDefineOrderKind.DisasterBroadcast && orderBizData.SelectedDisasterBroadKind == OrderView19201080.DisasterBroadKind.Mic)
            {
                byte[] tmpBuff          = TtsControlDataMng.GetTtsPlayData();
                string teleServerIpAddr = NCasUtilityMng.INCasCommUtility.AddIpAddr(NCasUtilityMng.INCasCommUtility.MakeNetIdByAnyIp(this.provInfo.NetIdToString), 0, 0, 1, 111);
                udpSoc.SendTo(teleServerIpAddr, (int)NCasPortID.PortIdExtCallPgServer, tmpBuff);
                udpSoc.SendTo(NCasUtilityMng.INCasEtcUtility.GetIPv4(), (int)NCasPortID.PortIdExtCallPgMan, tmpBuff);
                udpSoc.SendTo(this.LoopBackIP, (int)NCasPortID.PortIdTtsControl, Encoding.Default.GetBytes("RES"));
            }
            else if (tc1.AlarmKind != NCasDefineOrderKind.DisasterBroadcast)
            {
                udpSoc.SendTo(this.LoopBackIP, (int)NCasPortID.PortIdTtsControl, Encoding.Default.GetBytes("RES"));
            }
        }
Beispiel #4
0
 /// <summary>
 /// 발령 데이터 처리 메소드
 /// </summary>
 /// <param name="orderBizData"></param>
 public void SetOrderBizData(OrderBizData orderBizData)
 {
     this.pDAlmScreenBiz.AddBizData(orderBizData);
 }
Beispiel #5
0
        protected override void OnAsyncExternProcessing(NCASBIZ.NCasType.NCasObject param)
        {
            if (param is OrderBizData)
            {
                try
                {
                    OrderBizData orderBizData = param as OrderBizData;

                    if (orderBizData.IsLocal == false)
                    {
                        return;
                    }

                    if (orderBizData.SendBuff == null)
                    {
                        NCasLoggingMng.ILogging.WriteLog("PDAlmScreenBiz", "발령이 정상적으로 처리되지 않았습니다.",
                                                         "TC " + orderBizData.AlmProtocol.TcCode.ToString() + " - " + NCasUtilityMng.INCasEtcUtility.Bytes2HexString(orderBizData.SendBuff));
                        return;
                    }

                    if (orderBizData.IsEnd == OrderView19201080.OrderDataSendStatus.First)
                    {
                        udpSoc.SendTo(this.LoopBackIP, (int)NCasPortID.PortIdTtsControl, Encoding.Default.GetBytes("RES"));
                        Thread.Sleep(500);
                    }

                    if (orderBizData.TtsOrderFlag) //마지막 발령이 TTS발령이면..
                    {
                        byte[] tmpBuff          = TtsControlDataMng.GetTtsStopData();
                        string teleServerIpAddr = NCasUtilityMng.INCasCommUtility.AddIpAddr(NCasUtilityMng.INCasCommUtility.MakeNetIdByAnyIp(this.provInfo.NetIdToString), 0, 0, 1, 111);
                        udpSoc.SendTo(teleServerIpAddr, (int)NCasPortID.PortIdExtCallPgServer, tmpBuff);
                        udpSoc.SendTo(NCasUtilityMng.INCasEtcUtility.GetIPv4(), (int)NCasPortID.PortIdExtCallPgMan, tmpBuff);
                    }

                    if (orderBizData.AllDestinationFlag || orderBizData.OrderTermAllFlag) //시도전체 발령(무조건 1개 패킷 전송)
                    {
                        this.OrderProvAll(orderBizData);
                    }
                    else //하나의 발령에 의해 여러개의 패킷을 전송해야 하는 경우..
                    {
                        if (orderBizData.IsEnd == OrderView19201080.OrderDataSendStatus.First || orderBizData.IsEnd == OrderView19201080.OrderDataSendStatus.None)
                        {
                            this.lstOrderBizData.Add(orderBizData);
                        }
                        else if (orderBizData.IsEnd == OrderView19201080.OrderDataSendStatus.End || orderBizData.IsEnd == OrderView19201080.OrderDataSendStatus.FirstEnd)
                        {
                            this.lstOrderBizData.Add(orderBizData);

                            if (orderBizData.OrderTermFlag || orderBizData.OrderTermGroupFlag || orderBizData.OrderDistTermFlag) //단말개별 발령
                            {
                                this.OrderTerm();
                            }
                            else if (orderBizData.OrderDistFlag || orderBizData.OrderDistGroupFlag || orderBizData.OrderDistTermAllFlag) //시군 발령
                            {
                                this.OrderDist();
                            }

                            this.lstOrderBizData.Clear();
                        }
                    }
                }
                catch (Exception ex)
                {
                    NCasLoggingMng.ILoggingException.WriteException("PDAlmScreenBiz", "PDAlmScreenBiz.OnAsyncExternProcessing Method - OrderBizData", ex);
                }
            }
            else if (param is NCasProtocolBase)
            {
                try
                {
                    NCasProtocolBase nCasPlcProtocolBase = param as NCasProtocolBase;
                    byte[]           buff = NCasProtocolFactory.MakeUdpFrame(nCasPlcProtocolBase);

                    if (nCasPlcProtocolBase.TcCode == NCasDefineTcCode.None)
                    {
                        NCasLoggingMng.ILogging.WriteLog("PDAlmScreenBiz", "NCasPlcProtocolFactory.TcCode is NCasDefineTcCode.None");
                        return;
                    }

                    if (buff == null)
                    {
                        NCasLoggingMng.ILogging.WriteLog("PDAlmScreenBiz", "buff is null");
                        return;
                    }

                    this.udpSoc.SendTo(this.LoopBackIP, (int)NCasPipes.PipeNccDevAlmKey, buff);
                }
                catch (Exception ex)
                {
                    NCasLoggingMng.ILoggingException.WriteException("PDAlmScreenBiz", "PDAlmScreenBiz.OnAsyncExternProcessing Method - NCasPlcProtocolBase", ex);
                }
            }
        }