OpenASIP  2.0
InputOperandDialog.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 InputOperandDialog.cc
26  *
27  * Definition of InputOperandDialog class.
28  *
29  * @author Jussi Nykänen 2004 (nykanen-no.spam-cs.tut.fi)
30  * @note rating: red.
31  */
32 
33 #include <wx/valgen.h>
34 #include <string>
35 #include <boost/format.hpp>
36 #include <vector>
37 
38 #include "InputOperandDialog.hh"
39 #include "WxConversion.hh"
40 #include "Conversion.hh"
41 #include "WidgetTools.hh"
42 #include "ObjectState.hh"
43 #include "OSEdConstants.hh"
44 #include "GUITextGenerator.hh"
45 #include "OSEdTextGenerator.hh"
46 #include "DialogPosition.hh"
47 #include "Operand.hh"
48 #include "SimValue.hh"
49 
50 using std::set;
51 using std::string;
52 using boost::format;
53 using std::vector;
54 
55 BEGIN_EVENT_TABLE(InputOperandDialog, wxDialog)
58 
59  EVT_CHOICE(ID_OPERATION_INPUT_TYPES, InputOperandDialog::onType)
60  EVT_SPINCTRL(ID_ELEMENT_WIDTH, InputOperandDialog::onElementWidth)
61  EVT_CHOICE(ID_ELEMENT_COUNT, InputOperandDialog::onElementCount)
62 
66 
68 
69 /**
70  * Constructor.
71  *
72  * @param parent The parent window.
73  * @param operand Operand to be added or modified.
74  * @param numberOfOperands The number of input operands.
75  */
77  wxWindow* parent,
78  Operand* operand,
79  int numberOfOperands,
80  int operandIndex) :
81  wxDialog(parent, -1, _T(""),
82  DialogPosition::getPosition(DialogPosition::DIALOG_INPUT_OPERAND)),
83  operand_(operand), numberOfOperands_(numberOfOperands),
84  index_(operandIndex) {
85 
86  memAddress_ = operand_->isAddress();
87  memData_ = operand_->isMemoryData();
88  createContents(this, true, true);
89 
90  swapList_ = dynamic_cast<wxListCtrl*>(FindWindow(ID_SWAP_LIST));
91  swapChoice_ = dynamic_cast<wxChoice*>(FindWindow(ID_OPERAND_CHOICE));
92 
93  inputTypesComboBox_ =
94  dynamic_cast<wxChoice*>(FindWindow(ID_OPERATION_INPUT_TYPES));
95 
96  elementWidthSpinCtrl_ =
97  dynamic_cast<wxSpinCtrl*>(FindWindow(ID_ELEMENT_WIDTH));
98 
99  elementCountChoice_ =
100  dynamic_cast<wxChoice*>(FindWindow(ID_ELEMENT_COUNT));
101 
102  FindWindow(ID_MEM_ADDRESS)->SetValidator(wxGenericValidator(&memAddress_));
103  FindWindow(ID_MEM_DATA)->SetValidator(wxGenericValidator(&memData_));
104 
105  FindWindow(wxID_OK)->SetFocus();
106 
107  canSwap_ = operand_->swap();
108 
109  inputTypes_.push_back(Operand::SINT_WORD_STRING);
110  inputTypes_.push_back(Operand::UINT_WORD_STRING);
111  inputTypes_.push_back(Operand::FLOAT_WORD_STRING);
112  inputTypes_.push_back(Operand::DOUBLE_WORD_STRING);
113  inputTypes_.push_back(Operand::HALF_FLOAT_WORD_STRING);
114  inputTypes_.push_back(Operand::BOOL_STRING);
115  inputTypes_.push_back(Operand::RAW_DATA_STRING);
116  inputTypes_.push_back(Operand::SLONG_WORD_STRING);
117  inputTypes_.push_back(Operand::ULONG_WORD_STRING);
118 
119  operandTypes_[0] = Operand::SINT_WORD;
120  operandTypes_[1] = Operand::UINT_WORD;
121  operandTypes_[2] = Operand::FLOAT_WORD;
122  operandTypes_[3] = Operand::DOUBLE_WORD;
123  operandTypes_[4] = Operand::HALF_FLOAT_WORD;
124  operandTypes_[5] = Operand::BOOL;
125  operandTypes_[6] = Operand::RAW_DATA;
126  operandTypes_[7] = Operand::SLONG_WORD;
127  operandTypes_[8] = Operand::ULONG_WORD;
128 
129  type_ = operand_->type();
130  elemWidth_ = operand_->elementWidth();
131  elemCount_ = operand_->elementCount();
132  updateTypes();
133  updateElementWidths();
134  updateElementCounts();
135 
136  setTexts();
137  }
138 
139 /**
140  * Destructor.
141  */
143  int x, y;
144  GetPosition(&x, &y);
145  wxPoint point(x, y);
147 }
148 
149 /**
150  * Set texts to widgets.
151  */
152 void
154 
157 
158  // title
159  format fmt =
161  fmt % index_;
162  SetTitle(WxConversion::toWxString(fmt.str()));
163 
164  // buttons
165  WidgetTools::setLabel(&guiText, FindWindow(wxID_OK),
167 
168  WidgetTools::setLabel(&guiText, FindWindow(wxID_CANCEL),
170 
173 
176 
177  // column names
179  swapList_->InsertColumn(
180  0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
182 
183  // check boxes
186 
189 
190  // sizer
193 }
194 
195 /**
196  * Event handler for operand type choice box.
197 **/
198 void
199 InputOperandDialog::onType(wxCommandEvent&) {
200 
201  type_ = inputTypesComboBox_->GetSelection();
202 
203  Operand::OperandType operType = static_cast<Operand::OperandType>(type_);
205  elemCount_ = 1;
208 }
209 
210 /**
211  * Event handler for element width spin ctrl.
212 **/
213 void
215  elemWidth_ = elementWidthSpinCtrl_->GetValue();
216  // update choice box list cells
218 }
219 
220 /**
221  * Event handler for element count choice box.
222 **/
223 void
225  // get the current choice box value and convert it to integer
226  int index = elementCountChoice_->GetSelection();
227  wxString number = elementCountChoice_->GetString(index);
228  long value;
229  if(!number.ToLong(&value)) {
230  elemCount_ = 1;
231  return;
232  }
233 
234  // save current choice
235  elemCount_ = static_cast<int>(value);
236  // update spin ctrl range
238 }
239 
240 /**
241  * Updates the type lists.
242 **/
243 void
245 
246  inputTypesComboBox_->Clear();
247 
248  for (unsigned int i = 0; i < inputTypes_.size(); i++) {
249  wxString oper = WxConversion::toWxString(inputTypes_.at(i));
250  inputTypesComboBox_->Append(oper);
251  }
252 
253  inputTypesComboBox_->SetSelection(type_);
254 }
255 
256 /**
257  * Updates the element width choice box list.
258 **/
259 void
261 
262  Operand::OperandType operType = static_cast<Operand::OperandType>(type_);
263 
264  if (operType == Operand::RAW_DATA) {
265  // element width for raw data can be arbitrary up to the max width
266  int elemWidth = 1;
267  int lastValidWidth = 1;
268  while (elemCount_*elemWidth <= SIMD_WORD_WIDTH) {
269  lastValidWidth = elemWidth;
270  elemWidth *= 2;
271  }
272 
273  // degrade current element width if it is too big
274  if (elemWidth_ > lastValidWidth) {
275  elemWidth_ = lastValidWidth;
276  }
277  elementWidthSpinCtrl_->SetRange(1, lastValidWidth);
279  } else if (operType == Operand::SINT_WORD || operType == Operand::UINT_WORD) {
280  // element width for integers is 8 to 32
281  elementWidthSpinCtrl_->SetRange(8, 32);
283  } else {
284  // element width for other types is their default type width
287  }
288 }
289 
290 /**
291  * Updates the element count choice box list.
292 **/
293 void
295 
296  elementCountChoice_->Clear();
297 
298  // update the list so that only shorter or equal than SIMD_WORD_WIDTH
299  // width*count combinations are listed
300  int elemCount = 1;
301  int elemCountIndex = 0;
302  while (elemCount*elemWidth_ <= SIMD_WORD_WIDTH) {
303  if (elemCount < elemCount_) {
304  ++elemCountIndex;
305  }
306  elementCountChoice_->Append(WxConversion::toWxString(elemCount));
307  elemCount *= 2;
308  }
309  elementCountChoice_->SetSelection(elemCountIndex);
310 }
311 
312 /**
313  * Transfers data to window.
314  *
315  * @return True if transfer is successful.
316  */
317 bool
319  updateList();
320  return wxWindow::TransferDataToWindow();
321 }
322 
323 /**
324  * Updates the list of can swap operands.
325  */
326 void
328 
329  swapList_->DeleteAllItems();
330  swapChoice_->Clear();
331 
332  set<int>::iterator it = canSwap_.begin();
333  int i = 0;
334  while (it != canSwap_.end()) {
335  wxString id = WxConversion::toWxString(*it);
336  swapList_->InsertItem(i, id);
337  i++;
338  it++;
339  }
340 
341  for (int i = 1; i <= numberOfOperands_; i++) {
342  if (i != index_ &&
343  swapList_->FindItem(-1, WxConversion::toWxString(i)) == -1) {
344 
346  }
347  }
348  swapChoice_->SetSelection(0);
349  if (swapChoice_->GetCount() == 0) {
350  FindWindow(ID_ADD_BUTTON)->Disable();
351  } else {
352  FindWindow(ID_ADD_BUTTON)->Enable();
353  }
354  wxListEvent dummy;
356 }
357 
358 /**
359  * Handles the event when id is added to can swap list.
360  */
361 void
363  wxString wxId = swapChoice_->GetStringSelection();
364  string id = WxConversion::toString(wxId);
365  canSwap_.insert(Conversion::toInt(id));
366  updateList();
367 }
368 
369 /**
370  * Handles the event when id is deleted from can swap list.
371  *
372  * It is also possible to delete multible ids from the list.
373  */
374 void
376 
377  vector<string> toBeDeleted;
378  long item = -1;
379  for (;;) {
380  item = swapList_->GetNextItem(
381  item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
382 
383  if (item == -1) {
384  break;
385  }
386 
387  wxListItem info;
388  info.SetId(item);
389  info.SetColumn(0);
390  swapList_->GetItem(info);
391  toBeDeleted.push_back(WxConversion::toString(info.GetText()));
392  }
393 
394  for (size_t i = 0; i < toBeDeleted.size(); i++) {
395  int id = Conversion::toInt(toBeDeleted[i]);
396  set<int>::iterator it = canSwap_.begin();
397  while (it != canSwap_.end()) {
398  if (*it == id) {
399  canSwap_.erase(it);
400  break;
401  }
402  it++;
403  }
404  }
405 
406  updateList();
407 }
408 
409 /**
410  * Handles the event when OK button is pushed.
411  */
412 void
413 InputOperandDialog::onOk(wxCommandEvent&) {
414  TransferDataFromWindow();
415  updateOperand();
416  EndModal(wxID_OK);
417 }
418 
419 /**
420  * Loads the properties to the modified/created operand.
421  */
422 void
424  ObjectState* root = new ObjectState("");
426 
427  int selected = inputTypesComboBox_->GetSelection();
428  Operand::OperandType type = operandTypes_[selected];
429 
430 
431  switch(type) {
432  case Operand::SINT_WORD:
434  break;
435  case Operand::UINT_WORD:
437  break;
438  case Operand::FLOAT_WORD:
440  break;
443  break;
445  root->setAttribute(
447  break;
448  case Operand::BOOL:
450  break;
451  case Operand::RAW_DATA:
452  root->setAttribute(
454  break;
455  case Operand::SLONG_WORD:
456  root->setAttribute(
458  break;
459  case Operand::ULONG_WORD:
460  root->setAttribute(
462  break;
463  default:
465  break;
466  }
467 
470 
473 
474  if (canSwap_.size() > 0) {
476  set<int>::iterator it = canSwap_.begin();
477  while (it != canSwap_.end()) {
478  ObjectState* swapChild = new ObjectState(Operand::OPRND_IN);
479  swapChild->setAttribute(Operand::OPRND_ID, *it);
480  swap->addChild(swapChild);
481  it++;
482  }
483  root->addChild(swap);
484  }
485 
486  operand_->loadState(root);
487  delete root;
488 }
489 
490 /**
491  *
492  */
493 void
495  if (swapList_->GetSelectedItemCount() == 0) {
496  FindWindow(ID_DELETE_BUTTON)->Disable();
497  } else {
498  FindWindow(ID_DELETE_BUTTON)->Enable();
499  }
500 }
501 
502 /**
503  * Creates the contents of dialog.
504  *
505  * NOTE! This function is generated by wxDesigner, that is why it is ugly.
506  *
507  * @param parent The parent window.
508  * @param call_fir If true, fits the contents of the dialog inside dialog.
509  * @param set_sizer If true, sets the main sizer as the contents of the dialog.
510  * @return The created sizer.
511  */
512 wxSizer*
513 InputOperandDialog::createContents(wxWindow *parent, bool call_fit, bool set_sizer)
514 {
515  wxBoxSizer *item0 = new wxBoxSizer(wxVERTICAL);
516 
517  wxBoxSizer *item1 = new wxBoxSizer(wxHORIZONTAL);
518 
519  wxString strs9[] = {
520  wxT("id: 1")
521  };
522 
523 
524  // ComboBox for input operand types
525  wxChoice *itemInputTypes = new wxChoice(parent, ID_OPERATION_INPUT_TYPES, wxDefaultPosition, wxSize(100,-1), 1, strs9);
526  item1->Add(itemInputTypes, 0, wxALIGN_CENTER|wxALL, 5);
527 
528  wxStaticText *itemTextWidth = new wxStaticText(parent, ID_TEXT_WIDTH, wxT("Element width:"), wxDefaultPosition, wxDefaultSize, 0);
529  item1->Add(itemTextWidth, 0, wxALIGN_CENTER|wxALL, 5);
530  wxSpinCtrl *itemElemWidth = new wxSpinCtrl(parent, ID_ELEMENT_WIDTH, wxT(""), wxDefaultPosition, wxSize(-1,-1), 1);
531  item1->Add(itemElemWidth, 0, wxALIGN_CENTER|wxALL, 5);
532  wxStaticText *itemTextCount = new wxStaticText(parent, ID_TEXT_COUNT, wxT("Element count:"), wxDefaultPosition, wxDefaultSize, 0);
533  item1->Add(itemTextCount, 0, wxALIGN_CENTER|wxALL, 5);
534  wxChoice *itemElemCount = new wxChoice(parent, ID_ELEMENT_COUNT, wxDefaultPosition, wxSize(70,-1), 1, strs9);
535  item1->Add(itemElemCount, 0, wxALIGN_CENTER|wxALL, 5);
536 
537  wxBoxSizer *item1b = new wxBoxSizer(wxHORIZONTAL);
538 
539  wxCheckBox *item2 = new wxCheckBox(parent, ID_MEM_ADDRESS, wxT("Memory address"), wxDefaultPosition, wxDefaultSize, 0);
540  item1b->Add(item2, 0, wxALIGN_CENTER|wxALL, 5);
541 
542  wxCheckBox *item3 = new wxCheckBox(parent, ID_MEM_DATA, wxT("Memory data"), wxDefaultPosition, wxDefaultSize, 0);
543  item1b->Add(item3, 0, wxALIGN_CENTER|wxALL, 5);
544 
545  item0->Add(item1, 0, wxALIGN_CENTER|wxALL, 5);
546  item0->Add(item1b, 0, wxALIGN_CENTER|wxALL, 5);
547 
548  wxStaticBox *item5 = new wxStaticBox(parent, -1, wxT("Can swap"));
549  wxStaticBoxSizer *item4 = new wxStaticBoxSizer(item5, wxVERTICAL);
550  swapSizer_ = item4;
551 
552  wxListCtrl *item6 = new wxListCtrl(parent, ID_SWAP_LIST, wxDefaultPosition, wxSize(160,120), wxLC_REPORT|wxSUNKEN_BORDER);
553  item4->Add(item6, 0, wxGROW|wxALL, 5);
554 
555  wxBoxSizer *item7 = new wxBoxSizer(wxHORIZONTAL);
556 
557  wxChoice *item8 = new wxChoice(parent, ID_OPERAND_CHOICE, wxDefaultPosition, wxSize(100,-1), 1, strs9, 0);
558  item7->Add(item8, 0, wxALIGN_CENTER|wxALL, 5);
559 
560  wxButton *item9 = new wxButton(parent, ID_ADD_BUTTON, wxT("Add"), wxDefaultPosition, wxDefaultSize, 0);
561  item7->Add(item9, 0, wxALIGN_CENTER|wxALL, 5);
562 
563  wxButton *item10 = new wxButton(parent, ID_DELETE_BUTTON, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0);
564  item7->Add(item10, 0, wxALIGN_CENTER|wxALL, 5);
565 
566  item4->Add(item7, 0, wxALIGN_CENTER|wxALL, 5);
567 
568  item0->Add(item4, 0, wxALIGN_CENTER|wxALL, 5);
569 
570  wxGridSizer *item11 = new wxGridSizer(2, 0, 0);
571 
572  item11->Add(20, 20, 0, wxALIGN_CENTER|wxALL, 5);
573 
574  wxBoxSizer *item12 = new wxBoxSizer(wxHORIZONTAL);
575 
576  wxButton *item13 = new wxButton(parent, wxID_OK, wxT("&OK"), wxDefaultPosition, wxDefaultSize, 0);
577  item12->Add(item13, 0, wxALIGN_CENTER|wxALL, 5);
578 
579  wxButton *item14 = new wxButton(parent, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0);
580  item12->Add(item14, 0, wxALIGN_CENTER|wxALL, 5);
581 
582  item11->Add(item12, 0, wxGROW|wxALL, 5);
583 
584  item0->Add(item11, 0, wxALIGN_CENTER|wxALL, 5);
585 
586  if (set_sizer) {
587  parent->SetSizer(item0);
588  if (call_fit)
589  item0->SetSizeHints(parent);
590  }
591 
592  return item0;
593 }
InputOperandDialog::onElementCount
void onElementCount(wxCommandEvent &event)
Definition: InputOperandDialog.cc:224
Operand
Definition: Operand.hh:52
InputOperandDialog::memData_
bool memData_
Flag indicating if operand is memory data.
Definition: InputOperandDialog.hh:108
InputOperandDialog::ID_OPERATION_INPUT_TYPES
@ ID_OPERATION_INPUT_TYPES
Definition: InputOperandDialog.hh:88
Operand::OPRND_ELEM_COUNT
static const std::string OPRND_ELEM_COUNT
Object state name for element count.
Definition: Operand.hh:100
InputOperandDialog::elemWidth_
int elemWidth_
Current element width in choice box.
Definition: InputOperandDialog.hh:124
Operand::OPRND_MEM_DATA
static const std::string OPRND_MEM_DATA
Object state name for memory data.
Definition: Operand.hh:90
OSEdConstants::DEFAULT_COLUMN_WIDTH
static const int DEFAULT_COLUMN_WIDTH
Default column width.
Definition: OSEdConstants.hh:113
InputOperandDialog::ID_ADD_BUTTON
@ ID_ADD_BUTTON
Definition: InputOperandDialog.hh:89
WxConversion::toWxString
static wxString toWxString(const std::string &source)
InputOperandDialog::canSwap_
std::set< int > canSwap_
Operands that can be swapped with this operand.
Definition: InputOperandDialog.hh:116
Operand::BOOL
@ BOOL
Definition: Operand.hh:64
Operand::SINT_WORD_STRING
static const std::string SINT_WORD_STRING
Definition: Operand.hh:72
InputOperandDialog::swapSizer_
wxStaticBoxSizer * swapSizer_
Pointer to can swap sizer.
Definition: InputOperandDialog.hh:102
Operand::SLONG_WORD_STRING
static const std::string SLONG_WORD_STRING
Definition: Operand.hh:70
InputOperandDialog::numberOfOperands_
int numberOfOperands_
Numberof input operands.
Definition: InputOperandDialog.hh:118
Operand::OPRND_MEM_ADDRESS
static const std::string OPRND_MEM_ADDRESS
Object state name for memory address.
Definition: Operand.hh:86
Operand::OperandType
OperandType
Definition: Operand.hh:58
Operand::HALF_FLOAT_WORD
@ HALF_FLOAT_WORD
Definition: Operand.hh:63
InputOperandDialog::ID_DELETE_BUTTON
@ ID_DELETE_BUTTON
Definition: InputOperandDialog.hh:90
InputOperandDialog::inputTypesComboBox_
wxChoice * inputTypesComboBox_
Choice box for operation input types.
Definition: InputOperandDialog.hh:110
WidgetTools::setLabel
static void setLabel(Texts::TextGenerator *generator, wxWindow *widget, int textID)
Definition: WidgetTools.cc:92
GUITextGenerator::instance
static GUITextGenerator * instance()
Definition: GUITextGenerator.cc:67
InputOperandDialog::~InputOperandDialog
virtual ~InputOperandDialog()
Definition: InputOperandDialog.cc:142
Operand::UINT_WORD
@ UINT_WORD
Definition: Operand.hh:60
InputOperandDialog::updateOperand
void updateOperand()
Definition: InputOperandDialog.cc:423
InputOperandDialog::onSelection
void onSelection(wxListEvent &event)
Definition: InputOperandDialog.cc:494
Operand::OPRND_CAN_SWAP
static const std::string OPRND_CAN_SWAP
Object state name for can swap.
Definition: Operand.hh:92
GUITextGenerator
Definition: GUITextGenerator.hh:46
InputOperandDialog::type_
int type_
Current operand type in choice box.
Definition: InputOperandDialog.hh:122
InputOperandDialog::ID_MEM_ADDRESS
@ ID_MEM_ADDRESS
Definition: InputOperandDialog.hh:84
ObjectState
Definition: ObjectState.hh:59
WidgetTools.hh
FindWindow
Definition: FindWindow.hh:49
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
InputOperandDialog::operand_
Operand * operand_
Operand to be created or modified.
Definition: InputOperandDialog.hh:104
DialogPosition::setPosition
static void setPosition(Dialogs dialog, wxPoint point)
Definition: DialogPosition.cc:63
InputOperandDialog::onDeleteSwap
void onDeleteSwap(wxCommandEvent &event)
Definition: InputOperandDialog.cc:375
Operand::RAW_DATA_STRING
static const std::string RAW_DATA_STRING
Definition: Operand.hh:78
InputOperandDialog::ID_TEXT_COUNT
@ ID_TEXT_COUNT
Definition: InputOperandDialog.hh:94
OSEdConstants.hh
InputOperandDialog::updateElementWidths
void updateElementWidths()
Definition: InputOperandDialog.cc:260
Operand::HALF_FLOAT_WORD_STRING
static const std::string HALF_FLOAT_WORD_STRING
Definition: Operand.hh:74
Operand::FLOAT_WORD_STRING
static const std::string FLOAT_WORD_STRING
Definition: Operand.hh:75
InputOperandDialog::ID_ELEMENT_COUNT
@ ID_ELEMENT_COUNT
Definition: InputOperandDialog.hh:92
OSEdTextGenerator::TXT_BOX_CAN_SWAP
@ TXT_BOX_CAN_SWAP
Can swap sizer label.
Definition: OSEdTextGenerator.hh:127
GUITextGenerator::TXT_BUTTON_CANCEL
@ TXT_BUTTON_CANCEL
Label for cancel button.
Definition: GUITextGenerator.hh:55
Operand::OPRND_ID
static const std::string OPRND_ID
Object state name for operand id.
Definition: Operand.hh:82
InputOperandDialog::swapList_
wxListCtrl * swapList_
List of can swap operands.
Definition: InputOperandDialog.hh:98
InputOperandDialog::elementCountChoice_
wxChoice * elementCountChoice_
Choice box for operand element count.
Definition: InputOperandDialog.hh:114
InputOperandDialog::ID_OPERAND_CHOICE
@ ID_OPERAND_CHOICE
Definition: InputOperandDialog.hh:87
Conversion.hh
Operand::SLONG_WORD
@ SLONG_WORD
Definition: Operand.hh:66
Operand::DOUBLE_WORD_STRING
static const std::string DOUBLE_WORD_STRING
Definition: Operand.hh:76
InputOperandDialog.hh
dummy
SimValue dummy(32)
a dummy simvalue which is given for operands that are not bound
DialogPosition::DIALOG_INPUT_OPERAND
@ DIALOG_INPUT_OPERAND
Input operand dialog.
Definition: DialogPosition.hh:50
ObjectState.hh
Operand::FLOAT_WORD
@ FLOAT_WORD
Definition: Operand.hh:61
Operand::UINT_WORD_STRING
static const std::string UINT_WORD_STRING
Definition: Operand.hh:73
InputOperandDialog
Definition: InputOperandDialog.hh:47
GUITextGenerator::TXT_BUTTON_ADD
@ TXT_BUTTON_ADD
Label for an add button.
Definition: GUITextGenerator.hh:53
InputOperandDialog::onElementWidth
void onElementWidth(wxSpinEvent &event)
Definition: InputOperandDialog.cc:214
ObjectState::addChild
void addChild(ObjectState *child)
Definition: ObjectState.cc:376
InputOperandDialog::onType
void onType(wxCommandEvent &event)
Definition: InputOperandDialog.cc:199
DialogPosition
Definition: DialogPosition.hh:42
Operand::SINT_WORD
@ SINT_WORD
Definition: Operand.hh:59
Operand::OPRND_IN
static const std::string OPRND_IN
Object state name for input operand.
Definition: Operand.hh:94
InputOperandDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: InputOperandDialog.cc:318
InputOperandDialog::ID_SWAP_LIST
@ ID_SWAP_LIST
Definition: InputOperandDialog.hh:86
Operand::ULONG_WORD
@ ULONG_WORD
Definition: Operand.hh:67
InputOperandDialog::updateList
void updateList()
Definition: InputOperandDialog.cc:327
Operand::RAW_DATA
@ RAW_DATA
Definition: Operand.hh:65
InputOperandDialog::inputTypes_
std::vector< std::string > inputTypes_
Input types.
Definition: InputOperandDialog.hh:129
EVT_LIST_ITEM_SELECTED
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
InputOperandDialog::ID_MEM_DATA
@ ID_MEM_DATA
Definition: InputOperandDialog.hh:85
InputOperandDialog::updateElementCounts
void updateElementCounts()
Definition: InputOperandDialog.cc:294
GUITextGenerator::TXT_BUTTON_DELETE
@ TXT_BUTTON_DELETE
Label for delete button.
Definition: GUITextGenerator.hh:56
OSEdTextGenerator::TXT_INPUT_OPERAND_DIALOG_TITLE
@ TXT_INPUT_OPERAND_DIALOG_TITLE
Input operand dialog title.
Definition: OSEdTextGenerator.hh:110
GUITextGenerator.hh
Operand.hh
Operand::OPRND_TYPE
static const std::string OPRND_TYPE
Object state name for operand type.
Definition: Operand.hh:84
Operand::DOUBLE_WORD
@ DOUBLE_WORD
Definition: Operand.hh:62
InputOperandDialog::operandTypes_
Operand::OperandType operandTypes_[9]
Definition: InputOperandDialog.hh:131
InputOperandDialog::ID_ELEMENT_WIDTH
@ ID_ELEMENT_WIDTH
Definition: InputOperandDialog.hh:91
Operand::OPRND_ELEM_WIDTH
static const std::string OPRND_ELEM_WIDTH
Object state name for element width.
Definition: Operand.hh:98
EVT_LIST_ITEM_DESELECTED
FUImplementationDialog::onAddExternalPort FUImplementationDialog::onDeleteExternalPort FUImplementationDialog::onArchPortSelection EVT_LIST_ITEM_DESELECTED(ID_ARCH_PORT_LIST, FUImplementationDialog::onArchPortSelection) EVT_LIST_ITEM_ACTIVATED(ID_ARCH_PORT_LIST
EVT_BUTTON
EVT_BUTTON(ID_EDIT_ARCH_PORT, FUImplementationDialog::onEditArchitecturePort) EVT_BUTTON(ID_ADD_EXTERNAL_PORT
InputOperandDialog::onOk
void onOk(wxCommandEvent &event)
Definition: InputOperandDialog.cc:413
InputOperandDialog::memAddress_
bool memAddress_
Flag indicating if operand is memory address.
Definition: InputOperandDialog.hh:106
SimValue.hh
InputOperandDialog::setTexts
void setTexts()
Definition: InputOperandDialog.cc:153
OSEdTextGenerator::instance
static OSEdTextGenerator & instance()
Definition: OSEdTextGenerator.cc:214
InputOperandDialog::updateTypes
void updateTypes()
Definition: InputOperandDialog.cc:244
OSEdTextGenerator::TXT_COLUMN_OPERAND
@ TXT_COLUMN_OPERAND
Operand column header.
Definition: OSEdTextGenerator.hh:97
Operand::BOOL_STRING
static const std::string BOOL_STRING
Definition: Operand.hh:77
OSEdTextGenerator
Definition: OSEdTextGenerator.hh:42
WxConversion.hh
WidgetTools::setWidgetLabel
static void setWidgetLabel(wxWindow *widget, std::string text)
Definition: WidgetTools.cc:52
Conversion::toInt
static int toInt(const T &source)
InputOperandDialog::onAddSwap
void onAddSwap(wxCommandEvent &event)
Definition: InputOperandDialog.cc:362
InputOperandDialog::elementWidthSpinCtrl_
wxSpinCtrl * elementWidthSpinCtrl_
Spin ctrl for operand element width.
Definition: InputOperandDialog.hh:112
WxConversion::toString
static std::string toString(const wxString &source)
InputOperandDialog::elemCount_
int elemCount_
Current element count in choice box.
Definition: InputOperandDialog.hh:126
OSEdTextGenerator.hh
SIMD_WORD_WIDTH
#define SIMD_WORD_WIDTH
Definition: SimValue.hh:42
OSEdTextGenerator::TXT_CHECKBOX_MEM_ADDRESS
@ TXT_CHECKBOX_MEM_ADDRESS
Memory address label.
Definition: OSEdTextGenerator.hh:93
InputOperandDialog::swapChoice_
wxChoice * swapChoice_
Choice list for can swap operands.
Definition: InputOperandDialog.hh:100
Operand::ULONG_WORD_STRING
static const std::string ULONG_WORD_STRING
Definition: Operand.hh:71
Operand::defaultElementWidth
static int defaultElementWidth(OperandType type)
Definition: Operand.cc:557
InputOperandDialog::ID_TEXT_WIDTH
@ ID_TEXT_WIDTH
Definition: InputOperandDialog.hh:93
END_EVENT_TABLE
END_EVENT_TABLE() using namespace IDF
ObjectState::setAttribute
void setAttribute(const std::string &name, const std::string &value)
Definition: ObjectState.cc:100
Operand::loadState
virtual void loadState(const ObjectState *state)
Definition: Operand.cc:383
InputOperandDialog::index_
int index_
Index of the input operand currently modified.
Definition: InputOperandDialog.hh:120
InputOperandDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: InputOperandDialog.cc:513
GUITextGenerator::TXT_BUTTON_OK
@ TXT_BUTTON_OK
Label for OK button.
Definition: GUITextGenerator.hh:59
DialogPosition.hh
OSEdTextGenerator::TXT_CHECKBOX_MEM_DATA
@ TXT_CHECKBOX_MEM_DATA
Memory data label.
Definition: OSEdTextGenerator.hh:92