public static Vector4 RecordSensorError(int number)
    {
        Debug.Log("RecordSensorError is done");
        return(Wii.GetBalanceBoard(number));

        // TobeFinished
    }
 void Awake()
 {
     Debug.Log("Awake called.");
     Debug.Log("Awake called.");
     Wii.StartSearch();
     Wii.WakeUp();
 }
    // Update is called once per frame
    void Update()
    {
        // - - - - FORWARD REACH CALIBRATION - - - -
        if (Input.GetMouseButtonUp(0))
        {
            CaptureArmLengthAndHeight();
        }

        // Create a new empty vector for the position of the hand
        Vector3 posn3;

        // - - - - SIDE REACH CALIBRATION - - - -
        if (GlobalControl.Instance.rightHanded)
        {
            posn3 = rightHand.transform.position;
        }
        else
        {
            posn3 = leftHand.transform.position;
        }


        // check to see if it is a new maximum
        if (posn3.x > rightReachLocation)
        {
            rightReachLocation = posn3.x;
        }
        else if (posn3.x < leftReachLocation)
        {
            leftReachLocation = posn3.x;
        }

        Vector2 currentCoP = Task.CoPtoCM(Wii.GetCenterOfBalance(0));
    }
Esempio n. 4
0
 public void BeginSearch()
 {
     //searching = true;
     Wii.StartSearch();
     theText.text   = "I'm looking.";
     Time.timeScale = 1.0f;
 }
    // Update is called once per frame
    void Update()
    {
        List <string> stringList = new List <string>();

        stringList.Add("remoteCount:" + Wii.GetRemoteCount());
        for (int i = 0; i < Wii.GetRemoteCount(); ++i)
        {
            if (Wii.IsActive(i) && Wii.GetExpType(i) == 3)
            {
                Vector4 theBalanceBoard = Wii.GetBalanceBoard(i);
                Vector2 theCenter       = Wii.GetCenterOfBalance(i);
                float   topWeight       = theBalanceBoard.x + theBalanceBoard.y;
                float   bottomWeight    = theBalanceBoard.z + theBalanceBoard.w;
                float   topBottomDiff   = topWeight - bottomWeight;
                stringList.Add("totalWeight:  " + Wii.GetTotalWeight(i) + " kg");
                stringList.Add("centerX:      " + theCenter.x);
                stringList.Add("centerY:      " + theCenter.y);
                stringList.Add("topRight:     " + theBalanceBoard.x + " kg");
                stringList.Add("topLeft:      " + theBalanceBoard.y + " kg");
                stringList.Add("bottomRight:  " + theBalanceBoard.z + " kg");
                stringList.Add("bottomLeft:   " + theBalanceBoard.w + " kg");
                stringList.Add("topWeight:    " + topWeight + " kg");
                stringList.Add("bottomWeight: " + bottomWeight + " kg");
                stringList.Add("topBottomDiff:" + topBottomDiff + " kg");
            }
        }
        consoleText.text = string.Join("\n", stringList);
    }
