159 lines
8.3 KiB
C++
159 lines
8.3 KiB
C++
#include "helpers.h"
|
|
|
|
#include <dummies/AcuDummy.h>
|
|
#include <dummies/BpxDummy.h>
|
|
#include <dummies/ComCookieDummy.h>
|
|
#include <dummies/ComIFDummy.h>
|
|
#include <dummies/CoreControllerDummy.h>
|
|
#include <dummies/GpsDummy.h>
|
|
#include <dummies/GyroAdisDummy.h>
|
|
#include <dummies/GyroL3GD20Dummy.h>
|
|
#include <dummies/ImtqDummy.h>
|
|
#include <dummies/MgmLIS3MDLDummy.h>
|
|
#include <dummies/MgmRm3100Dummy.h>
|
|
#include <dummies/P60DockDummy.h>
|
|
#include <dummies/PduDummy.h>
|
|
#include <dummies/PlPcduDummy.h>
|
|
#include <dummies/RwDummy.h>
|
|
#include <dummies/SaDeploymentDummy.h>
|
|
#include <dummies/StarTrackerDummy.h>
|
|
#include <dummies/SusDummy.h>
|
|
#include <dummies/SyrlinksDummy.h>
|
|
#include <mission/system/objects/CamSwitcher.h>
|
|
|
|
#include "TemperatureSensorInserter.h"
|
|
#include "dummies/Max31865Dummy.h"
|
|
#include "dummies/Tmp1075Dummy.h"
|
|
|
|
using namespace dummy;
|
|
|
|
void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) {
|
|
new ComIFDummy(objects::DUMMY_COM_IF);
|
|
auto* comCookieDummy = new ComCookieDummy();
|
|
new BpxDummy(objects::BPX_BATT_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
if (cfg.addCoreCtrlCfg) {
|
|
new CoreControllerDummy(objects::CORE_CONTROLLER);
|
|
}
|
|
if (cfg.addRtdComIFDummy) {
|
|
new ComIFDummy(objects::SPI_RTD_COM_IF);
|
|
}
|
|
new RwDummy(objects::RW1, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new RwDummy(objects::RW2, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new RwDummy(objects::RW3, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER);
|
|
new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
if (cfg.addSyrlinksDummies) {
|
|
new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
}
|
|
auto* imtqDummy = new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
imtqDummy->enableThermalModule(ThermalStateCfg());
|
|
if (cfg.addPowerDummies) {
|
|
new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new PduDummy(objects::PDU2_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new P60DockDummy(objects::P60DOCK_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
}
|
|
|
|
if (cfg.addAcsBoardDummies) {
|
|
new GyroAdisDummy(objects::GYRO_0_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new GyroL3GD20Dummy(objects::GYRO_1_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new MgmLIS3MDLDummy(objects::MGM_0_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new MgmLIS3MDLDummy(objects::MGM_2_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new MgmRm3100Dummy(objects::MGM_1_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new MgmRm3100Dummy(objects::MGM_3_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new GpsDummy(objects::GPS_CONTROLLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
}
|
|
|
|
if (cfg.addSusDummies) {
|
|
new SusDummy(objects::SUS_0_N_LOC_XFYFZM_PT_XF, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new SusDummy(objects::SUS_1_N_LOC_XBYFZM_PT_XB, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new SusDummy(objects::SUS_2_N_LOC_XFYBZB_PT_YB, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new SusDummy(objects::SUS_3_N_LOC_XFYBZF_PT_YF, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new SusDummy(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new SusDummy(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new SusDummy(objects::SUS_6_R_LOC_XFYBZM_PT_XF, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new SusDummy(objects::SUS_7_R_LOC_XBYBZM_PT_XB, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new SusDummy(objects::SUS_8_R_LOC_XBYBZB_PT_YB, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new SusDummy(objects::SUS_9_R_LOC_XBYBZB_PT_YF, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new SusDummy(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::DUMMY_COM_IF, comCookieDummy);
|
|
new SusDummy(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, objects::DUMMY_COM_IF, comCookieDummy);
|
|
}
|
|
|
|
if (cfg.addTempSensorDummies) {
|
|
std::map<object_id_t, Max31865Dummy*> tempSensorDummies;
|
|
tempSensorDummies.emplace(objects::RTD_0_IC3_PLOC_HEATSPREADER,
|
|
new Max31865Dummy(objects::RTD_0_IC3_PLOC_HEATSPREADER,
|
|
objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(objects::RTD_1_IC4_PLOC_MISSIONBOARD,
|
|
new Max31865Dummy(objects::RTD_1_IC4_PLOC_MISSIONBOARD,
|
|
objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(
|
|
objects::RTD_2_IC5_4K_CAMERA,
|
|
new Max31865Dummy(objects::RTD_2_IC5_4K_CAMERA, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(objects::RTD_3_IC6_DAC_HEATSPREADER,
|
|
new Max31865Dummy(objects::RTD_3_IC6_DAC_HEATSPREADER,
|
|
objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(
|
|
objects::RTD_4_IC7_STARTRACKER,
|
|
new Max31865Dummy(objects::RTD_4_IC7_STARTRACKER, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(
|
|
objects::RTD_5_IC8_RW1_MX_MY,
|
|
new Max31865Dummy(objects::RTD_5_IC8_RW1_MX_MY, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(
|
|
objects::RTD_6_IC9_DRO,
|
|
new Max31865Dummy(objects::RTD_6_IC9_DRO, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(
|
|
objects::RTD_7_IC10_SCEX,
|
|
new Max31865Dummy(objects::RTD_7_IC10_SCEX, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(
|
|
objects::RTD_8_IC11_X8,
|
|
new Max31865Dummy(objects::RTD_8_IC11_X8, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(
|
|
objects::RTD_9_IC12_HPA,
|
|
new Max31865Dummy(objects::RTD_9_IC12_HPA, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(
|
|
objects::RTD_10_IC13_PL_TX,
|
|
new Max31865Dummy(objects::RTD_10_IC13_PL_TX, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(
|
|
objects::RTD_11_IC14_MPA,
|
|
new Max31865Dummy(objects::RTD_11_IC14_MPA, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(
|
|
objects::RTD_12_IC15_ACU,
|
|
new Max31865Dummy(objects::RTD_12_IC15_ACU, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(objects::RTD_13_IC16_PLPCDU_HEATSPREADER,
|
|
new Max31865Dummy(objects::RTD_13_IC16_PLPCDU_HEATSPREADER,
|
|
objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(
|
|
objects::RTD_14_IC17_TCS_BOARD,
|
|
new Max31865Dummy(objects::RTD_14_IC17_TCS_BOARD, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempSensorDummies.emplace(
|
|
objects::RTD_15_IC18_IMTQ,
|
|
new Max31865Dummy(objects::RTD_15_IC18_IMTQ, objects::DUMMY_COM_IF, comCookieDummy));
|
|
|
|
std::map<object_id_t, Tmp1075Dummy*> tempTmpSensorDummies;
|
|
tempTmpSensorDummies.emplace(
|
|
objects::TMP1075_HANDLER_TCS_0,
|
|
new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_0, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempTmpSensorDummies.emplace(
|
|
objects::TMP1075_HANDLER_TCS_1,
|
|
new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_1, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempTmpSensorDummies.emplace(
|
|
objects::TMP1075_HANDLER_PLPCDU_0,
|
|
new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_0, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempTmpSensorDummies.emplace(
|
|
objects::TMP1075_HANDLER_PLPCDU_1,
|
|
new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_1, objects::DUMMY_COM_IF, comCookieDummy));
|
|
tempTmpSensorDummies.emplace(
|
|
objects::TMP1075_HANDLER_IF_BOARD,
|
|
new Tmp1075Dummy(objects::TMP1075_HANDLER_IF_BOARD, objects::DUMMY_COM_IF, comCookieDummy));
|
|
|
|
new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, tempSensorDummies,
|
|
tempTmpSensorDummies);
|
|
}
|
|
new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, power::NO_SWITCH);
|
|
new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
|
}
|