OpenASIP  2.0
ProximUnitWindow.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 ProximUnitWindow.cc
26  *
27  * Declaration of ProximUnitWindow class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2006 (vjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 
34 #ifndef TTA_PROXIM_UNIT_WINDOW_HH
35 #define TTA_PROXIM_UNIT_WINDOW_HH
36 
37 #include "ProximSimulatorWindow.hh"
38 #include "SimulatorEvent.hh"
39 
40 class SimulatorFrontend;
41 class ProximMainFrame;
42 class wxListCtrl;
43 
44 /**
45  * Parent class for windows displaying list information of the Proxim machine
46  * state window units.
47  *
48  * This window listens to SimulatorEvents and updates the window
49  * contents automatically.
50  */
52 public:
53  ProximUnitWindow(ProximMainFrame* parent, int id);
54  virtual ~ProximUnitWindow();
55 
56 protected:
57  /// Simulator instance .
59  /// Unit choicer widget.
60  wxChoice* unitChoice_;
61  /// Value display mode choicer widget.
62  wxChoice* modeChoice_;
63  /// List widget for the values.
64  wxListCtrl* valueList_;
65 
66  /// String for the mode choicer integer mode.
67  static const wxString MODE_INT;
68  /// String for the mode choicer unsigned integer mode.
69  static const wxString MODE_UNSIGNED;
70  /// String for the mode choicer hexadecimal mode.
71  static const wxString MODE_HEX;
72  /// String for the mode choicer binary mode.
73  static const wxString MODE_BIN;
74 
75 private:
76  void onProgramLoaded(const SimulatorEvent& event);
77  void onSimulationStop(const SimulatorEvent& event);
78  void onChoice(wxCommandEvent& event);
79  void onClose(wxCommandEvent& event);
80  wxSizer* createContents(
81  wxWindow* parent, bool call_fit, bool set_sizer);
82 
83  virtual void reinitialize();
84  virtual void update();
85 
86  // Widget IDs.
87  enum {
88  ID_UNIT_CHOICE = 10000,
94  };
95 
96  DECLARE_EVENT_TABLE()
97 };
98 
99 #endif
ProximMainFrame
Definition: ProximMainFrame.hh:58
ProximUnitWindow::ProximUnitWindow
ProximUnitWindow(ProximMainFrame *parent, int id)
Definition: ProximUnitWindow.cc:67
ProximSimulatorWindow.hh
ProximUnitWindow::~ProximUnitWindow
virtual ~ProximUnitWindow()
Definition: ProximUnitWindow.cc:93
SimulatorEvent.hh
ProximUnitWindow::modeChoice_
wxChoice * modeChoice_
Value display mode choicer widget.
Definition: ProximUnitWindow.hh:62
ProximUnitWindow::ID_LINE
@ ID_LINE
Definition: ProximUnitWindow.hh:92
ProximUnitWindow::onChoice
void onChoice(wxCommandEvent &event)
Definition: ProximUnitWindow.cc:139
ProximUnitWindow::MODE_UNSIGNED
static const wxString MODE_UNSIGNED
String for the mode choicer unsigned integer mode.
Definition: ProximUnitWindow.hh:69
ProximUnitWindow::unitChoice_
wxChoice * unitChoice_
Unit choicer widget.
Definition: ProximUnitWindow.hh:60
ProximUnitWindow::ID_MODE_CHOICE
@ ID_MODE_CHOICE
Definition: ProximUnitWindow.hh:89
ProximSimulatorWindow
Definition: ProximSimulatorWindow.hh:47
ProximUnitWindow::ID_HELP
@ ID_HELP
Definition: ProximUnitWindow.hh:90
ProximUnitWindow::ID_CLOSE
@ ID_CLOSE
Definition: ProximUnitWindow.hh:91
ProximUnitWindow::valueList_
wxListCtrl * valueList_
List widget for the values.
Definition: ProximUnitWindow.hh:64
ProximUnitWindow::MODE_INT
static const wxString MODE_INT
String for the mode choicer integer mode.
Definition: ProximUnitWindow.hh:67
ProximUnitWindow
Definition: ProximUnitWindow.hh:51
ProximUnitWindow::simulator_
SimulatorFrontend * simulator_
Simulator instance .
Definition: ProximUnitWindow.hh:58
ProximUnitWindow::onClose
void onClose(wxCommandEvent &event)
Definition: ProximUnitWindow.cc:149
ProximUnitWindow::reinitialize
virtual void reinitialize()
Definition: ProximUnitWindow.cc:101
ProximUnitWindow::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: ProximUnitWindow.cc:169
ProximUnitWindow::ID_UNIT_CHOICE
@ ID_UNIT_CHOICE
Definition: ProximUnitWindow.hh:88
ProximUnitWindow::onSimulationStop
void onSimulationStop(const SimulatorEvent &event)
Definition: ProximUnitWindow.cc:128
ProximUnitWindow::update
virtual void update()
Definition: ProximUnitWindow.cc:118
ProximUnitWindow::ID_VALUE_LIST
@ ID_VALUE_LIST
Definition: ProximUnitWindow.hh:93
ProximUnitWindow::MODE_HEX
static const wxString MODE_HEX
String for the mode choicer hexadecimal mode.
Definition: ProximUnitWindow.hh:71
SimulatorEvent
Definition: SimulatorEvent.hh:42
ProximUnitWindow::MODE_BIN
static const wxString MODE_BIN
String for the mode choicer binary mode.
Definition: ProximUnitWindow.hh:73
SimulatorFrontend
Definition: SimulatorFrontend.hh:89
ProximUnitWindow::onProgramLoaded
void onProgramLoaded(const SimulatorEvent &event)
Definition: ProximUnitWindow.cc:109