Explorar o código

add scanfieldHeight100 parameter to the measure result file.

gsp %!s(int64=3) %!d(string=hai) anos
pai
achega
fa82baa9bb

+ 7 - 124
OTSIncAMeasureApp/0-OTSModel/Measure/ParamData/OTSDefaultParam.cs

@@ -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);

+ 1 - 1
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSSample.cs

@@ -264,7 +264,7 @@ namespace OTSDataType
                           CalculateScanFieldSize(a_dValue,ref nScanFieldSize,ref nScanFieldHeight);
 
                         m_poSEMDataMsr.SetScanFieldWidth(nScanFieldSize);
-                        m_poSEMDataMsr.SetScanFieldWidth(nScanFieldHeight);
+                        m_poSEMDataMsr.SetScanFieldHeight(nScanFieldHeight);
                     }
                     break;
 

+ 4 - 0
OTSIncAMeasureApp/0-OTSModel/OTSDataType/CSEMDataMsr.cs

@@ -15,6 +15,7 @@ namespace OTSDataType
         private int m_nScanFieldSize100;
         private double m_dWorkingDistance;
         private int m_nTotalFields;
+        private int m_nScanFieldHeight100;
 
         public CSEMDataMsr()
 	{
@@ -63,6 +64,8 @@ namespace OTSDataType
         public int GetScanFieldSize100() { return m_nScanFieldSize100; }
         public void SetScanFieldSize100(int a_nScanFieldSize100) { m_nScanFieldSize100 = a_nScanFieldSize100; }
 
+        public void SetScanFieldHeight100(int a_nScanFieldHeight100) { m_nScanFieldHeight100 = a_nScanFieldHeight100; }
+
         // working distance
         public double GetWorkingDistance() { return m_dWorkingDistance; }
         public void SetWorkingDistance(double a_dWorkingDistance) { m_dWorkingDistance = a_dWorkingDistance; }
@@ -92,6 +95,7 @@ namespace OTSDataType
                 return;
             }
             m_nScanFieldWidth = (int)(100.0 * (double)m_nScanFieldSize100 / a_dMag + 0.5);
+            m_nScanFieldHeight= (int)(100.0 * (double)m_nScanFieldHeight100 / a_dMag + 0.5);
         }
 
         public override void Serialize(bool isStoring, XmlDocument classDoc, XmlNode rootNode)

+ 8 - 0
OTSIncAMeasureApp/2-OTSMeasureParamManage/COTSMeasureParam.cs

@@ -346,7 +346,15 @@ namespace OTSMeasureApp
             pSample.SetMsrParams(poMsrParams);
             CSEMDataMsr semData = new CSEMDataMsr();
             var m_pSEMStageData = GetDefaultParam().GetStageDataParam();
+
+            var imageScanParam = GetDefaultParam().GetImageScanParam();
+            string resol = imageScanParam.GetImageResulotion().ToString();
+            double resWidth = Convert.ToDouble(resol.Split('_')[1]);
+            double resHeight = Convert.ToDouble(resol.Split('_')[2]);
+            double heightWidthRatio = resHeight / resWidth;
             semData.SetScanFieldSize100(m_pSEMStageData.GetScanFieldSize100());
+            double fieldHeight = m_pSEMStageData.GetScanFieldSize100() * heightWidthRatio;
+            semData.SetScanFieldHeight100((int)fieldHeight);
             pSample.SetSEMDataMsr(semData);
 
             return pSample;

+ 35 - 25
OTSIncAMeasureApp/2-OTSMeasureParamManage/MeasureParam.cd

@@ -27,52 +27,53 @@
       <Compartment Name="Methods" Collapsed="true" />
     </Compartments>
     <TypeIdentifier>
-      <HashCode>AAihQAAEJBFCk0Ao4SEGLADBOLCQgEAViAoEAggkAlI=</HashCode>
+      <HashCode>CAihQAAFJBFCk0Ao4QEGLADBGJDQgEARyIoEBgikglI=</HashCode>
       <FileName>2-OTSMeasureParamManage\COTSMeasureParam.cs</FileName>
     </TypeIdentifier>
     <ShowAsAssociation>
-      <Field Name="m_ResultData" />
-      <Field Name="m_DefaultParam" />
-      <Field Name="m_StageParam" />
+      <Field Name="defaultParam" />
+      <Field Name="stageParam" />
     </ShowAsAssociation>
     <ShowAsCollectionAssociation>
       <Field Name="m_MeasureSampleList" />
     </ShowAsCollectionAssociation>
   </Class>
   <Class Name="OTSModelSharp.COTSDefaultParam" Collapsed="true">
