1 |
786 |
skrzyp |
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####
|
2 |
|
|
// -------------------------------------------
|
3 |
|
|
// This file is part of the eCos host tools.
|
4 |
|
|
// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
5 |
|
|
//
|
6 |
|
|
// This program is free software; you can redistribute it and/or modify
|
7 |
|
|
// it under the terms of the GNU General Public License as published by
|
8 |
|
|
// the Free Software Foundation; either version 2 or (at your option) any
|
9 |
|
|
// later version.
|
10 |
|
|
//
|
11 |
|
|
// This program is distributed in the hope that it will be useful, but
|
12 |
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 |
|
|
// General Public License for more details.
|
15 |
|
|
//
|
16 |
|
|
// You should have received a copy of the GNU General Public License
|
17 |
|
|
// along with this program; if not, write to the
|
18 |
|
|
// Free Software Foundation, Inc., 51 Franklin Street,
|
19 |
|
|
// Fifth Floor, Boston, MA 02110-1301, USA.
|
20 |
|
|
// -------------------------------------------
|
21 |
|
|
// ####ECOSHOSTGPLCOPYRIGHTEND####
|
22 |
|
|
#if !defined(AFX_RUNTESTSSHEET_H__44CEA289_11C4_11D3_A505_00A0C949ADAC__INCLUDED_)
|
23 |
|
|
#define AFX_RUNTESTSSHEET_H__44CEA289_11C4_11D3_A505_00A0C949ADAC__INCLUDED_
|
24 |
|
|
|
25 |
|
|
#if _MSC_VER > 1000
|
26 |
|
|
#pragma once
|
27 |
|
|
#endif // _MSC_VER > 1000
|
28 |
|
|
// RunTestsSheet.h : header file
|
29 |
|
|
//
|
30 |
|
|
|
31 |
|
|
/////////////////////////////////////////////////////////////////////////////
|
32 |
|
|
// CRunTestsSheet
|
33 |
|
|
#include "stdafx.h"
|
34 |
|
|
#include "ExecutionPage.h"
|
35 |
|
|
#include "OutputPage.h"
|
36 |
|
|
#include "SummaryPage.h"
|
37 |
|
|
#include "Properties.h"
|
38 |
|
|
#include "eCosTest.h"
|
39 |
|
|
#include "eCosPropertySheet.h"
|
40 |
|
|
|
41 |
|
|
class CTestResource;
|
42 |
|
|
class CRunTestsSheet : public CeCosPropertySheet
|
43 |
|
|
{
|
44 |
|
|
DECLARE_DYNAMIC(CRunTestsSheet)
|
45 |
|
|
enum Status {Running, Stopping, Stopped};
|
46 |
|
|
Status m_Status;
|
47 |
|
|
// Construction
|
48 |
|
|
public:
|
49 |
|
|
|
50 |
|
|
typedef void (CALLBACK CBFunc)(CProperties*,bool bSave);
|
51 |
|
|
CRunTestsSheet(LPCTSTR pszCaption=_T("Run Tests"), CWnd* pParentWnd = NULL, UINT iSelectPage = 0, CBFunc *pInitFunc=0, CRunTestsSheet **ppSheet=0);
|
52 |
|
|
|
53 |
|
|
// Attributes
|
54 |
|
|
public:
|
55 |
|
|
protected:
|
56 |
|
|
CeCosTest::ExecutionParameters m_ep;
|
57 |
|
|
String m_strTarget;
|
58 |
|
|
int m_nTimeout;
|
59 |
|
|
int m_nDownloadTimeout;
|
60 |
|
|
int m_nTimeoutType;
|
61 |
|
|
int m_nDownloadTimeoutType;
|
62 |
|
|
bool m_bRemote;
|
63 |
|
|
bool m_bSerial;
|
64 |
|
|
int m_nBaud;
|
65 |
|
|
String m_strLocalTCPIPHost;
|
66 |
|
|
int m_nLocalTCPIPPort;
|
67 |
|
|
int m_nReset;
|
68 |
|
|
String m_strResourceHost;
|
69 |
|
|
int m_nResourcePort;
|
70 |
|
|
String m_strReset;
|
71 |
|
|
static void CALLBACK RunLocalFunc(void *pParam);
|
72 |
|
|
static void CALLBACK RunRemoteFunc(void *pParam);
|
73 |
|
|
|
74 |
|
|
// Operations
|
75 |
|
|
public:
|
76 |
|
|
void SetTarget(LPCTSTR pszTarget);
|
77 |
|
|
void SetResetNone() { m_nReset = RESET_NONE; };
|
78 |
|
|
// Overrides
|
79 |
|
|
// ClassWizard generated virtual function overrides
|
80 |
|
|
//{{AFX_VIRTUAL(CRunTestsSheet)
|
81 |
|
|
public:
|
82 |
|
|
virtual BOOL OnInitDialog();
|
83 |
|
|
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
84 |
|
|
virtual int DoModal();
|
85 |
|
|
protected:
|
86 |
|
|
virtual void PostNcDestroy();
|
87 |
|
|
//}}AFX_VIRTUAL
|
88 |
|
|
|
89 |
|
|
// Implementation
|
90 |
|
|
public:
|
91 |
|
|
CProperties m_prop;
|
92 |
|
|
virtual ~CRunTestsSheet();
|
93 |
|
|
|
94 |
|
|
enum AffinityType { BottomRight, TopLeft, TopRight, BottomLeft, Stretch};
|
95 |
|
|
void MoveWindow(CWnd *pWnd,AffinityType Affinity,bool bRepaint=true);
|
96 |
|
|
CRect GetWindowOffset(CWnd *pWnd);
|
97 |
|
|
// Generated message map functions
|
98 |
|
|
protected:
|
99 |
|
|
CRunTestsSheet ** m_ppSheet;
|
100 |
|
|
bool m_bModal;
|
101 |
|
|
bool m_bHideRemoteControls;
|
102 |
|
|
static DWORD CALLBACK X10ThreadFunc (void *pParam);
|
103 |
|
|
CString m_strPlacement;
|
104 |
|
|
bool m_bHideTarget;
|
105 |
|
|
UINT m_nRemotePort;
|
106 |
|
|
bool m_bFarmed;
|
107 |
|
|
String m_strPort;
|
108 |
|
|
int m_cyMin;
|
109 |
|
|
int m_cxMin;
|
110 |
|
|
CRect m_rcPrev,m_rcOffset;
|
111 |
|
|
bool m_bAllowResizing;
|
112 |
|
|
CBFunc* m_pInitFunc;
|
113 |
|
|
void * m_InitFuncParam;
|
114 |
|
|
static void CALLBACK TestOutputCallback(void *pParam,LPCTSTR psz);
|
115 |
|
|
CTestResource * m_pResource;
|
116 |
|
|
CRITICAL_SECTION m_CS;
|
117 |
|
|
int m_nTestsToComplete;
|
118 |
|
|
static void CALLBACK RunCallback(void *pParam);
|
119 |
|
|
int m_nNextToSubmit;
|
120 |
|
|
void SubmitTests();
|
121 |
|
|
CExecutionPage executionpage;
|
122 |
|
|
public:
|
123 |
|
|
void Populate (LPCTSTR pszFile,bool bSelect=true);
|
124 |
|
|
void HideRemoteControls();
|
125 |
|
|
String m_strRemoteHost;
|
126 |
|
|
private:
|
127 |
|
|
COutputPage outputpage;
|
128 |
|
|
CSummaryPage summarypage;
|
129 |
|
|
//{{AFX_MSG(CRunTestsSheet)
|
130 |
|
|
afx_msg void OnRun();
|
131 |
|
|
afx_msg void OnProperties();
|
132 |
|
|
afx_msg void OnClose();
|
133 |
|
|
afx_msg LRESULT OnTestOutput(WPARAM wParam, LPARAM lParam);
|
134 |
|
|
afx_msg LRESULT OnTestsComplete(WPARAM wParam, LPARAM lParam);
|
135 |
|
|
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
136 |
|
|
afx_msg void OnSize(UINT nType, int cx, int cy);
|
137 |
|
|
afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
|
138 |
|
|
afx_msg void OnTimer(UINT nIDEvent);
|
139 |
|
|
//}}AFX_MSG
|
140 |
|
|
afx_msg LRESULT OnKickIdle(WPARAM, LPARAM);
|
141 |
|
|
DECLARE_MESSAGE_MAP()
|
142 |
|
|
};
|
143 |
|
|
|
144 |
|
|
/////////////////////////////////////////////////////////////////////////////
|
145 |
|
|
|
146 |
|
|
//{{AFX_INSERT_LOCATION}}
|
147 |
|
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
148 |
|
|
|
149 |
|
|
#endif // !defined(AFX_RUNTESTSSHEET_H__44CEA289_11C4_11D3_A505_00A0C949ADAC__INCLUDED_)
|