From f87c49c48b5b99956697759168cffb06826e4fe8 Mon Sep 17 00:00:00 2001 From: Eduardo Davila Date: Mon, 17 Mar 2008 07:04:06 +0000 Subject: [PATCH] Create Black Box bbs + .bat + Bug interface Windows --- kernel/appli/CMakeLists.txt | 3 + kernel/appli/bbCreateBlackBox/CMakeLists.txt | 70 +++++++++ .../bbCreateBlackBox/bbCreateBlackBox.bat.in | 91 ++++++++++++ .../bbCreateBlackBox/bbCreateBlackBox.sh.in | 91 ++++++++++++ .../VTK_ImageAlgorithm-template.xml | 19 +++ .../VTK_PolyDataAlgorithm-template.xml | 46 ++++++ .../xml-templates/std-template.xml | 24 +++ .../xml-templates/widget-template.xml | 37 +++++ kernel/appli/bbCreatePackage/CMakeLists.txt | 6 +- .../bbCreatePackage/bbCreatePackage.bat.in | 63 +++----- kernel/cmake/BBTKKernelConfig.cmake | 2 +- kernel/doc/CMakeLists.txt | 1 + kernel/src/bbtkInterpreter.cxx | 80 ++++------ kernel/src/bbtkWxBrowser.cxx | 6 - kernel/src/bbtkWxConsole.cxx | 139 ++++++++++++------ kernel/src/bbtkWxConsole.h | 10 +- .../toolsbbtk/bbs/appli/CreateBlackBox.bbs | 136 +++++++++++++++++ packages/toolsbbtk/bbs/appli/CreateBox.bbs | 5 - .../toolsbbtk/bbs/appli/CreatePackage.bbs | 59 +++++--- packages/wx/src/bbwxDirectorySelector.cxx | 8 +- .../appli/ExampleBasicImageApplication.bbs | 3 +- 21 files changed, 723 insertions(+), 176 deletions(-) create mode 100644 kernel/appli/bbCreateBlackBox/CMakeLists.txt create mode 100644 kernel/appli/bbCreateBlackBox/bbCreateBlackBox.bat.in create mode 100644 kernel/appli/bbCreateBlackBox/bbCreateBlackBox.sh.in create mode 100644 kernel/appli/bbCreateBlackBox/xml-templates/VTK_ImageAlgorithm-template.xml create mode 100644 kernel/appli/bbCreateBlackBox/xml-templates/VTK_PolyDataAlgorithm-template.xml create mode 100644 kernel/appli/bbCreateBlackBox/xml-templates/std-template.xml create mode 100644 kernel/appli/bbCreateBlackBox/xml-templates/widget-template.xml create mode 100644 packages/toolsbbtk/bbs/appli/CreateBlackBox.bbs delete mode 100644 packages/toolsbbtk/bbs/appli/CreateBox.bbs diff --git a/kernel/appli/CMakeLists.txt b/kernel/appli/CMakeLists.txt index c049009..9e03012 100644 --- a/kernel/appli/CMakeLists.txt +++ b/kernel/appli/CMakeLists.txt @@ -16,3 +16,6 @@ SUBDIRS(bbfy) SUBDIRS(bbCreatePackage) +# Utility that creates the file architecture for a new user package +SUBDIRS(bbCreateBlackBox) + diff --git a/kernel/appli/bbCreateBlackBox/CMakeLists.txt b/kernel/appli/bbCreateBlackBox/CMakeLists.txt new file mode 100644 index 0000000..ea745ba --- /dev/null +++ b/kernel/appli/bbCreateBlackBox/CMakeLists.txt @@ -0,0 +1,70 @@ +# Installs bbCreatePackage.bat/.sh +# used to creates the file architecture for a new user package + +# go to data which install the input data to the script +#SUBDIRS(data) + +# Sets the data install path + +# Relative path to the data used by bbCreatePackage from data root folder +SET(bbCreateBlackBox_DATA_REL_PATH_FROM_DATA kernel/bbCreateBlackBox) + +# Configure / Install the empty package structure used by bbCreatePackage +# Copy it into build tree +FILE(GLOB_RECURSE LST_FILE_VOID_CREATE_PACKAGE RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/xml-templates *.xml ) +FOREACH( iLST ${LST_FILE_VOID_CREATE_PACKAGE}) + STRING(SUBSTRING ${iLST} 0 3 subStrTmp ) + IF( ${subStrTmp} STREQUAL "../" ) + # ... + ELSE( ${subStrTmp} STREQUAL "../" ) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/xml-templates/${iLST} + ${BBTK_DATA_BUILD_PATH}/${bbCreateBlackBox_DATA_REL_PATH_FROM_DATA}/xml-templates/${iLST} + COPYONLY ) + ENDIF( ${subStrTmp} STREQUAL "../" ) +ENDFOREACH(iLST) +# Install the build tree folder +INSTALL( + DIRECTORY ${BBTK_DATA_BUILD_PATH}/${bbCreateBlackBox_DATA_REL_PATH_FROM_DATA}/xml-templates + DESTINATION ${BBTK_DATA_INSTALL_PATH}/${bbCreateBlackBox_DATA_REL_PATH_FROM_DATA} + ) + +# Configure / Install the script bbCreatePackage +SET(bbCreateBlackBox_DATA_REL_PATH_FROM_BIN ../${BBTK_DATA_REL_PATH}/${bbCreateBlackBox_DATA_REL_PATH_FROM_DATA}) +FILE(TO_NATIVE_PATH ${bbCreateBlackBox_DATA_REL_PATH_FROM_BIN} bbCreateBlackBox_DATA_REL_PATH_FROM_BIN) +IF(WIN32) + # Build tree + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/bbCreateBlackBox.bat.in + ${BBTK_BINARY_DIR}/Debug/bbCreateBlackBox.bat + @ONLY IMMEDIATE + ) + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/bbCreateBlackBox.bat.in + ${BBTK_BINARY_DIR}/Release/bbCreateBlackBox.bat + @ONLY IMMEDIATE + ) + # install tree + INSTALL( + PROGRAMS ${BBTK_BINARY_DIR}/Debug/bbCreateBlackBox.bat + DESTINATION bin + ) +ENDIF(WIN32) + + +IF(UNIX) + # Build tree + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/bbCreateBlackBox.sh.in + ${BBTK_BINARY_DIR}/bin/bbCreateBlackBox + @ONLY IMMEDIATE + ) + # Install tree + INSTALL( + PROGRAMS ${BBTK_BINARY_DIR}/bin/bbCreateBlackBox + DESTINATION bin + ) +ENDIF(UNIX) + + + + diff --git a/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.bat.in b/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.bat.in new file mode 100644 index 0000000..b30c85f --- /dev/null +++ b/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.bat.in @@ -0,0 +1,91 @@ +@echo off + +echo creates the file architecture for a new blackbox + + +if %0%5==%0 goto ERROR01 + + +rem bbCreatePackage path +set BINPATH=%~dp0 +rem Input data path +set INPUT="%BINPATH%\@bbCreateBlackBox_DATA_REL_PATH_FROM_BIN@\xml-templates" + +set OUTPUT=%1 +set PACK=%2 +set BLACKBOX=%3 +set TYPE=%4 +set FORMAT=%5 +set AUTHOR=%6 +set DESCRIPTION=%7 +set FILENAME=bb%PACK%%BLACKBOX% + +echo output= %OUTPUT% +echo bin = %BINPATH% +echo input = %INPUT% +echo pack = %PACK% +echo blackbox = %BLACKBOX% +echo type = %TYPE% +echo format = %FORMAT% +echo author = %AUTHOR% +echo description = %DESCRIPTION% +echo filename = %FILENAME% + +echo "** Creating new black box '%BLACKBOX%' xml/c++ in folder '%OUTPUT%'" + +echo Creating XML file.. +echo copy %INPUT%\%type%-template.xml %OUTPUT%\%FILENAME%.xml +copy %INPUT%\%type%-template.xml %OUTPUT%\%FILENAME%.xml_tmp +%BINPATH%\bbSed %OUTPUT%\%FILENAME%.xml_tmp __BLACKBOXNAME__ %BLACKBOX% > %OUTPUT%\%FILENAME%_1.xml +%BINPATH%\bbSed %OUTPUT%\%FILENAME%_1.xml __AUTHOR__ %AUTHOR% > %OUTPUT%\%FILENAME%_2.xml +%BINPATH%\bbSed %OUTPUT%\%FILENAME%_2.xml __DESCRIPTION__ %DESCRIPTION% > %OUTPUT%\%FILENAME%.xml_tmp +del %OUTPUT%\%FILENAME%_1.xml +del %OUTPUT%\%FILENAME%_2.xml + + +IF %FORMAT%==XML GOTO module_XML +IF %FORMAT%==C++ GOTO module_C++ + +goto ERROR03 + +:module_XML + IF EXIST %OUTPUT%\%FILENAME%.xml GOTO ERROR02 + move %OUTPUT%\%FILENAME%.xml_tmp %OUTPUT%\%FILENAME%.xml +goto END + +:module_C++ + IF EXIST %OUTPUT%\%FILENAME%.cxx GOTO ERROR02 + echo %BINPATH%\bbfy %OUTPUT%\%FILENAME%.xml_tmp %PACK% %OUTPUT% + %BINPATH%\bbfy %OUTPUT%\%FILENAME%.xml_tmp %PACK% %OUTPUT%\ + del %OUTPUT%\%FILENAME%.xml_tmp +goto END + + + +:ERROR01 +echo ----------------------------------------------------------------------------- +echo bbCreateBlackBox.bat " [author] [description] " +echo type: +echo std +echo VTK_ImageAlgorithm +echo VTK_PolyDataAlgorithm +echo widget +echo format: +echo XML +echo C++ +echo ----------------------------------------------------------------------------- +goto END + +:ERROR02 +echo "ERROR : File '%OUTPUT%\%FILENAME%' %FORMAT% already exists !" +del %OUTPUT%\%FILENAME%.xml_tmp +goto end + +:ERROR03 +echo "ERROR : format not match '%FORMAT%' " +del %OUTPUT%\%FILENAME%.xml_tmp +goto end + + +:END + diff --git a/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.sh.in b/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.sh.in new file mode 100644 index 0000000..b30c85f --- /dev/null +++ b/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.sh.in @@ -0,0 +1,91 @@ +@echo off + +echo creates the file architecture for a new blackbox + + +if %0%5==%0 goto ERROR01 + + +rem bbCreatePackage path +set BINPATH=%~dp0 +rem Input data path +set INPUT="%BINPATH%\@bbCreateBlackBox_DATA_REL_PATH_FROM_BIN@\xml-templates" + +set OUTPUT=%1 +set PACK=%2 +set BLACKBOX=%3 +set TYPE=%4 +set FORMAT=%5 +set AUTHOR=%6 +set DESCRIPTION=%7 +set FILENAME=bb%PACK%%BLACKBOX% + +echo output= %OUTPUT% +echo bin = %BINPATH% +echo input = %INPUT% +echo pack = %PACK% +echo blackbox = %BLACKBOX% +echo type = %TYPE% +echo format = %FORMAT% +echo author = %AUTHOR% +echo description = %DESCRIPTION% +echo filename = %FILENAME% + +echo "** Creating new black box '%BLACKBOX%' xml/c++ in folder '%OUTPUT%'" + +echo Creating XML file.. +echo copy %INPUT%\%type%-template.xml %OUTPUT%\%FILENAME%.xml +copy %INPUT%\%type%-template.xml %OUTPUT%\%FILENAME%.xml_tmp +%BINPATH%\bbSed %OUTPUT%\%FILENAME%.xml_tmp __BLACKBOXNAME__ %BLACKBOX% > %OUTPUT%\%FILENAME%_1.xml +%BINPATH%\bbSed %OUTPUT%\%FILENAME%_1.xml __AUTHOR__ %AUTHOR% > %OUTPUT%\%FILENAME%_2.xml +%BINPATH%\bbSed %OUTPUT%\%FILENAME%_2.xml __DESCRIPTION__ %DESCRIPTION% > %OUTPUT%\%FILENAME%.xml_tmp +del %OUTPUT%\%FILENAME%_1.xml +del %OUTPUT%\%FILENAME%_2.xml + + +IF %FORMAT%==XML GOTO module_XML +IF %FORMAT%==C++ GOTO module_C++ + +goto ERROR03 + +:module_XML + IF EXIST %OUTPUT%\%FILENAME%.xml GOTO ERROR02 + move %OUTPUT%\%FILENAME%.xml_tmp %OUTPUT%\%FILENAME%.xml +goto END + +:module_C++ + IF EXIST %OUTPUT%\%FILENAME%.cxx GOTO ERROR02 + echo %BINPATH%\bbfy %OUTPUT%\%FILENAME%.xml_tmp %PACK% %OUTPUT% + %BINPATH%\bbfy %OUTPUT%\%FILENAME%.xml_tmp %PACK% %OUTPUT%\ + del %OUTPUT%\%FILENAME%.xml_tmp +goto END + + + +:ERROR01 +echo ----------------------------------------------------------------------------- +echo bbCreateBlackBox.bat " [author] [description] " +echo type: +echo std +echo VTK_ImageAlgorithm +echo VTK_PolyDataAlgorithm +echo widget +echo format: +echo XML +echo C++ +echo ----------------------------------------------------------------------------- +goto END + +:ERROR02 +echo "ERROR : File '%OUTPUT%\%FILENAME%' %FORMAT% already exists !" +del %OUTPUT%\%FILENAME%.xml_tmp +goto end + +:ERROR03 +echo "ERROR : format not match '%FORMAT%' " +del %OUTPUT%\%FILENAME%.xml_tmp +goto end + + +:END + diff --git a/kernel/appli/bbCreateBlackBox/xml-templates/VTK_ImageAlgorithm-template.xml b/kernel/appli/bbCreateBlackBox/xml-templates/VTK_ImageAlgorithm-template.xml new file mode 100644 index 0000000..3f0f0ec --- /dev/null +++ b/kernel/appli/bbCreateBlackBox/xml-templates/VTK_ImageAlgorithm-template.xml @@ -0,0 +1,19 @@ + + + + +__AUTHOR__ +
__DESCRIPTION__
+__CategoryBlackBox__ + +vtkImageAnisotropicDiffusion3D.h +vtkImageData.h +vtkImageAnisotropicDiffusion3D + + + + + +
+ + diff --git a/kernel/appli/bbCreateBlackBox/xml-templates/VTK_PolyDataAlgorithm-template.xml b/kernel/appli/bbCreateBlackBox/xml-templates/VTK_PolyDataAlgorithm-template.xml new file mode 100644 index 0000000..b6eca38 --- /dev/null +++ b/kernel/appli/bbCreateBlackBox/xml-templates/VTK_PolyDataAlgorithm-template.xml @@ -0,0 +1,46 @@ + + + + + +__AUTHOR__ +
__DESCRIPTION__
+__CategoryBlackBox__ + +vtkAppendPolyData.h +vtkAppendPolyData + + + + + + + + + +
+  SetInput(bbGetInputIn1());
+  SetInput(bbGetInputIn2());
+  SetInput(bbGetInputIn3());
+  SetInput(bbGetInputIn4());
+  SetInput(bbGetInputIn5());
+   
+  Update();
+
+
+ + +
+  bbSetInputIn1((vtkPolyData *)0);
+  bbSetInputIn2((vtkPolyData *)0);
+  bbSetInputIn3((vtkPolyData *)0);
+  bbSetInputIn4((vtkPolyData *)0);
+  bbSetInputIn5((vtkPolyData *)0);
+  bbSetOutputOut((vtkPolyData *)0);
+
+
+ + +
+ + diff --git a/kernel/appli/bbCreateBlackBox/xml-templates/std-template.xml b/kernel/appli/bbCreateBlackBox/xml-templates/std-template.xml new file mode 100644 index 0000000..70e19b1 --- /dev/null +++ b/kernel/appli/bbCreateBlackBox/xml-templates/std-template.xml @@ -0,0 +1,24 @@ + + + + + __AUTHOR__ + __DESCRIPTION__ + __CategoryBlackBox__ + + + + + +
+    bbSetOutputOut( bbGetInputIn1() + bbGetInputIn2() );
+  
+ +
+    bbSetInputIn1(0);
+    bbSetInputIn2(0);
+    bbSetOutputOut(0);
+  
+ +
+ diff --git a/kernel/appli/bbCreateBlackBox/xml-templates/widget-template.xml b/kernel/appli/bbCreateBlackBox/xml-templates/widget-template.xml new file mode 100644 index 0000000..4e321db --- /dev/null +++ b/kernel/appli/bbCreateBlackBox/xml-templates/widget-template.xml @@ -0,0 +1,37 @@ + + + + + __AUTHOR__ + __DESCRIPTION__ + __CategoryBlackBox__ + + + + +
+   bbSetOutputWidget( new wxStaticText ( bbGetWxParent() , -1 , _T("") ) );
+   Process();
+  
+ +
+   std::string msg;
+    if (bbGetInputTitle()!="")
+      {
+	msg = bbGetInputTitle()+": " + bbGetInputIn();
+      }  
+    else 
+      {
+	msg = bbGetInputIn();
+      }
+   ((wxStaticText*)bbGetOutputWidget())->SetLabel( bbtk::std2wx( msg ) ); 
+  
+ +
 
