OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [configtool/] [standalone/] [wxwin/] [runtestsdlg.h] - Blame information for rev 817

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
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
// runtestsdlg.cpp :
23
//
24
//===========================================================================
25
//#####DESCRIPTIONBEGIN####
26
//
27
// Author(s):   julians
28
// Contact(s):  julians
29
// Date:        2000/09/29
30
// Version:     $Id: runtestsdlg.h,v 1.11 2001/12/13 15:30:27 julians Exp $
31
// Purpose:
32
// Description: Header file for ecRunTestsDialog
33
// Requires:
34
// Provides:
35
// See also:
36
// Known bugs:
37
// Usage:
38
//
39
//####DESCRIPTIONEND####
40
//
41
//===========================================================================
42
 
43
#ifndef _ECOS_RUNTESTSDLG_H_
44
#define _ECOS_RUNTESTSDLG_H_
45
 
46
#ifdef __GNUG__
47
    #pragma interface "runtestsdlg.cpp"
48
#endif
49
 
50
#include "wx/notebook.h"
51
#include "wx/thread.h"
52
 
53
#include "eCosTest.h"
54
#include "Properties.h"
55
 
56
/*
57
 * ecRunTestsTimer
58
 * Just to force idle processing now and again while
59
 * the tests are running
60
 */
61
 
62
class ecRunTestsTimer: public wxTimer
63
{
64
public:
65
    ecRunTestsTimer() {}
66
 
67
    virtual void Notify() ;
68
};
69
 
70
//----------------------------------------------------------------------------
71
// ecRunTestsDialog
72
//----------------------------------------------------------------------------
73
 
74
class ecRunTestsExecutablesDialog;
75
class ecRunTestsOutputDialog;
76
class ecRunTestsSummaryDialog;
77
 
78
enum ecRunStatus { ecRunning, ecStopping, ecStopped };
79
 
80
#ifdef __WXGTK__
81
#define DWORD int
82
#endif
83
 
84
class ecRunTestsDialog: public wxDialog
85
{
86
DECLARE_CLASS(ecRunTestsDialog)
87
    friend class ecResetThread;
88
    friend class ecRunTestsTimer;
89
public:
90
    ecRunTestsDialog(wxWindow* parent);
91
    ~ecRunTestsDialog();
92
 
93
    void OnOK(wxCommandEvent& event);
94
    void OnRun(wxCommandEvent& event);
95
    void OnProperties(wxCommandEvent& event);
96
    //void OnHelp(wxCommandEvent& event);
97
    void OnPageChange(wxNotebookEvent& event);
98
    void OnSize(wxSizeEvent& event);
99
    void OnIdle(wxIdleEvent& event);
100
    void OnCloseWindow(wxCloseEvent& event);
101
 
102
    virtual bool TransferDataToWindow();
103
    virtual bool TransferDataFromWindow();
104
 
105
    inline wxNotebook* GetNotebook() const { return m_notebook; }
106
 
107
    // Add the test to the dialog
108
    void Populate(const wxString& test, bool select = TRUE);
109
        void SubmitTests();
110
 
111
    // Write to the output buffer for OnIdle to pick up
112
    void OutputToBuffer(const wxString& str);
113
    // Write any remaining text
114
    void FlushBuffer();
115
 
116
    // Thread callbacks
117
    static void RunCallback(void *pParam);
118
    static void CALLBACK RunLocalFunc(void *pParam);
119
    static void CALLBACK RunRemoteFunc(void *pParam);
120
        static void CALLBACK TestOutputCallback(void *pParam,LPCTSTR psz);
121
 
122
    // Helpers
123
    // Translate from Windows to Unix serial port nomenclature
124
    wxString TranslatePort(const wxString& port) const;
125
 
126
protected:
127
 
128
    ecRunTestsExecutablesDialog*            m_executables;
129
    ecRunTestsOutputDialog*                 m_output;
130
    ecRunTestsSummaryDialog*                m_summary;
131
    wxNotebook*                             m_notebook;
132
 
133
    ecRunStatus                             m_runStatus;
134
    CeCosTest::ExecutionParameters          m_ep;
135
        int                                     m_nNextToSubmit;
136
    CTestResource*                          m_pResource;
137
    CProperties                             m_prop;
138
    wxCriticalSection                       m_CS;
139
    static ecRunTestsDialog*                m_runTestsDialog;
140
    bool                                    m_testsAreComplete;
141
 
142
    // Output text by writing to the buffer and letting
143
    // OnIdle pick it up
144
    wxString                                m_outputBuffer;
145
    bool                                    m_outputBufferPresent;
146
    ecRunTestsTimer                         m_timer;
147
DECLARE_EVENT_TABLE()
148
};
149
 
