Ejemplo n.º 1
0
 /// <summary>
 /// Wraps all the accelerometer values in an vector3 of the specified Pillo
 /// </summary>
 /// <returns>The accelero.</returns>
 /// <param name="pillo">Pillo.</param>
 public static Vector3 GetAccelero(PilloID pillo)
 {
     Vector3 vector = new Vector3();
     vector.x = m_receiver.GetAcceleroX(pillo);
     vector.y = m_receiver.GetAcceleroY(pillo);
     vector.z = m_receiver.GetAcceleroZ(pillo);
     return vector;
 }
Ejemplo n.º 2
0
    public static Vector3 GetAccelero(PilloID pillo)
    {
        Vector3 vector = new Vector3();

        vector.x = m_receiver.GetAcceleroX(pillo);
        vector.y = m_receiver.GetAcceleroY(pillo);
        vector.z = m_receiver.GetAcceleroZ(pillo);
        return(vector);
    }
 public static Vector4 GetSensors(PilloID pillo)
 {
     Vector4 vector = new Vector4();
     vector.x = m_receiver.GetSensor1(pillo);
     vector.y = m_receiver.GetSensor2(pillo);
     vector.z = m_receiver.GetSensor3(pillo);
     vector.w = m_receiver.GetSensor4(pillo);
     return vector;
 }
Ejemplo n.º 4
0
    public static Vector4 GetSensors(PilloID pillo)
    {
        Vector4 vector = new Vector4();

        vector.x = m_receiver.GetSensor1(pillo);
        vector.y = m_receiver.GetSensor2(pillo);
        vector.z = m_receiver.GetSensor3(pillo);
        vector.w = m_receiver.GetSensor4(pillo);
        return(vector);
    }
