diff --git a/README.md b/README.md index 34f31da7..7acc6342 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,10 @@ 12. [Static Code Analysis](#static-code-analysis) 13. [Eclipse](#eclipse) 14. [Running the OBSW on a Raspberry Pi](#rpi) -15. [Manually preparing sysroots to compile gpsd](#gpsd) -16. [FSFW](#fsfw) -17. [Coding Style](#coding-style) +15. [Running OBSW on EGSE](#egse) +16. [Manually preparing sysroots to compile gpsd](#gpsd) +17. [FSFW](#fsfw) +18. [Coding Style](#coding-style) # General information @@ -1134,6 +1135,33 @@ sudo apt-get install gpiod libgpiod-dev to install the required GPIO libraries before cloning the system root folder. +# Running OBSW on EGSE +The EGSE is a test system from arcsec build arround a raspberry pi 4 to test the star tracker. The IP address of the EGSE (raspberry pi) is 192.168.18.31. An ssh session can be opened with +```` +ssh pi@192.168.18.31 +```` +Password: raspberry + +To run the obsw perform the following steps: +1. Build the cmake EGSE Configuration + * the sysroots for the EGSE can be found [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/egse&fileid=1190471) +2. Disable the ser2net systemd service on the EGSE +````sh +$ sudo systemctl stop ser2net.service +```` +3. Power on the star tracker by running +````sh +$ ~/powerctrl/enable0.sh` +```` +4. Run portforwarding script for tmtc tcp connection and tcf agent on host PC +````sh +$ ./scripts/egse-port.sh +```` +5. The star tracker can be powered off by running +````sh +$ ~/powerctrl/disable0.sh +```` + # Manually preparing sysroots to compile gpsd Copy all header files from [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/gpsd&fileid=1189985) to the /usr/include directory and all static libraries to /usr/lib. diff --git a/bsp_egse/InitMission.cpp b/bsp_egse/InitMission.cpp index 920c066d..222c8ec8 100644 --- a/bsp_egse/InitMission.cpp +++ b/bsp_egse/InitMission.cpp @@ -24,6 +24,10 @@ ServiceInterfaceStream sif::error("ERROR"); ObjectManagerIF* objectManager = nullptr; void initmission::initMission() { + sif::info << "Make sure the systemd service ser2net on the egse has been stopped " + << "(alias stop-ser2net)" << std::endl; + sif::info << "Make sure the power lines of the star tracker have been enabled " + << "(alias enable-startracker)" << std::endl; sif::info << "Building global objects.." << std::endl; /* Instantiate global object manager and also create all objects */ ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); diff --git a/linux/devices/devicedefinitions/StarTrackerDefinitions.h b/linux/devices/devicedefinitions/StarTrackerDefinitions.h index 7073bac9..ba077e5f 100644 --- a/linux/devices/devicedefinitions/StarTrackerDefinitions.h +++ b/linux/devices/devicedefinitions/StarTrackerDefinitions.h @@ -214,6 +214,15 @@ enum PoolIds : lp_id_t { CAM_VAL3, CAM_REG4, CAM_VAL4, + CAM_REG5, + CAM_VAL5, + CAM_REG6, + CAM_VAL6, + CAM_REG7, + CAM_VAL7, + CAM_REG8, + CAM_VAL8, + CAM_FREQ_1, LIMITS_ACTION, LIMITS_FPGA18CURRENT, LIMITS_FPGA25CURRENT, @@ -239,7 +248,96 @@ enum PoolIds : lp_id_t { BLOB_DARK_THRESHOLD, BLOB_ENABLE_HISTOGRAM, BLOB_ENABLE_CONTRAST, - BLOB_BIN_MODE + BLOB_BIN_MODE, + LOGLEVEL1, + LOGLEVEL2, + LOGLEVEL3, + LOGLEVEL4, + LOGLEVEL5, + LOGLEVEL6, + LOGLEVEL7, + LOGLEVEL8, + LOGLEVEL9, + LOGLEVEL10, + LOGLEVEL11, + LOGLEVEL12, + LOGLEVEL13, + LOGLEVEL14, + LOGLEVEL15, + LOGLEVEL16, + MOUNTING_QW, + MOUNTING_QX, + MOUNTING_QY, + MOUNTING_QZ, + IMAGE_PROCESSOR_MODE, + IMAGE_PROCESSOR_STORE, + IMAGE_PROCESSOR_SIGNALTHRESHOLD, + IMAGE_PROCESSOR_DARKTHRESHOLD, + IMAGE_PROCESSOR_BACKGROUNDCOMPENSATION, + CENTROIDING_ENABLE_FILTER, + CENTROIDING_MAX_QUALITY, + CENTROIDING_DARK_THRESHOLD, + CENTROIDING_MIN_QUALITY, + CENTROIDING_MAX_INTENSITY, + CENTROIDING_MIN_INTENSITY, + CENTROIDING_MAX_MAGNITUDE, + CENTROIDING_GAUSSIAN_CMAX, + CENTROIDING_GAUSSIAN_CMIN, + CENTROIDING_TRANSMATRIX00, + CENTROIDING_TRANSMATRIX01, + CENTROIDING_TRANSMATRIX10, + CENTROIDING_TRANSMATRIX11, + LISA_MODE, + LISA_PREFILTER_DIST_THRESHOLD, + LISA_PREFILTER_ANGLE_THRESHOLD, + LISA_FOV_WIDTH, + LISA_FOV_HEIGHT, + LISA_FLOAT_STAR_LIMIT, + LISA_CLOSE_STAR_LIMIT, + LISA_RATING_WEIGHT_CLOSE_STAR_COUNT, + LISA_RATING_WEIGHT_FRACTION_CLOSE, + LISA_RATING_WEIGHT_MEAN_SUM, + LISA_RATING_WEIGHT_DB_STAR_COUNT, + LISA_MAX_COMBINATIONS, + LISA_NR_STARS_STOP, + LISA_FRACTION_CLOSE_STOP, + MATCHING_SQUARED_DISTANCE_LIMIT, + MATCHING_SQUARED_SHIFT_LIMIT, + TRACKING_THIN_LIMIT, + TRACKING_OUTLIER_THRESHOLD, + TRACKING_OUTLIER_THRESHOLD_QUEST, + TRACKING_TRACKER_CHOICE, + VALIDATION_STABLE_COUNT, + VALIDATION_MAX_DIFFERENCE, + VALIDATION_MIN_TRACKER_CONFIDENCE, + VALIDATION_MIN_MATCHED_STARS, + ALGO_MODE, + ALGO_I2T_MIN_CONFIDENCE, + ALGO_I2T_MIN_MATCHED, + ALGO_I2L_MIN_CONFIDENCE, + ALGO_I2L_MIN_MATCHED, + SUBSCRIPTION_TM1, + SUBSCRIPTION_TM2, + SUBSCRIPTION_TM3, + SUBSCRIPTION_TM4, + SUBSCRIPTION_TM5, + SUBSCRIPTION_TM6, + SUBSCRIPTION_TM7, + SUBSCRIPTION_TM8, + SUBSCRIPTION_TM9, + SUBSCRIPTION_TM10, + SUBSCRIPTION_TM11, + SUBSCRIPTION_TM12, + SUBSCRIPTION_TM13, + SUBSCRIPTION_TM14, + SUBSCRIPTION_TM15, + SUBSCRIPTION_TM16, + LOG_SUBSCRIPTION_LEVEL1, + LOG_SUBSCRIPTION_MODULE1, + LOG_SUBSCRIPTION_LEVEL2, + LOG_SUBSCRIPTION_MODULE2, + DEBUG_CAMERA_TIMING, + DEBUG_CAMERA_TEST }; static const DeviceCommandId_t PING_REQUEST = 0; @@ -257,7 +355,7 @@ static const DeviceCommandId_t REQ_POWER = 11; static const DeviceCommandId_t TAKE_IMAGE = 15; static const DeviceCommandId_t DOWNLOAD_CENTROID = 16; static const DeviceCommandId_t UPLOAD_CENTROID = 17; -static const DeviceCommandId_t SUBSCRIBE_TO_TM = 18; +static const DeviceCommandId_t SUBSCRIPTION = 18; static const DeviceCommandId_t IMAGE_PROCESSOR = 19; static const DeviceCommandId_t REQ_SOLUTION = 24; static const DeviceCommandId_t REQ_TEMPERATURE = 25; @@ -290,6 +388,21 @@ static const DeviceCommandId_t UPLOAD_FPGA_IMAGE = 65; static const DeviceCommandId_t FPGA_ACTION = 66; static const DeviceCommandId_t REQ_CAMERA = 67; static const DeviceCommandId_t REQ_LIMITS = 68; +static const DeviceCommandId_t REQ_LOG_LEVEL = 69; +static const DeviceCommandId_t REQ_MOUNTING = 70; +static const DeviceCommandId_t REQ_IMAGE_PROCESSOR = 71; +static const DeviceCommandId_t REQ_CENTROIDING = 72; +static const DeviceCommandId_t REQ_LISA = 73; +static const DeviceCommandId_t REQ_MATCHING = 74; +static const DeviceCommandId_t REQ_TRACKING = 75; +static const DeviceCommandId_t REQ_VALIDATION = 76; +static const DeviceCommandId_t REQ_ALGO = 77; +static const DeviceCommandId_t REQ_SUBSCRIPTION = 78; +static const DeviceCommandId_t REQ_LOG_SUBSCRIPTION = 79; +static const DeviceCommandId_t REQ_DEBUG_CAMERA = 80; +static const DeviceCommandId_t LOGLEVEL = 81; +static const DeviceCommandId_t LOGSUBSCRIPTION = 82; +static const DeviceCommandId_t DEBUG_CAMERA = 83; static const DeviceCommandId_t NONE = 0xFFFFFFFF; static const uint32_t VERSION_SET_ID = REQ_VERSION; @@ -307,6 +420,18 @@ static const uint32_t DOWNLOAD_DBIMAGE_SET_ID = DOWNLOAD_DBIMAGE; static const uint32_t DOWNLOAD_BLOBPIXEL_SET_ID = DOWNLOAD_BLOBPIXEL; static const uint32_t CAMERA_SET_ID = REQ_CAMERA; static const uint32_t LIMITS_SET_ID = REQ_LIMITS; +static const uint32_t LOG_LEVEL_SET_ID = REQ_LOG_LEVEL; +static const uint32_t MOUNTING_SET_ID = REQ_MOUNTING; +static const uint32_t IMAGE_PROCESSOR_SET_ID = REQ_IMAGE_PROCESSOR; +static const uint32_t CENTROIDING_SET_ID = REQ_CENTROIDING; +static const uint32_t LISA_SET_ID = REQ_LISA; +static const uint32_t MATCHING_SET_ID = REQ_MATCHING; +static const uint32_t TRACKING_SET_ID = REQ_TRACKING; +static const uint32_t VALIDATION_SET_ID = REQ_VALIDATION; +static const uint32_t ALGO_SET_ID = REQ_ALGO; +static const uint32_t SUBSCRIPTION_SET_ID = REQ_SUBSCRIPTION; +static const uint32_t LOG_SUBSCRIPTION_SET_ID = REQ_LOG_SUBSCRIPTION; +static const uint32_t DEBUG_CAMERA_SET_ID = REQ_DEBUG_CAMERA; /** Max size of unencoded frame */ static const size_t MAX_FRAME_SIZE = 1200; @@ -324,8 +449,20 @@ static const uint8_t DOWNLOAD_CENTROID_SET_ENTRIES = 11; static const uint8_t DOWNLOAD_MATCHED_STAR_SET_ENTRIES = 14; static const uint8_t DOWNLOAD_DBIMAGE_SET_ENTRIES = 6; static const uint8_t DOWNLOAD_BLOBPIXEL_SET_ENTRIES = 7; -static const uint8_t CAMERA_SET_ENTRIES = 15; +static const uint8_t CAMERA_SET_ENTRIES = 24; static const uint8_t LIMITS_SET_ENTRIES = 11; +static const uint8_t LOG_LEVEL_SET_ENTRIES = 16; +static const uint8_t MOUNTING_SET_ENTRIES = 4; +static const uint8_t IMAGE_PROCESSOR_SET_ENTRIES = 5; +static const uint8_t CENTROIDING_PARAMS_SET_ENTRIES = 13; +static const uint8_t LISA_SET_ENTRIES = 14; +static const uint8_t MATCHING_SET_ENTRIES = 2; +static const uint8_t TRACKING_SET_ENTRIES = 4; +static const uint8_t VALIDATION_SET_ENTRIES = 4; +static const uint8_t ALGO_SET_ENTRIES = 5; +static const uint8_t SUBSCRIPTION_SET_ENTRIES = 16; +static const uint8_t LOG_SUBSCRIPTION_SET_ENTRIES = 4; +static const uint8_t DEBUG_CAMERA_SET_ENTRIES = 2; // Action, parameter and telemetry IDs namespace ID { @@ -347,7 +484,7 @@ static const uint8_t REBOOT = 7; static const uint8_t UPLOAD_IMAGE = 10; static const uint8_t POWER = 11; static const uint8_t SET_TIME = 14; -static const uint8_t SUBSCRIBE = 18; +static const uint8_t SUBSCRIPTION = 18; static const uint8_t SOLUTION = 24; static const uint8_t TEMPERATURE = 27; static const uint8_t HISTOGRAM = 28; @@ -366,6 +503,9 @@ static const uint8_t DOWNLOAD_MATCHED_STAR = 18; static const uint8_t DOWNLOAD_DBIMAGE = 19; static const uint8_t DOWNLOAD_BLOBPIXEL = 24; static const uint8_t FPGA_ACTION = 22; +static const uint8_t LOG_LEVEL = 3; +static const uint8_t LOG_SUBSCRIPTION = 19; +static const uint8_t DEBUG_CAMERA = 20; } // namespace ID namespace Program { @@ -1153,7 +1293,7 @@ class DownloadBlobPixel : public StaticLocalDataSet { public: // Size of dataset - static const size_t SIZE = 25; + static const size_t SIZE = 34; CameraSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CAMERA_SET_ID) {} @@ -1174,6 +1314,15 @@ class CameraSet : public StaticLocalDataSet { lp_var_t val3 = lp_var_t(sid.objectId, PoolIds::CAM_VAL3, this); lp_var_t reg4 = lp_var_t(sid.objectId, PoolIds::CAM_REG4, this); lp_var_t val4 = lp_var_t(sid.objectId, PoolIds::CAM_VAL4, this); + lp_var_t reg5 = lp_var_t(sid.objectId, PoolIds::CAM_REG5, this); + lp_var_t val5 = lp_var_t(sid.objectId, PoolIds::CAM_VAL5, this); + lp_var_t reg6 = lp_var_t(sid.objectId, PoolIds::CAM_REG6, this); + lp_var_t val6 = lp_var_t(sid.objectId, PoolIds::CAM_VAL6, this); + lp_var_t reg7 = lp_var_t(sid.objectId, PoolIds::CAM_REG7, this); + lp_var_t val7 = lp_var_t(sid.objectId, PoolIds::CAM_VAL7, this); + lp_var_t reg8 = lp_var_t(sid.objectId, PoolIds::CAM_REG8, this); + lp_var_t val8 = lp_var_t(sid.objectId, PoolIds::CAM_VAL8, this); + lp_var_t freq1 = lp_var_t(sid.objectId, PoolIds::CAM_FREQ_1, this); void printSet() { PoolReadGuard rg(this); @@ -1203,6 +1352,24 @@ class CameraSet : public StaticLocalDataSet { << std::endl; sif::info << "CameraSet::printSet: Val 4: " << static_cast(this->val4.value) << std::endl; + sif::info << "CameraSet::printSet: Reg 5: " << static_cast(this->reg5.value) + << std::endl; + sif::info << "CameraSet::printSet: Val 5: " << static_cast(this->val5.value) + << std::endl; + sif::info << "CameraSet::printSet: Reg 6: " << static_cast(this->reg6.value) + << std::endl; + sif::info << "CameraSet::printSet: Val 6: " << static_cast(this->val6.value) + << std::endl; + sif::info << "CameraSet::printSet: Reg 7: " << static_cast(this->reg7.value) + << std::endl; + sif::info << "CameraSet::printSet: Val 7: " << static_cast(this->val7.value) + << std::endl; + sif::info << "CameraSet::printSet: Reg 8: " << static_cast(this->reg8.value) + << std::endl; + sif::info << "CameraSet::printSet: Val 8: " << static_cast(this->val8.value) + << std::endl; + sif::info << "CameraSet::printSet: Freq 1: " << static_cast(this->freq1.value) + << std::endl; } }; @@ -1239,17 +1406,509 @@ class LimitsSet : public StaticLocalDataSet { void printSet() { PoolReadGuard rg(this); - sif::info << "CameraSet::printSet: action: " << static_cast(this->action.value) + sif::info << "LimitsSet::printSet: action: " << static_cast(this->action.value) << std::endl; - sif::info << "CameraSet::printSet: FPGA18Current: " << this->fpga18current << std::endl; - sif::info << "CameraSet::printSet: FPGA25Current: " << this->fpga25current << std::endl; - sif::info << "CameraSet::printSet: FPGA10Current: " << this->fpga10current << std::endl; - sif::info << "CameraSet::printSet: MCUCurrent: " << this->mcuCurrent << std::endl; - sif::info << "CameraSet::printSet: CMOS21Current: " << this->cmos21current << std::endl; - sif::info << "CameraSet::printSet: CMOSPixCurrent: " << this->cmosPixCurrent << std::endl; - sif::info << "CameraSet::printSet: CMOS33Current: " << this->cmos33current << std::endl; - sif::info << "CameraSet::printSet: CMOSVResCurrent: " << this->cmosVresCurrent << std::endl; - sif::info << "CameraSet::printSet: CMOSTemperature: " << this->cmosTemperature << std::endl; + sif::info << "LimitsSet::printSet: FPGA18Current: " << this->fpga18current << std::endl; + sif::info << "LimitsSet::printSet: FPGA25Current: " << this->fpga25current << std::endl; + sif::info << "LimitsSet::printSet: FPGA10Current: " << this->fpga10current << std::endl; + sif::info << "LimitsSet::printSet: MCUCurrent: " << this->mcuCurrent << std::endl; + sif::info << "LimitsSet::printSet: CMOS21Current: " << this->cmos21current << std::endl; + sif::info << "LimitsSet::printSet: CMOSPixCurrent: " << this->cmosPixCurrent << std::endl; + sif::info << "LimitsSet::printSet: CMOS33Current: " << this->cmos33current << std::endl; + sif::info << "LimitsSet::printSet: CMOSVResCurrent: " << this->cmosVresCurrent << std::endl; + sif::info << "LimitsSet::printSet: CMOSTemperature: " << this->cmosTemperature << std::endl; + } +}; + +/** + * @brief Will store the requested log level parameters + */ +class LogLevelSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 16; + + LogLevelSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, LOG_LEVEL_SET_ID) {} + + LogLevelSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, LOG_LEVEL_SET_ID)) {} + + lp_var_t loglevel1 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL1, this); + lp_var_t loglevel2 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL2, this); + lp_var_t loglevel3 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL3, this); + lp_var_t loglevel4 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL4, this); + lp_var_t loglevel5 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL5, this); + lp_var_t loglevel6 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL6, this); + lp_var_t loglevel7 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL7, this); + lp_var_t loglevel8 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL8, this); + lp_var_t loglevel9 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL9, this); + lp_var_t loglevel10 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL10, this); + lp_var_t loglevel11 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL11, this); + lp_var_t loglevel12 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL12, this); + lp_var_t loglevel13 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL13, this); + lp_var_t loglevel14 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL14, this); + lp_var_t loglevel15 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL15, this); + lp_var_t loglevel16 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL16, this); + + void printSet() { + PoolReadGuard rg(this); + sif::info << "LogLevelSet::printSet: loglevel1: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel2: " + << static_cast(this->loglevel2.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel3: " + << static_cast(this->loglevel3.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel4: " + << static_cast(this->loglevel4.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel5: " + << static_cast(this->loglevel5.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel6: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel7: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel8: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel9: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel10: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel11: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel12: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel13: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel14: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel15: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel16: " + << static_cast(this->loglevel1.value) << std::endl; + } +}; + +/** + * @brief Will store the requested mounting parameters + */ +class MountingSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 16; + + MountingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, MOUNTING_SET_ID) {} + + MountingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, MOUNTING_SET_ID)) {} + + lp_var_t qw = lp_var_t(sid.objectId, PoolIds::MOUNTING_QW, this); + lp_var_t qx = lp_var_t(sid.objectId, PoolIds::MOUNTING_QX, this); + lp_var_t qy = lp_var_t(sid.objectId, PoolIds::MOUNTING_QY, this); + lp_var_t qz = lp_var_t(sid.objectId, PoolIds::MOUNTING_QZ, this); + + void printSet() { + sif::info << "MountingSet::printSet: qw: " << this->qw << std::endl; + sif::info << "MountingSet::printSet: qx: " << this->qx << std::endl; + sif::info << "MountingSet::printSet: qy: " << this->qy << std::endl; + sif::info << "MountingSet::printSet: qz: " << this->qz << std::endl; + } +}; + +/** + * @brief Will store the requested image processor parameters + */ +class ImageProcessorSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 7; + + ImageProcessorSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, IMAGE_PROCESSOR_SET_ID) {} + + ImageProcessorSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, IMAGE_PROCESSOR_SET_ID)) {} + + lp_var_t mode = lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_MODE, this); + lp_var_t store = lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_STORE, this); + lp_var_t signalThreshold = + lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_SIGNALTHRESHOLD, this); + lp_var_t darkThreshold = + lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_DARKTHRESHOLD, this); + lp_var_t backgroundCompensation = + lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_BACKGROUNDCOMPENSATION, this); + + void printSet() { + sif::info << "ImageProcessorSet::printSet: mode: " + << static_cast(this->mode.value) << std::endl; + sif::info << "ImageProcessorSet::printSet: store: " + << static_cast(this->store.value) << std::endl; + sif::info << "ImageProcessorSet::printSet: signal threshold: " << this->signalThreshold + << std::endl; + sif::info << "ImageProcessorSet::printSet: dark threshold: " << this->darkThreshold + << std::endl; + sif::info << "ImageProcessorSet::printSet: background compensation: " + << static_cast(this->backgroundCompensation.value) << std::endl; + } +}; + +/** + * @brief Will store the requested centroiding parameters + */ +class CentroidingSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 49; + + CentroidingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CENTROIDING_SET_ID) {} + + CentroidingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, CENTROIDING_SET_ID)) {} + + lp_var_t enableFilter = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_ENABLE_FILTER, this); + lp_var_t maxQuality = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MAX_QUALITY, this); + lp_var_t darkThreshold = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_DARK_THRESHOLD, this); + lp_var_t minQuality = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MIN_QUALITY, this); + lp_var_t maxIntensity = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MAX_INTENSITY, this); + lp_var_t minIntensity = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MIN_INTENSITY, this); + lp_var_t maxMagnitude = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MAX_MAGNITUDE, this); + lp_var_t gaussianCmax = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_GAUSSIAN_CMAX, this); + lp_var_t gaussianCmin = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_GAUSSIAN_CMIN, this); + lp_var_t transmatrix00 = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX00, this); + lp_var_t transmatrix01 = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX01, this); + lp_var_t transmatrix10 = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX10, this); + lp_var_t transmatrix11 = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX11, this); + + void printSet() { + sif::info << "CentroidingSet::printSet: enable filter: " + << static_cast(this->enableFilter.value) << std::endl; + sif::info << "CentroidingSet::printSet: max quality: " << this->maxQuality << std::endl; + sif::info << "CentroidingSet::printSet: dark threshold: " << this->darkThreshold << std::endl; + sif::info << "CentroidingSet::printSet: min quality: " << this->minQuality << std::endl; + sif::info << "CentroidingSet::printSet: max intensity: " << this->maxIntensity << std::endl; + sif::info << "CentroidingSet::printSet: min intensity: " << this->minIntensity << std::endl; + sif::info << "CentroidingSet::printSet: max magnitude: " << this->maxMagnitude << std::endl; + sif::info << "CentroidingSet::printSet: gaussian cmax: " << this->gaussianCmax << std::endl; + sif::info << "CentroidingSet::printSet: gaussian cmin: " << this->gaussianCmin << std::endl; + sif::info << "CentroidingSet::printSet: transmatrix 00 : " << this->transmatrix00 << std::endl; + sif::info << "CentroidingSet::printSet: transmatrix 01 : " << this->transmatrix01 << std::endl; + sif::info << "CentroidingSet::printSet: transmatrix 10 : " << this->transmatrix10 << std::endl; + sif::info << "CentroidingSet::printSet: transmatrix 11 : " << this->transmatrix11 << std::endl; + } +}; + +/** + * @brief Will store the requested centroiding parameters + */ +class LisaSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 50; + + LisaSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, LISA_SET_ID) {} + + LisaSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, LISA_SET_ID)) {} + + lp_var_t mode = lp_var_t(sid.objectId, PoolIds::LISA_MODE, this); + lp_var_t prefilterDistThreshold = + lp_var_t(sid.objectId, PoolIds::LISA_PREFILTER_DIST_THRESHOLD, this); + lp_var_t prefilterAngleThreshold = + lp_var_t(sid.objectId, PoolIds::LISA_PREFILTER_ANGLE_THRESHOLD, this); + lp_var_t fovWidth = lp_var_t(sid.objectId, PoolIds::LISA_FOV_WIDTH, this); + lp_var_t fovHeight = lp_var_t(sid.objectId, PoolIds::LISA_FOV_HEIGHT, this); + lp_var_t floatStarLimit = + lp_var_t(sid.objectId, PoolIds::LISA_FLOAT_STAR_LIMIT, this); + lp_var_t closeStarLimit = + lp_var_t(sid.objectId, PoolIds::LISA_CLOSE_STAR_LIMIT, this); + lp_var_t ratingWeightCloseStarCount = + lp_var_t(sid.objectId, PoolIds::LISA_RATING_WEIGHT_CLOSE_STAR_COUNT, this); + lp_var_t ratingWeightFractionClose = + lp_var_t(sid.objectId, PoolIds::LISA_RATING_WEIGHT_FRACTION_CLOSE, this); + lp_var_t ratingWeightMeanSum = + lp_var_t(sid.objectId, PoolIds::LISA_RATING_WEIGHT_MEAN_SUM, this); + lp_var_t ratingWeightDbStarCount = + lp_var_t(sid.objectId, PoolIds::LISA_RATING_WEIGHT_DB_STAR_COUNT, this); + lp_var_t maxCombinations = + lp_var_t(sid.objectId, PoolIds::LISA_MAX_COMBINATIONS, this); + lp_var_t nrStarsStop = + lp_var_t(sid.objectId, PoolIds::LISA_NR_STARS_STOP, this); + lp_var_t fractionCloseStop = + lp_var_t(sid.objectId, PoolIds::LISA_FRACTION_CLOSE_STOP, this); + + void printSet() { + sif::info << "LisaSet::printSet: mode: " << this->mode << std::endl; + sif::info << "LisaSet::printSet: prefilter dist threshold: " << this->prefilterDistThreshold + << std::endl; + sif::info << "LisaSet::printSet: prefilter angle threshold: " << this->prefilterAngleThreshold + << std::endl; + sif::info << "LisaSet::printSet: fov width: " << this->fovWidth << std::endl; + sif::info << "LisaSet::printSet: fov height: " << this->fovHeight << std::endl; + sif::info << "LisaSet::printSet: float star limit: " << this->floatStarLimit << std::endl; + sif::info << "LisaSet::printSet: close star limit: " << this->closeStarLimit << std::endl; + sif::info << "LisaSet::printSet: rating weight close star count: " + << this->ratingWeightCloseStarCount << std::endl; + sif::info << "LisaSet::printSet: rating weight fraction close: " + << this->ratingWeightFractionClose << std::endl; + sif::info << "LisaSet::printSet: rating weight mean sum: " << this->ratingWeightMeanSum + << std::endl; + sif::info << "LisaSet::printSet: rating weight db star count: " << this->ratingWeightDbStarCount + << std::endl; + sif::info << "LisaSet::printSet: max combinations: " + << static_cast(this->maxCombinations.value) << std::endl; + sif::info << "LisaSet::printSet: nr stars stop: " + << static_cast(this->nrStarsStop.value) << std::endl; + sif::info << "LisaSet::printSet: fraction close stop: " << this->fractionCloseStop << std::endl; + } +}; + +/** + * @brief Will store the requested matching parameters + */ +class MatchingSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 8; + + MatchingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, MATCHING_SET_ID) {} + + MatchingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, MATCHING_SET_ID)) {} + + lp_var_t squaredDistanceLimit = lp_var_t(sid.objectId, PoolIds::MATCHING_SQUARED_DISTANCE_LIMIT, this); + lp_var_t squaredShiftLimit = lp_var_t(sid.objectId, PoolIds::MATCHING_SQUARED_SHIFT_LIMIT, this); + + void printSet() { + sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredDistanceLimit + << std::endl; + sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredShiftLimit + << std::endl; + } +}; + +/** + * @brief Will store the requested tracking parameters + */ +class TrackingSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 13; + + TrackingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, TRACKING_SET_ID) {} + + TrackingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, TRACKING_SET_ID)) {} + + lp_var_t thinLimit = lp_var_t(sid.objectId, PoolIds::TRACKING_THIN_LIMIT, this); + lp_var_t outlierThreshold = lp_var_t(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD, this); + lp_var_t outlierThresholdQuest = lp_var_t(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD_QUEST, this); + lp_var_t trackerChoice = lp_var_t(sid.objectId, PoolIds::TRACKING_TRACKER_CHOICE, this); + + void printSet() { + sif::info << "TrackingSet::printSet: thin limit: " << this->thinLimit << std::endl; + sif::info << "TrackingSet::printSet: outlier threshold: " << this->outlierThreshold + << std::endl; + sif::info << "TrackingSet::printSet: outlier threshold quest: " << this->outlierThresholdQuest + << std::endl; + sif::info << "TrackingSet::printSet: tracker choice: " + << static_cast(this->trackerChoice.value) << std::endl; + } +}; + +/** + * @brief Will store the requested validation parameters + */ +class ValidationSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 10; + + ValidationSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, VALIDATION_SET_ID) {} + + ValidationSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, VALIDATION_SET_ID)) {} + + lp_var_t stableCount = + lp_var_t(sid.objectId, PoolIds::VALIDATION_STABLE_COUNT, this); + lp_var_t maxDifference = + lp_var_t(sid.objectId, PoolIds::VALIDATION_MAX_DIFFERENCE, this); + lp_var_t minTrackerConfidence = + lp_var_t(sid.objectId, PoolIds::VALIDATION_MIN_TRACKER_CONFIDENCE, this); + lp_var_t minMatchedStars = + lp_var_t(sid.objectId, PoolIds::VALIDATION_MIN_MATCHED_STARS, this); + + void printSet() { + sif::info << "ValidationSet::printSet: stable count: " + << static_cast(this->stableCount.value) << std::endl; + sif::info << "ValidationSet::printSet: max difference: " << this->maxDifference << std::endl; + sif::info << "ValidationSet::printSet: min tracker confidence: " << this->minTrackerConfidence + << std::endl; + sif::info << "ValidationSet::printSet: min matched stars: " + << static_cast(this->minMatchedStars.value) << std::endl; + } +}; + +/** + * @brief Will store the requested algo parameters + */ +class AlgoSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 11; + + AlgoSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, ALGO_SET_ID) {} + + AlgoSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, ALGO_SET_ID)) {} + + lp_var_t mode = + lp_var_t(sid.objectId, PoolIds::ALGO_MODE, this); + lp_var_t i2tMinConfidence = + lp_var_t(sid.objectId, PoolIds::ALGO_I2T_MIN_CONFIDENCE, this); + lp_var_t i2tMinMatched = + lp_var_t(sid.objectId, PoolIds::ALGO_I2T_MIN_MATCHED, this); + lp_var_t i2lMinConfidence = + lp_var_t(sid.objectId, PoolIds::ALGO_I2L_MIN_CONFIDENCE, this); + lp_var_t i2lMinMatched = + lp_var_t(sid.objectId, PoolIds::ALGO_I2L_MIN_MATCHED, this); + + void printSet() { + sif::info << "AlgoSet::printSet: mode: " << static_cast(this->mode.value) << std::endl; + sif::info << "AlgoSet::printSet: i2t min confidence: " << this->i2tMinConfidence << std::endl; + sif::info << "AlgoSet::printSet: i2t min matched: " + << static_cast(this->i2tMinMatched.value) << std::endl; + sif::info << "AlgoSet::printSet: i2l min confidence: " << this->i2lMinConfidence << std::endl; + sif::info << "AlgoSet::printSet: i2l min matched: " + << static_cast(this->i2lMinMatched.value) << std::endl; + } +}; + +/** + * @brief Will store the requested subscription parameters + */ +class SubscriptionSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 16; + + SubscriptionSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, SUBSCRIPTION_SET_ID) {} + + SubscriptionSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, SUBSCRIPTION_SET_ID)) {} + + lp_var_t tm1 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM1, this); + lp_var_t tm2 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM2, this); + lp_var_t tm3 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM3, this); + lp_var_t tm4 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM4, this); + lp_var_t tm5 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM5, this); + lp_var_t tm6 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM6, this); + lp_var_t tm7 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM7, this); + lp_var_t tm8 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM8, this); + lp_var_t tm9 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM9, this); + lp_var_t tm10 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM10, this); + lp_var_t tm11 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM11, this); + lp_var_t tm12 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM12, this); + lp_var_t tm13 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM13, this); + lp_var_t tm14 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM14, this); + lp_var_t tm15 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM15, this); + lp_var_t tm16 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM16, this); + + void printSet() { + sif::info << "SubscriptionSet::printSet: telemetry 1: " + << static_cast(this->tm1.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 2: " + << static_cast(this->tm2.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 3: " + << static_cast(this->tm3.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 4: " + << static_cast(this->tm4.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 5: " + << static_cast(this->tm5.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 6: " + << static_cast(this->tm6.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 7: " + << static_cast(this->tm7.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 8: " + << static_cast(this->tm8.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 9: " + << static_cast(this->tm9.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 10: " + << static_cast(this->tm10.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 11: " + << static_cast(this->tm11.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 12: " + << static_cast(this->tm12.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 13: " + << static_cast(this->tm13.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 14: " + << static_cast(this->tm14.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 15: " + << static_cast(this->tm15.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 16: " + << static_cast(this->tm16.value) << std::endl; + } +}; + +/** + * @brief Will store the requested log subscription parameters + */ +class LogSubscriptionSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 4; + + LogSubscriptionSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, LOG_SUBSCRIPTION_SET_ID) {} + + LogSubscriptionSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, LOG_SUBSCRIPTION_SET_ID)) {} + + lp_var_t level1 = + lp_var_t(sid.objectId, PoolIds::LOG_SUBSCRIPTION_LEVEL1, this); + lp_var_t module1 = + lp_var_t(sid.objectId, PoolIds::LOG_SUBSCRIPTION_MODULE1, this); + lp_var_t level2 = + lp_var_t(sid.objectId, PoolIds::LOG_SUBSCRIPTION_LEVEL2, this); + lp_var_t module2 = + lp_var_t(sid.objectId, PoolIds::LOG_SUBSCRIPTION_MODULE2, this); + + void printSet() { + sif::info << "LogSubscriptionSet::printSet: level 1: " + << static_cast(this->level1.value) << std::endl; + sif::info << "LogSubscriptionSet::printSet: module 1: " + << static_cast(this->module1.value) << std::endl; + sif::info << "LogSubscriptionSet::printSet: level 2: " + << static_cast(this->level2.value) << std::endl; + sif::info << "LogSubscriptionSet::printSet: module 2: " + << static_cast(this->module2.value) << std::endl; + } +}; + +/** + * @brief Will store the requested debug camera parameters + */ +class DebugCameraSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 8; + + DebugCameraSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, DEBUG_CAMERA_SET_ID) {} + + lp_var_t timing = + lp_var_t(sid.objectId, PoolIds::DEBUG_CAMERA_TIMING, this); + lp_var_t test = + lp_var_t(sid.objectId, PoolIds::DEBUG_CAMERA_TEST, this); + + DebugCameraSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, DEBUG_CAMERA_SET_ID)) {} + + void printSet() { + sif::info << "DebugCameraSet::printSet: timing: " << this->timing << std::endl; + sif::info << "DebugCameraSet::printSet: test: " << this->test << std::endl; } }; } // namespace StarTracker diff --git a/linux/devices/startracker/ArcsecJsonKeys.h b/linux/devices/startracker/ArcsecJsonKeys.h index 28d4ad3f..34989b1f 100644 --- a/linux/devices/startracker/ArcsecJsonKeys.h +++ b/linux/devices/startracker/ArcsecJsonKeys.h @@ -126,9 +126,56 @@ static const char TRACKER_CHOICE[] = "trackerChoice"; static const char ALGO[] = "algo"; static const char L2T_MIN_CONFIDENCE[] = "l2t_minConfidence"; -static const char L2T_MIN_MATCHED[] = "l2t_minConfidence"; +static const char L2T_MIN_MATCHED[] = "l2t_minMatched"; static const char T2L_MIN_CONFIDENCE[] = "t2l_minConfidence"; static const char T2L_MIN_MATCHED[] = "t2l_minMatched"; + +static const char LOGLEVEL[] = "loglevel"; +static const char LOGLEVEL1[] = "loglevel1"; +static const char LOGLEVEL2[] = "loglevel2"; +static const char LOGLEVEL3[] = "loglevel3"; +static const char LOGLEVEL4[] = "loglevel4"; +static const char LOGLEVEL5[] = "loglevel5"; +static const char LOGLEVEL6[] = "loglevel6"; +static const char LOGLEVEL7[] = "loglevel7"; +static const char LOGLEVEL8[] = "loglevel8"; +static const char LOGLEVEL9[] = "loglevel9"; +static const char LOGLEVEL10[] = "loglevel10"; +static const char LOGLEVEL11[] = "loglevel11"; +static const char LOGLEVEL12[] = "loglevel12"; +static const char LOGLEVEL13[] = "loglevel13"; +static const char LOGLEVEL14[] = "loglevel14"; +static const char LOGLEVEL15[] = "loglevel15"; +static const char LOGLEVEL16[] = "loglevel16"; + +static const char SUBSCRIPTION[] = "subscription"; +static const char TELEMETRY_1[] = "telemetry1"; +static const char TELEMETRY_2[] = "telemetry2"; +static const char TELEMETRY_3[] = "telemetry3"; +static const char TELEMETRY_4[] = "telemetry4"; +static const char TELEMETRY_5[] = "telemetry5"; +static const char TELEMETRY_6[] = "telemetry6"; +static const char TELEMETRY_7[] = "telemetry7"; +static const char TELEMETRY_8[] = "telemetry8"; +static const char TELEMETRY_9[] = "telemetry9"; +static const char TELEMETRY_10[] = "telemetry10"; +static const char TELEMETRY_11[] = "telemetry11"; +static const char TELEMETRY_12[] = "telemetry12"; +static const char TELEMETRY_13[] = "telemetry13"; +static const char TELEMETRY_14[] = "telemetry14"; +static const char TELEMETRY_15[] = "telemetry15"; +static const char TELEMETRY_16[] = "telemetry16"; + +static const char LOG_SUBSCRIPTION[] = "logsubscription"; +static const char LEVEL1[] = "level1"; +static const char MODULE1[] = "module1"; +static const char LEVEL2[] = "level2"; +static const char MODULE2[] = "module2"; + +static const char DEBUG_CAMERA[] = "debugcamera"; +static const char TIMING[] = "timing"; +static const char TEST[] = "test"; + } // namespace arcseckeys #endif /* BSP_Q7S_DEVICES_DEVICEDEFINITIONS_ARCSECJSONKEYS_H_ */ diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index 3857ed81..bddab7a1 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -36,6 +36,18 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, downloadBlobPixel(this), cameraSet(this), limitsSet(this), + loglevelSet(this), + mountingSet(this), + imageProcessorSet(this), + centroidingSet(this), + lisaSet(this), + matchingSet(this), + trackingSet(this), + validationSet(this), + algoSet(this), + subscriptionSet(this), + logSubscriptionSet(this), + debugCameraSet(this), strHelper(strHelper) { if (comCookie == nullptr) { sif::error << "StarTrackerHandler: Invalid com cookie" << std::endl; @@ -92,11 +104,11 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu ReturnValue_t result = RETURN_OK; switch (actionId) { - case (startracker::STOP_IMAGE_LOADER): { + case (startrackerSTOP_IMAGE_LOADER): { strHelper->stopProcess(); return EXECUTION_FINISHED; } - case (startracker::SET_JSON_FILE_NAME): { + case (startrackerSET_JSON_FILE_NAME): { if (size > MAX_PATH_SIZE) { return FILE_PATH_TOO_LONG; } @@ -118,7 +130,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu // Intercept image loader commands which do not follow the common DHB communication flow switch (actionId) { - case (startracker::UPLOAD_IMAGE): { + case (startrackerUPLOAD_IMAGE): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -133,7 +145,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu strHelperExecuting = true; return EXECUTION_FINISHED; } - case (startracker::DOWNLOAD_IMAGE): { + case (startrackerDOWNLOAD_IMAGE): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -149,7 +161,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu strHelperExecuting = true; return EXECUTION_FINISHED; } - case (startracker::WRITE): { + case (startrackerWRITE): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -162,7 +174,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu strHelperExecuting = true; return EXECUTION_FINISHED; } - case (startracker::READ): { + case (startrackerREAD): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -174,28 +186,28 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu strHelperExecuting = true; return EXECUTION_FINISHED; } - case (startracker::CHANGE_DOWNLOAD_FILE): { + case (startrackerCHANGE_DOWNLOAD_FILE): { if (size > MAX_FILE_NAME) { return FILENAME_TOO_LONG; } strHelper->setDownloadImageName(std::string(reinterpret_cast(data), size)); return EXECUTION_FINISHED; } - case (startracker::CHANGE_FPGA_DOWNLOAD_FILE): { + case (startrackerCHANGE_FPGA_DOWNLOAD_FILE): { if (size > MAX_FILE_NAME) { return FILENAME_TOO_LONG; } strHelper->setDownloadFpgaImage(std::string(reinterpret_cast(data), size)); return EXECUTION_FINISHED; } - case (startracker::SET_READ_FILENAME): { + case (startrackerSET_READ_FILENAME): { if (size > MAX_FILE_NAME) { return FILENAME_TOO_LONG; } strHelper->setDownloadImageName(std::string(reinterpret_cast(data), size)); return EXECUTION_FINISHED; } - case (startracker::DOWNLOAD_FPGA_IMAGE): { + case (startrackerDOWNLOAD_FPGA_IMAGE): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -210,7 +222,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu strHelperExecuting = true; return EXECUTION_FINISHED; } - case (startracker::UPLOAD_FPGA_IMAGE): { + case (startrackerUPLOAD_FPGA_IMAGE): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -254,10 +266,11 @@ void StarTrackerHandler::doStartUp() { return; case StartupState::BOOT_DELAY: if (bootCountdown.hasTimedOut()) { - startupState = StartupState::LIMITS; + startupState = StartupState::LOGLEVEL; } return; case StartupState::DONE: + startupState = StartupState::IDLE; break; default: return; @@ -276,7 +289,7 @@ void StarTrackerHandler::doOffActivity() { startupState = StartupState::IDLE; } ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { switch (internalState) { case InternalState::TEMPERATURE_REQUEST: - *id = startracker::REQ_TEMPERATURE; + *id = startrackerREQ_TEMPERATURE; break; default: sif::debug << "StarTrackerHandler::buildNormalDeviceCommand: Invalid internal step" @@ -292,62 +305,77 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t } switch (startupState) { case StartupState::CHECK_BOOT_STATE: - *id = startracker::REQ_VERSION; + *id = startrackerREQ_VERSION; startupState = StartupState::WAIT_FOR_EXECUTION; return buildCommandFromCommand(*id, nullptr, 0); case StartupState::BOOT: - *id = startracker::BOOT; + *id = startrackerBOOT; bootCountdown.setTimeout(BOOT_TIMEOUT); startupState = StartupState::BOOT_DELAY; return buildCommandFromCommand(*id, nullptr, 0); + case StartupState::LOGLEVEL: + startupState = StartupState::WAIT_FOR_EXECUTION; + *id = startrackerLOGLEVEL; + return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), + paramJsonFile.size()); case StartupState::LIMITS: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startracker::LIMITS; + *id = startrackerLIMITS; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::TRACKING: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startracker::TRACKING; + *id = startrackerTRACKING; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::MOUNTING: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startracker::MOUNTING; + *id = startrackerMOUNTING; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::IMAGE_PROCESSOR: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startracker::IMAGE_PROCESSOR; + *id = startrackerIMAGE_PROCESSOR; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::CAMERA: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startracker::CAMERA; + *id = startrackerCAMERA; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::CENTROIDING: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startracker::CENTROIDING; + *id = startrackerCENTROIDING; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::LISA: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startracker::LISA; + *id = startrackerLISA; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::MATCHING: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startracker::MATCHING; + *id = startrackerMATCHING; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::VALIDATION: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startracker::VALIDATION; + *id = startrackerVALIDATION; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::ALGO: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startracker::ALGO; + *id = startrackerALGO; + return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), + paramJsonFile.size()); + case StartupState::LOG_SUBSCRIPTION: + startupState = StartupState::WAIT_FOR_EXECUTION; + *id = startrackerLOGSUBSCRIPTION; + return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), + paramJsonFile.size()); + case StartupState::DEBUG_CAMERA: + startupState = StartupState::WAIT_FOR_EXECUTION; + *id = startrackerDEBUG_CAMERA; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); default: @@ -361,160 +389,224 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi size_t commandDataLen) { ReturnValue_t result = RETURN_OK; switch (deviceCommand) { - case (startracker::PING_REQUEST): { + case (startrackerPING_REQUEST): { preparePingRequest(); return RETURN_OK; } - case (startracker::REQ_TIME): { + case (startrackerREQ_TIME): { prepareTimeRequest(); return RETURN_OK; } - case (startracker::BOOT): { + case (startrackerBOOT): { prepareBootCommand(); return RETURN_OK; } - case (startracker::REQ_VERSION): { + case (startrackerREQ_VERSION): { prepareVersionRequest(); return RETURN_OK; } - case (startracker::REQ_INTERFACE): { + case (startrackerREQ_INTERFACE): { prepareInterfaceRequest(); return RETURN_OK; } - case (startracker::REQ_POWER): { + case (startrackerREQ_POWER): { preparePowerRequest(); return RETURN_OK; } - case (startracker::SWITCH_TO_BOOTLOADER_PROGRAM): { + case (startrackerSWITCH_TO_BOOTLOADER_PROGRAM): { prepareRebootCommand(); return RETURN_OK; } - case (startracker::TAKE_IMAGE): { + case (startrackerTAKE_IMAGE): { prepareTakeImageCommand(commandData); return RETURN_OK; } - case (startracker::SUBSCRIBE_TO_TM): { - prepareSubscriptionCommand(commandData); + case (startrackerSUBSCRIPTION): { + Subscription subscription; + result = prepareParamCommand(commandData, commandDataLen, subscription); return RETURN_OK; } - case (startracker::REQ_SOLUTION): { + case (startrackerREQ_SOLUTION): { prepareSolutionRequest(); return RETURN_OK; } - case (startracker::REQ_TEMPERATURE): { + case (startrackerREQ_TEMPERATURE): { prepareTemperatureRequest(); return RETURN_OK; } - case (startracker::REQ_HISTOGRAM): { + case (startrackerREQ_HISTOGRAM): { prepareHistogramRequest(); return RETURN_OK; } - case (startracker::REQ_CONTRAST): { + case (startrackerREQ_CONTRAST): { prepareContrastRequest(); return RETURN_OK; } - case (startracker::RESET_ERROR): { + case (startrackerRESET_ERROR): { prepareErrorResetRequest(); return RETURN_OK; } - case (startracker::LIMITS): { + case (startrackerLIMITS): { Limits limits; result = prepareParamCommand(commandData, commandDataLen, limits); return result; } - case (startracker::MOUNTING): { + case (startrackerMOUNTING): { Mounting mounting; result = prepareParamCommand(commandData, commandDataLen, mounting); return result; } - case (startracker::IMAGE_PROCESSOR): { + case (startrackerIMAGE_PROCESSOR): { ImageProcessor imageProcessor; result = prepareParamCommand(commandData, commandDataLen, imageProcessor); return result; } - case (startracker::CAMERA): { + case (startrackerCAMERA): { Camera camera; result = prepareParamCommand(commandData, commandDataLen, camera); return result; } - case (startracker::CENTROIDING): { + case (startrackerCENTROIDING): { Centroiding centroiding; result = prepareParamCommand(commandData, commandDataLen, centroiding); return result; } - case (startracker::LISA): { + case (startrackerLISA): { Lisa lisa; result = prepareParamCommand(commandData, commandDataLen, lisa); return result; } - case (startracker::MATCHING): { + case (startrackerMATCHING): { Matching matching; result = prepareParamCommand(commandData, commandDataLen, matching); return result; } - case (startracker::VALIDATION): { + case (startrackerVALIDATION): { Validation validation; result = prepareParamCommand(commandData, commandDataLen, validation); return result; } - case (startracker::ALGO): { + case (startrackerALGO): { Algo algo; result = prepareParamCommand(commandData, commandDataLen, algo); return result; } - case (startracker::TRACKING): { + case (startrackerTRACKING): { Tracking tracking; result = prepareParamCommand(commandData, commandDataLen, tracking); return result; } - case (startracker::ERASE): { + case (startrackerLOGLEVEL): { + LogLevel logLevel; + result = prepareParamCommand(commandData, commandDataLen, logLevel); + return result; + } + case (startrackerLOGSUBSCRIPTION): { + LogSubscription logSubscription; + result = prepareParamCommand(commandData, commandDataLen, logSubscription); + return result; + } + case (startrackerDEBUG_CAMERA): { + DebugCamera debugCamera; + result = prepareParamCommand(commandData, commandDataLen, debugCamera); + return result; + } + case (startrackerERASE): { result = prepareEraseCommand(commandData, commandDataLen); return result; } - case (startracker::UNLOCK): { + case (startrackerUNLOCK): { result = prepareUnlockCommand(commandData, commandDataLen); return result; } - case (startracker::CHECKSUM): { + case (startrackerCHECKSUM): { result = prepareChecksumCommand(commandData, commandDataLen); return result; } - case (startracker::SET_TIME): { + case (startrackerSET_TIME): { result = prepareSetTimeCommand(commandData, commandDataLen); return result; } - case (startracker::DOWNLOAD_CENTROID): { + case (startrackerDOWNLOAD_CENTROID): { result = prepareDownloadCentroidCommand(commandData, commandDataLen); return result; } - case (startracker::UPLOAD_CENTROID): { + case (startrackerUPLOAD_CENTROID): { result = prepareUploadCentroidCommand(commandData, commandDataLen); return result; } - case (startracker::DOWNLOAD_MATCHED_STAR): { + case (startrackerDOWNLOAD_MATCHED_STAR): { result = prepareDownloadMatchedStarCommand(commandData, commandDataLen); return result; } - case (startracker::DOWNLOAD_DBIMAGE): { + case (startrackerDOWNLOAD_DBIMAGE): { result = prepareDownloadDbImageCommand(commandData, commandDataLen); return result; } - case (startracker::DOWNLOAD_BLOBPIXEL): { + case (startrackerDOWNLOAD_BLOBPIXEL): { result = prepareDownloadBlobPixelCommand(commandData, commandDataLen); return result; } - case (startracker::FPGA_ACTION): { + case (startrackerFPGA_ACTION): { result = prepareFpgaActionCommand(commandData, commandDataLen); return result; } - case (startracker::REQ_CAMERA): { + case (startrackerREQ_CAMERA): { result = prepareRequestCameraParams(); return result; } - case (startracker::REQ_LIMITS): { + case (startrackerREQ_LIMITS): { result = prepareRequestLimitsParams(); return result; } + case (startrackerREQ_LOG_LEVEL): { + result = prepareRequestLogLevelParams(); + return result; + } + case (startrackerREQ_MOUNTING): { + result = prepareRequestMountingParams(); + return result; + } + case (startrackerREQ_IMAGE_PROCESSOR): { + result = prepareRequestImageProcessorParams(); + return result; + } + case (startrackerREQ_CENTROIDING): { + result = prepareRequestCentroidingParams(); + return result; + } + case (startrackerREQ_LISA): { + result = prepareRequestLisaParams(); + return result; + } + case (startrackerREQ_MATCHING): { + result = prepareRequestMatchingParams(); + return result; + } + case (startrackerREQ_TRACKING): { + result = prepareRequestTrackingParams(); + return result; + } + case (startrackerREQ_VALIDATION): { + result = prepareRequestValidationParams(); + return result; + } + case (startrackerREQ_ALGO): { + result = prepareRequestAlgoParams(); + return result; + } + case (startrackerREQ_SUBSCRIPTION): { + result = prepareRequestSubscriptionParams(); + return result; + } + case (startrackerREQ_LOG_SUBSCRIPTION): { + result = prepareRequestLogSubscriptionParams(); + return result; + } + case (startrackerREQ_DEBUG_CAMERA): { + result = prepareRequestDebugCameraParams(); + return result; + } default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -524,81 +616,111 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi void StarTrackerHandler::fillCommandAndReplyMap() { /** Reply lengths are unknown because of the slip encoding. Thus always maximum reply size * is specified */ - this->insertInCommandAndReplyMap(startracker::PING_REQUEST, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandMap(startracker::BOOT); - this->insertInCommandAndReplyMap(startracker::REQ_VERSION, 3, &versionSet, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::REQ_TIME, 3, &timeSet, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandMap(startracker::UPLOAD_IMAGE); - this->insertInCommandMap(startracker::DOWNLOAD_IMAGE); - this->insertInCommandAndReplyMap(startracker::REQ_POWER, 3, &powerSet, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::REQ_INTERFACE, 3, &interfaceSet, - startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerPING_REQUEST, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandMap(startrackerBOOT); + this->insertInCommandAndReplyMap(startrackerREQ_VERSION, 3, &versionSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_TIME, 3, &timeSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandMap(startrackerUPLOAD_IMAGE); + this->insertInCommandMap(startrackerDOWNLOAD_IMAGE); + this->insertInCommandAndReplyMap(startrackerREQ_POWER, 3, &powerSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_INTERFACE, 3, &interfaceSet, + startrackerMAX_FRAME_SIZE * 2 + 2); // Reboot has no reply. Star tracker reboots immediately - this->insertInCommandMap(startracker::SWITCH_TO_BOOTLOADER_PROGRAM); - this->insertInCommandAndReplyMap(startracker::SUBSCRIBE_TO_TM, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::REQ_SOLUTION, 3, &solutionSet, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::REQ_TEMPERATURE, 3, &temperatureSet, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::REQ_HISTOGRAM, 3, &histogramSet, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::REQ_CONTRAST, 3, &contrastSet, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::LIMITS, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::MOUNTING, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::IMAGE_PROCESSOR, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::CAMERA, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::CAMERA, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::CENTROIDING, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::LISA, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::MATCHING, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::TRACKING, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::VALIDATION, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::ALGO, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::TAKE_IMAGE, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::RESET_ERROR, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::ERASE, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::UNLOCK, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::CHECKSUM, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::SET_TIME, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::DOWNLOAD_CENTROID, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::UPLOAD_CENTROID, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::DOWNLOAD_MATCHED_STAR, 3, &downloadMatchedStar, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::DOWNLOAD_DBIMAGE, 3, &downloadDbImage, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::DOWNLOAD_BLOBPIXEL, 3, &downloadBlobPixel, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::FPGA_ACTION, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::REQ_CAMERA, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startracker::REQ_LIMITS, 3, nullptr, - startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandMap(startrackerSWITCH_TO_BOOTLOADER_PROGRAM); + this->insertInCommandAndReplyMap(startrackerSUBSCRIPTION, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_SOLUTION, 3, &solutionSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_TEMPERATURE, 3, &temperatureSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_HISTOGRAM, 3, &histogramSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_CONTRAST, 3, &contrastSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerLOGLEVEL, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerLOGSUBSCRIPTION, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerDEBUG_CAMERA, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerLIMITS, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerMOUNTING, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerIMAGE_PROCESSOR, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerCAMERA, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerCAMERA, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerCENTROIDING, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerLISA, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerMATCHING, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerTRACKING, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerVALIDATION, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerALGO, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerTAKE_IMAGE, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerRESET_ERROR, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerERASE, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerUNLOCK, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerCHECKSUM, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerSET_TIME, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerDOWNLOAD_CENTROID, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerUPLOAD_CENTROID, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerDOWNLOAD_MATCHED_STAR, 3, &downloadMatchedStar, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerDOWNLOAD_DBIMAGE, 3, &downloadDbImage, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerDOWNLOAD_BLOBPIXEL, 3, &downloadBlobPixel, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerFPGA_ACTION, 3, nullptr, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_CAMERA, 3, &cameraSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_LIMITS, 3, &limitsSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_LOG_LEVEL, 3, &loglevelSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_MOUNTING, 3, &mountingSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_IMAGE_PROCESSOR, 3, &imageProcessorSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_CENTROIDING, 3, ¢roidingSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_LISA, 3, &lisaSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_MATCHING, 3, &matchingSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_TRACKING, 3, &trackingSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_VALIDATION, 3, &validationSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_ALGO, 3, &algoSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_SUBSCRIPTION, 3, &subscriptionSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_LOG_SUBSCRIPTION, 3, &logSubscriptionSet, + startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startrackerREQ_DEBUG_CAMERA, 3, &debugCameraSet, + startrackerMAX_FRAME_SIZE * 2 + 2); } ReturnValue_t StarTrackerHandler::scanForReply(const uint8_t* start, size_t remainingSize, @@ -659,57 +781,53 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, ReturnValue_t result = RETURN_OK; switch (id) { - case (startracker::SUBSCRIBE_TO_TM): { - result = handleSetParamReply(); + case (startrackerREQ_TIME): { + result = handleTm(timeSet, startrackerTimeSet::SIZE); break; } - case (startracker::REQ_TIME): { - result = handleTm(timeSet, startracker::TimeSet::SIZE); - break; - } - case (startracker::PING_REQUEST): { + case (startrackerPING_REQUEST): { result = handlePingReply(); break; } - case (startracker::BOOT): - case (startracker::TAKE_IMAGE): - case (startracker::RESET_ERROR): - case (startracker::UNLOCK): - case (startracker::SET_TIME): - case (startracker::FPGA_ACTION): { + case (startrackerBOOT): + case (startrackerTAKE_IMAGE): + case (startrackerRESET_ERROR): + case (startrackerUNLOCK): + case (startrackerSET_TIME): + case (startrackerFPGA_ACTION): { result = handleActionReply(); break; } - case (startracker::DOWNLOAD_CENTROID): { - result = handleActionReplySet(downloadCentroidSet, startracker::DownloadCentroidSet::SIZE); + case (startrackerDOWNLOAD_CENTROID): { + result = handleActionReplySet(downloadCentroidSet, startrackerDownloadCentroidSet::SIZE); break; } - case (startracker::DOWNLOAD_MATCHED_STAR): { - result = handleActionReplySet(downloadMatchedStar, startracker::DownloadMatchedStar::SIZE); + case (startrackerDOWNLOAD_MATCHED_STAR): { + result = handleActionReplySet(downloadMatchedStar, startrackerDownloadMatchedStar::SIZE); break; } - case (startracker::DOWNLOAD_DBIMAGE): { - result = handleActionReplySet(downloadDbImage, startracker::DownloadDBImage::SIZE); + case (startrackerDOWNLOAD_DBIMAGE): { + result = handleActionReplySet(downloadDbImage, startrackerDownloadDBImage::SIZE); break; } - case (startracker::DOWNLOAD_BLOBPIXEL): { - result = handleActionReplySet(downloadBlobPixel, startracker::DownloadBlobPixel::SIZE); + case (startrackerDOWNLOAD_BLOBPIXEL): { + result = handleActionReplySet(downloadBlobPixel, startrackerDownloadBlobPixel::SIZE); break; } - case (startracker::UPLOAD_CENTROID): { + case (startrackerUPLOAD_CENTROID): { result = handleUploadCentroidReply(); break; } - case (startracker::ERASE): { + case (startrackerERASE): { result = handleEraseReply(); break; } - case (startracker::CHECKSUM): { + case (startrackerCHECKSUM): { result = handleChecksumReply(); break; } - case (startracker::REQ_VERSION): { - result = handleTm(versionSet, startracker::VersionSet::SIZE); + case (startrackerREQ_VERSION): { + result = handleTm(versionSet, startrackerVersionSet::SIZE); if (result != RETURN_OK) { return result; } @@ -719,49 +837,101 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, } break; } - case (startracker::REQ_INTERFACE): { - result = handleTm(interfaceSet, startracker::InterfaceSet::SIZE); + case (startrackerREQ_INTERFACE): { + result = handleTm(interfaceSet, startrackerInterfaceSet::SIZE); break; } - case (startracker::REQ_POWER): { - result = handleTm(powerSet, startracker::PowerSet::SIZE); + case (startrackerREQ_POWER): { + result = handleTm(powerSet, startrackerPowerSet::SIZE); break; } - case (startracker::REQ_SOLUTION): { - result = handleTm(solutionSet, startracker::SolutionSet::SIZE); + case (startrackerREQ_SOLUTION): { + result = handleTm(solutionSet, startrackerSolutionSet::SIZE); break; } - case (startracker::REQ_TEMPERATURE): { - result = handleTm(temperatureSet, startracker::TemperatureSet::SIZE); + case (startrackerREQ_TEMPERATURE): { + result = handleTm(temperatureSet, startrackerTemperatureSet::SIZE); break; } - case (startracker::REQ_HISTOGRAM): { - result = handleTm(histogramSet, startracker::HistogramSet::SIZE); + case (startrackerREQ_HISTOGRAM): { + result = handleTm(histogramSet, startrackerHistogramSet::SIZE); break; } - case (startracker::REQ_CONTRAST): { - result = handleTm(contrastSet, startracker::ContrastSet::SIZE); + case (startrackerREQ_CONTRAST): { + result = handleTm(contrastSet, startrackerContrastSet::SIZE); break; } - case (startracker::LIMITS): - case (startracker::MOUNTING): - case (startracker::CAMERA): - case (startracker::CENTROIDING): - case (startracker::LISA): - case (startracker::MATCHING): - case (startracker::TRACKING): - case (startracker::VALIDATION): - case (startracker::IMAGE_PROCESSOR): - case (startracker::ALGO): { + case (startrackerSUBSCRIPTION): + case (startrackerLOGLEVEL): + case (startrackerLOGSUBSCRIPTION): + case (startrackerDEBUG_CAMERA): + case (startrackerLIMITS): + case (startrackerMOUNTING): + case (startrackerCAMERA): + case (startrackerCENTROIDING): + case (startrackerLISA): + case (startrackerMATCHING): + case (startrackerTRACKING): + case (startrackerVALIDATION): + case (startrackerIMAGE_PROCESSOR): + case (startrackerALGO): { result = handleSetParamReply(); break; } - case (startracker::REQ_CAMERA): { - handleParamRequest(cameraSet, startracker::CameraSet::SIZE); + case (startrackerREQ_CAMERA): { + handleParamRequest(cameraSet, startrackerCameraSet::SIZE); break; } - case (startracker::REQ_LIMITS): { - handleParamRequest(limitsSet, startracker::LimitsSet::SIZE); + case (startrackerREQ_LIMITS): { + handleParamRequest(limitsSet, startrackerLimitsSet::SIZE); + break; + } + case (startrackerREQ_LOG_LEVEL): { + handleParamRequest(loglevelSet, startrackerLogLevelSet::SIZE); + break; + } + case (startrackerREQ_MOUNTING): { + handleParamRequest(mountingSet, startrackerMountingSet::SIZE); + break; + } + case (startrackerREQ_IMAGE_PROCESSOR): { + handleParamRequest(imageProcessorSet, startrackerImageProcessorSet::SIZE); + break; + } + case (startrackerREQ_CENTROIDING): { + handleParamRequest(centroidingSet, startrackerCentroidingSet::SIZE); + break; + } + case (startrackerREQ_LISA): { + handleParamRequest(lisaSet, startrackerLisaSet::SIZE); + break; + } + case (startrackerREQ_MATCHING): { + handleParamRequest(matchingSet, startrackerMatchingSet::SIZE); + break; + } + case (startrackerREQ_TRACKING): { + handleParamRequest(trackingSet, startrackerTrackingSet::SIZE); + break; + } + case (startrackerREQ_VALIDATION): { + handleParamRequest(validationSet, startrackerValidationSet::SIZE); + break; + } + case (startrackerREQ_ALGO): { + handleParamRequest(algoSet, startrackerAlgoSet::SIZE); + break; + } + case (startrackerREQ_SUBSCRIPTION): { + handleParamRequest(subscriptionSet, startrackerSubscriptionSet::SIZE); + break; + } + case (startrackerREQ_LOG_SUBSCRIPTION): { + handleParamRequest(logSubscriptionSet, startrackerLogSubscriptionSet::SIZE); + break; + } + case (startrackerREQ_DEBUG_CAMERA): { + handleParamRequest(debugCameraSet, startrackerDebugCameraSet::SIZE); break; } default: { @@ -770,7 +940,6 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, result = DeviceHandlerIF::UNKNOWN_DEVICE_REPLY; } } - return result; } @@ -780,225 +949,335 @@ uint32_t StarTrackerHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { - localDataPoolMap.emplace(startracker::TICKS_TIME_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TIME_TIME_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::RUN_TIME, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::UNIX_TIME, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTICKS_TIME_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTIME_TIME_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerRUN_TIME, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerUNIX_TIME, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TICKS_VERSION_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TIME_VERSION_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::PROGRAM, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MAJOR, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MINOR, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTICKS_VERSION_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTIME_VERSION_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerPROGRAM, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMAJOR, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMINOR, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TICKS_INTERFACE_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TIME_INTERFACE_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::FRAME_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CHECKSUM_ERROR_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::SET_PARAM_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::SET_PARAM_REPLY_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::PARAM_REQUEST_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::PARAM_REPLY_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::REQ_TM_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TM_REPLY_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::ACTION_REQ_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::ACTION_REPLY_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTICKS_INTERFACE_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTIME_INTERFACE_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerFRAME_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCHECKSUM_ERROR_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSET_PARAM_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSET_PARAM_REPLY_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerPARAM_REQUEST_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerPARAM_REPLY_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerREQ_TM_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTM_REPLY_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerACTION_REQ_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerACTION_REPLY_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TICKS_POWER_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TIME_POWER_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MCU_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MCU_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::FPGA_CORE_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::FPGA_CORE_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::FPGA_18_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::FPGA_18_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::FPGA_25_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::FPGA_25_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CMV_21_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CMV_21_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CMV_PIX_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CMV_PIX_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CMV_33_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CMV_33_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CMV_RES_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CMV_RES_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTICKS_POWER_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTIME_POWER_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMCU_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMCU_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerFPGA_CORE_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerFPGA_CORE_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerFPGA_18_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerFPGA_18_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerFPGA_25_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerFPGA_25_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCMV_21_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCMV_21_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCMV_PIX_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCMV_PIX_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCMV_33_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCMV_33_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCMV_RES_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCMV_RES_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TICKS_TEMPERATURE_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TIME_TEMPERATURE_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MCU_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CMOS_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::FPGA_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTICKS_TEMPERATURE_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTIME_TEMPERATURE_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMCU_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCMOS_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerFPGA_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TICKS_SOLUTION_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TIME_SOLUTION_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CALI_QW, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CALI_QX, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CALI_QY, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CALI_QZ, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TRACK_CONFIDENCE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TRACK_QW, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TRACK_QX, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TRACK_QY, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TRACK_QZ, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TRACK_REMOVED, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::STARS_CENTROIDED, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::STARS_MATCHED_DATABASE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LISA_QW, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LISA_QX, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LISA_QY, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LISA_QZ, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LISA_PERC_CLOSE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LISA_NR_CLOSE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TRUST_WORTHY, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::STABLE_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::SOLUTION_STRATEGY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTICKS_SOLUTION_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTIME_SOLUTION_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCALI_QW, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCALI_QX, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCALI_QY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCALI_QZ, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTRACK_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTRACK_QW, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTRACK_QX, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTRACK_QY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTRACK_QZ, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTRACK_REMOVED, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSTARS_CENTROIDED, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSTARS_MATCHED_DATABASE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_QW, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_QX, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_QY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_QZ, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_PERC_CLOSE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_NR_CLOSE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTRUST_WORTHY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSTABLE_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSOLUTION_STRATEGY, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TICKS_HISTOGRAM_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TIME_HISTOGRAM_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINA0, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINA1, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINA2, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINA3, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINA4, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINA5, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINA6, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINA7, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINA8, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINB0, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINB1, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINB2, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINB3, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINB4, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINB5, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINB6, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINB7, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINB8, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINC0, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINC1, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINC2, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINC3, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINC4, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINC5, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINC6, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINC7, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BINC8, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BIND0, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BIND1, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BIND2, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BIND3, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BIND4, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BIND5, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BIND6, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BIND7, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::HISTOGRAM_BIND8, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTICKS_HISTOGRAM_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTIME_HISTOGRAM_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINA0, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINA1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINA2, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINA3, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINA4, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINA5, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINA6, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINA7, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINA8, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINB0, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINB1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINB2, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINB3, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINB4, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINB5, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINB6, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINB7, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINB8, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINC0, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINC1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINC2, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINC3, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINC4, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINC5, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINC6, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINC7, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BINC8, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BIND0, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BIND1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BIND2, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BIND3, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BIND4, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BIND5, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BIND6, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BIND7, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerHISTOGRAM_BIND8, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TICKS_CONTRAST_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::TIME_CONTRAST_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINA0, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINA1, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINA2, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINA3, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINA4, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINA5, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINA6, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINA7, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINA8, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINB0, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINB1, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINB2, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINB3, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINB4, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINB5, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINB6, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINB7, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINB8, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINC8, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINC0, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINC1, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINC2, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINC3, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINC4, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINC5, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINC6, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINC7, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BINC8, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BIND0, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BIND1, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BIND2, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BIND3, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BIND4, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BIND5, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BIND6, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BIND7, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CONTRAST_BIND8, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CHKSUM, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTICKS_CONTRAST_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTIME_CONTRAST_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINA0, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINA1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINA2, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINA3, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINA4, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINA5, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINA6, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINA7, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINA8, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINB0, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINB1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINB2, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINB3, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINB4, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINB5, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINB6, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINB7, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINB8, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINC8, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINC0, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINC1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINC2, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINC3, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINC4, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINC5, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINC6, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINC7, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BINC8, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BIND0, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BIND1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BIND2, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BIND3, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BIND4, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BIND5, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BIND6, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BIND7, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCONTRAST_BIND8, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCHKSUM, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::DWL_ID, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::DWL_PIXX, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::DWL_PIXY, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::DWL_X_UNCORRECTED, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::DWL_Y_UNCORRECTED, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::DWL_X_CORRECTED, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::DWL_Y_CORRECTED, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::DWL_MAGNITUDE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::DWL_CXA, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::DWL_CYA, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::DWL_QUALITY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerDWL_ID, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerDWL_PIXX, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerDWL_PIXY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerDWL_X_UNCORRECTED, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerDWL_Y_UNCORRECTED, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerDWL_X_CORRECTED, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerDWL_Y_CORRECTED, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerDWL_MAGNITUDE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerDWL_CXA, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerDWL_CYA, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerDWL_QUALITY, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_ID, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMFPX, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMFPY, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMCARTX, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMCARTY, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMCARTZ, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMMAGNITUDE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_DBFPX, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_DBFPY, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_DBCARTX, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_DBCARTY, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_DBCARTZ, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_DBMAGNITUDE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::MATCHEDSTR_CATALOGID, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_ID, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_CAMFPX, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_CAMFPY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_CAMCARTX, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_CAMCARTY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_CAMCARTZ, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_CAMMAGNITUDE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_DBFPX, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_DBFPY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_DBCARTX, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_DBCARTY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_DBCARTZ, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_DBMAGNITUDE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHEDSTR_CATALOGID, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::BLOBPIX_ID, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::BLOBPIX_X, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::BLOBPIX_Y, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::BLOBPIX_TOT_VAL, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::BLOBPIX_IN_USE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::BLOBPIX_BRIGHT_NEIGHBOURS, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::BLOBPIX_REGION, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerBLOBPIX_ID, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerBLOBPIX_X, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerBLOBPIX_Y, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerBLOBPIX_TOT_VAL, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerBLOBPIX_IN_USE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerBLOBPIX_BRIGHT_NEIGHBOURS, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerBLOBPIX_REGION, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CAMERA_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::FOCALLENGTH, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::EXPOSURE, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::INTERVAL, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CAMERA_OFFSET, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::PGAGAIN, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::ADCGAIN, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CAM_REG1, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CAM_VAL1, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CAM_REG2, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CAM_VAL2, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CAM_REG3, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CAM_VAL3, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CAM_REG4, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::CAM_VAL4, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAMERA_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerFOCALLENGTH, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerEXPOSURE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerINTERVAL, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAMERA_OFFSET, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerPGAGAIN, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerADCGAIN, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_REG1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_VAL1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_REG2, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_VAL2, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_REG3, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_VAL3, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_REG4, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_VAL4, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_REG5, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_VAL5, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_REG6, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_VAL6, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_REG7, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_VAL7, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_REG8, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_VAL8, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCAM_FREQ_1, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LIMITS_ACTION, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LIMITS_FPGA18CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LIMITS_FPGA25CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LIMITS_FPGA10CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LIMITS_MCUCURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LIMITS_CMOS21CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LIMITS_CMOSPIXCURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LIMITS_CMOS33CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LIMITS_CMOSVRESCURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startracker::LIMITS_CMOSTEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLIMITS_ACTION, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLIMITS_FPGA18CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLIMITS_FPGA25CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLIMITS_FPGA10CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLIMITS_MCUCURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLIMITS_CMOS21CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLIMITS_CMOSPIXCURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLIMITS_CMOS33CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLIMITS_CMOSVRESCURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLIMITS_CMOSTEMPERATURE, new PoolEntry({0})); + + localDataPoolMap.emplace(startrackerLOGLEVEL1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL2, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL3, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL4, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL5, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL6, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL7, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL8, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL9, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL10, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL11, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL12, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL13, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL14, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL15, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOGLEVEL16, new PoolEntry({0})); + + localDataPoolMap.emplace(startrackerMOUNTING_QW, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMOUNTING_QX, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMOUNTING_QY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMOUNTING_QZ, new PoolEntry({0})); + + localDataPoolMap.emplace(startrackerIMAGE_PROCESSOR_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerIMAGE_PROCESSOR_STORE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerIMAGE_PROCESSOR_SIGNALTHRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerIMAGE_PROCESSOR_DARKTHRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerIMAGE_PROCESSOR_BACKGROUNDCOMPENSATION, new PoolEntry({0})); + + localDataPoolMap.emplace(startrackerCENTROIDING_ENABLE_FILTER, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCENTROIDING_MAX_QUALITY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCENTROIDING_DARK_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCENTROIDING_MIN_QUALITY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCENTROIDING_MAX_INTENSITY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCENTROIDING_MIN_INTENSITY, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCENTROIDING_MAX_MAGNITUDE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCENTROIDING_GAUSSIAN_CMAX, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCENTROIDING_GAUSSIAN_CMIN, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCENTROIDING_TRANSMATRIX00, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCENTROIDING_TRANSMATRIX01, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCENTROIDING_TRANSMATRIX10, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerCENTROIDING_TRANSMATRIX11, new PoolEntry({0})); + + localDataPoolMap.emplace(startrackerLISA_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_PREFILTER_DIST_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_PREFILTER_ANGLE_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_FOV_WIDTH, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_FOV_HEIGHT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_FLOAT_STAR_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_CLOSE_STAR_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_RATING_WEIGHT_CLOSE_STAR_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_RATING_WEIGHT_FRACTION_CLOSE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_RATING_WEIGHT_MEAN_SUM, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_RATING_WEIGHT_DB_STAR_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_MAX_COMBINATIONS, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_NR_STARS_STOP, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLISA_FRACTION_CLOSE_STOP, new PoolEntry({0})); + + localDataPoolMap.emplace(startrackerMATCHING_SQUARED_DISTANCE_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerMATCHING_SQUARED_SHIFT_LIMIT, new PoolEntry({0})); + + localDataPoolMap.emplace(startrackerTRACKING_THIN_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTRACKING_OUTLIER_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTRACKING_OUTLIER_THRESHOLD_QUEST, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerTRACKING_TRACKER_CHOICE, new PoolEntry({0})); + + localDataPoolMap.emplace(startrackerVALIDATION_STABLE_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerVALIDATION_MAX_DIFFERENCE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerVALIDATION_MIN_TRACKER_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerVALIDATION_MIN_MATCHED_STARS, new PoolEntry({0})); + + localDataPoolMap.emplace(startrackerALGO_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerALGO_I2T_MIN_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerALGO_I2T_MIN_MATCHED, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerALGO_I2L_MIN_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerALGO_I2L_MIN_MATCHED, new PoolEntry({0})); + + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM2, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM3, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM4, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM5, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM6, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM7, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM8, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM9, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM10, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM11, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM12, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM13, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM14, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM15, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM16, new PoolEntry({0})); + + localDataPoolMap.emplace(startrackerLOG_SUBSCRIPTION_LEVEL1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOG_SUBSCRIPTION_MODULE1, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOG_SUBSCRIPTION_LEVEL2, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerLOG_SUBSCRIPTION_MODULE2, new PoolEntry({0})); + + localDataPoolMap.emplace(startrackerDEBUG_CAMERA_TIMING, new PoolEntry({0})); + localDataPoolMap.emplace(startrackerDEBUG_CAMERA_TEST, new PoolEntry({0})); return RETURN_OK; } size_t StarTrackerHandler::getNextReplyLength(DeviceCommandId_t commandId) { - return startracker::MAX_FRAME_SIZE; + return startrackerMAX_FRAME_SIZE; } ReturnValue_t StarTrackerHandler::doSendReadHook() { @@ -1011,8 +1290,8 @@ ReturnValue_t StarTrackerHandler::doSendReadHook() { ReturnValue_t StarTrackerHandler::checkMode(ActionId_t actionId) { switch (actionId) { - case startracker::UPLOAD_IMAGE: - case startracker::DOWNLOAD_IMAGE: { + case startrackerUPLOAD_IMAGE: + case startrackerDOWNLOAD_IMAGE: { return DeviceHandlerBase::acceptExternalDeviceCommands(); default: break; @@ -1024,72 +1303,72 @@ ReturnValue_t StarTrackerHandler::checkMode(ActionId_t actionId) { ReturnValue_t StarTrackerHandler::scanForActionReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (startracker::ID::PING): { - *foundId = startracker::PING_REQUEST; + case (startrackerID::PING): { + *foundId = startrackerPING_REQUEST; break; } - case (startracker::ID::WRITE): { - *foundId = startracker::WRITE; + case (startrackerID::WRITE): { + *foundId = startrackerWRITE; break; } - case (startracker::ID::BOOT): { - *foundId = startracker::BOOT; + case (startrackerID::BOOT): { + *foundId = startrackerBOOT; break; } - case (startracker::ID::TAKE_IMAGE): { - *foundId = startracker::TAKE_IMAGE; + case (startrackerID::TAKE_IMAGE): { + *foundId = startrackerTAKE_IMAGE; break; } - case (startracker::ID::UPLOAD_IMAGE): { - *foundId = startracker::UPLOAD_IMAGE; + case (startrackerID::UPLOAD_IMAGE): { + *foundId = startrackerUPLOAD_IMAGE; break; } - case (startracker::ID::ERROR_RESET): { - *foundId = startracker::RESET_ERROR; + case (startrackerID::ERROR_RESET): { + *foundId = startrackerRESET_ERROR; break; } - case (startracker::ID::ERASE): { - *foundId = startracker::ERASE; + case (startrackerID::ERASE): { + *foundId = startrackerERASE; break; } - case (startracker::ID::UNLOCK): { - *foundId = startracker::UNLOCK; + case (startrackerID::UNLOCK): { + *foundId = startrackerUNLOCK; break; } - case (startracker::ID::CHECKSUM): { - *foundId = startracker::CHECKSUM; + case (startrackerID::CHECKSUM): { + *foundId = startrackerCHECKSUM; break; } - case (startracker::ID::SET_TIME): { - *foundId = startracker::SET_TIME; + case (startrackerID::SET_TIME): { + *foundId = startrackerSET_TIME; break; } - case (startracker::ID::DOWNLOAD_CENTROID): { - *foundId = startracker::DOWNLOAD_CENTROID; + case (startrackerID::DOWNLOAD_CENTROID): { + *foundId = startrackerDOWNLOAD_CENTROID; break; } - case (startracker::ID::UPLOAD_CENTROID): { - *foundId = startracker::UPLOAD_CENTROID; + case (startrackerID::UPLOAD_CENTROID): { + *foundId = startrackerUPLOAD_CENTROID; break; } - case (startracker::ID::DOWNLOAD_MATCHED_STAR): { - *foundId = startracker::DOWNLOAD_MATCHED_STAR; + case (startrackerID::DOWNLOAD_MATCHED_STAR): { + *foundId = startrackerDOWNLOAD_MATCHED_STAR; break; } - case (startracker::ID::DOWNLOAD_DBIMAGE): { - *foundId = startracker::DOWNLOAD_DBIMAGE; + case (startrackerID::DOWNLOAD_DBIMAGE): { + *foundId = startrackerDOWNLOAD_DBIMAGE; break; } - case (startracker::ID::DOWNLOAD_BLOBPIXEL): { - *foundId = startracker::DOWNLOAD_BLOBPIXEL; + case (startrackerID::DOWNLOAD_BLOBPIXEL): { + *foundId = startrackerDOWNLOAD_BLOBPIXEL; break; } - case (startracker::ID::FPGA_ACTION): { - *foundId = startracker::FPGA_ACTION; + case (startrackerID::FPGA_ACTION): { + *foundId = startrackerFPGA_ACTION; break; } default: - sif::warning << "StarTrackerHandler::scanForParameterReply: Unknown parameter reply id" + sif::warning << "StarTrackerHandler::scanForActionReply: Unknown parameter reply id" << std::endl; return RETURN_FAILED; } @@ -1099,48 +1378,60 @@ ReturnValue_t StarTrackerHandler::scanForActionReply(DeviceCommandId_t* foundId) ReturnValue_t StarTrackerHandler::scanForSetParameterReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (startracker::ID::SUBSCRIBE): { - *foundId = startracker::SUBSCRIBE_TO_TM; + case (startrackerID::SUBSCRIPTION): { + *foundId = startrackerSUBSCRIPTION; break; } - case (startracker::ID::LIMITS): { - *foundId = startracker::LIMITS; + case (startrackerID::LIMITS): { + *foundId = startrackerLIMITS; break; } - case (startracker::ID::MOUNTING): { - *foundId = startracker::MOUNTING; + case (startrackerID::MOUNTING): { + *foundId = startrackerMOUNTING; break; } - case (startracker::ID::IMAGE_PROCESSOR): { - *foundId = startracker::IMAGE_PROCESSOR; + case (startrackerID::IMAGE_PROCESSOR): { + *foundId = startrackerIMAGE_PROCESSOR; break; } - case (startracker::ID::CAMERA): { - *foundId = startracker::CAMERA; + case (startrackerID::CAMERA): { + *foundId = startrackerCAMERA; break; } - case (startracker::ID::CENTROIDING): { - *foundId = startracker::CENTROIDING; + case (startrackerID::CENTROIDING): { + *foundId = startrackerCENTROIDING; break; } - case (startracker::ID::LISA): { - *foundId = startracker::LISA; + case (startrackerID::LISA): { + *foundId = startrackerLISA; break; } - case (startracker::ID::MATCHING): { - *foundId = startracker::MATCHING; + case (startrackerID::MATCHING): { + *foundId = startrackerMATCHING; break; } - case (startracker::ID::TRACKING): { - *foundId = startracker::TRACKING; + case (startrackerID::TRACKING): { + *foundId = startrackerTRACKING; break; } - case (startracker::ID::VALIDATION): { - *foundId = startracker::VALIDATION; + case (startrackerID::VALIDATION): { + *foundId = startrackerVALIDATION; break; } - case (startracker::ID::ALGO): { - *foundId = startracker::ALGO; + case (startrackerID::ALGO): { + *foundId = startrackerALGO; + break; + } + case (startrackerID::LOG_LEVEL): { + *foundId = startrackerLOGLEVEL; + break; + } + case (startrackerID::DEBUG_CAMERA): { + *foundId = startrackerDEBUG_CAMERA; + break; + } + case (startrackerID::LOG_SUBSCRIPTION): { + *foundId = startrackerLOGSUBSCRIPTION; break; } default: @@ -1154,12 +1445,60 @@ ReturnValue_t StarTrackerHandler::scanForSetParameterReply(DeviceCommandId_t* fo ReturnValue_t StarTrackerHandler::scanForGetParameterReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (startracker::ID::CAMERA): { - *foundId = startracker::REQ_CAMERA; + case (startrackerID::CAMERA): { + *foundId = startrackerREQ_CAMERA; break; } - case (startracker::ID::LIMITS): { - *foundId = startracker::REQ_LIMITS; + case (startrackerID::LIMITS): { + *foundId = startrackerREQ_LIMITS; + break; + } + case (startrackerID::LOG_LEVEL): { + *foundId = startrackerREQ_LOG_LEVEL; + break; + } + case (startrackerID::MOUNTING): { + *foundId = startrackerREQ_MOUNTING; + break; + } + case (startrackerID::IMAGE_PROCESSOR): { + *foundId = startrackerREQ_IMAGE_PROCESSOR; + break; + } + case (startrackerID::CENTROIDING): { + *foundId = startrackerREQ_CENTROIDING; + break; + } + case (startrackerID::LISA): { + *foundId = startrackerREQ_LISA; + break; + } + case (startrackerID::MATCHING): { + *foundId = startrackerREQ_MATCHING; + break; + } + case (startrackerID::TRACKING): { + *foundId = startrackerREQ_TRACKING; + break; + } + case (startrackerID::VALIDATION): { + *foundId = startrackerREQ_VALIDATION; + break; + } + case (startrackerID::ALGO): { + *foundId = startrackerREQ_ALGO; + break; + } + case (startrackerID::SUBSCRIPTION): { + *foundId = startrackerREQ_SUBSCRIPTION; + break; + } + case (startrackerID::LOG_SUBSCRIPTION): { + *foundId = startrackerREQ_LOG_SUBSCRIPTION; + break; + } + case (startrackerID::DEBUG_CAMERA): { + *foundId = startrackerREQ_DEBUG_CAMERA; break; } default: { @@ -1174,36 +1513,36 @@ ReturnValue_t StarTrackerHandler::scanForGetParameterReply(DeviceCommandId_t* fo ReturnValue_t StarTrackerHandler::scanForTmReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (startracker::ID::VERSION): { - *foundId = startracker::REQ_VERSION; + case (startrackerID::VERSION): { + *foundId = startrackerREQ_VERSION; break; } - case (startracker::ID::INTERFACE): { - *foundId = startracker::REQ_INTERFACE; + case (startrackerID::INTERFACE): { + *foundId = startrackerREQ_INTERFACE; break; } - case (startracker::ID::POWER): { - *foundId = startracker::REQ_POWER; + case (startrackerID::POWER): { + *foundId = startrackerREQ_POWER; break; } - case (startracker::ID::TEMPERATURE): { - *foundId = startracker::REQ_TEMPERATURE; + case (startrackerID::TEMPERATURE): { + *foundId = startrackerREQ_TEMPERATURE; break; } - case (startracker::ID::HISTOGRAM): { - *foundId = startracker::REQ_HISTOGRAM; + case (startrackerID::HISTOGRAM): { + *foundId = startrackerREQ_HISTOGRAM; break; } - case (startracker::ID::CONTRAST): { - *foundId = startracker::REQ_CONTRAST; + case (startrackerID::CONTRAST): { + *foundId = startrackerREQ_CONTRAST; break; } - case (startracker::ID::TIME): { - *foundId = startracker::REQ_TIME; + case (startrackerID::TIME): { + *foundId = startrackerREQ_TIME; break; } - case (startracker::ID::SOLUTION): { - *foundId = startracker::REQ_SOLUTION; + case (startrackerID::SOLUTION): { + *foundId = startrackerREQ_SOLUTION; break; } default: { @@ -1486,72 +1825,72 @@ ReturnValue_t StarTrackerHandler::prepareUploadCentroidCommand(const uint8_t* co << " does not exist" << std::endl; return result; } - result = j.getValue(startracker::UploadCentroidKeys::id, &req.id); + result = j.getValue(startrackerUploadCentroidKeys::id, &req.id); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startracker::UploadCentroidKeys::id << " does not exist" << std::endl; + << startrackerUploadCentroidKeys::id << " does not exist" << std::endl; return result; } - result = j.getValue(startracker::UploadCentroidKeys::pixx, &req.pixx); + result = j.getValue(startrackerUploadCentroidKeys::pixx, &req.pixx); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startracker::UploadCentroidKeys::pixx << " does not exist" << std::endl; + << startrackerUploadCentroidKeys::pixx << " does not exist" << std::endl; return result; } - result = j.getValue(startracker::UploadCentroidKeys::pixy, &req.pixy); + result = j.getValue(startrackerUploadCentroidKeys::pixy, &req.pixy); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startracker::UploadCentroidKeys::pixy << " does not exist" << std::endl; + << startrackerUploadCentroidKeys::pixy << " does not exist" << std::endl; return result; } - result = j.getValue(startracker::UploadCentroidKeys::x_uncorrected, &req.x_uncorrected); + result = j.getValue(startrackerUploadCentroidKeys::x_uncorrected, &req.x_uncorrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startracker::UploadCentroidKeys::x_uncorrected << " does not exist" + << startrackerUploadCentroidKeys::x_uncorrected << " does not exist" << std::endl; return result; } - result = j.getValue(startracker::UploadCentroidKeys::y_uncorrected, &req.y_uncorrected); + result = j.getValue(startrackerUploadCentroidKeys::y_uncorrected, &req.y_uncorrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startracker::UploadCentroidKeys::y_uncorrected << " does not exist" + << startrackerUploadCentroidKeys::y_uncorrected << " does not exist" << std::endl; return result; } - result = j.getValue(startracker::UploadCentroidKeys::x_corrected, &req.x_corrected); + result = j.getValue(startrackerUploadCentroidKeys::x_corrected, &req.x_corrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startracker::UploadCentroidKeys::x_corrected << " does not exist" << std::endl; + << startrackerUploadCentroidKeys::x_corrected << " does not exist" << std::endl; return result; } - result = j.getValue(startracker::UploadCentroidKeys::y_corrected, &req.y_corrected); + result = j.getValue(startrackerUploadCentroidKeys::y_corrected, &req.y_corrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startracker::UploadCentroidKeys::y_corrected << " does not exist" << std::endl; + << startrackerUploadCentroidKeys::y_corrected << " does not exist" << std::endl; return result; } - result = j.getValue(startracker::UploadCentroidKeys::magnitude, &req.magnitude); + result = j.getValue(startrackerUploadCentroidKeys::magnitude, &req.magnitude); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startracker::UploadCentroidKeys::magnitude << " does not exist" << std::endl; + << startrackerUploadCentroidKeys::magnitude << " does not exist" << std::endl; return result; } - result = j.getValue(startracker::UploadCentroidKeys::cxa, &req.cxa); + result = j.getValue(startrackerUploadCentroidKeys::cxa, &req.cxa); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startracker::UploadCentroidKeys::cxa << " does not exist" << std::endl; + << startrackerUploadCentroidKeys::cxa << " does not exist" << std::endl; return result; } - result = j.getValue(startracker::UploadCentroidKeys::cya, &req.cya); + result = j.getValue(startrackerUploadCentroidKeys::cya, &req.cya); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startracker::UploadCentroidKeys::cya << " does not exist" << std::endl; + << startrackerUploadCentroidKeys::cya << " does not exist" << std::endl; return result; } - result = j.getValue(startracker::UploadCentroidKeys::quality, &req.quality); + result = j.getValue(startrackerUploadCentroidKeys::quality, &req.quality); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startracker::UploadCentroidKeys::quality << " does not exist" << std::endl; + << startrackerUploadCentroidKeys::quality << " does not exist" << std::endl; return result; } uint32_t length = 0; @@ -1623,32 +1962,6 @@ void StarTrackerHandler::prepareTakeImageCommand(const uint8_t* commandData) { rawPacketLen = dataLinkLayer.getEncodedLength(); } -void StarTrackerHandler::prepareSubscriptionCommand(const uint8_t* tmId) { - uint32_t length = 18; - commandBuffer[0] = TMTC_SETPARAMREQ; - commandBuffer[1] = startracker::ID::SUBSCRIBE; - // Fill all other fields with invalid tm id - commandBuffer[2] = *tmId; - commandBuffer[3] = 0; - commandBuffer[4] = 0; - commandBuffer[5] = 0; - commandBuffer[6] = 0; - commandBuffer[7] = 0; - commandBuffer[8] = 0; - commandBuffer[9] = 0; - commandBuffer[10] = 0; - commandBuffer[11] = 0; - commandBuffer[12] = 0; - commandBuffer[13] = 0; - commandBuffer[14] = 0; - commandBuffer[15] = 0; - commandBuffer[16] = 0; - commandBuffer[17] = 0; - dataLinkLayer.encodeFrame(commandBuffer, length); - rawPacket = dataLinkLayer.getEncodedFrame(); - rawPacketLen = dataLinkLayer.getEncodedLength(); -} - void StarTrackerHandler::prepareSolutionRequest() { uint32_t length = 0; arc_tm_pack_solution_req(commandBuffer, &length); @@ -1794,10 +2107,118 @@ ReturnValue_t StarTrackerHandler::prepareRequestLimitsParams() { return RETURN_OK; } +ReturnValue_t StarTrackerHandler::prepareRequestLogLevelParams() { + uint32_t length = 0; + arc_pack_loglevel_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestMountingParams() { + uint32_t length = 0; + arc_pack_mounting_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestImageProcessorParams() { + uint32_t length = 0; + arc_pack_imageprocessor_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestCentroidingParams() { + uint32_t length = 0; + arc_pack_centroiding_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestLisaParams() { + uint32_t length = 0; + arc_pack_lisa_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestMatchingParams() { + uint32_t length = 0; + arc_pack_matching_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestTrackingParams() { + uint32_t length = 0; + arc_pack_tracking_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestValidationParams() { + uint32_t length = 0; + arc_pack_validation_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestAlgoParams() { + uint32_t length = 0; + arc_pack_algo_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestSubscriptionParams() { + uint32_t length = 0; + arc_pack_subscription_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestLogSubscriptionParams() { + uint32_t length = 0; + arc_pack_logsubscription_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestDebugCameraParams() { + uint32_t length = 0; + arc_pack_debugcamera_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + ReturnValue_t StarTrackerHandler::handleSetParamReply() { const uint8_t* reply = dataLinkLayer.getReply(); uint8_t status = *(reply + STATUS_OFFSET); - if (status != startracker::STATUS_OK) { + if (status != startrackerSTATUS_OK) { sif::warning << "StarTrackerHandler::handleSetParamReply: Failed to execute parameter set " " command with parameter ID" << static_cast(*(reply + PARAMETER_ID_OFFSET)) << std::endl; @@ -1815,7 +2236,7 @@ ReturnValue_t StarTrackerHandler::handleSetParamReply() { ReturnValue_t StarTrackerHandler::handleActionReply() { const uint8_t* reply = dataLinkLayer.getReply(); uint8_t status = *(reply + STATUS_OFFSET); - if (status != startracker::STATUS_OK) { + if (status != startrackerSTATUS_OK) { sif::warning << "StarTrackerHandler::handleActionReply: Failed to execute action " << "command with action ID " << static_cast(*(reply + ACTION_ID_OFFSET)) << " and status " @@ -1845,7 +2266,7 @@ ReturnValue_t StarTrackerHandler::handleEraseReply() { return result; } const uint8_t* replyData = dataLinkLayer.getReply() + ACTION_DATA_OFFSET; - startracker::EraseReply eraseReply(replyData); + startrackerEraseReply eraseReply(replyData); if (eraseReply.getRegion() != eraseCmd.rememberRegion) { sif::warning << "StarTrackerHandler::handleEraseReply: Region mismatch" << std::endl; return REGION_MISMATCH; @@ -1860,7 +2281,7 @@ ReturnValue_t StarTrackerHandler::handleChecksumReply() { return result; } const uint8_t* replyData = dataLinkLayer.getReply() + ACTION_DATA_OFFSET; - startracker::ChecksumReply checksumReply(replyData); + startrackerChecksumReply checksumReply(replyData); if (checksumReply.getRegion() != checksumCmd.rememberRegion) { sif::warning << "StarTrackerHandler::handleChecksumReply: Region mismatch" << std::endl; return REGION_MISMATCH; @@ -1875,7 +2296,7 @@ ReturnValue_t StarTrackerHandler::handleChecksumReply() { } PoolReadGuard rg(&checksumSet); checksumSet.checksum = checksumReply.getChecksum(); - handleDeviceTM(&checksumSet, startracker::CHECKSUM); + handleDeviceTM(&checksumSet, startrackerCHECKSUM); #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 checksumReply.printChecksum(); #endif /* OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 */ @@ -1918,7 +2339,7 @@ ReturnValue_t StarTrackerHandler::handlePingReply() { sif::info << "StarTracker: Ping status: " << static_cast(status) << std::endl; sif::info << "Ping id: 0x" << std::hex << pingId << std::endl; #endif /* OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 */ - if (status != startracker::STATUS_OK || pingId != PING_ID) { + if (status != startrackerSTATUS_OK || pingId != PING_ID) { sif::warning << "StarTrackerHandler::handlePingReply: Ping failed" << std::endl; result = PING_FAILED; } else { @@ -1932,14 +2353,14 @@ ReturnValue_t StarTrackerHandler::handlePingReply() { ReturnValue_t StarTrackerHandler::checkProgram() { PoolReadGuard pg(&versionSet); switch (versionSet.program.value) { - case startracker::Program::BOOTLOADER: + case startrackerProgram::BOOTLOADER: // Star tracker currently in bootloader program. Need to send boot command to switch to // firmware program if (startupState != StartupState::IDLE) { startupState = StartupState::BOOT; } break; - case startracker::Program::FIRMWARE: + case startrackerProgram::FIRMWARE: // Firmware already booted if (startupState != StartupState::IDLE) { startupState = StartupState::LIMITS; @@ -1956,7 +2377,7 @@ ReturnValue_t StarTrackerHandler::checkProgram() { ReturnValue_t StarTrackerHandler::handleTm(LocalPoolDataSetBase& dataset, size_t size) { ReturnValue_t result = RETURN_OK; uint8_t status = *(dataLinkLayer.getReply() + STATUS_OFFSET); - if (status != startracker::STATUS_OK) { + if (status != startrackerSTATUS_OK) { sif::warning << "StarTrackerHandler::handleTm: Reply error: " << static_cast(status) << std::endl; return REPLY_ERROR; @@ -1986,7 +2407,7 @@ ReturnValue_t StarTrackerHandler::handleTm(LocalPoolDataSetBase& dataset, size_t ReturnValue_t StarTrackerHandler::handleActionReplySet(LocalPoolDataSetBase& dataset, size_t size) { ReturnValue_t result = RETURN_OK; uint8_t status = *(dataLinkLayer.getReply() + STATUS_OFFSET); - if (status != startracker::STATUS_OK) { + if (status != startrackerSTATUS_OK) { sif::warning << "StarTrackerHandler::handleActionReplySet: Reply error: " << static_cast(status) << std::endl; return REPLY_ERROR; @@ -2015,43 +2436,55 @@ ReturnValue_t StarTrackerHandler::handleActionReplySet(LocalPoolDataSetBase& dat void StarTrackerHandler::handleStartup(const uint8_t* parameterId) { switch (*parameterId) { - case (startracker::ID::LIMITS): { + case (startrackerID::LOG_LEVEL): { + startupState = StartupState::LIMITS; + break; + } + case (startrackerID::LIMITS): { startupState = StartupState::TRACKING; break; } - case (startracker::ID::TRACKING): { + case (startrackerID::TRACKING): { startupState = StartupState::MOUNTING; break; } - case (startracker::ID::MOUNTING): { + case (startrackerID::MOUNTING): { startupState = StartupState::IMAGE_PROCESSOR; break; } - case (startracker::ID::IMAGE_PROCESSOR): { + case (startrackerID::IMAGE_PROCESSOR): { startupState = StartupState::CAMERA; break; } - case (startracker::ID::CAMERA): { + case (startrackerID::CAMERA): { startupState = StartupState::CENTROIDING; break; } - case (startracker::ID::CENTROIDING): { + case (startrackerID::CENTROIDING): { startupState = StartupState::LISA; break; } - case (startracker::ID::LISA): { + case (startrackerID::LISA): { startupState = StartupState::MATCHING; break; } - case (startracker::ID::MATCHING): { + case (startrackerID::MATCHING): { startupState = StartupState::VALIDATION; break; } - case (startracker::ID::VALIDATION): { + case (startrackerID::VALIDATION): { startupState = StartupState::ALGO; break; } - case (startracker::ID::ALGO): { + case (startrackerID::ALGO): { + startupState = StartupState::LOG_SUBSCRIPTION; + break; + } + case (startrackerID::LOG_SUBSCRIPTION): { + startupState = StartupState::DEBUG_CAMERA; + break; + } + case (startrackerID::DEBUG_CAMERA): { startupState = StartupState::DONE; break; } diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index aa7630b1..37411179 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -1,6 +1,7 @@ #ifndef MISSION_DEVICES_STARTRACKERHANDLER_H_ #define MISSION_DEVICES_STARTRACKERHANDLER_H_ +#include "OBSWConfig.h" #include #include "ArcsecDatalinkLayer.h" @@ -245,21 +246,33 @@ class StarTrackerHandler : public DeviceHandlerBase { ArcsecDatalinkLayer dataLinkLayer; - startracker::TemperatureSet temperatureSet; - startracker::VersionSet versionSet; - startracker::PowerSet powerSet; - startracker::InterfaceSet interfaceSet; - startracker::TimeSet timeSet; - startracker::SolutionSet solutionSet; - startracker::HistogramSet histogramSet; - startracker::ContrastSet contrastSet; - startracker::ChecksumSet checksumSet; - startracker::DownloadCentroidSet downloadCentroidSet; - startracker::DownloadMatchedStar downloadMatchedStar; - startracker::DownloadDBImage downloadDbImage; - startracker::DownloadBlobPixel downloadBlobPixel; - startracker::CameraSet cameraSet; - startracker::LimitsSet limitsSet; + StarTracker::TemperatureSet temperatureSet; + StarTracker::VersionSet versionSet; + StarTracker::PowerSet powerSet; + StarTracker::InterfaceSet interfaceSet; + StarTracker::TimeSet timeSet; + StarTracker::SolutionSet solutionSet; + StarTracker::HistogramSet histogramSet; + StarTracker::ContrastSet contrastSet; + StarTracker::ChecksumSet checksumSet; + StarTracker::DownloadCentroidSet downloadCentroidSet; + StarTracker::DownloadMatchedStar downloadMatchedStar; + StarTracker::DownloadDBImage downloadDbImage; + StarTracker::DownloadBlobPixel downloadBlobPixel; + StarTracker::CameraSet cameraSet; + StarTracker::LimitsSet limitsSet; + StarTracker::LogLevelSet loglevelSet; + StarTracker::MountingSet mountingSet; + StarTracker::ImageProcessorSet imageProcessorSet; + StarTracker::CentroidingSet centroidingSet; + StarTracker::LisaSet lisaSet; + StarTracker::MatchingSet matchingSet; + StarTracker::TrackingSet trackingSet; + StarTracker::ValidationSet validationSet; + StarTracker::AlgoSet algoSet; + StarTracker::SubscriptionSet subscriptionSet; + StarTracker::LogSubscriptionSet logSubscriptionSet; + StarTracker::DebugCameraSet debugCameraSet; // Pointer to object responsible for uploading and downloading images to/from the star tracker StrHelper* strHelper = nullptr; @@ -269,8 +282,8 @@ class StarTrackerHandler : public DeviceHandlerBase { // Countdown to insert delay for star tracker to switch from bootloader to firmware program Countdown bootCountdown; -#ifdef EGSE - std::string paramJsonFile = "/mnt/sd0/startracker/full.json"; +#ifndef EGSE + std::string paramJsonFile = "/mnt/sd0/startracker/flight-config.json"; #else #if OBSW_STAR_TRACKER_GROUND_CONFIG == 1 std::string paramJsonFile = "/mnt/sd0/startracker/ground-config.json"; @@ -288,6 +301,7 @@ class StarTrackerHandler : public DeviceHandlerBase { CHECK_BOOT_STATE, BOOT, BOOT_DELAY, + LOGLEVEL, LIMITS, TRACKING, MOUNTING, @@ -299,6 +313,8 @@ class StarTrackerHandler : public DeviceHandlerBase { MATCHING, VALIDATION, ALGO, + LOG_SUBSCRIPTION, + DEBUG_CAMERA, WAIT_FOR_EXECUTION, DONE }; @@ -499,14 +515,23 @@ class StarTrackerHandler : public DeviceHandlerBase { ReturnValue_t prepareFpgaActionCommand(const uint8_t* commandData, size_t commandDataLen); /** - * @brief Will fill the command buffer with the command to request the set camera parameters. + * @brief The following function will fill the command buffer with the command to request + * a parameter set. */ ReturnValue_t prepareRequestCameraParams(); - - /** - * @brief Will fill the command buffer with the command to request the set limits. - */ ReturnValue_t prepareRequestLimitsParams(); + ReturnValue_t prepareRequestLogLevelParams(); + ReturnValue_t prepareRequestMountingParams(); + ReturnValue_t prepareRequestImageProcessorParams(); + ReturnValue_t prepareRequestCentroidingParams(); + ReturnValue_t prepareRequestLisaParams(); + ReturnValue_t prepareRequestMatchingParams(); + ReturnValue_t prepareRequestTrackingParams(); + ReturnValue_t prepareRequestValidationParams(); + ReturnValue_t prepareRequestAlgoParams(); + ReturnValue_t prepareRequestSubscriptionParams(); + ReturnValue_t prepareRequestLogSubscriptionParams(); + ReturnValue_t prepareRequestDebugCameraParams(); /** * @brief Handles action replies with datasets. diff --git a/linux/devices/startracker/StarTrackerJsonCommands.cpp b/linux/devices/startracker/StarTrackerJsonCommands.cpp index c9d09a96..d8ddb7ca 100644 --- a/linux/devices/startracker/StarTrackerJsonCommands.cpp +++ b/linux/devices/startracker/StarTrackerJsonCommands.cpp @@ -504,6 +504,12 @@ ReturnValue_t Lisa::createCommand(uint8_t* buffer) { } 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; @@ -632,3 +638,280 @@ ReturnValue_t Algo::createCommand(uint8_t* buffer) { 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; +} diff --git a/linux/devices/startracker/StarTrackerJsonCommands.h b/linux/devices/startracker/StarTrackerJsonCommands.h index 2c816056..a827d829 100644 --- a/linux/devices/startracker/StarTrackerJsonCommands.h +++ b/linux/devices/startracker/StarTrackerJsonCommands.h @@ -173,4 +173,68 @@ class Algo : public ArcsecJsonParamBase { ReturnValue_t createCommand(uint8_t* buffer) override; }; +/** + * @brief Generates command to configure the log level parameters. + * + */ +class LogLevel : public ArcsecJsonParamBase { + public: + LogLevel(); + + size_t getSize(); + + private: + static const size_t COMMAND_SIZE = 18; + + ReturnValue_t createCommand(uint8_t* buffer) override; +}; + +/** + * @brief Generates command to set subscription parameters. + * + */ +class Subscription : public ArcsecJsonParamBase { + public: + Subscription(); + + size_t getSize(); + + private: + static const size_t COMMAND_SIZE = 18; + + ReturnValue_t createCommand(uint8_t* buffer) override; +}; + +/** + * @brief Generates command to set log subscription parameters. + * + */ +class LogSubscription : public ArcsecJsonParamBase { + public: + LogSubscription(); + + size_t getSize(); + + private: + static const size_t COMMAND_SIZE = 6; + + ReturnValue_t createCommand(uint8_t* buffer) override; +}; + +/** + * @brief Generates command to set debug camera parameters + * + */ +class DebugCamera : public ArcsecJsonParamBase { + public: + DebugCamera(); + + size_t getSize(); + + private: + static const size_t COMMAND_SIZE = 10; + + ReturnValue_t createCommand(uint8_t* buffer) override; +}; + #endif /* BSP_Q7S_DEVICES_DEVICEDEFINITIONS_STARTRACKERJSONCOMMANDS_H_ */ diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 1369383c..f918f921 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -61,7 +61,7 @@ debugging. */ #endif -#if defined EGSE +#ifdef EGSE #define OBSW_ADD_STAR_TRACKER 1 #endif @@ -108,7 +108,7 @@ debugging. */ #define OBSW_DEBUG_PLOC_SUPERVISOR 0 #define OBSW_DEBUG_PDEC_HANDLER 0 -#if defined EGSE +#ifdef EGSE #define OBSW_DEBUG_STARTRACKER 1 #else #define OBSW_DEBUG_STARTRACKER 0 diff --git a/thirdparty/arcsec_star_tracker b/thirdparty/arcsec_star_tracker index aa1ebfc1..7cb426a6 160000 --- a/thirdparty/arcsec_star_tracker +++ b/thirdparty/arcsec_star_tracker @@ -1 +1 @@ -Subproject commit aa1ebfc154558dad746a175d2efee52470fddefe +Subproject commit 7cb426a6a1f1b25ac02d7bfd0792c412451c70af diff --git a/tmtc b/tmtc index 199ffe1a..5d8b9aac 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 199ffe1a321c09ba9726c87413045f8b32f40e90 +Subproject commit 5d8b9aac1fea707015bd991b865da7f3405859e8