Esempio n. 6
0
 public void BeginSearch()
 {
     //searching = true;
     Wii.StartSearch();
     Debug.Log("I'm looking.");
     Time.timeScale = 1.0f;
 }
    // Start is called before the first frame update
    void Start()
    {
        Time.fixedDeltaTime = PlayerPrefs.GetFloat("DeltaTime");
        Board0 = gameObject.AddComponent <GenericBoard>();
        Board1 = gameObject.AddComponent <GenericBoard>();
        Board2 = gameObject.AddComponent <GenericBoard>();
        Board3 = gameObject.AddComponent <GenericBoard>();
        Wii.StartSearch();
        Wii.WakeUp();
        Boards.Add(Board0);
        Boards.Add(Board1);
        Boards.Add(Board2);
        Boards.Add(Board3);
        Board0.BoardNumber   = 0;
        Board1.BoardNumber   = 1;
        Board2.BoardNumber   = 2;
        Board3.BoardNumber   = 3;
        updatetime           = 0.02F;
        Board0.RotationAngle = PlayerPrefs.GetFloat("Board0_angle");
        Board1.RotationAngle = PlayerPrefs.GetFloat("Board1_angle");
        Board2.RotationAngle = 0;
        Board3.RotationAngle = 0;
        Board0.Board_length  = PlayerPrefs.GetFloat("Board_Length");
        Board0.Board_width   = PlayerPrefs.GetFloat("Board_Width");
        Board1.Board_length  = PlayerPrefs.GetFloat("Board_Length");
        Board1.Board_width   = PlayerPrefs.GetFloat("Board_Width");
        Board2.Board_length  = PlayerPrefs.GetFloat("Board_Length");
        Board2.Board_width   = PlayerPrefs.GetFloat("Board_Width");
        Board3.Board_length  = PlayerPrefs.GetFloat("Board_Length");
        Board3.Board_width   = PlayerPrefs.GetFloat("Board_Width");
        Board0.BoardPosition.Set(0f, 0f);
        Board1.BoardPosition.Set(PlayerPrefs.GetFloat("Board1_x"), PlayerPrefs.GetFloat("Board1_y"));
        Board0.Board_Force_error_storage.Set(0.0f, 0.0f, 0.0f, 0.0f);
        Board1.Board_Force_error_storage.Set(0.0f, 0.0f, 0.0f, 0.0f);



        foreach (GenericBoard item in Boards)
        {
            // Calculate Initial Sensor Position


            item.SensorXRelative.x = Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length - Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;
            item.SensorXRelative.y = Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length + Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;

            item.SensorYRelative.x = -Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length - Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;
            item.SensorYRelative.y = -Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length + Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;

            item.SensorZRelative.x = Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length + Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;
            item.SensorZRelative.y = Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length - Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;

            item.SensorWRelative.x = -Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length + Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;
            item.SensorWRelative.y = -Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length - Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;

            item.SensorXinGlobal = item.BoardPosition + item.SensorXRelative;
            item.SensorYinGlobal = item.BoardPosition + item.SensorYRelative;
            item.SensorZinGlobal = item.BoardPosition + item.SensorZRelative;
            item.SensorWinGlobal = item.BoardPosition + item.SensorWRelative;
        }
    }
Esempio n. 8
0
 public void OnWiimoteDiscovered(int thisRemote)
 {
     Debug.Log("found this one: " + thisRemote);
     if (!Wii.IsActive(whichRemote))
     {
         whichRemote = thisRemote;
     }
 }
 // Update is called once per frame
 void Update()
 {
     wiiBB = CoPtoCM(Wii.GetCenterOfBalance(0));
     //Debug.Log(CoPtoCM(Wii.GetCenterOfBalance(0)));
     //paddleX = Mathf.Clamp(wiiBB.x, transform.TransformPoint(westEdge).x, transform.TransformPoint(eastEdge).x);
     paddleX            = Mathf.Clamp(wiiBB.x, leftBound, rightBound);
     transform.position = new Vector3(paddleX, 22.04f, -3.81f);
 }
Esempio n. 10
0
    // Update is called once per frame
    void Update()
    {
        if (curGameState == GameState.PRE_GAME)
        {
            countdown = countdown - Time.deltaTime;
            feedbackCanvas.UpdateCountdownText(countdown);

            Vector2 currentCoP = CoPtoCM(Wii.GetCenterOfBalance(0));
            basket.GetComponent <Basket>().UpdatePosition(currentCoP);

            // Start game when countdown hits zero
            if (countdown < 0)
            {
                curGameState = GameState.GAME;
                fruitSpawner.SpawnFruit();
                trialTime = 0;
            }
        }
        else if (curGameState == GameState.GAME)
        {
            // Update canvas for the user to see score and time remaining
            timeRemaining = timeRemaining - Time.deltaTime;
            feedbackCanvas.UpdateTimeText(timeRemaining);
            feedbackCanvas.UpdateScoreText(score);

            // Update COP and move basket
            Vector2 currentCoP = CoPtoCM(Wii.GetCenterOfBalance(0));
            basket.GetComponent <Basket>().UpdatePosition(currentCoP);

            CheckBasketObstacle();

            // tick up trial time and check if a new fruit should be spawned
            trialTime = trialTime + Time.deltaTime;
            if (trialTime > trialLength)
            {
                GetComponent <SoundEffectPlayer>().PlaySpawnSound();
                fruitSpawner.SpawnFruit();
                trialTime = 0f;
            }

            if (timeRemaining < 0f)
            {
                curGameState = GameState.GAME_OVER;
                feedbackCanvas.DisplayGameOverText();
            }

            GetComponent <DataHandler>().recordContinuous(Time.time, currentCoP);
        }
        else
        {
            // Game is over
            if (Input.GetKeyUp(KeyCode.Space))
            {
                SceneManager.LoadScene("Menu");
            }
        }
    }
