OpenASIP 2.2
Loading...
Searching...
No Matches
FUDialog.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 FUDialog.cc
26 *
27 * Definition of FUDialog class.
28 *
29 * @author Veli-Pekka Jääskeläinen 2004 (vjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#include <set>
34#include <string>
35#include <wx/valtext.h>
36#include <wx/valgen.h>
37#include <boost/format.hpp>
38
39#include "Application.hh"
40#include "FUDialog.hh"
41#include "FUPortDialog.hh"
42#include "Model.hh"
43#include "WxConversion.hh"
44#include "ProDeConstants.hh"
45#include "Conversion.hh"
46#include "WarningDialog.hh"
47#include "ErrorDialog.hh"
48#include "InformationDialog.hh"
49#include "Machine.hh"
50#include "AddressSpace.hh"
51#include "FunctionUnit.hh"
52#include "FUPort.hh"
53#include "UserManualCmd.hh"
54#include "WidgetTools.hh"
55#include "OperationDialog.hh"
56#include "HWOperation.hh"
57#include "ModelConstants.hh"
58#include "MachineTester.hh"
59#include "GUITextGenerator.hh"
60#include "ProDeTextGenerator.hh"
61#include "OpsetDialog.hh"
62#include "ObjectState.hh"
63
64using boost::format;
65using std::string;
66using namespace TTAMachine;
67
68BEGIN_EVENT_TABLE(FUDialog, wxDialog)
69 EVT_TEXT(ID_NAME, FUDialog::onName)
70 EVT_CHOICE(ID_ADDRESS_SPACE, FUDialog::onSetAddressSpace)
72 EVT_BUTTON(ID_DELETE_PORT, FUDialog::onDeletePort)
73 EVT_BUTTON(ID_EDIT_PORT, FUDialog::onEditPort)
74 EVT_MENU(ID_EDIT_PORT, FUDialog::onEditPort)
75 EVT_MENU(ID_DELETE_PORT, FUDialog::onDeletePort)
76 EVT_MENU(ID_EDIT_OPERATION, FUDialog::onEditOperation)
77 EVT_MENU(ID_DELETE_OPERATION, FUDialog::onDeleteOperation)
78
80 EVT_LIST_ITEM_RIGHT_CLICK(ID_PORT_LIST, FUDialog::onPortRightClick)
82 EVT_LIST_ITEM_RIGHT_CLICK(ID_OPERATION_LIST, FUDialog::onOperationRightClick)
83
84 EVT_BUTTON(ID_ADD_OPERATION, FUDialog::onAddOperation)
85 EVT_BUTTON(ID_ADD_OPERATION_FROM_OPSET, FUDialog::onAddOperationFromOpset)
86 EVT_BUTTON(ID_DELETE_OPERATION, FUDialog::onDeleteOperation)
87 EVT_BUTTON(ID_EDIT_OPERATION, FUDialog::onEditOperation)
88
90
91 EVT_LIST_ITEM_FOCUSED(ID_PORT_LIST, FUDialog::onPortSelection)
92 EVT_LIST_DELETE_ITEM(ID_PORT_LIST, FUDialog::onPortSelection)
95
96 EVT_LIST_ITEM_FOCUSED(ID_OPERATION_LIST, FUDialog::onOperationSelection)
97 EVT_LIST_DELETE_ITEM(ID_OPERATION_LIST, FUDialog::onOperationSelection)
101
102
103/**
104 * The Constructor.
105 *
106 * @param parent Parent window of the dialog.
107 * @param functionUnit A function unit to be shown in the dialog.
108 */
110 wxWindow* parent,
111 FunctionUnit* functionUnit):
112 wxDialog(parent, -1, _T(""), wxDefaultPosition),
113 functionUnit_(functionUnit),
114 name_(_T("")),
115 portListCtrl_(NULL),
116 operationListCtrl_(NULL),
117 addressSpaceChoice_(NULL) {
118
119 createContents(this, true, true);
120
121 portListCtrl_ = dynamic_cast<wxListCtrl*>(FindWindow(ID_PORT_LIST));
122 operationListCtrl_ =
123 dynamic_cast<wxListCtrl*>(FindWindow(ID_OPERATION_LIST));
124 addressSpaceChoice_ =
125 dynamic_cast<wxChoice*>(FindWindow(ID_ADDRESS_SPACE));
126
127 FindWindow(ID_NAME)->SetValidator(wxTextValidator(wxFILTER_ASCII, &name_));
128
129 FindWindow(wxID_OK)->Disable();
130
131 // set widget texts
132 setTexts();
133
134 TransferDataToWindow();
135}
136
137
138/**
139 * The Destructor.
140 */
143
144
145/**
146 * Sets texts for widgets.
147 */
148void
152
153 // Dialog title
154 format fmt = prodeTexts->text(ProDeTextGenerator::TXT_FU_DIALOG_TITLE);
155 SetTitle(WxConversion::toWxString(fmt.str()));
156
157 // buttons
158 WidgetTools::setLabel(generator, FindWindow(wxID_OK),
160
161 WidgetTools::setLabel(generator, FindWindow(wxID_CANCEL),
163
166
169
172
175
178
181
184
185 // widget labels
188
191
192 // box sizer labels
195
198
199 // Create port list columns.
200 wxListCtrl* portList =
201 dynamic_cast<wxListCtrl*>(FindWindow(ID_PORT_LIST));
203 portList->InsertColumn(0, WxConversion::toWxString(fmt.str()),
204 wxLIST_FORMAT_CENTER, 30);
205 fmt = prodeTexts->text(ProDeTextGenerator::TXT_COLUMN_NAME);
206 portList->InsertColumn(1, WxConversion::toWxString(fmt.str()),
207 wxLIST_FORMAT_LEFT, 110);
209 portList->InsertColumn(2, WxConversion::toWxString(fmt.str()),
210 wxLIST_FORMAT_LEFT, 110);
211
212 // Create operation list column.
213 wxListCtrl* operationList =
214 dynamic_cast<wxListCtrl*>(FindWindow(ID_OPERATION_LIST));
215 fmt = prodeTexts->text(ProDeTextGenerator::TXT_COLUMN_NAME);
216 operationList->InsertColumn(0, WxConversion::toWxString(fmt.str()),
217 wxLIST_FORMAT_LEFT, 250);
218
219 Layout();
220}
221
222/**
223 * Transfers data from the MOM to the dialog widgets.
224 *
225 * @return False, if an error occured in the transfer, true otherwise.
226 */
227bool
229
234
235 return wxWindow::TransferDataToWindow();
236}
237
238
239/**
240 * Validates input in the controls, and updates the FunctionUnit.
241 */
242void
243FUDialog::onOK(wxCommandEvent&) {
244
245 if (!Validate()) {
246 return;
247 }
248
249 if (!TransferDataFromWindow()) {
250 return;
251 }
252
253 string trimmedName =
254 WxConversion::toString(name_.Trim(false).Trim(true));
255
256 // Check the name validity.
257 if (!MachineTester::isValidComponentName(trimmedName)) {
259 format message =
261 InformationDialog warning(
262 this, WxConversion::toWxString(message.str()));
263 warning.ShowModal();
264 return;
265 }
266
267 if (trimmedName != functionUnit_->name()) {
270 for (int i = 0; i < navigator.count(); i++) {
271 FunctionUnit* fu = navigator.item(i);
272 if (trimmedName == fu->name()) {
273 ProDeTextGenerator* prodeTexts =
275 format message =
277 format a_fu =
279 format machine =
281 format fu =
283 message % trimmedName % a_fu.str() % machine.str() % fu.str();
284 WarningDialog warning(
285 this, WxConversion::toWxString(message.str()));
286 warning.ShowModal();
287 return;
288 }
289 }
290 }
291 functionUnit_->setName(trimmedName);
292 EndModal(wxID_OK);
293}
294
295/**
296 * Sets the function unit address space when user changes it.
297 */
298void
300
301 string asName =
302 WxConversion::toString(addressSpaceChoice_->GetStringSelection());
303
306 } else {
307
310
311 AddressSpace* as = navigator.item(asName);
313 }
314}
315
316
317/**
318 * Creates and shows an empty Function Unit Port Dialog for adding ports.
319 */
320void
321FUDialog::onAddPort(wxCommandEvent&) {
322
323 // Generate name for the new port.
324 int i = 1;
327 while (functionUnit_->hasPort(newName)) {
330 i++;
331 }
332
333 FUPort* port = new FUPort(
334 newName, ModelConstants::DEFAULT_WIDTH, *functionUnit_, false, false);
335 FUPortDialog portDialog(this, port);
336 if (portDialog.ShowModal() == wxID_CANCEL) {
337 // adding port was cancelled
338 delete port;
339 }
341}
342
343
344
345/**
346 * Deletes selected port from the port list.
347 */
348void
349FUDialog::onDeletePort(wxCommandEvent&) {
350 FUPort* selected = selectedPort();
351 if (selected == NULL) {
352 return;
353 }
354 assert(selected != NULL);
355 delete selected;
357}
358
359
360/**
361 * Returns a pointer to the function unit port which is selected.
362 *
363 * @return Pointer to the port selected in the port list.
364 */
365FUPort*
368 if (name == "") {
369 return NULL;
370 }
371 FUPort* port = functionUnit_->operationPort(name);
372 return port;
373}
374
375
376/**
377 * Handles left mouse button double clicks on the port list.
378 */
379void
381 wxCommandEvent dummy;
383}
384
385
386/**
387 * Handles the 'Edit Port' button event.
388 *
389 * Opens a FUPortDialog with the selected port set.
390 */
391void
392FUDialog::onEditPort(wxCommandEvent&) {
393 FUPort* port = selectedPort();
394 if (port == NULL) {
395 return;
396 }
397 FUPortDialog portDialog(this, port);
398 portDialog.ShowModal();
400}
401
402
403/**
404 * Disables and enables Edit and Delete buttons under the port list.
405 *
406 * If a port is selected, buttons are enabled. If no port is selected the
407 * buttons will be disabled.
408 *
409 * @param event ListEvent, which may have changed the selection.
410 */
411void
413 if (portListCtrl_->GetSelectedItemCount() != 1) {
414 FindWindow(ID_DELETE_PORT)->Disable();
415 FindWindow(ID_EDIT_PORT)->Disable();
416 return;
417 }
418 FindWindow(ID_DELETE_PORT)->Enable();
419 FindWindow(ID_EDIT_PORT)->Enable();
420}
421
422
423/**
424 * Creates and shows an empty Function Unit Operation Dialog for
425 * adding operations.
426 *
427 * Not Implemented.
428 */
429void
430FUDialog::onAddOperation(wxCommandEvent&) {
432
433 // Generate name for the new operation.
434 int i = 1;
437 while (functionUnit_->hasOperation(newName)) {
440 i++;
441 }
442 HWOperation* operation = NULL;
443 operation = new HWOperation(newName, *functionUnit_);
444
445 OperationDialog dialog(this, operation);
446 if (dialog.ShowModal() == wxID_OK) {
447 delete fu;
448 } else {
450 }
452}
453
454/**
455 * Event handler for the add operation from opset button.
456 */
457void
459
460 try {
461 OpsetDialog opsetDialog(this);
462 if (opsetDialog.ShowModal() != wxID_OK) {
463 return;
464 }
465
466 HWOperation* operation = opsetDialog.createOperation(*functionUnit_);
467
468 if (operation == NULL) {
469 return;
470 }
471
472 OperationDialog operationDialog(this, operation);
473 if (operationDialog.ShowModal() != wxID_OK) {
474 delete operation;
475 }
476
478 } catch (Exception & e) {
479 wxString message = WxConversion::toWxString(e.errorMessage());
480 ErrorDialog dialog(this, message);
481 dialog.ShowModal();
482 return;
483 }
484}
485
486/**
487 * Deletes selected operation from the operation list.
488 */
489void
492 if (name == "") {
493 return;
494 }
495 delete functionUnit_->operation(name);
497}
498
499
500
501/**
502 * Handles the 'Edit Operation' button event.
503 *
504 * Opens a FUOperationDialog with the selected operation's attributes set.
505 */
506void
508
509 HWOperation* selected = selectedOperation();
510 if (selected == NULL) {
511 // No operation selected.
512 return;
513 }
514
516 OperationDialog dialog(this, selected);
517 if (dialog.ShowModal() == wxID_OK) {
518 delete fu;
519 } else {
521 }
523}
524
525
526/**
527 * Checks whether name field is empty and disables OK button of the
528 * dialog if it is.
529 */
530void
531FUDialog::onName(wxCommandEvent&) {
532 if (!TransferDataFromWindow()) {
533 assert(false);
534 }
535 wxString trimmedName = name_.Trim(false).Trim(true);
536 if (trimmedName == _T("")) {
537 FindWindow(wxID_OK)->Disable();
538 } else {
539 FindWindow(wxID_OK)->Enable();
540 }
541}
542
543
544/**
545 * Returns pointer to the operation, which is selected on the operation list.
546 *
547 * @return Pointer to the selected operation.
548 */
552 if (name == "") {
553 return NULL;
554 }
555 return functionUnit_->operation(name);
556}
557
558
559/**
560 * Disables and enables Edit and Delete buttons under the operation list.
561 *
562 * If a operation is selected, buttons are enabled. If no operation is
563 * selected the buttons will be disabled.
564 *
565 * @param event ListEvent, which may have changed the selection.
566 */
567void
569 if (operationListCtrl_->GetSelectedItemCount() != 1) {
571 FindWindow(ID_EDIT_OPERATION)->Disable();
572 return;
573 }
575 FindWindow(ID_EDIT_OPERATION)->Enable();
576}
577
578
579/**
580 * Updates 'Address Space' choice control.
581 *
582 * Clears all items from the choicer and adds all address spaces plus
583 * an item 'NONE' indicating empty selection.
584 */
585void
587
588 addressSpaceChoice_->Clear();
590
593
594 // put each address space of the Machine to the control.
595 for (int i = 0; i < navigator.count(); i++) {
596 AddressSpace* as = navigator.item(i);
597 wxString name = WxConversion::toWxString(as->name());
598 addressSpaceChoice_->Append(name);
599 }
600
601 // set address space selection
603 if (as != NULL) {
604 wxString name = WxConversion::toWxString(as->name());
605 addressSpaceChoice_->SetStringSelection(name);
606 } else {
607 addressSpaceChoice_->SetStringSelection(ProDeConstants::NONE);
608 }
609}
610
611
612/**
613 * Updates 'Ports' list control.
614 *
615 * Clears all items from the choicer and adds all ports.
616 */
617void
619
620 portListCtrl_->DeleteAllItems();
621
622 for (int i = 0; i < functionUnit_->portCount(); i++) {
623
625
626 bool triggers = port->isTriggering();
627 string width = Conversion::toString(port->width());
628 string name = port->name();
629
630 // set asterisk symbol in the "T" column if port triggers
631 if (!triggers) {
632 portListCtrl_->InsertItem(i, _T(""), 0);
633 } else {
634 portListCtrl_->InsertItem(i, _T("*"), 0);
635 }
636
637 portListCtrl_->SetItem(i, 1, WxConversion::toWxString(name));
638 portListCtrl_->SetItem(i, 2, WxConversion::toWxString(width));
639
640 }
641 wxListEvent dummy;
643}
644
645
646/**
647 * Updates operation list.
648 */
649void
651
652 operationListCtrl_->DeleteAllItems();
653
654 // Operation names are put in a set, which will sort the operation
655 // names automatically.
656 std::set<std::string> operations;
657 for (int i=0; i < functionUnit_->operationCount(); i++) {
658 operations.insert(functionUnit_->operation(i)->name());
659 }
660
661 std::set<std::string>::reverse_iterator iter = operations.rbegin();
662 for (; iter != operations.rend(); iter++) {
663 wxString name = WxConversion::toWxString(*iter);
664 operationListCtrl_->InsertItem(0, name);
665 }
666
667 wxListEvent dummy;
669}
670
671
672/**
673 * Opens a pop-up menu when right mouse button was pressed.
674 *
675 * @param event Information about right mouse click event.
676 */
677void
678FUDialog::onPortRightClick(wxListEvent& event) {
679
680 portListCtrl_->SetItemState(event.GetIndex(), wxLIST_STATE_SELECTED,
681 wxLIST_STATE_SELECTED);
682
683 wxMenu* contextMenu = new wxMenu();
684
686 format button = prodeTexts->text(
688 contextMenu->Append(
690 button = prodeTexts->text(
692 contextMenu->Append(
694 portListCtrl_->PopupMenu(contextMenu, event.GetPoint());
695}
696
697
698/**
699 * Opens a pop-up menu when right mouse button was pressed on the
700 * operation list.
701 *
702 * @param event Information about right mouse click event.
703 */
704void
706
707 operationListCtrl_->SetItemState(event.GetIndex(), wxLIST_STATE_SELECTED,
708 wxLIST_STATE_SELECTED);
709
710 wxMenu* contextMenu = new wxMenu();
711
713 format button = prodeTexts->text(
715 contextMenu->Append(
717 button = prodeTexts->text(
719 contextMenu->Append(
721 operationListCtrl_->PopupMenu(contextMenu, event.GetPoint());
722}
723
724
725/**
726 * Handles left mouse button double clicks on the operation list.
727 */
728void
730 wxCommandEvent dummy;
732}
733
734
735/**
736 * Creates the dialog window contents.
737 *
738 * This method was initially generated with wxDesigner, code will be
739 * cleaned up later.
740 *
741 * @return Main sizer of the created contents.
742 * @param parent The dialog window.
743 * @param call_fit If true, fits the contents inside the dialog.
744 * @param set_sizer If true, sets the main sizer as dialog contents.
745 */
746wxSizer*
747FUDialog::createContents(wxWindow* parent, bool call_fit, bool set_sizer) {
748
749 wxFlexGridSizer *item0 = new wxFlexGridSizer( 2, 0, 10 );
750
751 wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL );
752
753 wxStaticText *item2 = new wxStaticText( parent, ID_LABEL_NAME, wxT("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
754 item1->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );
755
756 wxTextCtrl *item3 = new wxTextCtrl( parent, ID_NAME, wxT(""), wxDefaultPosition, wxSize(150,-1), 0 );
757 item1->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );
758
759 item0->Add( item1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
760
761 wxBoxSizer *item4 = new wxBoxSizer( wxHORIZONTAL );
762
763 wxStaticText *item5 = new wxStaticText( parent, ID_LABEL_AS, wxT("Address Space:"), wxDefaultPosition, wxDefaultSize, 0 );
764 item4->Add( item5, 0, wxALIGN_CENTER|wxALL, 5 );
765
766 wxString *strs6 = (wxString*) NULL;
767 wxChoice *item6 = new wxChoice( parent, ID_ADDRESS_SPACE, wxDefaultPosition, wxSize(150,-1), 0, strs6, 0 );
768 item4->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );
769
770 item0->Add( item4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
771
772 wxStaticBox *item8 = new wxStaticBox( parent, -1, wxT("Operations:") );
773 wxStaticBoxSizer *item7 = new wxStaticBoxSizer( item8, wxVERTICAL );
774 operationsSizer_ = item7;
775
776 wxListCtrl *item9 = new wxListCtrl( parent, ID_OPERATION_LIST, wxDefaultPosition, wxSize(160,200), wxLC_REPORT|wxSUNKEN_BORDER );
777 item7->Add( item9, 0, wxGROW|wxALL, 5 );
778
779 wxBoxSizer *item10 = new wxBoxSizer( wxHORIZONTAL );
780
781 wxButton *item11 = new wxButton( parent, ID_ADD_OPERATION, wxT("Add..."), wxDefaultPosition, wxDefaultSize, 0 );
782 item10->Add( item11, 0, wxALIGN_CENTER|wxALL, 5 );
783
784 wxButton *item12 = new wxButton( parent, ID_EDIT_OPERATION, wxT("Edit..."), wxDefaultPosition, wxDefaultSize, 0 );
785 item10->Add( item12, 0, wxALIGN_CENTER|wxALL, 5 );
786
787 wxButton *item13 = new wxButton( parent, ID_DELETE_OPERATION, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
788 item10->Add( item13, 0, wxALIGN_CENTER|wxALL, 5 );
789
790 item7->Add( item10, 0, wxALIGN_CENTER, 5 );
791
792 wxButton *item14 = new wxButton( parent, ID_ADD_OPERATION_FROM_OPSET, wxT(" Add from Opset... "), wxDefaultPosition, wxDefaultSize, 0 );
793 item7->Add( item14, 0, wxALL, 5 );
794
795 item0->Add( item7, 0, wxGROW|wxALL, 5 );
796
797 wxStaticBox *item16 = new wxStaticBox( parent, -1, wxT("Ports:") );
798 wxStaticBoxSizer *item15 = new wxStaticBoxSizer( item16, wxVERTICAL );
799 portsSizer_ = item15;
800
801 wxListCtrl *item17 = new wxListCtrl( parent, ID_PORT_LIST, wxDefaultPosition, wxSize(160,200), wxLC_REPORT|wxSUNKEN_BORDER );
802 item15->Add( item17, 0, wxGROW|wxALL, 5 );
803
804 wxBoxSizer *item18 = new wxBoxSizer( wxHORIZONTAL );
805
806 wxButton *item19 = new wxButton( parent, ID_ADD_PORT, wxT("Add..."), wxDefaultPosition, wxDefaultSize, 0 );
807 item18->Add( item19, 0, wxALIGN_CENTER|wxALL, 5 );
808
809 wxButton *item20 = new wxButton( parent, ID_EDIT_PORT, wxT("Edit..."), wxDefaultPosition, wxDefaultSize, 0 );
810 item18->Add( item20, 0, wxALIGN_CENTER|wxALL, 5 );
811
812 wxButton *item21 = new wxButton( parent, ID_DELETE_PORT, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
813 item18->Add( item21, 0, wxALIGN_CENTER|wxALL, 5 );
814
815 item15->Add( item18, 0, wxALIGN_CENTER|wxALL, 5 );
816
817 item0->Add( item15, 0, wxGROW|wxALL, 5 );
818
819 wxBoxSizer *item25 = new wxBoxSizer( wxHORIZONTAL );
820
821 wxButton *item26 = new wxButton( parent, ID_HELP, wxT("&Help"), wxDefaultPosition, wxDefaultSize, 0 );
822 item25->Add( item26, 0, wxALIGN_CENTER|wxALL, 5 );
823
824 item0->Add( item25, 0, wxALL, 5 );
825
826 wxBoxSizer *item27 = new wxBoxSizer( wxHORIZONTAL );
827
828 wxButton *item28 = new wxButton( parent, wxID_OK, wxT("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
829 item27->Add( item28, 0, wxALIGN_CENTER|wxALL, 5 );
830
831 wxButton *item29 = new wxButton( parent, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
832 item27->Add( item29, 0, wxALIGN_CENTER|wxALL, 5 );
833
834 item0->Add( item27, 0, wxALL, 5 );
835
836 if (set_sizer)
837 {
838 parent->SetSizer( item0 );
839 if (call_fit)
840 item0->SetSizeHints( parent );
841 }
842
843 return item0;
844}
#define assert(condition)
END_EVENT_TABLE() using namespace IDF
TTAMachine::Machine * machine
the architecture definition of the estimated processor
FUImplementationDialog::onAddExternalPort FUImplementationDialog::onDeleteExternalPort FUImplementationDialog::onArchPortSelection EVT_LIST_ITEM_DESELECTED(ID_ARCH_PORT_LIST, FUImplementationDialog::onArchPortSelection) EVT_LIST_ITEM_ACTIVATED(ID_ARCH_PORT_LIST
FUImplementationDialog::onAddExternalPort FUImplementationDialog::onDeleteExternalPort FUImplementationDialog::onArchPortSelection FUImplementationDialog::onArchPortActivation EVT_LIST_ITEM_SELECTED(ID_EXTERNAL_PORT_LIST, FUImplementationDialog::onExternalPortSelection) EVT_LIST_ITEM_ACTIVATED(ID_EXTERNAL_PORT_LIST
FUImplementationDialog::onAddExternalPort FUImplementationDialog::onDeleteExternalPort FUImplementationDialog::onArchPortSelection FUImplementationDialog::onArchPortActivation FUImplementationDialog::onExternalPortActivation FUImplementationDialog::onParameterSelection EVT_LIST_ITEM_ACTIVATED(ID_PARAMETER_LIST, FUImplementationDialog::onParameterActivation) EVT_LIST_ITEM_DESELECTED(ID_PARAMETER_LIST
EVT_BUTTON(ID_EDIT_ARCH_PORT, FUImplementationDialog::onEditArchitecturePort) EVT_BUTTON(ID_ADD_EXTERNAL_PORT
SimValue dummy(32)
a dummy simvalue which is given for operands that are not bound
static std::string toString(const T &source)
std::string errorMessage() const
Definition Exception.cc:123
void onName(wxCommandEvent &event)
Definition FUDialog.cc:531
void onDeleteOperation(wxCommandEvent &event)
Definition FUDialog.cc:490
@ ID_LABEL_NAME
Definition FUDialog.hh:112
@ ID_EDIT_OPERATION
Definition FUDialog.hh:104
@ ID_DELETE_OPERATION
Definition FUDialog.hh:106
@ ID_ADD_OPERATION
Definition FUDialog.hh:103
@ ID_ADD_OPERATION_FROM_OPSET
Definition FUDialog.hh:105
@ ID_LABEL_AS
Definition FUDialog.hh:113
@ ID_ADDRESS_SPACE
Definition FUDialog.hh:101
@ ID_ADD_PORT
Definition FUDialog.hh:108
@ ID_EDIT_PORT
Definition FUDialog.hh:109
@ ID_PORT_LIST
Definition FUDialog.hh:107
@ ID_OPERATION_LIST
Definition FUDialog.hh:102
@ ID_DELETE_PORT
Definition FUDialog.hh:110
virtual bool TransferDataToWindow()
Definition FUDialog.cc:228
void updateAddressSpaceChoice()
Definition FUDialog.cc:586
void updatePortList()
Definition FUDialog.cc:618
TTAMachine::HWOperation * selectedOperation()
Definition FUDialog.cc:550
wxListCtrl * operationListCtrl_
Operation list control.
Definition FUDialog.hh:90
void setTexts()
Definition FUDialog.cc:149
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition FUDialog.cc:747
void onOperationRightClick(wxListEvent &event)
Definition FUDialog.cc:705
void onDeletePort(wxCommandEvent &event)
Definition FUDialog.cc:349
void onSetAddressSpace(wxCommandEvent &event)
Definition FUDialog.cc:299
void onPortSelection(wxListEvent &event)
Definition FUDialog.cc:412
void onActivateOperation(wxListEvent &event)
Definition FUDialog.cc:729
TTAMachine::FUPort * selectedPort()
Definition FUDialog.cc:366
void onOK(wxCommandEvent &event)
Definition FUDialog.cc:243
wxChoice * addressSpaceChoice_
Address Space choice control.
Definition FUDialog.hh:92
void onAddOperationFromOpset(wxCommandEvent &event)
Definition FUDialog.cc:458
void onAddOperation(wxCommandEvent &event)
Definition FUDialog.cc:430
wxListCtrl * portListCtrl_
Port list control.
Definition FUDialog.hh:88
void onEditOperation(wxCommandEvent &event)
Definition FUDialog.cc:507
void updateOperationList()
Definition FUDialog.cc:650
virtual ~FUDialog()
Definition FUDialog.cc:141
void onEditPort(wxCommandEvent &event)
Definition FUDialog.cc:392
void onOperationSelection(wxListEvent &event)
Definition FUDialog.cc:568
void onPortRightClick(wxListEvent &event)
Definition FUDialog.cc:678
wxStaticBoxSizer * portsSizer_
Sizer for the port list controls.
Definition FUDialog.hh:95
wxString name_
Name of the function unit.
Definition FUDialog.hh:85
void onAddPort(wxCommandEvent &event)
Definition FUDialog.cc:321
wxStaticBoxSizer * operationsSizer_
Sizer for the operation list controls.
Definition FUDialog.hh:97
void onActivatePort(wxListEvent &event)
Definition FUDialog.cc:380
TTAMachine::FunctionUnit * functionUnit_
FunctionUnit to modify.
Definition FUDialog.hh:83
@ TXT_BUTTON_EDIT_DIALOG
Label for edit button (with trailing ...).
@ TXT_BUTTON_ADD_DIALOG
Label for add button (with trailing ...).
@ TXT_BUTTON_HELP
Label for help button.
@ TXT_BUTTON_DELETE
Label for delete button.
@ TXT_BUTTON_CANCEL
Label for cancel button.
@ TXT_BUTTON_OK
Label for OK button.
static GUITextGenerator * instance()
static bool isValidComponentName(const std::string &name)
static const int DEFAULT_WIDTH
Default bit width.
TTAMachine::HWOperation * createOperation(TTAMachine::FunctionUnit &fu)
static const wxString NONE
Constant for "None".
static const std::string COMP_NEW_NAME_PREFIX_PORT
Prefix for new port names.
static const std::string COMP_NEW_NAME_PREFIX_OPERATION
Prefix for new operation names.
static ProDeTextGenerator * instance()
@ MSG_ERROR_SAME_NAME
Error: Same name exists.
@ MSG_ERROR_ILLEGAL_NAME
Error: Illegal component name.
@ TXT_LABEL_BUTTON_EDIT
Label for &Edit... button.
@ COMP_FUNCTION_UNIT
Name for FU (w/o article).
@ TXT_LABEL_NAME
Label for component name widget.
@ COMP_A_FUNCTION_UNIT
Name for FU (w/ article).
@ TXT_LABEL_ADDRESS_SPACE
Label for address spave selector.
@ TXT_COLUMN_WIDTH
Label for width column in a list.
@ COMP_MACHINE
Text for machine description.
@ TXT_LABEL_BUTTON_DELETE
Label for &Delete button.
@ TXT_FU_OPERATIONS_BOX
Operations box title.
@ TXT_FU_PORTS_BOX
Ports box title.
@ TXT_COLUMN_TRIGGERS
Label for T column in a list.
@ TXT_FU_DIALOG_TITLE
Function unit dialog title.
@ TXT_COLUMN_NAME
Label for name column in a list.
virtual int width() const
virtual Machine * machine() const
virtual TCEString name() const
virtual bool isTriggering() const
Definition FUPort.cc:182
virtual void loadState(const ObjectState *state)
virtual AddressSpace * addressSpace() const
virtual HWOperation * operation(const std::string &name) const
virtual ObjectState * saveState() const
virtual int operationCount() const
virtual FUPort * operationPort(const std::string &name) const
virtual void setAddressSpace(AddressSpace *as)
virtual bool hasOperation(const std::string &name) const
virtual void setName(const std::string &name)
const std::string & name() const
ComponentType * item(int index) const
virtual FunctionUnitNavigator functionUnitNavigator() const
Definition Machine.cc:380
virtual AddressSpaceNavigator addressSpaceNavigator() const
Definition Machine.cc:392
virtual std::string name() const
Definition Port.cc:141
virtual bool hasPort(const std::string &name) const
Definition Unit.cc:96
virtual int portCount() const
Definition Unit.cc:135
virtual boost::format text(int textId)
static void setWidgetLabel(wxWindow *widget, std::string text)
static void setLabel(Texts::TextGenerator *generator, wxWindow *widget, int textID)
static std::string lcStringSelection(wxListCtrl *list, int column)
static wxString toWxString(const std::string &source)
static std::string toString(const wxString &source)