Overview
Comment:Added -dr foo (reads from dir foo) option
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: c6e2d506f96aac54e10147b810a798c839229734a7ad8e46ab5f56326d8bc0e8
User & Date: gawthrop@users.sourceforge.net on 2002-05-01 14:10:22
Other Links: branch diff | manifest | tags
Context
2002-05-01
14:26:03
Whoops! Put awk back to gawk check-in: 81205b4869 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
14:10:22
Added -dr foo (reads from dir foo) option check-in: c6e2d506f9 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
14:07:44
Added -dr foo (reads files from foo) dir. check-in: 62841de034 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt from [1cae376587] to [b5d9f5c247].

13
14
15
16
17
18
19




20
21
22
23
24
25
26
# Copyright (C) 2001 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$




## Revision 1.332  2002/04/26 23:19:00  geraint
## Fixed path to info files for "mtt info".
##
## Revision 1.331  2002/04/19 09:24:29  gawthrop
## 2 changes to ode2odes_out generation: only compiles the specified c
## file; outside the computation=c clause
##







>
>
>
>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright (C) 2001 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.333  2002/04/28 18:41:26  geraint
## Fixed [ 549658 ] awk should be gawk.
## Replaced calls to awk with call to gawk.
##
## Revision 1.332  2002/04/26 23:19:00  geraint
## Fixed path to info files for "mtt info".
##
## Revision 1.331  2002/04/19 09:24:29  gawthrop
## 2 changes to ode2odes_out generation: only compiles the specified c
## file; outside the computation=c clause
##
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202


1203
1204
1205
1206
1207
1208
1209
m='m';

# Default use ps files
ps=ps
eps=eps
psview=$PSVIEW

#Initialise list
mtt_switches='';




#Look for a command line argument
while [ -n "`echo $1 | grep '^-'`" ]; do
  case $1 in
	-q )
                mtt_switches="$mtt_switches $1";
		quiet=quiet;;  







|


>
>







1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
m='m';

# Default use ps files
ps=ps
eps=eps
psview=$PSVIEW

#Initialise list of switches
mtt_switches='';

#Initialise read dirs
read_dirs=''

#Look for a command line argument
while [ -n "`echo $1 | grep '^-'`" ]; do
  case $1 in
	-q )
                mtt_switches="$mtt_switches $1";
		quiet=quiet;;  
1355
1356
1357
1358
1359
1360
1361








1362
1363
1364
1365
1366
1367
1368
                     partition='-partition';
                ;;
	-pdf )   mtt_switches="$mtt_switches $1";
                 ps=pdf; 
                 eps=pdf;
                 pdf='-pdf';
                 psview=$PDFVIEW;








                ;;
	-viewlevel )  mtt_switches="$mtt_switches $1 $2";
                      viewlevel=$2;
                      shift;;
        --version)                
                  echo 'MTT version' $version; exit;;
        --versions)                







>
>
>
>
>
>
>
>







1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
                     partition='-partition';
                ;;
	-pdf )   mtt_switches="$mtt_switches $1";
                 ps=pdf; 
                 eps=pdf;
                 pdf='-pdf';
                 psview=$PDFVIEW;
                ;;
	-dr )   mtt_switches="$mtt_switches $1"; shift
                mtt_switches="$mtt_switches $1"; read_dir=$1
	        if [ -d "${read_dir}" ]; then
		    read_dirs="${read_dirs} ${read_dir}"
		else
		    echo "${read_dir} does not exist - ignoring"
		fi
                ;;
	-viewlevel )  mtt_switches="$mtt_switches $1 $2";
                      viewlevel=$2;
                      shift;;
        --version)                
                  echo 'MTT version' $version; exit;;
        --versions)                
1907
1908
1909
1910
1911
1912
1913










1914
1915
1916
1917

1918



1919
1920
1921
1922
1923
1924
1925
##EOF

#DIFF=`diff -bq $1_args.m $1_args.new 2>/dev/null`

