comparison +multiblock/InterfaceOptions.m @ 911:f7306f03f77a feature/utux2D

Improve comments and names. Change InterfaceOptions.union to merge.
author Martin Almquist <malmquist@stanford.edu>
date Sat, 24 Nov 2018 15:43:34 -0800
parents ab1759166a8c
children
comparison
equal deleted inserted replaced
910:b9c98661ff5d 911:f7306f03f77a
52 % Sets the option optStr to val, for the coupling berween blocks i and j 52 % Sets the option optStr to val, for the coupling berween blocks i and j
53 % If i and j are omitted, all couplings get optStr = val. 53 % If i and j are omitted, all couplings get optStr = val.
54 % 54 %
55 % optStr -- string 55 % optStr -- string
56 % val -- anything 56 % val -- anything
57 % i,j -- integers 57 % i,j -- integers (or empty)
58 function setOption(obj, optStr, val, i ,j) 58 function setOption(obj, optStr, val, i ,j)
59 default_arg('i',[]); 59 default_arg('i',[]);
60 default_arg('j',[]); 60 default_arg('j',[]);
61 61
62 opts = obj.optsCell; 62 opts = obj.optsCell;
91 91
92 obj.optsCell = opts; 92 obj.optsCell = opts;
93 end 93 end
94 94
95 95
96 % Constructs the union of two InterfaceOptions 96 % Merges with another InterfaceOptions-object.
97 function union(obj, obj2) 97 % Errors if there are merge conflicts.
98 localOpts = obj.optsCell; 98 % TODO: merge with preference?
99 remoteOpts = obj2.optsCell; 99 function merge(obj, obj2)
100 localOpts = obj.getOptions();
101 remoteOpts = obj2.getOptions();
100 102
101 assert( numel(localOpts) == numel(remoteOpts), ... 103 assert( numel(localOpts) == numel(remoteOpts), ...
102 'multiblock.InterfaceOptions: The two InterfaceOptions do not have the same dimension.'); 104 'multiblock.InterfaceOptions: The two InterfaceOptions do not have the same dimension.');
103 105
104 for i = 1:numel(localOpts) 106 for i = 1:numel(localOpts)