Browse Source

Merge branch 'dev' of http://172.16.3.77:10080/gaoshipeng/OTS2_0 into dev

gsp 4 years ago
parent
commit
f6218411f3

+ 14 - 14
OTSIncAMeasureApp/0-OTSModel/Measure/GetBSEPic/CMsrDisplayResults.cs

@@ -16,7 +16,7 @@ namespace OTSModelSharp
     {   // Type ID
         private int m_nTypeId;
         // area (micros)
-        private System.UInt32 m_nArea;
+        private double m_nArea;
         // particle number
         private System.UInt32 m_nNumber;
         private string m_sName;
@@ -49,11 +49,11 @@ namespace OTSModelSharp
             m_nTypeId = a_nTypeId;
         }
         // area (micros)
-        public System.UInt32 GetArea()
+        public double GetArea()
         {
             return m_nArea;
         }
-        public void SetArea(System.UInt32 a_nArea)
+        public void SetArea(double a_nArea)
         {
             m_nArea = a_nArea;
         }
@@ -102,7 +102,7 @@ namespace OTSModelSharp
         // radio
         double m_dRadio;
         // measured area (micros)
-        System.UInt32 m_nMeasuredArea;
+        double m_nMeasuredArea;
         // result items list
         List<CMsrResultItem> m_listResultItems;
 
@@ -127,15 +127,15 @@ namespace OTSModelSharp
             m_dRadio = a_dRadio;
         }
         // measured area (micros)
-        public System.UInt32 GetMeasuredArea()
+        public double GetMeasuredArea()
         {
             return m_nMeasuredArea;
         }
-        public void SetMeasuredArea(System.UInt32 a_nMeasuredArea)
+        public void SetMeasuredArea(double a_nMeasuredArea)
         {
             m_nMeasuredArea = a_nMeasuredArea;
         }
-        public void CumulateMeasuredArea(System.UInt32 a_nMeasuredArea)
+        public void CumulateMeasuredArea(double a_nMeasuredArea)
         {
             m_nMeasuredArea += a_nMeasuredArea;
         }
@@ -154,18 +154,18 @@ namespace OTSModelSharp
                 m_listResultItems.Add(cMsrResultItem);
             }
         }
-        public System.UInt32 GetTotalParticleArea()
+        public double GetTotalParticleArea()
         {
-            System.UInt32 nArea = 0;
+            double nArea = 0;
             foreach (CMsrResultItem poResultItem in m_listResultItems)
             {
                 nArea += poResultItem.GetArea();
             }
             return nArea;
         }
-        public System.UInt32 GetTotalparticleIdentifyArea()
+        public double GetTotalparticleIdentifyArea()
         {
-            System.UInt32 nArea = 0;
+            double nArea = 0;
             foreach (CMsrResultItem poResultItem in m_listResultItems)
             {
                 if (poResultItem.GetTypeId() > 7)
@@ -192,7 +192,7 @@ namespace OTSModelSharp
             {
                 return dDisplayRadio;
             }
-            System.UInt32 nTotalParticleArea = GetTotalParticleArea();
+            double nTotalParticleArea = GetTotalParticleArea();
             dDisplayRadio = (double)nTotalParticleArea / (double)m_nMeasuredArea * m_dRadio;
             return dDisplayRadio;
         }
@@ -204,7 +204,7 @@ namespace OTSModelSharp
             if (itr != null)
             {
 
-                itr.SetArea((uint)a_poResultItem.GetArea() + itr.GetArea());
+                itr.SetArea(a_poResultItem.GetArea() + itr.GetArea());
                 itr.SetNumber(itr.GetNumber() + 1);
             }
             else            
@@ -212,7 +212,7 @@ namespace OTSModelSharp
                 CMsrResultItem pMsrResultItem = new CMsrResultItem();
                 pMsrResultItem.SetTypeId(a_poResultItem.GetClassifyId());
 
-                pMsrResultItem.SetArea((System.UInt32)(a_poResultItem.GetArea() + 0.5));
+                pMsrResultItem.SetArea(a_poResultItem.GetArea() + 0.5);
                 pMsrResultItem.SetNumber(1);
                 pMsrResultItem.SetName(a_poResultItem.GetTypeName());
                 m_listResultItems.Add(pMsrResultItem);

+ 3 - 3
OTSIncAMeasureApp/0-OTSModel/Measure/GetBSEPic/CSmplMeasure.cs

@@ -648,12 +648,12 @@ namespace OTSModelSharp
 
                     ++nNewFieldId;
 
-                    uint measuredArea = 0; // this area should be the field area
+                    double measuredArea = 0; // this area should be the field area
                     var a_pBSEImg = curFldData.GetBSEImage();
                     
                     double dPixelSize = m_Sample.CalculatePixelSize();
                    
-                        measuredArea = (uint)(a_pBSEImg.GetHeight() * a_pBSEImg.GetWidth()* dPixelSize * dPixelSize + 0.5); //Get measured area
+                        measuredArea = a_pBSEImg.GetHeight() * a_pBSEImg.GetWidth()* dPixelSize * dPixelSize + 0.5; //Get measured area
                     if (!CumulateFieldData(curFldData.ListAnalysisParticles, measuredArea))
                     { // failed to call SaveFieldFile method
                         loger.Error("ImageProcess: call CumulateFieldData method.");
@@ -935,7 +935,7 @@ namespace OTSModelSharp
             }
         }
         // Cumulate field data info