150
/* Executables dialog
151
 */
152
 
153
class ecRunTestsExecutablesDialog: public wxPanel
154
{
155
DECLARE_CLASS(ecRunTestsExecutablesDialog)
156
DECLARE_EVENT_TABLE()
157
public:
158
    ecRunTestsExecutablesDialog(wxWindow* parent);
159
 
160
    void CreateControls( wxPanel *parent);
161
    void AddFromFolder(const wxString& folder, bool recurse, const wxString& wildcard);
162
    int SelectedTestCount();
163
        wxString SelectedTest(int nIndex);
164
 
165
    void OnCheckAll(wxCommandEvent& event);
166
    void OnUncheckAll(wxCommandEvent& event);
167
    void OnAdd(wxCommandEvent& event);
168
    void OnAddFromFolder(wxCommandEvent& event);
169
    void OnRemove(wxCommandEvent& event);
170
    void OnUpdateCheckAll(wxUpdateUIEvent& event);
171
    void OnUpdateUncheckAll(wxUpdateUIEvent& event);
172
};
173
 
174
#define ecID_RUN_TESTS_CHECK_ALL 10072
175
#define ecID_RUN_TESTS_UNCHECK_ALL 10073
176
#define ecID_RUN_TESTS_ADD 10074
177
#define ecID_RUN_TESTS_ADD_FOLDER 10075
178
#define ecID_RUN_TESTS_REMOVE 10076
179
#define ecID_RUN_TESTS_TEST_LIST 2063
180
 
181
/* Output dialog
182
 */
183
 
184
class ecRunTestsOutputDialog: public wxPanel
185
{
186
DECLARE_CLASS(ecRunTestsOutputDialog)
187
public:
188
    ecRunTestsOutputDialog(wxWindow* parent);
189
 
190
    void CreateControls( wxPanel *parent);
191
 
192
    void AddText(const wxString& msg);
193
    void AddLogMsg(const wxString& msg);
194
};
195
 
196
#define ecID_RUN_TESTS_OUTPUT_TEXT 10088
197
 
198
/* Summary dialog
199
 */
200
 
201
class WXDLLEXPORT wxListCtrl;
202
 
203
// Windows requires the sort function to be of type
204
// CALLBACK
205
#ifndef CALLBACK
206
#define CALLBACK
207
#endif
208
 
209
class ecRunTestsSummaryDialog: public wxPanel
210
{
211
DECLARE_CLASS(ecRunTestsSummaryDialog)
212
DECLARE_EVENT_TABLE()
213
public:
214
    ecRunTestsSummaryDialog(wxWindow* parent);
215
 
216
    void CreateControls( wxPanel *parent);
217
        void AddResult (CeCosTest *pTest);
218
    void OnColClick(wxListEvent& event);
219
    static int CALLBACK SummarySortFunc(long data1, long data2, long col);
220
 
221
    static wxListCtrl* m_listCtrl;
222
};
223
 
224
#define ecID_RUN_TESTS_SUMMARY_LIST     2063
225
 
226
// Information used in thread processing
227
struct ecRunTestsInfo {
228
  ecRunTestsDialog* pSheet;
229
  CeCosTest      *  pTest;
230
};
231
 
232
// Thread class used for resetting a remote target
233
class ecResetThread : public wxThread
234
{
235
public:
236
    ecResetThread(ecRunTestsInfo* info) { m_info = info; };
237
 
238
    // thread execution starts here
239
    virtual void *Entry();
240
 
241
    // called when the thread exits - whether it terminates normally or is
242
    // stopped with Delete() (but not when it is Kill()ed!)
243
    virtual void OnExit();
244
 
245
public:
246
    ecRunTestsInfo* m_info;
247
};
248
 
249
 
250
#endif
251
    // _ECOS_RUNTESTSDLG_H_

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.