#ifndef _SURGE_GRAPH_H
#define _SURGE_GRAPH_H

class CGraph_Surge:public CGraphWave
{
private:
	int		m_nPole;
	int		m_nFrameV;
	int		m_nMaxFrameV;
	int     m_nFrameH;
	int     m_nMaxFrameH;

	int		m_nOscillatory;
	int		m_nDivideFreq;

	int     m_nPrecision;

	float   m_fSampleFreq;

	BOOL 	m_bsDisplay[MAX_SURGE_COUNT];
	BOOL    m_bRealTime;
	float   m_fVolBei;
public:
	void  SetVolBei(float fBei){m_fVolBei = fBei;}
	float GetVolBei(){return (m_fVolBei);}
	void SetPrecision(BOOL bPrecision){m_nPrecision = bPrecision;}
	int  GetPrecision(){return(m_nPrecision);}

	void SetSampleFreq(float fSampleFreq) {m_fSampleFreq = fSampleFreq;}
	float GetSampleFreq(){return(m_fSampleFreq);};

	void SetDisplay(int nIndex, BOOL bDisplay){m_bsDisplay[nIndex] = bDisplay;}
	BOOL GetDisplay(int nIndex){return(m_bsDisplay[nIndex]);}

	void SetRealTime(BOOL bRealTime) {m_bRealTime = bRealTime;}
	int  GetRealTime(){return(m_bRealTime);}
public:
	void  SetPole(int nPole){m_nPole = nPole;}
	int   GetPole(){return(m_nPole);}

	void  SetOscillatory(int nOscillatory){m_nOscillatory = nOscillatory;}
	int	  GetOscillatory(){return(m_nOscillatory);}

	void  SetDivideFreq(int nDivideFreq){m_nDivideFreq = nDivideFreq;}
	int   GetDivideFreq(){return(m_nDivideFreq);}

	int  GetFrameV(){return(m_nFrameV);}
	int  GetMaxFrameV(){return(m_nMaxFrameV);}
	void  SetFrameV(int nV){m_nFrameV = nV;}
	void  SetMaxFrameV(int nMaxV){m_nMaxFrameV = nMaxV;}

	int  GetFrameH(){return(m_nFrameH);}
	int  GetMaxFrameH(){return(m_nMaxFrameH);}
	void  SetFrameH(int nCount){m_nFrameH = nCount;}
	void  SetMaxFrameH(int nMaxCount){m_nMaxFrameH = nMaxCount;}

	void AddFrame_Vert();
	void SubFrame_Vert();
	void ChangeFrameV(int nIndex);

	void AddFrame_Horz();
	void SubFrame_Horz();
	void ChangeFrameH(int nCount);

	void  ChangeWave(int nIndex, BOOL bStandand, BOOL bDraw);
	void  DeleteWave (int nPole, BOOL bStandand);
	void  DrawTest(int nXmsIndex, BOOL bDraw);
public:
    static void GetY(int nPrecision, int nMaxV, int nIndex,
           float *pfMin1, float *pfMax1, float *pfMin2, float *pfMax2 );
	static void GetY_Anti(int nPrecision, int nMaxY, int nIndex, WORD *pwMin, WORD *pwMax);

public:
	CGraph_Surge();
};


class CSurgeControl:public CLabel
{
private:
	   CGraph_Surge m_GraphSurge;
public:
	   CGraph_Surge*   GetGraphSurge();

	   HANDLE   CreateObject(int nX,int nY,int nWidth,int nHeight, const char FAR *pStr);
public:
	   BOOL Show();
public:
	   CSurgeControl(CObject* pObject);
};


CGraph_Surge* AfxCreateSurge(int nLeft, int nTop,
	int nWidth, int nHeight, BOOL bRealTime, BOOL bShow);

#endif