OpenASIP 2.2
|
#include <BridgeDialog.hh>
Public Member Functions | |
BridgeDialog (wxWindow *parent, TTAMachine::Bridge *bridge, TTAMachine::Bridge *opposite) | |
virtual | ~BridgeDialog () |
Private Types | |
enum | { ID_NAME = 10000 , ID_OUTPUT_BUS , ID_INPUT_BUS , ID_OPPOSITE_BRIDGE , ID_BIDIRECTIONAL , ID_HELP , ID_LABEL_NAME , ID_LABEL_OPPOSITE_NAME , ID_LABEL_INPUT_BUS , ID_LABEL_OUTPUT_BUS , ID_LINE } |
Private Member Functions | |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
virtual bool | TransferDataToWindow () |
void | setTexts () |
void | updateBusChoices () |
void | onOK (wxCommandEvent &) |
void | onCancel (wxCommandEvent &) |
void | onHelp (wxCommandEvent &event) |
void | onName (wxCommandEvent &) |
void | onInputBus (wxCommandEvent &) |
void | onOutputBus (wxCommandEvent &) |
void | onBidirectional (wxCommandEvent &) |
Private Attributes | |
TTAMachine::Machine * | machine_ |
Parent machine of the bridge(s). | |
wxString | name_ |
Name of the bridge. | |
wxString | oppositeName_ |
Name of the opposite bridge. | |
wxString | inputBus_ |
Name of the bridge input bus. | |
wxString | outputBus_ |
Name of the bridge output bus. | |
wxTextCtrl * | oppositeNameCtrl_ |
Opposite name control. | |
wxChoice * | inputBusChoice_ |
Input bus choice control. | |
wxChoice * | outputBusChoice_ |
Output bus choice control. | |
wxCheckBox * | bidirectionalBox_ |
Indicates whether the bridge is bidirectional. | |
bool | adding_ |
Indicates whether we are adding a bridge or not. | |
bool | bidirectional_ |
Indicates whether we are modifying a bidirectional bridge or not. | |
Dialog for querying bridge parameters from the user.
Definition at line 46 of file BridgeDialog.hh.
|
private |
Enumerator | |
---|---|
ID_NAME | |
ID_OUTPUT_BUS | |
ID_INPUT_BUS | |
ID_OPPOSITE_BRIDGE | |
ID_BIDIRECTIONAL | |
ID_HELP | |
ID_LABEL_NAME | |
ID_LABEL_OPPOSITE_NAME | |
ID_LABEL_INPUT_BUS | |
ID_LABEL_OUTPUT_BUS | |
ID_LINE |
Definition at line 98 of file BridgeDialog.hh.
BridgeDialog::BridgeDialog | ( | wxWindow * | parent, |
TTAMachine::Bridge * | bridge, | ||
TTAMachine::Bridge * | opposite | ||
) |
The Constructor.
parent | Parent window of the dialog. |
bridge | Bridge to be modified with the dialog. |
opposite | Bridge to be modified having the opposite direction compared to bridge. |
Definition at line 80 of file BridgeDialog.cc.
References assert, MDFView::canvas(), MachineCanvasTool::deactivate(), MachineCanvas::tool(), and WxConversion::toWxString().
|
virtual |
|
private |
Creates the dialog window contents.
This method was initially generated with wxDesigner, thus the ugly code and too long lines.
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 469 of file BridgeDialog.cc.
References ID_BIDIRECTIONAL, ID_HELP, ID_INPUT_BUS, ID_LABEL_INPUT_BUS, ID_LABEL_NAME, ID_LABEL_OPPOSITE_NAME, ID_LABEL_OUTPUT_BUS, ID_LINE, ID_NAME, ID_OPPOSITE_BRIDGE, and ID_OUTPUT_BUS.
|
private |
Handles changes in bidirectional control.
When bdirectional is on, the opposite bridge name control is enabled, otherwise it is disabled.
Definition at line 444 of file BridgeDialog.cc.
References bidirectional_, bidirectionalBox_, dummy, onName(), and oppositeNameCtrl_.
|
private |
Definition at line 354 of file BridgeDialog.cc.
References MachineCanvasTool::activate(), MDFView::canvas(), and MachineCanvas::tool().
|
private |
|
private |
Handles changes in the input bus control.
Output bus choicer is updated to contain only valid output busses for the selected input bus.
Definition at line 408 of file BridgeDialog.cc.
References assert, TTAMachine::Machine::busNavigator(), MachineTester::canBridge(), TTAMachine::Machine::Navigator< ComponentType >::count(), inputBus_, inputBusChoice_, TTAMachine::Machine::Navigator< ComponentType >::item(), machine_, outputBus_, outputBusChoice_, WxConversion::toString(), WxConversion::toWxString(), and updateBusChoices().
|
private |
Checks whether name field is empty and disables OK button of the dialog if it is.
Definition at line 366 of file BridgeDialog.cc.
References bidirectional_, ID_NAME, and ID_OPPOSITE_BRIDGE.
Referenced by onBidirectional(), and TransferDataToWindow().
|
private |
Validates input in the controls, and updates the Bridge object.
Definition at line 263 of file BridgeDialog.cc.
References MachineCanvasTool::activate(), bidirectional_, TTAMachine::Machine::bridgeNavigator(), TTAMachine::Machine::busNavigator(), MachineTester::canBridge(), MDFView::canvas(), ProDeTextGenerator::COMP_A_BRIDGE, ProDeTextGenerator::COMP_BRIDGE, ProDeTextGenerator::COMP_MACHINE, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), inputBus_, ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, machine_, ProDeTextGenerator::MSG_ERROR_BRIDGE_NAMES, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, name_, oppositeName_, outputBus_, Texts::TextGenerator::text(), MachineCanvas::tool(), WxConversion::toString(), and WxConversion::toWxString().
|
private |
Handles changes in input bus control.
Checks that input bus is not the same as output bus. If it is the output bus is changed to the previous value of the input bus.
Definition at line 394 of file BridgeDialog.cc.
References outputBus_, outputBusChoice_, and updateBusChoices().
|
private |
Sets texts for widgets.
Definition at line 162 of file BridgeDialog.cc.
References ID_BIDIRECTIONAL, ID_HELP, ID_LABEL_INPUT_BUS, ID_LABEL_NAME, ID_LABEL_OPPOSITE_NAME, ID_OUTPUT_BUS, GUITextGenerator::instance(), ProDeTextGenerator::instance(), WidgetTools::setLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), ProDeTextGenerator::TXT_BRIDGE_DIALOG_TITLE, GUITextGenerator::TXT_BUTTON_CANCEL, GUITextGenerator::TXT_BUTTON_HELP, GUITextGenerator::TXT_BUTTON_OK, ProDeTextGenerator::TXT_LABEL_BIDIRECTIONAL, ProDeTextGenerator::TXT_LABEL_INPUT_BUS, ProDeTextGenerator::TXT_LABEL_NAME, ProDeTextGenerator::TXT_LABEL_OPPOSITE_BRIDGE, and ProDeTextGenerator::TXT_LABEL_OUTPUT_BUS.
|
privatevirtual |
Transfers data from the bridge object(s) to the dialog widgets.
Definition at line 203 of file BridgeDialog.cc.
References bidirectional_, bidirectionalBox_, dummy, onName(), oppositeNameCtrl_, and updateBusChoices().
|
private |
Updates the bus choicers.
Definition at line 228 of file BridgeDialog.cc.
References TTAMachine::Machine::busNavigator(), MachineTester::canBridge(), TTAMachine::Machine::Navigator< ComponentType >::count(), inputBus_, inputBusChoice_, TTAMachine::Machine::Navigator< ComponentType >::item(), machine_, outputBus_, outputBusChoice_, WxConversion::toString(), and WxConversion::toWxString().
Referenced by onInputBus(), onOutputBus(), and TransferDataToWindow().
|
private |
Indicates whether we are adding a bridge or not.
Definition at line 93 of file BridgeDialog.hh.
|
private |
Indicates whether we are modifying a bidirectional bridge or not.
Definition at line 95 of file BridgeDialog.hh.
Referenced by onBidirectional(), onName(), onOK(), and TransferDataToWindow().
|
private |
Indicates whether the bridge is bidirectional.
Definition at line 90 of file BridgeDialog.hh.
Referenced by onBidirectional(), and TransferDataToWindow().
|
private |
Name of the bridge input bus.
Definition at line 79 of file BridgeDialog.hh.
Referenced by onInputBus(), onOK(), and updateBusChoices().
|
private |
Input bus choice control.
Definition at line 86 of file BridgeDialog.hh.
Referenced by onInputBus(), and updateBusChoices().
|
private |
Parent machine of the bridge(s).
Definition at line 72 of file BridgeDialog.hh.
Referenced by onInputBus(), onOK(), and updateBusChoices().
|
private |
|
private |
|
private |
Opposite name control.
Definition at line 84 of file BridgeDialog.hh.
Referenced by onBidirectional(), and TransferDataToWindow().
|
private |
Name of the bridge output bus.
Definition at line 81 of file BridgeDialog.hh.
Referenced by onInputBus(), onOK(), onOutputBus(), and updateBusChoices().
|
private |
Output bus choice control.
Definition at line 88 of file BridgeDialog.hh.
Referenced by onInputBus(), onOutputBus(), and updateBusChoices().