|
|
@@ -1,10 +1,6 @@
|
|
|
-using DevExpress.Charts.Native;
|
|
|
-using DevExpress.XtraDiagram.Bars;
|
|
|
-using DevExpress.XtraEditors.Filtering;
|
|
|
-using OTSCommon.DBOperate;
|
|
|
+using OTSCommon.DBOperate;
|
|
|
using OTSCommon.DBOperate.Model;
|
|
|
using OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration;
|
|
|
-using OTSIncAReportApp.OTSRstMgrFunction;
|
|
|
using OTSIncAReportGraph.Controls;
|
|
|
using OTSPeriodicTable;
|
|
|
using System;
|
|
|
@@ -1007,7 +1003,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
/// <param name="X_AXIS_DIRECTION">电镜x轴正方向</param>
|
|
|
/// <param name="Y_AXIS_DIRECTION">电镜y轴正方向</param>
|
|
|
/// <returns></returns>
|
|
|
- public Bitmap GetBitmapForBig(string sub, double xs, string path, int picHeight, int picWidth, OTS_X_AXIS_DIRECTION X_AXIS_DIRECTION, OTS_Y_AXIS_DIRECTION Y_AXIS_DIRECTION)
|
|
|
+ public Bitmap GetBitmapForBig(string sub, double xs, string path, int picHeight, int picWidth)
|
|
|
{
|
|
|
string vs = "," + sub.Replace(':', '-') + ",";
|
|
|
|
|
|
@@ -1017,11 +1013,11 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
return null;
|
|
|
}
|
|
|
//内接矩形
|
|
|
- double max_Y = Convert.ToInt64(dataTable.Rows[0]["RectTop"]);
|
|
|
- double max_X = Convert.ToInt64(dataTable.Rows[0]["RectLeft"]);
|
|
|
- double min_Y = max_Y;
|
|
|
+ double max_Y = -1;
|
|
|
+ double max_X = -1;
|
|
|
+ double min_Y = 99999999;
|
|
|
|
|
|
- double min_X = max_X;
|
|
|
+ double min_X = 99999999;
|
|
|
//拼接field矩形
|
|
|
double B_Y = Convert.ToInt64(dataTable.Rows[0]["FieldPosY"]) * xs;
|
|
|
double R_X = Convert.ToInt64(dataTable.Rows[0]["FieldPosX"]) * xs;
|
|
|
@@ -1030,50 +1026,24 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
foreach (DataRow item in dataTable.Rows)
|
|
|
{
|
|
|
double lefttopXH = Convert.ToInt64(item["FieldPosX"]) * xs;
|
|
|
- if (X_AXIS_DIRECTION == OTS_X_AXIS_DIRECTION.LEFT_TOWARD)
|
|
|
+
|
|
|
+ if (lefttopXH > R_X)
|
|
|
{
|
|
|
- if (lefttopXH > L_X)
|
|
|
- {
|
|
|
- L_X = lefttopXH;
|
|
|
- }
|
|
|
- if (lefttopXH < R_X)
|
|
|
- {
|
|
|
- R_X = lefttopXH;
|
|
|
- }
|
|
|
+ R_X = lefttopXH;
|
|
|
}
|
|
|
- else
|
|
|
+ if (lefttopXH < L_X)
|
|
|
{
|
|
|
- if (lefttopXH < R_X)
|
|
|
- {
|
|
|
- R_X = lefttopXH;
|
|
|
- }
|
|
|
- if (lefttopXH > L_X)
|
|
|
- {
|
|
|
- L_X = lefttopXH;
|
|
|
- }
|
|
|
+ L_X = lefttopXH;
|
|
|
}
|
|
|
double lrfttopYH = Convert.ToInt64(item["FieldPosY"]) * xs;
|
|
|
- if (Y_AXIS_DIRECTION == OTS_Y_AXIS_DIRECTION.UP_TOWARD)
|
|
|
+
|
|
|
+ if (lrfttopYH < B_Y)
|
|
|
{
|
|
|
- if (lrfttopYH < B_Y)
|
|
|
- {
|
|
|
- B_Y = lrfttopYH;
|
|
|
- }
|
|
|
- if (lrfttopYH > T_Y)
|
|
|
- {
|
|
|
- T_Y = lrfttopYH;
|
|
|
- }
|
|
|
+ B_Y = lrfttopYH;
|
|
|
}
|
|
|
- else
|
|
|
+ if (lrfttopYH > T_Y)
|
|
|
{
|
|
|
- if (lrfttopYH > B_Y)
|
|
|
- {
|
|
|
- B_Y= lrfttopYH;
|
|
|
- }
|
|
|
- if (lrfttopYH < T_Y)
|
|
|
- {
|
|
|
- T_Y = lrfttopYH;
|
|
|
- }
|
|
|
+ T_Y = lrfttopYH;
|
|
|
}
|
|
|
}
|
|
|
int WIDTH = Math.Abs(Convert.ToInt32(R_X - L_X)) + picWidth;
|
|
|
@@ -1081,7 +1051,6 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
//构造最终的图片白板
|
|
|
Bitmap tableChartImage = new Bitmap(WIDTH, HEIGHT);
|
|
|
Graphics graph = Graphics.FromImage(tableChartImage);
|
|
|
- //初始化这个大图
|
|
|
graph.DrawImage(tableChartImage, 0, 0);
|
|
|
foreach (DataRow item in dataTable.Rows)
|
|
|
{
|
|
|
@@ -1119,6 +1088,8 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
int Y = Convert.ToInt32(min_Y);
|
|
|
Rectangle rectangle = new Rectangle() { X = X, Y = Y, Width = width, Height = height };
|
|
|
Bitmap bmap = tableChartImage.Clone(rectangle, PixelFormat.Format8bppIndexed);
|
|
|
+ graph.DrawImage(tableChartImage, 0, 0);
|
|
|
+
|
|
|
return bmap;
|
|
|
}
|
|
|
|
|
|
@@ -1134,7 +1105,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
/// <param name="X_AXIS_DIRECTION">电镜x轴正方向</param>
|
|
|
/// <param name="Y_AXIS_DIRECTION">电镜y轴正方向</param>
|
|
|
/// <returns></returns>
|
|
|
- public Bitmap GetBitmapForBigBlackAndWhiteImage(string sub, double xs, string path, int picHeight, int picWidth, OTS_X_AXIS_DIRECTION X_AXIS_DIRECTION, OTS_Y_AXIS_DIRECTION Y_AXIS_DIRECTION)
|
|
|
+ public Bitmap GetBitmapForBigBlackAndWhiteImage(string sub, double xs, string path, int picHeight, int picWidth)
|
|
|
{
|
|
|
string vs = "," + sub.Replace(':', '-') + ",";
|
|
|
DataTable dataTable = GetParticleAllForBig(vs);
|
|
|
@@ -1143,10 +1114,11 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
return null;
|
|
|
}
|
|
|
//内接矩形
|
|
|
- double max_Y = Convert.ToInt64(dataTable.Rows[0]["RectTop"]);
|
|
|
- double max_X = Convert.ToInt64(dataTable.Rows[0]["RectLeft"]);
|
|
|
- double min_Y = max_Y;
|
|
|
- double min_X = max_X;
|
|
|
+ double max_Y = -1;
|
|
|
+ double max_X = -1;
|
|
|
+ double min_Y = 99999999;
|
|
|
+
|
|
|
+ double min_X = 99999999;
|
|
|
//拼接field矩形
|
|
|
double B_Y = Convert.ToInt64(dataTable.Rows[0]["FieldPosY"]) * xs;
|
|
|
double R_X = Convert.ToInt64(dataTable.Rows[0]["FieldPosX"]) * xs;
|
|
|
@@ -1155,50 +1127,24 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
foreach (DataRow item in dataTable.Rows)
|
|
|
{
|
|
|
double lefttopXH = Convert.ToInt64(item["FieldPosX"]) * xs;
|
|
|
- if (X_AXIS_DIRECTION == OTS_X_AXIS_DIRECTION.LEFT_TOWARD)
|
|
|
+
|
|
|
+ if (lefttopXH > R_X)
|
|
|
{
|
|
|
- if (lefttopXH > L_X)
|
|
|
- {
|
|
|
- L_X = lefttopXH;
|
|
|
- }
|
|
|
- if (lefttopXH < R_X)
|
|
|
- {
|
|
|
- R_X = lefttopXH;
|
|
|
- }
|
|
|
+ R_X = lefttopXH;
|
|
|
}
|
|
|
- else
|
|
|
+ if (lefttopXH < L_X)
|
|
|
{
|
|
|
- if (lefttopXH < R_X)
|
|
|
- {
|
|
|
- R_X = lefttopXH;
|
|
|
- }
|
|
|
- if (lefttopXH > L_X)
|
|
|
- {
|
|
|
- L_X = lefttopXH;
|
|
|
- }
|
|
|
+ L_X = lefttopXH;
|
|
|
}
|
|
|
double lrfttopYH = Convert.ToInt64(item["FieldPosY"]) * xs;
|
|
|
- if (Y_AXIS_DIRECTION == OTS_Y_AXIS_DIRECTION.UP_TOWARD)
|
|
|
+
|
|
|
+ if (lrfttopYH < B_Y)
|
|
|
{
|
|
|
- if (lrfttopYH < B_Y)
|
|
|
- {
|
|
|
- B_Y = lrfttopYH;
|
|
|
- }
|
|
|
- if (lrfttopYH > T_Y)
|
|
|
- {
|
|
|
- T_Y = lrfttopYH;
|
|
|
- }
|
|
|
+ B_Y = lrfttopYH;
|
|
|
}
|
|
|
- else
|
|
|
+ if (lrfttopYH > T_Y)
|
|
|
{
|
|
|
- if (lrfttopYH > B_Y)
|
|
|
- {
|
|
|
- B_Y = lrfttopYH;
|
|
|
- }
|
|
|
- if (lrfttopYH < T_Y)
|
|
|
- {
|
|
|
- T_Y = lrfttopYH;
|
|
|
- }
|
|
|
+ T_Y = lrfttopYH;
|
|
|
}
|
|
|
}
|
|
|
int WIDTH = Math.Abs(Convert.ToInt32(R_X - L_X)) + picWidth;
|