|
@@ -15,7 +15,6 @@ using OTSIncAReportGraph.Controls;
|
|
|
using OTSIncAReportGraph.OTSIncAReportGraphFuncation;
|
|
using OTSIncAReportGraph.OTSIncAReportGraphFuncation;
|
|
|
using OTSIncAReportGrids.OTSIncAReportGridsFuncation;
|
|
using OTSIncAReportGrids.OTSIncAReportGridsFuncation;
|
|
|
using OTSIncAReportMailInterface;
|
|
using OTSIncAReportMailInterface;
|
|
|
-using OTSPeriodicTable;
|
|
|
|
|
using System;
|
|
using System;
|
|
|
using System.Collections;
|
|
using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
@@ -78,10 +77,16 @@ namespace OTSIncAReportGrids
|
|
|
DataTable particlesAll;
|
|
DataTable particlesAll;
|
|
|
DataTable particles;
|
|
DataTable particles;
|
|
|
public ParticleData Particledata;
|
|
public ParticleData Particledata;
|
|
|
- UserLibraryData userLibrary;
|
|
|
|
|
- DataTable userLibraryData;
|
|
|
|
|
|
|
+ UserSTDDbData userSTDDb;
|
|
|
|
|
+ DataTable userSTDDbData;
|
|
|
NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
|
|
NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
enum SelItem
|
|
enum SelItem
|
|
|
{
|
|
{
|
|
|
analyticalParticle = 0,
|
|
analyticalParticle = 0,
|
|
@@ -89,7 +94,7 @@ namespace OTSIncAReportGrids
|
|
|
MergeParticles = 2,
|
|
MergeParticles = 2,
|
|
|
allParticles = 3
|
|
allParticles = 3
|
|
|
}
|
|
}
|
|
|
- //ListOfSimilarParticles Form_listOfSimilarParticles;
|
|
|
|
|
|
|
+
|
|
|
#region 分页器相关
|
|
#region 分页器相关
|
|
|
|
|
|
|
|
#region 分页字段和属性
|
|
#region 分页字段和属性
|
|
@@ -225,15 +230,15 @@ namespace OTSIncAReportGrids
|
|
|
var systype = m_ReportApp.m_RptConfigFile.Systype;
|
|
var systype = m_ReportApp.m_RptConfigFile.Systype;
|
|
|
if (systype == OTS_SysType_ID.TCCleannessA || systype == OTS_SysType_ID.BatteryCleannessA)
|
|
if (systype == OTS_SysType_ID.TCCleannessA || systype == OTS_SysType_ID.BatteryCleannessA)
|
|
|
{
|
|
{
|
|
|
- string str_libraryName = result.GetSTDName();
|
|
|
|
|
- userLibrary = new UserLibraryData(str_libraryName, result.FilePath + "\\");
|
|
|
|
|
- if (userLibrary.GetSqlHelper() != null)
|
|
|
|
|
|
|
+ string str_STDDbName = result.GetSTDName();
|
|
|
|
|
+ userSTDDb = new UserSTDDbData(str_STDDbName, result.FilePath + "\\");
|
|
|
|
|
+ if (userSTDDb.GetSqlHelper() != null)
|
|
|
{
|
|
{
|
|
|
- userLibraryData = userLibrary.GetSubAttributeFromDatabase();
|
|
|
|
|
|
|
+ userSTDDbData = userSTDDb.GetSubAttributeFromDatabase();
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- userLibraryData = null;
|
|
|
|
|
|
|
+ userSTDDbData = null;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//初始化底层操作类
|
|
//初始化底层操作类
|
|
@@ -254,7 +259,7 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
}
|
|
|
ProgressStart();//进度条关闭通过cbB_PageSize.SelectedIndex事件
|
|
ProgressStart();//进度条关闭通过cbB_PageSize.SelectedIndex事件
|
|
|
|
|
|
|
|
- if (!UpdateTable())
|
|
|
|
|
|
|
+ if (!UpdateDataGrid())
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -287,27 +292,27 @@ namespace OTSIncAReportGrids
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 自定义方法
|
|
#region 自定义方法
|
|
|
- bool UpdateTable()
|
|
|
|
|
|
|
+ bool UpdateDataGrid()
|
|
|
{
|
|
{
|
|
|
int sel = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
|
|
int sel = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
|
|
|
particlesAll = new DataTable();
|
|
particlesAll = new DataTable();
|
|
|
if (sel == (int)SelItem.analyticalParticle)
|
|
if (sel == (int)SelItem.analyticalParticle)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
- particlesAll = Particledata.GetInfoForPartucleDevidePage_analyticalParticle(condition);
|
|
|
|
|
|
|
+ DataTable particlesAll = Particledata.GetInfoForPartucleDevidePage_analyticalParticle(condition);
|
|
|
DataTable mergeParticles = Particledata.GetInfoForPartucleDevidePage_mergeParticles(condition);
|
|
DataTable mergeParticles = Particledata.GetInfoForPartucleDevidePage_mergeParticles(condition);
|
|
|
if (mergeParticles != null && mergeParticles.Rows.Count > 0)
|
|
if (mergeParticles != null && mergeParticles.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
|
- RemoveMergeParticles(ref particlesAll, mergeParticles);
|
|
|
|
|
|
|
+ Particledata.RemoveMergeParticles(ref particlesAll, mergeParticles);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (sel == (int)SelItem.otherParticles)
|
|
if (sel == (int)SelItem.otherParticles)
|
|
|
{
|
|
{
|
|
|
- particlesAll = Particledata.GetInfoForPartucleDevidePage_otherParticle(condition);
|
|
|
|
|
|
|
+ DataTable particlesAll = Particledata.GetInfoForPartucleDevidePage_otherParticle(condition);
|
|
|
DataTable mergeParticles = Particledata.GetInfoForPartucleDevidePage_mergeParticles(condition);
|
|
DataTable mergeParticles = Particledata.GetInfoForPartucleDevidePage_mergeParticles(condition);
|
|
|
if (mergeParticles != null && mergeParticles.Rows.Count > 0)
|
|
if (mergeParticles != null && mergeParticles.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
|
- RemoveMergeParticles(ref particlesAll, mergeParticles);
|
|
|
|
|
|
|
+ Particledata.RemoveMergeParticles(ref particlesAll, mergeParticles);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (sel == (int)SelItem.MergeParticles)
|
|
if (sel == (int)SelItem.MergeParticles)
|
|
@@ -316,16 +321,21 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
}
|
|
|
if (sel == (int)SelItem.allParticles)
|
|
if (sel == (int)SelItem.allParticles)
|
|
|
{
|
|
{
|
|
|
- particlesAll = Particledata.GetInfoForPartucleDevidePage_allParticles(condition);
|
|
|
|
|
|
|
+ DataTable particlesAll = Particledata.GetInfoForPartucleDevidePage_allParticles(condition);
|
|
|
|
|
+ DataTable mergeParticles = Particledata.GetInfoForPartucleDevidePage_mergeParticles(condition);
|
|
|
|
|
+ if (mergeParticles != null && mergeParticles.Rows.Count > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ Particledata.RemoveMergeParticles(ref particlesAll, mergeParticles);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
particlesAll.Columns.Add("Hardness");
|
|
particlesAll.Columns.Add("Hardness");
|
|
|
particlesAll.Columns.Add("Density");
|
|
particlesAll.Columns.Add("Density");
|
|
|
particlesAll.Columns.Add("Electrical_conductivity");
|
|
particlesAll.Columns.Add("Electrical_conductivity");
|
|
|
- if (userLibraryData != null)
|
|
|
|
|
|
|
+ if (userSTDDbData != null)
|
|
|
{
|
|
{
|
|
|
for (int i = 0; i < particlesAll.Rows.Count; i++)
|
|
for (int i = 0; i < particlesAll.Rows.Count; i++)
|
|
|
{
|
|
{
|
|
|
- DataRow[] dr = userLibraryData.Select("STDId=" + particlesAll.Rows[i]["TypeId"].ToString());
|
|
|
|
|
|
|
+ DataRow[] dr = userSTDDbData.Select("STDId=" + particlesAll.Rows[i]["TypeId"].ToString());
|
|
|
if (dr.Length > 0)
|
|
if (dr.Length > 0)
|
|
|
{
|
|
{
|
|
|
particlesAll.Rows[i]["Hardness"] = dr[0]["Hardness"].ToString();
|
|
particlesAll.Rows[i]["Hardness"] = dr[0]["Hardness"].ToString();
|
|
@@ -361,6 +371,7 @@ namespace OTSIncAReportGrids
|
|
|
#endregion
|
|
#endregion
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
DataTable elementchemistry = Particledata.GetElementChemistry();
|
|
DataTable elementchemistry = Particledata.GetElementChemistry();
|
|
|
for (int i = 0; i < particlesAll.Rows.Count; i++)
|
|
for (int i = 0; i < particlesAll.Rows.Count; i++)
|
|
|
{
|
|
{
|
|
@@ -373,10 +384,10 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
}
|
|
|
particlesAll.Rows[i]["Element"] = ConcatenatedString;
|
|
particlesAll.Rows[i]["Element"] = ConcatenatedString;
|
|
|
}
|
|
}
|
|
|
|
|
+ particlesAll.Columns.Add("XRayDataCount");
|
|
|
if (sel != (int)SelItem.MergeParticles)
|
|
if (sel != (int)SelItem.MergeParticles)
|
|
|
{
|
|
{
|
|
|
DataTable XRayData = Particledata.GetXRayData();
|
|
DataTable XRayData = Particledata.GetXRayData();
|
|
|
- particlesAll.Columns.Add("XRayDataCount");
|
|
|
|
|
for (int i = 0; i < particlesAll.Rows.Count; i++)
|
|
for (int i = 0; i < particlesAll.Rows.Count; i++)
|
|
|
{
|
|
{
|
|
|
if (int.Parse(particlesAll.Rows[i]["particleId"].ToString()) > -1)
|
|
if (int.Parse(particlesAll.Rows[i]["particleId"].ToString()) > -1)
|
|
@@ -384,6 +395,8 @@ namespace OTSIncAReportGrids
|
|
|
particlesAll.Rows[i]["XRayDataCount"] = 0;
|
|
particlesAll.Rows[i]["XRayDataCount"] = 0;
|
|
|
string str = " XrayIndex= " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
|
|
string str = " XrayIndex= " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
|
|
|
DataRow[] drs = XRayData.Select(str);
|
|
DataRow[] drs = XRayData.Select(str);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
uint xraycount = 0;
|
|
uint xraycount = 0;
|
|
|
if (drs != null)
|
|
if (drs != null)
|
|
|
{
|
|
{
|
|
@@ -404,127 +417,37 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ for (int i = 0; i < particlesAll.Rows.Count; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ particlesAll.Rows[i]["XRayDataCount"] = 0;
|
|
|
|
|
+ DataRow dgvr = particlesAll.Rows[i];
|
|
|
|
|
+ var tPt = new ParticleData(ReportFun.resultFile.FilePath);
|
|
|
|
|
+ uint[] Search_xray = new uint[2000];
|
|
|
|
|
+ uint[] Analysis_xray = new uint[2000];
|
|
|
|
|
+ tPt.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr["particleId"]), Convert.ToInt32(dgvr["fieldid"]), out Search_xray, out Analysis_xray);
|
|
|
|
|
+ uint xraycount = 0;
|
|
|
|
|
+ for (int j = 0; j < 2000; j++)
|
|
|
|
|
+ {
|
|
|
|
|
+ xraycount += Analysis_xray[j];
|
|
|
|
|
+ }
|
|
|
|
|
+ particlesAll.Rows[i]["XRayDataCount"] = xraycount;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void BindDataGridView()
|
|
|
|
|
|
|
+ private void DisplayGridView()
|
|
|
{
|
|
{
|
|
|
dgV_ParticlesDevidePage.Visible = false;
|
|
dgV_ParticlesDevidePage.Visible = false;
|
|
|
if (m_frm_userprogress.IsDisposed)
|
|
if (m_frm_userprogress.IsDisposed)
|
|
|
{
|
|
{
|
|
|
ProgressStart();
|
|
ProgressStart();
|
|
|
}
|
|
}
|
|
|
- dgV_ParticlesDevidePage.Rows.Clear();
|
|
|
|
|
- dgV_ParticlesDevidePage.Columns.Clear();
|
|
|
|
|
-
|
|
|
|
|
- var startFun = m_ReportApp.m_RptConfigFile.Systype;
|
|
|
|
|
-
|
|
|
|
|
- string str_DefaultComputedColName = "", str_ElementsColName = "";
|
|
|
|
|
- DataSet ds = XMLoperate.GetXmlData(Application.StartupPath + RptConfigFile.m_ReportMgrParamFile, "XMLData");
|
|
|
|
|
- DataTable dt = ds.Tables["Member"];
|
|
|
|
|
- foreach (DataRow element in dt.Rows)
|
|
|
|
|
- {
|
|
|
|
|
- string RegName = element["RegName"].ToString();
|
|
|
|
|
-
|
|
|
|
|
- if (RegName == "DefaultComputedColName")
|
|
|
|
|
- {
|
|
|
|
|
- str_DefaultComputedColName = element["strValue"].ToString();
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- if (RegName == "ElementsColName")
|
|
|
|
|
- {
|
|
|
|
|
- str_ElementsColName = element["strValue"].ToString();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- string[] strs = str_DefaultComputedColName.Split(',');
|
|
|
|
|
- Dictionary<string, string> keyValues = new Dictionary<string, string>() { };
|
|
|
|
|
- keyValues.Add("rowid", table["str4"].ToString());
|
|
|
|
|
- keyValues.Add("TypeName", table["str6"].ToString());
|
|
|
|
|
- keyValues.Add("ParticleImage", table["str5"].ToString());
|
|
|
|
|
- keyValues.Add("FieldId", "FieldId");
|
|
|
|
|
- keyValues.Add("ParticleId", "ParticleId");
|
|
|
|
|
- keyValues.Add("SEMPosX", "SEMPosX");
|
|
|
|
|
- keyValues.Add("SEMPosY", "SEMPosY");
|
|
|
|
|
- for (int i = 0; i < strs.Count(); i++)
|
|
|
|
|
- {
|
|
|
|
|
- if (strs[i] == "ParticleCoordinate")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("AbPosX", "PosX");
|
|
|
|
|
- keyValues.Add("AbPosY", "PosY");
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "Area")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("Area", table["str21"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "EquivalentCircleDiameter")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("Equivalent", table["str22"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "MaxDiameter")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("DMAX", table["str23"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "MinDiameter")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("DMIN", table["str24"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "DiameterRatio")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("DiameterRatio", table["str25"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "FerretDiameter")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("DFERET", table["str26"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "PERP")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("DPERP", table["str27"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "PERI")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("PERIMETER", table["str28"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "INSCR")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("DINSCR", table["str29"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "MEAN")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("DMEAN", table["str30"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "ELONG")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("DELONG", table["str31"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "ASPECT_ELONG")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("ASPECT_ELONG", table["str32"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "Orientation")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("ORIENTATION", table["str33"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "XRayDataCount")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("XRayDataCount", "XRay计数");
|
|
|
|
|
- }
|
|
|
|
|
- if (startFun == OTS_SysType_ID.TCCleannessA || startFun == OTS_SysType_ID.BatteryCleannessA)
|
|
|
|
|
- {
|
|
|
|
|
- if (strs[i] == "Hardness")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("Hardness", table["str34"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "Density")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("Density", table["str35"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- if (strs[i] == "Electrical_conductivity")
|
|
|
|
|
- {
|
|
|
|
|
- keyValues.Add("Electrical_conductivity", table["str36"].ToString());
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- keyValues.Add("Element", "Element");
|
|
|
|
|
|
|
+ string str_ElementsColName = null;
|
|
|
|
|
+ Dictionary<string, string> keyValues = InitializeTable(ref str_ElementsColName);
|
|
|
Dictionary<string, string>.Enumerator en = keyValues.GetEnumerator();
|
|
Dictionary<string, string>.Enumerator en = keyValues.GetEnumerator();
|
|
|
for (int irow = 0; irow < keyValues.Count; irow++)
|
|
for (int irow = 0; irow < keyValues.Count; irow++)
|
|
|
{
|
|
{
|
|
@@ -535,6 +458,7 @@ namespace OTSIncAReportGrids
|
|
|
DataGridViewImageColumn iconColumn = new DataGridViewImageColumn();
|
|
DataGridViewImageColumn iconColumn = new DataGridViewImageColumn();
|
|
|
iconColumn.Name = en.Current.Key;
|
|
iconColumn.Name = en.Current.Key;
|
|
|
iconColumn.HeaderText = en.Current.Value;
|
|
iconColumn.HeaderText = en.Current.Value;
|
|
|
|
|
+ iconColumn.ImageLayout = DataGridViewImageCellLayout.Zoom;
|
|
|
dgV_ParticlesDevidePage.Columns.Add(iconColumn);
|
|
dgV_ParticlesDevidePage.Columns.Add(iconColumn);
|
|
|
}
|
|
}
|
|
|
else if (en.Current.Key == "Element")
|
|
else if (en.Current.Key == "Element")
|
|
@@ -614,15 +538,17 @@ namespace OTSIncAReportGrids
|
|
|
Bitmap tempbit = Particledata.ReadImageFile(imagePatht);
|
|
Bitmap tempbit = Particledata.ReadImageFile(imagePatht);
|
|
|
int pixw = tempbit.Width;
|
|
int pixw = tempbit.Width;
|
|
|
double xs = pixw / ScanFieldSize;
|
|
double xs = pixw / ScanFieldSize;
|
|
|
-
|
|
|
|
|
|
|
+ OTS_X_AXIS_DIRECTION X_AXIS_DIRECTION = result.GetXAxisDirEnum();
|
|
|
|
|
+ OTS_Y_AXIS_DIRECTION Y_AXIS_DIRECTION = result.GetYAxisDirEnum();
|
|
|
particleM = particleM + "," + subt;
|
|
particleM = particleM + "," + subt;
|
|
|
- Bitmap bmap = Particledata.GetBitmapForBig(subt, xs, result.FilePath, tempbit.Height, tempbit.Width);
|
|
|
|
|
|
|
+ Bitmap bmap = Particledata.GetBitmapForBig(subt, xs, result.FilePath, tempbit.Height, tempbit.Width, X_AXIS_DIRECTION,Y_AXIS_DIRECTION);
|
|
|
if (bmap != null)
|
|
if (bmap != null)
|
|
|
{
|
|
{
|
|
|
string[] str = subt.Split(',');
|
|
string[] str = subt.Split(',');
|
|
|
bmap.Tag = new List<string>() { str[0].Split(':')[0], str[0].Split(':')[1], particles.Rows[i]["TypeId"].ToString() };
|
|
bmap.Tag = new List<string>() { str[0].Split(':')[0], str[0].Split(':')[1], particles.Rows[i]["TypeId"].ToString() };
|
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
|
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = bmap;
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = bmap;
|
|
|
|
|
+ //dgV_ParticlesDevidePage.Rows[add_rowindex].Height= dgV_ParticlesDevidePage.Rows[add_rowindex].Height< bmap.Height ? bmap.Height: dgV_ParticlesDevidePage.Rows[add_rowindex].Height;
|
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
|
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].DefaultCellStyle.ForeColor = Color.Chocolate;
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].DefaultCellStyle.ForeColor = Color.Chocolate;
|
|
|
}
|
|
}
|
|
@@ -651,10 +577,6 @@ namespace OTSIncAReportGrids
|
|
|
{
|
|
{
|
|
|
double d = Convert.ToDouble(particles.Rows[i]["DMAX"]) / Convert.ToDouble(particles.Rows[i]["DMIN"]);
|
|
double d = Convert.ToDouble(particles.Rows[i]["DMAX"]) / Convert.ToDouble(particles.Rows[i]["DMIN"]);
|
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = Math.Round(d, 2);
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = Math.Round(d, 2);
|
|
|
- }
|
|
|
|
|
- if (en.Current.Key == "Element")
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
if (enl.Current.Key == "ASPECT_ELONG")
|
|
if (enl.Current.Key == "ASPECT_ELONG")
|
|
|
{
|
|
{
|
|
@@ -704,8 +626,6 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
}
|
|
|
if (enl.Current.Key == "TypeName")
|
|
if (enl.Current.Key == "TypeName")
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
if (particles.Rows[i]["TypeId"].ToString() == "9")
|
|
if (particles.Rows[i]["TypeId"].ToString() == "9")
|
|
|
{
|
|
{
|
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = "Not Identified";
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = "Not Identified";
|
|
@@ -747,7 +667,121 @@ namespace OTSIncAReportGrids
|
|
|
#endregion
|
|
#endregion
|
|
|
dgV_ParticlesDevidePage.Visible = true;
|
|
dgV_ParticlesDevidePage.Visible = true;
|
|
|
}
|
|
}
|
|
|
|
|
+ Dictionary<string, string> InitializeTable(ref string str_ElementsColName)
|
|
|
|
|
+ {
|
|
|
|
|
+ dgV_ParticlesDevidePage.Rows.Clear();
|
|
|
|
|
+ dgV_ParticlesDevidePage.Columns.Clear();
|
|
|
|
|
+
|
|
|
|
|
+ var startFun = m_ReportApp.m_RptConfigFile.Systype;
|
|
|
|
|
+
|
|
|
|
|
+ string str_DefaultComputedColName = "";str_ElementsColName = "";
|
|
|
|
|
+ DataSet ds = XMLoperate.GetXmlData(Application.StartupPath + RptConfigFile.m_ReportMgrParamFile, "XMLData");
|
|
|
|
|
+ DataTable dt = ds.Tables["Member"];
|
|
|
|
|
+ foreach (DataRow element in dt.Rows)
|
|
|
|
|
+ {
|
|
|
|
|
+ string RegName = element["RegName"].ToString();
|
|
|
|
|
+
|
|
|
|
|
+ if (RegName == "DefaultComputedColName")
|
|
|
|
|
+ {
|
|
|
|
|
+ str_DefaultComputedColName = element["strValue"].ToString();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ if (RegName == "ElementsColName")
|
|
|
|
|
+ {
|
|
|
|
|
+ str_ElementsColName = element["strValue"].ToString();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ string[] strs = str_DefaultComputedColName.Split(',');
|
|
|
|
|
+ Dictionary<string, string> keyValues = new Dictionary<string, string>() { };
|
|
|
|
|
+ keyValues.Add("rowid", table["str4"].ToString());
|
|
|
|
|
+ keyValues.Add("TypeName", table["str6"].ToString());
|
|
|
|
|
+ keyValues.Add("ParticleImage", table["str5"].ToString());
|
|
|
|
|
+ keyValues.Add("FieldId", "FieldId");
|
|
|
|
|
+ keyValues.Add("ParticleId", "ParticleId");
|
|
|
|
|
+ keyValues.Add("SEMPosX", "SEMPosX");
|
|
|
|
|
+ keyValues.Add("SEMPosY", "SEMPosY");
|
|
|
|
|
+ for (int i = 0; i < strs.Count(); i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (strs[i] == "ParticleCoordinate")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("AbPosX", "PosX");
|
|
|
|
|
+ keyValues.Add("AbPosY", "PosY");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "Area")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("Area", table["str21"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "EquivalentCircleDiameter")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("Equivalent", table["str22"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "MaxDiameter")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("DMAX", table["str23"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "MinDiameter")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("DMIN", table["str24"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "DiameterRatio")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("DiameterRatio", table["str25"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "FerretDiameter")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("DFERET", table["str26"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "PERP")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("DPERP", table["str27"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "PERI")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("PERIMETER", table["str28"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "INSCR")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("DINSCR", table["str29"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "MEAN")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("DMEAN", table["str30"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "ELONG")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("DELONG", table["str31"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "ASPECT_ELONG")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("ASPECT_ELONG", table["str32"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "Orientation")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("ORIENTATION", table["str33"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "XRayDataCount")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("XRayDataCount", "XRay计数");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (startFun == OTS_SysType_ID.TCCleannessA || startFun == OTS_SysType_ID.BatteryCleannessA)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (strs[i] == "Hardness")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("Hardness", table["str34"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "Density")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("Density", table["str35"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (strs[i] == "Electrical_conductivity")
|
|
|
|
|
+ {
|
|
|
|
|
+ keyValues.Add("Electrical_conductivity", table["str36"].ToString());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ keyValues.Add("Element", "Element");
|
|
|
|
|
+ return keyValues;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -1275,7 +1309,7 @@ namespace OTSIncAReportGrids
|
|
|
ProgressStart();
|
|
ProgressStart();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- UpdateTable();
|
|
|
|
|
|
|
+ UpdateDataGrid();
|
|
|
|
|
|
|
|
lnkFirst_Click(null, null);
|
|
lnkFirst_Click(null, null);
|
|
|
SetDataGridViewStyle();
|
|
SetDataGridViewStyle();
|
|
@@ -1304,7 +1338,7 @@ namespace OTSIncAReportGrids
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
private void DrawControl(bool callEvent)
|
|
private void DrawControl(bool callEvent)
|
|
|
{
|
|
{
|
|
|
- BindDataGridView();
|
|
|
|
|
|
|
+ DisplayGridView();
|
|
|
lblTotalCount.Text = RecordCount.ToString();
|
|
lblTotalCount.Text = RecordCount.ToString();
|
|
|
lblPageCount.Text = PageCount.ToString();
|
|
lblPageCount.Text = PageCount.ToString();
|
|
|
txtPageNum.Text = PageIndex.ToString();
|
|
txtPageNum.Text = PageIndex.ToString();
|
|
@@ -1863,7 +1897,7 @@ namespace OTSIncAReportGrids
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- UpdateTable();
|
|
|
|
|
|
|
+ UpdateDataGrid();
|
|
|
lnkFirst_Click(null, null);
|
|
lnkFirst_Click(null, null);
|
|
|
SetDataGridViewStyle();
|
|
SetDataGridViewStyle();
|
|
|
DataTable table = GetClassificationOfAllParticles();
|
|
DataTable table = GetClassificationOfAllParticles();
|
|
@@ -1947,7 +1981,7 @@ namespace OTSIncAReportGrids
|
|
|
{
|
|
{
|
|
|
if (i_ls_fieldid == item.FieldId && i_ls_particleid == item.ParticleId)
|
|
if (i_ls_fieldid == item.FieldId && i_ls_particleid == item.ParticleId)
|
|
|
{
|
|
{
|
|
|
- if (DeleteParticlesFromLibrary(item.ParticleId, item.FieldId))
|
|
|
|
|
|
|
+ if (DeleteParticlesFromSTDDb(item.ParticleId, item.FieldId))
|
|
|
{
|
|
{
|
|
|
for (int i = 0; i < particlesAll.Rows.Count; i++)
|
|
for (int i = 0; i < particlesAll.Rows.Count; i++)
|
|
|
{
|
|
{
|
|
@@ -1990,13 +2024,13 @@ namespace OTSIncAReportGrids
|
|
|
var _Control_DrawDistrbutionImageAndBSE = new OTSIncAReportGraph.Controls.Control_DrawDistrbutionImageAndBSE(m_ReportApp);
|
|
var _Control_DrawDistrbutionImageAndBSE = new OTSIncAReportGraph.Controls.Control_DrawDistrbutionImageAndBSE(m_ReportApp);
|
|
|
foreach (var p in list_Part)
|
|
foreach (var p in list_Part)
|
|
|
{
|
|
{
|
|
|
- _Control_DrawDistrbutionImageAndBSE.DeleteParticlesFromLibrary(p.ParticleId, p.FieldId);
|
|
|
|
|
|
|
+ _Control_DrawDistrbutionImageAndBSE.DeleteParticlesFromSTDDb(p.ParticleId, p.FieldId);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private bool DeleteParticlesFromLibrary(int in_clr_tagid, int in_clr_fieldid)
|
|
|
|
|
|
|
+ private bool DeleteParticlesFromSTDDb(int in_clr_tagid, int in_clr_fieldid)
|
|
|
{
|
|
{
|
|
|
bool DoesItExist = false;
|
|
bool DoesItExist = false;
|
|
|
for (int i = 1; i < 201; i++)
|
|
for (int i = 1; i < 201; i++)
|
|
@@ -2354,37 +2388,7 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- /// <summary>
|
|
|
|
|
- /// 去除拼接颗粒组成颗粒
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- /// <param name="dataTable_Particle"></param>
|
|
|
|
|
- /// <param name="dataTable_MergeParticles"></param>
|
|
|
|
|
- public void RemoveMergeParticles(ref DataTable dataTable_Particle, DataTable dataTable_MergeParticles)
|
|
|
|
|
- {
|
|
|
|
|
- foreach (DataRow row in dataTable_Particle.Rows)
|
|
|
|
|
- {
|
|
|
|
|
- foreach (DataRow MergeParticlesRow in dataTable_MergeParticles.Rows)
|
|
|
|
|
- {
|
|
|
|
|
- string subt = MergeParticlesRow["SubParticles"].ToString();
|
|
|
|
|
- string[] sub = subt.Split(',');
|
|
|
|
|
- if (row.RowState == DataRowState.Deleted)
|
|
|
|
|
- {
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- if (row["fieldid"].ToString() == Convert.ToString(sub[0]).Split(':')[0] && row["ParticleId"].ToString() == Convert.ToString(sub[0]).Split(':')[1])
|
|
|
|
|
- {
|
|
|
|
|
- row.Delete();
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- if (row["fieldid"].ToString() == Convert.ToString(sub[1]).Split(':')[0] && row["ParticleId"].ToString() == Convert.ToString(sub[1]).Split(':')[1])
|
|
|
|
|
- {
|
|
|
|
|
- row.Delete();
|
|
|
|
|
- break; ;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- dataTable_Particle.AcceptChanges();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
private void btn_showconfig_Click(object sender, EventArgs e)
|
|
private void btn_showconfig_Click(object sender, EventArgs e)
|
|
|
{
|
|
{
|
|
@@ -2418,7 +2422,7 @@ namespace OTSIncAReportGrids
|
|
|
{
|
|
{
|
|
|
dgV_ParticlesDevidePage.Rows.Clear();
|
|
dgV_ParticlesDevidePage.Rows.Clear();
|
|
|
dgV_ParticlesDevidePage.Columns.Clear();
|
|
dgV_ParticlesDevidePage.Columns.Clear();
|
|
|
- BindDataGridView();
|
|
|
|
|
|
|
+ DisplayGridView();
|
|
|
SetDataGridViewStyle();
|
|
SetDataGridViewStyle();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2458,13 +2462,11 @@ namespace OTSIncAReportGrids
|
|
|
return Particleslist_selecttodisplay;
|
|
return Particleslist_selecttodisplay;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
private void dgV_ParticlesDevidePage_MouseUp(object sender, MouseEventArgs e)
|
|
private void dgV_ParticlesDevidePage_MouseUp(object sender, MouseEventArgs e)
|
|
|
{
|
|
{
|
|
|
int sel = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
|
|
int sel = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
|
|
|
- if (sel == (int)SelItem.MergeParticles)
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
ToolStripMenuItem_SimilarityReclassification.Enabled = false;
|
|
ToolStripMenuItem_SimilarityReclassification.Enabled = false;
|
|
|
var SelectRows = dgV_ParticlesDevidePage.SelectedRows;
|
|
var SelectRows = dgV_ParticlesDevidePage.SelectedRows;
|
|
|
if (SelectRows.Count != 0)
|
|
if (SelectRows.Count != 0)
|
|
@@ -2473,77 +2475,46 @@ namespace OTSIncAReportGrids
|
|
|
{
|
|
{
|
|
|
DataGridViewRow dgvr = SelectRows[0];
|
|
DataGridViewRow dgvr = SelectRows[0];
|
|
|
Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
|
|
Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
|
|
|
- List<string> list_str = (List<string>)ls_bp.Tag;
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
uint[] Search_xray = new uint[2000];
|
|
uint[] Search_xray = new uint[2000];
|
|
|
uint[] Analysis_xray = new uint[2000];
|
|
uint[] Analysis_xray = new uint[2000];
|
|
|
int i_xray_id = 0;
|
|
int i_xray_id = 0;
|
|
|
List<Element> list_celementchemistryclr = new List<Element>();
|
|
List<Element> list_celementchemistryclr = new List<Element>();
|
|
|
- ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
|
|
|
|
|
-
|
|
|
|
|
- List<ShowElementInfo> list_showelementinfo = new List<ShowElementInfo>();
|
|
|
|
|
- for (int i = 0; i < list_celementchemistryclr.Count; i++)
|
|
|
|
|
|
|
+ Particle particle=new Particle();
|
|
|
|
|
+ var tPt = new ParticleData(ReportFun.resultFile.FilePath);
|
|
|
|
|
+ if (sel == (int)SelItem.MergeParticles)
|
|
|
{
|
|
{
|
|
|
- ShowElementInfo ls_sei = new ShowElementInfo();
|
|
|
|
|
- ls_sei.ElementName = list_celementchemistryclr[i].Name;
|
|
|
|
|
- ls_sei.Percentage = list_celementchemistryclr[i].Percentage;
|
|
|
|
|
- ls_sei.dKF = Convert.ToDouble(CListPeriodic.GetPeriodicByEleName(ls_sei.ElementName).K_Peak);
|
|
|
|
|
- double de_sx2 = 0;
|
|
|
|
|
- if (CListPeriodic.GetPeriodicByEleName(ls_sei.ElementName).L_Peak == "" || CListPeriodic.GetPeriodicByEleName(ls_sei.ElementName).L_Peak == "-")
|
|
|
|
|
- {
|
|
|
|
|
- de_sx2 = 0;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- de_sx2 = Convert.ToDouble(CListPeriodic.GetPeriodicByEleName(ls_sei.ElementName).L_Peak);
|
|
|
|
|
- }
|
|
|
|
|
- ls_sei.dLF = de_sx2;
|
|
|
|
|
- list_showelementinfo.Add(ls_sei);
|
|
|
|
|
|
|
+ particle = tPt.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray);
|
|
|
|
|
+ list_celementchemistryclr = particle.ElementList;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ particle = ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- list_showelementinfo.Sort((p1, p2) => p2.Percentage.CompareTo(p1.Percentage));
|
|
|
|
|
|
|
+ List<ShowElementInfo> list_showelementinfo = tPt.GetShowElementInfos_ForMergeParticle(list_celementchemistryclr);
|
|
|
string str_IncAName = "";
|
|
string str_IncAName = "";
|
|
|
str_IncAName = Convert.ToString(dgvr.Cells[1].Value);
|
|
str_IncAName = Convert.ToString(dgvr.Cells[1].Value);
|
|
|
- Particle particle = result.List_OTSField.Find(x => x.FieldID == Convert.ToInt32(dgvr.Cells["fieldid"].Value)).ParticleList.Find(x => x.ParticleId == Convert.ToInt32(dgvr.Cells["particleId"].Value));
|
|
|
|
|
if (particle == null)
|
|
if (particle == null)
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
control_XRayTable1.SetParticleInfo("Area:" + Math.Round(particle.Area, 2) + " " + "DMAX:" + Math.Round(particle.DMAX, 2) + " " + "DELONG:" + Math.Round(particle.DELONG, 2) + " " + "DFERET:" + Math.Round(particle.DFERET, 2) + " " + "DINSCR:" + Math.Round(particle.DINSCR, 2) + "\n" + "DMEAN:" + Math.Round(particle.DMEAN, 2) + " " + "DMIN:" + Math.Round(particle.DMIN, 2) + " " + "DPERP:" + Math.Round(particle.DPERP, 2) + " " + "ORIENTATION:" + Math.Round(particle.ORIENTATION, 2) + " " + "PERIMETER:" + Math.Round(particle.PERIMETER, 2));
|
|
control_XRayTable1.SetParticleInfo("Area:" + Math.Round(particle.Area, 2) + " " + "DMAX:" + Math.Round(particle.DMAX, 2) + " " + "DELONG:" + Math.Round(particle.DELONG, 2) + " " + "DFERET:" + Math.Round(particle.DFERET, 2) + " " + "DINSCR:" + Math.Round(particle.DINSCR, 2) + "\n" + "DMEAN:" + Math.Round(particle.DMEAN, 2) + " " + "DMIN:" + Math.Round(particle.DMIN, 2) + " " + "DPERP:" + Math.Round(particle.DPERP, 2) + " " + "ORIENTATION:" + Math.Round(particle.ORIENTATION, 2) + " " + "PERIMETER:" + Math.Round(particle.PERIMETER, 2));
|
|
|
-
|
|
|
|
|
control_XRayTable1.Visible = true;
|
|
control_XRayTable1.Visible = true;
|
|
|
control_XRayTable1.SetXRayShowLineValue(null, Analysis_xray, list_showelementinfo);
|
|
control_XRayTable1.SetXRayShowLineValue(null, Analysis_xray, list_showelementinfo);
|
|
|
- //颗粒国标信息
|
|
|
|
|
control_XRayTable1.GBInfoStr = "";
|
|
control_XRayTable1.GBInfoStr = "";
|
|
|
- control_XRayTable1.MaterialName = str_IncAName;//杂夹物
|
|
|
|
|
-
|
|
|
|
|
|
|
+ control_XRayTable1.MaterialName = str_IncAName;
|
|
|
control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
|
|
control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
|
|
|
|
|
|
|
|
- string str = " particleId= " + dgvr.Cells["particleId"].Value.ToString() + " and fieldid = " + dgvr.Cells["fieldid"].Value.ToString();
|
|
|
|
|
- DataRow[] drs = particles.Select(str);
|
|
|
|
|
- if (drs.Length > 0)
|
|
|
|
|
|
|
+ if (sel != (int)SelItem.MergeParticles)
|
|
|
{
|
|
{
|
|
|
Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(particle.RectLeft), Y = Convert.ToInt32(particle.RectTop), Width = Convert.ToInt32(particle.RectWidth), Height = Convert.ToInt32(particle.RectHeight) };
|
|
Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(particle.RectLeft), Y = Convert.ToInt32(particle.RectTop), Width = Convert.ToInt32(particle.RectWidth), Height = Convert.ToInt32(particle.RectHeight) };
|
|
|
- Bitmap dpImage = new Bitmap(result.GetImageWidth(), result.GetImageHeight());
|
|
|
|
|
- using (Graphics graphics = Graphics.FromImage(dpImage))
|
|
|
|
|
- {
|
|
|
|
|
- graphics.Clear(Color.White); // 清除位图背景为白色
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ Bitmap dpImage = ReportFun.GetBlackAndWhiteImage(particle);
|
|
|
string filePath = result.FilePath + "\\FIELD_FILES\\";
|
|
string filePath = result.FilePath + "\\FIELD_FILES\\";
|
|
|
string imagePath = filePath + "Field" + dgvr.Cells["fieldid"].Value.ToString() + ".bmp";
|
|
string imagePath = filePath + "Field" + dgvr.Cells["fieldid"].Value.ToString() + ".bmp";
|
|
|
Bitmap m_originalImage = DrawFunction.ReadImageFile(imagePath);
|
|
Bitmap m_originalImage = DrawFunction.ReadImageFile(imagePath);
|
|
|
-
|
|
|
|
|
- foreach (Segment seg in particle.SegmentList)
|
|
|
|
|
- {
|
|
|
|
|
- int f_length = seg.Length;
|
|
|
|
|
- for (int m = 0; m < f_length; m++)
|
|
|
|
|
- {
|
|
|
|
|
- int lsjs_x = seg.Start + m;
|
|
|
|
|
- int lsjs_y = seg.Height;
|
|
|
|
|
- var pixelColor = m_originalImage.GetPixel(lsjs_x, lsjs_y);
|
|
|
|
|
- dpImage.SetPixel(lsjs_x, lsjs_y, Color.Black);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
Bitmap bmap = Particledata.GetBitmapByParticle(dpImage, rectangle);
|
|
Bitmap bmap = Particledata.GetBitmapByParticle(dpImage, rectangle);
|
|
|
Bitmap bmap1 = Particledata.GetBitmapByParticle(m_originalImage, rectangle);
|
|
Bitmap bmap1 = Particledata.GetBitmapByParticle(m_originalImage, rectangle);
|
|
|
control_XRayTable1.SetBitmapOfPictureBox(bmap1, bmap);
|
|
control_XRayTable1.SetBitmapOfPictureBox(bmap1, bmap);
|
|
@@ -2551,7 +2522,21 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- control_XRayTable1.Visible = false;
|
|
|
|
|
|
|
+ double ScanFieldSize = result.GetScanFieldSizeX();
|
|
|
|
|
+ string filePatht = result.FilePath + "\\FIELD_FILES\\";
|
|
|
|
|
+ string str = " particleId= " + dgvr.Cells["particleId"].Value.ToString() + " and fieldid = " + dgvr.Cells["fieldid"].Value.ToString();
|
|
|
|
|
+ DataRow[] drs = particles.Select(str);
|
|
|
|
|
+ DataRow row = drs[0];
|
|
|
|
|
+ string subt = row["SubParticles"].ToString();
|
|
|
|
|
+ string imagePatht = filePatht + "Field" + subt.Split(',')[0].Split(':')[0].ToString() + ".bmp";
|
|
|
|
|
+ Bitmap tempbit = Particledata.ReadImageFile(imagePatht);
|
|
|
|
|
+ int pixw = tempbit.Width;
|
|
|
|
|
+ double xs = pixw / ScanFieldSize;
|
|
|
|
|
+ OTS_X_AXIS_DIRECTION X_AXIS_DIRECTION = result.GetXAxisDirEnum();
|
|
|
|
|
+ OTS_Y_AXIS_DIRECTION Y_AXIS_DIRECTION = result.GetYAxisDirEnum();
|
|
|
|
|
+ Bitmap bp= Particledata.GetBitmapForBigBlackAndWhiteImage(subt, xs, result.FilePath, tempbit.Height, tempbit.Width, X_AXIS_DIRECTION, Y_AXIS_DIRECTION);
|
|
|
|
|
+ control_XRayTable1.SetBitmapOfPictureBox(ls_bp,bp);
|
|
|
|
|
+ Invalidate();
|
|
|
}
|
|
}
|
|
|
ToolStripMenuItem_SimilarityReclassification.Enabled = true;
|
|
ToolStripMenuItem_SimilarityReclassification.Enabled = true;
|
|
|
}
|
|
}
|
|
@@ -2580,13 +2565,18 @@ namespace OTSIncAReportGrids
|
|
|
private void tbx_Type_Click(object sender, EventArgs e)
|
|
private void tbx_Type_Click(object sender, EventArgs e)
|
|
|
{
|
|
{
|
|
|
ParticleClassificationSelect particleClassificationSelect = new ParticleClassificationSelect(this, tbx_Type.Text);
|
|
ParticleClassificationSelect particleClassificationSelect = new ParticleClassificationSelect(this, tbx_Type.Text);
|
|
|
|
|
+
|
|
|
DialogResult result = particleClassificationSelect.ShowDialog();
|
|
DialogResult result = particleClassificationSelect.ShowDialog();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if (result == DialogResult.OK)
|
|
if (result == DialogResult.OK)
|
|
|
{
|
|
{
|
|
|
condition = "";
|
|
condition = "";
|
|
|
tbx_Type.Text = particleClassificationSelect.ParticleClassificationSelected;
|
|
tbx_Type.Text = particleClassificationSelect.ParticleClassificationSelected;
|
|
|
string[] tr = tbx_Type.Text.Split(',');
|
|
string[] tr = tbx_Type.Text.Split(',');
|
|
|
condition += " and (";
|
|
condition += " and (";
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
for (int i = 0; i < tr.Length; i++)
|
|
for (int i = 0; i < tr.Length; i++)
|
|
|
{
|
|
{
|
|
|
if (i == 0)
|
|
if (i == 0)
|
|
@@ -2605,7 +2595,7 @@ namespace OTSIncAReportGrids
|
|
|
ProgressStart();
|
|
ProgressStart();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- UpdateTable();
|
|
|
|
|
|
|
+ UpdateDataGrid();
|
|
|
lnkFirst_Click(null, null);
|
|
lnkFirst_Click(null, null);
|
|
|
SetDataGridViewStyle();
|
|
SetDataGridViewStyle();
|
|
|
}
|
|
}
|
|
@@ -2681,7 +2671,7 @@ namespace OTSIncAReportGrids
|
|
|
DialogResult result3 = Form_listOfSimilarParticles.ShowDialog();
|
|
DialogResult result3 = Form_listOfSimilarParticles.ShowDialog();
|
|
|
if (result3 == DialogResult.OK)
|
|
if (result3 == DialogResult.OK)
|
|
|
{
|
|
{
|
|
|
- UpdateTable();
|
|
|
|
|
|
|
+ UpdateDataGrid();
|
|
|
lnkFirst_Click(null, null);
|
|
lnkFirst_Click(null, null);
|
|
|
SetDataGridViewStyle();
|
|
SetDataGridViewStyle();
|
|
|
DataTable table = GetClassificationOfAllParticles();
|
|
DataTable table = GetClassificationOfAllParticles();
|