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

#include <AddFUFromHDBCmd.hh>

Inheritance diagram for AddFUFromHDBCmd:
Inheritance graph
Collaboration diagram for AddFUFromHDBCmd:
Collaboration graph

Public Member Functions

 AddFUFromHDBCmd ()
 
virtual ~AddFUFromHDBCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual AddFUFromHDBCmdcreate () 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

wxCommand for opening a dialog for adding function units from a HDB.

Definition at line 41 of file AddFUFromHDBCmd.hh.

Constructor & Destructor Documentation

◆ AddFUFromHDBCmd()

AddFUFromHDBCmd::AddFUFromHDBCmd ( )

The Constructor.

Definition at line 48 of file AddFUFromHDBCmd.cc.

Referenced by create().

◆ ~AddFUFromHDBCmd()

AddFUFromHDBCmd::~AddFUFromHDBCmd ( )
virtual

The Destructor.

Definition at line 56 of file AddFUFromHDBCmd.cc.

56 {}

Member Function Documentation

◆ create()

AddFUFromHDBCmd * AddFUFromHDBCmd::create ( ) const
virtual

Creates and returns a new instance of this command.

Implements GUICommand.

Definition at line 94 of file AddFUFromHDBCmd.cc.

94  {
95  return new AddFUFromHDBCmd();
96 }

References AddFUFromHDBCmd().

Here is the call graph for this function:

◆ Do()

bool AddFUFromHDBCmd::Do ( )
virtual

Executes the command.

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

Implements GUICommand.

Definition at line 65 of file AddFUFromHDBCmd.cc.

65  {
66 
67  assert(parentWindow() != NULL);
68  assert(view() != NULL);
69 
70  Model* model = dynamic_cast<MDFDocument*>(
71  view()->GetDocument())->getModel();
72 
73 
74  AddFUFromHDBDialog dialog(parentWindow(), model);
75 
76  dialog.ShowModal();
77  return true;
78 }

References assert, GUICommand::parentWindow(), and EditorCommand::view().

Here is the call graph for this function:

◆ icon()

string AddFUFromHDBCmd::icon ( ) const
virtual

Returns path to the command's icon file.

Reimplemented from EditorCommand.

Definition at line 104 of file AddFUFromHDBCmd.cc.

104  {
106 }

References ProDeConstants::CMD_ICON_DEFAULT.

◆ id()

int AddFUFromHDBCmd::id ( ) const
virtual

Returns id of this command.

Implements GUICommand.

Definition at line 85 of file AddFUFromHDBCmd.cc.

85  {
87 }

References ProDeConstants::COMMAND_ADD_FU_FROM_HDB.

◆ isEnabled()

bool AddFUFromHDBCmd::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 126 of file AddFUFromHDBCmd.cc.

126  {
127  wxDocManager* manager = wxGetApp().docManager();
128  if (manager->GetCurrentView() != NULL) {
129  return true;
130  }
131  return false;
132 }

◆ shortName()

string AddFUFromHDBCmd::shortName ( ) const
virtual

Returns short version of the command name.

Reimplemented from GUICommand.

Definition at line 113 of file AddFUFromHDBCmd.cc.

113  {
115 }

References ProDeConstants::CMD_SNAME_ADD_FU_FROM_HDB.


The documentation for this class was generated from the following files:
ProDeConstants::COMMAND_ADD_FU_FROM_HDB
@ COMMAND_ADD_FU_FROM_HDB
Definition: ProDeConstants.hh:428
AddFUFromHDBDialog
Definition: AddFUFromHDBDialog.hh:64
ProDeConstants::CMD_SNAME_ADD_FU_FROM_HDB
static const std::string CMD_SNAME_ADD_FU_FROM_HDB
Short command name for the "Add FU from hdb" command.
Definition: ProDeConstants.hh:226
EditorCommand::EditorCommand
EditorCommand(std::string name, wxWindow *parent=NULL)
Definition: EditorCommand.cc:42
assert
#define assert(condition)
Definition: Application.hh:86
EditorCommand::view
wxView * view() const
Definition: EditorCommand.cc:76
MDFDocument
Definition: MDFDocument.hh:51
ProDeConstants::CMD_ICON_DEFAULT
static const std::string CMD_ICON_DEFAULT
Icon path for default icon of commands.
Definition: ProDeConstants.hh:286
Model
Definition: Model.hh:50
ProDeConstants::CMD_NAME_ADD_FU_FROM_HDB
static const std::string CMD_NAME_ADD_FU_FROM_HDB
Command name for the "Add FU From hdb" command.
Definition: ProDeConstants.hh:114
AddFUFromHDBCmd::AddFUFromHDBCmd
AddFUFromHDBCmd()
Definition: AddFUFromHDBCmd.cc:48
GUICommand::parentWindow
wxWindow * parentWindow() const
Definition: GUICommand.cc:75