feat - 最终版程序

master
SoulStar 2 weeks ago
parent 93f26044fe
commit 7bf8791f4d

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesnac.Controls.ChemicalWeighing
{
public enum HslDirectionStyle
{
/// <summary>控件是横向摆放的</summary>
Horizontal = 1,
/// <summary>控件是纵向摆放的</summary>
Vertical = 2,
}
}

@ -0,0 +1,639 @@
using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Mesnac.Controls.ChemicalWeighing
{
/// <summary>整个组件的代码辅助工具,提供了一个基础的类库方法</summary>
public class HslHelper
{
static HslHelper()
{
HslHelper.StringFormatDefault = new StringFormat();
HslHelper.StringFormatCenter = new StringFormat();
HslHelper.StringFormatCenter.Alignment = StringAlignment.Center;
HslHelper.StringFormatCenter.LineAlignment = StringAlignment.Center;
HslHelper.StringFormatLeft = new StringFormat();
HslHelper.StringFormatLeft.LineAlignment = StringAlignment.Center;
HslHelper.StringFormatLeft.Alignment = StringAlignment.Near;
HslHelper.StringFormatRight = new StringFormat();
HslHelper.StringFormatRight.LineAlignment = StringAlignment.Center;
HslHelper.StringFormatRight.Alignment = StringAlignment.Far;
HslHelper.StringFormatTopCenter = new StringFormat();
HslHelper.StringFormatTopCenter.Alignment = StringAlignment.Center;
HslHelper.StringFormatTopCenter.LineAlignment = StringAlignment.Near;
}
/// <summary>返回中间范围值数据,如果大于最大值,则返回最大值,如果小于最小值,则返回最小值</summary>
/// <param name="min">最小值</param>
/// <param name="value">实际值</param>
/// <param name="max">最大值</param>
/// <returns>中间值信息</returns>
public static int Middle(int min, int value, int max)
{
if (value > max)
return max;
return value < min ? min : value;
}
/// <summary>从一个矩形的图形中获取菱形的坐标数组</summary>
/// <param name="rect">矩形</param>
/// <returns>数组结果</returns>
public static Point[] GetRhombusFromRectangle(Rectangle rect) => new Point[5]
{
new Point(rect.X, rect.Y + rect.Height / 2),
new Point(rect.X + rect.Width / 2, rect.Y + rect.Height - 1),
new Point(rect.X + rect.Width - 1, rect.Y + rect.Height / 2),
new Point(rect.X + rect.Width / 2, rect.Y),
new Point(rect.X, rect.Y + rect.Height / 2)
};
/// <summary>计算绘图时的相对偏移值</summary>
/// <param name="max">0-100分的最大值就是指准备绘制的最大值</param>
/// <param name="min">0-100分的最小值就是指准备绘制的最小值</param>
/// <param name="height">实际绘图区域的高度</param>
/// <param name="value">需要绘制数据的当前值</param>
/// <returns>相对于0的位置还需要增加上面的偏值</returns>
public static float ComputePaintLocationY(int max, int min, int height, int value) => (double)(max - min) == 0.0 ? (float)height : (float)height - (float)(value - min) * 1f / (float)(max - min) * (float)height;
/// <summary>计算绘图Y轴时的相对偏移值</summary>
/// <param name="max">0-100分的最大值就是指准备绘制的最大值</param>
/// <param name="min">0-100分的最小值就是指准备绘制的最小值</param>
/// <param name="height">实际绘图区域的高度</param>
/// <param name="value">需要绘制数据的当前值</param>
/// <returns>相对于0的位置还需要增加上面的偏值</returns>
public static float ComputePaintLocationY(float max, float min, float height, float value)
{
if ((double)max - (double)min == 0.0)
return height;
float num = max - min;
if ((double)num == 0.0)
num = 1f;
return height - (value - min) / num * height;
}
/// <summary>计算绘图X轴时的相对偏移值</summary>
/// <param name="max">0-100分的最大值就是指准备绘制的最大值</param>
/// <param name="min">0-100分的最小值就是指准备绘制的最小值</param>
/// <param name="width">实际绘图区域的宽度</param>
/// <param name="value">需要绘制数据的当前值</param>
/// <returns>相对于0的位置还需要增加上面的偏值</returns>
public static float ComputePaintLocationX(float max, float min, float width, float value)
{
if ((double)max - (double)min == 0.0)
return width;
float num = max - min;
if ((double)num == 0.0)
num = 1f;
return (value - min) / num * width;
}
/// <summary>根据绘制的值计算原始的值信息</summary>
/// <param name="max">0-100分的最大值就是指准备绘制的最大值</param>
/// <param name="min">0-100分的最小值就是指准备绘制的最小值</param>
/// <param name="height">实际绘图区域的高度</param>
/// <param name="paint">实际绘制的位置信息</param>
/// <returns>实际的值信息</returns>
public static float ComputeValueFromPaintLocationY(
float max,
float min,
float height,
float paint)
{
if ((double)max - (double)min == 0.0)
return max;
float num = max - min;
if ((double)num == 0.0)
num = 1f;
return (height - paint) * num / height + min;
}
/// <summary>计算绘图时的相对偏移值</summary>
/// <param name="referenceAxis">坐标轴信息</param>
/// <param name="height">实际绘图区域的高度</param>
/// <param name="value">需要绘制数据的当前值</param>
/// <returns>相对于0的位置还需要增加上面的偏值</returns>
public static float ComputePaintLocationY(
ReferenceAxis referenceAxis,
float height,
float value)
{
return HslHelper.ComputePaintLocationY(referenceAxis.Max, referenceAxis.Min, height, value);
}
/// <summary>绘制坐标系中的刻度线</summary>
/// <param name="g">绘图对象</param>
/// <param name="penLine">画坐标轴的画笔</param>
/// <param name="penDash"></param>
/// <param name="font"></param>
/// <param name="brush"></param>
/// <param name="sf"></param>
/// <param name="degree"></param>
/// <param name="max"></param>
/// <param name="min"></param>
/// <param name="width"></param>
/// <param name="height"></param>
/// <param name="left"></param>
/// <param name="right"></param>
/// <param name="up"></param>
/// <param name="down"></param>
public static void PaintCoordinateDivide(
Graphics g,
System.Drawing.Pen penLine,
System.Drawing.Pen penDash,
Font font,
System.Drawing.Brush brush,
StringFormat sf,
int degree,
int max,
int min,
int width,
int height,
int left = 60,
int right = 8,
int up = 8,
int down = 8)
{
for (int index = 0; index <= degree; ++index)
{
int num1 = (max - min) * index / degree + min;
int num2 = (int)HslHelper.ComputePaintLocationY(max, min, height - up - down, num1) + up + 1;
g.DrawLine(penLine, left - 1, num2, left - 4, num2);
if (index != 0)
g.DrawLine(penDash, left, num2, width - right, num2);
g.DrawString(num1.ToString(), font, brush, (RectangleF)new Rectangle(-5, num2 - font.Height / 2, left, font.Height), sf);
}
}
/// <summary>根据指定的方向绘制一个箭头</summary>
/// <param name="g"></param>
/// <param name="brush"></param>
/// <param name="point"></param>
/// <param name="size"></param>
/// <param name="direction"></param>
public static void PaintTriangle(
Graphics g,
System.Drawing.Brush brush,
Point point,
int size,
GraphDirection direction)
{
Point[] points = new Point[4];
switch (direction)
{
case GraphDirection.Upward:
points[0] = new Point(point.X - size, point.Y);
points[1] = new Point(point.X + size, point.Y);
points[2] = new Point(point.X, point.Y - 2 * size);
break;
case GraphDirection.Leftward:
points[0] = new Point(point.X, point.Y - size);
points[1] = new Point(point.X, point.Y + size);
points[2] = new Point(point.X - 2 * size, point.Y);
break;
case GraphDirection.Rightward:
points[0] = new Point(point.X, point.Y - size);
points[1] = new Point(point.X, point.Y + size);
points[2] = new Point(point.X + 2 * size, point.Y);
break;
default:
points[0] = new Point(point.X - size, point.Y);
points[1] = new Point(point.X + size, point.Y);
points[2] = new Point(point.X, point.Y + 2 * size);
break;
}
points[3] = points[0];
g.FillPolygon(brush, points);
}
/// <summary>绘制向左或是向右的箭头,例如 &lt;&lt; 或是 &gt;&gt;</summary>
/// <param name="g">画刷资源</param>
/// <param name="pen">画笔资源</param>
/// <param name="rectangle">绘制的矩形</param>
/// <param name="direction">方向信息</param>
public static void DrawLeftRight(
Graphics g,
System.Drawing.Pen pen,
Rectangle rectangle,
GraphDirection direction)
{
if (direction == GraphDirection.Leftward)
{
g.DrawLines(pen, new Point[3]
{
new Point(rectangle.X + rectangle.Width / 2, rectangle.Y),
new Point(rectangle.X, rectangle.Y + rectangle.Height / 2),
new Point(rectangle.X + rectangle.Width / 2, rectangle.Y + rectangle.Height)
});
g.DrawLines(pen, new Point[3]
{
new Point(rectangle.X + rectangle.Width, rectangle.Y),
new Point(rectangle.X + rectangle.Width / 2, rectangle.Y + rectangle.Height / 2),
new Point(rectangle.X + rectangle.Width, rectangle.Y + rectangle.Height)
});
}
else
{
if (direction != GraphDirection.Rightward)
return;
g.DrawLines(pen, new Point[3]
{
new Point(rectangle.X, rectangle.Y),
new Point(rectangle.X + rectangle.Width / 2, rectangle.Y + rectangle.Height / 2),
new Point(rectangle.X, rectangle.Y + rectangle.Height)
});
g.DrawLines(pen, new Point[3]
{
new Point(rectangle.X + rectangle.Width / 2, rectangle.Y),
new Point(rectangle.X + rectangle.Width, rectangle.Y + rectangle.Height / 2),
new Point(rectangle.X + rectangle.Width / 2, rectangle.Y + rectangle.Height)
});
}
}
/// <summary>根据指定的方向绘制一个箭头</summary>
/// <param name="g"></param>
/// <param name="brush"></param>
/// <param name="point"></param>
/// <param name="size"></param>
/// <param name="direction"></param>
public static void PaintTriangle(
Graphics g,
System.Drawing.Brush brush,
PointF point,
int size,
GraphDirection direction)
{
PointF[] points = new PointF[4];
switch (direction)
{
case GraphDirection.Upward:
points[0] = new PointF(point.X - (float)size, point.Y);
points[1] = new PointF(point.X + (float)size, point.Y);
points[2] = new PointF(point.X, point.Y - (float)(2 * size));
break;
case GraphDirection.Leftward:
points[0] = new PointF(point.X, point.Y - (float)size);
points[1] = new PointF(point.X, point.Y + (float)size);
points[2] = new PointF(point.X - (float)(2 * size), point.Y);
break;
case GraphDirection.Rightward:
points[0] = new PointF(point.X, point.Y - (float)size);
points[1] = new PointF(point.X, point.Y + (float)size);
points[2] = new PointF(point.X + (float)(2 * size), point.Y);
break;
default:
points[0] = new PointF(point.X - (float)size, point.Y);
points[1] = new PointF(point.X + (float)size, point.Y);
points[2] = new PointF(point.X, point.Y + (float)(2 * size));
break;
}
points[3] = points[0];
g.FillPolygon(brush, points);
}
/// <summary>
/// 一个通用的数组新增个数方法,会自动判断越界情况,越界的情况下,会自动的截断或是填充 -&gt;
/// A common array of new methods, will automatically determine the cross-border situation, in the case of cross-border, will be automatically truncated or filled
/// </summary>
/// <typeparam name="T">数据类型</typeparam>
/// <param name="array">原数据</param>
/// <param name="data">等待新增的数据</param>
/// <param name="max">原数据的最大值</param>
public static void AddArrayData<T>(ref T[] array, T[] data, int max)
{
if (data == null || data.Length == 0)
return;
if (array.Length == max)
{
Array.Copy((Array)array, data.Length, (Array)array, 0, array.Length - data.Length);
Array.Copy((Array)data, 0, (Array)array, array.Length - data.Length, data.Length);
}
else if (array.Length + data.Length > max)
{
T[] objArray = new T[max];
for (int index = 0; index < max - data.Length; ++index)
objArray[index] = array[index + (array.Length - max + data.Length)];
for (int index = 0; index < data.Length; ++index)
objArray[objArray.Length - data.Length + index] = data[index];
array = objArray;
}
else
{
T[] objArray = new T[array.Length + data.Length];
for (int index = 0; index < array.Length; ++index)
objArray[index] = array[index];
for (int index = 0; index < data.Length; ++index)
objArray[objArray.Length - data.Length + index] = data[index];
array = objArray;
}
}
/// <summary>尺寸转换,计算旋转后的尺寸。</summary>
/// <param name="size"></param>
/// <param name="angle"></param>
/// <returns></returns>
public static SizeF ConvertSize(SizeF size, float angle)
{
System.Drawing.Drawing2D.Matrix matrix = new System.Drawing.Drawing2D.Matrix();
matrix.Rotate(angle);
PointF[] pts = new PointF[4];
pts[0].X = (float)(-(double)size.Width / 2.0);
pts[0].Y = (float)(-(double)size.Height / 2.0);
pts[1].X = (float)(-(double)size.Width / 2.0);
pts[1].Y = size.Height / 2f;
pts[2].X = size.Width / 2f;
pts[2].Y = size.Height / 2f;
pts[3].X = size.Width / 2f;
pts[3].Y = (float)(-(double)size.Height / 2.0);
matrix.TransformPoints(pts);
float num1 = float.MaxValue;
float num2 = float.MinValue;
float num3 = float.MaxValue;
float num4 = float.MinValue;
foreach (PointF pointF in pts)
{
if ((double)pointF.X < (double)num1)
num1 = pointF.X;
if ((double)pointF.X > (double)num2)
num2 = pointF.X;
if ((double)pointF.Y < (double)num3)
num3 = pointF.Y;
if ((double)pointF.Y > (double)num4)
num4 = pointF.Y;
}
return new SizeF(num2 - num1, num4 - num3);
}
/// <summary>绘制旋转文本</summary>
/// <param name="g"></param>
/// <param name="s"></param>
/// <param name="font"></param>
/// <param name="brush"></param>
/// <param name="point"></param>
/// <param name="format"></param>
/// <param name="angle"></param>
public static void DrawString(
Graphics g,
string s,
Font font,
System.Drawing.Brush brush,
PointF point,
StringFormat format,
float angle)
{
System.Drawing.Drawing2D.Matrix transform1 = g.Transform;
System.Drawing.Drawing2D.Matrix transform2 = g.Transform;
transform2.RotateAt(angle, point);
g.Transform = transform2;
g.DrawString(s, font, brush, point, format);
g.Transform = transform1;
}
private static int GetPow(int digit)
{
int pow = 1;
for (int index = 0; index < digit; ++index)
pow *= 10;
return pow;
}
/// <summary>将int数组转换为double数组</summary>
/// <param name="values">int数组值</param>
/// <returns>结果值</returns>
public static double[] TranlateArrayToDouble(int[] values)
{
if (values == null)
return (double[])null;
double[] numArray = new double[values.Length];
for (int index = 0; index < values.Length; ++index)
numArray[index] = (double)values[index];
return numArray;
}
/// <summary>将float数组转换为double数组值</summary>
/// <param name="values">float数组值</param>
/// <returns>结果值</returns>
public static double[] TranlateArrayToDouble(float[] values)
{
double[] numArray = new double[values.Length];
for (int index = 0; index < values.Length; ++index)
numArray[index] = (double)values[index];
return numArray;
}
/// <summary>获得数据的上限值,这个上限值是自动计算的。</summary>
/// <param name="values">数据值</param>
/// <returns>数据值</returns>
public static int CalculateMaxSectionFrom(double[] values)
{
double a = ((IEnumerable<double>)values).Max();
if (a <= 5.0)
return 5;
if (a <= 9.0)
return 10;
int int32 = Convert.ToInt32(Math.Ceiling(a));
int digit = int32.ToString().Length - 2;
int num = int.Parse(int32.ToString().Substring(0, 2));
if (num < 11)
return 12 * HslHelper.GetPow(digit);
if (num < 13)
return 14 * HslHelper.GetPow(digit);
if (num < 15)
return 16 * HslHelper.GetPow(digit);
if (num < 17)
return 18 * HslHelper.GetPow(digit);
if (num < 19)
return 20 * HslHelper.GetPow(digit);
if (num < 21)
return 22 * HslHelper.GetPow(digit);
if (num < 23)
return 24 * HslHelper.GetPow(digit);
if (num < 25)
return 26 * HslHelper.GetPow(digit);
if (num < 27)
return 28 * HslHelper.GetPow(digit);
if (num < 29)
return 30 * HslHelper.GetPow(digit);
if (num < 33)
return 34 * HslHelper.GetPow(digit);
if (num < 40)
return 40 * HslHelper.GetPow(digit);
if (num < 50)
return 50 * HslHelper.GetPow(digit);
if (num < 60)
return 60 * HslHelper.GetPow(digit);
if (num < 80)
return 80 * HslHelper.GetPow(digit);
return num < 95 ? 100 * HslHelper.GetPow(digit) : 100 * HslHelper.GetPow(digit);
}
/// <inheritdoc cref="M:HslControls.HslHelper.CalculateMaxSectionFrom(System.Double[])" />
public static int CalculateMaxSectionFrom(Dictionary<string, double[]> values) => HslHelper.CalculateMaxSectionFrom(values.Select<KeyValuePair<string, double[]>, double>((Func<KeyValuePair<string, double[]>, double>)(m => ((IEnumerable<double>)m.Value).Max())).ToArray<double>());
/// <summary>获取当前颜色更淡的颜色信息</summary>
/// <param name="color">颜色信息</param>
/// <returns>颜色</returns>
public static System.Drawing.Color GetColorLight(System.Drawing.Color color) => HslHelper.GetColorLight(color, 40);
/// <summary>获取当前颜色更深的颜色信息</summary>
/// <param name="color">颜色信息</param>
/// <returns>颜色</returns>
public static System.Drawing.Color GetColorDeep(System.Drawing.Color color) => HslHelper.GetColorLight(color, -40);
/// <summary>获取当前颜色更淡的颜色信息需要指定系数0-1000时是原来的原色100时是纯白色</summary>
/// <param name="color">颜色信息</param>
/// <param name="scale">获取颜色的系数信息</param>
/// <returns>颜色</returns>
public static System.Drawing.Color GetColorLight(System.Drawing.Color color, int scale) => scale > 0 ? System.Drawing.Color.FromArgb((int)color.R + ((int)byte.MaxValue - (int)color.R) * scale / 100, (int)color.G + ((int)byte.MaxValue - (int)color.G) * scale / 100, (int)color.B + ((int)byte.MaxValue - (int)color.B) * scale / 100) : System.Drawing.Color.FromArgb((int)color.R + (int)color.R * scale / 100, (int)color.G + (int)color.G * scale / 100, (int)color.B + (int)color.B * scale / 100);
/// <summary>获取颜色的偏移信息</summary>
/// <param name="color">颜色值</param>
/// <param name="offset">颜色偏移信息</param>
/// <returns>颜色值</returns>
public static System.Drawing.Color GetColorOffset(System.Drawing.Color color, int offset)
{
int red = (int)color.R + offset;
if (red < 0)
red = 0;
if (red > (int)byte.MaxValue)
red = (int)byte.MaxValue;
int green = (int)color.G + offset;
if (green < 0)
green = 0;
if (green > (int)byte.MaxValue)
green = (int)byte.MaxValue;
int blue = (int)color.B + offset;
if (blue < 0)
blue = 0;
if (blue > (int)byte.MaxValue)
blue = (int)byte.MaxValue;
return System.Drawing.Color.FromArgb(red, green, blue);
}
///// <summary>获取当前颜色更淡的颜色信息</summary>
///// <param name="color">颜色信息</param>
///// <returns>颜色</returns>
//public static System.Drawing.Color GetColorLightFive(System.Drawing.Color color) => HslHelper.GetColorLight(color, 50);
///// <summary>获取当前颜色更淡的颜色信息</summary>
///// <param name="color">颜色信息</param>
///// <returns>颜色</returns>
//public static System.Windows.Media.Color GetColorLight(System.Windows.Media.Color color) => System.Windows.Media.Color.FromRgb((byte)((uint)color.R + (uint)(((int)byte.MaxValue - (int)color.R) * 40 / 100)), (byte)((uint)color.G + (uint)(((int)byte.MaxValue - (int)color.G) * 40 / 100)), (byte)((uint)color.B + (uint)(((int)byte.MaxValue - (int)color.B) * 40 / 100)));
///// <summary>获取当前颜色更淡的颜色信息</summary>
///// <param name="color">颜色信息</param>
///// <returns>颜色</returns>
//public static System.Windows.Media.Color GetColorLightFive(System.Windows.Media.Color color) => System.Windows.Media.Color.FromRgb((byte)((uint)color.R + (uint)(((int)byte.MaxValue - (int)color.R) * 50 / 100)), (byte)((uint)color.G + (uint)(((int)byte.MaxValue - (int)color.G) * 50 / 100)), (byte)((uint)color.B + (uint)(((int)byte.MaxValue - (int)color.B) * 50 / 100)));
/// <summary>从字符串表示的点位信息里解析出真正的点位信息</summary>
/// <param name="points">字符串的点位</param>
/// <param name="soureWidth">原来的长度信息</param>
/// <param name="sourceHeight">原来的高度信息</param>
/// <param name="width">实际的宽度信息</param>
/// <param name="height">实际的高度信息</param>
/// <param name="dx">x偏移量信息</param>
/// <param name="dy">y偏移量信息</param>
/// <returns></returns>
public static PointF[] GetPointsFrom(
string points,
float soureWidth,
float sourceHeight,
float width,
float height,
float dx = 0.0f,
float dy = 0.0f)
{
string[] strArray = points.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
PointF[] pointsFrom = new PointF[strArray.Length];
for (int index = 0; index < strArray.Length; ++index)
{
int length = strArray[index].IndexOf(',');
float single1 = Convert.ToSingle(strArray[index].Substring(0, length));
float single2 = Convert.ToSingle(strArray[index].Substring(length + 1));
pointsFrom[index] = new PointF(width * (single1 + dx) / soureWidth, height * (single2 + dy) / sourceHeight);
}
return pointsFrom;
}
/// <summary>根据矩形及其各个定点的配置信息,获取圆角的路径信息,可以指定每个定点的圆角情况</summary>
/// <param name="rectangle"></param>
/// <param name="radius"></param>
/// <param name="topLeft"></param>
/// <param name="topRight"></param>
/// <param name="buttomRight"></param>
/// <param name="buttomLeft"></param>
/// <returns></returns>
public static GraphicsPath GetRoundRectange(
Rectangle rectangle,
int radius,
bool topLeft,
bool topRight,
bool buttomRight,
bool buttomLeft)
{
GraphicsPath roundRectange = new GraphicsPath();
Point pt1_1 = new Point(rectangle.X + (topLeft ? radius : 0), rectangle.Y);
Point pt2_1 = new Point(rectangle.X + rectangle.Width - 1 - (topRight ? radius : 0), rectangle.Y);
roundRectange.AddLine(pt1_1, pt2_1);
if (topRight && radius > 0)
roundRectange.AddArc(rectangle.X + rectangle.Width - radius * 2 - 1, rectangle.Y, radius * 2, radius * 2, 270f, 90f);
Point pt1_2 = new Point(rectangle.X + rectangle.Width - 1, rectangle.Y + (topRight ? radius : 0));
Point pt2_2 = new Point(rectangle.X + rectangle.Width - 1, rectangle.Y + rectangle.Height - 1 - (buttomRight ? radius : 0));
roundRectange.AddLine(pt1_2, pt2_2);
if (buttomRight && radius > 0)
roundRectange.AddArc(rectangle.X + rectangle.Width - radius * 2 - 1, rectangle.Y + rectangle.Height - radius * 2 - 1, radius * 2, radius * 2, 0.0f, 90f);
Point pt1_3 = new Point(rectangle.X + rectangle.Width - 1 - (buttomRight ? radius : 0), rectangle.Y + rectangle.Height - 1);
Point pt2_3 = new Point(rectangle.X + (buttomLeft ? radius : 0), rectangle.Y + rectangle.Height - 1);
roundRectange.AddLine(pt1_3, pt2_3);
if (buttomLeft && radius > 0)
roundRectange.AddArc(rectangle.X, rectangle.Y + rectangle.Height - radius * 2 - 1, radius * 2, radius * 2, 90f, 90f);
Point pt1_4 = new Point(rectangle.X, rectangle.Y + rectangle.Height - 1 - (buttomLeft ? radius : 0));
Point pt2_4 = new Point(rectangle.X, rectangle.Y + (topLeft ? radius : 0));
roundRectange.AddLine(pt1_4, pt2_4);
if (topLeft && radius > 0)
roundRectange.AddArc(rectangle.X, rectangle.Y, radius * 2, radius * 2, 180f, 90f);
return roundRectange;
}
private static string FloatMatchEvaluator(Match m) => m.Value.Length == 5 ? m.Value.Substring(0, 3) : m.Value.Substring(0, 2);
/// <summary>获取浮点数值的格式化文本信息,如果发生了异常,则返回错误消息</summary>
/// <param name="format">格式化信息</param>
/// <param name="value">值信息</param>
/// <param name="remainZero">是否保留0的信息</param>
/// <returns>等待显示的文本</returns>
public static string GetFormatString(string format, float value, bool remainZero = false)
{
try
{
string input = string.Format(format, (object)value);
return remainZero ? input : Regex.Replace(input, "[Ee][+-][0]+", new MatchEvaluator(HslHelper.FloatMatchEvaluator));
}
catch
{
return "Wrong";
}
}
/// <summary>矩形中间的字符串对齐机制</summary>
public static StringFormat StringFormatCenter { get; set; }
/// <summary>矩形的左侧中间的对齐机制</summary>
public static StringFormat StringFormatLeft { get; set; }
/// <summary>矩形的右侧的中间对齐机制</summary>
public static StringFormat StringFormatRight { get; set; }
/// <summary>矩形的的默认的左上角对齐的机制</summary>
public static StringFormat StringFormatDefault { get; set; }
/// <summary>矩形的下方中间的对齐的机制</summary>
public static StringFormat StringFormatTopCenter { get; set; }
}
}

