OpenASIP 2.2
|
#include <FUPortDialog.hh>
Public Member Functions | |
FUPortDialog (wxWindow *parent, TTAMachine::FUPort *port) | |
~FUPortDialog () | |
Protected Member Functions | |
virtual bool | TransferDataToWindow () |
Private Types | |
enum | { ID_NAME =10000 , ID_WIDTH , ID_INPUT_SOCKET , ID_OUTPUT_SOCKET , ID_TRIGGERS , 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::FUPort * | port_ |
Function unit port to modify. | |
wxString | name_ |
Name of the port. | |
int | width_ |
Width of the port. | |
bool | triggers_ |
Trigger attribute of the port. | |
wxChoice * | inputSocketChoice_ |
Input socket choice control. | |
wxChoice * | outputSocketChoice_ |
Output socket choice control. | |
TTAMachine::Socket * | oldInput_ |
Original input socket of the port. | |
TTAMachine::Socket * | oldOutput_ |
Original output socket of the port. | |
Dialog for querying port parameters from the user.
Definition at line 44 of file FUPortDialog.hh.
|
private |
Enumerator | |
---|---|
ID_NAME | |
ID_WIDTH | |
ID_INPUT_SOCKET | |
ID_OUTPUT_SOCKET | |
ID_TRIGGERS | |
ID_HELP | |
ID_LABEL_NAME | |
ID_LABEL_WIDTH | |
ID_LABEL_INPUT_SOCKET | |
ID_LABEL_OUTPUT_SOCKET | |
ID_LINE |
Definition at line 81 of file FUPortDialog.hh.
FUPortDialog::FUPortDialog | ( | wxWindow * | parent, |
TTAMachine::FUPort * | port | ||
) |
The Constructor.
parent | Parent window of the dialog. |
port | Port to modify. |
Definition at line 76 of file FUPortDialog.cc.
FUPortDialog::~FUPortDialog | ( | ) |
|
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 377 of file FUPortDialog.cc.
References ID_HELP, ID_INPUT_SOCKET, ID_LABEL_INPUT_SOCKET, ID_LABEL_NAME, ID_LABEL_OUTPUT_SOCKET, ID_LABEL_WIDTH, ID_LINE, ID_NAME, ID_OUTPUT_SOCKET, ID_TRIGGERS, and ID_WIDTH.
|
private |
Resets the original input and output sockets for the port and closes the dialog.
Definition at line 249 of file FUPortDialog.cc.
References TTAMachine::Port::attachSocket(), TTAMachine::Port::detachAllSockets(), oldInput_, oldOutput_, and port_.
|
private |
|
private |
Disables OK-button if the name field is empty.
Definition at line 354 of file FUPortDialog.cc.
|
private |
Validates input in the controls, and updates the port object.
Definition at line 265 of file FUPortDialog.cc.
References 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(), name_, TTAMachine::BaseFUPort::parentUnit(), TTAMachine::FunctionUnit::port(), port_, TTAMachine::Unit::portCount(), TTAMachine::Port::setName(), TTAMachine::FUPort::setTriggering(), TTAMachine::BaseFUPort::setWidth(), Texts::TextGenerator::text(), WxConversion::toString(), WxConversion::toWxString(), triggers_, and width_.
|
private |
Updates the port object when user changes input/output socket selection.
Definition at line 328 of file FUPortDialog.cc.
References TTAMachine::Port::attachSocket(), TTAMachine::Port::detachAllSockets(), inputSocketChoice_, TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), ProDeConstants::NONE, outputSocketChoice_, TTAMachine::BaseFUPort::parentUnit(), port_, TTAMachine::Machine::socketNavigator(), WxConversion::toString(), and updateSockets().
|
private |
Sets texts for widgets.
Definition at line 117 of file FUPortDialog.cc.
References ID_HELP, ID_LABEL_INPUT_SOCKET, ID_LABEL_NAME, ID_LABEL_OUTPUT_SOCKET, ID_LABEL_WIDTH, ID_TRIGGERS, 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_FU_PORT_DIALOG_TITLE, ProDeTextGenerator::TXT_LABEL_INPUT_SOCKET, ProDeTextGenerator::TXT_LABEL_NAME, ProDeTextGenerator::TXT_LABEL_OUTPUT_SOCKET, ProDeTextGenerator::TXT_LABEL_TRIGGERS, and ProDeTextGenerator::TXT_LABEL_WIDTH.
|
protectedvirtual |
Transfers data from the port object to the dialog widgets.
Definition at line 160 of file FUPortDialog.cc.
References ID_TRIGGERS, ID_WIDTH, TTAMachine::FUPort::isTriggering(), TTAMachine::Port::name(), name_, port_, WxConversion::toWxString(), triggers_, updateSockets(), TTAMachine::BaseFUPort::width(), and width_.
|
private |
Updates input and output socket choicers.
Definition at line 179 of file FUPortDialog.cc.
References TTAMachine::Port::attachSocket(), MachineTester::canConnect(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Port::detachSocket(), TTAMachine::Socket::direction(), TTAMachine::Socket::INPUT, TTAMachine::Port::inputSocket(), inputSocketChoice_, TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), TTAMachine::Component::name(), ProDeConstants::NONE, TTAMachine::Socket::OUTPUT, TTAMachine::Port::outputSocket(), outputSocketChoice_, TTAMachine::BaseFUPort::parentUnit(), port_, TTAMachine::Machine::socketNavigator(), and WxConversion::toWxString().
Referenced by onSocketChoice(), and TransferDataToWindow().
|
private |
Input socket choice control.
Definition at line 72 of file FUPortDialog.hh.
Referenced by onSocketChoice(), and updateSockets().
|
private |
Name of the port.
Definition at line 66 of file FUPortDialog.hh.
Referenced by onName(), onOK(), and TransferDataToWindow().
|
private |
Original input socket of the port.
Definition at line 77 of file FUPortDialog.hh.
Referenced by onCancel().
|
private |
Original output socket of the port.
Definition at line 79 of file FUPortDialog.hh.
Referenced by onCancel().
|
private |
Output socket choice control.
Definition at line 74 of file FUPortDialog.hh.
Referenced by onSocketChoice(), and updateSockets().
|
private |
Function unit port to modify.
Definition at line 64 of file FUPortDialog.hh.
Referenced by onCancel(), onOK(), onSocketChoice(), TransferDataToWindow(), and updateSockets().
|
private |
Trigger attribute of the port.
Definition at line 70 of file FUPortDialog.hh.
Referenced by onOK(), and TransferDataToWindow().
|
private |
Width of the port.
Definition at line 68 of file FUPortDialog.hh.
Referenced by onOK(), and TransferDataToWindow().