/* $Header: https://svn.mpia.de/gulli/TwiceAsNice/branch/unstable/ln/laos-drot/test/LaosDrotServiceWorkerMock.cc 14115 2016-12-07 17:38:28Z mathar $
*/

#include "SharknirDrotServiceWorkerMock.h"

int Sharknir::DrotServiceWorkerMock::DeviceAsyncImplMock::asyncWait(const Nice::Time & _t)
{
    return DeviceAsyncImpl::asyncWait(_t / dynamic_cast<DrotServiceWorkerMock*>(m_service)->getTimelapse());
}

int Sharknir::DrotServiceWorkerMock::DeviceCmdAsyncImplMock::asyncWait(const Nice::Time & _t)
{
    return DeviceAsyncImpl::asyncWait(_t / dynamic_cast<DrotServiceWorkerMock*>(m_service)->getTimelapse());
}

Sharknir::DrotServiceWorkerMock::DrotServiceWorkerMock(const Nice::JointPtr & _config,
                                                      const Basda::MoccaNDevicePtr &_device)
        : Sharknir::DrotServiceWorker(_config, _device)
{
    m_timelapse = 1;

    m_deviceAsyncMock.m_service = this;
    m_deviceCmdAsyncMock.m_service = this;
}

Sharknir::DrotServiceWorkerMock::~DrotServiceWorkerMock()
{
}

void Sharknir::DrotServiceWorkerMock::setTimelapse(double _timelapse)
{
    m_timelapse = _timelapse;
}

double Sharknir::DrotServiceWorkerMock::getTimelapse()
{
    return m_timelapse;
}