Esempio n. 11
0
    // Zeroes center of balance to the position on which a person is standing on the board
    public void CalibrateCenterOfBalance()
    {
        float   weight             = Wii.GetTotalWeight(remote) / 4;
        Vector4 weigthDistribution = Wii.GetBalanceBoard(remote);

        weightOffset = new Vector4(weight, weight, weight, weight) - weigthDistribution;

        balanceOffset = (float)Wii.GetCenterOfBalance(remote).y;
    }
    // Start is called before the first frame update
    void Start()
    {
        Wii.StartSearch();
        Wii.WakeUp();
        Boards.Add(Board0);
        Boards.Add(Board1);
        Boards.Add(Board2);
        Boards.Add(Board3);
        Board0.BoardNumber   = 0;
        Board1.BoardNumber   = 1;
        Board2.BoardNumber   = 2;
        Board3.BoardNumber   = 3;
        updatetime           = 0.02F;
        Board0.RotationAngle = 90;
        Board1.RotationAngle = 90;
        Board2.RotationAngle = 0;
        Board3.RotationAngle = 0;
        Board0.Board_length  = 400f;
        Board0.Board_width   = 200f;
        Board1.Board_length  = 400f;
        Board1.Board_width   = 200f;
        Board2.Board_length  = 400f;
        Board2.Board_width   = 200f;
        Board3.Board_length  = 400f;
        Board3.Board_width   = 200f;
        Board0.BoardPosition.Set(0f, 0f);
        Board1.BoardPosition.Set(500f, 0f);



        foreach (GenericBoard item in Boards)
        {
            // Calculate Initial Sensor Position
            item.RotationMatrix = new float[, ] {
                { Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle), -Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) }, { Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle), Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) }
            };

            item.SensorXRelative.x = Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length - Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;
            item.SensorXRelative.y = Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length + Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;

            item.SensorYRelative.x = -Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length - Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;
            item.SensorYRelative.y = -Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length + Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;

            item.SensorZRelative.x = Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length + Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;
            item.SensorZRelative.y = Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length - Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;

            item.SensorWRelative.x = -Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length + Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;
            item.SensorWRelative.y = -Mathf.Sin(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_length - Mathf.Cos(Mathf.Deg2Rad * item.RotationAngle) * 1 / 2 * item.Board_width;

            item.SensorXinGlobal = item.BoardPosition + item.SensorXRelative;
            item.SensorYinGlobal = item.BoardPosition + item.SensorYRelative;
            item.SensorZinGlobal = item.BoardPosition + item.SensorZRelative;
            item.SensorWinGlobal = item.BoardPosition + item.SensorWRelative;
        }
    }
Esempio n. 13
0
 void Update()
 {
     for (int i = 0; i < Wii.GetRemoteCount(); ++i)
     {
         if (Wii.IsActive(i) && Wii.GetExpType(i) == wiiExpType)
         {
             remainBatteryBar.value = Wii.GetBattery(i);
             break;
         }
     }
 }
 /// <summary>
 /// Update can be removed once Wii issue is resolved and whether or not Wii is connected does
 /// not need to be displayed.
 /// </summary>
 void Update()
 {
     if (Wii.GetRemoteCount() == 0)
     {
         isWiiConnected.text = "Wii not connected.";
     }
     else
     {
         isWiiConnected.text = "Wii connected.";
     }
 }
Esempio n. 15
0
 // Sets max needed leaning values to 70% (forward) and 80% (backward) from the actual leaning done in reality
 public void GetLeanLimits(bool setLeanForward)
 {
     if (setLeanForward == true)
     {
         maxZoneForward = ((float)Wii.GetCenterOfBalance(remote).y - balanceOffset) * 0.7f;
     }
     else
     {
         maxZoneBackward = ((float)Wii.GetCenterOfBalance(remote).y - balanceOffset) * 0.8f;
     }
 }
