Bläddra i källkod

Merge branch 'Release2.3' into dev

gsp 4 år sedan
förälder
incheckning
363b842297

+ 1 - 1
Bin/x64/Debug/Config/ProData/ReportTemplateConfig.xml

@@ -88,7 +88,7 @@
       <YS7>Mn</YS7>
     </list_str_tb_lllb_sxys>
     <b_ck_kllb_ystx>True</b_ck_kllb_ystx>
-    <b_ck_kllb_fdtx>True</b_ck_kllb_fdtx>
+    <b_ck_kllb_fdtx>False</b_ck_kllb_fdtx>
     <b_ck_kllb_npxx>True</b_ck_kllb_npxx>
   </M_KLLBXX>
   <M_address>

+ 17 - 0
OTSCPP/OTSData/XMLSerialization.cpp

@@ -493,7 +493,24 @@ namespace xmls
 		if (pos1 != s.length())
 			v.push_back(s.substr(pos1));
 	}
+	std::vector<std::string> SplitString(const std::string& s,  const std::string& c)
+	{
+		std::string::size_type pos1, pos2;
+		pos2 = s.find(c);
+		pos1 = 0;
+		std::vector<std::string> v;
+		while (std::string::npos != pos2)
+		{
+			v.push_back(s.substr(pos1, pos2 - pos1));
 
+			pos1 = pos2 + c.size();
+			pos2 = s.find(c, pos1);
+		}
+		if (pos1 != s.length())
+			v.push_back(s.substr(pos1));
+
+		return v;
+	}
 	void ReplaceAll(std::string& content, std::string searchFor, std::string replaceWith)
 	{
 		if (searchFor.empty())

+ 1 - 0
OTSCPP/OTSData/XMLSerialization.h

@@ -309,6 +309,7 @@ serializable Point
 		void Clear();
 	};
 	void __declspec(dllexport) SplitString(const std::string& s, std::vector<std::string>& v, const std::string& c);
+	std::vector<std::string>  __declspec(dllexport) SplitString(const std::string& s, const std::string& c);
 	void __declspec(dllexport) ReplaceAll(std::string& content, std::string searchFor, std::string replaceWith);
 	void __declspec(dllexport) ReplaceFirst(std::string& content, std::string searchFor, std::string replaceWith);
 

+ 2 - 0
OTSCPP/OTSData/otsdataconst.h

@@ -116,6 +116,8 @@ namespace OTSDATA
 		TimeMode = 3,
 		MAX = 3
 	} OTS_MEASURE_STOP_MODE;
