feat - 监控报表逻辑和MES同步初步逻辑,界面修改,报错提示修改

master
SoulStar 8 months ago
parent 6372b3f2ad
commit c3a109739e

@ -32,12 +32,12 @@ namespace HighWayIot.Plc.PlcHelper
}
catch
{
return false;
return false;
}
//SPEC名称写入
var specNameBytes = Encoding.ASCII.GetBytes(paraEntity.SpecName);
Array.Copy(specNameBytes, 0, bytes, 0, specNameBytes.Length > 20 ? 20 : specNameBytes.Length);
Array.Copy(specNameBytes, 0, bytes, 0, specNameBytes.Length > 38 ? 38 : specNameBytes.Length);
//if (!PlcConnect.PlcWrite2("D290", paraEntity.SpecName, DataTypeEnum.String).IsSuccess)
// return false;
@ -59,6 +59,18 @@ namespace HighWayIot.Plc.PlcHelper
bitDatas[1] = bitDatas[1].SetBoolByIndex(0, paraEntity.S9 ?? false);
ushort bitData = bitDatas.FromBytes();
byte[] sideBytes = new byte[2];
sideBytes[0] = sideBytes[0].SetBoolByIndex(0, paraEntity.B0 ?? false);
sideBytes[0] = sideBytes[0].SetBoolByIndex(1, paraEntity.B1 ?? false);
sideBytes[0] = sideBytes[0].SetBoolByIndex(2, paraEntity.B2 ?? false);
sideBytes[0] = sideBytes[0].SetBoolByIndex(3, paraEntity.B3 ?? false);
sideBytes[0] = sideBytes[0].SetBoolByIndex(4, paraEntity.B4 ?? false);
sideBytes[0] = sideBytes[0].SetBoolByIndex(5, paraEntity.B5 ?? false);
sideBytes[0] = sideBytes[0].SetBoolByIndex(6, paraEntity.B6 ?? false);
sideBytes[0] = sideBytes[0].SetBoolByIndex(7, paraEntity.B7 ?? false);
sideBytes[1] = sideBytes[1].SetBoolByIndex(0, paraEntity.B0 ?? false);
sideBytes[1] = sideBytes[1].SetBoolByIndex(1, paraEntity.B1 ?? false);
//if (!PlcConnect.PlcWrite2("D390", bitData, DataTypeEnum.UInt16).IsSuccess)
// return false;
@ -85,7 +97,15 @@ namespace HighWayIot.Plc.PlcHelper
Array.Copy(bytes5, 0, bytes, (394 - 290) * 2, bytes5.Length);
Array.Copy(bytes6, 0, bytes, (398 - 290) * 2, bytes6.Length);
return PlcConnect.PlcWriteBytes2("D290", bytes).IsSuccess;
if (!PlcConnect.PlcWriteBytes2("D290", bytes).IsSuccess)
{
return false;
}
if (!PlcConnect.PlcWriteBytes2("D409", sideBytes).IsSuccess)
{
return false;
}
return true;
}
/// <summary>
@ -194,11 +214,11 @@ namespace HighWayIot.Plc.PlcHelper
return new List<ZxRecipePositionParaEntity>();
}
//读取SPEC编号
paraEntity.SpecCode = PlcConnect.ReadUInt322("D206").Content.ToString();
//读取标称尺度
paraEntity.RecipeCode = PlcConnect.ReadString2("D206", 10).Content.ToString();
//读取SPEC名称
paraEntity.SpecName = PlcConnect.MelsecInstance2.ByteTransform.TransString(data, 0, 10, Encoding.ASCII);
paraEntity.SpecName = PlcConnect.MelsecInstance2.ByteTransform.TransString(data, 0, 19, Encoding.ASCII);
//读取工位参数
List<ZxRecipePositionParaEntity> positionEntitys = SelectReadPositionPara(data);
@ -214,6 +234,22 @@ namespace HighWayIot.Plc.PlcHelper
paraEntity.S7 = bitDatas[0].GetBoolByIndex(6);
paraEntity.S8 = bitDatas[0].GetBoolByIndex(7);
paraEntity.S9 = bitDatas[1].GetBoolByIndex(0);//390.8
OperateResult<byte[]> sideResult = PlcConnect.ReadByte2("D409", 1);
byte[] sideData;
if (sideResult.IsSuccess)
{
sideData = sideResult.Content;
paraEntity.B0 = sideData[0].GetBoolByIndex(0);
paraEntity.B1 = sideData[0].GetBoolByIndex(1);
paraEntity.B2 = sideData[0].GetBoolByIndex(2);
paraEntity.B3 = sideData[0].GetBoolByIndex(3);
paraEntity.B4 = sideData[0].GetBoolByIndex(4);
paraEntity.B5 = sideData[0].GetBoolByIndex(5);
paraEntity.B6 = sideData[0].GetBoolByIndex(6);
paraEntity.B7 = sideData[0].GetBoolByIndex(7);
paraEntity.B8 = sideData[1].GetBoolByIndex(0);
paraEntity.B9 = sideData[1].GetBoolByIndex(1);
}
paraEntity.RimInch = PlcConnect.MelsecInstance2.ByteTransform.TransInt16(data, (391 - 290) * 2);//("D391");
paraEntity.LightWidth = PlcConnect.MelsecInstance2.ByteTransform.TransInt16(data, (392 - 290) * 2);//("D392");

@ -22,7 +22,7 @@ namespace HighWayIot.Plc.PlcHelper
if (!operateResult.IsSuccess)
{
LogHelper.Instance.Error("排程监视信息读取失败");
LogHelper.Instance.Error("排程监视PLC点位读取失败检查PLC连接情况");
return null;
}

@ -14,164 +14,189 @@ namespace HighWayIot.Plc.PlcHelper
public class TransferSingal
{
/// <summary>
/// 工位贴合开始信号写入
/// 读取工位报表信号
/// </summary>
/// <param name="stationNo"></param>
/// <returns></returns>
public bool WriteStationStickSingal(int stationNo)
public byte[] ReadStationReportSignal()
{
bool result = false;
switch (stationNo)
{
case 1:
result = PlcConnect.PlcWrite2("B201", true, DataTypeEnum.Bool).IsSuccess;
break;
case 2:
result = PlcConnect.PlcWrite2("B202", true, DataTypeEnum.Bool).IsSuccess;
break;
case 3:
result = PlcConnect.PlcWrite2("B203", true, DataTypeEnum.Bool).IsSuccess;
break;
case 4:
result = PlcConnect.PlcWrite2("B205", true, DataTypeEnum.Bool).IsSuccess;
break;
case 5:
result = PlcConnect.PlcWrite2("B207", true, DataTypeEnum.Bool).IsSuccess;
break;
default:
break;
}
return result;
}
/// <summary>
/// 工位贴合计数开始信号写入
/// </summary>
/// <param name="stationNo"></param>
/// <returns></returns>
public bool WriteStationStickCountSingal(int stationNo)
{
bool result = false;
switch (stationNo)
{
case 1:
result = PlcConnect.PlcWrite2("B211", true, DataTypeEnum.Bool).IsSuccess;
break;
case 2:
result = PlcConnect.PlcWrite2("B212", true, DataTypeEnum.Bool).IsSuccess;
break;
case 3:
result = PlcConnect.PlcWrite2("B213", true, DataTypeEnum.Bool).IsSuccess;
break;
case 4:
result = PlcConnect.PlcWrite2("B215", true, DataTypeEnum.Bool).IsSuccess;
break;
case 5:
result = PlcConnect.PlcWrite2("B217", true, DataTypeEnum.Bool).IsSuccess;
break;
default:
break;
}
return result;
}
/// <summary>
/// 读取小车就绪信号(开始贴合) 鼓到位信号读取(开始横裁信号)和贴合计数信号读取(横裁结束信号)
/// </summary>
/// <returns>第一个Byte数组是第二个Byte数组是开始横裁信号第三个是结束横裁信号</returns>
public bool[][] ReadDrumReadyAndCountReadySignal()
{
OperateResult<byte[]> operateResult = PlcConnect.ReadByte2("B980", 3);
OperateResult<byte[]> operateResult = PlcConnect.ReadByte2("D3001", 30);
if (!operateResult.IsSuccess)
{
return null;
}
byte[] data = operateResult.Content;
bool[][] result = new bool[3][];
result[0] = new bool[9];
result[1] = new bool[8];
result[2] = new bool[8];
//12345工位小车就绪
for (int i = 0; i < 6; i++)
{
result[0][i] = data[0].GetBoolByIndex(i);
}
//345称重工位就绪
for (int i = 0; i < 3; i++)
{
result[0][i + 6] = data[1].GetBoolByIndex(i);
}
//开始和结束横裁的信号
for (int i = 0; i < 8; i++)
{
result[1][i + 1] = data[2].GetBoolByIndex(i);
result[2][i + 1] = data[4].GetBoolByIndex(i);
}
return result;
return operateResult.Content;
}
/// <summary>
/// 监控中转信号
/// 复位工位小车结束信号
/// </summary>
/// <param name="No"></param>
/// <returns></returns>
public bool[][] ReadMonitorSingal()
public bool WriteStationReportSignal(int No)
{
OperateResult<byte[]> operateResult = PlcConnect.ReadByte2("B9B1", 5);
if (!operateResult.IsSuccess)
{
return null;
}
byte[] data = operateResult.Content;
bool[][] result = new bool[5][];
for (int i = 0; i < 5; i++)
{
result[i] = new bool[5];
for (int j = 0; j < 5; j++)
{
result[i][j] = data[i * 2].GetBoolByIndex(j);
}
}
return result;
return PlcConnect.PlcWrite2($"D301{No}", 0, DataTypeEnum.UInt16).IsSuccess;
}
/// <summary>
/// 监控工位配方信息
/// </summary>
/// <returns></returns>
public List<StationRecipeEntity> ReadStationRecipeInfo()
{
OperateResult<byte[]> operateResult = PlcConnect.ReadByte2("W950", 80);
if (!operateResult.IsSuccess)
{
return null;
}
///// <summary>
///// 工位贴合开始信号写入
///// </summary>
///// <param name="stationNo"></param>
///// <returns></returns>
//public bool WriteStationStickSingal(int stationNo)
//{
// bool result = false;
byte[] data = operateResult.Content;
List<StationRecipeEntity> resultList = new List<StationRecipeEntity>();
// switch (stationNo)
// {
// case 1:
// result = PlcConnect.PlcWrite2("B201", true, DataTypeEnum.Bool).IsSuccess;
// break;
// case 2:
// result = PlcConnect.PlcWrite2("B202", true, DataTypeEnum.Bool).IsSuccess;
// break;
// case 3:
// result = PlcConnect.PlcWrite2("B203", true, DataTypeEnum.Bool).IsSuccess;
// break;
// case 4:
// result = PlcConnect.PlcWrite2("B205", true, DataTypeEnum.Bool).IsSuccess;
// break;
// case 5:
// result = PlcConnect.PlcWrite2("B207", true, DataTypeEnum.Bool).IsSuccess;
// break;
// default:
// break;
// }
for (int i = 0; i < 5; i++)
{
resultList.Add(new StationRecipeEntity()
{
StationRecipeDescripe = PlcConnect.MelsecInstance2.ByteTransform.TransString(data, (i * 16) + 0, 20, Encoding.ASCII),
StationRecipeNo = PlcConnect.MelsecInstance2.ByteTransform.TransInt16(data, (i * 16) + 20),
StationVehicleNo = PlcConnect.MelsecInstance2.ByteTransform.TransInt16(data, (i * 16) + 22),
StationTireWeight = PlcConnect.MelsecInstance2.ByteTransform.TransSingle(data, (i * 16) + 24),
});
}
// return result;
//}
return resultList;
}
///// <summary>
///// 工位贴合计数开始信号写入
///// </summary>
///// <param name="stationNo"></param>
///// <returns></returns>
//public bool WriteStationStickCountSingal(int stationNo)
//{
// bool result = false;
// switch (stationNo)
// {
// case 1:
// result = PlcConnect.PlcWrite2("B211", true, DataTypeEnum.Bool).IsSuccess;
// break;
// case 2:
// result = PlcConnect.PlcWrite2("B212", true, DataTypeEnum.Bool).IsSuccess;
// break;
// case 3:
// result = PlcConnect.PlcWrite2("B213", true, DataTypeEnum.Bool).IsSuccess;
// break;
// case 4:
// result = PlcConnect.PlcWrite2("B215", true, DataTypeEnum.Bool).IsSuccess;
// break;
// case 5:
// result = PlcConnect.PlcWrite2("B217", true, DataTypeEnum.Bool).IsSuccess;
// break;
// default:
// break;
// }
// return result;
//}
///// <summary>
///// 读取小车就绪信号(开始贴合) 鼓到位信号读取(开始横裁信号)和贴合计数信号读取(横裁结束信号)
///// </summary>
///// <returns>第一个Byte数组是第二个Byte数组是开始横裁信号第三个是结束横裁信号</returns>
//public bool[][] ReadDrumReadyAndCountReadySignal()
//{
// OperateResult<byte[]> operateResult = PlcConnect.ReadByte2("B980", 3);
// if (!operateResult.IsSuccess)
// {
// return null;
// }
// byte[] data = operateResult.Content;
// bool[][] result = new bool[3][];
// result[0] = new bool[9];
// result[1] = new bool[8];
// result[2] = new bool[8];
// //12345工位小车就绪
// for (int i = 0; i < 6; i++)
// {
// result[0][i] = data[0].GetBoolByIndex(i);
// }
// //345称重工位就绪
// for (int i = 0; i < 3; i++)
// {
// result[0][i + 6] = data[1].GetBoolByIndex(i);
// }
// //开始和结束横裁的信号
// for (int i = 0; i < 8; i++)
// {
// result[1][i + 1] = data[2].GetBoolByIndex(i);
// result[2][i + 1] = data[4].GetBoolByIndex(i);
// }
// return result;
//}
///// <summary>
///// 监控中转信号
///// </summary>
///// <returns></returns>
//public bool[][] ReadMonitorSingal()
//{
// OperateResult<byte[]> operateResult = PlcConnect.ReadByte2("B9B1", 5);
// if (!operateResult.IsSuccess)
// {
// return null;
// }
// byte[] data = operateResult.Content;
// bool[][] result = new bool[5][];
// for (int i = 0; i < 5; i++)
// {
// result[i] = new bool[5];
// for (int j = 0; j < 5; j++)
// {
// result[i][j] = data[i * 2].GetBoolByIndex(j);
// }
// }
// return result;
//}
///// <summary>
///// 监控工位配方信息
///// </summary>
///// <returns></returns>
//public List<StationRecipeEntity> ReadStationRecipeInfo()
//{
// OperateResult<byte[]> operateResult = PlcConnect.ReadByte2("W950", 80);
// if (!operateResult.IsSuccess)
// {
// return null;
// }
// byte[] data = operateResult.Content;
// List<StationRecipeEntity> resultList = new List<StationRecipeEntity>();
// for (int i = 0; i < 5; i++)
// {
// resultList.Add(new StationRecipeEntity()
// {
// StationRecipeDescripe = PlcConnect.MelsecInstance2.ByteTransform.TransString(data, (i * 16) + 0, 20, Encoding.ASCII),
// StationRecipeNo = PlcConnect.MelsecInstance2.ByteTransform.TransInt16(data, (i * 16) + 20),
// StationVehicleNo = PlcConnect.MelsecInstance2.ByteTransform.TransInt16(data, (i * 16) + 22),
// StationTireWeight = PlcConnect.MelsecInstance2.ByteTransform.TransSingle(data, (i * 16) + 24),
// });
// }
// return resultList;
//}
}
}

