Ignore:
Timestamp:
Jun 10, 2009 11:19:35 AM (12 years ago)
Author:
raasch
Message:

several small bugfixes; some more dvrp changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/process_dvr_output

    r262 r336  
    1414    # Variable declarations + default values
    1515 camera=false
     16 create_config_file=false
    1617 create_sequence_output=false
    1718 data_catalog=`pwd`
     
    1920 file_identifier=all_streams
    2021 groundplate=false
    21  palm_run_identifier=""
     22 palm_run_identifier="unknown_run"
    2223 topography=false
    2324
    24  typeset  -i  i j nstream nscenes
     25 typeset  -i  a acceleration=1 k i j nstream nscenes
    2526
    2627
    2728    # Read shellscript options
    28  while  getopts  :d:f:ls option
     29 while  getopts  :a:cd:f:ls option
    2930 do
    3031   case  $option  in
     32       (a)   acceleration=$OPTARG;;
     33       (c)   create_config_file=true;;
    3134       (d)   data_catalog=$OPTARG;;
    3235       (f)   file_identifier=$OPTARG;;
     
    4043
    4144
     45    # Create the config file for the streaming server; do nothing else
     46 if [[ $create_config_file = true ]]
     47 then
     48    cp  ${PALM_BIN}/.dvrserver.config  .
     49
     50       # Entering the BASEDIR, UID and GID into this file
     51    user_id=`id -u`
     52    group_id=`id -g`
     53
     54       # data directory is always the current working directory
     55    sed "s/<replace by dvr data directory>/./g" .dvrserver.config > .dvrserver.1
     56    sed "s/<replace by user id>/$user_id/g"    .dvrserver.1 > .dvrserver.2
     57    sed "s/<replace by group id>/$group_id/g"  .dvrserver.2 > .dvrserver.3
     58    mv  .dvrserver.3  .dvrserver.config
     59    rm  .dvrserver.1  .dvrserver.2
     60    exit
     61 fi
     62
     63
    4264    # Find out the PALM run identifier
    4365 if [[ -f CPU_MEASURES ]]
     
    4567    palm_run_identifier=`head -1  CPU_MEASURES`
    4668 fi
     69
    4770
    4871    # Process the streaming server output
     
    172195
    173196       # Change path to the current file identifier
    174     sed  "s/DATA_DVR/${file_identifier}_dvr/g"  $dvr_file > tmp_file
     197       # Remove path because BASEDIR of streaming server is set to "."
     198#    sed  "s/DATA_DVR/${file_identifier}_dvr/g"  $dvr_file > tmp_file
     199    sed  "s/DATA_DVR\///g"  $dvr_file > tmp_file
    175200    mv  tmp_file  $dvr_file
    176201
    177202
    178203       # If there is a dvr configuration file, set the BASEDIR to the parent
    179        # directory of the above given path
     204       # directory of the above given path (i.e. ".")
    180205    if [[ -f .dvrserver.config ]]
    181206    then
    182207       old_path=`grep  BASEDIR  .dvrserver.config`
    183        sed  "s&${old_path}&BASEDIR=..&g"  .dvrserver.config  >  .dvrserver.config.new
     208       sed  "s&${old_path}&BASEDIR=.&g"  .dvrserver.config  >  .dvrserver.config.new
    184209       mv  .dvrserver.config.new  .dvrserver.config
    185210    fi
     
    326351 then
    327352
     353    rm -rf  sequence_data
    328354    mkdir  sequence_data
    329355
     
    347373       # Now, merge the data, frame by frame
    348374    (( j = 0 ))
     375    (( k = 0 ))
     376    (( a = 0 ))
    349377    while (( j < ${frames[1]} ))
    350378    do
    351379
    352        nframe=`printf "%05d" $j`
    353 
    354        (( i = 0 ))
    355        while (( i < nstream ))
    356        do
    357           (( i = i + 1 ))
    358           cat  ${streamname[$i]}/$nframe.dvr  >>  sequence_data/$nframe.dvr
    359        done
     380       rframe=`printf "%05d" $j`
     381
     382       if (( a == 0 ))
     383       then
     384
     385          wframe=`printf "%05d" $k`
     386          (( k = k + 1 ))
     387
     388          (( i = 0 ))
     389          while (( i < nstream ))
     390          do
     391             (( i = i + 1 ))
     392             cat  ${streamname[$i]}/$rframe.dvr  >>  sequence_data/$wframe.dvr
     393          done
     394
     395
     396       fi
     397
     398       (( a = a + 1 ))
     399       if (( a == acceleration ))
     400       then
     401          (( a = 0 ))
     402       fi
    360403
    361404       (( j = j + 1 ))
     
    368411    sed  "s/camera.dvr/static_scenes.dvr/g"  tmp1.html  >  tmp2.html
    369412    sed  "s&${streamname[1]}&sequence_data&g"  tmp2.html  >  tmp3.html
     413    sed  "s/;0-0/;0-$wframe/g"  tmp3.html  >  tmp4.html
    370414    if [[ "$palm_run_identifier" = "" ]]
    371415    then
    372        cp  tmp3.html  ${file_identifier}_sequence.html
     416       cp  tmp4.html  ${file_identifier}_sequence.html
    373417    else
    374        sed "s&DATA_DVR/sequence_data/\*\*\*\*\*.dvr (DVR 3D Sequence)&DVR 3D sequence generated by $palm_run_identifier&g"  tmp3.html  >  ${file_identifier}_sequence.html
    375     fi
    376     rm  tmp1.html  tmp2.html  tmp3.html
     418       sed "s&DATA_DVR/sequence_data/\*\*\*\*\*.dvr (DVR 3D Sequence)&DVR 3D sequence generated by $palm_run_identifier&g"  tmp4.html  >  ${file_identifier}_sequence.html
     419    fi
     420    rm  tmp1.html  tmp2.html  tmp3.html  tmp4.html
    377421
    378422    printf "      data for using sequence mode generated"
Note: See TracChangeset for help on using the changeset viewer.