+
+
 	typedef enum class __declspec(dllexport) OTS_MEASURE_FIELD_STOP_MODE
 	{
 		INVALID = -1,

+ 12 - 11
OTSCPP/OTSImagePro/OTSImageScanParam.cpp

@@ -1,5 +1,6 @@
 #include "stdafx.h"
 #include "OTSImageScanParam.h"
+#include <XMLSerialization.h>
 
 
 namespace OTSIMGPROC
@@ -84,13 +85,13 @@ namespace OTSIMGPROC
 
 	void COTSImageScanParam::Serialize(bool isStoring, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode)
 	{
-		xmls::xInt xnStopMode;
+		xmls::xString xnStopMode;
 		xmls::xInt xnStopParamMeasTime;
 		xmls::xInt xnStopParamFields;
 		xmls::xInt xnStopParamParticles;
-		xmls::xInt xnSatrtImageMode;
-		xmls::xInt xnScanImageSpeed;
-		xmls::xInt xnImagePixelSize;
+		xmls::xString xnSatrtImageMode;
+		xmls::xString xnScanImageSpeed;
+		xmls::xString xnImageResolution;
 
 
 		xmls::Slo slo;
@@ -101,12 +102,12 @@ namespace OTSIMGPROC
 		slo.Register("StopParamParticles", &xnStopParamParticles);
 		slo.Register("SatrtImageMode", &xnSatrtImageMode);
 		slo.Register("ScanImageSpeed", &xnScanImageSpeed);
-		slo.Register("ImagePixelSize", &xnImagePixelSize);
+		slo.Register("ImageResolution", &xnImageResolution);
 	
 
 		if (isStoring)
 		{
-			xnStopMode = (int)m_nStopMode;
+			/*xnStopMode = std::to_string((int)m_nStopMode);
 			xnStopParamMeasTime = m_nStopParamMeasTime;
 			xnStopParamFields = m_nStopParamFields;
 			xnStopParamParticles = m_nStopParamParticles;
@@ -115,18 +116,18 @@ namespace OTSIMGPROC
 			xnImagePixelSize = (int)m_nImagePixelSize;
 	
 
-			slo.Serialize(true, classDoc, rootNode);
+			slo.Serialize(true, classDoc, rootNode);*/
 		}
 		else
 		{
 			slo.Serialize(false, classDoc, rootNode);
 
-			m_nStopMode = (OTS_MEASURE_STOP_MODE)xnStopMode.value();
+			m_nStopMode = (OTS_MEASURE_STOP_MODE)stoi(xmls::SplitString(xnStopMode.value(),":")[0]);
 			m_nStopParamMeasTime = xnStopParamMeasTime.value();
 			m_nStopParamFields = xnStopParamFields.value();
-			m_nSatrtImageMode = (OTS_GET_IMAGE_MODE)xnSatrtImageMode.value();
-			m_nScanImageSpeed = (OTS_THREE_TIES_OPTIONS)xnScanImageSpeed.value();
-			m_nImagePixelSize = (OTS_FIVE_TIES_OPTIONS)xnImagePixelSize.value();
+			m_nSatrtImageMode = (OTS_GET_IMAGE_MODE)stoi(xmls::SplitString(xnSatrtImageMode.value(),":")[0]);
+			m_nScanImageSpeed = (OTS_THREE_TIES_OPTIONS)stoi(xmls::SplitString(xnScanImageSpeed.value(),":")[0]);
+			m_nImagePixelSize = (OTS_FIVE_TIES_OPTIONS)stoi(xmls::SplitString(xnImageResolution.value(), ":")[0]);
 
 		}
 

+ 6 - 6
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSImageProcParam.cs

@@ -108,18 +108,18 @@ namespace OTSDataType
 
             if (isStoring)
             {
-               
-                xnBGRemoveType.AssignValue(m_BGRemoveType.ToString());
-                xnautoBGRemoveType.AssignValue(m_autoBGRemoveType.ToString());
+
+                xnBGRemoveType.AssignValue((int)m_BGRemoveType+":"+m_BGRemoveType.ToString());
+                xnautoBGRemoveType.AssignValue((int)m_autoBGRemoveType+":"+m_autoBGRemoveType.ToString());
                 slo.Serialize(true, classDoc, rootNode);
             }
             else
             {
                 slo.Serialize(false, classDoc, rootNode);
                 //自动去背景设置
-                m_BGRemoveType = (OTS_BGREMOVE_TYPE)Enum.Parse(typeof(OTS_BGREMOVE_TYPE),xnBGRemoveType.value()) ;
-                m_autoBGRemoveType = (OTS_AUTOBGREMOVE_TYPE)Enum.Parse(typeof(OTS_AUTOBGREMOVE_TYPE),xnautoBGRemoveType.value());
-              
+                m_BGRemoveType = (OTS_BGREMOVE_TYPE)Convert.ToInt32( xnBGRemoveType.value().Split(':')[0]);
+                m_autoBGRemoveType = (OTS_AUTOBGREMOVE_TYPE)Convert.ToInt32( xnautoBGRemoveType.value().Split(':')[0]);
+
             }
         }
     }

+ 11 - 11
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSImageScanParam.cs