-    <Position X="2" Y="2.25" Width="2.5" />
+    <Position X="3.5" Y="2.25" Width="2.5" />
+    <Compartments>
+      <Compartment Name="Fields" Collapsed="true" />
+    </Compartments>
     <TypeIdentifier>
-      <HashCode>ABCAgKMgAIIAgACGQEggBIAACCHFMAAAAAgCAAMABAA=</HashCode>
+      <HashCode>ABCAgKMgAIIAgACGQEggBIAACCHFMAAAAAgCAAIABAA=</HashCode>
       <FileName>0-OTSModel\Measure\ParamData\OTSDefaultParam.cs</FileName>
     </TypeIdentifier>
   </Class>
   <Class Name="OTSModelSharp.CStageParam" Collapsed="true">
-    <Position X="1.75" Y="3.5" Width="1.5" />
+    <Position X="1" Y="3.5" Width="1.5" />
     <TypeIdentifier>
       <HashCode>AAAIgKAAARAgAACDAAoABAABhCCAICgAQgAmBSIAQAI=</HashCode>
       <FileName>0-OTSModel\Measure\ParamData\StageParam.cs</FileName>
     </TypeIdentifier>
   </Class>
   <Class Name="OTSDataType.COTSSample" Collapsed="true">
-    <Position X="8.25" Y="4.75" Width="2.5" />
+    <Position X="8.75" Y="6.5" Width="2.5" />
     <TypeIdentifier>
-      <HashCode>UCEIwsIiY0kC4AAQiUmCAikAECCEYxABiIAPYEIgXJk=</HashCode>
+      <HashCode>UCEIgsIiY0kCoAAQiUmCAikAECCEYxABiIAPYEIgXJk=</HashCode>
       <FileName>0-OTSModel\OTSDataType\COTSSample.cs</FileName>
     </TypeIdentifier>
     <ShowAsAssociation>
       <Field Name="m_poMsrParams" />
+      <Field Name="m_poSEMDataMsr" />
     </ShowAsAssociation>
   </Class>
   <Class Name="OTSModelSharp.COTSMsrPrjResultData" Collapsed="true">
-    <Position X="15" Y="3.25" Width="2.25" />
+    <Position X="13.5" Y="3.25" Width="2.25" />
     <AssociationLine Name="m_listSamples" Type="OTSDataType.COTSSample" FixedFromPoint="true" FixedToPoint="true">
       <Path>
-        <Point X="15" Y="3.625" />
-        <Point X="14.625" Y="3.625" />
-        <Point X="14.625" Y="4.888" />
-        <Point X="11.615" Y="4.888" Type="JumpStart" />
-        <Point X="11.448" Y="4.888" Type="JumpEnd" />
-        <Point X="10.75" Y="4.888" />
+        <Point X="13.5" Y="3.625" />
+        <Point X="13.125" Y="3.625" />
+        <Point X="13.125" Y="6.638" />
+        <Point X="11.25" Y="6.638" />
       </Path>
     </AssociationLine>
     <TypeIdentifier>
@@ -86,17 +87,19 @@
       <Field Name="m_listSamples" />
     </ShowAsCollectionAssociation>
   </Class>
-  <Class Name="OTSMeasureApp.OTSIncAMeasureAppForm" Collapsed="true">
+  <Class Name="OTSMeasureApp.OTSIncAMeasureAppForm">
     <Position X="2.5" Y="7.5" Width="2.75" />
     <AssociationLine Name="m_ProjData" Type="OTSModelSharp.COTSMsrPrjResultData" FixedFromPoint="true" FixedToPoint="true">
       <Path>
-        <Point X="5.25" Y="7.839" />
-        <Point X="17" Y="7.839" />
-        <Point X="17" Y="3.798" />
+        <Point X="5.25" Y="21.766" />
+        <Point X="6.94" Y="21.766" Type="JumpStart" />
+        <Point X="7.107" Y="21.766" Type="JumpEnd" />
+        <Point X="15.5" Y="21.766" />
+        <Point X="15.5" Y="3.798" />
       </Path>
     </AssociationLine>
     <TypeIdentifier>
-      <HashCode>cIGadXIZ6PANrQ5bYEOxLjq7DEARCnybVGsEIl+D4rk=</HashCode>
+      <HashCode>cIGadXIZ6PENrQ5bYEOxLjq7DEARCnwbVGsEIl+D4rk=</HashCode>
       <FileName>OTSIncAMeasureAppForm.cs</FileName>
     </TypeIdentifier>
     <ShowAsAssociation>
@@ -106,25 +109,32 @@
     </ShowAsAssociation>
   </Class>
   <Class Name="OTSMeasureApp.CMeasureThreadWrapper" Collapsed="true">