+    bbSetInputIn("");
+    bbSetInputTitle("");
+  
+ + +
+ diff --git a/kernel/appli/bbCreatePackage/CMakeLists.txt b/kernel/appli/bbCreatePackage/CMakeLists.txt index 71b8518..31a21b6 100644 --- a/kernel/appli/bbCreatePackage/CMakeLists.txt +++ b/kernel/appli/bbCreatePackage/CMakeLists.txt @@ -36,6 +36,7 @@ INSTALL( # Configure / Install the script bbCreatePackage SET(bbCreatePackage_DATA_REL_PATH_FROM_BIN ../${BBTK_DATA_REL_PATH}/${bbCreatePackage_DATA_REL_PATH_FROM_DATA}) +FILE(TO_NATIVE_PATH ${bbCreatePackage_DATA_REL_PATH_FROM_BIN} bbCreatePackage_DATA_REL_PATH_FROM_BIN) IF(WIN32) # Build tree CONFIGURE_FILE( @@ -49,7 +50,10 @@ IF(WIN32) @ONLY IMMEDIATE ) # install tree - INSTALL_FILES(/bin .bat bbCreatePackage) + INSTALL( + PROGRAMS ${BBTK_BINARY_DIR}/Debug/bbCreatePackage.bat + DESTINATION bin + ) ENDIF(WIN32) diff --git a/kernel/appli/bbCreatePackage/bbCreatePackage.bat.in b/kernel/appli/bbCreatePackage/bbCreatePackage.bat.in index 4285918..855bffe 100755 --- a/kernel/appli/bbCreatePackage/bbCreatePackage.bat.in +++ b/kernel/appli/bbCreatePackage/bbCreatePackage.bat.in @@ -6,65 +6,48 @@ echo creates the file architecture for a new user package if %0%1==%0 goto ERROR01 -set BBTKINPUT="@bbCreatePackage_DATA_PATH@" -set BBTKOUTPUT=%1 - - -echo %0 -echo %PWD% - -# bbCreatePackage path -##EED TMP=$(which $0|rev) -##EED BINPATH=$(echo ${TMP#*/}|rev) -# Input data path -set INPUT="${BINPATH}/@bbCreatePackage_DATA_REL_PATH_FROM_BIN@/void-Package" - - +rem bbCreatePackage path +set BINPATH=%~dp0 +rem Input data path +set INPUT="%BINPATH%\@bbCreatePackage_DATA_REL_PATH_FROM_BIN@\void-Package" set OUTPUT=%1 set PACK=%2 set AUTHOR=%3 set DESCRIPTION=%4 -echo "output= " %OUTPUT% -echo "bin = " %BINPATH% -echo "input = " %INPUT% -echo "pack = " %PACK% - +echo output= %OUTPUT% +echo bin = %BINPATH% +echo input = %INPUT% +echo pack = %PACK% +echo author = %AUTHOR% +echo description = %DESCRIPTION% -echo "----- Creating black box package '%BBTKNAME%' in repository '%BBTKOUTPUT%' -----" +IF EXIST %OUTPUT%\%PACK% GOTO ERROR02 +echo "** Creating new black box package '%PACK%' in folder '%OUTPUT%'" -IF EXIST %BBTKOUTPUT% GOTO ERROR02 +mkdir %OUTPUT%\%PACK% +xcopy %INPUT% %OUTPUT%\%PACK% /S +%BINPATH%\bbSed %OUTPUT%\%PACK%\CMakeLists.txt WITHOUT_NAME "%PACK%" > %OUTPUT%\%PACK%\CMakeLists2.txt +%BINPATH%\bbSed %OUTPUT%\%PACK%\CMakeLists2.txt WITHOUT_AUTHOR %AUTHOR% > %OUTPUT%\%PACK%\CMakeLists3.txt +%BINPATH%\bbSed %OUTPUT%\%PACK%\CMakeLists3.txt WITHOUT_DESCRIPTION %DESCRIPTION% > %OUTPUT%\%PACK%\CMakeLists.txt +del %OUTPUT%\%PACK%\CMakeLists2.txt +del %OUTPUT%\%PACK%\CMakeLists3.txt +echo "Done !" +echo "Edit the file '%OUTPUT%\%PACK%\CMakeLists.txt' to customize your package" -echo "-> Packages repository '%BBTKOUTPUT%' does not exist : creating it" -mkdir %BBTKOUTPUT% - - - - echo "-> Creating file '%BBTKOUTPUT%/CMakeLists.txt' " - copy %BBTKINPUT%\PackageCMakeLists.txt %BBTKOUTPUT%\CMakeLists.txt - echo "-> Creating file directory '%BBTKOUTPUT%/cmake' " - mkdir %BBTKOUTPUT%\cmake - echo "-> Coping files in '%BBTKOUTPUT%/cmake' " - copy %BBTKINPUT%\cmake\*.cmake %BBTKOUTPUT%\cmake - copy %BBTKINPUT%\cmake\*.in %BBTKOUTPUT%\cmake - -echo "Done !" -echo "Edit the file '%BBTKOUTPUT%/CMakeLists.txt' to customize your package" goto END - - :ERROR01 -echo bbCreatePackage.bat "" +echo bbCreatePackage.bat " [author] [description] " goto END :ERROR02 -echo "ERROR : Directory '%BBTKOUTPUT%/%BBTKNAME%' already exists !" +echo "ERROR : Directory '%OUTPUT%/%PACK%' already exists !" goto end diff --git a/kernel/cmake/BBTKKernelConfig.cmake b/kernel/cmake/BBTKKernelConfig.cmake index 86476e5..25d06c1 100644 --- a/kernel/cmake/BBTKKernelConfig.cmake +++ b/kernel/cmake/BBTKKernelConfig.cmake @@ -63,7 +63,7 @@ ENDIF(WIN32) # from build tree root or install tree root # (different on win/lin) IF(WIN32) - SET(BBTK_SHARE_REL_PATH " ") + SET(BBTK_SHARE_REL_PATH "/") SET(BBTK_DOC_REL_PATH doc) SET(BBTK_BBS_REL_PATH bbs) SET(BBTK_DATA_REL_PATH data) diff --git a/kernel/doc/CMakeLists.txt b/kernel/doc/CMakeLists.txt index c29805c..630b9a2 100755 --- a/kernel/doc/CMakeLists.txt +++ b/kernel/doc/CMakeLists.txt @@ -113,6 +113,7 @@ IF(BUILD_bbtk_DOC) # Recurse it bbtkWebSite dir SUBDIRS(bbtkWebSite) + INSTALL( DIRECTORY ${BBTK_BINARY_DIR}/${BBTK_DOC_REL_PATH} DESTINATION ${BBTK_SHARE_REL_PATH} diff --git a/kernel/src/bbtkInterpreter.cxx b/kernel/src/bbtkInterpreter.cxx index 22bd9fb..468d41f 100644 --- a/kernel/src/bbtkInterpreter.cxx +++ b/kernel/src/bbtkInterpreter.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkInterpreter.cxx,v $ $ Language: C++ - Date: $Date: 2008/03/14 14:58:53 $ - Version: $Revision: 1.44 $ + Date: $Date: 2008/03/17 07:04:08 $ + Version: $Revision: 1.45 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -179,7 +179,7 @@ bufferNb =0; info.help = "Creates an html index of known boxes. If filename is provided then save it to the file 'filename'. The default index entries are the initial letters of the names of the boxes. If 'Packages' or 'Categories' is provided then the entries are either the packages names or the categories. If 'Adaptors' is provided then an alphabetical index of all adaptors is created."; mCommandDict[info.category] = info; - info.category = "reset"; //EED + info.category = "reset"; info.argmin = 0; info.argmax = 0; info.code = cReset; @@ -290,8 +290,6 @@ bufferNb =0; */ Interpreter::~Interpreter() { - -std::cout << "=========================================~Interpreter()" << std::endl; bbtkDebugMessageInc("Interpreter",9,"Interpreter::~Interpreter()" <0) && !mFile.back()->eof() ) //{ // std::cout << "mFile.size() "<< mFile.size() << " mFileName.back() [" << mFileName.back() << "]" << std::endl; - while (!mFile.back()->eof()) { mLine.back()++; char buf[500]; @@ -349,13 +344,11 @@ std::cout << "=========================================~Interpreter()" << std::e str.erase(size-1,1); } - InterpretLine(str, insideComment); - -//printf("EED Interpreter::InterpretFile %s\n", str.c_str() ); + InterpretLine(str, insideComment); - } - //if (mFile.size()>0) - CloseCurrentFile(); + }//while + //if (mFile.size()>0) + CloseCurrentFile(); } } catch (QuitException e) @@ -402,7 +395,6 @@ std::cout << "=========================================~Interpreter()" << std::e */ void Interpreter::InterpretLine( const std::string& line, bool &insideComment ) { - bbtkDebugMessageInc("Interpreter",9,"Interpreter::InterpretLine(\""<mExecuter->Reset(); break; @@ -836,17 +828,21 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& continue; // ignore '-appli.bbs' files } */ - (*stream) << "include " << *i << "\n"; + + (*stream) << "include " << *i << "\n"; +//EED InterpretFile(*i); + nbBssFiles++; - } - if (nbBssFiles==0) + } // for vector + if (nbBssFiles==0){ bbtkMessage("Interpreter",2, "WARNING : No '.bbs' file found in [" << upath << "]" << std::endl); - else - SwitchToStream(stream); + } else { + SwitchToStream(stream); + } return; - } + } // if upath std::string path; std::vector::iterator i; @@ -861,11 +857,10 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& char * currentDir = getcwd(buf, 2048); std::string cwd(currentDir); path = currentDir; - } + } // if path fullDirectoryName = Utilities::MakePkgnameFromPath(path, upath, false); - //EED 18 Fev 2008 // without last slash "\" std::string fullDirectoryNameClean = fullDirectoryName.substr(0,fullDirectoryName.size()-1); @@ -878,7 +873,7 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& bbtkMessage("Interpreter",1," [" <& nbBssFiles = 0; for (std::vector::iterator i = Filenames.begin(); i!= Filenames.end(); ++i) { -//EEDprintf("EED Interpreter::SwitchToFile %s\n",(*i).c_str() ); // std::cout << "JPR================== iterate [" << *i << "]" << std::endl; int lgr = (*i).size(); if (lgr < 5) @@ -901,21 +895,25 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& continue; // ignore '-appli.bbs' files } */ - (*stream) << "include " << *i << "\n"; + + (*stream) << "include " << *i << "\n"; +//EED InterpretFile(*i); + nbBssFiles++; - } - if (nbBssFiles==0) + } // for vector + if (nbBssFiles==0){ bbtkMessage("Interpreter",1, "WARNING : No '.bbs' file found in [" << fullDirectoryName << "]" << std::endl); - else + } else { SwitchToStream(stream); + } //break; // a directory was found; we stop iterating // LG : No! We want all files included ! - } + } // for vector return; - } + } // if * //std::string::size_type slash_position = name.find_last_of("/\\"); @@ -1014,7 +1012,8 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& void Interpreter::SwitchToStream( std::stringstream* stream ) { //std::cout << "== 1 Entry in Interpreter::SwitchToStream " << std::endl; - mFile.push_back(stream); + + mFile.push_back(stream); //std::cout << " mFile.size() " << mFile.size() << std::endl; std::ostringstream buffer_name; bufferNb++; @@ -1054,18 +1053,14 @@ void Interpreter::SwitchToStream( std::stringstream* stream ) void Interpreter::LoadScript( std::string fullPathScriptName, std::string includeScriptName) { -//std::cout << "--------------------------EED Interpreter::LoadScript >>01\n" << std::endl; Utilities::replace( fullPathScriptName , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR); bool okScriptExist=false; int iStrScript,sizeVecStricpt=mFileName.size(); for ( iStrScript=0;iStrScript>__ %s\n", iStrScript,mFileName[iStrScript].c_str(),fullPathScriptName.c_str() ); - if (mFileName[iStrScript] == fullPathScriptName ) { - printf(" EED %d Interpreter::LoadScript iguales\n",iStrScript ); okScriptExist=true; } // if } // for @@ -1073,7 +1068,6 @@ void Interpreter::SwitchToStream( std::stringstream* stream ) if (find(mFileName.begin(),mFileName.end(),fullPathScriptName)!=mFileName.end()) // if (okScriptExist==true) { -//EED printf("EED Interpreter::LoadScript Exit method\n"); bbtkMessage("Interpreter",1,"file '"<>02\n"); return; } @@ -1124,15 +1117,6 @@ void Interpreter::SwitchToStream( std::stringstream* stream ) mFileName.pop_back(); mIncludeFileName.pop_back(); mLine.pop_back(); -/*EED3 - bbtkDebugMessage("Interpreter",9," Closing file '"<close(); - delete mFile[0]; - mFile.erase( mFile.begin() ); - mFileName.erase( mFileName.begin() ); - mIncludeFileName.erase( mIncludeFileName.begin() ); - mLine.erase( mLine.begin() ); -*/ bbtkDebugMessage("Interpreter",9," Remains " < WxBrowser::OnURLEnter URL(%s) \n ", (const char*) mwxURL->GetValue().mb_str() ); mwxHtmlWindow->LoadPage(mwxURL->GetValue()); } //======================================================================== @@ -288,12 +286,8 @@ namespace bbtk //======================================================================== void WxBrowser::OnLinkClicked(wxHtmlLinkEvent& e) { - std::cout << "WxBrowser::OnLinkClicked"< WxBrowser::OnLinkClicked eve(%s) \n ", (const char*) e.GetLinkInfo().GetHref().mb_str() ); mwxHtmlWindow->LoadPage( e.GetLinkInfo().GetHref() ); UpdateURL(); - printf ( "EED > WxBrowser::OnLinkClicked URL(%s) \n ", (const char*) mwxURL->GetValue().mb_str() ); mwxHtmlWindow->LoadPage( mwxURL->GetValue() ); } //======================================================================== diff --git a/kernel/src/bbtkWxConsole.cxx b/kernel/src/bbtkWxConsole.cxx index a218586..11b9f56 100644 --- a/kernel/src/bbtkWxConsole.cxx +++ b/kernel/src/bbtkWxConsole.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkWxConsole.cxx,v $ Language: C++ - Date: $Date: 2008/03/14 14:58:53 $ - Version: $Revision: 1.13 $ + Date: $Date: 2008/03/17 07:04:08 $ + Version: $Revision: 1.14 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -158,6 +158,8 @@ namespace bbtk WxConsole::WxConsole( wxWindow *parent, wxString title, wxSize size) : wxFrame((wxFrame *)parent, -1, title, wxDefaultPosition, size) { +// m_mgr = new wxAuiManager(this); + m_mgr.SetManagedWindow(this); mInterpreter = new bbtk::Interpreter(); mInterpreter->SetWxConsole(this); @@ -173,9 +175,11 @@ namespace bbtk menuAbout->Append( ID_Menu_About, _T("&About...") ); wxMenu *menuTools = new wxMenu; - menuTools->Append( ID_Menu_CreatePackage, _T("&Create package") ); - menuTools->Append( ID_Menu_CreateBlackBox, _T("&Create blackbox") ); + menuTools->Append( ID_Menu_EditConfig, _T("&Edit bbtk config") ); + menuTools->Append( ID_Menu_CreatePackage, _T("Create &package") ); + menuTools->Append( ID_Menu_CreateBlackBox, _T("Create &blackbox") ); menuTools->Append( ID_Menu_ShowImageGraph, _T("&Show last image graph") ); + menuTools->Append( ID_Menu_CreateIndex, _T("&Generate index") ); wxMenuBar *menuBar = new wxMenuBar; @@ -201,18 +205,9 @@ namespace bbtk wxSize(500,500), wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER); - mwxPageCommand = new wxPanel(mwxNotebook,-1); - mwxNotebook->AddPage( mwxPageCommand, _T("Command")); - + mwxPageCommand = new wxPanel(mwxNotebook,-1); mwxPageHelp = new wxPanel(mwxNotebook,-1); - mwxNotebook->AddPage( mwxPageHelp, _T("Help")); - - -//EED sizer->Add ( mwxNotebook, 1, wxEXPAND /*| wxALIGN_BOTTOM*/ ); - wxAuiManager *m_mgr = new wxAuiManager(this); - m_mgr->AddPane(mwxNotebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false)); - m_mgr->Update(); wxBoxSizer *cmdsizer = new wxBoxSizer(wxVERTICAL); @@ -273,10 +268,11 @@ namespace bbtk mwxTextCommand = new wxComboBox(mwxPageCommand, ID_Text_Command, - _T("") -// wxDefaultPosition, -// wxDefaultSize, -// wxTE_PROCESS_ENTER + _T(""), + wxDefaultPosition, + wxDefaultSize, + 0, NULL, + wxTE_PROCESS_ENTER // | wxTE_PROCESS_TAB // | wxWANTS_CHARS // //| wxTAB_TRAVERSAL @@ -310,10 +306,10 @@ namespace bbtk // Events connection // COMMAND // ENTER - /* Connect( mwxTextCommand->GetId(), wxEVT_COMMAND_TEXT_ENTER, (wxObjectEventFunction)& WxConsole::OnCommandEnter ); + /* Connect( mwxTextCommand->GetId(), wxEVT_CHAR, //wxEVT_COMMAND_TEXT_UPDATED, @@ -343,15 +339,24 @@ namespace bbtk // Layout //EED SetSizer(sizer); - SetAutoLayout(true); + + mwxNotebook->AddPage( mwxPageCommand, _T("Command")); + mwxNotebook->AddPage( mwxPageHelp, _T("Help")); + m_mgr.AddPane(mwxNotebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false)); + m_mgr.Update(); + + + SetAutoLayout(true); Layout(); - Refresh(); +// Refresh(); +// m_mgr.Update(); } //================================================================ //================================================================ WxConsole::~WxConsole() { + m_mgr.UnInit(); delete mRedirect_cout; delete mRedirect_cerr; } @@ -398,9 +403,7 @@ namespace bbtk { bool insideComment = false; -printf("WxConsole::CommandString 04 \n"); mInterpreter->InterpretLine( wx2std(line), insideComment ); -printf("WxConsole::CommandString 05 \n"); } catch (bbtk::QuitException) { @@ -435,21 +438,39 @@ printf("WxConsole::CommandString 05 \n"); //================================================================ void WxConsole::OnMenuAbout(wxCommandEvent& WXUNUSED(event)) { - - wxMessageBox(_T(" bbi\nThe Black Box Toolkit interpreter\n(c) CREATIS-LRMN 2007"), + m_mgr.Update(); + Refresh(); + wxMessageBox(_T(" bbi\nThe Black Box Toolkit interpreter\n(c) CREATIS-LRMN 2008"), _T("About ..."), wxOK | wxICON_INFORMATION, this); } //================================================================ - + + //================================================================ + void WxConsole::OnMenuEditConfig(wxCommandEvent& WXUNUSED(event)) + { + std::string commandStr; + std::string configFile = ConfigurationFile::GetInstance().Get_config_xml_full_path(); +#ifdef WIN32 + commandStr = "notepad.exe "; +#else + commandStr = "gedit "; +#endif + commandStr = commandStr + configFile; + std::cout << "system: " << commandStr << std::endl; + system ( commandStr.c_str() ); + } + //================================================================ + + //================================================================ void WxConsole::OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event)) { - - wxMessageBox(_T(" Creating Package"), - _T("Creating Package ..."), wxOK | wxICON_INFORMATION, - this); + std::cout << "bbi: include CreatePackage" << std::endl; + Interpreter* I = new Interpreter; + I->InterpretFile("CreatePackage"); + delete I; } //================================================================ @@ -457,29 +478,55 @@ printf("WxConsole::CommandString 05 \n"); //================================================================ void WxConsole::OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event)) { - - wxMessageBox(_T(" Creating blackbox"), - _T("Creating blackbox ..."), wxOK | wxICON_INFORMATION, - this); + std::cout << "bbi: include CreateBlackBox" << std::endl; + Interpreter* I = new Interpreter; + I->InterpretFile("CreateBlackBox"); + delete I; } //================================================================ //================================================================ void WxConsole::OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event)) { - std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir(); + std::string default_temp_dir = ConfigurationFile::GetInstance().Get_default_temp_dir(); #if defined(WIN32) std::string strappli="start "; #else std::string strappli="gnome-open "; #endif - std::string strcommand = strappli +default_doc_dir+"/temp_dir/workspace_workspacePrototype.png"; + std::string strcommand = strappli +default_temp_dir+"/temp_dir/workspace_workspacePrototype.png"; + std::cout << "system: " << strcommand << std::endl; system ( strcommand.c_str() ); + } //================================================================ - + + //================================================================ + void WxConsole::OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event)) + { + std::string doc_path = ConfigurationFile::GetInstance().Get_doc_path(); + std::string filepath = doc_path+"/bbdoc/make-index.bbs"; + Interpreter* I = new Interpreter; + +//EED std::cout << "bbi: include "<InterpretFile( filepath ); + + bool insideComment = false; // for multiline comment + I->InterpretLine( "exec freeze" ,insideComment ); + I->InterpretLine( "include *" ,insideComment ); + I->InterpretLine( "index "+doc_path+"/bbdoc/index-alpha.html Initials" ,insideComment ); + I->InterpretLine( "index "+doc_path+"/bbdoc/index-package.html Packages" ,insideComment ); + I->InterpretLine( "index "+doc_path+"/bbdoc/index-category.html Categories" ,insideComment ); + I->InterpretLine( "index "+doc_path+"/bbdoc/index-adaptors.html Adaptors",insideComment ); + + delete I; + } + //================================================================ + + + //================================================================ void WxConsole::OnCommandChar(wxCommandEvent& event) @@ -544,10 +591,18 @@ printf("WxConsole::CommandString 05 \n"); wxButton *btnInclude = new wxButton( btnsCtrlPanel,-1,_T("Include") ); wxButton *btnReset = new wxButton( btnsCtrlPanel,-1,_T("Reset") ); wxButton *btnConfig = new wxButton( btnsCtrlPanel,-1,_T("Config") ); - wxButton *btnGraphS = new wxButton( btnsCtrlPanel,-1,_T("Graph S.") ); - wxButton *btnGraphD = new wxButton( btnsCtrlPanel,-1,_T("Graph D.") ); + wxButton *btnGraphS = new wxButton( btnsCtrlPanel,-1,_T("Graph simple") ); + wxButton *btnGraphD = new wxButton( btnsCtrlPanel,-1,_T("Graph detailed") ); wxButton *btnHelp = new wxButton( btnsCtrlPanel,-1,_T("Help") ); + btnsSizer->Add( btnInclude ); + btnsSizer->Add( btnReset ); + btnsSizer->Add( btnConfig ); + btnsSizer->Add( btnGraphS ); + btnsSizer->Add( btnGraphD ); + btnsSizer->Add( btnHelp ); + btnsCtrlPanel->SetSizer(btnsSizer); + Connect(btnInclude->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxConsole::OnBtnInclude ); Connect(btnReset->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxConsole::OnBtnReset ); Connect(btnConfig->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxConsole::OnBtnConfig ); @@ -584,9 +639,7 @@ printf("WxConsole::CommandString 05 \n"); //================================================================ void WxConsole::OnBtnReset(wxCommandEvent& event) { -printf("WxConsole::OnBtnReset 01 \n"); CommandString(_T("reset")); -printf("WxConsole::OnBtnReset 02 \n"); } //================================================================ @@ -626,11 +679,13 @@ printf("WxConsole::OnBtnReset 02 \n"); BEGIN_EVENT_TABLE(WxConsole, wxFrame) EVT_MENU(WxConsole::ID_Menu_Quit, WxConsole::OnMenuQuit) EVT_MENU(WxConsole::ID_Menu_About, WxConsole::OnMenuAbout) + EVT_MENU(WxConsole::ID_Menu_EditConfig, WxConsole::OnMenuEditConfig) EVT_MENU(WxConsole::ID_Menu_CreatePackage, WxConsole::OnMenuCreatePackage) EVT_MENU(WxConsole::ID_Menu_CreateBlackBox, WxConsole::OnMenuCreateBlackBox) EVT_MENU(WxConsole::ID_Menu_ShowImageGraph, WxConsole::OnMenuShowImageGraph) + EVT_MENU(WxConsole::ID_Menu_CreateIndex, WxConsole::OnMenuCreateIndex) EVT_TEXT_ENTER(WxConsole::ID_Text_Command, WxConsole::OnCommandEnter) - // EVT_CHAR(WxConsole::ID_Text_Command, WxConsole::OnCommandChar) +// EVT_CHAR(WxConsole::ID_Text_Command, WxConsole::OnCommandChar) END_EVENT_TABLE() //================================================================ diff --git a/kernel/src/bbtkWxConsole.h b/kernel/src/bbtkWxConsole.h index 183c907..f66fe35 100644 --- a/kernel/src/bbtkWxConsole.h +++ b/kernel/src/bbtkWxConsole.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkWxConsole.h,v $ Language: C++ - Date: $Date: 2008/03/07 11:37:48 $ - Version: $Revision: 1.7 $ + Date: $Date: 2008/03/17 07:04:08 $ + Version: $Revision: 1.8 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -84,9 +84,11 @@ namespace bbtk void OnMenuQuit(wxCommandEvent& event); void OnMenuAbout(wxCommandEvent& event); + void OnMenuEditConfig(wxCommandEvent& WXUNUSED(event)); void OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event)); void OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event)); void OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event)); + void OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event)); void OnBtnGo(wxCommandEvent& event); void OnCommandEnter(wxCommandEvent& event); @@ -103,6 +105,7 @@ namespace bbtk void ShowHtmlPage(std::string&); private: + wxAuiManager m_mgr; Interpreter* mInterpreter; wxTextCtrl* mwxTextHistory; //EED wxTextCtrl* mwxTextCommand; @@ -119,16 +122,17 @@ namespace bbtk wxPanel* CreateBtnsCtrlPanel(wxWindow *parent); void CommandString(wxString line ); - public: enum { ID_Menu_Quit = 1, ID_Menu_About, + ID_Menu_EditConfig, ID_Menu_CreatePackage, ID_Menu_CreateBlackBox, ID_Menu_ShowImageGraph, + ID_Menu_CreateIndex, ID_Text_Command, ID_Text_History, diff --git a/packages/toolsbbtk/bbs/appli/CreateBlackBox.bbs b/packages/toolsbbtk/bbs/appli/CreateBlackBox.bbs new file mode 100644 index 0000000..232ac05 --- /dev/null +++ b/packages/toolsbbtk/bbs/appli/CreateBlackBox.bbs @@ -0,0 +1,136 @@ +description "Creates the XML or C++ code for a new black box" +author "eduardo.davila at creatis.insa-lyon.fr" +category "toolsbbtk" + +load std +load wx + +new OutputText windowTitle + set windowTitle.In "- - - - - - - - - - - - - - Create Blackbox - - - - - - - - - - - - - -" + +new DirectorySelector dir + set dir.Title "Select the location of your new package" + +new InputText nameBlackbox + set nameBlackbox.Title "Blackbox name (1 word)" + set nameBlackbox.In "NEW_BLACKBOX" + +new InputText namePackage + set namePackage.Title "Package name (1 word)" + set namePackage.In "__PACKAGE__" + + +new InputText author + set author.Title "Author(s) (caracters '<', '>' not accepted...)" + set author.In "_author_" + +new InputText description + set description.Title "Description (caracters '<', '>' not accepted...)" + set description.In "_description_" + +#--------------------------------------------------------------------- + + +new RadioButton typeBlackbox + set typeBlackbox.Title "Type of the blackbox :" + set typeBlackbox.In0 "std-template" + set typeBlackbox.In1 "VTK_PolyDataAlgorithm-template" + set typeBlackbox.In2 "VTK_ImageAlgorithm-template" + set typeBlackbox.In3 "widget-template " + +new StringSelect stringselectorType + set stringselectorType.In0 "std" + set stringselectorType.In1 "VTK_PolyDataAlgorithm" + set stringselectorType.In2 "VTK_ImageAlgorithm" + set stringselectorType.In3 "widget" + connect typeBlackbox.Out stringselectorType.In + +#--------------------------------------------------------------------- + +new RadioButton formatBlackbox + set formatBlackbox.Title "Format of the output file :" + set formatBlackbox.In 0 + set formatBlackbox.In0 "C++" + set formatBlackbox.In1 "XML" + +new StringSelect stringselectorFormat + set stringselectorFormat.In0 "C++" + set stringselectorFormat.In1 "XML" + connect formatBlackbox.Out stringselectorFormat.In + +#--------------------------------------------------------------------- + +new LayoutLine layoutHor + set layoutHor.Orientation H + connect typeBlackbox.Widget layoutHor.Widget1 + connect formatBlackbox.Widget layoutHor.Widget2 + +new LayoutLine info + connect windowTitle.Widget info.Widget1 + connect nameBlackbox.Widget info.Widget2 + connect namePackage.Widget info.Widget3 + connect author.Widget info.Widget4 + connect description.Widget info.Widget5 + connect layoutHor.Widget info.Widget6 + set info.WinDialog true + set info.WinWidth 350 + set info.WinHeight 500 +exec info + + +#--------------------------------------------------------------------- + +new ConcatStrings dirStr + connect dir.Out dirStr.In1 + set dirStr.In2 " " + +new ConcatStrings packageNameStr + connect namePackage.Out packageNameStr.In1 + set packageNameStr.In2 " " + +new ConcatStrings blackboxNameStr + connect nameBlackbox.Out blackboxNameStr.In1 + set blackboxNameStr.In2 " " + +new ConcatStrings typeStr + connect stringselectorType.Out typeStr.In1 + set typeStr.In2 " " + +new ConcatStrings formatStr + connect stringselectorFormat.Out formatStr.In1 + set formatStr.In2 " " + +new ConcatStrings authorStr + connect author.Out authorStr.In1 + set authorStr.In2 " " + +new ConcatStrings descriptionStr + connect description.Out descriptionStr.In1 + set descriptionStr.In2 " " + +new Configuration conf + +new ConcatStrings commandStr + set commandStr.In1 "." + connect conf.FileSeparator commandStr.In2 + set commandStr.In3 "bbCreateBlackBox " + +new ConcatStrings concatStr + connect commandStr.Out concatStr.In1 + connect dirStr.Out concatStr.In2 + connect packageNameStr.Out concatStr.In3 + connect blackboxNameStr.Out concatStr.In4 + connect typeStr.Out concatStr.In5 + connect formatStr.Out concatStr.In6 + connect authorStr.Out concatStr.In7 + connect descriptionStr.Out concatStr.In8 + + +new ExecSystemCommand command + connect concatStr.Out command.In + print $concatStr.Out$ + +exec command + +#seg fault : +#quit \ No newline at end of file diff --git a/packages/toolsbbtk/bbs/appli/CreateBox.bbs b/packages/toolsbbtk/bbs/appli/CreateBox.bbs deleted file mode 100644 index d479e65..0000000 --- a/packages/toolsbbtk/bbs/appli/CreateBox.bbs +++ /dev/null @@ -1,5 +0,0 @@ -description "Creates the XML or C++ code for a new black box" -author "laurent.guigues at creatis.insa-lyon.fr" -category "bbtk tool" - -print "Not implemented yet !!!" diff --git a/packages/toolsbbtk/bbs/appli/CreatePackage.bbs b/packages/toolsbbtk/bbs/appli/CreatePackage.bbs index 26fa6ad..c057ae5 100644 --- a/packages/toolsbbtk/bbs/appli/CreatePackage.bbs +++ b/packages/toolsbbtk/bbs/appli/CreatePackage.bbs @@ -5,44 +5,57 @@ category "bbtk tool" load wx load std +new OutputText windowTitle + set windowTitle.In "- - - - - - - - - - - - - - Create Blackbox - - - - - - - - - - - - - -" + new DirectorySelector dir -set dir.Title "Select the location of your new package" + set dir.Title "Select the location of your new package" new InputText name -set name.Title "Name" -set name.In "NEW_PACKAGE" + set name.Title "Name (1 word)" + set name.In "NEW_PACKAGE" new InputText author -set author.Title "Author(s)" -set author.In "" + set author.Title "Author(s) (caracters '<', '>' not accepted...)" + set author.In "_author_" new InputText description -set description.Title "Description" -set description.In "" + set description.Title "Description (caracters '<', '>' not accepted...)" + set description.In "_description_" new LayoutLine info -connect name.Widget info.Widget1 -connect author.Widget info.Widget2 -connect description.Widget info.Widget3 - -set info.WinDialog true + connect windowTitle.Widget info.Widget1 + connect name.Widget info.Widget2 + connect author.Widget info.Widget3 + connect description.Widget info.Widget4 + set info.WinDialog true + set info.WinWidth 400 + set info.WinHeight 250 exec info + +new Configuration conf +new ConcatStrings concatStrCommand + set concatStrCommand.In1 "." + connect conf.FileSeparator concatStrCommand.In2 + set concatStrCommand.In3 "bbCreatePackage " new ConcatStrings concatStr -set concatStr.In1 "./bbCreatePackage " -connect dir.Out concatStr.In2 -set concatStr.In3 " " -connect name.Out concatStr.In4 -set concatStr.In5 " '" -connect author.Out concatStr.In6 -set concatStr.In7 "' '" -connect description.Out concatStr.In8 -set concatStr.In9 "'" + connect concatStrCommand.Out concatStr.In1 + connect dir.Out concatStr.In2 + set concatStr.In3 " " + connect name.Out concatStr.In4 + set concatStr.In5 " '" + connect author.Out concatStr.In6 + set concatStr.In7 "' '" + connect description.Out concatStr.In8 + set concatStr.In9 "'" new ExecSystemCommand command -connect concatStr.Out command.In -print $concatStr.Out$ + connect concatStr.Out command.In + print $concatStr.Out$ + exec command + #seg fault : #quit diff --git a/packages/wx/src/bbwxDirectorySelector.cxx b/packages/wx/src/bbwxDirectorySelector.cxx index b0c6d62..a0b4f5c 100644 --- a/packages/wx/src/bbwxDirectorySelector.cxx +++ b/packages/wx/src/bbwxDirectorySelector.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbwxDirectorySelector.cxx,v $ Language: C++ - Date: $Date: 2008/02/15 13:52:44 $ - Version: $Revision: 1.2 $ + Date: $Date: 2008/03/17 07:04:09 $ + Version: $Revision: 1.3 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -48,9 +48,7 @@ namespace bbwx bbtk::std2wx(bbGetInputMessage()), bbtk::std2wx(bbGetInputDefaultDir())); - FD->ShowModal(); - - if (FD->GetReturnCode()==wxID_OK) + if (FD->ShowModal()==wxID_OK) { bbSetOutputOut( bbtk::wx2std (FD->GetPath()) ); bbSetInputDefaultDir( bbtk::wx2std (FD->GetPath()) ); diff --git a/packages/wxvtk/bbs/appli/ExampleBasicImageApplication.bbs b/packages/wxvtk/bbs/appli/ExampleBasicImageApplication.bbs index da88857..67da6c8 100644 --- a/packages/wxvtk/bbs/appli/ExampleBasicImageApplication.bbs +++ b/packages/wxvtk/bbs/appli/ExampleBasicImageApplication.bbs @@ -5,8 +5,7 @@ author "laurent.guigues@creatis.insa-lyon.fr" category "example" ## THE APPLICATION BOX -include /home/guigues/coding/Sofa/bbtk/packages/wxvtk/bbs/boxes/bbBasicImageApplication -#include wxvtk/boxes/bbBasicImageApplication +include wxvtk/boxes/bbBasicImageApplication new BasicImageApplication appli set appli.WinTitle "ExampleBasicImageApplication" -- 2.45.1