OpenASIP 2.2
Loading...
Searching...
No Matches
SocketDialog.cc
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file SocketDialog.cc
26 *
27 * Definition of SocketDialog class.
28 *
29 * @author Veli-Pekka Jääskeläinen 2004 (vjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#include <boost/format.hpp>
34
35#include "Application.hh"
36#include "SocketDialog.hh"
37#include "ModelConstants.hh"
38#include "WxConversion.hh"
39#include "Machine.hh"
40#include "WarningDialog.hh"
41#include "Socket.hh"
42#include "Bus.hh"
43#include "Segment.hh"
44#include "Port.hh"
45#include "UserManualCmd.hh"
46#include "ProDeConstants.hh"
47#include "Machine.hh"
48#include "MachineTester.hh"
50#include "WidgetTools.hh"
51#include "ProDeTextGenerator.hh"
52#include "InformationDialog.hh"
53#include "GUITextGenerator.hh"
54#include "ObjectState.hh"
55
56using boost::format;
57using std::string;
58using namespace TTAMachine;
59
60BEGIN_EVENT_TABLE(SocketDialog, wxDialog)
61
63 EVT_TEXT(ID_NAME, SocketDialog::onName)
64
67
68 EVT_RADIOBOX(ID_DIRECTION, SocketDialog::onDirection)
69
70 EVT_LIST_ITEM_FOCUSED(ID_ATTACHED_LIST, SocketDialog::onAttachedSelection)
71 EVT_LIST_DELETE_ITEM(ID_ATTACHED_LIST, SocketDialog::onAttachedSelection)
74
75 EVT_LIST_ITEM_FOCUSED(ID_DETACHED_LIST, SocketDialog::onDetachedSelection)
76 EVT_LIST_DELETE_ITEM(ID_DETACHED_LIST, SocketDialog::onDetachedSelection)
79
80 // too long lines to keep doxygen quiet
82
83
84/**
85 * The Constructor.
86 *
87 * @param parent Parent window of the dialog.
88 * @param socket Socket to be modified with the dialog.
89 */
91 wxWindow* parent,
92 Socket* socket):
93 wxDialog(parent, -1, _T(""), wxDefaultPosition),
94 socket_(socket),
95 directionBox_(NULL),
96 connectedListCtrl_(NULL),
97 segmentListCtrl_(NULL),
98 attachedSizer_(NULL),
99 detachedSizer_(NULL) {
100
101 createContents(this, true, true);
102 tester_ = new MachineTester(*socket_->machine());
103
104 name_ = WxConversion::toWxString(socket_->name());
105
106 FindWindow(wxID_OK)->Disable();
107 FindWindow(ID_ATTACH)->Disable();
108 FindWindow(ID_DETACH)->Disable();
109
110 // Set widget pointers.
111 directionBox_ = dynamic_cast<wxRadioBox*>(FindWindow(ID_DIRECTION));
112 connectedListCtrl_ =
113 dynamic_cast<wxListCtrl*>(FindWindow(ID_ATTACHED_LIST));
114 segmentListCtrl_ =
115 dynamic_cast<wxListCtrl*>(FindWindow(ID_DETACHED_LIST));
116
117 // Set widget validators.
118 FindWindow(ID_NAME)->SetValidator(wxTextValidator(wxFILTER_ASCII, &name_));
119
120 // sets labels for widgets
121 setTexts();
122
123 TransferDataToWindow();
124}
125
126
127/**
128 * The Destructor.
129 */
133
134
135/**
136 * Sets texts for widgets.
137 */
138void
142
143 // Dialog title
144 format fmt = prodeTexts->text(ProDeTextGenerator::TXT_SOCKET_DIALOG_TITLE);
145 SetTitle(WxConversion::toWxString(fmt.str()));
146
147 // buttons
148 WidgetTools::setLabel(generator, FindWindow(wxID_OK),
150
151 WidgetTools::setLabel(generator, FindWindow(wxID_CANCEL),
153
156
159
162
163 // widget labels
166
169
170 // box sizer label
173
176
177 // Create list columns.
178 wxListCtrl* attachedList =
179 dynamic_cast<wxListCtrl*>(FindWindow(ID_ATTACHED_LIST));
180 fmt = prodeTexts->text(ProDeTextGenerator::TXT_COLUMN_BUS);
181 attachedList->InsertColumn(0, WxConversion::toWxString(fmt.str()),
182 wxLIST_FORMAT_LEFT, 100);
184 attachedList->InsertColumn(1, WxConversion::toWxString(fmt.str()),
185 wxLIST_FORMAT_LEFT, 80);
186
187 wxListCtrl* detachedList =
188 dynamic_cast<wxListCtrl*>(FindWindow(ID_DETACHED_LIST));
189 fmt = prodeTexts->text(ProDeTextGenerator::TXT_COLUMN_BUS);
190 detachedList->InsertColumn(0, WxConversion::toWxString(fmt.str()),
191 wxLIST_FORMAT_LEFT, 100);
193 detachedList->InsertColumn(1, WxConversion::toWxString(fmt.str()),
194 wxLIST_FORMAT_LEFT, 80);
195
196 // Radio button labels
198 directionBox_->SetString(0, WxConversion::toWxString(fmt.str()));
200 directionBox_->SetString(1, WxConversion::toWxString(fmt.str()));
201}
202
203
204/**
205 * Transfers data from the socket object to the dialog widgets.
206 */
207bool
209 // Socket direction.
212 return wxDialog::TransferDataToWindow();
213}
214
215
216/**
217 * Updates the direction choicer.
218 */
219void
221 if (socket_->direction() == Socket::INPUT) {
222 directionBox_->SetStringSelection(
224 } else if (socket_->direction() == Socket::OUTPUT) {
225 directionBox_->SetStringSelection(
227 }
228
229}
230
231
232/**
233 * Validates input in the controls, and updates the Socket.
234 */
235void
236SocketDialog::onOK(wxCommandEvent&) {
237
238 if (!Validate()) {
239 return;
240 }
241 if (!TransferDataFromWindow()) {
242 return;
243 }
244
245 string trimmedName =
246 WxConversion::toString(name_.Trim(false).Trim(true));
247
248 // Check the name validity.
249 if (!MachineTester::isValidComponentName(trimmedName)) {
251 format message =
253 InformationDialog warning(
254 this, WxConversion::toWxString(message.str()));
255 warning.ShowModal();
256 return;
257 }
258
259 if (trimmedName != socket_->name()) {
260 Machine::SocketNavigator navigator =
262 for (int i = 0; i < navigator.count(); i++) {
263 Socket* socket = navigator.item(i);
264 if (trimmedName == socket->name()) {
265 ProDeTextGenerator* prodeTexts =
267 format message =
269 format a_soc =
271 format machine =
273 format soc =
275 message %
276 trimmedName % a_soc.str() % machine.str() % soc.str();
277 WarningDialog warning(
278 this, WxConversion::toWxString(message.str()));
279 warning.ShowModal();
280 return;
281 }
282 }
283 }
284 socket_->setName(trimmedName);
285 EndModal(wxID_OK);
286}
287
288
289/**
290 * Enables and disables OK button based on input in the socket name.
291 */
292void
293SocketDialog::onName(wxCommandEvent&) {
294 if (!TransferDataFromWindow()) {
295 assert(false);
296 }
297 wxString trimmedName = name_.Trim(false).Trim(true);
298 if (trimmedName == _T("")) {
299 FindWindow(wxID_OK)->Disable();
300 } else {
301 FindWindow(wxID_OK)->Enable();
302 }
303}
304
305
306/**
307 * Checks whether socket direction can be changed.
308 *
309 * Due to the port connections to the sockets it might be
310 * impossible. If the socket is connected to the port already
311 * containing a connection to socket of this direction, changing the
312 * direction is not allowed.
313 */
314void
316
317 wxString direction = directionBox_->GetStringSelection();
318
319 if (direction.IsSameAs(ProDeConstants::SOCKET_DIRECTION_INPUT) &&
321
322 // It wasn't legal to change the direction to input,
323 // display an error message.
324 string message =
327
328 WarningDialog dialog(this, WxConversion::toWxString(message));
329 dialog.ShowModal();
330 directionBox_->SetStringSelection(
332
333 } else if(direction.IsSameAs(ProDeConstants::SOCKET_DIRECTION_OUTPUT) &&
335
336 // It wasn't legal to change the direction to output,
337 // display an error message.
338 string message =
341
342 WarningDialog dialog(this, WxConversion::toWxString(message));
343
344 dialog.ShowModal();
345 directionBox_->SetStringSelection(
347 }
348
349 direction = directionBox_->GetStringSelection();
350
351 if (direction.IsSameAs(ProDeConstants::SOCKET_DIRECTION_INPUT)) {
353 }
354 if (direction.IsSameAs(ProDeConstants::SOCKET_DIRECTION_OUTPUT)) {
356 }
357}
358
359
360/**
361 * Attaches selected segments on the segment list to the socket.
362 */
363void
364SocketDialog::onAttach(wxCommandEvent&) {
365
366 long item = -1;
367 item = segmentListCtrl_->GetNextItem(
368 item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
369
370 // Socket state is saved, so it can be restored if the socket can't
371 // be connected to all selected segments.
372 ObjectState* savedState = socket_->saveState();
373 MachineTester tester(*socket_->machine());
374
375 // Try to connect socket to all selected segments.
376 while (item != -1) {
377
378 Segment* seg = segment(segmentListCtrl_, item);
379 assert(seg != NULL);
380
381 if (!tester.canConnect(*socket_, *seg)) {
382 // Socket couldn't be connected to all selected segments.
383 std::string error =
385 *socket_, *seg, tester);
386 wxString message = WxConversion::toWxString(error);
387 InformationDialog dialog(this, message);
388 dialog.ShowModal();
389 socket_->loadState(savedState);
390 break;
391 }
392 socket_->attachBus(*seg);
393 item = segmentListCtrl_->GetNextItem(
394 item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
395 }
396 delete savedState;
397 savedState = NULL;
398
401
402 // Select the first item in the segment list (if possible) to improve
403 // the dialog usability.
404 if (segmentListCtrl_->GetItemCount() > 0) {
405 segmentListCtrl_->SetItemState(
406 0, wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED,
407 wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED);
408 }
409
410 wxListEvent dummy;
412
413}
414
415/**
416 * Detaches selected segments on the connection list from the socket.
417 */
418void
419SocketDialog::onDetach(wxCommandEvent&) {
420
421 long item = -1;
422 item = connectedListCtrl_->GetNextItem(
423 item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
424
425 // Detach socket from all selected segments.
426 while (item != -1) {
427 Segment* seg = segment(connectedListCtrl_, item);
428 assert(seg != NULL);
429 socket_->detachBus(*seg);
430 item = connectedListCtrl_->GetNextItem(
431 item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
432 }
433
436 wxListEvent dummy;
438
439}
440
441/**
442 * Returns pointer to a segment with given index on a list.
443 *
444 * @param listCtrl List containing the segment.
445 * @param index List index of the segment.
446 * @return Pointer to the segment.
447 */
448Segment*
449SocketDialog::segment(wxListCtrl* listCtrl, int index) {
450
451 wxListItem busItem;
452 busItem.SetId(index);
453 busItem.SetColumn(0);
454 listCtrl->GetItem(busItem);
455 string busName = WxConversion::toString(busItem.GetText());
456
457 wxListItem segItem;
458 segItem.SetId(index);
459 segItem.SetColumn(1);
460 listCtrl->GetItem(segItem);
461 string segmentName = WxConversion::toString(segItem.GetText());
462
464 Segment* segment = navigator.item(busName)->segment(segmentName);
465 return segment;
466}
467
468
469
470/**
471 * Updates connected list elements.
472 */
473void
475
476 connectedListCtrl_->DeleteAllItems();
477 segmentListCtrl_->DeleteAllItems();
478
479 // update connections list
480 for (int i = 0; i < socket_->segmentCount(); i++) {
481
483
484 wxString segmentName =
486 wxString busName =
488
489 connectedListCtrl_->InsertItem(i, busName);
490 connectedListCtrl_->SetItem(i, 1, segmentName);
491 }
492
493 // update list of segments available for connection
495 int segments = 0;
496 for (int i = 0; i < navigator.count(); i++) {
497 Bus* bus = navigator.item(i);
498 for (int j = 0; j < bus->segmentCount(); j++) {
499 Segment* segment = bus->segment(j);
501 wxString segmentName =
503 wxString busName =
505
506 segmentListCtrl_->InsertItem(segments, busName);
507 segmentListCtrl_->SetItem(segments, 1, segmentName);
508 segments++;
509 }
510 }
511 }
512
513 // Disable the direction control if the socket is not
514 // connected to a bus.
515 if (socket_->segmentCount() > 0) {
516 FindWindow(ID_DIRECTION)->Enable();
517 } else {
518 FindWindow(ID_DIRECTION)->Disable();
519 }
520}
521
522
523/**
524 * Disables and enables Detach button under the connected list.
525 *
526 * If a (bus, segment) pair is selected, button is enabled. If no
527 * (bus, segment) pair is selected the button will be disabled.
528 */
529void
531 if (connectedListCtrl_->GetSelectedItemCount() < 1) {
532 FindWindow(ID_DETACH)->Disable();
533 return;
534 }
535 FindWindow(ID_DETACH)->Enable();
536}
537
538
539/**
540 * Disables and enables Attach button under the connected list.
541 *
542 * If a (bus, segment) pair is selected, button is enabled. If no
543 * (bus, segment) pair is selected the button will be disabled.
544 */
545void
547 if (segmentListCtrl_->GetSelectedItemCount() < 1) {
548 FindWindow(ID_ATTACH)->Disable();
549 return;
550 }
551 FindWindow(ID_ATTACH)->Enable();
552}
553
554
555/**
556 * Creates the dialog window contents.
557 *
558 * This method was initially generated with wxDesigner, code will be
559 * cleaned up later.
560 *
561 * @return Main sizer of the created contents.
562 * @param parent The dialog window.
563 * @param call_fit If true, fits the contents inside the dialog.
564 * @param set_sizer If true, sets the main sizer as dialog contents.
565 */
566wxSizer*
568 wxWindow *parent, bool call_fit, bool set_sizer) {
569
570 wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
571
572 wxGridSizer *item1 = new wxGridSizer( 2, 0, 0 );
573
574 wxBoxSizer *item2 = new wxBoxSizer( wxHORIZONTAL );
575
576 wxStaticText *item3 = new wxStaticText( parent, ID_LABEL_NAME, wxT("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
577 item2->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );
578
579 wxTextCtrl *item4 = new wxTextCtrl( parent, ID_NAME, wxT(""), wxDefaultPosition, wxSize(120,-1), 0 );
580 item2->Add( item4, 0, wxALIGN_CENTER|wxALL, 5 );
581
582 item1->Add( item2, 0, wxGROW|wxALL, 5 );
583
584 wxString strs5[] =
585 {
586 wxT("Input"),
587 wxT("Output")
588 };
589 wxRadioBox *item5 = new wxRadioBox( parent, ID_DIRECTION, wxT("Direction:"), wxDefaultPosition, wxDefaultSize, 2, strs5, 1, wxRA_SPECIFY_COLS );
590 item1->Add( item5, 0, wxGROW|wxALL, 5 );
591
592 item0->Add( item1, 0, wxGROW|wxALL, 5 );
593
594 wxBoxSizer *item6 = new wxBoxSizer( wxHORIZONTAL );
595
596 wxStaticBox *item8 = new wxStaticBox( parent, -1, wxT("Attached buses:") );
597 wxStaticBoxSizer *item7 = new wxStaticBoxSizer( item8, wxVERTICAL );
598 attachedSizer_ = item7;
599
600 wxListCtrl *item9 = new wxListCtrl( parent, ID_ATTACHED_LIST, wxDefaultPosition, wxSize(200,120), wxLC_REPORT|wxSUNKEN_BORDER );
601 item7->Add( item9, 0, wxALIGN_CENTER|wxALL, 5 );
602
603 item6->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 );
604
605 wxBoxSizer *item10 = new wxBoxSizer( wxVERTICAL );
606
607 wxButton *item11 = new wxButton( parent, ID_ATTACH, wxT("&Attach"), wxDefaultPosition, wxDefaultSize, 0 );
608 item10->Add( item11, 0, wxALIGN_CENTER|wxALL, 5 );
609
610 wxButton *item12 = new wxButton( parent, ID_DETACH, wxT("&Detach"), wxDefaultPosition, wxDefaultSize, 0 );
611 item10->Add( item12, 0, wxALIGN_CENTER|wxALL, 5 );
612
613 item6->Add( item10, 0, wxALIGN_CENTER|wxALL, 5 );
614
615 wxStaticBox *item14 = new wxStaticBox( parent, -1, wxT("Detached buses:") );
616 wxStaticBoxSizer *item13 = new wxStaticBoxSizer( item14, wxVERTICAL );
617 detachedSizer_ = item13;
618
619 wxListCtrl *item15 = new wxListCtrl( parent, ID_DETACHED_LIST, wxDefaultPosition, wxSize(200,120), wxLC_REPORT|wxSUNKEN_BORDER );
620 item13->Add( item15, 0, wxALIGN_CENTER|wxALL, 5 );
621
622 item6->Add( item13, 0, wxALIGN_CENTER|wxALL, 5 );
623
624 item0->Add( item6, 0, wxALIGN_CENTER, 5 );
625
626 wxStaticLine *item16 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
627 item0->Add( item16, 0, wxGROW|wxALL, 5 );
628
629 wxGridSizer *item17 = new wxGridSizer( 2, 0, 0 );
630
631 wxButton *item18 = new wxButton( parent, ID_HELP, wxT("&Help"), wxDefaultPosition, wxDefaultSize, 0 );
632 item17->Add( item18, 0, wxALL, 5 );
633
634 wxBoxSizer *item19 = new wxBoxSizer( wxHORIZONTAL );
635
636 wxButton *item20 = new wxButton( parent, wxID_OK, wxT("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
637 item19->Add( item20, 0, wxALIGN_CENTER|wxALL, 5 );
638
639 wxButton *item21 = new wxButton( parent, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
640 item19->Add( item21, 0, wxALIGN_CENTER|wxALL, 5 );
641
642 item17->Add( item19, 0, wxALL, 5 );
643
644 item0->Add( item17, 0, wxGROW|wxALL, 5 );
645
646 if (set_sizer)
647 {
648 parent->SetSizer( item0 );
649 if (call_fit)
650 item0->SetSizeHints( parent );
651 }
652
653 return item0;
654}
#define assert(condition)
END_EVENT_TABLE() using namespace IDF
TTAMachine::Machine * machine
the architecture definition of the estimated processor
FUImplementationDialog::onAddExternalPort FUImplementationDialog::onDeleteExternalPort FUImplementationDialog::onArchPortSelection EVT_LIST_ITEM_DESELECTED(ID_ARCH_PORT_LIST, FUImplementationDialog::onArchPortSelection) EVT_LIST_ITEM_ACTIVATED(ID_ARCH_PORT_LIST
FUImplementationDialog::onAddExternalPort FUImplementationDialog::onDeleteExternalPort FUImplementationDialog::onArchPortSelection FUImplementationDialog::onArchPortActivation EVT_LIST_ITEM_SELECTED(ID_EXTERNAL_PORT_LIST, FUImplementationDialog::onExternalPortSelection) EVT_LIST_ITEM_ACTIVATED(ID_EXTERNAL_PORT_LIST
EVT_BUTTON(ID_EDIT_ARCH_PORT, FUImplementationDialog::onEditArchitecturePort) EVT_BUTTON(ID_ADD_EXTERNAL_PORT
SimValue dummy(32)
a dummy simvalue which is given for operands that are not bound
@ TXT_BUTTON_HELP
Label for help button.
@ TXT_BUTTON_CANCEL
Label for cancel button.
@ TXT_BUTTON_OK
Label for OK button.
static GUITextGenerator * instance()
static std::string socketDirectionSettingError(const TTAMachine::Socket &socket, TTAMachine::Socket::Direction, const MachineTester &tester)
static std::string socketSegmentConnectionError(const TTAMachine::Socket &socket, const TTAMachine::Segment &segment, const MachineTester &tester)
virtual bool canConnect(const TTAMachine::Socket &socket, const TTAMachine::Segment &segment)
static bool isValidComponentName(const std::string &name)
virtual bool canSetDirection(const TTAMachine::Socket &socket, TTAMachine::Socket::Direction direction)
static const wxString SOCKET_DIRECTION_INPUT
String for the socket direction: input.
static const wxString SOCKET_DIRECTION_OUTPUT
String for the socket direction output.
static ProDeTextGenerator * instance()
@ MSG_ERROR_SAME_NAME
Error: Same name exists.
@ MSG_ERROR_ILLEGAL_NAME
Error: Illegal component name.
@ TXT_BUTTON_DETACH
Label for detach button.
@ TXT_SOCKET_ATTACHED_BOX
Label for Attached buses box.
@ TXT_COLUMN_SEGMENT
Label for segment column.
@ TXT_LABEL_NAME
Label for component name widget.
@ TXT_SOCKET_DETACHED_BOX
Label for Detached buses box.
@ TXT_SOCKET_DIALOG_TITLE
Socket dialog title.
@ COMP_MACHINE
Text for machine description.
@ COMP_SOCKET
Name for socket (w/o article).
@ COMP_A_SOCKET
Name for socket (w/ article).
@ TXT_RADIO_DIRECTION_INPUT
Label for input radio button.
@ TXT_LABEL_DIRECTION
Label for direction widget.
@ TXT_COLUMN_BUS
Label for bus column in a list.
@ TXT_BUTTON_ATTACH
Label for attach button.
@ TXT_RADIO_DIRECTION_OUTPUT
Label for output radio button.
wxString name_
Name of the socket.
void updateDirection()
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
void onName(wxCommandEvent &)
wxStaticBoxSizer * attachedSizer_
Static boxsizer containing the list of attached buses.
TTAMachine::Segment * segment(wxListCtrl *listCtrl, int index)
void onAttachedSelection(wxListEvent &)
virtual bool TransferDataToWindow()
void onOK(wxCommandEvent &)
void onDetachedSelection(wxListEvent &)
void onDirection(wxCommandEvent &)
wxRadioBox * directionBox_
Radio box for direction.
TTAMachine::Socket * socket_
Socket to modify.
virtual ~SocketDialog()
void onDetach(wxCommandEvent &)
void onAttach(wxCommandEvent &)
wxListCtrl * connectedListCtrl_
List control for connected (bus, segment) pairs.
MachineTester * tester_
MachineTester which does sanity checks for the target machine.
void updateConnected()
wxStaticBoxSizer * detachedSizer_
Static boxsizer containing the list of detached buses.
wxListCtrl * segmentListCtrl_
List control for all (bus, segment) pairs.
virtual Segment * segment(int index) const
Definition Bus.cc:329
virtual int segmentCount() const
Definition Bus.cc:385
virtual Machine * machine() const
virtual TCEString name() const
ComponentType * item(int index) const
virtual SocketNavigator socketNavigator() const
Definition Machine.cc:368
virtual BusNavigator busNavigator() const
Definition Machine.cc:356
std::string name() const
Bus * parentBus() const
void setDirection(Direction direction)
Definition Socket.cc:130
@ OUTPUT
Data goes from port to bus.
Definition Socket.hh:60
@ INPUT
Data goes from bus to port.
Definition Socket.hh:59
void detachBus(Segment &bus)
Definition Socket.cc:213
Direction direction() const
virtual void loadState(const ObjectState *state)
Definition Socket.cc:502
void attachBus(Segment &bus)
Definition Socket.cc:166
virtual ObjectState * saveState() const
Definition Socket.cc:465
virtual void setName(const std::string &name)
Definition Socket.cc:103
Segment * segment(int index) const
Definition Socket.cc:401
int segmentCount() const
virtual boost::format text(int textId)
static void setWidgetLabel(wxWindow *widget, std::string text)
static void setLabel(Texts::TextGenerator *generator, wxWindow *widget, int textID)
static wxString toWxString(const std::string &source)
static std::string toString(const wxString &source)