@@ -203,15 +203,15 @@ namespace OTSDataType
 
             if (isStoring)
             {
-                xnStopMode.AssignValue(m_nStopMode.ToString());
+                xnStopMode.AssignValue((int)m_nStopMode+":"+m_nStopMode.ToString());//
                 xnStopParamMeasTime.AssignValue( m_nStopParamMeasTime);
                 xnStopParamFields.AssignValue(m_nStopParamFields);
                 xnStopParamParticles.AssignValue(m_nStopParamParticles);
-                xnSatrtImageMode.AssignValue(m_nSatrtImageMode.ToString());
-                xnScanImageSpeed.AssignValue( m_nScanImageSpeed.ToString());
-                xnImageSize.AssignValue( m_nImageResulotion.ToString());
+                xnSatrtImageMode.AssignValue((int)m_nSatrtImageMode+":"+m_nSatrtImageMode.ToString());
+                xnScanImageSpeed.AssignValue((int)m_nScanImageSpeed+":"+ m_nScanImageSpeed.ToString());
+                xnImageSize.AssignValue( (int)m_nImageResulotion+":"+m_nImageResulotion.ToString());
 
-                xnFieldStopMode.AssignValue(m_nFieldStopMode.ToString());
+                xnFieldStopMode.AssignValue((int)m_nFieldStopMode+":"+m_nFieldStopMode.ToString());
                 xnFieldSmallParticles.AssignValue(m_nFieldSmallParticles);
                 xnFieldSmallParticlePercentage .AssignValue(m_nFieldSmallParticlesPercentage);
 
@@ -223,22 +223,22 @@ namespace OTSDataType
             {
                 slo.Serialize(false, classDoc, rootNode);
 
-                m_nStopMode =(OTS_MEASURE_STOP_MODE)Enum.Parse(typeof(OTS_MEASURE_STOP_MODE), xnStopMode.value());
+                m_nStopMode = (OTS_MEASURE_STOP_MODE)Convert.ToInt32(xnStopMode.value().Split(':')[0]);
                 m_nStopParamMeasTime = xnStopParamMeasTime.value();
                 m_nStopParamFields = xnStopParamFields.value();
                 m_nStopParamParticles = xnStopParamParticles.value();
-                m_nSatrtImageMode = (OTS_GET_IMAGE_MODE)Enum.Parse(typeof(OTS_GET_IMAGE_MODE), xnSatrtImageMode.value());
-                m_nScanImageSpeed = (OTS_IMAGE_SCANSPEED_OPTIONS)Enum.Parse(typeof(OTS_IMAGE_SCANSPEED_OPTIONS), xnScanImageSpeed.value());
-                m_nImageResulotion = (OTS_IMAGE_RESULOTION_OPTIONS)Enum.Parse(typeof(OTS_IMAGE_RESULOTION_OPTIONS), xnImageSize.value());
+                m_nSatrtImageMode = (OTS_GET_IMAGE_MODE)Convert.ToInt32(xnSatrtImageMode.value().Split(':')[0]);
+                m_nScanImageSpeed = (OTS_IMAGE_SCANSPEED_OPTIONS)Convert.ToInt32(xnScanImageSpeed.value().Split(':')[0]);
+                m_nImageResulotion = (OTS_IMAGE_RESULOTION_OPTIONS)Convert.ToInt32(xnImageSize.value().Split(':')[0]);
 
-                m_nFieldStopMode = (OTS_MEASURE_FIELD_STOP_MODE)Enum.Parse(typeof(OTS_MEASURE_FIELD_STOP_MODE),xnFieldStopMode.value());
+                m_nFieldStopMode = (OTS_MEASURE_FIELD_STOP_MODE)Convert.ToInt32(xnFieldStopMode.value().Split(':')[0]);
                 m_nFieldAreaPercentage = xnFieldAreaPercentage.value();
                 m_nFieldLargeParticles = xnFieldLargeParticles.value();
                 m_nFieldLargeParticlesPercentage = xnFieldLargeParticlePercentage.value();
                 m_nFieldSmallParticles = xnFieldSmallParticles.value();
                 m_nFieldSmallParticlesPercentage = xnFieldSmallParticlePercentage.value();
 
-              
+
             }
         }
 

+ 2 - 2
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSXRayParam.cs

