OpenASIP  2.0
ProximDebuggerWindow.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-20016 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file ProximDebuggerWindow.cc
26  *
27  * Declaration of ProximDebuggerWindow class.
28  *
29  * @author Alex Hirvonen 2016 (alex.hirvonen-no.spam-gmail.com)
30  * @note rating: red
31  */
32 
33 
34 #ifndef TTA_PROXIM_DEBUGGER_WINDOW_HH
35 #define TTA_PROXIM_DEBUGGER_WINDOW_HH
36 
37 
38 #include <vector>
39 
40 #include "ProximSimulatorWindow.hh"
41 #include "SimulatorEvent.hh"
42 
43 
44 namespace TTAProgram {
45  class Program;
46 }
47 
48 /**
49  * Proxim subwindow which displays program source code annotations.
50  *
51  * This window listens to SimulatorEvents and updates the window
52  * contents automatically.
53  */
55 public:
56  ProximDebuggerWindow(ProximMainFrame* parent, int id);
57  virtual ~ProximDebuggerWindow();
58  virtual void reset();
60  void updateAnnotations();
61  void loadSourceCode(wxString sourceFile);
62  void setLineAttributes(int lineNum, wxTextAttr style);
63  void highlightLine(int lineNum);
64  void showLine(int lineNum);
65 
66 private:
67  void onProgramLoaded(const SimulatorEvent& event);
68  void onSimulationStop(const SimulatorEvent& event);
69  void onSourceFileChoice(wxCommandEvent& event);
70  wxSizer* createContents(wxWindow *parent, bool call_fit, bool set_sizer);
71 
72  // Currently loaded source code file
73  wxString currentFile_;
74  // Currently highlighted source code line numbers
75  std::vector<int> currentLineNums_;
76  // Drop-down list of available source code files
77  wxChoice* sourceFileList_;
78  // Widget for displaying source code contents
79  wxTextCtrl* sourceCodeText_;
80 
81  // Widget IDs.
82  enum {
85  };
86 
87  DECLARE_EVENT_TABLE()
88 };
89 
90 #endif
ProximMainFrame
Definition: ProximMainFrame.hh:58
TTAProgram
Definition: Estimator.hh:65
TTAProgram::Program
Definition: Program.hh:63
ProximSimulatorWindow.hh
ProximDebuggerWindow::sourceCodeText_
wxTextCtrl * sourceCodeText_
Definition: ProximDebuggerWindow.hh:79
SimulatorEvent.hh
ProximDebuggerWindow::ProximDebuggerWindow
ProximDebuggerWindow(ProximMainFrame *parent, int id)
Definition: ProximDebuggerWindow.cc:58
ProximDebuggerWindow::updateAnnotations
void updateAnnotations()
Definition: ProximDebuggerWindow.cc:123
ProximDebuggerWindow::ID_SOURCECODE
@ ID_SOURCECODE
Definition: ProximDebuggerWindow.hh:84
ProximDebuggerWindow::showLine
void showLine(int lineNum)
Definition: ProximDebuggerWindow.cc:202
ProximDebuggerWindow::highlightLine
void highlightLine(int lineNum)
Definition: ProximDebuggerWindow.cc:185
ProximSimulatorWindow
Definition: ProximSimulatorWindow.hh:47
ProximDebuggerWindow::~ProximDebuggerWindow
virtual ~ProximDebuggerWindow()
Definition: ProximDebuggerWindow.cc:68
ProximDebuggerWindow::ID_SOURCEFILE_CHOICE
@ ID_SOURCEFILE_CHOICE
Definition: ProximDebuggerWindow.hh:83
ProximDebuggerWindow::onSimulationStop
void onSimulationStop(const SimulatorEvent &event)
Definition: ProximDebuggerWindow.cc:220
ProximDebuggerWindow::setLineAttributes
void setLineAttributes(int lineNum, wxTextAttr style)
Definition: ProximDebuggerWindow.cc:170
ProximDebuggerWindow::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: ProximDebuggerWindow.cc:250
ProximDebuggerWindow::currentLineNums_
std::vector< int > currentLineNums_
Definition: ProximDebuggerWindow.hh:75
ProximDebuggerWindow::sourceFileList_
wxChoice * sourceFileList_
Definition: ProximDebuggerWindow.hh:77
ProximDebuggerWindow::loadProgram
void loadProgram(const TTAProgram::Program &program)
Definition: ProximDebuggerWindow.cc:91
ProximDebuggerWindow::onSourceFileChoice
void onSourceFileChoice(wxCommandEvent &event)
Definition: ProximDebuggerWindow.cc:237
ProximDebuggerWindow::currentFile_
wxString currentFile_
Definition: ProximDebuggerWindow.hh:73
program
find Finds info of the inner loops in the program
Definition: InnerLoopFinder.cc:80
ProximDebuggerWindow::loadSourceCode
void loadSourceCode(wxString sourceFile)
Definition: ProximDebuggerWindow.cc:155
ProximDebuggerWindow::reset
virtual void reset()
Definition: ProximDebuggerWindow.cc:77
SimulatorEvent
Definition: SimulatorEvent.hh:42
ProximDebuggerWindow::onProgramLoaded
void onProgramLoaded(const SimulatorEvent &event)
Definition: ProximDebuggerWindow.cc:211
ProximDebuggerWindow
Definition: ProximDebuggerWindow.hh:54