From: guigues Date: Mon, 29 Sep 2008 10:08:39 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v0.8.0~94 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=83e444f7a7caaa06568f2704c968e44cb18a319e;p=bbtk.git *** empty log message *** --- diff --git a/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.bat.in b/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.bat.in new file mode 100644 index 0000000..8214efc --- /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 +