@ -0,0 +1,254 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Controls.ChemicalWeighing
{
/// <summary>
/// 移动的文本控件
/// </summary>
// Token: 0x02000045 RID: 69
[Description("移动文本控件,支持文件正向反向移动,支持设置移动速度")]
public class HslMoveText : UserControl
{
/// <summary>
/// 实例化一个默认的对象
/// </summary>
// Token: 0x060005CE RID: 1486 RVA: 0x00039D44 File Offset: 0x00037F44
public HslMoveText()
{
this.InitializeComponent();
this.sf = new StringFormat();
this.sf.Alignment = StringAlignment.Center;
this.sf.LineAlignment = StringAlignment.Center;
base.SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true);
base.SetStyle(ControlStyles.ResizeRedraw, true);
base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.timer = new Timer();
this.timer.Interval = 30;
this.timer.Tick += this.Timer_Tick;
this.timer.Start();
}
/// <summary>
/// 获取或设置控件的背景色
/// </summary>
// Token: 0x170001CB RID: 459
// (get) Token: 0x060005CF RID: 1487 RVA: 0x00039E30 File Offset: 0x00038030
// (set) Token: 0x060005D0 RID: 1488 RVA: 0x00039E38 File Offset: 0x00038038
[Browsable(true)]
[Description("获取或设置控件的背景色")]
[Category("HslControls")]
[DefaultValue(typeof(Color), "Transparent")]
[EditorBrowsable(EditorBrowsableState.Always)]
public override Color BackColor
{
get
{
return base.BackColor;
}
set
{
base.BackColor = value;
}
}
/// <summary>
/// 获取或设置当前控件的文本
/// </summary>
// Token: 0x170001CC RID: 460
// (get) Token: 0x060005D1 RID: 1489 RVA: 0x00039E44 File Offset: 0x00038044
// (set) Token: 0x060005D2 RID: 1490 RVA: 0x00039E5C File Offset: 0x0003805C
[Browsable(true)]
[Description("获取或设置当前控件的文本")]
[Category("HslControls")]
[EditorBrowsable(EditorBrowsableState.Always)]
[Bindable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public override string Text
{
get
{
return base.Text;
}
set
{
base.Text = value;
base.Invalidate();
}
}
/// <summary>
/// 获取或设置泵控件是否是横向的还是纵向的
/// </summary>
// Token: 0x170001CD RID: 461
// (get) Token: 0x060005D3 RID: 1491 RVA: 0x00039E70 File Offset: 0x00038070
// (set) Token: 0x060005D4 RID: 1492 RVA: 0x00039E88 File Offset: 0x00038088
[Browsable(true)]
[Description("获取或设置泵控件是否是横向的还是纵向的")]
[Category("HslControls")]
[DefaultValue(typeof(HslDirectionStyle), "Vertical")]
public HslDirectionStyle PumpStyle
{
get
{
return this.hslValvesStyle;
}
set
{
this.hslValvesStyle = value;
base.Invalidate();
}
}
/// <summary>
/// 获取或设置泵的动画速度0为静止正数为正向流动负数为反向流动
/// </summary>
// Token: 0x170001CE RID: 462
// (get) Token: 0x060005D5 RID: 1493 RVA: 0x00039E9C File Offset: 0x0003809C
// (set) Token: 0x060005D6 RID: 1494 RVA: 0x00039EB4 File Offset: 0x000380B4
[Browsable(true)]
[Description("获取或设置传送带流动的速度0为静止正数为正向流动负数为反向流动")]
[Category("HslControls")]
[DefaultValue(1f)]
public float MoveSpeed
{
get
{
return this.moveSpeed;
}
set
{
this.moveSpeed = value;
base.Invalidate();
}
}
/// <summary>
/// 重绘控件的
/// </summary>
/// <param name="e">重绘事件</param>
// Token: 0x060005D7 RID: 1495 RVA: 0x00039EC8 File Offset: 0x000380C8
protected override void OnPaint(PaintEventArgs e)
{
Graphics graphics = e.Graphics;
graphics.SmoothingMode = SmoothingMode.HighQuality;
graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
this.PaintHslControls(graphics, base.Width, base.Height);
base.OnPaint(e);
}
/// <inheritdoc cref="M:HslControls.HslArrow.PaintHslControls(System.Drawing.Graphics,System.Single,System.Single)" />
// Token: 0x060005D8 RID: 1496 RVA: 0x00039F18 File Offset: 0x00038118
public void PaintHslControls(Graphics g, int width, int height)
{
bool flag2 = this.hslValvesStyle == HslDirectionStyle.Vertical;
if (flag2)
{
this.PaintMain(g, (float)width, (float)height);
}
else
{
g.TranslateTransform((float)width, 0f);
g.RotateTransform(90f);
this.PaintMain(g, (float)height, (float)width);
g.ResetTransform();
}
}
// Token: 0x060005D9 RID: 1497 RVA: 0x00039F80 File Offset: 0x00038180
private void PaintMain(Graphics g, float width, float height)
{
this.fontWidth = g.MeasureString(this.Text, this.Font).Width + 3f;
Brush brush = new SolidBrush(this.ForeColor);
RectangleF layoutRectangle = new RectangleF(this.startLocationX, 0f, this.fontWidth, height);
g.DrawString(this.Text, this.Font, brush, layoutRectangle, this.sf);
}
// Token: 0x060005DA RID: 1498 RVA: 0x00039FF4 File Offset: 0x000381F4
private PointF[] GetPointsFrom(string points, float width, float height, float dx = 0f, float dy = 0f)
{
return HslHelper.GetPointsFrom(points, 80.7f, 112.5f, width, height, dx, dy);
}
// Token: 0x060005DB RID: 1499 RVA: 0x0003A01C File Offset: 0x0003821C
private void Timer_Tick(object sender, EventArgs e)
{
if (this.moveSpeed != 0f)
{
if (this.startLocationX < -this.fontWidth - 5f)
{
this.startLocationX = (float)(base.Width + 1);
}
else
{
this.startLocationX -= this.moveSpeed;
}
base.Invalidate();
}
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
// Token: 0x060005DC RID: 1500 RVA: 0x0003A088 File Offset: 0x00038288
protected override void Dispose(bool disposing)
{
bool flag = disposing && this.components != null;
if (flag)
{
this.components.Dispose();
}
base.Dispose(disposing);
}
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
// Token: 0x060005DD RID: 1501 RVA: 0x0003A0C0 File Offset: 0x000382C0
private void InitializeComponent()
{
base.SuspendLayout();
base.AutoScaleMode = AutoScaleMode.None;
this.BackColor = Color.Transparent;
base.Name = "HslMoveText";
base.Size = new Size(720, 41);
base.ResumeLayout(false);
}
// Token: 0x040002DD RID: 733
private float fontWidth = 100f;
// Token: 0x040002DE RID: 734
private StringFormat sf = null;
// Token: 0x040002DF RID: 735
private HslDirectionStyle hslValvesStyle = HslDirectionStyle.Vertical;
// Token: 0x040002E0 RID: 736
private float moveSpeed = 1f;
// Token: 0x040002E1 RID: 737
private Timer timer = null;
// Token: 0x040002E2 RID: 738
private float startLocationX = -100000f;
/// <summary>
/// 必需的设计器变量。
/// </summary>
// Token: 0x040002E3 RID: 739
private IContainer components = null;
}
}

@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace Mesnac.Controls.ChemicalWeighing
{
/// <summary>参考坐标系的轴信息</summary>
[TypeConverter(typeof(ReferenceAxisConverter))]
public class ReferenceAxis
{
private float _max;
private float _min;
private string _unit;
private string _format;
private Color _color;
private UserControl _control;
private Pen _pen;
/// <summary>实例化一个默认的对象</summary>
public ReferenceAxis()
{
this.Max = 100f;
this.Min = 0.0f;
this.Color = Color.LightGray;
this.Format = "{0}";
}
/// <summary>实例化一个默认的对象</summary>
public ReferenceAxis(UserControl userControl)
: this()
{
this._control = userControl;
}
/// <summary>实例化一个默认的对象</summary>
/// <param name="max">最大值</param>
/// <param name="min">最小值</param>
public ReferenceAxis(float max, float min)
{
this.Max = max;
this.Min = min;
}
/// <summary>最大值</summary>
[Category("HslControls")]
[Description("获取或设置当前的Y轴的最大值")]
[Browsable(true)]
[DefaultValue(100f)]
public float Max
{
get => this._max;
set
{
this._max = value;
this._control?.Invalidate();
}
}
/// <summary>最小值</summary>
[Category("HslControls")]
[Description("获取或设置当前的Y轴的最小值")]
[Browsable(true)]
[DefaultValue(0.0f)]
public float Min
{
get => this._min;
set
{
this._min = value;
this._control?.Invalidate();
}
}
/// <summary>单位信息</summary>
[Category("HslControls")]
[Description("获取或设置当前的Y轴的单位值")]
[Browsable(true)]
[DefaultValue("")]
public string Unit
{
get => this._unit;
set
{
this._unit = value;
this._control?.Invalidate();
}
}
/// <summary>获取或设置当前的坐标系的颜色信息</summary>
[Category("HslControls")]
[Description("获取或设置当前的坐标系的颜色信息")]
[Browsable(true)]
[DefaultValue(typeof(Color), "LightGray")]
public Color Color
{
get => this._color;
set
{
this._color = value;
this.Brush?.Dispose();
this.Brush = (Brush)new SolidBrush(this._color);
this._pen?.Dispose();
this._pen = new Pen(this._color, 1f);
this._control?.Invalidate();
}
}
/// <summary>获取或设置当前坐标轴数字的格式化信息,默认为 {0}, 直接转字符串</summary>
[Category("HslControls")]
[Description("获取或设置当前坐标轴数字的格式化信息,默认为 {0}, 直接转字符串")]
[Browsable(true)]
[DefaultValue("{0}")]
public string Format
{
get => this._format;
set
{
this._format = value;
this._control?.Invalidate();
}
}
/// <summary>获取画笔信息</summary>
/// <returns>画笔信息</returns>
public Pen GetPen()
{
if (this._pen != null)
return this._pen;
this._pen = new Pen(this.Color, 1f);
return this._pen;
}
/// <summary>画刷资源</summary>
[Browsable(false)]
public Brush Brush { get; set; }
}
}

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesnac.Controls.ChemicalWeighing
{
/// <summary>参考坐标轴的转换器</summary>
public class ReferenceAxisConverter : TypeConverter
{
/// <inheritdoc />
public override PropertyDescriptorCollection GetProperties(
ITypeDescriptorContext context,
object value,
Attribute[] attributes)
{
return TypeDescriptor.GetProperties(value, attributes);
}
/// <inheritdoc />
public override bool GetPropertiesSupported(ITypeDescriptorContext context) => true;
}
}

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DDEE27AA-0694-47A6-9335-E9308261F63A}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>HighWayIot.Controls</RootNamespace>
<AssemblyName>HighWayIot.Controls</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Controls\ControlHelper.cs" />
<Compile Include="Controls\HslDirectionStyle.cs" />
<Compile Include="Controls\HslHelper.cs" />
<Compile Include="Controls\HslMoveText.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\ReferenceAxis.cs" />
<Compile Include="Controls\ReferenceAxisConverter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("HighWayIot.Controls")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HighWayIot.Controls")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("ddee27aa-0694-47a6-9335-e9308261f63a")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -46,11 +46,11 @@ namespace HighWayIot.Plc.PlcHelper
/// 复位报警点位信号
/// </summary>
/// <param name="No"></param>
public void WriteAlarmSignal(int No)
public void WriteAlarmSignal()
{
if(!PlcConnect.PlcWrite2($"3030.{No:X}", false, DataTypeEnum.Bool).IsSuccess)
if(!PlcConnect.PlcWrite2($"D3030", 0, DataTypeEnum.UInt16).IsSuccess)
{
LogHelper.Instance.Error($"小车报警复位失败 No.{No}");
LogHelper.Instance.Error($"小车报警复位失败");
}
}

