OpenASIP 2.2
Loading...
Searching...
No Matches
HDBBrowserWindow.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 HDBBrowserWindow.hh
26 *
27 * Declaration of HDBBrowserWindow 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_HDB_BROWSER_WINDOW_HH
34#define TTA_HDB_BROWSER_WINDOW_HH
35
36#include <map>
37#include <wx/wx.h>
38#include <wx/treectrl.h>
39#include <wx/panel.h>
40#include "Exception.hh"
41#include "DBTypes.hh"
42
44
45namespace HDB {
46 class CachedHDBManager;
47}
48
49namespace TTAMachine {
50 class FunctionUnit;
51}
52
53/**
54 * Window for browsing an HDB.
55 *
56 * Displays a tree-view of the HDB, and an info panel which shows details
57 * of the element selected in the tree-view.
58 */
59class HDBBrowserWindow : public wxPanel {
60public:
61 HDBBrowserWindow(wxWindow* parent, wxWindowID id);
62 virtual ~HDBBrowserWindow();
64 void update();
65
70 bool isFUEntrySelected();
71 bool isRFEntrySelected();
72 bool isBusEntrySelected();
77
89
90 void selectRFArchitecture(int id);
91 void selectFUArchitecture(int id);
92 void selectRFImplementation(int id);
93 void selectFUImplementation(int id);
94 void selectFUEntry(int id);
95 void selectRFEntry(int id);
96 void selectBusEntry(int id);
97 void selectSocketEntry(int id);
98 void selectCostFunctionPlugin(int id);
99 void openLink(const wxString& link);
100
101private:
102 /// HDB to display in the browser.
104 /// Tree widget displayign the HDB hierarchy.
105 wxTreeCtrl* tree_;
106
107 void onItemSelected(wxTreeEvent& event);
108 void onRMBClick(wxTreeEvent& event);
109 wxString fuArchLabel(const TTAMachine::FunctionUnit& fu) const;
110
111 /// Widget window IDs.
112 enum {
113 ID_TREE_VIEW = 20000
114 };
115
116 /// Map of rf architecture RowIDs to tree item IDs.
117 std::map<RowID, wxTreeItemId> rfArchitectures_;
118 /// Map of rf implementation RowIDs to tree item IDs.
119 std::map<RowID, wxTreeItemId> rfImplementations_;
120 /// Map of fu architecture RowIDs to tree item IDs.
121 std::map<RowID, wxTreeItemId> fuArchitectures_;
122 /// Map of fu implementation RowIDs to tree item IDs.
123 std::map<RowID, wxTreeItemId> fuImplementations_;
124 /// Map of fu entry RowIDs to tree item IDs.
125 std::map<RowID, wxTreeItemId> fuEntries_;
126 /// Map of rf entry RowIDs to tree item IDs.
127 std::map<RowID, wxTreeItemId> rfEntries_;
128 /// Map of bus entry RowIDs to tree item IDs.
129 std::map<RowID, wxTreeItemId> busEntries_;
130 /// Map of socket entry RowIDs to tree item IDs.
131 std::map<RowID, wxTreeItemId> socketEntries_;
132 /// Map of cost function plugin RowIDs to tree item IDs.
133 std::map<RowID, wxTreeItemId> costPlugins_;
134
135 /// Info panel widget for displaying the selected element information.
137
138 DECLARE_EVENT_TABLE()
139};
140
141#endif
int RowID
Type definition of row ID in relational databases.
Definition DBTypes.hh:37
void selectFUImplementation(int id)
std::map< RowID, wxTreeItemId > rfArchitectures_
Map of rf architecture RowIDs to tree item IDs.
bool isCostFunctionPluginSelected()
void selectBusEntry(int id)
std::map< RowID, wxTreeItemId > fuArchitectures_
Map of fu architecture RowIDs to tree item IDs.
void selectCostFunctionPlugin(int id)
wxTreeCtrl * tree_
Tree widget displayign the HDB hierarchy.
void selectRFEntry(int id)
std::map< RowID, wxTreeItemId > rfImplementations_
Map of rf implementation RowIDs to tree item IDs.
std::map< RowID, wxTreeItemId > costPlugins_
Map of cost function plugin RowIDs to tree item IDs.
std::map< RowID, wxTreeItemId > rfEntries_
Map of rf entry RowIDs to tree item IDs.
void selectSocketEntry(int id)
RowID selectedOperationImplementation()
bool isOperationImplementationResourceSelected()
void selectFUArchitecture(int id)
HDB::CachedHDBManager * manager_
HDB to display in the browser.
HDBBrowserInfoPanel * infoPanel_
Info panel widget for displaying the selected element information.
std::map< RowID, wxTreeItemId > fuEntries_
Map of fu entry RowIDs to tree item IDs.
void selectRFImplementation(int id)
void onItemSelected(wxTreeEvent &event)
void onRMBClick(wxTreeEvent &event)
void selectFUEntry(int id)
wxString fuArchLabel(const TTAMachine::FunctionUnit &fu) const
RowID selectedOperationImplementationResource()
void selectRFArchitecture(int id)
std::map< RowID, wxTreeItemId > fuImplementations_
Map of fu implementation RowIDs to tree item IDs.
virtual ~HDBBrowserWindow()
bool isOperationImplementationSelected()
void openLink(const wxString &link)
std::map< RowID, wxTreeItemId > socketEntries_
Map of socket entry RowIDs to tree item IDs.
std::map< RowID, wxTreeItemId > busEntries_
Map of bus entry RowIDs to tree item IDs.
RowID selectedCostFunctionPlugin()
void setHDBManager(HDB::CachedHDBManager &manager)