diff --git a/update_amda/cleanNewMetaLight b/update_amda/cleanNewMetaLight index a124edd..ad5ec38 100755 --- a/update_amda/cleanNewMetaLight +++ b/update_amda/cleanNewMetaLight @@ -3,7 +3,7 @@ if test $NEWMETA then - for Dir in $(find -L $NEWMETA/* -type d -not -path *ParamInfo* ) + for Dir in $(find -L $NEWMETA/* -type d -not -path $NEWMETA/ParamInfo* ) do rm ${Dir}/* done diff --git a/update_amda/cp2amda b/update_amda/cp2amda index 9966ddc..7356dea 100755 --- a/update_amda/cp2amda +++ b/update_amda/cp2amda @@ -18,13 +18,14 @@ if [ -e $AMDAINTERNALDIR/ParamTemplateList.xml ]; then mkdir $AMDAINSTALLATION/AMDA_IHM/generic_data/newKernelDDBase fi - cp $NEWMETA/final/*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/newKernelDDBase - # if internal parameters not shown in the tree exist => copy them if [ -d $AMDAINTERNALDIR/INTERNAL_PARAM_DEF ] then - cp $AMDAINTERNALDIR/INTERNAL_PARAM_DEF/* $AMDAINSTALLATION/AMDA_IHM/generic_data/newKernelDDBase + cp $AMDAINTERNALDIR/INTERNAL_PARAM_DEF/* $NEWMETA/final/ fi + + cp $NEWMETA/final/*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/newKernelDDBase + # if special help exitsts => copy it if [ -d $AMDAINTERNALDIR/HELP_PREDEFINED ] diff --git a/update_amda/generate_param_info b/update_amda/generate_param_info index 0431c86..13dd604 100755 --- a/update_amda/generate_param_info +++ b/update_amda/generate_param_info @@ -21,9 +21,23 @@ fi # to avoid not needed calculations if [ -d $AMDAINTERNALDIR/PARAM_INFO_PREDEFINED ]; then - cp $AMDAINTERNALDIR/PARAM_INFO_PREDEFINED/info*.xml $NEWMETA/ParamInfo + cp $AMDAINTERNALDIR/PARAM_INFO_PREDEFINED/info*.xml $PARAM_INFO_PATH fi +for param_file in $NEWMETA/final/*.xml +do + param_filename=$(basename "${param_file%.*}") + info_file=info_${param_filename}.xml + + if [ -e $PARAM_INFO_PATH/$info_file ] + then + echo ${param_filename} exists + else + echo "Generate info file for ${param_filename}" + php $UPDATEDIR/preprocessInfo.php ${param_filename} + fi +done + #modif in app.properties if [ ! -e ./app.properties ]; then echo "No app.properties file !!!" @@ -79,17 +93,17 @@ do echo "Generate info file for ${param_filename}" amdaParameterInfo -p ${param_filename} if [ $? -eq 0 ]; then - mv $info_file $NEWMETA/ParamInfo + mv $info_file $PARAM_INFO_PATH fi fi -done; +done # copy info for parameter arguments if [ ! -d $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo ]; then mkdir $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo fi -cp $NEWMETA/ParamInfo/info*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo +cp $PARAM_INFO_PATH/info*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo cd ${CRT_PWD} diff --git a/update_amda/preprocessInfo.php b/update_amda/preprocessInfo.php new file mode 100644 index 0000000..0ff4594 --- /dev/null +++ b/update_amda/preprocessInfo.php @@ -0,0 +1,40 @@ +<?php +/** +* +*/ + $id = $argv[1]; + $NEWMETA = getenv('NEWMETA'); + + $infoXml = new DomDocument("1.0"); + $infoXml->load($NEWMETA."final/$id.xml"); + + $infoBlock = $infoXml->getElementsByTagName('info')->item(0); + $components = $infoBlock->getElementsByTagName('components')->item(0); + + if ($components->nodeValue != "") { + + echo "COMP ".$components->nodeValue.PHP_EOL; + $comps = explode(',',$components->nodeValue); + + if (count($comps) == 3) { + $argsXml = new DomDocument("1.0"); + $root = $argsXml->createElement('paraminfo'); + $root->setAttribute('xml:id',$id); + $dim = $argsXml->createElement('dimensions'); + $dim->setAttribute('dim_1',3); + $dim->setAttribute('dim_2',1); + $root->appendChild($dim); + $cmps = $argsXml->createElement('components'); + $root->appendChild($cmps); + for ($i = 0; $i < count($comps); $i++) { + $cmp = $argsXml->createElement('component'); + $cmp->setAttribute('index_1',$i); + $cmp->setAttribute('name',$comps[$i]); + $cmps->appendChild($cmp); + } + + $argsXml->appendChild($root); + $argsXml->save($NEWMETA."ParamInfo/info_$id.xml"); + } + } +?> \ No newline at end of file diff --git a/update_amda/updateAmda b/update_amda/updateAmda index 97c9184..15f4518 100755 --- a/update_amda/updateAmda +++ b/update_amda/updateAmda @@ -3,7 +3,7 @@ # --install | -i ; --update-internal | -u ; --with-remote | -r ; --generate-param-args | -a ; -update-param-args | -p ; # --spase-synchro | -s ; --clean-new-meta | -c ; --help | -h; - UPDATEDIR=`pwd`/$(dirname "$0") + export UPDATEDIR=`pwd`/$(dirname "$0") . $UPDATEDIR/updateEnv.sh for option in $@ -- libgit2 0.21.2