From 72575e97cabe50ea9f2d593bba1b0dcd69d35514 Mon Sep 17 00:00:00 2001 From: Daniel Felipe Gonzalez Date: Wed, 6 Feb 2013 18:37:26 +0100 Subject: [PATCH] Feature #1711 CreaDevManager application implementation - Fixed new package validators and adaptors - Fixed new black box validators and adaptors. VTK ImageAlgorithm and VTK PolyDataAlgorithm box creation doesn't work in windows bbCreateBlackBox command. --- lib/creaDevManagerLib/modelCDMPackageSrc.cpp | 1 + lib/creaDevManagerLib/modelCDMProject.cpp | 10 ++-- .../wxCDMNewBlackBoxDialog.cpp | 50 ++++++++++++++++--- 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/lib/creaDevManagerLib/modelCDMPackageSrc.cpp b/lib/creaDevManagerLib/modelCDMPackageSrc.cpp index 5c10bba..529bfe2 100644 --- a/lib/creaDevManagerLib/modelCDMPackageSrc.cpp +++ b/lib/creaDevManagerLib/modelCDMPackageSrc.cpp @@ -225,6 +225,7 @@ modelCDMBlackBox* modelCDMPackageSrc::CreateBlackBox( command += " \"" + bbCategories + "\""; //excecute command + //wxMessageBox(crea::std2wx("Command: ->" + command + "<-"),_T("Creating Black Box"),wxOK | wxICON_INFORMATION); if(system(command.c_str())) { result = new std::string("Error executing command '" + command + "'"); diff --git a/lib/creaDevManagerLib/modelCDMProject.cpp b/lib/creaDevManagerLib/modelCDMProject.cpp index 520fc0e..a021a10 100644 --- a/lib/creaDevManagerLib/modelCDMProject.cpp +++ b/lib/creaDevManagerLib/modelCDMProject.cpp @@ -345,7 +345,7 @@ modelCDMIProjectTreeNode* modelCDMProject::CreatePackage( //fixing input parameters std::vector words; - CDMUtilities::splitter::split(words,name," ",CDMUtilities::splitter::no_empties); + CDMUtilities::splitter::split(words,name," '/\"\\,.",CDMUtilities::splitter::no_empties); std::string nameFixed = ""; for (int i = 0; i < (int)(words.size()); i++) { @@ -353,7 +353,7 @@ modelCDMIProjectTreeNode* modelCDMProject::CreatePackage( } words.clear(); - CDMUtilities::splitter::split(words,authors," ",CDMUtilities::splitter::no_empties); + CDMUtilities::splitter::split(words,authors," '/\"\\,.",CDMUtilities::splitter::no_empties); std::string authorFixed; for (int i = 0; i < (int)(words.size()); i++) { @@ -362,13 +362,13 @@ modelCDMIProjectTreeNode* modelCDMProject::CreatePackage( words.clear(); std::string descriptionFixed; - CDMUtilities::splitter::split(words,authorsEmail," ",CDMUtilities::splitter::no_empties); + CDMUtilities::splitter::split(words,authorsEmail," '/\"\\,",CDMUtilities::splitter::no_empties); for (int i = 0; i < (int)(words.size()); i++) { - descriptionFixed += words[i]; + descriptionFixed += words[i] + "/"; } words.clear(); - CDMUtilities::splitter::split(words,description," ",CDMUtilities::splitter::no_empties); + CDMUtilities::splitter::split(words,description," '\"",CDMUtilities::splitter::no_empties); for (int i = 0; i < (int)(words.size()); i++) { descriptionFixed += "_" + words[i]; diff --git a/lib/creaDevManagerLib/wxCDMNewBlackBoxDialog.cpp b/lib/creaDevManagerLib/wxCDMNewBlackBoxDialog.cpp index 166ba83..7e0c69f 100644 --- a/lib/creaDevManagerLib/wxCDMNewBlackBoxDialog.cpp +++ b/lib/creaDevManagerLib/wxCDMNewBlackBoxDialog.cpp @@ -101,12 +101,50 @@ const wxString wxCDMNewBlackBoxDialog::GetBlackBoxCategories() const const wxString wxCDMNewBlackBoxDialog::GetBlackBoxType() const { - return this->blackBoxType->GetString(this->blackBoxType->GetCurrentSelection()); + wxString res; + switch(this->blackBoxType->GetCurrentSelection()) + { + case 0: + res = wxT("std"); + break; + case 1: + res = wxT("widget"); + break; + case 2: +#ifdef _WIN32 + res = wxT("VTK_ImageAlgorithm"); +#else + res = wxT("VTK-ImageAlgorithm"); +#endif + break; + case 3: +#ifdef _WIN32 + res = wxT("VTK_PolyDataAlgorithm"); +#else + res = wxT("VTK-PolyAlgorithm"); +#endif + break; + default: + res = wxT("std"); + } + return res; } const wxString wxCDMNewBlackBoxDialog::GetBlackBoxFormat() const { - return this->blackBoxFormat->GetString(this->blackBoxFormat->GetCurrentSelection()); + wxString res; + switch(this->blackBoxFormat->GetCurrentSelection()) + { + case 0: + res = wxT("C++"); + break; + case 1: + res = wxT("XML"); + break; + default: + res = wxT("C++"); + } + return res; } void wxCDMNewBlackBoxDialog::CreateControls() @@ -137,10 +175,10 @@ void wxCDMNewBlackBoxDialog::CreateControls() this->blackBoxCategories = new wxTextCtrl(this, -1); wxString BBTypes[] = { - wxT("std"), - wxT("VTK-ImageAlgorithm"), - wxT("VTK-PolyAlgorithm"), - wxT("widget") + wxT("Basic - AtomicBlackBox"), + wxT("Widget - WxBlackBox"), + wxT("VTK ImageAlgorithm - Basic and vtkImageAlgorithm (standard vtk I/O)"), + wxT("VTK PolyDataAlgorithm - Basic and vtkPolyDataAlgorithm (standard vtk I/O)") }; this->blackBoxType = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 4, BBTypes); -- 2.47.1