#include "cmwparamalignment.h"
#include "ui_cmwparamalignment.h"
#include "cprocess_level.h"
#include "logic.h"
CMWParamAlignment::CMWParamAlignment(QWidget *parent) :
	CMWidget(parent),
    ui(new Ui::CMWParamAlignment)
{
	ui->setupUi(this);
}

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

void CMWParamAlignment::MInit()
{
	CProcess_Level* pLevel=GET_PROCESS(PROCESS_LEVELING,
									   SM_MAIN,CProcess_Level);
	Q_ASSERT(pLevel);

    CProcess_Locate* pLocate=GET_PROCESS(PROCESS_LOCATE,
                                       SM_MAIN,CProcess_Locate);
    Q_ASSERT(pLevel);
    Q_ASSERT(pLocate);

    Variant* pparams[20];
    pparams[0]=pLevel->m_Variants.get_Variant(Var_Process_Level_MaxLevelCount);
    pparams[1]=pLevel->m_Variants.get_Variant(Var_Process_Level_MaxSearchCount);
	pparams[2]=pLevel->m_Variants.get_Variant(Var_Process_Level_LevelParent);
	pparams[3]=pLevel->m_Variants.get_Variant(Var_Process_Level_ROIParent);
	pparams[4]=pLevel->m_Variants.get_Variant(Var_Process_Level_MidStepOffset);

	pparams[5]=pLevel->m_Variants.get_Variant(Var_Process_Level_AngleThres);
	pparams[6]=pLevel->m_Variants.get_Variant(Var_Process_Level_MidOffsetThres);
    pparams[7]=pLevel->m_Variants.get_Variant(Var_Process_Level_OffsetThres);
    

	//pparams[4]=pLevel->m_Variants.get_Variant(Var_Process_Level_AngleOffset);
	
    pparams[8]=pLevel->m_Variants.get_Variant(Var_Process_Level_BaseOffsetMax);
    pparams[9]=pLevel->m_Variants.get_Variant(Var_Process_Level_BaseOffsetMin);

	pparams[10]=pLevel->m_Variants.get_Variant(Var_Process_Align_AFirst);
	pparams[11]=pLevel->m_Variants.get_Variant(Var_Process_Align_AStep);
	pparams[12]=pLevel->m_Variants.get_Variant(Var_Process_Align_BFirst);
	pparams[13]=pLevel->m_Variants.get_Variant(Var_Process_Align_BStep);

	pparams[14]=pLocate->m_Variants.get_Variant(Var_Process_Locate_LightDirect);
	pparams[15]=pLocate->m_Variants.get_Variant(Var_Process_Locate_LightSide);
	pparams[16]=pLocate->m_Variants.get_Variant(Var_Location_Exposure);
	pparams[17]=pLocate->m_Variants.get_Variant(Var_Location_Gain);
	pparams[18]=pLevel->m_Variants.get_Variant(Var_Process_ModelEnableLowOffset);


   ui->widget_Level->MParamInit_list(pparams,19);
   mchildwidgets[intptr_t(ui->widget_Level)]=ui->widget_Level;
}

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

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