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

#include <AddRFArchitectureCmd.hh>

Inheritance diagram for AddRFArchitectureCmd:
Inheritance graph
Collaboration diagram for AddRFArchitectureCmd:
Collaboration graph

Public Member Functions

 AddRFArchitectureCmd ()
 
virtual ~AddRFArchitectureCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual AddRFArchitectureCmdcreate () const
 
virtual std::string icon () const
 
virtual bool isEnabled ()
 
- 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
 

Detailed Description

Command for adding a new register file archtiecture to a HDB.

Definition at line 41 of file AddRFArchitectureCmd.hh.

Constructor & Destructor Documentation

◆ AddRFArchitectureCmd()

AddRFArchitectureCmd::AddRFArchitectureCmd ( )

The Constructor.

Definition at line 47 of file AddRFArchitectureCmd.cc.

Referenced by create().

◆ ~AddRFArchitectureCmd()

AddRFArchitectureCmd::~AddRFArchitectureCmd ( )
virtual

The Destructor.

Definition at line 55 of file AddRFArchitectureCmd.cc.

55  {
56 }

Member Function Documentation

◆ create()

AddRFArchitectureCmd * AddRFArchitectureCmd::create ( ) const
virtual

Creates and returns a new instance of this command.

Returns
A new instance of this command.

Implements GUICommand.

Definition at line 111 of file AddRFArchitectureCmd.cc.

111  {
112  return new AddRFArchitectureCmd();
113 }

References AddRFArchitectureCmd().

Here is the call graph for this function:

◆ Do()

bool AddRFArchitectureCmd::Do ( )
virtual

Executes the command.

Implements GUICommand.

Definition at line 62 of file AddRFArchitectureCmd.cc.

62  {
63 
64  HDB::HDBManager* manager = wxGetApp().mainFrame().hdbManager();
65  if (manager == NULL) {
66  return false;
67  }
68 
69  HDB::RFArchitecture arch(1, 1, 1, 1, 0, 1, false);
70 
71  RFArchitectureDialog dialog(parentWindow(), -1, arch);
72 
73  if (dialog.ShowModal() != wxID_OK) {
74  return false;
75  }
76 
77  int id = manager->addRFArchitecture(arch);
78  wxGetApp().mainFrame().update();
79  wxGetApp().mainFrame().browser()->selectRFArchitecture(id);
80  return true;
81 }

References HDB::HDBManager::addRFArchitecture(), and GUICommand::parentWindow().

Here is the call graph for this function:

◆ icon()

std::string AddRFArchitectureCmd::icon ( ) const
virtual

Returns name of the command icon file.

Returns
Command icon file name.

Implements GUICommand.

Definition at line 89 of file AddRFArchitectureCmd.cc.

89  {
90  return "";
91 }

◆ id()

int AddRFArchitectureCmd::id ( ) const
virtual

Returns the command identifier.

Returns
Command identifier for this command.

Implements GUICommand.

Definition at line 100 of file AddRFArchitectureCmd.cc.

References HDBEditorConstants::COMMAND_ADD_RF_ARCHITECTURE.

◆ isEnabled()

bool AddRFArchitectureCmd::isEnabled ( )
virtual

Returns true if the command should be enabled in menu/toolbar, false if not.

Returns
True, if the command is enabled, false if not.

Implements GUICommand.

Definition at line 122 of file AddRFArchitectureCmd.cc.

122  {
123 
124  HDB::HDBManager* manager = wxGetApp().mainFrame().hdbManager();
125 
126  if (manager == NULL) {
127  return false;
128  }
129  return true;
130 }

The documentation for this class was generated from the following files:
HDB::HDBManager::addRFArchitecture
RowID addRFArchitecture(const RFArchitecture &architecture) const
Definition: HDBManager.cc:1461
AddRFArchitectureCmd::AddRFArchitectureCmd
AddRFArchitectureCmd()
Definition: AddRFArchitectureCmd.cc:47
HDBEditorConstants::COMMAND_NAME_ADD_RF_ARCHITECTURE
static const std::string COMMAND_NAME_ADD_RF_ARCHITECTURE
Name of the add rf architecture.
Definition: HDBEditorConstants.hh:84
HDB::HDBManager
Definition: HDBManager.hh:82
HDB::RFArchitecture
Definition: RFArchitecture.hh:50
GUICommand::GUICommand
GUICommand(std::string name, wxWindow *parent)
Definition: GUICommand.cc:42
HDBEditorConstants::COMMAND_ADD_RF_ARCHITECTURE
@ COMMAND_ADD_RF_ARCHITECTURE
Definition: HDBEditorConstants.hh:48
RFArchitectureDialog
Definition: RFArchitectureDialog.hh:46
GUICommand::parentWindow
wxWindow * parentWindow() const
Definition: GUICommand.cc:75