Overview
Comment:Don't do strokes on port bonds
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: cc595a7941d063b18da22c81cb917b479969fb79bca9495a14e11e81b09a0782
User & Date: gawthrop@users.sourceforge.net on 1998-04-04 10:45:01
Other Links: branch diff | manifest | tags
Context
1998-04-04
10:46:37
Coerces port bonds to have smae direction as the imposing bonds
_cbg now generates the (coerced) components as welll as the (coerced)
causality.
check-in: 52853415b7 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
10:45:01
Don't do strokes on port bonds check-in: cc595a7941 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
07:29:26
SS now only port component check-in: a6112d8506 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/cbg2fig.m from [22dbce3f2d] to [e41c48b167].

22
23
24
25
26
27
28





29
30
31
32
33
34
35
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40







+
+
+
+
+







% Copyright (c) P.J.Gawthrop, 1996.

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.7  1997/08/19 09:49:19  peterg
% %% Modified to take account of the expanded vector bonds. Only displays
% %% causality corresponding to the bond connecting the first element of
% %% the vector ports.
% %%
% %% Revision 1.6  1997/08/19 09:41:47  peterg
% %% Some debugging lines added.
% %%
% %% Revision 1.5  1997/05/16  07:33:45  peterg
% %% Now checks to see if sub system is a simple component before
% %% recursion.
% %% 0 --> zero
96
97
98
99
100
101
102
103

104
105
106
107
108
109
110
101
102
103
104
105
106
107

108
109
110
111
112
113
114
115







-
+







end;

% Setup file - append to the fig file
filenum = fopen(fig_name, 'a');

% Get the raw and the processed bonds
eval(['[rbonds,rstrokes,rcomponents] = ', system_type, '_rbg;']);
eval(['[bonds] = ', system_type, '_abg;']);
eval(['[bonds,components,n_ports] = ', system_type, '_abg;']);

% Original number of bonds
[n_bonds,junk] = size(rbonds);

% Get the causal bonds
eval(['[cbonds,status]=', full_name, '_cbg;']);

135
136
137
138
139
140
141
142
143
144











145
146
147
148
149
150
151
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







-
-
-
+
+
+
+
+
+
+
+
+
+
+







unit_arrow_vector = arrow_vector./(length2d(arrow_vector)*[1 1]);
bond_vector = (arrow_end - other_end);
unit_bond_vector = bond_vector./(length2d(bond_vector)*[1 1]);
unit_stroke_vector = (rot*unit_bond_vector')';
  
% Get indices of bonds with changed causality -- but ignore the extra bonds
% due to vector bond expansion
changed_e = bonds(1:n_bonds,1)~=cbonds(1:n_bonds,1)
changed_f = bonds(1:n_bonds,2)~=cbonds(1:n_bonds,2)
changed = changed_e|changed_f
changed_e = bonds(1:n_bonds,1)~=cbonds(1:n_bonds,1);
changed_f = bonds(1:n_bonds,2)~=cbonds(1:n_bonds,2);
changed = changed_e|changed_f;
% Don't do port bonds
if n_ports>0
  port_bonds = sort(abs(components(1:n_ports,1)));
  changed(port_bonds) = zeros(n_ports,1);
  changed_e(port_bonds) = zeros(n_ports,1);
  changed_f(port_bonds) = zeros(n_ports,1);
end

index_e  = getindex(changed_e,1)'
index_f  = getindex(changed_f,1)'
index  = getindex(changed,1)';

% Print the new strokes in fig format
if index(1,1)>0
  for i = index_e % Do the effort stroke - opp. side to arrow


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