OpenASIP
2.0
|
#include <SRPortDialog.hh>
Public Member Functions | |
SRPortDialog (wxWindow *parent, TTAMachine::SpecialRegisterPort *port) | |
~SRPortDialog () | |
Protected Member Functions | |
virtual bool | TransferDataToWindow () |
Private Types | |
enum | { ID_NAME =10000, ID_WIDTH, ID_INPUT_SOCKET, ID_OUTPUT_SOCKET, ID_HELP, ID_LABEL_NAME, ID_LABEL_WIDTH, ID_LABEL_INPUT_SOCKET, ID_LABEL_OUTPUT_SOCKET, ID_LINE } |
Private Member Functions | |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
void | updateSockets () |
void | onOK (wxCommandEvent &event) |
void | onCancel (wxCommandEvent &event) |
void | onSocketChoice (wxCommandEvent &event) |
void | onHelp (wxCommandEvent &event) |
void | onName (wxCommandEvent &event) |
void | setTexts () |
Private Attributes | |
TTAMachine::SpecialRegisterPort * | port_ |
Function unit port to modify. More... | |
wxString | name_ |
Name of the port. More... | |
int | width_ |
Width of the port. More... | |
wxChoice * | inputSocketChoice_ |
Input socket choice control. More... | |
wxChoice * | outputSocketChoice_ |
Output socket choice control. More... | |
TTAMachine::Socket * | oldInput_ |
Original input socket of the port. More... | |
TTAMachine::Socket * | oldOutput_ |
Original output socket of the port. More... | |
Dialog for creating and editing special register ports.
Definition at line 44 of file SRPortDialog.hh.
|
private |
Enumerator | |
---|---|
ID_NAME | |
ID_WIDTH | |
ID_INPUT_SOCKET | |
ID_OUTPUT_SOCKET | |
ID_HELP | |
ID_LABEL_NAME | |
ID_LABEL_WIDTH | |
ID_LABEL_INPUT_SOCKET | |
ID_LABEL_OUTPUT_SOCKET | |
ID_LINE |
Definition at line 79 of file SRPortDialog.hh.
SRPortDialog::SRPortDialog | ( | wxWindow * | parent, |
TTAMachine::SpecialRegisterPort * | port | ||
) |
The Constructor.
parent | Parent window of the dialog. |
port | Port to modify. |
Definition at line 78 of file SRPortDialog.cc.
SRPortDialog::~SRPortDialog | ( | ) |
|
private |
Creates contents of the dialog window. Initially generated with wxDesigner, the code will be cleaned up later.
parent | Parent dialog of the contents. |
call_fit | If true, fits sizer in dialog window. |
set_sizer | If true, sets sizer as dialog's sizer. |
Definition at line 381 of file SRPortDialog.cc.
|
private |
Resets the original input and output sockets for the port and closes the dialog.
Definition at line 249 of file SRPortDialog.cc.
|
private |
|
private |
Disables OK-button if the name field is empty.
Definition at line 358 of file SRPortDialog.cc.
References assert.
|
private |
Validates input in the controls, and updates the port object.
Definition at line 265 of file SRPortDialog.cc.
References assert, ProDeTextGenerator::COMP_A_PORT, ProDeTextGenerator::COMP_FUNCTION_UNIT, ProDeTextGenerator::COMP_PORT, ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), machine, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, TTAMachine::Port::name(), TTAMachine::FunctionUnit::port(), TTAMachine::Unit::portCount(), Texts::TextGenerator::text(), WxConversion::toString(), and WxConversion::toWxString().
|
private |
Updates the port object when user changes input/output socket selection.
Definition at line 332 of file SRPortDialog.cc.
References TTAMachine::Machine::Navigator< ComponentType >::item(), ProDeConstants::NONE, and WxConversion::toString().
|
private |
Sets texts for widgets.
Definition at line 120 of file SRPortDialog.cc.
References GUITextGenerator::instance(), ProDeTextGenerator::instance(), WidgetTools::setLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), GUITextGenerator::TXT_BUTTON_CANCEL, GUITextGenerator::TXT_BUTTON_HELP, GUITextGenerator::TXT_BUTTON_OK, ProDeTextGenerator::TXT_LABEL_INPUT_SOCKET, ProDeTextGenerator::TXT_LABEL_NAME, ProDeTextGenerator::TXT_LABEL_OUTPUT_SOCKET, ProDeTextGenerator::TXT_LABEL_WIDTH, and ProDeTextGenerator::TXT_SR_PORT_DIALOG_TITLE.
|
protectedvirtual |
Transfers data from the port object to the dialog widgets.
Definition at line 161 of file SRPortDialog.cc.
References WxConversion::toWxString().
|
private |
Updates input and output socket choicers.
Definition at line 179 of file SRPortDialog.cc.
References MachineTester::canConnect(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Socket::direction(), TTAMachine::Socket::INPUT, TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::name(), ProDeConstants::NONE, TTAMachine::Socket::OUTPUT, and WxConversion::toWxString().
|
private |
Input socket choice control.
Definition at line 70 of file SRPortDialog.hh.
|
private |
Name of the port.
Definition at line 66 of file SRPortDialog.hh.
|
private |
Original input socket of the port.
Definition at line 75 of file SRPortDialog.hh.
|
private |
Original output socket of the port.
Definition at line 77 of file SRPortDialog.hh.
|
private |
Output socket choice control.
Definition at line 72 of file SRPortDialog.hh.
|
private |
Function unit port to modify.
Definition at line 64 of file SRPortDialog.hh.
|
private |
Width of the port.
Definition at line 68 of file SRPortDialog.hh.