OpenASIP
2.0
|
#include <RFDialog.hh>
Public Member Functions | |
RFDialog (wxWindow *parent, TTAMachine::RegisterFile *registerFile) | |
virtual | ~RFDialog () |
Private Types | |
enum | { ID_NAME = 10000, ID_TYPE, ID_SIZE, ID_WIDTH, ID_MAX_READS, ID_MAX_WRITES, ID_GUARD_LATENCY, ID_PORT_LIST, ID_ADD_PORT, ID_EDIT_PORT, ID_DELETE_PORT, ID_HELP, ID_LABEL_NAME, ID_LABEL_SIZE, ID_LABEL_WIDTH, ID_LABEL_TYPE, ID_LABEL_MAX_READS, ID_LABEL_MAX_WRITES, ID_LABEL_GUARD_LATENCY, ID_ZERO_REGISTER } |
enumerated IDs for the dialog controls More... | |
Private Member Functions | |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
virtual bool | TransferDataToWindow () |
TTAMachine::Port * | selectedPort () const |
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 | onActivatePort (wxListEvent &event) |
void | onEditPort (wxCommandEvent &event) |
void | onDeletePort (wxCommandEvent &event) |
void | updateWidgets () |
void | updatePortList () |
void | setTexts () |
Private Attributes | |
wxStaticBoxSizer * | portsSizer_ |
Sizer containing the port list and associated buttons. More... | |
TTAMachine::RegisterFile * | registerFile_ |
Register file to modify. More... | |
wxString | name_ |
Name of the register file. More... | |
int | size_ |
Number of registers. More... | |
int | width_ |
Width. More... | |
int | maxReads_ |
Max reads. More... | |
int | maxWrites_ |
Maximum writes. More... | |
int | guardLatency_ |
Guard latency. More... | |
bool | zeroRegister_ |
Zero register. More... | |
wxListCtrl * | portListCtrl_ |
Port list control. More... | |
wxChoice * | typeChoice_ |
Opcode choice control. More... | |
Dialog for editing register file parameters.
Definition at line 47 of file RFDialog.hh.
|
private |
enumerated IDs for the dialog controls
Definition at line 95 of file RFDialog.hh.
RFDialog::RFDialog | ( | wxWindow * | parent, |
TTAMachine::RegisterFile * | registerFile | ||
) |
The Constructor.
parent | Parent window of the dialog. |
registerFile | Register file to add/edit. |
Definition at line 82 of file RFDialog.cc.
|
virtual |
|
private |
Creates the dialog window contents.
This method was generated with wxDesigner.
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 536 of file RFDialog.cc.
|
private |
Handles left mouse button double clicks on the port list.
Definition at line 455 of file RFDialog.cc.
References dummy.
|
private |
Creates and shows an empty RFPortDialog for adding ports.
Definition at line 412 of file RFDialog.cc.
References ProDeConstants::COMP_NEW_NAME_PREFIX_PORT, and Conversion::toString().
|
private |
Deletes selected port from the port list.
Definition at line 441 of file RFDialog.cc.
References assert.
|
private |
Handles the 'Edit Port' button event.
Opens a RFPortDialog with the selected port's attributes set.
Definition at line 467 of file RFDialog.cc.
|
private |
|
private |
Checks whether name field is empty and disables OK button of the dialog if it is.
Definition at line 373 of file RFDialog.cc.
References assert.
|
private |
Validates input in the controls, and updates the RegisterFile.
Definition at line 285 of file RFDialog.cc.
References assert, ProDeTextGenerator::COMP_A_REGISTER_FILE, ProDeTextGenerator::COMP_MACHINE, ProDeTextGenerator::COMP_REGISTER_FILE, TTAMachine::Machine::Navigator< ComponentType >::count(), Exception::errorMessage(), ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, TTAMachine::Component::name(), TTAMachine::RegisterFile::NORMAL, TTAMachine::RegisterFile::RESERVED, Texts::TextGenerator::text(), WxConversion::toString(), WxConversion::toWxString(), and TTAMachine::RegisterFile::VOLATILE.
|
private |
Opens a pop-up menu when right mouse button was pressed.
event | Information about right mouse click event. |
Definition at line 505 of file RFDialog.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.
Definition at line 488 of file RFDialog.cc.
|
private |
Returns pointer to the port which is selected on the port list.
Definition at line 392 of file RFDialog.cc.
References WxConversion::toString().
|
private |
Sets texts for widgets.
Definition at line 135 of file RFDialog.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_LABEL_GUARD_LATENCY, ProDeTextGenerator::TXT_LABEL_MAX_READS, ProDeTextGenerator::TXT_LABEL_MAX_WRITES, ProDeTextGenerator::TXT_LABEL_NAME, ProDeTextGenerator::TXT_LABEL_SIZE, ProDeTextGenerator::TXT_LABEL_TYPE, ProDeTextGenerator::TXT_LABEL_WIDTH, ProDeTextGenerator::TXT_RF_DIALOG_TITLE, ProDeTextGenerator::TXT_RF_PORTS_BOX, ProDeTextGenerator::TXT_RF_TYPE_NORMAL, ProDeTextGenerator::TXT_RF_TYPE_RESERVED, and ProDeTextGenerator::TXT_RF_TYPE_VOLATILE.
|
privatevirtual |
Transfers data from the RegisterFile object to the dialog widgets.
Definition at line 210 of file RFDialog.cc.
|
private |
Updates the port list widget.
Definition at line 269 of file RFDialog.cc.
References WxConversion::toWxString().
|
private |
Reads data form the RegisterFile and updates GUI.
Definition at line 223 of file RFDialog.cc.
References assert, TTAMachine::RegisterFile::NORMAL, TTAMachine::RegisterFile::RESERVED, WxConversion::toWxString(), and TTAMachine::RegisterFile::VOLATILE.
|
private |
Guard latency.
Definition at line 85 of file RFDialog.hh.
|
private |
Max reads.
Definition at line 81 of file RFDialog.hh.
|
private |
Maximum writes.
Definition at line 83 of file RFDialog.hh.
|
private |
Name of the register file.
Definition at line 75 of file RFDialog.hh.
|
private |
Port list control.
Definition at line 90 of file RFDialog.hh.
|
private |
Sizer containing the port list and associated buttons.
Definition at line 70 of file RFDialog.hh.
|
private |
Register file to modify.
Definition at line 73 of file RFDialog.hh.
|
private |
Number of registers.
Definition at line 77 of file RFDialog.hh.
|
private |
Opcode choice control.
Definition at line 92 of file RFDialog.hh.
|
private |
Width.
Definition at line 79 of file RFDialog.hh.
|
private |
Zero register.
Definition at line 87 of file RFDialog.hh.