@ -47,7 +47,7 @@ namespace HighWayIot.Repository.domain
/// 备 注:小车编号
/// 默认值:
///</summary>
public int? DeviceNo { get; set; }
public string DeviceNo { get; set; } = string.Empty;
/// <summary>
/// 备 注:生胎重量
@ -70,6 +70,14 @@ namespace HighWayIot.Repository.domain
/// </summary>
public string FaceRubTimeSpan { get; set; } = string.Empty;
/// <summary>
/// 复重重量
/// </summary>
public int? RepeatWeight { get; set; }
/// <summary>
/// 是否已完成
/// </summary>
public string IsDone { get; set; } = string.Empty;
}
}

@ -54,6 +54,13 @@ namespace HighWayIot.Repository.domain
[SugarColumn(ColumnName = "spec_code")]
public string SpecCode { get; set; } = string.Empty;
/// <summary>
/// 备 注:更新时间
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "sync_time")]
public DateTime? SyncTime { get; set; }
/// <summary>
/// 备 注:钢圈尺寸
/// 默认值:
@ -73,7 +80,7 @@ namespace HighWayIot.Repository.domain
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "tire_weight")]
public float? TireWeight { get; set; }
public int? TireWeight { get; set; }
/// <summary>
/// 备 注:物料名称1基部胶
@ -90,18 +97,39 @@ namespace HighWayIot.Repository.domain
public int? MaterialLayers1 { get; set; }
/// <summary>
/// 备 注:重量1基部胶
/// 备 注:贴合层数1基部胶2
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_weight_1")]
public double? MaterialWeight1 { get; set; }
[SugarColumn(ColumnName = "material_layers_1_2")]
public int? MaterialLayers12 { get; set; }
/// <summary>
/// 备 注:贴合层数1基部胶3
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_layers_1_3")]
public int? MaterialLayers13 { get; set; }
/// <summary>
/// 备 注:宽度1基部胶
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_width_1")]
public double? MaterialWidth1 { get; set; }
public int? MaterialWidth1 { get; set; }
/// <summary>
/// 备 注:宽度1基部胶2
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_width_1_2")]
public int? MaterialWidth12 { get; set; }
/// <summary>
/// 备 注:宽度1基部胶3
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_width_1_3")]
public int? MaterialWidth13 { get; set; }
/// <summary>
/// 备 注:物料名称2缓冲胶
@ -117,19 +145,40 @@ namespace HighWayIot.Repository.domain
[SugarColumn(ColumnName = "material_layers_2")]
public int? MaterialLayers2 { get; set; }
/// <summary>
/// 备 注:重量2缓冲胶
/// <summary>
/// 备 注:贴合层数2缓冲胶2
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_weight_2")]
public double? MaterialWeight2 { get; set; }
[SugarColumn(ColumnName = "material_layers_2_2")]
public int? MaterialLayers22 { get; set; }
/// <summary>
/// 备 注:贴合层数2缓冲胶3
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_layers_2_3")]
public int? MaterialLayers23 { get; set; }
/// <summary>
/// 备 注:宽度2缓冲胶
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_width_2")]
public double? MaterialWidth2 { get; set; }
public int? MaterialWidth2 { get; set; }
/// <summary>
/// 备 注:宽度2缓冲胶2
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_width_2_2")]
public int? MaterialWidth22 { get; set; }
/// <summary>
/// 备 注:宽度2缓冲胶3
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_width_2_3")]
public int? MaterialWidth23 { get; set; }
/// <summary>
/// 备 注:物料名称3胎面胶
@ -146,53 +195,39 @@ namespace HighWayIot.Repository.domain
public int? MaterialLayers3 { get; set; }
/// <summary>
/// 备 注:重量3胎面胶
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_weight_3")]
public double? MaterialWeight3 { get; set; }
/// <summary>
/// 备 注:宽度3胎面胶
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_width_3")]
public double? MaterialWidth3 { get; set; }
/// <summary>
/// 备 注:更新时间
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "sync_time")]
public DateTime? SyncTime { get; set; }
/// <summary>
/// 备 注:贴合层数1基部胶
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_layers_1_2")]
public int? MaterialLayers12 { get; set; }
/// <summary>
/// 备 注:宽度1基部胶
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_width_1_2")]
public double? MaterialWidth12 { get; set; }
/// <summary>
/// 备 注:贴合层数3胎面胶
/// 备 注:贴合层数3胎面胶2
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_layers_3_2")]
public int? MaterialLayers32 { get; set; }
/// <summary>
/// 备 注:贴合层数3胎面胶3
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_layers_3_3")]
public int? MaterialLayers33 { get; set; }
/// <summary>
/// 备 注:宽度3胎面胶
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_width_3")]
public int? MaterialWidth3 { get; set; }
/// <summary>
/// 备 注:宽度3胎面胶2
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_width_3_2")]
public double? MaterialWidth32 { get; set; }
public int? MaterialWidth32 { get; set; }
/// <summary>
/// 备 注:宽度3胎面胶3
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_width_3_3")]
public int? MaterialWidth33 { get; set; }
}

@ -57,14 +57,21 @@ namespace Models
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "fixed_width")]
public decimal? FixedWidth { get; set; }
public int? FixedWidth { get; set; }
///// <summary>
///// 备 注:批次号
///// 默认值:
/////</summary>
//[SugarColumn(ColumnName = "batch_code")]
//public string BatchCode { get; set; } = string.Empty;
/// <summary>
/// 备 注:重量公差(%)
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "weight_error")]
public int? WeightError { get; set; }
public float? WeightError { get; set; }
/// <summary>
/// 备 注:是否使用
@ -80,7 +87,5 @@ namespace Models
[SugarColumn(ColumnName = "is_deleted")]
public bool? IsDeleted { get; set; }
}
}

@ -144,6 +144,76 @@ namespace Models
[SugarColumn(ColumnName = "S9")]
public bool? S9 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "B0")]
public bool? B0 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "B1")]
public bool? B1 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "B2")]
public bool? B2 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "B3")]
public bool? B3 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "B4")]
public bool? B4 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "B5")]
public bool? B5 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "B6")]
public bool? B6 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "B7")]
public bool? B7 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "B8")]
public bool? B8 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "B9")]
public bool? B9 { get; set; }
}

@ -38,6 +38,13 @@ namespace Models
[SugarColumn(ColumnName = "recipe_no_1")]
public string RecipeCode1 { get; set; } = string.Empty;
///// <summary>
///// 备 注:批次号1
///// 默认值:
/////</summary>
//[SugarColumn(ColumnName = "batch_code_1")]
//public string BatchCode1 { get; set; } = string.Empty;
/// <summary>
/// 备 注:成品代号2
/// 默认值:
@ -51,6 +58,15 @@ namespace Models
///</summary>
[SugarColumn(ColumnName = "recipe_no_2")]
public string RecipeCode2 { get; set; } = string.Empty;
///// <summary>
///// 备 注:批次号2
///// 默认值:
/////</summary>
//[SugarColumn(ColumnName = "batch_code_2")]
//public string BatchCode2 { get; set; } = string.Empty;
}
}

@ -59,21 +59,21 @@ namespace Models
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "set_width")]
public decimal? SetWidth { get; set; }
public int? SetWidth { get; set; }
/// <summary>
/// 备 注:宽度2
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "set_width_2")]
public decimal? SetWidth2 { get; set; }
public int? SetWidth2 { get; set; }
/// <summary>
/// 备 注:宽度3
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "set_width_3")]
public decimal? SetWidth3 { get; set; }
public int? SetWidth3 { get; set; }
/// <summary>
/// 备 注:层数
@ -101,7 +101,7 @@ namespace Models
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "set_weight")]
public decimal? SetWeight { get; set; }
public int? SetWeight { get; set; }
/// <summary>
/// 备 注:公差

@ -33,20 +33,41 @@ namespace HighWayIot.Repository.service
/// 查询报表信息
/// </summary>
/// <returns></returns>
public List<ZxDailyReportEntity> Get25DailyReportInfos()
public List<ZxDailyReportEntity> Get30DailyReportInfos()
{
try
{
List<ZxDailyReportEntity> entity =
_repository.AsQueryable()
.OrderByDescending(x => x.StartTime)
.Take(25)
.Take(30)
.ToList();
return entity;
}
catch (Exception ex)
{
log.Error("配方信息获取异常", ex);
log.Error("报表息获取异常", ex);
return null;
}
}
/// <summary>
/// 得到最近的一次符合条件的数据
/// </summary>
/// <returns></returns>
public ZxDailyReportEntity GetNearData(int rgvNo)
{
try
{
ZxDailyReportEntity entity =
_repository.AsQueryable()
.OrderByDescending(x => x.StartTime)
.First(x => x.DeviceNo == rgvNo);
return entity;
}
catch (Exception ex)
{
log.Error("报表信息获取异常或无数据", ex);
return null;
}
}
@ -65,7 +86,7 @@ namespace HighWayIot.Repository.service
}
catch(Exception ex)
{
log.Error("配发信息获取异常", ex);
log.Error("报表信息获取异常", ex);
return null;
}
}

