OpenASIP  2.0
GCUDialog.hh
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 GCUDialog.hh
26  *
27  * Declaration of GCUDialog class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2004 (vjaaskel-no.spam-cs.tut.fi)
30  */
31 
32 #ifndef TTA_GCU_DIALOG_HH
33 #define TTA_GCU_DIALOG_HH
34 
35 #include <wx/wx.h>
36 #include <wx/listctrl.h>
37 
38 namespace TTAMachine {
39  class ControlUnit;
40  class HWOperation;
41  class BaseFUPort;
42 }
43 
44 /**
45  * Dialog for adding a new Global Control Unit to the Machine and
46  * editing existing Global Control Unit attributes.
47  */
48 class GCUDialog : public wxDialog {
49  public:
50  GCUDialog(wxWindow* parent, TTAMachine::ControlUnit* gcu);
51  virtual ~GCUDialog();
52 
53  private:
54  virtual bool TransferDataToWindow();
55  wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
57  void updateSocketChoicers();
58  void updateOperationList();
59  void updatePortList();
60  void updateRAPortChoice();
63  void onName(wxCommandEvent& event);
64 
65  void onOperationSelection(wxListEvent& event);
66  void onAddOperation(wxCommandEvent& event);
67  void onEditOperation(wxCommandEvent& event);
68  void onDeleteOperation(wxCommandEvent& event);
69  void onActivateOperation(wxListEvent& event);
70  void onOperationRightClick(wxListEvent& event);
71 
72  void onAddFUPort(wxCommandEvent& event);
73  void onAddSRPort(wxCommandEvent& event);
74  void onEditPort(wxCommandEvent& event);
75  void onDeletePort(wxCommandEvent& event);
76  void onPortSelection(wxListEvent& event);
77  void onActivatePort(wxListEvent& event);
78  void onPortRightClick(wxListEvent& event);
79 
80  void onRAPortChoice(wxCommandEvent& event);
81 
82  void onHelp(wxCommandEvent& event);
83  void onOK(wxCommandEvent& event);
84  void setLabels();
85 
86  /// The Global Control Unit to be modified with the dialog.
88  /// Name of the global control unit.
89  wxString name_;
90  /// Number of delay slots of the global control unit.
92  /// Guard latency of the gcu.
94 
95  /// Address Space choice control.
97  /// Return address port choice control.
98  wxChoice* raPortChoice_;
99 
100  /// Operation list widget.
101  wxListCtrl* operationList_;
102  /// Port list widget.
103  wxListCtrl* portList_;
104 
105  /// Box sizer for the operations list controls.
106  wxStaticBoxSizer* operationsSizer_;
107  /// Box sizer for the port list controls.
108  wxStaticBoxSizer* portListSizer_;
109 
110  /// enumerated IDs for dialog controls
111  enum {
112  ID_NAME = 10000,
115  //ID_GUARD_LATENCY,
138  //ID_LABEL_GLOBAL_GUARD_LATENCY
139  };
140  DECLARE_EVENT_TABLE()
141 };
142 
143 #endif
GCUDialog::ID_EDIT_PORT
@ ID_EDIT_PORT
Definition: GCUDialog.hh:127
GCUDialog::ID_PORT_LIST
@ ID_PORT_LIST
Definition: GCUDialog.hh:118
GCUDialog::ID_LABEL_RA_CHOICE
@ ID_LABEL_RA_CHOICE
Definition: GCUDialog.hh:136
GCUDialog::ID_ADD_SR_PORT
@ ID_ADD_SR_PORT
Definition: GCUDialog.hh:126
TTAMachine::HWOperation
Definition: HWOperation.hh:52
GCUDialog::ID_TEXT_AS
@ ID_TEXT_AS
Definition: GCUDialog.hh:132
GCUDialog::ID_LABEL_OP_CHOICE
@ ID_LABEL_OP_CHOICE
Definition: GCUDialog.hh:137
TTAMachine::BaseFUPort
Definition: BaseFUPort.hh:44
GCUDialog::operationList_
wxListCtrl * operationList_
Operation list widget.
Definition: GCUDialog.hh:101
GCUDialog::guardLatency_
int guardLatency_
Guard latency of the gcu.
Definition: GCUDialog.hh:93
GCUDialog::ID_OPERATION_LIST
@ ID_OPERATION_LIST
Definition: GCUDialog.hh:117
GCUDialog::onEditPort
void onEditPort(wxCommandEvent &event)
Definition: GCUDialog.cc:727
GCUDialog::delaySlots_
int delaySlots_
Number of delay slots of the global control unit.
Definition: GCUDialog.hh:91
GCUDialog::ID_EDIT_OPERATION
@ ID_EDIT_OPERATION
Definition: GCUDialog.hh:123
GCUDialog::ID_TEXT_INPUT_SOCKET
@ ID_TEXT_INPUT_SOCKET
Definition: GCUDialog.hh:133
GCUDialog::ID_NAME
@ ID_NAME
Definition: GCUDialog.hh:112
GCUDialog::portListSizer_
wxStaticBoxSizer * portListSizer_
Box sizer for the port list controls.
Definition: GCUDialog.hh:108
GCUDialog::operationsSizer_
wxStaticBoxSizer * operationsSizer_
Box sizer for the operations list controls.
Definition: GCUDialog.hh:106
GCUDialog::setLabels
void setLabels()
Definition: GCUDialog.cc:158
GCUDialog::ID_HELP
@ ID_HELP
Definition: GCUDialog.hh:129
GCUDialog::ID_ADD_FU_PORT
@ ID_ADD_FU_PORT
Definition: GCUDialog.hh:125
GCUDialog
Definition: GCUDialog.hh:48
GCUDialog::ID_DELAY_SLOTS
@ ID_DELAY_SLOTS
Definition: GCUDialog.hh:114
GCUDialog::portList_
wxListCtrl * portList_
Port list widget.
Definition: GCUDialog.hh:103
GCUDialog::updatePortList
void updatePortList()
Definition: GCUDialog.cc:334
TTAMachine::ControlUnit
Definition: ControlUnit.hh:50
GCUDialog::ID_TEXT_NAME
@ ID_TEXT_NAME
Definition: GCUDialog.hh:130
GCUDialog::onDeletePort
void onDeletePort(wxCommandEvent &event)
Definition: GCUDialog.cc:694
GCUDialog::onAddSRPort
void onAddSRPort(wxCommandEvent &event)
Definition: GCUDialog.cc:665
GCUDialog::ID_DELETE_OPERATION
@ ID_DELETE_OPERATION
Definition: GCUDialog.hh:124
GCUDialog::gcu_
TTAMachine::ControlUnit * gcu_
The Global Control Unit to be modified with the dialog.
Definition: GCUDialog.hh:87
GCUDialog::ID_TEXT_DS
@ ID_TEXT_DS
Definition: GCUDialog.hh:131
GCUDialog::onOK
void onOK(wxCommandEvent &event)
Definition: GCUDialog.cc:378
GCUDialog::ID_ADD_OPERATION
@ ID_ADD_OPERATION
Definition: GCUDialog.hh:122
GCUDialog::onActivateOperation
void onActivateOperation(wxListEvent &event)
Definition: GCUDialog.cc:627
GCUDialog::ID_LINE
@ ID_LINE
Definition: GCUDialog.hh:121
GCUDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: GCUDialog.cc:840
GCUDialog::~GCUDialog
virtual ~GCUDialog()
Definition: GCUDialog.cc:150
GCUDialog::addressSpaceChoice_
wxChoice * addressSpaceChoice_
Address Space choice control.
Definition: GCUDialog.hh:96
GCUDialog::onAddOperation
void onAddOperation(wxCommandEvent &event)
Definition: GCUDialog.cc:483
GCUDialog::onEditOperation
void onEditOperation(wxCommandEvent &event)
Definition: GCUDialog.cc:527
GCUDialog::onActivatePort
void onActivatePort(wxListEvent &event)
Definition: GCUDialog.cc:798
GCUDialog::name_
wxString name_
Name of the global control unit.
Definition: GCUDialog.hh:89
GCUDialog::ID_TEXT_RA_WIDTH
@ ID_TEXT_RA_WIDTH
Definition: GCUDialog.hh:135
GCUDialog::updateSocketChoicers
void updateSocketChoicers()
GCUDialog::onName
void onName(wxCommandEvent &event)
Definition: GCUDialog.cc:465
GCUDialog::ID_OP_CHOICE
@ ID_OP_CHOICE
Definition: GCUDialog.hh:120
GCUDialog::onHelp
void onHelp(wxCommandEvent &event)
GCUDialog::selectedPort
TTAMachine::BaseFUPort * selectedPort()
Definition: GCUDialog.cc:711
GCUDialog::ID_TEXT_OUTPUT_SOCKET
@ ID_TEXT_OUTPUT_SOCKET
Definition: GCUDialog.hh:134
GCUDialog::ID_TEXT
@ ID_TEXT
Definition: GCUDialog.hh:113
GCUDialog::onDeleteOperation
void onDeleteOperation(wxCommandEvent &event)
Definition: GCUDialog.cc:511
GCUDialog::ID_RA_CHOICE
@ ID_RA_CHOICE
Definition: GCUDialog.hh:119
GCUDialog::GCUDialog
GCUDialog(wxWindow *parent, TTAMachine::ControlUnit *gcu)
Definition: GCUDialog.cc:106
GCUDialog::updateAddressSpaceChoice
void updateAddressSpaceChoice()
Definition: GCUDialog.cc:272
GCUDialog::onOperationRightClick
void onOperationRightClick(wxListEvent &event)
Definition: GCUDialog.cc:603
GCUDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: GCUDialog.cc:247
GCUDialog::onRAPortChoice
void onRAPortChoice(wxCommandEvent &event)
Definition: GCUDialog.cc:809
GCUDialog::ID_ADDRESS_SPACE
@ ID_ADDRESS_SPACE
Definition: GCUDialog.hh:116
GCUDialog::updateOperationList
void updateOperationList()
Definition: GCUDialog.cc:585
TTAMachine
Definition: Assembler.hh:48
GCUDialog::onPortSelection
void onPortSelection(wxListEvent &event)
Definition: GCUDialog.cc:757
GCUDialog::ID_DELETE_PORT
@ ID_DELETE_PORT
Definition: GCUDialog.hh:128
GCUDialog::selectedOperation
TTAMachine::HWOperation * selectedOperation()
Definition: GCUDialog.cc:552
GCUDialog::onPortRightClick
void onPortRightClick(wxListEvent &event)
Definition: GCUDialog.cc:774
GCUDialog::updateRAPortChoice
void updateRAPortChoice()
Definition: GCUDialog.cc:305
GCUDialog::raPortChoice_
wxChoice * raPortChoice_
Return address port choice control.
Definition: GCUDialog.hh:98
GCUDialog::onAddFUPort
void onAddFUPort(wxCommandEvent &event)
Definition: GCUDialog.cc:638
GCUDialog::onOperationSelection
void onOperationSelection(wxListEvent &event)
Definition: GCUDialog.cc:570