Migrates OcSituation and ServiceManagement to generated rtiddsgen API
Converts accessor calls to plain member access in osc, oss and obd services.
This commit is contained in:
30 files changed
+1000
-1007
No files matched your search
@@ -73,13 +73,13 @@ GroupScheme *GroupHandler::groupSchemeFromType(Core::ServiceGroupType type)
|
||||
|
||||
// TODO: make generic ...
|
||||
QMap<Core::ServiceGroupType, QString> groupNameMapping;
|
||||
groupNameMapping.insert(Core::ServiceGroupType_def::Master, QLatin1String("Master"));
|
||||
groupNameMapping.insert(Core::ServiceGroupType_def::Core, QLatin1String("Core"));
|
||||
groupNameMapping.insert(Core::ServiceGroupType_def::ExercisePreparation, QLatin1String("ExercisePreparation"));
|
||||
groupNameMapping.insert(Core::ServiceGroupType_def::ExerciseExecution, QLatin1String("ExerciseExecution"));
|
||||
groupNameMapping.insert(Core::ServiceGroupType_def::ExercisePaused, QLatin1String("ExercisePaused"));
|
||||
groupNameMapping.insert(Core::ServiceGroupType_def::ExerciseAfterActionReview, QLatin1String("ExerciseAfterActionReview"));
|
||||
groupNameMapping.insert(Core::ServiceGroupType_def::Playback, QLatin1String("Playback"));
|
||||
groupNameMapping.insert(Core::ServiceGroupType::Master, QLatin1String("Master"));
|
||||
groupNameMapping.insert(Core::ServiceGroupType::Core, QLatin1String("Core"));
|
||||
groupNameMapping.insert(Core::ServiceGroupType::ExercisePreparation, QLatin1String("ExercisePreparation"));
|
||||
groupNameMapping.insert(Core::ServiceGroupType::ExerciseExecution, QLatin1String("ExerciseExecution"));
|
||||
groupNameMapping.insert(Core::ServiceGroupType::ExercisePaused, QLatin1String("ExercisePaused"));
|
||||
groupNameMapping.insert(Core::ServiceGroupType::ExerciseAfterActionReview, QLatin1String("ExerciseAfterActionReview"));
|
||||
groupNameMapping.insert(Core::ServiceGroupType::Playback, QLatin1String("Playback"));
|
||||
|
||||
// if no scheme with type type exists, it will be newly generated and added
|
||||
GroupScheme *newScheme = new GroupScheme(type, groupNameMapping.value(type));
|
||||
@@ -92,10 +92,10 @@ Group *GroupHandler::getGroup(const GroupRequest &groupToFind) const
|
||||
{
|
||||
for (Group *group : m_groups)
|
||||
{
|
||||
if (group->type() == groupToFind.type() &&
|
||||
group->exercisePartitionId() == groupToFind.exercisePartitionId() &&
|
||||
group->domainId() == groupToFind.domainId() &&
|
||||
group->replayPartitionId() == groupToFind.replayPartitionId())
|
||||
if (group->type() == groupToFind.type &&
|
||||
group->exercisePartitionId() == groupToFind.exercisePartitionId &&
|
||||
group->domainId() == groupToFind.domainId &&
|
||||
group->replayPartitionId() == groupToFind.replayPartitionId)
|
||||
return group;
|
||||
}
|
||||
return nullptr;
|
||||
@@ -110,7 +110,7 @@ Group *GroupHandler::getSimilarGroup(const GroupRequest &groupToFind) const
|
||||
bool bSimilar = false;
|
||||
for (const auto &type : possibleTypes)
|
||||
{
|
||||
if (type != groupToFind.type())
|
||||
if (type != groupToFind.type)
|
||||
continue;
|
||||
bSimilar = true;
|
||||
break;
|
||||
@@ -121,10 +121,10 @@ Group *GroupHandler::getSimilarGroup(const GroupRequest &groupToFind) const
|
||||
for(auto type : possibleTypes)
|
||||
{
|
||||
// don't find ourself ...
|
||||
if (type == groupToFind.type())
|
||||
if (type == groupToFind.type)
|
||||
continue;
|
||||
GroupRequest similarGroup(groupToFind);
|
||||
similarGroup.type(type);
|
||||
similarGroup.type = type;
|
||||
Group *groupFound = getGroup(similarGroup);
|
||||
if (groupFound)
|
||||
return groupFound;
|
||||
@@ -147,13 +147,13 @@ bool GroupHandler::startGroupCore(int32_t domainId)
|
||||
DEBUG_LOG(m_logger) << "Starting core group ...";
|
||||
|
||||
GroupRequest groupToSearch;
|
||||
groupToSearch.type(Core::ServiceGroupType::Core);
|
||||
groupToSearch.domainId(domainId);
|
||||
groupToSearch.type = Core::ServiceGroupType::Core;
|
||||
groupToSearch.domainId = domainId;
|
||||
Group *coreGroup = getGroup(groupToSearch);
|
||||
|
||||
if (coreGroup == nullptr)
|
||||
{
|
||||
GroupScheme *coreScheme = groupSchemeFromType(groupToSearch.type());
|
||||
GroupScheme *coreScheme = groupSchemeFromType(groupToSearch.type);
|
||||
|
||||
if (coreScheme == nullptr)
|
||||
{
|
||||
@@ -190,15 +190,15 @@ Core::FunctionReplyObject GroupHandler::onStartGroup(const GroupRequest &request
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "New StartGroupRequest: " << request;
|
||||
|
||||
if (request.domainId() != m_ddsHandler->connector()->getDomainId())
|
||||
return Core::FunctionReplyObject(request.requestId(),
|
||||
if (request.domainId != m_ddsHandler->connector()->getDomainId())
|
||||
return Core::FunctionReplyObject(request.requestId,
|
||||
tr_lts("dds", "This instance of ServiceManagement only allows to start a group in domain %1. Domain %2 was provided"))
|
||||
.arg(m_ddsHandler->connector()->getDomainId())
|
||||
.arg(request.domainId());
|
||||
.arg(request.domainId);
|
||||
|
||||
// special case: request.type == Master, ExerciseId != 0 -> stopp all
|
||||
if (request.type() == Core::ServiceGroupType::Master && request.exercisePartitionId() != 0)
|
||||
return onStopAllForExercise(request.domainId(), request.exercisePartitionId());
|
||||
if (request.type == Core::ServiceGroupType::Master && request.exercisePartitionId != 0)
|
||||
return onStopAllForExercise(request.domainId, request.exercisePartitionId);
|
||||
|
||||
Group *existingGroup = getGroup(request);
|
||||
// check if it's a Exercise group and search a group with the same exercise/domain -id
|
||||
@@ -206,10 +206,10 @@ Core::FunctionReplyObject GroupHandler::onStartGroup(const GroupRequest &request
|
||||
// if the group does not exist, it is newly created (normal case)
|
||||
if (existingGroup == nullptr)
|
||||
{
|
||||
GroupScheme *scheme = groupSchemeFromType(request.type());
|
||||
GroupScheme *scheme = groupSchemeFromType(request.type);
|
||||
if (scheme == nullptr)
|
||||
return Core::FunctionReplyObject(request.requestId(),
|
||||
tr_lts("dds", "Starting attempt of non existing group: %1")).arg(request.type().underlying());
|
||||
return Core::FunctionReplyObject(request.requestId,
|
||||
tr_lts("dds", "Starting attempt of non existing group: %1")).arg(static_cast<int>(request.type));
|
||||
|
||||
existingGroup = new Group(m_ddsHandler, m_serviceDonator, request, scheme, this);
|
||||
m_groups.append(existingGroup);
|
||||
@@ -230,7 +230,7 @@ Core::FunctionReplyObject GroupHandler::onStartGroup(const GroupRequest &request
|
||||
|
||||
existingGroup->start();
|
||||
|
||||
return Core::FunctionReplyObject(request.requestId());
|
||||
return Core::FunctionReplyObject(request.requestId);
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject GroupHandler::onStopAllForExercise(int domainId, int exercisePartitionId)
|
||||
@@ -286,7 +286,7 @@ Core::FunctionReplyObject GroupHandler::onStopGroup(const GroupRequest &request)
|
||||
Group *existingGroup = getGroup(request);
|
||||
|
||||
if (existingGroup == nullptr)
|
||||
return Core::FunctionReplyObject(request.requestId(),
|
||||
return Core::FunctionReplyObject(request.requestId,
|
||||
tr_lts("dds", "Could not stop Group, because it does not exist"));
|
||||
|
||||
existingGroup->stop();
|
||||
@@ -295,7 +295,7 @@ Core::FunctionReplyObject GroupHandler::onStopGroup(const GroupRequest &request)
|
||||
m_groups.removeAll(existingGroup);
|
||||
delete existingGroup;
|
||||
|
||||
return Core::FunctionReplyObject(request.requestId());
|
||||
return Core::FunctionReplyObject(request.requestId);
|
||||
}
|
||||
|
||||
void GroupHandler::onRestartGroupRequest(const rti::core::SampleIdentity &cookie,
|
||||
|
||||
Reference in new issue
Block a user