Differences From Artifact [c42598280f]:

To Artifact [e3b347e99b]:


1
2
3
4
5
6
7



8
9
10
11
12
13
14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17







+
+
+







function write_abg(system_name,bonds,connections,n_vector_bonds);

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.8  1999/10/18 22:41:41  peterg
## Corrected vector junction expansion
##
## Revision 1.7  1999/10/18 05:16:51  peterg
## Now vectorises 0 and 1 junctions !!
##
## Revision 1.6  1998/09/02 11:35:20  peterg
## Removed port.index field
##
## Revision 1.5  1998/09/02 10:30:30  peterg
76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
79
80
81
82
83
84
85

86
87
88
89
90
91
92
93







-
+







	SubsystemList = [SubsystemList; new_name];
	fprintf(fid,"\n# Component %s\n", new_name);
	fprintf(fid,Sformat,system_name,new_name,"type",comp_type);
	fprintf(fid,Sformat,system_name,new_name,"cr",cr);
	fprintf(fid,Sformat,system_name,new_name,"arg",arg);
	fprintf(fid,Iformat,system_name,new_name,"repetitions",repetitions);
	fprintf(fid,Iformat,system_name,new_name,"status",-1);
	

	##Connections
	fprintf(fid,Cformat,system_name,new_name);
	## Each vector junction has n*m bonds
	## n - dimension of vector
	## m - number of bonds
	
	## The first m bonds (in c) correspond to the first vector element
127
128
129
130
131
132
133

134
135
136
137
138
139
140
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144







+







	fprintf(fid,PSformat,system_name,name_i,"arg",arg);
	fprintf(fid,PIformat,system_name,name_i,"repetitions",repetitions);
	fprintf(fid,PIformat,system_name,name_i,"status",-1);
	
	fprintf(fid,PCformat,system_name,name_i);
      	fprintf(fid,"%i ", c(i_port));
	fprintf(fid,"];\n");

      endfor;
    endif;
  endfor;

  [N,M]=size(PortList);
  if N>0			# Put name in list
    fprintf(fid,"\n# Ordered list of Port names\n");
168
169
170
171
172
173
174









175
176
177
178
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191







+
+
+
+
+
+
+
+
+




  fprintf(fid,"# A double underscore __ represents a comma \n");
  eval(["alias = ", system_name, "_alias;"]);
  if is_struct(alias)
    for [val,key] = alias
      fprintf(fid,"%s.alias.%s = \"%s\";\n", system_name,key,val);
    endfor
  endif

  fprintf(fid,"\n# Interface Definition\n");
  eval(["icd = ",system_name, "_icd;"]);
  if is_struct(icd)
    for [val,key] = icd
      fprintf(fid,"%s.icd.%s = \"%s\";\n",system_name,key,val);
    endfor
  endif
	

  fclose(fid);
  


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