Migrates AudioVideoManagement to generated rtiddsgen API
Converts accessor calls to plain member access across avm service and plugin.
This commit is contained in:
29 files changed
+308
-295
No files matched your search
+15
-15
@@ -23,18 +23,18 @@ namespace
|
||||
|
||||
bool isAssigned(const InfrastructureManagement::InstrumentationAsset &asset)
|
||||
{
|
||||
return asset.availableInExercise().size() > 0;
|
||||
return asset.availableInExercise.size() > 0;
|
||||
}
|
||||
|
||||
int assignedExercise(const InfrastructureManagement::InstrumentationAsset &asset)
|
||||
{
|
||||
Q_ASSERT(asset.availableInExercise().size() == 1);
|
||||
return asset.availableInExercise()[0];
|
||||
Q_ASSERT(asset.availableInExercise.size() == 1);
|
||||
return asset.availableInExercise[0];
|
||||
}
|
||||
|
||||
bool isMountingPoint(const InfrastructureManagement::StructureElement &structureElement)
|
||||
{
|
||||
return structureElement.structureElementTypeId() == InfrastructureManagement::StructureElementType::MountingPoint;
|
||||
return structureElement.structureElementTypeId == InfrastructureManagement::StructureElementType::MountingPoint;
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -96,7 +96,7 @@ void AssetAssignmentManager::onMainStructureElementChanged(const InfrastructureM
|
||||
|
||||
if (modType == DataModification::eAdded)
|
||||
{
|
||||
for (const auto &structureElement: data.elements())
|
||||
for (const auto &structureElement: data.elements)
|
||||
{
|
||||
if (!isMountingPoint(structureElement))
|
||||
continue;
|
||||
@@ -115,11 +115,11 @@ void AssetAssignmentManager::onMainStructureElementChanged(const InfrastructureM
|
||||
// Are the contained StructureElements still the same as before?
|
||||
// For now we simply assume that the MountingPoints are still the same
|
||||
// and we just update them.
|
||||
for (const auto &structureElement: data.elements())
|
||||
for (const auto &structureElement: data.elements)
|
||||
{
|
||||
if (!isMountingPoint(structureElement))
|
||||
continue;
|
||||
MountingPoint *mountingPoint = findMountingPoint(structureElement.id()).second;
|
||||
MountingPoint *mountingPoint = findMountingPoint(structureElement.id).second;
|
||||
Q_ASSERT(mountingPoint);
|
||||
if (mountingPoint)
|
||||
mountingPoint->update(structureElement);
|
||||
@@ -162,10 +162,10 @@ void AssetAssignmentManager::addAsset(const InfrastructureManagement::Instrument
|
||||
*/
|
||||
void AssetAssignmentManager::modifyAsset(const InfrastructureManagement::InstrumentationAsset &asset)
|
||||
{
|
||||
if (hasPendingModifications(asset.id()))
|
||||
if (hasPendingModifications(asset.id))
|
||||
return m_pendingModifications.push_back(asset);
|
||||
|
||||
auto found = findAsset(asset.id());
|
||||
auto found = findAsset(asset.id);
|
||||
Asset *foundAsset = found.second;
|
||||
Q_ASSERT(foundAsset);
|
||||
|
||||
@@ -197,7 +197,7 @@ void AssetAssignmentManager::modifyAsset(const InfrastructureManagement::Instrum
|
||||
*/
|
||||
void AssetAssignmentManager::removeAsset(const InfrastructureManagement::InstrumentationAsset &asset)
|
||||
{
|
||||
auto assetAndExercise = findAsset(asset.id());
|
||||
auto assetAndExercise = findAsset(asset.id);
|
||||
Asset *foundAsset = assetAndExercise.second;
|
||||
Exercise *exercise = assetAndExercise.first;
|
||||
Q_ASSERT(foundAsset);
|
||||
@@ -258,14 +258,14 @@ void AssetAssignmentManager::unassignAsset(Asset *asset, Exercise *exercise, con
|
||||
*/
|
||||
void AssetAssignmentManager::addMount(const InfrastructureManagement::MountingPointAsset &mount)
|
||||
{
|
||||
Asset *asset = pool()->findAsset(mount.assetId());
|
||||
Asset *asset = pool()->findAsset(mount.assetId);
|
||||
if (!asset)
|
||||
{
|
||||
m_pendingMounts.push_back(mount);
|
||||
return;
|
||||
}
|
||||
|
||||
MountingPoint *mountingPoint = pool()->findMountingPoint(mount.structureElementId());
|
||||
MountingPoint *mountingPoint = pool()->findMountingPoint(mount.structureElementId);
|
||||
if (!mountingPoint)
|
||||
{
|
||||
m_pendingMounts.push_back(mount);
|
||||
@@ -279,7 +279,7 @@ void AssetAssignmentManager::addMount(const InfrastructureManagement::MountingPo
|
||||
|
||||
void AssetAssignmentManager::removeMount(const InfrastructureManagement::MountingPointAsset &mount)
|
||||
{
|
||||
auto exerciseAndAsset = findAsset(mount.assetId());
|
||||
auto exerciseAndAsset = findAsset(mount.assetId);
|
||||
Asset *asset = exerciseAndAsset.second;
|
||||
Exercise *exercise = exerciseAndAsset.first;
|
||||
Q_ASSERT(asset);
|
||||
@@ -304,7 +304,7 @@ void AssetAssignmentManager::tryUnmount(Asset *asset, Exercise *exercise)
|
||||
if (exercise)
|
||||
inPoolExercise = exercise == pool();
|
||||
else
|
||||
inPoolExercise = pool()->findAsset(asset->data().id());
|
||||
inPoolExercise = pool()->findAsset(asset->data().id);
|
||||
|
||||
if (!inPoolExercise)
|
||||
{
|
||||
@@ -366,7 +366,7 @@ void AssetAssignmentManager::processPendingRemoves()
|
||||
|
||||
bool AssetAssignmentManager::hasPendingModifications(int assetId)
|
||||
{
|
||||
auto idMatches = [assetId] (const InfrastructureManagement::InstrumentationAsset &asset) { return asset.id() == assetId; };
|
||||
auto idMatches = [assetId] (const InfrastructureManagement::InstrumentationAsset &asset) { return asset.id == assetId; };
|
||||
auto found = std::find_if(m_pendingModifications.begin(), m_pendingModifications.end(), idMatches);
|
||||
return found != m_pendingModifications.end();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user