Esempio n. 16
0
 void Update()
 {
     // If connected to a board, send data
     if (Wii.IsActive(remote))
     {
         if (allowSending)
         {
             SendWheelRatio();
         }
     }
 }
Esempio n. 17
0
 // Use this for initialization
 void OnEnable()
 {
     // Connects to a board
     if (!Wii.IsActive(remote))
     {
         Debug.Log("Start searching");
         Wii.StartSearch();
     }
     Wii.OnDiscoveryFailed     += OnDiscoveryFailed;
     Wii.OnWiimoteDiscovered   += OnWiimoteDiscovered;
     Wii.OnWiimoteDisconnected += OnWiimoteDisconnected;
 }
Esempio n. 18
0
    // Update is called once per frame
    void Update()
    {
        if (paddle.GetComponent <MovePaddle>().CoPtoCMRaw(Wii.GetCenterOfBalance(0)).x < leftMax)
        {
            leftMax = paddle.GetComponent <MovePaddle>().CoPtoCMRaw(Wii.GetCenterOfBalance(0)).x;
        }

        if (paddle.GetComponent <MovePaddle>().CoPtoCMRaw(Wii.GetCenterOfBalance(0)).x > rightMax)
        {
            rightMax = paddle.GetComponent <MovePaddle>().CoPtoCMRaw(Wii.GetCenterOfBalance(0)).x;
        }
    }
Esempio n. 19
0
 // WiiFitに接続している番号を保持して処理回数を減らす
 public int?GetBalanceBoardConnectingIndex()
 {
     for (int i = 0; i < Wii.GetRemoteCount(); ++i)
     {
         // GetExpType == 3 がBaranceBoard
         if (Wii.IsActive(i) && Wii.GetExpType(i) == 3)
         {
             return(i);
         }
     }
     return(null);
 }