@ -138,6 +138,12 @@ namespace HighWayIot.Repository.domain
[Description("生胎宽度")]
public string RawTireWidth { get; set; } = string.Empty;
/// <summary>
/// 标准重量
/// </summary>
[Description("标准重量")]
public string StandardWeight { get; set; } = string.Empty;
/// <summary>
/// 生胎重量
/// </summary>
@ -149,5 +155,11 @@ namespace HighWayIot.Repository.domain
/// </summary>
[Description("复重重量")]
public string RepeatWeight { get; set; } = string.Empty;
/// <summary>
/// 状态
/// </summary>
[Description("状态")]
public string IsDone { get; set; } = string.Empty;
}
}

@ -55,6 +55,12 @@ namespace HighWayIot.Repository.domain
///</summary>
public int? RawTireWeight { get; set; }
/// <summary>
/// 备 注:标准重量
/// 默认值:
///</summary>
public int? StandardWeight { get; set; }
/// <summary>
/// 基部胶耗时
/// </summary>

@ -68,6 +68,13 @@ namespace HighWayIot.Repository.domain
[SugarColumn(ColumnName = "raw_tire_weight")]
public int? RawTireWeight { get; set; }
/// <summary>
/// 备 注:标准重量
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "standard_weight")]
public int? StandardWeight { get; set; }
/// <summary>
/// 备 注:基部胶开始
/// 默认值:

@ -67,5 +67,22 @@ namespace HighWayIot.Repository.service
return false;
}
}
/// <summary>
/// 删除一个月之前的数据
/// </summary>
/// <returns></returns>
public bool DeleteMoreData()
{
try
{
return _repository.Delete(x => x.LogTime <= (DateTime.Now - TimeSpan.FromDays(30)));
}
catch (Exception ex)
{
log.Error("数据删除异常", ex);
return false;
}
}
}
}

@ -68,5 +68,21 @@ namespace HighWayIot.Repository.service
}
}
/// <summary>
/// 删除一个月之前的数据
/// </summary>
/// <returns></returns>
public bool DeleteMoreData()
{
try
{
return _repository.Delete(x => x.LogTime <= (DateTime.Now - TimeSpan.FromDays(30)));
}
catch (Exception ex)
{
log.Error("数据删除异常", ex);
return false;
}
}
}
}

@ -34,6 +34,29 @@ namespace HighWayIot.Repository.service
/// </summary>
/// <returns></returns>
public List<ZxDailyReportEntity> GetDailyReportInfos()
{
try
{
DateTime day = DateTime.Now - TimeSpan.FromDays(2);
List<ZxDailyReportEntity> entity =
_repository.AsQueryable()
.Where(x => x.StartTime >= day)
.OrderByDescending(x => x.StartTime)
.ToList();
return entity;
}
catch (Exception ex)
{
log.Error("报表息获取异常", ex);
return null;
}
}
/// <summary>
/// 查询报表信息
/// </summary>
/// <returns></returns>
public List<ZxDailyReportEntity> GetOneDayDailyReportInfos()
{
try
{
@ -127,5 +150,22 @@ namespace HighWayIot.Repository.service
return false;
}
}
/// <summary>
/// 删除一个月之前的数据
/// </summary>
/// <returns></returns>
public bool DeleteMoreData()
{
try
{
return _repository.Delete(x => x.StartTime <= (DateTime.Now - TimeSpan.FromDays(30)));
}
catch (Exception ex)
{
log.Error("数据删除异常", ex);
return false;
}
}
}
}

@ -54,6 +54,7 @@ namespace HighWayIot.Winform.Business
float[] weights = new float[4];
//报警信号
bool[] alarm = new bool[10];
//报警信号获取
alarm[0] = signals[58].GetBoolByIndex(0);
alarm[1] = signals[58].GetBoolByIndex(1);
@ -66,6 +67,7 @@ namespace HighWayIot.Winform.Business
alarm[8] = signals[59].GetBoolByIndex(0);
alarm[9] = signals[59].GetBoolByIndex(1);
bool flag = false;
//称重信号解析
for (int i = 0; i < 10; i++)
{
@ -79,10 +81,14 @@ namespace HighWayIot.Winform.Business
P1 = i + 1,
}))
{
transferSingal.WriteAlarmSignal(i + 1);
flag = true;
}
}
}
if (flag)
{
transferSingal.WriteAlarmSignal();
}
//报表信号获取
for (int i = 0; i < 7; i++)
@ -208,7 +214,7 @@ namespace HighWayIot.Winform.Business
/// <param name="rgvNo">RGV编号</param>
public bool MonitorInsert(string recipeCode, string deviceNo, int rgvNo)
{
DateTime judgeTime = DateTime.Now - TimeSpan.FromMinutes(30);
DateTime judgeTime = DateTime.Now - TimeSpan.FromMinutes(10);
List<ZxDailyReportEntity> judgeEntity = ZxDailyReportService.Instance
.GetDailyReportInfos(x =>
x.DeviceNo == rgvNo &&
@ -239,7 +245,8 @@ namespace HighWayIot.Winform.Business
RecipeCode = recipeEntity.RecipeCode,
SpecCode = recipeEntity.RecipeSpecCode,
DeviceNo = rgvNo,
RawTireWeight = 0,//(int)ZxRecipeParaService.Instance.GetRecipeParaInfoByRecipeCode(recipeCode).FirstOrDefault()?.TireWeight,
RawTireWeight = 0,
StandardWeight = (int)ZxRecipeParaService.Instance.GetRecipeParaInfoByRecipeCode(recipeCode).FirstOrDefault()?.TireWeight,
IsDone = 0
};

@ -0,0 +1,330 @@
using HighWayIot.Repository.domain;
using HighWayIot.Repository.service;
using Models;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Timer = System.Threading.Timer;
namespace HighWayIot.Winform.Business
{
/// <summary>
/// 定时报表导出
/// </summary>
public class TimerExportBusiness
{
private Timer RecordTimer;
private string _savePath = string.Empty;
/// <summary>
/// 处理前的报表数据
/// </summary>
private List<ZxDailyReportEntity> _zxDailyReportEntities;
/// <summary>
/// 导出的报表
/// </summary>
private List<ExportTableEntity> _exportTableEntities = new List<ExportTableEntity>();
private DataTable dataTable;
public TimerExportBusiness()
{
RecordTimer = new Timer(ExportJudge, null, 0, 1000);
}
/// <summary>
/// 判断是否该导出了
/// </summary>
/// <param name="o"></param>
private void ExportJudge(object o)
{
DateTime now = DateTime.Now;
var timeList = SysShiftTimeService.Instance.GetShiftInfos();
var morningShift = timeList.Where(x => x.ShiftName == "早").FirstOrDefault();
var startArray = morningShift.ShiftStartTime.Split(':');
if(startArray.Length != 3)
{
return;
}
if (now.Hour == Convert.ToInt32(startArray[0])
&& now.Minute == Convert.ToInt32(startArray[1])
&& now.Second == Convert.ToInt32(startArray[3]))
{
AutoExport();
ZxDailyReportService.Instance.DeleteMoreData();
}
}
private void AutoExport()
{
_savePath = XmlUtil.Instance.ExportPathReader();
//获取前一天的报表
_zxDailyReportEntities = ZxDailyReportService.Instance.GetOneDayDailyReportInfos();
//查询所有称重信息
List<ZxWeightEntity> _zxWeightEntities = ZxWeightService.Instance.GetWeightInfos();
//查询所有配方信息
List<ZxRecipeEntity> _zxRecipeEntities = ZxRecipeService.Instance.GetRecipeInfos();
//开始关联 生成报表
foreach (ZxDailyReportEntity rawEntity in _zxDailyReportEntities)
{
ExportTableEntity exportTableEntity = new ExportTableEntity();
ZxRecipeEntity recipeEntity = _zxRecipeEntities.Where(x => x.RecipeCode == rawEntity.RecipeCode).FirstOrDefault();
ZxWeightEntity baseWeight = _zxWeightEntities.Where(x => x.RecipeCode == rawEntity.RecipeCode && x.MaterialType == "基部胶").FirstOrDefault();
ZxWeightEntity midWeight = _zxWeightEntities.Where(x => x.RecipeCode == rawEntity.RecipeCode && x.MaterialType == "中层胶").FirstOrDefault();
ZxWeightEntity faceWeight = _zxWeightEntities.Where(x => x.RecipeCode == rawEntity.RecipeCode && x.MaterialType == "胎面胶").FirstOrDefault();
if (recipeEntity == null)
{
continue;
}
exportTableEntity.RecipeCode = rawEntity.RecipeCode;
exportTableEntity.RecipeName = rawEntity.RecipeName;
exportTableEntity.SpecCode = rawEntity.SpecCode;
exportTableEntity.SpecName = recipeEntity.RecipeSpecName;
exportTableEntity.StartTime = rawEntity.StartTime.ToString("yyyy-MM-dd hh:mm:ss");
//基部胶
if (baseWeight != null)
{
exportTableEntity.BaseRubName = baseWeight.MaterialName;
exportTableEntity.BaseRubThickness = baseWeight.SetThickness.ToString();
//基部胶宽度和层数(可能有三层
if (baseWeight.SetLayer2 == 0 || baseWeight.SetLayer2 == null)
{
exportTableEntity.BaseRubWidth = baseWeight.SetWidth.ToString();
exportTableEntity.BaseRubLayer = baseWeight.SetLayer.ToString();
}
else if (baseWeight.SetLayer3 == 0 || baseWeight.SetLayer3 == null)
{
exportTableEntity.BaseRubWidth = $"{baseWeight.SetWidth2}/{baseWeight.SetWidth}";
exportTableEntity.BaseRubLayer = $"{baseWeight.SetLayer2}/{baseWeight.SetLayer}";
}
else
{
exportTableEntity.BaseRubWidth = $"{baseWeight.SetWidth2}/{baseWeight.SetWidth3}/{baseWeight.SetWidth}";
exportTableEntity.BaseRubLayer = $"{baseWeight.SetLayer2}/{baseWeight.SetLayer3}/{baseWeight.SetLayer}";
}
exportTableEntity.BaseRubFinishTime = GeneralUtils.DateTimeToString(rawEntity.StartTime, rawEntity.BaseEndTime);
}
//中层胶
if (midWeight != null)
{
exportTableEntity.MidRubName = midWeight.MaterialName;
exportTableEntity.MidRubThickness = midWeight.SetThickness.ToString();
//中层胶宽度和层数(可能有三层
if (midWeight.SetLayer2 == 0 || midWeight.SetLayer2 == null)
{
exportTableEntity.MidRubWidth = midWeight.SetWidth.ToString();
exportTableEntity.MidRubLayer = midWeight.SetLayer.ToString();
}
else if (midWeight.SetLayer3 == 0 || midWeight.SetLayer3 == null)
{
exportTableEntity.MidRubWidth = $"{midWeight.SetWidth2}/{midWeight.SetWidth}";
exportTableEntity.MidRubLayer = $"{midWeight.SetLayer2}/{midWeight.SetLayer}";
}
else
{
exportTableEntity.MidRubWidth = $"{midWeight.SetWidth2}/{midWeight.SetWidth3}/{midWeight.SetWidth}";
exportTableEntity.MidRubLayer = $"{midWeight.SetLayer2}/{midWeight.SetLayer3}/{midWeight.SetLayer}";
}
exportTableEntity.MidRubFinishTime = GeneralUtils.DateTimeToString(rawEntity.StartTime, rawEntity.MidEndTime);
}
//胎面胶
if (faceWeight != null)
{
exportTableEntity.FaceRubName = faceWeight.MaterialName;
exportTableEntity.FaceRubThickness = faceWeight.SetThickness.ToString();
//胎面胶宽度和层数(可能有三层
if (faceWeight.SetLayer2 == 0 || faceWeight.SetLayer2 == null)
{
exportTableEntity.FaceRubWidth = faceWeight.SetWidth.ToString();
exportTableEntity.FaceRubLayer = faceWeight.SetLayer.ToString();
}
else if (faceWeight.SetLayer3 == 0 || faceWeight.SetLayer3 == null)
{
exportTableEntity.FaceRubWidth = $"{faceWeight.SetWidth2}/{faceWeight.SetWidth}";
exportTableEntity.FaceRubLayer = $"{faceWeight.SetLayer2}/{faceWeight.SetLayer}";
}
else
{
exportTableEntity.FaceRubWidth = $"{faceWeight.SetWidth2}/{faceWeight.SetWidth3}/{faceWeight.SetWidth}";
exportTableEntity.FaceRubLayer = $"{faceWeight.SetLayer2}/{faceWeight.SetLayer3}/{faceWeight.SetLayer}";
}
exportTableEntity.FaceRubFinishTime = GeneralUtils.DateTimeToString(rawEntity.StartTime, rawEntity.FaceEndTime);
}
exportTableEntity.RawTireWidth = (faceWeight.SetThickness * 2 + faceWeight.SetWidth).ToString();
exportTableEntity.StandardWeight = rawEntity.StandardWeight.ToString();
exportTableEntity.RawTireWeight = (rawEntity.RawTireWeight ?? 0).ToString();
exportTableEntity.RepeatWeight = (rawEntity.RepeatWeight ?? 0).ToString();
exportTableEntity.IsDone = rawEntity.IsDone == 1 ? "已完成" : "未完成";
_exportTableEntities.Add(exportTableEntity);
}
try
{
dataTable = ToDataTable(_exportTableEntities.ToArray());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
ExportExcel(dataTable, _savePath);
}
/// <summary>
/// 导出Excel
/// </summary>
/// <param name="dt"></param>
public void ExportExcel(DataTable dt, string path)
{
try
{
//创建一个工作簿
IWorkbook workbook = new HSSFWorkbook();
//创建一个 sheet 表
ISheet sheet = workbook.CreateSheet(dt.TableName);
//创建一行
IRow rowH = sheet.CreateRow(0);
//创建一个单元格
ICell cell = null;
//创建单元格样式
ICellStyle cellStyle = workbook.CreateCellStyle();
//创建格式
IDataFormat dataFormat = workbook.CreateDataFormat();
//设置为文本格式,也可以为 text即 dataFormat.GetFormat("text");
cellStyle.DataFormat = dataFormat.GetFormat("@");
//设置列名
foreach (DataColumn col in dt.Columns)
{
//创建单元格并设置单元格内容
rowH.CreateCell(col.Ordinal).SetCellValue(col.Caption);
//设置单元格格式
rowH.Cells[col.Ordinal].CellStyle = cellStyle;
}
//写入数据
for (int i = 0; i < dt.Rows.Count; i++)
{
//跳过第一行,第一行为列名
IRow row = sheet.CreateRow(i + 1);
for (int j = 0; j < dt.Columns.Count; j++)
{
cell = row.CreateCell(j);
cell.SetCellValue(dt.Rows[i][j].ToString());
cell.CellStyle = cellStyle;
}
}
//设置导出文件路径
//string path = HttpContext.Current.Server.MapPath("Export/");
//设置新建文件路径及名称
string savePath = $"{path}/自动导出-203报表{DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")}.xls";
//创建文件
FileStream file = new FileStream(savePath, FileMode.CreateNew, FileAccess.Write);
//创建一个 IO 流
MemoryStream ms = new MemoryStream();
//写入到流
workbook.Write(ms);
//转换为字节数组
byte[] bytes = ms.ToArray();
file.Write(bytes, 0, bytes.Length);
file.Flush();
//还可以调用下面的方法,把流输出到浏览器下载
//OutputClient(bytes);
//释放资源
bytes = null;
ms.Close();
ms.Dispose();
file.Close();
file.Dispose();
workbook.Close();
sheet = null;
workbook = null;
MessageBox.Show("导出成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
/// <summary>
/// 实体类转dt
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="entities"></param>
/// <returns></returns>
public DataTable ToDataTable<T>(T[] entities)
{
DataTable dataTable = new DataTable(typeof(T).Name);
PropertyInfo[] properties = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance);
foreach (PropertyInfo propInfo in properties)
{
// Get the Description attribute if it exists
var descriptionAttribute = propInfo.GetCustomAttribute<DescriptionAttribute>();
string columnName = descriptionAttribute != null ? descriptionAttribute.Description : propInfo.Name;
dataTable.Columns.Add(columnName, propInfo.PropertyType);
}
foreach (T entity in entities)
{
object[] values = new object[properties.Length];
for (int i = 0; i < properties.Length; i++)
{
values[i] = properties[i].GetValue(entity);
}
dataTable.Rows.Add(values);
}
return dataTable;
}
}
}

@ -1,6 +1,8 @@
using HighWayIot.Repository.service;
using HighWayIot.Log4net;
using HighWayIot.Repository.service;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -58,8 +60,66 @@ namespace HighWayIot.Winform.Business
return list;
}
/// <summary>
/// 读取导出路径配置
/// </summary>
/// <returns></returns>
public string ExportPathReader()
{
xmlDocument.Load($"{Path}\\Configuration.xml");
XmlNode root = xmlDocument.DocumentElement;
XmlNode node = root.SelectSingleNode("ExportConfig");
XmlAttribute path = (XmlAttribute)node.Attributes.GetNamedItem("Path");
return path.Value;
}
public void ExportPathWriter(string path)
{
//xmlDocument.Load($"{Path}\\Configuration.xml");
//XmlNode root = xmlDocument.DocumentElement;
//XmlNode node = root.SelectSingleNode("ExportConfig");
//node.Attributes["Path"].Value = path;
//xmlDocument.Save($"{Path}\\Configuration.xml");
// 参数验证
if (string.IsNullOrWhiteSpace(path))
{
throw new ArgumentNullException(nameof(path), "导出路径不能为空");
}
try
{
// 加载XML文档
xmlDocument.Load($"{Path}\\Configuration.xml");
// 获取根节点
XmlNode root = xmlDocument.DocumentElement ??
throw new InvalidOperationException("XML文档没有根元素");
// 查找ExportConfig节点
XmlNode node = root.SelectSingleNode("ExportConfig") ??
throw new InvalidOperationException("找不到ExportConfig节点");
// 获取Path属性
XmlAttribute pathAttribute = node.Attributes?["Path"] ??
throw new InvalidOperationException("ExportConfig节点没有Path属性");
// 设置新值
pathAttribute.Value = path;
// 保存修改
xmlDocument.Save($"{Path}\\Configuration.xml");
}
catch (Exception ex)
{
// 记录日志或处理特定异常
LogHelper.Instance.Error("保存导出路径配置失败", ex);
}
}
}
public class RoleConfig
{
/// <summary>
@ -72,4 +132,11 @@ namespace HighWayIot.Winform.Business
/// </summary>
public int RoleIndex { get; set; }
}
public class ExportPathConfig
{
public string ExportConfig { get; set; }
public string Config { get; set; }
}
}

