Files
qad/cd_utils/cdutils_x.cpp

40 lines
761 B
C++

#include "cdutils_x.h"
#include "cdutils_core.h"
using namespace CDUtils;
XInterface X;
XInterface::XInterface(): Interface(CDType::cdX) {
CONNECTU(core, X_Sended, this, sended);
CONNECTU(core, X_SendFail, this, sendFailed);
CONNECTU(core, X_Received, this, received);
CONNECTU(core, X_ReceiveFail, this, receiveFailed);
}
void XInterface::send() {
core->X_Send();
}
void XInterface::request() {
core->X_Request();
}
void XInterface::setEnabled(const CDType & x, bool en) {
CDType & t((*s)[x.path()]);
if (t.cd_type() != CDType::cdX) return;
core->x_mutex.lock();
t.x_enabled = en;
core->need_rebuild_x = true;
core->x_mutex.unlock();
}
void XInterface::start(double freq) {
core->startX(freq);
}