Просмотр исходного кода

optimize the DefaultParam and StageParam loading method code.

gsp 4 лет назад
Родитель
Сommit
782ac7795b

+ 0 - 4
OTSIncAMeasureApp/0-OTSModel/Measure/1-OTSInclution/SmplMeasureInclution.cs

@@ -350,11 +350,7 @@ namespace OTSModelSharp
                 return false;
             }
 
-            //loger.Warn("db saving finished!");
 
-           
-
-            //pDBFileMgr.CommitTransaction();
 
             return true;
         }

+ 1 - 1
OTSIncAMeasureApp/0-OTSModel/Measure/2-OTSCleanliness/SmplMeasureCleanliness.cs

@@ -64,7 +64,7 @@ namespace OTSModelSharp
   
 
             // save field files
-           m_pSample.GetMsrStatus() .SetStatus(OTS_MSR_SAMPLE_STATUS.SUCCESSED);
+            m_pSample.GetMsrStatus() .SetStatus(OTS_MSR_SAMPLE_STATUS.SUCCESSED);
 
             StartSaveFileThread(curFldDataMgr);
 

+ 0 - 2
OTSIncAMeasureApp/0-OTSModel/Measure/GetBSEPic/CMsrThread.cs

@@ -11,8 +11,6 @@ namespace OTSModelSharp
 {
 
 
-    //using COTSSampleList = List<COTSSample>;
-
     // enum and struct used for send message to App
     public enum ENUM_MSG_TYPE
     {

+ 26 - 168
OTSIncAMeasureApp/0-OTSModel/Measure/GetParamData/OTSDefaultParam.cs

@@ -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 = "";

+ 26 - 100
OTSIncAMeasureApp/0-OTSModel/Measure/GetParamData/StageParam.cs

@@ -14,8 +14,7 @@ namespace OTSModelSharp
     {
         protected static NLog.Logger logger = null;
 
-        // flag is there is sample on the stage
-        bool m_bInUse;
+    
 
         // modify flag
         bool m_bModify;
@@ -35,7 +34,7 @@ namespace OTSModelSharp
         const int DOMAIN_ITEM_NUMBER = 5;
 
          const int TEXTFILE_ITEM_COLUMN_NUMBER = 2;
-                //原来在 Hole.h 界面定义
+                
         public const int HOLE_ITEM_NUMBER = 6;
         public enum COORDINATE_SYSTEM_SETTING
         {
@@ -68,7 +67,7 @@ namespace OTSModelSharp
         // initialization
         public void Init()
         {
-            m_bInUse = false;
+            
             m_bModify = false;
             m_strPathName = "";
             m_nWorkingStageId = -1;
@@ -78,45 +77,11 @@ namespace OTSModelSharp
 
 
 
-        public CStageParam(CStageParam a_poSource)
-        {
-
-            // can't copy itself
-            if (a_poSource == this)
-            {
-                return;
-            }
-            Duplicate(a_poSource);
-        }
-
-        public bool Equals(CStageParam a_oSource)          // CBSEImg& operator=(const CBSEImg&);        // =operator
-        {
-            if (m_bModify != a_oSource.m_bModify)
-            {
-                return false;
-            }
-            if (m_nWorkingStageId != a_oSource.m_nWorkingStageId)
-            {
-                return false;
-            }
-            if (m_strPathName != a_oSource.m_strPathName)
-            {
-                return false;
-            }
-            for (int i = 0; i < m_listStages.Count; i++)
-            {
-                if (m_listStages[i] != a_oSource.m_listStages[i])
-                {
-                    return false;
-                }
-            }
-            return true;
-        }
 
         // load/save a stage from a text file
-        public bool LoadStageFromTextFile(String a_strFilePathName, CSEMStageData a_stageData /* = _T("")*/)
+        public bool LoadStageFromTextFile(String a_strFilePathName, CSEMStageData a_stageData )
         {
-            // AFX_MANAGE_STATE(AfxGetStaticModuleState());
+          
 
             // check file pathname
             a_strFilePathName.Trim();
@@ -325,9 +290,7 @@ namespace OTSModelSharp
 
             }
 
-            //xbModify = a_oSource.m_bModify;
-            //xstrPathName = a_oSource.m_strPathName;
-            //xnWorkingStageId = a_oSource.m_nWorkingStageId;
+
         }
 
        
@@ -405,7 +368,7 @@ namespace OTSModelSharp
             return pDomain;
         }
         // get Hole
-        public CHole GetHole(string strName,String a_strValue)  //改完hole类再改此处
+        public CHole GetHole(string strName,String a_strValue)  
         {
             // hole
             CHole pHole = null;
@@ -418,10 +381,10 @@ namespace OTSModelSharp
             }
 
             // split the value string
-            String[] listStr1 = a_strValue.Split(',');//OTSModelConst类修改完再修改此处
+            String[] listStr1 = a_strValue.Split(',');
             List<String> listStr = new List<string>(listStr1);
             // check vector size
-            if (listStr.Count != HOLE_ITEM_NUMBER)//Hole修改完再修改此处
+            if (listStr.Count != HOLE_ITEM_NUMBER)
             {
                 return pHole;
             }
@@ -605,7 +568,7 @@ namespace OTSModelSharp
             return strDomainTextBody;
         }
 
-        public bool Load(OTS_SOFT_PACKAGE_ID a_nPackId, bool a_bClear /* = TRUE*/, bool a_bGetFromText /*= TRUE*/)
+        public bool Load( bool a_bClear /* = TRUE*/, bool a_bGetFromText /*= TRUE*/)
         {
 
             // 1. clear the stage list if necessary
@@ -614,14 +577,8 @@ namespace OTSModelSharp
                 m_listStages.Clear();
             }
             // 2. get software package system data folder name
-            String strStageFilePath = GetOTSPackSysDataPathName(a_nPackId);
-            // 3. software package system data folder name can't be empty
-            strStageFilePath.Trim();
-            if (strStageFilePath == "")
-            {// invalid stage file
-
-                return false;
-            }
+            String strStageFilePath = GetOTSSysDataPathName();
+  
             // 4. stage file pathname
             String strStageFilePathName = strStageFilePath + DataPublic.STAGE_FILE_NAME;
             // 5. check if the stage file exist 
@@ -647,44 +604,28 @@ namespace OTSModelSharp
             return false;
         }
 
-        // check if the file exists or not
-
-
         // 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 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 + DataPublic.STR_COFIGPATH + "\\" + DataPublic.STR_SYSTEM_DATA + "\\";
 
             // return software package system data path
             return strOTSSysDataPathName;
         }
 
