Index: mttroot/mtt/lib/comp/simple/SS_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/SS_eqn.m +++ mttroot/mtt/lib/comp/simple/SS_eqn.m @@ -29,10 +29,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.22 1998/07/28 19:05:46 peterg +% %% Fixed a few bugs. +% %% % %% Revision 1.21 1998/07/28 14:21:31 peterg % %% Vector SS ports. % %% % %% Revision 1.20 1998/07/08 14:42:52 peterg % %% Removed the annoying info message - it causes problems with big @@ -117,12 +120,12 @@ a = split(args,","); [N,M]=size(a); if (N~=2) # Must have 2 arguments mtt_error(sprintf("SS should have 2 args not %i", N)); else - effort_attribute = a(1,:); - flow_attribute = a(2,:); + effort_attribute = deblank(a(1,:)); + flow_attribute = deblank(a(2,:)); end; else # Old style file effort_attribute = cr; flow_attribute = args; # mtt_info(sprintf("SS component: Hmm... looks like an old-style label file")); @@ -210,19 +213,19 @@ end; % Flow if strcmp(flow_attribute, "external") if bonds(1,2)==1 % Source - inputs = inputs+1; + inputs = inputs+1 fprintf(filenum, "%s := MTTu(%d,1);\n", varname(sname, bond_number,-1),inputs); else % Sensor - outputs = outputs+1; + outputs = outputs+1 fprintf(filenum, "MTTy(%d,1) := %s;\n", outputs, ... varname(sname, bond_number,-1)); end; elseif strcmp(flow_attribute, "unknown") % Unknown input - unknown_inputs = unknown_inputs + 1; + unknown_inputs = unknown_inputs + 1 fprintf(filenum, "%s := MTTUi%d;\n", ... varname(sname, bond_number,-1), unknown_inputs); elseif strcmp(flow_attribute, "internal") % Do nothing else % Named constant @@ -229,11 +232,11 @@ if bonds(1,2)==1 % Source fprintf(filenum, "%s := %s;\n", ... varname(sname, bond_number,-1), flow_attribute); else % Sensor if strcmp(flow_attribute, "zero") %Zero output - zero_outputs = zero_outputs + 1; + zero_outputs = zero_outputs + 1 fprintf(filenum, "MTTyz%d := %s;\n", ... zero_outputs, varname(sname, bond_number,-1)); else mtt_error([flow_attribute, " not appropriate for an output "]); end;