OpenASIP 2.2
Loading...
Searching...
No Matches
HDBBrowserInfoPanel.cc
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 HDBBrowserInfoPanel.cc
26 *
27 * Implementation of HDBBrowserInfoPanel class.
28 *
29 * @author Veli-Pekka Jääskeläinen 2006 (vjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#include <iostream>
34#include <string>
35#include <sstream>
37#include "HDBEditor.hh"
38#include "HDBBrowserWindow.hh"
39#include "WxConversion.hh"
40#include "HDBToHtml.hh"
41#include "Application.hh"
42
43using namespace HDB;
44
45/**
46 * The Constructor.
47 *
48 * @param parent Parent window of the panel.
49 * @param id Window ientifier for the panel.
50 */
51HDBBrowserInfoPanel::HDBBrowserInfoPanel(wxWindow* parent, wxWindowID id) :
52 wxHtmlWindow(parent, id),
53 htmlGen_(NULL) {
54}
55
56/**
57 * The Destructor.
58 */
60 if (htmlGen_ != NULL) {
61 delete htmlGen_;
62 htmlGen_ = NULL;
63 }
64}
65
66void
67HDBBrowserInfoPanel::OnLinkClicked(const wxHtmlLinkInfo& link) {
68 wxString href = link.GetHref();
69 wxGetApp().browser()->openLink(href);
70}
71
72/**
73 * Sets the HDB.
74 *
75 * @param hdb HDB to generate html from.
76 */
77void
79 if (htmlGen_ != NULL) {
80 delete htmlGen_;
81 }
82 htmlGen_ = new HDBToHtml(hdb);
83}
84
85/**
86 * Clears the panel contents.
87 */
88void
90 SetPage(_T("<html><body></body></html>"));
91}
92
93/**
94 * Displays details of an FU entry in the panel.
95 *
96 * @param id ID of the FU entry.
97 */
98void
100 assert(htmlGen_ != NULL);
101 std::stringstream stream;
102 htmlGen_->fuEntryToHtml(id, stream);
103 std::string page = stream.str();
104 SetPage(WxConversion::toWxString(page));
105}
106
107
108/**
109 * Displays details of a RF entry in the panel.
110 *
111 * @param id ID of the register file entry.
112 */
113void
115 assert(htmlGen_ != NULL);
116 std::stringstream stream;
117 htmlGen_->rfEntryToHtml(id, stream);
118 std::string page = stream.str();
119 SetPage(WxConversion::toWxString(page));
120}
121
122/**
123 * Displays details of a bus entry in the panel.
124 *
125 * @param id ID of the bus entry.
126 */
127void
129 assert(htmlGen_ != NULL);
130 std::stringstream stream;
131 htmlGen_->busEntryToHtml(id, stream);
132 std::string page = stream.str();
133 SetPage(WxConversion::toWxString(page));
134}
135
136/**
137 * Displays details of a socket entry in the panel.
138 *
139 * @param id ID of the socket entry.
140 */
141void
143 assert(htmlGen_ != NULL);
144 std::stringstream stream;
145 htmlGen_->socketEntryToHtml(id, stream);
146 std::string page = stream.str();
147 SetPage(WxConversion::toWxString(page));
148}
149
150
151/**
152 * Displays details of an FU architecture in the panel.
153 *
154 * @param id ID of the FU architecture.
155 */
156void
158 assert(htmlGen_ != NULL);
159 std::stringstream stream;
160 htmlGen_->fuArchToHtml(id, stream);
161 std::string page = stream.str();
162 SetPage(WxConversion::toWxString(page));
163}
164
165/**
166 * Displays details of a RF architecture in the panel.
167 *
168 * @param id ID of the register file architecture.
169 */
170void
172 assert(htmlGen_ != NULL);
173 std::stringstream stream;
174 htmlGen_->rfArchToHtml(id, stream);
175 std::string page = stream.str();
176 SetPage(WxConversion::toWxString(page));
177}
178
179
180/**
181 * Displays details of an FU implementation in the panel.
182 *
183 * @param id ID of the FU implementation.
184 */
185void
187 assert(htmlGen_ != NULL);
188 std::stringstream stream;
189 htmlGen_->fuImplToHtml(id, stream);
190 std::string page = stream.str();
191 SetPage(WxConversion::toWxString(page));
192}
193
194
195/**
196 * Displays details of a RF implementation in the panel.
197 *
198 * @param id ID of the RF implementation.
199 */
200void
202 assert(htmlGen_ != NULL);
203 std::stringstream stream;
204 htmlGen_->rfImplToHtml(id, stream);
205 std::string page = stream.str();
206 SetPage(WxConversion::toWxString(page));
207}
208
209/**
210 * Displays details of a cost function plugin in the panel.
211 *
212 * @param id ID of the cost function plugin.
213 */
214void
216 assert(htmlGen_ != NULL);
217 std::stringstream stream;
219 std::string page = stream.str();
220 SetPage(WxConversion::toWxString(page));
221}
222
223/**
224 * Displays details of a FUGEN oparation in the panel.
225 *
226 * @param id ID of the FUGEN operation plugin.
227 */
228void
230 assert(htmlGen_ != NULL);
231 std::stringstream stream;
233 std::string page = stream.str();
234 SetPage(WxConversion::toWxString(page));
235}
236
237/**
238 * Displays details of a FUGEN resource in the panel.
239 *
240 * @param id ID of the FUGEN resource plugin.
241 */
242void
244 assert(htmlGen_ != NULL);
245 std::stringstream stream;
247 std::string page = stream.str();
248 SetPage(WxConversion::toWxString(page));
249}
#define assert(condition)
int RowID
Type definition of row ID in relational databases.
Definition DBTypes.hh:37
void displaySocketEntry(RowID id)
virtual void OnLinkClicked(const wxHtmlLinkInfo &link)
void setHDB(const HDB::HDBManager &hdb)
HDBToHtml * htmlGen_
HDB to HTML generator.
void displayRFArchitecture(RowID id)
HDBBrowserInfoPanel(wxWindow *parent, wxWindowID id)
void displayCostFunctionPlugin(RowID id)
void displayRFImplementation(RowID id)
void displayOperationImplementationResource(RowID id)
void displayFUImplementation(RowID id)
void displayFUArchitecture(RowID id)
void displayFUEntry(RowID id)
void displayOperationImplementation(RowID id)
void costFunctionPluginToHtml(RowID id, std::ostream &stream)
Definition HDBToHtml.cc:900
void socketEntryToHtml(RowID id, std::ostream &stream)
Definition HDBToHtml.cc:289
void busEntryToHtml(RowID id, std::ostream &stream)
Definition HDBToHtml.cc:250
void fuImplToHtml(RowID id, std::ostream &stream)
Definition HDBToHtml.cc:539
void OperationImplementationResourceToHtml(RowID id, std::ostream &stream)
void fuArchToHtml(RowID id, std::ostream &stream)
Definition HDBToHtml.cc:328
void fuEntryToHtml(RowID id, std::ostream &stream)
Definition HDBToHtml.cc:103
void OperationImplementationToHtml(RowID id, std::ostream &stream)
Definition HDBToHtml.cc:986
void rfArchToHtml(RowID id, std::ostream &stream)
Definition HDBToHtml.cc:469
void rfEntryToHtml(RowID id, std::ostream &stream)
Definition HDBToHtml.cc:177
void rfImplToHtml(RowID id, std::ostream &stream)
Definition HDBToHtml.cc:720
static wxString toWxString(const std::string &source)