|
@@ -18,7 +18,15 @@ namespace OTSIncAReportGrids
|
|
|
#region 设置变量
|
|
|
//设置模拟数据表
|
|
|
public DataTable m_dt = new DataTable();
|
|
|
+ DataTable SelectParticlesListConvertToTable(List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles)
|
|
|
+ {
|
|
|
+ DataTable dataTable = new DataTable();
|
|
|
+
|
|
|
+
|
|
|
|
|
|
+
|
|
|
+ return dataTable;
|
|
|
+ }
|
|
|
//国际化
|
|
|
Language lan;
|
|
|
Hashtable table;
|
|
@@ -36,7 +44,9 @@ namespace OTSIncAReportGrids
|
|
|
/// </summary>
|
|
|
public void BindDataGridView(string path, int num, string filename)
|
|
|
{
|
|
|
-
|
|
|
+ List<int> FLID = new List<int>() { 0, 1, 2, 4, 6, 7, 8, 9 };
|
|
|
+ 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() };
|
|
|
+ DataTable dt;
|
|
|
OTSGridView gridView = new OTSGridView();
|
|
|
|
|
|
OTSIncAReportApp.DataOperation.DataAccess.ParticleData particledata = new OTSIncAReportApp.DataOperation.DataAccess.ParticleData(path);
|
|
@@ -97,35 +107,97 @@ namespace OTSIncAReportGrids
|
|
|
gridView.Columns.Add("max", str7);
|
|
|
break;
|
|
|
}
|
|
|
- double totalarea = 0;
|
|
|
+ double totalArea = 0;
|
|
|
|
|
|
//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(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
|
|
|
- string filedAndParticl = "";
|
|
|
if (sel == 1)
|
|
|
{
|
|
|
List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
|
|
|
- foreach (var item in selectParticles)
|
|
|
+
|
|
|
+
|
|
|
+ Dictionary<int,List<OTSIncAReportApp.DataOperation.Model.Particle>> selectNameGroup = new Dictionary<int, List<OTSIncAReportApp.DataOperation.Model.Particle>>();
|
|
|
+ for(int i=0;i< selectParticles.Count;i++)
|
|
|
{
|
|
|
- filedAndParticl = filedAndParticl + "," + (item.FieldId.ToString() + "-" + item.ParticleId.ToString());
|
|
|
+ if(!selectNameGroup.ContainsKey(selectParticles[i].TypeId))
|
|
|
+ {
|
|
|
+ List<OTSIncAReportApp.DataOperation.Model.Particle> particles = new List<OTSIncAReportApp.DataOperation.Model.Particle>();
|
|
|
+ selectNameGroup.Add(selectParticles[i].TypeId, particles);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ selectNameGroup[selectParticles[i].TypeId].Add(selectParticles[i]);
|
|
|
+ }
|
|
|
}
|
|
|
- if (filedAndParticl != "")
|
|
|
+
|
|
|
+ double particlesCount = 0, areaSum = 0,avg = 0,max = 0;
|
|
|
+ DataTable dtUelect = new DataTable();
|
|
|
+ dtUelect.Columns.Add("typeid");
|
|
|
+ dtUelect.Columns.Add("TypeName");
|
|
|
+ dtUelect.Columns.Add("TypeColor");
|
|
|
+ dtUelect.Columns.Add("con");
|
|
|
+ dtUelect.Columns.Add("Area");
|
|
|
+ dtUelect.Columns.Add("av");
|
|
|
+ dtUelect.Columns.Add("max");
|
|
|
+ foreach (KeyValuePair<int, List<OTSIncAReportApp.DataOperation.Model.Particle>> kv in selectNameGroup)
|
|
|
{
|
|
|
- filedAndParticl = filedAndParticl + ",";
|
|
|
+ particlesCount = areaSum = avg = max = 0;
|
|
|
+ particlesCount = kv.Value.Count;
|
|
|
+ for(int i=0;i< kv.Value.Count;i++)
|
|
|
+ {
|
|
|
+ areaSum += kv.Value[i].Area;
|
|
|
+ switch (con)
|
|
|
+ {
|
|
|
+ case "DMAX":
|
|
|
+ avg += kv.Value[i].DMAX;
|
|
|
+ if(kv.Value[i].DMAX> max)
|
|
|
+ {
|
|
|
+ max = kv.Value[i].DMAX;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "DMIN":
|
|
|
+ avg += kv.Value[i].DMIN;
|
|
|
+ if (kv.Value[i].DMIN > max)
|
|
|
+ {
|
|
|
+ max = kv.Value[i].DMIN;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "CIRCLE":
|
|
|
+ avg += kv.Value[i].Area;
|
|
|
+ if (kv.Value[i].Area > max)
|
|
|
+ {
|
|
|
+ max = kv.Value[i].Area;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "FERET":
|
|
|
+ avg += kv.Value[i].FERET;
|
|
|
+ if (kv.Value[i].FERET > max)
|
|
|
+ {
|
|
|
+ max = kv.Value[i].FERET;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ avg = avg / particlesCount;
|
|
|
+ dtUelect.Rows.Add(kv.Key, kv.Value[0].TypeName, kv.Value[0].TypeColor, kv.Value[0].TypeName, areaSum, avg, max);
|
|
|
}
|
|
|
- totalarea = OTSIncAReportApp.frmReportApp.selectedRegion.Width * OTSIncAReportApp.frmReportApp.selectedRegion.Height;
|
|
|
+
|
|
|
+ totalArea = OTSIncAReportApp.frmReportApp.selectedRegion.Width * OTSIncAReportApp.frmReportApp.selectedRegion.Height;
|
|
|
+ dt = dtUelect.Clone();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- double ScanFieldSize = Convert.ToDouble(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["SEMDataMsr"])["ScanFieldSize"]);
|
|
|
- double ImagePixelSize = Convert.ToDouble(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["MsrParams"])["Members"])["ImageScanParam"])["ImagePixelSize"]);
|
|
|
- int filedCount = Convert.ToInt32(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["SEMDataMsr"])["TotalFields"]);
|
|
|
- totalarea = ScanFieldSize * ScanFieldSize / ImagePixelSize * filedCount;
|
|
|
+ Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"]);
|
|
|
+ Dictionary<string, object> semDataMsr = (Dictionary<string, object>)sampleMembers["SEMDataMsr"];
|
|
|
+ double scanFieldSize = Convert.ToDouble(semDataMsr["ScanFieldSize"]);
|
|
|
+ Dictionary<string, object> imageScanParam = (Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)sampleMembers["MsrParams"])["Members"])["ImageScanParam"];
|
|
|
+ string ImageResolution = imageScanParam["ImageResolution"].ToString();
|
|
|
+ double wide = Convert.ToDouble(ImageResolution.Split('_')[2]);
|
|
|
+ int filedCount = Convert.ToInt32(semDataMsr["TotalFields"]);
|
|
|
+ totalArea = scanFieldSize * wide * filedCount;
|
|
|
+ dt = particledata.GetParticleListByIncA(po);
|
|
|
}
|
|
|
- DataTable dt = particledata.GetParticleListByIncA(po, filedAndParticl);
|
|
|
- List<int> FLID = new List<int>() { 0, 1, 2, 4, 6, 7, 8, 9 };
|
|
|
- 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() };
|
|
|
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
@@ -161,9 +233,18 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
|
gridView.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
|
|
|
}
|
|
|
- else if (gridView.Columns[k].Name.ToLower() == "AreaRadio")
|
|
|
+ else if (gridView.Columns[k].Name.ToLower() == "arearadio")
|
|
|
{
|
|
|
- gridView.Rows[add_rowindex].Cells[k].Value = dt.Rows[i]["Area"].ToString();
|
|
|
+ if (totalArea == 0)
|
|
|
+ {
|
|
|
+ gridView.Rows[add_rowindex].Cells[k].Value = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Convert.ToDouble(dt.Rows[i]["Area"]) * 100 / totalArea, 3);
|
|
|
+ }
|
|
|
+ gridView.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
|
|
|
+
|
|
|
|
|
|
}
|
|
|
else
|
|
@@ -215,6 +296,19 @@ namespace OTSIncAReportGrids
|
|
|
gridView.Rows[add_rowindex].Cells[k].Value = name;
|
|
|
gridView.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
|
|
|
}
|
|
|
+ else if (gridView.Columns[k].Name.ToLower() == "arearadio")
|
|
|
+ {
|
|
|
+ if (totalArea == 0)
|
|
|
+ {
|
|
|
+ gridView.Rows[add_rowindex].Cells[k].Value = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ gridView.Rows[add_rowindex].Cells[k].Value = Math.Round((double)(dt.Rows[i]["Area"]) * 100/ totalArea, 5);
|
|
|
+ }
|
|
|
+ gridView.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
|
|
|
+
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
gridView.Rows[add_rowindex].Cells[k].Value = dt.Rows[i][gridView.Columns[k].Name];
|