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

#include <OSEdSimulateCmd.hh>

Inheritance diagram for OSEdSimulateCmd:
Inheritance graph
Collaboration diagram for OSEdSimulateCmd:
Collaboration graph

Public Member Functions

 OSEdSimulateCmd ()
 
virtual ~OSEdSimulateCmd ()
 
virtual int id () const
 
virtual GUICommandcreate () const
 
virtual bool Do ()
 
virtual bool isEnabled ()
 
virtual std::string icon () const
 
- Public Member Functions inherited from GUICommand
 GUICommand (std::string name, wxWindow *parent)
 
virtual ~GUICommand ()
 
virtual bool isChecked () const
 
virtual std::string shortName () const
 
void setParentWindow (wxWindow *view)
 
wxWindow * parentWindow () const
 
std::string name () const
 

Private Member Functions

 OSEdSimulateCmd (const OSEdSimulateCmd &)
 Copying not allowed.
 
OSEdSimulateCmdoperator= (const OSEdSimulateCmd &)
 Assignment not allowed.
 

Detailed Description

Executes the command when operation is simulated.

Definition at line 43 of file OSEdSimulateCmd.hh.

Constructor & Destructor Documentation

◆ OSEdSimulateCmd() [1/2]

OSEdSimulateCmd::OSEdSimulateCmd ( )

Constructor.

Definition at line 50 of file OSEdSimulateCmd.cc.

50 :
52}
static const std::string CMD_NAME_SIMULATE
Simulate command name.

Referenced by create().

◆ ~OSEdSimulateCmd()

OSEdSimulateCmd::~OSEdSimulateCmd ( )
virtual

Destructor.

Definition at line 57 of file OSEdSimulateCmd.cc.

57 {
58}

◆ OSEdSimulateCmd() [2/2]

OSEdSimulateCmd::OSEdSimulateCmd ( const OSEdSimulateCmd )
private

Copying not allowed.

Member Function Documentation

◆ create()

GUICommand * OSEdSimulateCmd::create ( ) const
virtual

Creates a new command.

Returns
The created command.

Implements GUICommand.

Definition at line 76 of file OSEdSimulateCmd.cc.

76 {
77 return new OSEdSimulateCmd();
78}

References OSEdSimulateCmd().

Here is the call graph for this function:

◆ Do()

bool OSEdSimulateCmd::Do ( )
virtual

Executes the command.

Returns
Always true.

Implements GUICommand.

Definition at line 86 of file OSEdSimulateCmd.cc.

86 {
87
88 OSEdMainFrame* mainFrame = wxGetApp().mainFrame();
89 OSEdTreeView* treeView = mainFrame->treeView();
90 Operation* op = treeView->selectedOperation();
91 wxTreeItemId opId = treeView->selectedOperationId();
92 string modName = treeView->moduleOfOperation(opId);
93 wxTreeItemId modId = treeView->moduleIdOfOperation(opId);
94 string pathName = treeView->pathOfModule(modId);
95
96 //OperationModule& module = OperationContainer::module(pathName, modName);
97
98 SimulateDialog* dialog =
99 new SimulateDialog(parentWindow(), op, pathName, modName);
100 dialog->ShowModal();
101 return true;
102}
wxWindow * parentWindow() const
Definition GUICommand.cc:75
OSEdTreeView * treeView() const
std::string pathOfModule(wxTreeItemId id)
wxTreeItemId selectedOperationId()
Operation * selectedOperation()
wxTreeItemId moduleIdOfOperation(wxTreeItemId id)
std::string moduleOfOperation(wxTreeItemId id)

References OSEdTreeView::moduleIdOfOperation(), OSEdTreeView::moduleOfOperation(), GUICommand::parentWindow(), OSEdTreeView::pathOfModule(), OSEdTreeView::selectedOperation(), OSEdTreeView::selectedOperationId(), and OSEdMainFrame::treeView().

Here is the call graph for this function:

◆ icon()

string OSEdSimulateCmd::icon ( ) const
virtual

Return icon path.

Returns
Empty string (icons not used).

Implements GUICommand.

Definition at line 128 of file OSEdSimulateCmd.cc.

128 {
129 return "";
130}

◆ id()

int OSEdSimulateCmd::id ( ) const
virtual

Returns the id of the command.

Returns
The id of the command.

Implements GUICommand.

Definition at line 66 of file OSEdSimulateCmd.cc.

66 {
68}
@ CMD_SIMULATE
Simulate command id.

References OSEdConstants::CMD_SIMULATE.

◆ isEnabled()

bool OSEdSimulateCmd::isEnabled ( )
virtual

Returns true if command is enabled.

Command is enabled, if selected operation has behavior module.

Returns
True if command is enabled.

Implements GUICommand.

Definition at line 112 of file OSEdSimulateCmd.cc.

112 {
113 OSEdTreeView* treeView = wxGetApp().mainFrame()->treeView();
114 Operation* op = treeView->selectedOperation();
115
116 if (treeView->isOperationSelected() && op != NULL) {
117 return op->canBeSimulated();
118 }
119 return false;
120}
bool isOperationSelected() const
virtual bool canBeSimulated() const
Definition Operation.cc:612

References Operation::canBeSimulated(), OSEdTreeView::isOperationSelected(), and OSEdTreeView::selectedOperation().

Here is the call graph for this function:

◆ operator=()

OSEdSimulateCmd & OSEdSimulateCmd::operator= ( const OSEdSimulateCmd )
private

Assignment not allowed.


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