OpenASIP 2.2
Loading...
Searching...
No Matches
InputOperandDialog.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 InputOperandDialog.hh
26 *
27 * Declaration of InputOperandDialog class.
28 *
29 * @author Jussi Nykänen 2004 (nykanen-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_INPUT_OPERAND_DIALOG_HH
34#define TTA_INPUT_OPERAND_DIALOG_HH
35
36#include <wx/wx.h>
37#include <wx/listctrl.h>
38#include <wx/spinctrl.h>
39#include <set>
40
41class Operand;
42#include "Operand.hh"
43
44/**
45 * Dialog for adding or modifying input operands.
46 */
47class InputOperandDialog : public wxDialog {
48public:
50 wxWindow* parent,
51 Operand* operand,
52 int numberOfOperands,
53 int operandIndex);
54
55 virtual ~InputOperandDialog();
56
57private:
58 /// Copying not allowed.
60 /// Assignment not allowed.
62
63 wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
64 virtual bool TransferDataToWindow();
65 void updateList();
66 void onAddSwap(wxCommandEvent& event);
67 void onDeleteSwap(wxCommandEvent& event);
68 void onSelection(wxListEvent& event);
69 void onOk(wxCommandEvent& event);
70 void updateOperand();
71 void onType(wxCommandEvent& event);
72 void onElementWidth(wxSpinEvent& event);
73 void onElementCount(wxCommandEvent& event);
74
75 void updateTypes();
78 void setTexts();
79
80 /**
81 * Component ids.
82 */
83 enum {
88 ID_OPERATION_INPUT_TYPES, // Input Type ComboBox
95 };
96
97 /// List of can swap operands.
98 wxListCtrl* swapList_;
99 /// Choice list for can swap operands.
100 wxChoice* swapChoice_;
101 /// Pointer to can swap sizer.
102 wxStaticBoxSizer* swapSizer_;
103 /// Operand to be created or modified.
105 /// Flag indicating if operand is memory address.
107 /// Flag indicating if operand is memory data.
109 /// Choice box for operation input types
111 /// Spin ctrl for operand element width.
113 /// Choice box for operand element count.
115 /// Operands that can be swapped with this operand.
116 std::set<int> canSwap_;
117 /// Numberof input operands.
119 /// Index of the input operand currently modified.
121 /// Current operand type in choice box.
122 int type_;
123 /// Current element width in choice box.
125 /// Current element count in choice box.
127
128 /// Input types
129 std::vector<std::string> inputTypes_;
130
132
133 DECLARE_EVENT_TABLE()
134};
135
136#endif
wxSpinCtrl * elementWidthSpinCtrl_
Spin ctrl for operand element width.
wxListCtrl * swapList_
List of can swap operands.
int type_
Current operand type in choice box.
InputOperandDialog & operator=(const InputOperandDialog &)
Assignment not allowed.
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
void onOk(wxCommandEvent &event)
int index_
Index of the input operand currently modified.
wxChoice * elementCountChoice_
Choice box for operand element count.
Operand * operand_
Operand to be created or modified.
wxChoice * inputTypesComboBox_
Choice box for operation input types.
wxChoice * swapChoice_
Choice list for can swap operands.
void onSelection(wxListEvent &event)
std::vector< std::string > inputTypes_
Input types.
std::set< int > canSwap_
Operands that can be swapped with this operand.
int elemWidth_
Current element width in choice box.
int elemCount_
Current element count in choice box.
int numberOfOperands_
Numberof input operands.
Operand::OperandType operandTypes_[9]
void onDeleteSwap(wxCommandEvent &event)
void onType(wxCommandEvent &event)
bool memAddress_
Flag indicating if operand is memory address.
void onAddSwap(wxCommandEvent &event)
void onElementWidth(wxSpinEvent &event)
virtual bool TransferDataToWindow()
wxStaticBoxSizer * swapSizer_
Pointer to can swap sizer.
void onElementCount(wxCommandEvent &event)
InputOperandDialog(const InputOperandDialog &)
Copying not allowed.
bool memData_
Flag indicating if operand is memory data.
OperandType
Definition Operand.hh:58