@ -80,6 +80,24 @@ namespace HighWayIot.Repository.service
}
}
/// <summary>
/// 修改配方字段信息
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public bool UpdateRangeRecipeParaInfo(List<ZxRecipeParaEntity> entity)
{
try
{
return _repository.UpdateRange(entity);
}
catch (Exception ex)
{
log.Error("配方字段信息修改异常", ex);
return false;
}
}
/// <summary>
/// 添加配方字段信息
/// </summary>

@ -99,6 +99,24 @@ namespace HighWayIot.Repository.service
}
}
/// <summary>
/// 修改工位配方字段信息
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public bool UpdateRecipePositionParaInfo(List<ZxRecipePositionParaEntity> entity)
{
try
{
return _repository.UpdateRange(entity);
}
catch (Exception ex)
{
log.Error("工位配方字段信息修改异常", ex);
return false;
}
}
/// <summary>
/// 添加工位配方字段信息
/// </summary>

@ -6,6 +6,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
@ -44,6 +45,20 @@ namespace HighWayIot.Repository.service
}
}
//public List<string> GetSpecBatchCodeByRecipeCode(string recipeCode)
//{
// try
// {
// List<string> entity = _repository.GetList(x => x.RecipeCode == recipeCode && x.IsDeleted == false).Select(x => x.)
// return entity;
// }
// catch (Exception ex)
// {
// log.Error("配方信息获取异常", ex);
// return null;
// }
//}
/// <summary>
/// 根据配方编号查询配方信息
/// </summary>

@ -0,0 +1,159 @@
using HighWayIot.Plc;
using HighWayIot.Plc.PlcHelper;
using HighWayIot.Repository.domain;
using HighWayIot.Repository.service;
using HighWayIot.Winform.UserControlPages;
using HslCommunication.Profinet.Keyence;
using Models;
using SixLabors.ImageSharp.PixelFormats;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace HighWayIot.Winform.Business
{
/// <summary>
/// 报表数据刷新业务类
/// </summary>
public class MonitorDataRefreshBusiness
{
TransferSingal transferSingal = new TransferSingal();
private Timer refreshTimer;
public MonitorDataRefreshBusiness()
{
// 启动定时器每隔1秒刷新一次报表数据
refreshTimer = new System.Threading.Timer(RefreshData, null, 0, 1000);
}
/// <summary>
/// 数据刷新
/// </summary>
/// <param name="o"></param>
private void RefreshData(object o)
{
byte[] signals = transferSingal.ReadStationReportSignal();
if (signals == null)
{
return;
}
//解析返回的信号数据
ushort[] rgvNo = new ushort[7];
ushort[] rgvState = new ushort[7];
float[] weights = new float[4];
for (int i = 0; i < 7; i++)
{
rgvNo[i] = BitConverter.ToUInt16(signals, i * 2);
rgvState[i] = BitConverter.ToUInt16(signals, (i * 2) + 20);
if (i > 2)
{
weights[i - 3] = BitConverter.ToSingle(signals, ((i - 3) * 4) + 40);
}
}
//装圈工位
if (rgvState[0] == 1)
{
// 监控画面信息插入
MonitorInsert(RecipeSendBusiness.NowRecipeCode, RecipeSendBusiness.NowDeviceNo, rgvNo[0]);
MonitorMainPage.MonitorRefreshAction.Invoke();
transferSingal.WriteStationReportSignal(1); // 复位信号
}
//基部胶
if (rgvState[1] == 1)
{
ZxDailyReportEntity entity = ZxDailyReportService.Instance.GetNearData(rgvNo[1]);
if (entity == null)
{
goto n1;
}
entity.BaseEndTime = DateTime.Now;
ZxDailyReportService.Instance.UpdateDailyReportInfo(entity);
MonitorMainPage.MonitorRefreshAction.Invoke();
transferSingal.WriteStationReportSignal(2); // 复位信号
}
n1:
//中层胶
if (rgvState[2] == 1)
{
ZxDailyReportEntity entity = ZxDailyReportService.Instance.GetNearData(rgvNo[2]);
if(entity == null)
{
goto n2;
}
entity.MidEndTime = DateTime.Now;
ZxDailyReportService.Instance.UpdateDailyReportInfo(entity);
MonitorMainPage.MonitorRefreshAction.Invoke();
transferSingal.WriteStationReportSignal(3); // 复位信号
}
n2:
//胎面胶
for (int i = 3; i <= 5; i++)
{
if (rgvState[i] == 1)
{
// 监控画面信息插入
ZxDailyReportEntity entity = ZxDailyReportService.Instance.GetNearData(rgvNo[i]);
if (entity == null)
{
continue;
}
entity.BaseEndTime = DateTime.Now;
entity.RawTireWeight = (int)weights[i - 3];
ZxDailyReportService.Instance.UpdateDailyReportInfo(entity);
MonitorMainPage.MonitorRefreshAction.Invoke();
transferSingal.WriteStationReportSignal(i + 1); // 复位信号
}
}
//结束
if (rgvState[6] == 1)
{
ZxDailyReportEntity entity = ZxDailyReportService.Instance.GetNearData(rgvNo[6]);
entity.RepeatWeight = (int)weights[3];
entity.IsDone = 1;
ZxDailyReportService.Instance.UpdateDailyReportInfo(entity);
MonitorMainPage.MonitorRefreshAction.Invoke();
transferSingal.WriteStationReportSignal(7); // 复位信号
}
}
/// <summary>
/// 监控画面信息插入
/// </summary>
/// <param name="deviceNo">机台号</param>
/// <param name="recipeCode">硫化机台编号</param>
/// <param name="rgvNo">RGV编号</param>
public void MonitorInsert(string recipeCode, string deviceNo, int rgvNo)
{
ZxRecipeEntity recipeEntity = ZxRecipeService.Instance.GetRecipeInfosByRecipeCode(recipeCode).FirstOrDefault();
if (recipeEntity == null)
{
return;
}
ZxDailyReportEntity entity = new ZxDailyReportEntity()
{
Uuid = Guid.NewGuid().ToString("N"),
VulcanizationNo = deviceNo,
StartTime = DateTime.Now,
RecipeName = recipeEntity.RecipeName,
RecipeCode = recipeEntity.RecipeCode,
SpecCode = recipeEntity.RecipeSpecCode,
DeviceNo = rgvNo,
RawTireWeight = (int)ZxRecipeParaService.Instance.GetRecipeParaInfoByRecipeCode(recipeCode).FirstOrDefault()?.TireWeight,
IsDone = 0
};
ZxDailyReportService.Instance.InsertDailyReportInfo(entity);
}
}
}

@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Winform.Business
{
public class RecipeMesSyncBusiness
{
}
}

@ -0,0 +1,112 @@
using HighWayIot.Plc;
using HighWayIot.Plc.PlcHelper;
using HighWayIot.Repository.domain;
using HighWayIot.Repository.service;
using HighWayIot.Winform.MainForm;
using HslCommunication;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Timer = System.Threading.Timer;
namespace HighWayIot.Winform.Business
{
/// <summary>
/// 上位机配方同步业务类
/// </summary>
public class RecipeParaSyncBusiness
{
//private Timer _readSignalTimer;
//private RecipeParaHelper recipeParaHelper = new RecipeParaHelper();
//private ZxRecipeParaService zxRecipeParaService = ZxRecipeParaService.Instance;
//private ZxRecipePositionParaService zxRecipePositionParaService = ZxRecipePositionParaService.Instance;
//public RecipeParaSyncBusiness()
//{
// _readSignalTimer = new Timer(new System.Threading.TimerCallback(ReadSignal), null, 0, 1500);
//}
///// <summary>
///// 读取某个点位
///// </summary>
///// <param name="o"></param>
//private void ReadSignal(object o)
//{
// OperateResult<bool> boolReault = PlcConnect.ReadBool2("B100");
// if (!boolReault.IsSuccess)
// {
// return;
// }
// if (boolReault.Content)
// {
// PlcConnect.PlcWrite2("B100", false,DataTypeEnum.Bool); //写入完成信号
// SyncRecipe();
// }
//}
///// <summary>
///// 配方同步
///// </summary>
//private void SyncRecipe()
//{
// ZxRecipeParaEntity recipeParaEntity = new ZxRecipeParaEntity();
// List<ZxRecipePositionParaEntity> positionParaEntities = recipeParaHelper.DownLoadFormPlc(ref recipeParaEntity);
// //查重
// var nowParaEntity = zxRecipeParaService.GetRecipeParaInfoByRecipeCode(recipeParaEntity.RecipeCode);
// var nowPositionParaEntity = zxRecipePositionParaService.GetRecipePositionParaInfoByRecipeCode(recipeParaEntity.RecipeCode);
// //保存公共参数
// if (nowParaEntity.Count == 0) //没有就插入
// {
// if (!zxRecipeParaService.InsertRecipeParaInfo(recipeParaEntity))
// {
// Log4net.LogHelper.Instance.Error("配方公共参数插入数据库失败");
// return;
// }
// }
// else //有就更新 多条更新第一条
// {
// recipeParaEntity.Id = nowParaEntity[0].Id;
// if (!zxRecipeParaService.UpdateRecipeParaInfo(recipeParaEntity))
// {
// Log4net.LogHelper.Instance.Error("配方公共参数更新数据库失败");
// return;
// }
// }
// //保存贴合参数
// var flag2 = true;
// foreach (var item in positionParaEntities)
// {
// item.RecipeCode = recipeParaEntity.RecipeCode;
// var count = positionParaEntities.Count(x => x.Position == item.Position);
// //如果没有
// if (count == 0)
// {
// flag2 = zxRecipePositionParaService.InsertRecipePositionParaInfo(item);
// }
// else //有 多条存第一条
// {
// item.Id = positionParaEntities.FirstOrDefault(x => x.Position == item.Position).Id;
// flag2 = zxRecipePositionParaService.UpdateRecipePositionParaInfo(item);
// if (count != 1) //多条提示
// {
// Log4net.LogHelper.Instance.Error($"配方贴合参数重复,配方号:{recipeParaEntity.RecipeCode},工位号:{item.Position}");
// }
// }
// if (!flag2) break;
// }
//}
}
}