@ -18,5 +18,6 @@
<Role PageName = "RFID参数配置" RoleIndex = "12" />
<Role PageName = "PLC测试页面" RoleIndex = "14" />
</RoleConfig>
<ExportConfig Path =""/>
</root>

@ -153,6 +153,7 @@
<Compile Include="Business\RoleBusiness.cs" />
<Compile Include="Business\SqlLogHelper.cs" />
<Compile Include="Business\TCPClientFactory.cs" />
<Compile Include="Business\TimerExportBusiness.cs" />
<Compile Include="Business\WorkStationBusiness.cs" />
<Compile Include="Business\XmlUtil.cs" />
<Compile Include="MainForm\BaseForm.cs">
@ -175,6 +176,12 @@
<Compile Include="UserControlPages\LogPages\ExportPreviewForm.Designer.cs">
<DependentUpon>ExportPreviewForm.cs</DependentUpon>
</Compile>
<Compile Include="UserControlPages\MonitorMainPages\ScrollTextSetForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UserControlPages\MonitorMainPages\ScrollTextSetForm.Designer.cs">
<DependentUpon>ScrollTextSetForm.cs</DependentUpon>
</Compile>
<Compile Include="UserControlPages\ParamConfigPages\RFIDParamSettingPage.cs">
<SubType>UserControl</SubType>
</Compile>
@ -333,6 +340,9 @@
<EmbeddedResource Include="UserControlPages\LogPages\ExportPreviewForm.resx">
<DependentUpon>ExportPreviewForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControlPages\MonitorMainPages\ScrollTextSetForm.resx">
<DependentUpon>ScrollTextSetForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControlPages\ParamConfigPages\RFIDParamSettingPage.resx">
<DependentUpon>RFIDParamSettingPage.cs</DependentUpon>
</EmbeddedResource>
@ -421,6 +431,10 @@
<None Include="Static\MesnacLogoHighPixel.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HighWayIot.Controls\HighWayIot.Controls.csproj">
<Project>{DDEE27AA-0694-47A6-9335-E9308261F63A}</Project>
<Name>HighWayIot.Controls</Name>
</ProjectReference>
<ProjectReference Include="..\HighWayIot.Log4net\HighWayIot.Log4net.csproj">
<Project>{DEABC30C-EC6F-472E-BD67-D65702FDAF74}</Project>
<Name>HighWayIot.Log4net</Name>
@ -467,7 +481,7 @@
<None Include="Resources\加硫-03.png" />
<Content Include="Static\海威.ico" />
<Content Include="Configuration.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>

@ -64,9 +64,6 @@ namespace HighWayIot.Winform.MainForm
this.SplitLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.LogInformationToolStrip = new System.Windows.Forms.ToolStripStatusLabel();
this.SplitLabel3 = new System.Windows.Forms.ToolStripStatusLabel();
this.Label2 = new System.Windows.Forms.ToolStripStatusLabel();
this.MolderStateLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.SplitLabel4 = new System.Windows.Forms.ToolStripStatusLabel();
this.StripLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.TimeStripLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.TimeDisplayTimer = new System.Windows.Forms.Timer(this.components);
@ -270,7 +267,7 @@ namespace HighWayIot.Winform.MainForm
this.UserControlTabs.SelectedIndex = 0;
this.UserControlTabs.Size = new System.Drawing.Size(1905, 995);
this.UserControlTabs.TabIndex = 3;
this.UserControlTabs.Selected += new TabControlEventHandler(this.TabControlChange);
this.UserControlTabs.Selected += new System.Windows.Forms.TabControlEventHandler(this.TabControlChange);
//
// ClosePageButton
//
@ -297,9 +294,6 @@ namespace HighWayIot.Winform.MainForm
this.SplitLabel2,
this.LogInformationToolStrip,
this.SplitLabel3,
this.Label2,
this.MolderStateLabel,
this.SplitLabel4,
this.StripLabel2,
this.TimeStripLabel});
this.statusStrip1.Location = new System.Drawing.Point(0, 1019);
@ -341,7 +335,7 @@ namespace HighWayIot.Winform.MainForm
// LogInformationToolStrip
//
this.LogInformationToolStrip.Name = "LogInformationToolStrip";
this.LogInformationToolStrip.Size = new System.Drawing.Size(1400, 17);
this.LogInformationToolStrip.Size = new System.Drawing.Size(1524, 17);
this.LogInformationToolStrip.Spring = true;
this.LogInformationToolStrip.Text = "message";
//
@ -351,24 +345,6 @@ namespace HighWayIot.Winform.MainForm
this.SplitLabel3.Name = "SplitLabel3";
this.SplitLabel3.Size = new System.Drawing.Size(4, 17);
//
// Label2
//
this.Label2.Name = "Label2";
this.Label2.Size = new System.Drawing.Size(89, 17);
this.Label2.Text = "成型PLC状态";
//
// MolderStateLabel
//
this.MolderStateLabel.Name = "MolderStateLabel";
this.MolderStateLabel.Size = new System.Drawing.Size(31, 17);
this.MolderStateLabel.Text = "N/A";
//
// SplitLabel4
//
this.SplitLabel4.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)));
this.SplitLabel4.Name = "SplitLabel4";
this.SplitLabel4.Size = new System.Drawing.Size(4, 17);
//
// StripLabel2
//
this.StripLabel2.Name = "StripLabel2";
@ -479,9 +455,6 @@ namespace HighWayIot.Winform.MainForm
private ToolStripMenuItem MaterialTypeConfigStripItem;
private ToolStripStatusLabel SplitLabel2;
private ToolStripStatusLabel SplitLabel3;
private ToolStripStatusLabel SplitLabel4;
private ToolStripStatusLabel Label2;
private ToolStripStatusLabel MolderStateLabel;
private ToolStripMenuItem rToolStripMenuItem;
private ToolStripMenuItem rFIDToolStripMenuItem;
private ToolStripMenuItem ToolStripMenuItem1;

@ -52,6 +52,11 @@ namespace HighWayIot.Winform.MainForm
/// </summary>
MonitorDataRefreshBusiness monitorDataRefreshBusiness = new MonitorDataRefreshBusiness();
/// <summary>
/// 定时报表导出
/// </summary>
TimerExportBusiness timerExportBusiness = new TimerExportBusiness();
/// <summary>
/// 排程combobox刷新
/// </summary>
@ -82,11 +87,6 @@ namespace HighWayIot.Winform.MainForm
/// </summary>
public int LastMoldingMachineWatchDogNum = -1;
/// <summary>
/// 看门狗计时器
/// </summary>
private System.Threading.Timer WatchDogTimer;
public BaseForm()
{
InitializeComponent();
@ -104,7 +104,6 @@ namespace HighWayIot.Winform.MainForm
UserPanelSwitch(typeof(MonitorMainPage), "监控主页面");
RoleControl();
SqlLogHelper.AddLog($"用户[{RoleBusiness.LoginUserName}]登录成功");
WatchDogTimer = new System.Threading.Timer(WarchDogJudge, null, 0, 2000); // 每2秒执行一次
LogRefreshAction += (log) =>
{
LogInformationToolStrip.Text = log;
@ -346,49 +345,6 @@ namespace HighWayIot.Winform.MainForm
}
}
/// <summary>
/// PLC看门狗状态判断
/// </summary>
/// <param name="WatchDogPoint">看门狗点位</param>
/// <returns></returns>
private void WarchDogJudge(object state)
{
//int openMixNow, moldingNow;
//if (PlcConnect.IsConnect1)
//{
// openMixNow = PlcConnect.ReadInt161("D666");
// if (openMixNow == LastOpenMixWatchDogNum)
// {
// OpenMixMachineWatchDog = 0;
// }
// else
// {
// OpenMixMachineWatchDog = 1;
// }
//}
//else
//{
// OpenMixMachineWatchDog = 2;
//}
//if (PlcConnect.IsConnect2)
//{
// moldingNow = PlcConnect.ReadInt162("D666");
// if (moldingNow == LastMoldingMachineWatchDogNum)
// {
// MoldingMachineWatchDog = 0;
// }
// else
// {
// MoldingMachineWatchDog = 1;
// }
//}
//else
//{
// MoldingMachineWatchDog = 2;
//}
}
/// <summary>
/// 配方下传方式转换
/// </summary>

@ -32,6 +32,13 @@ namespace HighWayIot.Winform.UserControlPages
private void InitializeComponent()
{
this.LogDataGridView = new System.Windows.Forms.DataGridView();
this.Id = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Text = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.LogTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Operator = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.SelectErrorLog = new System.Windows.Forms.Button();
this.ButtonPanel = new System.Windows.Forms.Panel();
this.P3TextBox = new System.Windows.Forms.TextBox();
@ -49,13 +56,7 @@ namespace HighWayIot.Winform.UserControlPages
this.label2 = new System.Windows.Forms.Label();
this.LogTextTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.Id = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Text = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.LogTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Operator = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.P3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DeleteUselessData = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.LogDataGridView)).BeginInit();
this.ButtonPanel.SuspendLayout();
this.SuspendLayout();
@ -85,6 +86,58 @@ namespace HighWayIot.Winform.UserControlPages
this.LogDataGridView.Size = new System.Drawing.Size(1170, 816);
this.LogDataGridView.TabIndex = 0;
//
// Id
//
this.Id.DataPropertyName = "Id";
this.Id.HeaderText = "ID";
this.Id.Name = "Id";
this.Id.ReadOnly = true;
this.Id.Width = 50;
//
// Text
//
this.Text.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.Text.DataPropertyName = "Text";
this.Text.HeaderText = "日志内容";
this.Text.Name = "Text";
this.Text.ReadOnly = true;
//
// LogTime
//
this.LogTime.DataPropertyName = "LogTime";
this.LogTime.HeaderText = "日志时间";
this.LogTime.Name = "LogTime";
this.LogTime.ReadOnly = true;
this.LogTime.Width = 150;
//
// Operator
//
this.Operator.DataPropertyName = "Operator";
this.Operator.HeaderText = "操作者用户名";
this.Operator.Name = "Operator";
this.Operator.ReadOnly = true;
//
// P1
//
this.P1.DataPropertyName = "P1";
this.P1.HeaderText = "字段1";
this.P1.Name = "P1";
this.P1.ReadOnly = true;
//
// P2
//
this.P2.DataPropertyName = "P2";
this.P2.HeaderText = "字段2";
this.P2.Name = "P2";
this.P2.ReadOnly = true;
//
// P3
//
this.P3.DataPropertyName = "P3";
this.P3.HeaderText = "字段3";
this.P3.Name = "P3";
this.P3.ReadOnly = true;
//
// SelectErrorLog
//
this.SelectErrorLog.Location = new System.Drawing.Point(11, 11);
@ -100,6 +153,7 @@ namespace HighWayIot.Winform.UserControlPages
//
this.ButtonPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ButtonPanel.Controls.Add(this.DeleteUselessData);
this.ButtonPanel.Controls.Add(this.P3TextBox);
this.ButtonPanel.Controls.Add(this.label7);
this.ButtonPanel.Controls.Add(this.P2TextBox);
@ -214,9 +268,9 @@ namespace HighWayIot.Winform.UserControlPages
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(295, 16);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(65, 12);
this.label3.Size = new System.Drawing.Size(41, 12);
this.label3.TabIndex = 31;
this.label3.Text = "登陆时间:";
this.label3.Text = "时间:";
//
// OperatorNameTextBox
//
@ -250,57 +304,17 @@ namespace HighWayIot.Winform.UserControlPages
this.label1.TabIndex = 27;
this.label1.Text = "日志内容";
//
// Id
// DeleteUselessData
//
this.Id.DataPropertyName = "Id";
this.Id.HeaderText = "ID";
this.Id.Name = "Id";
this.Id.ReadOnly = true;
this.Id.Width = 50;
//
// Text
//
this.Text.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.Text.DataPropertyName = "Text";
this.Text.HeaderText = "日志内容";
this.Text.Name = "Text";
this.Text.ReadOnly = true;
//
// LogTime
//
this.LogTime.DataPropertyName = "LogTime";
this.LogTime.HeaderText = "日志时间";
this.LogTime.Name = "LogTime";
this.LogTime.ReadOnly = true;
this.LogTime.Width = 150;
//
// Operator
//
this.Operator.DataPropertyName = "Operator";
this.Operator.HeaderText = "操作者用户名";
this.Operator.Name = "Operator";
this.Operator.ReadOnly = true;
//
// P1
//
this.P1.DataPropertyName = "P1";
this.P1.HeaderText = "字段1";
this.P1.Name = "P1";
this.P1.ReadOnly = true;
//
// P2
//
this.P2.DataPropertyName = "P2";
this.P2.HeaderText = "字段2";
this.P2.Name = "P2";
this.P2.ReadOnly = true;
//
// P3
//
this.P3.DataPropertyName = "P3";
this.P3.HeaderText = "字段3";
this.P3.Name = "P3";
this.P3.ReadOnly = true;
this.DeleteUselessData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.DeleteUselessData.Location = new System.Drawing.Point(1072, 13);
this.DeleteUselessData.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.DeleteUselessData.Name = "DeleteUselessData";
this.DeleteUselessData.Size = new System.Drawing.Size(82, 39);
this.DeleteUselessData.TabIndex = 42;
this.DeleteUselessData.Text = "删除一个月之前的数据";
this.DeleteUselessData.UseVisualStyleBackColor = true;
this.DeleteUselessData.Click += new System.EventHandler(this.DeleteUselessData_Click);
//
// AlarmConfigPage
//
@ -347,5 +361,6 @@ namespace HighWayIot.Winform.UserControlPages
private DataGridViewTextBoxColumn P1;
private DataGridViewTextBoxColumn P2;
private DataGridViewTextBoxColumn P3;
private Button DeleteUselessData;
}
}

@ -61,5 +61,13 @@ namespace HighWayIot.Winform.UserControlPages
LogDataGridView.DataSource = null;
LogDataGridView.DataSource = Lists;
}
private void DeleteUselessData_Click(object sender, EventArgs e)
{
if (sysErrorLogService.DeleteMoreData())
{
MessageBox.Show("删除成功");
}
}
}
}

@ -138,4 +138,25 @@
<metadata name="P3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Text.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="LogTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Operator.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="P1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="P2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="P3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

@ -40,11 +40,13 @@ namespace HighWayIot.Winform.UserControlPages
this.RecipeName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.SpecCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DeviceNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RawTireWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.StandardWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.BaseRubTimeSpan = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.MidRubTimeSpan = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.FaceRubTimeSpan = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RawTireWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RepeatWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.IsDone = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ButtonPanel = new System.Windows.Forms.Panel();
this.DataCountLabel = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
@ -60,6 +62,7 @@ namespace HighWayIot.Winform.UserControlPages
this.label3 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.SelectReport = new System.Windows.Forms.Button();
this.DeleteUselessData = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.ReportDataGridView)).BeginInit();
this.ButtonPanel.SuspendLayout();
this.SuspendLayout();
@ -88,11 +91,13 @@ namespace HighWayIot.Winform.UserControlPages
this.RecipeName,
this.SpecCode,
this.DeviceNo,
this.RawTireWeight,
this.StandardWeight,
this.BaseRubTimeSpan,
this.MidRubTimeSpan,
this.FaceRubTimeSpan,
this.RepeatWeight});
this.RawTireWeight,
this.RepeatWeight,
this.IsDone});
this.ReportDataGridView.Location = new System.Drawing.Point(-3, 65);
this.ReportDataGridView.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.ReportDataGridView.Name = "ReportDataGridView";
@ -161,13 +166,12 @@ namespace HighWayIot.Winform.UserControlPages
this.DeviceNo.ReadOnly = true;
this.DeviceNo.Width = 80;
//
// RawTireWeight
// StandardWeight
//
this.RawTireWeight.DataPropertyName = "RawTireWeight";
this.RawTireWeight.HeaderText = "生胎重量";
this.RawTireWeight.Name = "RawTireWeight";
this.RawTireWeight.ReadOnly = true;
this.RawTireWeight.Width = 80;
this.StandardWeight.DataPropertyName = "StandardWeight";
this.StandardWeight.HeaderText = "标准重量";
this.StandardWeight.Name = "StandardWeight";
this.StandardWeight.ReadOnly = true;
//
// BaseRubTimeSpan
//
@ -193,6 +197,14 @@ namespace HighWayIot.Winform.UserControlPages
this.FaceRubTimeSpan.ReadOnly = true;
this.FaceRubTimeSpan.Width = 140;
//
// RawTireWeight
//
this.RawTireWeight.DataPropertyName = "RawTireWeight";
this.RawTireWeight.HeaderText = "生胎重量";
this.RawTireWeight.Name = "RawTireWeight";
this.RawTireWeight.ReadOnly = true;
this.RawTireWeight.Width = 80;
//
// RepeatWeight
//
this.RepeatWeight.DataPropertyName = "RepeatWeight";
@ -201,10 +213,19 @@ namespace HighWayIot.Winform.UserControlPages
this.RepeatWeight.ReadOnly = true;
this.RepeatWeight.Width = 80;
//
// IsDone
//
this.IsDone.DataPropertyName = "IsDone";
this.IsDone.HeaderText = "状态";
this.IsDone.Name = "IsDone";
this.IsDone.ReadOnly = true;
this.IsDone.Width = 50;
//
// ButtonPanel
//
this.ButtonPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ButtonPanel.Controls.Add(this.DeleteUselessData);
this.ButtonPanel.Controls.Add(this.DataCountLabel);
this.ButtonPanel.Controls.Add(this.label5);
this.ButtonPanel.Controls.Add(this.ExportTableButton);
@ -224,7 +245,6 @@ namespace HighWayIot.Winform.UserControlPages
this.ButtonPanel.Name = "ButtonPanel";
this.ButtonPanel.Size = new System.Drawing.Size(1636, 61);
this.ButtonPanel.TabIndex = 6;
this.ButtonPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.ButtonPanel_Paint);
//
// DataCountLabel
//
@ -355,6 +375,18 @@ namespace HighWayIot.Winform.UserControlPages
this.SelectReport.UseVisualStyleBackColor = true;
this.SelectReport.Click += new System.EventHandler(this.SelectReport_Click);
//
// DeleteUselessData
//
this.DeleteUselessData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.DeleteUselessData.Location = new System.Drawing.Point(1537, 13);
this.DeleteUselessData.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.DeleteUselessData.Name = "DeleteUselessData";
this.DeleteUselessData.Size = new System.Drawing.Size(82, 39);
this.DeleteUselessData.TabIndex = 30;
this.DeleteUselessData.Text = "删除一个月之前的数据";
this.DeleteUselessData.UseVisualStyleBackColor = true;
this.DeleteUselessData.Click += new System.EventHandler(this.DeleteUselessData_Click);
//
// DailyReportPage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -397,10 +429,13 @@ namespace HighWayIot.Winform.UserControlPages
private DataGridViewTextBoxColumn RecipeName;
private DataGridViewTextBoxColumn SpecCode;
private DataGridViewTextBoxColumn DeviceNo;
private DataGridViewTextBoxColumn RawTireWeight;
private DataGridViewTextBoxColumn StandardWeight;
private DataGridViewTextBoxColumn BaseRubTimeSpan;
private DataGridViewTextBoxColumn MidRubTimeSpan;
private DataGridViewTextBoxColumn FaceRubTimeSpan;
private DataGridViewTextBoxColumn RawTireWeight;
private DataGridViewTextBoxColumn RepeatWeight;
private DataGridViewTextBoxColumn IsDone;
private Button DeleteUselessData;
}
}

