Migrates residual Lts sources to generated rtiddsgen API
Adds NmeaManagement tests, fixes codegen includes and Qt6 SerialPort CMake target.
This commit is contained in:
1 parent
5485a90385
commit
881d44f4dd
512 files changed
+6887
-6426
No files matched your search
+60
-60
@@ -100,7 +100,7 @@ void HandlerVideoReceiver::onVideoReceiverModifyRequest(const rti::core::SampleI
|
||||
const VideoReceiverModifyRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onVideoReceiverModifyRequest: " << request;
|
||||
auto ret = request.id() > 0 ? videoReceiverModifyRequest(request) : videoReceiverCreateRequest(request);
|
||||
auto ret = request.id > 0 ? videoReceiverModifyRequest(request) : videoReceiverCreateRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->videoReceiverModifyReply(cookie, ret);
|
||||
@@ -116,7 +116,7 @@ void HandlerVideoReceiver::onVideoReceiverModifyActiveRequest(const rti::core::S
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
else
|
||||
// activate channel here
|
||||
activateChannel(request.id(), request.isActive());
|
||||
activateChannel(request.id, request.isActive);
|
||||
m_fts->videoReceiverModifyActiveReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -134,17 +134,17 @@ void HandlerVideoReceiver::onVideoReceiverModifyAvsRequest(const rti::core::Samp
|
||||
VideoReceiver HandlerVideoReceiver::convert(const VideoReceiverModifyRequest &request)
|
||||
{
|
||||
VideoReceiver newData;
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
|
||||
if (ifs)
|
||||
newData = ifs->getData();
|
||||
newData.id(request.id());
|
||||
newData.mainStructureElementId(request.mainStructureElementId());
|
||||
newData.teamId(request.teamId());
|
||||
newData.streamName(request.streamName());
|
||||
newData.info(request.info());
|
||||
newData.hostName(request.hostName());
|
||||
newData.frequency(request.frequency());
|
||||
newData.isLocked(request.isLocked());
|
||||
newData.id = request.id;
|
||||
newData.mainStructureElementId = request.mainStructureElementId;
|
||||
newData.teamId = request.teamId;
|
||||
newData.streamName = request.streamName;
|
||||
newData.info = request.info;
|
||||
newData.hostName = request.hostName;
|
||||
newData.frequency = request.frequency;
|
||||
newData.isLocked = request.isLocked;
|
||||
return newData;
|
||||
}
|
||||
|
||||
@@ -152,12 +152,12 @@ VideoReceiver HandlerVideoReceiver::convert(const VideoReceiverModifyRequest &re
|
||||
VideoReceiver HandlerVideoReceiver::convertAvs(const VideoReceiverModifyAvsRequest &request)
|
||||
{
|
||||
VideoReceiver newData;
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
|
||||
if (ifs)
|
||||
newData = ifs->getData();
|
||||
newData.id(request.id());
|
||||
newData.dbm(request.dbm());
|
||||
newData.snr(request.snr());
|
||||
newData.id = request.id;
|
||||
newData.dbm = request.dbm;
|
||||
newData.snr = request.snr;
|
||||
return newData;
|
||||
}
|
||||
|
||||
@@ -165,11 +165,11 @@ VideoReceiver HandlerVideoReceiver::convertAvs(const VideoReceiverModifyAvsReque
|
||||
VideoReceiver HandlerVideoReceiver::convertActive(const VideoReceiverModifyActiveRequest &request)
|
||||
{
|
||||
VideoReceiver newData;
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
|
||||
if (ifs)
|
||||
newData = ifs->getData();
|
||||
newData.id(request.id());
|
||||
newData.isActive(request.isActive());
|
||||
newData.id = request.id;
|
||||
newData.isActive = request.isActive;
|
||||
return newData;
|
||||
}
|
||||
|
||||
@@ -177,9 +177,9 @@ VideoReceiver HandlerVideoReceiver::convertActive(const VideoReceiverModifyActiv
|
||||
Core::FunctionReplyObject HandlerVideoReceiver::videoReceiverModifyRequest(const VideoReceiverModifyRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "videoReceiverModifyRequest";
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id);
|
||||
|
||||
return ifs->updateObject(convert(request));
|
||||
}
|
||||
@@ -187,9 +187,9 @@ Core::FunctionReplyObject HandlerVideoReceiver::videoReceiverModifyRequest(const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject HandlerVideoReceiver::videoReceiverModifyActiveRequest(const VideoReceiverModifyActiveRequest &request)
|
||||
{
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id);
|
||||
|
||||
return ifs->updateObject(convertActive(request));
|
||||
}
|
||||
@@ -197,9 +197,9 @@ Core::FunctionReplyObject HandlerVideoReceiver::videoReceiverModifyActiveRequest
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject HandlerVideoReceiver::videoReceiverModifyAvsRequest(const VideoReceiverModifyAvsRequest &request)
|
||||
{
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id);
|
||||
|
||||
return ifs->updateObject(convertAvs(request));
|
||||
}
|
||||
@@ -223,18 +223,18 @@ void HandlerVideoReceiver::onVideoReceiverRemoveRequest(const rti::core::SampleI
|
||||
const Core::RemoveElementRequest &request)
|
||||
{
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
|
||||
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id);
|
||||
m_fts->videoReceiverRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_mainHandler->ddsHandler()->topicLockMaster()->isLocked(ifs->getData(), m_mainHandler->exerciseId()))
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Receiver '%1' is used by another user!")).arg(ifs->getId());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "Video Receiver '%1' is used by another user!")).arg(ifs->getId());
|
||||
m_fts->videoReceiverRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
@@ -247,7 +247,7 @@ void HandlerVideoReceiver::onVideoReceiverRemoveRequest(const rti::core::SampleI
|
||||
{
|
||||
// delete ObjectVideoReceiver
|
||||
delete ifs;
|
||||
m_videoReceiverObjMap.remove(request.id());
|
||||
m_videoReceiverObjMap.remove(request.id);
|
||||
}
|
||||
|
||||
m_fts->videoReceiverRemoveReply(cookie, ret);
|
||||
@@ -266,16 +266,16 @@ void HandlerVideoReceiver::onGetStatus()
|
||||
{
|
||||
i.next();
|
||||
ObjectVideoReceiver *objectVideoReceiver = i.value();
|
||||
QString host = QString::fromStdString(objectVideoReceiver->getData().hostName()).toLower();
|
||||
QString host = QString::fromStdString(objectVideoReceiver->getData().hostName).toLower();
|
||||
|
||||
DEBUG_LOG(m_logger) << " streamName=" << objectVideoReceiver->getData().streamName()
|
||||
DEBUG_LOG(m_logger) << " streamName=" << objectVideoReceiver->getData().streamName
|
||||
<< " hostName=" << host
|
||||
<< " teamId=" << objectVideoReceiver->getData().teamId();
|
||||
if ((objectVideoReceiver->getData().teamId() == 1)
|
||||
<< " teamId=" << objectVideoReceiver->getData().teamId;
|
||||
if ((objectVideoReceiver->getData().teamId == 1)
|
||||
&& (!m_receiver.contains(host)))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " onSendHttpRequest host=" << host << " key=" << i.key()
|
||||
<< " id=" << objectVideoReceiver->getData().id();
|
||||
<< " id=" << objectVideoReceiver->getData().id;
|
||||
m_receiver.insert(host, i.key());
|
||||
onSendHttpRequest(i.key());
|
||||
}
|
||||
@@ -289,7 +289,7 @@ void HandlerVideoReceiver::onSendHttpRequest(const int key)
|
||||
//request = QStringLiteral("http://localhost/set_param?remuxBitrate=90.0");
|
||||
//request = QStringLiteral("http://localhost/status.json");
|
||||
ObjectVideoReceiver *objectVideoReceiver = m_videoReceiverObjMap.value(key);
|
||||
QString hostname = QString::fromStdString(objectVideoReceiver->getData().hostName());
|
||||
QString hostname = QString::fromStdString(objectVideoReceiver->getData().hostName);
|
||||
const QString request = QStringLiteral("http://%1/status.json").arg(hostname);
|
||||
|
||||
startRequest(QUrl(request));
|
||||
@@ -547,13 +547,13 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply)
|
||||
ObjectVideoReceiver *objectVideoReceiver = i.value();
|
||||
DEBUG_LOG(m_logger) << "key=" << i.key()
|
||||
<< " : value.Id=" << objectVideoReceiver->getId()
|
||||
<< " mse=" << objectVideoReceiver->getData().mainStructureElementId()
|
||||
<< " streamName=" << objectVideoReceiver->getData().streamName()
|
||||
<< " hostName=" << objectVideoReceiver->getData().hostName()
|
||||
<< " teamId=" << objectVideoReceiver->getData().teamId()
|
||||
<< " snr=" << objectVideoReceiver->getData().snr()
|
||||
<< " dbm=" << objectVideoReceiver->getData().dbm()
|
||||
<< " isActive=" << objectVideoReceiver->getData().isActive();
|
||||
<< " mse=" << objectVideoReceiver->getData().mainStructureElementId
|
||||
<< " streamName=" << objectVideoReceiver->getData().streamName
|
||||
<< " hostName=" << objectVideoReceiver->getData().hostName
|
||||
<< " teamId=" << objectVideoReceiver->getData().teamId
|
||||
<< " snr=" << objectVideoReceiver->getData().snr
|
||||
<< " dbm=" << objectVideoReceiver->getData().dbm
|
||||
<< " isActive=" << objectVideoReceiver->getData().isActive;
|
||||
}
|
||||
reply->deleteLater();
|
||||
checkActiveState(key, remuxInputMask);
|
||||
@@ -566,17 +566,17 @@ void HandlerVideoReceiver::updateObject(const int key, const double powerLevel,
|
||||
if (ifs)
|
||||
{
|
||||
newData = ifs->getData();
|
||||
newData.id(ifs->getId());
|
||||
newData.mainStructureElementId(ifs->getData().mainStructureElementId());
|
||||
newData.teamId(ifs->getData().teamId());
|
||||
newData.streamName(ifs->getData().streamName());
|
||||
newData.hostName(ifs->getData().hostName());
|
||||
newData.info(ifs->getData().info());
|
||||
newData.dbm(powerLevel);
|
||||
newData.snr(snr);
|
||||
newData.isActive(ifs->getData().isActive());
|
||||
newData.isLocked(lockstatus);
|
||||
newData.frequency(frequency);
|
||||
newData.id = ifs->getId();
|
||||
newData.mainStructureElementId = ifs->getData().mainStructureElementId;
|
||||
newData.teamId = ifs->getData().teamId;
|
||||
newData.streamName = ifs->getData().streamName;
|
||||
newData.hostName = ifs->getData().hostName;
|
||||
newData.info = ifs->getData().info;
|
||||
newData.dbm = powerLevel;
|
||||
newData.snr = snr;
|
||||
newData.isActive = ifs->getData().isActive;
|
||||
newData.isLocked = lockstatus;
|
||||
newData.frequency = frequency;
|
||||
ifs->updateObject(newData);
|
||||
}
|
||||
}
|
||||
@@ -584,7 +584,7 @@ void HandlerVideoReceiver::updateObject(const int key, const double powerLevel,
|
||||
void HandlerVideoReceiver::activateChannel(const int channelId, const bool activate)
|
||||
{
|
||||
// send new Host HTTP-Request to VideoReceiver
|
||||
QString hostName = QString::fromStdString(m_videoReceiverObjMap.value(channelId)->getData().hostName());
|
||||
QString hostName = QString::fromStdString(m_videoReceiverObjMap.value(channelId)->getData().hostName);
|
||||
int active1 = 0;
|
||||
int active2 = 0;
|
||||
int active = 0;
|
||||
@@ -592,7 +592,7 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ
|
||||
DEBUG_LOG(m_logger) << "activateChannel channelId=" << channelId
|
||||
<< " activate = " << activate
|
||||
<< " hostname = " << hostName
|
||||
<< " teamId = " << m_videoReceiverObjMap.value(channelId)->getData().teamId();
|
||||
<< " teamId = " << m_videoReceiverObjMap.value(channelId)->getData().teamId;
|
||||
|
||||
// make sure there are 2 channels
|
||||
|
||||
@@ -602,7 +602,7 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_videoReceiverObjMap.value(channelId)->getData().teamId() == 1)
|
||||
if (m_videoReceiverObjMap.value(channelId)->getData().teamId == 1)
|
||||
{
|
||||
id = channelId;
|
||||
active1 = activate;
|
||||
@@ -611,14 +611,14 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ
|
||||
ERROR_LOG(m_logger) << "channelId " << id + 1 << " does not exist";
|
||||
return;
|
||||
}
|
||||
active2 = m_videoReceiverObjMap.value(id + 1)->getData().isActive();
|
||||
active2 = m_videoReceiverObjMap.value(id + 1)->getData().isActive;
|
||||
}
|
||||
else
|
||||
{
|
||||
id = channelId - 1;
|
||||
if (!m_videoReceiverObjMap.contains(id))
|
||||
return;
|
||||
active1 = m_videoReceiverObjMap.value(id)->getData().isActive();
|
||||
active1 = m_videoReceiverObjMap.value(id)->getData().isActive;
|
||||
active2 = activate;
|
||||
}
|
||||
active = active1 + active2 * 2;
|
||||
@@ -646,10 +646,10 @@ void HandlerVideoReceiver::checkActiveState(const int key, const int remuxInputM
|
||||
<< " remuxInputMask=" << remuxInputMask << " channel1 == nullptr";
|
||||
return;
|
||||
}
|
||||
int channel1Active = channel1->getData().isActive();
|
||||
QString host = QString::fromStdString(channel1->getData().hostName()).toLower();
|
||||
int channel1Active = channel1->getData().isActive;
|
||||
QString host = QString::fromStdString(channel1->getData().hostName).toLower();
|
||||
ObjectVideoReceiver *channel2 = m_videoReceiverObjMap.value(key + 1);
|
||||
int channel2Active = channel2->getData().isActive();
|
||||
int channel2Active = channel2->getData().isActive;
|
||||
int active = channel1Active + channel2Active * 2;
|
||||
DEBUG_LOG(m_logger) << "checkActiveState "
|
||||
<< " key=" << key
|
||||
|
||||
Reference in new issue
Block a user