|
@@ -98,7 +98,7 @@ namespace OTSModelSharp
|
|
|
string strProgMgrParamFileName = GetOTSMeasurePrefFileName();
|
|
|
|
|
|
// program manager param file exists?
|
|
|
- if (Exists(strProgMgrParamFileName))
|
|
|
+ if (File.Exists(strProgMgrParamFileName))
|
|
|
{
|
|
|
// tried to load it
|
|
|
if (!Load(strProgMgrParamFileName))
|
|
@@ -108,114 +108,12 @@ namespace OTSModelSharp
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- // get app system file path
|
|
|
- string strCompanySysDataPath = GetOTSSysDataPathName();
|
|
|
-
|
|
|
-
|
|
|
- // company system data path exists?
|
|
|
- if (!Exists(strCompanySysDataPath))
|
|
|
- {
|
|
|
- // company system data path doesn't exists, create it
|
|
|
- Directory.CreateDirectory(strCompanySysDataPath);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- // SEM stage
|
|
|
- CSEMStageData pStageData = new CSEMStageData();
|
|
|
- pStageData.SetScanFieldSize100(SCREEN_WIDTH_MAG100);
|
|
|
- CIntRange pXAxis = new CIntRange(Convert.ToInt32(STAGE_DATA_X_AXIS_START), Convert.ToInt32(STAGE_DATA_X_AXIS_END));
|
|
|
- pStageData.SetXAxis(pXAxis);
|
|
|
- CIntRange pYAxis = new CIntRange(Convert.ToInt32(STAGE_DATA_Y_AXIS_START), Convert.ToInt32(STAGE_DATA_Y_AXIS_END));
|
|
|
- pStageData.SetYAxis(pYAxis);
|
|
|
- pStageData.SetMinMag(otsdataconst.MAGNIFICATION_MIN);
|
|
|
-
|
|
|
- // general parameter
|
|
|
- COTSGeneralParam pGenParam = new COTSGeneralParam();
|
|
|
- pGenParam.SetSampleName(SAMPLE_NAME);
|
|
|
- pGenParam.SetMeasurementSwitch(MEASURE_SWITCH);
|
|
|
-
|
|
|
- // get software pack program data path
|
|
|
- string strOTSProDataPathName = GetOTSProgDataPathName();
|
|
|
- if (string.IsNullOrEmpty(strOTSProDataPathName))
|
|
|
- {
|
|
|
- // shouldn't happen, software pack program data path is empty
|
|
|
- logger.Info("LoadInfoFromProgMgrFile: failed to get software pack program data path."); //LogErrorTrace(__FILE__, __LINE__, _T("LoadInfoFromProgMgrFile: failed to get software pack program data path."));
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- pGenParam.SetMsrParamFileFolderName(strOTSProDataPathName);
|
|
|
- pGenParam.SetPartSTDLibFolderName(strOTSProDataPathName);
|
|
|
-
|
|
|
- //image scan parameter
|
|
|
- COTSImgScanPrm pImageScanParam = new COTSImgScanPrm ();
|
|
|
-
|
|
|
- pImageScanParam.SetStopMode(((int)DataPublic.STOPT_MODE).ToString());
|
|
|
- pImageScanParam.SetStopParamMeasTime(DataPublic.MEASURE_TIME);
|
|
|
- pImageScanParam.SetStopParamFields(DataPublic.FIELDS_NUM);
|
|
|
- pImageScanParam.SetStopParamParticles(DataPublic.PARTICL_NUM);
|
|
|
- pImageScanParam.SetStartImageMode(DataPublic.FETCH_IMAGE_MODE);
|
|
|
- pImageScanParam.SetScanImageSpeed(DataPublic.SCAN_SPEED);
|
|
|
- pImageScanParam.SetImageResulotion(DataPublic.IMAGE_SIZE);
|
|
|
-
|
|
|
-
|
|
|
- //image process parameter
|
|
|
- COTSImageProcParam pImageProcParam = new COTSImageProcParam ();
|
|
|
-
|
|
|
- // particle area
|
|
|
- CDoubleRange INCA_AREA = new CDoubleRange(5, 100);
|
|
|
- // background gray
|
|
|
- CIntRange BACK_GRAY = new CIntRange(100, 255);
|
|
|
- // particle gray
|
|
|
- CIntRange INCA_GRAY = new CIntRange(5, 100);
|
|
|
-
|
|
|
- pImageProcParam.SetIncAreaRange(INCA_AREA);
|
|
|
- pImageProcParam.SetBGGray(BACK_GRAY);
|
|
|
- pImageProcParam.SetParticleGray(INCA_GRAY);
|
|
|
-
|
|
|
- // X-Ray parameter
|
|
|
- COTSXRayParam pXRayParam = new COTSXRayParam();
|
|
|
- pXRayParam.SetScanMode(DataPublic.SCAN_MODE);
|
|
|
- //pXRayParam.SetSearchSpeed(DataPublic.SEARCH_SPEED);
|
|
|
- //pXRayParam.SetXRaySearchCount(DataPublic.SEARCH_COUNT);
|
|
|
- pXRayParam.SetAnalySpeed(DataPublic.ANALYSIS_SPEED);
|
|
|
- pXRayParam.SetAnalyExpCount(DataPublic.ANALYSIS_EXPECT_COUNT);
|
|
|
- CSampleParam msrParam = new CSampleParam();
|
|
|
- msrParam.SetImageProcessParam(pImageProcParam);
|
|
|
- msrParam.SetImageScanParam(pImageScanParam);
|
|
|
- msrParam.SetXRayParam(pXRayParam);
|
|
|
- //pGenParam.SetMsrParam(msrParam);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // create the program (preference) file
|
|
|
- if (!Save(strProgMgrParamFileName))
|
|
|
- {
|
|
|
- // failed to create
|
|
|
- logger.Info("LoadInfoFromProgMgrFile: create program manager file failed."); //LogErrorTrace(__FILE__, __LINE__, _T("LoadInfoFromProgMgrFile: create program manager file failed."));
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- // ok, return the program (preference) file
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- // get software pack program data path
|
|
|
- public String GetOTSProgDataPathName()
|
|
|
- {
|
|
|
-
|
|
|
-
|
|
|
- // get common data pathname string
|
|
|
- String strCommonDataPathName = GetOSCommonDataPathName();
|
|
|
|
|
|
|
|
|
- String strOTSProDataPathName = strCommonDataPathName + STR_COFIGPATH + "\\" + STR_PROG_DATA + "\\";
|
|
|
-
|
|
|
- // return software package program data path
|
|
|
- return strOTSProDataPathName;
|
|
|
- }
|
|
|
-
|
|
|
public string GetSysType()
|
|
|
{
|
|
|
return m_nPackId.ToString();
|
|
@@ -242,7 +140,7 @@ namespace OTSModelSharp
|
|
|
}
|
|
|
|
|
|
// get software pack system data path
|
|
|
- public String GetOTSSysDataPathName()//deprecated,since we have build one new solution for the particle system.
|
|
|
+ private String GetOTSSysDataPathName()//deprecated,since we have build one new solution for the particle system.
|
|
|
{
|
|
|
|
|
|
// get common data pathname string
|
|
@@ -260,7 +158,7 @@ namespace OTSModelSharp
|
|
|
|
|
|
// get system common data folder pathname
|
|
|
// return "" if failed
|
|
|
- public String GetOSCommonDataPathName()
|
|
|
+ private String GetOSCommonDataPathName()
|
|
|
{
|
|
|
|
|
|
return ".\\";
|
|
@@ -284,26 +182,11 @@ namespace OTSModelSharp
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- // check if the file exists or not
|
|
|
- public bool Exists(string a_sPath)
|
|
|
- {
|
|
|
- //return ::PathFileExists(a_sPath) == TRUE;
|
|
|
- if (File.Exists(a_sPath))
|
|
|
- {
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
-
|
|
|
- //执行读写操作
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
|
|
|
// NOTE: be sure a_strPathName is a valid file pathname
|
|
|
- public bool Load(string a_strPathName)
|
|
|
+ private bool Load(string a_strPathName)
|
|
|
{
|
|
|
// file pathname
|
|
|
m_strPathName = a_strPathName;
|
|
@@ -331,7 +214,7 @@ namespace OTSModelSharp
|
|
|
return true;
|
|
|
}
|
|
|
// save program manager file
|
|
|
- public bool Save(string a_strPathName)
|
|
|
+ private bool Save(string a_strPathName)
|
|
|
{
|
|
|
//ASSERT(m_pStageData);
|
|
|
//Debug.Assert(m_pParam);
|