OpenASIP  2.0
ProximMachineStateWindow.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 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 ProximMachineStateWindow.cc
26  *
27  * Declaration of ProximMachineStateWindow class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2005 (vjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 
34 #ifndef TTA_PROXIM_MACHINE_STATE_WINDOW_HH
35 #define TTA_PROXIM_MACHINE_STATE_WINDOW_HH
36 
37 #include "ProximSimulatorWindow.hh"
38 #include "SimulatorEvent.hh"
39 
40 namespace TTAMachine {
41  class Machine;
42  class MachinePart;
43 }
44 
45 class MachineCanvas;
46 class SimulatorFrontend;
47 class wxUpdateUIEvent;
48 class UtilizationWindow;
49 
50 /**
51  * Proxim subwindow which displays the simulated machine state.
52  *
53  * This window listens to SimulatorEvents and updates the window
54  * contents automatically.
55  */
57 public:
59  virtual ~ProximMachineStateWindow();
60  virtual void reset();
62  void setStatusText(std::string status);
63  void appendUtilizationData(std::string text);
64  void appendDetails(std::string text);
65  void clearDetails();
66 
67  // Command IDs.
68  enum {
69  COMMAND_ZOOM_IN = 20000,
75  };
76 
77 private:
78  void onMachineLoaded(const SimulatorEvent& event);
79  void onProgramLoaded(const SimulatorEvent& event);
80  void onSimulationStop(const SimulatorEvent& event);
81  void createContents();
82  void onZoom(wxCommandEvent& event);
84  void addMoves();
85  void onToggleMoves(wxCommandEvent& event);
86  void onToggleUtilizations(wxCommandEvent& event);
87  void onToggleUnitInfo(wxCommandEvent& event);
88  void onUpdateUIEvent(wxUpdateUIEvent& event);
89  void onExport(wxCommandEvent& event);
90 
91  /// Machine visualization canvas.
93  /// Simulator instance which contains the registers to display.
95  /// Toplevel sizer for the window widgets.
96  wxBoxSizer* sizer_;
97  /// Statusbar of the window.
98  wxStatusBar* statusbar_;
99 
100  // Widget IDs.
101  enum {
110  };
111 
112  /// Tells if the moves are displayed or not.
114  /// Tells if the machine part utilizations are displayed or not.
116  /// Utilziation window where to display utilization data of the components.
117  //UtilizationWindow* utilizationWindow_;
118 
119  wxTextCtrl* detailsCtrl_;
120  wxTextCtrl* utilizationCtrl_;
121 
122  /// Minimum width for the splitter window panes.
123  static const int MINIMUM_PANE_WIDTH;
124  /// Initial width for the component detail pane.
125  static const int INITIAL_DETAILS_PANE_WIDTH;
126 
127  DECLARE_EVENT_TABLE()
128 };
129 
130 #endif
ProximMainFrame
Definition: ProximMainFrame.hh:58
ProximMachineStateWindow::setStatusText
void setStatusText(std::string status)
Definition: ProximMachineStateWindow.cc:274
MachineCanvas
Definition: MachineCanvas.hh:64
ProximMachineStateWindow::ID_UTILIZATION_WINDOW
@ ID_UTILIZATION_WINDOW
Definition: ProximMachineStateWindow.hh:103
ProximMachineStateWindow::COMMAND_ZOOM_OUT
@ COMMAND_ZOOM_OUT
Definition: ProximMachineStateWindow.hh:70
ProximMachineStateWindow::onZoom
void onZoom(wxCommandEvent &event)
Definition: ProximMachineStateWindow.cc:286
ProximSimulatorWindow.hh
ProximMachineStateWindow::onExport
void onExport(wxCommandEvent &event)
Definition: ProximMachineStateWindow.cc:498
ProximMachineStateWindow::COMMAND_TOGGLE_MOVES
@ COMMAND_TOGGLE_MOVES
Definition: ProximMachineStateWindow.hh:72
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
ProximMachineStateWindow::INITIAL_DETAILS_PANE_WIDTH
static const int INITIAL_DETAILS_PANE_WIDTH
Initial width for the component detail pane.
Definition: ProximMachineStateWindow.hh:125
SimulatorEvent.hh
ProximMachineStateWindow::MINIMUM_PANE_WIDTH
static const int MINIMUM_PANE_WIDTH
Minimum width for the splitter window panes.
Definition: ProximMachineStateWindow.hh:123
ProximMachineStateWindow::ID_TITLE
@ ID_TITLE
Definition: ProximMachineStateWindow.hh:104
ProximMachineStateWindow::appendDetails
void appendDetails(std::string text)
Definition: ProximMachineStateWindow.cc:479
ProximMachineStateWindow::onToggleMoves
void onToggleMoves(wxCommandEvent &event)
Definition: ProximMachineStateWindow.cc:411
ProximMachineStateWindow::statusbar_
wxStatusBar * statusbar_
Statusbar of the window.
Definition: ProximMachineStateWindow.hh:98
ProximMachineStateWindow
Definition: ProximMachineStateWindow.hh:56
ProximMachineStateWindow::setMachine
void setMachine(TTAMachine::Machine *machine)
ProximMachineStateWindow::detailsCtrl_
wxTextCtrl * detailsCtrl_
Utilziation window where to display utilization data of the components.
Definition: ProximMachineStateWindow.hh:119
ProximMachineStateWindow::showMoves_
bool showMoves_
Tells if the moves are displayed or not.
Definition: ProximMachineStateWindow.hh:113
ProximMachineStateWindow::~ProximMachineStateWindow
virtual ~ProximMachineStateWindow()
Definition: ProximMachineStateWindow.cc:127
ProximMachineStateWindow::reset
virtual void reset()
Definition: ProximMachineStateWindow.cc:147
ProximSimulatorWindow
Definition: ProximSimulatorWindow.hh:47
ProximMachineStateWindow::simulator_
SimulatorFrontend * simulator_
Simulator instance which contains the registers to display.
Definition: ProximMachineStateWindow.hh:94
ProximMachineStateWindow::onMachineLoaded
void onMachineLoaded(const SimulatorEvent &event)
ProximMachineStateWindow::ID_LINE
@ ID_LINE
Definition: ProximMachineStateWindow.hh:106
ProximMachineStateWindow::ID_LABEL_UTILIZATION
@ ID_LABEL_UTILIZATION
Definition: ProximMachineStateWindow.hh:107
ProximMachineStateWindow::createContents
void createContents()
Definition: ProximMachineStateWindow.cc:199
ProximMachineStateWindow::COMMAND_TOGGLE_UNIT_INFO
@ COMMAND_TOGGLE_UNIT_INFO
Definition: ProximMachineStateWindow.hh:71
ProximMachineStateWindow::setUtilizationHighlights
void setUtilizationHighlights()
Definition: ProximMachineStateWindow.cc:304
ProximMachineStateWindow::ID_SPLITTER
@ ID_SPLITTER
Definition: ProximMachineStateWindow.hh:109
ProximMachineStateWindow::COMMAND_EXPORT
@ COMMAND_EXPORT
Definition: ProximMachineStateWindow.hh:74
ProximMachineStateWindow::onToggleUtilizations
void onToggleUtilizations(wxCommandEvent &event)
Definition: ProximMachineStateWindow.cc:425
ProximMachineStateWindow::addMoves
void addMoves()
Definition: ProximMachineStateWindow.cc:358
ProximMachineStateWindow::appendUtilizationData
void appendUtilizationData(std::string text)
Definition: ProximMachineStateWindow.cc:467
ProximMachineStateWindow::ProximMachineStateWindow
ProximMachineStateWindow(ProximMainFrame *parent, int id)
Definition: ProximMachineStateWindow.cc:94
ProximMachineStateWindow::COMMAND_ZOOM_IN
@ COMMAND_ZOOM_IN
Definition: ProximMachineStateWindow.hh:69
ProximMachineStateWindow::utilizationCtrl_
wxTextCtrl * utilizationCtrl_
Definition: ProximMachineStateWindow.hh:120
ProximMachineStateWindow::onToggleUnitInfo
void onToggleUnitInfo(wxCommandEvent &event)
Definition: ProximMachineStateWindow.cc:396
ProximMachineStateWindow::ID_MACHINE_CANVAS
@ ID_MACHINE_CANVAS
Definition: ProximMachineStateWindow.hh:102
ProximMachineStateWindow::showUtilizations_
bool showUtilizations_
Tells if the machine part utilizations are displayed or not.
Definition: ProximMachineStateWindow.hh:115
ProximMachineStateWindow::onUpdateUIEvent
void onUpdateUIEvent(wxUpdateUIEvent &event)
Definition: ProximMachineStateWindow.cc:445
ProximMachineStateWindow::ID_DETAILS
@ ID_DETAILS
Definition: ProximMachineStateWindow.hh:105
ProximMachineStateWindow::clearDetails
void clearDetails()
Definition: ProximMachineStateWindow.cc:488
SimulatorEvent
Definition: SimulatorEvent.hh:42
TTAMachine
Definition: Assembler.hh:48
ProximMachineStateWindow::onProgramLoaded
void onProgramLoaded(const SimulatorEvent &event)
Definition: ProximMachineStateWindow.cc:135
ProximMachineStateWindow::sizer_
wxBoxSizer * sizer_
Toplevel sizer for the window widgets.
Definition: ProximMachineStateWindow.hh:96
SimulatorFrontend
Definition: SimulatorFrontend.hh:89
ProximMachineStateWindow::ID_UTILIZATION
@ ID_UTILIZATION
Definition: ProximMachineStateWindow.hh:108
ProximMachineStateWindow::canvas_
MachineCanvas * canvas_
Machine visualization canvas.
Definition: ProximMachineStateWindow.hh:92
ProximMachineStateWindow::onSimulationStop
void onSimulationStop(const SimulatorEvent &event)
Definition: ProximMachineStateWindow.cc:159
ProximMachineStateWindow::COMMAND_TOGGLE_UTILIZATIONS
@ COMMAND_TOGGLE_UTILIZATIONS
Definition: ProximMachineStateWindow.hh:73
TTAMachine::Machine
Definition: Machine.hh:73