@ -32,19 +32,24 @@ namespace HighWayIot.Winform.Business
private RecipeParaHelper recipeParaHelper = new RecipeParaHelper();
public static int RecipeNeededVehicleNo = 0;
public static bool RecipeSendMode = false;
public static string NowRecipeCode = string.Empty;
public static string NowDeviceNo = string.Empty;
public RecipeSendBusiness()
{
GetSchedulingTimer = new Timer(new System.Threading.TimerCallback(ReadSignal), null, 0, 1500);
}
/// <summary>
/// 重复读取
/// </summary>
/// <param name="o"></param>
public void ReadSignal(object o)
{
//读取是True的点位
Dictionary<int, bool> a = recipeSignal.ReadSchedulingSignal();
if (a == null)
@ -60,91 +65,119 @@ namespace HighWayIot.Winform.Business
}
else
{
if(ares.Count > 1)
if (ares.Count > 1)
{
LogHelper.Instance.Error($"排程信号True值不唯一 {string.Join(", " , ares.Select(x => x.Key).ToList())}");
LogHelper.Instance.Error($"排程信号True值不唯一 {string.Join(", ", ares.Select(x => x.Key).ToList())}");
}
return;
}
var schedulingInfo = zxSchedulingService.GetSchedulingInfo();
string recipeNo;
ZxRecipeParaEntity recipeParaInfo;
List<ZxRecipePositionParaEntity> zxRecipePositionParaEntities;
if ((destinationVulcanizationNo + 1) <= 62)
if (RecipeSendMode) //通过MES下配方
{
recipeNo = schedulingInfo.Single(x => x.Id == destinationVulcanizationNo + 1).RecipeCode1;
recipeParaInfo = zxRecipeParaService.GetRecipeParaInfoByRecipeCode(recipeNo).FirstOrDefault();
zxRecipePositionParaEntities = zxRecipePositionParaService.GetRecipePositionParaInfos(x => x.RecipeCode == recipeNo);
if (recipeParaInfo == null)
//读同步数据库找到等于0的
List<ZxMesPlanTransferEntity> transferEntity = ZxMesPlanTransferService.Instance.GetRecipeInfos(x => x.RequestFlag == false).ToList();
if (transferEntity.Count > 1)
{
LogHelper.Instance.Error("配方信息获取失败");
LogHelper.Instance.Error($"标识同步数据不唯一,请检查数据库,当前数量:{transferEntity.Count}");
return;
}
if (recipeParaHelper.UploadToPLC(recipeParaInfo, zxRecipePositionParaEntities))
if (transferEntity.Count == 0)
{
PlcConnect.PlcWrite2($"B{(destinationVulcanizationNo + 0x901).ToString("X")}", false, DataTypeEnum.Bool);
int deviceNo = schedulingInfo.Single(x => x.Id == destinationVulcanizationNo + 1).DeviceNo ?? 0;
//MonitorInsert(recipeNo, $"{deviceNo}上模");
LogHelper.Instance.Info($"配方上传成功,配方号:{recipeNo},模具号:{deviceNo}上模");
LogHelper.Instance.Error("配方下发请求不存在,请检查数据库");
return;
}
//同步到配方(配方和称量,如果是新的加字段)
//////////////////////////////更新配方表/////////////////////////////////
//var newEneitys = RecipeLists.Where(x => x.RecipeCode == newRecipes.RecipeCode).ToList();
//if (newEneitys.Count > 0) //有就更新
//{
// //配方
// newEneitys[0].RecipeSpecCode = newRecipes.SpecCode;
// newEneitys[0].RecipeSpecName = newRecipes.SpecName;
// newEneitys[0].SizeKind = newRecipes.RimInch;
// newEneitys[0].FixedWidth = newRecipes.FixRubWidth;
// if (!zxRecipeService.UpdateRecipeInfo(newEneitys[0]))
// {
// return;
// }
//}
//else //没有就插入
//{
// ZxRecipeEntity entity = new ZxRecipeEntity()
// {
// RecipeName = newRecipes.RecipeName,
// RecipeCode = newRecipes.RecipeCode,
// RecipeSpecCode = newRecipes.SpecCode,
// RecipeSpecName = newRecipes.SpecName,
// SizeKind = newRecipes.RimInch,
// FixedWidth = newRecipes.FixRubWidth,
// IsUse = true,
// IsDeleted = false,
// };
// zxRecipeService.InsertRecipeInfo(entity);
//}
//同步到对应硫化排程的界面
//后续流程相同
}
else //手动下配方
{
var schedulingInfo = zxSchedulingService.GetSchedulingInfo();
string recipeNo;
ZxRecipeParaEntity recipeParaInfo;
List<ZxRecipePositionParaEntity> zxRecipePositionParaEntities;
if ((destinationVulcanizationNo + 1) <= 62)
{
recipeNo = schedulingInfo.Single(x => x.Id == destinationVulcanizationNo + 1).RecipeCode1;
recipeParaInfo = zxRecipeParaService.GetRecipeParaInfoByRecipeCode(recipeNo).FirstOrDefault();
zxRecipePositionParaEntities = zxRecipePositionParaService.GetRecipePositionParaInfos(x => x.RecipeCode == recipeNo);
if (recipeParaInfo == null)
{
LogHelper.Instance.Error("配方信息获取失败,请检查所选机台是否配置了相应配方");
return;
}
if (recipeParaHelper.UploadToPLC(recipeParaInfo, zxRecipePositionParaEntities))
{
//PlcConnect.PlcWrite2($"B{(destinationVulcanizationNo + 0x901).ToString("X")}", false, DataTypeEnum.Bool);
int deviceNo = schedulingInfo.Single(x => x.Id == destinationVulcanizationNo + 1).DeviceNo ?? 0;
//MonitorInsert(recipeNo, $"{deviceNo}上模");
LogHelper.Instance.Info($"配方上传成功,配方号:{recipeNo},模具号:{deviceNo}上模");
NowRecipeCode = recipeNo;
NowDeviceNo = deviceNo + "-2";
}
else
{
LogHelper.Instance.Error("配方上传失败检查PLC连接");
return;
}
}
else
{
LogHelper.Instance.Error("配方上传失败");
return;
recipeNo = schedulingInfo.Single(x => x.Id == destinationVulcanizationNo + 1 - 62).RecipeCode2;
recipeParaInfo = zxRecipeParaService.GetRecipeParaInfoByRecipeCode(recipeNo).FirstOrDefault();
zxRecipePositionParaEntities = zxRecipePositionParaService.GetRecipePositionParaInfos(x => x.RecipeCode == recipeNo);
if (recipeParaInfo == null)
{
LogHelper.Instance.Error("配方信息获取失败,请检查所选机台是否配置了相应配方");
return;
}
if (recipeParaHelper.UploadToPLC(recipeParaInfo, zxRecipePositionParaEntities))
{
//PlcConnect.PlcWrite2($"B{(destinationVulcanizationNo - 62 + 0x941).ToString("X")}", false, DataTypeEnum.Bool);
int deviceNo = schedulingInfo.Single(x => x.Id == destinationVulcanizationNo + 1 - 62).DeviceNo ?? 0;
//MonitorInsert(recipeNo, $"{deviceNo}下模");
LogHelper.Instance.Info($"配方上传成功,配方号:{recipeNo},模具号:{deviceNo}下模");
NowRecipeCode = recipeNo;
NowDeviceNo = deviceNo + "-1";
}
else
{
LogHelper.Instance.Error("配方上传失败检查PLC连接");
return;
}
}
}
else
{
recipeNo = schedulingInfo.Single(x => x.Id == destinationVulcanizationNo + 1 - 62).RecipeCode2;
recipeParaInfo = zxRecipeParaService.GetRecipeParaInfoByRecipeCode(recipeNo).FirstOrDefault();
zxRecipePositionParaEntities = zxRecipePositionParaService.GetRecipePositionParaInfos(x => x.RecipeCode == recipeNo);
if (recipeParaInfo == null)
{
LogHelper.Instance.Error("配方信息获取失败");
return;
}
if (recipeParaHelper.UploadToPLC(recipeParaInfo, zxRecipePositionParaEntities))
{
PlcConnect.PlcWrite2($"B{(destinationVulcanizationNo - 62 + 0x941).ToString("X")}", false, DataTypeEnum.Bool);
int deviceNo = schedulingInfo.Single(x => x.Id == destinationVulcanizationNo + 1 - 62).DeviceNo ?? 0;
//MonitorInsert(recipeNo, $"{deviceNo}下模");
LogHelper.Instance.Info($"配方上传成功,配方号:{recipeNo},模具号:{deviceNo}下模");
}
else
{
LogHelper.Instance.Error("配方上传失败");
return;
}
}
}
/// <summary>
/// 监控画面信息插入
/// </summary>
public void MonitorInsert(string recipeCode, string deviceNo)
{
ZxRecipeEntity recipeEntity = ZxRecipeService.Instance.GetRecipeInfosByRecipeCode(recipeCode).FirstOrDefault();
if (recipeEntity == null)
{
return;
}
ZxDailyReportEntity entity = new ZxDailyReportEntity()
{
Uuid = Guid.NewGuid().ToString("N"),
VulcanizationNo = deviceNo,
StartTime = DateTime.Now,
RecipeName = recipeEntity.RecipeName,
RecipeCode = recipeEntity.RecipeCode,
SpecCode = recipeEntity.RecipeSpecCode,
DeviceNo = RecipeNeededVehicleNo,
RawTireWeight = (int)ZxRecipeParaService.Instance.GetRecipeParaInfoByRecipeCode(recipeCode).FirstOrDefault()?.TireWeight,
IsDone = 0
};
ZxDailyReportService.Instance.InsertDailyReportInfo(entity);
}
}
}

@ -148,34 +148,12 @@ namespace HighWayIot.Winform.Business
try
{
//记录当前配方对应的小车
if (int.Parse(workstationNo) == 1)
{
RecipeSendBusiness.RecipeNeededVehicleNo = int.Parse(deviceNo);
}
//如果对应位置成功写入,记录上次该工位写入的是该小车,如果下次还是,不再写入(防止重复写入)
int stationNo = int.Parse(workstationNo);
int vehicleNo = int.Parse(deviceNo);
//if (StationRecord.ContainsKey(stationNo)) //判断上次是不是写入的该点位
//{
// //上次就写入的该车 就不继续写入了
// if (StationRecord[stationNo] == vehicleNo)
// {
// return;
// }
//}
//写入对应的PLC信号
if (_workStationHelper.WriteStationSingal(stationNo, vehicleNo))
{
////写入成功后记录,上次已写入了该点位,不继续写入
//if (StationRecord.ContainsKey(stationNo))
//{
// StationRecord[stationNo] = vehicleNo;
//}
//else
//{
// StationRecord.Add(stationNo, vehicleNo);
//}
LogHelper.Instance.RfidLog($"{workstationNo}工位, {deviceNo}号车 写入成功[{DateTime.Now.ToString("yy-MM-dd HH:mm:ss:fff")}]");
}
else

@ -135,7 +135,7 @@ namespace HighWayIot.Winform.Business
if (setting == null)
{
LogHelper.Instance.Error($"找不到第[{no}]个读写器");
//LogHelper.Instance.Error($"找不到第[{no}]个读写器");
return;
}

@ -148,7 +148,8 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Business\GeneralUtils.cs" />
<Compile Include="Business\RecipeMesSyncBusiness.cs" />
<Compile Include="Business\MonitorDataRefreshBusiness.cs" />
<Compile Include="Business\RecipeParaSyncBusiness.cs" />
<Compile Include="Business\RecipeSendBusiness.cs" />
<Compile Include="Business\RoleBusiness.cs" />
<Compile Include="Business\SqlLogHelper.cs" />

@ -70,6 +70,9 @@ namespace HighWayIot.Winform.MainForm
this.StripLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.TimeStripLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.TimeDisplayTimer = new System.Windows.Forms.Timer(this.components);
this.RecipeStateChangeButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.ModeSelectLabel = new System.Windows.Forms.Label();
this.MainMenu.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
@ -382,11 +385,44 @@ namespace HighWayIot.Winform.MainForm
this.TimeDisplayTimer.Interval = 1000;
this.TimeDisplayTimer.Tick += new System.EventHandler(this.TimeDisplayTimer_Tick);
//
// RecipeStateChangeButton
//
this.RecipeStateChangeButton.Location = new System.Drawing.Point(1708, 1);
this.RecipeStateChangeButton.Name = "RecipeStateChangeButton";
this.RecipeStateChangeButton.Size = new System.Drawing.Size(88, 23);
this.RecipeStateChangeButton.TabIndex = 6;
this.RecipeStateChangeButton.Text = "配方状态切换";
this.RecipeStateChangeButton.UseVisualStyleBackColor = true;
this.RecipeStateChangeButton.Click += new System.EventHandler(this.RecipeStateChangeButton_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Location = new System.Drawing.Point(1802, 6);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 7;
this.label1.Text = "当前:";
//
// ModeSelectLabel
//
this.ModeSelectLabel.AutoSize = true;
this.ModeSelectLabel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
this.ModeSelectLabel.Location = new System.Drawing.Point(1840, 6);
this.ModeSelectLabel.Name = "ModeSelectLabel";
this.ModeSelectLabel.Size = new System.Drawing.Size(29, 12);
this.ModeSelectLabel.TabIndex = 8;
this.ModeSelectLabel.Text = "手动";
//
// BaseForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1904, 1041);
this.Controls.Add(this.ModeSelectLabel);
this.Controls.Add(this.label1);
this.Controls.Add(this.RecipeStateChangeButton);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.ClosePageButton);
this.Controls.Add(this.UserControlTabs);
@ -443,5 +479,8 @@ namespace HighWayIot.Winform.MainForm
private ToolStripMenuItem rToolStripMenuItem;
private ToolStripMenuItem rFIDToolStripMenuItem;
private ToolStripMenuItem ToolStripMenuItem1;
private Button RecipeStateChangeButton;
private Label label1;
private Label ModeSelectLabel;
}
}

