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: 4887bf8185324c6a663dd240919d048fae7547e3a4ab091b7cbb647bf4bc9dd1
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: 34a1be3dea 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: 4887bf8185 user: geraint@users.sourceforge.net tags: origin/master, trunk
17:50:53
More helpful error message for vector bond matching. check-in: 0822372481 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 ]