#include "stdafx.h"
|
#include "config.h"
|
|
const TCHAR *PANEL_SIDE[] = {_T("A_TOP"), _T("B_TOP"), _T("C_TOP"), _T("D_TOP"),_T("A_BOT"), _T("B_BOT"), _T("C_BOT"), _T("D_BOT")};
|
|
CInspectionBase::CInspectionBase()
|
{
|
m_pBufferSize = NULL;
|
m_pBufferCount = NULL;
|
m_pMemFrameNo = NULL;
|
m_pCameraPort = NULL;
|
m_pFrameWidth = NULL;
|
m_pFrameHeight = NULL;
|
m_nBoardID = NULL;
|
m_nBoardCh = NULL;
|
m_nThreadCount = 0;
|
m_eProcessMode = 0;
|
|
m_bAutoDefectView = TRUE;
|
|
Reset();
|
|
#if USE_WEBSOCKET
|
ReadWebSocketConfigFile(_T("WebSocket"));
|
#endif // USE_WEBSOCKET
|
}
|
CInspectionBase::~CInspectionBase()
|
{
|
Reset();
|
}
|
|
|
BOOL CInspectionBase::ReadInspectConfigFile(CString strFileName,int nCamCount)
|
{
|
#if OFFLINE_KEY == 1
|
if (nCamCount <= 0)
|
{
|
nCamCount = 4;
|
}
|
#endif
|
|
CConfig CF;
|
if(CF.SetRegiConfig(NULL, NULL, (TCHAR*)(LPCTSTR)strFileName, FileMap_Mode) == FALSE)
|
return FALSE;
|
|
Reset();
|
|
int nValue;
|
m_nCameraCount = nCamCount;
|
|
CF.GetItemValue(_T("acqmode"), nValue, 0);
|
m_AcqMode = (AcqMode)nValue;
|
CF.GetItemValue(_T("framedefectpixel"), m_nFrameDefectPixel, 1000);
|
CF.GetItemValue(_T("scancount"), m_nScanCount, 2);
|
CF.GetItemValue(_T("threadcount"), m_nThreadCount, 2);
|
|
if(m_nCameraCount > 0)
|
{
|
m_pBufferSize = new int[m_nCameraCount];
|
ZeroMemory(m_pBufferSize,sizeof(int)*m_nCameraCount);
|
m_pBufferCount = new int[m_nCameraCount];
|
ZeroMemory(m_pBufferCount,sizeof(int)*m_nCameraCount);
|
m_pMemFrameNo = new int[m_nCameraCount];
|
ZeroMemory(m_pMemFrameNo,sizeof(int)*m_nCameraCount);
|
m_pCameraPort = new int[m_nCameraCount];
|
ZeroMemory(m_pCameraPort,sizeof(int)*m_nCameraCount);
|
m_pFrameWidth = new int[m_nCameraCount];
|
ZeroMemory(m_pFrameWidth,sizeof(int)*m_nCameraCount);
|
m_pFrameHeight = new int[m_nCameraCount];
|
ZeroMemory(m_pFrameHeight,sizeof(int)*m_nCameraCount);
|
m_nBoardID = new int[m_nCameraCount];
|
ZeroMemory(m_nBoardID,sizeof(int)*m_nCameraCount);
|
m_nBoardCh = new int[m_nCameraCount];
|
ZeroMemory(m_nBoardCh,sizeof(int)*m_nCameraCount);
|
|
int iCam;
|
CString str,strVal;
|
for(iCam=0;iCam<m_nCameraCount;iCam++)
|
{
|
str.Format(_T("CAM[%d]_camcca"),iCam);
|
CF.GetItemValue((TCHAR*)(LPCTSTR)str, strVal);
|
m_strCamCCA.Add(strVal);
|
|
str.Format(_T("CAM[%d]_camcvi"),iCam);
|
CF.GetItemValue((TCHAR*)(LPCTSTR)str, strVal);
|
m_strCamCVI.Add(strVal);
|
|
str.Format(_T("CAM[%d]_buffersize"),iCam);
|
CF.GetItemValue((TCHAR*)(LPCTSTR)str, m_pBufferSize[iCam],0);
|
|
str.Format(_T("CAM[%d]_buffercount"),iCam);
|
CF.GetItemValue((TCHAR*)(LPCTSTR)str, m_pBufferCount[iCam],0);
|
|
str.Format(_T("CAM[%d]_camport"),iCam);
|
CF.GetItemValue((TCHAR*)(LPCTSTR)str, m_pCameraPort[iCam],2);
|
|
str.Format(_T("CAM[%d]_framewidth"),iCam);
|
CF.GetItemValue((TCHAR*)(LPCTSTR)str, m_pFrameWidth[iCam],8192);
|
|
str.Format(_T("CAM[%d]_frameheight"),iCam);
|
CF.GetItemValue((TCHAR*)(LPCTSTR)str, m_pFrameHeight[iCam],1024);
|
|
str.Format(_T("CAM[%d]_BoardID"),iCam);
|
CF.GetItemValue((TCHAR*)(LPCTSTR)str, m_nBoardID[iCam],-1);
|
|
str.Format(_T("CAM[%d]_BoardCH"),iCam);
|
CF.GetItemValue((TCHAR*)(LPCTSTR)str, m_nBoardCh[iCam],-1);
|
|
m_pMemFrameNo[iCam] = m_pBufferSize[iCam] * m_pBufferCount[iCam];
|
}
|
}
|
|
ReadExtraConfigFile(_T("ExtraBase"));
|
return TRUE;
|
}
|
|
//0326
|
void CInspectionBase::SetGlassInfo(CString strHPanelID, CString strRecipeName)
|
{
|
m_strHPanelID = m_strOnlineID = _T("");
|
m_strRecipeName = _T("");
|
|
m_strHPanelID = m_strOnlineID = strHPanelID;
|
m_strRecipeName = strRecipeName;
|
}
|
|
void CInspectionBase::Reset()
|
{
|
m_AcqMode = Acq_Simul;
|
m_nCameraCount = 0;
|
m_nScanCount = 0;
|
m_nThreadCount = 0;
|
m_nFrameDefectPixel = 14000;
|
m_nMaxDefect = 1000;
|
m_eProcessMode = 0;
|
m_nStageNo = 0;
|
|
if(m_pFrameWidth != NULL)
|
delete[] m_pFrameWidth, m_pFrameWidth=NULL;
|
if(m_pFrameHeight != NULL)
|
delete[] m_pFrameHeight, m_pFrameHeight=NULL;
|
if(m_pBufferSize != NULL)
|
delete[] m_pBufferSize, m_pBufferSize=NULL;
|
if(m_pBufferCount != NULL)
|
delete[] m_pBufferCount, m_pBufferCount=NULL;
|
if(m_pMemFrameNo != NULL)
|
delete[] m_pMemFrameNo, m_pMemFrameNo=NULL;
|
if(m_pCameraPort != NULL)
|
delete[] m_pCameraPort, m_pCameraPort=NULL;
|
if(m_nBoardID != NULL)
|
delete[] m_nBoardID, m_nBoardID=NULL;
|
if(m_nBoardCh != NULL)
|
delete[] m_nBoardCh, m_nBoardCh=NULL;
|
|
m_strCamCCA.RemoveAll();
|
m_strCamCVI.RemoveAll();
|
|
m_strHPanelID = _T("");
|
m_strRecipeName = _T("");
|
m_strOnlineID = _T("");
|
m_strLoadingTime = _T("");
|
m_strProcessID = _T("");
|
m_strStepID = _T("");
|
m_strLoadingDay = _T("");
|
|
m_bAutoDefectView = TRUE;
|
|
m_bUseChipCIM = FALSE;
|
m_nChipCount = 0;
|
m_nChipMinLen = 0;
|
m_nChipMaxLen = 0;
|
m_nChipMinDep = 0;
|
m_nChipMaxDep = 0;
|
|
m_bPutTeethChip = FALSE;
|
m_bPutTeethCrack = FALSE;
|
m_bPutTeethBurr = FALSE;
|
m_bPutTeethChamfer = FALSE;
|
m_bPutTeethInChip = FALSE;
|
m_bPutTeethInCrack = FALSE;
|
m_bPutTeethInBurr = FALSE;
|
m_bPutTeethInChamfer = FALSE;
|
m_bPutTeethTopCorner = FALSE;
|
m_bPutTeethBotCorner = FALSE;
|
m_bPutTeethCornerDimension = FALSE;
|
m_bPutTeethDimension = FALSE;
|
m_bPutTeethNotch = FALSE;
|
m_bPutTeethNotchDimension = FALSE;
|
m_bPutTeethNotchChamfer = FALSE;
|
m_bPutTeethNotchRadius = FALSE;
|
m_bPutTeethUserDefect = FALSE;
|
m_bPutTeethMark = FALSE;
|
m_bPutTeethException = FALSE;
|
m_bPutTeethLicense = FALSE;
|
|
m_nMaxChipSaveCount = 20;
|
m_nMaxCrackSaveCount = 10;
|
m_nMaxBurrSaveCount = 10;
|
m_nMaxChamferSaveCount = 10;
|
m_nMaxInChipSaveCount = 20;
|
m_nMaxInCrackSaveCount = 10;
|
m_nMaxInBurrSaveCount = 10;
|
m_nMaxInChamferSaveCount = 10;
|
m_nMaxTopCornerSaveCount = 10;
|
m_nMaxBotCornerSaveCount = 10;
|
m_nMaxCornerDimensionSaveCount = 10;
|
m_nMaxDimensionSaveCount = 10;
|
m_nMaxNotchSaveCount = 10;
|
m_nMaxNotchDimensionSaveCount = 10;
|
m_nMaxNotchChamferSaveCount = 10;
|
m_nMaxNotchRadiusSaveCount = 10;
|
m_nMaxUserDefectSaveCount = 10;
|
m_nMaxMarkSaveCount = 10;
|
m_nMaxExceptionSaveCount = 10;
|
m_nMaxLicenseSaveCount = 10;
|
}
|
|
BOOL CInspectionBase::ReadExtraConfigFile(CString strFileName)
|
{
|
if (strFileName.IsEmpty())
|
return FALSE;
|
|
CString strTaget;
|
strTaget.Empty();
|
strTaget = PATH_INSPECTOR;
|
strTaget += "\\";
|
strTaget += "Config";
|
strTaget += "\\";
|
strTaget += strFileName;
|
strTaget += ".cfg";
|
|
CFileFind findFile;
|
BOOL bFind = findFile.FindFile(strTaget);
|
if (bFind == FALSE)
|
return WriteExtraConfigFile(strFileName);
|
|
CConfig Config;
|
if (!Config.SetRegiConfig(NULL, NULL, (TCHAR*)(LPCTSTR)strTaget, FileMap_Mode))
|
return FALSE;
|
|
Config.GetItemValue(_T("USE_SEND_CHIP_TO_CIM"), m_bUseChipCIM, FALSE);
|
Config.GetItemValue(_T("SEND_CHIP_TO_CIM_COUNT"), m_nChipCount, 0);
|
Config.GetItemValue(_T("CHIP_MIN_LENGTH"), m_nChipMinLen, 0);
|
Config.GetItemValue(_T("CHIP_MAX_LENGTH"), m_nChipMaxLen, 0);
|
Config.GetItemValue(_T("CHIP_MIN_DEPTH"), m_nChipMinDep, 0);
|
Config.GetItemValue(_T("CHIP_MAX_DEPTH"), m_nChipMaxDep, 0);
|
|
Config.GetItemValue(_T("USE_PUT_TEETH_CHIP"), m_bPutTeethChip, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_CRACK"), m_bPutTeethCrack, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_BURR"), m_bPutTeethBurr, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_CHAMFER"), m_bPutTeethChamfer, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_IN_CHIP"), m_bPutTeethInChip, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_IN_CRACK"), m_bPutTeethInCrack, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_IN_BURR"), m_bPutTeethInBurr, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_IN_CHAMFER"), m_bPutTeethInChamfer, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_TOP_CORNER"), m_bPutTeethTopCorner, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_BOT_CORNER"), m_bPutTeethBotCorner, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_CORNER_DIMENSION"), m_bPutTeethCornerDimension, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_DIMENSION"), m_bPutTeethDimension, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_NOTCH"), m_bPutTeethNotch, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_NOTCH_DIMENSION"), m_bPutTeethNotchDimension, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_NOTCH_CHAMFER"), m_bPutTeethNotchChamfer, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_NOTCH_RADIUS"), m_bPutTeethNotchRadius, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_USER_DEFECT"), m_bPutTeethUserDefect, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_MARK"), m_bPutTeethMark, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_EXCEPTION"), m_bPutTeethException, FALSE);
|
Config.GetItemValue(_T("USE_PUT_TEETH_LICENSE"), m_bPutTeethLicense, FALSE);
|
|
Config.GetItemValue(_T("MAX_CHIP_SAVE_COUNT"), m_nMaxChipSaveCount, 20);
|
Config.GetItemValue(_T("MAX_CRACK_SAVE_COUNT"), m_nMaxCrackSaveCount, 10);
|
Config.GetItemValue(_T("MAX_BURR_SAVE_COUNT"), m_nMaxBurrSaveCount, 10);
|
Config.GetItemValue(_T("MAX_CHAMFER_SAVE_COUNT"), m_nMaxChamferSaveCount, 10);
|
Config.GetItemValue(_T("MAX_IN_CHIP_SAVE_COUNT"), m_nMaxInChipSaveCount, 20);
|
Config.GetItemValue(_T("MAX_IN_CRACK_SAVE_COUNT"), m_nMaxInCrackSaveCount, 10);
|
Config.GetItemValue(_T("MAX_IN_BURR_SAVE_COUNT"), m_nMaxInBurrSaveCount, 10);
|
Config.GetItemValue(_T("MAX_IN_CHAMFER_SAVE_COUNT"), m_nMaxInChamferSaveCount, 10);
|
Config.GetItemValue(_T("MAX_TOP_CORNER_SAVE_COUNT"), m_nMaxTopCornerSaveCount, 10);
|
Config.GetItemValue(_T("MAX_BOT_CORNER_SAVE_COUNT"), m_nMaxBotCornerSaveCount, 10);
|
Config.GetItemValue(_T("MAX_CORNER_DIMENSION_SAVE_COUNT"), m_nMaxCornerDimensionSaveCount, 10);
|
Config.GetItemValue(_T("MAX_DIMENSION_SAVE_COUNT"), m_nMaxDimensionSaveCount, 10);
|
Config.GetItemValue(_T("MAX_NOTCH_SAVE_COUNT"), m_nMaxNotchSaveCount, 10);
|
Config.GetItemValue(_T("MAX_NOTCH_DIMENSION_SAVE_COUNT"), m_nMaxNotchDimensionSaveCount, 10);
|
Config.GetItemValue(_T("MAX_NOTCH_SAVE_COUNTCHAMFER"), m_nMaxNotchChamferSaveCount, 10);
|
Config.GetItemValue(_T("MAX_NOTCH_RADIUS_SAVE_COUNT"), m_nMaxNotchRadiusSaveCount, 10);
|
Config.GetItemValue(_T("MAX_USER_DEFECT_SAVE_COUNT"), m_nMaxUserDefectSaveCount, 10);
|
Config.GetItemValue(_T("MAX_MARK_SAVE_COUNT"), m_nMaxMarkSaveCount, 10);
|
Config.GetItemValue(_T("MAX_EXCEPTION_SAVE_COUNT"), m_nMaxExceptionSaveCount, 10);
|
Config.GetItemValue(_T("MAX_LICENSE_SAVE_COUNT"), m_nMaxLicenseSaveCount, 10);
|
|
return TRUE;
|
}
|
|
BOOL CInspectionBase::WriteExtraConfigFile(CString strFileName)
|
{
|
if (strFileName.IsEmpty())
|
return FALSE;
|
|
CString strTaget;
|
strTaget.Empty();
|
strTaget = PATH_INSPECTOR;
|
strTaget += "\\";
|
strTaget += "Config";
|
strTaget += "\\";
|
strTaget += strFileName;
|
strTaget += ".cfg";
|
|
CFileFind findFile;
|
BOOL bFind = findFile.FindFile(strTaget);
|
if (bFind == FALSE)
|
{
|
CFile FileI;
|
if (!FileI.Open(strTaget, CFile::modeCreate))
|
return FALSE;
|
FileI.Close();
|
}
|
|
CConfig Config;
|
if (!Config.SetRegiConfig(NULL, NULL, (TCHAR*)(LPCTSTR)strTaget, FileMap_Mode))
|
return FALSE;
|
|
Config.SetItemValue(_T("USE_SEND_CHIP_TO_CIM"), m_bUseChipCIM);
|
Config.SetItemValue(_T("SEND_CHIP_TO_CIM_COUNT"), m_nChipCount);
|
Config.SetItemValue(_T("CHIP_MIN_LENGTH"), m_nChipMinLen);
|
Config.SetItemValue(_T("CHIP_MAX_LENGTH"), m_nChipMaxLen);
|
Config.SetItemValue(_T("CHIP_MIN_DEPTH"), m_nChipMinDep);
|
Config.SetItemValue(_T("CHIP_MAX_DEPTH"), m_nChipMaxDep);
|
|
Config.SetItemValue(_T("USE_PUT_TEETH_CHIP"), m_bPutTeethChip);
|
Config.SetItemValue(_T("USE_PUT_TEETH_CRACK"), m_bPutTeethCrack);
|
Config.SetItemValue(_T("USE_PUT_TEETH_BURR"), m_bPutTeethBurr);
|
Config.SetItemValue(_T("USE_PUT_TEETH_CHAMFER"), m_bPutTeethChamfer);
|
Config.SetItemValue(_T("USE_PUT_TEETH_IN_CHIP"), m_bPutTeethInChip);
|
Config.SetItemValue(_T("USE_PUT_TEETH_IN_CRACK"), m_bPutTeethInCrack);
|
Config.SetItemValue(_T("USE_PUT_TEETH_IN_BURR"), m_bPutTeethInBurr);
|
Config.SetItemValue(_T("USE_PUT_TEETH_IN_CHAMFER"), m_bPutTeethInChamfer);
|
Config.SetItemValue(_T("USE_PUT_TEETH_TOP_CORNER"), m_bPutTeethTopCorner);
|
Config.SetItemValue(_T("USE_PUT_TEETH_BOT_CORNER"), m_bPutTeethBotCorner);
|
Config.SetItemValue(_T("USE_PUT_TEETH_CORNER_DIMENSION"), m_bPutTeethCornerDimension);
|
Config.SetItemValue(_T("USE_PUT_TEETH_DIMENSION"), m_bPutTeethDimension);
|
Config.SetItemValue(_T("USE_PUT_TEETH_NOTCH"), m_bPutTeethNotch);
|
Config.SetItemValue(_T("USE_PUT_TEETH_NOTCH_DIMENSION"), m_bPutTeethNotchDimension);
|
Config.SetItemValue(_T("USE_PUT_TEETH_NOTCH_CHAMFER"), m_bPutTeethNotchChamfer);
|
Config.SetItemValue(_T("USE_PUT_TEETH_NOTCH_RADIUS"), m_bPutTeethNotchRadius);
|
Config.SetItemValue(_T("USE_PUT_TEETH_USER_DEFECT"), m_bPutTeethUserDefect);
|
Config.SetItemValue(_T("USE_PUT_TEETH_MARK"), m_bPutTeethMark);
|
Config.SetItemValue(_T("USE_PUT_TEETH_EXCEPTION"), m_bPutTeethException);
|
Config.SetItemValue(_T("USE_PUT_TEETH_LICENSE"), m_bPutTeethLicense);
|
|
Config.SetItemValue(_T("MAX_CHIP_SAVE_COUNT"), m_nMaxChipSaveCount);
|
Config.SetItemValue(_T("MAX_CRACK_SAVE_COUNT"), m_nMaxCrackSaveCount);
|
Config.SetItemValue(_T("MAX_BURR_SAVE_COUNT"), m_nMaxBurrSaveCount);
|
Config.SetItemValue(_T("MAX_CHAMFER_SAVE_COUNT"), m_nMaxChamferSaveCount);
|
Config.SetItemValue(_T("MAX_IN_CHIP_SAVE_COUNT"), m_nMaxInChipSaveCount);
|
Config.SetItemValue(_T("MAX_IN_CRACK_SAVE_COUNT"), m_nMaxInCrackSaveCount);
|
Config.SetItemValue(_T("MAX_IN_BURR_SAVE_COUNT"), m_nMaxInBurrSaveCount);
|
Config.SetItemValue(_T("MAX_IN_CHAMFER_SAVE_COUNT"), m_nMaxInChamferSaveCount);
|
Config.SetItemValue(_T("MAX_TOP_CORNER_SAVE_COUNT"), m_nMaxTopCornerSaveCount);
|
Config.SetItemValue(_T("MAX_BOT_CORNER_SAVE_COUNT"), m_nMaxBotCornerSaveCount);
|
Config.SetItemValue(_T("MAX_CORNER_DIMENSION_SAVE_COUNT"), m_nMaxCornerDimensionSaveCount);
|
Config.SetItemValue(_T("MAX_DIMENSION_SAVE_COUNT"), m_nMaxDimensionSaveCount);
|
Config.SetItemValue(_T("MAX_NOTCH_SAVE_COUNT"), m_nMaxNotchSaveCount);
|
Config.SetItemValue(_T("MAX_NOTCH_DIMENSION_SAVE_COUNT"), m_nMaxNotchDimensionSaveCount);
|
Config.SetItemValue(_T("MAX_NOTCH_SAVE_COUNTCHAMFER"), m_nMaxNotchChamferSaveCount);
|
Config.SetItemValue(_T("MAX_NOTCH_RADIUS_SAVE_COUNT"), m_nMaxNotchRadiusSaveCount);
|
Config.SetItemValue(_T("MAX_USER_DEFECT_SAVE_COUNT"), m_nMaxUserDefectSaveCount);
|
Config.SetItemValue(_T("MAX_MARK_SAVE_COUNT"), m_nMaxMarkSaveCount);
|
Config.SetItemValue(_T("MAX_EXCEPTION_SAVE_COUNT"), m_nMaxExceptionSaveCount);
|
Config.SetItemValue(_T("MAX_LICENSE_SAVE_COUNT"), m_nMaxLicenseSaveCount);
|
|
return Config.WriteToFile();
|
}
|
|
BOOL CInspectionBase::ReadWebSocketConfigFile(CString strFileName)
|
{
|
if (strFileName.IsEmpty())
|
return FALSE;
|
|
CString strTaget;
|
strTaget.Empty();
|
strTaget = PATH_INSPECTOR;
|
strTaget += "\\";
|
strTaget += "Config";
|
strTaget += "\\";
|
strTaget += strFileName;
|
strTaget += ".cfg";
|
|
CFileFind findFile;
|
BOOL bFind = findFile.FindFile(strTaget);
|
if (bFind == FALSE)
|
return WriteWebSocketConfigFile(strFileName);
|
|
CConfig Config;
|
if (!Config.SetRegiConfig(NULL, NULL, (TCHAR*)(LPCTSTR)strTaget, FileMap_Mode))
|
return FALSE;
|
|
// WEB SOCKET
|
CString strCount, strURI;
|
for (size_t i = 0; i < 4; i++)
|
{
|
strCount.Format(_T("WS_CLIENT_THREAD_COUNT%d"), i + 1);
|
strURI.Format(_T("WS_CLIENT_THREAD_URI%d"), i + 1);
|
Config.GetItemValue((TCHAR*)(LPCTSTR)strCount, m_nWSClientThreadCount[i], 1);
|
Config.GetItemValue((TCHAR*)(LPCTSTR)strURI, m_nWSClientThreadURI[i], _T(""));
|
}
|
return TRUE;
|
}
|
|
BOOL CInspectionBase::WriteWebSocketConfigFile(CString strFileName)
|
{
|
if (strFileName.IsEmpty())
|
return FALSE;
|
|
CString strTaget;
|
strTaget.Empty();
|
strTaget = PATH_INSPECTOR;
|
strTaget += "\\";
|
strTaget += "Config";
|
strTaget += "\\";
|
strTaget += strFileName;
|
strTaget += ".cfg";
|
|
CFileFind findFile;
|
BOOL bFind = findFile.FindFile(strTaget);
|
if (bFind == FALSE)
|
{
|
CFile FileI;
|
if (!FileI.Open(strTaget, CFile::modeCreate))
|
return FALSE;
|
FileI.Close();
|
}
|
|
CConfig Config;
|
if (!Config.SetRegiConfig(NULL, NULL, (TCHAR*)(LPCTSTR)strTaget, FileMap_Mode))
|
return FALSE;
|
|
// WEB SOCKET
|
CString strCount, strURI;
|
for (size_t i = 0; i < 4; i++)
|
{
|
strCount.Format(_T("WS_CLIENT_THREAD_COUNT%d"), i + 1);
|
strURI.Format(_T("WS_CLIENT_THREAD_URI%d"), i + 1);
|
Config.SetItemValue((TCHAR*)(LPCTSTR)strCount, m_nWSClientThreadCount[i]);
|
Config.SetItemValue((TCHAR*)(LPCTSTR)strURI, m_nWSClientThreadURI[i]);
|
}
|
|
return Config.WriteToFile();
|
}
|