@@ -166,7 +166,7 @@ namespace OTSDataType
 
             if (isStoring)
             {
-                xnScanMode.AssignValue(m_nScanMode.ToString());
+                xnScanMode.AssignValue((int)m_nScanMode+":"+m_nScanMode.ToString());
     
                 xnAnalyExpCount.AssignValue(m_nAnalyExpCount);
             
@@ -179,7 +179,7 @@ namespace OTSDataType
             {
                 slo.Serialize(false, classDoc, rootNode);
 
-                m_nScanMode = (OTS_X_RAY_SCAN_MODE)Enum.Parse(typeof(OTS_X_RAY_SCAN_MODE),xnScanMode.value());
+                m_nScanMode = (OTS_X_RAY_SCAN_MODE)Convert.ToInt32( xnScanMode.value().Split(':')[0]);
          
                 m_nAnalyExpCount = xnAnalyExpCount.value();
              

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

@@ -89,7 +89,7 @@ namespace OTSDataType
                 xstrName.AssignValue(m_strName);
                 xSteelTech.AssignValue((int)m_SteelTech);
                 xstrSTDName.AssignValue(m_strSTDName);
-                xSystype.AssignValue(m_nPackId.ToString());
+                xSystype.AssignValue((int)m_nPackId+":"+m_nPackId.ToString());
                 slo.Serialize(true, classDoc, rootNode);
             }
             else

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

@@ -282,8 +282,8 @@ namespace OTSDataType
             if (isStoring)
             {
                 xscanFieldSize100.AssignValue(m_nScanFieldSize100);
-                xbXAxisDir.AssignValue(m_bXAxisDir.ToString());
-                xbYAxisDir.AssignValue(m_bYAxisDir.ToString());
+                xbXAxisDir.AssignValue((int)m_bXAxisDir + ":" + m_bXAxisDir.ToString());
+                xbYAxisDir.AssignValue((int)m_bYAxisDir + ":" + m_bYAxisDir.ToString());
                 xMinMag.AssignValue(m_dMinMag);
 
                 slo.Serialize(true, classDoc, rootNode);
@@ -292,8 +292,8 @@ namespace OTSDataType
             {
                 slo.Serialize(false, classDoc, rootNode);
                 m_nScanFieldSize100 = xscanFieldSize100.value();
-                m_bXAxisDir = (OTS_X_AXIS_DIRECTION)Enum.Parse(typeof(OTS_X_AXIS_DIRECTION),xbXAxisDir.value());
-                m_bYAxisDir = (OTS_Y_AXIS_DIRECTION)Enum.Parse(typeof(OTS_Y_AXIS_DIRECTION),xbYAxisDir.value());
+                m_bXAxisDir = (OTS_X_AXIS_DIRECTION)Convert.ToInt32( xbXAxisDir.value().Split(':')[0]);
+                m_bYAxisDir = (OTS_Y_AXIS_DIRECTION)Convert.ToInt32( xbYAxisDir.value().Split(':')[0]);
                 m_dMinMag = xMinMag.value();
             }
         }

+ 7 - 8
OTSIncAReportApp/1-UI/Control_Grids/CompositionDistributionGrid.cs

@@ -123,6 +123,7 @@ namespace OTSIncAReportGrids
                     if(!selectNameGroup.ContainsKey(selectParticles[i].TypeId))
                     {
                         List<OTSIncAReportApp.DataOperation.Model.Particle> particles = new List<OTSIncAReportApp.DataOperation.Model.Particle>();
+                        particles.Add(selectParticles[i]);
                         selectNameGroup.Add(selectParticles[i].TypeId, particles);
                     }
                     else
@@ -131,7 +132,7 @@ namespace OTSIncAReportGrids
                     }
                 }
 
-                double particlesCount = 0, areaSum = 0,avg = 0,max = 0;
+                double areaSum = 0,avg = 0,max = 0;
                 DataTable dtUelect = new DataTable();
                 dtUelect.Columns.Add("typeid");
                 dtUelect.Columns.Add("TypeName");
@@ -142,8 +143,7 @@ namespace OTSIncAReportGrids
                 dtUelect.Columns.Add("max");
                 foreach (KeyValuePair<int, List<OTSIncAReportApp.DataOperation.Model.Particle>> kv in selectNameGroup)
                 {
-                    particlesCount = areaSum = avg = max = 0;
-                    particlesCount = kv.Value.Count;
+                    areaSum = avg = max = 0;
                     for(int i=0;i< kv.Value.Count;i++)
                     {
                         areaSum += kv.Value[i].Area;
@@ -179,12 +179,11 @@ namespace OTSIncAReportGrids
                                 break;
                         }
                     }
-                    avg = avg / particlesCount;
-                    dtUelect.Rows.Add(kv.Key, kv.Value[0].TypeName, kv.Value[0].TypeColor, kv.Value[0].TypeName, areaSum, avg, max);
+                    avg = avg / kv.Value.Count;
+                    dtUelect.Rows.Add(kv.Key, kv.Value[0].TypeName, kv.Value[0].TypeColor, kv.Value.Count, areaSum, avg, max);
                 }
