OpenASIP 2.2
|
#include <ProximDebuggerWindow.hh>
Public Member Functions | |
ProximDebuggerWindow (ProximMainFrame *parent, int id) | |
virtual | ~ProximDebuggerWindow () |
virtual void | reset () |
void | loadProgram (const TTAProgram::Program &program) |
void | updateAnnotations () |
void | loadSourceCode (wxString sourceFile) |
void | setLineAttributes (int lineNum, wxTextAttr style) |
void | highlightLine (int lineNum) |
void | showLine (int lineNum) |
Private Types | |
enum | { ID_SOURCEFILE_CHOICE = 19000 , ID_SOURCECODE } |
Private Member Functions | |
void | onProgramLoaded (const SimulatorEvent &event) |
void | onSimulationStop (const SimulatorEvent &event) |
void | onSourceFileChoice (wxCommandEvent &event) |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
Private Attributes | |
wxString | currentFile_ |
std::vector< int > | currentLineNums_ |
wxChoice * | sourceFileList_ |
wxTextCtrl * | sourceCodeText_ |
Additional Inherited Members | |
![]() | |
ProximSimulatorWindow (ProximMainFrame *mainFrame, wxWindowID id=-1, wxPoint pos=wxDefaultPosition, wxSize size=wxDefaultSize, long style=wxTAB_TRAVERSAL) | |
virtual | ~ProximSimulatorWindow () |
Proxim subwindow which displays program source code annotations.
This window listens to SimulatorEvents and updates the window contents automatically.
Definition at line 54 of file ProximDebuggerWindow.hh.
|
private |
Enumerator | |
---|---|
ID_SOURCEFILE_CHOICE | |
ID_SOURCECODE |
Definition at line 82 of file ProximDebuggerWindow.hh.
ProximDebuggerWindow::ProximDebuggerWindow | ( | ProximMainFrame * | parent, |
int | id | ||
) |
Definition at line 58 of file ProximDebuggerWindow.cc.
References ProximToolbox::program().
|
virtual |
Definition at line 68 of file ProximDebuggerWindow.cc.
|
private |
Creates the window contents.
Code generated by wxDesigner.
Definition at line 250 of file ProximDebuggerWindow.cc.
References ID_SOURCECODE, ID_SOURCEFILE_CHOICE, sourceCodeText_, and sourceFileList_.
void ProximDebuggerWindow::highlightLine | ( | int | lineNum | ) |
Highlights line of code in the sourceCodeText_ widget
lineNum | Source code line number. |
Definition at line 185 of file ProximDebuggerWindow.cc.
References currentLineNums_, and setLineAttributes().
Referenced by updateAnnotations().
void ProximDebuggerWindow::loadProgram | ( | const TTAProgram::Program & | program | ) |
Loads a program model to the window.
program | Program to load. |
Definition at line 91 of file ProximDebuggerWindow.cc.
References TTAProgram::Move::hasSourceFileName(), loadSourceCode(), program, sourceFileList_, TTAProgram::Move::sourceFileName(), WxConversion::toWxString(), and updateAnnotations().
Referenced by onProgramLoaded().
void ProximDebuggerWindow::loadSourceCode | ( | wxString | sourceFile | ) |
Loads source code into the sourceCodeText_ widget
sourceFile | Absolute file location as wxString. |
Definition at line 155 of file ProximDebuggerWindow.cc.
References currentFile_, sourceCodeText_, and sourceFileList_.
Referenced by loadProgram(), and onSourceFileChoice().
|
private |
Event handler which is called when a new program is loaded in the simulator.
Definition at line 211 of file ProximDebuggerWindow.cc.
References loadProgram(), and ProximToolbox::program().
|
private |
Event handler which is called when simulation step ends.
Definition at line 220 of file ProximDebuggerWindow.cc.
References currentLineNums_, setLineAttributes(), and updateAnnotations().
|
private |
Event handler for drop-down list selection.
Loads selected source code from the drop-down list.
Definition at line 237 of file ProximDebuggerWindow.cc.
References currentLineNums_, loadSourceCode(), sourceFileList_, and updateAnnotations().
|
virtual |
Resets the window when a new program or machine is being loaded in the simulator.
Reimplemented from ProximSimulatorWindow.
Definition at line 77 of file ProximDebuggerWindow.cc.
References currentFile_, currentLineNums_, sourceCodeText_, and sourceFileList_.
void ProximDebuggerWindow::setLineAttributes | ( | int | lineNum, |
wxTextAttr | style | ||
) |
Sets certain style attributes to the line in sourceCodeText_ widget
lineNum | Line number |
style | Style attributes (text color, background color, font, alignment) |
Definition at line 170 of file ProximDebuggerWindow.cc.
References sourceCodeText_.
Referenced by highlightLine(), and onSimulationStop().
void ProximDebuggerWindow::showLine | ( | int | lineNum | ) |
Makes line visible in the sourceCodeText_ widget
lineNum | Source code line number. |
Definition at line 202 of file ProximDebuggerWindow.cc.
References sourceCodeText_.
Referenced by updateAnnotations().
void ProximDebuggerWindow::updateAnnotations | ( | ) |
Parses possible annotations in the current instruction and hilights source code lines.
Definition at line 123 of file ProximDebuggerWindow.cc.
References currentFile_, currentLineNums_, TTAProgram::Move::hasSourceLineNumber(), highlightLine(), TTAProgram::Program::instructionAt(), TTAProgram::Instruction::move(), TTAProgram::Instruction::moveCount(), ProximToolbox::program(), showLine(), TTAProgram::Move::sourceFileName(), TTAProgram::Move::sourceLineNumber(), and WxConversion::toWxString().
Referenced by loadProgram(), onSimulationStop(), and onSourceFileChoice().
|
private |
Definition at line 73 of file ProximDebuggerWindow.hh.
Referenced by loadSourceCode(), reset(), and updateAnnotations().
|
private |
Definition at line 75 of file ProximDebuggerWindow.hh.
Referenced by highlightLine(), onSimulationStop(), onSourceFileChoice(), reset(), and updateAnnotations().
|
private |
Definition at line 79 of file ProximDebuggerWindow.hh.
Referenced by createContents(), loadSourceCode(), reset(), setLineAttributes(), and showLine().
|
private |
Definition at line 77 of file ProximDebuggerWindow.hh.
Referenced by createContents(), loadProgram(), loadSourceCode(), onSourceFileChoice(), and reset().