Differences From Artifact [b7c5c6ac25]:

To Artifact [43595fcf36]:


1
2
3
4
5
6
7



8
9
10
11
12
13
14
function write_abg(system_name,bonds,connections);

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



## Revision 1.1  1998/08/25 06:22:02  peterg
## Initial revision
##
###############################################################


  fid=fopen([system_name,"_abg.m"], "w");







>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function write_abg(system_name,bonds,connections);

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.2  1998/08/26 11:59:20  peterg
## Don't use strrep to remove[]
##
## Revision 1.1  1998/08/25 06:22:02  peterg
## Initial revision
##
###############################################################


  fid=fopen([system_name,"_abg.m"], "w");
28
29
30
31
32
33
34




35
36
37
38
39
40
41

  
  fprintf(fid,"\n# Subsystems and Ports\n");
  i_port=0;
  for i=1:N
    eval(["[comp_type, name, cr, arg, repetitions] = ", system_name, "_cmp(i);"]);





    
    if index(name,"[")==0	# Not a port
      fprintf(fid,"\n# Component %s\n", name);
      fprintf(fid,Sformat,system_name,name,"type",comp_type);
      fprintf(fid,Sformat,system_name,name,"cr",cr);
      fprintf(fid,Sformat,system_name,name,"arg",arg);
      fprintf(fid,Iformat,system_name,name,"repetitions",repetitions);







>
>
>
>







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

  
  fprintf(fid,"\n# Subsystems and Ports\n");
  i_port=0;
  for i=1:N
    eval(["[comp_type, name, cr, arg, repetitions] = ", system_name, "_cmp(i);"]);

    ch=name(1);			# First char of name
    if (ch>="0")&&(ch<="9")	# Its a numeral
      name=["mtt",name];	# prefix by mtt
    endif;
    
    if index(name,"[")==0	# Not a port
      fprintf(fid,"\n# Component %s\n", name);
      fprintf(fid,Sformat,system_name,name,"type",comp_type);
      fprintf(fid,Sformat,system_name,name,"cr",cr);
      fprintf(fid,Sformat,system_name,name,"arg",arg);
      fprintf(fid,Iformat,system_name,name,"repetitions",repetitions);

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