-
                 totalArea = OTSIncAReportApp.frmReportApp.selectedRegion.Width * OTSIncAReportApp.frmReportApp.selectedRegion.Height;
-                dt = dtUelect.Clone();
+                dt = dtUelect.Copy();
             }
             else
             {
@@ -304,7 +303,7 @@ namespace OTSIncAReportGrids
                         }
                         else
                         { 
-                            gridView.Rows[add_rowindex].Cells[k].Value = Math.Round((double)(dt.Rows[i]["Area"]) * 100/ totalArea, 5); 
+                            gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Convert.ToDouble(dt.Rows[i]["Area"]) * 100/ totalArea, 5); 
                         }
                         gridView.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
 

+ 17 - 4
OTSIncAReportApp/1-UI/Control_Grids/ElementCompositionAvgGrid.cs

@@ -59,8 +59,9 @@ namespace OTSIncAReportGrids
             List<string> NameList = new List<string>() { table["partcletype0"].ToString(), table["partcletype1"].ToString(), table["partcletype2"].ToString(), table["partcletype4"].ToString(), table["partcletype6"].ToString(), table["partcletype7"].ToString(), table["partcletype8"].ToString(), table["partcletype9"].ToString() };
 
             //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
-            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropIndexByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             string filedAndParticl = "";
+            DataTable dt;
             if (sel == 1)
             {
                 List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
@@ -72,8 +73,20 @@ namespace OTSIncAReportGrids
                 {
                     filedAndParticl = filedAndParticl + ",";
                 }
+                if (selectParticles.Count == 0)
+                {
+                    dt = new DataTable();
+                }
+                else
+                {
+                    dt = particledata.GetAreaByAllIncA(filedAndParticl);
+                }
+            }
+            else
+            {
+                dt = particledata.GetAreaByAllIncA(filedAndParticl);
             }
