SSPC-Tester/Driver/PCIE8586/Samples/VC/Advanced/ADScopeCtrl.h

150 lines
3.7 KiB
C
Raw Permalink Normal View History

// OScopeCtrl.h : header file
//
#ifndef __OScopeCtrl_H__
#define __OScopeCtrl_H__
/////////////////////////////////////////////////////////////////////////////
// CADScopeCtrl window
class CADScopeCtrl : public CWnd
{
// Construction
public:
CADScopeCtrl();
// Attributes
public:
double AppendPoint(double dNewPoint);
void SetRange(double dLower, double dUpper, int nDecimalPlaces=1);
void SetXUnits(CString string);
void SetYUnits(CString string);
void SetGridColor(COLORREF color);
void SetPlotColor(COLORREF color);
void SetBackgroundColor(COLORREF color);
void InvalidateCtrl();
void Reset();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CADScopeCtrl)
public:
virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID=NULL);
protected:
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
public:
void DrawAllChannelText(CDC *pDC);
void DrawSingleCHText(CDC *pDC, int nChannelNum);
CPen m_polyPen[MAX_CHANNEL_COUNT];
CPen m_ChannelPen[MAX_CHANNEL_COUNT];
int FindTrigger(int nChannel, int nValue);
void SetStatusBar();
void AppendPoly(int BufferID, int Offset, ULONG nDrawLen);
int m_nPtCount;
int tempCount;
int m_nChannelCount;
int m_nChannelNum;
float PerY;
int m_BufferID;
int m_Offset;
float PixelOfLsb;
// int m_nCenter[32];
POINT pointxy[32][8192]; // <20><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>ʾ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>
CPoint pointTemp[8192]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>ʾ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>
SHORT *m_pBuffer;
COLORREF m_clPen[MAX_CHANNEL_COUNT];
int HeightMid[64] ;
int MouseOffset; // <20><><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>ƫ<EFBFBD><C6AB>λ<EFBFBD><CEBB>
int m_OldMoveX1; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD>ߵ<EFBFBD>λ<EFBFBD><CEBB>
int m_OldMoveX2;
int m_OldMoveY;
int m_CurMoveX1;
int m_CurMoveX2;
int m_CurMoveY;
COLORREF m_crLineAColor; // A<>ߵ<EFBFBD><DFB5><EFBFBD>ɫ
COLORREF m_crLineBColor; // B<>ߵ<EFBFBD><DFB5><EFBFBD>ɫ
COLORREF m_crLineVColor; // C<>ߵ<EFBFBD><DFB5><EFBFBD>ɫ
CPen m_PenLineA; // A<>ߵĻ<DFB5><C4BB><EFBFBD>
CPen m_PenLineB; // B<>ߵĻ<DFB5><C4BB><EFBFBD>
CPen m_PenLineV; // V<>ߵĻ<DFB5><C4BB><EFBFBD>
int m_CurVoltageY;
int m_OldVoltageY;
float m_VolOffset;
int m_nLineIndex;
BOOL m_bAllChannel;
int m_nShiftPixels;
int m_nYDecimals;
CString m_strXUnitsString;
CString m_strYUnitsString;
COLORREF m_crBackColor;
COLORREF m_crGridColor;
COLORREF m_crPlotColor;
double m_dCurrentPosition;
double m_dPreviousPosition;
LONG m_iDataLength;
virtual ~CADScopeCtrl();
private:
UINT m_nLoop;
void DrawBkGnd(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void DrawPoint();
void DrawPoly(ULONG nDrawLen,ULONG nDrawIdx);
void ProcessData(ULONG nDrawLen,ULONG nDrawIdx);
protected:
//{{AFX_MSG(CADScopeCtrl)
afx_msg void OnPaint();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
int m_nHalfShiftPixels;
int m_nPlotShiftPixels;
int m_nClientHeight;
int m_nClientWidth;
int m_nPlotHeight;
int m_nPlotWidth; //
BOOL m_bDrawPoly;
BOOL m_bInitialed;
double m_dLowerLimit[MAX_CHANNEL_COUNT]; // lower bounds
double m_dUpperLimit[MAX_CHANNEL_COUNT]; // upper bounds
double m_dRange;
double m_dVerticalFactor;
CRect m_rectClient;
CRect m_rectPlot;
CPen m_penPlot;
CBrush m_brushBack;
CDC m_dcGrid;
CDC m_dcPlot;
CDC m_dcMove;
CBitmap *m_pbitmapOldGrid;
CBitmap *m_pbitmapOldPlot;
CBitmap m_bitmapGrid;
CBitmap m_bitmapPlot;
};
/////////////////////////////////////////////////////////////////////////////
#endif