view m-toolbox/classes/@specwin/fromDom.m @ 17:7afc99ec5f04 database-connection-manager

Update ao_model_retrieve_in_timespan
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source


function obj = fromDom(obj, node, inhists)
  
  % Get shape
  objShape = utils.xml.getShape(node);
  
  if any(objShape==0)
    
    obj = specwin.initObjectWithSize(objShape(1), objShape(2));
    
  else
    
    %%%%%%%%%% Call super-class
    
    fromDom@ltpda_nuo(obj, node, inhists);
    
    %%%%%%%%%% Get properties from the node attributes
    
    %%%%%%%%%% Get properties from the child nodes
    
    % Get type
    childNode = utils.xml.getChildByName(node, 'type');
    if ~isempty(childNode)
      obj.type = utils.xml.getString(childNode);
    end
    
    % Get alpha
    childNode = utils.xml.getChildByName(node, 'alpha');
    if ~isempty(childNode)
      obj.alpha = utils.xml.getNumber(childNode);
    end
    
    % Get psll
    childNode = utils.xml.getChildByName(node, 'psll');
    if ~isempty(childNode)
      obj.psll = utils.xml.getNumber(childNode);
    end
    
    % Get rov
    childNode = utils.xml.getChildByName(node, 'rov');
    if ~isempty(childNode)
      obj.rov = utils.xml.getNumber(childNode);
    end
    
    % Get nenbw
    childNode = utils.xml.getChildByName(node, 'nenbw');
    if ~isempty(childNode)
      obj.nenbw = utils.xml.getNumber(childNode);
    end
    
    % Get w3db
    childNode = utils.xml.getChildByName(node, 'w3db');
    if ~isempty(childNode)
      obj.w3db = utils.xml.getNumber(childNode);
    end
    
    % Get flatness
    childNode = utils.xml.getChildByName(node, 'flatness');
    if ~isempty(childNode)
      obj.flatness = utils.xml.getNumber(childNode);
    end
    
    % Get levelorder
    childNode = utils.xml.getChildByName(node, 'levelorder');
    if ~isempty(childNode)
      obj.levelorder = utils.xml.getNumber(childNode);
    end
    
    % Get skip
    childNode = utils.xml.getChildByName(node, 'skip');
    if ~isempty(childNode)
      obj.skip = utils.xml.getNumber(childNode);
    end
    
    % Get len
    childNode = utils.xml.getChildByName(node, 'len');
    if ~isempty(childNode)
      obj.len = utils.xml.getNumber(childNode);
    end
    
    % Get win
    childNode = utils.xml.getChildByName(node, 'win');
    if ~isempty(childNode)
      obj.len = length(utils.xml.getNumber(childNode));
    end
    
  end
  
end