#include "stdafx.h" #include "MotionModelFactory.h" #include "TomoMotionModel.h" #include "RADMotionModel.h" #include "ResetMotionModel.h" #include "CalibrationModel.h" #include "ParkingModel.h" #include "SelfTestModel.h" #include "CBCTMotionModel.h" #include "CArmGeneralModel.h" #include "CArmResetMotionModel.h" using namespace DIOS::Dev::Detail::MachineryECOM; MotionModelFactory *MotionModelFactory::m_instance = nullptr; MotionModelFactory::MotionModelFactory() { } MotionModelFactory::~MotionModelFactory() { } MotionModelFactory *MotionModelFactory::Instance() { if (m_instance == nullptr) { m_instance = new MotionModelFactory(); } return m_instance; } IMotionModel *MotionModelFactory::CreateModel(MOTION_MODEL_TYPE type) { IMotionModel *model = nullptr; switch (type) { case MOTION_MODEL_TYPE_TOMO: model = CreateTomoMotionModel(); break; case MOTION_MODEL_TYPE_RAD: model = CreateRADMotionModel(); break; case MOTION_MODEL_TYPE_TOMO_RESET: model = CreateResetMotionModel(); break; case MOTION_MODEL_TYPE_TOMO_CALIBRATION: model = CreateCalibrationMotionModel(); break; case MOTION_MODEL_TYPE_TOMO_PARKING: model = CreateParkingMotionModel(); break; case MOTION_MODEL_TYPE_TOMO_SELFTEST: model = CreateSelfTestMotionModel(); break; case MOTION_MODEL_TYPE_CBCT: model = CreateCBCTMotionModel(); break; case MOTION_MODEL_TYPE_CARM_GENERAL: model = CreateCArmGeneralMotionModel(); break; case MOTION_MODEL_TYPE_CARM_RESET: model = CreateCArmResetMotionModel(); break; default: break; } return model; } IMotionModel *MotionModelFactory::CreateTomoMotionModel() { return new TomoMotionModel(); } IMotionModel *MotionModelFactory::CreateRADMotionModel() { return new RADMotionModel(); } IMotionModel *MotionModelFactory::CreateResetMotionModel() { return new ResetMotionModel(); } IMotionModel *MotionModelFactory::CreateCalibrationMotionModel() { return new CalibrationModel(); } IMotionModel *MotionModelFactory::CreateParkingMotionModel() { return new ParkingModel(); } IMotionModel *MotionModelFactory::CreateSelfTestMotionModel() { return new SelfTestModel(); } IMotionModel *MotionModelFactory::CreateCBCTMotionModel() { return new CBCTMotionModel(); } IMotionModel *MotionModelFactory::CreateCArmGeneralMotionModel() { return new CArmGeneralModel(); } IMotionModel *MotionModelFactory::CreateCArmResetMotionModel() { return new CArmResetMotionModel(); }