Index: mttroot/mtt/bin/trans/m/mtt_component_eqn.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_component_eqn.m +++ mttroot/mtt/bin/trans/m/mtt_component_eqn.m @@ -22,10 +22,11 @@ [Name,name] = mtt_subname(fullname); # Split fullname SD = "__"; # Subsystem delimiter CD = "\n%%"; # Comment delimiter + arg_default = "1"; # Default aliased arg DEBUG = 0; if DEBUG disp("======================================="); @@ -36,18 +37,27 @@ if length(known)<2 # Invalid known = " "; endif - cbg = mtt_cbg(Name); # Structure for this subsystem - + if length(Name)>0 + cbg = mtt_cbg(Name); # Structure for this subsystem + endif + if struct_contains (cbg, "ports") ## Combine ports with the other subsystems for [component_structure, component] = cbg.ports eval(sprintf("cbg.subsystems.%s=cbg.ports.%s;",component,component)); endfor endif + + ## Aliasing + if length(name)>0 + eval(sprintf("ARG=cbg.subsystems.%s.arg;", name)); # Arguments + ARG = mtt_alias (Name,ARG,arg_default); # Alias them + eval(sprintf("cbg.subsystems.%s.arg=ARG;", name)); # and copy + endif ## Call to a subsystem (represented by name="") if strcmp(name,"") if !struct_contains(cbg,"portlist")