Overview
Comment:Now stips ; from bottlom level argument list - allows aliasing of
parts of a,b,c (eg a,b by using a,b;c
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 9c099c6e0a1a57e0d158b781b9f76ab9b380ddfc5c8da95c0f222ca90f9f153f
User & Date: gawthrop@users.sourceforge.net on 2001-04-23 16:23:30
Other Links: branch diff | manifest | tags
Context
2001-04-23
22:25:29
Plots each column individually. check-in: 75eb8f868e user: geraint@users.sourceforge.net tags: origin/master, trunk
16:23:30
Now stips ; from bottlom level argument list - allows aliasing of
parts of a,b,c (eg a,b by using a,b;c
check-in: 9c099c6e0a user: gawthrop@users.sourceforge.net tags: origin/master, trunk
15:06:21
Removed stdin bug workaround check-in: 4c2e6123ad user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/alias_args.m from [810260547d] to [75006dd80b].

1
2
3
4
5
6
7



8
9
10
11
12
13
14
function args = alias_args(args,alias,delim,message,FileID,sys_name)

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.4  2000/09/14 13:35:43  peterg
## appended '(' and ')' to SEPS
##   -- otherwise first argument after '(' doesn't get substituted
## (Fixed by Geraint)
##
## Revision 1.3  1998/08/11 14:09:05  peterg
## Replaced incorrect length(args>0) with !isempty(args)







>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function args = alias_args(args,alias,delim,message,FileID,sys_name)

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.5  2000/10/12 19:27:20  peterg
## Now writes out the aliased args ...
##
## Revision 1.4  2000/09/14 13:35:43  peterg
## appended '(' and ')' to SEPS
##   -- otherwise first argument after '(' doesn't get substituted
## (Fixed by Geraint)
##
## Revision 1.3  1998/08/11 14:09:05  peterg
## Replaced incorrect length(args>0) with !isempty(args)
33
34
35
36
37
38
39


40
41
42
43
44
45
46
47
48
49
50
51
52
        if struct_contains(alias,arg_)
          eval(["new_arg = alias.", arg_,";"]);
  	  mtt_info(["Replacing ", arg, "\t by ",\
		    new_arg, message],FileID);
  	  mtt_save_alias(arg,sys_name);

          arg = new_arg;


        end
        SEPS = ",+-*/()";
        for j = 1:length(SEPS)
	  if length(findstr(arg,SEPS(j)))>0
	    arg = alias_args(arg,alias,SEPS(j),message,FileID,sys_name);
	  end 
	end;
        args = sprintf("%s%s%s", args, delim, arg);
      end
      args = substr(args,2); % loose leading ;
    end
  end;
endfunction;







>
>













36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
        if struct_contains(alias,arg_)
          eval(["new_arg = alias.", arg_,";"]);
  	  mtt_info(["Replacing ", arg, "\t by ",\
		    new_arg, message],FileID);
  	  mtt_save_alias(arg,sys_name);

          arg = new_arg;
	else
	  mtt_info(["NOT replacing ", arg, message],FileID);
        end
        SEPS = ",+-*/()";
        for j = 1:length(SEPS)
	  if length(findstr(arg,SEPS(j)))>0
	    arg = alias_args(arg,alias,SEPS(j),message,FileID,sys_name);
	  end 
	end;
        args = sprintf("%s%s%s", args, delim, arg);
      end
      args = substr(args,2); % loose leading ;
    end
  end;
endfunction;

Modified mttroot/mtt/bin/trans/m/cbg2ese.m from [332487e2b1] to [30fe4dd076].

19
20
21
22
23
24
25



26
27
28
29
30
31
32
  ## Structure matrix [states,nonstates,inputs,outputs,zero_outputs]
  
  ## ###############################################################
  ## ## Version control history
  ## ###############################################################
  ## ## $Id$
  ## ## $Log$



  ## ## Revision 1.40  2001/02/05 01:50:29  geraint
  ## ## No unit type comparison at ports if either is "none".
  ## ##
  ## ## Revision 1.40  2000/12/16 08:10:55  geraint
  ## ## No unit type comparison at ports if either is "none".
  ## ##
  ## ## Revision 1.39  2000/11/16 12:54:14  peterg







>
>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  ## Structure matrix [states,nonstates,inputs,outputs,zero_outputs]
  
  ## ###############################################################
  ## ## Version control history
  ## ###############################################################
  ## ## $Id$
  ## ## $Log$
  ## ## Revision 1.41  2001/04/15 21:15:41  geraint
  ## ## Added interface definition rep: _ICD.(txt|c|cc|m).
  ## ##
  ## ## Revision 1.40  2001/02/05 01:50:29  geraint
  ## ## No unit type comparison at ports if either is "none".
  ## ##
  ## ## Revision 1.40  2000/12/16 08:10:55  geraint
  ## ## No unit type comparison at ports if either is "none".
  ## ##
  ## ## Revision 1.39  2000/11/16 12:54:14  peterg
467
468
469
470
471
472
473



474
475
476
477
478
479
480
481
482
483
484
	      name_r = ["[" name_r];
	    endif;
	    
	    ## Save the current structure
	    old_structure = structure;
	    
	    ## Generate the simple component equations



	    eval(["structure = ", ...
		  eqn_name, ...
		  "(name_r,bond_list,comp_bonds, ...
		    direction,subsystem.cr,subsystem.arg,structure,ese_file);" ]);
	    
	    ## If structure has changed, write info to structure file.
	    structure_change = structure-old_structure;
	    
	    ## The following line is to avoid probs with multiport C or I
	    ## it needs changing to handle multi ports correctly
	    structure_changes = sum(structure_change);







>
>
>



|







470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
	      name_r = ["[" name_r];
	    endif;
	    
	    ## Save the current structure
	    old_structure = structure;
	    
	    ## Generate the simple component equations
	    ## .. firstly replacing ; by , in argument list
	    subsystem_arg = strrep(subsystem.arg,";",",");

	    eval(["structure = ", ...
		  eqn_name, ...
		  "(name_r,bond_list,comp_bonds, ...
		    direction,subsystem.cr,subsystem_arg,structure,ese_file);" ]);
	    
	    ## If structure has changed, write info to structure file.
	    structure_change = structure-old_structure;
	    
	    ## The following line is to avoid probs with multiport C or I
	    ## it needs changing to handle multi ports correctly
	    structure_changes = sum(structure_change);


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