Esempio n. 20
0
 // WiiFitに接続しているかどうか判定
 public bool IsBalanceBoardConnecting()
 {
     for (int i = 0; i < Wii.GetRemoteCount(); ++i)
     {
         // GetExpType == 3 がBaranceBoard
         if (Wii.IsActive(i) && Wii.GetExpType(i) == 3)
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 21
0
 // WiiFitのバッテリー残量
 public float GetBalanceBoardBattery()
 {
     for (int i = 0; i < Wii.GetRemoteCount(); ++i)
     {
         // GetExpType == 3 がBaranceBoard
         if (Wii.IsActive(i) && Wii.GetExpType(i) == 3)
         {
             return(Wii.GetBattery(i));
         }
     }
     return(0f);
 }
Esempio n. 22
0
    public void FixedUpdate()
    {
        totalRemotes = Wii.GetRemoteCount();

        for (int i = 0; i < 4; i++)
        {
            if (Wii.IsActive(i))
            {
                Vector3 wiiAccel = Wii.GetWiimoteAcceleration(i);
                ParseData(oars[i], wiiAccel);
            }
        }
    }
Esempio n. 23
0
    public void ChooseRemote(Button remotebutton)
    {
        whichRemote = int.Parse(remotebutton.gameObject.name);

        if (!Wii.IsActive(whichRemote))
        {
            if (Wii.IsSearching())
            {
                theText.text = ("I'm looking.");
            }
            else
            {
                theText.text = ("remote " + whichRemote + " is not active.");
            }
        }
    }
Esempio n. 24
0
    // Update is called once per frame
    void Update()
    {
        bool isPointerActive = false;

        for (int i = 0; i < Wii.GetRemoteCount(); ++i)
        {
            if (Wii.IsActive(i) && Wii.GetExpType(i) == 3)
            {
                isPointerActive = true;
                Vector2 theCenter = Wii.GetCenterOfBalance(i);
                pointerImageRect.transform.position = new Vector3((1 + theCenter.x) * Screen.width / 2, (1 + theCenter.y) * Screen.height / 2);
                break;
            }
        }
        pointerImageRect.gameObject.SetActive(isPointerActive);
    }
Esempio n. 25
0
    void FixedUpdate()
    {
        if (Wii.IsActive(whichRemote))            //remote is on
        {
            if (Wii.GetExpType(whichRemote) == 3) //balance board is being used
            {
                Vector4 theBalanceBoard = Wii.GetBalanceBoard(whichRemote);
                Vector2 theCenter       = Wii.GetCenterOfBalance(whichRemote);
                Debug.Log(theBalanceBoard + " " + theCenter);
                Debug.Log("the total weight is: k" + Wii.GetTotalWeight(whichRemote));

                // move self according the center of gravity
                rigidbody.AddForce(new Vector3(theCenter.x * speed, 0, theCenter.y * speed));
            }
        }
    }
Esempio n. 26
0
    // Update is called once per frame
    void Update()
    {
        Wii.WakeUp();
        Wii.StartSearch();

        if (Measurement.WhetherStart == true)
        {
            human.transform.localPosition = new Vector2(800f * ((Measurement.GlobalCOP.x + (0.5f * Measurement.Board0.Board_width)) / (Measurement.Board0.Board_width + Measurement.Board1.BoardPosition.x)),
                                                        400f * ((Measurement.GlobalCOP.y + (0.5f * Measurement.Board0.Board_length))/ (Measurement.Board0.Board_length)));
        }
        if (Measurement.WhetherStart == false)
        {
            human.transform.localPosition = new Vector2(0, 0);

        }
    }
    // Update is called once per frame
    void FixedUpdate()
    {
        if (Input.GetKeyDown(KeyCode.T))
        {
            Debug.Log("Test Mode Begins");
            testmode = true;
        }
        if (Input.GetKeyDown(KeyCode.S))
        {
            Debug.Log("Test Mode Stops");
            testmode = false;
        }

        if (testmode == false)
        {
            DeviceNumbers = Wii.GetRemoteCount();
            foreach (GenericBoard item in Boards)

            {
                item.Board_Force      = Wiiboard.Board_ForceRead(item.BoardNumber);
                item.CalibratedForce  = EliminateError(item);
                item.Board_Totalforce = item.CalculateTotalForce();
            }
            Debug.Log(Board0.Board_Force);
            Debug.Log("This is Board0.Board_Force");
            Debug.Log(Board0.CalibratedForce);
            Debug.Log("This is Board0.CalibratedForce");
            Debug.Log(Board0.Board_Totalforce);
            Debug.Log("This is Board0.Board_Totalforce");
            GlobalTotalForce = CalculateGlobalTotalForce();
            COPRatioCalculationInGlobalCoordinate();
            GlobalVelocity = VelocityCalculationInGlobalCoordinate();
        }

        if (testmode == true)
        {
            Testdataset();
            foreach (GenericBoard item in Boards)
            {
                item.CalibratedForce  = EliminateError(item);
                item.Board_Totalforce = item.CalculateTotalForce();
            }
            GlobalTotalForce = CalculateGlobalTotalForce();
            COPRatioCalculationInGlobalCoordinate();
            GlobalVelocity = VelocityCalculationInGlobalCoordinate();
        }
    }
Esempio n. 28
0
 // Function for normalizing value between given min and max needed lean values
 public float Normalize(float value, float min)
 {
     if (Mathf.Abs(value) < min || Wii.GetTotalWeight(remote) < 40)
     {
         return(0);
     }
     if (value > 0)
     {
         value -= min;
         return(Mathf.Min(1, value / (maxZoneForward - min)));
     }
     else
     {
         value += min;
         return(-Mathf.Min(1, value / (maxZoneBackward + min)));
     }
 }
Esempio n. 29
0
    // Send data from a board to the NewRobotController
    public void SendWheelRatio()
    {
        // Add offset to bring weight distribution on the board to zero while standing still
        Vector4 board = Wii.GetBalanceBoard(remote) + weightOffset;

        // Calculates distribution of front and back sensors on both sides independently
        float rightWheel = (board.x - board.z) / (board.x + board.z);
        float leftWheel  = (board.y - board.w) / (board.y + board.w);

        // Normalize values to start from the min need lean
        rightWheel = Normalize(rightWheel, minZone);
        leftWheel  = Normalize(leftWheel, minZone);

        // Send data to the NewRobotController
        NewRobotController.Instance.leftTarget  = leftWheel;
        NewRobotController.Instance.rightTarget = rightWheel;
    }
Esempio n. 30
0
    public void FixedUpdate()
    {
        // a -> Z-axis, b -> X-axis
        float x_axes = ((Wii.GetBalanceBoard(0).x + Wii.GetBalanceBoard(0).z) -   ////////////var x_axes yerine float yazdım
                        (Wii.GetBalanceBoard(0).y + Wii.GetBalanceBoard(0).w));

        float z_axes = ((Wii.GetBalanceBoard(0).x + Wii.GetBalanceBoard(0).y) -
                        (Wii.GetBalanceBoard(0).w + Wii.GetBalanceBoard(0).z));

        if (Wii.GetTotalWeight(0) > 0)
        {
            // Move translation along the object's z-axis

            Rigidbody.AddRelativeForce(x_axes / 8, 0, z_axes / 5);

            //   Debug.Log("x_axes: " + x_axes/8 + "\tz_axes: " + z_axes/5);
        }
    }
 private void wadExtract_Progress(object sender, Wii.ProgressChangedEventArgs e)
 {
     objectInvoker v = new objectInvoker(this.updateProgress);
     this.Invoke(v, e.PercentProgress);
 }
Esempio n. 32
0
 private void convertWiiGame_Name(object sender, Wii.MessageEventArgs e)
 {
     objectInvoker v = new objectInvoker(this.updateGameName);
     this.Invoke(v, e.Message);
 }
Esempio n. 33
0
 /// <summary>
 /// Sets the Value of the ProgressBar to the current state (given by Wii.cs).
 /// Set the Tag of the ProgressBar to "NoProgress" to disable this
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void WadProgressChanged(object sender, Wii.ProgressChangedEventArgs e)
 {
     if ((string)pbProgress.Tag != "NoProgress")
         pbProgress.Value = e.PercentProgress;
 }
 private void nandExtract_ThreadFinish(object sender, Wii.ThreadFinishEventArgs e)
 {
     if (this.InvokeRequired)
     {
         objectInvoker v = new objectInvoker(this.EndThread);
         this.Invoke(v, e.IsThreadInterrupted);
     }
     else
     {
         this.EndThread(e.IsThreadInterrupted);
     }
 }
 private void nandExtract_Error(object sender, Wii.MessageEventArgs e)
 {
     objectInvoker v = new objectInvoker(this.ErrorMessageBox);
     this.Invoke(v, e.Message);
 }
 void nandExtract_Debug(object sender, Wii.MessageEventArgs e)
 {
     objectInvoker v = new objectInvoker(this.UpdateLabel);
     this.Invoke(v, e.Message);
 }
Esempio n. 37
0
    private void WakeUp()
    {
        if(amAwake)//already awake.
            return;
        if(!checkPlugin())
        {
           	initPlugin("doesn't matter");
        }

        wii              = target as Wii;
        Wii.WakeUp();
        max = Wii.GetMaximumRemotes();
        showPanel        = new bool[max];
        showMPPanel      = new bool[max];
        showExpPanel     = new bool[max];
        currentStates    = new Wii.State[max];
        theIRs           = new Vector3[max];
        theIRRot         = new float[max];
        theLEDs          = new bool[max][];

        for(int x=0;x<max;x++)
        {
            theLEDs[x] = new bool[4];
            currentStates[x] = getStates(x);
            if(currentStates[x].active || Wii.GetIsVirtual(x))
            {
                theIRs[x].x     = getVirtualIR(x,0);
                theIRs[x].y     = getVirtualIR(x,1);
                theIRs[x].z     = getVirtualIR(x,2);
                theIRRot[x]     = getVirtualIR(x,3);

                showPanel[x]     = getPanel(x,0);
                showMPPanel[x]   = getPanel(x,1);
                showExpPanel[x]  = getPanel(x,2);
            }
        }
        amAwake=true;
    }
Esempio n. 38
0
 private static extern void setVirtualStates(int i, Wii.State state);
Esempio n. 39
0
 private void convertWiiGame_Progress(object sender, Wii.ProgressChangedEventArgs e)
 {
     objectInvoker v = new objectInvoker(this.updateProgress);
     this.Invoke(v, e.PercentProgress);
 }
Esempio n. 40
0
 private void convertWiiGame_End(object sender, Wii.ThreadFinishEventArgs e)
 {
     objectInvoker v = new objectInvoker(this.EndConvertWiiGames);
     this.Invoke(v, e.IsThreadInterrupted);
 }