-        public virtual bool CumulateFieldData( List<COTSParticleClr> listParticles, uint a_nMeasuredArea)
+        public virtual bool CumulateFieldData( List<COTSParticleClr> listParticles, double a_nMeasuredArea)
         {
 
             // get measure result items of the sample

+ 18 - 14
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSSample.cs

@@ -298,6 +298,8 @@ namespace OTSDataType
                 case OTS_SAMPLE_PROP_GRID_ITEMS.WORKING_DISTANCE:
                 case OTS_SAMPLE_PROP_GRID_ITEMS.RATIO:
                 case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_TO_MEASURE_AREA:
+                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_AREA:
+                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_PARTICLE_AREA:
                 default:
                     {
                         // something wrong, return false
@@ -552,23 +554,12 @@ namespace OTSDataType
                     }
                     break;
 
-                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_AREA:
-                    {
-                        a_nValue = (int)m_poMsrResults.GetMeasuredArea();
-                    }
-                    break;
-
                 case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_PARTICLE:
                     {
                         a_nValue = (int)m_poMsrResults.GetTotalParticleNumber();
                     }
                     break;
 
-                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_PARTICLE_AREA:
-                    {
-                        a_nValue = (int)m_poMsrResults.GetTotalParticleArea();
-                    }
-                    break;
                 case OTS_SAMPLE_PROP_GRID_ITEMS.FIELDSTOP_AREAPERCENTAGE:
                     {
                         a_nValue = m_poMsrParams.GetImageScanParam().GetFieldAreaPercentage();
@@ -823,9 +814,9 @@ namespace OTSDataType
                 // read only properties, treat same as default
                 case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_FIELDS:
                 case OTS_SAMPLE_PROP_GRID_ITEMS.COMPLETED_FIELDS:
-                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_AREA:
+                
                 case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_PARTICLE:
-                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_PARTICLE_AREA:
+                
                 default:
                     {
                         // something wrong, return false
@@ -2021,7 +2012,20 @@ namespace OTSDataType
 
                         double dFieldArea = 0; // this area should be the field area
                         dFieldArea = CalculateAFieldArea();
-                        a_dValue = (double)m_poSEMDataMsr.GetTotalFields() * dFieldArea;//
+                        a_dValue = m_poSEMDataMsr.GetTotalFields() * dFieldArea;
+                    }
+                    break;
+
+                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_AREA:
+                    {
+                        a_dValue = m_poMsrResults.GetMeasuredArea();
+                    }
+                    break;
+
+
+                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_PARTICLE_AREA:
+                    {
+                        a_dValue = m_poMsrResults.GetTotalParticleArea();
                     }
                     break;
 

+ 1 - 1
OTSIncAMeasureApp/8-OTSSampleMeasureInfo/OTSSampleData.cs

@@ -401,7 +401,7 @@ namespace OTSMeasureApp
             //测量面积
             SampleData sData30 = new SampleData();
             sData30.iSampleId = OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_AREA;
-            sData30.iSampleValType = OTS_ITEM_TYPES.INT;
+            sData30.iSampleValType = OTS_ITEM_TYPES.DOUBLE;
             sData30.sSCaptionName = "测量面积";
             sData30.SampleVal = 120;
             m_SMInfo.SampleDataList.Add(sData30);

+ 1 - 1
OTSIncAReportApp/FunctionClass/OTSTreeViewData/OTSTreeViewData.cs

@@ -239,7 +239,7 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
                     FindTreeWorkSampleNode(Tnode.Nodes[i], sWorkSampleName);
                 }
             }
