OpenASIP  2.0
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. More...
 
OSEdSimulateCmdoperator= (const OSEdSimulateCmd &)
 Assignment not allowed. More...
 

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 }

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 }

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 }

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 }

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:
OSEdTreeView::pathOfModule
std::string pathOfModule(wxTreeItemId id)
Definition: OSEdTreeView.cc:431
OSEdTreeView::moduleIdOfOperation
wxTreeItemId moduleIdOfOperation(wxTreeItemId id)
Definition: OSEdTreeView.cc:420
SimulateDialog
Definition: SimulateDialog.hh:53
Operation::canBeSimulated
virtual bool canBeSimulated() const
Definition: Operation.cc:612
OSEdMainFrame::treeView
OSEdTreeView * treeView() const
Definition: OSEdMainFrame.cc:241
OSEdConstants::CMD_SIMULATE
@ CMD_SIMULATE
Simulate command id.
Definition: OSEdConstants.hh:100
OSEdTreeView
Definition: OSEdTreeView.hh:54
OSEdTreeView::moduleOfOperation
std::string moduleOfOperation(wxTreeItemId id)
Definition: OSEdTreeView.cc:407
OSEdTreeView::isOperationSelected
bool isOperationSelected() const
Definition: OSEdTreeView.cc:745
OSEdTreeView::selectedOperation
Operation * selectedOperation()
Definition: OSEdTreeView.cc:328
Operation
Definition: Operation.hh:59
OSEdMainFrame
Definition: OSEdMainFrame.hh:49
GUICommand::GUICommand
GUICommand(std::string name, wxWindow *parent)
Definition: GUICommand.cc:42
OSEdSimulateCmd::OSEdSimulateCmd
OSEdSimulateCmd()
Definition: OSEdSimulateCmd.cc:50
OSEdTreeView::selectedOperationId
wxTreeItemId selectedOperationId()
Definition: OSEdTreeView.cc:379
GUICommand::parentWindow
wxWindow * parentWindow() const
Definition: GUICommand.cc:75
OSEdConstants::CMD_NAME_SIMULATE
static const std::string CMD_NAME_SIMULATE
Simulate command name.
Definition: OSEdConstants.hh:59