@ -377,5 +377,25 @@ namespace HighWayIot.Winform.MainForm
// MoldingMachineWatchDog = 2;
//}
}
/// <summary>
/// 配方下传方式转换
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void RecipeStateChangeButton_Click(object sender, EventArgs e)
{
RecipeSendBusiness.RecipeSendMode = !RecipeSendBusiness.RecipeSendMode;
if (RecipeSendBusiness.RecipeSendMode)
{
ModeSelectLabel.Text = "自动";
ModeSelectLabel.BackColor = Color.FromArgb(100, 128, 255, 128);
}
else
{
ModeSelectLabel.Text = "手动";
ModeSelectLabel.BackColor = Color.FromArgb(100, 255, 255, 128);
}
}
}
}

@ -28,8 +28,8 @@ namespace HighWayIot.Winform.UserControlPages
private void Init()
{
LogDataGridView.AutoGenerateColumns = false;
Lists = sysErrorLogService.GetErrorLogInfos();
SelectLogBeginTime.Value = DateTime.Now.AddMonths(-3);
Lists = sysErrorLogService.GetErrorLogInfos(x => x.LogTime >= SelectLogBeginTime.Value && x.LogTime <= SelectLogEndTime.Value);
LogDataGridView.DataSource = null;
LogDataGridView.DataSource = Lists;

@ -31,18 +31,8 @@ namespace HighWayIot.Winform.UserControlPages
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.ReportDataGridView = 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.RawTireWeight = 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.ButtonPanel = new System.Windows.Forms.Panel();
this.ExportTableButton = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
@ -56,6 +46,20 @@ 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.label5 = new System.Windows.Forms.Label();
this.DataCountLabel = new System.Windows.Forms.Label();
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.RawTireWeight = 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.RepeatWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.ReportDataGridView)).BeginInit();
this.ButtonPanel.SuspendLayout();
this.SuspendLayout();
@ -67,6 +71,14 @@ namespace HighWayIot.Winform.UserControlPages
this.ReportDataGridView.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)));
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, 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.ReportDataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.ReportDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.ReportDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.No,
@ -79,7 +91,8 @@ namespace HighWayIot.Winform.UserControlPages
this.RawTireWeight,
this.BaseRubTimeSpan,
this.MidRubTimeSpan,
this.FaceRubTimeSpan});
this.FaceRubTimeSpan,
this.RepeatWeight});
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";
@ -89,101 +102,12 @@ namespace HighWayIot.Winform.UserControlPages
this.ReportDataGridView.Size = new System.Drawing.Size(1639, 868);
this.ReportDataGridView.TabIndex = 7;
//
// No
//
this.No.DataPropertyName = "No";
this.No.HeaderText = "ID";
this.No.Name = "No";
this.No.ReadOnly = true;
this.No.Width = 50;
//
// VulcanizationNo
//
this.VulcanizationNo.DataPropertyName = "VulcanizationNo";
this.VulcanizationNo.HeaderText = "机位";
this.VulcanizationNo.Name = "VulcanizationNo";
this.VulcanizationNo.ReadOnly = true;
this.VulcanizationNo.Width = 70;
//
// StartTime
//
this.StartTime.DataPropertyName = "StartTime";
this.StartTime.HeaderText = "开始时间";
this.StartTime.Name = "StartTime";
this.StartTime.ReadOnly = true;
this.StartTime.Width = 150;
//
// RecipeCode
//
this.RecipeCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.RecipeCode.DataPropertyName = "RecipeCode";
this.RecipeCode.FillWeight = 30F;
this.RecipeCode.HeaderText = "成品代号";
this.RecipeCode.Name = "RecipeCode";
this.RecipeCode.ReadOnly = true;
//
// RecipeName
//
this.RecipeName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.RecipeName.DataPropertyName = "RecipeName";
this.RecipeName.FillWeight = 70F;
this.RecipeName.HeaderText = "标称尺度";
this.RecipeName.Name = "RecipeName";
this.RecipeName.ReadOnly = true;
//
// SpecCode
//
this.SpecCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.SpecCode.DataPropertyName = "SpecCode";
this.SpecCode.FillWeight = 30F;
this.SpecCode.HeaderText = "Spec编号";
this.SpecCode.Name = "SpecCode";
this.SpecCode.ReadOnly = true;
//
// DeviceNo
//
this.DeviceNo.DataPropertyName = "DeviceNo";
this.DeviceNo.HeaderText = "小车编号";
this.DeviceNo.Name = "DeviceNo";
this.DeviceNo.ReadOnly = true;
this.DeviceNo.Width = 80;
//
// RawTireWeight
//
this.RawTireWeight.DataPropertyName = "RawTireWeight";
this.RawTireWeight.HeaderText = "生胎重量";
this.RawTireWeight.Name = "RawTireWeight";
this.RawTireWeight.ReadOnly = true;
this.RawTireWeight.Width = 80;
//
// BaseRubTimeSpan
//
this.BaseRubTimeSpan.DataPropertyName = "BaseRubTimeSpan";
this.BaseRubTimeSpan.HeaderText = "基部胶完成时间";
this.BaseRubTimeSpan.Name = "BaseRubTimeSpan";
this.BaseRubTimeSpan.ReadOnly = true;
this.BaseRubTimeSpan.Width = 140;
//
// MidRubTimeSpan
//
this.MidRubTimeSpan.DataPropertyName = "MidRubTimeSpan";
this.MidRubTimeSpan.HeaderText = "中层胶完成时间";
this.MidRubTimeSpan.Name = "MidRubTimeSpan";
this.MidRubTimeSpan.ReadOnly = true;
this.MidRubTimeSpan.Width = 150;
//
// FaceRubTimeSpan
//
this.FaceRubTimeSpan.DataPropertyName = "FaceRubTimeSpan";
this.FaceRubTimeSpan.HeaderText = "生胎完成时间";
this.FaceRubTimeSpan.Name = "FaceRubTimeSpan";
this.FaceRubTimeSpan.ReadOnly = true;
this.FaceRubTimeSpan.Width = 140;
//
// 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.DataCountLabel);
this.ButtonPanel.Controls.Add(this.label5);
this.ButtonPanel.Controls.Add(this.ExportTableButton);
this.ButtonPanel.Controls.Add(this.label6);
this.ButtonPanel.Controls.Add(this.VulcanizationNoCombobox);
@ -313,6 +237,123 @@ namespace HighWayIot.Winform.UserControlPages
this.SelectReport.UseVisualStyleBackColor = true;
this.SelectReport.Click += new System.EventHandler(this.SelectReport_Click);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(771, 38);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(65, 12);
this.label5.TabIndex = 28;
this.label5.Text = "数据条目:";
//
// DataCountLabel
//
this.DataCountLabel.AutoSize = true;
this.DataCountLabel.Location = new System.Drawing.Point(842, 38);
this.DataCountLabel.Name = "DataCountLabel";
this.DataCountLabel.Size = new System.Drawing.Size(23, 12);
this.DataCountLabel.TabIndex = 29;
this.DataCountLabel.Text = "N/A";
//
// No
//
this.No.DataPropertyName = "No";
this.No.HeaderText = "ID";
this.No.Name = "No";
this.No.ReadOnly = true;
this.No.Width = 50;
//
// VulcanizationNo
//
this.VulcanizationNo.DataPropertyName = "VulcanizationNo";
this.VulcanizationNo.HeaderText = "机位";
this.VulcanizationNo.Name = "VulcanizationNo";
this.VulcanizationNo.ReadOnly = true;
this.VulcanizationNo.Width = 70;
//
// StartTime
//
this.StartTime.DataPropertyName = "StartTime";
this.StartTime.HeaderText = "开始时间";
this.StartTime.Name = "StartTime";
this.StartTime.ReadOnly = true;
this.StartTime.Width = 150;
//
// RecipeCode
//
this.RecipeCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.RecipeCode.DataPropertyName = "RecipeCode";
this.RecipeCode.FillWeight = 30F;
this.RecipeCode.HeaderText = "成品代号";
this.RecipeCode.Name = "RecipeCode";
this.RecipeCode.ReadOnly = true;
//
// RecipeName
//
this.RecipeName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.RecipeName.DataPropertyName = "RecipeName";
this.RecipeName.FillWeight = 70F;
this.RecipeName.HeaderText = "标称尺度";
this.RecipeName.Name = "RecipeName";
this.RecipeName.ReadOnly = true;
//
// SpecCode
//
this.SpecCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.SpecCode.DataPropertyName = "SpecCode";
this.SpecCode.FillWeight = 30F;
this.SpecCode.HeaderText = "Spec编号";
this.SpecCode.Name = "SpecCode";
this.SpecCode.ReadOnly = true;
//
// DeviceNo
//
this.DeviceNo.DataPropertyName = "DeviceNo";
this.DeviceNo.HeaderText = "小车编号";
this.DeviceNo.Name = "DeviceNo";
this.DeviceNo.ReadOnly = true;
this.DeviceNo.Width = 80;
//
// RawTireWeight
//
this.RawTireWeight.DataPropertyName = "RawTireWeight";
this.RawTireWeight.HeaderText = "生胎重量";
this.RawTireWeight.Name = "RawTireWeight";
this.RawTireWeight.ReadOnly = true;
this.RawTireWeight.Width = 80;
//
// BaseRubTimeSpan
//
this.BaseRubTimeSpan.DataPropertyName = "BaseRubTimeSpan";
this.BaseRubTimeSpan.HeaderText = "基部胶完成时间";
this.BaseRubTimeSpan.Name = "BaseRubTimeSpan";
this.BaseRubTimeSpan.ReadOnly = true;
this.BaseRubTimeSpan.Width = 140;
//
// MidRubTimeSpan
//
this.MidRubTimeSpan.DataPropertyName = "MidRubTimeSpan";
this.MidRubTimeSpan.HeaderText = "中层胶完成时间";
this.MidRubTimeSpan.Name = "MidRubTimeSpan";
this.MidRubTimeSpan.ReadOnly = true;
this.MidRubTimeSpan.Width = 150;
//
// FaceRubTimeSpan
//
this.FaceRubTimeSpan.DataPropertyName = "FaceRubTimeSpan";
this.FaceRubTimeSpan.HeaderText = "生胎完成时间";
this.FaceRubTimeSpan.Name = "FaceRubTimeSpan";
this.FaceRubTimeSpan.ReadOnly = true;
this.FaceRubTimeSpan.Width = 140;
//
// RepeatWeight
//
this.RepeatWeight.DataPropertyName = "RepeatWeight";
this.RepeatWeight.HeaderText = "复重重量";
this.RepeatWeight.Name = "RepeatWeight";
this.RepeatWeight.ReadOnly = true;
this.RepeatWeight.Width = 80;
//
// DailyReportPage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -345,6 +386,9 @@ namespace HighWayIot.Winform.UserControlPages
private ComboBox RecipeCodeCombobox;
private Label label6;
private ComboBox VulcanizationNoCombobox;
private Button ExportTableButton;
private Label DataCountLabel;
private Label label5;
private DataGridViewTextBoxColumn No;
private DataGridViewTextBoxColumn VulcanizationNo;
private DataGridViewTextBoxColumn StartTime;
@ -356,6 +400,6 @@ namespace HighWayIot.Winform.UserControlPages
private DataGridViewTextBoxColumn BaseRubTimeSpan;
private DataGridViewTextBoxColumn MidRubTimeSpan;
private DataGridViewTextBoxColumn FaceRubTimeSpan;
private Button ExportTableButton;
private DataGridViewTextBoxColumn RepeatWeight;
}
}

@ -88,7 +88,8 @@ 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));
&& (string.IsNullOrEmpty(DeviceNoCombobox.Text) || x.DeviceNo.ToString() == DeviceNoCombobox.Text)
&& x.IsDone == 1);
_monitorDataSources.Clear();
@ -102,13 +103,30 @@ namespace HighWayIot.Winform.UserControlPages
RecipeName = dailyEntities[i].RecipeName,
RecipeCode = dailyEntities[i].RecipeCode,
SpecCode = dailyEntities[i].SpecCode,
DeviceNo = dailyEntities[i].DeviceNo,
DeviceNo = dailyEntities[i].DeviceNo.ToString(),
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),
});
}
List<string> ds1 = new List<string>() { "" };
ds1.AddRange(_monitorDataSources.Select(x => x.VulcanizationNo).ToList());
VulcanizationNoCombobox.DataSource = ds1;
VulcanizationNoCombobox.SelectedIndex = 0;
List<string> ds2 = new List<string>() { "" };
ds2.AddRange(_monitorDataSources.Select(x => x.DeviceNo).ToList());
DeviceNoCombobox.DataSource = ds2;
DeviceNoCombobox.SelectedIndex = 0;
List<string> ds3 = new List<string>() { "" };
ds3.AddRange(_monitorDataSources.Select(x => x.RecipeCode).ToList());
RecipeCodeCombobox.DataSource = ds3;
RecipeCodeCombobox.SelectedIndex = 0;
DataCountLabel.Text = _monitorDataSources.Count.ToString();
}
/// <summary>

