RaspRPM::RaspRPM(std::shared_ptr<Wt::WServer> server, Wt::Json::Object conf) : AbstractRPM(server, conf) { prepareGPIOs(); startPolling(); }
void PollThread:: run() { isDone = false; th = std::thread([=] { startPolling(); while(!isDone) poll(100); stopPolling(); }); }
void XDKSensor::enable(bool enabled) { Poco::Mutex::ScopedLock lock(_mutex); if (enabled) { startPolling(); } else { stopPolling(); } _enabled = enabled; }
DGLDebugeeQTProcess::DGLDebugeeQTProcess(int port, bool modeEGL) : m_Port(port), m_Loaded(false), m_ModeEGL(modeEGL), m_PortStr(boost::lexical_cast<std::string>(getPort())), m_SemLoaderStr("sem_loader_" + m_PortStr), m_SemOpenGLStr("sem_" + m_PortStr), m_SemLoader(boost::interprocess::open_or_create, m_SemLoaderStr.c_str(), 0), m_SemOpenGL(boost::interprocess::open_or_create, m_SemOpenGLStr.c_str(), 0), m_PollTimer(new QTimer(this)) { CONNASSERT(m_PollTimer, SIGNAL(timeout()), this, SLOT(pollReady())); CONNASSERT(getProcess(), SIGNAL(started()), this, SLOT(startPolling())); CONNASSERT(getProcess(), SIGNAL(error(QProcess::ProcessError)), this, SLOT(handleProcessError(QProcess::ProcessError))); CONNASSERT(getProcess(), SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(handleProcessFinished(int, QProcess::ExitStatus))); }
//#Broadcast region void YoutubeController::broadcastModelChanged() { const auto& broadcastModel = api_->broadcastModel(); if (broadcastModel->rowCount() ==0) { emit error(tr("No broadcasts found")); return; } QString liveChatId = broadcastModel->data(broadcastModel->index(0,0)).toString(); if (liveChatId.size()==0) { emit error(tr("Broadcast has no live chats attached")); return; } emit message(QApplication::tr("Connected to youtube channel."),"",""); liveChatId_ = liveChatId; startPolling(); }