Esempio n. 1
0
        public frmStarter()
        {
            InitializeComponent();
            this.EnableGlass = false;

            LOCAL_ADDRESS = new IPEndPoint(_GetLocalIP(), PORT);
            m_udpClient = new UdpClient(LOCAL_ADDRESS);

            BreakInAlert += new SensorDataRcvEventHandler(OnBreakInAlert);
            ShowAlertForm = new ShowAlertFormEventHandler(OnShowAlertForm);
            CloseAlertForm = new ShowAlertFormEventHandler(OnCloseAlertForm);

            m_tmrAlert = new System.Threading.Timer(
                TmrAlertTick, "", Timeout.Infinite,	Timeout.Infinite);

            m_spFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
            m_voice = new SpVoice();
        }
Esempio n. 2
0
        private void frmStatus_Load(object sender, EventArgs e)
        {
            try
            {
                // 允许在不同线程中使用控件
                System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;

                m_UdpSensorData = new UdpClient(LOCAL_ADDRESS);

                SensorDataRcv = new SensorDataRcvEventHandler(OnSensorDataRcv);

                ThreadStart starter = new ThreadStart(threadListener);
                m_trdListener = new Thread(starter);
                m_trdListener.Start();
            }
            catch(Exception ex)
            {
                WriteLine(ex.Message);
            }
        }
Esempio n. 3
0
        public frmInteropCtrl(frmLocalCtrl f)
        {
            m_frmLocalCtrl = f;

            InitializeComponent();

            IPAddress temp = _GetLocalIP();
            if (null != temp)
            {
                SENSOR_NET_ADDRESS = new IPEndPoint(temp, 1699); // new IPEndPoint(IPAddress.Parse("192.168.1.5"), 1699);
                LOCAL_ADDRESS = new IPEndPoint(temp, 1799);
                ROBOT_ADDRESS = new IPEndPoint(IPAddress.Parse("192.168.1.7"), 1599);
            }

            GameControl[0,0] = new GameControlEventHandler(GameStatusChange_0_0);
            GameControl[0,1] = new GameControlEventHandler(GameStatusChange_0_1);
            GameControl[0,3] = new GameControlEventHandler(GameStatusChange_0_3);
            GameControl[0,4] = new GameControlEventHandler(GameStatusChange_0_4);
            GameControl[1,0] = new GameControlEventHandler(GameStatusChange_1_0);
            GameControl[1,1] = new GameControlEventHandler(GameStatusChange_1_1);
            GameControl[1,3] = new GameControlEventHandler(GameStatusChange_1_3);
            GameControl[1,4] = new GameControlEventHandler(GameStatusChange_1_4);
            GameControl[3,0] = new GameControlEventHandler(GameStatusChange_3_0);
            GameControl[3,1] = new GameControlEventHandler(GameStatusChange_3_1);
            GameControl[3,3] = new GameControlEventHandler(GameStatusChange_3_3);
            GameControl[3,4] = new GameControlEventHandler(GameStatusChange_3_4);

            CurtainControl[0] = new GestureControlEventHandler(CurtainClose);
            CurtainControl[1] = new GestureControlEventHandler(CurtainOpen);
            CurtainControl[2] = new GestureControlEventHandler(CurtainHold);

            LightControl[0] = new GestureControlEventHandler(LightHold);
            LightControl[1] = new GestureControlEventHandler(LightShift);

            DtcDataRcv += new SensorDataRcvEventHandler(OnDtcDataRcv);
        }