OpenASIP 2.2
|
#include <FUGuardDialog.hh>
Public Member Functions | |
FUGuardDialog (wxWindow *parent, TTAMachine::Bus *bus, TTAMachine::PortGuard *guard=NULL) | |
virtual | ~FUGuardDialog () |
virtual bool | TransferDataToWindow () |
Private Types | |
enum | { ID_LABEL_NAME = 10000 , ID_LABEL_PORT , ID_FU_NAME , ID_FU_PORT , ID_INVERTED , ID_HELP , ID_LINE } |
Private Member Functions | |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
void | onFUChoice (wxCommandEvent &event) |
void | onOK (wxCommandEvent &event) |
void | onCancel (wxCommandEvent &event) |
TTAMachine::FunctionUnit * | selectedFU () const |
TTAMachine::FUPort * | selectedPort () const |
void | setTexts () |
Private Attributes | |
wxChoice * | nameChoice_ |
Choice widget for the function unit selection. | |
wxChoice * | portChoice_ |
Choice widget for the port selection. | |
wxCheckBox * | invertedBox_ |
Checkbox widget for the inverted flag. | |
bool | inverted_ |
Inverted flag for the guard. | |
bool | newInverted_ |
Modified inverted flag. | |
TTAMachine::FUPort * | port_ |
Port of the guard. | |
TTAMachine::Bus * | bus_ |
Parent bus of the guard. | |
bool | adding_ |
True if a new guard is being added, false otherwise. | |
Dialog for editing function unit port guard properties.
Definition at line 47 of file FUGuardDialog.hh.
|
private |
Enumerator | |
---|---|
ID_LABEL_NAME | |
ID_LABEL_PORT | |
ID_FU_NAME | |
ID_FU_PORT | |
ID_INVERTED | |
ID_HELP | |
ID_LINE |
Definition at line 84 of file FUGuardDialog.hh.
FUGuardDialog::FUGuardDialog | ( | wxWindow * | parent, |
TTAMachine::Bus * | bus, | ||
TTAMachine::PortGuard * | guard = NULL |
||
) |
The Constructor.
parent | Parent window of the dialog. |
guard | Port guard to edit. |
Definition at line 65 of file FUGuardDialog.cc.
References assert, TTAMachine::Machine::Navigator< ComponentType >::count(), and TTAMachine::Machine::Navigator< ComponentType >::item().
|
virtual |
|
private |
Creates contents of the dialog window.
Code generated with wxDesigner.
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 320 of file FUGuardDialog.cc.
References ID_FU_NAME, ID_FU_PORT, ID_HELP, ID_INVERTED, ID_LABEL_NAME, ID_LABEL_PORT, and ID_LINE.
|
private |
Cancels the dialog effects by creating the original port guard.
Closes the Dialog.
Definition at line 301 of file FUGuardDialog.cc.
|
private |
Updates the port choice when the function unit selection is changed.
Definition at line 208 of file FUGuardDialog.cc.
References TTAMachine::Port::name(), TTAMachine::FunctionUnit::port(), portChoice_, TTAMachine::Unit::portCount(), selectedFU(), and WxConversion::toWxString().
|
private |
Updates the guard object when the OK-button is pressed.
Closes the dialog.
Definition at line 266 of file FUGuardDialog.cc.
References bus_, ProDeTextGenerator::instance(), ProDeTextGenerator::MSG_ERROR, ProDeTextGenerator::MSG_ERROR_GUARD_EXISTS, newInverted_, selectedPort(), Texts::TextGenerator::text(), and WxConversion::toWxString().
|
private |
Returns a pointer to the selected function unit.
Definition at line 234 of file FUGuardDialog.cc.
References bus_, TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), nameChoice_, and WxConversion::toString().
Referenced by onFUChoice(), and selectedPort().
|
private |
Returns a pointer to the selected function unit port.
Definition at line 249 of file FUGuardDialog.cc.
References TTAMachine::FunctionUnit::operationPort(), portChoice_, selectedFU(), and WxConversion::toString().
Referenced by onOK().
|
private |
Sets texts for widgets.
Definition at line 130 of file FUGuardDialog.cc.
References ID_HELP, ID_INVERTED, ID_LABEL_NAME, ID_LABEL_PORT, 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_GUARD_DIALOG_TITLE, ProDeTextGenerator::TXT_LABEL_FU_NAME, ProDeTextGenerator::TXT_LABEL_INVERTED, and ProDeTextGenerator::TXT_LABEL_PORT_NAME.
|
virtual |
Transfers data from the guard object to the dialog widgets.
Definition at line 167 of file FUGuardDialog.cc.
References bus_, TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::functionUnitNavigator(), invertedBox_, TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), TTAMachine::Component::name(), TTAMachine::Port::name(), nameChoice_, newInverted_, TTAMachine::Port::outputSocket(), TTAMachine::BaseFUPort::parentUnit(), TTAMachine::FunctionUnit::port(), port_, portChoice_, and WxConversion::toWxString().
|
private |
True if a new guard is being added, false otherwise.
Definition at line 81 of file FUGuardDialog.hh.
Referenced by onCancel().
|
private |
Parent bus of the guard.
Definition at line 79 of file FUGuardDialog.hh.
Referenced by onCancel(), onOK(), selectedFU(), and TransferDataToWindow().
|
private |
Inverted flag for the guard.
Definition at line 73 of file FUGuardDialog.hh.
Referenced by onCancel().
|
private |
Checkbox widget for the inverted flag.
Definition at line 70 of file FUGuardDialog.hh.
Referenced by TransferDataToWindow().
|
private |
Choice widget for the function unit selection.
Definition at line 66 of file FUGuardDialog.hh.
Referenced by selectedFU(), and TransferDataToWindow().
|
private |
Modified inverted flag.
Definition at line 75 of file FUGuardDialog.hh.
Referenced by onOK(), and TransferDataToWindow().
|
private |
Port of the guard.
Definition at line 77 of file FUGuardDialog.hh.
Referenced by onCancel(), and TransferDataToWindow().
|
private |
Choice widget for the port selection.
Definition at line 68 of file FUGuardDialog.hh.
Referenced by onFUChoice(), selectedPort(), and TransferDataToWindow().