read excel data
This commit is contained in:
@@ -84,7 +84,7 @@ namespace TetraPackOCR
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 共印依据 QSV Design, Layers, Colours,产品规格
|
/// 共印依据 QSV Design, Layers, Colours,产品规格
|
||||||
/// </summary>
|
/// </summary>
|
||||||
string QSV, Colours, ProductStandard;
|
string QSV, ProductStandard;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 幅数 包材宽 梯度 X距离 Y距离
|
/// 幅数 包材宽 梯度 X距离 Y距离
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -677,241 +677,123 @@ namespace TetraPackOCR
|
|||||||
btn_OrderNum.BackColor = Color.DeepSkyBlue;
|
btn_OrderNum.BackColor = Color.DeepSkyBlue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string laststr;
|
|
||||||
if (order.Length > 1)
|
log.Info("当前订单号为:" + order);
|
||||||
laststr = order.Substring(order.Length - 1);
|
//读取表格内容
|
||||||
else
|
ExcelPackage.License.SetNonCommercialOrganization("My Noncommercial organization");
|
||||||
laststr = order;
|
using (ExcelPackage package = new ExcelPackage(execlFileName))
|
||||||
if (laststr == "C")
|
|
||||||
{
|
{
|
||||||
log.Info("当前订单号为:" + order);
|
sheet1 = package.Workbook.Worksheets["P2生成数据"];
|
||||||
//读取表格内容
|
sheet2 = package.Workbook.Worksheets["QSV对应产品规格和梯度"];
|
||||||
ExcelPackage.License.SetNonCommercialOrganization("My Noncommercial organization");
|
sheet3 = package.Workbook.Worksheets["产品规格对应排布方式"];
|
||||||
using (ExcelPackage package = new ExcelPackage(execlFileName))
|
//根据订单遍历sheet1 找Sequence QSV NumOFLanes 字符
|
||||||
|
for (int i = 1; i < sheet1.Dimension.Rows; i++)
|
||||||
{
|
{
|
||||||
sheet1 = package.Workbook.Worksheets["P2生成数据"];
|
if (sheet1.GetValue(i, 3) != null)
|
||||||
sheet2 = package.Workbook.Worksheets["QSV对应产品规格和梯度"];
|
|
||||||
sheet3 = package.Workbook.Worksheets["产品规格对应排布方式"];
|
|
||||||
string FirstLayers = "";
|
|
||||||
//根据订单遍历sheet1 找Sequence QSV NumOFLanes 字符
|
|
||||||
for (int i = 1; i < sheet1.Dimension.Rows; i++)
|
|
||||||
{
|
{
|
||||||
if (sheet1.GetValue(i, 3) != null)
|
if (sheet1.Cells[i, 3].Value.ToString() == order)
|
||||||
{
|
{
|
||||||
if (sheet1.Cells[i, 3].Value.ToString() == order)
|
QSV = sheet1.Cells[i, 4].Value.ToString();
|
||||||
|
lbl_QSVShow.Text = QSV;
|
||||||
|
log.Info("当前订单QSV:" + QSV);
|
||||||
|
NumberOfLanes = Convert.ToInt32(sheet1.Cells[i, 5].Value.ToString());
|
||||||
|
log.Info("当前订单Number Of Lanes:" + NumberOfLanes);
|
||||||
|
lbl_NOFShow.Text = sheet1.Cells[i, 5].Value.ToString();
|
||||||
|
|
||||||
|
int num = 0;
|
||||||
|
for (int k = 0; k < 10; k++)
|
||||||
{
|
{
|
||||||
QSV = sheet1.Cells[i, 4].Value.ToString();
|
string lanes = sheet1.Cells[i + k, 6].Value.ToString();
|
||||||
lbl_QSVShow.Text = QSV;
|
string design = sheet1.Cells[i + k, 7].Value.ToString().Split('-')[1];
|
||||||
log.Info("当前订单QSV:" + QSV);
|
lanes = lanes.Substring(1, lanes.Length - 2);
|
||||||
NumberOfLanes = Convert.ToInt32(sheet1.Cells[i, 5].Value.ToString());
|
string[] tmp = lanes.Split(',');
|
||||||
log.Info("当前订单Number Of Lanes:" + NumberOfLanes);
|
num += tmp.Length;
|
||||||
lbl_NOFShow.Text = sheet1.Cells[i, 5].Value.ToString();
|
List<string> textOCR = ExecelGetOcrText(design, sheet1.Cells[i + k, 8].Value.ToString());
|
||||||
FirstLayers = sheet1.Cells[i, 8].Value.ToString();
|
foreach (string lan in tmp)
|
||||||
Colours = sheet1.Cells[i, 9].Value.ToString();
|
|
||||||
|
|
||||||
int num = 0;
|
|
||||||
for (int k = 0; k < 10; k++)
|
|
||||||
{
|
{
|
||||||
string lanes = sheet1.Cells[i + k, 6].Value.ToString();
|
int lanInt = Convert.ToInt32(lan);
|
||||||
string design = sheet1.Cells[i + k, 7].Value.ToString();
|
ocrTextRequest[lanInt] = textOCR;
|
||||||
string layers = sheet1.Cells[i + k, 8].Value.ToString();
|
ocrTextDesign[lanInt] = design;
|
||||||
string colours = sheet1.Cells[i + k, 9].Value.ToString();
|
|
||||||
lanes = lanes.Substring(1, lanes.Length - 2);
|
|
||||||
string[] tmp = lanes.Split(',');
|
|
||||||
num += tmp.Length;
|
|
||||||
foreach (string lan in tmp)
|
|
||||||
{
|
|
||||||
int lanInt = Convert.ToInt32(lan);
|
|
||||||
ocrTextRequest[lanInt] = ExecelGetOcrText(design, layers);
|
|
||||||
ocrTextDesign[lanInt] = design;
|
|
||||||
}
|
|
||||||
listBox1.Items.Add(sheet1.Cells[i + k, 6].Value.ToString());
|
|
||||||
listBox1.Items.Add(string.Join(",", ocrTextRequest[Convert.ToInt32(tmp[0])]));
|
|
||||||
|
|
||||||
if (num >= NumberOfLanes)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
listBox1.Items.Add(sheet1.Cells[i + k, 6].Value.ToString());
|
||||||
}
|
listBox1.Items.Add(string.Join(",", textOCR));
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(QSV))
|
if (num >= NumberOfLanes)
|
||||||
{
|
|
||||||
string qsv;
|
|
||||||
//根据得到的QSV遍历sheet2 找产品规格和宽度梯度
|
|
||||||
for (int j = 1; j <= sheet2.Dimension.Rows; j++)
|
|
||||||
{
|
|
||||||
qsv = sheet2.Cells[j, 1].Value.ToString();
|
|
||||||
if (qsv == QSV)
|
|
||||||
{
|
|
||||||
ProductStandard = sheet2.Cells[j, 2].Value.ToString();
|
|
||||||
lbl_ProductStandardShow.Text = ProductStandard;
|
|
||||||
log.Info("当前订单产品编号:" + ProductStandard);
|
|
||||||
width = Convert.ToDouble(sheet2.Cells[j, 3].Value.ToString());
|
|
||||||
lbl_widthShow.Text = sheet2.Cells[j, 3].Value.ToString();
|
|
||||||
log.Info("当前订单幅宽:" + width);
|
|
||||||
Gradient = Convert.ToDouble(sheet2.Cells[j, 4].Value.ToString());
|
|
||||||
lbl_GradientShow.Text = sheet2.Cells[j, 4].Value.ToString();
|
|
||||||
log.Info("当前订单梯度:" + Gradient);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (string.IsNullOrEmpty(ProductStandard))
|
|
||||||
{
|
|
||||||
log.Debug("ProductStandard未找到,请检查订单号是否正确");
|
|
||||||
btn_OrderNum.Enabled = true;
|
|
||||||
btn_OrderNum.BackColor = Color.DeepSkyBlue;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//根据产品规格获取距离坐标
|
|
||||||
for (int n = 1; n < sheet3.Dimension.Rows; n++)
|
|
||||||
{
|
|
||||||
if (sheet3.GetValue(n, 1) != null)
|
|
||||||
{
|
|
||||||
if (sheet3.Cells[n, 1].Value.ToString() == ProductStandard)
|
|
||||||
{
|
|
||||||
string str = sheet3.Cells[n + FirstLayers.Split(',').Length - 1, 4].Value.ToString();
|
|
||||||
string[] x_y = str.Split(',');
|
|
||||||
string[] X = x_y[0].Split(':');
|
|
||||||
string[] Y = x_y[1].Split(':');
|
|
||||||
DistX = Convert.ToDouble(X[1].Replace("mm", ""));
|
|
||||||
lbl_DistXShow.Text = X[1].Replace("mm", "");
|
|
||||||
log.Info("当前订单X偏移:" + DistX);
|
|
||||||
DistY = Convert.ToDouble(Y[1].Replace("mm", ""));
|
|
||||||
lbl_DistYShow.Text = Y[1].Replace("mm", "");
|
|
||||||
log.Info("当前订单Y偏移:" + DistY);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (DistX == 0 || DistY == 0)
|
|
||||||
{
|
|
||||||
log.Debug("DistX,DistY未找到,请检查订单号是否正确");
|
|
||||||
btn_OrderNum.Enabled = true;
|
|
||||||
btn_OrderNum.BackColor = Color.DeepSkyBlue;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
log.Info("相关数据已获取完成,且已显示在界面中,请查看。");
|
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(QSV))
|
||||||
|
{
|
||||||
|
string qsv;
|
||||||
|
//根据得到的QSV遍历sheet2 找产品规格和宽度梯度
|
||||||
|
for (int j = 1; j <= sheet2.Dimension.Rows; j++)
|
||||||
{
|
{
|
||||||
log.Debug("QSV未找到,请检查订单号是否正确");
|
qsv = sheet2.Cells[j, 1].Value.ToString();
|
||||||
|
if (qsv == QSV)
|
||||||
|
{
|
||||||
|
ProductStandard = sheet2.Cells[j, 2].Value.ToString();
|
||||||
|
lbl_ProductStandardShow.Text = ProductStandard;
|
||||||
|
log.Info("当前订单产品编号:" + ProductStandard);
|
||||||
|
width = Convert.ToDouble(sheet2.Cells[j, 3].Value.ToString());
|
||||||
|
lbl_widthShow.Text = sheet2.Cells[j, 3].Value.ToString();
|
||||||
|
log.Info("当前订单幅宽:" + width);
|
||||||
|
Gradient = Convert.ToDouble(sheet2.Cells[j, 4].Value.ToString());
|
||||||
|
lbl_GradientShow.Text = sheet2.Cells[j, 4].Value.ToString();
|
||||||
|
log.Info("当前订单梯度:" + Gradient);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(ProductStandard))
|
||||||
|
{
|
||||||
|
log.Debug("ProductStandard未找到,请检查订单号是否正确");
|
||||||
btn_OrderNum.Enabled = true;
|
btn_OrderNum.Enabled = true;
|
||||||
btn_OrderNum.BackColor = Color.DeepSkyBlue;
|
btn_OrderNum.BackColor = Color.DeepSkyBlue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
//根据产品规格获取距离坐标
|
||||||
}
|
for (int n = 1; n < sheet3.Dimension.Rows; n++)
|
||||||
else
|
|
||||||
{
|
|
||||||
log.Info("当前订单号为:" + order);
|
|
||||||
//读取表格内容
|
|
||||||
ExcelPackage.License.SetNonCommercialOrganization("My Noncommercial organization");
|
|
||||||
using (ExcelPackage package = new ExcelPackage(execlFileName))
|
|
||||||
{
|
|
||||||
sheet1 = package.Workbook.Worksheets["P2生成数据"];
|
|
||||||
sheet2 = package.Workbook.Worksheets["QSV对应产品规格和梯度"];
|
|
||||||
sheet3 = package.Workbook.Worksheets["产品规格对应排布方式"];
|
|
||||||
string firstLayers = "";
|
|
||||||
//根据订单遍历sheet1 找QSV NumOFLanes 字符
|
|
||||||
for (int i = 1; i < sheet1.Dimension.Rows; i++)
|
|
||||||
{
|
{
|
||||||
if (sheet1.GetValue(i, 3) != null)
|
if (sheet3.GetValue(n, 1) != null)
|
||||||
{
|
{
|
||||||
if (sheet1.Cells[i, 3].Value.ToString() == order)
|
if (sheet3.Cells[n, 1].Value.ToString() == ProductStandard)
|
||||||
{
|
{
|
||||||
QSV = sheet1.Cells[i, 4].Value.ToString();
|
string str = sheet3.Cells[n + ocrTextRequest[1].Count - 1, 4].Value.ToString();
|
||||||
lbl_QSVShow.Text = QSV;
|
string[] x_y = str.Split(',');
|
||||||
log.Info("当前订单QSV:" + QSV);
|
string[] X = x_y[0].Split(':');
|
||||||
NumberOfLanes = Convert.ToInt32(sheet1.Cells[i, 5].Value.ToString());
|
string[] Y = x_y[1].Split(':');
|
||||||
log.Info("当前订单Number Of Lanes:" + NumberOfLanes);
|
DistX = Convert.ToDouble(X[1].Replace("mm", ""));
|
||||||
lbl_NOFShow.Text = sheet1.Cells[i, 5].Value.ToString();
|
lbl_DistXShow.Text = X[1].Replace("mm", "");
|
||||||
|
log.Info("当前订单X偏移:" + DistX);
|
||||||
//获取字符 并显示在界面还需处理先预留在这
|
DistY = Convert.ToDouble(Y[1].Replace("mm", ""));
|
||||||
string design = sheet1.Cells[i, 7].Value.ToString();
|
lbl_DistYShow.Text = Y[1].Replace("mm", "");
|
||||||
firstLayers = sheet1.Cells[i, 8].Value.ToString();
|
log.Info("当前订单Y偏移:" + DistY);
|
||||||
Colours = sheet1.Cells[i, 9].Value.ToString();
|
|
||||||
|
|
||||||
for (int lan = 1; lan <= NumberOfLanes; lan++)
|
|
||||||
{
|
|
||||||
ocrTextRequest[lan] = ExecelGetOcrText(design, firstLayers);
|
|
||||||
ocrTextDesign[lan] = design;
|
|
||||||
}
|
|
||||||
listBox1.Items.Add(sheet1.Cells[i, 6].Value.ToString());
|
|
||||||
listBox1.Items.Add(string.Join(",", ocrTextRequest[1]));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(QSV))
|
if (DistX == 0 || DistY == 0)
|
||||||
{
|
{
|
||||||
string qsv;
|
log.Debug("DistX,DistY未找到,请检查订单号是否正确");
|
||||||
//根据得到的QSV遍历sheet2 找产品规格和宽度梯度
|
|
||||||
for (int j = 1; j <= sheet2.Dimension.Rows; j++)
|
|
||||||
{
|
|
||||||
qsv = sheet2.Cells[j, 1].Value.ToString();
|
|
||||||
if (qsv == QSV)
|
|
||||||
{
|
|
||||||
ProductStandard = sheet2.Cells[j, 2].Value.ToString();
|
|
||||||
lbl_ProductStandardShow.Text = ProductStandard;
|
|
||||||
log.Info("当前订单产品编号:" + ProductStandard);
|
|
||||||
width = Convert.ToDouble(sheet2.Cells[j, 3].Value.ToString());
|
|
||||||
lbl_widthShow.Text = sheet2.Cells[j, 3].Value.ToString();
|
|
||||||
log.Info("当前订单幅宽:" + width);
|
|
||||||
Gradient = Convert.ToDouble(sheet2.Cells[j, 4].Value.ToString());
|
|
||||||
lbl_GradientShow.Text = sheet2.Cells[j, 4].Value.ToString();
|
|
||||||
log.Info("当前订单梯度:" + Gradient);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (string.IsNullOrEmpty(ProductStandard))
|
|
||||||
{
|
|
||||||
log.Debug("ProductStandard未找到,请检查订单号是否正确");
|
|
||||||
btn_OrderNum.Enabled = true;
|
|
||||||
btn_OrderNum.BackColor = Color.DeepSkyBlue;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//根据产品规格获取距离坐标
|
|
||||||
for (int n = 1; n < sheet3.Dimension.Rows; n++)
|
|
||||||
{
|
|
||||||
if (sheet3.GetValue(n, 1) != null)
|
|
||||||
{
|
|
||||||
if (sheet3.Cells[n, 1].Value.ToString() == ProductStandard)
|
|
||||||
{
|
|
||||||
string str = sheet3.Cells[n + firstLayers.Split(',').Length - 1, 4].Value.ToString();
|
|
||||||
string[] x_y = str.Split(',');
|
|
||||||
string[] X = x_y[0].Split(':');
|
|
||||||
string[] Y = x_y[1].Split(':');
|
|
||||||
DistX = Convert.ToDouble(X[1].Replace("mm", ""));
|
|
||||||
lbl_DistXShow.Text = X[1].Replace("mm", "");
|
|
||||||
log.Info("当前订单X偏移:" + DistX);
|
|
||||||
DistY = Convert.ToDouble(Y[1].Replace("mm", ""));
|
|
||||||
lbl_DistYShow.Text = Y[1].Replace("mm", "");
|
|
||||||
log.Info("当前订单Y偏移:" + DistY);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (DistX == 0 || DistY == 0)
|
|
||||||
{
|
|
||||||
log.Debug("DistX,DistY未找到,请检查订单号是否正确");
|
|
||||||
btn_OrderNum.Enabled = true;
|
|
||||||
btn_OrderNum.BackColor = Color.DeepSkyBlue;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
log.Info("相关数据已获取完成,且已显示在界面中,请查看。");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
log.Debug("QSV未找到,请检查订单号是否正确");
|
|
||||||
btn_OrderNum.Enabled = true;
|
btn_OrderNum.Enabled = true;
|
||||||
btn_OrderNum.BackColor = Color.DeepSkyBlue;
|
btn_OrderNum.BackColor = Color.DeepSkyBlue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
log.Info("相关数据已获取完成,且已显示在界面中,请查看。");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
log.Debug("QSV未找到,请检查订单号是否正确");
|
||||||
|
btn_OrderNum.Enabled = true;
|
||||||
|
btn_OrderNum.BackColor = Color.DeepSkyBlue;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
///判断当前Lans决定结果显示数量
|
|
||||||
|
//判断当前Lans决定结果显示数量
|
||||||
InitLableColumn();
|
InitLableColumn();
|
||||||
|
|
||||||
btn_OrderNum.Enabled = true;
|
btn_OrderNum.Enabled = true;
|
||||||
@@ -1125,9 +1007,6 @@ namespace TetraPackOCR
|
|||||||
private List<string> ExecelGetOcrText(string design, string layer)
|
private List<string> ExecelGetOcrText(string design, string layer)
|
||||||
{
|
{
|
||||||
List<string> result = new List<string>();
|
List<string> result = new List<string>();
|
||||||
string[] dd = design.Split('-');
|
|
||||||
if (dd.Length < 2)
|
|
||||||
return result;
|
|
||||||
string[] ll = layer.Replace("[", "").Replace("]", "").Split(',');
|
string[] ll = layer.Replace("[", "").Replace("]", "").Split(',');
|
||||||
for (int i = 0; i < ll.Length; i++)
|
for (int i = 0; i < ll.Length; i++)
|
||||||
{
|
{
|
||||||
@@ -1135,7 +1014,7 @@ namespace TetraPackOCR
|
|||||||
string[] str = ll[i].Split('-');
|
string[] str = ll[i].Split('-');
|
||||||
if (str.Length < 2)
|
if (str.Length < 2)
|
||||||
continue;
|
continue;
|
||||||
result.Add(dd[1] + str[1] + str[0]);
|
result.Add(design + str[1] + str[0]);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1144,7 +1023,7 @@ namespace TetraPackOCR
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
void ClearData()
|
void ClearData()
|
||||||
{
|
{
|
||||||
QSV = null; Colours = null; ProductStandard = null;
|
QSV = null; ProductStandard = null;
|
||||||
NumberOfLanes = 0; width = 0; Gradient = 0; DistX = 0; DistY = 0;
|
NumberOfLanes = 0; width = 0; Gradient = 0; DistX = 0; DistY = 0;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1538,16 +1417,13 @@ namespace TetraPackOCR
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
OCRTextResult result = new OCRTextResult();
|
OCRTextResult result = new OCRTextResult();
|
||||||
|
|
||||||
List<string> lastocr = new List<string>();
|
List<string> lastocr = new List<string>();
|
||||||
OCRResult ocrResult = Engine.DetectText(ocrimagebyte);
|
OCRResult ocrResult = Engine.DetectText(ocrimagebyte);
|
||||||
|
|
||||||
List<Point> pointsList = new List<Point>();
|
List<Point> pointsList = new List<Point>();
|
||||||
|
|
||||||
string[] sd = ocrTextDesign[mMatchingStr].Split('-');
|
foreach (var item in ocrResult.TextBlocks)
|
||||||
foreach (var item in ocrResult.TextBlocks) //将检测框绘制在图片上
|
|
||||||
{
|
{
|
||||||
if (item.Text.Contains(sd[1]))
|
if (item.Text.Contains(ocrTextDesign[mMatchingStr]))
|
||||||
{
|
{
|
||||||
result.points = item.BoxPoints.Select(x => new PointF() { X = x.X, Y = x.Y }).ToArray();
|
result.points = item.BoxPoints.Select(x => new PointF() { X = x.X, Y = x.Y }).ToArray();
|
||||||
pointsList.Add(new Point(item.BoxPoints[0].X, item.BoxPoints[0].Y, item.Text));
|
pointsList.Add(new Point(item.BoxPoints[0].X, item.BoxPoints[0].Y, item.Text));
|
||||||
@@ -1633,8 +1509,7 @@ namespace TetraPackOCR
|
|||||||
private string GETOCR(List<string> readOCR, string design)
|
private string GETOCR(List<string> readOCR, string design)
|
||||||
{
|
{
|
||||||
string ocrresult = "";
|
string ocrresult = "";
|
||||||
string[] d = design.Split('-');
|
string pattern = @"" + design + "[A-Z0-9]{8}";
|
||||||
string pattern = @"" + d[1] + "[A-Z0-9]{8}";
|
|
||||||
for (int i = 0; i < readOCR.Count; i++)
|
for (int i = 0; i < readOCR.Count; i++)
|
||||||
{
|
{
|
||||||
readOCR[i] = readOCR[i].Replace("_", "");
|
readOCR[i] = readOCR[i].Replace("_", "");
|
||||||
@@ -2017,10 +1892,7 @@ namespace TetraPackOCR
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string[] col = Colours.Split(',');
|
|
||||||
|
|
||||||
float xx = (float)x;
|
float xx = (float)x;
|
||||||
|
|
||||||
float yy = (float)y;
|
float yy = (float)y;
|
||||||
float rr = (float)r;
|
float rr = (float)r;
|
||||||
List<float> ocrxx = new List<float>();
|
List<float> ocrxx = new List<float>();
|
||||||
@@ -2029,7 +1901,7 @@ namespace TetraPackOCR
|
|||||||
switch (ProductStandard)
|
switch (ProductStandard)
|
||||||
{
|
{
|
||||||
case "TBA1000Slim":
|
case "TBA1000Slim":
|
||||||
switch (col.Length)
|
switch (ocrTextRequest[1].Count)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
xx = (float)x - 9.5f;
|
xx = (float)x - 9.5f;
|
||||||
@@ -2052,7 +1924,7 @@ namespace TetraPackOCR
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "TBA250B":
|
case "TBA250B":
|
||||||
switch (col.Length)
|
switch (ocrTextRequest[1].Count)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
xx = (float)x - 9.5f;
|
xx = (float)x - 9.5f;
|
||||||
@@ -2075,7 +1947,7 @@ namespace TetraPackOCR
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "TBA125Slim":
|
case "TBA125Slim":
|
||||||
switch (col.Length)
|
switch (ocrTextRequest[1].Count)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
xx = (float)x - 9.5f;
|
xx = (float)x - 9.5f;
|
||||||
@@ -2098,7 +1970,7 @@ namespace TetraPackOCR
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "TPA250SQ":
|
case "TPA250SQ":
|
||||||
switch (col.Length)
|
switch (ocrTextRequest[1].Count)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
xx = (float)x - 9.5f;
|
xx = (float)x - 9.5f;
|
||||||
@@ -2121,7 +1993,7 @@ namespace TetraPackOCR
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "TPA200SQ":
|
case "TPA200SQ":
|
||||||
switch (col.Length)
|
switch (ocrTextRequest[1].Count)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
xx = (float)x - 9.5f;
|
xx = (float)x - 9.5f;
|
||||||
|
|||||||
Reference in New Issue
Block a user