OpenASIP
2.0
|
#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. More... | |
wxString | name_ |
Name of the function unit. More... | |
wxListCtrl * | portListCtrl_ |
Port list control. More... | |
wxListCtrl * | operationListCtrl_ |
Operation list control. More... | |
wxChoice * | addressSpaceChoice_ |
Address Space choice control. More... | |
wxStaticBoxSizer * | portsSizer_ |
Sizer for the port list controls. More... | |
wxStaticBoxSizer * | operationsSizer_ |
Sizer for the operation list controls. More... | |
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.
|
private |
Handles left mouse button double clicks on the operation list.
Definition at line 729 of file FUDialog.cc.
References dummy.
|
private |
Handles left mouse button double clicks on the port list.
Definition at line 380 of file FUDialog.cc.
References dummy.
|
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, and Conversion::toString().
|
private |
Event handler for the add operation from opset button.
Definition at line 458 of file FUDialog.cc.
References OpsetDialog::createOperation(), Exception::errorMessage(), and WxConversion::toWxString().
|
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, and Conversion::toString().
|
private |
Deletes selected operation from the operation list.
Definition at line 490 of file FUDialog.cc.
References WidgetTools::lcStringSelection().
|
private |
Deletes selected port from the port list.
Definition at line 349 of file FUDialog.cc.
References assert.
|
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.
|
private |
Handles the 'Edit Port' button event.
Opens a FUPortDialog with the selected port set.
Definition at line 392 of file FUDialog.cc.
|
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.
References assert.
|
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(), ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, TTAMachine::Component::name(), 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 ProDeTextGenerator::instance(), 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.
|
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 ProDeTextGenerator::instance(), 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.
|
private |
Sets the function unit address space when user changes it.
Definition at line 299 of file FUDialog.cc.
References TTAMachine::Machine::Navigator< ComponentType >::item(), ProDeConstants::NONE, 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 WidgetTools::lcStringSelection().
|
private |
Returns a pointer to the function unit port which is selected.
Definition at line 366 of file FUDialog.cc.
References WidgetTools::lcStringSelection().
|
private |
Sets texts for widgets.
Definition at line 149 of file FUDialog.cc.
References GUITextGenerator::instance(), ProDeTextGenerator::instance(), 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 WxConversion::toWxString().
|
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::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::name(), ProDeConstants::NONE, and WxConversion::toWxString().
|
private |
Updates operation list.
Definition at line 650 of file FUDialog.cc.
References dummy, and WxConversion::toWxString().
|
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, TTAMachine::FUPort::isTriggering(), TTAMachine::Port::name(), Conversion::toString(), WxConversion::toWxString(), and TTAMachine::BaseFUPort::width().
|
private |
Address Space choice control.
Definition at line 92 of file FUDialog.hh.
|
private |
FunctionUnit to modify.
Definition at line 83 of file FUDialog.hh.
|
private |
Name of the function unit.
Definition at line 85 of file FUDialog.hh.
|
private |
Operation list control.
Definition at line 90 of file FUDialog.hh.
|
private |
Sizer for the operation list controls.
Definition at line 97 of file FUDialog.hh.
|
private |
Port list control.
Definition at line 88 of file FUDialog.hh.
|
private |
Sizer for the port list controls.
Definition at line 95 of file FUDialog.hh.