Ejemplo n.º 5
0
 /// <summary>
 /// Determines if the specified pillo is calibrated. will return true unless calibration values are both zero, or if the minimum is higher than the maximum.
 /// </summary>
 /// <returns><c>true</c> if is pillo calibrated the specified pillo; otherwise, <c>false</c>.</returns>
 /// <param name="pillo">Pillo.</param>
 public static bool IsPilloCalibrated(PilloID pillo)
 {
     if (calibration_PressureValue [(int)pillo] == Vector2.zero || calibration_PressureValue [(int)pillo].x > calibration_PressureValue [(int)pillo].y)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Ejemplo n.º 6
0
 ///Get the pressure applied to the specified Pillo. Set last param to true to use calibrated values;
 ///</summary>
 public static float GetSensor(PilloID pillo, bool useCalibrated)
 {
     if (useCalibrated)
     {
         if (!IsPilloCalibrated(pillo) && Debugging_Enabled)
         {
             Debug.LogWarning("Pillo " + ((int)pillo).ToString() + " is not calibrated, but calibrated values are requested");
         }
         return(Mathf.Clamp((m_receiver.GetSensor(pillo, PilloSensor.Sensor1) - calibration_PressureValue[(int)pillo].x) / (calibration_PressureValue[(int)pillo].y - calibration_PressureValue[(int)pillo].x), 0.0f, 1.0f));
     }
     else
     {
         return(m_receiver.GetSensor(pillo, PilloSensor.Sensor1));
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Sets the calibrated maximum for the specified Pillo.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <param name="pillo">Pillo.</param>
 public static void SetCalibratedMaximum(float value, PilloID pillo)
 {
     calibration_PressureValue [(int)pillo] = new Vector2(calibration_PressureValue [(int)pillo].x, value);
 }
Ejemplo n.º 8
0
 ///Get the pressure applied to the specified Pillo.
 ///</summary>
 public static float GetSensor(PilloID pillo, PilloSensor sensor)
 {
     return m_receiver.GetSensor(pillo, sensor);
 }
Ejemplo n.º 9
0
 public static string getUniqueID(PilloID pillo)
 {
     return(m_receiver.GetUniqueID(pillo));
 }
Ejemplo n.º 10
0
 public static bool isBatteryLow(PilloID pillo)
 {
     return(m_receiver.GetBatteryLow(pillo));
 }
Ejemplo n.º 11
0
 public static string GetName(PilloID pillo)
 {
     return(m_receiver.GetName(pillo));
 }
Ejemplo n.º 12
0
 public static float GetAcceleroZ(PilloID pillo)
 {
     return(m_receiver.GetAcceleroZ(pillo));
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Sets the accelero calibration value of the specified pillo. use this to determine which way is down for the pillo
 /// </summary>
 /// <param name="pillo">Pillo.</param>
 public static void SetAcceleroCalibrationValue(PilloID pillo)
 {
     calibration_AcceleroValue[(int)pillo] = GetAccelero (pillo);
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Determines if the specified pillo is calibrated. will return true unless calibration values are both zero, or if the minimum is higher than the maximum.
 /// </summary>
 /// <returns><c>true</c> if is pillo calibrated the specified pillo; otherwise, <c>false</c>.</returns>
 /// <param name="pillo">Pillo.</param>
 public static bool IsPilloCalibrated(PilloID pillo)
 {
     if (calibration_PressureValue [(int)pillo] == Vector2.zero || calibration_PressureValue [(int)pillo].x > calibration_PressureValue [(int)pillo].y)
         return false;
     else
         return true;
 }
Ejemplo n.º 15
0
 ///returns true if externally powered, false if it's not
 ///</summary>
 public static bool isExternallyPowered(PilloID pillo)
 {
     return m_receiver.GetExternalPower(pillo);
 }
Ejemplo n.º 16
0
 ///checks if the specified Pillo's battery is low
 ///</summary>
 public static bool isBatteryLow(PilloID pillo)
 {
     return m_receiver.GetBatteryLow(pillo);
 }
Ejemplo n.º 17
0
 ///returns the current version of the Pillo
 ///</summary>
 public static int GetVersion(PilloID pillo)
 {
     return m_receiver.GetVersion(pillo);
 }
Ejemplo n.º 18
0
 ///returns the id of the specified Pillo
 ///</summary>
 public static string getUniqueID(PilloID pillo)
 {
     return m_receiver.GetUniqueID(pillo);
 }
Ejemplo n.º 19
0
 ///Get the pressure applied to the specified Pillo. Set last param to true to use calibrated values;
 ///</summary>
 public static float GetSensor(PilloID pillo, bool useCalibrated)
 {
     if (useCalibrated)
     {
         if(!IsPilloCalibrated(pillo) && Debugging_Enabled)
             Debug.LogWarning("Pillo "+ ((int)pillo).ToString() + " is not calibrated, but calibrated values are requested");
         return Mathf.Clamp ((m_receiver.GetSensor(pillo, PilloSensor.Sensor1)-calibration_PressureValue[(int)pillo].x) / (calibration_PressureValue[(int)pillo].y - calibration_PressureValue[(int)pillo].x ),0.0f,1.0f);
     }
     else
     {
         return m_receiver.GetSensor(pillo, PilloSensor.Sensor1);
     }
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Gets the calibrated maximum for the specified Pillo.
 /// </summary>
 /// <returns>The calibrated maximum.</returns>
 /// <param name="pillo">Pillo.</param>
 public static float GetCalibratedMaximum(PilloID pillo)
 {
     return(calibration_PressureValue [(int)pillo].y);
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Sets the accelero calibration value of the specified pillo. use this to determine which way is down for the pillo
 /// </summary>
 /// <param name="pillo">Pillo.</param>
 public static void SetAcceleroCalibrationValue(PilloID pillo)
 {
     calibration_AcceleroValue[(int)pillo] = GetAccelero(pillo);
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Sets the calibrated minimum for the specified Pillo.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <param name="pillo">Pillo.</param>
 public static void SetCalibratedMinimum(float value, PilloID pillo)
 {
     calibration_PressureValue [(int) pillo] = new Vector2 (value, calibration_PressureValue [(int) pillo].y);
 }
Ejemplo n.º 23
0
 public static int GetVersion(PilloID pillo)
 {
     return(m_receiver.GetVersion(pillo));
 }
Ejemplo n.º 24
0
 ///Sets the specified ID with the specified name
 ///</summary>
 public static void SetName(PilloID pillo, string name)
 {
     m_receiver.SetName(pillo, name);
 }
Ejemplo n.º 25
0
 public static void SetName(PilloID pillo, string name)
 {
     m_receiver.SetName(pillo, name);
 }
Ejemplo n.º 26
0
 public static float GetSensor(PilloID pillo, PilloSensor sensor)
 {
     return(m_receiver.GetSensor(pillo, sensor));
 }
Ejemplo n.º 27
0
 public static bool isExternallyPowered(PilloID pillo)
 {
     return(m_receiver.GetExternalPower(pillo));
 }
Ejemplo n.º 28
0
 ///returns the name of the specified Pillo Id
 ///</summary>
 public static string GetName(PilloID pillo)
 {
     return m_receiver.GetName(pillo);
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Gets the calibrated minimum for the specified Pillo.
 /// </summary>
 /// <returns>The calibrated minimum.</returns>
 /// <param name="pillo">Pillo.</param>
 public static float GetCalibratedMinimum(PilloID pillo)
 {
     return calibration_PressureValue [(int)pillo].x;
 }
Ejemplo n.º 30
0
 ///Get the pressure applied to the specified Pillo.
 ///</summary>
 public static float GetSensor(PilloID pillo)
 {
     return m_receiver.GetSensor(pillo, PilloSensor.Sensor1);
 }
Ejemplo n.º 31
0
 /// <summary>
 /// Get's the Z value of the accelerometer. (of the specified Pillo)
 /// </summary>
 /// <returns>The accelero z.</returns>
 /// <param name="pillo">Pillo.</param>
 public static float GetAcceleroZ(PilloID pillo)
 {
     return m_receiver.GetAcceleroZ(pillo);
 }
Ejemplo n.º 32
0
 public static float GetSensor(PilloID pillo)
 {
     //	MakeReceiver ();
     return(m_receiver.GetSensor(pillo, PilloSensor.Sensor1));
 }