Browse Source

Merge branch 'OTSRelease3_0' of http://36.129.163.148:30080/gogsadmin/OTS into OTSRelease3_0

gsp 1 year ago
parent
commit
96d5a73fdd

+ 0 - 24
Bin/x64/Debug/Config/SysData/OTSStage.stg

@@ -78,29 +78,5 @@
         <Member HoleName="18" rectDomian="-14500,-24500,12000,0" shape="0" />
       </Collection>
     </Member>
-    <Member strName="Apero">
-      <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,130000,120000" shape="1:RECTANGLE" />
-      <Member RegName="std" PolygonPoint="" rectDomian="6300,0,2,0" shape="0:ROUND" />
-      <Collection RegName="Holes">
-        <Member HoleName="9" rectDomian="0,0,10000,0" shape="0" />
-        <Member HoleName="2" rectDomian="0,25000,10000,0" shape="0" />
-        <Member HoleName="3" rectDomian="-15000,25000,10000,0" shape="0" />
-        <Member HoleName="1" rectDomian="15000,25500,10000,0" shape="0" />
-        <Member HoleName="4" rectDomian="22000,13000,10000,0" shape="0" />
-        <Member HoleName="5" rectDomian="7000,13000,10000,0" shape="0" />
-        <Member HoleName="6" rectDomian="-7500,13000,10000,0" shape="0" />
-        <Member HoleName="7" rectDomian="-22500,13000,10000,0" shape="0" />
-        <Member HoleName="8" rectDomian="14000,0,10000,0" shape="0" />
-        <Member HoleName="10" rectDomian="-15000,0,10000,0" shape="0" />
-        <Member HoleName="11" rectDomian="-30000,0,10000,0" shape="0" />
-        <Member HoleName="12" rectDomian="22000,-12500,10000,0" shape="0" />
-        <Member HoleName="13" rectDomian="7000,-12500,10000,0" shape="0" />
-        <Member HoleName="14" rectDomian="-7500,-12500,10000,0" shape="0" />
-        <Member HoleName="15" rectDomian="-22500,-12500,10000,0" shape="0" />
-        <Member HoleName="16" rectDomian="14500,-24500,10000,0" shape="0" />
-        <Member HoleName="17" rectDomian="-500,-24500,10000,0" shape="0" />
-        <Member HoleName="18" rectDomian="-14500,-24500,10000,0" shape="0" />
-      </Collection>
-    </Member>
   </Collection>
 </XMLData>

+ 8 - 0
OTSCommon/ReportModel/ResultFile.cs

@@ -51,6 +51,14 @@ public    enum OTS_Y_AXIS_DIRECTION
             float ScanFieldSizeX100 = float.Parse(SEMDataMsr["ScanFieldSize100"].ToString());
             return ScanFieldSizeX100;
         }
+        public float GetMeasurementMagnification()
+        {
+            Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)ResultInfo["Sample"])["Members"]);
+            Dictionary<string, object> SEMDataMsr = (Dictionary<string, object>)sampleMembers["SEMDataMsr"];
+            //Dictionary<string, object> SEMStageData = (Dictionary<string, object>)ResultInfo["SEMStageData"];
+            float ScanMagnification = float.Parse(SEMDataMsr["Magnification"].ToString());
+            return ScanMagnification;
+        }
         public float GetScanFieldSizeY()
         {
             Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)ResultInfo["Sample"])["Members"]);

+ 1 - 1
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSPropertyWindow.cs

@@ -356,7 +356,7 @@ namespace OTSMeasureApp
             m_cotsprogmgrparamfile.SetGenParam(m_cgenparam);
             if (m_cotsprogmgrparamfile.SaveInfoToProgMgrFile())
             {
-                MessageBox.Show("Already saved!", "Tip");
+                //MessageBox.Show("Already saved!", "Tip");
             }
         }
 

+ 17 - 2
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/DlgStageEdit.Designer.cs

@@ -71,6 +71,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             this.button_Coordinate = new System.Windows.Forms.Button();
             this.btn_reght90 = new System.Windows.Forms.Button();
             this.btn_left90 = new System.Windows.Forms.Button();
