|
@@ -43,9 +43,7 @@ namespace OTSModelSharp
|
|
|
|
|
|
//stage data y end
|
|
|
const long STAGE_DATA_Y_AXIS_END = 100000;
|
|
|
-
|
|
|
- //stage data x direction
|
|
|
- // const OTS_X_AXIS_DIRECTION STAGE_DATA_X_AXIS_DIRECTION = OTS_X_AXIS_DIRECTION.LEFT_TOWARD;
|
|
|
+
|
|
|
|
|
|
const String STR_MEASURE_PREFERENCE_FILE_NAME = "OTSProgMgrParam.pmf";
|
|
|
|
|
@@ -63,7 +61,7 @@ namespace OTSModelSharp
|
|
|
// XRay scan mode
|
|
|
const OTS_X_RAY_SCAN_MODE SCAN_MODE = OTS_X_RAY_SCAN_MODE.PointMode;
|
|
|
|
|
|
- MemberBase m_Param;
|
|
|
+
|
|
|
|
|
|
const String STR_APPNAME_OTSINCA = "OTSIncA";
|
|
|
|
|
@@ -77,12 +75,6 @@ namespace OTSModelSharp
|
|
|
{
|
|
|
Init();
|
|
|
}
|
|
|
- // copy constructor
|
|
|
- public COTSDefaultParam(COTSDefaultParam a_poSource)
|
|
|
- {
|
|
|
-
|
|
|
- Duplicate(a_poSource);
|
|
|
- }
|
|
|
|
|
|
public COTSImgScanPrm GetImageScanParam() { return m_pImageScanParam; }
|
|
|
|
|
@@ -95,58 +87,32 @@ namespace OTSModelSharp
|
|
|
|
|
|
|
|
|
|
|
|
- // get path name // file pathname
|
|
|
- public string GetPathName()
|
|
|
- {
|
|
|
- return m_strPathName;
|
|
|
- }
|
|
|
|
|
|
public COTSGeneralParam GetGenParam() { return m_GenParam; }
|
|
|
- // set path name
|
|
|
- public void SetPathName(string a_strPathName)
|
|
|
- {
|
|
|
- m_strPathName = a_strPathName;
|
|
|
- }
|
|
|
|
|
|
- // get SEM stage data
|
|
|
- //CSEMStageDataPtr GetStageData() { return m_pStageData; }
|
|
|
- // Set SEM stage data
|
|
|
- //void SetStageData(CSEMStageDataPtr a_pStageData);
|
|
|
|
|
|
- // Read project manager information from project manager file
|
|
|
-
|
|
|
- public bool LoadInfoFromProgMgrFile(otsdataconst.OTS_SOFT_PACKAGE_ID a_nPackId)
|
|
|
+ public bool LoadInfoFromProgMgrFile()
|
|
|
{
|
|
|
|
|
|
// get software pack measure preference file pathname
|
|
|
- string strProgMgrParamFilePathName = GetOTSPackMeasurePrefFilePathName((otsdataconst.OTS_SOFT_PACKAGE_ID)a_nPackId);
|
|
|
- if (string.IsNullOrEmpty(strProgMgrParamFilePathName))
|
|
|
- {
|
|
|
- logger.Info("LoadInfoFromProgMgrFile: failed to find program manager param file pathname."); //LogErrorTrace(__FILE__, __LINE__, _T("LoadInfoFromProgMgrFile: failed to find program manager param file pathname."));
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
+ string strProgMgrParamFileName = GetOTSMeasurePrefFileName();
|
|
|
+
|
|
|
// program manager param file exists?
|
|
|
- if (Exists(strProgMgrParamFilePathName))
|
|
|
+ if (Exists(strProgMgrParamFileName))
|
|
|
{
|
|
|
// tried to load it
|
|
|
- if (!Load(strProgMgrParamFilePathName))
|
|
|
+ if (!Load(strProgMgrParamFileName))
|
|
|
{
|
|
|
// failed to load the license info file
|
|
|
- logger.Info("LoadLicenseInfoFile: failed to load license info file. pathname:"+strProgMgrParamFilePathName+"."); //LogErrorTrace(__FILE__, __LINE__, _T("LoadLicenseInfoFile: failed to load license info file. pathname: %s"), strProgMgrParamFilePathName);
|
|
|
+ logger.Info("LoadLicenseInfoFile: failed to load license info file. pathname:"+strProgMgrParamFileName+"."); //LogErrorTrace(__FILE__, __LINE__, _T("LoadLicenseInfoFile: failed to load license info file. pathname: %s"), strProgMgrParamFilePathName);
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
// get app system file path
|
|
|
- string strCompanySysDataPath = GetOTSPackSysDataPathName((otsdataconst.OTS_SOFT_PACKAGE_ID)a_nPackId);
|
|
|
- if (string.IsNullOrEmpty(strCompanySysDataPath))
|
|
|
- {
|
|
|
- // shouldn't happen, program manager param file pathname is empty, return nullptr
|
|
|
- logger.Info("LoadInfoFromProgMgrFile: failed to company system data pathname."); //LogErrorTrace(__FILE__, __LINE__, _T("LoadInfoFromProgMgrFile: failed to company system data pathname."));
|
|
|
- return false;
|
|
|
- }
|
|
|
+ string strCompanySysDataPath = GetOTSSysDataPathName();
|
|
|
+
|
|
|
|
|
|
// company system data path exists?
|
|
|
if (!Exists(strCompanySysDataPath))
|
|
@@ -171,7 +137,7 @@ namespace OTSModelSharp
|
|
|
pGenParam.SetMeasurementSwitch(MEASURE_SWITCH);
|
|
|
|
|
|
// get software pack program data path
|
|
|
- string strOTSProDataPathName = GetOTSPackProgDataPathName((otsdataconst.OTS_SOFT_PACKAGE_ID)a_nPackId);
|
|
|
+ string strOTSProDataPathName = GetOTSProgDataPathName();
|
|
|
if (string.IsNullOrEmpty(strOTSProDataPathName))
|
|
|
{
|
|
|
// shouldn't happen, software pack program data path is empty
|
|
@@ -223,7 +189,7 @@ namespace OTSModelSharp
|
|
|
|
|
|
|
|
|
// create the program (preference) file
|
|
|
- if (!Save(strProgMgrParamFilePathName))
|
|
|
+ if (!Save(strProgMgrParamFileName))
|
|
|
{
|
|
|
// failed to create
|
|
|
logger.Info("LoadInfoFromProgMgrFile: create program manager file failed."); //LogErrorTrace(__FILE__, __LINE__, _T("LoadInfoFromProgMgrFile: create program manager file failed."));
|
|
@@ -235,20 +201,13 @@ namespace OTSModelSharp
|
|
|
}
|
|
|
|
|
|
// get software pack program data path
|
|
|
- public String GetOTSPackProgDataPathName(OTS_SOFT_PACKAGE_ID a_nPackId)
|
|
|
+ public String GetOTSProgDataPathName()
|
|
|
{
|
|
|
|
|
|
|
|
|
// get common data pathname string
|
|
|
String strCommonDataPathName = GetOSCommonDataPathName();
|
|
|
- if (strCommonDataPathName=="")
|
|
|
- {
|
|
|
- // can't common data path
|
|
|
-
|
|
|
- return "";
|
|
|
- }
|
|
|
|
|
|
- // software package program data pathname
|
|
|
|
|
|
String strOTSProDataPathName = strCommonDataPathName + STR_COFIGPATH + "\\" + STR_PROG_DATA + "\\";
|
|
|
|
|
@@ -256,44 +215,15 @@ namespace OTSModelSharp
|
|
|
return strOTSProDataPathName;
|
|
|
}
|
|
|
|
|
|
- // creates a folder.
|
|
|
- public bool CreateFolder(string a_strFolder)
|
|
|
- {
|
|
|
-
|
|
|
-
|
|
|
- // create the folder
|
|
|
- // bool bRet = CreateDirectory(strFolder, null) == true;
|
|
|
- Directory.CreateDirectory(a_strFolder);
|
|
|
-
|
|
|
- // return folder create result
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- // check if the given string is valid file name or not
|
|
|
- // check if the given string is valid file name or not
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // get software pack preferece file path name
|
|
|
|
|
|
|
|
|
// get software pack preference file path name
|
|
|
- public String GetOTSPackMeasurePrefFilePathName(OTS_SOFT_PACKAGE_ID a_nPackId)
|
|
|
+ public String GetOTSMeasurePrefFileName()
|
|
|
{
|
|
|
// get software package system data pathname
|
|
|
- String strOTSPackSysDataPathName = GetOTSPackSysDataPathName(a_nPackId);
|
|
|
+ String strOTSPackSysDataPathName = GetOTSSysDataPathName();
|
|
|
|
|
|
- // check if software package system data pathname is right
|
|
|
- if (strOTSPackSysDataPathName=="")
|
|
|
- {
|
|
|
- // failed to get software package system data pathname
|
|
|
-
|
|
|
- return "";
|
|
|
- }
|
|
|
|
|
|
- // software package project manager file pathname
|
|
|
- // i.e. "c:\ProgramData\OPTON\OTSIncA\SysData\OTSProgMgrParam.pmf"
|
|
|
String strOTSPackProgMgrPathName = strOTSPackSysDataPathName + STR_MEASURE_PREFERENCE_FILE_NAME;
|
|
|
|
|
|
// return software package license file pathname
|
|
@@ -301,37 +231,15 @@ namespace OTSModelSharp
|
|
|
}
|
|
|
|
|
|
// get software pack system data path
|
|
|
- public String GetOTSPackSysDataPathName(OTS_SOFT_PACKAGE_ID a_nPackId)//deprecated,since we have build one new solution for the particle system.
|
|
|
+ public String GetOTSSysDataPathName()//deprecated,since we have build one new solution for the particle system.
|
|
|
{
|
|
|
- // get app package name
|
|
|
- String strAppPackageName="";
|
|
|
- switch (a_nPackId)
|
|
|
- {
|
|
|
- case OTS_SOFT_PACKAGE_ID.OTSIncA:
|
|
|
- strAppPackageName = STR_APPNAME_OTSINCA;
|
|
|
- break;
|
|
|
-
|
|
|
- case OTS_SOFT_PACKAGE_ID.OTSPartA:
|
|
|
- strAppPackageName = STR_APPNAME_OTSINCA;
|
|
|
- break;
|
|
|
-
|
|
|
- default:
|
|
|
-
|
|
|
- return "";
|
|
|
- }
|
|
|
|
|
|
// get common data pathname string
|
|
|
String strCommonDataPathName = GetOSCommonDataPathName();
|
|
|
- if (strCommonDataPathName=="")
|
|
|
- {
|
|
|
- // can't common data path
|
|
|
-
|
|
|
- return "";
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
// software package system data pathname
|
|
|
- // e.g. "c:\ProgramData\OPTON\OTSIncA\SysData\"
|
|
|
- //CString strOTSSysDataPathName = strCommonDataPathName + STR_COFIGPATH + _T("\\") + strAppPackageName + _T("\\") + STR_SYSTEM_DATA + _T("\\");
|
|
|
+
|
|
|
String strOTSSysDataPathName = strCommonDataPathName + STR_COFIGPATH + "\\" + STR_SYSTEM_DATA + "\\";
|
|
|
|
|
|
// return software package system data path
|
|
@@ -344,50 +252,18 @@ namespace OTSModelSharp
|
|
|
public String GetOSCommonDataPathName()
|
|
|
{
|
|
|
|
|
|
- String strPathName = ".\\";
|
|
|
-
|
|
|
-
|
|
|
- return strPathName;
|
|
|
+ return ".\\";
|
|
|
}
|
|
|
|
|
|
- // Save project manager information to project manager file
|
|
|
|
|
|
// safe parameters into program preference file
|
|
|
- public bool SaveInfoToProgMgrFile(otsdataconst.OTS_SOFT_PACKAGE_ID a_nPackId)
|
|
|
+ public bool SaveInfoToProgMgrFile()
|
|
|
{
|
|
|
|
|
|
- // get software package system data path
|
|
|
- string strSoftwareSysDataPath = GetOTSPackSysDataPathName((otsdataconst.OTS_SOFT_PACKAGE_ID)a_nPackId);
|
|
|
- if (string.IsNullOrEmpty(strSoftwareSysDataPath))
|
|
|
- {
|
|
|
- // shouldn't happen, software package system data path string is empty
|
|
|
- logger.Info("SaveInfoToProgMgrFile: failed to software package system data path string."); //LogErrorTrace(__FILE__, __LINE__, _T("SaveInfoToProgMgrFile: failed to software package system data path string."));
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- //// software package system data path exists?
|
|
|
- //if (!Exists(strSoftwareSysDataPath))
|
|
|
- //{
|
|
|
- // // software package system data path doesn't exists, create it
|
|
|
- // if (!CreateFolder(strSoftwareSysDataPath))
|
|
|
- // {
|
|
|
- // // failed to create software package system data path, return FALSE
|
|
|
- // logger.Info("SaveInfoToProgMgrFile: failed to create software package system data path."); //LogErrorTrace(__FILE__, __LINE__, _T("SaveInfoToProgMgrFile: failed to create software package system data path."));
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- //}
|
|
|
-
|
|
|
// get software pack measure preference file pathname
|
|
|
- string strProgMgrParamFilePathName = GetOTSPackMeasurePrefFilePathName((otsdataconst.OTS_SOFT_PACKAGE_ID)a_nPackId);
|
|
|
- if (string.IsNullOrEmpty(strProgMgrParamFilePathName))
|
|
|
- {
|
|
|
- // shouldn't happen, software pack measure preference file pathname is empty, return nullptr
|
|
|
- logger.Info("SaveInfoToProgMgrFile: failed to find program manager param file pathname."); //LogErrorTrace(__FILE__, __LINE__, _T("SaveInfoToProgMgrFile: failed to find program manager param file pathname."));
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- // save parameters into program preference file
|
|
|
- if (!Save(strProgMgrParamFilePathName))
|
|
|
+ string strProgMgrParamFileFullName = GetOTSMeasurePrefFileName();
|
|
|
+ // save parameters into program preference file
|
|
|
+ if (!Save(strProgMgrParamFileFullName))
|
|
|
{
|
|
|
// failed to save program preference file, return FALSE
|
|
|
logger.Info("SaveInfoToProgMgrFile: failed to save program preference file."); //LogErrorTrace(__FILE__, __LINE__, _T("SaveInfoToProgMgrFile: failed to save program preference file."));
|
|
@@ -397,23 +273,18 @@ namespace OTSModelSharp
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- // creates a folder.
|
|
|
-
|
|
|
-
|
|
|
// check if the file exists or not
|
|
|
public bool Exists(string a_sPath)
|
|
|
{
|
|
|
//return ::PathFileExists(a_sPath) == TRUE;
|
|
|
if (File.Exists(a_sPath))
|
|
|
{
|
|
|
- //MessageBox.Show(filePath + " not exists!");
|
|
|
- //FileStream fs = File.Create(a_sPath);//创建文件
|
|
|
- //fs.Close();
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
- //System.Windows.Forms.MessageBox.Show(a_sPath + " exists!");
|
|
|
+ {
|
|
|
+
|
|
|
//执行读写操作
|
|
|
return false;
|
|
|
}
|
|
@@ -502,21 +373,8 @@ namespace OTSModelSharp
|
|
|
slo.Serialize(false, classDoc, rootNode);
|
|
|
}
|
|
|
}
|
|
|
- public COTSGeneralParam GetDefaultParam()
|
|
|
- {
|
|
|
- return m_GenParam;
|
|
|
- }
|
|
|
- public void SetDefaultParam(COTSGeneralParam val)
|
|
|
- {
|
|
|
- m_GenParam = val;
|
|
|
- }
|
|
|
|
|
|
- // cleanup
|
|
|
- //protected void Cleanup()
|
|
|
- //{
|
|
|
- //}
|
|
|
|
|
|
- // initialization
|
|
|
protected void Init()
|
|
|
{
|
|
|
m_strPathName = "";
|