| OpenASIP 2.2
    | 
#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. | |
| wxString | name_ | 
| Name of the socket. | |
| MachineTester * | tester_ | 
| MachineTester which does sanity checks for the target machine. | |
| wxRadioBox * | directionBox_ | 
| Radio box for direction. | |
| wxListCtrl * | connectedListCtrl_ | 
| List control for connected (bus, segment) pairs. | |
| wxListCtrl * | segmentListCtrl_ | 
| List control for all (bus, segment) pairs. | |
| wxStaticBoxSizer * | attachedSizer_ | 
| Static boxsizer containing the list of attached buses. | |
| wxStaticBoxSizer * | detachedSizer_ | 
| Static boxsizer containing the list of detached buses. | |
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.
References attachedSizer_, detachedSizer_, ID_ATTACH, ID_ATTACHED_LIST, ID_DETACH, ID_DETACHED_LIST, ID_DIRECTION, ID_HELP, ID_LABEL_NAME, ID_LINE, and ID_NAME.
| 
 | private | 
Attaches selected segments on the segment list to the socket.
Definition at line 364 of file SocketDialog.cc.
References assert, TTAMachine::Socket::attachBus(), MachineTester::canConnect(), dummy, TTAMachine::Socket::loadState(), TTAMachine::Component::machine(), onDetachedSelection(), TTAMachine::Socket::saveState(), segment(), segmentListCtrl_, socket_, MachineTestReporter::socketSegmentConnectionError(), WxConversion::toWxString(), updateConnected(), and updateDirection().

| 
 | 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.
References connectedListCtrl_, and ID_DETACH.
Referenced by onDetach().
| 
 | private | 
Detaches selected segments on the connection list from the socket.
Definition at line 419 of file SocketDialog.cc.
References assert, connectedListCtrl_, TTAMachine::Socket::detachBus(), dummy, onAttachedSelection(), segment(), socket_, updateConnected(), and updateDirection().

| 
 | 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.
References ID_ATTACH, and segmentListCtrl_.
Referenced by onAttach().
| 
 | 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 MachineTester::canSetDirection(), directionBox_, TTAMachine::Socket::INPUT, TTAMachine::Socket::OUTPUT, TTAMachine::Socket::setDirection(), socket_, ProDeConstants::SOCKET_DIRECTION_INPUT, ProDeConstants::SOCKET_DIRECTION_OUTPUT, MachineTestReporter::socketDirectionSettingError(), tester_, 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.
| 
 | 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(), TTAMachine::Component::machine(), machine, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, TTAMachine::Component::name(), name_, TTAMachine::Socket::setName(), socket_, TTAMachine::Machine::socketNavigator(), 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::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), segment(), socket_, and WxConversion::toString().
Referenced by onAttach(), onDetach(), segment(), and updateConnected().

| 
 | private | 
Sets texts for widgets.
Definition at line 139 of file SocketDialog.cc.
References attachedSizer_, detachedSizer_, directionBox_, ID_ATTACH, ID_ATTACHED_LIST, ID_DETACH, ID_DETACHED_LIST, ID_DIRECTION, ID_HELP, ID_LABEL_NAME, 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.
References updateConnected(), and updateDirection().

| 
 | private | 
Updates connected list elements.
Definition at line 474 of file SocketDialog.cc.
References TTAMachine::Machine::busNavigator(), MachineTester::canConnect(), connectedListCtrl_, TTAMachine::Machine::Navigator< ComponentType >::count(), ID_DIRECTION, TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), TTAMachine::Component::name(), TTAMachine::Segment::name(), TTAMachine::Segment::parentBus(), TTAMachine::Bus::segment(), TTAMachine::Socket::segment(), segment(), TTAMachine::Bus::segmentCount(), TTAMachine::Socket::segmentCount(), segmentListCtrl_, socket_, tester_, and WxConversion::toWxString().
Referenced by onAttach(), onDetach(), and TransferDataToWindow().

| 
 | private | 
Updates the direction choicer.
Definition at line 220 of file SocketDialog.cc.
References TTAMachine::Socket::direction(), directionBox_, TTAMachine::Socket::INPUT, TTAMachine::Socket::OUTPUT, socket_, ProDeConstants::SOCKET_DIRECTION_INPUT, and ProDeConstants::SOCKET_DIRECTION_OUTPUT.
Referenced by onAttach(), onDetach(), and TransferDataToWindow().

| 
 | private | 
Static boxsizer containing the list of attached buses.
Definition at line 84 of file SocketDialog.hh.
Referenced by createContents(), and setTexts().
| 
 | private | 
List control for connected (bus, segment) pairs.
Definition at line 80 of file SocketDialog.hh.
Referenced by onAttachedSelection(), onDetach(), and updateConnected().
| 
 | private | 
Static boxsizer containing the list of detached buses.
Definition at line 86 of file SocketDialog.hh.
Referenced by createContents(), and setTexts().
| 
 | private | 
Radio box for direction.
Definition at line 78 of file SocketDialog.hh.
Referenced by onDirection(), setTexts(), and updateDirection().
| 
 | 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.
Referenced by onAttach(), onDetachedSelection(), and updateConnected().
| 
 | private | 
Socket to modify.
Definition at line 72 of file SocketDialog.hh.
Referenced by onAttach(), onDetach(), onDirection(), onOK(), segment(), updateConnected(), and updateDirection().
| 
 | private | 
MachineTester which does sanity checks for the target machine.
Definition at line 76 of file SocketDialog.hh.
Referenced by onDirection(), updateConnected(), and ~SocketDialog().