+            this.btn_new = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.m_ctrlStagePicture)).BeginInit();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
@@ -492,10 +493,10 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             // button_Ok
             // 
             this.button_Ok.Enabled = false;
-            this.button_Ok.Location = new System.Drawing.Point(1005, 584);
+            this.button_Ok.Location = new System.Drawing.Point(1065, 586);
             this.button_Ok.Margin = new System.Windows.Forms.Padding(2);
             this.button_Ok.Name = "button_Ok";
-            this.button_Ok.Size = new System.Drawing.Size(118, 30);
+            this.button_Ok.Size = new System.Drawing.Size(58, 30);
             this.button_Ok.TabIndex = 21;
             this.button_Ok.Text = "保存";
             this.button_Ok.UseVisualStyleBackColor = true;
@@ -536,11 +537,24 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             this.btn_left90.UseVisualStyleBackColor = true;
             this.btn_left90.Click += new System.EventHandler(this.btn_left90_Click);
             // 
+            // btn_new
+            // 
+            this.btn_new.Enabled = false;
+            this.btn_new.Location = new System.Drawing.Point(1003, 586);
+            this.btn_new.Margin = new System.Windows.Forms.Padding(2);
+            this.btn_new.Name = "btn_new";
+            this.btn_new.Size = new System.Drawing.Size(58, 30);
+            this.btn_new.TabIndex = 25;
+            this.btn_new.Text = "新建";
+            this.btn_new.UseVisualStyleBackColor = true;
+            this.btn_new.Click += new System.EventHandler(this.btn_new_Click);
+            // 
             // DlgStageEdit
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
             this.ClientSize = new System.Drawing.Size(1127, 625);
+            this.Controls.Add(this.btn_new);
             this.Controls.Add(this.btn_left90);
             this.Controls.Add(this.btn_reght90);
             this.Controls.Add(this.button_Coordinate);
@@ -627,5 +641,6 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
         private System.Windows.Forms.Button button_Coordinate;
         private System.Windows.Forms.Button btn_reght90;
         private System.Windows.Forms.Button btn_left90;
+        private System.Windows.Forms.Button btn_new;
     }
 }

+ 50 - 19
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/DlgStageEdit.cs

@@ -23,6 +23,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
         OTSCommon.Language lan;
         System.Collections.Hashtable hashtable;
         List<string> StageNames = new List<string>();
+        string StageN = "";
         public DlgStageEdit(List<string> a_StageNames)
         {
             InitializeComponent();
@@ -71,7 +72,8 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             }
             SetHelp();
 
-            StageNames.Remove(tStageName.Text.Trim());
+            StageNames.Remove(tStageName.Text);
+            StageN = tStageName.Text;
         }
         void SetHelp()
         {
@@ -228,24 +230,24 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             this.cmb_Temp.Visible = false;
         }
 
