Overview
Comment:Changed to filenumer type of fprintf
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: af4dbd77210bb4f8c4da554f597dc764b1608502fe582ef3c03a49b32a507151
User & Date: gawthrop@users.sourceforge.net on 1996-08-08 16:38:19
Other Links: branch diff | manifest | tags
Context
1996-08-08
16:38:50
Initial revision check-in: cc875b2a3e user: gawthrop@users.sourceforge.net tags: origin/master, trunk
16:38:19
Changed to filenumer type of fprintf check-in: af4dbd7721 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
16:19:08
Initial revision check-in: 5a9d0b5681 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/lib/comp/simple/SS_eqn.m from [b5fc849f02] to [6061651cf9].

1
2

3
4
5
6
7
8



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

32
33
34
35

36
37
38
39
40
41
42

43
44
45
46
47
48
49
50
51
52
53
54

55
56
57

58
59
60
61
62
63
64

65
66
67
68
69
70
71
1

2
3
4
5
6
7
8
9
10
11
12
13



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

31
32
33
34

35
36
37
38
39
40
41

42
43
44
45
46
47
48
49
50
51
52
53

54
55
56

57
58
59
60
61
62
63

64
65
66
67
68
69
70
71

-
+






+
+
+


-
-
-

















-
+



-
+






-
+











-
+


-
+






-
+







function structure =  SS_eqn(bond_number,bonds,direction,cr,args, ...
                            structure,eqnfile);
                            structure,filenum);

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.1  1996/08/08 16:19:08  peter
% %% Initial revision
% %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if nargin<7
  eqnfile = 'stdout';
end;

% The string 'cr' contains the effort attributes;  
% 'arg' contains the flow attributes. 
% external indicates an external variable
% internal indicates an internal variable
% anything else is the name of a constant.

effort_attribute = cr;
flow_attribute = args;

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

% Effort
if strcmp(effort_attribute, 'external')
  if bonds(1,1)==-1 % Source
    inputs = inputs+1;
    fprintf(eqnfile, '%s := MTTu(%1.0f,1);\n', ...
    fprintf(filenum, '%s := MTTu(%1.0f,1);\n', ...
        varname(bond_number,1),inputs);
  else % Sensor
    outputs = outputs+1;
    fprintf(eqnfile, 'MTTy(%1.0f,1) := %s;\n', ...
    fprintf(filenum, 'MTTy(%1.0f,1) := %s;\n', ...
        outputs, varname(bond_number,1));
  end;
elseif strcmp(effort_attribute, 'internal')
  % Do nothing
else % named constant
  if bonds(1,1)==-1 % Source
    fprintf(eqnfile, '%s := %s;\n', ...
    fprintf(filenum, '%s := %s;\n', ...
        varname(bond_number,1), effort_attribute);
  else % Sensor
  % THIS STILL NEEDS DOING!
  mtt_info('Constant outputs not implemented yet!');
  end;
end;

% Flow
if strcmp(flow_attribute, 'external')
  if bonds(1,2)==1 % Source
    inputs = inputs+1;
    fprintf(eqnfile, '%s := MTTu(%1.0f,1);\n', varname(bond_number,-1),inputs);
    fprintf(filenum, '%s := MTTu(%1.0f,1);\n', varname(bond_number,-1),inputs);
  else % Sensor
    outputs = outputs+1;
    fprintf(eqnfile, 'MTTy(%1.0f,1) := %s;\n', outputs, ...
    fprintf(filenum, 'MTTy(%1.0f,1) := %s;\n', outputs, ...
        varname(bond_number,-1));
  end;
elseif strcmp(flow_attribute, 'internal')
  % Do nothing
else % Named constant
  if bonds(1,2)==1 % Source
    fprintf(eqnfile, '%s := %s;\n', ...
    fprintf(filenum, '%s := %s;\n', ...
	varname(bond_number,-1), flow_attribute);
  else % Sensor
  % THIS STILL NEEDS DOING!
  mtt_info('Zero outputs not implemented yet!');
  end;
end;


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