Zwischenstand
git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@968 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
#include "Interpolator.hpp"
|
||||
#include <iostream>
|
||||
|
||||
namespace Radio
|
||||
{
|
||||
namespace Interpolation
|
||||
{
|
||||
Interpolator::Interpolator()
|
||||
: m_mu (0)
|
||||
: m_adv(0)
|
||||
, m_mu(0)
|
||||
{
|
||||
|
||||
count = 0;
|
||||
}
|
||||
|
||||
Interpolator::~Interpolator()
|
||||
@@ -15,18 +17,14 @@ Interpolator::~Interpolator()
|
||||
|
||||
}
|
||||
|
||||
void Interpolator::setMu(radio_float_t mu)
|
||||
void Interpolator::process(radio_float_t dMu)
|
||||
{
|
||||
m_mu = mu;
|
||||
}
|
||||
m_mu += dMu;
|
||||
m_adv = (size_t)m_mu;
|
||||
m_mu -= m_adv;
|
||||
|
||||
|
||||
size_t Interpolator::process(radio_float_t dMu)
|
||||
{
|
||||
radio_float_t nextMu = m_mu + dMu;
|
||||
size_t adv = nextMu;
|
||||
nextMu -= adv;
|
||||
return adv;
|
||||
std::cout << count << ": adv = " << m_adv << ", mu = " << m_mu << std::endl;
|
||||
count++;
|
||||
}
|
||||
|
||||
radio_float_t Interpolator::getMu()
|
||||
@@ -34,5 +32,10 @@ radio_float_t Interpolator::getMu()
|
||||
return m_mu;
|
||||
}
|
||||
|
||||
size_t Interpolator::getAdv()
|
||||
{
|
||||
return m_adv;
|
||||
}
|
||||
|
||||
} // Interpolation
|
||||
} // Radio
|
||||
|
||||
Reference in New Issue
Block a user