OpenASIP
2.0
|
#include <GCUDialog.hh>
Public Member Functions | |
GCUDialog (wxWindow *parent, TTAMachine::ControlUnit *gcu) | |
virtual | ~GCUDialog () |
Private Types | |
enum | { ID_NAME = 10000, ID_TEXT, ID_DELAY_SLOTS, ID_ADDRESS_SPACE, ID_OPERATION_LIST, ID_PORT_LIST, ID_RA_CHOICE, ID_OP_CHOICE, ID_LINE, ID_ADD_OPERATION, ID_EDIT_OPERATION, ID_DELETE_OPERATION, ID_ADD_FU_PORT, ID_ADD_SR_PORT, ID_EDIT_PORT, ID_DELETE_PORT, ID_HELP, ID_TEXT_NAME, ID_TEXT_DS, ID_TEXT_AS, ID_TEXT_INPUT_SOCKET, ID_TEXT_OUTPUT_SOCKET, ID_TEXT_RA_WIDTH, ID_LABEL_RA_CHOICE, ID_LABEL_OP_CHOICE } |
enumerated IDs for dialog controls More... | |
Private Member Functions | |
virtual bool | TransferDataToWindow () |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
void | updateAddressSpaceChoice () |
void | updateSocketChoicers () |
void | updateOperationList () |
void | updatePortList () |
void | updateRAPortChoice () |
TTAMachine::HWOperation * | selectedOperation () |
TTAMachine::BaseFUPort * | selectedPort () |
void | onName (wxCommandEvent &event) |
void | onOperationSelection (wxListEvent &event) |
void | onAddOperation (wxCommandEvent &event) |
void | onEditOperation (wxCommandEvent &event) |
void | onDeleteOperation (wxCommandEvent &event) |
void | onActivateOperation (wxListEvent &event) |
void | onOperationRightClick (wxListEvent &event) |
void | onAddFUPort (wxCommandEvent &event) |
void | onAddSRPort (wxCommandEvent &event) |
void | onEditPort (wxCommandEvent &event) |
void | onDeletePort (wxCommandEvent &event) |
void | onPortSelection (wxListEvent &event) |
void | onActivatePort (wxListEvent &event) |
void | onPortRightClick (wxListEvent &event) |
void | onRAPortChoice (wxCommandEvent &event) |
void | onHelp (wxCommandEvent &event) |
void | onOK (wxCommandEvent &event) |
void | setLabels () |
Private Attributes | |
TTAMachine::ControlUnit * | gcu_ |
The Global Control Unit to be modified with the dialog. More... | |
wxString | name_ |
Name of the global control unit. More... | |
int | delaySlots_ |
Number of delay slots of the global control unit. More... | |
int | guardLatency_ |
Guard latency of the gcu. More... | |
wxChoice * | addressSpaceChoice_ |
Address Space choice control. More... | |
wxChoice * | raPortChoice_ |
Return address port choice control. More... | |
wxListCtrl * | operationList_ |
Operation list widget. More... | |
wxListCtrl * | portList_ |
Port list widget. More... | |
wxStaticBoxSizer * | operationsSizer_ |
Box sizer for the operations list controls. More... | |
wxStaticBoxSizer * | portListSizer_ |
Box sizer for the port list controls. More... | |
Dialog for adding a new Global Control Unit to the Machine and editing existing Global Control Unit attributes.
Definition at line 48 of file GCUDialog.hh.
|
private |
enumerated IDs for dialog controls
Definition at line 111 of file GCUDialog.hh.
GCUDialog::GCUDialog | ( | wxWindow * | parent, |
TTAMachine::ControlUnit * | gcu | ||
) |
The Constructor.
parent | Parent window of the dialog. |
gcu | The Global Control Unit to be modified with the dialog. |
Definition at line 106 of file GCUDialog.cc.
|
virtual |
|
private |
Creates the dialog window contents.
This method was generated with wxDesigner, thus the ugly code and too long lines.
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 840 of file GCUDialog.cc.
|
private |
Handles left mouse button double clicks on the operation list.
Definition at line 627 of file GCUDialog.cc.
References dummy.
|
private |
Handles left mouse button double clicks on the port list.
Definition at line 798 of file GCUDialog.cc.
References dummy.
|
private |
Creates and shows an empty Function Unit Port Dialog for adding ports.
Definition at line 638 of file GCUDialog.cc.
References ProDeConstants::COMP_NEW_NAME_PREFIX_PORT, ModelConstants::DEFAULT_WIDTH, and Conversion::toString().
|
private |
Creates and shows an empty Operation Dialog for adding operations.
Definition at line 483 of file GCUDialog.cc.
References ProDeConstants::COMP_NEW_NAME_PREFIX_OPERATION, and Conversion::toString().
|
private |
Creates and shows an empty Special Register Port Dialog for adding ports.
Definition at line 665 of file GCUDialog.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 511 of file GCUDialog.cc.
References WidgetTools::lcStringSelection().
|
private |
|
private |
Handles the 'Edit Operation' button event.
Opens a OperationDialog with the selected operation's attributes set.
Definition at line 527 of file GCUDialog.cc.
|
private |
Handles the 'Edit Port' button event.
Opens a FUPortDialog with the selected port set.
Definition at line 727 of file GCUDialog.cc.
References TTAMachine::Port::name().
|
private |
|
private |
Checks whether the name field is empty, and disables OK button of the dialog if it is.
Definition at line 465 of file GCUDialog.cc.
References assert.
|
private |
Validates input in the controls, and updates the ControlUnit.
Definition at line 378 of file GCUDialog.cc.
References assert, ProDeTextGenerator::COMP_A_FUNCTION_UNIT, ProDeTextGenerator::COMP_GCU, ProDeTextGenerator::COMP_MACHINE, TTAMachine::Machine::Navigator< ComponentType >::count(), Exception::errorMessage(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, TTAMachine::Component::name(), ProDeConstants::NONE, 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 603 of file GCUDialog.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 570 of file GCUDialog.cc.
|
private |
Opens a pop-up menu when right mouse button was pressed on the port list.
event | Information about right mouse click event. |
Definition at line 774 of file GCUDialog.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 757 of file GCUDialog.cc.
|
private |
Sets the return address port when return address port choicer selection changes.
Definition at line 809 of file GCUDialog.cc.
References assert, ProDeConstants::NONE, and WxConversion::toString().
|
private |
Returns pointer to the operation, which is selected on the operation list.
Definition at line 552 of file GCUDialog.cc.
References WidgetTools::lcStringSelection().
|
private |
Returns a pointer to the port selected in the port list.
Definition at line 711 of file GCUDialog.cc.
References WidgetTools::lcStringSelection().
|
private |
Sets the widget labels to texts provided by the GUITextGenerator.
Definition at line 158 of file GCUDialog.cc.
References GUITextGenerator::instance(), ProDeTextGenerator::instance(), WidgetTools::setLabel(), WidgetTools::setWidgetLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), GUITextGenerator::TXT_BUTTON_ADD_DIALOG, ProDeTextGenerator::TXT_BUTTON_ADD_FU_PORT, ProDeTextGenerator::TXT_BUTTON_ADD_SR_PORT, 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_SRP, ProDeTextGenerator::TXT_COLUMN_TRIGGERS, ProDeTextGenerator::TXT_COLUMN_WIDTH, ProDeTextGenerator::TXT_GCU_DELAY_SLOTS, ProDeTextGenerator::TXT_GCU_DIALOG_TITLE, ProDeTextGenerator::TXT_GCU_PORTS_BOX, ProDeTextGenerator::TXT_LABEL_ADDRESS_SPACE, and ProDeTextGenerator::TXT_LABEL_NAME.
|
privatevirtual |
Transfers data from the GCU object to the dialog widgets.
Definition at line 247 of file GCUDialog.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 272 of file GCUDialog.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::name(), ProDeConstants::NONE, and WxConversion::toWxString().
|
private |
Updates the operation list.
Definition at line 585 of file GCUDialog.cc.
References dummy, and WxConversion::toWxString().
|
private |
Updates 'Ports' list control.
Clears all items from the choicer and adds all ports.
Definition at line 334 of file GCUDialog.cc.
References dummy, TTAMachine::BaseFUPort::isTriggering(), TTAMachine::Port::name(), Conversion::toString(), WxConversion::toWxString(), and TTAMachine::BaseFUPort::width().
|
private |
Updates the Return address port choicer when the return address port choicer selection is changed.
Definition at line 305 of file GCUDialog.cc.
References TTAMachine::Port::name(), ProDeConstants::NONE, and WxConversion::toWxString().
|
private |
|
private |
Address Space choice control.
Definition at line 96 of file GCUDialog.hh.
|
private |
Number of delay slots of the global control unit.
Definition at line 91 of file GCUDialog.hh.
|
private |
The Global Control Unit to be modified with the dialog.
Definition at line 87 of file GCUDialog.hh.
|
private |
Guard latency of the gcu.
Definition at line 93 of file GCUDialog.hh.
|
private |
Name of the global control unit.
Definition at line 89 of file GCUDialog.hh.
|
private |
Operation list widget.
Definition at line 101 of file GCUDialog.hh.
|
private |
Box sizer for the operations list controls.
Definition at line 106 of file GCUDialog.hh.
|
private |
Port list widget.
Definition at line 103 of file GCUDialog.hh.
|
private |
Box sizer for the port list controls.
Definition at line 108 of file GCUDialog.hh.
|
private |
Return address port choice control.
Definition at line 98 of file GCUDialog.hh.