@ -44,28 +44,6 @@ namespace HighWayIot.Winform.UserControlPages
{
ReportDataGridView.AutoGenerateColumns = false;
List<string> recipeCodes = new List<string>()
{
""
};
recipeCodes.AddRange(ZxRecipeService.Instance.GetRecipeInfos().Select(x => x.RecipeCode).ToList());
List<string> workStationNos = new List<string>()
{
""
};
workStationNos.AddRange(ZxReaderSettingService.Instance.GetReaderInfos().Select(x => x.WorkstationNo).ToList());
List<string> deviceNos = new List<string>()
{
""
};
deviceNos.AddRange(ZxTagSettingService.Instance.GetTagInfos().Select(x => x.DeviceNo).ToList());
RecipeCodeCombobox.DataSource = recipeCodes;
VulcanizationNoCombobox.DataSource = workStationNos;
DeviceNoCombobox.DataSource = deviceNos;
SelectStartTime.Value = DateTime.Now.AddDays(-1);
SelectEndTime.Value = DateTime.Now;
@ -88,8 +66,9 @@ namespace HighWayIot.Winform.UserControlPages
&& x.StartTime <= SelectEndTime.Value
&& (string.IsNullOrEmpty(RecipeCodeCombobox.Text) || x.RecipeCode == RecipeCodeCombobox.Text)
&& (string.IsNullOrEmpty(VulcanizationNoCombobox.Text) || x.VulcanizationNo == VulcanizationNoCombobox.Text)
&& (string.IsNullOrEmpty(DeviceNoCombobox.Text) || x.DeviceNo.ToString() == DeviceNoCombobox.Text)
&& x.IsDone == 1);
&& (string.IsNullOrEmpty(DeviceNoCombobox.Text) || x.DeviceNo.ToString() == DeviceNoCombobox.Text))
.OrderByDescending(x => x.StartTime)
.ToList();
_monitorDataSources.Clear();
@ -104,25 +83,39 @@ namespace HighWayIot.Winform.UserControlPages
RecipeCode = dailyEntities[i].RecipeCode,
SpecCode = dailyEntities[i].SpecCode,
DeviceNo = dailyEntities[i].DeviceNo.ToString(),
StandardWeight = dailyEntities[i].StandardWeight ?? 0,
RawTireWeight = dailyEntities[i].RawTireWeight ?? 0,
BaseRubTimeSpan = GeneralUtils.DateTimeToString(dailyEntities[i].StartTime, dailyEntities[i].BaseEndTime),
MidRubTimeSpan = GeneralUtils.DateTimeToString(dailyEntities[i].StartTime, dailyEntities[i].MidEndTime),
FaceRubTimeSpan = GeneralUtils.DateTimeToString(dailyEntities[i].StartTime, dailyEntities[i].FaceEndTime),
IsDone = dailyEntities[i].IsDone == 1 ? "已完成" : "未完成"
});
}
List<string> ds1 = new List<string>() { "" };
ds1.AddRange(_monitorDataSources.Select(x => x.VulcanizationNo).ToList());
ds1.AddRange(_monitorDataSources
.Select(x => x.VulcanizationNo)
.Distinct()
.OrderBy(x => x)
.ToList());
VulcanizationNoCombobox.DataSource = ds1;
VulcanizationNoCombobox.SelectedIndex = 0;
List<string> ds2 = new List<string>() { "" };
ds2.AddRange(_monitorDataSources.Select(x => x.DeviceNo).ToList());
ds2.AddRange(_monitorDataSources
.Select(x => x.DeviceNo)
.Distinct()
.OrderBy(x => x)
.ToList());
DeviceNoCombobox.DataSource = ds2;
DeviceNoCombobox.SelectedIndex = 0;
List<string> ds3 = new List<string>() { "" };
ds3.AddRange(_monitorDataSources.Select(x => x.RecipeCode).ToList());
ds3.AddRange(_monitorDataSources
.Select(x => x.RecipeCode)
.Distinct()
.OrderBy(x => x)
.ToList());
RecipeCodeCombobox.DataSource = ds3;
RecipeCodeCombobox.SelectedIndex = 0;
@ -143,9 +136,17 @@ namespace HighWayIot.Winform.UserControlPages
}
}
private void ButtonPanel_Paint(object sender, PaintEventArgs e)
/// <summary>
/// 删除多余数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DeleteUselessData_Click(object sender, EventArgs e)
{
if (_zxDailyReportService.DeleteMoreData())
{
MessageBox.Show("删除成功");
}
}
}
}

@ -138,7 +138,7 @@
<metadata name="DeviceNo.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RawTireWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="StandardWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="BaseRubTimeSpan.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@ -150,7 +150,13 @@
<metadata name="FaceRubTimeSpan.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RawTireWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RepeatWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="IsDone.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

@ -30,6 +30,10 @@
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.ExportButton = new System.Windows.Forms.Button();
this.PathTextBox = new System.Windows.Forms.TextBox();
this.PathSelectButton = new System.Windows.Forms.Button();
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
this.RecipeCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RecipeName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.SpecCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -50,13 +54,11 @@
this.FaceRubWidth = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.FaceRubLayer = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RawTireWidth = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RawTireFinishTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.FaceRubFinishTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.StandardWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RawTireWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RepeatWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ExportButton = new System.Windows.Forms.Button();
this.PathTextBox = new System.Windows.Forms.TextBox();
this.PathSelectButton = new System.Windows.Forms.Button();
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
this.IsDone = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
@ -96,9 +98,11 @@
this.FaceRubWidth,
this.FaceRubLayer,
this.RawTireWidth,
this.RawTireFinishTime,
this.FaceRubFinishTime,
this.StandardWeight,
this.RawTireWeight,
this.RepeatWeight});
this.RepeatWeight,
this.IsDone});
this.dataGridView1.Cursor = System.Windows.Forms.Cursors.IBeam;
this.dataGridView1.EnableHeadersVisualStyles = false;
this.dataGridView1.Location = new System.Drawing.Point(0, 50);
@ -108,6 +112,34 @@
this.dataGridView1.Size = new System.Drawing.Size(1904, 991);
this.dataGridView1.TabIndex = 0;
//
// ExportButton
//
this.ExportButton.Location = new System.Drawing.Point(9, 9);
this.ExportButton.Margin = new System.Windows.Forms.Padding(0);
this.ExportButton.Name = "ExportButton";
this.ExportButton.Size = new System.Drawing.Size(90, 38);
this.ExportButton.TabIndex = 1;
this.ExportButton.Text = "导出为EXCEL";
this.ExportButton.UseVisualStyleBackColor = true;
this.ExportButton.Click += new System.EventHandler(this.ExportButton_Click);
//
// PathTextBox
//
this.PathTextBox.Location = new System.Drawing.Point(102, 19);
this.PathTextBox.Name = "PathTextBox";
this.PathTextBox.Size = new System.Drawing.Size(364, 21);
this.PathTextBox.TabIndex = 2;
//
// PathSelectButton
//
this.PathSelectButton.Location = new System.Drawing.Point(472, 18);
this.PathSelectButton.Name = "PathSelectButton";
this.PathSelectButton.Size = new System.Drawing.Size(86, 23);
this.PathSelectButton.TabIndex = 3;
this.PathSelectButton.Text = "路径选择";
this.PathSelectButton.UseVisualStyleBackColor = true;
this.PathSelectButton.Click += new System.EventHandler(this.PathSelectButton_Click);
//
// RecipeCode
//
this.RecipeCode.DataPropertyName = "RecipeCode";
@ -270,7 +302,7 @@
// FaceRubLayer
//
this.FaceRubLayer.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
this.FaceRubLayer.DataPropertyName = "(无)FaceRubLayer";
this.FaceRubLayer.DataPropertyName = "FaceRubLayer";
this.FaceRubLayer.FillWeight = 88.53656F;
this.FaceRubLayer.HeaderText = "胎面胶层数";
this.FaceRubLayer.Name = "FaceRubLayer";
@ -285,14 +317,21 @@
this.RawTireWidth.Name = "RawTireWidth";
this.RawTireWidth.Width = 59;
//
// RawTireFinishTime
// FaceRubFinishTime
//
this.RawTireFinishTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
this.RawTireFinishTime.DataPropertyName = "RawTireFinishTime";
this.RawTireFinishTime.FillWeight = 88.53656F;
this.RawTireFinishTime.HeaderText = "生胎完成时间";
this.RawTireFinishTime.Name = "RawTireFinishTime";
this.RawTireFinishTime.Width = 83;
this.FaceRubFinishTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
this.FaceRubFinishTime.DataPropertyName = "FaceRubFinishTime";
this.FaceRubFinishTime.FillWeight = 88.53656F;
this.FaceRubFinishTime.HeaderText = "生胎完成时间";
this.FaceRubFinishTime.Name = "FaceRubFinishTime";
this.FaceRubFinishTime.Width = 83;
//
// StandardWeight
//
this.StandardWeight.DataPropertyName = "StandardWeight";
this.StandardWeight.HeaderText = "标准重量";
this.StandardWeight.Name = "StandardWeight";
this.StandardWeight.Width = 59;
//
// RawTireWeight
//
@ -312,33 +351,12 @@
this.RepeatWeight.Name = "RepeatWeight";
this.RepeatWeight.Width = 59;
//
// ExportButton
// IsDone
//
this.ExportButton.Location = new System.Drawing.Point(9, 9);
this.ExportButton.Margin = new System.Windows.Forms.Padding(0);
this.ExportButton.Name = "ExportButton";
this.ExportButton.Size = new System.Drawing.Size(90, 38);
this.ExportButton.TabIndex = 1;
this.ExportButton.Text = "导出为EXCEL";
this.ExportButton.UseVisualStyleBackColor = true;
this.ExportButton.Click += new System.EventHandler(this.ExportButton_Click);
//
// PathTextBox
//
this.PathTextBox.Location = new System.Drawing.Point(102, 19);
this.PathTextBox.Name = "PathTextBox";
this.PathTextBox.Size = new System.Drawing.Size(364, 21);
this.PathTextBox.TabIndex = 2;
//
// PathSelectButton
//
this.PathSelectButton.Location = new System.Drawing.Point(472, 18);
this.PathSelectButton.Name = "PathSelectButton";
this.PathSelectButton.Size = new System.Drawing.Size(86, 23);
this.PathSelectButton.TabIndex = 3;
this.PathSelectButton.Text = "路径选择";
this.PathSelectButton.UseVisualStyleBackColor = true;
this.PathSelectButton.Click += new System.EventHandler(this.PathSelectButton_Click);
this.IsDone.DataPropertyName = "IsDone";
this.IsDone.HeaderText = "状态";
this.IsDone.Name = "IsDone";
this.IsDone.Width = 50;
//
// ExportPreviewForm
//
@ -386,8 +404,10 @@
private System.Windows.Forms.DataGridViewTextBoxColumn FaceRubWidth;
private System.Windows.Forms.DataGridViewTextBoxColumn FaceRubLayer;
private System.Windows.Forms.DataGridViewTextBoxColumn RawTireWidth;
private System.Windows.Forms.DataGridViewTextBoxColumn RawTireFinishTime;
private System.Windows.Forms.DataGridViewTextBoxColumn FaceRubFinishTime;
private System.Windows.Forms.DataGridViewTextBoxColumn StandardWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn RawTireWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn RepeatWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn IsDone;
}
}

@ -50,6 +50,7 @@ namespace HighWayIot.Winform.UserControlPages.LogPages
private void Init()
{
dataGridView1.AutoGenerateColumns = false;
PathTextBox.Text = XmlUtil.Instance.ExportPathReader();
//查询所有称重信息
_zxWeightEntities = _zxWeightService.GetWeightInfos();
@ -58,7 +59,7 @@ namespace HighWayIot.Winform.UserControlPages.LogPages
_zxRecipeEntities = _zxRecipeService.GetRecipeInfos();
//开始关联 生成报表
foreach(ZxDailyReportEntity rawEntity in _zxDailyReportEntities)
foreach (ZxDailyReportEntity rawEntity in _zxDailyReportEntities)
{
ExportTableEntity exportTableEntity = new ExportTableEntity();
ZxRecipeEntity recipeEntity = _zxRecipeEntities.Where(x => x.RecipeCode == rawEntity.RecipeCode).FirstOrDefault();
@ -86,10 +87,15 @@ namespace HighWayIot.Winform.UserControlPages.LogPages
exportTableEntity.BaseRubWidth = baseWeight.SetWidth.ToString();
exportTableEntity.BaseRubLayer = baseWeight.SetLayer.ToString();
}
else if(baseWeight.SetLayer3 == 0 || baseWeight.SetLayer3 == null)
{
exportTableEntity.BaseRubWidth = $"{baseWeight.SetWidth2}/{baseWeight.SetWidth}";
exportTableEntity.BaseRubLayer = $"{baseWeight.SetLayer2}/{baseWeight.SetLayer}";
}
else
{
exportTableEntity.BaseRubWidth = $"{baseWeight.SetWidth}/{baseWeight.SetWidth2}";
exportTableEntity.BaseRubLayer = $"{baseWeight.SetLayer}/{baseWeight.SetLayer2}";
exportTableEntity.BaseRubWidth = $"{baseWeight.SetWidth2}/{baseWeight.SetWidth3}/{baseWeight.SetWidth}";
exportTableEntity.BaseRubLayer = $"{baseWeight.SetLayer2}/{baseWeight.SetLayer3}/{baseWeight.SetLayer}";
}
exportTableEntity.BaseRubFinishTime = GeneralUtils.DateTimeToString(rawEntity.StartTime, rawEntity.BaseEndTime);
}
@ -99,8 +105,22 @@ namespace HighWayIot.Winform.UserControlPages.LogPages
{
exportTableEntity.MidRubName = midWeight.MaterialName;
exportTableEntity.MidRubThickness = midWeight.SetThickness.ToString();
//中层胶宽度和层数(可能有三层
if (midWeight.SetLayer2 == 0 || midWeight.SetLayer2 == null)
{
exportTableEntity.MidRubWidth = midWeight.SetWidth.ToString();
exportTableEntity.MidRubLayer = midWeight.SetLayer.ToString();
}
else if (midWeight.SetLayer3 == 0 || midWeight.SetLayer3 == null)
{
exportTableEntity.MidRubWidth = $"{midWeight.SetWidth2}/{midWeight.SetWidth}";
exportTableEntity.MidRubLayer = $"{midWeight.SetLayer2}/{midWeight.SetLayer}";
}
else
{
exportTableEntity.MidRubWidth = $"{midWeight.SetWidth2}/{midWeight.SetWidth3}/{midWeight.SetWidth}";
exportTableEntity.MidRubLayer = $"{midWeight.SetLayer2}/{midWeight.SetLayer3}/{midWeight.SetLayer}";
}
exportTableEntity.MidRubFinishTime = GeneralUtils.DateTimeToString(rawEntity.StartTime, rawEntity.MidEndTime);
}
@ -109,31 +129,34 @@ namespace HighWayIot.Winform.UserControlPages.LogPages
{
exportTableEntity.FaceRubName = faceWeight.MaterialName;
exportTableEntity.FaceRubThickness = faceWeight.SetThickness.ToString();
//胎面胶宽度和层数(可能有
//胎面胶宽度和层数(可能有
if (faceWeight.SetLayer2 == 0 || faceWeight.SetLayer2 == null)
{
exportTableEntity.FaceRubWidth = faceWeight.SetWidth.ToString();
exportTableEntity.FaceRubLayer = faceWeight.SetLayer.ToString();
}
else if (faceWeight.SetLayer3 == 0 || faceWeight.SetLayer3 == null)
{
exportTableEntity.FaceRubWidth = $"{faceWeight.SetWidth2}/{faceWeight.SetWidth}";
exportTableEntity.FaceRubLayer = $"{faceWeight.SetLayer2}/{faceWeight.SetLayer}";
}
else
{
exportTableEntity.FaceRubWidth = $"{faceWeight.SetWidth}/{faceWeight.SetWidth2}";
exportTableEntity.FaceRubLayer = $"{faceWeight.SetLayer}/{faceWeight.SetLayer2}";
exportTableEntity.FaceRubWidth = $"{faceWeight.SetWidth2}/{faceWeight.SetWidth3}/{faceWeight.SetWidth}";
exportTableEntity.FaceRubLayer = $"{faceWeight.SetLayer2}/{faceWeight.SetLayer3}/{faceWeight.SetLayer}";
}
exportTableEntity.FaceRubFinishTime = GeneralUtils.DateTimeToString(rawEntity.StartTime, rawEntity.FaceEndTime);
}
exportTableEntity.RawTireWidth = (faceWeight.SetThickness * 2 + faceWeight.SetWidth).ToString();
exportTableEntity.RawTireWeight = rawEntity.RawTireWeight.ToString();
exportTableEntity.RepeatWeight = rawEntity.RepeatWeight.ToString();
exportTableEntity.StandardWeight = rawEntity.StandardWeight.ToString();
exportTableEntity.RawTireWeight = (rawEntity.RawTireWeight ?? 0).ToString();
exportTableEntity.RepeatWeight = (rawEntity.RepeatWeight ?? 0).ToString();
exportTableEntity.IsDone = rawEntity.IsDone == 1 ? "已完成" : "未完成";
_exportTableEntities.Add(exportTableEntity);
}
dataGridView1.DataSource = null;
dataGridView1.DataSource = _exportTableEntities;
try
{
dataTable = ToDataTable(_exportTableEntities.ToArray());
@ -142,6 +165,9 @@ namespace HighWayIot.Winform.UserControlPages.LogPages
{
MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
dataGridView1.DataSource = null;
dataGridView1.DataSource = _exportTableEntities;
}
/// <summary>
@ -157,6 +183,7 @@ namespace HighWayIot.Winform.UserControlPages.LogPages
{
_savePath = folderBrowserDialog1.SelectedPath;
PathTextBox.Text = _savePath;
XmlUtil.Instance.ExportPathWriter(_savePath);
}
}
@ -168,6 +195,7 @@ namespace HighWayIot.Winform.UserControlPages.LogPages
return;
}
ExportExcel(dataTable, _savePath);
ZxDailyReportService.Instance.DeleteMoreData();
this.Close();
}

