Skip to content
Snippets Groups Projects
Commit c9702640 authored by sp89hili's avatar sp89hili
Browse files

Pu_add getOptionID, enable not equal operation for options

parent 92e5bb02
Branches
Tags
No related merge requests found
......@@ -122,12 +122,29 @@ classdef BearImpOptions < handle & dynamicprops & matlab.mixin.CustomDisplay & m
end
methods (Hidden)
function charOut = char(obj)
function str = getOptionID(obj)
% Gerates an abbreviated string according to the options chosen
str = ['T' lower(obj.T.char(1)) '_B' lower(obj.B.char(1)) '_H' lower(obj.H.filmThicknessFormula.char(1)) ];
if obj.H.thermalCorrection == 'on', str = [str 't']; end
if obj.H.starvationCorrection == 'on', str = [str 's']; end
if obj.H.roughnessCorrection == 'on', str = [str 'r']; end
str = [str '_C' lower(obj.C.outsideArea.char(1:2))];
if obj.C.k_vh_factor == 'on' , str = [str 'k']; end
if obj.C.pressureDistribution == 'on' , str = [str 'p']; end
if obj.C.roughnessCorrection ~= 'off', str = [str 'r']; end
str = [str lower(obj.C.rhoRatio.char(1))];
end
function charOut = char(obj,n)
arguments
obj
n {mustBeInteger} = []
end
if strcmp(obj.optionChosen,'default') && ~obj.hasSubSubOptions
charOut = obj.defaultOption;
else
charOut = obj.optionChosen;
end
if ~isempty(n), charOut = charOut(n); end
end
function stringOut = string(obj)
......@@ -138,6 +155,11 @@ classdef BearImpOptions < handle & dynamicprops & matlab.mixin.CustomDisplay & m
cellOut = {char(obj)};
end
function logicalOut = ne(obj,otherObj)
nargoutchk(0,1)
logicalOut = ~eq(obj,otherObj);
end
function [logicalOut,diffs] = eq(obj,otherObj)
nargoutchk(0,2)
logicalOut = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment