From 0c1688a361586c3c8ef21c77673529fef0c2643b Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Fri, 18 Jul 2014 14:34:54 +0000 Subject: [PATCH] [Matlab] Switch to explicit class specific hndl functions. Deprecate generic hndl functions --- interfaces/matlab/toolbox/@FlowDevice/install.m | 4 ++-- interfaces/matlab/toolbox/@Kinetics/Kinetics.m | 2 +- interfaces/matlab/toolbox/@Kinetics/hndl.m | 2 ++ interfaces/matlab/toolbox/@Reactor/hndl.m | 2 ++ interfaces/matlab/toolbox/@ThermoPhase/ThermoPhase.m | 2 +- interfaces/matlab/toolbox/@ThermoPhase/hndl.m | 2 ++ interfaces/matlab/toolbox/@Transport/hndl.m | 2 ++ interfaces/matlab/toolbox/@XML_Node/hndl.m | 2 ++ interfaces/matlab/toolbox/@XML_Node/xml_hndl.m | 3 +++ 9 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 interfaces/matlab/toolbox/@XML_Node/xml_hndl.m diff --git a/interfaces/matlab/toolbox/@FlowDevice/install.m b/interfaces/matlab/toolbox/@FlowDevice/install.m index d20e2bb23..65a63cd13 100644 --- a/interfaces/matlab/toolbox/@FlowDevice/install.m +++ b/interfaces/matlab/toolbox/@FlowDevice/install.m @@ -5,8 +5,8 @@ if nargin == 3 error(['Flow devices can only be installed between reactors or' ... ' reservoirs']) end - i = hndl(upstream); - j = hndl(downstream); + i = reactor_hndl(upstream); + j = reactor_hndl(downstream); ok = flowdevicemethods(2, f.index, i, j); if ok < 0 error(geterr) diff --git a/interfaces/matlab/toolbox/@Kinetics/Kinetics.m b/interfaces/matlab/toolbox/@Kinetics/Kinetics.m index 4816b19da..839844fc4 100644 --- a/interfaces/matlab/toolbox/@Kinetics/Kinetics.m +++ b/interfaces/matlab/toolbox/@Kinetics/Kinetics.m @@ -32,7 +32,7 @@ if ~isa(r, 'XML_Node') end k.owner = 1; -ixml = hndl(r); +ixml = xml_hndl(r); % get the integer indices used to find the stored objects % representing the phases participating in the mechanism. diff --git a/interfaces/matlab/toolbox/@Kinetics/hndl.m b/interfaces/matlab/toolbox/@Kinetics/hndl.m index c031576c8..4d475990c 100644 --- a/interfaces/matlab/toolbox/@Kinetics/hndl.m +++ b/interfaces/matlab/toolbox/@Kinetics/hndl.m @@ -1,2 +1,4 @@ function i = hndl(k) + +warning('This function is deprecated in favor of kinetics_hndl.m') i = k.id; diff --git a/interfaces/matlab/toolbox/@Reactor/hndl.m b/interfaces/matlab/toolbox/@Reactor/hndl.m index 77715a715..b11113862 100644 --- a/interfaces/matlab/toolbox/@Reactor/hndl.m +++ b/interfaces/matlab/toolbox/@Reactor/hndl.m @@ -1,2 +1,4 @@ function i = hndl(r) + +warning('This function is deprecated in favor of reactor_hndl.m') i = r.index; diff --git a/interfaces/matlab/toolbox/@ThermoPhase/ThermoPhase.m b/interfaces/matlab/toolbox/@ThermoPhase/ThermoPhase.m index d67bb265a..8400e9a7a 100644 --- a/interfaces/matlab/toolbox/@ThermoPhase/ThermoPhase.m +++ b/interfaces/matlab/toolbox/@ThermoPhase/ThermoPhase.m @@ -8,7 +8,7 @@ if nargin == 1 return elseif isa(r, 'XML_Node') t.owner = 1; - hr = hndl(r); + hr = xml_hndl(r); t.tp_id = thermo_get(hr, 0); if t.tp_id < 0 error(geterr); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/hndl.m b/interfaces/matlab/toolbox/@ThermoPhase/hndl.m index 4b6c8c94f..760c55198 100644 --- a/interfaces/matlab/toolbox/@ThermoPhase/hndl.m +++ b/interfaces/matlab/toolbox/@ThermoPhase/hndl.m @@ -1,2 +1,4 @@ function i = hndl(p) + +warning('This function is deprecated in favor of thermo_hndl.m') i = p.tp_id; diff --git a/interfaces/matlab/toolbox/@Transport/hndl.m b/interfaces/matlab/toolbox/@Transport/hndl.m index d8ce4d46f..988ee5fab 100644 --- a/interfaces/matlab/toolbox/@Transport/hndl.m +++ b/interfaces/matlab/toolbox/@Transport/hndl.m @@ -1,2 +1,4 @@ function n = hndl(a) + +warning('This function is deprecated in favor of trans_hndl') n = a.id; diff --git a/interfaces/matlab/toolbox/@XML_Node/hndl.m b/interfaces/matlab/toolbox/@XML_Node/hndl.m index 4061904d7..06165df2c 100644 --- a/interfaces/matlab/toolbox/@XML_Node/hndl.m +++ b/interfaces/matlab/toolbox/@XML_Node/hndl.m @@ -1,2 +1,4 @@ function i = hndl(x) + +warning('This function is deprecated in favor of xml_hndl.m') i = x.id; diff --git a/interfaces/matlab/toolbox/@XML_Node/xml_hndl.m b/interfaces/matlab/toolbox/@XML_Node/xml_hndl.m new file mode 100644 index 000000000..bf83949fd --- /dev/null +++ b/interfaces/matlab/toolbox/@XML_Node/xml_hndl.m @@ -0,0 +1,3 @@ +function i = xml_hndl(x) + +i = x.id; \ No newline at end of file