OpenASIP  2.0
OutputOperandDialog.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 OutputOperandDialog.hh
26  *
27  * Declaration of OutputOperandDialog class.
28  *
29  * @author Jussi Nykänen 2004 (nykanen-no.spam-cs.tut.fi)
30  * @author Tero Ryynänen 2008 (tero.ryynanen-no.spam-tut.fi)
31  * @note rating: red
32  */
33 
34 #ifndef TTA_OUTPUT_OPERAND_DIALOG_HH
35 #define TTA_OUTPUT_OPERAND_DIALOG_HH
36 
37 #include <wx/wx.h>
38 #include <wx/spinctrl.h>
39 #include <map>
40 
41 #include "Operand.hh"
42 
43 typedef std::map <int, Operand::OperandType> operandList;
44 typedef std::pair <int, Operand::OperandType> operandPair;
45 
46 /**
47  * Class for adding or modifying output operands.
48  */
49 class OutputOperandDialog : public wxDialog {
50 public:
51  OutputOperandDialog(wxWindow* window, Operand* operand, int index);
52  virtual ~OutputOperandDialog();
53 
54 private:
55  /// Copying not allowed.
57  /// Assignment not allowed.
59 
60  wxSizer* createContents(wxWindow* window, bool call_fit, bool set_sizer);
61  void onOk(wxCommandEvent& event);
62  void onType(wxCommandEvent& event);
63  void onElementWidth(wxSpinEvent& event);
64  void onElementCount(wxCommandEvent& event);
65 
66  void updateTypes();
67  void updateElementWidths();
68  void updateElementCounts();
69  void setTexts();
70 
71  /**
72  * Component ids.
73  */
74  enum {
75  ID_MEM_DATA, ///< Memory data choice.
76  ID_OPERATION_OUTPUT_TYPES, ///< Output Type ComboBox
81  };
82 
83  /// Operand to be modified.
85  /// Flag indicating whether operand is memory data or not.
86  bool memData_;
87  /// Index of the operand.
88  int index_;
89  /// Choice box for operation input types
91  /// Spin ctrl for operand element width.
92  wxSpinCtrl* elementWidthSpinCtrl_;
93  /// Choice box for operand element count.
95  /// Current operand type in choice box.
96  int type_;
97  /// Current element width in choice box.
99  /// Current element count in choice box.
101 
102  /// Output types
103  std::vector<std::string> outputTypes_;
105 
106  DECLARE_EVENT_TABLE()
107 };
108 
109 #endif
Operand
Definition: Operand.hh:52
OutputOperandDialog::memData_
bool memData_
Flag indicating whether operand is memory data or not.
Definition: OutputOperandDialog.hh:86
OutputOperandDialog::createContents
wxSizer * createContents(wxWindow *window, bool call_fit, bool set_sizer)
Definition: OutputOperandDialog.cc:347
OutputOperandDialog::elementWidthSpinCtrl_
wxSpinCtrl * elementWidthSpinCtrl_
Spin ctrl for operand element width.
Definition: OutputOperandDialog.hh:92
OutputOperandDialog::ID_TEXT_WIDTH
@ ID_TEXT_WIDTH
Definition: OutputOperandDialog.hh:79
OutputOperandDialog::outputTypesComboBox_
wxChoice * outputTypesComboBox_
Choice box for operation input types.
Definition: OutputOperandDialog.hh:90
OutputOperandDialog
Definition: OutputOperandDialog.hh:49
OutputOperandDialog::onElementCount
void onElementCount(wxCommandEvent &event)
Definition: OutputOperandDialog.cc:159
OutputOperandDialog::ID_OPERATION_OUTPUT_TYPES
@ ID_OPERATION_OUTPUT_TYPES
Output Type ComboBox.
Definition: OutputOperandDialog.hh:76
OutputOperandDialog::ID_ELEMENT_WIDTH
@ ID_ELEMENT_WIDTH
Definition: OutputOperandDialog.hh:77
OutputOperandDialog::outputTypes_
std::vector< std::string > outputTypes_
Output types.
Definition: OutputOperandDialog.hh:103
operandPair
std::pair< int, Operand::OperandType > operandPair
Definition: OutputOperandDialog.hh:44
OutputOperandDialog::OutputOperandDialog
OutputOperandDialog(wxWindow *window, Operand *operand, int index)
Definition: OutputOperandDialog.cc:66
OutputOperandDialog::ID_ELEMENT_COUNT
@ ID_ELEMENT_COUNT
Definition: OutputOperandDialog.hh:78
OutputOperandDialog::elemCount_
int elemCount_
Current element count in choice box.
Definition: OutputOperandDialog.hh:100
OutputOperandDialog::setTexts
void setTexts()
Definition: OutputOperandDialog.cc:252
OutputOperandDialog::onOk
void onOk(wxCommandEvent &event)
Definition: OutputOperandDialog.cc:279
OutputOperandDialog::updateElementWidths
void updateElementWidths()
Definition: OutputOperandDialog.cc:196
OutputOperandDialog::updateTypes
void updateTypes()
Definition: OutputOperandDialog.cc:179
OutputOperandDialog::operandTypes_
operandList operandTypes_
Definition: OutputOperandDialog.hh:104
OutputOperandDialog::elemWidth_
int elemWidth_
Current element width in choice box.
Definition: OutputOperandDialog.hh:98
OutputOperandDialog::ID_MEM_DATA
@ ID_MEM_DATA
Memory data choice.
Definition: OutputOperandDialog.hh:75
Operand.hh
OutputOperandDialog::onType
void onType(wxCommandEvent &event)
Definition: OutputOperandDialog.cc:134
OutputOperandDialog::type_
int type_
Current operand type in choice box.
Definition: OutputOperandDialog.hh:96
OutputOperandDialog::ID_TEXT_COUNT
@ ID_TEXT_COUNT
Definition: OutputOperandDialog.hh:80
OutputOperandDialog::elementCountChoice_
wxChoice * elementCountChoice_
Choice box for operand element count.
Definition: OutputOperandDialog.hh:94
operandList
std::map< int, Operand::OperandType > operandList
Definition: OutputOperandDialog.hh:43
OutputOperandDialog::~OutputOperandDialog
virtual ~OutputOperandDialog()
Definition: OutputOperandDialog.cc:123
OutputOperandDialog::onElementWidth
void onElementWidth(wxSpinEvent &event)
Definition: OutputOperandDialog.cc:149
OutputOperandDialog::operator=
OutputOperandDialog & operator=(const OutputOperandDialog &)
Assignment not allowed.
OutputOperandDialog::operand_
Operand * operand_
Operand to be modified.
Definition: OutputOperandDialog.hh:84
OutputOperandDialog::index_
int index_
Index of the operand.
Definition: OutputOperandDialog.hh:88
OutputOperandDialog::updateElementCounts
void updateElementCounts()
Definition: OutputOperandDialog.cc:230