|
@@ -10,6 +10,7 @@ using OTSIncAReportGraph.Class;
|
|
|
|
|
|
using OTSIncAReportGraph.OTSIncAReportGraphFuncation;
|
|
using OTSIncAReportGraph.OTSIncAReportGraphFuncation;
|
|
using OTSIncAReportMailInterface;
|
|
using OTSIncAReportMailInterface;
|
|
|
|
+using OTSMeasureApp._0_OTSModel.OTSDataType;
|
|
using OTSPeriodicTable;
|
|
using OTSPeriodicTable;
|
|
|
|
|
|
using System;
|
|
using System;
|
|
@@ -106,12 +107,13 @@ namespace OTSIncAReportGraph.Controls
|
|
System.Collections.Hashtable table;
|
|
System.Collections.Hashtable table;
|
|
|
|
|
|
//包含particle的field的列表对象
|
|
//包含particle的field的列表对象
|
|
- public List<DisplayField> m_list_allDfield = null;
|
|
|
|
|
|
+ public List<DisplayRectangle> m_list_allDfield = null;
|
|
|
|
|
|
|
|
|
|
//这里要做成控件,不要是窗体
|
|
//这里要做成控件,不要是窗体
|
|
public List<DisplayParticle> m_list_allDPart_original = null;
|
|
public List<DisplayParticle> m_list_allDPart_original = null;
|
|
- public List<DisplayField> m_CurGBFields = new List<DisplayField>();
|
|
|
|
|
|
+ public List<DisplayRectangle> m_CurGBFields = new List<DisplayRectangle>();
|
|
|
|
+ public List<DisplayRectangle> m_CurGBParticles = new List<DisplayRectangle>();
|
|
|
|
|
|
//总背景矩形
|
|
//总背景矩形
|
|
private RectangleF m_backRect = new RectangleF();
|
|
private RectangleF m_backRect = new RectangleF();
|
|
@@ -204,7 +206,7 @@ namespace OTSIncAReportGraph.Controls
|
|
public Control_DrawDistrbutionImageAndBSE(OTSIncAReportApp.frmReportApp ReportApp)
|
|
public Control_DrawDistrbutionImageAndBSE(OTSIncAReportApp.frmReportApp ReportApp)
|
|
{
|
|
{
|
|
log = NLog.LogManager.GetCurrentClassLogger();
|
|
log = NLog.LogManager.GetCurrentClassLogger();
|
|
- m_list_allDfield = new List<DisplayField>();
|
|
|
|
|
|
+ m_list_allDfield = new List<DisplayRectangle>();
|
|
|
|
|
|
m_frm_userprogress = new Frm_UserProgress();
|
|
m_frm_userprogress = new Frm_UserProgress();
|
|
|
|
|
|
@@ -305,14 +307,14 @@ namespace OTSIncAReportGraph.Controls
|
|
{
|
|
{
|
|
ProgressBarUpdate(20 + (int)(ls_int_progresscalc * (i + 1)), "finished " + i.ToString() + "total " + resultFile.List_OTSField.Count.ToString() + "field...");
|
|
ProgressBarUpdate(20 + (int)(ls_int_progresscalc * (i + 1)), "finished " + i.ToString() + "total " + resultFile.List_OTSField.Count.ToString() + "field...");
|
|
|
|
|
|
- Point thisfield_point = new Point() { X = fieldlist[i].FieldPosX, Y = fieldlist[i].FieldPosY };//get OTS coordination
|
|
|
|
|
|
+ PointF thisfield_point = new PointF() { X = fieldlist[i].FieldPosX, Y = fieldlist[i].FieldPosY };//get OTS coordination
|
|
|
|
|
|
- Point offset_point = imageDisHelper.ConvertOTSCoordToScreenCoord(thisfield_point);//the ots coordinate is always the up right positive.
|
|
|
|
- DisplayField df;
|
|
|
|
|
|
+ PointF offset_point = imageDisHelper.ConvertOTSCoordToScreenCoord(thisfield_point);//the ots coordinate is always the up right positive.
|
|
|
|
+ DisplayRectangle df;
|
|
try
|
|
try
|
|
{
|
|
{
|
|
|
|
|
|
- df = new DisplayField(fieldlist[i], (int)fieldSize.Width, (int)fieldSize.Height, resultFile.GetPixelSize(), offset_point);
|
|
|
|
|
|
+ df = new DisplayRectangle(fieldlist[i], fieldSize.Width,fieldSize.Height, resultFile.GetPixelSize(), offset_point);
|
|
df.ContentColor = Color.Black;
|
|
df.ContentColor = Color.Black;
|
|
m_list_allDfield.Add(df);
|
|
m_list_allDfield.Add(df);
|
|
}
|
|
}
|
|
@@ -414,7 +416,7 @@ namespace OTSIncAReportGraph.Controls
|
|
double dia_min = Convert.ToDouble(min);
|
|
double dia_min = Convert.ToDouble(min);
|
|
double dia_max = Convert.ToDouble(max);
|
|
double dia_max = Convert.ToDouble(max);
|
|
|
|
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (DisplayParticle ls_dp in a_field.List_DParticle)
|
|
foreach (DisplayParticle ls_dp in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -515,7 +517,7 @@ namespace OTSIncAReportGraph.Controls
|
|
case DISTRIBUTION_IMAGE_SHOW_MODE.BSE:
|
|
case DISTRIBUTION_IMAGE_SHOW_MODE.BSE:
|
|
|
|
|
|
e.Graphics.FillRectangle(new SolidBrush(Color.Gainsboro), m_backRect);
|
|
e.Graphics.FillRectangle(new SolidBrush(Color.Gainsboro), m_backRect);
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -533,7 +535,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
e.Graphics.FillRectangle(new SolidBrush(Color.Gainsboro), m_backRect);
|
|
e.Graphics.FillRectangle(new SolidBrush(Color.Gainsboro), m_backRect);
|
|
|
|
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -547,7 +549,7 @@ namespace OTSIncAReportGraph.Controls
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case DISTRIBUTION_IMAGE_SHOW_MODE.ORIGINAl:
|
|
case DISTRIBUTION_IMAGE_SHOW_MODE.ORIGINAl:
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (DisplayParticle ls_dp in a_field.List_DParticle)
|
|
foreach (DisplayParticle ls_dp in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -558,7 +560,7 @@ namespace OTSIncAReportGraph.Controls
|
|
break;
|
|
break;
|
|
case DISTRIBUTION_IMAGE_SHOW_MODE.ORIGINALCLASSIFIED:
|
|
case DISTRIBUTION_IMAGE_SHOW_MODE.ORIGINALCLASSIFIED:
|
|
DrawOriginalImageAsBackground(e);
|
|
DrawOriginalImageAsBackground(e);
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -585,6 +587,13 @@ namespace OTSIncAReportGraph.Controls
|
|
f.OnPaint(e, Color.Red);
|
|
f.OnPaint(e, Color.Red);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (m_CurGBParticles.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ foreach (var f in m_CurGBParticles)
|
|
|
|
+ {
|
|
|
|
+ f.OnPaint(e, Color.Blue);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
#region 绘制网格线,帧图边框部份
|
|
#region 绘制网格线,帧图边框部份
|
|
if (true == m_is_showgrid)
|
|
if (true == m_is_showgrid)
|
|
{
|
|
{
|
|
@@ -677,7 +686,7 @@ namespace OTSIncAReportGraph.Controls
|
|
m_backRect.X = refPoint.X + xShift;
|
|
m_backRect.X = refPoint.X + xShift;
|
|
m_backRect.Y = refPoint.Y + yShift;
|
|
m_backRect.Y = refPoint.Y + yShift;
|
|
|
|
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
for (int i = 0; i < a_field.List_DParticle.Count(); i++)
|
|
for (int i = 0; i < a_field.List_DParticle.Count(); i++)
|
|
{
|
|
{
|
|
@@ -698,7 +707,7 @@ namespace OTSIncAReportGraph.Controls
|
|
{
|
|
{
|
|
for (int i = 0; i < m_list_allDfield.Count; i++)
|
|
for (int i = 0; i < m_list_allDfield.Count; i++)
|
|
{
|
|
{
|
|
- DisplayField theField = m_list_allDfield[i];
|
|
|
|
|
|
+ DisplayRectangle theField = m_list_allDfield[i];
|
|
theField.Zoom(zoomDelta, refPoint);
|
|
theField.Zoom(zoomDelta, refPoint);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -715,6 +724,17 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ if (m_CurGBParticles.Count > 0)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < m_CurGBParticles.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ var r = m_CurGBParticles[i];
|
|
|
|
+ r.Zoom(zoomDelta, refPoint);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
#region 计算标尺尺寸部份-----放大------
|
|
#region 计算标尺尺寸部份-----放大------
|
|
@@ -771,7 +791,7 @@ namespace OTSIncAReportGraph.Controls
|
|
else
|
|
else
|
|
{
|
|
{
|
|
bool ifClickOnParticle = false;
|
|
bool ifClickOnParticle = false;
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
if (imageDisHelper.WhetherInRange(a_field, e.Location))
|
|
if (imageDisHelper.WhetherInRange(a_field, e.Location))
|
|
{
|
|
{
|
|
@@ -789,7 +809,7 @@ namespace OTSIncAReportGraph.Controls
|
|
}
|
|
}
|
|
if (ifClickOnParticle == false)
|
|
if (ifClickOnParticle == false)
|
|
{
|
|
{
|
|
- foreach (DisplayField item in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle item in m_list_allDfield)
|
|
{
|
|
{
|
|
item.IsDragging = true;
|
|
item.IsDragging = true;
|
|
item.DraggingPoint = e.Location;
|
|
item.DraggingPoint = e.Location;
|
|
@@ -808,7 +828,12 @@ namespace OTSIncAReportGraph.Controls
|
|
dp.DraggingPoint = e.Location;
|
|
dp.DraggingPoint = e.Location;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- foreach (DisplayField item in m_CurGBFields)
|
|
|
|
|
|
+ foreach (DisplayRectangle item in m_CurGBFields)
|
|
|
|
+ {
|
|
|
|
+ item.IsDragging = true;
|
|
|
|
+ item.DraggingPoint = e.Location;
|
|
|
|
+ }
|
|
|
|
+ foreach (DisplayRectangle item in m_CurGBParticles)
|
|
{
|
|
{
|
|
item.IsDragging = true;
|
|
item.IsDragging = true;
|
|
item.DraggingPoint = e.Location;
|
|
item.DraggingPoint = e.Location;
|
|
@@ -893,6 +918,14 @@ namespace OTSIncAReportGraph.Controls
|
|
item.DraggingMove(e.Location);
|
|
item.DraggingMove(e.Location);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ foreach (var item in m_CurGBParticles)
|
|
|
|
+ {
|
|
|
|
+ if (item.IsDragging)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ item.DraggingMove(e.Location);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
//同样重新计算backrectf的坐标
|
|
//同样重新计算backrectf的坐标
|
|
m_backRect = new RectangleF(m_backRect.Location.X + e.X - m_beforedrag_pointf.X,
|
|
m_backRect = new RectangleF(m_backRect.Location.X + e.X - m_beforedrag_pointf.X,
|
|
m_backRect.Location.Y + e.Y - m_beforedrag_pointf.Y, m_backRect.Width, m_backRect.Height);
|
|
m_backRect.Location.Y + e.Y - m_beforedrag_pointf.Y, m_backRect.Width, m_backRect.Height);
|
|
@@ -902,7 +935,7 @@ namespace OTSIncAReportGraph.Controls
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
|
|
|
|
foreach (DisplayParticle item in a_field.List_DParticle)
|
|
foreach (DisplayParticle item in a_field.List_DParticle)
|
|
@@ -1036,7 +1069,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -1107,7 +1140,7 @@ namespace OTSIncAReportGraph.Controls
|
|
if (m_isDrag)
|
|
if (m_isDrag)
|
|
{
|
|
{
|
|
|
|
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -1147,7 +1180,7 @@ namespace OTSIncAReportGraph.Controls
|
|
bool ifClickOnParticle = false;
|
|
bool ifClickOnParticle = false;
|
|
|
|
|
|
|
|
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
if (imageDisHelper.WhetherInRange(a_field, e.Location))
|
|
if (imageDisHelper.WhetherInRange(a_field, e.Location))
|
|
{
|
|
{
|
|
@@ -1355,7 +1388,7 @@ namespace OTSIncAReportGraph.Controls
|
|
{
|
|
{
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
for (int i = 0; i < particles.Count; i++)
|
|
for (int i = 0; i < particles.Count; i++)
|
|
{
|
|
{
|
|
@@ -1608,7 +1641,7 @@ namespace OTSIncAReportGraph.Controls
|
|
//同样重新计算backrectf的坐标
|
|
//同样重新计算backrectf的坐标
|
|
m_backRect = new RectangleF(in_pointf.X, in_pointf.Y,
|
|
m_backRect = new RectangleF(in_pointf.X, in_pointf.Y,
|
|
m_backRect.Width, m_backRect.Height);
|
|
m_backRect.Width, m_backRect.Height);
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
for (int i = 0; i < a_field.List_DParticle.Count; i++)
|
|
for (int i = 0; i < a_field.List_DParticle.Count; i++)
|
|
{
|
|
{
|
|
@@ -1643,6 +1676,12 @@ namespace OTSIncAReportGraph.Controls
|
|
f.Move(offex_p);
|
|
f.Move(offex_p);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ for (int i = 0; i < m_CurGBParticles.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ var f = m_CurGBParticles[i];
|
|
|
|
+ f.Move(offex_p);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
Invalidate();
|
|
Invalidate();
|
|
@@ -1729,7 +1768,7 @@ namespace OTSIncAReportGraph.Controls
|
|
/// </summary>
|
|
/// </summary>
|
|
public void ReverseSelection()
|
|
public void ReverseSelection()
|
|
{
|
|
{
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -1755,7 +1794,7 @@ namespace OTSIncAReportGraph.Controls
|
|
/// </summary>
|
|
/// </summary>
|
|
public void DeselectAllParticle()
|
|
public void DeselectAllParticle()
|
|
{
|
|
{
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -1764,7 +1803,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ m_CurGBParticles.Clear();
|
|
|
|
|
|
|
|
|
|
this.Invalidate();
|
|
this.Invalidate();
|
|
@@ -1806,7 +1845,7 @@ namespace OTSIncAReportGraph.Controls
|
|
public int GetParticleNumberByState(PaintState in_ParticleState)
|
|
public int GetParticleNumberByState(PaintState in_ParticleState)
|
|
{
|
|
{
|
|
int icount = 0;
|
|
int icount = 0;
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
foreach (DisplayParticle dp in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -1900,7 +1939,7 @@ namespace OTSIncAReportGraph.Controls
|
|
DialogResult dr = MessageBox.Show("Remove all these particles permanently?", "Tips", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
|
|
DialogResult dr = MessageBox.Show("Remove all these particles permanently?", "Tips", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
|
|
if (dr == DialogResult.OK)
|
|
if (dr == DialogResult.OK)
|
|
{
|
|
{
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (var p in a_field.List_DParticle)
|
|
foreach (var p in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -1927,7 +1966,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
public void DeletesParticlesSynchronously(List<Particle> list_Part)
|
|
public void DeletesParticlesSynchronously(List<Particle> list_Part)
|
|
{
|
|
{
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (var p_Selected in list_Part)
|
|
foreach (var p_Selected in list_Part)
|
|
{
|
|
{
|
|
@@ -1984,7 +2023,7 @@ namespace OTSIncAReportGraph.Controls
|
|
}
|
|
}
|
|
public bool WhetherThereAreDeleteParticles()
|
|
public bool WhetherThereAreDeleteParticles()
|
|
{
|
|
{
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (var p in a_field.List_DParticle)
|
|
foreach (var p in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -2099,14 +2138,14 @@ namespace OTSIncAReportGraph.Controls
|
|
{
|
|
{
|
|
foreach (DataRow r in tbl.Rows)
|
|
foreach (DataRow r in tbl.Rows)
|
|
{
|
|
{
|
|
- Point p = new Point(Convert.ToInt32(r["fieldX"]), Convert.ToInt32(r["fieldY"]));
|
|
|
|
|
|
+ PointF p = new PointF(Convert.ToSingle( r["fieldX"]),Convert.ToSingle(r["fieldY"]));
|
|
|
|
|
|
- Point screenP = imageDisHelper.ConvertOTSCoordToScreenCoord(p);
|
|
|
|
|
|
+ PointF screenP = imageDisHelper.ConvertOTSCoordToScreenCoord(p);
|
|
|
|
|
|
- int gbfldwidth = Convert.ToInt32(710.0 / imageDisHelper.m_pixelSize);
|
|
|
|
|
|
+ float gbfldwidth = (float)((float)710.0 / imageDisHelper.m_pixelSize);
|
|
|
|
|
|
|
|
|
|
- var df = new DisplayField(gbfldwidth, gbfldwidth, p, screenP);
|
|
|
|
|
|
+ var df = new DisplayRectangle(gbfldwidth, gbfldwidth, p, screenP);
|
|
|
|
|
|
|
|
|
|
df.Zoom(m_zoom_record - 1, new PointF(0, 0));
|
|
df.Zoom(m_zoom_record - 1, new PointF(0, 0));
|
|
@@ -2159,14 +2198,15 @@ namespace OTSIncAReportGraph.Controls
|
|
foreach (DataRow r in tbl.Rows)
|
|
foreach (DataRow r in tbl.Rows)
|
|
{
|
|
{
|
|
int fid = Convert.ToInt32(r["fieldId"]);
|
|
int fid = Convert.ToInt32(r["fieldId"]);
|
|
- int pid = Convert.ToInt32(r["particleId"]);
|
|
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ string pid =Convert.ToString( r["particleId"]);
|
|
|
|
+ string[] partid = pid.Split(':');
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
if (int.Parse(a_field.FieldID) == fid)
|
|
if (int.Parse(a_field.FieldID) == fid)
|
|
{
|
|
{
|
|
foreach (var p in a_field.List_DParticle)
|
|
foreach (var p in a_field.List_DParticle)
|
|
{
|
|
{
|
|
- if (p.objParticleData.ParticleId == pid)
|
|
|
|
|
|
+ if (p.objParticleData.ParticleId == Convert.ToInt32( partid[1]))
|
|
{
|
|
{
|
|
p.IsSelect = true;
|
|
p.IsSelect = true;
|
|
break;
|
|
break;
|
|
@@ -2188,6 +2228,7 @@ namespace OTSIncAReportGraph.Controls
|
|
private void 清除ToolStripMenuItem_Click(object sender, EventArgs e)
|
|
private void 清除ToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
{
|
|
m_CurGBFields.Clear();
|
|
m_CurGBFields.Clear();
|
|
|
|
+ m_CurGBParticles.Clear();
|
|
Invalidate();
|
|
Invalidate();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2228,7 +2269,7 @@ namespace OTSIncAReportGraph.Controls
|
|
{
|
|
{
|
|
bool deleteflag = true;
|
|
bool deleteflag = true;
|
|
|
|
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (var p in a_field.List_DParticle)
|
|
foreach (var p in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -2334,7 +2375,7 @@ namespace OTSIncAReportGraph.Controls
|
|
clr_prop.SetDataSourceId(index);//
|
|
clr_prop.SetDataSourceId(index);//
|
|
|
|
|
|
clr_prop.SetType((int)DisplayPicutureType.AnalyzeDataTable);//table
|
|
clr_prop.SetType((int)DisplayPicutureType.AnalyzeDataTable);//table
|
|
- DisplayField curfld = new DisplayField(1024,768,new Point(0,0),new Point(0,0));
|
|
|
|
|
|
+ DisplayRectangle curfld = new DisplayRectangle(1024,768,new Point(0,0),new Point(0,0));
|
|
foreach (var f in m_CurGBFields)
|
|
foreach (var f in m_CurGBFields)
|
|
{
|
|
{
|
|
if (imageDisHelper.WhetherInRange(f, m_currentMouseDownPoint))
|
|
if (imageDisHelper.WhetherInRange(f, m_currentMouseDownPoint))
|
|
@@ -2363,7 +2404,7 @@ namespace OTSIncAReportGraph.Controls
|
|
{
|
|
{
|
|
int fid = Convert.ToInt32(r["fieldId"]);
|
|
int fid = Convert.ToInt32(r["fieldId"]);
|
|
int pid = Convert.ToInt32(r["particleId"]);
|
|
int pid = Convert.ToInt32(r["particleId"]);
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
if (int.Parse(a_field.FieldID) == fid)
|
|
if (int.Parse(a_field.FieldID) == fid)
|
|
{
|
|
{
|
|
@@ -2384,40 +2425,93 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
Invalidate();
|
|
Invalidate();
|
|
}
|
|
}
|
|
-
|
|
|
|
- private void aToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
|
|
|
+ private void DisplayGBParticles(string parttype)
|
|
{
|
|
{
|
|
- Cursor = Cursors.WaitCursor;
|
|
|
|
-
|
|
|
|
var tbl = GetAllPartsOfCurrentGBField();
|
|
var tbl = GetAllPartsOfCurrentGBField();
|
|
|
|
+
|
|
if (tbl.Rows.Count > 0)
|
|
if (tbl.Rows.Count > 0)
|
|
{
|
|
{
|
|
foreach (DataRow r in tbl.Rows)
|
|
foreach (DataRow r in tbl.Rows)
|
|
{
|
|
{
|
|
int fid = Convert.ToInt32(r["fieldId"]);
|
|
int fid = Convert.ToInt32(r["fieldId"]);
|
|
- int pid = Convert.ToInt32(r["particleId"]);
|
|
|
|
- var typestr =Convert.ToString( r["gbClassify"]);
|
|
|
|
- if (typestr == "A")
|
|
|
|
|
|
+ string pid = Convert.ToString(r["particleId"]);
|
|
|
|
+ string[] GBpartsid = pid.Split(' ');
|
|
|
|
+ var typestr = Convert.ToString(r["gbClassify"]);
|
|
|
|
+ List<DisplayParticle> parts = new List<DisplayParticle>();
|
|
|
|
+ if (typestr == parttype)
|
|
{
|
|
{
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
- if (int.Parse(a_field.FieldID) == fid)
|
|
|
|
|
|
+
|
|
|
|
+ foreach (var p1 in a_field.List_DParticle)
|
|
{
|
|
{
|
|
- foreach (var p in a_field.List_DParticle)
|
|
|
|
|
|
+ string partid = a_field.FieldID.ToString() + ":" + p1.objParticleData.ParticleId.ToString();
|
|
|
|
+ if (GBpartsid.Contains(partid))
|
|
{
|
|
{
|
|
- if (p.objParticleData.FieldId == fid && p.objParticleData.ParticleId == pid)
|
|
|
|
- {
|
|
|
|
- p.IsSelect = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ parts.Add(p1);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ var pfirst = parts[0];
|
|
|
|
+ float top = pfirst.OTSRect.GetTopLeft().Y;
|
|
|
|
+ float bottom = pfirst.OTSRect.GetBottomRight().Y;
|
|
|
|
+ float left = pfirst.OTSRect.GetTopLeft().X;
|
|
|
|
+ float right = pfirst.OTSRect.GetBottomRight().X;
|
|
|
|
+ foreach (var p2 in parts)
|
|
|
|
+ {
|
|
|
|
+ if (p2.OTSRect.GetTopLeft().Y > top)
|
|
|
|
+ {
|
|
|
|
+ top = p2.OTSRect.GetTopLeft().Y;
|
|
|
|
+ }
|
|
|
|
+ if (p2.OTSRect.GetTopLeft().X < left)
|
|
|
|
+ {
|
|
|
|
+ left = p2.OTSRect.GetTopLeft().X;
|
|
|
|
+ }
|
|
|
|
+ if (p2.OTSRect.GetBottomRight().X > right)
|
|
|
|
+ {
|
|
|
|
+ right = p2.OTSRect.GetBottomRight().X;
|
|
|
|
+ }
|
|
|
|
+ if (p2.OTSRect.GetBottomRight().Y < bottom)
|
|
|
|
+ {
|
|
|
|
+ bottom = p2.OTSRect.GetBottomRight().Y;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ COTSRect rec = new COTSRect(left, top, right, bottom);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ PointF otsPos = new PointF(rec.GetCenterPoint().X, rec.GetCenterPoint().Y);
|
|
|
|
+ PointF screenP = imageDisHelper.ConvertOTSCoordToScreenCoord(otsPos);
|
|
|
|
+
|
|
|
|
+ double gbpartwidth = ((right - left) / imageDisHelper.m_pixelSize);
|
|
|
|
+ double gbpartheight = ((top - bottom) / imageDisHelper.m_pixelSize);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ var gbprec = new DisplayRectangle((float)gbpartwidth, (float)gbpartheight, otsPos, screenP);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ gbprec.Zoom(m_zoom_record - 1, new PointF(0, 0));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ gbprec.Move(new SizeF(-m_backRect.X, -m_backRect.Y));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ m_CurGBParticles.Add(gbprec);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ private void aToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
|
+ {
|
|
|
|
+ Cursor = Cursors.WaitCursor;
|
|
|
|
+
|
|
|
|
+ DisplayGBParticles("A");
|
|
|
|
+
|
|
Cursor = Cursors.Default;
|
|
Cursor = Cursors.Default;
|
|
|
|
|
|
Invalidate();
|
|
Invalidate();
|
|
@@ -2426,33 +2520,7 @@ namespace OTSIncAReportGraph.Controls
|
|
private void bToolStripMenuItem_Click(object sender, EventArgs e)
|
|
private void bToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
{
|
|
Cursor = Cursors.WaitCursor;
|
|
Cursor = Cursors.WaitCursor;
|
|
- var tbl = GetAllPartsOfCurrentGBField();
|
|
|
|
- if (tbl.Rows.Count > 0)
|
|
|
|
- {
|
|
|
|
- foreach (DataRow r in tbl.Rows)
|
|
|
|
- {
|
|
|
|
- int fid = Convert.ToInt32(r["fieldId"]);
|
|
|
|
- int pid = Convert.ToInt32(r["particleId"]);
|
|
|
|
- var typestr = Convert.ToString(r["gbClassify"]);
|
|
|
|
- if (typestr == "B")
|
|
|
|
- {
|
|
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
- {
|
|
|
|
- if (int.Parse(a_field.FieldID) == fid)
|
|
|
|
- {
|
|
|
|
- foreach (var p in a_field.List_DParticle)
|
|
|
|
- {
|
|
|
|
- if (p.objParticleData.FieldId == fid && p.objParticleData.ParticleId == pid)
|
|
|
|
- {
|
|
|
|
- p.IsSelect = true;
|
|
|
|
- break;
|
|
|
|
- }}}
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ DisplayGBParticles("B");
|
|
|
|
|
|
Cursor = Cursors.Default;
|
|
Cursor = Cursors.Default;
|
|
|
|
|
|
@@ -2463,34 +2531,7 @@ namespace OTSIncAReportGraph.Controls
|
|
{
|
|
{
|
|
Cursor = Cursors.WaitCursor;
|
|
Cursor = Cursors.WaitCursor;
|
|
|
|
|
|
- var tbl = GetAllPartsOfCurrentGBField();
|
|
|
|
- if (tbl.Rows.Count > 0)
|
|
|
|
- {
|
|
|
|
- foreach (DataRow r in tbl.Rows)
|
|
|
|
- {
|
|
|
|
- int fid = Convert.ToInt32(r["fieldId"]);
|
|
|
|
- int pid = Convert.ToInt32(r["particleId"]);
|
|
|
|
- var typestr = Convert.ToString(r["gbClassify"]);
|
|
|
|
- if (typestr == "C")
|
|
|
|
- {
|
|
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
- {
|
|
|
|
- if (int.Parse(a_field.FieldID) == fid)
|
|
|
|
- {
|
|
|
|
- foreach (var p in a_field.List_DParticle)
|
|
|
|
- {
|
|
|
|
- if (p.objParticleData.FieldId == fid && p.objParticleData.ParticleId == pid)
|
|
|
|
- {
|
|
|
|
- p.IsSelect = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ DisplayGBParticles("C");
|
|
|
|
|
|
Cursor = Cursors.Default;
|
|
Cursor = Cursors.Default;
|
|
|
|
|
|
@@ -2501,34 +2542,7 @@ namespace OTSIncAReportGraph.Controls
|
|
{
|
|
{
|
|
Cursor = Cursors.WaitCursor;
|
|
Cursor = Cursors.WaitCursor;
|
|
|
|
|
|
- var tbl = GetAllPartsOfCurrentGBField();
|
|
|
|
- if (tbl.Rows.Count > 0)
|
|
|
|
- {
|
|
|
|
- foreach (DataRow r in tbl.Rows)
|
|
|
|
- {
|
|
|
|
- int fid = Convert.ToInt32(r["fieldId"]);
|
|
|
|
- int pid = Convert.ToInt32(r["particleId"]);
|
|
|
|
- var typestr = Convert.ToString(r["gbClassify"]);
|
|
|
|
- if (typestr == "D")
|
|
|
|
- {
|
|
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
- {
|
|
|
|
- if (int.Parse(a_field.FieldID) == fid)
|
|
|
|
- {
|
|
|
|
- foreach (var p in a_field.List_DParticle)
|
|
|
|
- {
|
|
|
|
- if (p.objParticleData.FieldId == fid && p.objParticleData.ParticleId == pid)
|
|
|
|
- {
|
|
|
|
- p.IsSelect = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }}
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ DisplayGBParticles("D");
|
|
|
|
|
|
Cursor = Cursors.Default;
|
|
Cursor = Cursors.Default;
|
|
|
|
|
|
@@ -2629,7 +2643,7 @@ namespace OTSIncAReportGraph.Controls
|
|
{
|
|
{
|
|
DisplayParticle selpart = new DisplayParticle();
|
|
DisplayParticle selpart = new DisplayParticle();
|
|
var overlap = resultFile.GetOverlapParam();
|
|
var overlap = resultFile.GetOverlapParam();
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (var p in a_field.List_DParticle)
|
|
foreach (var p in a_field.List_DParticle)
|
|
{
|
|
{
|
|
@@ -2647,7 +2661,7 @@ namespace OTSIncAReportGraph.Controls
|
|
var selpartPos = selpart.OTSRect.GetCenterPoint();
|
|
var selpartPos = selpart.OTSRect.GetCenterPoint();
|
|
|
|
|
|
var selpartclrobj = GetParticleclrObjFromParticleData(selpart);
|
|
var selpartclrobj = GetParticleclrObjFromParticleData(selpart);
|
|
- foreach (DisplayField a_field in m_list_allDfield)
|
|
|
|
|
|
+ foreach (DisplayRectangle a_field in m_list_allDfield)
|
|
{
|
|
{
|
|
foreach (var otherP in a_field.List_DParticle)
|
|
foreach (var otherP in a_field.List_DParticle)
|
|
{
|
|
{
|