@ -150,4 +150,7 @@
<metadata name="FaceRubTimeSpan.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>
</root>

@ -101,11 +101,11 @@
this.RepeatWeight});
this.dataGridView1.Cursor = System.Windows.Forms.Cursors.IBeam;
this.dataGridView1.EnableHeadersVisualStyles = false;
this.dataGridView1.Location = new System.Drawing.Point(-238, 193);
this.dataGridView1.Location = new System.Drawing.Point(0, 50);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowHeadersVisible = false;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(1904, 985);
this.dataGridView1.Size = new System.Drawing.Size(1904, 991);
this.dataGridView1.TabIndex = 0;
//
// RecipeCode
@ -352,6 +352,7 @@
this.Name = "ExportPreviewForm";
this.Text = "导出预览";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ExportPreviewForm_FormClosing);
this.Load += new System.EventHandler(this.ExportPreviewForm_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

@ -80,7 +80,7 @@ namespace HighWayIot.Winform.UserControlPages.LogPages
{
exportTableEntity.BaseRubName = baseWeight.MaterialName;
exportTableEntity.BaseRubThickness = baseWeight.SetThickness.ToString();
//基部胶宽度和层数(可能有
//基部胶宽度和层数(可能有
if (baseWeight.SetLayer2 == 0 || baseWeight.SetLayer2 == null)
{
exportTableEntity.BaseRubWidth = baseWeight.SetWidth.ToString();
@ -308,5 +308,10 @@ namespace HighWayIot.Winform.UserControlPages.LogPages
return dataTable;
}
private void ExportPreviewForm_Load(object sender, EventArgs e)
{
}
}
}

@ -29,7 +29,7 @@ namespace HighWayIot.Winform.UserControlPages
{
LogDataGridView.AutoGenerateColumns = false;
SelectLogBeginTime.Value = DateTime.Now.AddMonths(-3);
Lists = sysLogService.GetLogInfos();
Lists = sysLogService.GetLogInfos(x => x.LogTime >= SelectLogBeginTime.Value && x.LogTime <= SelectLogEndTime.Value);
LogDataGridView.DataSource = null;
LogDataGridView.DataSource = Lists;
}

@ -44,14 +44,16 @@ namespace HighWayIot.Winform.UserControlPages
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
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();
this.panel1 = new System.Windows.Forms.Panel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.panel3 = new System.Windows.Forms.Panel();
this.label9 = new System.Windows.Forms.Label();
this.RgvNoLabel = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.RawTireWeightLabel = new System.Windows.Forms.Label();
this.SpecNameLabel = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
@ -67,7 +69,7 @@ namespace HighWayIot.Winform.UserControlPages
this.label12 = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.SpecCodeLabel = new System.Windows.Forms.Label();
this.SpecNameLabel = 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();
@ -86,6 +88,8 @@ namespace HighWayIot.Winform.UserControlPages
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.panel1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
@ -142,10 +146,10 @@ namespace HighWayIot.Winform.UserControlPages
// panel3
//
this.panel3.BackColor = System.Drawing.SystemColors.ButtonShadow;
this.panel3.Controls.Add(this.label9);
this.panel3.Controls.Add(this.RgvNoLabel);
this.panel3.Controls.Add(this.label10);
this.panel3.Controls.Add(this.label5);
this.panel3.Controls.Add(this.label6);
this.panel3.Controls.Add(this.RawTireWeightLabel);
this.panel3.Controls.Add(this.SpecNameLabel);
this.panel3.Controls.Add(this.label7);
this.panel3.Controls.Add(this.label8);
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
@ -155,16 +159,16 @@ namespace HighWayIot.Winform.UserControlPages
this.panel3.Size = new System.Drawing.Size(953, 138);
this.panel3.TabIndex = 3;
//
// label9
// RgvNoLabel
//
this.label9.AutoSize = true;
this.label9.Font = new System.Drawing.Font("微软雅黑", 18F);
this.label9.ForeColor = System.Drawing.Color.Khaki;
this.label9.Location = new System.Drawing.Point(480, 74);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(61, 31);
this.label9.TabIndex = 11;
this.label9.Text = "N/A";
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(480, 74);
this.RgvNoLabel.Name = "RgvNoLabel";
this.RgvNoLabel.Size = new System.Drawing.Size(61, 31);
this.RgvNoLabel.TabIndex = 11;
this.RgvNoLabel.Text = "N/A";
//
// label10
//
@ -177,27 +181,27 @@ namespace HighWayIot.Winform.UserControlPages
this.label10.TabIndex = 10;
this.label10.Text = "小车号:";
//
// label5
// RawTireWeightLabel
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("微软雅黑", 18F);
this.label5.ForeColor = System.Drawing.Color.Khaki;
this.label5.Location = new System.Drawing.Point(212, 74);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(61, 31);
this.label5.TabIndex = 9;
this.label5.Text = "N/A";
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(212, 74);
this.RawTireWeightLabel.Name = "RawTireWeightLabel";
this.RawTireWeightLabel.Size = new System.Drawing.Size(61, 31);
this.RawTireWeightLabel.TabIndex = 9;
this.RawTireWeightLabel.Text = "N/A";
//
// label6
// SpecNameLabel
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("微软雅黑", 18F);
this.label6.ForeColor = System.Drawing.Color.Khaki;
this.label6.Location = new System.Drawing.Point(181, 28);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(61, 31);
this.label6.TabIndex = 8;
this.label6.Text = "N/A";
this.SpecNameLabel.AutoSize = true;
this.SpecNameLabel.Font = new System.Drawing.Font("微软雅黑", 18F);
this.SpecNameLabel.ForeColor = System.Drawing.Color.Khaki;
this.SpecNameLabel.Location = new System.Drawing.Point(181, 28);
this.SpecNameLabel.Name = "SpecNameLabel";
this.SpecNameLabel.Size = new System.Drawing.Size(61, 31);
this.SpecNameLabel.TabIndex = 8;
this.SpecNameLabel.Text = "N/A";
//
// label7
//
@ -351,7 +355,7 @@ namespace HighWayIot.Winform.UserControlPages
//
this.panel2.BackColor = System.Drawing.Color.Gray;
this.panel2.Controls.Add(this.SpecCodeLabel);
this.panel2.Controls.Add(this.SpecNameLabel);
this.panel2.Controls.Add(this.RecipeNameLabel);
this.panel2.Controls.Add(this.RecipeCodeLabel);
this.panel2.Controls.Add(this.label4);
this.panel2.Controls.Add(this.label3);
@ -375,16 +379,16 @@ namespace HighWayIot.Winform.UserControlPages
this.SpecCodeLabel.TabIndex = 6;
this.SpecCodeLabel.Text = "N/A";
//
// SpecNameLabel
// RecipeNameLabel
//
this.SpecNameLabel.AutoSize = true;
this.SpecNameLabel.Font = new System.Drawing.Font("微软雅黑", 18F);
this.SpecNameLabel.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
this.SpecNameLabel.Location = new System.Drawing.Point(181, 105);
this.SpecNameLabel.Name = "SpecNameLabel";
this.SpecNameLabel.Size = new System.Drawing.Size(61, 31);
this.SpecNameLabel.TabIndex = 5;
this.SpecNameLabel.Text = "N/A";
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(181, 105);
this.RecipeNameLabel.Name = "RecipeNameLabel";
this.RecipeNameLabel.Size = new System.Drawing.Size(61, 31);
this.RecipeNameLabel.TabIndex = 5;
this.RecipeNameLabel.Text = "N/A";
//
// RecipeCodeLabel
//
@ -435,13 +439,13 @@ namespace HighWayIot.Winform.UserControlPages
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 15F);
this.label1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.ForeColor = System.Drawing.Color.Cyan;
this.label1.Location = new System.Drawing.Point(333, 14);
this.label1.Location = new System.Drawing.Point(417, 18);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(129, 20);
this.label1.Size = new System.Drawing.Size(114, 20);
this.label1.TabIndex = 0;
this.label1.Text = "运行中的计划";
this.label1.Text = "新下发计划";
//
// MonitorDataGridView
//
@ -459,7 +463,7 @@ namespace HighWayIot.Winform.UserControlPages
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
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[] {
@ -473,7 +477,9 @@ namespace HighWayIot.Winform.UserControlPages
this.TireWeight,
this.BaseRubFinishTime,
this.MidRubFinishTime,
this.RowTireFinishTime});
this.RowTireFinishTime,
this.RepeatWeight,
this.IsDone});
this.MonitorDataGridView.Location = new System.Drawing.Point(0, 231);
this.MonitorDataGridView.Margin = new System.Windows.Forms.Padding(0);
this.MonitorDataGridView.MultiSelect = false;
@ -498,7 +504,7 @@ namespace HighWayIot.Winform.UserControlPages
this.No.HeaderText = "序号";
this.No.Name = "No";
this.No.ReadOnly = true;
this.No.Width = 79;
this.No.Width = 60;
//
// VulcanizationNo
//
@ -527,7 +533,7 @@ namespace HighWayIot.Winform.UserControlPages
this.RecipeCode.HeaderText = "成品代号";
this.RecipeCode.Name = "RecipeCode";
this.RecipeCode.ReadOnly = true;
this.RecipeCode.Width = 220;
this.RecipeCode.Width = 180;
//
// RecipeName
//
@ -547,7 +553,7 @@ namespace HighWayIot.Winform.UserControlPages
this.SpecCode.HeaderText = "SPEC编号";
this.SpecCode.Name = "SpecCode";
this.SpecCode.ReadOnly = true;
this.SpecCode.Width = 200;
this.SpecCode.Width = 140;
//
// DeviceNo
//
@ -557,16 +563,16 @@ namespace HighWayIot.Winform.UserControlPages
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.HeaderText = "胎重量";
this.TireWeight.Name = "TireWeight";
this.TireWeight.ReadOnly = true;
this.TireWeight.Width = 120;
//
// BaseRubFinishTime
//
@ -576,7 +582,7 @@ namespace HighWayIot.Winform.UserControlPages
this.BaseRubFinishTime.HeaderText = "基部胶完成时间";
this.BaseRubFinishTime.Name = "BaseRubFinishTime";
this.BaseRubFinishTime.ReadOnly = true;
this.BaseRubFinishTime.Width = 179;
this.BaseRubFinishTime.Width = 162;
//
// MidRubFinishTime
//
@ -586,7 +592,7 @@ namespace HighWayIot.Winform.UserControlPages
this.MidRubFinishTime.HeaderText = "中层胶完成时间";
this.MidRubFinishTime.Name = "MidRubFinishTime";
this.MidRubFinishTime.ReadOnly = true;
this.MidRubFinishTime.Width = 179;
this.MidRubFinishTime.Width = 162;
//
// RowTireFinishTime
//
@ -596,7 +602,26 @@ namespace HighWayIot.Winform.UserControlPages
this.RowTireFinishTime.HeaderText = "生胎完成时间";
this.RowTireFinishTime.Name = "RowTireFinishTime";
this.RowTireFinishTime.ReadOnly = true;
this.RowTireFinishTime.Width = 160;
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;
//
// MonitorMainPage
//
@ -641,15 +666,15 @@ namespace HighWayIot.Winform.UserControlPages
private Label label1;
private Label label2;
private Label SpecCodeLabel;
private Label SpecNameLabel;
private Label RecipeNameLabel;
private Label RecipeCodeLabel;
private Label label4;
private Label label3;
private Label label5;
private Label label6;
private Label RawTireWeightLabel;
private Label SpecNameLabel;
private Label label7;
private Label label8;
private Label label9;
private Label RgvNoLabel;
private Label label10;
private Label DayTimeLabel;
private Label label12;
@ -671,5 +696,7 @@ namespace HighWayIot.Winform.UserControlPages
private DataGridViewTextBoxColumn BaseRubFinishTime;
private DataGridViewTextBoxColumn MidRubFinishTime;
private DataGridViewTextBoxColumn RowTireFinishTime;
private DataGridViewTextBoxColumn RepeatWeight;
private DataGridViewTextBoxColumn IsDone;
}
}

