Index: mttroot/mtt/bin/trans/cbg_m2fig ================================================================== --- mttroot/mtt/bin/trans/cbg_m2fig +++ mttroot/mtt/bin/trans/cbg_m2fig @@ -16,10 +16,13 @@ ############################################################### ## 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 @@ -62,11 +65,11 @@ #| 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 Index: mttroot/mtt/bin/trans/m/cbg2fig.m ================================================================== --- mttroot/mtt/bin/trans/m/cbg2fig.m +++ mttroot/mtt/bin/trans/m/cbg2fig.m @@ -22,10 +22,13 @@ ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ## %% 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 @@ -247,19 +250,22 @@ ## Print all the components - coloured acording to causality. ## Miss out the ports for i = N_rports+1:N_rcomponents - 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 + eval(['[comp_type,comp_name] = ', system_type, '_cmp(i);']); + eval(["comp_status = CBG.subsystems.", comp_name, ".status;"]); + +# 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; @@ -271,21 +277,27 @@ 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) - fprintf(filenum, '%1.0f ', fig_params(j)); + if j==real_index + fprintf(filenum, '%2.4f ', fig_params(j)); + else + fprintf(filenum, '%i ', fig_params(j)); + endif + + endfor fprintf(filenum, '%1.0f %1.0f ', coords(1), coords(2));