continue refactoring
This commit is contained in:
@ -1,11 +1,15 @@
|
||||
#include "LocalPoolOwnerBase.h"
|
||||
|
||||
LocalPoolOwnerBase::LocalPoolOwnerBase(MessageQueueIF &queue, object_id_t objectId)
|
||||
#include <fsfw/datapool/PoolReadGuard.h>
|
||||
|
||||
LocalPoolOwnerBase::LocalPoolOwnerBase(MessageQueueIF &queue, MessageQueueId_t hkDestId,
|
||||
object_id_t objectId)
|
||||
: SystemObject(objectId),
|
||||
queue(queue),
|
||||
sharedPool(getObjectId()),
|
||||
hkHelper(this, &queue),
|
||||
dataset(sharedPool, lpool::testSetId) {}
|
||||
hkHelper(this, &queue, hkDestId),
|
||||
sharedPool(LocalPoolOwnerBase::getObjectId()),
|
||||
set1(sharedPool, lpool::testSetId1),
|
||||
set2(sharedPool, lpool::testSetId2),
|
||||
queue(queue) {}
|
||||
|
||||
LocalPoolOwnerBase::~LocalPoolOwnerBase() = default;
|
||||
|
||||
@ -68,15 +72,15 @@ ReturnValue_t LocalPoolOwnerBase::reset() {
|
||||
// resetSubscriptionList();
|
||||
ReturnValue_t status = returnvalue::OK;
|
||||
{
|
||||
PoolReadGuard readHelper(&dataset);
|
||||
PoolReadGuard readHelper(&set1);
|
||||
if (readHelper.getReadResult() != returnvalue::OK) {
|
||||
status = readHelper.getReadResult();
|
||||
}
|
||||
dataset.localPoolVarUint8.value = 0;
|
||||
dataset.localPoolVarFloat.value = 0.0;
|
||||
dataset.localPoolUint16Vec.value[0] = 0;
|
||||
dataset.localPoolUint16Vec.value[1] = 0;
|
||||
dataset.localPoolUint16Vec.value[2] = 0;
|
||||
set1.localPoolVarUint8.value = 0;
|
||||
set1.localPoolVarFloat.value = 0.0;
|
||||
set1.localPoolUint16Vec.value[0] = 0;
|
||||
set1.localPoolUint16Vec.value[1] = 0;
|
||||
set1.localPoolUint16Vec.value[2] = 0;
|
||||
// dataset.setValidity(false, true);
|
||||
}
|
||||
|
||||
@ -101,28 +105,4 @@ ReturnValue_t LocalPoolOwnerBase::reset() {
|
||||
return status;
|
||||
}
|
||||
|
||||
bool LocalPoolOwnerBase::changedDataSetCallbackWasCalled(sid_t &sid, store_address_t &storeId) {
|
||||
bool condition = false;
|
||||
if (not this->changedDatasetSid.notSet()) {
|
||||
condition = true;
|
||||
}
|
||||
sid = changedDatasetSid;
|
||||
storeId = storeIdForChangedSet;
|
||||
this->changedDatasetSid.raw = sid_t::INVALID_SID;
|
||||
this->storeIdForChangedSet = store_address_t::invalid();
|
||||
return condition;
|
||||
}
|
||||
|
||||
bool LocalPoolOwnerBase::changedVariableCallbackWasCalled(gp_id_t &gpid, store_address_t &storeId) {
|
||||
bool condition = false;
|
||||
if (not this->changedPoolVariableGpid.notSet()) {
|
||||
condition = true;
|
||||
}
|
||||
gpid = changedPoolVariableGpid;
|
||||
storeId = storeIdForChangedVariable;
|
||||
this->changedPoolVariableGpid.raw = gp_id_t::INVALID_GPID;
|
||||
this->storeIdForChangedVariable = store_address_t::invalid();
|
||||
return condition;
|
||||
}
|
||||
|
||||
void LocalPoolOwnerBase::setHkDestId(MessageQueueId_t id) { hkHelper.setHkDestinationId(id); }
|
||||
|
Reference in New Issue
Block a user