#include "stable.h"
#include "cmwsettingkerf.h"
#include "ui_cmwsettingkerf.h"

CMWSettingKerf::CMWSettingKerf(QWidget *parent)
	: CMWidget(parent)
{
	ui = new Ui::CMWSettingKerf();
	ui->setupUi(this);
}

CMWSettingKerf::~CMWSettingKerf()
{
	delete ui;
}

void CMWSettingKerf::MInit()
{
	CProcess_HalfCutKerf* pHalfcutKerf=GET_PROCESS(PROCESS_HALFKERF,SM_MAIN,CProcess_HalfCutKerf);
	Q_ASSERT(pHalfcutKerf);
	Variant* pparam[5]={0};
	pparam[0]=pHalfcutKerf->m_Variants.get_Variant(Var_Process_Kerf_BeforeSearchSleep_ID);
	pparam[1]=pHalfcutKerf->m_Variants.get_Variant(Var_Process_Kerf_AfterSearchSleep_ID);
	pparam[2] = pHalfcutKerf->m_Variants.get_Variant(Var_Process_Kerf_MinOffsetThres_ID);
	pparam[3] = pHalfcutKerf->m_Variants.get_Variant(Var_Process_Kerf_MaxOffsetThres_ID);
	pparam[4] = pHalfcutKerf->m_Variants.get_Variant(Var_Process_Kerf_EnableAutoCompensation);
	ui->widget_Halfcut->MParamInit_list(pparam,5);
	mchildwidgets[(uintptr_t)ui->widget_Halfcut]=ui->widget_Halfcut;

	CProcess_Kerf* pKerf=GET_PROCESS(PROCESS_KERFCHECK,SM_MAIN,CProcess_Kerf);
	Q_ASSERT(pKerf);
	Variant* pparamKerf[5]={0};
	pparamKerf[0]=pKerf->m_Variants.get_Variant(Var_Process_Kerf_BeforeSearchSleep_ID);
	pparamKerf[1]=pKerf->m_Variants.get_Variant(Var_Process_Kerf_AfterSearchSleep_ID);
	pparamKerf[2] = pHalfcutKerf->m_Variants.get_Variant(Var_Process_Kerf_EnableAutoCompensation);
	ui->widget_LaserKerf->MParamInit_list(pparamKerf,3);
	mchildwidgets[(uintptr_t)ui->widget_LaserKerf]=ui->widget_LaserKerf;

	CProcess_LaserKerf* pKerfCali=GET_PROCESS(PROCESS_LASERKERF, SM_MAIN, CProcess_LaserKerf);
	Q_ASSERT(pKerf);
	Variant* pparamCali[5]={0};
	pparamCali[0]=pKerfCali->m_Variants.get_Variant(Var_Process_Kerf_BeforeSearchSleep_ID);
	pparamCali[1]=pKerfCali->m_Variants.get_Variant(Var_Process_Kerf_AfterSearchSleep_ID);
	ui->widget_LaserCali->MParamInit_list(pparamCali,2);
	mchildwidgets[(uintptr_t)ui->widget_LaserCali]=ui->widget_LaserCali;

}

