OpenASIP 2.2
|
#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. | |
TTAMachine::RegisterFile * | registerFile_ |
Register file to modify. | |
wxString | name_ |
Name of the register file. | |
int | size_ |
Number of registers. | |
int | width_ |
Width. | |
int | maxReads_ |
Max reads. | |
int | maxWrites_ |
Maximum writes. | |
int | guardLatency_ |
Guard latency. | |
bool | zeroRegister_ |
Zero register. | |
wxListCtrl * | portListCtrl_ |
Port list control. | |
wxChoice * | typeChoice_ |
Opcode choice control. | |
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.
References ID_ADD_PORT, ID_DELETE_PORT, ID_EDIT_PORT, ID_GUARD_LATENCY, ID_HELP, ID_LABEL_GUARD_LATENCY, ID_LABEL_MAX_READS, ID_LABEL_MAX_WRITES, ID_LABEL_NAME, ID_LABEL_SIZE, ID_LABEL_TYPE, ID_LABEL_WIDTH, ID_MAX_READS, ID_MAX_WRITES, ID_NAME, ID_PORT_LIST, ID_SIZE, ID_TYPE, ID_WIDTH, ID_ZERO_REGISTER, and portsSizer_.
|
private |
Handles left mouse button double clicks on the port list.
Definition at line 455 of file RFDialog.cc.
References dummy, and onEditPort().
|
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, TTAMachine::Unit::hasPort(), registerFile_, Conversion::toString(), updatePortList(), and updateWidgets().
|
private |
Deletes selected port from the port list.
Definition at line 441 of file RFDialog.cc.
References assert, selectedPort(), updatePortList(), and updateWidgets().
|
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.
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 373 of file RFDialog.cc.
|
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(), guardLatency_, 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::RegisterFile::NORMAL, registerFile_, TTAMachine::Machine::registerFileNavigator(), TTAMachine::RegisterFile::RESERVED, TTAMachine::RegisterFile::setGuardLatency(), TTAMachine::RegisterFile::setName(), TTAMachine::RegisterFile::setNumberOfRegisters(), TTAMachine::RegisterFile::setType(), TTAMachine::BaseRegisterFile::setWidth(), TTAMachine::RegisterFile::setZeroRegister(), size_, Texts::TextGenerator::text(), WxConversion::toString(), WxConversion::toWxString(), typeChoice_, TTAMachine::RegisterFile::VOLATILE, width_, and zeroRegister_.
|
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 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.
Definition at line 488 of file RFDialog.cc.
References ID_DELETE_PORT, ID_EDIT_PORT, and portListCtrl_.
|
private |
Returns pointer to the port which is selected on the port list.
Definition at line 392 of file RFDialog.cc.
References TTAMachine::BaseRegisterFile::port(), portListCtrl_, registerFile_, and WxConversion::toString().
Referenced by onDeletePort(), and onEditPort().
|
private |
Sets texts for widgets.
Definition at line 135 of file RFDialog.cc.
References ID_ADD_PORT, ID_DELETE_PORT, ID_EDIT_PORT, ID_HELP, ID_LABEL_GUARD_LATENCY, ID_LABEL_MAX_READS, ID_LABEL_MAX_WRITES, ID_LABEL_NAME, ID_LABEL_SIZE, ID_LABEL_TYPE, ID_LABEL_WIDTH, ID_PORT_LIST, GUITextGenerator::instance(), ProDeTextGenerator::instance(), 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_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, ProDeTextGenerator::TXT_RF_TYPE_VOLATILE, and typeChoice_.
|
privatevirtual |
Transfers data from the RegisterFile object to the dialog widgets.
Definition at line 210 of file RFDialog.cc.
References updateWidgets().
|
private |
Updates the port list widget.
Definition at line 269 of file RFDialog.cc.
References TTAMachine::Port::name(), TTAMachine::BaseRegisterFile::port(), TTAMachine::Unit::portCount(), portListCtrl_, registerFile_, and WxConversion::toWxString().
Referenced by onAddPort(), onDeletePort(), onEditPort(), and updateWidgets().
|
private |
Reads data form the RegisterFile and updates GUI.
Definition at line 223 of file RFDialog.cc.
References assert, TTAMachine::RegisterFile::guardLatency(), guardLatency_, ID_GUARD_LATENCY, ID_MAX_READS, ID_MAX_WRITES, ID_SIZE, ID_WIDTH, ID_ZERO_REGISTER, TTAMachine::RegisterFile::maxReads(), maxReads_, TTAMachine::RegisterFile::maxWrites(), maxWrites_, TTAMachine::Component::name(), name_, TTAMachine::RegisterFile::NORMAL, TTAMachine::BaseRegisterFile::numberOfRegisters(), registerFile_, TTAMachine::RegisterFile::RESERVED, size_, WxConversion::toWxString(), TTAMachine::RegisterFile::type(), typeChoice_, updatePortList(), TTAMachine::RegisterFile::VOLATILE, TTAMachine::BaseRegisterFile::width(), width_, TTAMachine::RegisterFile::zeroRegister(), and zeroRegister_.
Referenced by onAddPort(), onDeletePort(), and TransferDataToWindow().
|
private |
Guard latency.
Definition at line 85 of file RFDialog.hh.
Referenced by onOK(), and updateWidgets().
|
private |
|
private |
|
private |
Name of the register file.
Definition at line 75 of file RFDialog.hh.
Referenced by onName(), onOK(), and updateWidgets().
|
private |
Port list control.
Definition at line 90 of file RFDialog.hh.
Referenced by onPortRightClick(), onPortSelection(), selectedPort(), and updatePortList().
|
private |
Sizer containing the port list and associated buttons.
Definition at line 70 of file RFDialog.hh.
Referenced by createContents(), and setTexts().
|
private |
Register file to modify.
Definition at line 73 of file RFDialog.hh.
Referenced by onAddPort(), onOK(), selectedPort(), updatePortList(), and updateWidgets().
|
private |
Number of registers.
Definition at line 77 of file RFDialog.hh.
Referenced by onOK(), and updateWidgets().
|
private |
Opcode choice control.
Definition at line 92 of file RFDialog.hh.
Referenced by onOK(), setTexts(), and updateWidgets().
|
private |
|
private |
Zero register.
Definition at line 87 of file RFDialog.hh.
Referenced by onOK(), and updateWidgets().