//{{AFX_INCLUDES()
//}}AFX_INCLUDES
#if !defined(AFX_DTTUNE_H__F086C1D7_CA58_11D5_855B_000000000000__INCLUDED_)
#define AFX_DTTUNE_H__F086C1D7_CA58_11D5_855B_000000000000__INCLUDED_

#if _MSC_VER >= 1000
#  pragma once
#endif

// $Id$

//*****************************************
//******** PC Configurator V1.00 **********
//*** (C) - 2001 B.Bowling/A. Grippo ******
//** All derivatives from this software ***
//**  are required to keep this header ****
//*****************************************

#include "AnalogMeter.h"
#include "BarMeter.h"
#include "plot3d.h"

//------------------------------------------------------------------------------
// Dttune dialog

class Dttune:public CDialog
{
// Construction
public:
   Dttune(CWnd * pParent = NULL);                        // standard constructor
  ~Dttune();

// Dialog Data
   //{{AFX_DATA(Dttune)
	enum { IDD = IDD_TTUNE };
	CEdit	m_tReqFuel;
	//}}AFX_DATA


// Overrides
   // ClassWizard generated virtual function overrides
   //{{AFX_VIRTUAL(Dttune)
	public:
      virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
      virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
      virtual void DoDataExchange(CDataExchange * pDX);  // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
private:
   enum { on = 1, off = 0 };
   void timer(int state);

   enum gaugeState { aeGauges, eeGauges, pw1Gauges, pw2Gauges };
   gaugeState gauges;
   void setupGauges(bool forceUpdate);

   plot3d *p3d; // 3D plot area in VE grid window.
   static double Xrot, Yrot, Zrot;
   static bool   flat;
   void    setPerspective(bool);
   void    drawGrid();


   void setMsg(char *newMsg, int line, long clr);
   void updateDisplay(unsigned char runtimevars[]);
   BOOL spinReqFuel(int delta);

   CAnalogMeter meterrpm, metermap, meterve, metero2, meterTop, meterBot;
   CBarMeter meterEGO;

   CProgressCtrl *veBar;

   bool    chasing; // Chase mode does an automatic "F" at timer events.

   int     ivebin;
   int     currcurx;
   int     currcury;
   int     vepx1;
   int     vepy1;
   int     vepx2;
   int     vepy2;
   int     wux1;
   int     wux2;
   int     wuy1;
   int     wuy2;

   double  sloperpm;
   double  slopemap;

   int     rpm;
   int     map;
   double  minrpm;
   double  maxrpm;
   double  minmap;
   double  maxmap;

   int     xrpm;
   int     ymap;
   
   CRect   veplotrect;
   CRect   vewarmrect;

protected:

   // Generated message map functions
   //{{AFX_MSG(Dttune)
      virtual BOOL   OnInitDialog();
      afx_msg void   OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
      afx_msg void   OnPaint();
      afx_msg void   OnTimer(UINT nIDEvent);
      afx_msg void   OnBurn();
      afx_msg void   OnRecord();
      afx_msg void   OnReqfuelSpin(NMHDR* pNMHDR, LRESULT* pResult);
      afx_msg void   OnEnrich();
      afx_msg void   OnPw1();
      afx_msg void   OnPw2();
	afx_msg void OnEgo();
      DECLARE_EVENTSINK_MAP()
	//}}AFX_MSG
   DECLARE_MESSAGE_MAP()
};


//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DTTUNE_H__F086C1D7_CA58_11D5_855B_000000000000__INCLUDED_)

