33 #include <wx/statline.h>
34 #include <boost/format.hpp>
56 wxDialog(parent,
id, _T("Simulation running..."), wxDefaultPosition),
57 frontend_(frontend), time_(0) {
59 createContents(
this,
true,
true);
61 cyclesCtrl_ =
dynamic_cast<wxStaticText*
>(
FindWindow(ID_CYCLES));
62 timeCtrl_ =
dynamic_cast<wxStaticText*
>(
FindWindow(ID_TIME));
63 cpsCtrl_ =
dynamic_cast<wxStaticText*
>(
FindWindow(ID_CPS));
64 cpsCtrl_->SetLabel(_T(
""));
66 timer_ =
new wxTimer(
this, 0);
67 watch_ =
new wxStopWatch();
69 cycles_ = frontend_.cycleCount();
70 timer_->Start(UPDATE_INTERVAL);
100 long time =
watch_->Time();
101 unsigned seconds = (time / 1000) % 60;
102 unsigned minutes = (time / 1000) / 60;
105 timeStr.Prepend(_T(
":0"));
107 timeStr.Prepend(_T(
":"));
112 if (time -
time_ > 1000) {
156 wxWindow *parent,
bool call_fit,
bool set_sizer) {
157 wxBoxSizer *item0 =
new wxBoxSizer( wxVERTICAL );
159 item0->Add( 20, 20, 0, wxALIGN_CENTER|wxALL, 5 );
161 wxStaticText *item1 =
new wxStaticText( parent,
ID_TEXT, wxT(
"Simulation running..."), wxDefaultPosition, wxDefaultSize, 0 );
162 item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
164 item0->Add( 20, 20, 0, wxALIGN_CENTER|wxALL, 5 );
166 wxFlexGridSizer *item2 =
new wxFlexGridSizer( 2, 0, 0 );
168 wxStaticText *item3 =
new wxStaticText( parent,
ID_LABEL_CYCLES, wxT(
"Cycles:"), wxDefaultPosition, wxDefaultSize, 0 );
169 item2->Add( item3, 0, wxALIGN_RIGHT|wxALL, 5 );
171 wxStaticText *item4 =
new wxStaticText( parent,
ID_CYCLES, wxT(
"???????????????????"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
172 item2->Add( item4, 0, wxALL, 5 );
174 wxStaticText *item5 =
new wxStaticText( parent,
ID_LABEL_TIME, wxT(
"Time:"), wxDefaultPosition, wxDefaultSize, 0 );
175 item2->Add( item5, 0, wxALIGN_RIGHT|wxALL, 5 );
177 wxStaticText *item6 =
new wxStaticText( parent,
ID_TIME, wxT(
"???????????????????"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
178 item2->Add( item6, 0, wxALL, 5 );
180 wxStaticText *item7 =
new wxStaticText( parent,
ID_LABEL_CPS, wxT(
"Avg. cycles/sec:"), wxDefaultPosition, wxDefaultSize, 0 );
181 item2->Add( item7, 0, wxALIGN_RIGHT|wxALL, 5 );
183 wxStaticText *item8 =
new wxStaticText( parent,
ID_CPS, wxT(
"???????????????????"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
184 item2->Add( item8, 0, wxALL, 5 );
186 item0->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );
188 wxStaticLine *item9 =
new wxStaticLine( parent,
ID_LINE, wxDefaultPosition, wxSize(300,-1), wxLI_HORIZONTAL );
189 item0->Add( item9, 0, wxGROW|wxALL, 5 );
191 wxButton *item10 =
new wxButton( parent,
ID_STOP, wxT(
"&Stop"), wxDefaultPosition, wxDefaultSize, 0 );
192 item0->Add( item10, 0, wxALIGN_CENTER|wxALL, 5 );
196 parent->SetSizer( item0 );
198 item0->SetSizeHints( parent );