OpenASIP  2.0
OTAFormatListDialog.hh
Go to the documentation of this file.
1 /*
2  Copyright (C) 2022 Tampere University.
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 /**
19  * @file OTAFormatListDialog.hh
20  *
21  * Declaration of OTAFormatListDialog class.
22  *
23  * @author Kari Hepola 2022
24  * @note rating: red
25  */
26 
27 #ifndef TTA_OTA_FORMAT_LIST_DIALOG_HH
28 #define TTA_OTA_FORMAT_LIST_DIALOG_HH
29 
30 #include <wx/wx.h>
31 #include <wx/listctrl.h>
32 
33 class wxListCtrl;
34 
35 namespace TTAMachine {
36  class Machine;
37  class OperationTriggeredFormat;
38  class Bus;
39 }
40 
41 /**
42  * Dialog for listing and editing instruction OTAFormats in a machine.
43  */
44 class OTAFormatListDialog : public wxDialog {
45 public:
47  virtual ~OTAFormatListDialog();
48 
49 private:
50  wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
51  virtual bool TransferDataToWindow();
52  void updateOperationList();
53  void onOTAFormatSelection(wxListEvent& event);
54  void onOperationSelection(wxListEvent& event);
55  void onOTAFormatName(wxCommandEvent& event);
56  void onAddOTAFormat(wxCommandEvent& event);
57  void onDeleteOTAFormat(wxCommandEvent& event);
58  void onAddOperation(wxCommandEvent& event);
59  void onEditOperation(wxCommandEvent& event);
60  void onDeleteOperation(wxCommandEvent& event);
61  void setTexts();
62  bool validFormatName() const;
64  std::string selectedOperation();
65 
66  /// Parent machine of the instruction OTAFormats.
68  /// Box sizer around the OTAFormat list.
69  wxStaticBoxSizer* OTAFormatSizer_;
70  /// Box sizer around the operation list.
71  wxStaticBoxSizer* operationSizer_;
72  /// Widget for list of OTAFormats.
73  wxListCtrl* OTAFormatList_;
74  /// Widget for list of operations in the selected OTAFormat.
75  wxListCtrl* operationList_;
76  /// Name of the new OTAFormat.
77  wxString OTAFormatName_;
78 
79  // enumerated IDs for dialog widgets
80  enum {
92  };
93 
94  DECLARE_EVENT_TABLE()
95 };
96 #endif
OTAFormatListDialog::ID_ADD_OTA_FORMAT
@ ID_ADD_OTA_FORMAT
Definition: OTAFormatListDialog.hh:85
OTAFormatListDialog::operationSizer_
wxStaticBoxSizer * operationSizer_
Box sizer around the operation list.
Definition: OTAFormatListDialog.hh:71
OTAFormatListDialog::selectedOperation
std::string selectedOperation()
Definition: OTAFormatListDialog.cc:274
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
OTAFormatListDialog::ID_NAME
@ ID_NAME
Definition: OTAFormatListDialog.hh:90
OTAFormatListDialog::ID_DELETE_OPERATION
@ ID_DELETE_OPERATION
Definition: OTAFormatListDialog.hh:89
OTAFormatListDialog::OTAFormatName_
wxString OTAFormatName_
Name of the new OTAFormat.
Definition: OTAFormatListDialog.hh:77
OTAFormatListDialog::ID_HELP
@ ID_HELP
Definition: OTAFormatListDialog.hh:84
OTAFormatListDialog::onDeleteOperation
void onDeleteOperation(wxCommandEvent &event)
Definition: OTAFormatListDialog.cc:389
OTAFormatListDialog::ID_ADD_OPERATION
@ ID_ADD_OPERATION
Definition: OTAFormatListDialog.hh:87
OTAFormatListDialog::updateOperationList
void updateOperationList()
Definition: OTAFormatListDialog.cc:183
OTAFormatListDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: OTAFormatListDialog.cc:409
OTAFormatListDialog::onOperationSelection
void onOperationSelection(wxListEvent &event)
Definition: OTAFormatListDialog.cc:226
OTAFormatListDialog
Definition: OTAFormatListDialog.hh:44
OTAFormatListDialog::~OTAFormatListDialog
virtual ~OTAFormatListDialog()
Definition: OTAFormatListDialog.cc:94
OTAFormatListDialog::ID_DELETE_OTA_FORMAT
@ ID_DELETE_OTA_FORMAT
Definition: OTAFormatListDialog.hh:86
OTAFormatListDialog::OTAFormatList_
wxListCtrl * OTAFormatList_
Widget for list of OTAFormats.
Definition: OTAFormatListDialog.hh:73
OTAFormatListDialog::ID_LABEL_NAME
@ ID_LABEL_NAME
Definition: OTAFormatListDialog.hh:91
OTAFormatListDialog::ID_OPERATION_LIST
@ ID_OPERATION_LIST
Definition: OTAFormatListDialog.hh:82
OTAFormatListDialog::ID_EDIT_OPERATION
@ ID_EDIT_OPERATION
Definition: OTAFormatListDialog.hh:88
TTAMachine::OperationTriggeredFormat
Definition: OperationTriggeredFormat.hh:44
OTAFormatListDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: OTAFormatListDialog.cc:164
OTAFormatListDialog::validFormatName
bool validFormatName() const
Definition: OTAFormatListDialog.cc:280
OTAFormatListDialog::onAddOTAFormat
void onAddOTAFormat(wxCommandEvent &event)
Definition: OTAFormatListDialog.cc:299
OTAFormatListDialog::OTAFormatSizer_
wxStaticBoxSizer * OTAFormatSizer_
Box sizer around the OTAFormat list.
Definition: OTAFormatListDialog.hh:69
OTAFormatListDialog::selectedOTAFormat
TTAMachine::OperationTriggeredFormat * selectedOTAFormat()
Definition: OTAFormatListDialog.cc:253
OTAFormatListDialog::onOTAFormatName
void onOTAFormatName(wxCommandEvent &event)
Definition: OTAFormatListDialog.cc:352
OTAFormatListDialog::onOTAFormatSelection
void onOTAFormatSelection(wxListEvent &event)
Definition: OTAFormatListDialog.cc:212
OTAFormatListDialog::machine_
TTAMachine::Machine * machine_
Parent machine of the instruction OTAFormats.
Definition: OTAFormatListDialog.hh:67
OTAFormatListDialog::ID_LINE
@ ID_LINE
Definition: OTAFormatListDialog.hh:83
OTAFormatListDialog::onEditOperation
void onEditOperation(wxCommandEvent &event)
OTAFormatListDialog::OTAFormatListDialog
OTAFormatListDialog(wxWindow *parent, TTAMachine::Machine *machine)
Definition: OTAFormatListDialog.cc:70
OTAFormatListDialog::setTexts
void setTexts()
Definition: OTAFormatListDialog.cc:102
OTAFormatListDialog::operationList_
wxListCtrl * operationList_
Widget for list of operations in the selected OTAFormat.
Definition: OTAFormatListDialog.hh:75
TTAMachine
Definition: Assembler.hh:48
OTAFormatListDialog::onDeleteOTAFormat
void onDeleteOTAFormat(wxCommandEvent &event)
Definition: OTAFormatListDialog.cc:239
OTAFormatListDialog::ID_OTA_FORMAT_LIST
@ ID_OTA_FORMAT_LIST
Definition: OTAFormatListDialog.hh:81
TTAMachine::Machine
Definition: Machine.hh:73
OTAFormatListDialog::onAddOperation
void onAddOperation(wxCommandEvent &event)
Definition: OTAFormatListDialog.cc:374