private void UpdateEmotionZoneDisplay(EmotionZone emotionZone)
 {
     if (EmotionText != null)
     {
         EmotionText.text = emotionZone.ToString();
     }
     ChangeIndicator(emotionZone);
 }
예제 #2
0
 public void ChangeIndicator(EmotionZone emotionZone)
 {
     if (emotionZone == EmotionZone.CALM_EMOTION_ZONE) {
         IndicatorLight.color = Color.green;
     } else if (emotionZone == EmotionZone.WARNING_EMOTION_ZONE) {
         IndicatorLight.color = Color.yellow;
     } else if (emotionZone == EmotionZone.OVER_EMOTION_ZONE) {
         IndicatorLight.color = Color.red;
     }
 }
예제 #3
0
 public void ChangeIndicator(EmotionZone emotionZone)
 {
     if (emotionZone == EmotionZone.CALM_EMOTION_ZONE)
     {
         IndicatorLight.color = Color.green;
     }
     else if (emotionZone == EmotionZone.WARNING_EMOTION_ZONE)
     {
         IndicatorLight.color = Color.yellow;
     }
     else if (emotionZone == EmotionZone.OVER_EMOTION_ZONE)
     {
         IndicatorLight.color = Color.red;
     }
 }
예제 #4
0
    /**
     * Method called on each new HR Measurement
     */
    private void OnNewHRMeasurement(string deviceAddress, string characteristicUUID, byte[] bytes)
    {
        BluetoothLEHardwareInterface.Log("New Heart Rate Triggered");
        if (deviceAddress.CompareTo(_connectedDevice.address) == 0)
        {
            if (IsEqual(characteristicUUID, _readHRCharacteristicUUID))
            {
                if (_baseline == 0)
                {
                    CalculateEmotionBaseline();
                }

                EmotionMeasurement hrMeasurement = ProcessData(bytes);

                //Check if player is in new emotion zone
                EmotionZone currentZone = getEmotionZone(Convert.ToInt32(hrMeasurement.Measurement));
                CurrentEmotionZone = currentZone;
                BluetoothLEHardwareInterface.Log("Heart Rate: " + hrMeasurement.Measurement + " Baseline: " + _baseline + " Emotion Zone: " + currentZone);
            }
        }
    }
	// *** Supplementary functions

	//Initializes an instance of BluetoothDeviceScript, already taken care of in Start
	public void Initialize(){
		EmotionDeviceManager.Instance.Initialize ();
		MyEmotionZone = EmotionDeviceManager.Instance.CurrentEmotionZone;
	}
	private void UpdateEmotionZoneDisplay(EmotionZone emotionZone){
		if (EmotionText != null) {
			EmotionText.text = emotionZone.ToString ();
		}
		ChangeIndicator (emotionZone);
	}
 public NewZoneEventArgs(EmotionZone newZone)
 {
     _newZone = newZone;
 }
예제 #8
0
 public NewZoneEventArgs(EmotionZone newZone)
 {
     _newZone = newZone;
 }
    // *** Supplementary functions

    //Initializes an instance of BluetoothDeviceScript, already taken care of in Start
    public void Initialize()
    {
        EmotionDeviceManager.Instance.Initialize();
        MyEmotionZone = EmotionDeviceManager.Instance.CurrentEmotionZone;
    }