OpenASIP
2.0
|
#include <SocketDialog.hh>
Public Member Functions | |
SocketDialog (wxWindow *parent, TTAMachine::Socket *socket) | |
virtual | ~SocketDialog () |
Private Types | |
enum | { ID_NAME = 10000, ID_ATTACHED_LIST, ID_DETACHED_LIST, ID_ATTACH, ID_DETACH, ID_HELP, ID_DIRECTION, ID_LABEL_NAME, ID_LINE } |
Private Member Functions | |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
TTAMachine::Segment * | segment (wxListCtrl *listCtrl, int index) |
void | onOK (wxCommandEvent &) |
void | onHelp (wxCommandEvent &event) |
void | onName (wxCommandEvent &) |
void | onAttach (wxCommandEvent &) |
void | onDetach (wxCommandEvent &) |
void | onAttachedSelection (wxListEvent &) |
void | onDetachedSelection (wxListEvent &) |
void | onDirection (wxCommandEvent &) |
void | updateConnected () |
void | updateDirection () |
virtual bool | TransferDataToWindow () |
void | setTexts () |
Private Attributes | |
TTAMachine::Socket * | socket_ |
Socket to modify. More... | |
wxString | name_ |
Name of the socket. More... | |
MachineTester * | tester_ |
MachineTester which does sanity checks for the target machine. More... | |
wxRadioBox * | directionBox_ |
Radio box for direction. More... | |
wxListCtrl * | connectedListCtrl_ |
List control for connected (bus, segment) pairs. More... | |
wxListCtrl * | segmentListCtrl_ |
List control for all (bus, segment) pairs. More... | |
wxStaticBoxSizer * | attachedSizer_ |
Static boxsizer containing the list of attached buses. More... | |
wxStaticBoxSizer * | detachedSizer_ |
Static boxsizer containing the list of detached buses. More... | |
Dialog for modifying socket attributes.
Definition at line 50 of file SocketDialog.hh.
|
private |
Enumerator | |
---|---|
ID_NAME | |
ID_ATTACHED_LIST | |
ID_DETACHED_LIST | |
ID_ATTACH | |
ID_DETACH | |
ID_HELP | |
ID_DIRECTION | |
ID_LABEL_NAME | |
ID_LINE |
Definition at line 88 of file SocketDialog.hh.
SocketDialog::SocketDialog | ( | wxWindow * | parent, |
TTAMachine::Socket * | socket | ||
) |
The Constructor.
parent | Parent window of the dialog. |
socket | Socket to be modified with the dialog. |
Definition at line 90 of file SocketDialog.cc.
References WxConversion::toWxString().
|
virtual |
|
private |
Creates the dialog window contents.
This method was initially generated with wxDesigner, code will be cleaned up later.
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 567 of file SocketDialog.cc.
|
private |
Attaches selected segments on the segment list to the socket.
Definition at line 364 of file SocketDialog.cc.
References assert, MachineTester::canConnect(), dummy, MachineTestReporter::socketSegmentConnectionError(), and WxConversion::toWxString().
|
private |
Disables and enables Detach button under the connected list.
If a (bus, segment) pair is selected, button is enabled. If no (bus, segment) pair is selected the button will be disabled.
Definition at line 530 of file SocketDialog.cc.
|
private |
Detaches selected segments on the connection list from the socket.
Definition at line 419 of file SocketDialog.cc.
|
private |
Disables and enables Attach button under the connected list.
If a (bus, segment) pair is selected, button is enabled. If no (bus, segment) pair is selected the button will be disabled.
Definition at line 546 of file SocketDialog.cc.
|
private |
Checks whether socket direction can be changed.
Due to the port connections to the sockets it might be impossible. If the socket is connected to the port already containing a connection to socket of this direction, changing the direction is not allowed.
Definition at line 315 of file SocketDialog.cc.
References TTAMachine::Socket::INPUT, TTAMachine::Socket::OUTPUT, ProDeConstants::SOCKET_DIRECTION_INPUT, ProDeConstants::SOCKET_DIRECTION_OUTPUT, MachineTestReporter::socketDirectionSettingError(), and WxConversion::toWxString().
|
private |
|
private |
Enables and disables OK button based on input in the socket name.
Definition at line 293 of file SocketDialog.cc.
References assert.
|
private |
Validates input in the controls, and updates the Socket.
Definition at line 236 of file SocketDialog.cc.
References ProDeTextGenerator::COMP_A_SOCKET, ProDeTextGenerator::COMP_MACHINE, ProDeTextGenerator::COMP_SOCKET, TTAMachine::Machine::Navigator< ComponentType >::count(), ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, TTAMachine::Component::name(), Texts::TextGenerator::text(), WxConversion::toString(), and WxConversion::toWxString().
|
private |
Returns pointer to a segment with given index on a list.
listCtrl | List containing the segment. |
index | List index of the segment. |
Definition at line 449 of file SocketDialog.cc.
References TTAMachine::Machine::Navigator< ComponentType >::item(), and WxConversion::toString().
|
private |
Sets texts for widgets.
Definition at line 139 of file SocketDialog.cc.
References GUITextGenerator::instance(), ProDeTextGenerator::instance(), WidgetTools::setLabel(), WidgetTools::setWidgetLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), ProDeTextGenerator::TXT_BUTTON_ATTACH, GUITextGenerator::TXT_BUTTON_CANCEL, ProDeTextGenerator::TXT_BUTTON_DETACH, GUITextGenerator::TXT_BUTTON_HELP, GUITextGenerator::TXT_BUTTON_OK, ProDeTextGenerator::TXT_COLUMN_BUS, ProDeTextGenerator::TXT_COLUMN_SEGMENT, ProDeTextGenerator::TXT_LABEL_DIRECTION, ProDeTextGenerator::TXT_LABEL_NAME, ProDeTextGenerator::TXT_RADIO_DIRECTION_INPUT, ProDeTextGenerator::TXT_RADIO_DIRECTION_OUTPUT, ProDeTextGenerator::TXT_SOCKET_ATTACHED_BOX, ProDeTextGenerator::TXT_SOCKET_DETACHED_BOX, and ProDeTextGenerator::TXT_SOCKET_DIALOG_TITLE.
|
privatevirtual |
Transfers data from the socket object to the dialog widgets.
Definition at line 208 of file SocketDialog.cc.
|
private |
Updates connected list elements.
Definition at line 474 of file SocketDialog.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Segment::name(), TTAMachine::Component::name(), TTAMachine::Segment::parentBus(), TTAMachine::Bus::segment(), TTAMachine::Bus::segmentCount(), and WxConversion::toWxString().
|
private |
Updates the direction choicer.
Definition at line 220 of file SocketDialog.cc.
References TTAMachine::Socket::INPUT, TTAMachine::Socket::OUTPUT, ProDeConstants::SOCKET_DIRECTION_INPUT, and ProDeConstants::SOCKET_DIRECTION_OUTPUT.
|
private |
Static boxsizer containing the list of attached buses.
Definition at line 84 of file SocketDialog.hh.
|
private |
List control for connected (bus, segment) pairs.
Definition at line 80 of file SocketDialog.hh.
|
private |
Static boxsizer containing the list of detached buses.
Definition at line 86 of file SocketDialog.hh.
|
private |
Radio box for direction.
Definition at line 78 of file SocketDialog.hh.
|
private |
Name of the socket.
Definition at line 74 of file SocketDialog.hh.
|
private |
List control for all (bus, segment) pairs.
Definition at line 82 of file SocketDialog.hh.
|
private |
Socket to modify.
Definition at line 72 of file SocketDialog.hh.
|
private |
MachineTester which does sanity checks for the target machine.
Definition at line 76 of file SocketDialog.hh.