Commit 189c51a1715902f2edabde48b506636af94ae4a2

Authored by Elena.Budnik
1 parent 22dd7e8c

preprocessInfo

update_amda/cleanNewMetaLight
... ... @@ -3,7 +3,7 @@
3 3 if test $NEWMETA
4 4 then
5 5  
6   - for Dir in $(find -L $NEWMETA/* -type d -not -path *ParamInfo* )
  6 + for Dir in $(find -L $NEWMETA/* -type d -not -path $NEWMETA/ParamInfo* )
7 7 do
8 8 rm ${Dir}/*
9 9 done
... ...
update_amda/cp2amda
... ... @@ -18,13 +18,14 @@ if [ -e $AMDAINTERNALDIR/ParamTemplateList.xml ]; then
18 18 mkdir $AMDAINSTALLATION/AMDA_IHM/generic_data/newKernelDDBase
19 19 fi
20 20  
21   - cp $NEWMETA/final/*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/newKernelDDBase
22   -
23 21 # if internal parameters not shown in the tree exist => copy them
24 22 if [ -d $AMDAINTERNALDIR/INTERNAL_PARAM_DEF ]
25 23 then
26   - cp $AMDAINTERNALDIR/INTERNAL_PARAM_DEF/* $AMDAINSTALLATION/AMDA_IHM/generic_data/newKernelDDBase
  24 + cp $AMDAINTERNALDIR/INTERNAL_PARAM_DEF/* $NEWMETA/final/
27 25 fi
  26 +
  27 + cp $NEWMETA/final/*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/newKernelDDBase
  28 +
28 29  
29 30 # if special help exitsts => copy it
30 31 if [ -d $AMDAINTERNALDIR/HELP_PREDEFINED ]
... ...
update_amda/generate_param_info
... ... @@ -21,9 +21,23 @@ fi
21 21 # to avoid not needed calculations
22 22  
23 23 if [ -d $AMDAINTERNALDIR/PARAM_INFO_PREDEFINED ]; then
24   - cp $AMDAINTERNALDIR/PARAM_INFO_PREDEFINED/info*.xml $NEWMETA/ParamInfo
  24 + cp $AMDAINTERNALDIR/PARAM_INFO_PREDEFINED/info*.xml $PARAM_INFO_PATH
25 25 fi
26 26  
  27 +for param_file in $NEWMETA/final/*.xml
  28 +do
  29 + param_filename=$(basename "${param_file%.*}")
  30 + info_file=info_${param_filename}.xml
  31 +
  32 + if [ -e $PARAM_INFO_PATH/$info_file ]
  33 + then
  34 + echo ${param_filename} exists
  35 + else
  36 + echo "Generate info file for ${param_filename}"
  37 + php $UPDATEDIR/preprocessInfo.php ${param_filename}
  38 + fi
  39 +done
  40 +
27 41 #modif in app.properties
28 42 if [ ! -e ./app.properties ]; then
29 43 echo "No app.properties file !!!"
... ... @@ -79,17 +93,17 @@ do
79 93 echo "Generate info file for ${param_filename}"
80 94 amdaParameterInfo -p ${param_filename}
81 95 if [ $? -eq 0 ]; then
82   - mv $info_file $NEWMETA/ParamInfo
  96 + mv $info_file $PARAM_INFO_PATH
83 97 fi
84 98 fi
85   -done;
  99 +done
86 100  
87 101 # copy info for parameter arguments
88 102 if [ ! -d $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo ]; then
89 103 mkdir $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo
90 104 fi
91 105  
92   -cp $NEWMETA/ParamInfo/info*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo
  106 +cp $PARAM_INFO_PATH/info*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo
93 107  
94 108 cd ${CRT_PWD}
95 109  
... ...
update_amda/preprocessInfo.php 0 → 100644
... ... @@ -0,0 +1,40 @@
  1 +<?php
  2 +/**
  3 +*
  4 +*/
  5 + $id = $argv[1];
  6 + $NEWMETA = getenv('NEWMETA');
  7 +
  8 + $infoXml = new DomDocument("1.0");
  9 + $infoXml->load($NEWMETA."final/$id.xml");
  10 +
  11 + $infoBlock = $infoXml->getElementsByTagName('info')->item(0);
  12 + $components = $infoBlock->getElementsByTagName('components')->item(0);
  13 +
  14 + if ($components->nodeValue != "") {
  15 +
  16 + echo "COMP ".$components->nodeValue.PHP_EOL;
  17 + $comps = explode(',',$components->nodeValue);
  18 +
  19 + if (count($comps) == 3) {
  20 + $argsXml = new DomDocument("1.0");
  21 + $root = $argsXml->createElement('paraminfo');
  22 + $root->setAttribute('xml:id',$id);
  23 + $dim = $argsXml->createElement('dimensions');
  24 + $dim->setAttribute('dim_1',3);
  25 + $dim->setAttribute('dim_2',1);
  26 + $root->appendChild($dim);
  27 + $cmps = $argsXml->createElement('components');
  28 + $root->appendChild($cmps);
  29 + for ($i = 0; $i < count($comps); $i++) {
  30 + $cmp = $argsXml->createElement('component');
  31 + $cmp->setAttribute('index_1',$i);
  32 + $cmp->setAttribute('name',$comps[$i]);
  33 + $cmps->appendChild($cmp);
  34 + }
  35 +
  36 + $argsXml->appendChild($root);
  37 + $argsXml->save($NEWMETA."ParamInfo/info_$id.xml");
  38 + }
  39 + }
  40 +?>
0 41 \ No newline at end of file
... ...
update_amda/updateAmda
... ... @@ -3,7 +3,7 @@
3 3 # --install | -i ; --update-internal | -u ; --with-remote | -r ; --generate-param-args | -a ; -update-param-args | -p ;
4 4 # --spase-synchro | -s ; --clean-new-meta | -c ; --help | -h;
5 5  
6   - UPDATEDIR=`pwd`/$(dirname "$0")
  6 + export UPDATEDIR=`pwd`/$(dirname "$0")
7 7 . $UPDATEDIR/updateEnv.sh
8 8  
9 9 for option in $@
... ...