OpenASIP  2.0
TemplateSlotDialog.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 TemplateSlotDialog.hh
26  *
27  * Declaration of TemplateSlotDialog.
28  *
29  * @author Veli-Pekka Jääskeläinen 2004 (vjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_TEMPLATE_SLOT_DIALOG_HH
34 #define TTA_TEMPLATE_SLOT_DIALOG_HH
35 
36 #include <wx/wx.h>
37 #include <wx/spinctrl.h>
38 
39 namespace TTAMachine {
40  class InstructionTemplate;
41  class TemplateSlot;
42  class Bus;
43  class ImmediateUnit;
44 }
45 
46 /**
47  * Dialog for editing telplate slot properties.
48  */
49 class TemplateSlotDialog : public wxDialog {
50 public:
52  wxWindow* parent,
54  TTAMachine::TemplateSlot* slot = NULL);
55 
56  virtual ~TemplateSlotDialog();
57 
58 private:
59  wxSizer* createContents(wxWindow *parent, bool call_fit, bool set_sizer);
60  virtual bool TransferDataToWindow();
61  void onOK(wxCommandEvent& event);
62  void setTexts();
63 
64  /// Instruction template slot to edit.
66  /// Parent instruction template of the slot.
68  /// Choice control for the slot.
69  wxChoice* slotChoice_;
70  /// Choice control fot the destination IU.
71  wxChoice* destinationChoice_;
72  /// Spin control for the width.
73  wxSpinCtrl* widthCtrl_;
74  /// Bit width of the slot.
75  int width_;
76  /// Destination immediate unit.
78 
79  // enumerated IDs for dialog widgets
80  enum {
81  ID_LABEL_SLOT = 10000,
89  };
90 
91  DECLARE_EVENT_TABLE()
92 };
93 #endif
TemplateSlotDialog::ID_SLOT
@ ID_SLOT
Definition: TemplateSlotDialog.hh:82
TemplateSlotDialog::it_
TTAMachine::InstructionTemplate * it_
Parent instruction template of the slot.
Definition: TemplateSlotDialog.hh:67
TemplateSlotDialog::ID_LABEL_DESTINATION
@ ID_LABEL_DESTINATION
Definition: TemplateSlotDialog.hh:85
TemplateSlotDialog::TemplateSlotDialog
TemplateSlotDialog(wxWindow *parent, TTAMachine::InstructionTemplate *it, TTAMachine::TemplateSlot *slot=NULL)
Definition: TemplateSlotDialog.cc:69
TemplateSlotDialog::ID_HELP
@ ID_HELP
Definition: TemplateSlotDialog.hh:88
TemplateSlotDialog::ID_WIDTH
@ ID_WIDTH
Definition: TemplateSlotDialog.hh:84
TemplateSlotDialog::~TemplateSlotDialog
virtual ~TemplateSlotDialog()
Definition: TemplateSlotDialog.cc:108
TemplateSlotDialog::widthCtrl_
wxSpinCtrl * widthCtrl_
Spin control for the width.
Definition: TemplateSlotDialog.hh:73
TemplateSlotDialog::destinationChoice_
wxChoice * destinationChoice_
Choice control fot the destination IU.
Definition: TemplateSlotDialog.hh:71
TemplateSlotDialog::slot_
TTAMachine::TemplateSlot * slot_
Instruction template slot to edit.
Definition: TemplateSlotDialog.hh:65
TemplateSlotDialog::ID_LABEL_SLOT
@ ID_LABEL_SLOT
Definition: TemplateSlotDialog.hh:81
TemplateSlotDialog::setTexts
void setTexts()
Definition: TemplateSlotDialog.cc:116
TTAMachine::InstructionTemplate
Definition: InstructionTemplate.hh:49
TTAMachine::TemplateSlot
Definition: TemplateSlot.hh:55
TemplateSlotDialog::slotChoice_
wxChoice * slotChoice_
Choice control for the slot.
Definition: TemplateSlotDialog.hh:69
TemplateSlotDialog
Definition: TemplateSlotDialog.hh:49
TemplateSlotDialog::ID_DESTINATION
@ ID_DESTINATION
Definition: TemplateSlotDialog.hh:86
TemplateSlotDialog::onOK
void onOK(wxCommandEvent &event)
Definition: TemplateSlotDialog.cc:220
TemplateSlotDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: TemplateSlotDialog.cc:264
TemplateSlotDialog::ID_LINE
@ ID_LINE
Definition: TemplateSlotDialog.hh:87
TemplateSlotDialog::ID_LABEL_WIDTH
@ ID_LABEL_WIDTH
Definition: TemplateSlotDialog.hh:83
TemplateSlotDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: TemplateSlotDialog.cc:154
TTAMachine
Definition: Assembler.hh:48
TemplateSlotDialog::destination_
TTAMachine::ImmediateUnit * destination_
Destination immediate unit.
Definition: TemplateSlotDialog.hh:77
TemplateSlotDialog::width_
int width_
Bit width of the slot.
Definition: TemplateSlotDialog.hh:75
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50