Overview
Comment:Fixed bug in port labelling for vector junctions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 0da72471c7063f82a940d52be44271d801e5f855183551068cad95ea4738f624
User & Date: geraint@users.sourceforge.net on 2005-02-18 18:43:52
Other Links: branch diff | manifest | tags
Context
2005-02-21
17:39:25
Fixed vector junctions. check-in: d148584101 user: geraint@users.sourceforge.net tags: origin/master, trunk
2005-02-18
18:43:52
Fixed bug in port labelling for vector junctions. check-in: 0da72471c7 user: geraint@users.sourceforge.net tags: origin/master, trunk
17:50:53
More helpful error message for vector bond matching. check-in: 45671deeac user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/ibg2abg.m from [781ceb84d9] to [a1f16d2e04].

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154


155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179

	## component is a junction
	n_named_ports = 0;
	
	## get labelled ports
	for [bond, bond_name] = comp
	  if (index(bond_name, "bond") == 1)
	    if (! exist("bond.label"))
	      bond.label = "[]";
	    endif
	    if (! strcmp(bond.label, "[]"))
	      n_named_ports += 1;
	      port_label = bond.label;
	    endif
	  endif
	  eval(sprintf("comp.%s = bond;", bond_name));
	endfor
	
	## attach labels to unlabelled ports
	if (n_named_ports == 0)


	  for [bond, bond_name] = comp
	    if (index(bond_name, "bond") == 1)
	      bond.label = "in";
	    endif
	    eval(sprintf("comp.%s = bond;", bond_name));
	  endfor
	elseif (n_named_ports == 1)
	  mtt_info(sprintf("Defaulting all ports on junction %s to %s", \
			   comp_name, port_label), infofile);
	  for [bond, bond_name] = comp
	    if (index(bond_name, "bond") == 1)
	      bond.label = port_label;
	    endif
	    eval(sprintf("comp.%s = bond;", bond_name));
	  endfor
	elseif (n_named_ports != bond.n_bonds)
	  mtt_error(sprintf("Junction must have 0,1 or %i port labels", \
			    n_bonds), errorfile);
	endif
	
      else
	## component is not a junction
	for [bond, bond_name] = comp
	  if (index(bond_name, "bond") == 1)
	    if (strcmp(bond.label, "[]"))







|
|











>
>















|

|







135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181

	## component is a junction
	n_named_ports = 0;
	
	## get labelled ports
	for [bond, bond_name] = comp
	  if (index(bond_name, "bond") == 1)
	    if (! isfield (bond, "label"))
	      bond.label = "[]"
	    endif
	    if (! strcmp(bond.label, "[]"))
	      n_named_ports += 1;
	      port_label = bond.label;
	    endif
	  endif
	  eval(sprintf("comp.%s = bond;", bond_name));
	endfor
	
	## attach labels to unlabelled ports
	if (n_named_ports == 0)
	  mtt_info(sprintf("Defaulting all ports on junction %s to 'in'", \
			   comp_name), infofile);
	  for [bond, bond_name] = comp
	    if (index(bond_name, "bond") == 1)
	      bond.label = "in";
	    endif
	    eval(sprintf("comp.%s = bond;", bond_name));
	  endfor
	elseif (n_named_ports == 1)
	  mtt_info(sprintf("Defaulting all ports on junction %s to %s", \
			   comp_name, port_label), infofile);
	  for [bond, bond_name] = comp
	    if (index(bond_name, "bond") == 1)
	      bond.label = port_label;
	    endif
	    eval(sprintf("comp.%s = bond;", bond_name));
	  endfor
	elseif (n_named_ports != comp.n_bonds)
	  mtt_error(sprintf("Junction must have 0,1 or %i port labels", \
			    comp.n_bonds), errorfile);
	endif
	
      else
	## component is not a junction
	for [bond, bond_name] = comp
	  if (index(bond_name, "bond") == 1)
	    if (strcmp(bond.label, "[]"))


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