Differences From Artifact [10e2dbaa4d]:

To Artifact [42eed27966]:


27
28
29
30
31
32
33



34
35
36
37
38
39
40

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



% %% 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
% %% systems
% %%







>
>
>







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

			
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% 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
% %% systems
% %%
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130

if (strcmp(cr,"SS"))		# Then its the standard file
  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,:);
  end;
else				# Old style file
  effort_attribute = cr;
  flow_attribute = args;
				# mtt_info(sprintf("SS component: Hmm... looks like an old-style label file"));
end;








|
|







118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133

if (strcmp(cr,"SS"))		# Then its the standard file
  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 = 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"));
end;

208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
	end;
      end;
    end;
    
    % Flow
    if strcmp(flow_attribute, "external")
      if bonds(1,2)==1 % Source
	inputs = inputs+1;
	fprintf(filenum, "%s := MTTu(%d,1);\n", varname(sname, bond_number,-1),inputs);
      else % Sensor
	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;
      fprintf(filenum, "%s := MTTUi%d;\n", ...
	      varname(sname, bond_number,-1), unknown_inputs);
    elseif strcmp(flow_attribute, "internal")
      % Do nothing
    else % Named constant
      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;
	  fprintf(filenum, "MTTyz%d := %s;\n", ...
		  zero_outputs, varname(sname, bond_number,-1));
	else
	  mtt_error([flow_attribute, " not appropriate for an output "]);
	end;
      end;
    end;







|


|




|










|







211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
	end;
      end;
    end;
    
    % Flow
    if strcmp(flow_attribute, "external")
      if bonds(1,2)==1 % Source
	inputs = inputs+1
	fprintf(filenum, "%s := MTTu(%d,1);\n", varname(sname, bond_number,-1),inputs);
      else % Sensor
	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
      fprintf(filenum, "%s := MTTUi%d;\n", ...
	      varname(sname, bond_number,-1), unknown_inputs);
    elseif strcmp(flow_attribute, "internal")
      % Do nothing
    else % Named constant
      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
	  fprintf(filenum, "MTTyz%d := %s;\n", ...
		  zero_outputs, varname(sname, bond_number,-1));
	else
	  mtt_error([flow_attribute, " not appropriate for an output "]);
	end;
      end;
    end;

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