Differences From Artifact [bfcc0cd3fd]:

To Artifact [9ac520a74a]:


1
2
3
4
5
6
7



8
9
10
11
12
13
14
function write_cbg(system_name,system_type,system,Flipped)

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



## Revision 1.2  1998/08/25 06:21:19  peterg
## Just writes additional information; basic info from the abg structure.
##
## Revision 1.1  1998/08/25 05:55:10  peterg
## Initial revision
##
###############################################################







>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function write_cbg(system_name,system_type,system,Flipped)

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.3  1998/08/25 20:05:33  peterg
## Write flipped port info
##
## Revision 1.2  1998/08/25 06:21:19  peterg
## Just writes additional information; basic info from the abg structure.
##
## Revision 1.1  1998/08/25 05:55:10  peterg
## Initial revision
##
###############################################################
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
      fprintf(fid,"%i ", system.bonds(i,j));
    endfor;
    fprintf(fid,"\n");
  endfor;
  fprintf(fid,"      ];\n");

  [N,M]=size(Flipped.ports);
  if N>0
    fprintf(fid,"\n# Flipped port information\n");
    for i=1:N
      name=deblank(Flipped.ports(i,:));
      eval(["con = system.ports.",name,".connections;"]);
      fprintf(fid,Iformat,system_name,"ports",name,1,con);
    endfor;
  endif;

  [N,M]=size(Flipped.subs);
  if N>0
    for i=1:N
      name=deblank(Flipped.subs(i,:));
      k=Flipped.cons(i);
      eval(["con = system.subsystems.",name,".connections(",num2str(k),");"]);
      fprintf(fid,Iformat,system_name,"subsystems",name,k,con);
    endfor;
  endif;

  fclose(fid);
  








|









|











53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
      fprintf(fid,"%i ", system.bonds(i,j));
    endfor;
    fprintf(fid,"\n");
  endfor;
  fprintf(fid,"      ];\n");

  [N,M]=size(Flipped.ports);
  if (N>0)&&(M>0)		# Flipped ports exist
    fprintf(fid,"\n# Flipped port information\n");
    for i=1:N
      name=deblank(Flipped.ports(i,:));
      eval(["con = system.ports.",name,".connections;"]);
      fprintf(fid,Iformat,system_name,"ports",name,1,con);
    endfor;
  endif;

  [N,M]=size(Flipped.subs);
  if (N>0)&&(M>0)		# Flipped subs exist
    for i=1:N
      name=deblank(Flipped.subs(i,:));
      k=Flipped.cons(i);
      eval(["con = system.subsystems.",name,".connections(",num2str(k),");"]);
      fprintf(fid,Iformat,system_name,"subsystems",name,k,con);
    endfor;
  endif;

  fclose(fid);
  


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