OpenASIP 2.2
Loading...
Searching...
No Matches
AddFUFromHDBDialog.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 AddFUFromHDBDialog.hh
26 *
27 * Declaration of AddFUFromHDBDialog 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_FU_FROM_HDB_DIALOG_HH
34#define TTA_ADD_FU_FROM_HDB_DIALOG_HH
35
36#include <map>
37#include <vector>
38#include <string>
39
40#include <wx/wx.h>
41#include <wx/listctrl.h>
42#include <wx/timer.h>
43
44class Model;
45class wxSearchCtrl;
46
48 int id;
50 wxString operations;
51 int hdbId;
52 wxString path;
53};
54
55namespace HDB {
56 class FUArchitecture;
57 class HDBManager;
58}
59
60/**
61 * Dialog for adding register file architectures directly from HDB to the
62 * current machine.
63 */
64class AddFUFromHDBDialog : public wxDialog {
65public:
66 AddFUFromHDBDialog(wxWindow* parent, Model* model);
67 virtual ~AddFUFromHDBDialog();
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 bool acceptToList(
77 const std::string hdbFilePath,
78 const HDB::FUArchitecture& arch,
79 const std::vector<std::string>& filterList);
80 void onFilterChange(wxCommandEvent& event);
81 void onFilterTimeOut(wxTimerEvent& event);
82 void onColumnClick(wxListEvent& event);
83 void setColumnImage(int col, int image);
84
85 /// Model of the current adf file.
87 /// Immediate slot list widget.
88 wxListCtrl* list_;
89 /// Map of iu architectures displayed in the dialog list.
90 std::map<int, HDB::FUArchitecture*> fuArchitectures_;
91 /// The list filter text control.
92 wxSearchCtrl* filterCtrl_ = nullptr;
93 /// Keywords to filter HDB entries.
94 std::vector<std::string> filterPatterns_;
95 /// Timer to postpone filtering while typing filter patterns.
96 wxTimer filterTimer_;
97
100
101 enum {
102 ID_LIST = 10000,
109 };
110
111 /// File filter for HDB files.
112 static const wxString HDB_FILE_FILTER;
113
114 DECLARE_EVENT_TABLE()
115};
116#endif
void setColumnImage(int col, int image)
void onAdd(wxCommandEvent &event)
bool acceptToList(const std::string hdbFilePath, const HDB::FUArchitecture &arch, const std::vector< std::string > &filterList)
wxTimer filterTimer_
Timer to postpone filtering while typing filter patterns.
std::vector< std::string > filterPatterns_
Keywords to filter HDB entries.
wxSearchCtrl * filterCtrl_
The list filter text control.
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
void onColumnClick(wxListEvent &event)
void onFilterChange(wxCommandEvent &event)
void onFilterTimeOut(wxTimerEvent &event)
wxListCtrl * list_
Immediate slot list widget.
bool loadHDB(const HDB::HDBManager &manager)
virtual bool TransferDataToWindow()
static const wxString HDB_FILE_FILTER
File filter for HDB files.
std::map< int, HDB::FUArchitecture * > fuArchitectures_
Map of iu architectures displayed in the dialog list.
Model * model_
Model of the current adf file.
void onListSelectionChange(wxListEvent &event)
void onClose(wxCommandEvent &event)
Definition Model.hh:50