OpenASIP  2.0
FUDialog.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 FUDialog.hh
26  *
27  * Declaration of FUDialog class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2004 (vjaaskel-no.spam-cs.tut.fi)
30  */
31 
32 #ifndef TTA_FU_DIALOG_HH
33 #define TTA_FU_DIALOG_HH
34 
35 #include <string>
36 #include <wx/wx.h>
37 #include <wx/listctrl.h>
38 
39 namespace TTAMachine {
40  class FunctionUnit;
41  class FUPort;
42  class HWOperation;
43 }
44 
45 /**
46  * Dialog for querying FunctionUnit parameters from the user.
47  */
48 class FUDialog : public wxDialog {
49 public:
50  FUDialog(wxWindow* parent, TTAMachine::FunctionUnit* functionUnit);
51  virtual ~FUDialog();
52 
53 protected:
54  virtual bool TransferDataToWindow();
55 private:
56  wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
57 
60  void onOK(wxCommandEvent& event);
61  void onHelp(wxCommandEvent& event);
62  void onName(wxCommandEvent& event);
63  void onPortSelection(wxListEvent& event);
64  void onPortRightClick(wxListEvent& event);
65  void onAddPort(wxCommandEvent& event);
66  void onDeletePort(wxCommandEvent& event);
67  void onEditPort(wxCommandEvent& event);
68  void onActivatePort(wxListEvent& event);
69  void onOperationSelection(wxListEvent& event);
70  void onAddOperation(wxCommandEvent& event);
71  void onAddOperationFromOpset(wxCommandEvent& event);
72  void onDeleteOperation(wxCommandEvent& event);
73  void onEditOperation(wxCommandEvent& event);
74  void onSetAddressSpace(wxCommandEvent& event);
75  void onActivateOperation(wxListEvent& event);
76  void onOperationRightClick(wxListEvent& event);
78  void updatePortList();
79  void updateOperationList();
80  void setTexts();
81 
82  /// FunctionUnit to modify.
84  /// Name of the function unit.
85  wxString name_;
86 
87  /// Port list control.
88  wxListCtrl* portListCtrl_;
89  /// Operation list control.
90  wxListCtrl* operationListCtrl_;
91  /// Address Space choice control.
93 
94  /// Sizer for the port list controls.
95  wxStaticBoxSizer* portsSizer_;
96  /// Sizer for the operation list controls.
97  wxStaticBoxSizer* operationsSizer_;
98 
99  enum {
100  ID_NAME=10000,
114  };
115 
116  /// The event table for the controls of the dialog.
117  DECLARE_EVENT_TABLE()
118 };
119 #endif
FUDialog::ID_HELP
@ ID_HELP
Definition: FUDialog.hh:111
FUDialog::onPortSelection
void onPortSelection(wxListEvent &event)
Definition: FUDialog.cc:412
FUDialog::addressSpaceChoice_
wxChoice * addressSpaceChoice_
Address Space choice control.
Definition: FUDialog.hh:92
FUDialog
Definition: FUDialog.hh:48
FUDialog::onActivatePort
void onActivatePort(wxListEvent &event)
Definition: FUDialog.cc:380
FUDialog::ID_NAME
@ ID_NAME
Definition: FUDialog.hh:100
FUDialog::onEditPort
void onEditPort(wxCommandEvent &event)
Definition: FUDialog.cc:392
TTAMachine::HWOperation
Definition: HWOperation.hh:52
FUDialog::ID_ADDRESS_SPACE
@ ID_ADDRESS_SPACE
Definition: FUDialog.hh:101
FUDialog::portListCtrl_
wxListCtrl * portListCtrl_
Port list control.
Definition: FUDialog.hh:88
FUDialog::selectedOperation
TTAMachine::HWOperation * selectedOperation()
Definition: FUDialog.cc:550
FUDialog::updatePortList
void updatePortList()
Definition: FUDialog.cc:618
FUDialog::onSetAddressSpace
void onSetAddressSpace(wxCommandEvent &event)
Definition: FUDialog.cc:299
FUDialog::onPortRightClick
void onPortRightClick(wxListEvent &event)
Definition: FUDialog.cc:678
FUDialog::setTexts
void setTexts()
Definition: FUDialog.cc:149
FUDialog::onOperationRightClick
void onOperationRightClick(wxListEvent &event)
Definition: FUDialog.cc:705
FUDialog::ID_DELETE_PORT
@ ID_DELETE_PORT
Definition: FUDialog.hh:110
FUDialog::updateAddressSpaceChoice
void updateAddressSpaceChoice()
Definition: FUDialog.cc:586
FUDialog::ID_ADD_OPERATION
@ ID_ADD_OPERATION
Definition: FUDialog.hh:103
FUDialog::operationsSizer_
wxStaticBoxSizer * operationsSizer_
Sizer for the operation list controls.
Definition: FUDialog.hh:97
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
TTAMachine::FUPort
Definition: FUPort.hh:46
FUDialog::onEditOperation
void onEditOperation(wxCommandEvent &event)
Definition: FUDialog.cc:507
FUDialog::onAddOperation
void onAddOperation(wxCommandEvent &event)
Definition: FUDialog.cc:430
FUDialog::onAddOperationFromOpset
void onAddOperationFromOpset(wxCommandEvent &event)
Definition: FUDialog.cc:458
FUDialog::~FUDialog
virtual ~FUDialog()
Definition: FUDialog.cc:141
FUDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: FUDialog.cc:228
FUDialog::ID_LABEL_AS
@ ID_LABEL_AS
Definition: FUDialog.hh:113
FUDialog::ID_LABEL_NAME
@ ID_LABEL_NAME
Definition: FUDialog.hh:112
FUDialog::onOK
void onOK(wxCommandEvent &event)
Definition: FUDialog.cc:243
FUDialog::functionUnit_
TTAMachine::FunctionUnit * functionUnit_
FunctionUnit to modify.
Definition: FUDialog.hh:83
FUDialog::onName
void onName(wxCommandEvent &event)
Definition: FUDialog.cc:531
FUDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: FUDialog.cc:747
FUDialog::onOperationSelection
void onOperationSelection(wxListEvent &event)
Definition: FUDialog.cc:568
FUDialog::onActivateOperation
void onActivateOperation(wxListEvent &event)
Definition: FUDialog.cc:729
FUDialog::ID_EDIT_OPERATION
@ ID_EDIT_OPERATION
Definition: FUDialog.hh:104
FUDialog::ID_EDIT_PORT
@ ID_EDIT_PORT
Definition: FUDialog.hh:109
FUDialog::ID_PORT_LIST
@ ID_PORT_LIST
Definition: FUDialog.hh:107
FUDialog::ID_OPERATION_LIST
@ ID_OPERATION_LIST
Definition: FUDialog.hh:102
FUDialog::ID_ADD_OPERATION_FROM_OPSET
@ ID_ADD_OPERATION_FROM_OPSET
Definition: FUDialog.hh:105
FUDialog::onDeletePort
void onDeletePort(wxCommandEvent &event)
Definition: FUDialog.cc:349
FUDialog::onAddPort
void onAddPort(wxCommandEvent &event)
Definition: FUDialog.cc:321
FUDialog::portsSizer_
wxStaticBoxSizer * portsSizer_
Sizer for the port list controls.
Definition: FUDialog.hh:95
FUDialog::ID_ADD_PORT
@ ID_ADD_PORT
Definition: FUDialog.hh:108
FUDialog::operationListCtrl_
wxListCtrl * operationListCtrl_
Operation list control.
Definition: FUDialog.hh:90
FUDialog::onDeleteOperation
void onDeleteOperation(wxCommandEvent &event)
Definition: FUDialog.cc:490
TTAMachine
Definition: Assembler.hh:48
FUDialog::ID_DELETE_OPERATION
@ ID_DELETE_OPERATION
Definition: FUDialog.hh:106
FUDialog::name_
wxString name_
Name of the function unit.
Definition: FUDialog.hh:85
FUDialog::selectedPort
TTAMachine::FUPort * selectedPort()
Definition: FUDialog.cc:366
FUDialog::updateOperationList
void updateOperationList()
Definition: FUDialog.cc:650
FUDialog::onHelp
void onHelp(wxCommandEvent &event)
FUDialog::FUDialog
FUDialog(wxWindow *parent, TTAMachine::FunctionUnit *functionUnit)
Definition: FUDialog.cc:109