@ -177,7 +177,10 @@
<metadata name="RawTireWidth.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RawTireFinishTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="FaceRubFinishTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="StandardWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RawTireWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@ -186,6 +189,9 @@
<metadata name="RepeatWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="IsDone.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>

@ -47,6 +47,7 @@ namespace HighWayIot.Winform.UserControlPages
this.Text = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.LogTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Operator = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DeleteUselessData = new System.Windows.Forms.Button();
this.ButtonPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.LogDataGridView)).BeginInit();
this.SuspendLayout();
@ -66,6 +67,7 @@ namespace HighWayIot.Winform.UserControlPages
//
this.ButtonPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ButtonPanel.Controls.Add(this.DeleteUselessData);
this.ButtonPanel.Controls.Add(this.label4);
this.ButtonPanel.Controls.Add(this.SelectLogEndTime);
this.ButtonPanel.Controls.Add(this.SelectLogBeginTime);
@ -125,9 +127,9 @@ namespace HighWayIot.Winform.UserControlPages
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(295, 16);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(65, 12);
this.label3.Size = new System.Drawing.Size(41, 12);
this.label3.TabIndex = 14;
this.label3.Text = "登陆时间:";
this.label3.Text = "时间:";
//
// OperatorNameTextBox
//
@ -214,6 +216,18 @@ namespace HighWayIot.Winform.UserControlPages
this.Operator.Name = "Operator";
this.Operator.ReadOnly = true;
//
// DeleteUselessData
//
this.DeleteUselessData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.DeleteUselessData.Location = new System.Drawing.Point(1061, 11);
this.DeleteUselessData.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.DeleteUselessData.Name = "DeleteUselessData";
this.DeleteUselessData.Size = new System.Drawing.Size(82, 39);
this.DeleteUselessData.TabIndex = 31;
this.DeleteUselessData.Text = "删除一个月之前的数据";
this.DeleteUselessData.UseVisualStyleBackColor = true;
this.DeleteUselessData.Click += new System.EventHandler(this.DeleteUselessData_Click);
//
// OperateConfigPage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -248,5 +262,6 @@ namespace HighWayIot.Winform.UserControlPages
private DataGridViewTextBoxColumn Text;
private DataGridViewTextBoxColumn LogTime;
private DataGridViewTextBoxColumn Operator;
private Button DeleteUselessData;
}
}

@ -53,5 +53,13 @@ namespace HighWayIot.Winform.UserControlPages
LogDataGridView.DataSource = null;
LogDataGridView.DataSource = Lists;
}
private void DeleteUselessData_Click(object sender, EventArgs e)
{
if (sysLogService.DeleteMoreData())
{
MessageBox.Show("删除成功");
}
}
}
}

@ -129,4 +129,16 @@
<metadata name="Operator.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Text.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="LogTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Operator.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

