OpenASIP 2.2
Loading...
Searching...
No Matches
AddressSpaceDialog.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 AddressSpaceDialog.hh
26 *
27 * Declaration of AddressSpaceDialog class.
28 *
29 * @author Veli-Pekka Jääskeläinen 2004 (vjaaskel-no.spam-cs.tut.fi)
30 */
31
32#ifndef TTA_ADDRESS_SPACE_DIALOG_HH
33#define TTA_ADDRESS_SPACE_DIALOG_HH
34
35#include <wx/wx.h>
36#include <wx/spinctrl.h>
37#include <wx/listctrl.h>
38#include <set>
39
40class NumberControl;
41
42namespace TTAMachine {
43 class Machine;
44 class AddressSpace;
45}
46
47/**
48 * Dialog for editing address space properties.
49 */
50class AddressSpaceDialog : public wxDialog {
51public:
53 wxWindow* parent,
55 TTAMachine::AddressSpace* addressSpace);
57
58private:
59 wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
60 virtual bool TransferDataToWindow();
61 void onName(wxCommandEvent& event);
62 void onOK(wxCommandEvent& event);
63 void onHelp(wxCommandEvent& event);
64 void onMinAddress(wxCommandEvent& event);
65 void onMinHex(wxCommandEvent& event);
66 void onMaxAddress(wxCommandEvent& event);
67 void onMaxHex(wxCommandEvent& event);
68 void onMinToDec(wxCommandEvent& event);
69 void onMinToHex(wxCommandEvent& event);
70 void onMaxToDec(wxCommandEvent& event);
71 void onMaxToHex(wxCommandEvent& event);
72 void onBitWidth(wxSpinEvent& event);
73 void onBitWidthText(wxCommandEvent& event);
74
75 void onAddId(wxCommandEvent& event);
76 void onDeleteId(wxCommandEvent& event);
77 void onSpinId(wxSpinEvent& event);
78 void onIdListSelection(wxListEvent& event);
79 void updateIdLists();
80 bool isFreeId(unsigned id) const;
81
82 void setTexts();
83
84 /// Machine containing all the address spaces.
86 /// Address space to modify with the dialog.
88 /// Name of the address space.
89 wxString name_;
90 /// The bit width of the minimum addressable word.
91 int width_;
92 /// The lowest address in the address space.
93 wxString minAddress_;
94 /// The highest address in the address space.
95 wxString maxAddress_;
96 /// Widget for the lowest address hex value.
98 /// Widget for the highest address hex value.
100
101 /// Boxsizer containing the name widget.
102 wxStaticBoxSizer* nameSizer_;
103 /// Boxsizer containing the min-address widget.
104 wxStaticBoxSizer* minAddressSizer_;
105 /// Boxsizer containing the max-address widget.
106 wxStaticBoxSizer* maxAddressSizer_;
107 /// Boxsizer containing the width widget.
108 wxStaticBoxSizer* widthSizer_;
109 /// SpinCtrl containing the bit width of the max-address.
110 wxSpinCtrl *bitWidthSpinCtrl_;
111
112 /// Boxsizer containing the address space id widget.
113 wxStaticBoxSizer* idSizer_;
114 /// List control containing the address space ids.
115 wxListCtrl* idListCtrl_;
116 /// SpinCtrl containing an address space id.
117 wxSpinCtrl* idSpinCtrl_;
118
119 /// Container for unique id numbers.
120 std::set<unsigned> idNumbers_;
121
122 // IDs for dialog controls
123 enum {
124 ID_NAME = 10000,
129
134
141 ID_HELP
142 };
143
144 DECLARE_EVENT_TABLE()
145};
146#endif
TTAMachine::Machine * machine
the architecture definition of the estimated processor
wxString name_
Name of the address space.
void onName(wxCommandEvent &event)
void onOK(wxCommandEvent &event)
wxStaticBoxSizer * maxAddressSizer_
Boxsizer containing the max-address widget.
void onMaxAddress(wxCommandEvent &event)
void onMinToHex(wxCommandEvent &event)
void onSpinId(wxSpinEvent &event)
wxString minAddress_
The lowest address in the address space.
void onAddId(wxCommandEvent &event)
wxSpinCtrl * bitWidthSpinCtrl_
SpinCtrl containing the bit width of the max-address.
NumberControl * maxControl_
Widget for the highest address hex value.
void onMaxToDec(wxCommandEvent &event)
TTAMachine::Machine * machine_
Machine containing all the address spaces.
void onDeleteId(wxCommandEvent &event)
wxListCtrl * idListCtrl_
List control containing the address space ids.
void onMinAddress(wxCommandEvent &event)
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
void onMinHex(wxCommandEvent &event)
void onIdListSelection(wxListEvent &event)
wxStaticBoxSizer * idSizer_
Boxsizer containing the address space id widget.
bool isFreeId(unsigned id) const
virtual bool TransferDataToWindow()
void onBitWidth(wxSpinEvent &event)
wxStaticBoxSizer * nameSizer_
Boxsizer containing the name widget.
wxSpinCtrl * idSpinCtrl_
SpinCtrl containing an address space id.
TTAMachine::AddressSpace * as_
Address space to modify with the dialog.
wxStaticBoxSizer * minAddressSizer_
Boxsizer containing the min-address widget.
wxString maxAddress_
The highest address in the address space.
void onMinToDec(wxCommandEvent &event)
NumberControl * minControl_
Widget for the lowest address hex value.
void onBitWidthText(wxCommandEvent &event)
wxStaticBoxSizer * widthSizer_
Boxsizer containing the width widget.
std::set< unsigned > idNumbers_
Container for unique id numbers.
void onHelp(wxCommandEvent &event)
void onMaxToHex(wxCommandEvent &event)
int width_
The bit width of the minimum addressable word.
void onMaxHex(wxCommandEvent &event)