git-svn-id: svn://db.shs.com.ru/libs@380 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
39
cd_utils/cdutils_x.cpp
Normal file
39
cd_utils/cdutils_x.cpp
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user