|
@@ -116,7 +116,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
//总背景矩形
|
|
|
private RectangleF m_backRect = new RectangleF();
|
|
|
|
|
|
-
|
|
|
+ private PointF m_ScaleRefPoint;
|
|
|
|
|
|
|
|
|
//记录总物理矩形总大小
|
|
@@ -194,11 +194,11 @@ namespace OTSIncAReportGraph.Controls
|
|
|
/// <summary>
|
|
|
/// 背景矩形属性
|
|
|
/// </summary>
|
|
|
- public RectangleF BackRectF
|
|
|
- {
|
|
|
- set { m_backRect = value; }
|
|
|
- get { return m_backRect; }
|
|
|
- }
|
|
|
+ //public RectangleF BackRectF
|
|
|
+ //{
|
|
|
+ // set { m_backRect = value; }
|
|
|
+ // get { return m_backRect; }
|
|
|
+ //}
|
|
|
|
|
|
//public OTSImageDisHelp ImageDisHelper { get => imageDisHelper; set => imageDisHelper = value; }
|
|
|
|
|
@@ -301,7 +301,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
//初始化底层操作类
|
|
|
imageDisHelper = new OTSImageDisHelp(resultFile);
|
|
|
|
|
|
- m_backRect = imageDisHelper.m_wholeBackRect;
|
|
|
+ m_backRect = imageDisHelper.m_originalBackRect;
|
|
|
|
|
|
string str29 = "begin to compose field picture....";
|
|
|
log.Info(str29);
|
|
@@ -320,8 +320,8 @@ namespace OTSIncAReportGraph.Controls
|
|
|
for (int i = 0; i < fieldlist.Count(); i++)
|
|
|
{
|
|
|
ProgressBarUpdate(20 + (int)(ls_int_progresscalc * (i + 1)), "finished " + i.ToString() + "total " + resultFile.List_OTSField.Count.ToString() + "field...");
|
|
|
- //取出该Field的物理坐标,将其转换成对应的屏幕像素坐标,屏幕左上角为原点(0,0)的偏移值,用于后面计算各Segment的位置使用
|
|
|
- Point thisfield_point = new Point() { X = fieldlist[i].FieldPosX, Y = fieldlist[i].FieldPosY };
|
|
|
+
|
|
|
+ Point thisfield_point = new Point() { 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;
|
|
@@ -656,9 +656,11 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
private void ImageZoom(float newZoom,PointF refPoint)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
+ m_ScaleRefPoint = refPoint;
|
|
|
float zoomDelta = newZoom - m_zoom_record;
|
|
|
- //if (zoomDelta == 0) return;
|
|
|
+
|
|
|
+
|
|
|
m_backRect.Width += m_backRect.Width/m_zoom_record*zoomDelta;
|
|
|
m_backRect.Height += m_backRect.Height / m_zoom_record*zoomDelta;
|
|
|
//锚点缩放补差值计算,得出差值
|
|
@@ -670,7 +672,8 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
//对背景矩形与所有的segment进行修补差值
|
|
|
m_backRect.X = refPoint.X + xShift;
|
|
|
- m_backRect.Y = refPoint.Y + yShift;
|
|
|
+ m_backRect.Y = refPoint.Y + yShift;
|
|
|
+
|
|
|
|
|
|
for (int i = 0; i < m_list_allDPart.Count(); i++)
|
|
|
{
|
|
@@ -749,8 +752,8 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
|
|
|
ImageZoom(currentZoom, new PointF(e.X, e.Y));
|
|
|
-
|
|
|
|
|
|
+
|
|
|
Invalidate();
|
|
|
}
|
|
|
|
|
@@ -902,7 +905,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
}
|
|
|
//同样重新计算backrectf的坐标
|
|
|
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);
|
|
|
m_beforedrag_pointf = e.Location;
|
|
|
|
|
|
|
|
@@ -1456,8 +1459,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
{
|
|
|
this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
|
|
|
SaveFileDialog sfd = new SaveFileDialog();
|
|
|
- //|ALL Files(*.*)|*.*
|
|
|
- //BMP Files(*.bmp)| *.bmp |
|
|
|
+
|
|
|
sfd.Filter = "png Files(*.png)| *.png |BMP Files(*.bmp)| *.bmp |JPG Files(*.jpg)|*.jpg;*.jpeg";
|
|
|
if (sfd.ShowDialog() == DialogResult.OK)
|
|
|
{
|
|
@@ -1669,7 +1671,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
//同样重新计算backrectf的坐标
|
|
|
m_backRect = new RectangleF(in_pointf.X, in_pointf.Y,
|
|
|
- m_backRect.Width, m_backRect.Height);
|
|
|
+ m_backRect.Width, m_backRect.Height);
|
|
|
|
|
|
for (int i = 0; i < m_list_allDPart.Count; i++)
|
|
|
{
|
|
@@ -1915,67 +1917,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- private static byte[] ImgtoByte(Image img)
|
|
|
- {
|
|
|
- MemoryStream ms = new MemoryStream();
|
|
|
- byte[] imagedata = null;
|
|
|
- img.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
|
|
|
- imagedata = ms.GetBuffer();
|
|
|
- return imagedata;
|
|
|
- }
|
|
|
- private static Image BytesToImage(byte[] buffer)
|
|
|
- {
|
|
|
- MemoryStream ms = new MemoryStream(buffer);
|
|
|
- Image image = System.Drawing.Image.FromStream(ms);
|
|
|
- return image;
|
|
|
- }
|
|
|
-
|
|
|
- #region Debug下执行的辅助测试代码
|
|
|
- private void Control_DrawDistrbutionImageAndBSE_MouseDoubleClick(object sender, MouseEventArgs e)
|
|
|
- {
|
|
|
-#if DEBUG
|
|
|
- Screen[] screens = Screen.AllScreens;
|
|
|
- string ls_str = "";
|
|
|
- for (int i = 0; i < screens.Count(); i++)
|
|
|
- {
|
|
|
- ls_str = ls_str + "显示器" + (i + 1).ToString() + " 名称:" + screens[i].DeviceName + Environment.NewLine +
|
|
|
- "显示器" + (i + 1).ToString() + " 是否主要显示器:" + screens[i].Primary + Environment.NewLine +
|
|
|
- "显示器" + (i + 1).ToString() + " WorkingArea:" + screens[i].WorkingArea + Environment.NewLine +
|
|
|
- "显示器" + (i + 1).ToString() + " Bounds:" + screens[i].Bounds + Environment.NewLine +
|
|
|
- "显示器" + (i + 1).ToString() + " 色深:" + screens[i].BitsPerPixel + Environment.NewLine;
|
|
|
- }
|
|
|
-
|
|
|
- MessageBox.Show("------------------该段代码主要用来测试程序---------------------" + Environment.NewLine +
|
|
|
- //"当前窗体X:" + this.ParentForm.Location.X.ToString() + " Y:" + this.ParentForm.Location.Y.ToString() + Environment.NewLine +
|
|
|
- "显示器数量" + Screen.AllScreens.Count().ToString() + Environment.NewLine +
|
|
|
- ls_str +
|
|
|
- "DESKTOP.Width:" + MyPrimaryScreen.DESKTOP.Width + " DESKTOP.Height:" + MyPrimaryScreen.DESKTOP.Height + Environment.NewLine +
|
|
|
- "DpiX:" + MyPrimaryScreen.DpiX + " DpiY:" + MyPrimaryScreen.DpiY + Environment.NewLine +
|
|
|
- "ScaleX:" + MyPrimaryScreen.ScaleX + " ScaleY:" + MyPrimaryScreen.ScaleY + Environment.NewLine +
|
|
|
- "WorkingArea.Width:" + MyPrimaryScreen.WorkingArea.Width + " WorkingArea.Height:" + MyPrimaryScreen.WorkingArea.Height + Environment.NewLine +
|
|
|
- "this.Width:" + this.Width + " this.Height:" + this.Height + Environment.NewLine +
|
|
|
- "单像素比:" + m_pixelSize.ToString() + Environment.NewLine +
|
|
|
- "缩放倍数:" + m_zoom_record.ToString() + Environment.NewLine +
|
|
|
- "屏幕像素backrectf x:" + m_backRect.X.ToString() + " y:" + m_backRect.Y.ToString() + " width:" + m_backRect.Width.ToString() + " height:" + m_backRect.Height.ToString() + Environment.NewLine +
|
|
|
- //"屏幕像素oldbackrectf x:" + m_original_backRect.X.ToString() + " y:" + m_original_backRect.Y.ToString() + " width:" + m_original_backRect.Width.ToString() + " height:" + m_original_backRect.Height.ToString() + Environment.NewLine +
|
|
|
- "物理像素back_wl_rectf x:" + m_back_wl_rectf.X.ToString() + " y:" + m_back_wl_rectf.Y.ToString() + " width:" + m_back_wl_rectf.Width.ToString() + " height:" + m_back_wl_rectf.Height.ToString() + Environment.NewLine +
|
|
|
- //"单个Field视域屏幕像素宽:" + m_OneField_Screen_BackRectf.Width.ToString() + " 高:" + m_OneField_Screen_BackRectf.Height.ToString() + Environment.NewLine +
|
|
|
- //"单个OTS视域屏幕像素宽:" + m_OneField_OTS_Rect.Width.ToString() + " 高:" + m_OneField_OTS_Rect.Height.ToString() + Environment.NewLine +
|
|
|
- "屏幕像素backrectf x:" + m_backRect.X.ToString() + " y:" + m_backRect.Y.ToString() + " width:" + m_backRect.Width.ToString() + " height:" + m_backRect.Height.ToString() + Environment.NewLine +
|
|
|
- //"包含Field数量:" + imageDisHelper.m_field_count.ToString() + " Particle数量:" + imageDisHelper.m_particle_count.ToString() + Environment.NewLine +
|
|
|
- "正常显示Paticle数量:" + GetParticleNumberByState(PaintState.PAINT).ToString() + " 不显示Particel数量:" + GetParticleNumberByState(PaintState.NOPAINT).ToString() + Environment.NewLine +
|
|
|
- //"删除Particle数量:" + GetParticleNumberByState("删除").ToString() + " 选中Particle数量:" + GetParticleNumberByState("选择").ToString() + Environment.NewLine +
|
|
|
- //"加载底层数据用时:" + imageDisHelper.m_time_str + Environment.NewLine +
|
|
|
- //"组建并计算图像用时:" + imageDisHelper.m_time_str2 + Environment.NewLine +
|
|
|
- "---------------------------END----------------------------------"
|
|
|
- );
|
|
|
-#endif
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- #endregion
|
|
|
+
|
|
|
|
|
|
private void ExportoriginalspliceToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
{
|
|
@@ -2211,6 +2153,10 @@ namespace OTSIncAReportGraph.Controls
|
|
|
clr_prop.SetCalTableType((int)CALCULATE_TABLE_TYPE.GB_Method2);
|
|
|
tbl = m_ReportApp.m_rstDataMgr.m_ReportMgr.GetGBDSParticles(clr_prop);
|
|
|
break;
|
|
|
+ case "ASTMAll":
|
|
|
+ clr_prop.SetCalTableType((int)CALCULATE_TABLE_TYPE.ASTM);
|
|
|
+ tbl = m_ReportApp.m_rstDataMgr.m_ReportMgr.GetAllGBFields(clr_prop);
|
|
|
+ break;
|
|
|
|
|
|
default:
|
|
|
tbl = new DataTable();
|
|
@@ -2219,21 +2165,28 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
|
|
|
}
|
|
|
- FullGraphMatch();
|
|
|
- if (tag == "All1" || tag == "All2")
|
|
|
+
|
|
|
+ if (tag == "All1" || tag == "All2" || tag=="ASTMAll")
|
|
|
{
|
|
|
if (tbl.Rows.Count > 0)
|
|
|
{
|
|
|
foreach (DataRow r in tbl.Rows)
|
|
|
{
|
|
|
Point p = new Point(Convert.ToInt32(r["fieldX"]), Convert.ToInt32(r["fieldY"]));
|
|
|
- //double GBFieldwidth = 710;
|
|
|
+
|
|
|
Point screenP = imageDisHelper.ConvertOTSCoordToScreenCoord(p);
|
|
|
+
|
|
|
int gbfldwidth = Convert.ToInt32(710.0 / imageDisHelper.m_pixelSize);
|
|
|
+
|
|
|
|
|
|
var df = new DisplayField(gbfldwidth, gbfldwidth, screenP);
|
|
|
- df.Zoom(m_zoom_record - 1, new Point(0,0));
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ df.Zoom(m_zoom_record - 1, new PointF(0, 0));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ df.Move(new SizeF(-m_backRect.X,-m_backRect.Y));
|
|
|
|
|
|
int topgrade = Convert.ToInt32(r["topGrade"]);
|
|
|
switch (topgrade)
|
|
@@ -2248,7 +2201,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
df.DisColor = Color.Purple;
|
|
|
break;
|
|
|
case 3:
|
|
|
- df.DisColor = Color.DarkBlue;
|
|
|
+ df.DisColor = Color.Blue;
|
|
|
break;
|
|
|
case 4:
|
|
|
df.DisColor = Color.Red;
|