Overview
Comment:Convert user-defined txt to lower-case in translation.
Required by logic.m (Octave is case sensitive).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: afa911e79558fece4e7fc4cefc359af486719f25b0fe533d53e3a428aed33311
User & Date: geraint@users.sourceforge.net on 2001-02-05 03:33:18
Other Links: branch diff | manifest | tags
Context
2001-02-05
04:11:26
Added _logic.txt check-in: d14aabb42d user: geraint@users.sourceforge.net tags: origin/master, trunk
03:33:18
Convert user-defined txt to lower-case in translation.
Required by logic.m (Octave is case sensitive).
check-in: afa911e795 user: geraint@users.sourceforge.net tags: origin/master, trunk
03:07:10
angular displacement units: changed rads to radians check-in: 820a695c45 user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/mtt_txt2m from [1b8f24af39] to [abf1c9f144].

11
12
13
14
15
16
17



18
19
20
21
22
23
24


# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$



# %% Revision 1.11  2000/10/17 09:55:21  peterg
# %% Added logic rep
# %%
# %% Revision 1.10  2000/10/15 09:51:50  peterg
# %% Set array code in input rep
# %%
# %% Revision 1.9  2000/10/13 11:07:33  peterg







>
>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27


# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% Revision 1.12  2000/11/08 11:20:49  peterg
# %% removed the empty matrix stuff
# %%
# %% Revision 1.11  2000/10/17 09:55:21  peterg
# %% Added logic rep
# %%
# %% Revision 1.10  2000/10/15 09:51:50  peterg
# %% Set array code in input rep
# %%
# %% Revision 1.9  2000/10/13 11:07:33  peterg
115
116
117
118
119
120
121


122
123
124
125
126
127
128
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

system=$1
representation=$2
outfile=$1_$2.m



# Inform user
echo Creating $outfile

#Create the rep  file complete with headers.
case $representation in
    input)
      name=mttu







>
>







118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

system=$1
representation=$2
outfile=$1_$2.m

tolower () { tr [A-Z] [a-z] ;}

# Inform user
echo Creating $outfile

#Create the rep  file complete with headers.
case $representation in
    input)
      name=mttu
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239

  if (NF>1)  print statement " # " $2
}' | sed\
     -e 's/\[\([0-9]*\)\]/(\1)/g' \
     -e 's/\([^a-zA-Z_]\)t\([^a-zA-Z_]\)/\1mttt\2/g' \
     -e 's/x(/mttx(/g' \
     -e 's/u(/mttu(/g' \
     -e 's/mttmtt/mtt/g' \
 >> $outfile

if [ -n "$arraycode" ]; then
  new_style=`strip_comments < $1_$2.txt| grep "$name(">/dev/null; echo $?`

  if [ "$new_style" = "1" ]; then
    echo >> $outfile
    echo "  ## Set up the $name vector"  >> $outfile
    ## echo "  $name = []; # Default to empty matrix (Remove in mtt_m2p)"  >> $outfile
    mtt_name2array $1 $arraycode set   >> $outfile
  else
    echo "Old-style file detected: not creating array translations"  
  fi
fi

## Special for logic rep
if [ "$representation" = "logic" ]; then
  echo >> $outfile
  echo "## Open switches" >> $outfile
  switch_txt2m $system >> $outfile
fi

# End of the function
echo '## END Code' >> $outfile
echo 'endfunction' >> $outfile








|


















|





>
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
  if (NF>1)  print statement " # " $2
}' | sed\
     -e 's/\[\([0-9]*\)\]/(\1)/g' \
     -e 's/\([^a-zA-Z_]\)t\([^a-zA-Z_]\)/\1mttt\2/g' \
     -e 's/x(/mttx(/g' \
     -e 's/u(/mttu(/g' \
     -e 's/mttmtt/mtt/g' \
| tolower >> $outfile

if [ -n "$arraycode" ]; then
  new_style=`strip_comments < $1_$2.txt| grep "$name(">/dev/null; echo $?`

  if [ "$new_style" = "1" ]; then
    echo >> $outfile
    echo "  ## Set up the $name vector"  >> $outfile
    ## echo "  $name = []; # Default to empty matrix (Remove in mtt_m2p)"  >> $outfile
    mtt_name2array $1 $arraycode set   >> $outfile
  else
    echo "Old-style file detected: not creating array translations"  
  fi
fi

## Special for logic rep
if [ "$representation" = "logic" ]; then
  echo >> $outfile
  echo "## Open switches" >> $outfile
  switch_txt2m $system | tolower >> $outfile
fi

# End of the function
echo '## END Code' >> $outfile
echo 'endfunction' >> $outfile


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