Overview
Comment:Fixed cosmetic bugs -- component display
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 4acfbce1bfd038f44303185f4d64bef9ba9cec37006a27ce7e96a3d154156123
User & Date: gawthrop@users.sourceforge.net on 2001-03-23 14:58:16
Other Links: branch diff | manifest | tags
Context
2001-03-24
23:13:56
Declared static functions ((unused)) to eliminate warnings building .oct. check-in: 01eb15b39a user: geraint@users.sourceforge.net tags: origin/master, trunk
2001-03-23
14:58:16
Fixed cosmetic bugs -- component display check-in: 4acfbce1bf user: gawthrop@users.sourceforge.net tags: origin/master, trunk
14:57:31
Now puts space after header fields + writes _port.fig check-in: 40b1df7cf5 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/cbg_m2fig from [b85a89ba68] to [c0cea1fea3].

14
15
16
17
18
19
20



21
22
23
24
25
26
27
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30







+
+
+







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

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.11  2000/12/28 12:19:49  peterg
## *** empty log message ***
##
## Revision 1.10  2000/09/14 12:04:48  peterg
## New 2 parameter version
##
## Revision 1.9  1998/01/23 13:31:23  peterg
## $RMATRIX --> $MATRIX
##
## Revision 1.8  1996/12/07 19:23:07  peterg
60
61
62
63
64
65
66
67

68
69
70
71
72
73
74
63
64
65
66
67
68
69

70
71
72
73
74
75
76
77







-
+







# (ls $1_*_cbg.m \
# | sed 's/\(.*_\)\(.*_\)cbg.m/cp \2fig.fig \1\2cbg.fig/' \
#| sh ) 2>mtt_error.txt

#sh $1_type.sh 'cp ' '_fig.fig ' '_cbg.fig'> mtt_error.txt

# Copy the unchaging part of the figure file
cp $1_fig.fig $2_cbg.fig
cat $1_head.fig $1_port.fig $1_bnd.fig> $2_cbg.fig

#Inform user
echo Creating $2_cbg.fig -- component type $1

# Use  matrix manipulation to accomplish the transformation
$MATRIX   <<EOF  2>mtt_error.txt > cbg_m2fig.log

Modified mttroot/mtt/bin/trans/m/cbg2fig.m from [cbb4e19511] to [040a608b2a].

20
21
22
23
24
25
26



27
28
29
30
31
32
33
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36







+
+
+







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

  ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  ## %% Version control history
  ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  ## %% $Id$
  ## %% $Log$
  ## %% Revision 1.15  2001/03/23 11:20:20  gawthrop
  ## %% Fixed bug with vector components --NB takes geometric info from _rbg.fig
  ## %%
  ## %% Revision 1.14  2000/09/14 12:07:15  peterg
  ## %% Fixed overwriting of ports.
  ## %%
  ## %% Revision 1.13  2000/09/14 09:12:19  peterg
  ## %% Fixed stroke orientation bug with bent bonds
  ## %% Uses new info from the _rbg.m file - 4 new cols in rbonds
  ## %%
245
246
247
248
249
250
251



252
253
254
255
256
257
258
259
260









261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284


285



286




287
288
289
290
291
292
293
248
249
250
251
252
253
254
255
256
257









258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281

282
283
284
285
286
287
288

289
290
291
292
293
294

295
296
297
298
299
300
301
302
303
304
305







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















-







-
+
+

+
+
+
-
+
+
+
+







    end;
  end;

  ## Print all the components - coloured acording to causality.
  ## Miss out the ports
  
  for i = N_rports+1:N_rcomponents
    eval(['[comp_type,comp_name] = ', system_type, '_cmp(i);']);
    eval(["comp_status = CBG.subsystems.", comp_name, ".status;"]);

    if i>N_ports			# Subsystem
      comp_name = CBG.subsystemlist(i-N_ports,:);
      eval(["comp_status = CBG.subsystems.", comp_name, ".status;"]);
    else
      comp_name = CBG.portlist(i,:);
      eval(["comp_status = CBG.ports.", comp_name, ".status;"]);
    end
    
   i,comp_name,N_rcomponents,N_rports
#     if i>N_rports			# Subsystem
#       comp_name = CBG.subsystemlist(i-N_rports,:);
#       eval(["comp_status = CBG.subsystems.", comp_name, ".status;"]);
#     else
#       comp_name = CBG.portlist(i,:);
#       eval(["comp_status = CBG.ports.", comp_name, ".status;"]);
#     end

    
    fig_params = rcomponents(i,3:M_components);
    coords = rcomponents(i,1:2);
    
    if comp_status==-1		# Then under causal
      fig_params(3) = comp_colour_u;
      fig_params(6) = comp_font;
    end;

    if comp_status==1		# Then over causal
      fig_params(3) = comp_colour_o;
      fig_params(6) = comp_font;
    end;


    ## Now print the component in fig format
    eval(['[comp_type,comp_name] = ', system_type, '_cmp(i);']);
    
    if index(comp_name,"mtt")==1 # Its a dummy name
      typename = comp_type;	# just show type
    else
      typename = [comp_type,":",comp_name];
    endif;

    Terminator = [bs, '001'];   
    Terminator = [bs, '001'];  
    real_index = 8;
    for j = 1:length(fig_params)
      if j==real_index
	fprintf(filenum, '%2.4f ', fig_params(j));
      else
      fprintf(filenum, '%1.0f ', fig_params(j));
	fprintf(filenum, '%i ', fig_params(j));
      endif
      

    endfor
    
    

    fprintf(filenum, '%1.0f %1.0f ', coords(1), coords(2)); 
    fprintf(filenum, '%s%s\n', typename, Terminator);


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