Ejemplo n.º 1
0
        private void StartEngine()
        {
            if (engineClient == null)
            {
                EngineLogin login = new EngineLogin();
                login.LocalIp    = "127.0.0.1";
                login.LocalPort  = 2323;
                login.EngineIp   = "127.0.0.1";
                login.EnginePort = 3456;
                if (login.Valid() == false)
                {
                    MessageBox.Show("本地Ip和对端Ip必须是同一个Ip段的");
                    return;
                }

                engineClient = new PositionEngineClient();
                //engineClient.Logs = Logs;
                engineClient.IsWriteToDb = true;
                engineClient.StartConnectEngine(login);
                engineClient.NewAlarmsFired += EngineClient_NewAlarmsFired;
            }
        }
        private void Start()
        {
            if (engineClient == null)
            {
                EngineLogin login = new EngineLogin();
                login.LocalIp    = TbLocalIp.Text;
                login.LocalPort  = TbLocalPort.Text.ToInt();
                login.EngineIp   = TbEngineIp.Text;
                login.EnginePort = TbEnginePort.Text.ToInt();
                if (login.Valid() == false)
                {
                    MessageBox.Show("本地Ip和对端Ip必须是同一个Ip段的");
                    return;
                }

                engineClient             = new PositionEngineClient();
                engineClient.Logs        = Logs;
                engineClient.IsWriteToDb = (bool)CbWriteToDb.IsChecked;
                engineClient.StartConnectEngine(login);
                engineClient.NewAlarmsFired += EngineClient_NewAlarmsFired;
            }
        }