%

% Copyright 2017 The MathWorks, Inc.

classdef Options
    properties (Constant=true)
        TestgenTargetModelStr = 'Model'
        TestgenTargetGeneratedCodeStr = 'GenCodeTopModel'
        TestgenTargetGeneratedModelRefCodeStr = 'GenCodeModelRef'
    end

    methods (Static)
        function out = isTestgenTargetForModel(opt)
            if isa(opt, 'Sldv.Options')
                opt = opt.TestgenTarget;
            else
                validateattributes(opt, {'char', 'string'}, {'scalartext'}, 1);
            end
            out = ~sldv.code.internal.isXilFeatureEnabled() || ...
                strcmpi(opt, Sldv.utils.Options.TestgenTargetModelStr);
        end

        function out = isTestgenTargetForCode(opt)
            if isa(opt, 'Sldv.Options')
                opt = opt.TestgenTarget;
            else
                validateattributes(opt, {'char', 'string'}, {'scalartext'}, 1);
            end
            out = sldv.code.internal.isXilFeatureEnabled() && ...
                strcmpi(opt, Sldv.utils.Options.TestgenTargetGeneratedCodeStr);
        end

        function out = isTestgenTargetForModelRefCode(opt)
            if isa(opt, 'Sldv.Options')
                opt = opt.TestgenTarget;
            else
                validateattributes(opt, {'char', 'string'}, {'scalartext'}, 1);
            end
            out = sldv.code.internal.isXilFeatureEnabled() && ...
                strcmpi(opt, Sldv.utils.Options.TestgenTargetGeneratedModelRefCodeStr);
        end
    end
end
