OpenASIP  2.0
Public Member Functions | List of all members
CallExplorerPluginCmd Class Reference

#include <CallExplorerPluginCmd.hh>

Inheritance diagram for CallExplorerPluginCmd:
Inheritance graph
Collaboration diagram for CallExplorerPluginCmd:
Collaboration graph

Public Member Functions

 CallExplorerPluginCmd ()
 
virtual ~CallExplorerPluginCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual CallExplorerPluginCmdcreate () const
 
virtual std::string icon () const
 
virtual std::string shortName () const
 
virtual bool isEnabled ()
 
- Public Member Functions inherited from EditorCommand
 EditorCommand (std::string name, wxWindow *parent=NULL)
 
virtual ~EditorCommand ()
 
void setView (wxView *view)
 
wxView * view () const
 
- Public Member Functions inherited from GUICommand
 GUICommand (std::string name, wxWindow *parent)
 
virtual ~GUICommand ()
 
virtual bool isChecked () const
 
void setParentWindow (wxWindow *view)
 
wxWindow * parentWindow () const
 
std::string name () const
 

Detailed Description

Command for opening explorer plugin call window.

Definition at line 43 of file CallExplorerPluginCmd.hh.

Constructor & Destructor Documentation

◆ CallExplorerPluginCmd()

CallExplorerPluginCmd::CallExplorerPluginCmd ( )

The Constructor.

Definition at line 46 of file CallExplorerPluginCmd.cc.

Referenced by create().

◆ ~CallExplorerPluginCmd()

CallExplorerPluginCmd::~CallExplorerPluginCmd ( )
virtual

The Destructor.

Definition at line 55 of file CallExplorerPluginCmd.cc.

55 {}

Member Function Documentation

◆ create()

CallExplorerPluginCmd * CallExplorerPluginCmd::create ( ) const
virtual

Creates and returns a new instance of this command.

Implements GUICommand.

Definition at line 101 of file CallExplorerPluginCmd.cc.

101  {
102  return new CallExplorerPluginCmd();
103 }

References CallExplorerPluginCmd().

Here is the call graph for this function:

◆ Do()

bool CallExplorerPluginCmd::Do ( )
virtual

Executes the command.

Returns
True, if the command was succesfully executed, false otherwise.

Implements GUICommand.

Definition at line 64 of file CallExplorerPluginCmd.cc.

64  {
65 
66  TTAMachine::Machine* machine = dynamic_cast<MDFDocument*>(
67  view()->GetDocument())->getModel()->getMachine();
68 
69  Model* model = dynamic_cast<MDFDocument*>(
70  view()->GetDocument())->getModel();
71 
72  model->pushToStack();
73 
74  CallExplorerPluginWindow dialog(parentWindow(), *machine, *model);
75 
76  if (dialog.ShowModal() == wxID_OK) {
77  model->notifyObservers();
78  return true;
79  } else {
80  model->popFromStack();
81  return false;
82  }
83 
84  return true;
85 }

References machine, Model::notifyObservers(), GUICommand::parentWindow(), Model::popFromStack(), Model::pushToStack(), and EditorCommand::view().

Here is the call graph for this function:

◆ icon()

string CallExplorerPluginCmd::icon ( ) const
virtual

Returns path to the command's icon file.

Reimplemented from EditorCommand.

Definition at line 111 of file CallExplorerPluginCmd.cc.

111  {
113 }

References ProDeConstants::CMD_ICON_EXPLORER_PLUGIN.

◆ id()

int CallExplorerPluginCmd::id ( ) const
virtual

Returns id of this command.

Implements GUICommand.

Definition at line 92 of file CallExplorerPluginCmd.cc.

References ProDeConstants::COMMAND_CALL_EXPLORER_PLUGIN.

◆ isEnabled()

bool CallExplorerPluginCmd::isEnabled ( )
virtual

Returns true when the command is executable, false when not.

This command is executable when a document is open.

Returns
True, if a document is open.

Reimplemented from EditorCommand.

Definition at line 133 of file CallExplorerPluginCmd.cc.

133  {
134  wxDocManager* manager = wxGetApp().docManager();
135  if (manager->GetCurrentView() != NULL) {
136  return true;
137  }
138  return false;
139 }

◆ shortName()

string CallExplorerPluginCmd::shortName ( ) const
virtual

Returns short version of the command name.

Reimplemented from GUICommand.

Definition at line 120 of file CallExplorerPluginCmd.cc.

120  {
122 }

References ProDeConstants::CMD_SNAME_EXPLORER_PLUGIN.


The documentation for this class was generated from the following files:
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
ProDeConstants::CMD_ICON_EXPLORER_PLUGIN
static const std::string CMD_ICON_EXPLORER_PLUGIN
Icon location for the "Explorer plugin" command.
Definition: ProDeConstants.hh:352
Model::pushToStack
void pushToStack()
Definition: Model.cc:167
EditorCommand::EditorCommand
EditorCommand(std::string name, wxWindow *parent=NULL)
Definition: EditorCommand.cc:42
Model::notifyObservers
void notifyObservers(bool modified=true)
Definition: Model.cc:152
ProDeConstants::CMD_SNAME_EXPLORER_PLUGIN
static const std::string CMD_SNAME_EXPLORER_PLUGIN
Command name for the "Call Explorer Plugin" command.
Definition: ProDeConstants.hh:253
EditorCommand::view
wxView * view() const
Definition: EditorCommand.cc:76
CallExplorerPluginWindow
Definition: CallExplorerPlugin.hh:52
ProDeConstants::COMMAND_CALL_EXPLORER_PLUGIN
@ COMMAND_CALL_EXPLORER_PLUGIN
Definition: ProDeConstants.hh:459
Model::popFromStack
void popFromStack(bool modified=false)
Definition: Model.cc:195
MDFDocument
Definition: MDFDocument.hh:51
Model
Definition: Model.hh:50
CallExplorerPluginCmd::CallExplorerPluginCmd
CallExplorerPluginCmd()
Definition: CallExplorerPluginCmd.cc:46
ProDeConstants::CMD_CALL_EXPLORER_PLUGIN
static const std::string CMD_CALL_EXPLORER_PLUGIN
Command name for the "Call Explorer plugin" command.
Definition: ProDeConstants.hh:173
GUICommand::parentWindow
wxWindow * parentWindow() const
Definition: GUICommand.cc:75
TTAMachine::Machine
Definition: Machine.hh:73