package com.bran.android;

import android.util.Log;

import com.thalmic.myo.Myo;
import com.thalmic.myo.Quaternion;
import com.thalmic.myo.Vector3;

public class BicepCurl extends Exercise {

	private boolean down = true;
	private double minAngle = 1.2217; //70 degrees
	private double downAngle = -0.1745; //-10 degrees

	public BicepCurl() {
		super("Bicep Curl",ExerciseType.BICEP_CURL);
	}

	@Override
	public void processData(Myo myo, long timestamp, Quaternion quaternion, DataType type) {

		// Process Data
		/*if(type.equals(DataType.GYROSCOPE)) {
			Log.i("BicepCurl Gyroscope","z: "+vector.z());
			if(started) {
				if(down && vector.z() > minAngle) {
					down = false;
					rep++;
				} else if (!down && vector.z() < downAngle) {
					down = true;
				}
			}
		}*/
		
	}
	
	
	
}

@@ -490,16 +490,17 @@
 ype) %7B%0A%0A
+%0A
 %09%09// Pro
@@ -515,10 +515,8 @@
 a%0A%09%09
-/*
 if(t
@@ -539,17 +539,19 @@
 ype.
-GYROSCOPE
+ORIENTATION
 )) %7B
@@ -575,31 +575,32 @@
 url 
-Gyroscope%22,%22z: %22+vector
+Angles%22,%22z: %22+quaternion
 .z()
@@ -776,21 +776,370 @@
 %0A%09%09%7D
-*/%0A%09%09%0A%09%7D%0A%09%0A%09%0A%09
+%0A%0A%09%7D%0A%0A%09@Override%0A%09public void processData(Myo myo, long timestamp, Vector3 vector, DataType type) %7B%0A%0A%0A%09%09// Process Data%0A%09%09/*if(type.equals(DataType.GYROSCOPE)) %7B%0A%09%09Log.i(%22BicepCurl Gyroscope%22,%22z: %22+vector.z());%0A%09%09if(started) %7B%0A%09%09if(down && vector.z() %3E minAngle) %7B%0A%09%09down = false;%0A%09%09rep++;%0A%09%7D else if (!down && vector.z() %3C downAngle) %7B%0A%09down = true;%0A%7D%5D%0A%7D%0A%7D*/%0A%0A%7D%0A
 %0A%7D%0A

switch to quaternion data