/**
 * SectionKnowledge.h (失它玄戊□旦迕澀爛)
 */
#ifndef SECTIONKNOWLEDGE_H
#define SECTIONKNOWLEDGE_H

typedef struct {
	long lDistance_mm;
	S16 lSpeed;
	bool bLineTrace;
} st_section;


//#include <vector>
//using namespace std;

class SectionKnowledge
{
public:
	SectionKnowledge() 
	:idx(-1),idxMax(0)
	{
		//in/out濠曰贅尹
		idxMax = 13;
		//雖墊襞摹
		st_section section;

		// 旦正□玄凜反簧蘸 50 / 200 mm 
		section.lDistance_mm = 200;
		section.lSpeed = 70;// 70;
		section.bLineTrace = true;
		m_knowledge[0] = section;

		// 旦正□玄井日躂瞬峏切曉互曰引匹 
		section.lDistance_mm = 1500;
		section.lSpeed = 70;// 120;
		section.bLineTrace = true;
		m_knowledge[1] = section;

		// 躂瞬
		section.lDistance_mm = 2000;
		section.lSpeed = 70;// 130;
		section.bLineTrace = true;
		m_knowledge[2] = section;

		// 躂瞬詨３目失疋件澎蟆
		section.lDistance_mm = 2500;
		section.lSpeed = 70;// 120;
		section.bLineTrace = true;
		m_knowledge[3] = section;

		// 目失疋件
		section.lDistance_mm = 2000;
		section.lSpeed = 70;// 100;
		section.bLineTrace = true;
		m_knowledge[4] = section;

		// 目失疋件詨３ R 引匹
		section.lDistance_mm = 2300;
		section.lSpeed = 70;// 130;
		section.bLineTrace = true;
		m_knowledge[5] = section;

		// 鎔 2 躂瞬
		section.lDistance_mm = 1500;
		section.lSpeed = 70;// 130;
		section.bLineTrace = true;
		m_knowledge[6] = section;

		// 鎔 2 躂瞬詨３仁及儂澎蟆
		section.lDistance_mm = 1000;
		section.lSpeed = 70;// 120;
		section.bLineTrace = true;
		m_knowledge[7] = section;

		// 仁及儂
		section.lDistance_mm = 1200;
		section.lSpeed = 70;// 100;
		section.bLineTrace = true;
		m_knowledge[8] = section;

		// 仁及儂詨３箔し澎蟆
		section.lDistance_mm = 1300;
		section.lSpeed = 70;// 120;
		section.bLineTrace = true;
		m_knowledge[9] = section;

		// 箔し
		section.lDistance_mm = 2700;
		section.lSpeed = 70;// 100;
		section.bLineTrace = true;
		m_knowledge[10] = section;

		// 箔し詨３打□伙聊亢
		section.lDistance_mm = 1000;
		section.lSpeed = 70;// 100;
		section.bLineTrace = true;
		m_knowledge[11] = section;

		// 打□伙詨３樂裝
		section.lDistance_mm = 950;
		section.lSpeed = 70;// 90;
		section.bLineTrace = false;
		m_knowledge[12] = section;

	}
	
	
	bool next(st_section&);

private:
	//vector<st_section> m_knowledge;
	st_section m_knowledge[13];
	long idx;
	long idxMax;
	
};

inline bool SectionKnowledge::next(st_section& section) {
	
	idx++;
	if (idx == idxMax) {
		return false;
	}
	section = m_knowledge[idx];
	return true;
	
}

#endif
