918 lines
25 KiB
C++
918 lines
25 KiB
C++
#include "StarTrackerJsonCommands.h"
|
|
|
|
#include "ArcsecJsonKeys.h"
|
|
|
|
Limits::Limits() : ArcsecJsonParamBase(arcseckeys::LIMITS) {}
|
|
|
|
size_t Limits::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t Limits::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::LIMITS);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::ACTION, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::FPGA18CURRENT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::FPGA25CURRENT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::FPGA10CURRENT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::MCUCURRENT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::CMOS21CURRENT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::CMOSPIXCURRENT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::CMOS33CURRENT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::CMOSVRESCURRENT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::CMOS_TEMPERATURE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::MCU_TEMPERATURE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
return RETURN_OK;
|
|
}
|
|
|
|
Tracking::Tracking() : ArcsecJsonParamBase(arcseckeys::TRACKING) {}
|
|
|
|
size_t Tracking::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t Tracking::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::TRACKING);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::THIN_LIMIT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::OUTLIER_THRESHOLD, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::OUTLIER_THRESHOLD_QUEST, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::TRACKER_CHOICE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
return RETURN_OK;
|
|
}
|
|
|
|
Mounting::Mounting() : ArcsecJsonParamBase(arcseckeys::MOUNTING) {}
|
|
|
|
size_t Mounting::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t Mounting::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::MOUNTING);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::qw, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::qx, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::qy, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::qz, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
return RETURN_OK;
|
|
}
|
|
|
|
ImageProcessor::ImageProcessor() : ArcsecJsonParamBase(arcseckeys::IMAGE_PROCESSOR) {}
|
|
|
|
size_t ImageProcessor::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t ImageProcessor::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::IMAGE_PROCESSOR);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::IMAGE_PROCESSOR_MODE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::STORE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::SIGNAL_THRESHOLD, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint16(param, buffer + offset);
|
|
offset += sizeof(uint16_t);
|
|
result = getParam(arcseckeys::IMAGE_PROCESSOR_DARK_THRESHOLD, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint16(param, buffer + offset);
|
|
offset += sizeof(uint16_t);
|
|
result = getParam(arcseckeys::BACKGROUND_COMPENSATION, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
return RETURN_OK;
|
|
}
|
|
|
|
Camera::Camera() : ArcsecJsonParamBase(arcseckeys::CAMERA) {}
|
|
|
|
size_t Camera::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t Camera::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::CAMERA);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::MODE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::FOCALLENGTH, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::EXPOSURE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::INTERVAL, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::OFFSET, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addint16(param, buffer + offset);
|
|
offset += sizeof(int16_t);
|
|
result = getParam(arcseckeys::PGAGAIN, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::ADCGAIN, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::REG_1, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::VAL_1, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::REG_2, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::VAL_2, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::REG_3, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::VAL_3, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::REG_4, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::VAL_4, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::REG_5, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::VAL_5, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::REG_6, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::VAL_6, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::REG_7, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::VAL_7, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::REG_8, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::VAL_8, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::FREQ_1, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint32(param, buffer + offset);
|
|
return RETURN_OK;
|
|
}
|
|
|
|
Centroiding::Centroiding() : ArcsecJsonParamBase(arcseckeys::CENTROIDING) {}
|
|
|
|
size_t Centroiding::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t Centroiding::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::CENTROIDING);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::ENABLE_FILTER, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::MAX_QUALITY, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::DARK_THRESHOLD, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::MIN_QUALITY, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::MAX_INTENSITY, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::MIN_INTENSITY, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::MAX_MAGNITUDE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::GAUSSIAN_CMAX, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::GAUSSIAN_CMIN, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::TRANSMATRIX_00, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::TRANSMATRIX_01, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::TRANSMATRIX_10, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::TRANSMATRIX_11, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
return RETURN_OK;
|
|
}
|
|
|
|
Lisa::Lisa() : ArcsecJsonParamBase(arcseckeys::LISA) {}
|
|
|
|
size_t Lisa::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t Lisa::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::LISA);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::LISA_MODE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint32(param, buffer + offset);
|
|
offset += sizeof(uint32_t);
|
|
result = getParam(arcseckeys::PREFILTER_DIST_THRESHOLD, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::PREFILTER_ANGLE_THRESHOLD, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::FOV_WIDTH, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::FOV_HEIGHT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::FLOAT_STAR_LIMIT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::CLOSE_STAR_LIMIT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::RATING_WEIGHT_CLOSE_STAR_COUNT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::RATING_WEIGHT_FRACTION_CLOSE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::RATING_WEIGHT_MEAN_SUM, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::RATING_WEIGHT_DB_STAR_COUNT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::MAX_COMBINATIONS, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::NR_STARS_STOP, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::FRACTION_CLOSE_STOP, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
return RETURN_OK;
|
|
}
|
|
|
|
Matching::Matching() : ArcsecJsonParamBase(arcseckeys::MATCHING) {}
|
|
|
|
size_t Matching::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t Matching::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::MATCHING);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::SQUARED_DISTANCE_LIMIT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::SQUARED_SHIFT_LIMIT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
return RETURN_OK;
|
|
}
|
|
|
|
Validation::Validation() : ArcsecJsonParamBase(arcseckeys::VALIDATION) {}
|
|
|
|
size_t Validation::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t Validation::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::VALIDATION);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::STABLE_COUNT, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::MAX_DIFFERENCE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::MIN_TRACKER_CONFIDENCE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::MIN_MATCHED_STARS, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
return RETURN_OK;
|
|
}
|
|
|
|
Algo::Algo() : ArcsecJsonParamBase(arcseckeys::ALGO) {}
|
|
|
|
size_t Algo::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t Algo::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::ALGO);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::MODE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::L2T_MIN_CONFIDENCE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::L2T_MIN_MATCHED, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::T2L_MIN_CONFIDENCE, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
addfloat(param, buffer + offset);
|
|
offset += sizeof(float);
|
|
result = getParam(arcseckeys::T2L_MIN_MATCHED, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
return RETURN_OK;
|
|
}
|
|
|
|
LogLevel::LogLevel() : ArcsecJsonParamBase(arcseckeys::LOGLEVEL) {}
|
|
|
|
size_t LogLevel::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t LogLevel::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::LOG_LEVEL);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::LOGLEVEL1, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL2, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL3, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL4, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL5, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL6, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL7, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL8, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL9, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL10, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL11, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL12, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL13, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL14, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL15, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LOGLEVEL16, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
|
|
return RETURN_OK;
|
|
}
|
|
|
|
Subscription::Subscription() : ArcsecJsonParamBase(arcseckeys::SUBSCRIPTION) {}
|
|
|
|
size_t Subscription::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t Subscription::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::SUBSCRIPTION);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::TELEMETRY_1, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_2, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_3, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_4, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_5, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_6, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_7, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_8, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_9, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_10, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_11, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_12, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_13, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_14, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_15, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::TELEMETRY_16, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
return RETURN_OK;
|
|
}
|
|
|
|
LogSubscription::LogSubscription() : ArcsecJsonParamBase(arcseckeys::LOG_SUBSCRIPTION) {}
|
|
|
|
size_t LogSubscription::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t LogSubscription::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::LOG_SUBSCRIPTION);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::LEVEL1, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::MODULE1, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::LEVEL2, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
offset += sizeof(uint8_t);
|
|
result = getParam(arcseckeys::MODULE2, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint8(param, buffer + offset);
|
|
return RETURN_OK;
|
|
}
|
|
|
|
DebugCamera::DebugCamera() : ArcsecJsonParamBase(arcseckeys::DEBUG_CAMERA) {}
|
|
|
|
size_t DebugCamera::getSize() { return COMMAND_SIZE; }
|
|
|
|
ReturnValue_t DebugCamera::createCommand(uint8_t* buffer) {
|
|
ReturnValue_t result = RETURN_OK;
|
|
uint8_t offset = 0;
|
|
std::string param;
|
|
addSetParamHeader(buffer, startracker::ID::DEBUG_CAMERA);
|
|
offset = 2;
|
|
result = getParam(arcseckeys::TIMING, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint32(param, buffer + offset);
|
|
offset += sizeof(uint32_t);
|
|
result = getParam(arcseckeys::TEST, param);
|
|
if (result != RETURN_OK) {
|
|
return result;
|
|
}
|
|
adduint32(param, buffer + offset);
|
|
return RETURN_OK;
|
|
}
|