move json init somewhere else
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2023-03-07 18:47:16 +01:00
parent 1b00029202
commit fd62efcae2
5 changed files with 67 additions and 36 deletions

View File

@ -16,7 +16,8 @@ extern "C" {
}
StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
StrHelper* strHelper, power::Switch_t powerSwitch)
const char* jsonFileStr, StrHelper* strHelper,
power::Switch_t powerSwitch)
: DeviceHandlerBase(objectId, comIF, comCookie),
temperatureSet(this),
versionSet(this),
@ -41,6 +42,7 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF,
logSubscriptionSet(this),
debugCameraSet(this),
strHelper(strHelper),
paramJsonFile(jsonFileStr),
powerSwitch(powerSwitch) {
if (comCookie == nullptr) {
sif::error << "StarTrackerHandler: Invalid com cookie" << std::endl;
@ -60,6 +62,24 @@ ReturnValue_t StarTrackerHandler::initialize() {
return result;
}
// TODO: This takes ages. Move it into a separate thread, use a mutexed boolean
// to check whether init was done. Or move it into the helper class..
// Also move update of these classes into the helper class.
tracking.init(paramJsonFile);
logLevel.init(paramJsonFile);
logSubscription.init(paramJsonFile);
debugCamera.init(paramJsonFile);
algo.init(paramJsonFile);
validation.init(paramJsonFile);
matching.init(paramJsonFile);
lisa.init(paramJsonFile);
centroiding.init(paramJsonFile);
camera.init(paramJsonFile);
imageProcessor.init(paramJsonFile);
mounting.init(paramJsonFile);
limits.init(paramJsonFile);
subscription.init(paramJsonFile);
EventManagerIF* manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
if (manager == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1