OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
OSEdInfoView Class Reference

#include <OSEdInfoView.hh>

Inheritance diagram for OSEdInfoView:
Inheritance graph
Collaboration diagram for OSEdInfoView:
Collaboration graph

Public Member Functions

 OSEdInfoView (wxWindow *parent)
 
virtual ~OSEdInfoView ()
 
void clear ()
 
void pathView ()
 
void moduleView (const std::string &name)
 
void operationView (const std::string &path, const std::string &mod)
 
void operationPropertyView (const std::string &opName, const std::string &modName, const std::string &pathName)
 
std::string selectedPath ()
 
std::string selectedModule ()
 
std::string selectedOperation ()
 

Private Types

enum  InfoMode {
  MODE_NOMODE , MODE_PATH , MODE_MODULE , MODE_OPERATION ,
  MODE_PROPERTY
}
 

Private Member Functions

void onSelection (wxListEvent &event)
 
void onDropDownMenu (wxMouseEvent &event)
 
void insertOperationPropertyColumns ()
 
int writeStaticPropertiesOfOperation (Operation *op)
 

Private Attributes

InfoMode mode_
 Mode of the info view.
 

Detailed Description

Models an info screen.

Info screen shows info about search paths, modules, and operations.

Definition at line 47 of file OSEdInfoView.hh.

Member Enumeration Documentation

◆ InfoMode

enum OSEdInfoView::InfoMode
private

Possible modes of info view.

Enumerator
MODE_NOMODE 

Initial state.

MODE_PATH 

Path view.

MODE_MODULE 

Module view.

MODE_OPERATION 

Operation View.

MODE_PROPERTY 

Operation property view.

Definition at line 75 of file OSEdInfoView.hh.

75 {
76 MODE_NOMODE, ///< Initial state.
77 MODE_PATH, ///< Path view.
78 MODE_MODULE, ///< Module view.
79 MODE_OPERATION, ///< Operation View.
80 MODE_PROPERTY ///< Operation property view.
81 };
@ MODE_PATH
Path view.
@ MODE_PROPERTY
Operation property view.
@ MODE_OPERATION
Operation View.
@ MODE_NOMODE
Initial state.
@ MODE_MODULE
Module view.

Constructor & Destructor Documentation

◆ OSEdInfoView()

OSEdInfoView::OSEdInfoView ( wxWindow *  parent)

Constructor.

Parameters
parentParent window.

Definition at line 68 of file OSEdInfoView.cc.

68 :
69 wxListCtrl(
70 parent, OSEdConstants::CMD_INFO_VIEW, wxDefaultPosition,
71 wxSize(400,400),
72 wxLC_REPORT|wxLC_SINGLE_SEL|wxSUNKEN_BORDER), mode_(MODE_NOMODE) {
73}
@ CMD_INFO_VIEW
Id for list events.
InfoMode mode_
Mode of the info view.

◆ ~OSEdInfoView()

OSEdInfoView::~OSEdInfoView ( )
virtual

Destructor.

Definition at line 79 of file OSEdInfoView.cc.

79 {
80}

Member Function Documentation

◆ clear()

void OSEdInfoView::clear ( )

Clears the info screen.

Definition at line 86 of file OSEdInfoView.cc.

86 {
87 int columns = GetColumnCount();
88 for (int i = 0; i < columns; i++) {
89 DeleteColumn(0);
90 }
91 DeleteAllItems();
92}

Referenced by moduleView(), operationPropertyView(), operationView(), and pathView().

◆ insertOperationPropertyColumns()

void OSEdInfoView::insertOperationPropertyColumns ( )
private

Inserts columns in operation property view.

Definition at line 372 of file OSEdInfoView.cc.