-        }
+    }
 
         /// <summary>
         /// 递归遍历树节点,找到后,设置树节点的选中状态

+ 5 - 1
OTSIncAReportApp/frmMeasureRstMgr.cs

@@ -384,7 +384,11 @@ namespace OTSIncAReportApp
 
             if (DialogResult.OK == MessageBox.Show(sDeleteSampleName, "Tip", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning))
             {
-                //删除样品成功
+                //删除当前选中的节点
+                TreeNode tvnode = treeView1.SelectedNode;
+                treeView1.Nodes.Remove(tvnode);
+
+                
                 //当节点全部删除完时刷新树以及主窗口的控件
                 if (treeView1.Nodes.Count == 0)
                 {

+ 2 - 2
OTSIncAReportTemplate/OTSIncAReportTemplate.cs

@@ -61,7 +61,7 @@ namespace OTSIncAReportTemplate
             //}
 
             //方便测试代码分岐
-            bool bDebug = true;
+            bool bDebug = false;
             if (bDebug == false)
             {
                 m_arg1 = args[0].Replace("^", " ");
@@ -85,7 +85,7 @@ namespace OTSIncAReportTemplate
                 //m_arg4 = "0-983";
                 //m_arg5 = "";
 
-                m_arg1 = "E:\\ResultFile\\beijing20210708\\Sample4\\ReportTemplateDB.db";
+                m_arg1 = "D:\\夹杂物\\ReportTemplateDB.db";
                 m_arg2 = "./Config/ProData/ReportTemplateConfig.xml";
                 m_arg3 = "MainReport";
                 m_arg4 = "100";

+ 3 - 2
OTSIncAReportTemplate/OTSIncAReportTemplate.csproj

@@ -94,8 +94,9 @@
     <Reference Include="System" />
     <Reference Include="System.ComponentModel.DataAnnotations" />
     <Reference Include="System.Core" />
-    <Reference Include="System.Data.SQLite, Version=1.0.114.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
-      <HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.114.0\lib\net46\System.Data.SQLite.dll</HintPath>
+    <Reference Include="System.Data.SQLite, Version=1.0.86.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\Bin\x64\Debug\ReportTemplateExe\System.Data.SQLite.dll</HintPath>
     </Reference>
     <Reference Include="System.Data.SQLite.EF6, Version=1.0.114.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
       <HintPath>..\packages\System.Data.SQLite.EF6.1.0.114.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>

+ 2 - 2
OTSSysMgrApp/ControllerSettingForm.cs

@@ -983,7 +983,6 @@ namespace OTSSysMgrApp
                         lbXrayCount.Text = nXrayCount.ToString();
                     }
                 }
-                log.Info("Area collection successful!");
             }
             catch (Exception ex)
             {
@@ -1045,6 +1044,7 @@ namespace OTSSysMgrApp
                 chartXRay.Refresh();
                 //EDS过程结束
                 //cfun.EDSFinishedInstance();
+                ConnectionState = false;
                 log.Info("Cleared successfully!");
             }
             catch (Exception ex)
@@ -1136,7 +1136,7 @@ namespace OTSSysMgrApp
                 //EDS过程结束
                 //cfun.EDSFinishedInstance();
                 //关闭连接
-                DisConnectSem(connectionEnumType.EDSAreaXRay);
+                //DisConnectSem(connectionEnumType.EDSAreaXRay);
             }
         }
         #endregion

+ 2 - 0
XMLData/AppResource_ZH.xml

@@ -189,6 +189,8 @@
       <Control name="AddSample" text="增加样品测量结果" />
       <Control name="button1" text="多选数据源" />
       <Control name="frmMeasureRstMgr" text="测量结果窗口" />
+	  <Control name="str1" text="是否确定删除 " />
+	  <Control name="str2" text="信息?" />
     </Controls>
  </Form>
  <Form>