Example #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try
            {
                NCasBizActivator.Active(NCASBIZ.NCasDefine.NCasDefineActivatorCode.ForProv);
                this.InitMmfInfo(NCasUtilityMng.INCasEtcUtility.GetIPv4());
                NCasEnvironmentMng.NCasEnvConfig.NetSessionContext.UseConnectionChecking = true;
                NCasEnvironmentMng.NCasEnvConfig.NetSessionContext.UsePolling            = true;
                NCasEnvironmentMng.NCasEnvConfig.LoggingContext.UseDebugLogging          = true;

                NCasProfile profile = new NCasProfile();

#if release
                profile.IpAddr = NCasUtilityMng.INCasCommUtility.AddIpAddr(NCasUtilityMng.INCasEtcUtility.GetIPv4(), 0, 0, 0, 1);
#endif

#if debug
                profile.IpAddr = "158.181.17.226";
#endif

                profile.Port = this.PDMainSessionPort;
                profile.Name = "PDMainScreen";

                this.pDMainTcpServer = new NCasNetSessionServerMng();
                this.pDMainTcpServer.PollingDatas          = new byte[] { 0x01 };
                this.pDMainTcpServer.RecvNetSessionClient += new NCasNetSessionRecvEventHandler(pDMainTcpServer_RecvNetSessionClient);
                this.pDMainTcpServer.AddProfile(profile);
                this.pDMainTcpServer.StartSessionServerMng(NCasUtilityMng.INCasEtcUtility.GetIPv4(), this.PDMainSessionPort);

                this.udpCasMon = new NCasUdpSocket();
                this.udpCasMon.Listen(IP_LOOPBACK, (int)NCasPortID.PortIdRecvCasMonData);
                this.udpCasMon.ReceivedData += new NCasUdpRecvEventHandler(udpCasMon_ReceivedData);

                this.recvUdpKey = new NCasUdpSocket();
                this.recvUdpKey.Listen(this.IP_LOOPBACK, (int)NCasPipes.PipePdaDevAlmKey);
                this.recvUdpKey.ReceivedData += new NCasUdpRecvEventHandler(recvUdpKey_ReceivedData);

                this.recvUdpLauncher = new NCasUdpSocket();
                this.recvUdpLauncher.Listen(this.IP_LOOPBACK, (int)NCasPipes.PipePdaScreenLauncher);
                this.recvUdpLauncher.ReceivedData += new NCasUdpRecvEventHandler(recvUdpLauncher_ReceivedData);

                DeviceStatusMng.LoadDeviceStatusDatas();
                PasswordMng.LoadPassword();
                NCasContentsMng.LoadTtsOptionFromFile();
                TtsDelayTimeMng.LoadTtsDelayTime();
                GroupContentMng.LoadGroupContent();
                DistIconMng.LoadDistIconDatas();
                DisasterBroadFlagMng.LoadDisasterBroadFlag();

                this.ttsDelayTime   = int.Parse(TtsDelayTimeMng.TtsDelayTime);
                this.pDAlmScreenBiz = new PDAlmScreenBiz(this);
                this.InitView();
                NCasAnimator.InitAnimator();
                this.OpenView(ViewKind.None);
                this.InitLogoImage(this.provInfo.Code);
                this.StartTimer(1000);
                this.Text = "민방위 시도 지진해일 경보시스템 " + NCasUtilityMng.INCasEtcUtility.GetVersionInfo();
                this.labelTotalTermCount.Text = this.provInfo.GetUsableAlarmTermCnt().ToString();

#if release
                PDevInfo pDevInfo = this.mmfMng.GetPDevInfoByIp(NCasUtilityMng.INCasEtcUtility.GetIPv4());
#endif

#if debug
                PDevInfo pDevInfo = this.mmfMng.GetPDevInfoByIp("10.96.1.231");
#endif

                if (pDevInfo == null)
                {
                    MessageBox.Show("IP가 정상적이지 않습니다.\n네트워크를 확인하세요.", "시도 지진해일 경보시스템", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    NCasLoggingMng.ILogging.WriteLog("MainForm", "IP가 정상적이지 않습니다.");
                }

                if (!(pDevInfo.DevId == NCasDefineDeviceKind.JijinAlarmCtrlSys1))
                {
                    MessageBox.Show("IP가 정상적이지 않습니다.\n네트워크를 확인하세요.", "시도 지진해일 경보시스템", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    NCasLoggingMng.ILogging.WriteLog("MainForm", "IP가 정상적이지 않습니다.");
                }
            }
            catch (Exception ex)
            {
                NCasLoggingMng.ILoggingException.WriteException("MainForm", "MainForm.OnLoad(EventArgs e) Method", ex);
                return;
            }
        }
Example #2
0
        /// <summary>
        /// OnLoad override method
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try
            {
                NCasBizActivator.Active(NCASBIZ.NCasDefine.NCasDefineActivatorCode.ForProv);
                this.InitMmfInfo(NCasUtilityMng.INCasEtcUtility.GetIPv4());
                NCasEnvironmentMng.NCasEnvConfig.NetSessionContext.UseConnectionChecking = true;
                NCasEnvironmentMng.NCasEnvConfig.NetSessionContext.UsePolling            = true;
                this.InitDualSession(NCasUtilityMng.INCasEtcUtility.GetIPv4());

                this.udpCasMon = new NCasUdpSocket();
                this.udpCasMon.Listen(IP_LOOPBACK, (int)NCasPortID.PortIdRecvCasMonData);
                this.udpCasMon.ReceivedData += new NCasUdpRecvEventHandler(udpCasMon_ReceivedData);

                this.recvUdpKey = new NCasUdpSocket();
                this.recvUdpKey.Listen(this.IP_LOOPBACK, (int)NCasPipes.PipePcaScreenPlc);
                this.recvUdpKey.ReceivedData += new NCasUdpRecvEventHandler(recvUdpKey_ReceivedData);

                this.recvUdpGis = new NCasUdpSocket();
                this.recvUdpGis.Listen(this.IP_LOOPBACK, (int)NCasPipes.PipePcaScreen);
                this.recvUdpGis.ReceivedData += new NCasUdpRecvEventHandler(recvUdpGis_ReceivedData);

                this.recvUdpLauncher = new NCasUdpSocket();
                this.recvUdpLauncher.Listen(this.IP_LOOPBACK, (int)NCasPipes.PipePcaScreenLauncher);
                this.recvUdpLauncher.ReceivedData += new NCasUdpRecvEventHandler(recvUdpLauncher_ReceivedData);

                this.recvCenterAlarm = new NCasUdpSocket();
                this.recvCenterAlarm.Listen(this.IP_LOOPBACK, (int)NCasPipes.PipePcaScreenAlm);
                this.recvCenterAlarm.ReceivedData += new NCasUdpRecvEventHandler(recvCenterAlarm_ReceivedData);

                KeyDataMng.LoadKeyDatas();
                DeviceStatusMng.LoadDeviceStatusDatas();
                PasswordMng.LoadPassword();
                GroupContentMng.LoadGroupContent();
                NCasContentsMng.LoadTtsOptionFromFile();
                TtsDelayTimeMng.LoadTtsDelayTime();
                TeleSendDelayTimeMng.LoadTeleDelayTime();

                this.ttsDelayTime  = int.Parse(TtsDelayTimeMng.TtsDelayTime);
                this.teleDelayTime = int.Parse(TeleSendDelayTimeMng.TeleDelayTime);
                this.pAlmScreenBiz = new PAlmScreenBiz(this);
                this.InitDeviceStatus();
                this.InitView();
                NCasAnimator.InitAnimator();
                this.OpenView(ViewKind.None);
                this.InitLogoImage(this.provInfo.Code);
                this.StartTimer(1000);
                this.Text = "민방위 시도 경보대시스템 " + NCasUtilityMng.INCasEtcUtility.GetVersionInfo();
                PDevInfo pDevInfo = this.mmfMng.GetPDevInfoByIp(NCasUtilityMng.INCasEtcUtility.GetIPv4());

                if (pDevInfo == null)
                {
                    MessageBox.Show("IP가 정상적이지 않습니다.\n네트워크를 확인하세요.", "시도 경보대시스템", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    NCasLoggingMng.ILogging.WriteLog("MainForm", "IP가 정상적이지 않습니다.");
                    return;
                }

                if (!(pDevInfo.DevId == NCasDefineDeviceKind.AlarmCtrlSys1 || pDevInfo.DevId == NCasDefineDeviceKind.AlarmCtrlSys2))
                {
                    MessageBox.Show("IP가 정상적이지 않습니다.\n네트워크를 확인하세요.", "시도 경보대시스템", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    NCasLoggingMng.ILogging.WriteLog("MainForm", "IP가 정상적이지 않습니다.");
                }

                NCasEnvironmentMng.NCasEnvConfig.LoggingContext.UseDebugLogging = true;
            }
            catch (Exception ex)
            {
                NCasLoggingMng.ILoggingException.WriteException("MainForm", "MainForm.OnLoad(EventArgs e) Method", ex);
                return;
            }
        }