Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public LostWMsgMng()
 {
     datamng   = DataManager.getInstance();
     soc       = SocketClient.getInstance();
     secession = new Secession();
 }
Exemplo n.º 3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            try
            {
                // 재실행 방지 코드
                bool  executeProc;
                Mutex mutex = new Mutex(true, Application.ProductName, out executeProc);

                if (!executeProc)
                {
                    //MessageBox.Show("방송 DMB송출 시스템이 이미 실행중입니다.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //this.Dispose();
                    //Application.Exit();
                    //return;
                }

                DmbBizActivator.Active(DmbDefineActivatorCode.ForProv);
                TcpProfileMng.LoadNavProfileConfig();
                TcpProfileMng.LoadSpProfileConfig();
                this.SetServerState(); //서버상태 부분

                this.logMng = new LogManager();
                this.logMng.Dir_Mng();

                DmbProtocolCmdP protoP = DmbProtocolFactory.CreateDmbProtocol(DmbDefineCmd.CmdP) as DmbProtocolCmdP;
                protoP.IP       = DMBBIZ.DmbUtility.DmbUtilityMng.IDmbEtcUtility.GetIPv4();
                this.forNaviSoc = new DmbNetSessionClientMng();
                this.forNaviSoc.PollingDatas = DmbProtocolFactory.MakeFrame(protoP);

                foreach (TcpProfileData eachTcpProfileData in TcpProfileMng.LstNavTcpProfileData)
                {
                    DmbProfile profileForDmb = new DmbProfile();
                    profileForDmb.IpAddr = eachTcpProfileData.IpAddr;
                    profileForDmb.Port   = eachTcpProfileData.Port;
                    profileForDmb.Name   = "ForNav";

                    this.forNaviSoc.AddProfile(profileForDmb);
                }

                this.forNaviSoc.ConnectNetSessionClient += new DmbNetSessionConnectEventHandler(forNaviSoc_ConnectNetSessionClient);
                this.forNaviSoc.RecvNetSessionClient    += new DmbNetSessionRecvEventHandler(forNaviSoc_RecvNetSessionClient);
                this.forNaviSoc.CloseNetSessionClient   += new DmbNetSessionCloseEventHandler(forNaviSoc_CloseNetSessionClient);

                this.forSpSoc = new DmbNetSessionClientMng();
                this.forSpSoc.PollingDatas = DmbProtocolFactory.MakeFrame(protoP);

                foreach (TcpProfileData eachTcpProfileData in TcpProfileMng.LstSpTcpProfileData)
                {
                    DmbProfile profileForWeb = new DmbProfile();
                    profileForWeb.IpAddr = eachTcpProfileData.IpAddr;
                    profileForWeb.Port   = eachTcpProfileData.Port;
                    profileForWeb.Name   = "ForSp";

                    this.forSpSoc.AddProfile(profileForWeb);
                }

                this.forSpSoc.ConnectNetSessionClient += new DmbNetSessionConnectEventHandler(forSpSoc_ConnectNetSessionClient);
                this.forSpSoc.RecvNetSessionClient    += new DmbNetSessionRecvEventHandler(forSpSoc_RecvNetSessionClient);
                this.forSpSoc.CloseNetSessionClient   += new DmbNetSessionCloseEventHandler(forSpSoc_CloseNetSessionClient);

                this.forNaviSoc.StartSessionClientMng();
                this.forSpSoc.StartSessionClientMng();

                this.datamanager = DataManager.getInstance();
                this.Text       += " " + DMBBIZ.DmbUtility.DmbUtilityMng.IDmbEtcUtility.GetVersionInfo();
                //this.Text += this.mainVersionStr;
                mainviewform = new MainViewForm();
                secession    = new Secession();
                recvmng      = RecvMng.getInstance();
                serialMng    = SerialMng.getInstance();
                tcpcheck     = new TcpCheck();

                mainviewform.MdiParent      = this;
                mainviewform.Dock           = DockStyle.Fill;
                MainToolStripButton.Checked = true;
                mainviewform.Show();

                this.tcpcheck.ConnectionCheckEvt += new TcpCheck.ConnectionCheckHandle(tcpcheck_ConnectionCheckEvt);
                this.tcpconnect(); //tcp통신연결 부분
            }
            catch (Exception ex)
            {
                Console.WriteLine("MainForm_Load - " + ex.Message);
            }
        }