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
+30
-30
@@ -25,9 +25,9 @@ AudioVideoManagement::MenuStruct toDdsToplevel(const AudioVideoManagement::Datab
|
||||
Q_ASSERT(dbEntry.name.isValid());
|
||||
|
||||
AudioVideoManagement::MenuStruct ms;
|
||||
ms.id(dbEntry.id);
|
||||
ms.name(dbEntry.name.toString().toStdString());
|
||||
ms.isAudio(dbEntry.isAudio);
|
||||
ms.id = dbEntry.id;
|
||||
ms.name = dbEntry.name.toString().toStdString();
|
||||
ms.isAudio = dbEntry.isAudio;
|
||||
|
||||
return ms;
|
||||
}
|
||||
@@ -46,13 +46,13 @@ void insertChildren(std::vector<AudioVideoManagement::AvMenuEntry>& contToAdd,
|
||||
bool lessToplevel(const AudioVideoManagement::AvMenuEntry &a,
|
||||
const AudioVideoManagement::AvMenuEntry &b)
|
||||
{
|
||||
return a.id() < b.id();
|
||||
return a.id < b.id;
|
||||
}
|
||||
|
||||
bool lessSublevel(const AudioVideoManagement::AvMenuEntry &a,
|
||||
const AudioVideoManagement::AvMenuEntry &b)
|
||||
{
|
||||
return std::make_tuple(a.parentId(), a.rowId(), a.id()) < std::make_tuple(b.parentId(), b.rowId(), b.id());
|
||||
return std::make_tuple(a.parentId, a.rowId, a.id) < std::make_tuple(b.parentId, b.rowId, b.id);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -67,14 +67,14 @@ AvMenuEntry HandlerMenuStruct::toDds(const Database::AvmMenuStruct &dbEntry)
|
||||
|
||||
AvMenuEntry ddsItem;
|
||||
|
||||
ddsItem.id(dbEntry.id);
|
||||
ddsItem.parentId(dbEntry.parentId);
|
||||
ddsItem.isGroup(dbEntry.isGroup);
|
||||
ddsItem.rowId(dbEntry.rowid);
|
||||
ddsItem.id = dbEntry.id;
|
||||
ddsItem.parentId = dbEntry.parentId;
|
||||
ddsItem.isGroup = dbEntry.isGroup;
|
||||
ddsItem.rowId = dbEntry.rowid;
|
||||
if (dbEntry.isGroup)
|
||||
{
|
||||
Q_ASSERT(dbEntry.name.isValid());
|
||||
ddsItem.name().set(dbEntry.name.toString().toStdString());
|
||||
ddsItem.name = dbEntry.name.toString().toStdString();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -84,8 +84,8 @@ AvMenuEntry HandlerMenuStruct::toDds(const Database::AvmMenuStruct &dbEntry)
|
||||
// Using the internal stream name here makes it easy for clients to directly
|
||||
// use those when communicating with AVS.
|
||||
Q_ASSERT(dbEntry.mountingPointId.isValid());
|
||||
ddsItem.mountingPointId(dbEntry.mountingPointId.toInt());
|
||||
ddsItem.name().set(AudioVideoHandlerImpl::internalStreamName(dbEntry.mountingPointId.toInt()).toStdString());
|
||||
ddsItem.mountingPointId = dbEntry.mountingPointId.toInt();
|
||||
ddsItem.name = AudioVideoHandlerImpl::internalStreamName(dbEntry.mountingPointId.toInt()).toStdString();
|
||||
}
|
||||
|
||||
return ddsItem;
|
||||
@@ -93,11 +93,11 @@ AvMenuEntry HandlerMenuStruct::toDds(const Database::AvmMenuStruct &dbEntry)
|
||||
|
||||
void HandlerMenuStruct::sortEntries(MenuStruct &menu)
|
||||
{
|
||||
auto isToplevel = [&menu] (const AvMenuEntry& entry) { return entry.parentId() == menu.id(); };
|
||||
auto sublevelStart = std::partition(menu.menuEntries().begin(), menu.menuEntries().end(), isToplevel);
|
||||
auto isToplevel = [&menu] (const AvMenuEntry& entry) { return entry.parentId == menu.id; };
|
||||
auto sublevelStart = std::partition(menu.menuEntries.begin(), menu.menuEntries.end(), isToplevel);
|
||||
|
||||
std::sort(menu.menuEntries().begin(), sublevelStart, lessToplevel);
|
||||
std::sort(sublevelStart, menu.menuEntries().end(), lessSublevel);
|
||||
std::sort(menu.menuEntries.begin(), sublevelStart, lessToplevel);
|
||||
std::sort(sublevelStart, menu.menuEntries.end(), lessSublevel);
|
||||
}
|
||||
|
||||
HandlerMenuStruct::HandlerMenuStruct(Interface::Dts *dts, Interface::Fts *fts, DatabaseInterface *db)
|
||||
@@ -163,7 +163,7 @@ void HandlerMenuStruct::reload()
|
||||
|
||||
for (const auto &ms : dbItems)
|
||||
{
|
||||
auto found = m_objMap.find(ms.id());
|
||||
auto found = m_objMap.find(ms.id);
|
||||
Q_ASSERT(found != m_objMap.end());
|
||||
(*found)->updateFromDb(ms);
|
||||
}
|
||||
@@ -184,7 +184,7 @@ QList<MenuStruct> HandlerMenuStruct::loadFromDb(bool &status)
|
||||
for (auto dbEntry = vecMenuStruct.begin(); dbEntry != sublevelStart; ++dbEntry)
|
||||
{
|
||||
MenuStruct ms = toDdsToplevel(*dbEntry);
|
||||
msMap.insert(ms.id(), ms);
|
||||
msMap.insert(ms.id, ms);
|
||||
}
|
||||
|
||||
// Go over all non-toplevel entries and create AvMenuEntries for those
|
||||
@@ -198,9 +198,9 @@ QList<MenuStruct> HandlerMenuStruct::loadFromDb(bool &status)
|
||||
MenuStruct &parent = it.value();
|
||||
|
||||
AudioVideoManagement::AvMenuEntry me = toDds(*dbEntry);
|
||||
parent.menuEntries().push_back(me);
|
||||
parent.menuEntries.push_back(me);
|
||||
|
||||
insertChildren(parent.menuEntries(), me.id(), vecMenuStruct);
|
||||
insertChildren(parent.menuEntries, me.id, vecMenuStruct);
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ QList<MenuStruct> HandlerMenuStruct::loadFromDb(bool &status)
|
||||
for (auto &ms : msMap)
|
||||
{
|
||||
sortEntries(ms);
|
||||
totalCount += ms.menuEntries().size();
|
||||
totalCount += ms.menuEntries.size();
|
||||
}
|
||||
Q_ASSERT(totalCount == vecMenuStruct.size());
|
||||
|
||||
@@ -224,7 +224,7 @@ void HandlerMenuStruct::onModifyMenuStructRequest(const rti::core::SampleIdentit
|
||||
const MenuStruct &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onModifyMenuStructRequest: " << request;
|
||||
auto ret = request.id() > 0 ? modifyMenuStructRequest(request) : createMenuStructRequest(request);
|
||||
auto ret = request.id > 0 ? modifyMenuStructRequest(request) : createMenuStructRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->modifyMenuStructReply(cookie, ret);
|
||||
@@ -234,7 +234,7 @@ Core::FunctionReplyObject HandlerMenuStruct::createMenuStructRequest(const MenuS
|
||||
{
|
||||
ObjectMenuStruct *ifs = new ObjectMenuStruct(m_dts, m_db);
|
||||
|
||||
DEBUG_LOG(m_logger) << "request.menuEntries.size() : " << request.menuEntries().size();
|
||||
DEBUG_LOG(m_logger) << "request.menuEntries.size() : " << request.menuEntries.size();
|
||||
Core::FunctionReplyObject ret = ifs->createFromDds(request);
|
||||
|
||||
if (ret.error())
|
||||
@@ -247,15 +247,15 @@ Core::FunctionReplyObject HandlerMenuStruct::createMenuStructRequest(const MenuS
|
||||
|
||||
Core::FunctionReplyObject HandlerMenuStruct::modifyMenuStructRequest(const MenuStruct &request)
|
||||
{
|
||||
ObjectMenuStruct *ifs = m_objMap.value(request.id());
|
||||
ObjectMenuStruct *ifs = m_objMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "MenuStruct with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "MenuStruct with id %1 not found")).arg(request.id);
|
||||
|
||||
auto ret = ifs->updateFromDds(request);
|
||||
if (ret.error())
|
||||
return ret;
|
||||
|
||||
Q_ASSERT(ifs->getId() == request.id());
|
||||
Q_ASSERT(ifs->getId() == request.id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -264,12 +264,12 @@ void HandlerMenuStruct::onRemoveMenuStructRequest(const rti::core::SampleIdentit
|
||||
{
|
||||
Core::FunctionReplyObject ret;
|
||||
|
||||
INFO_LOG(m_logger) << "onRemoveMenuStructRequest id = " << request.id();
|
||||
INFO_LOG(m_logger) << "onRemoveMenuStructRequest id = " << request.id;
|
||||
|
||||
ObjectMenuStruct *ifs = m_objMap.value(request.id());
|
||||
ObjectMenuStruct *ifs = m_objMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "MenuStruct with id %1 not found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "MenuStruct with id %1 not found")).arg(request.id);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -277,7 +277,7 @@ void HandlerMenuStruct::onRemoveMenuStructRequest(const rti::core::SampleIdentit
|
||||
|
||||
if (!ret.error())
|
||||
{
|
||||
m_objMap.remove(request.id());
|
||||
m_objMap.remove(request.id);
|
||||
delete ifs;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user