Changeset 6314 for issm/trunk


Ignore:
Timestamp:
10/15/10 11:14:29 (14 years ago)
Author:
Mathieu Morlighem
Message:

Complete Synchronization of verbose.m, very cool

Location:
issm/trunk/src/c/shared/Numerics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk/src/c/shared/Numerics/Synchronize.sh

    r6310 r6314  
    4646        #Get name of the line i
    4747        FILENAME=$(cat temp | grep "^[ ]*$i " | awk '{printf("%s",$2);}');
     48        LEVELNAME=$(echo $FILENAME | sed -e "s/Verb//g");
    4849
    4950        let POWER=$i-1
     
    5556        cat <<END > $ISSM_TIER"/src/m/shared/"$(echo $FILENAME".m")
    5657function bool=$(echo $FILENAME)()
    57 %$(echo $FILENAME | awk {'print toupper($1)'}) - Enum of $(echo $NAME)
     58%$(echo $FILENAME | awk {'print toupper($1)'}) - Return true if $(echo $LEVELNAME | awk {'print tolower($1)'}) level is activated
    5859%
    5960%   WARNING: DO NOT MODIFY THIS FILE
     
    6768END
    6869        #}}}
     70        #Add case to verbose.m FIELDS{{{
     71        if [ $i -eq 1 ]; then cat <<END >> FIELDS
     72                %BEGINFIELDS
     73END
     74fi
     75        cat <<END >> FIELDS
     76                $(echo $LEVELNAME | awk {'print tolower($1)'})=false;
     77END
     78        if [ $i -eq $NUMBEROFLINES ]; then cat <<END >> FIELDS
     79                %ENDFIELDS
     80END
     81fi
     82#}}}
     83        #Add case to verbose.m VERB2BIN{{{
     84        if [ $i -eq 1 ]; then cat <<END >> VERB2BIN
     85                %BEGINVERB2BIN
     86                binary=0;
     87END
     88fi
     89        cat <<END >> VERB2BIN
     90                if (verbose.$(echo $LEVELNAME | awk {'print tolower($1)'})), binary=bitor(binary,$BINARY); end
     91END
     92        if [ $i -eq $NUMBEROFLINES ]; then cat <<END >> VERB2BIN
     93                %ENDVERB2BIN
     94END
     95fi
     96#}}}
     97        #Add case to verbose.m BIN2VERB{{{
     98        if [ $i -eq 1 ]; then cat <<END >> BIN2VERB
     99                %BEGINBIN2VERB
     100END
     101fi
     102        cat <<END >> BIN2VERB
     103                if bitand(binary,$BINARY), verbose.$(echo $LEVELNAME | awk {'print tolower($1)'})=true; else verbose.$(echo $LEVELNAME | awk {'print tolower($1)'})=false; end
     104END
     105        if [ $i -eq $NUMBEROFLINES ]; then cat <<END >> BIN2VERB
     106                %ENDBIN2VERB
     107END
     108fi
     109#}}}
     110        #Add case to verbose.m DISP{{{
     111        if [ $i -eq 1 ]; then cat <<END >> DISP
     112                %BEGINDISP
     113                disp(sprintf('class ''%s''  = ',class(verbose)));
     114END
     115fi
     116        cat <<END >> DISP
     117                disp(sprintf('   %10s : %s','$(echo $LEVELNAME | awk {'print tolower($1)'})',mat2str(verbose.$(echo $LEVELNAME | awk {'print tolower($1)'}))));
     118END
     119        if [ $i -eq $NUMBEROFLINES ]; then cat <<END >> DISP
     120                %ENDDISP
     121END
     122fi
     123#}}}
    69124        #Add case to Verbosity.cpp {{{
    70125        cat <<END >> Verbosity.cpp
     
    120175END
    121176#}}}
     177#Complete verbose.m {{{1
     178VERBOSEPATH="$ISSM_TIER/src/m/classes/verbose.m"
     179cat $VERBOSEPATH  | sed "/%BEGINFIELDS/,$ d"  > temp_begin
     180cat $VERBOSEPATH  | sed "1,/%ENDFIELDS/d" > temp_end
     181cat temp_begin FIELDS temp_end > $VERBOSEPATH
     182rm temp_begin temp_end FIELDS
     183
     184cat $VERBOSEPATH  | sed "/%BEGINVERB2BIN/,$ d"  > temp_begin
     185cat $VERBOSEPATH  | sed "1,/%ENDVERB2BIN/d" > temp_end
     186cat temp_begin VERB2BIN temp_end > $VERBOSEPATH
     187rm temp_begin temp_end VERB2BIN
     188
     189cat $VERBOSEPATH  | sed "/%BEGINBIN2VERB/,$ d"  > temp_begin
     190cat $VERBOSEPATH  | sed "1,/%ENDBIN2VERB/d" > temp_end
     191cat temp_begin BIN2VERB temp_end > $VERBOSEPATH
     192rm temp_begin temp_end BIN2VERB
     193
     194cat $VERBOSEPATH  | sed "/%BEGINDISP/,$ d"  > temp_begin
     195cat $VERBOSEPATH  | sed "1,/%ENDDISP/d" > temp_end
     196cat temp_begin DISP temp_end > $VERBOSEPATH
     197rm temp_begin temp_end DISP
     198#}}}
    122199
    123200#clean up{{{
  • TabularUnified issm/trunk/src/c/shared/Numerics/Verbosity.h

    r6310 r6314  
    66#define _VERBOSITY_H_
    77
    8 /*List of Verbosity levels (Add your own and Synchronize)*/
     8/*List of Verbosity levels (Add your own and Synchronize: must begin with "Verb")*/
    99bool VerbModule(void);
    1010bool VerbConverge(void);
Note: See TracChangeset for help on using the changeset viewer.