OpenASIP 2.2
Loading...
Searching...
No Matches
AddIUFromHDBDialog.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_IU_FROM_HDB_DIALOG_HH
34#define TTA_ADD_IU_FROM_HDB_DIALOG_HH
35
36#include <map>
37#include <wx/wx.h>
38#include <wx/listctrl.h>
39#include "Machine.hh"
40
41class Model;
42
43struct ListItemData {
44 int id;
45 int width;
46 int size;
48 int latency;
49 int hdbId;
50 wxString path;
51};
52
53namespace HDB {
54 class RFArchitecture;
55}
56
57/**
58 * Dialog for adding immediate unit architectures directly from HDB to the
59 * current machine.
60 */
61class AddIUFromHDBDialog : public wxDialog {
62public:
63 AddIUFromHDBDialog(wxWindow* parent, Model* model);
64 virtual ~AddIUFromHDBDialog();
65
66private:
67 virtual bool TransferDataToWindow();
68 wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
69 void onListSelectionChange(wxListEvent& event);
70 void onAdd(wxCommandEvent& event);
71 void onClose(wxCommandEvent& event);
72 bool loadHDB(const std::string& path);
73 void onColumnClick(wxListEvent& event);
74 void setColumnImage(int col, int image);
75
76 /// Model of the current adf file.
78 /// Immediate slot list widget.
79 wxListCtrl* list_;
80 /// Map of iu architectures displayed in the dialog list.
81 std::map<int, HDB::RFArchitecture*> iuArchitectures_;
82
85
86 enum {
87 ID_LIST = 10000,
91 };
92
93 /// Default size for the IU, if the size is parameterized in the HDB.
94 static const int DEFAULT_SIZE;
95 /// Default width for the IU, if the size is parameterized in the HDB.
96 static const int DEFAULT_WIDTH;
97 /// Default extension mode for the immediate unit.
99 /// File filter for HDB files.
100 static const wxString HDB_FILE_FILTER;
101
102 DECLARE_EVENT_TABLE()
103};
104#endif
static const wxString HDB_FILE_FILTER
File filter for HDB files.
void setColumnImage(int col, int image)
virtual bool TransferDataToWindow()
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
void onColumnClick(wxListEvent &event)
void onClose(wxCommandEvent &event)
static const int DEFAULT_SIZE
Default size for the IU, if the size is parameterized in the HDB.
bool loadHDB(const std::string &path)
void onListSelectionChange(wxListEvent &event)
std::map< int, HDB::RFArchitecture * > iuArchitectures_
Map of iu architectures displayed in the dialog list.
static const int DEFAULT_WIDTH
Default width for the IU, if the size is parameterized in the HDB.
static const TTAMachine::Machine::Extension DEFAULT_EXTENSION_MODE
Default extension mode for the immediate unit.
void onAdd(wxCommandEvent &event)
Model * model_
Model of the current adf file.
wxListCtrl * list_
Immediate slot list widget.
Definition Model.hh:50