@ -2,6 +2,7 @@
using HighWayIot.Repository.domain;
using HighWayIot.Repository.service;
using HighWayIot.Winform.Business;
using Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -35,6 +36,8 @@ namespace HighWayIot.Winform.UserControlPages
/// </summary>
private BindingList<MonitorDataSource> _monitorDataSources = new BindingList<MonitorDataSource>();
public static Action MonitorRefreshAction;
public MonitorMainPage()
{
InitializeComponent();
@ -45,6 +48,9 @@ namespace HighWayIot.Winform.UserControlPages
MonitorDataGridView.DataSource = null;
MonitorDataGridView.DataSource = _monitorDataSources;
MonitorRefreshAction += BindData;
MonitorRefreshAction.Invoke();
}
/// <summary>
@ -58,7 +64,6 @@ namespace HighWayIot.Winform.UserControlPages
{
DateTimeRefresh();
}
BindData();
}
/// <summary>
@ -90,7 +95,7 @@ namespace HighWayIot.Winform.UserControlPages
/// </summary>
private void BindData()
{
List<ZxDailyReportEntity> dailyEntity = _zxDailyReportService.Get25DailyReportInfos();
List<ZxDailyReportEntity> dailyEntity = _zxDailyReportService.Get30DailyReportInfos();
_monitorDataSources.Clear();
for(int i = 0; i < dailyEntity.Count; i++)
{
@ -102,14 +107,32 @@ namespace HighWayIot.Winform.UserControlPages
RecipeName = dailyEntity[i].RecipeName,
RecipeCode = dailyEntity[i].RecipeCode,
SpecCode = dailyEntity[i].SpecCode,
DeviceNo = dailyEntity[i].DeviceNo,
DeviceNo = dailyEntity[i].DeviceNo.ToString(),
RawTireWeight = dailyEntity[i].RawTireWeight ?? 0,
BaseRubTimeSpan = GeneralUtils.DateTimeToString(dailyEntity[i].StartTime, dailyEntity[i].BaseEndTime),
MidRubTimeSpan = GeneralUtils.DateTimeToString(dailyEntity[i].StartTime, dailyEntity[i].MidEndTime),
FaceRubTimeSpan = GeneralUtils.DateTimeToString(dailyEntity[i].StartTime, dailyEntity[i].FaceEndTime),
RepeatWeight = dailyEntity[i].RepeatWeight,
IsDone = dailyEntity[i].IsDone == 1 ? "已完成" : "未完成"
});
}
ZxDailyReportEntity first = dailyEntity.FirstOrDefault();
RecipeCodeLabel.Text = first.RecipeCode;
SpecCodeLabel.Text = first.SpecCode;
RecipeNameLabel.Text = first.RecipeName;
ZxRecipeEntity recipeEntity = ZxRecipeService.Instance.GetRecipeInfosByRecipeCode(first.RecipeCode).FirstOrDefault();
if (recipeEntity != null)
{
SpecNameLabel.Text = recipeEntity.RecipeName;
ZxRecipeParaEntity paraEntity = ZxRecipeParaService.Instance.GetRecipeParaInfoByRecipeCode(recipeEntity.RecipeCode).FirstOrDefault();
if (paraEntity != null)
{
RawTireWeightLabel.Text = paraEntity.TireWeight.ToString();
}
}
RgvNoLabel.Text = first.DeviceNo.ToString();
}
}
}

@ -150,6 +150,12 @@
<metadata name="RowTireFinishTime.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>
<metadata name="DataRefresh.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>

@ -37,6 +37,7 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
this.SchedulingDataGridView = new System.Windows.Forms.DataGridView();
this.SelectConfigButton = new System.Windows.Forms.Button();
this.ButtonPanel = new System.Windows.Forms.Panel();
@ -56,6 +57,14 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
this.SchedulingDataGridView.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)));
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, 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.SchedulingDataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.SchedulingDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.SchedulingDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Id,
@ -112,8 +121,8 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
// Id
//
this.Id.DataPropertyName = "Id";
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Id.DefaultCellStyle = dataGridViewCellStyle1;
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Id.DefaultCellStyle = dataGridViewCellStyle2;
this.Id.HeaderText = "ID";
this.Id.Name = "Id";
this.Id.ReadOnly = true;
@ -123,8 +132,8 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
// DeviceNo
//
this.DeviceNo.DataPropertyName = "DeviceNo";
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.DeviceNo.DefaultCellStyle = dataGridViewCellStyle2;
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.DeviceNo.DefaultCellStyle = dataGridViewCellStyle3;
this.DeviceNo.HeaderText = "机台编号";
this.DeviceNo.Name = "DeviceNo";
this.DeviceNo.ReadOnly = true;
@ -133,9 +142,9 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
// RecipeCode2
//
this.RecipeCode2.DataPropertyName = "RecipeCode2";
dataGridViewCellStyle3.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.RecipeCode2.DefaultCellStyle = dataGridViewCellStyle3;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.RecipeCode2.DefaultCellStyle = dataGridViewCellStyle4;
this.RecipeCode2.HeaderText = "成品代号 - 上模";
this.RecipeCode2.Name = "RecipeCode2";
this.RecipeCode2.ReadOnly = true;
@ -147,8 +156,8 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
//
this.RecipeName2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.RecipeName2.DataPropertyName = "RecipeName2";
dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.RecipeName2.DefaultCellStyle = dataGridViewCellStyle4;
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.RecipeName2.DefaultCellStyle = dataGridViewCellStyle5;
this.RecipeName2.HeaderText = "标称尺度 - 上模";
this.RecipeName2.Name = "RecipeName2";
this.RecipeName2.Resizable = System.Windows.Forms.DataGridViewTriState.False;
@ -156,12 +165,12 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
// RecipeCode1
//
this.RecipeCode1.DataPropertyName = "RecipeCode1";
dataGridViewCellStyle5.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle5.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.White;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.Black;
this.RecipeCode1.DefaultCellStyle = dataGridViewCellStyle5;
dataGridViewCellStyle6.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle6.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.White;
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.Black;
this.RecipeCode1.DefaultCellStyle = dataGridViewCellStyle6;
this.RecipeCode1.HeaderText = "成品代号 - 下模";
this.RecipeCode1.Name = "RecipeCode1";
this.RecipeCode1.ReadOnly = true;
@ -172,8 +181,8 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
//
this.RecipeName1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.RecipeName1.DataPropertyName = "RecipeName1";
dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.RecipeName1.DefaultCellStyle = dataGridViewCellStyle6;
dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.RecipeName1.DefaultCellStyle = dataGridViewCellStyle7;
this.RecipeName1.HeaderText = "标称尺度 - 下模";
this.RecipeName1.Name = "RecipeName1";
this.RecipeName1.Resizable = System.Windows.Forms.DataGridViewTriState.False;

@ -1,6 +1,7 @@
using HighWayIot.Log4net;
using HighWayIot.Repository.service;
using HighWayIot.Winform.Business;
using HighWayIot.Winform.MainForm;
using Models;
using System;
using System.Collections.Generic;
@ -149,18 +150,20 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
int column = SchedulingDataGridView.CurrentCell.ColumnIndex;
string DeviceNo = SchedulingDataGridView.Rows[row].Cells[1].Value.ToString();
if(column == 5)
if (column == 5)
{
ZxRecipeEntity recipe = zxRecipeService.GetSingleInfoByRecipeName(combox.Text);
if (recipe == null)
{
MessageBox.Show("存在多个相同的标称尺度或不存在,请检查并维护配方,重启排程界面");
BaseForm.LogRefreshAction.Invoke($"{combox.Text}存在多个相同的配方或不存在,请检查并维护配方,重启排程界面");
zxSchedulingEntity[row].RecipeCode1 = string.Empty;
}
else
{
zxSchedulingEntity[row].RecipeCode1 = recipe.RecipeCode;
SqlLogHelper.AddLog($"排程信息操作 机台[{DeviceNo}下模] 配方更改为[{recipe.RecipeCode}]");
//DataGridViewComboBoxCell cb = SchedulingDataGridView.Rows[row].Cells[column + 1] as DataGridViewComboBoxCell;
//cb.DataSource = zxRecipeService.
}
}
@ -169,7 +172,7 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
ZxRecipeEntity recipe = zxRecipeService.GetSingleInfoByRecipeName(combox.Text);
if (recipe == null)
{
MessageBox.Show("存在多个相同的标称尺度或不存在,请检查并维护配方,重启排程界面");
BaseForm.LogRefreshAction.Invoke($"{combox.Text}存在多个相同的配方或不存在,请检查并维护配方,重启排程界面");
zxSchedulingEntity[row].RecipeCode2 = string.Empty;
}
else

@ -62,7 +62,7 @@
//
// ConfrimAddButton
//
this.ConfrimAddButton.Location = new System.Drawing.Point(241, 125);
this.ConfrimAddButton.Location = new System.Drawing.Point(241, 112);
this.ConfrimAddButton.Name = "ConfrimAddButton";
this.ConfrimAddButton.Size = new System.Drawing.Size(110, 41);
this.ConfrimAddButton.TabIndex = 20;
@ -200,12 +200,13 @@
this.WeightErrorTextBox.Size = new System.Drawing.Size(83, 21);
this.WeightErrorTextBox.TabIndex = 33;
this.WeightErrorTextBox.Text = "1";
this.WeightErrorTextBox.TextChanged += new System.EventHandler(this.WeightErrorTextBox_TextChanged);
//
// AddRecipeForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(601, 188);
this.ClientSize = new System.Drawing.Size(601, 172);
this.Controls.Add(this.label9);
this.Controls.Add(this.WeightErrorTextBox);
this.Controls.Add(this.label8);

@ -56,6 +56,7 @@ namespace HighWayIot.Winform.UserControlPages.RecipeConfigPages
RecipeName = RecipeNameTextBox.Text.Trim(),
RecipeSpecCode = SpecCodeTextBox.Text.Trim(),
RecipeSpecName = SpecNameTextBox.Text.Trim(),
//BatchCode = SPECBatchCodeTextBox.Text.Trim(),
IsDeleted = false,
IsUse = IsUseCheckBox.Checked,
};
@ -65,13 +66,13 @@ namespace HighWayIot.Winform.UserControlPages.RecipeConfigPages
return;
}
zxRecipeEntity.SizeKind = sizeKind;
if (!decimal.TryParse(FixedWidthTextBox.Text.Trim(), out decimal fixedWidth))
if (!int.TryParse(FixedWidthTextBox.Text.Trim(), out int fixedWidth))
{
MessageBox.Show("固定胶宽度请填入可带小数点的阿拉伯数字");
return;
}
zxRecipeEntity.FixedWidth = fixedWidth;
if (!int.TryParse(WeightErrorTextBox.Text.Trim(), out int weightError))
if (!float.TryParse(WeightErrorTextBox.Text.Trim(), out float weightError))
{
MessageBox.Show("重量公差请填入整数阿拉伯数字");
return;
@ -97,5 +98,15 @@ namespace HighWayIot.Winform.UserControlPages.RecipeConfigPages
{
this.DialogResult = DialogResult.OK;
}
private void label10_Click(object sender, EventArgs e)
{
}
private void WeightErrorTextBox_TextChanged(object sender, EventArgs e)
{
}
}
}

