|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_IMTQDEFINITIONS_H_
|
|
|
|
|
#define MISSION_DEVICES_DEVICEDEFINITIONS_IMTQDEFINITIONS_H_
|
|
|
|
|
|
|
|
|
|
#include <fsfw/datapool/PoolReadGuard.h>
|
|
|
|
|
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
|
|
|
|
|
|
|
|
|
|
namespace IMTQ {
|
|
|
|
@ -27,15 +28,18 @@ static const uint8_t GET_TEMP_REPLY_SIZE = 2;
|
|
|
|
|
static const uint8_t CFGR_CMD_SIZE = 3;
|
|
|
|
|
static const uint8_t POINTER_REG_SIZE = 1;
|
|
|
|
|
|
|
|
|
|
static const uint32_t ENG_HK_DATA_SET_ID = 1;
|
|
|
|
|
static const uint32_t CAL_MTM_SET = 2;
|
|
|
|
|
static const uint32_t RAW_MTM_SET = 3;
|
|
|
|
|
static const uint32_t POS_X_TEST_DATASET = 4;
|
|
|
|
|
static const uint32_t NEG_X_TEST_DATASET = 5;
|
|
|
|
|
static const uint32_t POS_Y_TEST_DATASET = 6;
|
|
|
|
|
static const uint32_t NEG_Y_TEST_DATASET = 7;
|
|
|
|
|
static const uint32_t POS_Z_TEST_DATASET = 8;
|
|
|
|
|
static const uint32_t NEG_Z_TEST_DATASET = 9;
|
|
|
|
|
enum SetIds : uint32_t {
|
|
|
|
|
ENG_HK = 1,
|
|
|
|
|
CAL_MGM = 2,
|
|
|
|
|
RAW_MGM = 3,
|
|
|
|
|
POS_X_TEST = 4,
|
|
|
|
|
NEG_X_TEST = 5,
|
|
|
|
|
POS_Y_TEST = 6,
|
|
|
|
|
NEG_Y_TEST = 7,
|
|
|
|
|
POS_Z_TEST = 8,
|
|
|
|
|
NEG_Z_TEST = 9,
|
|
|
|
|
DIPOLES = 10
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const uint8_t SIZE_ENG_HK_COMMAND = 1;
|
|
|
|
|
static const uint8_t SIZE_STATUS_REPLY = 2;
|
|
|
|
@ -103,7 +107,7 @@ static const uint8_t Z_NEGATIVE = 0x6;
|
|
|
|
|
static const uint8_t FINA = 0x7;
|
|
|
|
|
} // namespace SELF_TEST_STEPS
|
|
|
|
|
|
|
|
|
|
enum IMTQPoolIds : lp_id_t {
|
|
|
|
|
enum PoolIds : lp_id_t {
|
|
|
|
|
DIGITAL_VOLTAGE_MV,
|
|
|
|
|
ANALOG_VOLTAGE_MV,
|
|
|
|
|
DIGITAL_CURRENT,
|
|
|
|
@ -119,6 +123,10 @@ enum IMTQPoolIds : lp_id_t {
|
|
|
|
|
ACTUATION_CAL_STATUS,
|
|
|
|
|
MTM_RAW,
|
|
|
|
|
ACTUATION_RAW_STATUS,
|
|
|
|
|
DIPOLES_X,
|
|
|
|
|
DIPOLES_Y,
|
|
|
|
|
DIPOLES_Z,
|
|
|
|
|
CURRENT_TORQUE_DURATION,
|
|
|
|
|
|
|
|
|
|
INIT_POS_X_ERR,
|
|
|
|
|
INIT_POS_X_RAW_MAG_X,
|
|
|
|
@ -375,9 +383,9 @@ enum IMTQPoolIds : lp_id_t {
|
|
|
|
|
|
|
|
|
|
class EngHkDataset : public StaticLocalDataSet<ENG_HK_SET_POOL_ENTRIES> {
|
|
|
|
|
public:
|
|
|
|
|
EngHkDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, ENG_HK_DATA_SET_ID) {}
|
|
|
|
|
EngHkDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, IMTQ::SetIds::ENG_HK) {}
|
|
|
|
|
|
|
|
|
|
EngHkDataset(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, ENG_HK_DATA_SET_ID)) {}
|
|
|
|
|
EngHkDataset(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::ENG_HK)) {}
|
|
|
|
|
|
|
|
|
|
lp_var_t<uint16_t> digitalVoltageMv = lp_var_t<uint16_t>(sid.objectId, DIGITAL_VOLTAGE_MV, this);
|
|
|
|
|
lp_var_t<uint16_t> analogVoltageMv = lp_var_t<uint16_t>(sid.objectId, ANALOG_VOLTAGE_MV, this);
|
|
|
|
@ -398,13 +406,14 @@ class EngHkDataset : public StaticLocalDataSet<ENG_HK_SET_POOL_ENTRIES> {
|
|
|
|
|
*/
|
|
|
|
|
class CalibratedMtmMeasurementSet : public StaticLocalDataSet<CAL_MTM_POOL_ENTRIES> {
|
|
|
|
|
public:
|
|
|
|
|
CalibratedMtmMeasurementSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CAL_MTM_SET) {}
|
|
|
|
|
CalibratedMtmMeasurementSet(HasLocalDataPoolIF* owner)
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::SetIds::CAL_MGM) {}
|
|
|
|
|
|
|
|
|
|
CalibratedMtmMeasurementSet(object_id_t objectId)
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, CAL_MTM_SET)) {}
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::CAL_MGM)) {}
|
|
|
|
|
|
|
|
|
|
/** The unit of all measurements is nT */
|
|
|
|
|
lp_vec_t<int32_t, 3> mgmXyz = lp_vec_t<int32_t, 3>(sid.objectId, MGM_CAL_NT);
|
|
|
|
|
lp_vec_t<int32_t, 3> mgmXyz = lp_vec_t<int32_t, 3>(sid.objectId, MGM_CAL_NT, this);
|
|
|
|
|
/** 1 if coils were actuating during measurement otherwise 0 */
|
|
|
|
|
lp_var_t<uint8_t> coilActuationStatus =
|
|
|
|
|
lp_var_t<uint8_t>(sid.objectId, ACTUATION_CAL_STATUS, this);
|
|
|
|
@ -415,9 +424,11 @@ class CalibratedMtmMeasurementSet : public StaticLocalDataSet<CAL_MTM_POOL_ENTRI
|
|
|
|
|
*/
|
|
|
|
|
class RawMtmMeasurementSet : public StaticLocalDataSet<CAL_MTM_POOL_ENTRIES> {
|
|
|
|
|
public:
|
|
|
|
|
RawMtmMeasurementSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, RAW_MTM_SET) {}
|
|
|
|
|
RawMtmMeasurementSet(HasLocalDataPoolIF* owner)
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::SetIds::RAW_MGM) {}
|
|
|
|
|
|
|
|
|
|
RawMtmMeasurementSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, RAW_MTM_SET)) {}
|
|
|
|
|
RawMtmMeasurementSet(object_id_t objectId)
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::RAW_MGM)) {}
|
|
|
|
|
|
|
|
|
|
/** The unit of all measurements is nT */
|
|
|
|
|
lp_vec_t<float, 3> mtmRawNt = lp_vec_t<float, 3>(sid.objectId, MTM_RAW, this);
|
|
|
|
@ -462,6 +473,40 @@ class CommandDipolePacket : public SerialLinkedListAdapter<SerializeIF> {
|
|
|
|
|
SerializeElement<uint16_t> duration;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class DipoleActuationSet : public StaticLocalDataSet<4> {
|
|
|
|
|
public:
|
|
|
|
|
DipoleActuationSet(HasLocalDataPoolIF& owner)
|
|
|
|
|
: StaticLocalDataSet(&owner, IMTQ::SetIds::DIPOLES) {}
|
|
|
|
|
DipoleActuationSet(object_id_t objectId)
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::DIPOLES)) {}
|
|
|
|
|
|
|
|
|
|
void setDipoles(uint16_t xDipole_, uint16_t yDipole_, uint16_t zDipole_,
|
|
|
|
|
uint16_t currentTorqueDurationMs_) {
|
|
|
|
|
PoolReadGuard pg(this);
|
|
|
|
|
newActuation = false;
|
|
|
|
|
if (xDipole.value != xDipole_) {
|
|
|
|
|
newActuation = true;
|
|
|
|
|
}
|
|
|
|
|
xDipole = xDipole_;
|
|
|
|
|
if (yDipole.value != yDipole_) {
|
|
|
|
|
newActuation = true;
|
|
|
|
|
}
|
|
|
|
|
yDipole = yDipole_;
|
|
|
|
|
if (zDipole.value != zDipole_) {
|
|
|
|
|
newActuation = true;
|
|
|
|
|
}
|
|
|
|
|
zDipole = zDipole_;
|
|
|
|
|
currentTorqueDurationMs = currentTorqueDurationMs_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
lp_var_t<uint16_t> xDipole = lp_var_t<uint16_t>(sid.objectId, DIPOLES_X, this);
|
|
|
|
|
lp_var_t<uint16_t> yDipole = lp_var_t<uint16_t>(sid.objectId, DIPOLES_Y, this);
|
|
|
|
|
lp_var_t<uint16_t> zDipole = lp_var_t<uint16_t>(sid.objectId, DIPOLES_Z, this);
|
|
|
|
|
lp_var_t<uint16_t> currentTorqueDurationMs =
|
|
|
|
|
lp_var_t<uint16_t>(sid.objectId, CURRENT_TORQUE_DURATION, this);
|
|
|
|
|
bool newActuation = false;
|
|
|
|
|
};
|
|
|
|
|
/**
|
|
|
|
|
* @brief This dataset can be used to store the self test results of the +X self test.
|
|
|
|
|
*
|
|
|
|
@ -479,10 +524,10 @@ class CommandDipolePacket : public SerialLinkedListAdapter<SerializeIF> {
|
|
|
|
|
class PosXSelfTestSet : public StaticLocalDataSet<SELF_TEST_DATASET_ENTRIES> {
|
|
|
|
|
public:
|
|
|
|
|
PosXSelfTestSet(HasLocalDataPoolIF* owner)
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::POS_X_TEST_DATASET) {}
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::SetIds::POS_X_TEST) {}
|
|
|
|
|
|
|
|
|
|
PosXSelfTestSet(object_id_t objectId)
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::POS_X_TEST_DATASET)) {}
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::POS_X_TEST)) {}
|
|
|
|
|
|
|
|
|
|
/** INIT block */
|
|
|
|
|
lp_var_t<uint8_t> initErr = lp_var_t<uint8_t>(sid.objectId, INIT_POS_X_ERR, this);
|
|
|
|
@ -556,10 +601,10 @@ class PosXSelfTestSet : public StaticLocalDataSet<SELF_TEST_DATASET_ENTRIES> {
|
|
|
|
|
class NegXSelfTestSet : public StaticLocalDataSet<SELF_TEST_DATASET_ENTRIES> {
|
|
|
|
|
public:
|
|
|
|
|
NegXSelfTestSet(HasLocalDataPoolIF* owner)
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::NEG_X_TEST_DATASET) {}
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::SetIds::NEG_X_TEST) {}
|
|
|
|
|
|
|
|
|
|
NegXSelfTestSet(object_id_t objectId)
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::NEG_X_TEST_DATASET)) {}
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::NEG_X_TEST)) {}
|
|
|
|
|
|
|
|
|
|
/** INIT block */
|
|
|
|
|
lp_var_t<uint8_t> initErr = lp_var_t<uint8_t>(sid.objectId, INIT_NEG_X_ERR, this);
|
|
|
|
@ -633,10 +678,10 @@ class NegXSelfTestSet : public StaticLocalDataSet<SELF_TEST_DATASET_ENTRIES> {
|
|
|
|
|
class PosYSelfTestSet : public StaticLocalDataSet<SELF_TEST_DATASET_ENTRIES> {
|
|
|
|
|
public:
|
|
|
|
|
PosYSelfTestSet(HasLocalDataPoolIF* owner)
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::POS_Y_TEST_DATASET) {}
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::SetIds::POS_Y_TEST) {}
|
|
|
|
|
|
|
|
|
|
PosYSelfTestSet(object_id_t objectId)
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::POS_Y_TEST_DATASET)) {}
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::POS_Y_TEST)) {}
|
|
|
|
|
|
|
|
|
|
/** INIT block */
|
|
|
|
|
lp_var_t<uint8_t> initErr = lp_var_t<uint8_t>(sid.objectId, INIT_POS_Y_ERR, this);
|
|
|
|
@ -710,10 +755,10 @@ class PosYSelfTestSet : public StaticLocalDataSet<SELF_TEST_DATASET_ENTRIES> {
|
|
|
|
|
class NegYSelfTestSet : public StaticLocalDataSet<SELF_TEST_DATASET_ENTRIES> {
|
|
|
|
|
public:
|
|
|
|
|
NegYSelfTestSet(HasLocalDataPoolIF* owner)
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::NEG_Y_TEST_DATASET) {}
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::SetIds::NEG_Y_TEST) {}
|
|
|
|
|
|
|
|
|
|
NegYSelfTestSet(object_id_t objectId)
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::NEG_Y_TEST_DATASET)) {}
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::NEG_Y_TEST)) {}
|
|
|
|
|
|
|
|
|
|
/** INIT block */
|
|
|
|
|
lp_var_t<uint8_t> initErr = lp_var_t<uint8_t>(sid.objectId, INIT_NEG_Y_ERR, this);
|
|
|
|
@ -787,10 +832,10 @@ class NegYSelfTestSet : public StaticLocalDataSet<SELF_TEST_DATASET_ENTRIES> {
|
|
|
|
|
class PosZSelfTestSet : public StaticLocalDataSet<SELF_TEST_DATASET_ENTRIES> {
|
|
|
|
|
public:
|
|
|
|
|
PosZSelfTestSet(HasLocalDataPoolIF* owner)
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::POS_Z_TEST_DATASET) {}
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::SetIds::POS_Z_TEST) {}
|
|
|
|
|
|
|
|
|
|
PosZSelfTestSet(object_id_t objectId)
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::POS_Z_TEST_DATASET)) {}
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::POS_Z_TEST)) {}
|
|
|
|
|
|
|
|
|
|
/** INIT block */
|
|
|
|
|
lp_var_t<uint8_t> initErr = lp_var_t<uint8_t>(sid.objectId, INIT_POS_Z_ERR, this);
|
|
|
|
@ -864,10 +909,10 @@ class PosZSelfTestSet : public StaticLocalDataSet<SELF_TEST_DATASET_ENTRIES> {
|
|
|
|
|
class NegZSelfTestSet : public StaticLocalDataSet<SELF_TEST_DATASET_ENTRIES> {
|
|
|
|
|
public:
|
|
|
|
|
NegZSelfTestSet(HasLocalDataPoolIF* owner)
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::NEG_Z_TEST_DATASET) {}
|
|
|
|
|
: StaticLocalDataSet(owner, IMTQ::SetIds::NEG_Z_TEST) {}
|
|
|
|
|
|
|
|
|
|
NegZSelfTestSet(object_id_t objectId)
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::NEG_Z_TEST_DATASET)) {}
|
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, IMTQ::SetIds::NEG_Z_TEST)) {}
|
|
|
|
|
|
|
|
|
|
/** INIT block */
|
|
|
|
|
lp_var_t<uint8_t> initErr = lp_var_t<uint8_t>(sid.objectId, INIT_NEG_Z_ERR, this);
|
|
|
|
|