Overview
Comment:Added error message if port label near to >1 bond.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 655583a1e537fe1b66bd1b26cf312fda9ae78a7bbe97a6edfcf2bd7e61b3c1fa
User & Date: gawthrop@users.sourceforge.net on 1997-04-29 09:12:37
Other Links: branch diff | manifest | tags
Context
1997-05-01
07:35:48
Initial revision check-in: ad3b9d6d0f user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1997-04-29
09:12:37
Added error message if port label near to >1 bond. check-in: 655583a1e5 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1997-04-23
07:26:49
Added -o switch -- ode and dae are the same
Added switches to default menu
check-in: 645d1d2c5c user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/rbg2abg.m from [3130b73565] to [deb6ad7165].

1
2
3
4
5
6
7



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

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



% %% Revision 1.9  1996/12/31  11:25:57  peterg
% %% Clearer error messages for incorrect ports.
% %%
% %% Revision 1.8  1996/12/04 21:52:39  peterg
% %% Now uses fopen.
% %%
% %% Revision 1.7  1996/11/01 18:01:57  peterg







>
>
>







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

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.10  1997/03/17  13:45:42  peterg
% %% Added more error info.
% %%
% %% Revision 1.9  1996/12/31  11:25:57  peterg
% %% Clearer error messages for incorrect ports.
% %%
% %% Revision 1.8  1996/12/04 21:52:39  peterg
% %% Now uses fopen.
% %%
% %% Revision 1.7  1996/11/01 18:01:57  peterg
79
80
81
82
83
84
85

86






87
88
89
90
91
92
93
94
arrow_vector = ( which_end.*other_end_2 + (one-which_end).*other_end_1 ) - ...
    arrow_end;
 
% Locate the bond end nearest to each port
% col 1 of port_near_bond contains a signed bond number (+ for arrow end)
% col 2  of port_near_bond contains the corresponding port number
for i = 1:n_ports

  near_bond = adjbond(rports(i,1:2),arrow_end,other_end);






  signed_bond = near_bond(1)*sign(1.5-near_bond(2))
  port_near_bond(i,:) = [signed_bond, rports(i,3)];
end;

% Locate the components at the ends of each bond
% col 1 of comp_near_bond contain the component nearest to the arrow end
% col 2 of comp_near_bond contain the component nearest to the other end
for i = 1:n_bonds







>
|
>
>
>
>
>
>
|







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
arrow_vector = ( which_end.*other_end_2 + (one-which_end).*other_end_1 ) - ...
    arrow_end;
 
% Locate the bond end nearest to each port
% col 1 of port_near_bond contains a signed bond number (+ for arrow end)
% col 2  of port_near_bond contains the corresponding port number
for i = 1:n_ports
   [i rports(i,1:2)/scale rports(i,3)]
   near_bond = adjbond(rports(i,1:2),arrow_end,other_end)
   [rows,cols]=size(near_bond);
   if rows>1
     error(sprintf ...
	 ("A port is near to more than one bond at coordinates %g,%g\n", ...
	 rports(i,1)/scale,  rports(i,2)/scale));
   end;
  signed_bond = near_bond(1)*sign(1.5-near_bond(2));
  port_near_bond(i,:) = [signed_bond, rports(i,3)];
end;

% Locate the components at the ends of each bond
% col 1 of comp_near_bond contain the component nearest to the arrow end
% col 2 of comp_near_bond contain the component nearest to the other end
for i = 1:n_bonds


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