@ -205,31 +205,34 @@
//
// SetWidthTextBox
//
this.SetWidthTextBox.Location = new System.Drawing.Point(272, 145);
this.SetWidthTextBox.Location = new System.Drawing.Point(278, 202);
this.SetWidthTextBox.Name = "SetWidthTextBox";
this.SetWidthTextBox.Size = new System.Drawing.Size(123, 21);
this.SetWidthTextBox.Size = new System.Drawing.Size(121, 21);
this.SetWidthTextBox.TabIndex = 16;
this.SetWidthTextBox.TextChanged += new System.EventHandler(this.SetWidthTextBox_TextChanged);
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(225, 149);
this.label7.Location = new System.Drawing.Point(233, 206);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(47, 12);
this.label7.TabIndex = 15;
this.label7.Text = "宽度1";
this.label7.Click += new System.EventHandler(this.label7_Click);
//
// SetLayerTextBox
//
this.SetLayerTextBox.Location = new System.Drawing.Point(450, 145);
this.SetLayerTextBox.Location = new System.Drawing.Point(459, 203);
this.SetLayerTextBox.Name = "SetLayerTextBox";
this.SetLayerTextBox.Size = new System.Drawing.Size(123, 21);
this.SetLayerTextBox.Size = new System.Drawing.Size(121, 21);
this.SetLayerTextBox.TabIndex = 18;
this.SetLayerTextBox.TextChanged += new System.EventHandler(this.SetLayerTextBox_TextChanged);
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(403, 149);
this.label8.Location = new System.Drawing.Point(415, 206);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(47, 12);
this.label8.TabIndex = 17;
@ -298,15 +301,16 @@
//
// SetLayerTextBox2
//
this.SetLayerTextBox2.Location = new System.Drawing.Point(450, 172);
this.SetLayerTextBox2.Location = new System.Drawing.Point(459, 149);
this.SetLayerTextBox2.Name = "SetLayerTextBox2";
this.SetLayerTextBox2.Size = new System.Drawing.Size(123, 21);
this.SetLayerTextBox2.Size = new System.Drawing.Size(121, 21);
this.SetLayerTextBox2.TabIndex = 28;
this.SetLayerTextBox2.TextChanged += new System.EventHandler(this.SetLayerTextBox2_TextChanged);
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(403, 176);
this.label12.Location = new System.Drawing.Point(415, 153);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(47, 12);
this.label12.TabIndex = 27;
@ -314,15 +318,16 @@
//
// SetWidthTextBox2
//
this.SetWidthTextBox2.Location = new System.Drawing.Point(272, 172);
this.SetWidthTextBox2.Location = new System.Drawing.Point(278, 148);
this.SetWidthTextBox2.Name = "SetWidthTextBox2";
this.SetWidthTextBox2.Size = new System.Drawing.Size(123, 21);
this.SetWidthTextBox2.Size = new System.Drawing.Size(121, 21);
this.SetWidthTextBox2.TabIndex = 26;
this.SetWidthTextBox2.TextChanged += new System.EventHandler(this.SetWidthTextBox2_TextChanged);
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(225, 176);
this.label13.Location = new System.Drawing.Point(233, 151);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(47, 12);
this.label13.TabIndex = 25;
@ -330,15 +335,16 @@
//
// SetLayerTextBox3
//
this.SetLayerTextBox3.Location = new System.Drawing.Point(450, 199);
this.SetLayerTextBox3.Location = new System.Drawing.Point(459, 176);
this.SetLayerTextBox3.Name = "SetLayerTextBox3";
this.SetLayerTextBox3.Size = new System.Drawing.Size(123, 21);
this.SetLayerTextBox3.Size = new System.Drawing.Size(121, 21);
this.SetLayerTextBox3.TabIndex = 32;
this.SetLayerTextBox3.TextChanged += new System.EventHandler(this.SetLayerTextBox3_TextChanged);
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(403, 203);
this.label14.Location = new System.Drawing.Point(415, 180);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(47, 12);
this.label14.TabIndex = 31;
@ -346,15 +352,16 @@
//
// SetWidthTextBox3
//
this.SetWidthTextBox3.Location = new System.Drawing.Point(272, 199);
this.SetWidthTextBox3.Location = new System.Drawing.Point(278, 175);
this.SetWidthTextBox3.Name = "SetWidthTextBox3";
this.SetWidthTextBox3.Size = new System.Drawing.Size(123, 21);
this.SetWidthTextBox3.Size = new System.Drawing.Size(121, 21);
this.SetWidthTextBox3.TabIndex = 30;
this.SetWidthTextBox3.TextChanged += new System.EventHandler(this.SetWidthTextBox3_TextChanged);
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(225, 203);
this.label15.Location = new System.Drawing.Point(233, 178);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(47, 12);
this.label15.TabIndex = 29;
@ -394,6 +401,7 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "添加成型信息";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AddWeightForm_FormClosing);
this.Load += new System.EventHandler(this.AddWeightForm_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);

@ -139,23 +139,23 @@ namespace HighWayIot.Winform.UserControlPages.RecipeConfigPages
}
zxWeightEntity.SetThickness = thickness;
if (!decimal.TryParse(SetWidthTextBox.Text.Trim(), out decimal width) && !string.IsNullOrEmpty(SetWidthTextBox.Text.Trim()))
if (!int.TryParse(SetWidthTextBox.Text.Trim(), out int width) && !string.IsNullOrEmpty(SetWidthTextBox.Text.Trim()))
{
MessageBox.Show("宽度请填入可带小数的阿拉伯数字");
MessageBox.Show("宽度请填入整数");
return;
}
zxWeightEntity.SetWidth = width;
if (!decimal.TryParse(SetWidthTextBox2.Text.Trim(), out decimal width2) && !string.IsNullOrEmpty(SetWidthTextBox2.Text.Trim()))
if (!int.TryParse(SetWidthTextBox2.Text.Trim(), out int width2) && !string.IsNullOrEmpty(SetWidthTextBox2.Text.Trim()))
{
MessageBox.Show("宽度请填入可带小数的阿拉伯数字");
MessageBox.Show("宽度请填入整数");
return;
}
zxWeightEntity.SetWidth2 = width2;
if (!decimal.TryParse(SetWidthTextBox3.Text.Trim(), out decimal width3) && !string.IsNullOrEmpty(SetWidthTextBox2.Text.Trim()))
if (!int.TryParse(SetWidthTextBox3.Text.Trim(), out int width3) && !string.IsNullOrEmpty(SetWidthTextBox3.Text.Trim()))
{
MessageBox.Show("宽度请填入可带小数的阿拉伯数字");
MessageBox.Show("宽度请填入整数");
return;
}
zxWeightEntity.SetWidth3 = width3;
@ -174,14 +174,14 @@ namespace HighWayIot.Winform.UserControlPages.RecipeConfigPages
}
zxWeightEntity.SetLayer2 = layer2;
if (!int.TryParse(SetLayerTextBox3.Text.Trim(), out int layer3) && !string.IsNullOrEmpty(SetLayerTextBox2.Text.Trim()))
if (!int.TryParse(SetLayerTextBox3.Text.Trim(), out int layer3) && !string.IsNullOrEmpty(SetLayerTextBox3.Text.Trim()))
{
MessageBox.Show("层数请填入整数阿拉伯数字");
return;
}
zxWeightEntity.SetLayer3 = layer3;
if (!decimal.TryParse(SetWeightTextBox.Text.Trim(), out decimal weight) && !string.IsNullOrEmpty(SetWeightTextBox.Text.Trim()))
if (!int.TryParse(SetWeightTextBox.Text.Trim(), out int weight) && !string.IsNullOrEmpty(SetWeightTextBox.Text.Trim()))
{
MessageBox.Show("重量请填入可带小数的阿拉伯数字");
return;
@ -334,5 +334,45 @@ namespace HighWayIot.Winform.UserControlPages.RecipeConfigPages
{
this.DialogResult = DialogResult.OK;
}
private void SetLayerTextBox2_TextChanged(object sender, EventArgs e)
{
}
private void SetWidthTextBox2_TextChanged(object sender, EventArgs e)
{
}
private void SetWidthTextBox_TextChanged(object sender, EventArgs e)
{
}
private void SetLayerTextBox3_TextChanged(object sender, EventArgs e)
{
}
private void SetWidthTextBox3_TextChanged(object sender, EventArgs e)
{
}
private void SetLayerTextBox_TextChanged(object sender, EventArgs e)
{
}
private void label7_Click(object sender, EventArgs e)
{
}
private void AddWeightForm_Load(object sender, EventArgs e)
{
}
}
}

@ -132,12 +132,6 @@
<metadata name="SetThickness.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SetWidth1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SetLayer1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SetWidth2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -150,15 +144,18 @@
<metadata name="SetLayer3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SetWidth1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SetLayer1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SetWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SetError.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="WeightIsUse.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -183,7 +180,4 @@
<metadata name="WeightError.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="IsUse.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

@ -47,7 +47,7 @@
//
// button1
//
this.button1.Location = new System.Drawing.Point(29, 28);
this.button1.Location = new System.Drawing.Point(382, 28);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(93, 51);
this.button1.TabIndex = 0;

@ -59,19 +59,6 @@ namespace HighWayIot.Winform.UserControlPages
//PlcType.DataSource = ;
}
/// <summary>
/// 测试按钮1
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
MonitorInsert(
ZxRecipeService.Instance.GetRecipeInfos().FirstOrDefault().RecipeCode,
10.ToString()
);
}
/// <summary>
/// RFID测试
/// </summary>
@ -90,9 +77,49 @@ namespace HighWayIot.Winform.UserControlPages
/// <param name="e"></param>
private void button3_Click(object sender, EventArgs e)
{
//MessageBox.Show(PlcConnect.ReadByte2("D200", 1).IsSuccess.ToString());
var res = PlcConnect.PlcWrite2("D310", 123, DataTypeEnum.UInt16);
MessageBox.Show(res.IsSuccess.ToString());
byte[] sideBytes = new byte[2];
sideBytes[0] = sideBytes[0].SetBoolByIndex(0, false);
sideBytes[0] = sideBytes[0].SetBoolByIndex(1, true);
sideBytes[0] = sideBytes[0].SetBoolByIndex(2, false);
sideBytes[0] = sideBytes[0].SetBoolByIndex(3, true);
sideBytes[0] = sideBytes[0].SetBoolByIndex(4, false);
sideBytes[0] = sideBytes[0].SetBoolByIndex(5, true);
sideBytes[0] = sideBytes[0].SetBoolByIndex(6, false);
sideBytes[0] = sideBytes[0].SetBoolByIndex(7, true);
sideBytes[1] = sideBytes[1].SetBoolByIndex(0, false);
sideBytes[1] = sideBytes[1].SetBoolByIndex(1, true);
ushort sideBitData = sideBytes.FromBytes();
sideBytes = BitConverter.GetBytes(sideBitData);
if (PlcConnect.PlcWriteBytes2("D409", sideBytes).IsSuccess)
{
MessageBox.Show("写入成功");
}
}
/// <summary>
/// 测试按钮1
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
OperateResult<byte[]> sideResult = PlcConnect.ReadByte2("D409", 1);
byte[] sideData;
if (sideResult.IsSuccess)
{
sideData = sideResult.Content;
List<bool> result = new List<bool>();
result.Add(sideData[0].GetBoolByIndex(0));
result.Add(sideData[0].GetBoolByIndex(1));
result.Add(sideData[0].GetBoolByIndex(2));
result.Add(sideData[0].GetBoolByIndex(3));
result.Add(sideData[0].GetBoolByIndex(4));
result.Add(sideData[0].GetBoolByIndex(5));
result.Add(sideData[0].GetBoolByIndex(6));
result.Add(sideData[0].GetBoolByIndex(7));
result.Add(sideData[1].GetBoolByIndex(0));
result.Add(sideData[1].GetBoolByIndex(1));
}
}
/// <summary>
@ -146,33 +173,6 @@ namespace HighWayIot.Winform.UserControlPages
//PlcShowValue.Text = res;
}
/// <summary>
/// 监控画面信息插入
/// </summary>
public void MonitorInsert(string recipeCode, string deviceNo)
{
ZxRecipeEntity recipeEntity = ZxRecipeService.Instance.GetRecipeInfosByRecipeCode(recipeCode).FirstOrDefault();
if (recipeEntity == null)
{
return;
}
ZxDailyReportEntity entity = new ZxDailyReportEntity()
{
Uuid = Guid.NewGuid().ToString("N"),
VulcanizationNo = deviceNo,
StartTime = DateTime.Now,
RecipeName = recipeEntity.RecipeName,
RecipeCode = recipeEntity.RecipeCode,
SpecCode = recipeEntity.RecipeSpecCode,
DeviceNo = RecipeSendBusiness.RecipeNeededVehicleNo,
RawTireWeight = (int)ZxRecipeParaService.Instance.GetRecipeParaInfoByRecipeCode(recipeCode).FirstOrDefault()?.TireWeight,
IsDone = 0
};
ZxDailyReportService.Instance.InsertDailyReportInfo(entity);
}
/// <summary>
/// PLC写入按钮
/// </summary>

Loading…
Cancel
Save