Overview
Comment:Some debugging lines added.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: a9dfa0341a832d58e40041174dd65bd6ce74019aeba61f93c427fa4ee9a7e806
User & Date: gawthrop@users.sourceforge.net on 1997-08-19 09:41:47
Other Links: branch diff | manifest | tags
Context
1997-08-19
09:49:19
Modified to take account of the expanded vector bonds. Only displays
causality corresponding to the bond connecting the first element of
the vector ports.
check-in: f6a850f6fb user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:41:47
Some debugging lines added. check-in: a9dfa0341a user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1997-08-18
19:39:48
Now generates (exampaded) port_bond list correctely check-in: 34c2407185 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/cbg2fig.m from [1134e48f37] to [073925ade9].

22
23
24
25
26
27
28






29
30
31
32
33
34
35
% Copyright (c) P.J.Gawthrop, 1996.

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






% %% Revision 1.4  1996/12/07  21:34:52  peterg
% %% Tests for null string with strcmp
% %% 
% %% Revision 1.3  1996/08/08  15:52:28  peter
% %% Recursive version.
% %% Fails due to octave bug - reported.
% %%







>
>
>
>
>
>







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
% Copyright (c) P.J.Gawthrop, 1996.

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% 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
% %% 1 --> one
% %%
% %% Revision 1.4  1996/12/07  21:34:52  peterg
% %% Tests for null string with strcmp
% %% 
% %% Revision 1.3  1996/08/08  15:52:28  peter
% %% Recursive version.
% %% Fails due to octave bug - reported.
% %%
89
90
91
92
93
94
95



96
97
98
99
100
101
102
% 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;']);




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

% Check sizes
[N_components,Columns] = size(rcomponents);
if (Columns ~= 13)
  error('Incorrect rcomponents matrix: must have 13 columns');







>
>
>







95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
% 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;']);

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

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

% Check sizes
[N_components,Columns] = size(rcomponents);
if (Columns ~= 13)
  error('Incorrect rcomponents matrix: must have 13 columns');
121
122
123
124
125
126
127
128

129
130
131
132
133
134
135
136
137
138
139
140
arrow_barb = which_end.*other_end_2 + (one-which_end).*other_end_1;
arrow_vector =  arrow_barb-arrow_end;
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

changed_e = bonds(:,1)~=cbonds(:,1);
changed_f = bonds(:,2)~=cbonds(:,2);
changed = changed_e|changed_f;
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

    if cbonds(i,1)==1 % Stroke at arrow end







|
>
|
|
|
|
|







130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
arrow_barb = which_end.*other_end_2 + (one-which_end).*other_end_1;
arrow_vector =  arrow_barb-arrow_end;
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)~=cbonds(1:n_bonds,1)
changed_f = bonds(:,2)~=cbonds(1:n_bonds,2)
changed = changed_e|changed_f
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

    if cbonds(i,1)==1 % Stroke at arrow end


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