Overview
Comment:Added warning if a component has no bonds.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 0ad47fec520f94fe24593c5ffef917dc05871b07077113768bb172ec601840c4
User & Date: gawthrop@users.sourceforge.net on 1997-09-16 15:14:14
Other Links: branch diff | manifest | tags
Context
1997-09-18
13:15:15
Fixed incorrect error message flagging inappropriate flow outputs
-- used to give the effort rather than the flow in the error message.
check-in: 894128874b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1997-09-16
15:14:14
Added warning if a component has no bonds. check-in: 0ad47fec52 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
14:56:07
Initial revision check-in: 6b86b5a8da user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/rbg2abg.m from [8751eebb58] to [d8d9ef6887].

1
2
3
4
5
6
7



8
9
10
11
12
13
14
function [bonds,components] = rbg2abg(name,rbonds,rstrokes,rcomponents,port_coord,port_name,infofile)

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$



% %% Revision 1.19  1997/08/14  11:59:47  peterg
% %% Vector ports added!!
% %%
% %% Revision 1.18  1997/08/14  11:01:42  peterg
% %% Reordered algorithms as follows:
% %% bond end coordinates
% %% associate port labels with bonds (port_bond)







>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function [bonds,components] = rbg2abg(name,rbonds,rstrokes,rcomponents,port_coord,port_name,infofile)

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.20  1997/08/18  19:39:48  peterg
% %% Now generates (exampaded) port_bond list correctely
% %%
% %% Revision 1.19  1997/08/14  11:59:47  peterg
% %% Vector ports added!!
% %%
% %% Revision 1.18  1997/08/14  11:01:42  peterg
% %% Reordered algorithms as follows:
% %% bond end coordinates
% %% associate port labels with bonds (port_bond)
154
155
156
157
158
159
160



161
162





163
164
165
166
167
168
169

% We now have a list (comp_near_bond) of the component(s) at each end
% of each bond

% Now do a list of the bonds on each component - unsorted at this stage.
components = [];
for i = 1:n_components



  % There are n_comp_bonds bonds on this component with corresponding index
  [index,n_comp_bonds] = getindex(comp_near_bond,i);





  
  % Create the signed list of bonds on this component
  one = ones(n_comp_bonds,1);
  bond_list = index(:,1); %  bond at component
  bond_end = index(:,2);  % which end of bond at component?
  direction = -sign(bond_end-1.5*one);
  signed_bond_list = bond_list.*direction;







>
>
>


>
>
>
>
>







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

% We now have a list (comp_near_bond) of the component(s) at each end
% of each bond

% Now do a list of the bonds on each component - unsorted at this stage.
components = [];
for i = 1:n_components
  %Get component type
  eval(['[comp_type, comp_name] = ', name, '_cmp(i)']);

  % There are n_comp_bonds bonds on this component with corresponding index
  [index,n_comp_bonds] = getindex(comp_near_bond,i);

  if index(1,1)==0
    mtt_info(sprintf("Component %s (%s) has no bonds", comp_name,
    comp_type),infofile);
  end;
  
  % Create the signed list of bonds on this component
  one = ones(n_comp_bonds,1);
  bond_list = index(:,1); %  bond at component
  bond_end = index(:,2);  % which end of bond at component?
  direction = -sign(bond_end-1.5*one);
  signed_bond_list = bond_list.*direction;


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