OpenASIP
2.0
|
#include <ProximMachineStateWindow.hh>
Public Types | |
enum | { COMMAND_ZOOM_IN = 20000, COMMAND_ZOOM_OUT, COMMAND_TOGGLE_UNIT_INFO, COMMAND_TOGGLE_MOVES, COMMAND_TOGGLE_UTILIZATIONS, COMMAND_EXPORT } |
Public Member Functions | |
ProximMachineStateWindow (ProximMainFrame *parent, int id) | |
virtual | ~ProximMachineStateWindow () |
virtual void | reset () |
void | setMachine (TTAMachine::Machine *machine) |
void | setStatusText (std::string status) |
void | appendUtilizationData (std::string text) |
void | appendDetails (std::string text) |
void | clearDetails () |
Private Types | |
enum | { ID_MACHINE_CANVAS = 10000, ID_UTILIZATION_WINDOW, ID_TITLE, ID_DETAILS, ID_LINE, ID_LABEL_UTILIZATION, ID_UTILIZATION, ID_SPLITTER } |
Private Member Functions | |
void | onMachineLoaded (const SimulatorEvent &event) |
void | onProgramLoaded (const SimulatorEvent &event) |
void | onSimulationStop (const SimulatorEvent &event) |
void | createContents () |
void | onZoom (wxCommandEvent &event) |
void | setUtilizationHighlights () |
void | addMoves () |
void | onToggleMoves (wxCommandEvent &event) |
void | onToggleUtilizations (wxCommandEvent &event) |
void | onToggleUnitInfo (wxCommandEvent &event) |
void | onUpdateUIEvent (wxUpdateUIEvent &event) |
void | onExport (wxCommandEvent &event) |
Private Attributes | |
MachineCanvas * | canvas_ |
Machine visualization canvas. More... | |
SimulatorFrontend * | simulator_ |
Simulator instance which contains the registers to display. More... | |
wxBoxSizer * | sizer_ |
Toplevel sizer for the window widgets. More... | |
wxStatusBar * | statusbar_ |
Statusbar of the window. More... | |
bool | showMoves_ |
Tells if the moves are displayed or not. More... | |
bool | showUtilizations_ |
Tells if the machine part utilizations are displayed or not. More... | |
wxTextCtrl * | detailsCtrl_ |
Utilziation window where to display utilization data of the components. More... | |
wxTextCtrl * | utilizationCtrl_ |
Static Private Attributes | |
static const int | MINIMUM_PANE_WIDTH = 150 |
Minimum width for the splitter window panes. More... | |
static const int | INITIAL_DETAILS_PANE_WIDTH = 200 |
Initial width for the component detail pane. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ProximSimulatorWindow | |
ProximSimulatorWindow (ProximMainFrame *mainFrame, wxWindowID id=-1, wxPoint pos=wxDefaultPosition, wxSize size=wxDefaultSize, long style=wxTAB_TRAVERSAL) | |
virtual | ~ProximSimulatorWindow () |
Proxim subwindow which displays the simulated machine state.
This window listens to SimulatorEvents and updates the window contents automatically.
Definition at line 56 of file ProximMachineStateWindow.hh.
anonymous enum |
Enumerator | |
---|---|
COMMAND_ZOOM_IN | |
COMMAND_ZOOM_OUT | |
COMMAND_TOGGLE_UNIT_INFO | |
COMMAND_TOGGLE_MOVES | |
COMMAND_TOGGLE_UTILIZATIONS | |
COMMAND_EXPORT |
Definition at line 68 of file ProximMachineStateWindow.hh.
|
private |
Enumerator | |
---|---|
ID_MACHINE_CANVAS | |
ID_UTILIZATION_WINDOW | |
ID_TITLE | |
ID_DETAILS | |
ID_LINE | |
ID_LABEL_UTILIZATION | |
ID_UTILIZATION | |
ID_SPLITTER |
Definition at line 101 of file ProximMachineStateWindow.hh.
ProximMachineStateWindow::ProximMachineStateWindow | ( | ProximMainFrame * | parent, |
int | id | ||
) |
Constructor.
parent | Parent window of the window. |
id | Window identifier. |
Definition at line 94 of file ProximMachineStateWindow.cc.
References ProximToolbox::machine(), and machine.
|
virtual |
|
private |
Adds active moves to be drawn on the canvas.
Definition at line 358 of file ProximMachineStateWindow.cc.
References MachineCanvas::addMove(), TTAProgram::Move::bus(), canvas_, MachineCanvas::clearMoves(), TTAProgram::Move::destination(), TTAProgram::Program::instructionAt(), TTAProgram::Terminal::isFUPort(), TTAProgram::Terminal::isGPR(), SimulatorFrontend::lastExecInstruction(), SimulatorFrontend::lastExecutedInstruction(), TTAProgram::Instruction::move(), TTAProgram::Instruction::moveCount(), ExecutableInstruction::moveSquashed(), TTAProgram::Terminal::port(), SimulatorFrontend::program(), simulator_, and TTAProgram::Move::source().
Referenced by onSimulationStop(), and onToggleMoves().
void ProximMachineStateWindow::appendDetails | ( | std::string | text | ) |
Appends text to the component details widget.
text | Text to append. |
Definition at line 479 of file ProximMachineStateWindow.cc.
References detailsCtrl_, and WxConversion::toWxString().
Referenced by ProximBusDetailsCmd::Do(), ProximSocketDetailsCmd::Do(), ProximRFDetailsCmd::Do(), ProximIUDetailsCmd::Do(), ProximFUPortDetailsCmd::Do(), and ProximFUDetailsCmd::Do().
void ProximMachineStateWindow::appendUtilizationData | ( | std::string | text | ) |
Appends text to the component utilization widget.
text | Text to append. |
Definition at line 467 of file ProximMachineStateWindow.cc.
References WxConversion::toWxString(), and utilizationCtrl_.
Referenced by ProximBusDetailsCmd::Do(), ProximSocketDetailsCmd::Do(), ProximRFDetailsCmd::Do(), ProximIUDetailsCmd::Do(), and ProximFUDetailsCmd::Do().
void ProximMachineStateWindow::clearDetails | ( | ) |
Clears data in the component details pane.
Definition at line 488 of file ProximMachineStateWindow.cc.
References detailsCtrl_, and utilizationCtrl_.
Referenced by ProximMachineCanvasTool::onMouseEvent(), and onSimulationStop().
|
private |
Creates the window contents.
Code generated by wxWidgets.
Definition at line 199 of file ProximMachineStateWindow.cc.
References canvas_, detailsCtrl_, ID_DETAILS, ID_LABEL_UTILIZATION, ID_LINE, ID_SPLITTER, ID_TITLE, ID_UTILIZATION, INITIAL_DETAILS_PANE_WIDTH, ProximConstants::MACH_WIN_DETAILS_TITLE, ProximConstants::MACH_WIN_UTILIZATION_TITLE, MINIMUM_PANE_WIDTH, MachineCanvas::setTool(), sizer_, statusbar_, and utilizationCtrl_.
|
private |
Displays a dialog for saving machine figure in a file.
Definition at line 498 of file ProximMachineStateWindow.cc.
References canvas_, FileSystem::fileExtension(), MachineCanvas::saveEPS(), MachineCanvas::savePNG(), WxConversion::toString(), and WxConversion::toWxString().
|
private |
|
private |
Event handler which is called when a new program is loaded in the simulator.
Definition at line 135 of file ProximMachineStateWindow.cc.
References canvas_, machine, SimulatorFrontend::machine(), MachineCanvas::setMachine(), and simulator_.
|
private |
Event handler for simulation stop.
Refreshes the register values.
Definition at line 159 of file ProximMachineStateWindow.cc.
References addMoves(), EditPart::canHandle(), canvas_, clearDetails(), MachineCanvas::clearSelection(), Request::DETAILS_REQUEST, ComponentCommand::Do(), MachineCanvas::findEditPart(), EditPart::model(), EditPart::performRequest(), MachineCanvas::select(), MachineCanvas::selection(), setUtilizationHighlights(), showMoves_, and showUtilizations_.
|
private |
Toggles the move display on and off.
Definition at line 411 of file ProximMachineStateWindow.cc.
References addMoves(), canvas_, MachineCanvas::clearMoves(), and showMoves_.
|
private |
Toggles the unit info string display on and off.
Definition at line 396 of file ProximMachineStateWindow.cc.
References canvas_, OptionValue::isFlagOn(), MachineCanvas::options(), Options::optionValue(), OptionValue::setBoolValue(), MachineCanvasOptions::SHOW_UNIT_INFO_STRING, and MachineCanvas::updateMachine().
|
private |
Toggles the utilization display on and off.
Definition at line 425 of file ProximMachineStateWindow.cc.
References canvas_, MachineCanvas::clearHighlights(), ProximToolbox::frontend(), setUtilizationHighlights(), and showUtilizations_.
|
private |
Event handler for meni item UI update events.
event | Update event to handle. |
Definition at line 445 of file ProximMachineStateWindow.cc.
References canvas_, COMMAND_TOGGLE_MOVES, COMMAND_TOGGLE_UNIT_INFO, COMMAND_TOGGLE_UTILIZATIONS, OptionValue::isFlagOn(), MachineCanvas::options(), Options::optionValue(), MachineCanvasOptions::SHOW_UNIT_INFO_STRING, showMoves_, and showUtilizations_.
|
private |
Handles zoom menu item events.
event | Menu event to handle. |
Definition at line 286 of file ProximMachineStateWindow.cc.
References canvas_, COMMAND_ZOOM_IN, COMMAND_ZOOM_OUT, MachineCanvas::zoomIn(), and MachineCanvas::zoomOut().
|
virtual |
Resets the machine displayed on the canvas when the machine is unloaded in the simulator.
Reimplemented from ProximSimulatorWindow.
Definition at line 147 of file ProximMachineStateWindow.cc.
References canvas_, and MachineCanvas::setMachine().
void ProximMachineStateWindow::setMachine | ( | TTAMachine::Machine * | machine | ) |
void ProximMachineStateWindow::setStatusText | ( | std::string | status | ) |
Sets the status line text.
status | Status text to set. |
Definition at line 274 of file ProximMachineStateWindow.cc.
References statusbar_, and WxConversion::toWxString().
Referenced by ProximComponentStatusCmd::Do(), and ProximMachineCanvasTool::onMouseEvent().
|
private |
Sets machine part highlights based on part utilizations.
Definition at line 304 of file ProximMachineStateWindow.cc.
References TTAMachine::Machine::busNavigator(), UtilizationStats::busWrites(), canvas_, MachineCanvas::clearHighlights(), TTAMachine::Machine::Navigator< ComponentType >::count(), SimulatorFrontend::cycleCount(), ProximToolbox::frontend(), TTAMachine::Machine::functionUnitNavigator(), MachineCanvas::highlight(), TTAMachine::Machine::Navigator< ComponentType >::item(), ProximToolbox::machine(), machine, TTAMachine::Machine::socketNavigator(), UtilizationStats::socketWrites(), UtilizationStats::triggerCount(), and SimulatorFrontend::utilizationStatistics().
Referenced by onSimulationStop(), and onToggleUtilizations().
|
private |
Machine visualization canvas.
Definition at line 92 of file ProximMachineStateWindow.hh.
Referenced by addMoves(), createContents(), onExport(), onProgramLoaded(), onSimulationStop(), onToggleMoves(), onToggleUnitInfo(), onToggleUtilizations(), onUpdateUIEvent(), onZoom(), reset(), and setUtilizationHighlights().
|
private |
Utilziation window where to display utilization data of the components.
Definition at line 119 of file ProximMachineStateWindow.hh.
Referenced by appendDetails(), clearDetails(), and createContents().
|
staticprivate |
Initial width for the component detail pane.
Definition at line 125 of file ProximMachineStateWindow.hh.
Referenced by createContents().
|
staticprivate |
Minimum width for the splitter window panes.
Definition at line 123 of file ProximMachineStateWindow.hh.
Referenced by createContents().
|
private |
Tells if the moves are displayed or not.
Definition at line 113 of file ProximMachineStateWindow.hh.
Referenced by onSimulationStop(), onToggleMoves(), and onUpdateUIEvent().
|
private |
Tells if the machine part utilizations are displayed or not.
Definition at line 115 of file ProximMachineStateWindow.hh.
Referenced by onSimulationStop(), onToggleUtilizations(), and onUpdateUIEvent().
|
private |
Simulator instance which contains the registers to display.
Definition at line 94 of file ProximMachineStateWindow.hh.
Referenced by addMoves(), and onProgramLoaded().
|
private |
Toplevel sizer for the window widgets.
Definition at line 96 of file ProximMachineStateWindow.hh.
Referenced by createContents().
|
private |
Statusbar of the window.
Definition at line 98 of file ProximMachineStateWindow.hh.
Referenced by createContents(), and setStatusText().
|
private |
Definition at line 120 of file ProximMachineStateWindow.hh.
Referenced by appendUtilizationData(), clearDetails(), and createContents().