|
|
@@ -1,5 +1,4 @@
|
|
|
using OTSCommon.DBOperate.Model;
|
|
|
-using OTSIncAReportGraph.Class;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Data;
|
|
|
@@ -19,16 +18,15 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
|
|
|
/// <summary>
|
|
|
/// 拼接颗粒黑白图
|
|
|
/// </summary>
|
|
|
- /// <param name="sub">拼接字符串</param>
|
|
|
- /// <param name="xs">xs =1/ pixw </param>
|
|
|
- /// <param name="path">报告文件路径</param>
|
|
|
+ /// <param name="substring">拼接字符串</param>
|
|
|
+ /// <param name="PartdataTable">组成拼接颗粒的子颗粒</param>
|
|
|
/// <param name="picHeight">图像高</param>
|
|
|
/// <param name="picWidth">帧图宽</param>
|
|
|
/// <param name="segsData">KEY为FidANDpID</param>
|
|
|
/// <returns></returns>
|
|
|
- public Bitmap GetBlackAndWhiteBitmapForMergedParticle(string sub, double xs, int picHeight, int picWidth,DataTable PartdataTable,Dictionary<string,List<Segment>> segsData)
|
|
|
+ public Bitmap GetBlackAndWhiteBitmapForMergedParticle(string substring, double pix, int picHeight, int picWidth,DataTable PartdataTable,Dictionary<string,List<Segment>> segsData)
|
|
|
{
|
|
|
- string vs = "," + sub.Replace(':', '-') + ",";
|
|
|
+ string vs = "," + substring.Replace(':', '-') + ",";
|
|
|
|
|
|
if (PartdataTable.Rows.Count == 0)
|
|
|
{
|
|
|
@@ -41,13 +39,13 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
|
|
|
|
|
|
double min_X = 99999999;
|
|
|
//拼接field矩形
|
|
|
- double B_Y = Convert.ToInt64(PartdataTable.Rows[0]["FieldPosY"]) * xs;
|
|
|
- double R_X = Convert.ToInt64(PartdataTable.Rows[0]["FieldPosX"]) * xs;
|
|
|
+ double B_Y = Convert.ToInt64(PartdataTable.Rows[0]["FieldPosY"]) * 1/pix;
|
|
|
+ double R_X = Convert.ToInt64(PartdataTable.Rows[0]["FieldPosX"]) * 1/pix;
|
|
|
double T_Y = B_Y;
|
|
|
double L_X = R_X;
|
|
|
foreach (DataRow item in PartdataTable.Rows)
|
|
|
{
|
|
|
- double lefttopXH = Convert.ToInt64(item["FieldPosX"]) * xs;
|
|
|
+ double lefttopXH = Convert.ToInt64(item["FieldPosX"]) * 1 / pix;
|
|
|
|
|
|
if (lefttopXH > R_X)
|
|
|
{
|
|
|
@@ -57,7 +55,7 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
|
|
|
{
|
|
|
L_X = lefttopXH;
|
|
|
}
|
|
|
- double lrfttopYH = Convert.ToInt64(item["FieldPosY"]) * xs;
|
|
|
+ double lrfttopYH = Convert.ToInt64(item["FieldPosY"]) * 1 / pix;
|
|
|
|
|
|
if (lrfttopYH < B_Y)
|
|
|
{
|
|
|
@@ -77,8 +75,8 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
|
|
|
graph.DrawImage(tableChartImage, 0, 0);
|
|
|
foreach (DataRow item in PartdataTable.Rows)
|
|
|
{
|
|
|
- int x = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosX"]) * xs - L_X));
|
|
|
- int y = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosY"]) * xs - T_Y));
|
|
|
+ int x = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosX"]) * 1 / pix - L_X));
|
|
|
+ int y = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosY"]) * 1 / pix - T_Y));
|
|
|
//颗粒外接矩形
|
|
|
double lefttopX = x + Convert.ToInt64(item["RectLeft"]);
|
|
|
if (lefttopX < min_X)
|
|
|
@@ -141,15 +139,14 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
|
|
|
/// <summary>
|
|
|
/// 拼接颗粒图
|
|
|
/// </summary>
|
|
|
- /// <param name="sub">拼接字符串</param>
|
|
|
- /// <param name="xs">xs = pixw / ScanFieldSize</param>
|
|
|
- /// <param name="path">报告文件路径</param>
|
|
|
+ /// <param name="substring">拼接字符串</param>
|
|
|
/// <param name="picHeight">图像高</param>
|
|
|
/// <param name="picWidth">帧图宽</param>
|
|
|
+ /// <param name="dataTable">组成拼接颗粒的子颗粒</param>
|
|
|
/// <returns></returns>
|
|
|
- public Bitmap GetBitmapForMergedParticle(string sub, double xs, int picHeight, int picWidth,DataTable dataTable)
|
|
|
+ public Bitmap GetBitmapForMergedParticle(string substring, double pix, int picHeight, int picWidth,DataTable dataTable)
|
|
|
{
|
|
|
- string vs = "," + sub.Replace(':', '-') + ",";
|
|
|
+ string vs = "," + substring.Replace(':', '-') + ",";
|
|
|
|
|
|
|
|
|
if (dataTable.Rows.Count == 0)
|
|
|
@@ -163,13 +160,13 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
|
|
|
|
|
|
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;
|
|
|
+ double B_Y = Convert.ToInt64(dataTable.Rows[0]["FieldPosY"]) * 1 / pix;
|
|
|
+ double R_X = Convert.ToInt64(dataTable.Rows[0]["FieldPosX"]) * 1 / pix;
|
|
|
double T_Y = B_Y;
|
|
|
double L_X = R_X;
|
|
|
foreach (DataRow item in dataTable.Rows)
|
|
|
{
|
|
|
- double lefttopXH = Convert.ToInt64(item["FieldPosX"]) * xs;
|
|
|
+ double lefttopXH = Convert.ToInt64(item["FieldPosX"]) * 1 / pix;
|
|
|
|
|
|
if (lefttopXH > R_X)
|
|
|
{
|
|
|
@@ -179,7 +176,7 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
|
|
|
{
|
|
|
L_X = lefttopXH;
|
|
|
}
|
|
|
- double lrfttopYH = Convert.ToInt64(item["FieldPosY"]) * xs;
|
|
|
+ double lrfttopYH = Convert.ToInt64(item["FieldPosY"]) * 1 / pix;
|
|
|
|
|
|
if (lrfttopYH < B_Y)
|
|
|
{
|
|
|
@@ -201,8 +198,8 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
|
|
|
string path1= "Field" + item["fieldid"].ToString() + ".bmp";
|
|
|
//然后将取出的数据,转换成Bitmap对象
|
|
|
Bitmap ls_bt = ReadImageFile(path1);
|
|
|
- int x = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosX"]) * xs - L_X));
|
|
|
- int y = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosY"]) * xs - T_Y));
|
|
|
+ int x = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosX"]) * 1 / pix - L_X));
|
|
|
+ int y = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosY"]) * 1 / pix - T_Y));
|
|
|
|
|
|
graph.DrawImage(ls_bt, x, y);
|
|
|
//颗粒外接矩形
|
|
|
@@ -239,7 +236,7 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
|
|
|
/// </summary>
|
|
|
/// <param name="in_cotsparticleclr"></param>
|
|
|
/// <returns></returns>
|
|
|
- public Bitmap GetBitmapByParticle(DataTable dataTable)
|
|
|
+ public Bitmap GetBitmapByParticleForUncombinedParticle(DataTable dataTable)
|
|
|
{
|
|
|
string path1 = "Field" + dataTable.Rows[0]["fieldid"].ToString() + ".bmp";
|
|
|
//然后将取出的数据,转换成Bitmap对象
|
|
|
@@ -291,40 +288,40 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
|
|
|
/// <summary>
|
|
|
/// 获取全部颗粒图
|
|
|
/// </summary>
|
|
|
- /// <param name="sub">拼接颗粒连接字符串</param>
|
|
|
+ /// <param name="substring">拼接颗粒连接字符串</param>
|
|
|
/// <param name="dataTable">颗粒表</param>
|
|
|
- /// <param name="xs">pixel</param>
|
|
|
+ /// <param name="pix">pixel</param>
|
|
|
/// <param name="picHeight">帧图高</param>
|
|
|
/// <param name="picWidth">帧图宽</param>
|
|
|
/// <returns></returns>
|
|
|
- public Bitmap GetBitmapForParticleAll(string sub, DataTable dataTable, double xs=0, int picHeight=0, int picWidth=0)
|
|
|
+ public Bitmap GetBitmapForParticleAll(string substring, DataTable dataTable, double pix=0, int picHeight=0, int picWidth=0)
|
|
|
{
|
|
|
Bitmap bmap;
|
|
|
- if(sub != "")
|
|
|
+ if(substring != "")
|
|
|
{
|
|
|
- bmap = GetBitmapForMergedParticle(sub, xs, picHeight, picWidth,dataTable);
|
|
|
+ bmap = GetBitmapForMergedParticle(substring, pix, picHeight, picWidth,dataTable);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- bmap=GetBitmapByParticle(dataTable);
|
|
|
+ bmap=GetBitmapByParticleForUncombinedParticle(dataTable);
|
|
|
}
|
|
|
return bmap;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取全部颗粒图
|
|
|
/// </summary>
|
|
|
- /// <param name="sub">拼接颗粒连接字符串</param>
|
|
|
- /// <param name="dataTable">颗粒表</param>
|
|
|
- /// <param name="xs">pixel</param>
|
|
|
+ /// <param name="subsubstring">拼接颗粒连接字符串</param>
|
|
|
+ /// <param name="dataTable">颗粒表 或 组成拼接颗粒的子颗粒表</param>
|
|
|
+ /// <param name="pix">pixel</param>
|
|
|
/// <param name="picHeight">帧图高</param>
|
|
|
/// <param name="picWidth">帧图宽</param>
|
|
|
/// <returns></returns>
|
|
|
- public Bitmap GetBitmapForParticleAllWithBlackAndWhite(string sub, DataTable dataTable, Dictionary<string, List<Segment>> segsData, double xs = 0, int picHeight = 0, int picWidth = 0)
|
|
|
+ public Bitmap GetBitmapForParticleAllWithBlackAndWhite(string subsubstring, DataTable dataTable, Dictionary<string, List<Segment>> segsData, double pix = 0, int picHeight = 0, int picWidth = 0)
|
|
|
{
|
|
|
Bitmap bmap;
|
|
|
- if (sub != "")
|
|
|
+ if (subsubstring != "")
|
|
|
{
|
|
|
- bmap = GetBlackAndWhiteBitmapForMergedParticle(sub, xs, picHeight, picWidth, dataTable, segsData);
|
|
|
+ bmap = GetBlackAndWhiteBitmapForMergedParticle(subsubstring, pix, picHeight, picWidth, dataTable, segsData);
|
|
|
}
|
|
|
else
|
|
|
{
|