OpenASIP
2.0
|
#include <AddRFFromHDBDialog.hh>
Public Member Functions | |
AddRFFromHDBDialog (wxWindow *parent, Model *model) | |
virtual | ~AddRFFromHDBDialog () |
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 HDB::HDBManager &manager) |
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 * > | rfArchitectures_ |
Map of rf architectures displayed in the dialog list. More... | |
int | sortColumn_ |
bool | sortASC_ |
Static Private Attributes | |
static const int | DEFAULT_SIZE = 1 |
Default size for the rf, if the size is parameterized in the HDB. More... | |
static const int | DEFAULT_WIDTH = 32 |
Default bit width for the rf, if the size is parameterized in the HDB. More... | |
static const wxString | HDB_FILE_FILTER = _T("*.hdb") |
File filter for the HDB files. More... | |
Dialog for adding register file architectures directly from HDB to the current machine.
Definition at line 64 of file AddRFFromHDBDialog.hh.
|
private |
AddRFFromHDBDialog::AddRFFromHDBDialog | ( | wxWindow * | parent, |
Model * | model | ||
) |
The Constructor.
parent | Parent window of the dialog. |
machine | Parent Machine of the immediate slots. |
Definition at line 142 of file AddRFFromHDBDialog.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 |
|
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 387 of file AddRFFromHDBDialog.cc.
References ID_ADD, ID_CLOSE, ID_LINE, and ID_LIST.
Referenced by AddRFFromHDBDialog().
|
private |
Loads register files from a HDB to the dialog list.
manager | HDBManager managing the HDB to load. |
Definition at line 231 of file AddRFFromHDBDialog.cc.
References HDB::RFArchitecture::bidirPortCount(), ListItemData::bidirPorts, HDB::HDBManager::fileName(), HDB::RFArchitecture::hasParameterizedSize(), HDB::RFArchitecture::hasParameterizedWidth(), ListItemData::hdbId, ListItemData::id, HDB::RFArchitecture::latency(), list_, ListItemData::maxReads, HDB::RFArchitecture::maxReads(), ListItemData::maxWrites, HDB::RFArchitecture::maxWrites(), ListItemData::path, HDB::RFArchitecture::readPortCount(), ListItemData::readPorts, HDB::HDBManager::rfArchitectureByID(), HDB::HDBManager::rfArchitectureIDs(), rfArchitectures_, RFListCompareASC(), setColumnImage(), ListItemData::size, HDB::RFArchitecture::size(), sortASC_, WxConversion::toWxString(), ListItemData::width, HDB::RFArchitecture::width(), HDB::RFArchitecture::writePortCount(), and ListItemData::writePorts.
Referenced by TransferDataToWindow().
|
private |
Adds a new register file to the machine when "Add" button is pressed.
Definition at line 309 of file AddRFFromHDBDialog.cc.
References TTAMachine::Machine::addRegisterFile(), HDB::RFArchitecture::bidirPortCount(), DEFAULT_SIZE, DEFAULT_WIDTH, Model::getMachine(), HDB::RFArchitecture::guardLatency(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), HDB::RFArchitecture::hasParameterizedSize(), HDB::RFArchitecture::hasParameterizedWidth(), ListItemData::id, list_, machine, HDB::RFArchitecture::maxReads(), HDB::RFArchitecture::maxWrites(), model_, NORMAL, Model::notifyObservers(), Model::pushToStack(), HDB::RFArchitecture::readPortCount(), TTAMachine::Machine::registerFileNavigator(), rfArchitectures_, HDB::RFArchitecture::size(), Conversion::toString(), HDB::RFArchitecture::width(), HDB::RFArchitecture::writePortCount(), and HDB::RFArchitecture::zeroRegister().
|
private |
Closes the dialog when the close button is pressed.
Definition at line 373 of file AddRFFromHDBDialog.cc.
|
private |
Sorts HDB RF list according to clicked column.
Definition at line 421 of file AddRFFromHDBDialog.cc.
References list_, RFListCompareASC(), RFListCompareDESC(), setColumnImage(), sortASC_, and sortColumn_.
|
private |
Enables and disables the delete button according to slot list selection.
Definition at line 296 of file AddRFFromHDBDialog.cc.
|
private |
Sets sorting arrow image on selected column
col | Column index to set the image |
image | Image index in wxImageList |
Definition at line 450 of file AddRFFromHDBDialog.cc.
References list_.
Referenced by loadHDB(), and onColumnClick().
|
privatevirtual |
Transfers data from the HDBs to the dialog list.
Definition at line 193 of file AddRFFromHDBDialog.cc.
References MapTools::deleteAllValues(), HDB::HDBRegistry::hdb(), HDB::HDBRegistry::hdbCount(), HDB::HDBRegistry::hdbErrorCount(), HDB::HDBRegistry::hdbErrorMessage(), list_, HDB::HDBRegistry::loadFromSearchPaths(), loadHDB(), rfArchitectures_, and WxConversion::toWxString().
|
staticprivate |
Default size for the rf, if the size is parameterized in the HDB.
Definition at line 97 of file AddRFFromHDBDialog.hh.
Referenced by onAdd().
|
staticprivate |
Default bit width for the rf, if the size is parameterized in the HDB.
Definition at line 99 of file AddRFFromHDBDialog.hh.
Referenced by onAdd().
|
staticprivate |
File filter for the HDB files.
Definition at line 101 of file AddRFFromHDBDialog.hh.
|
private |
Immediate slot list widget.
Definition at line 82 of file AddRFFromHDBDialog.hh.
Referenced by AddRFFromHDBDialog(), loadHDB(), onAdd(), onColumnClick(), onListSelectionChange(), setColumnImage(), and TransferDataToWindow().
|
private |
Model of the current adf file.
Definition at line 80 of file AddRFFromHDBDialog.hh.
Referenced by onAdd().
|
private |
Map of rf architectures displayed in the dialog list.
Definition at line 84 of file AddRFFromHDBDialog.hh.
Referenced by loadHDB(), onAdd(), and TransferDataToWindow().
|
private |
Definition at line 87 of file AddRFFromHDBDialog.hh.
Referenced by loadHDB(), and onColumnClick().
|
private |
Definition at line 86 of file AddRFFromHDBDialog.hh.
Referenced by onColumnClick().