

#include "PublicSDKMotion.h"

#include <deque>
#define PRESS_WINDOW_SIZE 10

//struct same_position_press
//{
//	int32_t left_mag;
//	int32_t right_mag;
//};

class Aerobics : public PublicSDKMotion
{
public:
	Aerobics();

	void setResult(deque<shoes_data_cell>& step_data_vector, int LEFT_OR_RIGHT);

	void ResetDenyDownTime(int time_stamp);

	bool isValidDown(int time_stamp);

	//float calVar(deque<same_position_press>& front_mag_deq);


	virtual void Process(int time_stamp, int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_front_press, int right_back_press,
		int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_front_press, int left_back_press,
		int jump, int down, int rssi);

private:

	const float high_thresh = 0.1f;
	const float plane_thresh = 0.2f;
	
	deque<shoes_data_cell> left_shoes_data_vector;
	deque<shoes_data_cell> right_shoes_data_vector;

	deque<shoes_data_cell> left_step_data_vector;
	deque<shoes_data_cell> right_step_data_vector;

	int last_down;
	int last_jump;

	int stretch_left_status;
	int stretch_right_status;

	int stretch_front_left_status;
	int stretch_front_right_status;

	int lift_left_status;
	int lift_right_status;

	int left_wait_time;
	int right_wait_time;

	int special_down;
	int last_special_down;

	int deny_down_time;


	deque<int> left_acc_deque;
	deque<int> right_acc_deque;

	int wait_down = 0;

	//deque<same_position_press> front_mag_deq;
	//deque<same_position_press> back_mag_deq;

};