-        private void button_Generate_Click(object sender, EventArgs e)
-        {
-            if(StageNames.Contains(tStageName.Text.Trim()))
+        bool CheckAndSetStage()
+        { 
+            if(StageNames.Contains(tStageName.Text))
             {
                 MessageBox.Show("Already exist " + tStageName.Text.Trim() + "!", "Error");
-                return;
+                return false;
             }
             if (!CheckParams())
             {
                 this.button_Ok.Enabled = false;
                 MessageBox.Show("Please check Params!");
-                return;
+                return false;
             }
             if (tBoundaryWide.Text == "1" || tBoundaryHeight.Text == "1" || tStandardsampleWide.Text == "1" || tStandardsampleHeight.Text == "1")
             {
                 this.button_Ok.Enabled = false;
                 MessageBox.Show("The length value cannot be 1!");
-                return;
+                return false;
             }
             for (int i = 0; i < dataGridView_Holes.Rows.Count; i++)
             {
@@ -255,7 +257,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
                     {
                         this.button_Ok.Enabled = false;
                         MessageBox.Show("The length value cannot be 1!");
-                        return;
+                        return false;
                     }
                 }
             }
@@ -326,25 +328,25 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             // name should be ok
             if (pBoundary == null)
             {
-                return ;
+                return false;
             }
             if (pBoundary.IsInvalid())
             {
                 // boundary is invalid
-                return ;
+                return false;
             }
             if (pSTD != null)
             {
-                // STD has to be inside of the boundary
-                if (!pBoundary.DomainInDomain(pSTD))
-                {
-                    MessageBox.Show("STD is over the boundary!");
-                    return;
-                }
+                // STD has to be inside of the boundary由于计算准确性问题,此项暂时去除
+                //if (!pBoundary.DomainInDomain(pSTD))
+                //{
+                //    MessageBox.Show("STD is over the boundary!");
+                //    return false;
+                //}
             }
             else
             {
-                return;
+                return false;
             }
 
             // hole has to be inside of the boundary and can't have common part with STD and each other
@@ -383,7 +385,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             if (listStageHoles.Count == 0)
             {
                 // no hole at all
-                return ;
+                return false;
             }
 
             // the stage is in SEM coordinate system, convert all components to OTS system 
@@ -391,7 +393,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             {
                 if (!a_pCSEMStageData.ConverSEMToOTSSystem(pBoundary, pSTD, listStageHoles))
                 {
-                    return ;
+                    return false;
                 }
             }
 
@@ -399,10 +401,20 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             Stage.SetBoundary(pBoundary);
             Stage.SetSTD(pSTD);
             Stage.SetHoleList(listStageHoles, true);
+            return true;
+        }
+
+        private void button_Generate_Click(object sender, EventArgs e)
+        {
+            if(!CheckAndSetStage())
+            {
+                return;
+            }
             DrawStage();
             btn_reght90.Enabled = true;
             btn_left90.Enabled = true;
             this.button_Ok.Enabled = true;
+            btn_new.Enabled = true;
         }
 
         public void DrawStage()
@@ -484,6 +496,10 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
 
         private void button_Ok_Click(object sender, EventArgs e)
         {
+            if (!CheckAndSetStage())
+            {
+                return;
+            }
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
@@ -666,5 +682,20 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
 
             button_Generate_Click(null, null);
         }
+
+        private void btn_new_Click(object sender, EventArgs e)
+        {
+            if(StageN.Trim()== tStageName.Text.Trim())
+            {
+                MessageBox.Show("Already exist " + tStageName.Text.Trim() + "!", "Error");
+                return;
+            }
+            if (!CheckAndSetStage())
+            {
+                return;
+            }
+            this.DialogResult = DialogResult.No;
+            this.Close();
+        }
     }
 }

+ 10 - 22
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/DlgStageMgr.cs

@@ -317,24 +317,8 @@ namespace OTSModelSharp.Measure.GetStageInfo
 
         public void UpdateStageFileData(bool a_bUpdateData/* = TRUE*/)
         {
-            if (a_bUpdateData)
-            {
-                UpdateData(true);
-            }
-
-           
-                // if there is sample on the stage, the working stage can't be changed.
-                m_pStageFile.SetWorkingStageId(m_nListBoxStageListIndex);
-           
-
-
-        }
-
-        public bool UpdateData(bool bSaveAndValidate)
-        {
-
-            return true;
-
+            // if there is sample on the stage, the working stage can't be changed.
+            m_pStageFile.SetWorkingStageId(m_nListBoxStageListIndex);
         }
 
         public void DrawStage()
@@ -514,8 +498,8 @@ namespace OTSModelSharp.Measure.GetStageInfo
                 StageNames.Add(it.ToString());
             }
             DlgStageEdit dlgStageEdit = new DlgStageEdit(m_pStageFile.GetStagesList()[m_ctrlListBoxStageList.SelectedIndex], StageNames);
-
-            if (dlgStageEdit.ShowDialog() == DialogResult.OK)
+            DialogResult dialogResult = dlgStageEdit.ShowDialog();
+            if (dialogResult == DialogResult.OK)
             {
                 List<CStage> cli = m_pStageFile.GetStagesList();
                 cli[m_ctrlListBoxStageList.SelectedIndex]=dlgStageEdit.Stage;
@@ -523,9 +507,13 @@ namespace OTSModelSharp.Measure.GetStageInfo
                 m_pStageFile.SetModify(true);
                 SetStageListControlData();
             }
