OpenASIP
2.0
|
#include <AddIUFromHDBDialog.hh>
Public Member Functions | |
AddIUFromHDBDialog (wxWindow *parent, Model *model) | |
virtual | ~AddIUFromHDBDialog () |
Private Types | |
enum | { ID_LIST = 10000, ID_ADD, ID_CLOSE, ID_LINE } |
Private Member Functions | |
virtual bool | TransferDataToWindow () |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
void | onListSelectionChange (wxListEvent &event) |
void | onAdd (wxCommandEvent &event) |
void | onClose (wxCommandEvent &event) |
bool | loadHDB (const std::string &path) |
void | onColumnClick (wxListEvent &event) |
void | setColumnImage (int col, int image) |
Private Attributes | |
Model * | model_ |
Model of the current adf file. More... | |
wxListCtrl * | list_ |
Immediate slot list widget. More... | |
std::map< int, HDB::RFArchitecture * > | iuArchitectures_ |
Map of iu architectures displayed in the dialog list. More... | |
int | sortColumn_ |
bool | sortASC_ |
Static Private Attributes | |
static const int | DEFAULT_SIZE = 1 |
Default size for the IU, if the size is parameterized in the HDB. More... | |
static const int | DEFAULT_WIDTH = 32 |
Default width for the IU, if the size is parameterized in the HDB. More... | |
static const TTAMachine::Machine::Extension | DEFAULT_EXTENSION_MODE |
Default extension mode for the immediate unit. More... | |
static const wxString | HDB_FILE_FILTER = _T("*.hdb") |
File filter for HDB files. More... | |
Dialog for adding immediate unit architectures directly from HDB to the current machine.
Definition at line 61 of file AddIUFromHDBDialog.hh.
|
private |
AddIUFromHDBDialog::AddIUFromHDBDialog | ( | wxWindow * | parent, |
Model * | model | ||
) |
The Constructor.
parent | Parent window of the dialog. |
machine | Parent Machine of the immediate slots. |
Definition at line 133 of file AddIUFromHDBDialog.cc.
References createContents(), FileSystem::DIRECTORY_SEPARATOR, ProDeConstants::ICON_SORT_ASC, ProDeConstants::ICON_SORT_DESC, Environment::iconDirPath(), ID_ADD, ID_LIST, list_, and WxConversion::toWxString().
|
virtual |
The Destructor.
Definition at line 174 of file AddIUFromHDBDialog.cc.
References MapTools::deleteAllValues(), and iuArchitectures_.
|
private |
Creates the dialog contents.
parent | Parent dialog of the contents. |
call_fit | If true, fits the contents inside the dialog. |
set_sizer | If true, sets the main sizer as dialog contents. |
Definition at line 402 of file AddIUFromHDBDialog.cc.
References ID_ADD, ID_CLOSE, ID_LINE, and ID_LIST.
Referenced by AddIUFromHDBDialog().
|
private |
Loads immediate units from a HDB to the dialog list.
path | Full path to the HDB file to load. |
Definition at line 241 of file AddIUFromHDBDialog.cc.
References HDB::RFArchitecture::bidirPortCount(), Exception::errorMessage(), HDB::RFArchitecture::hasParameterizedSize(), HDB::RFArchitecture::hasParameterizedWidth(), ListItemData::hdbId, ListItemData::id, iuArchitectures_, IUListCompareASC(), ListItemData::latency, HDB::RFArchitecture::latency(), list_, ListItemData::path, HDB::RFArchitecture::readPortCount(), ListItemData::readPorts, HDB::HDBManager::rfArchitectureByID(), HDB::HDBManager::rfArchitectureIDs(), setColumnImage(), ListItemData::size, HDB::RFArchitecture::size(), sortASC_, WxConversion::toWxString(), ListItemData::width, HDB::RFArchitecture::width(), and HDB::RFArchitecture::writePortCount().
Referenced by TransferDataToWindow().
|
private |
Adds a new register file to the machine when "Add" button is pressed.
Definition at line 330 of file AddIUFromHDBDialog.cc.
References TTAMachine::Machine::addImmediateUnit(), DEFAULT_EXTENSION_MODE, DEFAULT_SIZE, DEFAULT_WIDTH, Model::getMachine(), HDB::RFArchitecture::guardLatency(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), HDB::RFArchitecture::hasParameterizedSize(), HDB::RFArchitecture::hasParameterizedWidth(), ListItemData::id, TTAMachine::Machine::immediateUnitNavigator(), iuArchitectures_, list_, machine, HDB::RFArchitecture::maxReads(), model_, Model::notifyObservers(), Model::pushToStack(), HDB::RFArchitecture::readPortCount(), HDB::RFArchitecture::size(), Conversion::toString(), and HDB::RFArchitecture::width().
|
private |
Closes the dialog when the close button is pressed.
Definition at line 388 of file AddIUFromHDBDialog.cc.
|
private |
Sorts HDB IU list according to clicked column.
Definition at line 436 of file AddIUFromHDBDialog.cc.
References IUListCompareASC(), IUListCompareDESC(), list_, setColumnImage(), sortASC_, and sortColumn_.
|
private |
Enables and disables the delete button according to slot list selection.
Definition at line 317 of file AddIUFromHDBDialog.cc.
|
private |
Sets sorting arrow image on selected column
col | Column index to set the image |
image | Image index in wxImageList |
Definition at line 465 of file AddIUFromHDBDialog.cc.
References list_.
Referenced by loadHDB(), and onColumnClick().
|
privatevirtual |
Transfers data from the HDBs to the dialog list.
Definition at line 185 of file AddIUFromHDBDialog.cc.
References MapTools::deleteAllValues(), FileSystem::DIRECTORY_SEPARATOR, HDB_FILE_FILTER, Environment::hdbPaths(), iuArchitectures_, list_, loadHDB(), WxConversion::toString(), and WxConversion::toWxString().
|
staticprivate |
Default extension mode for the immediate unit.
Definition at line 98 of file AddIUFromHDBDialog.hh.
Referenced by onAdd().
|
staticprivate |
Default size for the IU, if the size is parameterized in the HDB.
Definition at line 94 of file AddIUFromHDBDialog.hh.
Referenced by onAdd().
|
staticprivate |
Default width for the IU, if the size is parameterized in the HDB.
Definition at line 96 of file AddIUFromHDBDialog.hh.
Referenced by onAdd().
|
staticprivate |
File filter for HDB files.
Definition at line 100 of file AddIUFromHDBDialog.hh.
Referenced by TransferDataToWindow().
|
private |
Map of iu architectures displayed in the dialog list.
Definition at line 81 of file AddIUFromHDBDialog.hh.
Referenced by loadHDB(), onAdd(), TransferDataToWindow(), and ~AddIUFromHDBDialog().
|
private |
Immediate slot list widget.
Definition at line 79 of file AddIUFromHDBDialog.hh.
Referenced by AddIUFromHDBDialog(), loadHDB(), onAdd(), onColumnClick(), onListSelectionChange(), setColumnImage(), and TransferDataToWindow().
|
private |
Model of the current adf file.
Definition at line 77 of file AddIUFromHDBDialog.hh.
Referenced by onAdd().
|
private |
Definition at line 84 of file AddIUFromHDBDialog.hh.
Referenced by loadHDB(), and onColumnClick().
|
private |
Definition at line 83 of file AddIUFromHDBDialog.hh.
Referenced by onColumnClick().