OpenASIP 2.2
|
#include <FUDialog.hh>
Public Member Functions | |
FUDialog (wxWindow *parent, TTAMachine::FunctionUnit *functionUnit) | |
virtual | ~FUDialog () |
Protected Member Functions | |
virtual bool | TransferDataToWindow () |
Private Types | |
enum | { ID_NAME =10000 , ID_ADDRESS_SPACE , ID_OPERATION_LIST , ID_ADD_OPERATION , ID_EDIT_OPERATION , ID_ADD_OPERATION_FROM_OPSET , ID_DELETE_OPERATION , ID_PORT_LIST , ID_ADD_PORT , ID_EDIT_PORT , ID_DELETE_PORT , ID_HELP , ID_LABEL_NAME , ID_LABEL_AS } |
Private Member Functions | |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
TTAMachine::FUPort * | selectedPort () |
TTAMachine::HWOperation * | selectedOperation () |
void | onOK (wxCommandEvent &event) |
void | onHelp (wxCommandEvent &event) |
void | onName (wxCommandEvent &event) |
void | onPortSelection (wxListEvent &event) |
void | onPortRightClick (wxListEvent &event) |
void | onAddPort (wxCommandEvent &event) |
void | onDeletePort (wxCommandEvent &event) |
void | onEditPort (wxCommandEvent &event) |
void | onActivatePort (wxListEvent &event) |
void | onOperationSelection (wxListEvent &event) |
void | onAddOperation (wxCommandEvent &event) |
void | onAddOperationFromOpset (wxCommandEvent &event) |
void | onDeleteOperation (wxCommandEvent &event) |
void | onEditOperation (wxCommandEvent &event) |
void | onSetAddressSpace (wxCommandEvent &event) |
void | onActivateOperation (wxListEvent &event) |
void | onOperationRightClick (wxListEvent &event) |
void | updateAddressSpaceChoice () |
void | updatePortList () |
void | updateOperationList () |
void | setTexts () |
Private Attributes | |
TTAMachine::FunctionUnit * | functionUnit_ |
FunctionUnit to modify. | |
wxString | name_ |
Name of the function unit. | |
wxListCtrl * | portListCtrl_ |
Port list control. | |
wxListCtrl * | operationListCtrl_ |
Operation list control. | |
wxChoice * | addressSpaceChoice_ |
Address Space choice control. | |
wxStaticBoxSizer * | portsSizer_ |
Sizer for the port list controls. | |
wxStaticBoxSizer * | operationsSizer_ |
Sizer for the operation list controls. | |
Dialog for querying FunctionUnit parameters from the user.
Definition at line 48 of file FUDialog.hh.
|
private |
Definition at line 99 of file FUDialog.hh.
FUDialog::FUDialog | ( | wxWindow * | parent, |
TTAMachine::FunctionUnit * | functionUnit | ||
) |
The Constructor.
parent | Parent window of the dialog. |
functionUnit | A function unit to be shown in the dialog. |
Definition at line 109 of file FUDialog.cc.
|
virtual |
|
private |
Creates the dialog window contents.
This method was initially generated with wxDesigner, code will be cleaned up later.
parent | The dialog window. |
call_fit | If true, fits the contents inside the dialog. |
set_sizer | If true, sets the main sizer as dialog contents. |
Definition at line 747 of file FUDialog.cc.
References ID_ADD_OPERATION, ID_ADD_OPERATION_FROM_OPSET, ID_ADD_PORT, ID_ADDRESS_SPACE, ID_DELETE_OPERATION, ID_DELETE_PORT, ID_EDIT_OPERATION, ID_EDIT_PORT, ID_HELP, ID_LABEL_AS, ID_LABEL_NAME, ID_NAME, ID_OPERATION_LIST, ID_PORT_LIST, operationsSizer_, and portsSizer_.
|
private |
Handles left mouse button double clicks on the operation list.
Definition at line 729 of file FUDialog.cc.
References dummy, and onEditOperation().
|
private |
Handles left mouse button double clicks on the port list.
Definition at line 380 of file FUDialog.cc.
References dummy, and onEditPort().
|
private |
Creates and shows an empty Function Unit Operation Dialog for adding operations.
Not Implemented.
Definition at line 430 of file FUDialog.cc.
References ProDeConstants::COMP_NEW_NAME_PREFIX_OPERATION, functionUnit_, TTAMachine::FunctionUnit::hasOperation(), TTAMachine::FunctionUnit::loadState(), TTAMachine::FunctionUnit::saveState(), Conversion::toString(), and updateOperationList().
|
private |
Event handler for the add operation from opset button.
Definition at line 458 of file FUDialog.cc.
References OpsetDialog::createOperation(), Exception::errorMessage(), functionUnit_, WxConversion::toWxString(), and updateOperationList().
|
private |
Creates and shows an empty Function Unit Port Dialog for adding ports.
Definition at line 321 of file FUDialog.cc.
References ProDeConstants::COMP_NEW_NAME_PREFIX_PORT, ModelConstants::DEFAULT_WIDTH, functionUnit_, TTAMachine::Unit::hasPort(), Conversion::toString(), and updatePortList().
|
private |
Deletes selected operation from the operation list.
Definition at line 490 of file FUDialog.cc.
References functionUnit_, WidgetTools::lcStringSelection(), TTAMachine::FunctionUnit::operation(), operationListCtrl_, and updateOperationList().
|
private |
Deletes selected port from the port list.
Definition at line 349 of file FUDialog.cc.
References assert, selectedPort(), and updatePortList().
|
private |
Handles the 'Edit Operation' button event.
Opens a FUOperationDialog with the selected operation's attributes set.
Definition at line 507 of file FUDialog.cc.
References functionUnit_, TTAMachine::FunctionUnit::loadState(), TTAMachine::FunctionUnit::saveState(), selectedOperation(), and updateOperationList().
Referenced by onActivateOperation().
|
private |
Handles the 'Edit Port' button event.
Opens a FUPortDialog with the selected port set.
Definition at line 392 of file FUDialog.cc.
References selectedPort(), and updatePortList().
Referenced by onActivatePort().
|
private |
|
private |
Checks whether name field is empty and disables OK button of the dialog if it is.
Definition at line 531 of file FUDialog.cc.
|
private |
Validates input in the controls, and updates the FunctionUnit.
Definition at line 243 of file FUDialog.cc.
References ProDeTextGenerator::COMP_A_FUNCTION_UNIT, ProDeTextGenerator::COMP_FUNCTION_UNIT, ProDeTextGenerator::COMP_MACHINE, TTAMachine::Machine::Navigator< ComponentType >::count(), functionUnit_, TTAMachine::Machine::functionUnitNavigator(), ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), machine, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, TTAMachine::Component::name(), name_, TTAMachine::FunctionUnit::setName(), Texts::TextGenerator::text(), WxConversion::toString(), and WxConversion::toWxString().
|
private |
Opens a pop-up menu when right mouse button was pressed on the operation list.
event | Information about right mouse click event. |
Definition at line 705 of file FUDialog.cc.
References ID_DELETE_OPERATION, ID_EDIT_OPERATION, ProDeTextGenerator::instance(), operationListCtrl_, Texts::TextGenerator::text(), WxConversion::toWxString(), ProDeTextGenerator::TXT_LABEL_BUTTON_DELETE, and ProDeTextGenerator::TXT_LABEL_BUTTON_EDIT.
|
private |
Disables and enables Edit and Delete buttons under the operation list.
If a operation is selected, buttons are enabled. If no operation is selected the buttons will be disabled.
event | ListEvent, which may have changed the selection. |
Definition at line 568 of file FUDialog.cc.
References ID_DELETE_OPERATION, ID_EDIT_OPERATION, and operationListCtrl_.
Referenced by updateOperationList().
|
private |
Opens a pop-up menu when right mouse button was pressed.
event | Information about right mouse click event. |
Definition at line 678 of file FUDialog.cc.
References ID_DELETE_PORT, ID_EDIT_PORT, ProDeTextGenerator::instance(), portListCtrl_, Texts::TextGenerator::text(), WxConversion::toWxString(), ProDeTextGenerator::TXT_LABEL_BUTTON_DELETE, and ProDeTextGenerator::TXT_LABEL_BUTTON_EDIT.
|
private |
Disables and enables Edit and Delete buttons under the port list.
If a port is selected, buttons are enabled. If no port is selected the buttons will be disabled.
event | ListEvent, which may have changed the selection. |
Definition at line 412 of file FUDialog.cc.
References ID_DELETE_PORT, ID_EDIT_PORT, and portListCtrl_.
Referenced by updatePortList().
|
private |
Sets the function unit address space when user changes it.
Definition at line 299 of file FUDialog.cc.
References addressSpaceChoice_, TTAMachine::Machine::addressSpaceNavigator(), functionUnit_, TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), ProDeConstants::NONE, TTAMachine::FunctionUnit::setAddressSpace(), and WxConversion::toString().
|
private |
Returns pointer to the operation, which is selected on the operation list.
Definition at line 550 of file FUDialog.cc.
References functionUnit_, WidgetTools::lcStringSelection(), TTAMachine::FunctionUnit::operation(), and operationListCtrl_.
Referenced by onEditOperation().
|
private |
Returns a pointer to the function unit port which is selected.
Definition at line 366 of file FUDialog.cc.
References functionUnit_, WidgetTools::lcStringSelection(), TTAMachine::FunctionUnit::operationPort(), and portListCtrl_.
Referenced by onDeletePort(), and onEditPort().
|
private |
Sets texts for widgets.
Definition at line 149 of file FUDialog.cc.
References ID_ADD_OPERATION, ID_ADD_PORT, ID_DELETE_OPERATION, ID_DELETE_PORT, ID_EDIT_OPERATION, ID_EDIT_PORT, ID_HELP, ID_LABEL_AS, ID_LABEL_NAME, ID_OPERATION_LIST, ID_PORT_LIST, GUITextGenerator::instance(), ProDeTextGenerator::instance(), operationsSizer_, portsSizer_, WidgetTools::setLabel(), WidgetTools::setWidgetLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), GUITextGenerator::TXT_BUTTON_ADD_DIALOG, GUITextGenerator::TXT_BUTTON_CANCEL, GUITextGenerator::TXT_BUTTON_DELETE, GUITextGenerator::TXT_BUTTON_EDIT_DIALOG, GUITextGenerator::TXT_BUTTON_HELP, GUITextGenerator::TXT_BUTTON_OK, ProDeTextGenerator::TXT_COLUMN_NAME, ProDeTextGenerator::TXT_COLUMN_TRIGGERS, ProDeTextGenerator::TXT_COLUMN_WIDTH, ProDeTextGenerator::TXT_FU_DIALOG_TITLE, ProDeTextGenerator::TXT_FU_OPERATIONS_BOX, ProDeTextGenerator::TXT_FU_PORTS_BOX, ProDeTextGenerator::TXT_LABEL_ADDRESS_SPACE, and ProDeTextGenerator::TXT_LABEL_NAME.
|
protectedvirtual |
Transfers data from the MOM to the dialog widgets.
Definition at line 228 of file FUDialog.cc.
References functionUnit_, TTAMachine::Component::name(), name_, WxConversion::toWxString(), updateAddressSpaceChoice(), updateOperationList(), and updatePortList().
|
private |
Updates 'Address Space' choice control.
Clears all items from the choicer and adds all address spaces plus an item 'NONE' indicating empty selection.
Definition at line 586 of file FUDialog.cc.
References TTAMachine::FunctionUnit::addressSpace(), addressSpaceChoice_, TTAMachine::Machine::addressSpaceNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), functionUnit_, TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), TTAMachine::Component::name(), ProDeConstants::NONE, and WxConversion::toWxString().
Referenced by TransferDataToWindow().
|
private |
Updates operation list.
Definition at line 650 of file FUDialog.cc.
References dummy, functionUnit_, TTAMachine::HWOperation::name(), onOperationSelection(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), operationListCtrl_, and WxConversion::toWxString().
Referenced by onAddOperation(), onAddOperationFromOpset(), onDeleteOperation(), onEditOperation(), and TransferDataToWindow().
|
private |
Updates 'Ports' list control.
Clears all items from the choicer and adds all ports.
Definition at line 618 of file FUDialog.cc.
References dummy, functionUnit_, TTAMachine::FUPort::isTriggering(), TTAMachine::Port::name(), onPortSelection(), TTAMachine::FunctionUnit::operationPort(), TTAMachine::Unit::portCount(), portListCtrl_, Conversion::toString(), WxConversion::toWxString(), and TTAMachine::BaseFUPort::width().
Referenced by onAddPort(), onDeletePort(), onEditPort(), and TransferDataToWindow().
|
private |
Address Space choice control.
Definition at line 92 of file FUDialog.hh.
Referenced by onSetAddressSpace(), and updateAddressSpaceChoice().
|
private |
FunctionUnit to modify.
Definition at line 83 of file FUDialog.hh.
Referenced by onAddOperation(), onAddOperationFromOpset(), onAddPort(), onDeleteOperation(), onEditOperation(), onOK(), onSetAddressSpace(), selectedOperation(), selectedPort(), TransferDataToWindow(), updateAddressSpaceChoice(), updateOperationList(), and updatePortList().
|
private |
Name of the function unit.
Definition at line 85 of file FUDialog.hh.
Referenced by onName(), onOK(), and TransferDataToWindow().
|
private |
Operation list control.
Definition at line 90 of file FUDialog.hh.
Referenced by onDeleteOperation(), onOperationRightClick(), onOperationSelection(), selectedOperation(), and updateOperationList().
|
private |
Sizer for the operation list controls.
Definition at line 97 of file FUDialog.hh.
Referenced by createContents(), and setTexts().
|
private |
Port list control.
Definition at line 88 of file FUDialog.hh.
Referenced by onPortRightClick(), onPortSelection(), selectedPort(), and updatePortList().
|
private |
Sizer for the port list controls.
Definition at line 95 of file FUDialog.hh.
Referenced by createContents(), and setTexts().