OpenASIP 2.2
Loading...
Searching...
No Matches
AddRFFromHDBDialog.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 AddRFFromHDBDialog.hh
26 *
27 * Declaration of AddRFFromHDBDialog class.
28 *
29 * @author Veli-Pekka Jääskeläinen 2006 (vjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_ADD_RF_FROM_HDB_DIALOG_HH
34#define TTA_ADD_RF_FROM_HDB_DIALOG_HH
35
36#include <map>
37#include <wx/wx.h>
38#include <wx/listctrl.h>
39
40class Model;
41
42struct ListItemData {
43 int id;
44 int width;
45 int size;
46 int readPorts;
51 int hdbId;
52 wxString path;
53};
54
55namespace HDB {
56 class RFArchitecture;
57 class HDBManager;
58}
59
60/**
61 * Dialog for adding register file architectures directly from HDB to the
62 * current machine.
63 */
64class AddRFFromHDBDialog : public wxDialog {
65public:
66 AddRFFromHDBDialog(wxWindow* parent, Model* model);
67 virtual ~AddRFFromHDBDialog();
68
69private:
70 virtual bool TransferDataToWindow();
71 wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
72 void onListSelectionChange(wxListEvent& event);
73 void onAdd(wxCommandEvent& event);
74 void onClose(wxCommandEvent& event);
75 bool loadHDB(const HDB::HDBManager& manager);
76 void onColumnClick(wxListEvent& event);
77 void setColumnImage(int col, int image);
78
79 /// Model of the current adf file.
81 /// Immediate slot list widget.
82 wxListCtrl* list_;
83 /// Map of rf architectures displayed in the dialog list.
84 std::map<int, HDB::RFArchitecture*> rfArchitectures_;
85
88
89 enum {
90 ID_LIST = 10000,
94 };
95
96 /// Default size for the rf, if the size is parameterized in the HDB.
97 static const int DEFAULT_SIZE;
98 /// Default bit width for the rf, if the size is parameterized in the HDB.
99 static const int DEFAULT_WIDTH;
100 /// File filter for the HDB files.
101 static const wxString HDB_FILE_FILTER;
102
103 DECLARE_EVENT_TABLE()
104};
105#endif
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
bool loadHDB(const HDB::HDBManager &manager)
void onColumnClick(wxListEvent &event)
void onAdd(wxCommandEvent &event)
static const int DEFAULT_SIZE
Default size for the rf, if the size is parameterized in the HDB.
static const int DEFAULT_WIDTH
Default bit width for the rf, if the size is parameterized in the HDB.
void onClose(wxCommandEvent &event)
wxListCtrl * list_
Immediate slot list widget.
void setColumnImage(int col, int image)
std::map< int, HDB::RFArchitecture * > rfArchitectures_
Map of rf architectures displayed in the dialog list.
Model * model_
Model of the current adf file.
static const wxString HDB_FILE_FILTER
File filter for the HDB files.
virtual bool TransferDataToWindow()
void onListSelectionChange(wxListEvent &event)
Definition Model.hh:50