Overview
Comment:Made "lin" default in place of "none"
Still needs arg and cr alias clashes to be sorted ....
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: d689652e81aba3a98f062b843424876e123791a056bc51c363c8dce8d50d4ea9
User & Date: gawthrop@users.sourceforge.net on 2001-06-13 18:24:10
Other Links: branch diff | manifest | tags
Context
2001-07-03
22:59:10
Fixed problems with argument passing for CRs check-in: e16dcf0ecb user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2001-06-13
18:24:10
Made "lin" default in place of "none"
Still needs arg and cr alias clashes to be sorted ....
check-in: d689652e81 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
17:10:26
Alias for the cr (ie %ALIAS $1 lin) check-in: b0f39398c4 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/abg2lbl_fig2txt from [2aec5bf1c2] to [dba6ba8fd1].

9
10
11
12
13
14
15




16
17
18
19
20
21
22
# Acausal bond graph to causal bond graph: mfile format

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




## Revision 1.16  2001/06/11 19:43:49  gawthrop
## MTT is now much more sophisticated in generating lbl files
## Labels can contain maths
## Repetative components are now broken
##
## Revision 1.15  2001/06/11 16:53:49  gawthrop
## Now uses abg2sympar_m2txt to get the arguments







>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Acausal bond graph to causal bond graph: mfile format

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.17  2001/06/13 10:41:06  gawthrop
## Further changes towards aouto creation of lbl files.
## Prettified lbl files
##
## Revision 1.16  2001/06/11 19:43:49  gawthrop
## MTT is now much more sophisticated in generating lbl files
## Labels can contain maths
## Repetative components are now broken
##
## Revision 1.15  2001/06/11 16:53:49  gawthrop
## Now uses abg2sympar_m2txt to get the arguments
143
144
145
146
147
148
149

150
151
152
153
154
155
156
#diff $1_unique_raw_list  $1_raw_list | grep '>' | sed 's/>/	/'

#Write out the outline lbl file
grep -v  '\[[0-9]*\]'  $1_unique_raw_list | \
awk --field-separator ':' '
 BEGIN {
    OldComponent="None";

 }
 { 
  Component = $1;
  Name = $2;
  Arg = $3;

##Aliases







>







147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#diff $1_unique_raw_list  $1_raw_list | grep '>' | sed 's/>/	/'

#Write out the outline lbl file
grep -v  '\[[0-9]*\]'  $1_unique_raw_list | \
awk --field-separator ':' '
 BEGIN {
    OldComponent="None";
    default_cr = "lin";
 }
 { 
  Component = $1;
  Name = $2;
  Arg = $3;

##Aliases
203
204
205
206
207
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
    ## Put in the explicit arguments
    if (length(Arg)>0) {
      arg[Component] = Arg;
      if (match(Arg,"=")>0) # Its an equation type cr
        cr[Component] = "cr"
      else # assume a linear cr
        cr[Component] = "lin";

    }
  ## Heading
  if (Component !~ OldComponent) print "\n## Component type", Component

  ## Component
    printf("\t%s\t", Name);
    if (Component in cr)
      printf("%s\t\t", cr[Component])
    else 
      printf("none\t\t");

   if (Component in arg)
      printf("%s\t\t\n", arg[Component])
    else {
	print "lbl2args_txt2out", Component | "/bin/sh"; close("/bin/sh")
    }

    OldComponent=Component;


  }
  END{
    print "\n## Port aliases" >> "mtt_junk_alias.txt";
    for (k=1;k<=j;k++){
      if (port_alias[k] ~ "\\["){ # Only do ports
        port_name = substr(port_alias[k],2,length(port_alias[k])-2);
        if (length(sensitivity)==0)







|
|








|








>
>







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
240
241
242
    ## Put in the explicit arguments
    if (length(Arg)>0) {
      arg[Component] = Arg;
      if (match(Arg,"=")>0) # Its an equation type cr
        cr[Component] = "cr"
      else # assume a linear cr
        cr[Component] = "lin";
    }

  ## Heading
  if (Component !~ OldComponent) print "\n## Component type", Component

  ## Component
    printf("\t%s\t", Name);
    if (Component in cr)
      printf("%s\t\t", cr[Component])
    else 
      printf("%s\t\t",default_cr);

   if (Component in arg)
      printf("%s\t\t\n", arg[Component])
    else {
	print "lbl2args_txt2out", Component | "/bin/sh"; close("/bin/sh")
    }

    OldComponent=Component;
    delete arg[Component]; # Zap the element
    delete cr[Component]; # Zap the element
  }
  END{
    print "\n## Port aliases" >> "mtt_junk_alias.txt";
    for (k=1;k<=j;k++){
      if (port_alias[k] ~ "\\["){ # Only do ports
        port_name = substr(port_alias[k],2,length(port_alias[k])-2);
        if (length(sensitivity)==0)


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