The datapool variables definition has been corrected. The controller is now working apparently well. It still needs to be tested with real data and devices.
This commit is contained in:
parent
510949b54d
commit
02bde1133e
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -8,106 +8,64 @@
|
||||
#include "../../../bsp_linux/fsfwconfig/datapool/dataPoolInit.h"
|
||||
|
||||
void dataPoolInit(std::map<uint32_t, PoolEntryIF*>* pool_map) {
|
||||
uint32_t testVar[1] = { 0 };
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::DUMMY1,
|
||||
new PoolEntry<uint32_t>(testVar, 1)));
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::DUMMY2,
|
||||
new PoolEntry<uint32_t>(testVar, 1)));
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::DUMMY3,
|
||||
new PoolEntry<uint32_t>(testVar, 1)));
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::DUMMY4,
|
||||
new PoolEntry<uint32_t>(testVar, 1)));
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::DUMMY5,
|
||||
new PoolEntry<uint32_t>(testVar, 1)));
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::DUMMY6,
|
||||
new PoolEntry<uint32_t>(testVar, 1)));
|
||||
int32_t testVarSigned[1] = { 0 };
|
||||
pool_map->insert(
|
||||
std::pair<int32_t, PoolEntryIF*>(datapool::LIMIT_VAR,
|
||||
new PoolEntry<int32_t>(testVarSigned, 1)));
|
||||
|
||||
/*float t_Centroid_PoolId[2] = {0,0};
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::Centroid_PoolId,
|
||||
new PoolEntry<float>(t_Centroid_PoolId, 2)));
|
||||
uint32_t t_CentroidTime_PoolId[2] = {0,0};
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::CentroidTime_PoolId,
|
||||
new PoolEntry<uint32_t>(t_CentroidTime_PoolId, 2)));*/
|
||||
|
||||
//Here the pool map entries of the Arduino DH are defined
|
||||
//Here the pool map entries of the DH and CONTROLLER are defined.
|
||||
|
||||
float Temperature_value[36] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<float, PoolEntryIF*>(datapool::Temperature_value,
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::Temperature_value,
|
||||
new PoolEntry<float>(Temperature_value, 36)));
|
||||
unsigned int Temperature_Timestamp[36] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<unsigned int, PoolEntryIF*>(datapool::Temperature_Timestamp,
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::Temperature_Timestamp,
|
||||
new PoolEntry<unsigned int>(Temperature_Timestamp, 36)));
|
||||
float Environmental_value[9] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<float, PoolEntryIF*>(datapool::Environmental_value,
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::Environmental_value,
|
||||
new PoolEntry<float>(Environmental_value, 9)));
|
||||
unsigned int Environmental_Timestamp[9] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<unsigned int, PoolEntryIF*>(datapool::Environmental_Timestamp,
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::Environmental_Timestamp,
|
||||
new PoolEntry<unsigned int>(Environmental_Timestamp, 9)));
|
||||
float Accelerometer_value[15] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<float, PoolEntryIF*>(datapool::Accelerometer_value,
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::Accelerometer_value,
|
||||
new PoolEntry<float>(Accelerometer_value, 15)));
|
||||
unsigned int Accelerometer_Timestamp[15] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<unsigned int, PoolEntryIF*>(datapool::Accelerometer_Timestamp,
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::Accelerometer_Timestamp,
|
||||
new PoolEntry<unsigned int>(Accelerometer_Timestamp, 15)));
|
||||
|
||||
float TEMP_SENSOR_CH1[1] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<float, PoolEntryIF*>(datapool::TEMP_SENSOR_CH1,
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::TEMP_SENSOR_CH1,
|
||||
new PoolEntry<float>(TEMP_SENSOR_CH1, 1)));
|
||||
float TEMP_SENSOR_CH2[1] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<float, PoolEntryIF*>(datapool::TEMP_SENSOR_CH2,
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::TEMP_SENSOR_CH2,
|
||||
new PoolEntry<float>(TEMP_SENSOR_CH2, 1)));
|
||||
|
||||
/*uint32_t Temp_COMPONENT_1[1] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::Temp_COMPONENT_1,
|
||||
new PoolEntry<uint32_t>(Temp_COMPONENT_1, 1)));*/
|
||||
uint32_t TargetState_COMPONENT_1[1] = {0};
|
||||
int8_t TargetState_COMPONENT_1[1] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::TargetState_COMPONENT_1,
|
||||
new PoolEntry<uint32_t>(TargetState_COMPONENT_1, 1)));
|
||||
uint32_t CurrentState_COMPONENT_1[1] = {0};
|
||||
new PoolEntry<int8_t>(TargetState_COMPONENT_1, 1)));
|
||||
int8_t CurrentState_COMPONENT_1[1] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::CurrentState_COMPONENT_1,
|
||||
new PoolEntry<uint32_t>(CurrentState_COMPONENT_1, 1)));
|
||||
uint32_t HeaterRequest_COMPONENT_1[1] = {0};
|
||||
new PoolEntry<int8_t>(CurrentState_COMPONENT_1, 1)));
|
||||
uint8_t HeaterRequest_COMPONENT_1[1] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::HeaterRequest_COMPONENT_1,
|
||||
new PoolEntry<uint32_t>(HeaterRequest_COMPONENT_1, 1)));
|
||||
/*uint32_t Temp_COMPONENT_2[1] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::Temp_COMPONENT_2,
|
||||
new PoolEntry<uint32_t>(Temp_COMPONENT_2, 1)));*/
|
||||
uint32_t TargetState_COMPONENT_2[1] = {0};
|
||||
new PoolEntry<uint8_t>(HeaterRequest_COMPONENT_1, 1)));
|
||||
int8_t TargetState_COMPONENT_2[1] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::TargetState_COMPONENT_2,
|
||||
new PoolEntry<uint32_t>(TargetState_COMPONENT_2, 1)));
|
||||
uint32_t CurrentState_COMPONENT_2[1] = {0};
|
||||
new PoolEntry<int8_t>(TargetState_COMPONENT_2, 1)));
|
||||
int8_t CurrentState_COMPONENT_2[1] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::CurrentState_COMPONENT_2,
|
||||
new PoolEntry<uint32_t>(CurrentState_COMPONENT_2, 1)));
|
||||
uint32_t HeaterRequest_COMPONENT_2[1] = {0};
|
||||
new PoolEntry<int8_t>(CurrentState_COMPONENT_2, 1)));
|
||||
uint8_t HeaterRequest_COMPONENT_2[1] = {0};
|
||||
pool_map->insert(
|
||||
std::pair<uint32_t, PoolEntryIF*>(datapool::HeaterRequest_COMPONENT_2,
|
||||
new PoolEntry<uint32_t>(HeaterRequest_COMPONENT_2, 1)));
|
||||
new PoolEntry<uint8_t>(HeaterRequest_COMPONENT_2, 1)));
|
||||
|
||||
}
|
||||
|
@ -12,60 +12,22 @@
|
||||
|
||||
namespace datapool {
|
||||
enum opus_variable_id {
|
||||
DUMMY1 = 0x100000,
|
||||
DUMMY2 = 0x100001,
|
||||
DUMMY3 = 0x100002,
|
||||
DUMMY4 = 0x100003,
|
||||
DUMMY5 = 0x100004,
|
||||
DUMMY6 = 0x100005,//TEST VAR
|
||||
LIMIT_VAR = 0x100006,
|
||||
TIME_STAMPER = 0x100007,
|
||||
|
||||
/* The IDs of the variables of the Arduino serial output are here defined.*/
|
||||
|
||||
/*
|
||||
Temperature.start_string = 0x100008,
|
||||
Temperature.Typ = 0x100009,
|
||||
Temperature.SPCChNumber = 0x100010,
|
||||
Temperature.Value_Cnt = 0x100011,
|
||||
Temperature.temperature = 0x100012,
|
||||
Temperature.Timestamp = 0x100013,
|
||||
Temperature.end_string = 0x100014,
|
||||
|
||||
Environmental.start_string = 0x100015,
|
||||
Environmental.Typ = 0x100016,
|
||||
Environmental.SPCChNumber = 0x100017,
|
||||
Environmental.Value_Cnt = 0x100018,
|
||||
Environmental.Value = 0x100019,
|
||||
Environmental.Timestamp = 0x100020,
|
||||
Environmental.end_string = 0x100021,
|
||||
|
||||
Accelerometer.start_string = 0x100022,
|
||||
Accelerometer.Typ = 0x100023,
|
||||
Accelerometer.SPCChNumber = 0x100024,
|
||||
Accelerometer.Value_Cnt = 0x100025,
|
||||
Accelerometer.Value = 0x100026,
|
||||
Accelerometer.Timestamp = 0x100027,
|
||||
Accelerometer.end_string = 0x100028,
|
||||
*/
|
||||
|
||||
Temperature_value = 0x100008,
|
||||
Temperature_Timestamp = 0x100009,
|
||||
Environmental_value = 0x100010,
|
||||
Environmental_Timestamp = 0x100011,
|
||||
Accelerometer_value = 0x100012,
|
||||
Accelerometer_Timestamp = 0x100013,
|
||||
|
||||
TEMP_SENSOR_CH1 = 0x100014,
|
||||
TEMP_SENSOR_CH2 = 0x100015,
|
||||
TargetState_COMPONENT_1 = 0x100016,
|
||||
CurrentState_COMPONENT_1 = 0x100017,
|
||||
HeaterRequest_COMPONENT_1 = 0x100018,
|
||||
TargetState_COMPONENT_2 = 0x100019,
|
||||
CurrentState_COMPONENT_2 = 0x100020,
|
||||
HeaterRequest_COMPONENT_2 = 0x100021
|
||||
//Temp_COMPONENT_1 = 0x100098,
|
||||
//Temp_COMPONENT_2 = 0x100099,
|
||||
// The IDs of the variables of the DH and CONTROLLER are here defined.
|
||||
Temperature_value = 0x100001,
|
||||
Temperature_Timestamp = 0x100002,
|
||||
Environmental_value = 0x10003,
|
||||
Environmental_Timestamp = 0x10004,
|
||||
Accelerometer_value = 0x10005,
|
||||
Accelerometer_Timestamp = 0x10006,
|
||||
TEMP_SENSOR_CH1 = 0x10007,
|
||||
TEMP_SENSOR_CH2 = 0x10008,
|
||||
TargetState_COMPONENT_1 = 0x10009,
|
||||
CurrentState_COMPONENT_1 = 0x100010,
|
||||
HeaterRequest_COMPONENT_1 = 0x100011,
|
||||
TargetState_COMPONENT_2 = 0x100012,
|
||||
CurrentState_COMPONENT_2 = 0x100013,
|
||||
HeaterRequest_COMPONENT_2 = 0x100014
|
||||
|
||||
|
||||
};
|
||||
|
@ -17,9 +17,9 @@ ReturnValue_t pollingSequenceArduinoFunction(
|
||||
uint32_t length = thisSequence->getPeriodMs();
|
||||
|
||||
thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0, 0);
|
||||
thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0.3, 1);
|
||||
thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0.2, 1);
|
||||
thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0.3, 2);
|
||||
thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0.4, 3);
|
||||
thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0.5, 3);
|
||||
|
||||
if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
|
@ -68,13 +68,25 @@ ReturnValue_t ArduinoDH::scanForReply(const uint8_t *start, size_t len,
|
||||
if (len == *foundLen){
|
||||
// start character: '['
|
||||
if (*start == 91 ){
|
||||
return APERIODIC_REPLY;
|
||||
return APERIODIC_REPLY;
|
||||
} else{
|
||||
return DeviceHandlerIF::LENGTH_MISSMATCH;
|
||||
}
|
||||
} else {
|
||||
return IGNORE_REPLY_DATA;
|
||||
}
|
||||
/*if (len == *foundLen){
|
||||
// start character: '['
|
||||
if (*start == 91 ){
|
||||
if (*start + 9 == 49) {
|
||||
return APERIODIC_REPLY;
|
||||
}
|
||||
} else{
|
||||
return DeviceHandlerIF::LENGTH_MISSMATCH;
|
||||
}
|
||||
} else {
|
||||
return IGNORE_REPLY_DATA;
|
||||
}*/
|
||||
}
|
||||
|
||||
ReturnValue_t ArduinoDH::interpretDeviceReply(DeviceCommandId_t id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user