OpenASIP  2.0
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"
49 #include "MachineTestReporter.hh"
50 #include "WidgetTools.hh"
51 #include "ProDeTextGenerator.hh"
52 #include "InformationDialog.hh"
53 #include "GUITextGenerator.hh"
54 #include "ObjectState.hh"
55 
56 using boost::format;
57 using std::string;
58 using namespace TTAMachine;
59 
60 BEGIN_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  */
131  delete tester_;
132 }
133 
134 
135 /**
136  * Sets texts for widgets.
137  */
138 void
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 
154  WidgetTools::setLabel(generator, FindWindow(ID_HELP),
156 
157  WidgetTools::setLabel(prodeTexts, FindWindow(ID_ATTACH),
159 
160  WidgetTools::setLabel(prodeTexts, FindWindow(ID_DETACH),
162 
163  // widget labels
164  WidgetTools::setLabel(prodeTexts, FindWindow(ID_LABEL_NAME),
166 
167  WidgetTools::setLabel(prodeTexts, FindWindow(ID_DIRECTION),
169 
170  // box sizer label
172  WidgetTools::setWidgetLabel(attachedSizer_, fmt.str());
173 
175  WidgetTools::setWidgetLabel(detachedSizer_, fmt.str());
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);
183  fmt = prodeTexts->text(ProDeTextGenerator::TXT_COLUMN_SEGMENT);
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);
192  fmt = prodeTexts->text(ProDeTextGenerator::TXT_COLUMN_SEGMENT);
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  */
207 bool
209  // Socket direction.
210  updateDirection();
211  updateConnected();
212  return wxDialog::TransferDataToWindow();
213 }
214 
215 
216 /**
217  * Updates the direction choicer.
218  */
219 void
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  */
235 void
236 SocketDialog::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 =
261  socket_->machine()->socketNavigator();
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  */
292 void
293 SocketDialog::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  */
314 void
315 SocketDialog::onDirection(wxCommandEvent&) {
316 
317  wxString direction = directionBox_->GetStringSelection();
318 
319  if (direction.IsSameAs(ProDeConstants::SOCKET_DIRECTION_INPUT) &&
320  !tester_->canSetDirection(*socket_, Socket::INPUT)) {
321 
322  // It wasn't legal to change the direction to input,
323  // display an error message.
324  string message =
326  *socket_, Socket::INPUT, *tester_);
327 
328  WarningDialog dialog(this, WxConversion::toWxString(message));
329  dialog.ShowModal();
330  directionBox_->SetStringSelection(
332 
333  } else if(direction.IsSameAs(ProDeConstants::SOCKET_DIRECTION_OUTPUT) &&
334  !tester_->canSetDirection(*socket_, Socket::OUTPUT)) {
335 
336  // It wasn't legal to change the direction to output,
337  // display an error message.
338  string message =
340  *socket_, Socket::OUTPUT, *tester_);
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)) {
352  socket_->setDirection(Socket::INPUT);
353  }
354  if (direction.IsSameAs(ProDeConstants::SOCKET_DIRECTION_OUTPUT)) {
355  socket_->setDirection(Socket::OUTPUT);
356  }
357 }
358 
359 
360 /**
361  * Attaches selected segments on the segment list to the socket.
362  */
363 void
364 SocketDialog::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 
399  updateConnected();
400  updateDirection();
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;
411  onDetachedSelection(dummy);
412 
413 }
414 
415 /**
416  * Detaches selected segments on the connection list from the socket.
417  */
418 void
419 SocketDialog::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 
434  updateConnected();
435  updateDirection();
436  wxListEvent dummy;
437  onAttachedSelection(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  */
448 Segment*
449 SocketDialog::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 
463  Machine::BusNavigator navigator = socket_->machine()->busNavigator();
464  Segment* segment = navigator.item(busName)->segment(segmentName);
465  return segment;
466 }
467 
468 
469 
470 /**
471  * Updates connected list elements.
472  */
473 void
475 
476  connectedListCtrl_->DeleteAllItems();
477  segmentListCtrl_->DeleteAllItems();
478 
479  // update connections list
480  for (int i = 0; i < socket_->segmentCount(); i++) {
481 
482  Segment* segment = socket_->segment(i);
483 
484  wxString segmentName =
485  WxConversion::toWxString(segment->name());
486  wxString busName =
487  WxConversion::toWxString(segment->parentBus()->name());
488 
489  connectedListCtrl_->InsertItem(i, busName);
490  connectedListCtrl_->SetItem(i, 1, segmentName);
491  }
492 
493  // update list of segments available for connection
494  Machine::BusNavigator navigator = socket_->machine()->busNavigator();
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);
500  if (tester_->canConnect(*socket_, *segment)) {
501  wxString segmentName =
502  WxConversion::toWxString(segment->name());
503  wxString busName =
504  WxConversion::toWxString(segment->parentBus()->name());
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  */
529 void
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  */
545 void
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  */
566 wxSizer*
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 }
ProDeTextGenerator::TXT_SOCKET_DETACHED_BOX
@ TXT_SOCKET_DETACHED_BOX
Label for Detached buses box.
Definition: ProDeTextGenerator.hh:218
MachineTester::canConnect
virtual bool canConnect(const TTAMachine::Socket &socket, const TTAMachine::Segment &segment)
Definition: MachineTester.cc:86
WarningDialog
Definition: WarningDialog.hh:42
SocketDialog::updateConnected
void updateConnected()
Definition: SocketDialog.cc:474
ProDeTextGenerator::TXT_LABEL_DIRECTION
@ TXT_LABEL_DIRECTION
Label for direction widget.
Definition: ProDeTextGenerator.hh:90
ProDeTextGenerator::COMP_A_SOCKET
@ COMP_A_SOCKET
Name for socket (w/ article).
Definition: ProDeTextGenerator.hh:280
WxConversion::toWxString
static wxString toWxString(const std::string &source)
SocketDialog::segment
TTAMachine::Segment * segment(wxListCtrl *listCtrl, int index)
Definition: SocketDialog.cc:449
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
TTAMachine::Socket::OUTPUT
@ OUTPUT
Data goes from port to bus.
Definition: Socket.hh:60
TTAMachine::Segment
Definition: Segment.hh:54
SocketDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: SocketDialog.cc:208
WidgetTools::setLabel
static void setLabel(Texts::TextGenerator *generator, wxWindow *widget, int textID)
Definition: WidgetTools.cc:92
TTAMachine::Bus
Definition: Bus.hh:53
GUITextGenerator::instance
static GUITextGenerator * instance()
Definition: GUITextGenerator.cc:67
MachineTestReporter::socketDirectionSettingError
static std::string socketDirectionSettingError(const TTAMachine::Socket &socket, TTAMachine::Socket::Direction, const MachineTester &tester)
Definition: MachineTestReporter.cc:299
GUITextGenerator
Definition: GUITextGenerator.hh:46
ObjectState
Definition: ObjectState.hh:59
GUITextGenerator::TXT_BUTTON_HELP
@ TXT_BUTTON_HELP
Label for help button.
Definition: GUITextGenerator.hh:60
SocketDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: SocketDialog.cc:567
WidgetTools.hh
FindWindow
Definition: FindWindow.hh:49
MachineTestReporter::socketSegmentConnectionError
static std::string socketSegmentConnectionError(const TTAMachine::Socket &socket, const TTAMachine::Segment &segment, const MachineTester &tester)
Definition: MachineTestReporter.cc:55
SocketDialog::onOK
void onOK(wxCommandEvent &)
Definition: SocketDialog.cc:236
ProDeTextGenerator::TXT_BUTTON_DETACH
@ TXT_BUTTON_DETACH
Label for detach button.
Definition: ProDeTextGenerator.hh:141
MachineTestReporter.hh
TTAMachine::Machine::Navigator::count
int count() const
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
TTAMachine::Bus::segment
virtual Segment * segment(int index) const
Definition: Bus.cc:329
Socket.hh
ProDeTextGenerator.hh
ProDeTextGenerator
Definition: ProDeTextGenerator.hh:49
ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME
@ MSG_ERROR_ILLEGAL_NAME
Error: Illegal component name.
Definition: ProDeTextGenerator.hh:223
SocketDialog::onAttachedSelection
void onAttachedSelection(wxListEvent &)
Definition: SocketDialog.cc:530
ProDeConstants::SOCKET_DIRECTION_OUTPUT
static const wxString SOCKET_DIRECTION_OUTPUT
String for the socket direction output.
Definition: ProDeConstants.hh:69
ProDeTextGenerator::TXT_COLUMN_SEGMENT
@ TXT_COLUMN_SEGMENT
Label for segment column.
Definition: ProDeTextGenerator.hh:127
ProDeTextGenerator::MSG_ERROR_SAME_NAME
@ MSG_ERROR_SAME_NAME
Error: Same name exists.
Definition: ProDeTextGenerator.hh:229
assert
#define assert(condition)
Definition: Application.hh:86
Port.hh
Segment.hh
GUITextGenerator::TXT_BUTTON_CANCEL
@ TXT_BUTTON_CANCEL
Label for cancel button.
Definition: GUITextGenerator.hh:55
ProDeTextGenerator::TXT_COLUMN_BUS
@ TXT_COLUMN_BUS
Label for bus column in a list.
Definition: ProDeTextGenerator.hh:126
WarningDialog.hh
ProDeConstants::SOCKET_DIRECTION_INPUT
static const wxString SOCKET_DIRECTION_INPUT
String for the socket direction: input.
Definition: ProDeConstants.hh:67
TTAMachine::Segment::parentBus
Bus * parentBus() const
SocketDialog::onDetachedSelection
void onDetachedSelection(wxListEvent &)
Definition: SocketDialog.cc:546
dummy
SimValue dummy(32)
a dummy simvalue which is given for operands that are not bound
InformationDialog.hh
SocketDialog.hh
Application.hh
SocketDialog::~SocketDialog
virtual ~SocketDialog()
Definition: SocketDialog.cc:130
ObjectState.hh
ProDeTextGenerator::COMP_SOCKET
@ COMP_SOCKET
Name for socket (w/o article).
Definition: ProDeTextGenerator.hh:281
TTAMachine::Socket
Definition: Socket.hh:53
ProDeTextGenerator::TXT_LABEL_NAME
@ TXT_LABEL_NAME
Label for component name widget.
Definition: ProDeTextGenerator.hh:56
SocketDialog::updateDirection
void updateDirection()
Definition: SocketDialog.cc:220
ProDeTextGenerator::TXT_SOCKET_DIALOG_TITLE
@ TXT_SOCKET_DIALOG_TITLE
Socket dialog title.
Definition: ProDeTextGenerator.hh:216
ModelConstants.hh
ProDeTextGenerator::TXT_RADIO_DIRECTION_INPUT
@ TXT_RADIO_DIRECTION_INPUT
Label for input radio button.
Definition: ProDeTextGenerator.hh:102
Machine.hh
MachineTester::isValidComponentName
static bool isValidComponentName(const std::string &name)
Definition: MachineTester.cc:312
Bus.hh
EVT_LIST_ITEM_SELECTED
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
SocketDialog
Definition: SocketDialog.hh:50
SocketDialog::onDirection
void onDirection(wxCommandEvent &)
Definition: SocketDialog.cc:315
ProDeConstants.hh
GUITextGenerator.hh
SocketDialog::onDetach
void onDetach(wxCommandEvent &)
Definition: SocketDialog.cc:419
ProDeTextGenerator::TXT_BUTTON_ATTACH
@ TXT_BUTTON_ATTACH
Label for attach button.
Definition: ProDeTextGenerator.hh:140
MachineTester.hh
ProDeTextGenerator::instance
static ProDeTextGenerator * instance()
Definition: ProDeTextGenerator.cc:382
EVT_LIST_ITEM_DESELECTED
FUImplementationDialog::onAddExternalPort FUImplementationDialog::onDeleteExternalPort FUImplementationDialog::onArchPortSelection EVT_LIST_ITEM_DESELECTED(ID_ARCH_PORT_LIST, FUImplementationDialog::onArchPortSelection) EVT_LIST_ITEM_ACTIVATED(ID_ARCH_PORT_LIST
EVT_BUTTON
EVT_BUTTON(ID_EDIT_ARCH_PORT, FUImplementationDialog::onEditArchitecturePort) EVT_BUTTON(ID_ADD_EXTERNAL_PORT
SocketDialog::setTexts
void setTexts()
Definition: SocketDialog.cc:139
SocketDialog::onAttach
void onAttach(wxCommandEvent &)
Definition: SocketDialog.cc:364
ProDeTextGenerator::COMP_MACHINE
@ COMP_MACHINE
Text for machine description.
Definition: ProDeTextGenerator.hh:252
WxConversion.hh
SocketDialog::onName
void onName(wxCommandEvent &)
Definition: SocketDialog.cc:293
TTAMachine::Machine::Navigator::item
ComponentType * item(int index) const
WidgetTools::setWidgetLabel
static void setWidgetLabel(wxWindow *widget, std::string text)
Definition: WidgetTools.cc:52
InformationDialog
Definition: InformationDialog.hh:42
TTAMachine::Segment::name
std::string name() const
TTAMachine
Definition: Assembler.hh:48
ProDeTextGenerator::TXT_SOCKET_ATTACHED_BOX
@ TXT_SOCKET_ATTACHED_BOX
Label for Attached buses box.
Definition: ProDeTextGenerator.hh:217
MachineTester
Definition: MachineTester.hh:46
WxConversion::toString
static std::string toString(const wxString &source)
TTAMachine::Machine::Navigator
Definition: Machine.hh:186
UserManualCmd.hh
TTAMachine::Bus::segmentCount
virtual int segmentCount() const
Definition: Bus.cc:385
END_EVENT_TABLE
END_EVENT_TABLE() using namespace IDF
TTAMachine::Socket::INPUT
@ INPUT
Data goes from bus to port.
Definition: Socket.hh:59
GUITextGenerator::TXT_BUTTON_OK
@ TXT_BUTTON_OK
Label for OK button.
Definition: GUITextGenerator.hh:59
ProDeTextGenerator::TXT_RADIO_DIRECTION_OUTPUT
@ TXT_RADIO_DIRECTION_OUTPUT
Label for output radio button.
Definition: ProDeTextGenerator.hh:103