-        // get system common data folder pathname
-        // return "" if failed
+   
         public String GetOSCommonDataPathName()
         {
-
-            String strPathName = ".\\";
-
-
-            return strPathName;
+            return ".\\";
         }
 
-        public bool Save(OTSDataType.otsdataconst.OTS_SOFT_PACKAGE_ID a_nPackId)
+        public bool Save()
         {
             // can do nothing if stages list is empty
             if (m_listStages == null)
@@ -694,16 +635,10 @@ namespace OTSModelSharp
             }
 
             // get software package system data folder name
-            String strStageFilePath = GetOTSPackSysDataPathName(a_nPackId);
-
-            // software package system data folder name can't be empty
-            strStageFilePath.Trim();
-            if (strStageFilePath == "")
-            {
-                // invalid software package system data folder name
+            String strStageFilePath = GetOTSSysDataPathName();
 
-                return false;
-            }
+           
+   
             // stage file pathname
             String strStageFilePathName = strStageFilePath + DataPublic.STAGE_FILE_NAME;
             // check if software package system data folder exists
@@ -732,8 +667,6 @@ namespace OTSModelSharp
                 return false;
             }
 
-            /*	Serialize(ar);
-                ar.Close();*/
             // set file modify flag
             m_bModify = false;
 
@@ -759,8 +692,7 @@ namespace OTSModelSharp
             slo.Register("Modify", xbModify);
             slo.Register("PathName", xstrPathName);
             slo.Register("WorkingStageId", xnWorkingStageId);
