#include "stable.h"
#include "cmwsettinglevel.h"
#include "ui_cmwsettinglevel.h"

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

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

void CMWSettingLevel::MInit()
{
	Variant *pParamLevel[5]={0};
    CProcess_Level* pLevel=GET_PROCESS(PROCESS_LEVELING,
                                       SM_MAIN,
                                       CProcess_Level);
    CMProduct* product=GET_CHDIRECT(PRODUCT,CMProduct);
    Q_ASSERT(product);
    pParamLevel[0]=pLevel->m_Variants.get_Variant(Var_Process_Level_BeforeSearchSleep);
    pParamLevel[1]=pLevel->m_Variants.get_Variant(Var_Process_Level_AfterSearchSleep);
    ui->widget_Level->MParamInit_list(pParamLevel,2);


	Variant *pParam[10]={0};
	CProcess_Locate* pLocate=GET_PROCESS(PROCESS_LOCATE,
		SM_MAIN,
		CProcess_Locate);

	pParam[0]=pLocate->m_Variants.get_Variant(Var_Process_Locate_SearchStep);
	pParam[1]=pLocate->m_Variants.get_Variant(Var_Process_Locate_SearchCount);
	pParam[2]=pLocate->m_Variants.get_Variant(Var_Process_Locate_StopSleep);
	//pParam[3]=pLocate->m_Variants.get_Variant(Var_Process_Locate_MaxDiameterError);
	ui->widget_Locate->MParamInit_list(pParam,3);


	mchildwidgets[intptr_t(ui->widget_Locate)]=ui->widget_Locate;
    mchildwidgets[intptr_t(ui->widget_Level)]=ui->widget_Level;
}

void CMWSettingLevel::MFresh()
{
	CMWidget::MFresh();
}

void CMWSettingLevel::MApply()
{
	CMWidget::MApply();
}

