Exemplo n.º 1
0
	//--------------------------------------
	// INITIALIZE
	//--------------------------------------

	void Awake() {

		instance = this;


		GameCenterManager.OnAuthFinished += OnAuthFinished;
		GameCenterManager.init ();



		b = gameObject.AddComponent<ConnectionButton> ();
		b.enabled = false;

		d = gameObject.AddComponent<DisconnectButton> ();
		d.enabled = false;

		m = gameObject.GetComponent<ClickManager> ();
		m.enabled = false;


		GameCenterMultiplayer.instance.addEventListener (GameCenterMultiplayer.PLAYER_DISCONNECTED, OnGCPlayerDisconnected);

		GameCenterMultiplayer.OnMatchStarted += OnGCMatchStart;

	}
Exemplo n.º 2
0
        private void ConnectButton_Click(object sender, EventArgs e)
        {
            PortSettings();
            try
            {
                //sp.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);
                //open serial port
                sp.Open();

                //set read time out to 500 ms
                // sp.ReadTimeout = 100;
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            if (sp.IsOpen)
            {
                MessageBox.Show("serial port has open");
                connectSp = true;
                ConnectButton.Hide();
                DisconnectButton.Show();
                RefreshButton.Hide();
            }
            else
            {
                MessageBox.Show("faild to open serial port");
                connectSp = false;
                ConnectButton.Show();
                DisconnectButton.Hide();
                RefreshButton.Show();
            }
        }
Exemplo n.º 3
0
        void ReleaseDesignerOutlets()
        {
            if (ConnectBluetoothButton != null)
            {
                ConnectBluetoothButton.Dispose();
                ConnectBluetoothButton = null;
            }

            if (DisconnectButton != null)
            {
                DisconnectButton.Dispose();
                DisconnectButton = null;
            }

            if (MoveDownButton != null)
            {
                MoveDownButton.Dispose();
                MoveDownButton = null;
            }

            if (MoveLeftButton != null)
            {
                MoveLeftButton.Dispose();
                MoveLeftButton = null;
            }

            if (MovementView != null)
            {
                MovementView.Dispose();
                MovementView = null;
            }

            if (MoveRightButton != null)
            {
                MoveRightButton.Dispose();
                MoveRightButton = null;
            }

            if (MoveUpButton != null)
            {
                MoveUpButton.Dispose();
                MoveUpButton = null;
            }

            if (OptionsView != null)
            {
                OptionsView.Dispose();
                OptionsView = null;
            }
        }
 public void                            UpdatePanel()
 {
     if (User != null && User.UserID > 0)
     {
         DisconnectButton.SetActive(true);
         Username    = User.Username;
         Realname    = User.RealName;
         NetworkInfo = User.NetConnection.address + "  (" + User.NetID.ToString() + ")";
     }
     else
     {
         DisconnectButton.SetActive(false);
     }
 }
Exemplo n.º 5
0
        void ReleaseDesignerOutlets()
        {
            if (ChargeCardButton != null)
            {
                ChargeCardButton.Dispose();
                ChargeCardButton = null;
            }

            if (ConnectButton != null)
            {
                ConnectButton.Dispose();
                ConnectButton = null;
            }

            if (DisconnectButton != null)
            {
                DisconnectButton.Dispose();
                DisconnectButton = null;
            }

            if (GetDeviceInfoButton != null)
            {
                GetDeviceInfoButton.Dispose();
                GetDeviceInfoButton = null;
            }

            if (RefNumText != null)
            {
                RefNumText.Dispose();
                RefNumText = null;
            }

            if (RefundButton != null)
            {
                RefundButton.Dispose();
                RefundButton = null;
            }

            if (StatusText != null)
            {
                StatusText.Dispose();
                StatusText = null;
            }
        }
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------
    void Awake()
    {
        instance = this;

        GameCenterManager.dispatcher.addEventListener (GameCenterManager.GAME_CENTER_PLAYER_AUTHENTICATED, OnPlayerAuth);
        GameCenterManager.init ();

        b = gameObject.AddComponent<ConectionButton> ();
        b.enabled = false;

        d = gameObject.AddComponent<DisconnectButton> ();
        d.enabled = false;

        m = gameObject.GetComponent<ClickManager> ();
        m.enabled = false;

        GameCenterMultiplayer.instance.addEventListener (GameCenterMultiplayer.PLAYER_DISCONNECTED, OnGCPlayerDisconnected);
        GameCenterMultiplayer.instance.addEventListener (GameCenterMultiplayer.MATCH_STARTED, OnGCMatchStart);
    }
Exemplo n.º 7
0
 private void DisconnectButton_Click(object sender, EventArgs e)
 {
     try
     {
         connectSp = false;
         sp.Close();
         ConnectButton.Show();
         DisconnectButton.Hide();
         RefreshButton.Show();
     }
     catch (System.Exception ex)
     {
         connectSp = true;
         MessageBox.Show("faild to close serial port");
         ConnectButton.Hide();
         DisconnectButton.Show();
         RefreshButton.Hide();
     }
 }
Exemplo n.º 8
0
        private void Form1_Load(object sender, EventArgs e)
        {
            haar   = new HaarCascade("haarcascade_frontalface_alt2.xml");
            sensor = KinectSensor.KinectSensors[0];
            sensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
            sensor.DepthStream.Enable(DepthImageFormat.Resolution320x240Fps30);
            sensor.SkeletonStream.Enable();
            running = false;
            PosX    = 320;
            disT    = false;
            try
            {
                sensor.Start();
            }
            catch {
                MessageBox.Show("Sensor not star");
            }
            try
            {
                sensor.ColorFrameReady += FrameReady;
            }
            catch
            {
                MessageBox.Show("colour frame not Found");
            }
            try
            {
                sensor.DepthFrameReady += DepthFrameReady;
            }
            catch
            {
                MessageBox.Show("Defth frame not Found");
            }
            posY = 0;
            sensor.ElevationAngle = 0;
            connectSp             = false;
            DisconnectButton.Hide();


            Application.Idle += new EventHandler(take1);
        }
Exemplo n.º 9
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------

    void Awake()
    {
        instance = this;

        GameCenterManager.dispatcher.addEventListener(GameCenterManager.GAME_CENTER_PLAYER_AUTHENTICATED, OnPlayerAuth);
        GameCenterManager.init();



        b         = gameObject.AddComponent <ConectionButton> ();
        b.enabled = false;

        d         = gameObject.AddComponent <DisconnectButton> ();
        d.enabled = false;

        m         = gameObject.GetComponent <ClickManager> ();
        m.enabled = false;


        GameCenterMultiplayer.instance.addEventListener(GameCenterMultiplayer.PLAYER_DISCONNECTED, OnGCPlayerDisconnected);
        GameCenterMultiplayer.instance.addEventListener(GameCenterMultiplayer.MATCH_STARTED, OnGCMatchStart);
    }
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------

    void Awake()
    {
        instance = this;


        GameCenterManager.OnAuthFinished += OnAuthFinished;
        GameCenterManager.Init();



        b         = gameObject.AddComponent <ConnectionButton> ();
        b.enabled = false;

        d         = gameObject.AddComponent <DisconnectButton> ();
        d.enabled = false;

        m         = gameObject.GetComponent <ClickManagerExample> ();
        m.enabled = false;


        GameCenter_RTM.ActionPlayerStateChanged += HandleActionPlayerStateChanged;;
        GameCenter_RTM.ActionMatchStarted       += HandleActionMatchStarted;
    }
Exemplo n.º 11
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------

    void Awake()
    {
        instance = this;


        GameCenterManager.OnAuthFinished += OnAuthFinished;
        GameCenterManager.init();



        b         = gameObject.AddComponent <ConnectionButton> ();
        b.enabled = false;

        d         = gameObject.AddComponent <DisconnectButton> ();
        d.enabled = false;

        m         = gameObject.GetComponent <ClickManager> ();
        m.enabled = false;


        GameCenterMultiplayer.instance.addEventListener(GameCenterMultiplayer.PLAYER_DISCONNECTED, OnGCPlayerDisconnected);

        GameCenterMultiplayer.OnMatchStarted += OnGCMatchStart;
    }
Exemplo n.º 12
0
	//--------------------------------------
	// INITIALIZE
	//--------------------------------------

	void Awake() {

		instance = this;


		GameCenterManager.OnAuthFinished += OnAuthFinished;
		GameCenterManager.Init ();



		b = gameObject.AddComponent<ConnectionButton> ();
		b.enabled = false;

		d = gameObject.AddComponent<DisconnectButton> ();
		d.enabled = false;

		m = gameObject.GetComponent<ClickManager> ();
		m.enabled = false;


		GameCenter_RTM.ActionPlayerStateChanged += HandleActionPlayerStateChanged;;
		GameCenter_RTM.ActionMatchStarted += HandleActionMatchStarted;

	}
Exemplo n.º 13
0
 void ReleaseDesignerOutlets()
 {
     if (ConnectButton != null)
     {
         ConnectButton.Dispose();
         ConnectButton = null;
     }
     if (ConnectionStateLabel != null)
     {
         ConnectionStateLabel.Dispose();
         ConnectionStateLabel = null;
     }
     if (CurrentTagEPCLabel != null)
     {
         CurrentTagEPCLabel.Dispose();
         CurrentTagEPCLabel = null;
     }
     if (DisconnectButton != null)
     {
         DisconnectButton.Dispose();
         DisconnectButton = null;
     }
     if (GrokPluggedInStateLabel != null)
     {
         GrokPluggedInStateLabel.Dispose();
         GrokPluggedInStateLabel = null;
     }
     if (NewTagEPCTextField != null)
     {
         NewTagEPCTextField.Dispose();
         NewTagEPCTextField = null;
     }
     if (ReadTagsStartButton != null)
     {
         ReadTagsStartButton.Dispose();
         ReadTagsStartButton = null;
     }
     if (ReadTagsStopButton != null)
     {
         ReadTagsStopButton.Dispose();
         ReadTagsStopButton = null;
     }
     if (SetTagButton != null)
     {
         SetTagButton.Dispose();
         SetTagButton = null;
     }
     if (StartEditingButton != null)
     {
         StartEditingButton.Dispose();
         StartEditingButton = null;
     }
     if (StopEditingButton != null)
     {
         StopEditingButton.Dispose();
         StopEditingButton = null;
     }
     if (TagsTextView != null)
     {
         TagsTextView.Dispose();
         TagsTextView = null;
     }
 }
Exemplo n.º 14
0
 private void Client_ServerClosedConnection(object sender, EventArgs e)
 {
     Log("Server Closed connection...");
     ConnectButton.BeginInvoke(new MethodInvoker(() => { ConnectButton.Enabled = true; }));
     DisconnectButton.BeginInvoke(new MethodInvoker(() => { DisconnectButton.Enabled = false; }));
 }
Exemplo n.º 15
0
 private void Client_SocketError(object sender, Core.Communication.EventArguments.SocketErrorEventArgs e)
 {
     Log("Connection Error: " + e.SocketError);
     ConnectButton.BeginInvoke(new MethodInvoker(() => { ConnectButton.Enabled = true; }));
     DisconnectButton.BeginInvoke(new MethodInvoker(() => { DisconnectButton.Enabled = false; }));
 }
Exemplo n.º 16
0
 private void Client_Connected(object sender, EventArgs e)
 {
     Log("connection to server established");
     ConnectButton.BeginInvoke(new MethodInvoker(() => { ConnectButton.Enabled = false; }));
     DisconnectButton.BeginInvoke(new MethodInvoker(() => { DisconnectButton.Enabled = true; }));
 }