372 {
375 InsertColumn(
376 0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
378
380 InsertColumn(
381 1, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
383
385 InsertColumn(
386 2, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
388}
static const int DEFAULT_COLUMN_WIDTH
Default column width.
static OSEdTextGenerator & instance()
@ TXT_COLUMN_PROPERTY
Property column header.
@ TXT_COLUMN_OPERAND_VALUE
Operand value column header.
@ TXT_COLUMN_VALUE
Value column header.
virtual boost::format text(int textId)
static wxString toWxString(const std::string &source)

References OSEdConstants::DEFAULT_COLUMN_WIDTH, OSEdTextGenerator::instance(), Texts::TextGenerator::text(), WxConversion::toWxString(), OSEdTextGenerator::TXT_COLUMN_OPERAND_VALUE, OSEdTextGenerator::TXT_COLUMN_PROPERTY, and OSEdTextGenerator::TXT_COLUMN_VALUE.

Referenced by operationPropertyView().

Here is the call graph for this function:

◆ moduleView()

void OSEdInfoView::moduleView ( const std::string &  name)

Shows the module view.

Parameters
Thename of the path.

Definition at line 129 of file OSEdInfoView.cc.

129 {
130
132 clear();
135 InsertColumn(
136 0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
138
139 int modules = 0;
140 try {
141 modules = index.moduleCount(name);
142 } catch (const PathNotFound& p) {
143 // path not found
144 }
145
146 for (int i = 0; i < modules; i++) {
147 OperationModule& module = index.module(i, name);
148 InsertItem(i, WxConversion::toWxString(module.name()));
149 }
150
152}
@ TXT_COLUMN_MODULES
Module column header.
static OperationIndex & operationIndex()
int moduleCount() const

References clear(), OSEdConstants::DEFAULT_COLUMN_WIDTH, OSEdTextGenerator::instance(), mode_, MODE_MODULE, OperationIndex::moduleCount(), OperationContainer::operationIndex(), Texts::TextGenerator::text(), WxConversion::toWxString(), and OSEdTextGenerator::TXT_COLUMN_MODULES.

Referenced by OSEdRemoveModuleCmd::Do(), OSEdTreeView::onItemSelected(), and OSEdTreeView::update().

Here is the call graph for this function:

◆ onDropDownMenu()

void OSEdInfoView::onDropDownMenu ( wxMouseEvent &  event)
private

Handles the event when list item is clicked with right mouse button.

Then the drop down menu is shown.

Parameters
eventEvent to be handled.

Definition at line 579 of file OSEdInfoView.cc.

579 {
580
581 if (GetSelectedItemCount() <= 1 && mode_ != MODE_PROPERTY) {
582 // deselect the selected item
583 long item = -1;
584 item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
585 if (item != -1) {
586 SetItemState(item, 0, wxLIST_STATE_SELECTED);
587 }
588
589 wxPoint pos = event.GetPosition();
590 int flags = wxLIST_HITTEST_ONITEMLABEL;
591 item = -1;
592 item = HitTest(pos, flags);
593
595 OSEdMainFrame* mainFrame = wxGetApp().mainFrame();
596 DropDownMenu* menu = NULL;
597 if (item != -1) {
598 // select the item that was clicked
599 SetItemState(item, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
600 switch(mode_) {
601 case MODE_PATH: {
602 format fmt =
604 mainFrame->statusBar()->
605 SetStatusText(WxConversion::toWxString(fmt.str()));
607 PopupMenu(menu, pos);
608 }
609 break;
610 case MODE_MODULE: {
611 format fmt =
613 mainFrame->statusBar()->
614 SetStatusText(WxConversion::toWxString(fmt.str()));
616 PopupMenu(menu, pos);
617 }
618 break;
619 case MODE_OPERATION: {
620 format fmt =
622 mainFrame->statusBar()->
623 SetStatusText(WxConversion::toWxString(fmt.str()));
625 PopupMenu(menu, pos);
626 }
627 break;
628 default:
629 break;
630 }
631 }
632 delete menu;
633 }
634}
@ MENU_MODULE
Module menu.
@ MENU_OPERATION
Operation menu.
@ MENU_PATH
Path menu.
wxStatusBar * statusBar() const
@ TXT_STATUS_MODULE_SELECTED
Status bar text when module is selected.
@ TXT_STATUS_OPERATION_SELECTED
Status bar text when operation is selected.
@ TXT_STATUS_PATH_SELECTED
Status bar text when path is selected.

References OSEdTextGenerator::instance(), DropDownMenu::MENU_MODULE, DropDownMenu::MENU_OPERATION, DropDownMenu::MENU_PATH, mode_, MODE_MODULE, MODE_OPERATION, MODE_PATH, MODE_PROPERTY, OSEdMainFrame::statusBar(), Texts::TextGenerator::text(), WxConversion::toWxString(), OSEdTextGenerator::TXT_STATUS_MODULE_SELECTED, OSEdTextGenerator::TXT_STATUS_OPERATION_SELECTED, and OSEdTextGenerator::TXT_STATUS_PATH_SELECTED.

Here is the call graph for this function:

◆ onSelection()

void OSEdInfoView::onSelection ( wxListEvent &  event)
private

Handles the event when list item is selected.

Definition at line 538 of file OSEdInfoView.cc.

538 {
539 if (GetSelectedItemCount() == 1) {
541 OSEdMainFrame* mainFrame = wxGetApp().mainFrame();
542 mainFrame->updateMenuBar();
543 switch (mode_) {
544 case MODE_PATH: {
545 format fmt =
547 mainFrame->statusBar()->
548 SetStatusText(WxConversion::toWxString(fmt.str()));
549 }
550 break;
551 case MODE_MODULE: {
552 format fmt =
554 mainFrame->statusBar()->
555 SetStatusText(WxConversion::toWxString(fmt.str()));
556 }
557 break;
558 case MODE_OPERATION: {
559 format fmt =
561 mainFrame->statusBar()->
562 SetStatusText(WxConversion::toWxString(fmt.str()));
563 }
564 break;
565 default:
566 break;
567 }
568 }
569}

References OSEdTextGenerator::instance(), mode_, MODE_MODULE, MODE_OPERATION, MODE_PATH, OSEdMainFrame::statusBar(), Texts::TextGenerator::text(), WxConversion::toWxString(), OSEdTextGenerator::TXT_STATUS_MODULE_SELECTED, OSEdTextGenerator::TXT_STATUS_OPERATION_SELECTED, OSEdTextGenerator::TXT_STATUS_PATH_SELECTED, and OSEdMainFrame::updateMenuBar().

Here is the call graph for this function:

◆ operationPropertyView()

void OSEdInfoView::operationPropertyView ( const std::string &  opName,
const std::string &  modName,
const std::string &  pathName 
)

Shows the operation properties of an operation.

Parameters
opNameThe name of the operation.
modNameThe name of the module.
pathNameThe name of the path.

Definition at line 202 of file OSEdInfoView.cc.

205 {
206
207 clear();
208
210 format yesFmt = texts.text(OSEdTextGenerator::TXT_ROW_YES);
211 format noFmt = texts.text(OSEdTextGenerator::TXT_ROW_NO);
212 format trueFmt = texts.text(OSEdTextGenerator::TXT_ROW_TRUE);
213 format falseFmt = texts.text(OSEdTextGenerator::TXT_ROW_FALSE);
214
215 Operation* op = OperationContainer::operation(pathName, modName, opName);
216
217 // insert columns
219
220 if (op == NULL) {
221 // operation properties can not be loaded
222 return;
223 }
224
225 // write "static" properties
227
228 format fmt;
229
230 // affected by
231 for (int k = 0; k < op->affectedByCount(); k++) {
232 if (k == 0) {
234 InsertItem(i, WxConversion::toWxString(fmt.str()));
235 } else {
236 InsertItem(i, _T(""));
237 }
238 SetItem(i, 1, WxConversion::toWxString(op->affectedBy(k)));
239 i++;
240 }
241
242 // affects
243 for (int k = 0; k < op->affectsCount(); k++) {
244 if (k == 0) {
246 InsertItem(i, WxConversion::toWxString(fmt.str()));
247 } else {
248 InsertItem(i, _T(""));
249 }
250 SetItem(i, 1, WxConversion::toWxString(op->affects(k)));
251 i++;
252 }
253
255 InsertItem(i, WxConversion::toWxString(fmt.str()));
256 i++;
257
258 // input operands
259 for (int j = 1; j <= op->numberOfInputs(); j++) {
260 Operand& operand = op->operand(j);
261 InsertItem(i, _T(""));
262 wxString index = WxConversion::toWxString(j);
264 index.Prepend(WxConversion::toWxString(fmt.str()));
265 SetItem(i, 1, index);
266 i++;
267
268 InsertItem(i, _T(""));
270 SetItem(i, 1, WxConversion::toWxString(fmt.str()));
271 SetItem(i, 2, WxConversion::toWxString(operand.typeString()));
272 i++;
273
274 InsertItem(i, _T(""));
276 SetItem(i, 1, WxConversion::toWxString(fmt.str()));
277
278 // is operand address?
279 if (operand.isAddress()) {
280 SetItem(i, 2, WxConversion::toWxString(yesFmt.str()));
281 } else {
282 SetItem(i, 2, WxConversion::toWxString(noFmt.str()));
283 }
284 i++;
285
286 InsertItem(i, _T(""));
288 SetItem(i, 1, WxConversion::toWxString(fmt.str()));
289
290 // is operand memory data?
291 if (operand.isMemoryData()) {
292 SetItem(i, 2, WxConversion::toWxString(yesFmt.str()));
293 } else {
294 SetItem(i, 2, WxConversion::toWxString(noFmt.str()));
295 }
296
297 i++;
298 set<int> canSwap = operand.swap();
299 set<int>::iterator it = canSwap.begin();
300
301 // can swap list
302 while (it != canSwap.end()) {
303 wxString opId = WxConversion::toWxString(*it);
304 opId.Prepend(_T("id: "));
305 if (it == canSwap.begin()) {
306 InsertItem(i, _T(""));
308 SetItem(i, 1, WxConversion::toWxString(fmt.str()));
309 SetItem(i, 2, opId);
310
311 } else {
312 InsertItem(i, _T(""));
313 SetItem(i, 2, opId);
314 }
315 i++;
316 it++;
317 }
318 }
319
321 InsertItem(i, WxConversion::toWxString(fmt.str()));
322 i++;
323
324 // outputs
325 for (int j = op->numberOfInputs() + 1;
326 j <= op->numberOfOutputs() + op->numberOfInputs(); j++) {
327
328 Operand& operand = op->operand(j);
329 InsertItem(i, _T(""));
330 wxString opId = WxConversion::toWxString(j);
332 opId.Prepend(WxConversion::toWxString(fmt.str()));
333 SetItem(i, 1, opId);
334 i++;
335
336 InsertItem(i, _T(""));
338 SetItem(i, 1, WxConversion::toWxString(fmt.str()));
339 SetItem(i, 2, WxConversion::toWxString(operand.typeString()));
340 i++;
341
342 InsertItem(i, _T(""));
344 SetItem(i, 1, WxConversion::toWxString(fmt.str()));
345
346 // is operand memory data?
347 if (operand.isMemoryData()) {
348 SetItem(i, 2, WxConversion::toWxString(yesFmt.str()));
349 } else {
350 SetItem(i, 2, WxConversion::toWxString(noFmt.str()));
351 }
352 i++;
353 }
354
356 InsertItem(i, WxConversion::toWxString(fmt.str()));
357
358 if (op->canBeSimulated()) {
359 SetItem(i, 1, WxConversion::toWxString(yesFmt.str()));
360 } else {
361 SetItem(i, 1, WxConversion::toWxString(noFmt.str()));
362 }
363
364 delete op;
366}
void insertOperationPropertyColumns()
int writeStaticPropertiesOfOperation(Operation *op)
@ TXT_ROW_HAS_BEHAVIOR
Has behavior row label.
@ TXT_ROW_AFFECTS
Affects row label.
@ TXT_ROW_TYPE
Type row label.
@ TXT_ROW_OUTPUT_OPERANDS
Output operands row label.
@ TXT_ROW_MEMORY_ADDRESS
Memory address row label.
@ TXT_ROW_ID
Id row label.
@ TXT_ROW_CAN_SWAP
Can swap row label.
@ TXT_ROW_INPUT_OPERANDS
Input operands row label.
@ TXT_ROW_AFFECTED_BY
Affected by row label.
@ TXT_ROW_MEMORY_DATA
Memory data row label.
virtual const std::string & typeString() const
Definition Operand.cc:185
virtual bool isMemoryData() const
Definition Operand.cc:351
virtual bool isAddress() const
Definition Operand.cc:328
virtual const std::set< int > & swap() const
Definition Operand.cc:361
static Operation * operation(const std::string &path, const std::string &module, const std::string &oper)
virtual int affectedByCount() const
Definition Operation.cc:416
virtual TCEString affectedBy(unsigned int i) const
Definition Operation.cc:447
virtual int affectsCount() const
Definition Operation.cc:402
virtual int numberOfInputs() const
Definition Operation.cc:192
virtual bool canBeSimulated() const
Definition Operation.cc:612
virtual TCEString affects(unsigned int i) const
Definition Operation.cc:431
virtual int numberOfOutputs() const
Definition Operation.cc:202
virtual Operand & operand(int id) const
Definition Operation.cc:541

References Operation::affectedBy(), Operation::affectedByCount(), Operation::affects(), Operation::affectsCount(), Operation::canBeSimulated(), clear(), insertOperationPropertyColumns(), OSEdTextGenerator::instance(), Operand::isAddress(), Operand::isMemoryData(), mode_, MODE_PROPERTY, Operation::numberOfInputs(), Operation::numberOfOutputs(), Operation::operand(), OperationContainer::operation(), Operand::swap(), Texts::TextGenerator::text(), WxConversion::toWxString(), OSEdTextGenerator::TXT_ROW_AFFECTED_BY, OSEdTextGenerator::TXT_ROW_AFFECTS, OSEdTextGenerator::TXT_ROW_CAN_SWAP, OSEdTextGenerator::TXT_ROW_FALSE, OSEdTextGenerator::TXT_ROW_HAS_BEHAVIOR, OSEdTextGenerator::TXT_ROW_ID, OSEdTextGenerator::TXT_ROW_INPUT_OPERANDS, OSEdTextGenerator::TXT_ROW_MEMORY_ADDRESS, OSEdTextGenerator::TXT_ROW_MEMORY_DATA, OSEdTextGenerator::TXT_ROW_NO, OSEdTextGenerator::TXT_ROW_OUTPUT_OPERANDS, OSEdTextGenerator::TXT_ROW_TRUE, OSEdTextGenerator::TXT_ROW_TYPE, OSEdTextGenerator::TXT_ROW_YES, Operand::typeString(), and writeStaticPropertiesOfOperation().

Referenced by OSEdTreeView::onItemSelected(), and OSEdTreeView::update().

Here is the call graph for this function:

◆ operationView()

void OSEdInfoView::operationView ( const std::string &  path,
const std::string &  mod 
)

Shows the operation view.

Parameters
pathThe path of the module.
modThe name of the module.

Definition at line 161 of file OSEdInfoView.cc.

161 {
162
164 OperationModule& module = OperationContainer::module(path, mod);
165 clear();
168 InsertColumn(
169 0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
171
172 int operations = 0;
173 try {
174 operations = index.operationCount(module);
175 } catch (const Exception& e) {
176 return;
177 }
178 for (int j = 0; j < operations; j++) {
179 string name = index.operationName(j, module);
180 wxListItem item;
181 if (OperationContainer::isEffective(module, name)) {
182 // operation is effective, let's put it with bold font
183 wxFont boldFont = wxFont(10, wxROMAN, wxNORMAL, wxBOLD);
184 item.SetFont(boldFont);
185 }
186 item.SetId(j);
187 int index = InsertItem(item);
188 SetItemText(index, WxConversion::toWxString(name));
189 }
190
192}
@ TXT_COLUMN_OPERATIONS
Operations column header.
static bool isEffective(OperationModule &module, const std::string &name)
std::string operationName(int i, const OperationModule &om)
int operationCount(const OperationModule &om)

References clear(), OSEdConstants::DEFAULT_COLUMN_WIDTH, OSEdTextGenerator::instance(), OperationContainer::isEffective(), mode_, MODE_OPERATION, OperationIndex::operationCount(), OperationContainer::operationIndex(), OperationIndex::operationName(), Texts::TextGenerator::text(), WxConversion::toWxString(), and OSEdTextGenerator::TXT_COLUMN_OPERATIONS.

Referenced by OSEdRemoveOperationCmd::Do(), OSEdTreeView::onItemSelected(), and OSEdTreeView::update().

Here is the call graph for this function:

◆ pathView()

void OSEdInfoView::pathView ( )

Shows the search path view.

Definition at line 98 of file OSEdInfoView.cc.

98 {
99
100 clear();
103 InsertColumn(
104 0, WxConversion::toWxString(fmt.str()), wxLIST_FORMAT_LEFT,
106
107 vector<string> paths = Environment::osalPaths();
108 for (size_t i = 0; i < paths.size(); i++) {
109 wxListItem item;
110 if (FileSystem::fileExists(paths[i])) {
111 // path exists, let's write it bold
112 wxFont boldFont = wxFont(10, wxROMAN, wxNORMAL, wxBOLD);
113 item.SetFont(boldFont);
114 }
115 item.SetId(i);
116 int index = InsertItem(item);
117 SetItemText(index, WxConversion::toWxString(paths[i]));
118 }
119
121}
static std::vector< std::string > osalPaths()
static bool fileExists(const std::string fileName)
@ TXT_COLUMN_SEARCH_PATHS
Search path column header.

References clear(), OSEdConstants::DEFAULT_COLUMN_WIDTH, FileSystem::fileExists(), OSEdTextGenerator::instance(), mode_, MODE_PATH, Environment::osalPaths(), Texts::TextGenerator::text(), WxConversion::toWxString(), and OSEdTextGenerator::TXT_COLUMN_SEARCH_PATHS.

Referenced by OSEdTreeView::constructTree(), OSEdTreeView::onItemSelected(), and OSEdTreeView::update().

Here is the call graph for this function:

◆ selectedModule()

string OSEdInfoView::selectedModule ( )

Returns the selected module.

If no module is selected, returns an empty string.

Returns
The selected module.

Definition at line 510 of file OSEdInfoView.cc.

510 {
511
512 if (mode_ != MODE_MODULE || GetSelectedItemCount() != 1) {
513 return "";
514 }
515 return WidgetTools::lcStringSelection(this, 0);
516}
static std::string lcStringSelection(wxListCtrl *list, int column)

References WidgetTools::lcStringSelection(), mode_, and MODE_MODULE.

Referenced by OSEdTreeView::isModuleSelected().

Here is the call graph for this function:

◆ selectedOperation()

string OSEdInfoView::selectedOperation ( )

Returns the selected operation.

If no operation is selected, return empty string.

Returns
The selected operation.

Definition at line 526 of file OSEdInfoView.cc.

526 {
527
528 if(mode_ != MODE_OPERATION || GetSelectedItemCount() != 1) {
529 return "";
530 }
531 return WidgetTools::lcStringSelection(this, 0);
532}

References WidgetTools::lcStringSelection(), mode_, and MODE_OPERATION.

Referenced by OSEdTreeView::isOperationSelected(), OSEdTreeView::selectedOperation(), and OSEdTreeView::selectedOperationId().

Here is the call graph for this function:

◆ selectedPath()

string OSEdInfoView::selectedPath ( )

Returns the selected path.

If path is not selected returns an empty string.

Returns
The selected path.

Definition at line 493 of file OSEdInfoView.cc.

493 {
494
495 if (mode_ != MODE_PATH || GetSelectedItemCount() != 1) {
496 return "";
497 }
498
499 return WidgetTools::lcStringSelection(this, 0);
500}

References WidgetTools::lcStringSelection(), mode_, and MODE_PATH.

Referenced by OSEdTreeView::isPathSelected(), OSEdTreeView::selectedPath(), and OSEdTreeView::selectedPathId().

Here is the call graph for this function:

◆ writeStaticPropertiesOfOperation()

int OSEdInfoView::writeStaticPropertiesOfOperation ( Operation op)
private

Writes the "static" operation properties in operation property view

Parameters
opOperation which static properties are written.
Returns
Number of written properties.

Definition at line 398 of file OSEdInfoView.cc.

398 {
399
401
402 format trueFmt = texts.text(OSEdTextGenerator::TXT_ROW_TRUE);
403 format falseFmt = texts.text(OSEdTextGenerator::TXT_ROW_FALSE);
404
405 // row counter
406 int i = 0;
407
408 // name of the operation
409 format fmt = texts.text(OSEdTextGenerator::TXT_ROW_NAME);
410 InsertItem(i, WxConversion::toWxString(fmt.str()));
411 SetItem(i, 1, WxConversion::toWxString(op->name()));
412 i++;
413
414 // description of the operation
416 InsertItem(i, WxConversion::toWxString(fmt.str()));
417 SetItem(i, 1, WxConversion::toWxString(op->description()));
418 i++;
419
420 // number of inputs
422 InsertItem(i, WxConversion::toWxString(fmt.str()));
423 SetItem(i, 1, WxConversion::toWxString(op->numberOfInputs()));
424 i++;
425
426 // number of outputs
428 InsertItem(i, WxConversion::toWxString(fmt.str()));
429 SetItem(i, 1, WxConversion::toWxString(op->numberOfOutputs()));
430 i++;
431
432 // reads memory
434 InsertItem(i, WxConversion::toWxString(fmt.str()));
435 if (op->readsMemory()) {
436 SetItem(i, 1, WxConversion::toWxString(trueFmt.str()));
437 } else {
438 SetItem(i, 1, WxConversion::toWxString(falseFmt.str()));
439 }
440 i++;
441
442 // writes memory
444 InsertItem(i, WxConversion::toWxString(fmt.str()));
445 if (op->writesMemory()) {
446 SetItem(i, 1, WxConversion::toWxString(trueFmt.str()));
447 } else {
448 SetItem(i, 1, WxConversion::toWxString(falseFmt.str()));
449 }
450 i++;
451
452 // can trap
454 InsertItem(i, WxConversion::toWxString(fmt.str()));
455 if (op->canTrap()) {
456 SetItem(i, 1, WxConversion::toWxString(trueFmt.str()));
457 } else {
458 SetItem(i, 1, WxConversion::toWxString(falseFmt.str()));
459 }
460 i++;
461
462 // has side effects
464 InsertItem(i, WxConversion::toWxString(fmt.str()));
465 if (op->hasSideEffects()) {
466 SetItem(i, 1, WxConversion::toWxString(trueFmt.str()));
467 } else {
468 SetItem(i, 1, WxConversion::toWxString(falseFmt.str()));
469 }
470 i++;
471
472 // is clocked
474 InsertItem(i, WxConversion::toWxString(fmt.str()));
475 if (op->isClocked()) {
476 SetItem(i, 1, WxConversion::toWxString(trueFmt.str()));
477 } else {
478 SetItem(i, 1, WxConversion::toWxString(falseFmt.str()));
479 }
480 i++;
481
482 return i;
483}
@ TXT_ROW_NAME
Name row label.
@ TXT_ROW_DESCRIPTION
Description row label.
@ TXT_ROW_CLOCKED
Clocked row label.
@ TXT_ROW_HAS_SIDE_EFFECTS
Has side effects row label.
@ TXT_ROW_INPUTS
Inputs row label.
@ TXT_ROW_OUTPUTS
Outputs row label.
@ TXT_ROW_READS_MEMORY
Reads memory row label.
@ TXT_ROW_CAN_TRAP
Can trap row label.
@ TXT_ROW_WRITES_MEMORY
Writes memory row label.
virtual bool readsMemory() const
Definition Operation.cc:242
virtual TCEString name() const
Definition Operation.cc:93
virtual TCEString description() const
Definition Operation.cc:103
virtual bool canTrap() const
Definition Operation.cc:262
virtual bool hasSideEffects() const
Definition Operation.cc:272
virtual bool isClocked() const
Definition Operation.cc:282
virtual bool writesMemory() const
Definition Operation.cc:252

References Operation::canTrap(), Operation::description(), Operation::hasSideEffects(), OSEdTextGenerator::instance(), Operation::isClocked(), Operation::name(), Operation::numberOfInputs(), Operation::numberOfOutputs(), Operation::readsMemory(), Texts::TextGenerator::text(), WxConversion::toWxString(), OSEdTextGenerator::TXT_ROW_CAN_TRAP, OSEdTextGenerator::TXT_ROW_CLOCKED, OSEdTextGenerator::TXT_ROW_DESCRIPTION, OSEdTextGenerator::TXT_ROW_FALSE, OSEdTextGenerator::TXT_ROW_HAS_SIDE_EFFECTS, OSEdTextGenerator::TXT_ROW_INPUTS, OSEdTextGenerator::TXT_ROW_NAME, OSEdTextGenerator::TXT_ROW_OUTPUTS, OSEdTextGenerator::TXT_ROW_READS_MEMORY, OSEdTextGenerator::TXT_ROW_TRUE, OSEdTextGenerator::TXT_ROW_WRITES_MEMORY, and Operation::writesMemory().

Referenced by operationPropertyView().

Here is the call graph for this function:

Member Data Documentation

◆ mode_

InfoMode OSEdInfoView::mode_
private

The documentation for this class was generated from the following files: