Select Git revision
-
Xavier ELATTAOUI authoredXavier ELATTAOUI authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
SingleShotAOManager.cpp 14.18 KiB
//=============================================================================
// SingleShotAOManager.cpp
//=============================================================================
// abstraction.......SingleShotAOManager
// class.............SingleShotAOManager
// original author...S.Gara - Nexeya
//=============================================================================
// ============================================================================
// DEPENDENCIES
// ============================================================================
#include <yat4tango/LogHelper.h>
#include "SingleShotAOManager.h"
namespace SingleShotAO_ns
{
//- check ssao macro:
#define CHECK_SSAO() \
do \
{ \
if (! m_ssao) \
THROW_DEVFAILED("DEVICE_ERROR", \
"request aborted - the AO board isn't accessible ", \
"SingleShotAOManager::check_ssao"); \
} while (0)
// ============================================================================
// SingleShotAOManager::SingleShotAOManager ()
// ============================================================================
SingleShotAOManager::SingleShotAOManager (Tango::DeviceImpl * hostDevice)
: yat4tango::DeviceTask(hostDevice)
{
//- trace/profile this method
yat4tango::TraceHelper t("SingleShotAOManager::SingleShotAOManager", this);
enable_timeout_msg(false);
enable_periodic_msg(false);
m_state = Tango::INIT;
m_status = "Initialization in progress";
}
// ============================================================================
// SingleShotAOManager::~SingleShotAOManager ()
// ============================================================================
SingleShotAOManager::~SingleShotAOManager ()
{
enable_periodic_msg(false);
}
// ============================================================================
// SingleShotAOManager::get_state ()
// ============================================================================
Tango::DevState SingleShotAOManager::get_state()
{
bool l_isRunning = false;
if (m_state != Tango::FAULT)
{
for (unsigned int l_cpt = 0;l_cpt < m_nb_chan;l_cpt++)
{
if (m_isRunning[l_cpt])
{
l_isRunning = true;
}
}
if (l_isRunning)
{
m_state = Tango::MOVING;