| 1 |
#pragma once |
| 2 |
|
| 3 |
// white |
| 4 |
#define RESET_WINDOW_COLOR RGB(255, 255, 255) |
| 5 |
|
| 6 |
////////////////////////////////////////////////////////////////////////// |
| 7 |
|
| 8 |
class CAPIGraphicsWindow : public CWnd, CStringConvert |
| 9 |
{ |
| 10 |
DECLARE_DYNAMIC(CAPIGraphicsWindow) |
| 11 |
|
| 12 |
public: |
| 13 |
CAPIGraphicsWindow(); |
| 14 |
virtual ~CAPIGraphicsWindow(); |
| 15 |
BOOL Create(const CString &csName, int cx, int cy, BOOL bFront); |
| 16 |
BOOL SetPixel(int x, int y, COLORREF color); |
| 17 |
BOOL SetXLine(int y, int cx, LPCOLORREF lpColor); |
| 18 |
BOOL SetYLine(int x, int cy, LPCOLORREF lpColor); |
| 19 |
void SetWindowSize(int cx, int cy, int x, int y); |
| 20 |
void SetCenterWindow(); |
| 21 |
void ResetWindow(); |
| 22 |
|
| 23 |
BOOL StartTimer(); |
| 24 |
BOOL ForceClose(); |
| 25 |
void StopTimer(); |
| 26 |
void RuntimeTimer(); |
| 27 |
void InitRenderingCount(UINT nTotal); |
| 28 |
void AddRenderingCount(); |
| 29 |
void FinishDrawing(); |
| 30 |
void GetTimer(CString &cs); |
| 31 |
void SetReportList(const CalcReportList &list) { m_ReportList.Copy(list); } |
| 32 |
void SetMode(BOOL fSystem) { m_fSystem = fSystem; } |
| 33 |
void SetNodeCount(DWORD dwNodes) { m_dwNodes = dwNodes; } |
| 34 |
void SetProcessros(DWORD dwProcessors) { m_dwProcessors = dwProcessors; } |
| 35 |
|
| 36 |
void SetCalcSize(CALCSIZE size) { m_CalcSize = size; } |
| 37 |
void GetCalcSize(CALCSIZE &size) { size = m_CalcSize; } |
| 38 |
void SetLog(BOOL fSave) { m_fSaveLog = fSave; } |
| 39 |
BOOL IsAPIWindow() { return IsWindow(m_hWnd); } |
| 40 |
BOOL IsSystemMode() { return m_fSystem; } |
| 41 |
|
| 42 |
protected: |
| 43 |
DECLARE_MESSAGE_MAP() |
| 44 |
|
| 45 |
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); |
| 46 |
afx_msg void OnClose(); |
| 47 |
afx_msg void OnDestroy(); |
| 48 |
afx_msg LRESULT OnShowLog(WPARAM wParam, LPARAM lParam); |
| 49 |
afx_msg LRESULT OnOutputReport(WPARAM wParam, LPARAM lParam); |
| 50 |
|
| 51 |
BOOL SaveReport(); |
| 52 |
void OutputReportList(); |
| 53 |
static void WINAPI doRuntimeTimer(LPVOID pvContext, BOOLEAN fTimeout); |
| 54 |
|
| 55 |
protected: |
| 56 |
CCriticalSection m_DrawLock; |
| 57 |
CCriticalSection m_RgCountLock; |
| 58 |
CalcReportList m_ReportList; |
| 59 |
LOCKTIMER m_Timer; |
| 60 |
CALCSIZE m_CalcSize; |
| 61 |
CStopwatch m_Stopwatch; |
| 62 |
CString m_csWndName; |
| 63 |
CString m_LogPath; |
| 64 |
HICON m_hIcon; |
| 65 |
DWORD m_dwNodes; |
| 66 |
DWORD m_dwProcessors; |
| 67 |
BOOL m_fDrawing; |
| 68 |
BOOL m_fView; |
| 69 |
BOOL m_fSystem; |
| 70 |
BOOL m_fSaveLog; |
| 71 |
UINT m_nRecvCount; |
| 72 |
UINT m_nTotalCount; |
| 73 |
int m_nWidth; |
| 74 |
int m_nHeight; |
| 75 |
int m_nHPos; |
| 76 |
int m_nVPos; |
| 77 |
}; |
| 78 |
|
| 79 |
////////////////////////////////////////////////////////////////////////// |
| 80 |
|
| 81 |
|