@ -46,35 +46,13 @@ namespace HighWayIot.Winform.UserControlPages
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
this.panel1 = new System.Windows.Forms.Panel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.RgvNoLabel = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.RawTireWeightLabel = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.SpecCodeLabel = new System.Windows.Forms.Label();
this.RecipeNameLabel = new System.Windows.Forms.Label();
this.RecipeCodeLabel = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.MonitorDataGridView = new System.Windows.Forms.DataGridView();
this.No = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.VulcanizationNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.StartTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RecipeCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RecipeName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.SpecCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DeviceNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.TireWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.BaseRubFinishTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.MidRubFinishTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RowTireFinishTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RepeatWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.IsDone = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DataRefresh = new System.Windows.Forms.Timer(this.components);
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.panel5 = new System.Windows.Forms.Panel();
this.NowDateProductNumTextBox = new System.Windows.Forms.TextBox();
this.NowDateProductNumLabel = new System.Windows.Forms.Label();
this.panel4 = new System.Windows.Forms.Panel();
this.NightProductNumTextBox = new System.Windows.Forms.TextBox();
this.DayProductNumTextBox = new System.Windows.Forms.TextBox();
@ -82,19 +60,46 @@ namespace HighWayIot.Winform.UserControlPages
this.label13 = new System.Windows.Forms.Label();
this.DayTimeLabel = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.panel5 = new System.Windows.Forms.Panel();
this.NowDateProductNumTextBox = new System.Windows.Forms.TextBox();
this.NowDateProductNumLabel = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.RgvNoLabel = new System.Windows.Forms.Label();
this.SpecCodeLabel = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.RecipeNameLabel = new System.Windows.Forms.Label();
this.RawTireWeightLabel = new System.Windows.Forms.Label();
this.RecipeCodeLabel = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.MonitorDataGridView = new System.Windows.Forms.DataGridView();
this.DataRefresh = new System.Windows.Forms.Timer(this.components);
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.panel6 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.No = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.VulcanizationNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.StartTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RecipeCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RecipeName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.SpecCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DeviceNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.StandardWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.BaseRubFinishTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.MidRubFinishTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RowTireFinishTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.TireWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RepeatWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.IsDone = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.MoveText = new Mesnac.Controls.ChemicalWeighing.HslMoveText();
this.panel1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
this.panel5.SuspendLayout();
this.panel4.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.MonitorDataGridView)).BeginInit();
this.tableLayoutPanel3.SuspendLayout();
this.panel4.SuspendLayout();
this.panel5.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.panel6.SuspendLayout();
this.panel3.SuspendLayout();
this.SuspendLayout();
//
@ -120,316 +125,10 @@ namespace HighWayIot.Winform.UserControlPages
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 231F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 114F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(2169, 114);
this.tableLayoutPanel1.TabIndex = 0;
//
// RgvNoLabel
//
this.RgvNoLabel.AutoSize = true;
this.RgvNoLabel.Font = new System.Drawing.Font("微软雅黑", 18F);
this.RgvNoLabel.ForeColor = System.Drawing.Color.Khaki;
this.RgvNoLabel.Location = new System.Drawing.Point(110, 14);
this.RgvNoLabel.Name = "RgvNoLabel";
this.RgvNoLabel.Size = new System.Drawing.Size(61, 31);
this.RgvNoLabel.TabIndex = 11;
this.RgvNoLabel.Text = "N/A";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Font = new System.Drawing.Font("微软雅黑", 18F);
this.label10.ForeColor = System.Drawing.Color.Khaki;
this.label10.Location = new System.Drawing.Point(16, 14);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(110, 31);
this.label10.TabIndex = 10;
this.label10.Text = "小车号:";
//
// RawTireWeightLabel
//
this.RawTireWeightLabel.AutoSize = true;
this.RawTireWeightLabel.Font = new System.Drawing.Font("微软雅黑", 18F);
this.RawTireWeightLabel.ForeColor = System.Drawing.Color.Khaki;
this.RawTireWeightLabel.Location = new System.Drawing.Point(741, 49);
this.RawTireWeightLabel.Name = "RawTireWeightLabel";
this.RawTireWeightLabel.Size = new System.Drawing.Size(61, 31);
this.RawTireWeightLabel.TabIndex = 9;
this.RawTireWeightLabel.Text = "N/A";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("微软雅黑", 18F);
this.label7.ForeColor = System.Drawing.Color.Khaki;
this.label7.Location = new System.Drawing.Point(590, 49);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(165, 31);
this.label7.TabIndex = 7;
this.label7.Text = "生胎重量(g)";
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.Gray;
this.panel2.Controls.Add(this.RgvNoLabel);
this.panel2.Controls.Add(this.SpecCodeLabel);
this.panel2.Controls.Add(this.label10);
this.panel2.Controls.Add(this.RecipeNameLabel);
this.panel2.Controls.Add(this.RawTireWeightLabel);
this.panel2.Controls.Add(this.RecipeCodeLabel);
this.panel2.Controls.Add(this.label4);
this.panel2.Controls.Add(this.label7);
this.panel2.Controls.Add(this.label3);
this.panel2.Controls.Add(this.label2);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Margin = new System.Windows.Forms.Padding(0);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(1084, 114);
this.panel2.TabIndex = 2;
//
// SpecCodeLabel
//
this.SpecCodeLabel.AutoSize = true;
this.SpecCodeLabel.Font = new System.Drawing.Font("微软雅黑", 18F);
this.SpecCodeLabel.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
this.SpecCodeLabel.Location = new System.Drawing.Point(454, 50);
this.SpecCodeLabel.Name = "SpecCodeLabel";
this.SpecCodeLabel.Size = new System.Drawing.Size(112, 31);
this.SpecCodeLabel.TabIndex = 6;
this.SpecCodeLabel.Text = "T123456";
//
// RecipeNameLabel
//
this.RecipeNameLabel.AutoSize = true;
this.RecipeNameLabel.Font = new System.Drawing.Font("微软雅黑", 18F);
this.RecipeNameLabel.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
this.RecipeNameLabel.Location = new System.Drawing.Point(297, 14);
this.RecipeNameLabel.Name = "RecipeNameLabel";
this.RecipeNameLabel.Size = new System.Drawing.Size(494, 31);
this.RecipeNameLabel.TabIndex = 5;
this.RecipeNameLabel.Text = "8.15-15/28×9-15 C8900 THS NM 正新轮胎";
//
// RecipeCodeLabel
//
this.RecipeCodeLabel.AutoSize = true;
this.RecipeCodeLabel.Font = new System.Drawing.Font("微软雅黑", 18F);
this.RecipeCodeLabel.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
this.RecipeCodeLabel.Location = new System.Drawing.Point(156, 49);
this.RecipeCodeLabel.Name = "RecipeCodeLabel";
this.RecipeCodeLabel.Size = new System.Drawing.Size(147, 31);
this.RecipeCodeLabel.TabIndex = 4;
this.RecipeCodeLabel.Text = "TI12345567";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("微软雅黑", 18F);
this.label4.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
this.label4.Location = new System.Drawing.Point(329, 49);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(144, 31);
this.label4.TabIndex = 3;
this.label4.Text = "SPEC编号";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("微软雅黑", 18F);
this.label3.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
this.label3.Location = new System.Drawing.Point(177, 14);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(134, 31);
this.label3.TabIndex = 2;
this.label3.Text = "标称尺度:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("微软雅黑", 18F);
this.label2.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
this.label2.Location = new System.Drawing.Point(16, 49);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(134, 31);
this.label2.TabIndex = 1;
this.label2.Text = "成品代号:";
//
// MonitorDataGridView
//
this.MonitorDataGridView.AllowUserToAddRows = false;
this.MonitorDataGridView.AllowUserToDeleteRows = false;
this.MonitorDataGridView.AllowUserToResizeColumns = false;
this.MonitorDataGridView.AllowUserToResizeRows = false;
this.MonitorDataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.MonitorDataGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.MonitorDataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.MonitorDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.MonitorDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.No,
this.VulcanizationNo,
this.StartTime,
this.RecipeCode,
this.RecipeName,
this.SpecCode,
this.DeviceNo,
this.TireWeight,
this.BaseRubFinishTime,
this.MidRubFinishTime,
this.RowTireFinishTime,
this.RepeatWeight,
this.IsDone});
this.MonitorDataGridView.Location = new System.Drawing.Point(0, 228);
this.MonitorDataGridView.Margin = new System.Windows.Forms.Padding(0);
this.MonitorDataGridView.MultiSelect = false;
this.MonitorDataGridView.Name = "MonitorDataGridView";
this.MonitorDataGridView.ReadOnly = true;
this.MonitorDataGridView.RowHeadersVisible = false;
this.MonitorDataGridView.RowTemplate.Height = 32;
this.MonitorDataGridView.Size = new System.Drawing.Size(2169, 767);
this.MonitorDataGridView.TabIndex = 1;
//
// No
//
this.No.DataPropertyName = "No";
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.No.DefaultCellStyle = dataGridViewCellStyle2;
this.No.HeaderText = "序号";
this.No.Name = "No";
this.No.ReadOnly = true;
this.No.Width = 60;
//
// VulcanizationNo
//
this.VulcanizationNo.DataPropertyName = "VulcanizationNo";
dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.VulcanizationNo.DefaultCellStyle = dataGridViewCellStyle3;
this.VulcanizationNo.HeaderText = "机位";
this.VulcanizationNo.Name = "VulcanizationNo";
this.VulcanizationNo.ReadOnly = true;
//
// StartTime
//
this.StartTime.DataPropertyName = "StartTime";
dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.StartTime.DefaultCellStyle = dataGridViewCellStyle4;
this.StartTime.HeaderText = "开始时间";
this.StartTime.Name = "StartTime";
this.StartTime.ReadOnly = true;
this.StartTime.Width = 200;
//
// RecipeCode
//
this.RecipeCode.DataPropertyName = "RecipeCode";
dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.RecipeCode.DefaultCellStyle = dataGridViewCellStyle5;
this.RecipeCode.HeaderText = "成品代号";
this.RecipeCode.Name = "RecipeCode";
this.RecipeCode.ReadOnly = true;
this.RecipeCode.Width = 180;
//
// RecipeName
//
this.RecipeName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.RecipeName.DataPropertyName = "RecipeName";
dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.RecipeName.DefaultCellStyle = dataGridViewCellStyle6;
this.RecipeName.HeaderText = "标称尺度";
this.RecipeName.Name = "RecipeName";
this.RecipeName.ReadOnly = true;
//
// SpecCode
//
this.SpecCode.DataPropertyName = "SpecCode";
dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.SpecCode.DefaultCellStyle = dataGridViewCellStyle7;
this.SpecCode.HeaderText = "SPEC编号";
this.SpecCode.Name = "SpecCode";
this.SpecCode.ReadOnly = true;
this.SpecCode.Width = 140;
//
// DeviceNo
//
this.DeviceNo.DataPropertyName = "DeviceNo";
dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.DeviceNo.DefaultCellStyle = dataGridViewCellStyle8;
this.DeviceNo.HeaderText = "小车号";
this.DeviceNo.Name = "DeviceNo";
this.DeviceNo.ReadOnly = true;
this.DeviceNo.Width = 80;
//
// TireWeight
//
this.TireWeight.DataPropertyName = "RawTireWeight";
dataGridViewCellStyle9.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.TireWeight.DefaultCellStyle = dataGridViewCellStyle9;
this.TireWeight.HeaderText = "生胎重量";
this.TireWeight.Name = "TireWeight";
this.TireWeight.ReadOnly = true;
//
// BaseRubFinishTime
//
this.BaseRubFinishTime.DataPropertyName = "BaseRubTimeSpan";
dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.BaseRubFinishTime.DefaultCellStyle = dataGridViewCellStyle10;
this.BaseRubFinishTime.HeaderText = "基部胶完成时间";
this.BaseRubFinishTime.Name = "BaseRubFinishTime";
this.BaseRubFinishTime.ReadOnly = true;
this.BaseRubFinishTime.Width = 162;
//
// MidRubFinishTime
//
this.MidRubFinishTime.DataPropertyName = "MidRubTimeSpan";
dataGridViewCellStyle11.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.MidRubFinishTime.DefaultCellStyle = dataGridViewCellStyle11;
this.MidRubFinishTime.HeaderText = "中层胶完成时间";
this.MidRubFinishTime.Name = "MidRubFinishTime";
this.MidRubFinishTime.ReadOnly = true;
this.MidRubFinishTime.Width = 162;
//
// RowTireFinishTime
//
this.RowTireFinishTime.DataPropertyName = "FaceRubTimeSpan";
dataGridViewCellStyle12.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.RowTireFinishTime.DefaultCellStyle = dataGridViewCellStyle12;
this.RowTireFinishTime.HeaderText = "生胎完成时间";
this.RowTireFinishTime.Name = "RowTireFinishTime";
this.RowTireFinishTime.ReadOnly = true;
this.RowTireFinishTime.Width = 141;
//
// RepeatWeight
//
this.RepeatWeight.DataPropertyName = "RepeatWeight";
dataGridViewCellStyle13.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.RepeatWeight.DefaultCellStyle = dataGridViewCellStyle13;
this.RepeatWeight.HeaderText = "复重重量";
this.RepeatWeight.Name = "RepeatWeight";
this.RepeatWeight.ReadOnly = true;
//
// IsDone
//
this.IsDone.DataPropertyName = "IsDone";
dataGridViewCellStyle14.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.IsDone.DefaultCellStyle = dataGridViewCellStyle14;
this.IsDone.HeaderText = "状态";
this.IsDone.Name = "IsDone";
this.IsDone.ReadOnly = true;
this.IsDone.Width = 80;
//
// DataRefresh
//
this.DataRefresh.Enabled = true;
this.DataRefresh.Interval = 1000;
this.DataRefresh.Tick += new System.EventHandler(this.DataRefresh_Tick);
//
// tableLayoutPanel3
//
this.tableLayoutPanel3.ColumnCount = 2;
@ -446,6 +145,42 @@ namespace HighWayIot.Winform.UserControlPages
this.tableLayoutPanel3.Size = new System.Drawing.Size(1085, 114);
this.tableLayoutPanel3.TabIndex = 3;
//
// panel5
//
this.panel5.BackColor = System.Drawing.SystemColors.ControlLight;
this.panel5.Controls.Add(this.NowDateProductNumTextBox);
this.panel5.Controls.Add(this.NowDateProductNumLabel);
this.panel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel5.Location = new System.Drawing.Point(824, 0);
this.panel5.Margin = new System.Windows.Forms.Padding(0);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(261, 114);
this.panel5.TabIndex = 18;
//
// NowDateProductNumTextBox
//
this.NowDateProductNumTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.NowDateProductNumTextBox.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.NowDateProductNumTextBox.Location = new System.Drawing.Point(67, 58);
this.NowDateProductNumTextBox.Name = "NowDateProductNumTextBox";
this.NowDateProductNumTextBox.ReadOnly = true;
this.NowDateProductNumTextBox.Size = new System.Drawing.Size(122, 30);
this.NowDateProductNumTextBox.TabIndex = 18;
this.NowDateProductNumTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// NowDateProductNumLabel
//
this.NowDateProductNumLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.NowDateProductNumLabel.AutoSize = true;
this.NowDateProductNumLabel.Font = new System.Drawing.Font("微软雅黑", 15F);
this.NowDateProductNumLabel.ForeColor = System.Drawing.Color.Sienna;
this.NowDateProductNumLabel.Location = new System.Drawing.Point(48, 23);
this.NowDateProductNumLabel.Name = "NowDateProductNumLabel";
this.NowDateProductNumLabel.Size = new System.Drawing.Size(164, 27);
this.NowDateProductNumLabel.TabIndex = 13;
this.NowDateProductNumLabel.Text = "99 月 99 日 产量";
this.NowDateProductNumLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// panel4
//
this.panel4.BackColor = System.Drawing.SystemColors.ScrollBar;
@ -526,47 +261,192 @@ namespace HighWayIot.Winform.UserControlPages
this.label12.TabIndex = 12;
this.label12.Text = "白班:";
//
// panel5
// panel2
//
this.panel5.BackColor = System.Drawing.SystemColors.ControlLight;
this.panel5.Controls.Add(this.NowDateProductNumTextBox);
this.panel5.Controls.Add(this.NowDateProductNumLabel);
this.panel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel5.Location = new System.Drawing.Point(824, 0);
this.panel5.Margin = new System.Windows.Forms.Padding(0);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(261, 114);
this.panel5.TabIndex = 18;
this.panel2.BackColor = System.Drawing.Color.Gray;
this.panel2.Controls.Add(this.RgvNoLabel);
this.panel2.Controls.Add(this.SpecCodeLabel);
this.panel2.Controls.Add(this.label10);
this.panel2.Controls.Add(this.RecipeNameLabel);
this.panel2.Controls.Add(this.RawTireWeightLabel);
this.panel2.Controls.Add(this.RecipeCodeLabel);
this.panel2.Controls.Add(this.label4);
this.panel2.Controls.Add(this.label7);
this.panel2.Controls.Add(this.label3);
this.panel2.Controls.Add(this.label2);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Margin = new System.Windows.Forms.Padding(0);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(1084, 114);
this.panel2.TabIndex = 2;
//
// NowDateProductNumTextBox
// RgvNoLabel
//
this.NowDateProductNumTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.NowDateProductNumTextBox.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.NowDateProductNumTextBox.Location = new System.Drawing.Point(67, 58);
this.NowDateProductNumTextBox.Name = "NowDateProductNumTextBox";
this.NowDateProductNumTextBox.ReadOnly = true;
this.NowDateProductNumTextBox.Size = new System.Drawing.Size(122, 30);
this.NowDateProductNumTextBox.TabIndex = 18;
this.NowDateProductNumTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.RgvNoLabel.AutoSize = true;
this.RgvNoLabel.Font = new System.Drawing.Font("微软雅黑", 18F);
this.RgvNoLabel.ForeColor = System.Drawing.Color.Khaki;
this.RgvNoLabel.Location = new System.Drawing.Point(122, 23);
this.RgvNoLabel.Name = "RgvNoLabel";
this.RgvNoLabel.Size = new System.Drawing.Size(61, 31);
this.RgvNoLabel.TabIndex = 11;
this.RgvNoLabel.Text = "N/A";
//
// NowDateProductNumLabel
// SpecCodeLabel
//
this.NowDateProductNumLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.NowDateProductNumLabel.AutoSize = true;
this.NowDateProductNumLabel.Font = new System.Drawing.Font("微软雅黑", 15F);
this.NowDateProductNumLabel.ForeColor = System.Drawing.Color.Sienna;
this.NowDateProductNumLabel.Location = new System.Drawing.Point(48, 23);
this.NowDateProductNumLabel.Name = "NowDateProductNumLabel";
this.NowDateProductNumLabel.Size = new System.Drawing.Size(164, 27);
this.NowDateProductNumLabel.TabIndex = 13;
this.NowDateProductNumLabel.Text = "99 月 99 日 产量";
this.NowDateProductNumLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.SpecCodeLabel.AutoSize = true;
this.SpecCodeLabel.Font = new System.Drawing.Font("微软雅黑", 18F);
this.SpecCodeLabel.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
this.SpecCodeLabel.Location = new System.Drawing.Point(466, 59);
this.SpecCodeLabel.Name = "SpecCodeLabel";
this.SpecCodeLabel.Size = new System.Drawing.Size(112, 31);
this.SpecCodeLabel.TabIndex = 6;
this.SpecCodeLabel.Text = "T123456";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Font = new System.Drawing.Font("微软雅黑", 18F);
this.label10.ForeColor = System.Drawing.Color.Khaki;
this.label10.Location = new System.Drawing.Point(28, 23);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(110, 31);
this.label10.TabIndex = 10;
this.label10.Text = "小车号:";
//
// RecipeNameLabel
//
this.RecipeNameLabel.AutoSize = true;
this.RecipeNameLabel.Font = new System.Drawing.Font("微软雅黑", 18F);
this.RecipeNameLabel.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
this.RecipeNameLabel.Location = new System.Drawing.Point(309, 23);
this.RecipeNameLabel.Name = "RecipeNameLabel";
this.RecipeNameLabel.Size = new System.Drawing.Size(494, 31);
this.RecipeNameLabel.TabIndex = 5;
this.RecipeNameLabel.Text = "8.15-15/28×9-15 C8900 THS NM 正新轮胎";
//
// RawTireWeightLabel
//
this.RawTireWeightLabel.AutoSize = true;
this.RawTireWeightLabel.Font = new System.Drawing.Font("微软雅黑", 18F);
this.RawTireWeightLabel.ForeColor = System.Drawing.Color.Khaki;
this.RawTireWeightLabel.Location = new System.Drawing.Point(753, 58);
this.RawTireWeightLabel.Name = "RawTireWeightLabel";
this.RawTireWeightLabel.Size = new System.Drawing.Size(61, 31);
this.RawTireWeightLabel.TabIndex = 9;
this.RawTireWeightLabel.Text = "N/A";
//
// RecipeCodeLabel
//
this.RecipeCodeLabel.AutoSize = true;
this.RecipeCodeLabel.Font = new System.Drawing.Font("微软雅黑", 18F);
this.RecipeCodeLabel.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
this.RecipeCodeLabel.Location = new System.Drawing.Point(150, 58);
this.RecipeCodeLabel.Name = "RecipeCodeLabel";
this.RecipeCodeLabel.Size = new System.Drawing.Size(147, 31);
this.RecipeCodeLabel.TabIndex = 4;
this.RecipeCodeLabel.Text = "TI12345567";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("微软雅黑", 18F);
this.label4.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
this.label4.Location = new System.Drawing.Point(341, 58);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(144, 31);
this.label4.TabIndex = 3;
this.label4.Text = "SPEC编号";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("微软雅黑", 18F);
this.label7.ForeColor = System.Drawing.Color.Khaki;
this.label7.Location = new System.Drawing.Point(602, 58);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(165, 31);
this.label7.TabIndex = 7;
this.label7.Text = "生胎重量(g)";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("微软雅黑", 18F);
this.label3.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
this.label3.Location = new System.Drawing.Point(189, 23);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(134, 31);
this.label3.TabIndex = 2;
this.label3.Text = "标称尺度:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("微软雅黑", 18F);
this.label2.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
this.label2.Location = new System.Drawing.Point(28, 58);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(134, 31);
this.label2.TabIndex = 1;
this.label2.Text = "成品代号:";
//
// MonitorDataGridView
//
this.MonitorDataGridView.AllowUserToAddRows = false;
this.MonitorDataGridView.AllowUserToDeleteRows = false;
this.MonitorDataGridView.AllowUserToResizeColumns = false;
this.MonitorDataGridView.AllowUserToResizeRows = false;
this.MonitorDataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.MonitorDataGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.MonitorDataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.MonitorDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.MonitorDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.No,
this.VulcanizationNo,
this.StartTime,
this.RecipeCode,
this.RecipeName,
this.SpecCode,
this.DeviceNo,
this.StandardWeight,
this.BaseRubFinishTime,
this.MidRubFinishTime,
this.RowTireFinishTime,
this.TireWeight,
this.RepeatWeight,
this.IsDone});
this.MonitorDataGridView.Location = new System.Drawing.Point(0, 228);
this.MonitorDataGridView.Margin = new System.Windows.Forms.Padding(0);
this.MonitorDataGridView.MultiSelect = false;
this.MonitorDataGridView.Name = "MonitorDataGridView";
this.MonitorDataGridView.ReadOnly = true;
this.MonitorDataGridView.RowHeadersVisible = false;
this.MonitorDataGridView.RowTemplate.Height = 32;
this.MonitorDataGridView.Size = new System.Drawing.Size(2169, 799);
this.MonitorDataGridView.TabIndex = 1;
//
// DataRefresh
//
this.DataRefresh.Enabled = true;
this.DataRefresh.Interval = 1000;
this.DataRefresh.Tick += new System.EventHandler(this.DataRefresh_Tick);
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 1;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Controls.Add(this.panel1, 0, 1);
this.tableLayoutPanel2.Controls.Add(this.panel6, 0, 0);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
@ -576,6 +456,15 @@ namespace HighWayIot.Winform.UserControlPages
this.tableLayoutPanel2.Size = new System.Drawing.Size(2169, 228);
this.tableLayoutPanel2.TabIndex = 2;
//
// panel6
//
this.panel6.Controls.Add(this.MoveText);
this.panel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel6.Location = new System.Drawing.Point(3, 3);
this.panel6.Name = "panel6";
this.panel6.Size = new System.Drawing.Size(2163, 108);
this.panel6.TabIndex = 1;
//
// panel3
//
this.panel3.Controls.Add(this.tableLayoutPanel2);
@ -585,6 +474,156 @@ namespace HighWayIot.Winform.UserControlPages
this.panel3.Size = new System.Drawing.Size(2169, 228);
this.panel3.TabIndex = 3;
//
// No
//
this.No.DataPropertyName = "No";
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.No.DefaultCellStyle = dataGridViewCellStyle2;
this.No.HeaderText = "序号";
this.No.Name = "No";
this.No.ReadOnly = true;
this.No.Width = 60;
//
// VulcanizationNo
//
this.VulcanizationNo.DataPropertyName = "VulcanizationNo";
dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.VulcanizationNo.DefaultCellStyle = dataGridViewCellStyle3;
this.VulcanizationNo.HeaderText = "机位";
this.VulcanizationNo.Name = "VulcanizationNo";
this.VulcanizationNo.ReadOnly = true;
this.VulcanizationNo.Width = 75;
//
// StartTime
//
this.StartTime.DataPropertyName = "StartTime";
dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.StartTime.DefaultCellStyle = dataGridViewCellStyle4;
this.StartTime.HeaderText = "开始时间";
this.StartTime.Name = "StartTime";
this.StartTime.ReadOnly = true;
this.StartTime.Width = 110;
//
// RecipeCode
//
this.RecipeCode.DataPropertyName = "RecipeCode";
dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.RecipeCode.DefaultCellStyle = dataGridViewCellStyle5;
this.RecipeCode.HeaderText = "成品代号";
this.RecipeCode.Name = "RecipeCode";
this.RecipeCode.ReadOnly = true;
this.RecipeCode.Width = 140;
//
// RecipeName
//
this.RecipeName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.RecipeName.DataPropertyName = "RecipeName";
dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.RecipeName.DefaultCellStyle = dataGridViewCellStyle6;
this.RecipeName.HeaderText = "标称尺度";
this.RecipeName.Name = "RecipeName";
this.RecipeName.ReadOnly = true;
//
// SpecCode
//
this.SpecCode.DataPropertyName = "SpecCode";
dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.SpecCode.DefaultCellStyle = dataGridViewCellStyle7;
this.SpecCode.HeaderText = "SPEC编号";
this.SpecCode.Name = "SpecCode";
this.SpecCode.ReadOnly = true;
this.SpecCode.Width = 110;
//
// DeviceNo
//
this.DeviceNo.DataPropertyName = "DeviceNo";
dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.DeviceNo.DefaultCellStyle = dataGridViewCellStyle8;
this.DeviceNo.HeaderText = "小车号";
this.DeviceNo.Name = "DeviceNo";
this.DeviceNo.ReadOnly = true;
this.DeviceNo.Width = 80;
//
// StandardWeight
//
this.StandardWeight.DataPropertyName = "StandardWeight";
dataGridViewCellStyle9.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.StandardWeight.DefaultCellStyle = dataGridViewCellStyle9;
this.StandardWeight.HeaderText = "标准重量";
this.StandardWeight.Name = "StandardWeight";
this.StandardWeight.ReadOnly = true;
//
// BaseRubFinishTime
//
this.BaseRubFinishTime.DataPropertyName = "BaseRubTimeSpan";
dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.BaseRubFinishTime.DefaultCellStyle = dataGridViewCellStyle10;
this.BaseRubFinishTime.HeaderText = "基部胶完成时间";
this.BaseRubFinishTime.Name = "BaseRubFinishTime";
this.BaseRubFinishTime.ReadOnly = true;
this.BaseRubFinishTime.Width = 162;
//
// MidRubFinishTime
//
this.MidRubFinishTime.DataPropertyName = "MidRubTimeSpan";
dataGridViewCellStyle11.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.MidRubFinishTime.DefaultCellStyle = dataGridViewCellStyle11;
this.MidRubFinishTime.HeaderText = "中层胶完成时间";
this.MidRubFinishTime.Name = "MidRubFinishTime";
this.MidRubFinishTime.ReadOnly = true;
this.MidRubFinishTime.Width = 162;
//
// RowTireFinishTime
//
this.RowTireFinishTime.DataPropertyName = "FaceRubTimeSpan";
dataGridViewCellStyle12.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.RowTireFinishTime.DefaultCellStyle = dataGridViewCellStyle12;
this.RowTireFinishTime.HeaderText = "生胎完成时间";
this.RowTireFinishTime.Name = "RowTireFinishTime";
this.RowTireFinishTime.ReadOnly = true;
this.RowTireFinishTime.Width = 141;
//
// TireWeight
//
this.TireWeight.DataPropertyName = "RawTireWeight";
dataGridViewCellStyle13.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.TireWeight.DefaultCellStyle = dataGridViewCellStyle13;
this.TireWeight.HeaderText = "生胎重量";
this.TireWeight.Name = "TireWeight";
this.TireWeight.ReadOnly = true;
//
// RepeatWeight
//
this.RepeatWeight.DataPropertyName = "RepeatWeight";
dataGridViewCellStyle14.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.RepeatWeight.DefaultCellStyle = dataGridViewCellStyle14;
this.RepeatWeight.HeaderText = "复重重量";
this.RepeatWeight.Name = "RepeatWeight";
this.RepeatWeight.ReadOnly = true;
//
// IsDone
//
this.IsDone.DataPropertyName = "IsDone";
dataGridViewCellStyle15.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
this.IsDone.DefaultCellStyle = dataGridViewCellStyle15;
this.IsDone.HeaderText = "状态";
this.IsDone.Name = "IsDone";
this.IsDone.ReadOnly = true;
this.IsDone.Width = 80;
//
// MoveText
//
this.MoveText.BackColor = System.Drawing.Color.Gold;
this.MoveText.Dock = System.Windows.Forms.DockStyle.Fill;
this.MoveText.Font = new System.Drawing.Font("宋体", 48F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.MoveText.Location = new System.Drawing.Point(0, 0);
this.MoveText.MoveSpeed = 5F;
this.MoveText.Name = "MoveText";
this.MoveText.Size = new System.Drawing.Size(2163, 108);
this.MoveText.TabIndex = 1;
this.MoveText.Text = "欢迎各位领导莅临参观";
this.MoveText.DoubleClick += new System.EventHandler(this.MoveText_DoubleClick);
//
// MonitorMainPage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -596,18 +635,19 @@ namespace HighWayIot.Winform.UserControlPages
this.Controls.Add(this.MonitorDataGridView);
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "MonitorMainPage";
this.Size = new System.Drawing.Size(2169, 1019);
this.Size = new System.Drawing.Size(2169, 1027);
this.panel1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel3.ResumeLayout(false);
this.panel5.ResumeLayout(false);
this.panel5.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel4.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.MonitorDataGridView)).EndInit();
this.tableLayoutPanel3.ResumeLayout(false);
this.panel4.ResumeLayout(false);
this.panel4.PerformLayout();
this.panel5.ResumeLayout(false);
this.panel5.PerformLayout();
this.tableLayoutPanel2.ResumeLayout(false);
this.panel6.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.ResumeLayout(false);
@ -630,19 +670,6 @@ namespace HighWayIot.Winform.UserControlPages
private Label RgvNoLabel;
private Label label10;
private Timer DataRefresh;
private DataGridViewTextBoxColumn No;
private DataGridViewTextBoxColumn VulcanizationNo;
private DataGridViewTextBoxColumn StartTime;
private DataGridViewTextBoxColumn RecipeCode;
private DataGridViewTextBoxColumn RecipeName;
private DataGridViewTextBoxColumn SpecCode;
private DataGridViewTextBoxColumn DeviceNo;
private DataGridViewTextBoxColumn TireWeight;
private DataGridViewTextBoxColumn BaseRubFinishTime;
private DataGridViewTextBoxColumn MidRubFinishTime;
private DataGridViewTextBoxColumn RowTireFinishTime;
private DataGridViewTextBoxColumn RepeatWeight;
private DataGridViewTextBoxColumn IsDone;
private TableLayoutPanel tableLayoutPanel3;
private Panel panel4;
private TextBox NightProductNumTextBox;
@ -656,5 +683,21 @@ namespace HighWayIot.Winform.UserControlPages
private Label NowDateProductNumLabel;
private TableLayoutPanel tableLayoutPanel2;
private Panel panel3;
private Panel panel6;
private Mesnac.Controls.ChemicalWeighing.HslMoveText MoveText;
private DataGridViewTextBoxColumn No;
private DataGridViewTextBoxColumn VulcanizationNo;
private DataGridViewTextBoxColumn StartTime;
private DataGridViewTextBoxColumn RecipeCode;
private DataGridViewTextBoxColumn RecipeName;
private DataGridViewTextBoxColumn SpecCode;
private DataGridViewTextBoxColumn DeviceNo;
private DataGridViewTextBoxColumn StandardWeight;
private DataGridViewTextBoxColumn BaseRubFinishTime;
private DataGridViewTextBoxColumn MidRubFinishTime;
private DataGridViewTextBoxColumn RowTireFinishTime;
private DataGridViewTextBoxColumn TireWeight;
private DataGridViewTextBoxColumn RepeatWeight;
private DataGridViewTextBoxColumn IsDone;
}
}

