OpenASIP
2.0
|
#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). More... | |
wxString | name_ |
Name of the bridge. More... | |
wxString | oppositeName_ |
Name of the opposite bridge. More... | |
wxString | inputBus_ |
Name of the bridge input bus. More... | |
wxString | outputBus_ |
Name of the bridge output bus. More... | |
wxTextCtrl * | oppositeNameCtrl_ |
Opposite name control. More... | |
wxChoice * | inputBusChoice_ |
Input bus choice control. More... | |
wxChoice * | outputBusChoice_ |
Output bus choice control. More... | |
wxCheckBox * | bidirectionalBox_ |
Indicates whether the bridge is bidirectional. More... | |
bool | adding_ |
Indicates whether we are adding a bridge or not. More... | |
bool | bidirectional_ |
Indicates whether we are modifying a bidirectional bridge or not. More... | |
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.
|
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 dummy.
|
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, MachineTester::canBridge(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), WxConversion::toString(), and WxConversion::toWxString().
|
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.
|
private |
Validates input in the controls, and updates the Bridge object.
Definition at line 263 of file BridgeDialog.cc.
References MachineCanvasTool::activate(), MachineTester::canBridge(), MDFView::canvas(), ProDeTextGenerator::COMP_A_BRIDGE, ProDeTextGenerator::COMP_BRIDGE, ProDeTextGenerator::COMP_MACHINE, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, ProDeTextGenerator::MSG_ERROR_BRIDGE_NAMES, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, 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.
|
private |
Sets texts for widgets.
Definition at line 162 of file BridgeDialog.cc.
References 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 dummy.
|
private |
Updates the bus choicers.
Definition at line 228 of file BridgeDialog.cc.
References MachineTester::canBridge(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), WxConversion::toString(), and WxConversion::toWxString().
|
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.
|
private |
Indicates whether the bridge is bidirectional.
Definition at line 90 of file BridgeDialog.hh.
|
private |
Name of the bridge input bus.
Definition at line 79 of file BridgeDialog.hh.
|
private |
Input bus choice control.
Definition at line 86 of file BridgeDialog.hh.
|
private |
Parent machine of the bridge(s).
Definition at line 72 of file BridgeDialog.hh.
|
private |
Name of the bridge.
Definition at line 74 of file BridgeDialog.hh.
|
private |
Name of the opposite bridge.
Definition at line 76 of file BridgeDialog.hh.
|
private |
Opposite name control.
Definition at line 84 of file BridgeDialog.hh.
|
private |
Name of the bridge output bus.
Definition at line 81 of file BridgeDialog.hh.
|
private |
Output bus choice control.
Definition at line 88 of file BridgeDialog.hh.