-            DataTable dt = particledata.GetAreaByAllIncA(filedAndParticl);
+             
 
             for (int i = 0; i < dt.Rows.Count; i++)
             {
@@ -141,8 +154,8 @@ namespace OTSIncAReportGrids
                 Gview_gz.Rows[add_rowindex].Cells[2].Style.BackColor = Color.Azure;
                 //Gview_gz.Rows[add_rowindex].Cells[3].Value = Math.Round(small, 2);
                 Gview_gz.Rows[add_rowindex].Cells[3].Style.BackColor = Color.Azure;
-                Gview_gz.Rows[add_rowindex].Cells[4].Value = dt.Rows[i]["con"];
-                Gview_gz.Rows[add_rowindex].Cells[4].Style.BackColor = Color.Azure;
+                Gview_gz.Rows[add_rowindex].Cells[3].Value = dt.Rows[i]["con"];
+                //Gview_gz.Rows[add_rowindex].Cells[4].Style.BackColor = Color.Azure;
                 DataTable dtp = particledata.GetAreaByIncA(dt.Rows[i]["TypeId"].ToString(), filedAndParticl);
                 for (int j = 4; j < Gview_gz.Columns.Count; j++)
                 {

+ 21 - 17
OTSIncAReportApp/1-UI/Control_Grids/ElementContentGrid.cs

@@ -52,8 +52,7 @@ namespace OTSIncAReportGrids
                 gridView.Columns[i].DefaultCellStyle.NullValue = null;
             }
 
-            //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
-            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropIndexByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             string filedAndParticle = "";
             if (sel == 1)
             {
@@ -66,25 +65,30 @@ namespace OTSIncAReportGrids
                 {
                     filedAndParticle = filedAndParticle + ",";
                 }
-            }
 
-            if (filedAndParticle != "")
-            {
-                DataTable dt = particledata.GetElementForArea(filedAndParticle);
-                double totalArea = 0;
-                foreach (DataRow item in dt.Rows)
+
+                if (filedAndParticle != "")
                 {
-                    totalArea += Convert.ToDouble(item["earea"]);
+                    DataTable dt = particledata.GetElementForArea(filedAndParticle);
+                    double totalArea = 0;
+                    foreach (DataRow item in dt.Rows)
+                    {
+                        totalArea += Convert.ToDouble(item["earea"]);
+                    }
+                    for (int i = 0; i < dt.Rows.Count; i++)
+                    {
+                        int add_rowindex = gridView.Rows.Add();
+                        gridView.Rows[i].Cells[0].Value = (i + 1).ToString();
+                        gridView.Rows[i].Cells[1].Value = dt.Rows[i]["name"];
+                        double d = Convert.ToDouble(dt.Rows[i]["earea"]) / totalArea;
+                        gridView.Rows[i].Cells[2].Value = Math.Round(d, 6) * 100;
+                        gridView.Rows[i].Cells[1].Style.BackColor = Color.Azure;
+                        gridView.Rows[i].Cells[2].Style.BackColor = Color.Azure;
+                    }
                 }
-                for (int i = 0; i < dt.Rows.Count; i++)
+                else
                 {
-                    int add_rowindex = gridView.Rows.Add();
-                    gridView.Rows[i].Cells[0].Value = (i + 1).ToString();
-                    gridView.Rows[i].Cells[1].Value = dt.Rows[i]["name"];
-                    double d = Convert.ToDouble(dt.Rows[i]["earea"]) / totalArea;
-                    gridView.Rows[i].Cells[2].Value = Math.Round(d, 6) * 100;
-                    gridView.Rows[i].Cells[1].Style.BackColor = Color.Azure;
-                    gridView.Rows[i].Cells[2].Style.BackColor = Color.Azure;
+
                 }
             }
             else

+ 50 - 4
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

@@ -205,11 +205,57 @@ namespace OTSIncAReportGrids
         #region 自定义方法
         void UpdateTable()
         {
-            //多次测试发现 读取数据库时间耗时长,但读取条数目对读取数据库时长影响不大,故此处直接读取所有数据库信息,以取代多次连接数据库方式,优化分页速度
-            particlesAll = new DataTable();
-            particlesAll = Particledata.GetInfoForPartucleDevidePage2(condition);
+            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+            if (sel == 1)
+            {
+                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
+                DataTable dtUelect = new DataTable();
+                dtUelect.Columns.Add("fieldid");
+                dtUelect.Columns.Add("particleid");
+                dtUelect.Columns.Add("AveGray");
+                dtUelect.Columns.Add("RectLeft");
+                dtUelect.Columns.Add("RectTop");
+                dtUelect.Columns.Add("RectWidth");
+                dtUelect.Columns.Add("RectHeight");
+                dtUelect.Columns.Add("Area");
+                dtUelect.Columns.Add("PosX");
+                dtUelect.Columns.Add("PosY");
+                dtUelect.Columns.Add("TypeId");
+                dtUelect.Columns.Add("ElementNum");
+                dtUelect.Columns.Add("SegmentNum");
+                dtUelect.Columns.Add("SEMPosX");
+                dtUelect.Columns.Add("SEMPosY");
+                dtUelect.Columns.Add("XrayId");
+                dtUelect.Columns.Add("DMAX");
+                dtUelect.Columns.Add("DMIN");
+                dtUelect.Columns.Add("DPERP");
+                dtUelect.Columns.Add("PERIMETER");
+                dtUelect.Columns.Add("ORIENTATION");
+                dtUelect.Columns.Add("DINSCR");
+                dtUelect.Columns.Add("DMEAN");
+                dtUelect.Columns.Add("DELONG");
+                dtUelect.Columns.Add("DFERET");
+                dtUelect.Columns.Add("TypeName");
+                dtUelect.Columns.Add("TypeColor");
+                dtUelect.Columns.Add("SubParticles");
+                dtUelect.Columns.Add("Element");
+                for(int i=0;i< selectParticles.Count;i++)
+                {
+                    dtUelect.Rows.Add(selectParticles[i].FieldId, selectParticles[i].ParticleId, selectParticles[i].AveGray, selectParticles[i].RectLeft, selectParticles[i].RectTop, selectParticles[i].RectWidth, selectParticles[i].RectHeight, selectParticles[i].Area, selectParticles[i].PosX, selectParticles[i].PosX, selectParticles[i].TypeId, selectParticles[i].ElementNum, selectParticles[i].SegmentNum, selectParticles[i].SEMPosX, selectParticles[i].SEMPosY, selectParticles[i].ParticleId, selectParticles[i].DMAX, selectParticles[i].DMIN, selectParticles[i].DPERP, selectParticles[i].PERIMETER, selectParticles[i].ORIENTATION, selectParticles[i].DINSCR, selectParticles[i].DMEAN, selectParticles[i].DELONG, selectParticles[i].FERET, selectParticles[i].TypeName, selectParticles[i].TypeColor, "", "");
+                 }
+                particlesAll = new DataTable();
+                particlesAll = dtUelect.Copy();
+                btn_Sel.Enabled = false;
+            }
+            else
+            {
+                //多次测试发现 读取数据库时间耗时长,但读取条数目对读取数据库时长影响不大,故此处直接读取所有数据库信息,以取代多次连接数据库方式,优化分页速度
+                particlesAll = new DataTable();
+                particlesAll = Particledata.GetInfoForPartucleDevidePage2(condition);
+                btn_Sel.Enabled = true;
+            }
+                
             DataTable elementchemistry = Particledata.GetElementChemistry();
-
             for (int i = 0; i < particlesAll.Rows.Count; i++)
             {
                 string str = "XRayId = " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();

+ 16 - 2
OTSIncAReportApp/1-UI/Control_Grids/ParticlesSizeGrid.cs

@@ -87,8 +87,9 @@ namespace OTSIncAReportGrids
 
             //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
             //int sel = m_ReportApp.SourceGridData.ConditionItemList[idx].comboDownList.IndexOf(m_ReportApp.SourceGridData.ConditionItemList[idx].itemVal.ToString());
-           int sel= source.GetComboDownListIndexByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
+            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             string filedAndParticl = "";
+            DataTable dt;
             if (sel == 1)
             {
                 List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
@@ -100,10 +101,23 @@ namespace OTSIncAReportGrids
                 {
                     filedAndParticl = filedAndParticl + ",";
                 }
+                if(selectParticles.Count == 0)
+                {
+                    dt = new DataTable();
+                }
+                else
+                {
+                    dt = particledata.GetParticleListForParticlSize("area", filedAndParticl);
+                }
+            }
+            else
+            {
+                dt = particledata.GetParticleListForParticlSize("area", filedAndParticl);
             }
             gridView.MergeColumnNames.Add(filename);
             gridView.AddSpanHeader(1, gridView.Columns.Count - 1, filename);
-            DataTable dt = particledata.GetParticleListForParticlSize("area", filedAndParticl);
+
+            
 
             for (int i = 0; i < dt.Rows.Count; i++)
             {

+ 29 - 9
OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/frmReportConditionChoose.cs

@@ -385,13 +385,11 @@ namespace OTSIncAReportApp
                 sampleData = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE];
                 list.Add(sampleData);
 
-               var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
-                list.Add(sampleData1);
 
                 //数据表类型
-
                 var sampleData3 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE];
-                list.Add(sampleData3);
+                //list.Add(sampleData3);
+                
                 if ((int)sampleData3.itemVal == (int)CALCULATE_TABLE_TYPE.PARTICALE_SIZE_DISTRIBUTION )
                 {
                     //粒级表
@@ -400,22 +398,44 @@ namespace OTSIncAReportApp
                     list.Add(sampleData_partsizefile);
 
                     //尺寸计算方法
-
-
                     var sampleData5 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE];
                     list.Add(sampleData5);
+
+                    var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
+                    //list.Add(sampleData1);
+                    list.Insert(1, sampleData1);
                 }
                 if ((int)sampleData3.itemVal == (int)CALCULATE_TABLE_TYPE.PARTICALE_COMP)
                 {
                     //尺寸计算方法
-
-
                     var sampleData5 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE];
                     list.Add(sampleData5);
 
+                    var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
+                    //list.Add(sampleData1);
+                    list.Insert(1, sampleData1);
                 }
 
