OpenASIP  2.0
ProximStopDialog.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file ProximStopDialog.hh
26  *
27  * Declaration of ProximStopDialog class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2005 (vjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_PROXIM_STOP_DIALOG_HH
34 #define TTA_PROXIM_STOP_DIALOG_HH
35 
36 #include <wx/wx.h>
37 #include "SimulatorConstants.hh"
38 
39 class SimulatorFrontend;
40 
41 /**
42  * Dialog which is diaplayed when the simulation is running.
43  *
44  * The dialog contains Stop-button for stopping the simulation, and some
45  * information of the simulation progress.
46  */
47 class ProximStopDialog : public wxDialog {
48 public:
50  wxWindow* parent,
51  wxWindowID id,
52  SimulatorFrontend& frontend);
53 
54  virtual ~ProximStopDialog();
55 
56 private:
57  void onStop(wxCommandEvent& event);
58  void onClose(wxCloseEvent& event);
59  void onUpdate(wxTimerEvent& event);
60 
61  wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
62 
63  /// Widget IDs.
64  enum {
65  ID_STOP = 10000,
74  };
75 
76  /// Simulator frontend to stop and track.
78 
79  /// Timer which updates the dialog periodically.
80  wxTimer* timer_;
81  /// Stop watch measuring the simulation runtime.
82  wxStopWatch* watch_;
83 
84  /// Text displaying the elapsed simulation time.
85  wxStaticText* timeCtrl_;
86  /// Text displaying the simulated cycle count.
87  wxStaticText* cyclesCtrl_;
88  /// Text displaying the average cps value.
89  wxStaticText* cpsCtrl_;
90 
91  /// Time elapsed on the cps update.
92  long time_;
93  /// Cycles simulated on the last cps update.
95 
96  /// Dialog update itnerval in milliseconds.
97  static const int UPDATE_INTERVAL;
98 
99  DECLARE_EVENT_TABLE()
100 };
101 #endif
ProximStopDialog::cycles_
ClockCycleCount cycles_
Cycles simulated on the last cps update.
Definition: ProximStopDialog.hh:94
ProximStopDialog::time_
long time_
Time elapsed on the cps update.
Definition: ProximStopDialog.hh:92
ProximStopDialog::ProximStopDialog
ProximStopDialog(wxWindow *parent, wxWindowID id, SimulatorFrontend &frontend)
Definition: ProximStopDialog.cc:54
ProximStopDialog::ID_LABEL_TIME
@ ID_LABEL_TIME
Definition: ProximStopDialog.hh:68
ProximStopDialog::ID_TIME
@ ID_TIME
Definition: ProximStopDialog.hh:69
SimulatorConstants.hh
ProximStopDialog::ID_STOP
@ ID_STOP
Definition: ProximStopDialog.hh:65
ProximStopDialog::ID_LABEL_CPS
@ ID_LABEL_CPS
Definition: ProximStopDialog.hh:70
ProximStopDialog::frontend_
SimulatorFrontend & frontend_
Simulator frontend to stop and track.
Definition: ProximStopDialog.hh:77
ProximStopDialog::ID_CPS
@ ID_CPS
Definition: ProximStopDialog.hh:71
ProximStopDialog::cyclesCtrl_
wxStaticText * cyclesCtrl_
Text displaying the simulated cycle count.
Definition: ProximStopDialog.hh:87
ProximStopDialog::ID_CYCLES
@ ID_CYCLES
Definition: ProximStopDialog.hh:67
ProximStopDialog::timeCtrl_
wxStaticText * timeCtrl_
Text displaying the elapsed simulation time.
Definition: ProximStopDialog.hh:85
ProximStopDialog::watch_
wxStopWatch * watch_
Stop watch measuring the simulation runtime.
Definition: ProximStopDialog.hh:82
ProximStopDialog
Definition: ProximStopDialog.hh:47
ProximStopDialog::onStop
void onStop(wxCommandEvent &event)
Definition: ProximStopDialog.cc:127
ProximStopDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: ProximStopDialog.cc:155
ProximStopDialog::ID_TEXT
@ ID_TEXT
Definition: ProximStopDialog.hh:72
ProximStopDialog::cpsCtrl_
wxStaticText * cpsCtrl_
Text displaying the average cps value.
Definition: ProximStopDialog.hh:89
ProximStopDialog::ID_LINE
@ ID_LINE
Definition: ProximStopDialog.hh:73
ProximStopDialog::onClose
void onClose(wxCloseEvent &event)
Definition: ProximStopDialog.cc:138
ClockCycleCount
CycleCount ClockCycleCount
Alias for ClockCycleCount.
Definition: SimulatorConstants.hh:57
ProximStopDialog::onUpdate
void onUpdate(wxTimerEvent &event)
Definition: ProximStopDialog.cc:90
ProximStopDialog::timer_
wxTimer * timer_
Timer which updates the dialog periodically.
Definition: ProximStopDialog.hh:80
ProximStopDialog::~ProximStopDialog
virtual ~ProximStopDialog()
Definition: ProximStopDialog.cc:77
SimulatorFrontend
Definition: SimulatorFrontend.hh:89
ProximStopDialog::ID_LABEL_CYCLES
@ ID_LABEL_CYCLES
Definition: ProximStopDialog.hh:66
ProximStopDialog::UPDATE_INTERVAL
static const int UPDATE_INTERVAL
Dialog update itnerval in milliseconds.
Definition: ProximStopDialog.hh:97