%

%   Copyright 2016 The MathWorks, Inc.

classdef ExtensionUtils  
    
    properties
        modelH;
        extendOpts;
        sldvData;
        
    end
    
    methods(Access = 'private')       
        [data,errStatus]   = checkConsistencyOfInput(obj);
        convertedData      = convertToSldvData(obj, data);
        convertedData      = convertFromSldvData(obj, data);
        [status, outData]  = extendSLDVData(obj, data); 
        errStatus          = checkOptsForErrors (opts);
    end
 
        

    methods(Static, Access = 'public') 
        [status, outData]  = TopItOff(obj);
        opts               = getDefaultOpts();
        
        function obj = setCovExtensionOpts(obj, dataToExtend, format)
            obj.extendOpts.mode = 'COV_EXTN_MODE';
            obj.extendOpts.inputTCfile = dataToExtend;
            obj.extendOpts.inputTCformat = format;
        end
        function obj = setTCExtensionOpts(obj, dataToExtend, format)
            obj.extendOpts.mode = 'TEST_EXTN_MODE';
            obj.extendOpts.inputTCfile = dataToExtend;
            if strcmp(format,'COVDATA')
                error('Sldv:ExtensionUtils:InvalidFormatForTCExtension','abc');
            else
                obj.extendOpts.inputTCformat = format;
            end
        end
        function obj = ExtensionUtils(modelH)
            try
                if ischar(modelH)
                    obj.modelH = get_param(modelH,'Handle');
                else
                    obj.modelH = modelH;
                end
                obj.extendOpts = obj.getDefaultOpts();
            catch mex
                throw(mex);
            end
        end
        
    end    
end