#if [ -n "$DIFF" ]; then
#  mv $1_args.new $1_args.m
#fi











# Tidy mode - operate in the directory MTT-work
if [ "$tidy" = "tidy" ]; then
   mkdir -p MTT_work

   cp -p -u  Makefile Make *.* .* MTT_work  2>/dev/null



   cd MTT_work

   if [ -f ".octaverc" ]; then
     touch .octaverc
   else
     echo Copying .octaverc 
     cp $MTT_LIB/octave/.octaverc .







>
>
>
>
>
>
>
>
>
>




>
|
>
>
>







1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
##EOF

#DIFF=`diff -bq $1_args.m $1_args.new 2>/dev/null`

#if [ -n "$DIFF" ]; then
#  mv $1_args.new $1_args.m
#fi

## If in MTT_work, then copy from -dr read dirs
this_dir=`basename $PWD`
if [ "${this_dir}" = "MTT_work" ]; then
  # Copy from read dirs to MTT_work
  for dir in ${read_dirs}; do
    echo Copying ${dir}/*
    cp --force ${dir}/* .
   done
fi

# Tidy mode - operate in the directory MTT-work
if [ "$tidy" = "tidy" ]; then
   mkdir -p MTT_work
   valid_files=`ls | grep -v '^MTT'`
   ##cp -p -u  Makefile Make *.* .* MTT_work  2>/dev/null
   cp -p -u -R ${valid_files} MTT_work  2>/dev/null

   # Go to MTT_work
   cd MTT_work

   if [ -f ".octaverc" ]; then
     touch .octaverc
   else
     echo Copying .octaverc 
     cp $MTT_LIB/octave/.octaverc .
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957

   # Exit on failure
   if [ "$mtt_status" != "0" ]; then
     echo Exiting MTT with error $mtt_status
     exit 1
   fi

  # Copy back form working directory
   if [ "$3" != "view" ] && [ "$3" != "hview" ] && [ -z "$reset" ]; then
      if [ "$3" = "html" ]; then
	  echo Moving $1_$2
          mv $1_$2 ..
      else
        if [ "$PLOTTYPE" = "multiple" -a -f $1_$2__ARGS.$ps ]; then
          echo Copying  $1_$2$__ARGS.$ps







|







1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985

   # Exit on failure
   if [ "$mtt_status" != "0" ]; then
     echo Exiting MTT with error $mtt_status
     exit 1
   fi

  # Copy back from working directory
   if [ "$3" != "view" ] && [ "$3" != "hview" ] && [ -z "$reset" ]; then
      if [ "$3" = "html" ]; then
	  echo Moving $1_$2
          mv $1_$2 ..
      else
        if [ "$PLOTTYPE" = "multiple" -a -f $1_$2__ARGS.$ps ]; then
          echo Copying  $1_$2$__ARGS.$ps
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
$1_rep.make: $1_rep.txt
	rep_txt2make $1 "$mtt_switches"

$1_reps_made:
	rep_txt2sh $1 "$mtt_switches";  touch $1_reps_made

$1_rep.tex: $1_rep.txt $1_reps_made
	rep_txt2tex $1 "$documenttype" "$directory";

#SUMMARY abg Acausal bond graph report (tex)
$1_abg.tex: $1_sub.sh
	abg2tex $pdf ${sensitivity_switch} $1

#SUMMARY tf Transfer function (mml)
$1_$2.mml: $1_$2.r







|







3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
$1_rep.make: $1_rep.txt
	rep_txt2make $1 "$mtt_switches"

$1_reps_made:
	rep_txt2sh $1 "$mtt_switches";  touch $1_reps_made

$1_rep.tex: $1_rep.txt $1_reps_made
	rep_txt2tex $1 "$documenttype" "$directory" "$mtt_switches";

#SUMMARY abg Acausal bond graph report (tex)
$1_abg.tex: $1_sub.sh
	abg2tex $pdf ${sensitivity_switch} $1

#SUMMARY tf Transfer function (mml)
$1_$2.mml: $1_$2.r


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]