Overview
Comment:Explicit computation of port number -- avoids str2num
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: a63ef50a6afa2d5f29689b0e92eb2a7eda5fb7c81f71f94d6104d2c49a381db9
User & Date: gawthrop@users.sourceforge.net on 1997-05-09 08:21:07.000
Other Links: branch diff | manifest | tags
Context
1997-05-09
09:18:45
Put ./ in front of a.out (again) check-in: 7af1b5e5c1 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
08:21:07
Explicit computation of port number -- avoids str2num check-in: a63ef50a6a user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1997-05-06
13:54:21
Changed gcc arguments for the ode simulation -- all files now included
in the _odes.c file
check-in: 9684c7989e user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes
15
16
17
18
19
20
21



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







+
+
+








			
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.10  1997/03/22  17:13:03  peterg
% %% Fixed bug for port nos. > 1 digit!
% %%
% %% Revision 1.9  1997/03/22  15:50:59  peterg
% %% Changed %1.0f to %d format.
% %%
% %% Revision 1.8  1996/12/10 16:52:29  peterg
% %% Detect null string using strcmp, not length.
% %% Put filnum argument to mtt_info.
% %%
77
78
79
80
81
82
83
84









85
86
87
88
89
90
91
80
81
82
83
84
85
86

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102







-
+
+
+
+
+
+
+
+
+







inputs = structure(3);
outputs = structure(4);
zero_outputs = structure(5);

if strcmp(effort_attribute, 'MTT_port') % Its a numbered port
  % Convert string to number
  % port_number = abs(flow_attribute)-abs('0');
  port_number = str2num(flow_attribute);
  %port_number = str2num(flow_attribute);

  %Compute port number
  str_port_number = flow_attribute;
  N_string = length(str_port_number);
  port_number=0;
  for i=1:N_string
    port_number = 10*port_number + abs(str_port_number(i))-abs('0');
  end;

  % Effort 
  if bonds(1,1)==-1 % Source
    fprintf(filenum, '%s := %s_MTTu%d;\n', ...
        varname(name, bond_number,1), name, port_number);
  else % Sensor
    fprintf(filenum, '%s_MTTy%d := %s;\n', ...

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