Overview
Comment:Octavised
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 281670b4d23680d1188bd717792f0cc5da6fa8b38d4e3476b113d8a320388c59
User & Date: gawthrop@users.sourceforge.net on 2003-01-07 09:11:53
Other Links: branch diff | manifest | tags
Context
2003-01-07
10:10:14
Uses new version of equation.m - passes component type to cr. check-in: 3581948d08 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:11:53
Octavised check-in: 281670b4d2 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
00:43:29
Attempting to add common intermediate representation between rbg and abg
so that a common method can be used to interpret dia and xfig diagrams
check-in: 2c420ae578 user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/printcr.m from [cc1770a912] to [4fb181bd27].

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
function  printcr(name,outport,bond_number,cr,args,RHS_cause,eqnfile)
% printcr - prints cr and arguments
% Assumes that the (multiport) component is unicausal.
% 

%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%     %%%%% Model Transformation Tools %%%%%
%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 

% Matlab function  printcr
% printcr(name,outport,bond_number,cr,args,RHS_cause,eqnfile


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






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

% Find the number of ports
ports = length(RHS_cause);

% Print the CR
if length(cr) == 0 % No CR given - use unity CR
  fprintf(eqnfile, '%s;\n', varname(name,bond_number(outport), RHS_cause(outport)));

else % CR exists
  fprintf(eqnfile, '%s(', cr); % The CR name
  if ports>1 % Multi ports - port no. is first arg of CR
    fprintf(eqnfile, '%1.0f,', outport);
  end;
  fprintf(eqnfile, '%s', args); % Print the arguments
  for port = 1:ports % Print the input causalities and values
    fprintf(eqnfile, '\n\t\t,%s,%s', cause2name(RHS_cause(port)), ...
    varname(name,bond_number(port), RHS_cause(port)));
  end;
fprintf(eqnfile, '\n\t\t);\n');    
end;




|
|
<
>
|
|
|
<
>
|
|


|
|
|
|
|
|
>
>
>



|
|
|

|
|

|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
>
>

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
function  printcr(name,outport,bond_number,cr,args,RHS_cause,eqnfile)
## printcr - prints cr and arguments
## Assumes that the (multiport) component is unicausal.

## 
##     ###################################### 
##     ##### Model Transformation Tools #####
##     ######################################

## 
## Octave function  printcr
## printcr(name,outport,bond_number,cr,args,RHS_cause,eqnfile


## ###############################################################
## ## Version control history
## ###############################################################
## ## $Id$
## ## $Log$
## ## Revision 1.1  1998/07/25 09:47:43  peterg
## ## Initial revision
## ##
## ###############################################################



  if nargin<7
    eqnfile = "stdout";
  endif

  ## Find the number of ports
  ports = length(RHS_cause);

  ## Print the CR
  if length(cr) == 0 # No CR given - use unity CR
    fprintf(eqnfile, "%s;\n", varname(name,bond_number(outport), \
				      RHS_cause(outport)));
  else # CR exists
    fprintf(eqnfile, "%s(%s", cr, name); # The CR name and component type
    if ports>1 # Multi ports - port no. is first arg of CR
      fprintf(eqnfile, "#1.0f,", outport);
    endif
    fprintf(eqnfile, "%s", args); # Print the arguments
    for port = 1:ports # Print the input causalities and values
      fprintf(eqnfile, "\n\t\t,%s,%s", cause2name(RHS_cause(port)), ...
	      varname(name,bond_number(port), RHS_cause(port)));
    endif
    fprintf(eqnfile, "\n\t\t);\n");
  endif
endfunction



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