-                
+                if ((int)sampleData3.itemVal == (int)CALCULATE_TABLE_TYPE.PARTICALE_GENE_INFO)
+                {
+                    var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
+                    //list.Add(sampleData1);
+                    list.Insert(1, sampleData1);
+                }
+                if ((int)sampleData3.itemVal == (int)CALCULATE_TABLE_TYPE.AVE_ELEMENT_COMP)
+                {
+                    var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
+                    //list.Add(sampleData1);
+                    list.Insert(1, sampleData1);
+                }
+                if ((int)sampleData3.itemVal == (int)CALCULATE_TABLE_TYPE.ELEMENT_COMP)
+                {
+                    var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
+                    //list.Add(sampleData1);
+                    list.Insert(1, sampleData1);
+                }
+                list.Add(sampleData3);
+              
             }
             else if (tbindex == DisplayPicutureType.AnalyzeDataChart)//Chart图页
             {

+ 1 - 1
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.cs

@@ -750,7 +750,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     list_str = m_OTSReport_Export.m_ReportApp.m_rstDataMgr.GetPartSizeFileList();
                     break;
                 case OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE://数据类型,全部颗粒,分析颗粒
-                    //list_str = m_OTSReport_Export.m_ReportApp.m_DataMgrFun.GetDataSourceTypeList();
+                    list_str = m_OTSReport_Export.m_ReportApp.m_rstDataMgr.ParticleRange();
                     break;
                 case OTS_REPORT_PROP_GRID_ITEMS.TRIO_CHART_TYPE://三元相图模板
                     list_str = m_OTSReport_Export.m_ReportApp.m_rstDataMgr.GetTriTemplateNameList();

+ 1 - 9
OTSIncAReportApp/1-UI/frmReportApp.cs

@@ -279,10 +279,7 @@ namespace OTSIncAReportApp
             //树窗口
             m_RstWindow = new frmMeasureRstMgr(this);
             //属性窗口
-            m_conditionChoose = new frmReportConditionChoose(this);
-
-          
-
+            //m_conditionChoose = new frmReportConditionChoose(this);
 
             //分布图,排列图窗体
             m_SImageWindow = new frmSampleImage(this);
@@ -290,11 +287,6 @@ namespace OTSIncAReportApp
             m_ChartsWindow = new frmCharts(this);
             //grid表格窗体
             m_TablesWindow = new frmTables(this);
-          
-
-            
-            
-            
             
             
             SetTag();

+ 5 - 1
OTSIncAReportApp/2-CommonFunction/OTSDataMgrFunction/ResultDataMgr.cs

@@ -259,7 +259,11 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
             List<string> ret_list = new List<string>() { "DMAX", "DMIN", "CIRCLE", "FERET" };
             return ret_list;
         }
