GrpcPrint/PrintC/UI/Controller.cpp
2024-04-09 16:53:02 +08:00

41 lines
941 B
C++

#include "Controller.h"
#include "../config/ConfigManager.h"
Controller::Controller()
: m_Machine(nullptr)
//, m_Axis(nullptr)
, m_StateCtrlWrapper(nullptr)
, m_SysParamWrapper(nullptr)
, m_AxisRecordWrapper(nullptr)
, m_SignalStateWrapper(nullptr)
, m_MachineCfg(nullptr){
}
Controller::~Controller() {
//DELP(m_Axis);
DELP(m_StateCtrlWrapper);
DELP(m_SysParamWrapper);
DELP(m_AxisRecordWrapper);
DELP(m_SignalStateWrapper);
DELP(m_Machine);
DELP(m_MachineCfg);
}
bool Controller::Init() {
m_StateCtrlWrapper = new StateCtrlWrapper();
m_SysParamWrapper = new SysParamWrapper();
m_AxisRecordWrapper = new AxisRecordWrapper();
m_SignalStateWrapper = new SignalStateWrapper();
ConfigManager::Instance()->Init();
m_Machine = ConfigManager::Instance()->GetMachine();
m_Machine->SetAxisAndSignal(m_SysParamWrapper, m_AxisRecordWrapper);
m_MachineCfg = ConfigManager::Instance()->GetMachineCfg();
return true;
}