From d14e256901afa11dd97e84c07faba8827c6937a1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 29 Jun 2023 16:40:21 +0200 Subject: [PATCH 1/3] STR tests --- bsp_q7s/core/ObjectFactory.cpp | 11 +---------- bsp_q7s/core/scheduling.cpp | 1 + bsp_q7s/em/emObjectFactory.cpp | 3 +++ dummies/helperFactory.cpp | 13 ++++++++----- dummies/helperFactory.h | 1 + 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 8223ceaf..339b80e0 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -932,16 +932,7 @@ void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) { starTrackerCookie->setNoFixedSizeReply(); StrComHandler* strComIF = new StrComHandler(objects::STR_COM_IF); - const char* paramJsonFile = nullptr; -#ifdef EGSE - paramJsonFile = "/home/pi/arcsec/json/flight-config.json"; -#else -#if OBSW_STAR_TRACKER_GROUND_CONFIG == 1 - paramJsonFile = "/mnt/sd0/startracker/ground-config.json"; -#else - paramJsonFile = "/mnt/sd0/startracker/flight-config.json"; -#endif -#endif + const char* paramJsonFile = "/mnt/sd0/startracker/flight-config.json"; if (paramJsonFile == nullptr) { sif::error << "No valid Star Tracker parameter JSON file" << std::endl; } diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 90918cf3..60cffb98 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -339,6 +339,7 @@ void scheduling::initTasks() { #endif #if OBSW_ADD_STAR_TRACKER == 1 + sif::debug << "scheduling STR helper" << std::endl; // Relatively high priority to make sure STR COM works well. PeriodicTaskIF* strHelperTask = factory->createPeriodicTask("STR_HELPER", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 2e171e02..21f8a6ad 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -65,6 +65,9 @@ void ObjectFactory::produce(void* args) { // The ACU broke. dummyCfg.addOnlyAcuDummy = true; #endif +#if OBSW_ADD_STAR_TRACKER == 1 + dummyCfg.addStrDummy = false; +#endif #if OBSW_ADD_BPX_BATTERY_HANDLER == 1 dummyCfg.addBpxBattDummy = false; #endif diff --git a/dummies/helperFactory.cpp b/dummies/helperFactory.cpp index 157d11d3..398fc4bd 100644 --- a/dummies/helperFactory.cpp +++ b/dummies/helperFactory.cpp @@ -63,11 +63,14 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio rws[3] = new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy); ObjectFactory::createRwAssy(pwrSwitcher, power::Switches::PDU2_CH2_RW_5V, rws, rwIds); new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER); - auto* strAssy = new StrAssembly(objects::STR_ASSY); - strAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); - auto* strDummy = - new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); - strDummy->connectModeTreeParent(*strAssy); + + if (cfg.addStrDummy) { + auto* strAssy = new StrAssembly(objects::STR_ASSY); + strAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); + auto* strDummy = + new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); + strDummy->connectModeTreeParent(*strAssy); + } if (cfg.addSyrlinksDummies) { auto* syrlinksDummy = new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); diff --git a/dummies/helperFactory.h b/dummies/helperFactory.h index bab9d8d8..5466e809 100644 --- a/dummies/helperFactory.h +++ b/dummies/helperFactory.h @@ -19,6 +19,7 @@ struct DummyCfg { bool addTempSensorDummies = true; bool addRtdComIFDummy = true; bool addPlocDummies = true; + bool addStrDummy = true; bool addCamSwitcherDummy = false; }; -- 2.43.0 From 8cc5220dd00eb3a3ceea2990d0a3d9b73069dec0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Jul 2023 17:02:52 +0200 Subject: [PATCH 2/3] remove printout --- bsp_q7s/scheduling.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/bsp_q7s/scheduling.cpp b/bsp_q7s/scheduling.cpp index 4c853406..d7c179ad 100644 --- a/bsp_q7s/scheduling.cpp +++ b/bsp_q7s/scheduling.cpp @@ -340,7 +340,6 @@ void scheduling::initTasks() { #endif #if OBSW_ADD_STAR_TRACKER == 1 - sif::debug << "scheduling STR helper" << std::endl; // Relatively high priority to make sure STR COM works well. PeriodicTaskIF* strHelperTask = factory->createPeriodicTask("STR_HELPER", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, -- 2.43.0 From 86f7d05526cdcb59aeaed442241cf97459875ec4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 12 Jul 2023 17:03:17 +0200 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44c98cb5..8b2c84ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ will consitute of a breaking change warranting a new major release: maximum size of 255 bytes. - TCS CTRL: Limit number of heater handler messages sent in case there are not sensors available anymore. +- Fix to allow adding real STR device for EM. # Added -- 2.43.0