-
+        public List<string> ParticleRange()
+        {
+            List<string> pr_str = new List<string>() { "全部颗粒","选择颗粒" };
+            return pr_str;
+        }
 
 
         #endregion

+ 1 - 1
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -386,7 +386,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         }
         public DataTable GetInfoForPartucleDevidePage2(string condition)
         {
-            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,ElementNum,SegmentNum,FieldPosX as 'SEMPosX',FieldPosY as 'SEMPosY',ParticleId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,SubParticles, (select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = MergedParticleInfo.XRayId and fieldid = MergedParticleInfo.fieldid) as Element from MergedParticleInfo where 1=1 " + condition + " union select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,ElementNum,SegmentNum,FieldPosX,FieldPosY,ParticleId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as SubParticles,'' as Element from INcAData where xrayid > -1 and instr(','||(select ifnull(group_concat(SubParticles, ','),'') from MergedParticleInfo)|| ',',',' || fieldid || ':' || particleid || ',')= 0 " + condition;
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,ElementNum,SegmentNum,FieldPosX as 'SEMPosX',FieldPosY as 'SEMPosY',XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,SubParticles, (select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = MergedParticleInfo.XRayId and fieldid = MergedParticleInfo.fieldid) as Element from MergedParticleInfo where 1=1 " + condition + " union select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,ElementNum,SegmentNum,FieldPosX,FieldPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as SubParticles,'' as Element from INcAData where xrayid > -1 and instr(','||(select ifnull(group_concat(SubParticles, ','),'') from MergedParticleInfo)|| ',',',' || fieldid || ':' || particleid || ',')= 0 " + condition;
             DataTable DT = new DataTable();
             DT = dbHelper.ExecuteQuery(sqliteString);
             return DT;