/// <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; }
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; }
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); }
/// <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); } }
///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)); } }
/// <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); }
///Get the pressure applied to the specified Pillo. ///</summary> public static float GetSensor(PilloID pillo, PilloSensor sensor) { return m_receiver.GetSensor(pillo, sensor); }
public static string getUniqueID(PilloID pillo) { return(m_receiver.GetUniqueID(pillo)); }
public static bool isBatteryLow(PilloID pillo) { return(m_receiver.GetBatteryLow(pillo)); }
public static string GetName(PilloID pillo) { return(m_receiver.GetName(pillo)); }
public static float GetAcceleroZ(PilloID pillo) { return(m_receiver.GetAcceleroZ(pillo)); }
/// <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); }
/// <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; }
///returns true if externally powered, false if it's not ///</summary> public static bool isExternallyPowered(PilloID pillo) { return m_receiver.GetExternalPower(pillo); }
///checks if the specified Pillo's battery is low ///</summary> public static bool isBatteryLow(PilloID pillo) { return m_receiver.GetBatteryLow(pillo); }
///returns the current version of the Pillo ///</summary> public static int GetVersion(PilloID pillo) { return m_receiver.GetVersion(pillo); }
///returns the id of the specified Pillo ///</summary> public static string getUniqueID(PilloID pillo) { return m_receiver.GetUniqueID(pillo); }
///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); } }
/// <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); }
/// <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); }
/// <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); }
public static int GetVersion(PilloID pillo) { return(m_receiver.GetVersion(pillo)); }
///Sets the specified ID with the specified name ///</summary> public static void SetName(PilloID pillo, string name) { m_receiver.SetName(pillo, name); }
public static void SetName(PilloID pillo, string name) { m_receiver.SetName(pillo, name); }
public static float GetSensor(PilloID pillo, PilloSensor sensor) { return(m_receiver.GetSensor(pillo, sensor)); }
public static bool isExternallyPowered(PilloID pillo) { return(m_receiver.GetExternalPower(pillo)); }
///returns the name of the specified Pillo Id ///</summary> public static string GetName(PilloID pillo) { return m_receiver.GetName(pillo); }
/// <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; }
///Get the pressure applied to the specified Pillo. ///</summary> public static float GetSensor(PilloID pillo) { return m_receiver.GetSensor(pillo, PilloSensor.Sensor1); }
/// <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); }
public static float GetSensor(PilloID pillo) { // MakeReceiver (); return(m_receiver.GetSensor(pillo, PilloSensor.Sensor1)); }