% 下一步是实现Matlab类接口，该接口将从动态库中分派相应的C++方法。
% 类文件和.mexw64文件必须位于同一目录中
classdef EngineMatlab < handle
%EngineMatlab usage of the mexplus development kit.

properties (Access = private)
  id_ % ID of the session
end

methods
  function this = EngineMatlab()
    %EngineMatlab Create a new
    this.id_ = EngineMatlab_('new');
  end

  function delete(this)
    %delete Destructor
    EngineMatlab_('delete', this.id_);
  end
  
  function setup(this, modelfileName)

      
    %step integration step
    assert(isscalar(this));
    assert(ischar(modelfileName));
    
    EngineMatlab_('setup', this.id_,  modelfileName);
  end

  function bool = step(this, tf)
    %step integration step
    assert(isscalar(this));
    bool = EngineMatlab_('step', this.id_, tf);
  end
  
  function setExcitations(this, excitations)
    %setExcitations sets the excitations of the muscle
    assert(isscalar(this));
    EngineMatlab_('setExcitations', this.id_, excitations);
  end
  
  
  
  function setExcitation(this, actuatorName, excitation)
    %setExcitations sets the excitations of the muscle by name
    assert(isscalar(this));
    assert(ischar(actuatorName));
    assert(isscalar(excitation));
    EngineMatlab_('setExcitation', this.id_, actuatorName, excitation);
  end
  
  
  
  
  function muscleNames = getMuscleNames(this)
    %getMuscleNames integration step
    assert(isscalar(this));
    muscleNames = EngineMatlab_('getMuscleNames', this.id_);
  end
 
  
  function actuatorNames = getActuatorNames(this)
    %getActuatorNames integration step
    assert(isscalar(this));
    actuatorNames = EngineMatlab_('getActuatorNames', this.id_);
  end
  
 
  
  function value = getCoordinateValue(this, name)
    %getLatestNormalizedMuscleForce gets the value of a spesific
    %coordinate
    assert(isscalar(this));
    assert(ischar(name));
    value = EngineMatlab_('getCoordinateValue', ...
        this.id_, name);
  end

  function printResults(this, dir)
    %printResults Save something to the database.
    assert(isscalar(this));
    EngineMatlab_('printResults', this.id_, dir);
  end
  
end

end