-            else
+            else if(dialogResult == DialogResult.No)
             {
-
+                List<CStage> cli = m_pStageFile.GetStagesList();
+                cli.Add(dlgStageEdit.Stage);
+                //m_pStageFile.SetStagesList(cli, true);
+                m_pStageFile.SetModify(true);
+                SetStageListControlData();
             }
         }
 

+ 4 - 1
OTSIncAReportApp/1-UI/Control_ECharts/EChart_ParticlesComposition.cs

@@ -337,7 +337,10 @@ namespace OTSIncAReportApp.Control_ECharts
             DataOperation.DataAccess.ParticleData particledata = new DataOperation.DataAccess.ParticleData(path);
             DataTable data = new DataTable();
             data = particledata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
-
+            if(data.Rows.Count==0)
+            {
+                return data;
+            }
             
             DataTable AreaInformationOfAllElements = ConSolidateInvalid(data);
             DataTable AllAnalysisDetails = new DataTable();

+ 28 - 1
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -2628,7 +2628,7 @@ namespace OTSIncAReportGraph.Controls
 
         public void DisplayParticleByParticlelist(List<Particle> particle)
         {
-
+            bool flag = true;
             foreach (var p in m_list_allDPart)
             {
                 var dp = p;
@@ -2638,7 +2638,34 @@ namespace OTSIncAReportGraph.Controls
                     {
                         if (dp.objParticleData.ParticleId == p2.ParticleId)
                         {
+                            if (flag)
+                            {
+                                var p1= dp.GetCenterPoint();
+                                foreach (DisplayParticle dp1 in m_list_allDPart)
+                                {
+
+                                    dp1.DraggingPoint = p1;
+                                    dp1.DraggingMove(new PointF(this.Width / 2, this.Height / 2));
+                                    dp1.DraggingPoint = Point.Empty;
+                                }
+                                foreach (var item in m_list_allDfield)
+                                {
+                                    item.DraggingPoint = p1;
+                                    item.DraggingMove(new PointF(this.Width / 2, this.Height / 2));
+                                }
+                                foreach (var item in m_CurGBFields)
+                                {
+                                    item.DraggingPoint = p1;
+                                    item.DraggingMove(new PointF(this.Width / 2, this.Height / 2));
+                                }
+                                m_beforedrag_pointf = p1;
+                                //同样重新计算backrectf的坐标
+                                m_backRect = new RectangleF(m_backRect.Location.X + this.Width / 2 - m_beforedrag_pointf.X,
+                                     m_backRect.Location.Y + this.Height / 2 - m_beforedrag_pointf.Y, m_backRect.Width, m_backRect.Height);
 
+                                ImageZoom(2.5f, new PointF(dp.GetCenterPoint().X, dp.GetCenterPoint().Y));
+                                flag = false;
+                            }
                             dp.IsSelect = true;
                             break;
                         }

+ 1 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.Designer.cs

@@ -521,6 +521,7 @@
             this.dgV_ParticlesDevidePage.Size = new System.Drawing.Size(1502, 741);
             this.dgV_ParticlesDevidePage.TabIndex = 5;
             this.dgV_ParticlesDevidePage.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.dgV_ParticlesDevidePage_SortCompare);
+            this.dgV_ParticlesDevidePage.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgV_ParticlesDevidePage_KeyDown);
             this.dgV_ParticlesDevidePage.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dgV_ParticlesDevidePage_MouseDown);
             this.dgV_ParticlesDevidePage.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dgV_ParticlesDevidePage_MouseUp);
             // 

+ 16 - 8
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.cs

@@ -82,9 +82,9 @@ namespace OTSIncAReportGrids
         enum SelItem
         {
             analyticalParticle = 0,
-            otherParticles = 2,
-            MergeParticles = 3,
-            allParticles=4
+            otherParticles = 1,
+            MergeParticles = 2,
+            allParticles=3
         }
 
         #region 分页器相关
