OpenASIP  2.0
CostFunctionPluginDialog.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 CostFunctionPluginDialog.hh
26  *
27  * Declaration of CostFunctionPluginDialog class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2006 (vjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_COST_FUNCTION_PLUGIN_DIALOG_HH
34 #define TTA_COST_FUNCTION_PLUGIN_DIALOG_HH
35 
36 #include <wx/wx.h>
37 #include <wx/listctrl.h>
38 
39 namespace HDB {
40  class HDBManager;
41 }
42 
43 /**
44  * Dialog for modifying CostFunctionPlugins.
45  */
46 class CostFunctionPluginDialog : public wxDialog {
47 public:
49  wxWindow* parent, wxWindowID id, HDB::HDBManager& hdb, int pluginID);
50 
51  virtual ~CostFunctionPluginDialog();
52 private:
53  virtual bool TransferDataToWindow();
54  void onBrowse(wxCommandEvent& event);
55  void onAdd(wxCommandEvent& event);
56  void onModify(wxCommandEvent& event);
57  void onDelete(wxCommandEvent& event);
58  void onOK(wxCommandEvent& event);
59 
60  void onDataSelection(wxListEvent& event);
61  int selectedData();
62 
63  wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
64 
65  /// Pointer to the data list widget.
66  wxListCtrl* list_;
67 
68  /// HDB containing the plugin.
70  /// Plugin id in the HDB.
71  int id_;
72  /// Plugin name.
73  wxString name_;
74  /// Plugin file path.
75  wxString path_;
76  /// Plugin description string.
77  wxString description_;
78 
79  /// Pointer to the type choice widget.
80  wxChoice* typeChoice_;
81 
82  /// FU Cost estimator string for the type choicer widget.
83  static const wxString TYPE_COST_FU;
84  /// RF Cost estimator string for the type choicer widget.
85  static const wxString TYPE_COST_RF;
86  /// Decompressor cost estimator string for the type choicer widget.
87  static const wxString TYPE_COST_DECOMP;
88  /// IC&decoder Cost estimator string for the type choicer widget.
89  static const wxString TYPE_COST_ICDEC;
90 
91  /// Widget ids.
92  enum {
93  ID_LIST = 10000,
104  };
105 
106  DECLARE_EVENT_TABLE()
107 };
108 
109 #endif
CostFunctionPluginDialog::onOK
void onOK(wxCommandEvent &event)
Definition: CostFunctionPluginDialog.cc:264
CostFunctionPluginDialog::path_
wxString path_
Plugin file path.
Definition: CostFunctionPluginDialog.hh:75
CostFunctionPluginDialog::CostFunctionPluginDialog
CostFunctionPluginDialog(wxWindow *parent, wxWindowID id, HDB::HDBManager &hdb, int pluginID)
Definition: CostFunctionPluginDialog.cc:79
HDB
Definition: CostDatabase.hh:49
CostFunctionPluginDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: CostFunctionPluginDialog.cc:302
CostFunctionPluginDialog::ID_DESCRIPTION
@ ID_DESCRIPTION
Definition: CostFunctionPluginDialog.hh:98
CostFunctionPluginDialog::selectedData
int selectedData()
Definition: CostFunctionPluginDialog.cc:180
CostFunctionPluginDialog::ID_LIST
@ ID_LIST
Definition: CostFunctionPluginDialog.hh:93
CostFunctionPluginDialog
Definition: CostFunctionPluginDialog.hh:46
CostFunctionPluginDialog::ID_NAME
@ ID_NAME
Definition: CostFunctionPluginDialog.hh:94
CostFunctionPluginDialog::ID_ADD
@ ID_ADD
Definition: CostFunctionPluginDialog.hh:99
CostFunctionPluginDialog::onDelete
void onDelete(wxCommandEvent &event)
Definition: CostFunctionPluginDialog.cc:251
CostFunctionPluginDialog::typeChoice_
wxChoice * typeChoice_
Pointer to the type choice widget.
Definition: CostFunctionPluginDialog.hh:80
CostFunctionPluginDialog::ID_MODIFY
@ ID_MODIFY
Definition: CostFunctionPluginDialog.hh:100
HDB::HDBManager
Definition: HDBManager.hh:82
CostFunctionPluginDialog::ID_TYPE
@ ID_TYPE
Definition: CostFunctionPluginDialog.hh:96
CostFunctionPluginDialog::onAdd
void onAdd(wxCommandEvent &event)
Definition: CostFunctionPluginDialog.cc:224
CostFunctionPluginDialog::onBrowse
void onBrowse(wxCommandEvent &event)
Definition: CostFunctionPluginDialog.cc:210
CostFunctionPluginDialog::description_
wxString description_
Plugin description string.
Definition: CostFunctionPluginDialog.hh:77
CostFunctionPluginDialog::hdb_
HDB::HDBManager & hdb_
HDB containing the plugin.
Definition: CostFunctionPluginDialog.hh:69
CostFunctionPluginDialog::ID_LINE
@ ID_LINE
Definition: CostFunctionPluginDialog.hh:103
CostFunctionPluginDialog::TYPE_COST_FU
static const wxString TYPE_COST_FU
FU Cost estimator string for the type choicer widget.
Definition: CostFunctionPluginDialog.hh:83
CostFunctionPluginDialog::name_
wxString name_
Plugin name.
Definition: CostFunctionPluginDialog.hh:73
CostFunctionPluginDialog::list_
wxListCtrl * list_
Pointer to the data list widget.
Definition: CostFunctionPluginDialog.hh:66
CostFunctionPluginDialog::onDataSelection
void onDataSelection(wxListEvent &event)
Definition: CostFunctionPluginDialog.cc:196
CostFunctionPluginDialog::TYPE_COST_RF
static const wxString TYPE_COST_RF
RF Cost estimator string for the type choicer widget.
Definition: CostFunctionPluginDialog.hh:85
CostFunctionPluginDialog::id_
int id_
Plugin id in the HDB.
Definition: CostFunctionPluginDialog.hh:71
CostFunctionPluginDialog::onModify
void onModify(wxCommandEvent &event)
Definition: CostFunctionPluginDialog.cc:237
CostFunctionPluginDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: CostFunctionPluginDialog.cc:135
CostFunctionPluginDialog::TYPE_COST_ICDEC
static const wxString TYPE_COST_ICDEC
IC&decoder Cost estimator string for the type choicer widget.
Definition: CostFunctionPluginDialog.hh:89
CostFunctionPluginDialog::ID_BROWSE
@ ID_BROWSE
Definition: CostFunctionPluginDialog.hh:97
CostFunctionPluginDialog::ID_TEXT
@ ID_TEXT
Definition: CostFunctionPluginDialog.hh:102
CostFunctionPluginDialog::ID_DELETE
@ ID_DELETE
Definition: CostFunctionPluginDialog.hh:101
CostFunctionPluginDialog::TYPE_COST_DECOMP
static const wxString TYPE_COST_DECOMP
Decompressor cost estimator string for the type choicer widget.
Definition: CostFunctionPluginDialog.hh:87
CostFunctionPluginDialog::ID_PATH
@ ID_PATH
Definition: CostFunctionPluginDialog.hh:95
CostFunctionPluginDialog::~CostFunctionPluginDialog
virtual ~CostFunctionPluginDialog()
Definition: CostFunctionPluginDialog.cc:128