OpenASIP  2.0
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TemplateListDialog Class Reference

#include <TemplateListDialog.hh>

Inheritance diagram for TemplateListDialog:
Inheritance graph
Collaboration diagram for TemplateListDialog:
Collaboration graph

Public Member Functions

 TemplateListDialog (wxWindow *parent, TTAMachine::Machine *machine)
 
virtual ~TemplateListDialog ()
 

Private Types

enum  {
  ID_TEMPLATE_LIST = 10000, ID_SLOT_LIST, ID_LINE, ID_HELP,
  ID_ADD_TEMPLATE, ID_DELETE_TEMPLATE, ID_ADD_SLOT, ID_EDIT_SLOT,
  ID_DELETE_SLOT, ID_NAME, ID_LABEL_NAME
}
 

Private Member Functions

wxSizer * createContents (wxWindow *parent, bool call_fit, bool set_sizer)
 
virtual bool TransferDataToWindow ()
 
void updateSlotList ()
 
void onTemplateSelection (wxListEvent &event)
 
void onSlotSelection (wxListEvent &event)
 
void onTemplateName (wxCommandEvent &event)
 
void onAddTemplate (wxCommandEvent &event)
 
void onDeleteTemplate (wxCommandEvent &event)
 
void onAddSlot (wxCommandEvent &event)
 
void onEditSlot (wxCommandEvent &event)
 
void onDeleteSlot (wxCommandEvent &event)
 
void setTexts ()
 
TTAMachine::InstructionTemplateselectedTemplate ()
 
std::string selectedSlot ()
 

Private Attributes

TTAMachine::Machinemachine_
 Parent machine of the instruction templates. More...
 
wxStaticBoxSizer * templateSizer_
 Box sizer around the template list. More...
 
wxStaticBoxSizer * slotSizer_
 Box sizer around the slot list. More...
 
wxListCtrl * templateList_
 Widget for list of templates. More...
 
wxListCtrl * slotList_
 Widget for list of slots in the selected template. More...
 
wxString templateName_
 Name of the new template. More...
 

Detailed Description

Dialog for listing and editing instruction templates in a machine.

Definition at line 50 of file TemplateListDialog.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
ID_TEMPLATE_LIST 
ID_SLOT_LIST 
ID_LINE 
ID_HELP 
ID_ADD_TEMPLATE 
ID_DELETE_TEMPLATE 
ID_ADD_SLOT 
ID_EDIT_SLOT 
ID_DELETE_SLOT 
ID_NAME 
ID_LABEL_NAME 

Definition at line 85 of file TemplateListDialog.hh.

85  {
86  ID_TEMPLATE_LIST = 10000,
88  ID_LINE,
89  ID_HELP,
95  ID_NAME,
97  };

Constructor & Destructor Documentation

◆ TemplateListDialog()

TemplateListDialog::TemplateListDialog ( wxWindow *  parent,
TTAMachine::Machine machine 
)

The Constructor.

Parameters
parentParent window of the dialog.
machineParent machine of the instruction templates.

Definition at line 77 of file TemplateListDialog.cc.

79  :
80  wxDialog(parent, -1, _T(""), wxDefaultPosition),
82  templateName_(_T("")) {
83 
84  createContents(this, true, true);
85 
86  templateList_ = dynamic_cast<wxListCtrl*>(FindWindow(ID_TEMPLATE_LIST));
87  slotList_ = dynamic_cast<wxListCtrl*>(FindWindow(ID_SLOT_LIST));
88 
89  FindWindow(ID_NAME)->SetValidator(
90  wxTextValidator(wxFILTER_ASCII, &templateName_));
91  FindWindow(ID_ADD_TEMPLATE)->Disable();
92  FindWindow(ID_DELETE_TEMPLATE)->Disable();
93  FindWindow(ID_EDIT_SLOT)->Disable();
94 
95  // set widget texts
96  setTexts();
97 }

◆ ~TemplateListDialog()

TemplateListDialog::~TemplateListDialog ( )
virtual

The Destructor.

Definition at line 103 of file TemplateListDialog.cc.

103  {
104 }

Member Function Documentation

◆ createContents()

wxSizer * TemplateListDialog::createContents ( wxWindow *  parent,
bool  call_fit,
bool  set_sizer 
)
private

Creates the dialog window contents.