@@ -432,7 +432,7 @@ namespace OTSIncAReportGrids
 
             string vs = "," + sub.Replace(':', '-') + ",";
 
-            DataTable dataTable = fielddata.GetParticleAll(vs);
+            DataTable dataTable = fielddata.GetParticleAllforparticlelist(vs);
             if (dataTable.Rows.Count == 0)
             {
                 return null;
@@ -2576,10 +2576,10 @@ namespace OTSIncAReportGrids
 
                 }
             }
-            if(m_ReportApp.im_Control_DrawDistrbutionImageAndBSE!=null)
-            {
-                m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.DisplayParticleByParticlelist(Particleslist_selecttodisplay);
-            }
+            //if(m_ReportApp.im_Control_DrawDistrbutionImageAndBSE!=null)
+            //{
+            //    m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.DisplayParticleByParticlelist(Particleslist_selecttodisplay);
+            //}
         }
 
         public List<Particle> GetParticleslist_select()
@@ -2595,6 +2595,14 @@ namespace OTSIncAReportGrids
                 SaveParticleslist_select();
             }
         }
+
+        private void dgV_ParticlesDevidePage_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyData == Keys.Delete)
+            {
+                ToolStripMenuItem_Delete_Particle_Click(null, null);
+            }
+        }
     }
 }
 

+ 14 - 8
OTSIncAReportApp/1-UI/Control_Grids/ResultGrid.cs

@@ -140,9 +140,13 @@ namespace OTSIncAReportGrids
             int particleArea = fielddata.GetparticleArea();
 
             double ratio = Math.Round(particleArea / filedsArea*1000,3);
-            float ScanFieldSize100 = resfile.GetScanFieldSizeX100();
-            float ScanFieldSize = resfile.GetScanFieldSizeX();
-            double Magnification = ScanFieldSize100 * 100 / ScanFieldSize;
+            //float ScanFieldSize100 = resfile.GetScanFieldSizeX100();
+            //float ScanFieldSize = resfile.GetScanFieldSizeX();
+
+
+            //double Magnification = ScanFieldSize100 * 100 / ScanFieldSize;
+
+            double Magnification= resfile.GetMeasurementMagnification();
             //报告参数文件
             string xmlpath = Application.StartupPath + RptConfigFile.m_ReportMgrParamFile;
             DataSet ds = XMLoperate.GetXmlData(xmlpath, "XMLData");
@@ -217,11 +221,13 @@ namespace OTSIncAReportGrids
             }
             TimeSpan timeSpan = end - star;
             int all_FiledCount = resfile.GetTotalFields();
-            //当前屏幕尺寸/µm
-            double ScanFieldSize = resfile.GetScanFieldSizeX();
-            //100倍时屏幕尺寸/µm
-            double ScanFieldSize100 = resfile.GetScanFieldSizeX100();
-            double  Magnification = ScanFieldSize100 / ScanFieldSize * 100;
+            ////当前屏幕尺寸/µm
+            //double ScanFieldSize = resfile.GetScanFieldSizeX();
+            ////100倍时屏幕尺寸/µm
+            //double ScanFieldSize100 = resfile.GetScanFieldSizeX100();
+            //double  Magnification = ScanFieldSize100 / ScanFieldSize * 100;
+
+            double Magnification = resfile.GetMeasurementMagnification();
             int filedCount = fielddata.GetFiledCount();
             //Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)resfile.ResultInfo["Sample"])["Members"]);
             //Dictionary<string, object> semDataMsr = (Dictionary<string, object>)sampleMembers["SEMDataMsr"];

+ 28 - 11
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -112,7 +112,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             string sqlp = @"select TypeId,TypeName,TypeColor,count(1) as con,sum(Area) as Area,avg(" + con
                 + ") as av,max(" + con
                 + ") as max ";
-            sqlp = sqlp + " from IncAData group by TypeId";
+            sqlp = sqlp + "from IncAData where typeid !=-1 and typeid !=4 group by TypeId";
 
             DataTable DT = dbHelper.ExecuteDataTable(sqlp, null);
             return DT;