-    <Position X="6" Y="6.25" Width="3.25" />
+    <Position X="0.5" Y="6" Width="3.25" />
     <TypeIdentifier>
       <HashCode>FAgIAwAhIQIAAACQBAAEKI0hQBAAAAAACQBgYAQACgA=</HashCode>
       <FileName>1-OTSMeasure\CMeasureThreadWrapper.cs</FileName>
     </TypeIdentifier>
   </Class>
   <Class Name="OTSModelSharp.COTSGeneralParam" Collapsed="true">
-    <Position X="14.75" Y="1.75" Width="2.75" />
+    <Position X="16" Y="2.25" Width="2.75" />
     <TypeIdentifier>
-      <HashCode>MAAAgEQEQhIAbYBCiAQQBIQmyGxAKAikJADGECAAAQA=</HashCode>
+      <HashCode>MAAAgEQEQhIAbYBCiAQQBIQmyGxAKAikJAHGECAAAQA=</HashCode>
       <FileName>0-OTSModel\Measure\ParamData\OTSGeneralParam.cs</FileName>
     </TypeIdentifier>
   </Class>
   <Class Name="OTSDataType.CSampleParam" Collapsed="true">
     <Position X="10.75" Y="3.5" Width="1.5" />
     <TypeIdentifier>
-      <HashCode>CACQAAAAAgAABABAgAKgAAwACCCFIAQgAEACAgIARAA=</HashCode>
+      <HashCode>CACQQAAAAgAERABAgAKwAAwACCCFYAQgAEACAgIARAA=</HashCode>
       <FileName>0-OTSModel\OTSDataType\CSampleParam.cs</FileName>
     </TypeIdentifier>
   </Class>
+  <Class Name="OTSDataType.CSEMDataMsr" Collapsed="true">
+    <Position X="9" Y="8.5" Width="2.75" />
+    <TypeIdentifier>
+      <HashCode>gCAACIAAggAIACAAgBAAAAAQACAAMAgQAAgLAAgEIAA=</HashCode>
+      <FileName>0-OTSModel\OTSDataType\CSEMDataMsr.cs</FileName>
+    </TypeIdentifier>
+  </Class>
   <Font Name="Microsoft YaHei UI" Size="9" />
 </ClassDiagram>

+ 29 - 8
OTSIncAMeasureApp/7-OTSProgMgrInfo/SpecialParticleForm.cs

@@ -60,13 +60,18 @@ namespace OTSMeasureApp
         {
 
              ds1 = XMLoperate.GetXMLRegList(xmlPath, "Member");
-             dg1.DataSource = ds1.Tables[0];
-           
-            var ds2 = XMLoperate.GetXMLRegList(xmlPath, "XMLData");
+            if (ds1.Tables.Count > 0)
+            {
+                dg1.DataSource = ds1.Tables[0];
+
+                var ds2 = XMLoperate.GetXMLRegList(xmlPath, "XMLData");
+
+                var ifrun = Convert.ToBoolean(ds2.Tables[0].Rows[0]["ToRun"]);
 
-            var ifrun = Convert.ToBoolean(ds2.Tables[0].Rows[0]["ToRun"]);
+                checkBox1.Checked = ifrun;
 
-            checkBox1.Checked = ifrun;
+            }
+            
         }
 
 
@@ -75,7 +80,18 @@ namespace OTSMeasureApp
 
         private void button1_Click(object sender, EventArgs e)
         {
-
+            if (ds1.Tables.Count == 0)
+            {
+                
+                var t = new DataTable();
+                t.Columns.Add(new DataColumn("RegName"));
+                t.Columns.Add(new DataColumn("start"));
+                t.Columns.Add(new DataColumn("end"));
+                t.Columns.Add(new DataColumn("diameterStart"));
+                t.Columns.Add(new DataColumn("diameterEnd"));
+                t.Columns.Add(new DataColumn("collectXray"));
+                ds1.Tables.Add(t);
+            }
             var nr = ds1.Tables[0].NewRow();
 
             nr["RegName"] = str_RegName;
@@ -86,12 +102,17 @@ namespace OTSMeasureApp
             nr["collectXray"] = "false";
            
             ds1.Tables[0].Rows.Add(nr);
-           
+            dg1.DataSource = ds1.Tables[0];
+
         }
 
         private void button3_Click(object sender, EventArgs e)
         {
-            ds1.Tables[0].Rows.RemoveAt(dg1.CurrentRow.Index);
+            if (ds1.Tables[0].Rows.Count > 0)
+            {
+                ds1.Tables[0].Rows.RemoveAt(dg1.CurrentRow.Index);
+            }
+           
         }
 
         private void dg1_CellContentClick(object sender, DataGridViewCellEventArgs e)