OpenASIP  2.0
OperationDAGDialog.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 OperationDAGDialog.hh
26  *
27  * Declaration of OperationDAGDialog 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_OPERATION_DAG_DIALOG_HH
35 #define TTA_OPERATION_DAG_DIALOG_HH
36 
37 #include <wx/wx.h>
38 #include <wx/listctrl.h>
39 #include <wx/choice.h>
40 #include <vector>
41 #include <string>
42 
43 class Operation;
44 class Operand;
45 class OperationModule;
46 class ObjectState;
47 
48 /**
49  * Dialog which is used to create or modify an operation.
50  */
51 class OperationDAGDialog : public wxDialog {
52 public:
54  wxWindow* parent,
55  Operation* op);
56  virtual ~OperationDAGDialog();
57 
58  Operation* operation() const;
59 
60 private:
61  /// Copying not allowed.
63  /// Assignment not allowed.
65 
66  wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
67  virtual bool TransferDataToWindow();
68  void updateIndex();
69  bool hasDot();
70  void updateDAG();
71 
72  void onOK(wxCommandEvent& event);
73  void onCancel(wxCommandEvent& event);
74 
75  void doSaveDAG(int index);
76  void onSaveDAG(wxCommandEvent& event);
77  void onUndoDAG(wxCommandEvent& event);
78  void onDeleteDAG(wxCommandEvent& event);
79  void onNewDAG(wxCommandEvent& event);
80 
81  void onDAGChange(wxCommandEvent& event);
82  void onComboBoxChange(wxCommandEvent& event);
83 
85 
86  void setTexts();
87  void setBehaviorLabel();
88 
89  /**
90  * Component ids.
91  */
92  enum {
93  ID_EDIT_DAG = 1000,
102  };
103 
104  /// Operation to be created or to be modified.
106  /// Original operation's ObjectState tree
108 
109  // Text box for editing dag
110  wxTextCtrl* dagEdit_;
111  //
112  // Text box for editing operation description
113  wxTextCtrl* editDescription_;
114 
115  // ComboBox for selectind dag
116  wxChoice* dagIndex_;
117 
118  // Dot generated image
119  wxBitmap* dotImage_;
120 
121  // Bitmap for holding the dot image
122  wxStaticBitmap* dagStaticBitmap_;
123  wxStaticBoxSizer *dagImageStaticBoxSizer_;
124 
125  // Scrolled window for DAG
126  wxScrolledWindow *dagWindow_;
127 
129 
130  DECLARE_EVENT_TABLE()
131 };
132 
133 #endif
Operand
Definition: Operand.hh:52
OperationDAGDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: OperationDAGDialog.cc:187
OperationDAGDialog::ID_SAVE_DAG_BUTTON
@ ID_SAVE_DAG_BUTTON
Definition: OperationDAGDialog.hh:94
OperationDAGDialog::ID_EDIT_DAG
@ ID_EDIT_DAG
Definition: OperationDAGDialog.hh:93
OperationDAGDialog::setBehaviorLabel
void setBehaviorLabel()
OperationDAGDialog::updateIndex
void updateIndex()
Definition: OperationDAGDialog.cc:195
OperationDAGDialog::operator=
OperationDAGDialog & operator=(const OperationDAGDialog &)
Assignment not allowed.
OperationDAGDialog::dagStaticBitmap_
wxStaticBitmap * dagStaticBitmap_
Definition: OperationDAGDialog.hh:122
OperationDAGDialog::operation
Operation * operation() const
Definition: OperationDAGDialog.cc:149
OperationDAGDialog::hasDot
bool hasDot()
Definition: OperationDAGDialog.cc:223
ObjectState
Definition: ObjectState.hh:59
OperationDAGDialog::ID_DELETE_DAG_BUTTON
@ ID_DELETE_DAG_BUTTON
Definition: OperationDAGDialog.hh:96
OperationDAGDialog::onSaveDAG
void onSaveDAG(wxCommandEvent &event)
Definition: OperationDAGDialog.cc:421
OperationDAGDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: OperationDAGDialog.cc:516
OperationDAGDialog::onOK
void onOK(wxCommandEvent &event)
Definition: OperationDAGDialog.cc:371
OperationDAGDialog::ID_DAG_IMAGE
@ ID_DAG_IMAGE
Definition: OperationDAGDialog.hh:98
OperationDAGDialog::dagIndex_
wxChoice * dagIndex_
Definition: OperationDAGDialog.hh:116
OperationDAGDialog::onCancel
void onCancel(wxCommandEvent &event)
Definition: OperationDAGDialog.cc:383
OperationDAGDialog::dotImage_
wxBitmap * dotImage_
Definition: OperationDAGDialog.hh:119
OperationDAGDialog::ID_NEW_DAG_BUTTON
@ ID_NEW_DAG_BUTTON
Definition: OperationDAGDialog.hh:97
OperationDAGDialog::onDeleteDAG
void onDeleteDAG(wxCommandEvent &event)
Definition: OperationDAGDialog.cc:458
OperationDAGDialog::orig_
ObjectState * orig_
Original operation's ObjectState tree.
Definition: OperationDAGDialog.hh:107
OperationDAGDialog::onComboBoxChange
void onComboBoxChange(wxCommandEvent &event)
Definition: OperationDAGDialog.cc:503
OperationDAGDialog::OperationDAGDialog
OperationDAGDialog(wxWindow *parent, Operation *op)
Definition: OperationDAGDialog.cc:91
OperationDAGDialog::ID_CANCEL_BUTTON
@ ID_CANCEL_BUTTON
Definition: OperationDAGDialog.hh:101
OperationDAGDialog::onDAGChange
void onDAGChange(wxCommandEvent &event)
Definition: OperationDAGDialog.cc:494
OperationDAGDialog::doSaveDAG
void doSaveDAG(int index)
Definition: OperationDAGDialog.cc:389
Operation
Definition: Operation.hh:59
OperationDAGDialog::dagEdit_
wxTextCtrl * dagEdit_
Definition: OperationDAGDialog.hh:110
OperationDAGDialog::saveOperation
ObjectState * saveOperation()
OperationDAGDialog::dagWindow_
wxScrolledWindow * dagWindow_
Definition: OperationDAGDialog.hh:126
OperationDAGDialog::setTexts
void setTexts()
Definition: OperationDAGDialog.cc:157
OperationDAGDialog::updateDAG
void updateDAG()
Definition: OperationDAGDialog.cc:243
OperationDAGDialog::ID_INDEX_DAG
@ ID_INDEX_DAG
Definition: OperationDAGDialog.hh:99
OperationDAGDialog::onUndoDAG
void onUndoDAG(wxCommandEvent &event)
Definition: OperationDAGDialog.cc:439
OperationDAGDialog::operation_
Operation * operation_
Operation to be created or to be modified.
Definition: OperationDAGDialog.hh:105
OperationDAGDialog::ID_OK_BUTTON
@ ID_OK_BUTTON
Definition: OperationDAGDialog.hh:100
OperationModule
Definition: OperationModule.hh:46
OperationDAGDialog::editDescription_
wxTextCtrl * editDescription_
Definition: OperationDAGDialog.hh:113
OperationDAGDialog::dotInstalled_
bool dotInstalled_
Definition: OperationDAGDialog.hh:128
OperationDAGDialog::dagImageStaticBoxSizer_
wxStaticBoxSizer * dagImageStaticBoxSizer_
Definition: OperationDAGDialog.hh:123
OperationDAGDialog::ID_UNDO_DAG_BUTTON
@ ID_UNDO_DAG_BUTTON
Definition: OperationDAGDialog.hh:95
OperationDAGDialog::onNewDAG
void onNewDAG(wxCommandEvent &event)
Definition: OperationDAGDialog.cc:479
OperationDAGDialog
Definition: OperationDAGDialog.hh:51
OperationDAGDialog::~OperationDAGDialog
virtual ~OperationDAGDialog()
Definition: OperationDAGDialog.cc:134