git-svn-id: svn://db.shs.com.ru/libs@380 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2018-05-22 13:49:16 +00:00
parent d3e81d5efa
commit 7a8dd9efba
28 changed files with 1052 additions and 137 deletions

39
cd_utils/cdutils_x.cpp Normal file
View File

@@ -0,0 +1,39 @@
#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);
}