#pragma once

#include "EngraveImage.h"

enum seq { SEQNONE, SEQ_START, SEQ_CHECK , SEQ_ENDOFLINE , SEQ_WAITONLINE 
};

enum REVMOVES { NONE, XMOVE, YMOVE, ZMOVE };
// MenuHandler
struct ProbePoint
{
   double x,y,z,a,b,c;
};
class MenuHandler : public CWnd
{
	DECLARE_DYNAMIC(MenuHandler)

public:
	MenuHandler();
	virtual ~MenuHandler();

protected:
	DECLARE_MESSAGE_MAP()
public:
	void InitMenus(void);
	void OnCenter();
	void ToolTouch(void);
	void DoPoint(void);
	void DoCenter3(void);
	void DoRotate3(void);
	void SetMachError(CString Message);
	void CalcPoint( int point );
	void CheckMenu( int PointSearch, bool done);
	void MenuHandler::FillLine();
	void MenuHandler::MoveNextLine();
	void MenuHandler::SetInfoBit( int pos , int state);
	seq SEQUENCE;
//Now some variables for the tool touch probe sequence..
	 
	ProbePoint target,current,lastmove,points[3];
	bool         POK[3];
	REVMOVES     LastMove;
	int          Reversals;
	double       XDir,YDir,ZDir;
	int          PointSearch;

 


	 

 

public:

	 CMenu addon;
protected:
	
public:
	int  Restcycles;
	int  RangeStart;
	void DoMenuItem(int ID);
	void CalcRatios(double , double );
	void Sequencer(void);
	bool OKtoStart(void);
	void Engrave(void);
	bool IsProbeHit();
	bool Rest();
	bool CheckTarget();
	ProbePoint GetGridPoint();
};