-            slo.Register("Stagelist", xStagelist);
-            //slo.Register("StageData", xStageData);
+            slo.Register("Stagelist", xStagelist);       
             if (isStoring)
             {
                 xbModify.AssignValue(m_bModify);
@@ -780,7 +712,7 @@ namespace OTSModelSharp
                 m_bModify = xbModify.value();
                 m_strPathName = xstrPathName.value().ToString();
                 m_nWorkingStageId = xnWorkingStageId.value();
-                //m_pStageData = xStageData;
+              
                 m_listStages.Clear();
                 for (int i = 0; i < xStagelist.size(); i++)
                 {
@@ -906,16 +838,10 @@ namespace OTSModelSharp
 
       
 
-        // flag there is sample on the stage
-        public void SetInUse(bool a_bVal = true)
-        {
-            m_bInUse = a_bVal;
-        }
-
-        public bool GetInUse()
-        {
-            return m_bInUse;
-        }
+        //public bool GetInUse()
+        //{
+        //    return m_bInUse;
+        //}
     }
 }
 

+ 28 - 30
OTSIncAMeasureApp/0-OTSModel/Measure/GetStageInfo/DlgStageMgr.cs

@@ -62,7 +62,7 @@ namespace OTSModelSharp.Measure.GetStageInfo
         private void DlgStageMgr_Load(object sender, EventArgs e)
         {
             // 加载样品台文件;  \Config\SysData\OTSStage.stg
-            if (!m_pStageFile.Load((int)otsdataconst.OTS_SOFT_PACKAGE_ID.OTSIncA, true, false))
+            if (!m_pStageFile.Load( true, false))
             {
                 return;
             }
@@ -105,7 +105,7 @@ namespace OTSModelSharp.Measure.GetStageInfo
                     CSEMStageData a_pCSEMStageData = new CSEMStageData();
                     //获取配置文件中 StageData 内容
                     COTSDefaultParam m_DefaultParam = new COTSDefaultParam();
-                    m_DefaultParam.LoadInfoFromProgMgrFile((int)otsdataconst.OTS_SOFT_PACKAGE_ID.OTSIncA);
+                    m_DefaultParam.LoadInfoFromProgMgrFile();
                     a_pCSEMStageData = m_DefaultParam.GetStageDataParam();
                     // load a stage from txt file
                     if (!m_pStageFile.LoadStageFromTextFile(strPathName, a_pCSEMStageData))
@@ -144,7 +144,7 @@ namespace OTSModelSharp.Measure.GetStageInfo
             //create stage manager file
             if (m_pStageFile.IsModified())
             {
-                if (!m_pStageFile.Save(m_nPackId))
+                if (!m_pStageFile.Save())
                 {
                     loger.Error("OnClickedBtnAply: save a stage file failed.");
                     return;
@@ -171,11 +171,10 @@ namespace OTSModelSharp.Measure.GetStageInfo
             {
                 m_pStageFile.GetStagesList().RemoveAt(m_nListBoxStageListIndex);
                 // set new working stage
-                if (!m_pStageFile.GetInUse())
-                {
+               
                     m_nListBoxStageListIndex = 0;
                     m_pStageFile.SetWorkingStageId(m_nListBoxStageListIndex);
-                }
+               
                 m_pStageFile.SetModify();
                 //m_nListBoxStageList--;
                 Invalidate();
@@ -268,30 +267,30 @@ namespace OTSModelSharp.Measure.GetStageInfo
             if (m_pStageFile.GetStagesList().Count > 0)
             {
                 // there is sample on the work stage
-                if (m_pStageFile.GetInUse() == true)
-                {
-                    // can't change working stage
-                    m_ctrlBtnApply.Enabled = false;
-
-                    // if working stage id == selected id
-                    if (m_nListBoxStageListIndex == m_pStageFile.GetWorkingStageId())
-                    {
-                        // can't delete and rename the woking stage
-                        m_ctrlBtnDelete.Enabled = false;
-                        m_ctrlBtnRename.Enabled = false;
-                    }
-                    else
-                    {
-                        m_ctrlBtnDelete.Enabled = true;
-                        m_ctrlBtnRename.Enabled = true;
-                    }
-                }
-                else
-                {
+                //if (m_pStageFile.GetInUse() == true)
+                //{
+                //    // can't change working stage
+                //    m_ctrlBtnApply.Enabled = false;
+
+                //    // if working stage id == selected id
+                //    if (m_nListBoxStageListIndex == m_pStageFile.GetWorkingStageId())
+                //    {
+                //        // can't delete and rename the woking stage
+                //        m_ctrlBtnDelete.Enabled = false;
+                //        m_ctrlBtnRename.Enabled = false;
+                //    }
+                //    else
+                //    {
+                //        m_ctrlBtnDelete.Enabled = true;
+                //        m_ctrlBtnRename.Enabled = true;
+                //    }
+                //}
+                //else
+                //{
                     m_ctrlBtnApply.Enabled = true;
                     m_ctrlBtnDelete.Enabled = true;
                     m_ctrlBtnRename.Enabled = true;
-                }
+                //}
 
                 foreach (var pStage in m_pStageFile.GetStagesList())
                 {
@@ -325,11 +324,10 @@ namespace OTSModelSharp.Measure.GetStageInfo
                 UpdateData(true);
             }
 
-            if (!m_pStageFile.GetInUse())
-            {
+           
                 // if there is sample on the stage, the working stage can't be changed.
                 m_pStageFile.SetWorkingStageId(m_nListBoxStageListIndex);
-            }
+           
 
 
         }

+ 18 - 6
OTSIncAMeasureApp/2-OTSMeasureParamManage/MeasureParam.cd

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <ClassDiagram MajorVersion="1" MinorVersion="1">
   <Comment CommentText="从文件获得默认参数">
-    <Position X="5.208" Y="1.885" Height="0.469" Width="1.304" />
+    <Position X="2.208" Y="1.718" Height="0.469" Width="1.304" />
   </Comment>
   <Comment CommentText="从用户操作获得样品区域信息,并创建测量结果数据集合">
     <Position X="9.323" Y="1.469" Height="0.75" Width="1.7" />
@@ -16,9 +16,9 @@
       <FileName>2-OTSMeasureParamManage\OTSMeasureParam.cs</FileName>
     </TypeIdentifier>
     <ShowAsAssociation>
+      <Field Name="m_ResultData" />
       <Field Name="m_DefaultParam" />
       <Field Name="m_StageParam" />
-      <Field Name="m_ResultData" />
     </ShowAsAssociation>
     <ShowAsCollectionAssociation>
       <Field Name="m_MeasureSampleList" />
@@ -26,19 +26,31 @@
   </Class>
   <Class Name="OTSModelSharp.COTSDefaultParam" Collapsed="true">
     <Position X="2" Y="2.25" Width="2.5" />
-    <TypeIdentifier />
+    <TypeIdentifier>
+      <HashCode>ABCAgKIgAoMAgACGgFsgBIAAgCHBIAAAQCgiBANABAA=</HashCode>
+      <FileName>0-OTSModel\Measure\GetParamData\OTSDefaultParam.cs</FileName>
+    </TypeIdentifier>
   </Class>
   <Class Name="OTSModelSharp.CStageParam" Collapsed="true">
     <Position X="1.75" Y="3.5" Width="1.5" />
-    <TypeIdentifier />
+    <TypeIdentifier>
+      <HashCode>CIAIgIACARAgAACDgAIABAABhCCAICgAQgAmBSIAQAo=</HashCode>
+      <FileName>0-OTSModel\Measure\GetParamData\StageParam.cs</FileName>
+    </TypeIdentifier>
   </Class>
   <Class Name="OTSDataType.COTSSample" Collapsed="true">
     <Position X="12" Y="2.25" Width="1.5" />
-    <TypeIdentifier />
+    <TypeIdentifier>
+      <HashCode>UCEIwsIiY0kC4AAQiUmCAikAECCEIxCBiIAPYEIgXJk=</HashCode>
+      <FileName>0-OTSModel\OTSDataType\COTSSample.cs</FileName>
+    </TypeIdentifier>
   </Class>
   <Class Name="OTSModelSharp.COTSMsrPrjResultData" Collapsed="true">
     <Position X="11.25" Y="3.75" Width="2.25" />
-    <TypeIdentifier />
+    <TypeIdentifier>
+      <HashCode>IIQggICCQZAEZADnBDIAKkZAwCSAqCAEIjAqT0IQAIg=</HashCode>
+      <FileName>0-OTSModel\Measure\GetParamData\COTSMsrPrjResultData.cs</FileName>
+    </TypeIdentifier>
   </Class>
   <Font Name="Microsoft YaHei UI" Size="9" />
 </ClassDiagram>

+ 2 - 2
OTSIncAMeasureApp/2-OTSMeasureParamManage/OTSMeasureParam.cs

@@ -100,7 +100,7 @@ namespace OTSMeasureApp
         {
             //加载样品参数文件:   \Config\SysData\OTSProgMgrParam.pmf
             m_DefaultParam = new COTSDefaultParam();
-            m_DefaultParam.LoadInfoFromProgMgrFile((int)OTS_SOFT_PACKAGE_ID.OTSIncA);
+            m_DefaultParam.LoadInfoFromProgMgrFile();
             if (null == m_DefaultParam)
             {
                 return false;
@@ -115,7 +115,7 @@ namespace OTSMeasureApp
         {
             m_StageParam = new CStageParam();
             // 加载样品台文件;  \Config\SysData\OTSStage.stg
-            if (!m_StageParam.Load((int)OTS_SOFT_PACKAGE_ID.OTSIncA, true, false))
+            if (!m_StageParam.Load(true, false))
             {
                 return false;
             }

+ 23 - 103
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.cs

@@ -150,9 +150,9 @@ namespace OTSMeasureApp
     public partial class ProgMgrInfoForm : Form
     {
         #region 定义变量
-        public bool m_bInUse = false;
+
         //初始化函数功能类
-        //private OTSProgMgrInfoFun m_otsMif;
+  
         public CStage m_cstage;                                      //样品台类
         public CStageParam m_cstagefile;                              //样品台文件类
         public COTSDefaultParam m_cotsprogmgrparamfile;          //参数类
@@ -161,7 +161,7 @@ namespace OTSMeasureApp
         public COTSGeneralParam m_cgenparam;                                //一般参数类
         public COTSImageProcParam m_cotsimgprocprm;                      //图像处理类
         public COTSXRayParam m_cotsxrayprm;
-        //默认样品台文件存在吧,这个不重要,主要是从外面调用传入的来进行判断
+     
         public bool m_b_checkstagefile = false;
         //定位程序管理路径用的变量
         public string m_ParameterPath;
@@ -178,7 +178,7 @@ namespace OTSMeasureApp
         public bool StageLoad()
         {
 
-            if (!m_cstagefile.Load((int)OTS_SOFT_PACKAGE_ID.OTSIncA, true, !m_b_checkstagefile))
+            if (!m_cstagefile.Load( true, !m_b_checkstagefile))
             {
                 log.Error("(OTSProgMgrInfoFun.StageLoad)  加载样品台信息失败");
                 return false;
@@ -194,41 +194,15 @@ namespace OTSMeasureApp
         {
             m_cotsprogmgrparamfile = new COTSDefaultParam();
             m_cstagefile = new CStageParam();
-           // m_otsMif = new OTSProgMgrInfoFun(this);
+      
             InitializeComponent();
             //国际化
             lan = new OTSSysMgrTools.Language(this);
             table = lan.GetNameTable(this.Name);
         }
 
-        /// <summary>
-        /// 构造函数,传入当前工作样品台是否正在使用
-        /// </summary>
-        /// <param name="in_bInUse"></param>
-        public ProgMgrInfoForm(bool in_bInUse)
-        {
-            m_cotsprogmgrparamfile = new COTSDefaultParam();
-            m_cstagefile = new CStageParam();
-         
-            m_bInUse = in_bInUse;
-            InitializeComponent();
-            //国际化
-            lan = new OTSSysMgrTools.Language(this);
-            table = lan.GetNameTable(this.Name);
-        }
 
-        public void SetUseing(bool in_bInUse)
-        {
-            m_bInUse = in_bInUse;
-        }
-        public bool GetUseing()
-        {
-            return m_bInUse;
-        }
-        public void CheckStageFileExist(bool in_b_checkstagefile)
-        {
-            m_b_checkstagefile = in_b_checkstagefile;
-        }
+ 
         #endregion
 
         #region 绑定各combobox控件
@@ -409,10 +383,9 @@ namespace OTSMeasureApp
                 cbi.Text = GetXRayScanModeIdString(enum_one);
                 cbi.Value = (int)enum_one;
                 //只添加点扫描
-                //if (IDC_COMBO_XRAYSCANMODE.Items.Count == 0)
-                //{
+
                 IDC_COMBO_XRAYSCANMODE.Items.Add(cbi);
-                //}
+               
             }
             this.IDC_COMBO_XRAYSCANMODE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_XRAYSCANMODE_SelectedIndexChanged);
             if (IDC_COMBO_XRAYSCANMODE.Items.Count > 0)
@@ -518,7 +491,6 @@ namespace OTSMeasureApp
         /// <returns></returns>
         public List<CStage> GetStageList()
         {
-            //m_LogFunExport.TraceLog("(OTSProgMgrInfoFun.GetStageList)  获取样品台信息列表");
             List<CStage> l_cstageclr = m_cstagefile.GetStagesList();
             if (null == l_cstageclr)
             {
@@ -544,7 +516,7 @@ namespace OTSMeasureApp
             IDC_COMBO_STAGE.Items.Add(ls_cbi);
 
             //添加其它的样品台信息
-            //这个相当于就是id了,与郝工的dll中,的getworkingstageid是相同的
+        
             List<CStage> l_cstageclr = GetStageList();
             for (int i = 0; i < l_cstageclr.Count(); i++)
             {
@@ -566,17 +538,6 @@ namespace OTSMeasureApp
             }
             this.IDC_COMBO_STAGE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_STAGE_SelectedIndexChanged);
 
-            //判断 当前工作样品台是否正在使用,在使用的话,那么就不让选择工作样品台列表
-            if (m_bInUse == true)
-            {
-                IDC_COMBO_STAGE.Enabled = false;
-                //应该是让保存
-            }
-            else
-            {
-                IDC_COMBO_STAGE.Enabled = true;
-                //工作样品台不在使用,那么就不让保存,除非选择样品台下拉框重新选择后让保存?
-            }
         }
 
         #endregion
@@ -753,7 +714,7 @@ namespace OTSMeasureApp
         /// </summary>
         public void LoadImageProc()
         {
-            //m_LogFunExport.TraceLog("(OTSProgMgrInfoFun.LoadImageProc)  加载图像处理参数");
+       
 
             //颗粒面积范围 最小
             IDC_EDIT_PARTAREAMIN.Text = m_cotsimgprocprm.GetIncAreaRange().GetStart().ToString();
@@ -863,11 +824,6 @@ namespace OTSMeasureApp
             IDC_XRAY_COUNT_SWITCH.Checked = m_cotsxrayprm.GetShowExpCount();
         }
 
-        /// <summary>
-        /// 保存样品台信息
-        /// </summary>
-
-
         /// <summary>
         /// 保存SEM样品台参数
         /// </summary>
@@ -1067,7 +1023,7 @@ namespace OTSMeasureApp
         public bool SaveInfoToProgMgrFile()
         {
             //SaveInfoToProgMgrFile()
-            if (false == m_cotsprogmgrparamfile.SaveInfoToProgMgrFile((int)OTS_SOFT_PACKAGE_ID.OTSIncA))
+            if (false == m_cotsprogmgrparamfile.SaveInfoToProgMgrFile())
             {
                 log.Error("(OTSProgMgrInfoFun.SaveInfoToProgMgrFile)  将参数保存到文件失败");
                 return false;
@@ -1081,7 +1037,7 @@ namespace OTSMeasureApp
         public bool LoadParamFun()
         {
 
-            bool result = m_cotsprogmgrparamfile.LoadInfoFromProgMgrFile((int)OTS_SOFT_PACKAGE_ID.OTSIncA);
+            bool result = m_cotsprogmgrparamfile.LoadInfoFromProgMgrFile();
             if (!result)
             {
                 log.Error("(OTSProgMgrInfoFun.LoadParamFun)  LoadInfoFromProgMgrFile失败");
@@ -1223,17 +1179,12 @@ namespace OTSMeasureApp
         /// <param name="a_nPackId"></param>
         /// <param name="a_pStageFile"></param>
         /// <returns></returns>
-        public void ShowStageDialogExport(bool isuse)
+        public void ShowStageDialogExport()
         {
-            //弹出样品台选择窗体
-            m_cstagefile.SetInUse(isuse);
+     
             DlgStageMgr dlgStageMgr = new DlgStageMgr(m_cstagefile); 
             dlgStageMgr.ShowDialog();
-            //m_cstagefile = m_cstagefile.ShowStageDialogExport((int)OTS_SOFT_PACKAGE_ID.OTSIncA, m_cstagefile);
-            //if (null == m_cstagefile)
-            //{
-            //    log.Error("(OTSProgMgrInfoFun.ShowStageDialogExport) 弹出样品台选择窗体出错!");
-            //}
+
             return;
         }
 
@@ -1250,7 +1201,7 @@ namespace OTSMeasureApp
             }
             else
             {
-                bool b_ret = m_cstagefile.Save((int)OTS_SOFT_PACKAGE_ID.OTSIncA);
+                bool b_ret = m_cstagefile.Save();
                 if (false == b_ret)
                 {
                     log.Error("(OTSProgMgrInfoFun.CStageFileClrSave) 保存样品台信息出错!");
@@ -1260,8 +1211,9 @@ namespace OTSMeasureApp
         }
         private void IDC_BUTTON_STAGE_Click(object sender, EventArgs e)
         {
+            
             //弹出管理样品台管理窗体
-            ShowStageDialogExport(m_bInUse);
+            ShowStageDialogExport();
 
             //弹出后再保存样品台信息
             CStageFileClrSave();
@@ -1277,7 +1229,7 @@ namespace OTSMeasureApp
         /// 判断各控件值是否正确
         /// </summary>
         /// <returns></returns>
-        private bool PD(int bz)
+        private bool CheckSetupValues(int bz)
         {
             if ("" == IDC_COMBO_STAGE.Text)
             {
@@ -1758,22 +1710,7 @@ namespace OTSMeasureApp
                 MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 return false;
             }
-            //if (Convert.ToInt32(IDC_EDIT_XSTART.Text.Trim()) < 0)
-            //{
-            //    IDC_EDIT_XSTART.Focus();
-            //    IDC_EDIT_XSTART.SelectAll();
-            //    string message = table["message48"].ToString();
-            //    MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
-            //    return false;
-            //}
-            //if (Convert.ToInt32(IDC_EDIT_XEND.Text.Trim()) < 0)
-            //{
-            //    IDC_EDIT_XEND.Focus();
-            //    IDC_EDIT_XEND.SelectAll();
-            //    string message = table["message49"].ToString();
-            //    MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
-            //    return false;
-            //}
+
             if (Convert.ToInt32(IDC_EDIT_XSTART.Text.Trim()) > Convert.ToInt32(IDC_EDIT_XEND.Text.Trim()))
             {
                 IDC_EDIT_XEND.Focus();
@@ -1782,22 +1719,7 @@ namespace OTSMeasureApp
                 MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 return false;
             }
-            //if (Convert.ToInt32(IDC_EDIT_YSTART.Text.Trim()) < 0)
-            //{
-            //    IDC_EDIT_YSTART.Focus();
-            //    IDC_EDIT_YSTART.SelectAll();
-            //    string message = table["message51"].ToString();
-            //    MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
-            //    return false;
-            //}
-            //if (Convert.ToInt32(IDC_EDIT_YEND.Text.Trim()) < 0)
-            //{
-            //    IDC_EDIT_YEND.Focus();
-            //    IDC_EDIT_YEND.SelectAll();
-            //    string message = table["message52"].ToString();
-            //    MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
-            //    return false;
-            //}
+
             if (Convert.ToInt32(IDC_EDIT_YSTART.Text.Trim()) > Convert.ToInt32(IDC_EDIT_YEND.Text.Trim()))
             {
                 IDC_EDIT_YEND.Focus();
@@ -1842,7 +1764,6 @@ namespace OTSMeasureApp
         /// <returns></returns>
         public bool IsModified()
         {
-            //m_LogFunExport.TraceLog("(OTSProgMgrInfoFun.IsModified)  判断当前样品台是否在被修改");
 
             return m_cstagefile.IsModified();
         }
@@ -1853,8 +1774,7 @@ namespace OTSMeasureApp
         /// <returns></returns>
         public bool StageSave()
         {
-            //m_LogFunExport.TraceLog("(OTSProgMgrInfoFun.StageSave)  保存样品台信息");
-            if (!m_cstagefile.Save((int)OTS_SOFT_PACKAGE_ID.OTSIncA))
+            if (!m_cstagefile.Save())
             {
                 log.Error("(OTSProgMgrInfoFun.StageLoad)  保存样品台信息失败");
                 return false;
@@ -1864,7 +1784,7 @@ namespace OTSMeasureApp
         private void btnok_Click(object sender, EventArgs e)
         {
             //先判断
-            if (false == PD(1))
+            if (false == CheckSetupValues(1))
             {
                 return;
             }

+ 5 - 4
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -760,15 +760,16 @@ namespace OTSMeasureApp
 
         private void rbSelectDlg_Click(object sender, EventArgs e)
         {
-            bool bUseFlag = false;
-            //判断样品台是否有样品
+           
+            //判断样品台是否有样品,如果有样品则不能设置默认参数
             if (m_ProjParam.GetSampleCount() > 0)
             {
-                bUseFlag = true;
+                MessageBox.Show("Cann't setup preference parameter,for you have added some samples!");
+                return;
             }
             ProgMgrInfoForm ProgMgrForm = new ProgMgrInfoForm();
-            ProgMgrForm.SetUseing(bUseFlag);
           
+
             if (DialogResult.OK == ProgMgrForm.ShowDialog())
             {
                 //m_DataMgrFun.SetSysPartSTDData(ProgMgrForm.GetCPartSTDDataClr());

+ 1 - 3
OTSIncAReportTemplate/OTSIncAReportTemplate.Designer.cs

@@ -29,9 +29,7 @@
         private void InitializeComponent()
         {
             this.SuspendLayout();
-            // 
-            // OTSIncAReportTemplate
-            // 
+    
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(21, 10);

+ 2 - 3
OTSIncAReportTemplate/OTSIncAReportTemplate.csproj

@@ -88,9 +88,8 @@
       <HintPath>..\Bin\x64\Release_oxford50\RM.Interop.ReportMachine.dll</HintPath>
       <EmbedInteropTypes>True</EmbedInteropTypes>
     </Reference>
-    <Reference Include="RM.ReportEngine, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\Bin\Win32\Debug\RM.ReportEngine.dll</HintPath>
+    <Reference Include="RM.ReportEngine">
+      <HintPath>..\Bin\x64\Release_oxford50\RM.ReportEngine.dll</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.ComponentModel.DataAnnotations" />