OpenASIP 2.2
Loading...
Searching...
No Matches
BusDialog.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 BusDialog.hh
26 *
27 * Declaration of BusDialog class.
28 *
29 * @author Veli-Pekka Jääskeläinen 2004 (vjaaskel-no.spam-cs.tut.fi)
30 */
31
32#ifndef TTA_BUS_DIALOG_HH
33#define TTA_BUS_DIALOG_HH
34
35#include <wx/wx.h>
36#include <wx/listctrl.h>
37#include <wx/spinctrl.h>
38#include <wx/valgen.h>
39#include <vector>
40#include <string>
41
42using std::vector;
43
44namespace TTAMachine {
45 class Bus;
46 class RegisterGuard;
47 class PortGuard;
48 class Segment;
49}
50
51/**
52 * Dialog for querying transport bus parameters from the user.
53 */
54class BusDialog : public wxDialog {
55public:
56 BusDialog(wxWindow* parent, TTAMachine::Bus* bus);
57 virtual ~BusDialog();
58
59private:
60 virtual bool TransferDataToWindow();
61 void onOK(wxCommandEvent&);
62 void onHelp(wxCommandEvent& event);
63 void onBusName(wxCommandEvent&);
64 void onAddSegment(wxCommandEvent&);
65 void onSegmentName(wxCommandEvent&);
66 void onSegmentSelection(wxListEvent&);
67 void onSegmentRightClick(wxListEvent& event);
68 void onDeleteSegment(wxCommandEvent&);
69 void onSegmentUp(wxCommandEvent&);
70 void onSegmentDown(wxCommandEvent&);
71 void setTexts();
72
73 void onRFGuardSelection(wxListEvent&);
74 void onAddRFGuard(wxCommandEvent&);
75 void onDeleteRFGuard(wxCommandEvent&);
76 void onEditRFGuard(wxCommandEvent&);
77 void onFUGuardSelection(wxListEvent&);
78 void onAddFUGuard(wxCommandEvent&);
79 void onDeleteFUGuard(wxCommandEvent&);
80 void onEditFUGuard(wxCommandEvent&);
81 void onUnconditionalGuard(wxCommandEvent&);
82 void onWidth(wxSpinEvent&);
83 void updateSegmentList();
84 void updateGuardLists();
85
86 void onRFGuardRightClick(wxListEvent& event);
87 void onActivateRFGuard(wxListEvent& event);
88 void onFUGuardRightClick(wxListEvent& event);
89 void onActivateFUGuard(wxListEvent& event);
90
94 wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
95
96 /// Transport Bus to edit.
98 /// Name of the bus.
99 wxString name_;
100 /// Width of the bus.
102 /// Short immediate width
104 /// Name for a new segment.
105 wxString newSegName_;
106
107 /// List widget for the segment list.
108 wxListCtrl* segList_;
109 /// Check box for always true unconditional guard.
110 wxCheckBox* alwaysTrueGuard_;
111 /// Check box for always false unconditional guard.
112 wxCheckBox* alwaysFalseGuard_;
113 /// Radio box for immediate extension.
115 /// Register file guard list control.
116 wxListCtrl* rfGuardList_;
117 /// Function unit port guard list control.
118 wxListCtrl* fuGuardList_;
119
120 /// Static boxsizer for the bus properties.
121 wxStaticBoxSizer* busSizer_;
122 /// Static boxsizer for the short immediate properties.
123 wxStaticBoxSizer* siSizer_;
124 /// Static boxsizer for the register guard properties.
125 wxStaticBoxSizer* registerGuardSizer_;
126 /// Static boxsizer for the port guard properties.
127 wxStaticBoxSizer* portGuardSizer_;
128 /// Static boxsizer for the segment properties.
129 wxStaticBoxSizer* segmentSizer_;
130
131
132 /// list of register guards
133 vector<TTAMachine::RegisterGuard*> registerGuards_;
134 /// list of port guards
135 vector<TTAMachine::PortGuard*> portGuards_;
136
137 /// enumerated IDs for dialog controls
138 enum {
139 ID_BUS_NAME = 10000,
165 };
166
167 /// The event table for the controls of the dialog.
168 DECLARE_EVENT_TABLE()
169};
170#endif
void onOK(wxCommandEvent &)
Definition BusDialog.cc:797
wxString newSegName_
Name for a new segment.
Definition BusDialog.hh:105
void onBusName(wxCommandEvent &)
Definition BusDialog.cc:617
wxListCtrl * rfGuardList_
Register file guard list control.
Definition BusDialog.hh:116
wxListCtrl * fuGuardList_
Function unit port guard list control.
Definition BusDialog.hh:118
void onDeleteSegment(wxCommandEvent &)
Definition BusDialog.cc:735
wxCheckBox * alwaysFalseGuard_
Check box for always false unconditional guard.
Definition BusDialog.hh:112
wxRadioBox * immediateExtensionBox_
Radio box for immediate extension.
Definition BusDialog.hh:114
void onAddFUGuard(wxCommandEvent &)
Definition BusDialog.cc:998
@ ID_EDIT_RF_GUARD
Definition BusDialog.hh:153
@ ID_EDIT_FU_GUARD
Definition BusDialog.hh:157
@ ID_SEGMENT_NAME
Definition BusDialog.hh:146
@ ID_RF_GUARD_LIST
Definition BusDialog.hh:151
@ ID_DELETE_SEGMENT
Definition BusDialog.hh:150
@ ID_LABEL_SEGMENT_NAME
Definition BusDialog.hh:164
@ ID_DELETE_RF_GUARD
Definition BusDialog.hh:154
@ ID_ADD_FU_GUARD
Definition BusDialog.hh:156
@ ID_SEGMENT_LIST
Definition BusDialog.hh:145
@ ID_SI_EXTENSION
Definition BusDialog.hh:142
@ ID_LABEL_BUS_WIDTH
Definition BusDialog.hh:161
@ ID_ADD_RF_GUARD
Definition BusDialog.hh:152
@ ID_SEGMENT_DOWN
Definition BusDialog.hh:148
@ ID_DELETE_FU_GUARD
Definition BusDialog.hh:158
@ ID_LABEL_SI_WIDTH
Definition BusDialog.hh:163
@ ID_FU_GUARD_LIST
Definition BusDialog.hh:155
@ ID_LABEL_BUS_NAME
Definition BusDialog.hh:160
wxStaticBoxSizer * registerGuardSizer_
Static boxsizer for the register guard properties.
Definition BusDialog.hh:125
TTAMachine::PortGuard * selectedFUGuard() const
Definition BusDialog.cc:522
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
vector< TTAMachine::PortGuard * > portGuards_
list of port guards
Definition BusDialog.hh:135
void onActivateRFGuard(wxListEvent &event)
void onFUGuardRightClick(wxListEvent &event)
void onHelp(wxCommandEvent &event)
void onDeleteRFGuard(wxCommandEvent &)
Definition BusDialog.cc:922
TTAMachine::RegisterGuard * selectedRFGuard() const
Definition BusDialog.cc:543
void onRFGuardSelection(wxListEvent &)
Definition BusDialog.cc:978
void setTexts()
Definition BusDialog.cc:192
virtual ~BusDialog()
Definition BusDialog.cc:184
void onDeleteFUGuard(wxCommandEvent &)
wxListCtrl * segList_
List widget for the segment list.
Definition BusDialog.hh:108
void onActivateFUGuard(wxListEvent &event)
void updateGuardLists()
Definition BusDialog.cc:412
void onWidth(wxSpinEvent &)
TTAMachine::Segment * selectedSegment() const
Definition BusDialog.cc:501
virtual bool TransferDataToWindow()
Definition BusDialog.cc:337
int width_
Width of the bus.
Definition BusDialog.hh:101
wxStaticBoxSizer * siSizer_
Static boxsizer for the short immediate properties.
Definition BusDialog.hh:123
void onEditRFGuard(wxCommandEvent &)
Definition BusDialog.cc:958
wxString name_
Name of the bus.
Definition BusDialog.hh:99
void onSegmentDown(wxCommandEvent &)
Definition BusDialog.cc:775
void updateSegmentList()
Definition BusDialog.cc:486
void onAddRFGuard(wxCommandEvent &)
Definition BusDialog.cc:898
void onUnconditionalGuard(wxCommandEvent &)
Definition BusDialog.cc:635
vector< TTAMachine::RegisterGuard * > registerGuards_
list of register guards
Definition BusDialog.hh:133
int immWidth_
Short immediate width.
Definition BusDialog.hh:103
wxCheckBox * alwaysTrueGuard_
Check box for always true unconditional guard.
Definition BusDialog.hh:110
void onEditFUGuard(wxCommandEvent &)
void onRFGuardRightClick(wxListEvent &event)
wxStaticBoxSizer * segmentSizer_
Static boxsizer for the segment properties.
Definition BusDialog.hh:129
void onSegmentName(wxCommandEvent &)
Definition BusDialog.cc:676
void onSegmentRightClick(wxListEvent &event)
Definition BusDialog.cc:712
void onFUGuardSelection(wxListEvent &)
void onAddSegment(wxCommandEvent &)
Definition BusDialog.cc:567
wxStaticBoxSizer * busSizer_
Static boxsizer for the bus properties.
Definition BusDialog.hh:121
void onSegmentSelection(wxListEvent &)
Definition BusDialog.cc:693
TTAMachine::Bus * bus_
Transport Bus to edit.
Definition BusDialog.hh:97
void onSegmentUp(wxCommandEvent &)
Definition BusDialog.cc:752
wxStaticBoxSizer * portGuardSizer_
Static boxsizer for the port guard properties.
Definition BusDialog.hh:127