OpenASIP
2.0
|
#include <AddFUFromHDBDialog.hh>
Public Member Functions | |
AddFUFromHDBDialog (wxWindow *parent, Model *model) | |
virtual | ~AddFUFromHDBDialog () |
Private Types | |
enum | { ID_LIST = 10000, ID_FILTER_LABEL, ID_FILTER_TEXTCTRL, ID_ADD, ID_CLOSE, ID_LINE, ID_FILTER_TIMER } |
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) |
bool | acceptToList (const std::string hdbFilePath, const HDB::FUArchitecture &arch, const std::vector< std::string > &filterList) |
void | onFilterChange (wxCommandEvent &event) |
void | onFilterTimeOut (wxTimerEvent &event) |
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::FUArchitecture * > | fuArchitectures_ |
Map of iu architectures displayed in the dialog list. More... | |
wxSearchCtrl * | filterCtrl_ = nullptr |
The list filter text control. More... | |
std::vector< std::string > | filterPatterns_ |
Keywords to filter HDB entries. More... | |
wxTimer | filterTimer_ |
Timer to postpone filtering while typing filter patterns. More... | |
int | sortColumn_ |
bool | sortASC_ |
Static Private Attributes | |
static const wxString | HDB_FILE_FILTER = _T("*.hdb") |
File filter for HDB files. More... | |
Dialog for adding register file architectures directly from HDB to the current machine.
Definition at line 64 of file AddFUFromHDBDialog.hh.
|
private |
Enumerator | |
---|---|
ID_LIST | |
ID_FILTER_LABEL | |
ID_FILTER_TEXTCTRL | |
ID_ADD | |
ID_CLOSE | |
ID_LINE | |
ID_FILTER_TIMER |
Definition at line 101 of file AddFUFromHDBDialog.hh.
AddFUFromHDBDialog::AddFUFromHDBDialog | ( | wxWindow * | parent, |
Model * | model | ||
) |
The Constructor.
parent | Parent window of the dialog. |
machine | Parent Machine of the immediate slots. |
Definition at line 131 of file AddFUFromHDBDialog.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 172 of file AddFUFromHDBDialog.cc.
References MapTools::deleteAllValues(), and fuArchitectures_.
|
private |
Returns true if the FU architecture should not be viewed.
filterList | The list of all keywords (uppercase), that the FU architecture should contain. |
Definition at line 308 of file AddFUFromHDBDialog.cc.
References HDB::FUArchitecture::architecture(), TTAMachine::HWOperation::latency(), TTAMachine::HWOperation::name(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), and Conversion::toString().
Referenced by loadHDB().
|
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 496 of file AddFUFromHDBDialog.cc.
References filterCtrl_, ID_ADD, ID_CLOSE, ID_FILTER_TEXTCTRL, ID_LINE, and ID_LIST.
Referenced by AddFUFromHDBDialog().
|
private |
Loads register files from a HDB to the dialog list.
manager | HDB manager to load. |
Definition at line 229 of file AddFUFromHDBDialog.cc.
References acceptToList(), HDB::FUArchitecture::architecture(), HDB::HDBManager::fileName(), filterPatterns_, HDB::HDBManager::fuArchitectureByID(), HDB::HDBManager::fuArchitectureIDs(), fuArchitectures_, FUListCompareASC(), ListItemData::hdbId, ListItemData::id, ListItemData::latency, TTAMachine::HWOperation::latency(), list_, TTAMachine::HWOperation::name(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), ListItemData::operations, ListItemData::path, setColumnImage(), sortASC_, and WxConversion::toWxString().
Referenced by TransferDataToWindow().
|
private |
Adds a new register file to the machine when "Add" button is pressed.
Definition at line 387 of file AddFUFromHDBDialog.cc.
References TTAMachine::Machine::addFunctionUnit(), HDB::FUArchitecture::architecture(), Exception::errorMessage(), fuArchitectures_, TTAMachine::Machine::functionUnitNavigator(), Model::getMachine(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), ListItemData::id, TTAMachine::ExecutionPipeline::isPortRead(), TTAMachine::ExecutionPipeline::isPortWritten(), TTAMachine::FUPort::isTriggering(), TTAMachine::HWOperation::latency(), list_, machine, model_, TTAMachine::HWOperation::name(), Model::notifyObservers(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), TTAMachine::HWOperation::pipeline(), TTAMachine::FunctionUnit::port(), TTAMachine::Unit::portCount(), Model::pushToStack(), TTAMachine::FunctionUnit::saveState(), TTAMachine::Port::setName(), TTAMachine::FunctionUnit::setName(), Conversion::toString(), and WxConversion::toWxString().
|
private |
Closes the dialog when the close button is pressed.
Definition at line 482 of file AddFUFromHDBDialog.cc.
|
private |
Sorts HDB FU list according to clicked column.
Definition at line 536 of file AddFUFromHDBDialog.cc.
References FUListCompareASC(), FUListCompareDESC(), list_, setColumnImage(), sortASC_, and sortColumn_.
|
private |
Updates FU architecture list view accordingly to new filter rule.
Definition at line 353 of file AddFUFromHDBDialog.cc.
References filterTimer_, and TransferDataToWindow().
|
private |
Definition at line 365 of file AddFUFromHDBDialog.cc.
References TransferDataToWindow().
|
private |
Enables and disables the delete button according to slot list selection.
Definition at line 374 of file AddFUFromHDBDialog.cc.
|
private |
Sets sorting arrow image on selected column
col | Column index to set the image |
image | Image index in wxImageList |
Definition at line 565 of file AddFUFromHDBDialog.cc.
References list_.
Referenced by loadHDB(), and onColumnClick().
|
privatevirtual |
Transfers data from the HDBs to the dialog list widget.
Definition at line 181 of file AddFUFromHDBDialog.cc.
References MapTools::deleteAllValues(), filterCtrl_, filterPatterns_, fuArchitectures_, HDB::HDBRegistry::hdb(), HDB::HDBRegistry::hdbCount(), HDB::HDBRegistry::hdbErrorCount(), HDB::HDBRegistry::hdbErrorMessage(), list_, HDB::HDBRegistry::loadFromSearchPaths(), loadHDB(), WxConversion::toString(), and WxConversion::toWxString().
Referenced by onFilterChange(), and onFilterTimeOut().
|
private |
The list filter text control.
Definition at line 92 of file AddFUFromHDBDialog.hh.
Referenced by createContents(), and TransferDataToWindow().
|
private |
Keywords to filter HDB entries.
Definition at line 94 of file AddFUFromHDBDialog.hh.
Referenced by loadHDB(), and TransferDataToWindow().
|
private |
Timer to postpone filtering while typing filter patterns.
Definition at line 96 of file AddFUFromHDBDialog.hh.
Referenced by onFilterChange().
|
private |
Map of iu architectures displayed in the dialog list.
Definition at line 90 of file AddFUFromHDBDialog.hh.
Referenced by loadHDB(), onAdd(), TransferDataToWindow(), and ~AddFUFromHDBDialog().
|
staticprivate |
File filter for HDB files.
Definition at line 112 of file AddFUFromHDBDialog.hh.
|
private |
Immediate slot list widget.
Definition at line 88 of file AddFUFromHDBDialog.hh.
Referenced by AddFUFromHDBDialog(), loadHDB(), onAdd(), onColumnClick(), onListSelectionChange(), setColumnImage(), and TransferDataToWindow().
|
private |
Model of the current adf file.
Definition at line 86 of file AddFUFromHDBDialog.hh.
Referenced by onAdd().
|
private |
Definition at line 99 of file AddFUFromHDBDialog.hh.
Referenced by loadHDB(), and onColumnClick().
|
private |
Definition at line 98 of file AddFUFromHDBDialog.hh.
Referenced by onColumnClick().