% MKSProperty is a class used to store information 
% about an export physical property

% Version 2.0 - updated 2024-02-29
classdef MKSProperty < MKSBase
    
    % Properties
    properties
        data = MKSDatum.empty
        component = ""
        dataType = ""
        status = ""
        name = ""
    end

    % Methods
    methods

        % processJson - decoded json input
        function mksPrp = processJson(mksPrp, jsonStruct)

            % Only process numeric data (for now)
            if mksPrp.isNumericDataType(jsonStruct.DataType)

                % Parse each datum structure
                for i = 1:numel(jsonStruct.Data)

                    % Create datum object
                    mksDtm = MKSDatum;

                    % Parse json input
                    mksDtm = mksDtm.processJson(jsonStruct.Data(i));
                    mksPrp.data(end+1) = mksDtm;
                
                end
            end

            % Assign properties
            mksPrp.component = jsonStruct.Component;
            mksPrp.dataType = jsonStruct.DataType;
            mksPrp.status = jsonStruct.Status;
            mksPrp.name = jsonStruct.Name;

        end

    end
end