
#ifndef _FootStep_H
#define _FootStep_H

#include <iostream>
#include <cstring>
#include <vector>
#include <deque>

using namespace std;

#define LEAVE_TIME_STYPE 1
#define CATCH_TIME_STYPE 2

struct  FLOOR_TIME_STYPE {
	int  time_type;
	int  time;
};


class FootStep
{
public:

	FootStep();

	//void stepCal(int timeStamp, int pos[3], int zupt);

	void stepCal(int timeStamp, int zupt, int front_mag, int back_mag, int *acc);

	int getStepFreq();
	int getStepStatus();

	int getStepCount();

private:

	int stepStatus;//脚步状态 0 1 2
	int stepFreq;	//脚步步频 分钟为单位
	int stepTag;	//计算步数所用
	int zuptCount;
	
	int localTime;
	int last_time_stamp;

	int leaveFloorTime;

	int leaveFloorTime1;
	int leaveFloorTime2;

	int leaveTimeStatus;

	int catchFloorTime;

	int lastZupt;

	int stepCount;

	int last_pos[3];

	vector<FLOOR_TIME_STYPE> time_vector;

	float mean_vel;

	float mean_window_vel;

	float step_vel_buff[3];

	float vel_sqrt_sum;
	int vel_sqrt_num;

	float vel_sqrt_buff[3];

	int front_mag_min;
	int back_mag_min;

	int max_acc[3];
	int min_acc[3];

	int unzupt_count;

	int leave_time_wait = 0;

	deque<int> acc_z_deque;
};

#endif