@@ -129,10 +129,10 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             string sqlp = @"select TypeId,TypeName,TypeColor,count(1) as con,avg(" + con
                 + ") as av,max(" + con
                 + ") as max ,GroupName";
-            sqlp = sqlp + " from IncAData ";
+            sqlp = sqlp + " from IncAData where typeid !=-1 and typeid !=4";
             if (fieldAndPartic != "")
             {
-                sqlp = sqlp + " where '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
+                sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
             }
 
             sqlp = sqlp + " group by TypeId ";
@@ -157,10 +157,10 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         {
 
             string sqlp = @"select e.name,sum(e.percentage*p.area) as earea from ElementChemistry e 
-                inner join INcAData p on e.xrayid=p.xrayid and e.fieldid = p.fieldid";
+                inner join INcAData p on e.xrayid=p.xrayid and e.fieldid = p.fieldid from IncAData where typeid !=-1 and typeid !=4";
             if (fieldAndPartic != "")
             {
-                sqlp = sqlp + " where '" + fieldAndPartic + "' like ('%,'||p.fieldid||'-'||p.particleid||',%')";
+                sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||p.fieldid||'-'||p.particleid||',%')";
             }
 
             sqlp = sqlp + " group by e.name  order by sum(e.percentage*p.area) desc";
@@ -187,6 +187,23 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// </summary>
         /// <returns></returns>
         public DataTable GetParticleAll(string fieldAndPartic)
+        {
+            string sqlp = @"select * from INcAData where typeid !=-1 and typeid !=4";
+            if (fieldAndPartic != "")
+            {
+                sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
+            }
+            DataTable DT = dbHelper.ExecuteDataTable(sqlp, null);
+            for (int i = 0; i < DT.Rows.Count; i++)
+            {
+                DT.Rows[i]["Area"] = Math.Sqrt((double)DT.Rows[i]["Area"] / Math.PI) * 2;
+            }
+
+
+            return DT;
+        }
+
+        public DataTable GetParticleAllforparticlelist(string fieldAndPartic)
         {
             string sqlp = @"select * from INcAData";
             if (fieldAndPartic != "")
@@ -229,11 +246,11 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// <returns></returns>
         public DataTable GetParticleAllHaveXray(string fieldAndPartic)
         {
-            string incaSql = @"select * from IncAData";
+            string incaSql = @"select * from IncAData where typeid !=-1 and typeid !=4";
 
             if (fieldAndPartic != "")
             {
-                incaSql = incaSql + " where '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
+                incaSql = incaSql + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
             }
             DataTable incaDT = dbHelper.ExecuteDataTable(incaSql, null);
 
@@ -310,10 +327,10 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// <returns></returns>
         public DataTable GetAreaByAllIncA(string fieldAndPartic)
         {
-            string sqlp = @"select TypeId,TypeName,sum(area) as ar,count(1) as con ,GroupName from INcAData";
+            string sqlp = @"select TypeId,TypeName,sum(area) as ar,count(1) as con ,GroupName from INcAData where typeid !=-1 and typeid !=4";
             if (fieldAndPartic != "")
             {
-                sqlp = sqlp + " where '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
+                sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
             }
             sqlp = sqlp + "  group by TypeId";
 
@@ -571,7 +588,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
 
         public DataTable GetInfoForPartucleDevidePage_analyticalParticle(string condition)
         {
-            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1  and typeid !=9 and typeid !=-1 and typeid !=0" +
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1  and typeid !=9 and typeid !=-1 and typeid !=4" +
                 condition;
             DataTable DT = new DataTable();
             DT = dbHelper.ExecuteQuery(sqliteString);
@@ -581,7 +598,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
 
         public DataTable GetInfoForPartucleDevidePage_otherParticle(string condition)
         {
-            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1  and (typeid =9 or typeid =-1 or typeid =0) " +
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as Element from INcAData where typeid =9 or typeid =-1 or typeid =4 " +
                 condition;
             DataTable DT = new DataTable();
             DT = dbHelper.ExecuteQuery(sqliteString);