OpenASIP
2.0
|
#include <ProximStopDialog.hh>
Public Member Functions | |
ProximStopDialog (wxWindow *parent, wxWindowID id, SimulatorFrontend &frontend) | |
virtual | ~ProximStopDialog () |
Private Types | |
enum | { ID_STOP = 10000, ID_LABEL_CYCLES, ID_CYCLES, ID_LABEL_TIME, ID_TIME, ID_LABEL_CPS, ID_CPS, ID_TEXT, ID_LINE } |
Widget IDs. More... | |
Private Member Functions | |
void | onStop (wxCommandEvent &event) |
void | onClose (wxCloseEvent &event) |
void | onUpdate (wxTimerEvent &event) |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
Private Attributes | |
SimulatorFrontend & | frontend_ |
Simulator frontend to stop and track. More... | |
wxTimer * | timer_ |
Timer which updates the dialog periodically. More... | |
wxStopWatch * | watch_ |
Stop watch measuring the simulation runtime. More... | |
wxStaticText * | timeCtrl_ |
Text displaying the elapsed simulation time. More... | |
wxStaticText * | cyclesCtrl_ |
Text displaying the simulated cycle count. More... | |
wxStaticText * | cpsCtrl_ |
Text displaying the average cps value. More... | |
long | time_ |
Time elapsed on the cps update. More... | |
ClockCycleCount | cycles_ |
Cycles simulated on the last cps update. More... | |
Static Private Attributes | |
static const int | UPDATE_INTERVAL = 100 |
Dialog update itnerval in milliseconds. More... | |
Dialog which is diaplayed when the simulation is running.
The dialog contains Stop-button for stopping the simulation, and some information of the simulation progress.
Definition at line 47 of file ProximStopDialog.hh.
|
private |
Widget IDs.
Enumerator | |
---|---|
ID_STOP | |
ID_LABEL_CYCLES | |
ID_CYCLES | |
ID_LABEL_TIME | |
ID_TIME | |
ID_LABEL_CPS | |
ID_CPS | |
ID_TEXT | |
ID_LINE |
Definition at line 64 of file ProximStopDialog.hh.
ProximStopDialog::ProximStopDialog | ( | wxWindow * | parent, |
wxWindowID | id, | ||
SimulatorFrontend & | frontend | ||
) |
The Constructor.
parent | Parent window of the dialog. |
id | Window identifier. |
frontend | Simulator frontend to stop. |
Definition at line 54 of file ProximStopDialog.cc.
|
virtual |
|
private |
Creates the dialog widgets.
Code generated by wxDesigner. Do not modify manually.
parent | Parent window of the dialog. |
call_fit | If true, the parent window is resized to fit the widgets. |
set_sizer | If true, Sets the created widgets as parent window contents. |
Definition at line 155 of file ProximStopDialog.cc.
References ID_CPS, ID_CYCLES, ID_LABEL_CPS, ID_LABEL_CYCLES, ID_LABEL_TIME, ID_LINE, ID_STOP, ID_TEXT, and ID_TIME.
|
private |
Event handler for the windowmanager dialog close button.
Requests simulator stop and closes the dialog.
Definition at line 138 of file ProximStopDialog.cc.
References frontend_, SimulatorFrontend::prepareToStop(), and SRE_USER_REQUESTED.
|
private |
Event handler for the Stop button.
Request simulator stop and closes the dialog.
Definition at line 127 of file ProximStopDialog.cc.
References frontend_, SimulatorFrontend::prepareToStop(), and SRE_USER_REQUESTED.
|
private |
Event handler for the dialog update timer.
Updates the cycle count and simulation time. Also checks if the simulation is still running. If the simulation is no longer running, the dialog is closed automatically.
Definition at line 90 of file ProximStopDialog.cc.
References cpsCtrl_, SimulatorFrontend::cycleCount(), cycles_, cyclesCtrl_, frontend_, SimulatorFrontend::isSimulationRunning(), time_, timeCtrl_, WxConversion::toWxString(), and watch_.
|
private |
Text displaying the average cps value.
Definition at line 89 of file ProximStopDialog.hh.
Referenced by onUpdate().
|
private |
Cycles simulated on the last cps update.
Definition at line 94 of file ProximStopDialog.hh.
Referenced by onUpdate().
|
private |
Text displaying the simulated cycle count.
Definition at line 87 of file ProximStopDialog.hh.
Referenced by onUpdate().
|
private |
Simulator frontend to stop and track.
Definition at line 77 of file ProximStopDialog.hh.
Referenced by onClose(), onStop(), and onUpdate().
|
private |
Time elapsed on the cps update.
Definition at line 92 of file ProximStopDialog.hh.
Referenced by onUpdate().
|
private |
Text displaying the elapsed simulation time.
Definition at line 85 of file ProximStopDialog.hh.
Referenced by onUpdate().
|
private |
Timer which updates the dialog periodically.
Definition at line 80 of file ProximStopDialog.hh.
Referenced by ~ProximStopDialog().
|
staticprivate |
Dialog update itnerval in milliseconds.
Definition at line 97 of file ProximStopDialog.hh.
|
private |
Stop watch measuring the simulation runtime.
Definition at line 82 of file ProximStopDialog.hh.
Referenced by onUpdate(), and ~ProximStopDialog().