OpenASIP  2.0
OperationPropertyDialog.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 OperationPropertyDialog.cc
26  *
27  * Declaration of OperationProperty class.
28  *
29  * @author Jussi Nykänen 2004 (nykanen-no.spam-cs.tut.fi)
30  * @author Mikael Lepistö 2007 (mikael.lepisto-no.spam-cs.tut.fi)
31  * @author Tero Ryynänen 2008 (tero.ryynanen-no.spam-tut.fi)
32  * @note rating: red
33  */
34 
35 #include <wx/valgen.h>
36 #include <boost/format.hpp>
37 #include <fstream>
38 #include <iostream>
39 #include <string>
40 
42 #include "OperationDAGDialog.hh"
43 #include "OperationContainer.hh"
44 #include "WxConversion.hh"
45 #include "WidgetTools.hh"
46 #include "InputOperandDialog.hh"
47 #include "OutputOperandDialog.hh"
48 #include "OSEdConstants.hh"
49 #include "Application.hh"
50 #include "GUITextGenerator.hh"
51 #include "OSEdTextGenerator.hh"
52 #include "ErrorDialog.hh"
53 #include "ConfirmDialog.hh"
54 #include "CommandThread.hh"
55 #include "DialogPosition.hh"
56 #include "OSEd.hh"
57 #include "StringTools.hh"
58 #include "OperationIndex.hh"
59 #include "Operation.hh"
60 #include "Operand.hh"
61 #include "OperationModule.hh"
62 #include "ObjectState.hh"
63 #include "WarningDialog.hh"
64 #include "OperationDAG.hh"
65 #include "TCEString.hh"
66 #include "FileSystem.hh"
67 #include "OperationBehavior.hh"
68 #include "OSEdOptions.hh"
69 
70 using std::string;
71 using std::vector;
72 using std::ifstream;
73 using boost::format;
74 
75 BEGIN_EVENT_TABLE(OperationPropertyDialog, wxDialog)
78 
81 
84 
87 
90 
92  EVT_BUTTON(ID_AFFECTS_DELETE_BUTTON, OperationPropertyDialog::onDeleteAffects)
93 
97 
101 
104 
107 
111 
113 
114 /**
115  * Constructor.
116  *
117  * @param parent The parent window.
118  * @param op Operation to be created or modified.
119  * @param module Module in which operation belongs to.
120  * @param path Path in which module belongs to.
121  */
123  wxWindow* parent,
124  Operation* op,
125  OperationModule& module,
126  const std::string& path) :
127  wxDialog(
128  parent, -1, _T(""),
129  DialogPosition::getPosition(DialogPosition::DIALOG_PROPERTIES),
130  wxDefaultSize, wxRESIZE_BORDER),
131  operation_(op), name_(_T("")), module_(module), path_(path),
132  operationWasCreatedHere_(false) {
133 
134  createContents(this, true, true);
135 
136  affectedByList_ = dynamic_cast<wxListCtrl*>(FindWindow(ID_AFFECTED_BY));
137  affectsList_ = dynamic_cast<wxListCtrl*>(FindWindow(ID_AFFECTS));
138  inputOperandList_ =
139  dynamic_cast<wxListCtrl*>(FindWindow(ID_INPUT_OPERANDS));
140  outputOperandList_ =
141  dynamic_cast<wxListCtrl*>(FindWindow(ID_OUTPUT_OPERANDS));
142  affectedByChoice_ =
143  dynamic_cast<wxComboBox*>(FindWindow(ID_OPERATION_AFFECTED_BY));
144  affectsChoice_ =
145  dynamic_cast<wxComboBox*>(FindWindow(ID_OPERATION_AFFECTS));
146  readMemoryCB_ = dynamic_cast<wxCheckBox*>(FindWindow(ID_READS_MEMORY));
147  writeMemoryCB_ = dynamic_cast<wxCheckBox*>(FindWindow(ID_WRITES_MEMORY));
148  canTrapCB_ = dynamic_cast<wxCheckBox*>(FindWindow(ID_CAN_TRAP));
149  sideEffectsCB_ =
150  dynamic_cast<wxCheckBox*>(FindWindow(ID_HAS_SIDE_EFFECTS));
151  clockedCB_ =
152  dynamic_cast<wxCheckBox*>(FindWindow(ID_CLOCKED));
153 
154  editDescription_ = dynamic_cast<wxTextCtrl*>(FindWindow(ID_EDIT_DESCRIPTION));
155 
156  FindWindow(ID_NAME)->SetValidator(
157  wxTextValidator(wxFILTER_ASCII, &name_));
158 
159  FindWindow(ID_READS_MEMORY)->SetValidator(
160  wxGenericValidator(&readMemory_));
161 
162  FindWindow(ID_WRITES_MEMORY)->SetValidator(
163  wxGenericValidator(&writeMemory_));
164 
165  FindWindow(ID_CAN_TRAP)->SetValidator(wxGenericValidator(&canTrap_));
166 
167  FindWindow(ID_HAS_SIDE_EFFECTS)->SetValidator(
168  wxGenericValidator(&hasSideEffects_));
169 
170  FindWindow(ID_CLOCKED)->SetValidator(
171  wxGenericValidator(&clocked_));
172 
173  // set OK button as default choice
174  FindWindow(ID_OK_BUTTON)->SetFocus();
175 
176  if (operation_ != NULL) {
177  for (int i = 1; i <= operation_->numberOfInputs(); i++) {
178  Operand* op = new Operand(operation_->operand(i));
179  inputOperands_.push_back(op);
180  }
181 
182  for (int i = operation_->numberOfInputs() + 1;
183  i <= operation_->numberOfInputs() + operation_->numberOfOutputs(); i++) {
184 
185  Operand* op = new Operand(operation_->operand(i));
186  outputOperands_.push_back(op);
187  }
188 
189  for (int i = 0; i < operation_->affectsCount(); i++) {
190  affects_.push_back(operation_->affects(i));
191  }
192 
193  for (int i = 0; i < operation_->affectedByCount(); i++) {
194  affectedBy_.push_back(operation_->affectedBy(i));
195  }
196  } else {
197  operation_ = new Operation("", NullOperationBehavior::instance());
198  operationWasCreatedHere_ = true;
199  }
200 
201  orig_ = operation_->saveState(); // save original operation's state
202 
203  setTexts();
204 }
205 
206 /**
207  * Destructor.
208  */
210 
211  for (unsigned int i = 0; i < inputOperands_.size(); i++) {
212  delete inputOperands_[i];
213  }
214 
215  for (unsigned int i = 0; i < outputOperands_.size(); i++) {
216  delete outputOperands_[i];
217  }
218 
219  int x, y;
220  GetPosition(&x, &y);
221  wxPoint point(x, y);
223 
225  delete operation_;
226  operation_ = NULL;
227  }
228 }
229 
230 /**
231  * Returns operation object of dialog.
232  *
233  * @return Operation object of dialog.
234  */
235 Operation*
237  return operation_;
238 }
239 
240 /**
241  * Set texts to all widgets.
242  */
243 void
245 
248 
249  // title
250  format fmt = osedText.text(OSEdTextGenerator::TXT_PROPERTY_DIALOG_TITLE);
251  SetTitle(WxConversion::toWxString(fmt.str()));
252 
255 
256  // buttons
259 
260  WidgetTools::setLabel(&guiText, FindWindow(wxID_CANCEL),
262 
265 
268 
271 
274 
277 
280 
283 
286 
289 
292 
295 
296 
298 
299  // column titles
301  affectedByList_->InsertColumn(
302  0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
304 
305  affectsList_->InsertColumn(
306  0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
308 
310 
311  inputOperandList_->InsertColumn(
312  0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
313  110);
314 
316 
317  inputOperandList_->InsertColumn(
318  0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
319  110);
320 
322 
323  inputOperandList_->InsertColumn(
324  0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
325  110);
326 
328 
329  inputOperandList_->InsertColumn(
330  0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
331  70);
332 
334 
335  outputOperandList_->InsertColumn(
336  0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
337  110);
338 
340 
341  outputOperandList_->InsertColumn(
342  0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
343  110);
344 
346 
347  outputOperandList_->InsertColumn(
348  0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
349  110);
350 
352 
353  outputOperandList_->InsertColumn(
354  0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
355  70);
356 
357  // check boxes
360 
363 
366 
369 
372 
373  // box sizers
376 
379 
382 
385 
386 
387 }
388 
389 /**
390  * Sets the has behavior label.
391  */
392 void
395  if (module_.hasBehaviorSource()) {
398  } else {
401  }
402 }
403 
404 /**
405  * Transfers data to window.
406  *
407  * @return True if transfer is successful.
408  */
409 bool
411  if (operation_ != NULL) {
413  editDescription_->Clear();
423  updateOperands();
424  updateAffected();
425  } else {
426  readMemory_ = false;
427  writeMemory_ = false;
428  canTrap_ = false;
429  hasSideEffects_ = false;
430  clocked_ = false;
431  controlFlow_ = false;
432  isCall_ = false;
433  isBranch_ = false;
434  }
435 
436  return wxWindow::TransferDataToWindow();
437 }
438 
439 /**
440  * Updates the operand lists.
441  */
442 void
444 
445  inputOperandList_->DeleteAllItems();
446  outputOperandList_->DeleteAllItems();
447 
448  for (unsigned int i = 0; i < inputOperands_.size(); i++) {
449  wxString id = WxConversion::toWxString(i + 1);
450  inputOperandList_->InsertItem(i, id);
451  std::string type = inputOperands_.at(i)->typeString();
452  inputOperandList_->SetItem(i, 1, WxConversion::toWxString(type));
453  std::string elemWidth = Conversion::toString(
454  inputOperands_.at(i)->elementWidth());
455  inputOperandList_->SetItem(i, 2, WxConversion::toWxString(elemWidth));
456  std::string elemCount = Conversion::toString(
457  inputOperands_.at(i)->elementCount());
458  inputOperandList_->SetItem(i, 3, WxConversion::toWxString(elemCount));
459  }
460  int k = 0;
461  for (unsigned int i = inputOperands_.size() + 1;
462  i <= inputOperands_.size() + outputOperands_.size(); i++) {
463 
464  wxString id = WxConversion::toWxString(i);
465  outputOperandList_->InsertItem(k, id);
466  std::string type = outputOperands_.at(k)->typeString();
467  outputOperandList_->SetItem(k, 1, WxConversion::toWxString(type));
468  std::string elemWidth = Conversion::toString(
469  outputOperands_.at(k)->elementWidth());
470  outputOperandList_->SetItem(k, 2, WxConversion::toWxString(elemWidth));
471  std::string elemCount = Conversion::toString(
472  outputOperands_.at(k)->elementCount());
473  outputOperandList_->SetItem(k, 3, WxConversion::toWxString(elemCount));
474  k++;
475  }
476 
477  wxListEvent dummy;
479 }
480 
481 /**
482  * Updates the affects and affected by lists.
483  */
484 void
486 
487  affectedByList_->DeleteAllItems();
488  affectsList_->DeleteAllItems();
489 
490  for (unsigned int i = 0; i < affectedBy_.size(); i++) {
491  wxString oper = WxConversion::toWxString(affectedBy_[i]);
492  affectedByList_->InsertItem(i, oper);
493  }
494 
495  for (unsigned int i = 0; i < affects_.size(); i++) {
496  wxString oper = WxConversion::toWxString(affects_[i]);
497  affectsList_->InsertItem(i, oper);
498  }
499 
501  affectsChoice_->Clear();
502  affectedByChoice_->Clear();
503  for (int i = 0; i < index.pathCount(); i++) {
504  string path = index.path(i);
505  int modules = index.moduleCount(path);
506  for (int j = 0; j < modules; j++) {
507  OperationModule& module = index.module(j, path);
508  int operations = 0;
509  try {
510  operations = index.operationCount(module);
511  } catch (const Exception& e) {
512  continue;
513  }
514  for (int k = 0; k < operations; k++) {
515  string name = index.operationName(k, module);
516  if (affectsList_->
517  FindItem(-1, WxConversion::toWxString(name)) == -1) {
518 
520  }
521  if (affectedByList_->
522  FindItem(-1, WxConversion::toWxString(name)) == -1) {
523 
525  }
526  }
527 
528  }
529  }
530  affectsChoice_->SetSelection(0);
531  affectedByChoice_->SetSelection(0);
532 
533  if (affectsChoice_->GetCount() == 0) {
534  FindWindow(ID_AFFECTS_ADD_BUTTON)->Disable();
535  } else {
537  }
538 
539  if (affectedByChoice_->GetCount() == 0) {
541  } else {
543  }
544 
545  wxListEvent dummy;
547 }
548 
549 
550 /**
551  * Handles the event when an item is selected from a list.
552  *
553  * Item selection affects statuses of several buttons.
554  */
555 void
557 
558  if (affectedByList_->GetSelectedItemCount() < 1) {
560  } else {
562  }
563 
564  if (affectsList_->GetSelectedItemCount() < 1) {
566  } else {
568  }
569 
570  if (inputOperandList_->GetSelectedItemCount() < 1) {
572  } else {
574  }
575 
576  if (outputOperandList_->GetSelectedItemCount() < 1) {
578  } else {
580  }
581 
582  if (inputOperandList_->GetSelectedItemCount() != 1) {
584  FindWindow(ID_INPUT_UP_BUTTON)->Disable();
585  FindWindow(ID_INPUT_DOWN_BUTTON)->Disable();
586  } else {
588 
590  int id = Conversion::toInt(idString);
591 
592  if (id != 1) {
593  FindWindow(ID_INPUT_UP_BUTTON)->Enable();
594  } else {
595  FindWindow(ID_INPUT_UP_BUTTON)->Disable();
596  }
597 
598  if (id != static_cast<int>(inputOperands_.size())) {
599  FindWindow(ID_INPUT_DOWN_BUTTON)->Enable();
600  } else {
601  FindWindow(ID_INPUT_DOWN_BUTTON)->Disable();
602  }
603  }
604 
605  if (outputOperandList_->GetSelectedItemCount() != 1) {
607  FindWindow(ID_OUTPUT_UP_BUTTON)->Disable();
608  FindWindow(ID_OUTPUT_DOWN_BUTTON)->Disable();
609  } else {
611 
613  int id = Conversion::toInt(idString);
614 
615  if (id != static_cast<int>(inputOperands_.size()) + 1) {
616  FindWindow(ID_OUTPUT_UP_BUTTON)->Enable();
617  } else {
618  FindWindow(ID_OUTPUT_UP_BUTTON)->Disable();
619  }
620 
621  if (id != static_cast<int>(inputOperands_.size()) +
622  static_cast<int>(outputOperands_.size())) {
624  } else {
625  FindWindow(ID_OUTPUT_DOWN_BUTTON)->Disable();
626  }
627  }
628 }
629 
630 /**
631  * Handles adding new item to affected by list.
632  */
633 void
635 
636  wxString name = affectedByChoice_->GetValue();
638 
640  format fmt = texts.text(
642  fmt % name;
643  ErrorDialog dialog(this, WxConversion::toWxString(fmt.str()));
644  dialog.ShowModal();
645  } else {
646  affectedBy_.push_back(WxConversion::toString(name));
647  updateAffected();
648  }
649 }
650 
651 /**
652  * Handles deleting an item from affected by list.
653  */
654 void
656 
657  vector<string> toBeDeleted = getSelectedItems(affectedByList_);
658 
659  for (size_t i = 0; i < toBeDeleted.size(); i++) {
660  vector<string>::iterator it = affectedBy_.begin();
661  while (it != affectedBy_.end()) {
662  if (*it == toBeDeleted[i]) {
663  affectedBy_.erase(it);
664  break;
665  }
666  it++;
667  }
668  }
669  updateAffected();
670 }
671 
672 /**
673  * Handles event of adding new item to affects list.
674  */
675 void
677 
678  wxString name = affectsChoice_->GetValue();
680 
682  format fmt = texts.text(
684  fmt % name;
685  ErrorDialog dialog(this, WxConversion::toWxString(fmt.str()));
686  dialog.ShowModal();
687  } else {
688  affects_.push_back(WxConversion::toString(name));
689  updateAffected();
690  }
691 }
692 
693 /**
694  * Handles event of deleting item from affects list.
695  */
696 void
698 
699  vector<string> toBeDeleted = getSelectedItems(affectsList_);
700 
701  for (size_t i = 0; i < toBeDeleted.size(); i++) {
702  vector<string>::iterator it = affects_.begin();
703  while (it != affects_.end()) {
704  if (*it == toBeDeleted[i]) {
705  affects_.erase(it);
706  break;
707  }
708  it++;
709  }
710  }
711  updateAffected();
712 }
713 
714 /**
715  * Handles event for adding new operand to input operand list.
716  */
717 void
719  Operand* input =
720  new Operand(true, inputOperands_.size() + 1, Operand::SINT_WORD);
721 
722  InputOperandDialog dialog(
723  this, input, inputOperands_.size(), inputOperands_.size() + 1);
724 
725  if (dialog.ShowModal() == wxID_OK) {
726  inputOperands_.push_back(input);
727  updateOperands();
728  } else {
729  delete input;
730  }
731  updateOperands();
732 }
733 
734 /**
735  * Handles the event for modifying input operand.
736  */
737 void
740  int id = Conversion::toInt(idString);
741  Operand* operand = NULL;
742  operand = inputOperands_[id - 1];
743  assert(operand != NULL);
744  InputOperandDialog dialog(this, operand, inputOperands_.size(), id);
745  dialog.ShowModal();
746  updateOperands();
747 }
748 
749 /**
750  * Handles the event of deleting input operand.
751  */
752 void
754 
755  vector<string> toBeDeleted = getSelectedItems(inputOperandList_);
756  size_t i = 0;
757  vector<Operand*>::iterator it = inputOperands_.begin();
758  int index = 1;
759 
760  updateSwapLists(toBeDeleted);
761  while (it != inputOperands_.end() && i < toBeDeleted.size()) {
762  int id = Conversion::toInt(toBeDeleted[i]);
763  while (index < id) {
764  it++;
765  index++;
766  }
767  delete *it;
768  it = inputOperands_.erase(it);
769  index++;
770  i++;
771  }
772  updateOperands();
773 }
774 
775 /**
776  * Handles the event of adding new output operand.
777  */
778 void
780  unsigned int id = inputOperands_.size() + outputOperands_.size() + 1;
781  Operand* output = new Operand(false, id, Operand::SINT_WORD);
782  OutputOperandDialog dialog(this, output, id);
783  if (dialog.ShowModal() == wxID_OK) {
784  outputOperands_.push_back(output);
785  updateOperands();
786  } else {
787  delete output;
788  }
789  updateOperands();
790 }
791 
792 /**
793  * Handles the event for mofifying output operand.
794  */
795 void
798  int realId = Conversion::toInt(idString);
799  int id = realId - static_cast<int>(inputOperands_.size());
800  Operand* operand = NULL;
801  operand = outputOperands_[id - 1];
802  assert(operand != NULL);
803  OutputOperandDialog dialog(this, operand, realId);
804  dialog.ShowModal();
805  updateOperands();
806 }
807 
808 /**
809  * Handles the event of deleting output operand.
810  */
811 void
813 
814  vector<string> toBeDeleted = getSelectedItems(outputOperandList_);
815  size_t i = 0;
816  vector<Operand*>::iterator it = outputOperands_.begin();
817  int index = inputOperands_.size() + 1;
818 
819  while (it != outputOperands_.end() && i < toBeDeleted.size()) {
820  int id = Conversion::toInt(toBeDeleted[i]);
821  while (index < id) {
822  it++;
823  index++;
824  }
825  delete *it;
826  it = outputOperands_.erase(it);
827  index++;
828  i++;
829  }
830  updateOperands();
831 }
832 
833 /**
834  * Handles the event when input operand is moved up.
835  */
836 void
839  int id = Conversion::toInt(idString);
841 }
842 
843 /**
844  * Handles the event when input operand is moved down.
845  */
846 void
849  int id = Conversion::toInt(idString);
851 }
852 
853 /**
854  * Handles the event when output operand is moved up.
855  */
856 void
859  int id = Conversion::toInt(idString) -
860  static_cast<int>(inputOperands_.size());
862 }
863 
864 /**
865  * Handles the event when output operand is moved down.
866  */
867 void
870  int id = Conversion::toInt(idString) -
871  static_cast<int>(inputOperands_.size());
873 }
874 
875 /**
876  * Handles the event when Open button is pushed.
877  */
878 void
880 
882  OSEdOptions* options = wxGetApp().options();
883  string editor = options->editor();
884  if (editor == "") {
885  format fmt = texts.text(OSEdTextGenerator::TXT_ERROR_NO_EDITOR);
886  ErrorDialog error(this, WxConversion::toWxString(fmt.str()));
887  error.ShowModal();
888  } else {
889  if (FileSystem::fileExists(editor)) {
890  if (module_.hasBehaviorSource()) {
891  string code = module_.behaviorSourceModule();
892  string cmd = editor + " " + code;
893 
894  launchEditor(cmd);
895  } else {
896  // new behavior is added for the module
897  string code = module_.propertiesModule();
898  size_t pos = code.find_last_of(".");
899  code.erase(pos);
900  code += ".cc";
901 
902  // copy template file as new file
903  string dir =
907 
908  string templateFile = dir + FileSystem::DIRECTORY_SEPARATOR +
910 
911  FileSystem::copy(templateFile, code);
912 
913  string cmd = editor + " " + code;
914  launchEditor(cmd);
915  }
916  } else {
917  format fmt = texts.text(OSEdTextGenerator::TXT_ERROR_OPEN);
918  fmt % editor;
919  ErrorDialog error(this, WxConversion::toWxString(fmt.str()));
920  error.ShowModal();
921  }
922  }
923 
925 }
926 
927 /**
928  * Handles the event when Open DAG button is pushed.
929  */
930 void
932 
934  updateOperation(true);
935  }
936  // TODO: here set the number of operands of new operation.
937  OperationDAGDialog dialog(this, operation_);
938  dialog.ShowModal();
939 }
940 
941 /**
942  * Moves operand up.
943  *
944  * @param list List from which operand is selected.
945  * @param id Id of the operand.
946  * @param ops Operands.
947  */
948 void
950  std::vector<Operand*>& ops,
951  int id,
952  wxListCtrl* list) {
953 
954  if (id != 1) {
955  Operand* temp = ops[id - 2];
956  ops[id - 2] = ops[id - 1];
957  ops[id - 1] = temp;
958  long item = -1;
959  item = list->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
960  list->SetItemState(
961  item - 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
962  list->SetItemState(item, 0, wxLIST_STATE_SELECTED);
963  }
964 }
965 
966 /**
967  * Moves operand down.
968  *
969  * @param list List from which operand is selected.
970  * @param ops Operands.
971  * @param id Id of the operand.
972  */
973 void
975  std::vector<Operand*>& ops,
976  int id,
977  wxListCtrl* list) {
978 
979  if (static_cast<unsigned int>(id) != ops.size()) {
980  Operand* temp = ops[id - 1];
981  ops[id - 1] = ops[id];
982  ops[id] = temp;
983  long item = -1;
984  item = list->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
985  list->SetItemState(
986  item + 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
987  list->SetItemState(item, 0, wxLIST_STATE_SELECTED);
988  }
989 }
990 
991 /**
992  * Returns all the selected items of the list control.
993  *
994  * @param listCtrl List control which is investigated.
995  * @return All selected items as a vector.
996  */
997 vector<string>
999  vector<string> selected;
1000  long item = -1;
1001  for (;;) {
1002  item = listCtrl->GetNextItem(
1003  item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
1004  if (item == -1) {
1005  break;
1006  }
1007  wxListItem info;
1008  info.SetId(item);
1009  info.SetColumn(0);
1010  listCtrl->GetItem(info);
1011  selected.push_back(WxConversion::toString(info.GetText()));
1012  }
1013  return selected;
1014 }
1015 
1016 /**
1017  * Handles the event when OK button is pushed.
1018  */
1019 void
1021  updateOperation(false);
1022 }
1023 
1024 void
1026  TransferDataFromWindow();
1027  string opName =
1029 
1030  if (newOpDag && opName == "") {
1031  opName = "__UnnamedNewOperation";
1032  }
1033 
1035 
1036  if (opName == "" && operation_->name() == "") {
1037  format fmt = texts.text(OSEdTextGenerator::TXT_ERROR_NO_NAME);
1038  fmt % "operation";
1039  WarningDialog dialog(this, WxConversion::toWxString(fmt.str()));
1040  dialog.ShowModal();
1041  } else {
1042 
1043  // let's check there isn't already an operation by the same name.
1044  // Do the check only if we are renaming this op.
1045  if (operation_ != NULL && operation_->name() != opName) {
1046 
1047  Operation* op =
1049 
1050  // there was old operation with same name
1051  if (op != NULL) {
1052  format fmt =
1055  WarningDialog dialog(this, WxConversion::toWxString(fmt.str()));
1056  dialog.ShowModal();
1057  return;
1058  }
1059  }
1060 
1061  ObjectState* mod = saveOperation(); // load modified operation's settings from gui
1062  ObjectState* orig = orig_;
1063 
1064  if (newOpDag) {
1065  operation_->loadState(mod);
1066  } else {
1067  if (*orig != *mod) {
1068  format fmt = texts.text(
1070  ConfirmDialog dialog(this, WxConversion::toWxString(fmt.str()));
1071  int ans = dialog.ShowModal();
1072  if (ans == wxID_YES) {
1073  try {
1074  operation_->loadState(mod);
1075  } catch (ObjectStateLoadingException& e) {
1076  std::cerr << "Exception caught: " << e.errorMessage()
1077  << std::endl;
1078  assert(false);
1079  }
1080  }
1081 
1082  delete mod;
1083 
1084  if (ans == wxID_YES) {
1085  delete orig;
1086  EndModal(wxID_OK);
1087  } else if (ans == wxID_NO) {
1088  EndModal(wxID_CANCEL);
1089  }
1090  } else {
1091  delete orig;
1092  delete mod;
1093  EndModal(wxID_OK);
1094  }
1095  }
1096  }
1097 }
1098 
1099 /**
1100  * Returns the operation properties as ObjectState tree.
1101  *
1102  * @return Operation properties as ObjectState tree.
1103  */
1104 ObjectState*
1106 
1109 
1110  std::string description("");
1111  wxString wxTemp;
1112 
1113  for (int i = 0; i < editDescription_->GetNumberOfLines(); ++i)
1114  {
1115  wxTemp = editDescription_->GetLineText(i);
1116 #if wxCHECK_VERSION(2, 6, 0)
1117  std::string stdTemp(wxTemp.mb_str());
1118 #else
1119  std::string stdTemp(wxTemp.c_str());
1120 #endif
1121  if (!StringTools::endsWith(stdTemp, "\n"))
1122  stdTemp = stdTemp + "\n";
1123  description += stdTemp;
1124  }
1125 
1126  description = StringTools::trim(description);
1127 
1128  root->setAttribute(Operation::OPRN_DESCRIPTION, description);
1129 
1130  int inputs = inputOperands_.size();
1131  int outputs = outputOperands_.size();
1132 
1133  root->setAttribute(Operation::OPRN_INPUTS, inputs);
1134  root->setAttribute(Operation::OPRN_OUTPUTS, outputs);
1135 
1144 
1145  if (affectedBy_.size() > 0) {
1147  for (unsigned int i = 0; i < affectedBy_.size(); i++) {
1148  ObjectState* affectedByChild =
1150  affectedByChild->setAttribute(Operation::OPRN_NAME, affectedBy_[i]);
1151  affectedBy->addChild(affectedByChild);
1152  }
1153  root->addChild(affectedBy);
1154  }
1155 
1156  if (affects_.size() > 0) {
1158  for (unsigned int i = 0; i < affects_.size(); i++) {
1159  ObjectState* affectsChild =
1161  affectsChild->setAttribute(Operation::OPRN_NAME, affects_[i]);
1162  affects->addChild(affectsChild);
1163  }
1164  root->addChild(affects);
1165  }
1166 
1167  for (unsigned int i = 0; i < inputOperands_.size(); i++) {
1168  ObjectState* operand = inputOperands_[i]->saveState();
1169  operand->setName(Operation::OPRN_IN);
1170  int index = i + 1;
1172  std::string type = inputOperands_.at(i)->typeString();
1173  operand->setAttribute(Operand::OPRND_TYPE, type);
1174  root->addChild(operand);
1175  }
1176 
1177  for (unsigned int i = 0; i < outputOperands_.size(); i++) {
1178  ObjectState* operand = outputOperands_[i]->saveState();
1179  operand->setName(Operation::OPRN_OUT);
1180  int index = inputOperands_.size() + i + 1;
1182  std::string type = outputOperands_.at(i)->typeString();
1183  operand->setAttribute(Operand::OPRND_TYPE, type);
1184  root->addChild(operand);
1185  }
1186 
1187  // copy dags from operation to objectState tree
1188  for (int i = 0; i < operation_->dagCount(); i++) {
1190  trigger->setValue(operation_->dagCode(i));
1191  root->addChild(trigger);
1192  }
1193 
1194  return root;
1195 }
1196 
1197 /**
1198  * Launches editor for editing operation behavior.
1199  *
1200  * @param cmd Command for launching the editor.
1201  */
1202 void
1203 OperationPropertyDialog::launchEditor(const std::string& cmd) {
1204  CommandThread* thread = new CommandThread(cmd);
1205  thread->Create();
1206  thread->Run();
1207 }
1208 
1209 /**
1210  * Deletes deleted operands from swap lists.
1211  *
1212  * @param deletedOperands Deleted operands.
1213  */
1214 void
1215 OperationPropertyDialog::updateSwapLists(vector<string> deletedOperands) {
1216 
1217  for (size_t i = 0; i < inputOperands_.size(); i++) {
1218  Operand* operand = inputOperands_[i];
1219  ObjectState* state = operand->saveState();
1220  for (int j = 0; j < state->childCount(); j++) {
1221  if (state->child(j)->name() == Operand::OPRND_CAN_SWAP) {
1222  ObjectState* canSwap = state->child(j);
1223 
1224  int k = 0;
1225  while (k < canSwap->childCount()) {
1226  ObjectState* child = canSwap->child(k);
1227  int id = child->intAttribute(Operand::OPRND_ID);
1228  string idString = Conversion::toString(id);
1229 
1230  bool deleted = false;
1231  for (size_t r = 0; r < deletedOperands.size(); r++) {
1232  if (deletedOperands[r] == idString) {
1233  delete child;
1234  child = NULL;
1235  k--;
1236  deleted = true;
1237  break;
1238  }
1239  }
1240 
1241  if (!deleted) {
1242  int dec = 0;
1243  for (size_t r = 0; r < deletedOperands.size(); r++) {
1244  int delId = Conversion::toInt(deletedOperands[r]);
1245  if (delId < id) {
1246  dec++;
1247  }
1248  }
1249  id = id - dec;
1250  child->setAttribute(Operand::OPRND_ID, id);
1251  }
1252  k++;
1253  }
1254  }
1255  }
1256  operand->loadState(state);
1257  }
1258 }
1259 
1260 /**
1261  * Creates the contents of the dialog.
1262  *
1263  * NOTE! This function was generated by wxDesigner, that's why it is so ugly.
1264  *
1265  * @param parent Parent window.
1266  * @param call_fit If true, fits the contents inside the dialog.
1267  * @param set_sizer If true, sets the main sizer as dialog contents.
1268  * @return The created sizer.
1269  */
1270 wxSizer*
1272  wxWindow* parent,
1273  bool call_fit,
1274  bool set_sizer) {
1275 
1276  wxBoxSizer *item0 = new wxBoxSizer(wxVERTICAL);
1277 
1278  wxGridSizer *item1 = new wxGridSizer(2, 0, 0);
1279 
1280  wxBoxSizer *opHeaderSizer = new wxBoxSizer(wxHORIZONTAL);
1281 
1282  wxBoxSizer *nameSizer = new wxBoxSizer(wxHORIZONTAL);
1283 
1284  wxStaticText *item2 = new wxStaticText(parent, ID_TEXT_NAME, wxT("Name:"), wxDefaultPosition, wxDefaultSize, 0);
1285  nameSizer->Add(item2, 0, wxALL, 5);
1286 
1287  wxTextCtrl *item3 = new wxTextCtrl(parent, ID_NAME, wxT(""), wxDefaultPosition, wxSize(200,-1), 0);
1288  nameSizer->Add(item3, 0, wxALL, 5);
1289 
1290  wxStaticBox *opProperties = new wxStaticBox(parent, -1, wxT("Operation properties"));
1291  wxStaticBoxSizer *opPropertiesContainer = new wxStaticBoxSizer(opProperties, wxVERTICAL);
1292 
1293  opPropertiesContainer->Add(nameSizer, 0, wxGROW, 5);
1294  opPropertiesContainer->Add(item1, 0, wxGROW, 5);
1295 
1296  wxStaticBox *opDescription = new wxStaticBox(parent, -1, wxT("Operation description"));
1297  wxTextCtrl* editDescription = new wxTextCtrl(parent, ID_EDIT_DESCRIPTION, wxT(""), wxDefaultPosition, wxSize(250,50), wxTE_MULTILINE);
1298  wxStaticBoxSizer *opDescriptionContainer = new wxStaticBoxSizer(opDescription, wxHORIZONTAL);
1299 
1300  opDescriptionContainer->Add(editDescription, 0, wxALL|wxEXPAND, 5);
1301 
1302  opHeaderSizer->Add(opPropertiesContainer, 0, wxALL, 5);
1303  opHeaderSizer->Add(opDescriptionContainer, 0, wxALL|wxGROW, 5);
1304 
1305  wxCheckBox *item4 = new wxCheckBox(parent, ID_READS_MEMORY, wxT("Reads memory"), wxDefaultPosition, wxDefaultSize, 0);
1306  item1->Add(item4, 0, wxALL, 5);
1307 
1308  wxCheckBox *item5 = new wxCheckBox(parent, ID_WRITES_MEMORY, wxT("Writes memory"), wxDefaultPosition, wxDefaultSize, 0);
1309  item1->Add(item5, 0, wxALL, 5);
1310 
1311  wxCheckBox *item6 = new wxCheckBox(parent, ID_CAN_TRAP, wxT("Can trap"), wxDefaultPosition, wxDefaultSize, 0);
1312  item1->Add(item6, 0, wxALL, 5);
1313 
1314  wxCheckBox *item7 = new wxCheckBox(parent, ID_HAS_SIDE_EFFECTS, wxT("Has side effects"), wxDefaultPosition, wxDefaultSize, 0);
1315  item1->Add(item7, 0, wxALL, 5);
1316 
1317  wxCheckBox *clocked = new wxCheckBox(parent, ID_CLOCKED, wxT("Clocked"), wxDefaultPosition, wxDefaultSize, 0);
1318  item1->Add(clocked, 0, wxALL, 5);
1319 
1320  item0->Add(opHeaderSizer, 0, wxALIGN_CENTER|wxALL, 5);
1321 
1322  wxGridSizer *item8 = new wxGridSizer(2, 0, 0);
1323 
1324  wxStaticBox *item10 = new wxStaticBox(parent, -1, wxT("Affected by"));
1325  wxStaticBoxSizer *item9 = new wxStaticBoxSizer(item10, wxVERTICAL);
1326  affectedBySizer_ = item9;
1327 
1328  wxListCtrl *item11 = new wxListCtrl(parent, ID_AFFECTED_BY, wxDefaultPosition, wxSize(160,120), wxLC_REPORT|wxSUNKEN_BORDER);
1329  item9->Add(item11, 0, wxGROW|wxALL, 10);
1330 
1331  wxBoxSizer *item12 = new wxBoxSizer(wxHORIZONTAL);
1332 
1333  wxString strs13[] =
1334  {
1335  wxT("ComboItem")
1336  };
1337  wxComboBox *item13 = new wxComboBox(parent, ID_OPERATION_AFFECTED_BY, wxT(""), wxDefaultPosition, wxSize(100,-1), 1, strs13, wxCB_SORT);
1338  item12->Add(item13, 0, wxALIGN_CENTER|wxALL, 5);
1339 
1340  wxButton *item14 = new wxButton(parent, ID_AFFECTED_ADD_BUTTON, wxT("Add"), wxDefaultPosition, wxDefaultSize, 0);
1341  item12->Add(item14, 0, wxALIGN_CENTER|wxALL, 5);
1342 
1343  wxButton *item15 = new wxButton(parent, ID_AFFECTED_DELETE_BUTTON, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0);
1344  item12->Add(item15, 0, wxALIGN_CENTER|wxALL, 5);
1345 
1346  item9->Add(item12, 0, wxGROW|wxALL, 5);
1347 
1348  item8->Add(item9, 0, wxGROW|wxALL, 5);
1349 
1350  // Operation inputs
1351  wxStaticBox *item17 = new wxStaticBox(parent, -1, wxT("Input operands"));
1352  wxStaticBoxSizer *item16 = new wxStaticBoxSizer(item17, wxVERTICAL);
1353  inputSizer_ = item16;
1354 
1355  wxBoxSizer *item18 = new wxBoxSizer(wxHORIZONTAL);
1356 
1357  wxListCtrl *item19 = new wxListCtrl(parent, ID_INPUT_OPERANDS, wxDefaultPosition, wxSize(335,120), wxLC_REPORT|wxSUNKEN_BORDER);
1358  item18->Add(item19, 0, wxALIGN_CENTER|wxALL, 5);
1359 
1360  // BoxSizer for up and down buttons
1361  wxBoxSizer *item20 = new wxBoxSizer(wxVERTICAL);
1362 
1363  // Move up and down buttons
1364  wxBitmapButton *item21 = new wxBitmapButton(parent, ID_INPUT_UP_BUTTON, createBitmaps(0), wxDefaultPosition, wxDefaultSize);
1365  item20->Add(item21, 0, wxALL, 5);
1366 
1367  wxBitmapButton *item22 = new wxBitmapButton(parent, ID_INPUT_DOWN_BUTTON, createBitmaps(1), wxDefaultPosition, wxDefaultSize);
1368  item20->Add(item22, 0, wxALIGN_CENTER|wxALL, 5);
1369 
1370  item18->Add(item20, 0, wxALIGN_CENTER|wxALL, 5);
1371 
1372  item16->Add(item18, 0, wxGROW|wxALL, 5);
1373 
1374  wxBoxSizer *item23 = new wxBoxSizer(wxHORIZONTAL);
1375 
1376  wxButton *item24 = new wxButton(parent, ID_INPUT_ADD_BUTTON, wxT("Add..."), wxDefaultPosition, wxDefaultSize, 0);
1377  item23->Add(item24, 0, wxALIGN_CENTER|wxALL, 5);
1378 
1379  wxButton *item25 = new wxButton(parent, ID_INPUT_MODIFY_BUTTON, wxT("Modify..."), wxDefaultPosition, wxDefaultSize, 0);
1380  item23->Add(item25, 0, wxALIGN_CENTER|wxALL, 5);
1381 
1382  wxButton *item26 = new wxButton(parent, ID_INPUT_DELETE_BUTTON, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0);
1383  item23->Add(item26, 0, wxALIGN_CENTER|wxALL, 5);
1384 
1385  item16->Add(item23, 0, wxALIGN_CENTER|wxALL, 5);
1386 
1387  item8->Add(item16, 0, wxGROW|wxALL, 5);
1388 
1389  wxStaticBox *item28 = new wxStaticBox(parent, -1, wxT("Affects"));
1390  wxStaticBoxSizer *item27 = new wxStaticBoxSizer(item28, wxVERTICAL);
1391  affectsSizer_ = item27;
1392 
1393  wxListCtrl *item29 = new wxListCtrl(parent, ID_AFFECTS, wxDefaultPosition, wxSize(160,120), wxLC_REPORT|wxSUNKEN_BORDER);
1394  item27->Add(item29, 0, wxGROW|wxALL, 10);
1395 
1396  wxBoxSizer *item30 = new wxBoxSizer(wxHORIZONTAL);
1397 
1398  wxString strs31[] =
1399  {
1400  wxT("ComboItem")
1401  };
1402  wxComboBox *item31 = new wxComboBox(parent, ID_OPERATION_AFFECTS, wxT(""), wxDefaultPosition, wxSize(100,-1), 1, strs31, wxCB_SORT);
1403  item30->Add(item31, 0, wxALIGN_CENTER|wxALL, 5);
1404 
1405  wxButton *item32 = new wxButton(parent, ID_AFFECTS_ADD_BUTTON, wxT("Add"), wxDefaultPosition, wxDefaultSize, 0);
1406  item30->Add(item32, 0, wxALIGN_CENTER|wxALL, 5);
1407 
1408  wxButton *item33 = new wxButton(parent, ID_AFFECTS_DELETE_BUTTON, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0);
1409  item30->Add(item33, 0, wxALIGN_CENTER|wxALL, 5);
1410 
1411  item27->Add(item30, 0, wxGROW|wxALL, 5);
1412 
1413  item8->Add(item27, 0, wxGROW|wxALL, 5);
1414 
1415  wxStaticBox *item35 = new wxStaticBox(parent, -1, wxT("Output operands"));
1416  wxStaticBoxSizer *item34 = new wxStaticBoxSizer(item35, wxVERTICAL);
1417  outputSizer_ = item34;
1418 
1419  wxBoxSizer *item36 = new wxBoxSizer(wxHORIZONTAL);
1420 
1421  wxListCtrl *item37 = new wxListCtrl(parent, ID_OUTPUT_OPERANDS, wxDefaultPosition, wxSize(335,120), wxLC_REPORT|wxSUNKEN_BORDER);
1422  item36->Add(item37, 0, wxALIGN_CENTER|wxALL, 5);
1423 
1424  wxBoxSizer *item38 = new wxBoxSizer(wxVERTICAL);
1425 
1426  wxBitmapButton *item39 = new wxBitmapButton(parent, ID_OUTPUT_UP_BUTTON, createBitmaps(0), wxDefaultPosition, wxDefaultSize);
1427  item38->Add(item39, 0, wxALIGN_CENTER|wxALL, 5);
1428 
1429  wxBitmapButton *item40 = new wxBitmapButton(parent, ID_OUTPUT_DOWN_BUTTON, createBitmaps(1), wxDefaultPosition, wxDefaultSize);
1430  item38->Add(item40, 0, wxALIGN_CENTER|wxALL, 5);
1431 
1432  item36->Add(item38, 0, wxALIGN_CENTER|wxALL, 5);
1433 
1434  item34->Add(item36, 0, wxGROW|wxALL, 5);
1435 
1436  wxBoxSizer *item41 = new wxBoxSizer(wxHORIZONTAL);
1437 
1438  wxButton *item42 = new wxButton(parent, ID_OUTPUT_ADD_BUTTON, wxT("Add..."), wxDefaultPosition, wxDefaultSize, 0);
1439  item41->Add(item42, 0, wxALIGN_CENTER|wxALL, 5);
1440 
1441  wxButton *item43 = new wxButton(parent, ID_OUTPUT_MODIFY_BUTTON, wxT("Modify..."), wxDefaultPosition, wxDefaultSize, 0);
1442  item41->Add(item43, 0, wxALIGN_CENTER|wxALL, 5);
1443 
1444  wxButton *item44 = new wxButton(parent, ID_OUTPUT_DELETE_BUTTON, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0);
1445  item41->Add(item44, 0, wxALIGN_CENTER|wxALL, 5);
1446 
1447  item34->Add(item41, 0, wxALIGN_CENTER|wxALL, 5);
1448 
1449  item8->Add(item34, 0, wxALIGN_CENTER|wxALL, 5);
1450 
1451  wxBoxSizer *pageSizer = new wxBoxSizer(wxHORIZONTAL);
1452  pageSizer->Add(item8, 0, wxALL, 5);
1453 
1454  item0->Add(pageSizer, 0, wxALIGN_CENTER|wxALL, 5);
1455 
1456  wxGridSizer *item45 = new wxGridSizer(2, 0, 0);
1457 
1458  wxBoxSizer *item46 = new wxBoxSizer(wxHORIZONTAL);
1459 
1460  wxStaticText *item47 = NULL;
1461  if (module_.hasBehaviorSource()) {
1462  item47 = new wxStaticText(parent, ID_TEXT_OPEN, _T("Operation behavior module defined."), wxDefaultPosition, wxDefaultSize, 0);
1463  } else {
1464  item47 = new wxStaticText(parent, ID_TEXT_OPEN, wxT("Operation behavior module not defined."), wxDefaultPosition, wxDefaultSize, 0);
1465  }
1466  item46->Add(item47, 0, wxALIGN_CENTER|wxALL, 5);
1467 
1468  wxButton *item48 = new wxButton(parent, ID_OPEN_BUTTON, wxT("Open"), wxDefaultPosition, wxDefaultSize, 0);
1469  item46->Add(item48, 0, wxALIGN_CENTER|wxALL, 5);
1470 
1471  wxButton *OpenDAG = new wxButton(parent, ID_DAG_BUTTON, wxT("Open DAG"), wxDefaultPosition, wxDefaultSize, 0);
1472  item46->Add(OpenDAG, 0, wxALIGN_CENTER|wxALL, 5);
1473 
1474  item45->Add(item46, 0, wxALL, 5);
1475 
1476  wxBoxSizer *item49 = new wxBoxSizer(wxHORIZONTAL);
1477 
1478  wxButton *item50 = new wxButton(parent, ID_OK_BUTTON, wxT("&OK"), wxDefaultPosition, wxDefaultSize, 0);
1479  item49->Add(item50, 0, wxALIGN_CENTER|wxALL, 5);
1480 
1481  wxButton *item51 = new wxButton(parent, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0);
1482  item49->Add(item51, 0, wxALIGN_CENTER|wxALL, 5);
1483 
1484  item45->Add(item49, 0, wxALL, 5);
1485 
1486  item0->Add(item45, 0, wxGROW|wxALL, 5);
1487 
1488  if (set_sizer)
1489  {
1490  parent->SetSizer(item0);
1491  if (call_fit)
1492  item0->SetSizeHints(parent);
1493  }
1494 
1495  return item0;
1496 }
1497 
1498 /**
1499  * Creates the bitmaps.
1500  *
1501  * NOTE! This function was created by wxDesigner.
1502  *
1503  * @param index Index of the bitmap.
1504  * @return The bitmap.
1505  */
1506 wxBitmap
1508  if (index == 0)
1509  {
1510  /* XPM */
1511  static const char *xpm_data[] = {
1512  /* columns rows colors chars-per-pixel */
1513  "16 30 2 1",
1514  " c None",
1515  "a c Black",
1516  /* pixels */
1517  " ",
1518  " ",
1519  " ",
1520  " aa ",
1521  " aaaa ",
1522  " aaaaaa ",
1523  " aa aa aa ",
1524  " aa aa aa ",
1525  " aa aa aa ",
1526  " aa aa aa ",
1527  " a aa a ",
1528  " aa ",
1529  " aa ",
1530  " aa ",
1531  " aa ",
1532  " aa ",
1533  " aa ",
1534  " aa ",
1535  " aa ",
1536  " aa ",
1537  " aa ",
1538  " aa ",
1539  " aa ",
1540  " aa ",
1541  " aa ",
1542  " aa ",
1543  " aa ",
1544  " aa ",
1545  " aa ",
1546  " "
1547  };
1548  wxBitmap bitmap(xpm_data);
1549  return bitmap;
1550  }
1551  if (index == 1)
1552  {
1553  /* XPM */
1554  static const char *xpm_data[] = {
1555  /* columns rows colors chars-per-pixel */
1556  "16 30 2 1",
1557  " c None",
1558  "a c Black",
1559  /* pixels */
1560  " ",
1561  " aa ",
1562  " aa ",
1563  " aa ",
1564  " aa ",
1565  " aa ",
1566  " aa ",
1567  " aa ",
1568  " aa ",
1569  " aa ",
1570  " aa ",
1571  " aa ",
1572  " aa ",
1573  " aa ",
1574  " aa ",
1575  " aa ",
1576  " aa ",
1577  " aa ",
1578  " aa ",
1579  " aa ",
1580  " a aa a ",
1581  " aa aa aa ",
1582  " aa aa aa ",
1583  " aa aa aa ",
1584  " aaaaaa ",
1585  " aaaa ",
1586  " aa ",
1587  " ",
1588  " ",
1589  " "
1590  };
1591  wxBitmap bitmap(xpm_data);
1592  return bitmap;
1593  }
1594  return wxNullBitmap;
1595 }
OSEdConstants::BEHAVIOR_TEMPLATE_FILE_NAME
static const std::string BEHAVIOR_TEMPLATE_FILE_NAME
Name of the behavior template file name.
Definition: OSEdConstants.hh:82
Operand
Definition: Operand.hh:52
OperationPropertyDialog::setBehaviorLabel
void setBehaviorLabel()
Definition: OperationPropertyDialog.cc:393
OperationPropertyDialog::readMemory_
bool readMemory_
Does operation read memory?
Definition: OperationPropertyDialog.hh:197
OperationPropertyDialog::name_
wxString name_
Name of the operation.
Definition: OperationPropertyDialog.hh:191
OperationPropertyDialog::onModifyOutputOperand
void onModifyOutputOperand(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:796
StringTools::endsWith
static bool endsWith(const std::string &source, const std::string &searchString)
Definition: StringTools.cc:126
OperationPropertyDialog::onDeleteOutputOperand
void onDeleteOutputOperand(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:812
OperationPropertyDialog::onMoveInputUp
void onMoveInputUp(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:837
WarningDialog
Definition: WarningDialog.hh:42
OperationPropertyDialog
Definition: OperationPropertyDialog.hh:51
OperationPropertyDialog::operation_
Operation * operation_
Operation to be created or to be modified.
Definition: OperationPropertyDialog.hh:186
OperationPropertyDialog::ID_TEXT_NAME
@ ID_TEXT_NAME
Definition: OperationPropertyDialog.hh:119
OperationPropertyDialog::operation
Operation * operation() const
Definition: OperationPropertyDialog.cc:236
Operation::writesMemory
virtual bool writesMemory() const
Definition: Operation.cc:252
OperationPropertyDialog::onAddOutputOperand
void onAddOutputOperand(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:779
OSEdConstants::DEFAULT_COLUMN_WIDTH
static const int DEFAULT_COLUMN_WIDTH
Default column width.
Definition: OSEdConstants.hh:113
OSEdConstants::APPLICATION_NAME
static const wxString APPLICATION_NAME
The name of the application.
Definition: OSEdConstants.hh:110
OperationPropertyDialog::onDeleteAffects
void onDeleteAffects(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:697
FileSystem.hh
OperationPropertyDialog::ID_OUTPUT_UP_BUTTON
@ ID_OUTPUT_UP_BUTTON
Definition: OperationPropertyDialog.hh:141
OSEdTextGenerator::TXT_COLUMN_ELEMENT_WIDTH
@ TXT_COLUMN_ELEMENT_WIDTH
Operand element width header.
Definition: OSEdTextGenerator.hh:105
WxConversion::toWxString
static wxString toWxString(const std::string &source)
OperationPropertyDialog::onSelection
void onSelection(wxListEvent &event)
Definition: OperationPropertyDialog.cc:556
OperationPropertyDialog::affectsChoice_
wxComboBox * affectsChoice_
Choice box for new affects operations.
Definition: OperationPropertyDialog.hh:174
CommandThread.hh
Operation::hasSideEffects
virtual bool hasSideEffects() const
Definition: Operation.cc:272
OperationPropertyDialog::ID_WRITES_MEMORY
@ ID_WRITES_MEMORY
Definition: OperationPropertyDialog.hh:122
OperationPropertyDialog::isBranch_
bool isBranch_
Operation is branch.
Definition: OperationPropertyDialog.hh:211
OperationPropertyDialog::ID_OPERATION_AFFECTED_BY
@ ID_OPERATION_AFFECTED_BY
Definition: OperationPropertyDialog.hh:127
OperationPropertyDialog::onModifyInputOperand
void onModifyInputOperand(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:738
Operand::saveState
virtual ObjectState * saveState() const
Definition: Operand.cc:490
ObjectStateLoadingException
Definition: Exception.hh:551
Operation::OPRN_IN
static const char * OPRN_IN
Object state name for input operand.
Definition: Operation.hh:91
OperationPropertyDialog::ID_READS_MEMORY
@ ID_READS_MEMORY
Definition: OperationPropertyDialog.hh:121
OperationPropertyDialog::ID_OUTPUT_DELETE_BUTTON
@ ID_OUTPUT_DELETE_BUTTON
Definition: OperationPropertyDialog.hh:145
OperationPropertyDialog::onOk
void onOk(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:1020
OSEdTextGenerator::TXT_CHECKBOX_HAS_SIDE_EFFECTS
@ TXT_CHECKBOX_HAS_SIDE_EFFECTS
Has side effects label.
Definition: OSEdTextGenerator.hh:90
WidgetTools::setLabel
static void setLabel(Texts::TextGenerator *generator, wxWindow *widget, int textID)
Definition: WidgetTools.cc:92
OperationPropertyDialog::controlFlow_
bool controlFlow_
Can operation can change program flow.
Definition: OperationPropertyDialog.hh:207
OperationPropertyDialog::affectedBySizer_
wxStaticBoxSizer * affectedBySizer_
Affected by sizer.
Definition: OperationPropertyDialog.hh:161
GUITextGenerator::instance
static GUITextGenerator * instance()
Definition: GUITextGenerator.cc:67
OperationPropertyDialog::ID_AFFECTED_BY
@ ID_AFFECTED_BY
Definition: OperationPropertyDialog.hh:126
OperationPropertyDialog::editDescription_
wxTextCtrl * editDescription_
Definition: OperationPropertyDialog.hh:214
OperationPropertyDialog::~OperationPropertyDialog
virtual ~OperationPropertyDialog()
Definition: OperationPropertyDialog.cc:209
Operation::OPRN_NAME
static const char * OPRN_NAME
Object state name for name.
Definition: Operation.hh:67
Operand::OPRND_CAN_SWAP
static const std::string OPRND_CAN_SWAP
Object state name for can swap.
Definition: Operand.hh:92
OutputOperandDialog
Definition: OutputOperandDialog.hh:49
OperationPool::index
OperationIndex & index()
Definition: OperationPool.cc:109
GUITextGenerator
Definition: GUITextGenerator.hh:46
OperationPropertyDialog::updateOperation
void updateOperation(bool newOpDag)
Definition: OperationPropertyDialog.cc:1025
ObjectState
Definition: ObjectState.hh:59
OSEdTextGenerator::TXT_LABEL_NO_BEHAVIOR
@ TXT_LABEL_NO_BEHAVIOR
No behavior label.
Definition: OSEdTextGenerator.hh:55
Operation::isClocked
virtual bool isClocked() const
Definition: Operation.cc:282
WidgetTools.hh
OperationPropertyDialog::isCall_
bool isCall_
Operation performs function call.
Definition: OperationPropertyDialog.hh:209
OSEd.hh
OSEdTextGenerator::TXT_ERROR_OPERATION_EXISTS
@ TXT_ERROR_OPERATION_EXISTS
Operation exists error.
Definition: OSEdTextGenerator.hh:152
OperationPropertyDialog::onMoveInputDown
void onMoveInputDown(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:847
Operation::OPRN_AFFECTS
static const char * OPRN_AFFECTS
Object state name for affects.
Definition: Operation.hh:87
FindWindow
Definition: FindWindow.hh:49
OSEdTextGenerator::TXT_LABEL_OPERATION_NAME
@ TXT_LABEL_OPERATION_NAME
Operation name label.
Definition: OSEdTextGenerator.hh:52
OperationPropertyDialog::ID_OK_BUTTON
@ ID_OK_BUTTON
Definition: OperationPropertyDialog.hh:148
OperationContainer::operationExists
static bool operationExists(const std::string &name)
Definition: OperationContainer.cc:219
OperationPropertyDialog::canTrap_
bool canTrap_
Can operation trap?
Definition: OperationPropertyDialog.hh:201
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
ObjectState::setName
void setName(const std::string &name)
OperationPropertyDialog::moveUp
void moveUp(std::vector< Operand * > &ops, int id, wxListCtrl *list)
Definition: OperationPropertyDialog.cc:949
OperationPropertyDialog::onOpen
void onOpen(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:879
OperationPropertyDialog::updateOperands
void updateOperands()
Definition: OperationPropertyDialog.cc:443
OSEdTextGenerator::TXT_CHECKBOX_CAN_TRAP
@ TXT_CHECKBOX_CAN_TRAP
Can trap label.
Definition: OSEdTextGenerator.hh:89
OperationPropertyDialog::ID_TEXT_OPEN
@ ID_TEXT_OPEN
Definition: OperationPropertyDialog.hh:150
Operation::name
virtual TCEString name() const
Definition: Operation.cc:93
DialogPosition::setPosition
static void setPosition(Dialogs dialog, wxPoint point)
Definition: DialogPosition.cc:63
Operation::OPRN_AFFECTED_BY
static const char * OPRN_AFFECTED_BY
Object state name for affected by.
Definition: Operation.hh:89
OperationPropertyDialog::ID_DAG_BUTTON
@ ID_DAG_BUTTON
Definition: OperationPropertyDialog.hh:147
OperationPropertyDialog::onMoveOutputDown
void onMoveOutputDown(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:868
Conversion::toString
static std::string toString(const T &source)
OperationPropertyDialog::setTexts
void setTexts()
Definition: OperationPropertyDialog.cc:244
OSEdTextGenerator::TXT_CHECKBOX_WRITES_MEMORY
@ TXT_CHECKBOX_WRITES_MEMORY
Writes memory label.
Definition: OSEdTextGenerator.hh:88
OSEdConstants.hh
OSEdTextGenerator::TXT_CHECKBOX_READS_MEMORY
@ TXT_CHECKBOX_READS_MEMORY
Reads memory label.
Definition: OSEdTextGenerator.hh:87
Operation::dagCode
virtual TCEString dagCode(int index) const
Definition: Operation.cc:159
OSEdTextGenerator::TXT_BUTTON_MODIFY
@ TXT_BUTTON_MODIFY
Modify button label.
Definition: OSEdTextGenerator.hh:70
TCEString.hh
StringTools::stringToUpper
static std::string stringToUpper(const std::string &source)
Definition: StringTools.cc:143
OperationPropertyDialog::updateSwapLists
void updateSwapLists(std::vector< std::string > deletedOperands)
Definition: OperationPropertyDialog.cc:1215
OperationPropertyDialog::affectedByList_
wxListCtrl * affectedByList_
List of affected by operations.
Definition: OperationPropertyDialog.hh:164
StringTools.hh
OSEdTextGenerator::TXT_COLUMN_ELEMENT_COUNT
@ TXT_COLUMN_ELEMENT_COUNT
Operand element count header.
Definition: OSEdTextGenerator.hh:106
assert
#define assert(condition)
Definition: Application.hh:86
OperationIndex::pathCount
int pathCount() const
OSEdTextGenerator::TXT_BOX_AFFECTED_BY
@ TXT_BOX_AFFECTED_BY
Affected by sizer label.
Definition: OSEdTextGenerator.hh:124
OperationPropertyDialog::onMoveOutputUp
void onMoveOutputUp(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:857
OperationPropertyDialog::ID_CLOCKED
@ ID_CLOCKED
Definition: OperationPropertyDialog.hh:125
Operation::OPRN_CONTROL_FLOW
static const char * OPRN_CONTROL_FLOW
Object state name for control flow property.
Definition: Operation.hh:81
OperationModule::propertiesModule
virtual std::string propertiesModule() const
Definition: OperationModule.cc:121
GUITextGenerator::TXT_BUTTON_CANCEL
@ TXT_BUTTON_CANCEL
Label for cancel button.
Definition: GUITextGenerator.hh:55
OperationPropertyDialog::ID_CAN_TRAP
@ ID_CAN_TRAP
Definition: OperationPropertyDialog.hh:123
OperationPropertyDialog::affectsSizer_
wxStaticBoxSizer * affectsSizer_
Affects sizer.
Definition: OperationPropertyDialog.hh:159
Operation::OPRN_DESCRIPTION
static const char * OPRN_DESCRIPTION
Object state name for description.
Definition: Operation.hh:69
Operand::OPRND_ID
static const std::string OPRND_ID
Object state name for operand id.
Definition: Operand.hh:82
OperationPropertyDialog::affectedByChoice_
wxComboBox * affectedByChoice_
Choice box for new affected by operations.
Definition: OperationPropertyDialog.hh:172
OperationPropertyDialog::onDeleteInputOperand
void onDeleteInputOperand(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:753
Operation::OPRN_TRAP
static const char * OPRN_TRAP
Object state name for trap.
Definition: Operation.hh:75
OperationPropertyDialog::inputOperandList_
wxListCtrl * inputOperandList_
List of input operands.
Definition: OperationPropertyDialog.hh:168
ErrorDialog
Definition: ErrorDialog.hh:42
Operation::OPRN_TRIGGER
static const char * OPRN_TRIGGER
Object state name for trigger semantics.
Definition: Operation.hh:95
OperationPropertyDialog::ID_OUTPUT_MODIFY_BUTTON
@ ID_OUTPUT_MODIFY_BUTTON
Definition: OperationPropertyDialog.hh:144
WarningDialog.hh
OSEdTextGenerator::TXT_COLUMN_OPERATION
@ TXT_COLUMN_OPERATION
Operation column header.
Definition: OSEdTextGenerator.hh:96
OperationPropertyDialog.hh
OSEdTextGenerator::TXT_BUTTON_OPEN
@ TXT_BUTTON_OPEN
Open button label.
Definition: OSEdTextGenerator.hh:71
OperationPropertyDialog::path_
std::string path_
Path in which module belongs to.
Definition: OperationPropertyDialog.hh:195
OSEdTextGenerator::TXT_QUESTION_SAVE_PROPERTIES
@ TXT_QUESTION_SAVE_PROPERTIES
Save properties question.
Definition: OSEdTextGenerator.hh:210
ErrorDialog.hh
OSEdTextGenerator::TXT_LABEL_HAS_BEHAVIOR
@ TXT_LABEL_HAS_BEHAVIOR
Has behavior label.
Definition: OSEdTextGenerator.hh:54
OperationDAGDialog.hh
InputOperandDialog.hh
OperationPropertyDialog::inputSizer_
wxStaticBoxSizer * inputSizer_
Input operand sizer.
Definition: OperationPropertyDialog.hh:155
OperationPropertyDialog::ID_INPUT_MODIFY_BUTTON
@ ID_INPUT_MODIFY_BUTTON
Definition: OperationPropertyDialog.hh:134
dummy
SimValue dummy(32)
a dummy simvalue which is given for operands that are not bound
OperationModule::behaviorSourceModule
virtual std::string behaviorSourceModule() const
Definition: OperationModule.cc:144
OperationIndex.hh
OperationDAG.hh
ConfirmDialog.hh
Application.hh
WidgetTools::lcStringSelection
static std::string lcStringSelection(wxListCtrl *list, int column)
Definition: WidgetTools.cc:108
Operation::OPRN_OPERATION
static const char * OPRN_OPERATION
Object state name for operation.
Definition: Operation.hh:65
Operation::OPRN_CLOCKED
static const char * OPRN_CLOCKED
Object state name for clockedness.
Definition: Operation.hh:79
OperationPropertyDialog::getSelectedItems
std::vector< std::string > getSelectedItems(wxListCtrl *listCtrl)
Definition: OperationPropertyDialog.cc:998
OSEdTextGenerator::TXT_ERROR_NO_EDITOR
@ TXT_ERROR_NO_EDITOR
Error when no editor is given.
Definition: OSEdTextGenerator.hh:140
ObjectState.hh
InputOperandDialog
Definition: InputOperandDialog.hh:47
OperationPropertyDialog::clocked_
bool clocked_
Is operation clocked?
Definition: OperationPropertyDialog.hh:205
Operation::OPRN_ISCALL
static const char * OPRN_ISCALL
Object state name for call property.
Definition: Operation.hh:97
OperationPropertyDialog::createBitmaps
wxBitmap createBitmaps(size_t index)
Definition: OperationPropertyDialog.cc:1507
Operation::loadState
virtual void loadState(const ObjectState *state)
Definition: Operation.cc:480
FileSystem::copy
static void copy(const std::string &source, const std::string &target)
Definition: FileSystem.cc:524
GUITextGenerator::TXT_BUTTON_ADD
@ TXT_BUTTON_ADD
Label for an add button.
Definition: GUITextGenerator.hh:53
OperationPropertyDialog::onOpenDAG
void onOpenDAG(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:931
ObjectState::child
ObjectState * child(int index) const
Definition: ObjectState.cc:471
ObjectState::addChild
void addChild(ObjectState *child)
Definition: ObjectState.cc:376
Operation.hh
DialogPosition
Definition: DialogPosition.hh:42
OperationPropertyDialog::ID_AFFECTS
@ ID_AFFECTS
Definition: OperationPropertyDialog.hh:136
OSEdTextGenerator::TXT_ERROR_OPEN
@ TXT_ERROR_OPEN
Error when opening fails.
Definition: OSEdTextGenerator.hh:141
OperationPropertyDialog::affects_
std::vector< std::string > affects_
Operations that affects this operation.
Definition: OperationPropertyDialog.hh:221
Operation::OPRN_WRITES_MEMORY
static const char * OPRN_WRITES_MEMORY
Object state name for writes memory.
Definition: Operation.hh:85
ObjectState::childCount
int childCount() const
Operation::readsMemory
virtual bool readsMemory() const
Definition: Operation.cc:242
Operation::canTrap
virtual bool canTrap() const
Definition: Operation.cc:262
Operand::SINT_WORD
@ SINT_WORD
Definition: Operand.hh:59
OperationPropertyDialog::outputSizer_
wxStaticBoxSizer * outputSizer_
Output operand sizer.
Definition: OperationPropertyDialog.hh:157
Operation::OPRN_READS_MEMORY
static const char * OPRN_READS_MEMORY
Object state name for reads memory.
Definition: Operation.hh:83
Exception
Definition: Exception.hh:54
OperationPropertyDialog::onAddInputOperand
void onAddInputOperand(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:718
OSEdTextGenerator::TXT_COLUMN_TYPE
@ TXT_COLUMN_TYPE
Type column header.
Definition: OSEdTextGenerator.hh:98
OSEdTextGenerator::TXT_CHECKBOX_CLOCKED
@ TXT_CHECKBOX_CLOCKED
Clocked label.
Definition: OSEdTextGenerator.hh:91
OperationPropertyDialog::launchEditor
void launchEditor(const std::string &cmd)
Definition: OperationPropertyDialog.cc:1203
ObjectState::name
std::string name() const
OperationPropertyDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: OperationPropertyDialog.cc:410
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
OperationPropertyDialog::ID_OUTPUT_DOWN_BUTTON
@ ID_OUTPUT_DOWN_BUTTON
Definition: OperationPropertyDialog.hh:142
ConfirmDialog
Definition: ConfirmDialog.hh:41
Operation
Definition: Operation.hh:59
Operation::OPRN_OUT
static const char * OPRN_OUT
Object state name for output operand.
Definition: Operation.hh:93
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
GUITextGenerator::TXT_BUTTON_DELETE
@ TXT_BUTTON_DELETE
Label for delete button.
Definition: GUITextGenerator.hh:56
Operation::OPRN_INPUTS
static const char * OPRN_INPUTS
Object state name for inputs.
Definition: Operation.hh:71
FileSystem::DIRECTORY_SEPARATOR
static const std::string DIRECTORY_SEPARATOR
Definition: FileSystem.hh:189
GUITextGenerator.hh
CommandThread
Definition: CommandThread.hh:43
Operand.hh
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
Operand::OPRND_TYPE
static const std::string OPRND_TYPE
Object state name for operand type.
Definition: Operand.hh:84
Operation::description
virtual TCEString description() const
Definition: Operation.cc:103
OperationPropertyDialog::ID_OPEN_BUTTON
@ ID_OPEN_BUTTON
Definition: OperationPropertyDialog.hh:146
OSEdTextGenerator::TXT_BOX_INPUT_OPERANDS
@ TXT_BOX_INPUT_OPERANDS
Input operand sizer label.
Definition: OSEdTextGenerator.hh:125
StringTools::trim
static std::string trim(const std::string &source)
Definition: StringTools.cc:55
OperationPropertyDialog::ID_AFFECTED_DELETE_BUTTON
@ ID_AFFECTED_DELETE_BUTTON
Definition: OperationPropertyDialog.hh:129
Operation::OPRN_SIDE_EFFECTS
static const char * OPRN_SIDE_EFFECTS
Object state name for side effects.
Definition: Operation.hh:77
OperationPropertyDialog::affectedBy_
std::vector< std::string > affectedBy_
Operations that are affected by this operation.
Definition: OperationPropertyDialog.hh:223
Operation::dagCount
virtual int dagCount() const
Definition: Operation.cc:134
OperationPropertyDialog::ID_OUTPUT_OPERANDS
@ ID_OUTPUT_OPERANDS
Definition: OperationPropertyDialog.hh:140
OperationBehavior.hh
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
NullOperationBehavior::instance
static NullOperationBehavior & instance()
Definition: OperationBehavior.hh:95
OSEdTextGenerator::TXT_ERROR_NON_EXISTING_OPERATION
@ TXT_ERROR_NON_EXISTING_OPERATION
Error when operation does not exist.
Definition: OSEdTextGenerator.hh:145
OperationIndex::moduleCount
int moduleCount() const
DialogPosition::DIALOG_PROPERTIES
@ DIALOG_PROPERTIES
Operation properties dialog.
Definition: DialogPosition.hh:48
GUITextGenerator::TXT_BUTTON_ADD_DIALOG
@ TXT_BUTTON_ADD_DIALOG
Label for add button (with trailing ...).
Definition: GUITextGenerator.hh:54
OperationPropertyDialog::affectsList_
wxListCtrl * affectsList_
List of affects operations.
Definition: OperationPropertyDialog.hh:166
OperationPropertyDialog::ID_EDIT_DESCRIPTION
@ ID_EDIT_DESCRIPTION
Definition: OperationPropertyDialog.hh:151
false
find Finds info of the inner loops in the false
Definition: InnerLoopFinder.cc:81
OperationPropertyDialog::ID_AFFECTS_DELETE_BUTTON
@ ID_AFFECTS_DELETE_BUTTON
Definition: OperationPropertyDialog.hh:139
OSEdTextGenerator::TXT_ERROR_NO_NAME
@ TXT_ERROR_NO_NAME
Error when no name is given.
Definition: OSEdTextGenerator.hh:132
FileSystem::fileExists
static bool fileExists(const std::string fileName)
OperationModule
Definition: OperationModule.hh:46
OperationPropertyDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: OperationPropertyDialog.cc:1271
OperationModule::hasBehaviorSource
virtual bool hasBehaviorSource() const
Definition: OperationModule.cc:131
OperationPropertyDialog::operationWasCreatedHere_
bool operationWasCreatedHere_
Definition: OperationPropertyDialog.hh:225
OperationPropertyDialog::ID_HAS_SIDE_EFFECTS
@ ID_HAS_SIDE_EFFECTS
Definition: OperationPropertyDialog.hh:124
OperationIndex::path
std::string path(int i) const
OperationIndex
Definition: OperationIndex.hh:58
OSEdTextGenerator::instance
static OSEdTextGenerator & instance()
Definition: OSEdTextGenerator.cc:214
OperationPropertyDialog::ID_OUTPUT_ADD_BUTTON
@ ID_OUTPUT_ADD_BUTTON
Definition: OperationPropertyDialog.hh:143
OSEdTextGenerator::TXT_COLUMN_OPERAND
@ TXT_COLUMN_OPERAND
Operand column header.
Definition: OSEdTextGenerator.hh:97
OperationPropertyDialog::module_
OperationModule & module_
Module in which operation belongs to.
Definition: OperationPropertyDialog.hh:193
OperationPropertyDialog::ID_OPERATION_AFFECTS
@ ID_OPERATION_AFFECTS
Definition: OperationPropertyDialog.hh:137
OperationPropertyDialog::ID_INPUT_DOWN_BUTTON
@ ID_INPUT_DOWN_BUTTON
Definition: OperationPropertyDialog.hh:132
ObjectState::intAttribute
int intAttribute(const std::string &name) const
Definition: ObjectState.cc:276
OSEdTextGenerator
Definition: OSEdTextGenerator.hh:42
OSEdTextGenerator::TXT_BOX_OUTPUT_OPERANDS
@ TXT_BOX_OUTPUT_OPERANDS
Output operand sizer label.
Definition: OSEdTextGenerator.hh:126
WxConversion.hh
OperationPropertyDialog::ID_INPUT_UP_BUTTON
@ ID_INPUT_UP_BUTTON
Definition: OperationPropertyDialog.hh:131
OperationPropertyDialog::onAddAffects
void onAddAffects(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:676
OperationPropertyDialog::ID_INPUT_DELETE_BUTTON
@ ID_INPUT_DELETE_BUTTON
Definition: OperationPropertyDialog.hh:135
OSEdOptions.hh
OSEdOptions
Definition: OSEdOptions.hh:46
WidgetTools::setWidgetLabel
static void setWidgetLabel(wxWindow *widget, std::string text)
Definition: WidgetTools.cc:52
OperationContainer::operation
static Operation * operation(const std::string &path, const std::string &module, const std::string &oper)
Definition: OperationContainer.cc:173
Conversion::toInt
static int toInt(const T &source)
OperationPropertyDialog::ID_AFFECTED_ADD_BUTTON
@ ID_AFFECTED_ADD_BUTTON
Definition: OperationPropertyDialog.hh:128
OperationPropertyDialog::outputOperands_
std::vector< Operand * > outputOperands_
Output operands.
Definition: OperationPropertyDialog.hh:219
OperationPropertyDialog::ID_AFFECTS_ADD_BUTTON
@ ID_AFFECTS_ADD_BUTTON
Definition: OperationPropertyDialog.hh:138
Operation::isCall
virtual bool isCall() const
Definition: Operation.cc:318
OperationModule::name
virtual std::string name() const
Definition: OperationModule.cc:160
OperationPropertyDialog::inputOperands_
std::vector< Operand * > inputOperands_
Input operands.
Definition: OperationPropertyDialog.hh:217
OperationPropertyDialog::hasSideEffects_
bool hasSideEffects_
Does operation has side effects?
Definition: OperationPropertyDialog.hh:203
OperationPropertyDialog::outputOperandList_
wxListCtrl * outputOperandList_
List of output operands.
Definition: OperationPropertyDialog.hh:170
OperationPropertyDialog::onDeleteAffectedBy
void onDeleteAffectedBy(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:655
OperationIndex::operationCount
int operationCount(const OperationModule &om)
Definition: OperationIndex.cc:363
OperationPropertyDialog::ID_INPUT_ADD_BUTTON
@ ID_INPUT_ADD_BUTTON
Definition: OperationPropertyDialog.hh:133
WxConversion::toString
static std::string toString(const wxString &source)
OSEdTextGenerator::TXT_BOX_AFFECTS
@ TXT_BOX_AFFECTS
Affects sizer label.
Definition: OSEdTextGenerator.hh:123
OperationPropertyDialog::onAddAffectedBy
void onAddAffectedBy(wxCommandEvent &event)
Definition: OperationPropertyDialog.cc:634
OSEdTextGenerator.hh
OperationPropertyDialog::ID_INPUT_OPERANDS
@ ID_INPUT_OPERANDS
Definition: OperationPropertyDialog.hh:130
OperationPropertyDialog::updateAffected
void updateAffected()
Definition: OperationPropertyDialog.cc:485
OperationContainer::operationIndex
static OperationIndex & operationIndex()
Definition: OperationContainer.cc:94
OperationPropertyDialog::writeMemory_
bool writeMemory_
Does operation write memory?
Definition: OperationPropertyDialog.hh:199
ObjectState::setValue
void setValue(const std::string &value)
OperationPropertyDialog::ID_NAME
@ ID_NAME
Definition: OperationPropertyDialog.hh:120
Operation::OPRN_ISBRANCH
static const char * OPRN_ISBRANCH
Object state name for branch property.
Definition: Operation.hh:99
OperationPropertyDialog::moveDown
void moveDown(std::vector< Operand * > &ops, int id, wxListCtrl *list)
Definition: OperationPropertyDialog.cc:974
OperationDAGDialog
Definition: OperationDAGDialog.hh:51
Operation::OPRN_OUTPUTS
static const char * OPRN_OUTPUTS
Object state name for outputs.
Definition: Operation.hh:73
OperationIndex::module
OperationModule & module(int i)
Operation::isBranch
virtual bool isBranch() const
Definition: Operation.cc:306
OperationIndex::operationName
std::string operationName(int i, const OperationModule &om)
Definition: OperationIndex.cc:337
OperationModule.hh
END_EVENT_TABLE
END_EVENT_TABLE() using namespace IDF
OperationPropertyDialog::saveOperation
ObjectState * saveOperation()
Definition: OperationPropertyDialog.cc:1105
OSEdTextGenerator::TXT_PROPERTY_DIALOG_TITLE
@ TXT_PROPERTY_DIALOG_TITLE
Property dialog title.
Definition: OSEdTextGenerator.hh:109
ObjectState::setAttribute
void setAttribute(const std::string &name, const std::string &value)
Definition: ObjectState.cc:100
Environment::dataDirPath
static std::string dataDirPath(const std::string &prog)
Definition: Environment.cc:176
Operand::loadState
virtual void loadState(const ObjectState *state)
Definition: Operand.cc:383
OperationPropertyDialog::orig_
ObjectState * orig_
Original operation's ObjectState tree.
Definition: OperationPropertyDialog.hh:188
Operation::isControlFlowOperation
virtual bool isControlFlowOperation() const
Definition: Operation.cc:294
OperationContainer.hh
OutputOperandDialog.hh
GUITextGenerator::TXT_BUTTON_OK
@ TXT_BUTTON_OK
Label for OK button.
Definition: GUITextGenerator.hh:59
DialogPosition.hh