|
@@ -96,6 +96,14 @@ namespace OTSIncAReportGrids
|
|
|
DataTable userLibraryData;
|
|
|
NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
+ enum SelItem
|
|
|
+ {
|
|
|
+ analyticalParticle=0,
|
|
|
+ selectParticles=1,
|
|
|
+ otherParticles=2,
|
|
|
+ MergeParticles=3
|
|
|
+ }
|
|
|
+
|
|
|
#region 分页器相关
|
|
|
|
|
|
#region 分页字段和属性
|
|
@@ -280,7 +288,7 @@ namespace OTSIncAReportGrids
|
|
|
|
|
|
bool UpdateTable()
|
|
|
{
|
|
|
- int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
|
|
|
+ int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
|
|
|
if (sel == 1)
|
|
|
{
|
|
|
List<Particle> selectParticles = m_ReportApp.GetSelectedParticles();
|
|
@@ -312,14 +320,14 @@ namespace OTSIncAReportGrids
|
|
|
dtUelect.Columns.Add("DFERET");
|
|
|
dtUelect.Columns.Add("TypeName");
|
|
|
dtUelect.Columns.Add("TypeColor");
|
|
|
- dtUelect.Columns.Add("SubParticles");
|
|
|
+ //dtUelect.Columns.Add("SubParticles");
|
|
|
dtUelect.Columns.Add("Element");
|
|
|
dtUelect.Columns.Add("Hardness");
|
|
|
dtUelect.Columns.Add("Density");
|
|
|
dtUelect.Columns.Add("Electrical_conductivity");
|
|
|
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].DFERET, selectParticles[i].TypeName, selectParticles[i].TypeColor, "", "", "", "", "");
|
|
|
+ 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].DFERET, selectParticles[i].TypeName, selectParticles[i].TypeColor,/* "", */"", "", "", "");
|
|
|
}
|
|
|
if (userLibraryData != null)
|
|
|
{
|
|
@@ -357,7 +365,20 @@ namespace OTSIncAReportGrids
|
|
|
{
|
|
|
//多次测试发现 读取数据库时间耗时长,但读取条数目对读取数据库时长影响不大,故此处直接读取所有数据库信息,以取代多次连接数据库方式,优化分页速度
|
|
|
particlesAll = new DataTable();
|
|
|
- particlesAll = Particledata.GetInfoForPartucleDevidePage2(condition);
|
|
|
+ if (sel == (int)SelItem.analyticalParticle)
|
|
|
+ {
|
|
|
+ //particlesAll = Particledata.GetInfoForPartucleDevidePage2(condition);
|
|
|
+ particlesAll = Particledata.GetInfoForPartucleDevidePage_analyticalParticle(condition);
|
|
|
+ }
|
|
|
+ if (sel == (int)SelItem.otherParticles)
|
|
|
+ {
|
|
|
+ particlesAll = Particledata.GetInfoForPartucleDevidePage_otherParticle(condition);
|
|
|
+ }
|
|
|
+ if (sel == (int)SelItem.MergeParticles)
|
|
|
+ {
|
|
|
+ particlesAll = Particledata.GetInfoForPartucleDevidePage_mergeParticles(condition);
|
|
|
+ }
|
|
|
+
|
|
|
particlesAll.Columns.Add("Hardness");
|
|
|
particlesAll.Columns.Add("Density");
|
|
|
particlesAll.Columns.Add("Electrical_conductivity");
|
|
@@ -368,9 +389,6 @@ namespace OTSIncAReportGrids
|
|
|
DataRow[] dr = userLibraryData.Select("STDId=" + particlesAll.Rows[i]["TypeId"].ToString());
|
|
|
if (dr.Length > 0)
|
|
|
{
|
|
|
- //particlesAll.Rows[i]["Hardness"] = System.Text.RegularExpressions.Regex.Replace(dr[0]["Hardness"].ToString(), @"[^\d.\d]", "");
|
|
|
- //particlesAll.Rows[i]["Density"] = System.Text.RegularExpressions.Regex.Replace(dr[0]["Density"].ToString(), @"[^\d.\d]", "");
|
|
|
- //particlesAll.Rows[i]["Electrical_conductivity"] = System.Text.RegularExpressions.Regex.Replace(dr[0]["Electrical_conductivity"].ToString(), @"[^\d.\d]", "");
|
|
|
particlesAll.Rows[i]["Hardness"] = dr[0]["Hardness"].ToString();
|
|
|
particlesAll.Rows[i]["Density"] = dr[0]["Density"].ToString();
|
|
|
particlesAll.Rows[i]["Electrical_conductivity"] = dr[0]["Electrical_conductivity"].ToString();
|
|
@@ -392,16 +410,7 @@ namespace OTSIncAReportGrids
|
|
|
particlesAll.Rows[i]["Electrical_conductivity"] = "";
|
|
|
}
|
|
|
}
|
|
|
- if (sel == 0)
|
|
|
- {
|
|
|
- string str = "TypeId <> -1 and TypeId <> 9 and TypeId <> 0";
|
|
|
- particlesAll = SreeenDataTable(particlesAll, str);
|
|
|
- }
|
|
|
- if (sel == 2)
|
|
|
- {
|
|
|
- string str = "TypeId = " + "-1 or TypeId =" + "9 or TypeId =" + "0";
|
|
|
- particlesAll = SreeenDataTable(particlesAll, str);
|
|
|
- }
|
|
|
+
|
|
|
btn_Sel.Enabled = true;
|
|
|
}
|
|
|
if (particlesAll == null)
|
|
@@ -807,33 +816,36 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
|
if (enl.Current.Key == "ParticleImage")
|
|
|
{
|
|
|
- string subt = particles.Rows[i]["SubParticles"].ToString();
|
|
|
- if (subt != null && subt != "")
|
|
|
+ if (particles.Columns.Contains("SubParticles"))
|
|
|
{
|
|
|
- double ScanFieldSize = Convert.ToDouble(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["SEMDataMsr"])["ScanFieldSize"]);
|
|
|
- string filePatht = result.FilePath + "\\FIELD_FILES\\";
|
|
|
- string imagePatht = filePatht + "Field" + subt.Split(',')[0].Split(':')[0].ToString() + ".bmp";
|
|
|
- //然后将取出的数据,转换成Bitmap对象
|
|
|
- Bitmap tempbit = Particledata.ReadImageFile(imagePatht);
|
|
|
- int pixw = tempbit.Width;
|
|
|
- double xs = pixw / ScanFieldSize;
|
|
|
-
|
|
|
- particleM = particleM + "," + subt;
|
|
|
- Bitmap bmap = Particledata.GetBitmapForBig(subt, xs, result.FilePath, tempbit.Height, tempbit.Width);
|
|
|
- if (bmap != null)
|
|
|
+ string subt = particles.Rows[i]["SubParticles"].ToString();
|
|
|
+ if (subt != null && subt != "")
|
|
|
{
|
|
|
- string[] str = subt.Split(',');
|
|
|
- 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].Cells[k].Value = bmap;
|
|
|
- dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
|
|
|
- dgV_ParticlesDevidePage.Rows[add_rowindex].DefaultCellStyle.ForeColor = Color.Chocolate;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
|
|
|
+ double ScanFieldSize = Convert.ToDouble(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["SEMDataMsr"])["ScanFieldSize"]);
|
|
|
+ string filePatht = result.FilePath + "\\FIELD_FILES\\";
|
|
|
+ string imagePatht = filePatht + "Field" + subt.Split(',')[0].Split(':')[0].ToString() + ".bmp";
|
|
|
+ //然后将取出的数据,转换成Bitmap对象
|
|
|
+ Bitmap tempbit = Particledata.ReadImageFile(imagePatht);
|
|
|
+ int pixw = tempbit.Width;
|
|
|
+ double xs = pixw / ScanFieldSize;
|
|
|
+
|
|
|
+ particleM = particleM + "," + subt;
|
|
|
+ Bitmap bmap = Particledata.GetBitmapForBig(subt, xs, result.FilePath, tempbit.Height, tempbit.Width);
|
|
|
+ if (bmap != null)
|
|
|
+ {
|
|
|
+ string[] str = subt.Split(',');
|
|
|
+ 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].Cells[k].Value = bmap;
|
|
|
+ dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
|
|
|
+ dgV_ParticlesDevidePage.Rows[add_rowindex].DefaultCellStyle.ForeColor = Color.Chocolate;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
|
|
|
|
|
|
- dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
|
|
|
+ dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -2425,23 +2437,26 @@ namespace OTSIncAReportGrids
|
|
|
{
|
|
|
|
|
|
var SelectRows = dgV_ParticlesDevidePage.SelectedRows;
|
|
|
- if (SelectRows != null && SelectRows.Count == 1)
|
|
|
- {
|
|
|
- DataGridViewRow dgvr = SelectRows[0];
|
|
|
- Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
|
|
|
- List<string> list_str = (List<string>)ls_bp.Tag;
|
|
|
- //if (list_str[2].ToString() == "9")
|
|
|
- //{
|
|
|
- contextMenuStrip1.Items[11].Visible = true;
|
|
|
- //}
|
|
|
- //else
|
|
|
- //{
|
|
|
- // contextMenuStrip1.Items[11].Visible = false;
|
|
|
- //}
|
|
|
- }
|
|
|
- else
|
|
|
+ int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
|
|
|
{
|
|
|
- contextMenuStrip1.Items[11].Visible = false;
|
|
|
+ if (sel != (int)SelItem.MergeParticles)
|
|
|
+ {
|
|
|
+ if (SelectRows != null && SelectRows.Count == 1)
|
|
|
+ {
|
|
|
+ DataGridViewRow dgvr = SelectRows[0];
|
|
|
+ Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
|
|
|
+ List<string> list_str = (List<string>)ls_bp.Tag;
|
|
|
+ contextMenuStrip1.Items[10].Visible = true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ contextMenuStrip1.Items[10].Visible = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ contextMenuStrip1.Items[10].Visible = false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|