34 #include <wx/statline.h>
55 #if wxCHECK_VERSION(3, 0, 0)
56 #define wxOPEN wxFD_OPEN
57 #define wxFILE_MUST_EXIST wxFD_FILE_MUST_EXIST
88 UnitImplementationLocation& impl) :
90 wxDefaultPosition, wxDefaultSize,
91 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
92 block_(block), impl_(impl) {
94 createContents(
this,
true,
true);
95 SetSize(wxSize(580, 300));
97 list_ =
dynamic_cast<wxListCtrl*
>(
FindWindow(ID_LIST));
98 hdbChoice_ =
dynamic_cast<wxChoice*
>(
FindWindow(ID_HDB_CHOICE));
100 list_->InsertColumn(0, _T(
"module name"), wxLIST_FORMAT_LEFT, 150);
101 list_->InsertColumn(1, _T(
"id"), wxLIST_FORMAT_LEFT, 50);
102 list_->InsertColumn(2, _T(
"param size"), wxLIST_FORMAT_LEFT, 100);
103 list_->InsertColumn(3, _T(
"param width"), wxLIST_FORMAT_LEFT, 100);
106 list_->InsertColumn(4, _T(
"guard latency"), wxLIST_FORMAT_LEFT, 170);
111 for (
int i = 0; i < registry.
hdbCount(); i++) {
112 hdbs_.insert(registry.
hdbPath(i));
114 if (!hdbs_.empty()) {
115 std::set<std::string>::iterator iter = hdbs_.begin();
116 bool defaultHDBFound =
false;
117 for (; iter != hdbs_.end(); iter++) {
121 selection_ = hdbChoice_->GetCount() - 1;
122 defaultHDBFound =
true;
125 hdbChoice_->SetSelection(selection_);
126 wxCommandEvent
dummy;
127 onHDBSelection(
dummy);
146 this, _T(
"Choose a HDB file containing the implementation"),
147 _T(
""), _T(
""), _T(
"HDBs|*.hdb|All files|*.*"),
148 (wxOPEN | wxFILE_MUST_EXIST));
150 if (dialog.ShowModal() == wxID_OK) {
151 std::string hdb = std::string(dialog.GetPath().mb_str());
155 if (item == wxNOT_FOUND) {
166 if (
list_->GetSelectedItemCount() == 1) {
183 list_->DeleteAllItems();
186 HDBManager& hdb = HDBRegistry::instance().hdb(path);
192 if (fuEntryIDs.empty()) {
193 wxString message = _T(
"No implementations for '");
195 message.Append(_T(
"' found in '"));
196 message.Append(
hdbChoice_->GetStringSelection());
197 message.Append(_T(
"'."));
201 std::set<RowID>::iterator iter = fuEntryIDs.begin();
202 for (; iter != fuEntryIDs.end(); iter++) {
226 int width = rf->
width();
227 int size = rf->
size();
232 for (
int p = 0; p < rf->
portCount(); p++) {
247 int guardLatency = 0;
249 bool zeroRegister =
false;
264 std::set<RowID> rfEntryIDs =
266 readPorts, writePorts, bidirPorts,
276 if (rfEntryIDs.empty()) {
277 wxString message = _T(
"No implementations for '");
279 message.Append(_T(
"' found in '"));
280 message.Append(
hdbChoice_->GetStringSelection());
281 message.Append(_T(
"'."));
285 std::set<RowID>::iterator iter = rfEntryIDs.begin();
286 for (; iter != rfEntryIDs.end(); iter++) {
317 wxString message = _T(
"Error opening '");
319 message.Append(_T(
"':\n\n"));
373 wxFlexGridSizer *item0 =
new wxFlexGridSizer( 1, 0, 0 );
374 item0->AddGrowableCol( 0 );
375 item0->AddGrowableRow( 1 );
377 wxBoxSizer *item1 =
new wxBoxSizer( wxHORIZONTAL );
379 wxString *strs2 = (wxString*) NULL;
380 wxChoice *item2 =
new wxChoice( parent,
ID_HDB_CHOICE, wxDefaultPosition, wxSize(250,-1), 0, strs2, 0 );
381 item1->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );
383 wxButton *item3 =
new wxButton( parent,
ID_BROWSE, wxT(
"Browse..."), wxDefaultPosition, wxDefaultSize, 0 );
384 item1->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );
386 item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
388 wxListCtrl *item4 =
new wxListCtrl( parent,
ID_LIST, wxDefaultPosition, wxSize(300,120), wxLC_REPORT|wxSUNKEN_BORDER );
389 item0->Add( item4, 0, wxGROW|wxALL, 5 );
391 wxStaticLine *item5 =
new wxStaticLine( parent,
ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
392 item0->Add( item5, 0, wxGROW|wxALL, 5 );
394 wxBoxSizer *item6 =
new wxBoxSizer( wxHORIZONTAL );
396 wxButton *item7 =
new wxButton( parent, wxID_CANCEL, wxT(
"&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
397 item6->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 );
399 wxButton *item8 =
new wxButton( parent, wxID_OK, wxT(
"&OK"), wxDefaultPosition, wxDefaultSize, 0 );
400 item6->Add( item8, 0, wxALIGN_CENTER|wxALL, 5 );
402 item0->Add( item6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
406 parent->SetSizer( item0 );
408 item0->SetSizeHints( parent );