@ -2,6 +2,7 @@
using HighWayIot.Repository.domain;
using HighWayIot.Repository.service;
using HighWayIot.Winform.Business;
using HighWayIot.Winform.UserControlPages.MonitorMainPages;
using Models;
using System;
using System.Collections.Generic;
@ -38,14 +39,36 @@ namespace HighWayIot.Winform.UserControlPages
private List<MonitorDataSource> _monitorDataSources = new List<MonitorDataSource>();
/// <summary>
/// 白班开始时间
/// </summary>
private DateTime DayStartTime;
/// <summary>
/// 白班结束时间
/// </summary>
private DateTime DayEndTine;
/// <summary>
/// 夜班开始时间
/// </summary>
private DateTime NightStartTime;
/// <summary>
/// 夜班结束时间
/// </summary>
private DateTime NightEndTime;
/// <summary>
/// 上次白班开始时间
/// </summary>
private DateTime LastDayStartTime;
/// <summary>
/// 上次夜班结束时间
/// </summary>
private DateTime LastNightEndTime;
public static Action MonitorRefreshAction;
/// <summary>
@ -109,15 +132,26 @@ namespace HighWayIot.Winform.UserControlPages
DayEndTine = DateTime.Now.Date + EndTime;
NightStartTime = DateTime.Now.Date - TimeSpan.FromDays(1) + EndTime;
NightEndTime = DateTime.Now.Date + StartTime;
LastDayStartTime = DateTime.Today - TimeSpan.FromDays(1) + StartTime;
LastNightEndTime = DateTime.Today + StartTime;
DayProductNumTextBox.BackColor = Color.LightGreen;
NightProductNumTextBox.BackColor = Color.LightGray;
}
else
{//夜班
DayProductNumTextBox.BackColor = Color.LightGray;
NightProductNumTextBox.BackColor = Color.LightGreen;
if (DateTime.Now.TimeOfDay < StartTime) //前半夜
{
DayStartTime = DateTime.Now.Date + StartTime;
DayEndTine = DateTime.Now.Date + EndTime;
NightStartTime = DateTime.Now.Date + EndTime;
NightEndTime = DateTime.Now + TimeSpan.FromDays(1) + StartTime;
LastDayStartTime = DateTime.Today - TimeSpan.FromDays(1) + StartTime;
LastNightEndTime = DateTime.Today + StartTime;
}
else if (DateTime.Now.TimeOfDay > EndTime) //后半夜
{
@ -125,6 +159,9 @@ namespace HighWayIot.Winform.UserControlPages
DayEndTine = DateTime.Now.Date - TimeSpan.FromDays(1) + EndTime;
NightStartTime = DateTime.Now.Date - TimeSpan.FromDays(1) + EndTime;
NightEndTime = DateTime.Now + StartTime;
LastDayStartTime = DateTime.Today - TimeSpan.FromDays(2) + StartTime;
LastNightEndTime = DateTime.Today - TimeSpan.FromDays(1) + StartTime;
}
}
@ -133,7 +170,7 @@ namespace HighWayIot.Winform.UserControlPages
DayTimeLabel.Text = dayString;
NightTimeLabel.Text = nightString;
NowDateProductNumLabel.Text = DateTime.Now.ToString("MM 月 dd 日 产量");
NowDateProductNumLabel.Text = (DateTime.Now - TimeSpan.FromDays(1)).ToString("MM 月 dd 日 产量");
}
/// <summary>
@ -150,17 +187,29 @@ namespace HighWayIot.Winform.UserControlPages
{
return;
}
for (int i = 0; i < dailyEntity.Count; i++)
int showCount = 0;
if (dailyEntity.Count >= 50)
{
showCount = 50;
}
else
{
showCount = dailyEntity.Count;
}
for (int i = 0; i < showCount; i++)
{
_monitorDataSources.Add(new MonitorDataSource()
{
No = i + 1,
VulcanizationNo = dailyEntity[i].VulcanizationNo,
StartTime = dailyEntity[i].StartTime.ToString("MM月dd日 HH:mm:ss"),
StartTime = dailyEntity[i].StartTime.ToString("HH:mm:ss"),
RecipeName = dailyEntity[i].RecipeName,
RecipeCode = dailyEntity[i].RecipeCode,
SpecCode = dailyEntity[i].SpecCode,
DeviceNo = dailyEntity[i].DeviceNo.ToString(),
StandardWeight = dailyEntity[i].StandardWeight ?? 0,
RawTireWeight = dailyEntity[i].RawTireWeight ?? 0,
BaseRubTimeSpan = GeneralUtils.DateTimeToString(dailyEntity[i].StartTime, dailyEntity[i].BaseEndTime),
MidRubTimeSpan = GeneralUtils.DateTimeToString(dailyEntity[i].StartTime, dailyEntity[i].MidEndTime),
@ -168,16 +217,18 @@ namespace HighWayIot.Winform.UserControlPages
RepeatWeight = dailyEntity[i].RepeatWeight ?? 0,
IsDone = dailyEntity[i].IsDone == 1 ? "已完成" : "未完成"
});
}
MonitorDataGridView.DataSource = null;
MonitorDataGridView.DataSource = _monitorDataSources;
MonitorDataGridView.CellFormatting += MonitorDataGridView_CellFormatting;
int daycount = dailyEntity.Count(x => x.StartTime >= DayStartTime && x.StartTime <= DayEndTine && x.IsDone == 1);
DayProductNumTextBox.Text = daycount.ToString();
int nightcount = dailyEntity.Count(x => x.StartTime >= NightStartTime && x.StartTime <= NightEndTime && x.IsDone == 1);
NightProductNumTextBox.Text = nightcount.ToString();
NowDateProductNumTextBox.Text = dailyEntity.Count(x => x.StartTime >= DateTime.Today).ToString();
NowDateProductNumTextBox.Text = dailyEntity.Count(x => x.StartTime >= LastDayStartTime && x.StartTime <= LastNightEndTime).ToString();
ZxDailyReportEntity first = dailyEntity.FirstOrDefault();
if (first == null)
@ -198,10 +249,45 @@ namespace HighWayIot.Winform.UserControlPages
}
}
RgvNoLabel.Text = first.DeviceNo.ToString();
}
}
/// <summary>
/// 单元格格式回调方法
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MonitorDataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
// 确保是针对 "IsDone" 列的操作
if (MonitorDataGridView.Columns[e.ColumnIndex].Name == "IsDone" && e.RowIndex >= 0)
{
var cell = MonitorDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex];
string status = cell.Value?.ToString();
if (status == "已完成")
{
cell.Style.BackColor = Color.LightGreen; // 绿色
}
else if (status == "未完成")
{
cell.Style.BackColor = Color.Yellow; // 黄色
}
}
}
/// <summary>
/// 滚动文本框双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MoveText_DoubleClick(object sender, EventArgs e)
{
ScrollTextSetForm form = new ScrollTextSetForm();
if (form.ShowDialog() == DialogResult.OK)
{
MoveText.Text = form.OutValue;
}
}
}
}

@ -138,7 +138,7 @@
<metadata name="DeviceNo.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="TireWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="StandardWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="BaseRubFinishTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@ -150,6 +150,9 @@
<metadata name="RowTireFinishTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="TireWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RepeatWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -159,6 +162,9 @@
<metadata name="DataRefresh.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="MoveText.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>44</value>
</metadata>

@ -0,0 +1,71 @@
namespace HighWayIot.Winform.UserControlPages.MonitorMainPages
{
partial class ScrollTextSetForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(26, 22);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(427, 21);
this.textBox1.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(163, 59);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(155, 37);
this.button1.TabIndex = 1;
this.button1.Text = "确认设置";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// ScrollTextSetForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(478, 118);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.Name = "ScrollTextSetForm";
this.Text = "滚动文本设置";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
}
}

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HighWayIot.Winform.UserControlPages.MonitorMainPages
{
public partial class ScrollTextSetForm : Form
{
public ScrollTextSetForm()
{
InitializeComponent();
}
public string OutValue { get; set; }
/// <summary>
/// 滚动文本设置
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
this.OutValue = this.textBox1.Text.Trim();
this.DialogResult = DialogResult.OK;
this.Close();
this.Dispose();
}
}
}

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

@ -64,6 +64,7 @@
this.TestButton2.TabIndex = 2;
this.TestButton2.Text = "读";
this.TestButton2.UseVisualStyleBackColor = true;
this.TestButton2.Click += new System.EventHandler(this.TestButton2_Click);
//
// TestButton1
//

@ -9,11 +9,17 @@ using HighWayIot.Winform.Business;
using HighWayIot.Winform.Properties;
using HslCommunication;
using Models;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
@ -119,284 +125,15 @@ namespace HighWayIot.Winform.UserControlPages
}
}
/// <summary>
/// 配方同步方法
/// </summary>
public void SyncRecipe(ZxMesPlanTransferEntity newRecipe)
{
if(newRecipe == null)
{
return;
}
//同步到配方(配方和称量,如果是新的加字段)
List<ZxRecipeEntity> RecipeLists = ZxRecipeService.Instance.GetRecipeInfos();
var nowEneity = RecipeLists.Where(x => x.RecipeCode == newRecipe.RecipeCode && x.IsDeleted == false).FirstOrDefault();
if (nowEneity != null) //有就更新 只更新配方和称量信息
{
//同步配方
nowEneity.RecipeSpecCode = newRecipe.SpecCode;
nowEneity.RecipeSpecName = newRecipe.SpecName;
nowEneity.SizeKind = newRecipe.RimInch;
nowEneity.FixedWidth = newRecipe.FixRubWidth;
if (!ZxRecipeService.Instance.UpdateRecipeInfo(nowEneity))
{
return;
}
//同步称量信息
List<ZxWeightEntity> zxWeightEntities = ZxWeightService.Instance.GetWeightInfos(nowEneity.RecipeCode);
for (int i = 1; i <= 3; i++)
{
string typeName = string.Empty;
switch (i)
{
case 1:
typeName = "基部胶";
break;
case 2:
typeName = "中层胶";
break;
case 3:
typeName = "胎面胶";
break;
default:
break;
}
string MaterialName = Convert.ToString(newRecipe.GetType().GetProperty($"MaterialName{i}").GetValue(newRecipe));
if (!string.IsNullOrEmpty(MaterialName))
{
ZxWeightEntity weight = zxWeightEntities.FirstOrDefault(x => x.MaterialCode == MaterialName);
if (weight != null) //原来就有
{
weight.SetThickness = Convert.ToDecimal(newRecipe.GetType().GetProperty($"MaterialThickness{i}").GetValue(newRecipe)); //(decimal)newRecipe.MaterialThickness1;
weight.SetWidth = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)); //newRecipe.MaterialWidth1;
weight.SetWidth2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)); //newRecipe.MaterialWidth12;
weight.SetWidth3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)); //newRecipe.MaterialWidth13;
weight.SetLayer = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)); //newRecipe.MaterialLayers1;
weight.SetLayer2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)); //newRecipe.MaterialLayers12;
weight.SetLayer3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)); //newRecipe.MaterialLayers13;
ZxWeightService.Instance.UpdateWeightInfo(weight);
}
else //原来没有就添加
{
ZxWeightService.Instance.InsertWeightInfo(new ZxWeightEntity()
{
RecipeCode = newRecipe.RecipeCode,
MaterialCode = MaterialName,
MaterialName = MaterialName + typeName,
MaterialType = typeName,
SetThickness = Convert.ToDecimal(newRecipe.GetType().GetProperty($"MaterialThickness{i}").GetValue(newRecipe)),
SetWidth = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)),
SetWidth2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)),
SetWidth3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)),
SetLayer = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)),
SetLayer2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)),
SetLayer3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)),
SetError = 1,
IsUse = true,
IsDeleted = false,
});
}
}
}
}
else //没有就插入 全部同步
{
//同步配方
ZxRecipeEntity entity = new ZxRecipeEntity()
{
RecipeName = newRecipe.RecipeName,
RecipeCode = newRecipe.RecipeCode,
RecipeSpecCode = newRecipe.SpecCode,
RecipeSpecName = newRecipe.SpecName,
SizeKind = newRecipe.RimInch,
FixedWidth = newRecipe.FixRubWidth,
IsUse = true,
IsDeleted = false,
};
ZxRecipeService.Instance.InsertRecipeInfo(entity);
//同步称量信息
List<ZxWeightEntity> zxWeightEntities = ZxWeightService.Instance.GetWeightInfos(nowEneity.RecipeCode);
for (int i = 1; i <= 3; i++)
{
string typeName = string.Empty;
switch (i)
{
case 1:
typeName = "基部胶";
break;
case 2:
typeName = "中层胶";
break;
case 3:
typeName = "胎面胶";
break;
default:
break;
}
string MaterialName = Convert.ToString(newRecipe.GetType().GetProperty($"MaterialName{i}").GetValue(newRecipe));
if (!string.IsNullOrEmpty(MaterialName))
{
ZxWeightEntity weight = zxWeightEntities.FirstOrDefault(x => x.MaterialCode == MaterialName);
if (weight != null) //原来就有
{
weight.SetThickness = Convert.ToDecimal(newRecipe.GetType().GetProperty($"MaterialThickness{i}").GetValue(newRecipe)); //(decimal)newRecipe.MaterialThickness1;
weight.SetWidth = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)); //newRecipe.MaterialWidth1;
weight.SetWidth2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)); //newRecipe.MaterialWidth12;
weight.SetWidth3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)); //newRecipe.MaterialWidth13;
weight.SetLayer = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)); //newRecipe.MaterialLayers1;
weight.SetLayer2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)); //newRecipe.MaterialLayers12;
weight.SetLayer3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)); //newRecipe.MaterialLayers13;
ZxWeightService.Instance.UpdateWeightInfo(weight);
}
else //原来没有就添加
{
ZxWeightService.Instance.InsertWeightInfo(new ZxWeightEntity()
{
RecipeCode = newRecipe.RecipeCode,
MaterialCode = MaterialName,
MaterialName = MaterialName + typeName,
MaterialType = typeName,
SetThickness = Convert.ToDecimal(newRecipe.GetType().GetProperty($"MaterialThickness{i}").GetValue(newRecipe)),
SetWidth = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)),
SetWidth2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)),
SetWidth3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)),
SetLayer = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)),
SetLayer2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)),
SetLayer3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)),
SetError = 1,
IsUse = true,
IsDeleted = false,
});
}
}
}
//同步公共参数
ZxRecipeParaEntity recipeParaEntity = new ZxRecipeParaEntity();
recipeParaEntity.RimInch = newRecipe.RimInch;
recipeParaEntity.LightWidth = newRecipe.FixRubWidth;
recipeParaEntity.SlowDistance = 0;
recipeParaEntity.StopDistance = 0;
recipeParaEntity.TireWeight = newRecipe.TireWeight;
recipeParaEntity.SpecCode = newRecipe.SpecCode;
recipeParaEntity.SpecName = newRecipe.SpecName;
recipeParaEntity.RecipeCode = newRecipe.RecipeCode;
//自动工位选择
zxWeightEntities.Clear();
zxWeightEntities = ZxWeightService.Instance.GetWeightInfos(nowEneity.RecipeCode);
List<ZxOpenMixMaterialEntity> openMixConfig = ZxOpenMixMaterialService.Instance.GetInfos();
foreach (ZxWeightEntity weightEntity in zxWeightEntities)
{
var config = openMixConfig.Where(x => x.MaterialName == weightEntity.MaterialName).FirstOrDefault();
if (config == null)
{
continue;
}
var prop = recipeParaEntity.GetType().GetProperty($"S{config.StationNo + 1}");
if (prop != null)
{
prop.SetValue(recipeParaEntity, true);
}
//自动包边选择
if (!(weightEntity.SetLayer2 == 0
|| weightEntity.SetLayer2 == null
|| weightEntity.SetWidth2 == null
|| weightEntity.SetWidth2 == 0))
{
var propp = recipeParaEntity.GetType().GetProperty($"B{config.StationNo - 1}");
if (propp != null)
{
propp.SetValue(recipeParaEntity, true);
}
}
if (!(weightEntity.SetLayer3 == 0
|| weightEntity.SetLayer3 == null
|| weightEntity.SetWidth3 == null
|| weightEntity.SetWidth3 == 0))
{
var propp = recipeParaEntity.GetType().GetProperty($"B{config.StationNo + 4}");
if (propp != null)
{
propp.SetValue(recipeParaEntity, true);
}
}
//设置胎体重量
if (weightEntity.MaterialType == "胎面胶")
{
recipeParaEntity.TireWeight = Convert.ToSingle(weightEntity.SetWeight);
switch (config.StationNo)
{
case 3:
recipeParaEntity.S7 = true;
break;
case 4:
recipeParaEntity.S8 = true;
break;
case 5:
recipeParaEntity.S9 = true;
break;
default:
break;
}
}
}
ZxRecipeParaEntity nowRecipeParaEntity = ZxRecipeParaService.Instance.GetRecipeParaInfoByRecipeCode(nowEneity.RecipeCode).FirstOrDefault();
if (nowRecipeParaEntity != null) //如果存在就更改
{
recipeParaEntity.Id = nowRecipeParaEntity.Id;
ZxRecipeParaService.Instance.UpdateRecipeParaInfo(recipeParaEntity);
}
else
{
ZxRecipeParaService.Instance.InsertRecipeParaInfo(recipeParaEntity);
}
//同步工位参数
ZxRecipePositionParaService.Instance.DeleteRecipePositionParaInfoByRecipeCode(newRecipe.RecipeCode); //删除可能存在的脏数据
for (int i = 1; i <= 3; i++)
{
string MaterialName = Convert.ToString(newRecipe.GetType().GetProperty($"MaterialName{i}").GetValue(newRecipe));
if (string.IsNullOrEmpty(MaterialName))
{
continue;
}
var config = openMixConfig.Where(x => x.MaterialName.Contains(MaterialName)).FirstOrDefault();
if (config == null)
{
continue;
}
ZxRecipePositionParaEntity positionEntity = new ZxRecipePositionParaEntity()
{
RecipeCode = newRecipe.RecipeCode,
Position = config.StationNo,
E1 = 15,
E2 = 52,
E5 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)) * 10,
E9 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)),
E6 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)) * 10,
E7 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)),
E3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)) * 10,
E4 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)),
E10 = 800,
E8 = 300
};
ZxRecipePositionParaService.Instance.InsertRecipePositionParaInfo(positionEntity);
}
}
}
private void TestButton1_Click(object sender, EventArgs e)
{
var a = ZxMesPlanTransferService.Instance.GetRecipeInfos(x => x.RequestFlag == false).FirstOrDefault();
SyncRecipe(a);
}
private void TestButton2_Click(object sender, EventArgs e)
{
}
}
}

@ -24,6 +24,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HighWayIot.Plc", "HighWayIot.Plc\HighWayIot.Plc.csproj", "{FE3EA2BE-71C5-4F56-8125-E8E5AAA8FB84}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HighWayIot.Controls", "HighWayIot.Controls\HighWayIot.Controls.csproj", "{DDEE27AA-0694-47A6-9335-E9308261F63A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -62,6 +64,10 @@ Global
{FE3EA2BE-71C5-4F56-8125-E8E5AAA8FB84}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE3EA2BE-71C5-4F56-8125-E8E5AAA8FB84}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE3EA2BE-71C5-4F56-8125-E8E5AAA8FB84}.Release|Any CPU.Build.0 = Release|Any CPU
{DDEE27AA-0694-47A6-9335-E9308261F63A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDEE27AA-0694-47A6-9335-E9308261F63A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDEE27AA-0694-47A6-9335-E9308261F63A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDEE27AA-0694-47A6-9335-E9308261F63A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Loading…
Cancel
Save