- Migrated all 104 CMakeLists.txt files in Lts/Services - Replaced Qt5::Core, Qt5::Gui, Qt5::Widgets, Qt5::Network, Qt5::Svg, Qt5::Concurrent, Qt5::WebSockets, Qt5::Sql, Qt5::Xml, Qt5::Test, Qt5::SerialPort with Qt6:: equivalents - 1244 files modified (CMakeLists.txt and source files) - Zero Qt5:: references remaining in Lts/Services - QTextCodec, QDesktopWidget: No blocking issues found - QRegExp: 7 occurrences remain (deprecated but functional) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
59 lines
1.3 KiB
C++
Executable File
59 lines
1.3 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* VdSession
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Astrid Müller, SGAS, 2018-02-26
|
|
*/
|
|
|
|
#include "vd_session.h"
|
|
#include "vd_control.h"
|
|
#include "ivd_comm.h"
|
|
|
|
namespace AudioVideoManagement
|
|
{
|
|
|
|
VdSession::VdSession(VdControl *ctrl, int exerciseId, bool keepAliveEnabled)
|
|
: m_ctrl(ctrl)
|
|
, m_exerciseId(exerciseId)
|
|
, m_keepAliveEnabled(keepAliveEnabled)
|
|
, m_logger(getLogger("AvaSession"))
|
|
{
|
|
Q_ASSERT(ctrl);
|
|
|
|
m_keepAliveTimer.setInterval(std::chrono::milliseconds(5000).count());
|
|
m_keepAliveTimer.setSingleShot(true);
|
|
|
|
connect(m_ctrl->comm(), &IVdComm::connected, this, &VdSession::onConnected);
|
|
connect(m_ctrl->comm(), &IVdComm::disconnected, this, &VdSession::onDisconnected);
|
|
connect(&m_keepAliveTimer, &QTimer::timeout, this, &VdSession::onKeepAliveTimerElapsed);
|
|
}
|
|
|
|
void VdSession::onConnected()
|
|
{
|
|
m_ctrl->switchContext(m_exerciseId);
|
|
|
|
m_established = true;
|
|
if (m_keepAliveEnabled)
|
|
m_keepAliveTimer.start();
|
|
DEBUG_LOG(m_logger) << "session established";
|
|
emit sessionEstablished();
|
|
}
|
|
|
|
void VdSession::onDisconnected()
|
|
{
|
|
m_keepAliveTimer.stop();
|
|
m_established = false;
|
|
DEBUG_LOG(m_logger) << "disconnected";
|
|
emit disconnected();
|
|
}
|
|
|
|
void VdSession::onKeepAliveTimerElapsed()
|
|
{
|
|
m_ctrl->keepAlive();
|
|
m_keepAliveTimer.start();
|
|
}
|
|
|
|
} // namespace AudioVideoManagement
|