#include "stable.h"
#include "cmwsettingbase.h"
#include "ui_cmwsettingbase.h"

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

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

void CMWSettingBase::MInit()
{
	Variant *pParam[20]={0};
	CProcess_Locate* pLocate=GET_PROCESS(PROCESS_LOCATE,SM_MAIN,CProcess_Locate);
	pParam[0]=pLocate->m_Variants.get_Variant(Var_Process_Locate_MaxDiameterError);

	CProcess_LaserPowerCali* pLaserPowercali=GET_PROCESS(PROCESS_POWERCALI_D_NARROW,SM_MAIN,CProcess_LaserPowerCali);
	pParam[1]=pLaserPowercali->m_Variants.get_Variant(Var_Process_LaserPowerCali_PowerCheck_Thres);
	pParam[2]=pLaserPowercali->m_Variants.get_Variant(Var_Process_LaserPowerCali_PowerCheck_ThresPercent);

	CCoatVolumeSensor* pVolumeSensor=GET_CARD(COATVOLUME_SENSOR,CCoatVolumeSensor);
	pParam[3]= pVolumeSensor->m_Variants.get_Variant(Var_CoatVolume_AlarmDiffVolume);
	pParam[4]= pVolumeSensor->m_Variants.get_Variant(Var_CoatVolume_ReplaceDate);
	
	CLaserPathDriver* pLaserPathDriver = GET_CARD(LASERPATH_DRIVER, CLaserPathDriver);
	pParam[5] = pLaserPathDriver->m_Variants.get_Variant(Var_LensFLow_VolumeCheck_WaitTime);
	pParam[6] = pLaserPathDriver->m_Variants.get_Variant(Var_LensFlow_Volume_MinThres);
	pParam[7] = pLaserPathDriver->m_Variants.get_Variant(Var_LensFlow_Volume_MaxThres);
	
	//pParam[9]= pVolumeSensor->m_Variants.get_Variant(Var_CoatVolume_InvalidDays);

	ui->widget->MParamInit_list(pParam,8);
	mchildwidgets[intptr_t(ui->widget)]=ui->widget;

	
	Variant *pParamQualified[20]={0};
	CProcess_Scan* pScan=GET_PROCESS(PROCESS_SCAN, SM_TRANS,CProcess_Scan);
	Q_ASSERT(pScan);
	pParamQualified[0]=pScan->m_Variants.get_Variant(Var_Process_WaferCheckType);

	//CProcess_LaserPowerCali* pLaserPowercali=GET_PROCESS(PROCESS_POWERCALI_D_NARROW,SM_MAIN,CProcess_LaserPowerCali);
	Q_ASSERT(pLaserPowercali);
	pParamQualified[1]=pLaserPowercali->m_Variants.get_Variant(Var_Process_PowerCheckType);
	
	CGEMDriver* pDriverGEM=GET_CARD(GEM_DRIVER_JNG, CGEMDriver);
	pParamQualified[2]=pDriverGEM->m_Variants.get_Variant(Var_MES_RecipeRoot);

	//pParamQualified[3] = m_gSystem.m_Variants.get_Variant(Var_Enable_FixLaserPathAngle);

	ui->widget_Qualified->MParamInit_list(pParamQualified,3);
	mchildwidgets[intptr_t(ui->widget_Qualified)]=ui->widget_Qualified;


	Variant* pparam[20]={0};
	int ID[20]={0};
	pparam[0]=m_gSystem.m_Variants.get_Variant(Var_AllSystem_SafeDoorConfig_ID);
	pparam[1]=m_gSystem.m_Variants.get_Variant(Var_AllSystem_FullScreen_ID);
	pparam[2]=m_gSystem.m_Variants.get_Variant(Var_AllSystem_EnableSoftKeyboard_ID);
	pparam[3]=m_gSystem.m_Variants.get_Variant(Var_AllSystem_StyleSheet_Type_ID);
	pparam[4]=m_gSystem.m_Variants.get_Variant(Var_AllSystem_Language_Type_ID);
	ui->widget_System->MParamInit_list(pparam,5);
	mchildwidgets[intptr_t(ui->widget_System)]=ui->widget_System;
}

