34 #include <wx/statline.h>
64 #if wxCHECK_VERSION(3, 0, 0)
65 #define wxSAVE wxFD_SAVE
66 #define wxOVERWRITE_PROMPT wxFD_OVERWRITE_PROMPT
97 showMoves_(true), showUtilizations_(true),
98 detailsCtrl_(NULL), utilizationCtrl_(NULL) {
102 SetSizeHints(400, 300);
104 simulator_ = wxGetApp().simulation()->frontend();
106 if (simulator_->isSimulationInitialized() ||
107 simulator_->isSimulationStopped() ||
108 simulator_->isSimulationRunning() ||
109 simulator_->hasSimulationEnded()) {
116 if (showUtilizations_) {
117 setUtilizationHighlights();
181 if (selection != NULL) {
183 if (part != NULL && part->
canHandle(&statusRequest)) {
201 sizer_ =
new wxBoxSizer(wxVERTICAL);
203 wxSplitterWindow* splitter =
new wxSplitterWindow(
204 this,
ID_SPLITTER, wxDefaultPosition, wxSize(800,600),
205 wxSP_BORDER|wxSP_3D|wxCLIP_CHILDREN);
207 wxPanel* left =
new wxPanel(splitter, -1);
208 wxPanel* right =
new wxPanel(splitter, -1);
211 wxFlexGridSizer* leftSizer =
new wxFlexGridSizer(1, 0, 0);
212 leftSizer->AddGrowableCol(0);
213 leftSizer->AddGrowableRow(1);
214 leftSizer->AddGrowableRow(4);
216 wxStaticText* title =
new wxStaticText(
218 wxDefaultPosition, wxDefaultSize, 0);
221 left,
ID_DETAILS, wxT(
""), wxDefaultPosition, wxSize(80,40),
222 wxTE_MULTILINE|wxTE_READONLY|wxVSCROLL|wxHSCROLL);
224 wxStaticLine* line =
new wxStaticLine(
225 left,
ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL);
227 wxStaticText* utilizationTitle =
new wxStaticText(
234 wxTE_MULTILINE|wxTE_READONLY|wxVSCROLL|wxHSCROLL);
236 leftSizer->Add(title, 0, wxGROW|wxALL, 5);
238 leftSizer->Add(line, 0, wxGROW|wxALL, 5);
239 leftSizer->Add(utilizationTitle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
241 left->SetSizer(leftSizer);
245 wxFlexGridSizer* rightSizer =
new wxFlexGridSizer(1, 0, 0);
246 rightSizer->AddGrowableCol(0);
247 rightSizer->AddGrowableRow(0);
250 rightSizer->Add(
canvas_, 0, wxGROW|wxALL, 5);
251 rightSizer->Add(
statusbar_, 0, wxGROW|wxALL, 5);
252 right->SetSizer(rightSizer);
256 splitter->SplitVertically(left, right);
259 sizer_->Add(splitter, 1, wxGROW);
317 for (
int i = 0; i < busNavigator.
count(); i++) {
320 double utilization =
static_cast<double>(writes) / cycles;
321 unsigned value = unsigned(utilization * 255);
329 for (
int i = 0; i < socketNavigator.
count(); i++) {
332 double utilization =
static_cast<double>(writes) / cycles;
333 unsigned value = 255 - unsigned(utilization * 255);
334 wxColour colour = wxColour(255, value, value);
342 for (
int i = 0; i < fuNavigator.
count(); i++) {
345 double utilization =
static_cast<double>(writes) / cycles;
346 unsigned value = 255 - unsigned(utilization * 255);
347 wxColour colour = wxColour(255, value, value);
366 for (
int i = 0; i < instruction.
moveCount(); i++) {
378 const Bus* bus = &move.
bus();
379 const Port* source = NULL;
380 const Port* target = NULL;
500 wxString message = _T(
"Export processor figure.");
501 wxString defaultDir = _T(
".");
502 wxString defaultFile= _T(
"");
503 #if wxCHECK_VERSION(3, 0, 0)
504 wxString fileTypes = _T(
"Scalable Vector Graphics (.svg)|*.svg|");
506 wxString fileTypes = _T(
"Encapsulated Postscript (.eps)|*.eps;*.epsi|");
508 fileTypes.Append(_T(
"Portable Network Graphics (.png)|*.png"));
511 this, message, defaultDir, defaultFile, fileTypes,
512 wxSAVE | wxOVERWRITE_PROMPT);
514 if (dialog.ShowModal() == wxID_CANCEL) {
520 std::string creator =
"TTA Processor Simulator (Proxim)";
521 std::string title =
"Processor Simulation";
523 #if wxCHECK_VERSION(3, 0, 0)
524 if (extension ==
".svg") {
525 if (!
canvas_->saveSVG(filename)) {
527 if (extension ==
".eps" || extension ==
".epsi") {
530 wxString message = _T(
"Error saving file '");
531 message.Append(dialog.GetPath());
532 message.Append(_T(
"'."));
534 errorDialog.ShowModal();
536 }
else if (extension ==
".png") {
538 wxString message = _T(
"Error saving file '");
539 message.Append(dialog.GetPath());
540 message.Append(_T(
"'."));
542 errorDialog.ShowModal();
545 wxString message = _T(
"File type with extension '");
547 message.Append(_T(
"' is not supported."));