Пример #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;
 }
Пример #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;
 }
Пример #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);
    }
Пример #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);
     }
 }
Пример #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));
     }
 }
Пример #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);
 }
Пример #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);
 }
Пример #9
0
 public static string getUniqueID(PilloID pillo)
 {
     return(m_receiver.GetUniqueID(pillo));
 }
Пример #10
0
 public static bool isBatteryLow(PilloID pillo)
 {
     return(m_receiver.GetBatteryLow(pillo));
 }
Пример #11
0
 public static string GetName(PilloID pillo)
 {
     return(m_receiver.GetName(pillo));
 }
Пример #12
0
 public static float GetAcceleroZ(PilloID pillo)
 {
     return(m_receiver.GetAcceleroZ(pillo));
 }
Пример #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);
 }
Пример #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;
 }
Пример #15
0
 ///returns true if externally powered, false if it's not
 ///</summary>
 public static bool isExternallyPowered(PilloID pillo)
 {
     return m_receiver.GetExternalPower(pillo);
 }
Пример #16
0
 ///checks if the specified Pillo's battery is low
 ///</summary>
 public static bool isBatteryLow(PilloID pillo)
 {
     return m_receiver.GetBatteryLow(pillo);
 }
Пример #17
0
 ///returns the current version of the Pillo
 ///</summary>
 public static int GetVersion(PilloID pillo)
 {
     return m_receiver.GetVersion(pillo);
 }
Пример #18
0
 ///returns the id of the specified Pillo
 ///</summary>
 public static string getUniqueID(PilloID pillo)
 {
     return m_receiver.GetUniqueID(pillo);
 }
Пример #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);
     }
 }
Пример #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);
 }
Пример #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);
 }
Пример #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);
 }
Пример #23
0
 public static int GetVersion(PilloID pillo)
 {
     return(m_receiver.GetVersion(pillo));
 }
Пример #24
0
 ///Sets the specified ID with the specified name
 ///</summary>
 public static void SetName(PilloID pillo, string name)
 {
     m_receiver.SetName(pillo, name);
 }
Пример #25
0
 public static void SetName(PilloID pillo, string name)
 {
     m_receiver.SetName(pillo, name);
 }
Пример #26
0
 public static float GetSensor(PilloID pillo, PilloSensor sensor)
 {
     return(m_receiver.GetSensor(pillo, sensor));
 }
Пример #27
0
 public static bool isExternallyPowered(PilloID pillo)
 {
     return(m_receiver.GetExternalPower(pillo));
 }
Пример #28
0
 ///returns the name of the specified Pillo Id
 ///</summary>
 public static string GetName(PilloID pillo)
 {
     return m_receiver.GetName(pillo);
 }
Пример #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;
 }
Пример #30
0
 ///Get the pressure applied to the specified Pillo.
 ///</summary>
 public static float GetSensor(PilloID pillo)
 {
     return m_receiver.GetSensor(pillo, PilloSensor.Sensor1);
 }
Пример #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);
 }
Пример #32
0
 public static float GetSensor(PilloID pillo)
 {
     //	MakeReceiver ();
     return(m_receiver.GetSensor(pillo, PilloSensor.Sensor1));
 }