34 #include <wx/statline.h>
35 #include <wx/valgen.h>
36 #include <wx/spinctrl.h>
37 #include <boost/format.hpp>
39 #include <wx/docview.h>
85 wxDialog(parent, -1, _T(""), wxDefaultPosition), machine_(
machine),
90 createContents(
this,
true,
true);
93 dynamic_cast<wxComboBox*
>(
FindWindow(ID_PLUGIN_CHOOSER));
96 dynamic_cast<wxTextCtrl*
>(
FindWindow(ID_DESCRIPTION_FIELD));
99 dynamic_cast<wxListCtrl*
>(
FindWindow(ID_PARAM_LIST));
108 std::vector<DesignSpaceExplorerPlugin*> plugins = explorer_.getPlugins();
109 std::set<string> addedPlugins;
111 for (std::size_t i = 0; i < plugins.size(); i++) {
117 addedPlugins.find(plugin->
name()) == addedPlugins.end()) {
119 plugins_.push_back(plugin);
120 addedPlugins.insert(plugin->
name());
128 TransferDataToWindow();
147 format fmt = prodeTexts->
text(
152 for (
size_t i = 0; i < plugins_.size(); ++i) {
154 pluginNames_->Append(pluginName);
160 wxLIST_FORMAT_CENTER, 160);
166 wxLIST_FORMAT_LEFT, 100);
169 wxLIST_FORMAT_LEFT, 160);
181 return wxWindow::TransferDataToWindow();
190 EndModal(wxID_CANCEL);
209 if (selectedPlugin_ == 0) {
214 const string dsdbFile =
"tmp.dsdb";
225 selectedPlugin_->setDSDB(*dsdb);
226 std::vector<RowID> result = selectedPlugin_->explore(confID, 0);
238 EndModal(wxID_CANCEL);
259 selectedParam_ =
event.GetIndex();
268 selectedParam_ =
event.GetIndex();
290 for (
size_t i = 0; i < plugins_.size(); i++) {
291 if (plugins_.at(i)->name() == pluginName) {
292 selectedPlugin_ = plugins_.at(i);
298 pluginDescription_->Clear();
300 selectedPlugin_->description()));
302 updateParameterList();
311 if (selectedParam_ == -1) {
318 selectedPlugin_->giveParameter(param.
name(), param.
value());
319 updateParameterList();
329 parameterList_->DeleteAllItems();
332 DesignSpaceExplorerPlugin::ParameterMap::iterator it = params.begin();
334 for (
int i =0; it != params.end(); ++it, ++i) {
337 string name = parameter.
name();
339 string value = parameter.
value();
356 DesignSpaceExplorerPlugin::ParameterMap::iterator it = params.begin();
358 for (
int i =0; it != params.end(); ++it, ++i) {
385 wxBoxSizer *item0 =
new wxBoxSizer( wxVERTICAL );
387 wxFlexGridSizer *item1 =
new wxFlexGridSizer( 2, 0, 0 );
388 item1->AddGrowableCol( 1 );
390 wxStaticText *item2 =
new wxStaticText( parent, ID_TEXT, wxT(
"Explorer Plugin:"), wxDefaultPosition, wxDefaultSize, 0 );
391 item1->Add( item2, 0, wxFIXED_MINSIZE|wxALL, 5 );
393 wxString *strs3 = (wxString*) NULL;
394 wxComboBox *item3 =
new wxComboBox( parent, ID_PLUGIN_CHOOSER, wxT(
""), wxDefaultPosition, wxDefaultSize, 0, strs3, wxCB_DROPDOWN );
395 item1->Add( item3, 0, wxGROW|wxALL, 5 );
397 wxStaticText *item4 =
new wxStaticText( parent, ID_TEXT, wxT(
"Plugin Description:"), wxDefaultPosition, wxDefaultSize, 0 );
398 item1->Add( item4, 0, wxFIXED_MINSIZE|wxALL, 5 );
400 wxTextCtrl *item5 =
new wxTextCtrl( parent, ID_DESCRIPTION_FIELD, wxT(
""), wxDefaultPosition, wxSize(240,150), wxTE_MULTILINE|wxTE_READONLY );
401 item1->Add( item5, 0, wxGROW|wxALL, 5 );
403 item0->Add( item1, 0, wxGROW|wxALL, 5 );
405 wxStaticText *item6 =
new wxStaticText( parent, ID_TEXT, wxT(
"Plugin Parameters:"), wxDefaultPosition, wxDefaultSize, 0 );
406 item0->Add( item6, 0, wxALL, 5 );
408 wxListCtrl *item7 =
new wxListCtrl( parent, ID_PARAM_LIST, wxDefaultPosition, wxSize(400,200), wxLC_REPORT|wxSUNKEN_BORDER );
409 item0->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 );
411 wxGridSizer *item8 =
new wxGridSizer( 3, 0, 0 );
413 item0->Add( item8, 0, wxGROW, 5 );
415 wxGridSizer *item9 =
new wxGridSizer( 3, 0, 0 );
417 wxButton *item10 =
new wxButton( parent, ID_EDIT, wxT(
"&Edit Parameter..."), wxDefaultPosition, wxDefaultSize, 0 );
418 item9->Add( item10, 0, wxALL, 5 );
420 wxButton *item11 =
new wxButton( parent, ID_RUN, wxT(
"&Run Plugin"), wxDefaultPosition, wxDefaultSize, 0 );
421 item9->Add( item11, 0, wxALIGN_RIGHT|wxALL, 5 );
423 wxBoxSizer *item12 =
new wxBoxSizer( wxHORIZONTAL );
425 wxButton *item13 =
new wxButton( parent, wxID_CLOSE, wxT(
"&Close"), wxDefaultPosition, wxDefaultSize, 0 );
426 item12->Add( item13, 0, wxALIGN_CENTER|wxALL, 5 );
428 item9->Add( item12, 0, wxALL, 5 );
430 item0->Add( item9, 0, wxGROW, 5 );
434 parent->SetSizer( item0 );
436 item0->SetSizeHints( parent );