Removed insert function in config handler, not needed. Added more tests for config handler
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
@ -2,11 +2,11 @@
|
||||
* GlobalConfigHandler.h
|
||||
*
|
||||
* Created on: May 3, 2022
|
||||
* Author: metobs
|
||||
* Author: Jona Petri (IRS)
|
||||
*/
|
||||
|
||||
#ifndef BSP_LINUX_GLOBALCONFIGHANDLER_H_
|
||||
#define BSP_LINUX_GLOBALCONFIGHANDLER_H_
|
||||
#ifndef MISSION_UTILITY_GLOBALCONFIGHANDLER_H_
|
||||
#define MISSION_UTILITY_GLOBALCONFIGHANDLER_H_
|
||||
|
||||
#include <fsfw/objectmanager/SystemObject.h>
|
||||
#include <fsfw/storagemanager/StorageManagerIF.h>
|
||||
@ -21,14 +21,7 @@
|
||||
#include <fsfw/action/ActionHelper.h>
|
||||
#include <fsfw/action/HasActionsIF.h>
|
||||
|
||||
static constexpr double PARAM0_DEFAULT = 5.0;
|
||||
static constexpr int PARAM1_DEFAULT = 905;
|
||||
|
||||
enum ParamIds : uint8_t {
|
||||
PARAM0 = 0,
|
||||
PARAM1 = 1,
|
||||
|
||||
};
|
||||
#include "GlobalConfigFileDefinitions.h"
|
||||
|
||||
static std::map<ParamIds, std::string> PARAM_KEY_MAP = {
|
||||
{PARAM0, "Parameter0"},
|
||||
@ -58,34 +51,26 @@ public:
|
||||
|
||||
ReturnValue_t initialize();
|
||||
|
||||
ReturnValue_t lockConfigFile();
|
||||
ReturnValue_t unlockConfigFile();
|
||||
template <typename T> ReturnValue_t setConfigFileValue(std::string key, T data);
|
||||
template <typename T> ReturnValue_t getConfigFileValue(std::string key, T& data);
|
||||
template <typename T> ReturnValue_t insertConfigFileValue(std::string key, T data);
|
||||
|
||||
template <typename T> ReturnValue_t setConfigFileValue(ParamIds paramID, T data);
|
||||
template <typename T> ReturnValue_t getConfigFileValue(ParamIds paramID, T& data);
|
||||
|
||||
ReturnValue_t resetConfigFileValues();
|
||||
ReturnValue_t WriteConfigFile();
|
||||
std::string getConfigFileName();
|
||||
|
||||
private:
|
||||
static MutexIF* configLock ;
|
||||
|
||||
ReturnValue_t lockConfigFile();
|
||||
ReturnValue_t unlockConfigFile();
|
||||
|
||||
|
||||
|
||||
ReturnValue_t ReadConfigFile();
|
||||
ReturnValue_t ResetConfigFile();
|
||||
|
||||
ReturnValue_t setConfigFileName(std::string configFileName);
|
||||
std::string getConfigFileName();
|
||||
|
||||
ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueId,
|
||||
ParameterWrapper* parameterWrapper,
|
||||
const ParameterWrapper* newValues,
|
||||
uint16_t startAtIndex);
|
||||
|
||||
ReturnValue_t handleDoubleParamUpdate(std::string key,
|
||||
ParameterWrapper* parameterWrapper,
|
||||
const ParameterWrapper* newValues);
|
||||
ReturnValue_t handleIntParamUpdate(std::string key,
|
||||
ParameterWrapper* parameterWrapper,
|
||||
const ParameterWrapper* newValues) ;
|
||||
|
||||
|
||||
private:
|
||||
static MutexIF* configLock ;
|
||||
|
||||
|
||||
MessageQueueIF* commandQueue;
|
||||
@ -94,4 +79,4 @@ private:
|
||||
|
||||
};
|
||||
|
||||
#endif /* BSP_LINUX_GLOBALCONFIGHANDLER_H_ */
|
||||
#endif /* MISSION_UTILITY_GLOBALCONFIGHANDLER_H_ */
|
||||
|
Reference in New Issue
Block a user