This method was generated with wxDesigner.

Returns
Main sizer of the created contents.
Parameters
parentThe dialog window.
call_fitIf true, fits the contents inside the dialog.
set_sizerIf true, sets the main sizer as dialog contents.

Definition at line 505 of file TemplateListDialog.cc.

506  {
507 
508  wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
509 
510  wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL );
511 
512  wxStaticBox *item3 = new wxStaticBox( parent, -1, wxT("Instruction Templates:") );
513  wxStaticBoxSizer *item2 = new wxStaticBoxSizer( item3, wxVERTICAL );
514  templateSizer_ = item2;
515 
516  wxListCtrl *item4 = new wxListCtrl( parent, ID_TEMPLATE_LIST, wxDefaultPosition, wxSize(160,200), wxLC_REPORT|wxLC_SINGLE_SEL|wxSUNKEN_BORDER );
517  item2->Add( item4, 0, wxGROW|wxALL, 5 );
518 
519  wxBoxSizer *item5 = new wxBoxSizer( wxHORIZONTAL );
520 
521  wxStaticText *item6 = new wxStaticText( parent, ID_LABEL_NAME, wxT("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
522  item5->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );
523 
524  wxTextCtrl *item7 = new wxTextCtrl( parent, ID_NAME, wxT(""), wxDefaultPosition, wxSize(120,-1), 0 );
525  item5->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 );
526 
527  item2->Add( item5, 0, wxGROW|wxALL, 5 );
528 
529  wxBoxSizer *item8 = new wxBoxSizer( wxHORIZONTAL );
530 
531  wxButton *item9 = new wxButton( parent, ID_ADD_TEMPLATE, wxT("Add"), wxDefaultPosition, wxDefaultSize, 0 );
532  item8->Add( item9, 0, wxALIGN_CENTER|wxALL, 5 );
533 
534  wxButton *item10 = new wxButton( parent, ID_DELETE_TEMPLATE, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
535  item8->Add( item10, 0, wxALIGN_CENTER|wxALL, 5 );
536 
537  item2->Add( item8, 0, wxALIGN_CENTER|wxALL, 5 );
538 
539  item1->Add( item2, 0, wxGROW|wxALL, 5 );
540 
541  wxStaticBox *item12 = new wxStaticBox( parent, -1, wxT("Template Slots:") );
542  wxStaticBoxSizer *item11 = new wxStaticBoxSizer( item12, wxVERTICAL );
543  slotSizer_ = item11;
544 
545  wxListCtrl *item13 = new wxListCtrl( parent, ID_SLOT_LIST, wxDefaultPosition, wxSize(250,245), wxLC_REPORT|wxLC_SINGLE_SEL|wxSUNKEN_BORDER );
546  item11->Add( item13, 0, wxGROW|wxALL, 5 );
547 
548  wxBoxSizer *item14 = new wxBoxSizer( wxHORIZONTAL );
549 
550  wxButton *item15 = new wxButton( parent, ID_ADD_SLOT, wxT("Add..."), wxDefaultPosition, wxDefaultSize, 0 );
551  item14->Add( item15, 0, wxALIGN_CENTER|wxALL, 5 );
552 
553  wxButton *item16 = new wxButton( parent, ID_EDIT_SLOT, wxT("Edit..."), wxDefaultPosition, wxDefaultSize, 0 );
554  item14->Add( item16, 0, wxALIGN_CENTER|wxALL, 5 );
555 
556  wxButton *item17 = new wxButton( parent, ID_DELETE_SLOT, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
557  item14->Add( item17, 0, wxALIGN_CENTER|wxALL, 5 );
558 
559  item11->Add( item14, 0, wxALIGN_CENTER|wxALL, 5 );
560 
561  item1->Add( item11, 0, wxGROW|wxALL, 5 );
562 
563  item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
564 
565  wxStaticLine *item18 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
566  item0->Add( item18, 0, wxGROW|wxALL, 5 );
567 
568  wxGridSizer *item19 = new wxGridSizer( 2, 0, 0 );
569 
570  wxButton *item20 = new wxButton( parent, ID_HELP, wxT("&Help"), wxDefaultPosition, wxDefaultSize, 0 );
571  item19->Add( item20, 0, wxALL, 5 );
572 
573  wxBoxSizer *item21 = new wxBoxSizer( wxHORIZONTAL );
574 
575  wxButton *item22 = new wxButton( parent, wxID_OK, wxT("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
576  item21->Add( item22, 0, wxALIGN_CENTER|wxALL, 5 );
577 
578  wxButton *item23 = new wxButton( parent, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
579  item21->Add( item23, 0, wxALIGN_CENTER|wxALL, 5 );
580 
581  item19->Add( item21, 0, wxALL, 5 );
582 
583  item0->Add( item19, 0, wxGROW, 5 );
584 
585  if (set_sizer)
586  {
587  parent->SetSizer( item0 );
588  if (call_fit)
589  item0->SetSizeHints( parent );
590  }
591 
592  return item0;
593 }

◆ onAddSlot()

void TemplateListDialog::onAddSlot ( wxCommandEvent &  event)
private

Handles the add slot button event.

Definition at line 415 of file TemplateListDialog.cc.

415  {
416 
417  if (selectedTemplate() == NULL) {
418  assert(false);
419  }
420 
421  // Check that there is at least one immediate unit in the machine.
422  const Machine::ImmediateUnitNavigator iuNavigator =
424 
425  if (iuNavigator.count() == 0) {
427  wxString message = WxConversion::toWxString(generator->text(
429 
430  InformationDialog dialog(this, message);
431  dialog.ShowModal();
432  return;
433  }
434 
435  // check that the template doesn't have all possible slots already
436  bool available = false;
437 
438  // check buses
439  const Machine::BusNavigator busNavigator = machine_->busNavigator();
440  for (int i = 0; i < busNavigator.count(); i++) {
441  if (!selectedTemplate()->usesSlot(busNavigator.item(i)->name())) {
442  available = true;
443  break;
444  }
445  }
446 
447  // check immediate slots
448  const Machine::ImmediateSlotNavigator immsNavigator =
450  for (int i = 0; i < immsNavigator.count(); i++) {
451  if (!selectedTemplate()->usesSlot(immsNavigator.item(i)->name())) {
452  available = true;
453  break;
454  }
455  }
456 
457  if (available == false) {
459  wxString message = WxConversion::toWxString(generator->text(
461  InformationDialog dialog(this, message);
462  dialog.ShowModal();
463  return;
464  }
465 
466  TemplateSlotDialog dialog(this, selectedTemplate());
467  dialog.ShowModal();
468  updateSlotList();
469 }

References assert, TTAMachine::Machine::Navigator< ComponentType >::count(), ProDeTextGenerator::instance(), TTAMachine::Machine::Navigator< ComponentType >::item(), ProDeTextGenerator::MSG_ERROR_NO_IMMEDIATE_UNITS, ProDeTextGenerator::MSG_ERROR_NO_SLOTS_AVAILABLE, Texts::TextGenerator::text(), and WxConversion::toWxString().

Here is the call graph for this function:

◆ onAddTemplate()

void TemplateListDialog::onAddTemplate ( wxCommandEvent &  event)
private

Handles the Add tempalte button event.

Adds a new template to the machine.

Definition at line 349 of file TemplateListDialog.cc.

349  {
350  if (!TransferDataFromWindow()) {
351  assert(false);
352  }
353  string trimmedName =
354  WxConversion::toString(templateName_.Trim(false).Trim(true));
355 
356  // Check the name validity.
357  if (!MachineTester::isValidComponentName(trimmedName)) {
359  format message =
361  InformationDialog warning(
362  this, WxConversion::toWxString(message.str()));
363  warning.ShowModal();
364  return;
365  }
366 
369 
370  if (navigator.hasItem(trimmedName)) {
371  ProDeTextGenerator* prodeTexts =
373  format message =
375  format a_tmplate =
377  format machine =
379  format tmplate =
381  message % trimmedName % a_tmplate.str() % machine.str() %
382  tmplate.str();
383  WarningDialog warning(this, WxConversion::toWxString(message.str()));
384  warning.ShowModal();
385  return;
386  }
387  new InstructionTemplate(trimmedName, *machine_);
388  templateName_ = _T("");
390 }

References assert, ProDeTextGenerator::COMP_A_TEMPLATE, ProDeTextGenerator::COMP_MACHINE, ProDeTextGenerator::COMP_TEMPLATE, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), machine, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, Texts::TextGenerator::text(), WxConversion::toString(), and WxConversion::toWxString().

Here is the call graph for this function:

◆ onDeleteSlot()

void TemplateListDialog::onDeleteSlot ( wxCommandEvent &  event)
private

Handles the delete slot button event.

Definition at line 476 of file TemplateListDialog.cc.

476  {
478  updateSlotList();
479 }

◆ onDeleteTemplate()

void TemplateListDialog::onDeleteTemplate ( wxCommandEvent &  event)
private

Deletes the selected template.

Definition at line 302 of file TemplateListDialog.cc.

302  {
303  delete selectedTemplate();
305  wxListEvent dummy;
307 }

References dummy.

◆ onEditSlot()

void TemplateListDialog::onEditSlot ( wxCommandEvent &  event)
private

Handles the edit slot button event.

Definition at line 486 of file TemplateListDialog.cc.

486  {
487  TemplateSlotDialog dialog(this, selectedTemplate(),
488  selectedTemplate()->templateSlot(selectedSlot()) );
489  dialog.ShowModal();
490  updateSlotList();
491 }

◆ onSlotSelection()

void TemplateListDialog::onSlotSelection ( wxListEvent &  event)
private

Updates the edit/delete slot buttons when the slot selection changes.

Definition at line 287 of file TemplateListDialog.cc.

287  {
288  if (slotList_->GetSelectedItemCount() == 1) {
289  FindWindow(ID_DELETE_SLOT)->Enable();
290  FindWindow(ID_EDIT_SLOT)->Enable();
291  } else {
292  FindWindow(ID_DELETE_SLOT)->Disable();
293  FindWindow(ID_EDIT_SLOT)->Disable();
294  }
295 }

◆ onTemplateName()

void TemplateListDialog::onTemplateName ( wxCommandEvent &  event)
private

Enables and disables the Add template button when text is entered in the template name widget.

Definition at line 398 of file TemplateListDialog.cc.

398  {
399  if (!TransferDataFromWindow()) {
400  assert(false);
401  }
402  wxString trimmedName = templateName_.Trim(false).Trim(true);
403  if (trimmedName == _T("")) {
404  FindWindow(ID_ADD_TEMPLATE)->Disable();
405  } else {
406  FindWindow(ID_ADD_TEMPLATE)->Enable();
407  }
408 }

References assert.

◆ onTemplateSelection()

void TemplateListDialog::onTemplateSelection ( wxListEvent &  event)
private

Updates the slot list when the template selection changes.

Definition at line 273 of file TemplateListDialog.cc.

273  {
274  if (templateList_->GetSelectedItemCount() == 0) {
275  FindWindow(ID_DELETE_TEMPLATE)->Disable();
276  } else {
277  FindWindow(ID_DELETE_TEMPLATE)->Enable();
278  }
279  updateSlotList();
280 }

◆ selectedSlot()

string TemplateListDialog::selectedSlot ( )
private

Returns name of the selected slot.

Returns
Name of the selected slot.

Definition at line 337 of file TemplateListDialog.cc.

337  {
338  string name = WidgetTools::lcStringSelection(slotList_, 0);
339  return name;
340 }

References WidgetTools::lcStringSelection().

Here is the call graph for this function:

◆ selectedTemplate()

InstructionTemplate * TemplateListDialog::selectedTemplate ( )
private

Returns pointer to the selected InstructionTemplate.

Returns
Pointer to the selected InstructionTemplate.

Definition at line 316 of file TemplateListDialog.cc.

316  {
317  long item = -1;
318  item = templateList_->GetNextItem(
319  item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
320 
321  if (item < 0) {
322  return NULL;
323  }
324 
325  InstructionTemplate* temp =
327  return temp;
328 }

◆ setTexts()

void TemplateListDialog::setTexts ( )
private

Sets texts for widgets.

Definition at line 111 of file TemplateListDialog.cc.

111  {
114 
115  // Dialog title
116  format fmt = prodeTexts->text(
118  SetTitle(WxConversion::toWxString(fmt.str()));
119 
120  // buttons
121  WidgetTools::setLabel(generator, FindWindow(wxID_OK),
123 
124  WidgetTools::setLabel(generator, FindWindow(wxID_CANCEL),
126 
129 
132 
135 
138 
141 
144 
145  // widget labels
148 
149  // box sizer label
152 
155 
156  // Create instruction template list columns.
157  wxListCtrl* templateList =
158  dynamic_cast<wxListCtrl*>(FindWindow(ID_TEMPLATE_LIST));
159  fmt = prodeTexts->text(ProDeTextGenerator::TXT_COLUMN_NAME);
160  templateList->InsertColumn(0, WxConversion::toWxString(fmt.str()),
161  wxLIST_FORMAT_LEFT, 160);
162 
163  // Create template slot list columns.
164  wxListCtrl* slotList =
165  dynamic_cast<wxListCtrl*>(FindWindow(ID_SLOT_LIST));
166  fmt = prodeTexts->text(ProDeTextGenerator::TXT_COLUMN_SLOT);
167  slotList->InsertColumn(0, WxConversion::toWxString(fmt.str()),
168  wxLIST_FORMAT_LEFT, 100);
170  slotList->InsertColumn(1, WxConversion::toWxString(fmt.str()),
171  wxLIST_FORMAT_LEFT, 100);
172  fmt = prodeTexts->text(ProDeTextGenerator::TXT_COLUMN_WIDTH);
173  slotList->InsertColumn(2, WxConversion::toWxString(fmt.str()),
174  wxLIST_FORMAT_LEFT, 50);
175 
176 }

References GUITextGenerator::instance(), ProDeTextGenerator::instance(), WidgetTools::setLabel(), WidgetTools::setWidgetLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), GUITextGenerator::TXT_BUTTON_ADD, GUITextGenerator::TXT_BUTTON_ADD_DIALOG, GUITextGenerator::TXT_BUTTON_CANCEL, GUITextGenerator::TXT_BUTTON_DELETE, GUITextGenerator::TXT_BUTTON_EDIT_DIALOG, GUITextGenerator::TXT_BUTTON_HELP, GUITextGenerator::TXT_BUTTON_OK, ProDeTextGenerator::TXT_COLUMN_DESTINATION, ProDeTextGenerator::TXT_COLUMN_NAME, ProDeTextGenerator::TXT_COLUMN_SLOT, ProDeTextGenerator::TXT_COLUMN_WIDTH, ProDeTextGenerator::TXT_LABEL_NAME, ProDeTextGenerator::TXT_TEMPLATES_DIALOG_TITLE, ProDeTextGenerator::TXT_TEMPLATES_SLOTS_BOX, and ProDeTextGenerator::TXT_TEMPLATES_TEMPLATES_BOX.

Here is the call graph for this function:

◆ TransferDataToWindow()

bool TemplateListDialog::TransferDataToWindow ( )
privatevirtual

Transfers data from the machine to the dialog widgets.

Definition at line 183 of file TemplateListDialog.cc.

183  {
184 
185  // update template list
186  templateList_->DeleteAllItems();
189  for (int i = 0; i < navigator.count(); i++) {
190  templateList_->InsertItem(
191  i, WxConversion::toWxString(navigator.item(i)->name()));
192  }
193  updateSlotList();
194  return wxDialog::TransferDataToWindow();
195 }

References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), and WxConversion::toWxString().

Here is the call graph for this function:

◆ updateSlotList()

void TemplateListDialog::updateSlotList ( )
private

Updates the template slot list.

Definition at line 202 of file TemplateListDialog.cc.

202  {
203 
204 
205  slotList_->DeleteAllItems();
206  slotList_->Enable();
207 
209 
210  if (templ == NULL) {
211  FindWindow(ID_ADD_SLOT)->Disable();
212  return;
213  }
214 
215  FindWindow(ID_ADD_SLOT)->Enable();
216 
217  // Add bus slots.
218  Machine::BusNavigator busNavigator = machine_->busNavigator();
219  for (int i = 0; i < busNavigator.count(); i++) {
220  if (templ->usesSlot(busNavigator.item(i)->name())) {
221 
222  Bus* slot = busNavigator.item(i);
223  // Add slot name.
224  slotList_->InsertItem(
225  0, WxConversion::toWxString(slot->name()));
226 
227  // Add slot Destination.
228 
229  // Set slot destination.
230  wxString name = WxConversion::toWxString(
231  templ->destinationOfSlot(slot->name())->name());
232  slotList_->SetItem(0, 1, name);
233 
234  // Set slot width.
235  wxString width = WxConversion::toWxString(
236  templ->supportedWidth(slot->name()));
237  slotList_->SetItem(0, 2, width);
238  }
239  }
240 
241  // Add immediate slots.
242  Machine::ImmediateSlotNavigator immsNavigator =
244  for (int i = 0; i < immsNavigator.count(); i++) {
245  if (templ->usesSlot(immsNavigator.item(i)->name())) {
246 
247  ImmediateSlot* slot = immsNavigator.item(i);
248 
249  // Add slot name.
250  slotList_->InsertItem(
251  0, WxConversion::toWxString(slot->name()));
252 
253  // Set slot destination.
254  wxString name = WxConversion::toWxString(
255  templ->destinationOfSlot(slot->name())->name());
256  slotList_->SetItem(0, 1, name);
257 
258  // Set slot width.
259  wxString width = WxConversion::toWxString(
260  templ->supportedWidth(slot->name()));
261  slotList_->SetItem(0, 2, width);
262  }
263  }
264  wxListEvent dummy;
266 }

References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::InstructionTemplate::destinationOfSlot(), dummy, TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::name(), TTAMachine::InstructionTemplate::supportedWidth(), WxConversion::toWxString(), and TTAMachine::InstructionTemplate::usesSlot().

Here is the call graph for this function:

Member Data Documentation

◆ machine_

TTAMachine::Machine* TemplateListDialog::machine_
private

Parent machine of the instruction templates.

Definition at line 72 of file TemplateListDialog.hh.

◆ slotList_

wxListCtrl* TemplateListDialog::slotList_
private

Widget for list of slots in the selected template.

Definition at line 80 of file TemplateListDialog.hh.

◆ slotSizer_

wxStaticBoxSizer* TemplateListDialog::slotSizer_
private

Box sizer around the slot list.

Definition at line 76 of file TemplateListDialog.hh.

◆ templateList_

wxListCtrl* TemplateListDialog::templateList_
private

Widget for list of templates.

Definition at line 78 of file TemplateListDialog.hh.

◆ templateName_

wxString TemplateListDialog::templateName_
private

Name of the new template.

Definition at line 82 of file TemplateListDialog.hh.

◆ templateSizer_

wxStaticBoxSizer* TemplateListDialog::templateSizer_
private

Box sizer around the template list.

Definition at line 74 of file TemplateListDialog.hh.


The documentation for this class was generated from the following files:
WarningDialog
Definition: WarningDialog.hh:42
TemplateListDialog::setTexts
void setTexts()
Definition: TemplateListDialog.cc:111
TemplateListDialog::onTemplateSelection
void onTemplateSelection(wxListEvent &event)
Definition: TemplateListDialog.cc:273
WxConversion::toWxString
static wxString toWxString(const std::string &source)
TemplateListDialog::ID_ADD_SLOT
@ ID_ADD_SLOT
Definition: TemplateListDialog.hh:92
TemplateListDialog::selectedSlot
std::string selectedSlot()
Definition: TemplateListDialog.cc:337
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
TemplateListDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: TemplateListDialog.cc:505
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
TemplateListDialog::updateSlotList
void updateSlotList()
Definition: TemplateListDialog.cc:202
TemplateListDialog::templateSizer_
wxStaticBoxSizer * templateSizer_
Box sizer around the template list.
Definition: TemplateListDialog.hh:74
WidgetTools::setLabel
static void setLabel(Texts::TextGenerator *generator, wxWindow *widget, int textID)
Definition: WidgetTools.cc:92
TTAMachine::Bus
Definition: Bus.hh:53
GUITextGenerator::instance
static GUITextGenerator * instance()
Definition: GUITextGenerator.cc:67
TemplateListDialog::ID_DELETE_TEMPLATE
@ ID_DELETE_TEMPLATE
Definition: TemplateListDialog.hh:91
TemplateListDialog::machine_
TTAMachine::Machine * machine_
Parent machine of the instruction templates.
Definition: TemplateListDialog.hh:72
TemplateListDialog::slotSizer_
wxStaticBoxSizer * slotSizer_
Box sizer around the slot list.
Definition: TemplateListDialog.hh:76
TemplateListDialog::selectedTemplate
TTAMachine::InstructionTemplate * selectedTemplate()
Definition: TemplateListDialog.cc:316
GUITextGenerator
Definition: GUITextGenerator.hh:46
GUITextGenerator::TXT_BUTTON_HELP
@ TXT_BUTTON_HELP
Label for help button.
Definition: GUITextGenerator.hh:60
TemplateListDialog::ID_SLOT_LIST
@ ID_SLOT_LIST
Definition: TemplateListDialog.hh:87
FindWindow
Definition: FindWindow.hh:49
ProDeTextGenerator::TXT_COLUMN_WIDTH
@ TXT_COLUMN_WIDTH
Label for width column in a list.
Definition: ProDeTextGenerator.hh:109
TemplateListDialog::slotList_
wxListCtrl * slotList_
Widget for list of slots in the selected template.
Definition: TemplateListDialog.hh:80
TTAMachine::Machine::Navigator::count
int count() const
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
TemplateListDialog::ID_LABEL_NAME
@ ID_LABEL_NAME
Definition: TemplateListDialog.hh:96
ProDeTextGenerator
Definition: ProDeTextGenerator.hh:49
ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME
@ MSG_ERROR_ILLEGAL_NAME
Error: Illegal component name.
Definition: ProDeTextGenerator.hh:223
TemplateListDialog::ID_TEMPLATE_LIST
@ ID_TEMPLATE_LIST
Definition: TemplateListDialog.hh:86
ProDeTextGenerator::MSG_ERROR_SAME_NAME
@ MSG_ERROR_SAME_NAME
Error: Same name exists.
Definition: ProDeTextGenerator.hh:229
ProDeTextGenerator::TXT_TEMPLATES_SLOTS_BOX
@ TXT_TEMPLATES_SLOTS_BOX
Template Slots box title.
Definition: ProDeTextGenerator.hh:165
TemplateListDialog::ID_ADD_TEMPLATE
@ ID_ADD_TEMPLATE
Definition: TemplateListDialog.hh:90
ProDeTextGenerator::MSG_ERROR_NO_SLOTS_AVAILABLE
@ MSG_ERROR_NO_SLOTS_AVAILABLE
Error: No slots available for IT.
Definition: ProDeTextGenerator.hh:231
TTAMachine::InstructionTemplate
Definition: InstructionTemplate.hh:49
assert
#define assert(condition)
Definition: Application.hh:86
ProDeTextGenerator::COMP_A_TEMPLATE
@ COMP_A_TEMPLATE
Name for template (w/ article).
Definition: ProDeTextGenerator.hh:272
GUITextGenerator::TXT_BUTTON_CANCEL
@ TXT_BUTTON_CANCEL
Label for cancel button.
Definition: GUITextGenerator.hh:55
TemplateListDialog::ID_EDIT_SLOT
@ ID_EDIT_SLOT
Definition: TemplateListDialog.hh:93
TemplateListDialog::ID_LINE
@ ID_LINE
Definition: TemplateListDialog.hh:88
TTAMachine::Machine::immediateUnitNavigator
virtual ImmediateUnitNavigator immediateUnitNavigator() const
Definition: Machine.cc:416
ProDeTextGenerator::TXT_TEMPLATES_TEMPLATES_BOX
@ TXT_TEMPLATES_TEMPLATES_BOX
Instruction Templates bos title.
Definition: ProDeTextGenerator.hh:164
dummy
SimValue dummy(32)
a dummy simvalue which is given for operands that are not bound
ProDeTextGenerator::TXT_COLUMN_SLOT
@ TXT_COLUMN_SLOT
Label for slot column in a list.
Definition: ProDeTextGenerator.hh:115
TTAMachine::Machine::Navigator::hasItem
bool hasItem(const std::string &name) const
WidgetTools::lcStringSelection
static std::string lcStringSelection(wxListCtrl *list, int column)
Definition: WidgetTools.cc:108
ProDeTextGenerator::TXT_COLUMN_DESTINATION
@ TXT_COLUMN_DESTINATION
Label for destination column.
Definition: ProDeTextGenerator.hh:117
ProDeTextGenerator::COMP_TEMPLATE
@ COMP_TEMPLATE
Name for template (w/o article).
Definition: ProDeTextGenerator.hh:273
GUITextGenerator::TXT_BUTTON_ADD
@ TXT_BUTTON_ADD
Label for an add button.
Definition: GUITextGenerator.hh:53
ProDeTextGenerator::TXT_LABEL_NAME
@ TXT_LABEL_NAME
Label for component name widget.
Definition: ProDeTextGenerator.hh:56
TemplateSlotDialog
Definition: TemplateSlotDialog.hh:49
TTAMachine::InstructionTemplate::supportedWidth
virtual int supportedWidth() const
Definition: InstructionTemplate.cc:427
MachineTester::isValidComponentName
static bool isValidComponentName(const std::string &name)
Definition: MachineTester.cc:312
TemplateListDialog::ID_HELP
@ ID_HELP
Definition: TemplateListDialog.hh:89
TTAMachine::Machine::immediateSlotNavigator
virtual ImmediateSlotNavigator immediateSlotNavigator() const
Definition: Machine.cc:462
GUITextGenerator::TXT_BUTTON_DELETE
@ TXT_BUTTON_DELETE
Label for delete button.
Definition: GUITextGenerator.hh:56
ProDeTextGenerator::instance
static ProDeTextGenerator * instance()
Definition: ProDeTextGenerator.cc:382
GUITextGenerator::TXT_BUTTON_ADD_DIALOG
@ TXT_BUTTON_ADD_DIALOG
Label for add button (with trailing ...).
Definition: GUITextGenerator.hh:54
GUITextGenerator::TXT_BUTTON_EDIT_DIALOG
@ TXT_BUTTON_EDIT_DIALOG
Label for edit button (with trailing ...).
Definition: GUITextGenerator.hh:58
TemplateListDialog::templateList_
wxListCtrl * templateList_
Widget for list of templates.
Definition: TemplateListDialog.hh:78
TemplateListDialog::ID_DELETE_SLOT
@ ID_DELETE_SLOT
Definition: TemplateListDialog.hh:94
ProDeTextGenerator::TXT_TEMPLATES_DIALOG_TITLE
@ TXT_TEMPLATES_DIALOG_TITLE
Templates dialog title.
Definition: ProDeTextGenerator.hh:163
TTAMachine::Machine::busNavigator
virtual BusNavigator busNavigator() const
Definition: Machine.cc:356
TemplateListDialog::templateName_
wxString templateName_
Name of the new template.
Definition: TemplateListDialog.hh:82
ProDeTextGenerator::COMP_MACHINE
@ COMP_MACHINE
Text for machine description.
Definition: ProDeTextGenerator.hh:252
TTAMachine::Machine::Navigator::item
ComponentType * item(int index) const
WidgetTools::setWidgetLabel
static void setWidgetLabel(wxWindow *widget, std::string text)
Definition: WidgetTools.cc:52
InformationDialog
Definition: InformationDialog.hh:42
TTAMachine::InstructionTemplate::removeSlot
virtual void removeSlot(const std::string &slotName)
Definition: InstructionTemplate.cc:201
TTAMachine::Machine::instructionTemplateNavigator
virtual InstructionTemplateNavigator instructionTemplateNavigator() const
Definition: Machine.cc:428
ProDeTextGenerator::MSG_ERROR_NO_IMMEDIATE_UNITS
@ MSG_ERROR_NO_IMMEDIATE_UNITS
Error: No IUs for a template slot.
Definition: ProDeTextGenerator.hh:245
WxConversion::toString
static std::string toString(const wxString &source)
ProDeTextGenerator::TXT_COLUMN_NAME
@ TXT_COLUMN_NAME
Label for name column in a list.
Definition: ProDeTextGenerator.hh:105
TemplateListDialog::onSlotSelection
void onSlotSelection(wxListEvent &event)
Definition: TemplateListDialog.cc:287
TTAMachine::Machine::Navigator
Definition: Machine.hh:186
TemplateListDialog::ID_NAME
@ ID_NAME
Definition: TemplateListDialog.hh:95
TTAMachine::ImmediateSlot
Definition: ImmediateSlot.hh:44
TTAMachine::InstructionTemplate::usesSlot
virtual bool usesSlot(const std::string &slotName) const
Definition: InstructionTemplate.cc:265
TemplateListDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: TemplateListDialog.cc:183
TTAMachine::InstructionTemplate::destinationOfSlot
virtual ImmediateUnit * destinationOfSlot(const std::string &slotName) const
Definition: InstructionTemplate.cc:346
GUITextGenerator::TXT_BUTTON_OK
@ TXT_BUTTON_OK
Label for OK button.
Definition: GUITextGenerator.hh:59