change - 优化前端逻辑,修改排程错误,增大前端数据刷新间隔

master
SoulStar 1 month ago
parent 3a994c80ff
commit 5fcdd89323

@ -86,7 +86,8 @@ namespace HighWayIot.Repository.service
ZxDailyReportEntity entity =
_repository.AsQueryable()
.OrderByDescending(x => x.StartTime)
.First(x => x.DeviceNo == rgvNo);
//取最近一小时内未完成的数据,防止取到很久以前的数据
.First(x => x.DeviceNo == rgvNo && x.IsDone == 0 && x.StartTime > (DateTime.Now - TimeSpan.FromMinutes(60)));
return entity;
}
catch (Exception ex)

@ -29,7 +29,7 @@ namespace HighWayIot.Winform.Business
public MonitorDataRefreshBusiness()
{
// 启动定时器每隔1秒刷新一次报表数据
refreshTimer = new System.Threading.Timer(RefreshData, null, 0, 1000);
refreshTimer = new System.Threading.Timer(RefreshData, null, 0, 1600);
}
/// <summary>

@ -76,50 +76,51 @@ namespace HighWayIot.Winform.Business
}
var schedulingInfo = zxSchedulingService.GetSchedulingInfo();
if (RecipeSendMode) //通过MES下配方
{
//读同步数据库找到等于0的
List<ZxMesPlanTransferEntity> transferEntity = ZxMesPlanTransferService.Instance.GetRecipeInfos(x => x.RequestFlag == false).ToList();
ZxMesPlanTransferEntity newRecipes;
if (transferEntity.Count > 1)
{
newRecipes = transferEntity.Where(x => x.SyncTime == transferEntity.Max(y => y.SyncTime)).Single();
}
else if (transferEntity.Count == 0)
{
return;
}
else
{
newRecipes = transferEntity.Single();
}
//同步配方
SyncRecipe(newRecipes);
ZxMesPlanTransferService.Instance.SetFlagTrue();
//if (RecipeSendMode) //通过MES下配方
//{
// //读同步数据库找到等于0的
// List<ZxMesPlanTransferEntity> transferEntity = ZxMesPlanTransferService.Instance.GetRecipeInfos(x => x.RequestFlag == false).ToList();
// ZxMesPlanTransferEntity newRecipes;
// if (transferEntity.Count > 1)
// {
// newRecipes = transferEntity.Where(x => x.SyncTime == transferEntity.Max(y => y.SyncTime)).Single();
// }
// else if (transferEntity.Count == 0)
// {
// return;
// }
// else
// {
// newRecipes = transferEntity.Single();
// }
// //同步配方
// SyncRecipe(newRecipes);
// ZxMesPlanTransferService.Instance.SetFlagTrue();
//同步到对应硫化排程的界面
ZxSchedulingEntity schedulingEntity;
if ((destinationVulcanizationNo + 1) <= 62) //上模
{
schedulingEntity = schedulingInfo.Single(x => x.Id == destinationVulcanizationNo + 1);
schedulingEntity.RecipeName2 = newRecipes.RecipeName;
schedulingEntity.RecipeCode2 = newRecipes.RecipeCode;
}
else //下模
{
schedulingEntity = schedulingInfo.Single(x => x.Id == destinationVulcanizationNo + 1 - 62);
schedulingEntity.RecipeName1 = newRecipes.RecipeName;
schedulingEntity.RecipeCode1 = newRecipes.RecipeCode;
}
ZxSchedulingService.Instance.UpdateSchedulingInfo(schedulingEntity);
BaseForm.SchdulingRefreshAction.Invoke();
}
// //同步到对应硫化排程的界面
// ZxSchedulingEntity schedulingEntity;
// if ((destinationVulcanizationNo + 1) <= 62) //上模
// {
// schedulingEntity = schedulingInfo.Single(x => x.Id == destinationVulcanizationNo + 1);
// schedulingEntity.RecipeName2 = newRecipes.RecipeName;
// schedulingEntity.RecipeCode2 = newRecipes.RecipeCode;
// }
// else //下模
// {
// schedulingEntity = schedulingInfo.Single(x => x.Id == destinationVulcanizationNo + 1 - 62);
// schedulingEntity.RecipeName1 = newRecipes.RecipeName;
// schedulingEntity.RecipeCode1 = newRecipes.RecipeCode;
// }
// ZxSchedulingService.Instance.UpdateSchedulingInfo(schedulingEntity);
// BaseForm.SchdulingRefreshAction.Invoke();
//}
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)
@ -127,6 +128,7 @@ namespace HighWayIot.Winform.Business
LogHelper.Instance.Error("配方信息获取失败,请检查所选机台是否配置了相应配方");
return;
}
//没问题就在此下传PLC
if (recipeParaHelper.UploadToPLC(recipeParaInfo, zxRecipePositionParaEntities))
{
//PlcConnect.PlcWrite2($"B{(destinationVulcanizationNo + 0x901).ToString("X")}", false, DataTypeEnum.Bool);
@ -169,279 +171,279 @@ namespace HighWayIot.Winform.Business
}
}
/// <summary>
/// 配方同步方法
/// </summary>
public void SyncRecipe(ZxMesPlanTransferEntity newRecipe)
{
if (newRecipe == null)
{
return;
}
//同步到配方(配方和称量,如果是新的加字段)
List<ZxRecipeEntity> RecipeLists = ZxRecipeService.Instance.GetRecipeInfos();
var nowEneity = RecipeLists.Where(x => x.RecipeCode == newRecipe.RecipeCode && x.IsDeleted == false).FirstOrDefault();
if (nowEneity != null) //有就更新 只更新配方和称量信息
{
//同步配方
nowEneity.RecipeName = newRecipe.RecipeName;
nowEneity.RecipeSpecCode = newRecipe.SpecCode;
nowEneity.RecipeSpecName = newRecipe.SpecName;
nowEneity.SizeKind = newRecipe.RimInch;
nowEneity.FixedWidth = newRecipe.FixRubWidth;
if (!ZxRecipeService.Instance.UpdateRecipeInfo(nowEneity))
{
return;
}
///// <summary>
///// 配方同步方法
///// </summary>
//public void SyncRecipe(ZxMesPlanTransferEntity newRecipe)
//{
// if (newRecipe == null)
// {
// return;
// }
// //同步到配方(配方和称量,如果是新的加字段)
// List<ZxRecipeEntity> RecipeLists = ZxRecipeService.Instance.GetRecipeInfos();
// var nowEneity = RecipeLists.Where(x => x.RecipeCode == newRecipe.RecipeCode && x.IsDeleted == false).FirstOrDefault();
// if (nowEneity != null) //有就更新 只更新配方和称量信息
// {
// //同步配方
// nowEneity.RecipeName = newRecipe.RecipeName;
// nowEneity.RecipeSpecCode = newRecipe.SpecCode;
// nowEneity.RecipeSpecName = newRecipe.SpecName;
// nowEneity.SizeKind = newRecipe.RimInch;
// nowEneity.FixedWidth = newRecipe.FixRubWidth;
// if (!ZxRecipeService.Instance.UpdateRecipeInfo(nowEneity))
// {
// return;
// }
//同步称量信息
List<ZxWeightEntity> zxWeightEntities = ZxWeightService.Instance.GetWeightInfos(nowEneity.RecipeCode);
for (int i = 1; i <= 3; i++)
{
string typeName = string.Empty;
switch (i)
{
case 1:
typeName = "基部胶";
break;
case 2:
typeName = "中层胶";
break;
case 3:
typeName = "胎面胶";
break;
default:
break;
}
string MaterialName = Convert.ToString(newRecipe.GetType().GetProperty($"MaterialName{i}").GetValue(newRecipe));
if (!string.IsNullOrEmpty(MaterialName))
{
ZxWeightEntity weight = zxWeightEntities.FirstOrDefault(x => x.MaterialCode == MaterialName);
if (weight != null) //原来就有
{
weight.SetThickness = Convert.ToDecimal(newRecipe.GetType().GetProperty($"MaterialThickness{i}").GetValue(newRecipe)); //(decimal)newRecipe.MaterialThickness1;
weight.SetWidth = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)); //newRecipe.MaterialWidth1;
weight.SetWidth2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)); //newRecipe.MaterialWidth12;
weight.SetWidth3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)); //newRecipe.MaterialWidth13;
weight.SetLayer = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)); //newRecipe.MaterialLayers1;
weight.SetLayer2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)); //newRecipe.MaterialLayers12;
weight.SetLayer3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)); //newRecipe.MaterialLayers13;
ZxWeightService.Instance.UpdateWeightInfo(weight);
}
else //原来没有就添加
{
ZxWeightService.Instance.InsertWeightInfo(new ZxWeightEntity()
{
RecipeCode = newRecipe.RecipeCode,
MaterialCode = MaterialName,
MaterialName = MaterialName + typeName,
MaterialType = typeName,
SetThickness = Convert.ToDecimal(newRecipe.GetType().GetProperty($"MaterialThickness{i}").GetValue(newRecipe)),
SetWidth = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)),
SetWidth2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)),
SetWidth3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)),
SetLayer = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)),
SetLayer2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)),
SetLayer3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)),
SetError = 1,
IsUse = true,
IsDeleted = false,
});
}
}
}
}
else //没有就插入 全部同步
{
//同步配方
ZxRecipeEntity entity = new ZxRecipeEntity()
{
RecipeName = newRecipe.RecipeName,
RecipeCode = newRecipe.RecipeCode,
RecipeSpecCode = newRecipe.SpecCode,
RecipeSpecName = newRecipe.SpecName,
SizeKind = newRecipe.RimInch,
FixedWidth = newRecipe.FixRubWidth,
IsUse = true,
IsDeleted = false,
};
ZxRecipeService.Instance.InsertRecipeInfo(entity);
// //同步称量信息
// List<ZxWeightEntity> zxWeightEntities = ZxWeightService.Instance.GetWeightInfos(nowEneity.RecipeCode);
// for (int i = 1; i <= 3; i++)
// {
// string typeName = string.Empty;
// switch (i)
// {
// case 1:
// typeName = "基部胶";
// break;
// case 2:
// typeName = "中层胶";
// break;
// case 3:
// typeName = "胎面胶";
// break;
// default:
// break;
// }
// string MaterialName = Convert.ToString(newRecipe.GetType().GetProperty($"MaterialName{i}").GetValue(newRecipe));
// if (!string.IsNullOrEmpty(MaterialName))
// {
// ZxWeightEntity weight = zxWeightEntities.FirstOrDefault(x => x.MaterialCode == MaterialName);
// if (weight != null) //原来就有
// {
// weight.SetThickness = Convert.ToDecimal(newRecipe.GetType().GetProperty($"MaterialThickness{i}").GetValue(newRecipe)); //(decimal)newRecipe.MaterialThickness1;
// weight.SetWidth = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)); //newRecipe.MaterialWidth1;
// weight.SetWidth2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)); //newRecipe.MaterialWidth12;
// weight.SetWidth3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)); //newRecipe.MaterialWidth13;
// weight.SetLayer = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)); //newRecipe.MaterialLayers1;
// weight.SetLayer2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)); //newRecipe.MaterialLayers12;
// weight.SetLayer3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)); //newRecipe.MaterialLayers13;
// ZxWeightService.Instance.UpdateWeightInfo(weight);
// }
// else //原来没有就添加
// {
// ZxWeightService.Instance.InsertWeightInfo(new ZxWeightEntity()
// {
// RecipeCode = newRecipe.RecipeCode,
// MaterialCode = MaterialName,
// MaterialName = MaterialName + typeName,
// MaterialType = typeName,
// SetThickness = Convert.ToDecimal(newRecipe.GetType().GetProperty($"MaterialThickness{i}").GetValue(newRecipe)),
// SetWidth = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)),
// SetWidth2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)),
// SetWidth3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)),
// SetLayer = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)),
// SetLayer2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)),
// SetLayer3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)),
// SetError = 1,
// IsUse = true,
// IsDeleted = false,
// });
// }
// }
// }
// }
// else //没有就插入 全部同步
// {
// //同步配方
// ZxRecipeEntity entity = new ZxRecipeEntity()
// {
// RecipeName = newRecipe.RecipeName,
// RecipeCode = newRecipe.RecipeCode,
// RecipeSpecCode = newRecipe.SpecCode,
// RecipeSpecName = newRecipe.SpecName,
// SizeKind = newRecipe.RimInch,
// FixedWidth = newRecipe.FixRubWidth,
// IsUse = true,
// IsDeleted = false,
// };
// ZxRecipeService.Instance.InsertRecipeInfo(entity);
//同步称量信息
List<ZxWeightEntity> zxWeightEntities = ZxWeightService.Instance.GetWeightInfos(nowEneity.RecipeCode);
for (int i = 1; i <= 3; i++)
{
string typeName = string.Empty;
switch (i)
{
case 1:
typeName = "基部胶";
break;
case 2:
typeName = "中层胶";
break;
case 3:
typeName = "胎面胶";
break;
default:
break;
}
string MaterialName = Convert.ToString(newRecipe.GetType().GetProperty($"MaterialName{i}").GetValue(newRecipe));
if (!string.IsNullOrEmpty(MaterialName))
{
ZxWeightEntity weight = zxWeightEntities.FirstOrDefault(x => x.MaterialCode == MaterialName);
if (weight != null) //原来就有
{
weight.SetThickness = Convert.ToDecimal(newRecipe.GetType().GetProperty($"MaterialThickness{i}").GetValue(newRecipe)); //(decimal)newRecipe.MaterialThickness1;
weight.SetWidth = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)); //newRecipe.MaterialWidth1;
weight.SetWidth2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)); //newRecipe.MaterialWidth12;
weight.SetWidth3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)); //newRecipe.MaterialWidth13;
weight.SetLayer = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)); //newRecipe.MaterialLayers1;
weight.SetLayer2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)); //newRecipe.MaterialLayers12;
weight.SetLayer3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)); //newRecipe.MaterialLayers13;
ZxWeightService.Instance.UpdateWeightInfo(weight);
}
else //原来没有就添加
{
ZxWeightService.Instance.InsertWeightInfo(new ZxWeightEntity()
{
RecipeCode = newRecipe.RecipeCode,
MaterialCode = MaterialName,
MaterialName = MaterialName + typeName,
MaterialType = typeName,
SetThickness = Convert.ToDecimal(newRecipe.GetType().GetProperty($"MaterialThickness{i}").GetValue(newRecipe)),
SetWidth = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)),
SetWidth2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)),
SetWidth3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)),
SetLayer = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)),
SetLayer2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)),
SetLayer3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)),
SetError = 1,
IsUse = true,
IsDeleted = false,
});
}
}
}
// //同步称量信息
// List<ZxWeightEntity> zxWeightEntities = ZxWeightService.Instance.GetWeightInfos(nowEneity.RecipeCode);
// for (int i = 1; i <= 3; i++)
// {
// string typeName = string.Empty;
// switch (i)
// {
// case 1:
// typeName = "基部胶";
// break;
// case 2:
// typeName = "中层胶";
// break;
// case 3:
// typeName = "胎面胶";
// break;
// default:
// break;
// }
// string MaterialName = Convert.ToString(newRecipe.GetType().GetProperty($"MaterialName{i}").GetValue(newRecipe));
// if (!string.IsNullOrEmpty(MaterialName))
// {
// ZxWeightEntity weight = zxWeightEntities.FirstOrDefault(x => x.MaterialCode == MaterialName);
// if (weight != null) //原来就有
// {
// weight.SetThickness = Convert.ToDecimal(newRecipe.GetType().GetProperty($"MaterialThickness{i}").GetValue(newRecipe)); //(decimal)newRecipe.MaterialThickness1;
// weight.SetWidth = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)); //newRecipe.MaterialWidth1;
// weight.SetWidth2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)); //newRecipe.MaterialWidth12;
// weight.SetWidth3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)); //newRecipe.MaterialWidth13;
// weight.SetLayer = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)); //newRecipe.MaterialLayers1;
// weight.SetLayer2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)); //newRecipe.MaterialLayers12;
// weight.SetLayer3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)); //newRecipe.MaterialLayers13;
// ZxWeightService.Instance.UpdateWeightInfo(weight);
// }
// else //原来没有就添加
// {
// ZxWeightService.Instance.InsertWeightInfo(new ZxWeightEntity()
// {
// RecipeCode = newRecipe.RecipeCode,
// MaterialCode = MaterialName,
// MaterialName = MaterialName + typeName,
// MaterialType = typeName,
// SetThickness = Convert.ToDecimal(newRecipe.GetType().GetProperty($"MaterialThickness{i}").GetValue(newRecipe)),
// SetWidth = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)),
// SetWidth2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)),
// SetWidth3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)),
// SetLayer = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)),
// SetLayer2 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)),
// SetLayer3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)),
// SetError = 1,
// IsUse = true,
// IsDeleted = false,
// });
// }
// }
// }
//同步公共参数
ZxRecipeParaEntity recipeParaEntity = new ZxRecipeParaEntity();
recipeParaEntity.RimInch = newRecipe.RimInch;
recipeParaEntity.LightWidth = newRecipe.FixRubWidth;
recipeParaEntity.SlowDistance = 0;
recipeParaEntity.StopDistance = 0;
recipeParaEntity.TireWeight = newRecipe.TireWeight;
recipeParaEntity.SpecCode = newRecipe.SpecCode;
recipeParaEntity.SpecName = newRecipe.SpecName;
recipeParaEntity.RecipeCode = newRecipe.RecipeCode;
// //同步公共参数
// ZxRecipeParaEntity recipeParaEntity = new ZxRecipeParaEntity();
// recipeParaEntity.RimInch = newRecipe.RimInch;
// recipeParaEntity.LightWidth = newRecipe.FixRubWidth;
// recipeParaEntity.SlowDistance = 0;
// recipeParaEntity.StopDistance = 0;
// recipeParaEntity.TireWeight = newRecipe.TireWeight;
// recipeParaEntity.SpecCode = newRecipe.SpecCode;
// recipeParaEntity.SpecName = newRecipe.SpecName;
// recipeParaEntity.RecipeCode = newRecipe.RecipeCode;
//自动工位选择
zxWeightEntities.Clear();
zxWeightEntities = ZxWeightService.Instance.GetWeightInfos(nowEneity.RecipeCode);
List<ZxOpenMixMaterialEntity> openMixConfig = ZxOpenMixMaterialService.Instance.GetInfos();
foreach (ZxWeightEntity weightEntity in zxWeightEntities)
{
var config = openMixConfig.Where(x => x.MaterialName == weightEntity.MaterialName).FirstOrDefault();
if (config == null)
{
continue;
}
var prop = recipeParaEntity.GetType().GetProperty($"S{config.StationNo + 1}");
if (prop != null)
{
prop.SetValue(recipeParaEntity, true);
}
//自动包边选择
if (!(weightEntity.SetLayer2 == 0
|| weightEntity.SetLayer2 == null
|| weightEntity.SetWidth2 == null
|| weightEntity.SetWidth2 == 0))
{
var propp = recipeParaEntity.GetType().GetProperty($"B{config.StationNo - 1}");
if (propp != null)
{
propp.SetValue(recipeParaEntity, true);
}
}
if (!(weightEntity.SetLayer3 == 0
|| weightEntity.SetLayer3 == null
|| weightEntity.SetWidth3 == null
|| weightEntity.SetWidth3 == 0))
{
var propp = recipeParaEntity.GetType().GetProperty($"B{config.StationNo + 4}");
if (propp != null)
{
propp.SetValue(recipeParaEntity, true);
}
}
//设置胎体重量
if (weightEntity.MaterialType == "胎面胶")
{
recipeParaEntity.TireWeight = Convert.ToSingle(weightEntity.SetWeight);
switch (config.StationNo)
{
case 3:
recipeParaEntity.S7 = true;
break;
case 4:
recipeParaEntity.S8 = true;
break;
case 5:
recipeParaEntity.S9 = true;
break;
default:
break;
}
}
}
ZxRecipeParaEntity nowRecipeParaEntity = ZxRecipeParaService.Instance.GetRecipeParaInfoByRecipeCode(nowEneity.RecipeCode).FirstOrDefault();
// //自动工位选择
// zxWeightEntities.Clear();
// zxWeightEntities = ZxWeightService.Instance.GetWeightInfos(nowEneity.RecipeCode);
// List<ZxOpenMixMaterialEntity> openMixConfig = ZxOpenMixMaterialService.Instance.GetInfos();
// foreach (ZxWeightEntity weightEntity in zxWeightEntities)
// {
// var config = openMixConfig.Where(x => x.MaterialName == weightEntity.MaterialName).FirstOrDefault();
// if (config == null)
// {
// continue;
// }
// var prop = recipeParaEntity.GetType().GetProperty($"S{config.StationNo + 1}");
// if (prop != null)
// {
// prop.SetValue(recipeParaEntity, true);
// }
// //自动包边选择
// if (!(weightEntity.SetLayer2 == 0
// || weightEntity.SetLayer2 == null
// || weightEntity.SetWidth2 == null
// || weightEntity.SetWidth2 == 0))
// {
// var propp = recipeParaEntity.GetType().GetProperty($"B{config.StationNo - 1}");
// if (propp != null)
// {
// propp.SetValue(recipeParaEntity, true);
// }
// }
// if (!(weightEntity.SetLayer3 == 0
// || weightEntity.SetLayer3 == null
// || weightEntity.SetWidth3 == null
// || weightEntity.SetWidth3 == 0))
// {
// var propp = recipeParaEntity.GetType().GetProperty($"B{config.StationNo + 4}");
// if (propp != null)
// {
// propp.SetValue(recipeParaEntity, true);
// }
// }
// //设置胎体重量
// if (weightEntity.MaterialType == "胎面胶")
// {
// recipeParaEntity.TireWeight = Convert.ToSingle(weightEntity.SetWeight);
// switch (config.StationNo)
// {
// case 3:
// recipeParaEntity.S7 = true;
// break;
// case 4:
// recipeParaEntity.S8 = true;
// break;
// case 5:
// recipeParaEntity.S9 = true;
// break;
// default:
// break;
// }
// }
// }
// ZxRecipeParaEntity nowRecipeParaEntity = ZxRecipeParaService.Instance.GetRecipeParaInfoByRecipeCode(nowEneity.RecipeCode).FirstOrDefault();
if (nowRecipeParaEntity != null) //如果存在就更改
{
recipeParaEntity.Id = nowRecipeParaEntity.Id;
ZxRecipeParaService.Instance.UpdateRecipeParaInfo(recipeParaEntity);
}
else
{
ZxRecipeParaService.Instance.InsertRecipeParaInfo(recipeParaEntity);
}
// if (nowRecipeParaEntity != null) //如果存在就更改
// {
// recipeParaEntity.Id = nowRecipeParaEntity.Id;
// ZxRecipeParaService.Instance.UpdateRecipeParaInfo(recipeParaEntity);
// }
// else
// {
// ZxRecipeParaService.Instance.InsertRecipeParaInfo(recipeParaEntity);
// }
//同步工位参数
ZxRecipePositionParaService.Instance.DeleteRecipePositionParaInfoByRecipeCode(newRecipe.RecipeCode); //删除可能存在的脏数据
for (int i = 1; i <= 3; i++)
{
string MaterialName = Convert.ToString(newRecipe.GetType().GetProperty($"MaterialName{i}").GetValue(newRecipe));
if (string.IsNullOrEmpty(MaterialName))
{
continue;
}
// //同步工位参数
// ZxRecipePositionParaService.Instance.DeleteRecipePositionParaInfoByRecipeCode(newRecipe.RecipeCode); //删除可能存在的脏数据
// for (int i = 1; i <= 3; i++)
// {
// string MaterialName = Convert.ToString(newRecipe.GetType().GetProperty($"MaterialName{i}").GetValue(newRecipe));
// if (string.IsNullOrEmpty(MaterialName))
// {
// continue;
// }
var config = openMixConfig.Where(x => x.MaterialName.Contains(MaterialName)).FirstOrDefault();
if (config == null)
{
continue;
}
ZxRecipePositionParaEntity positionEntity = new ZxRecipePositionParaEntity()
{
RecipeCode = newRecipe.RecipeCode,
Position = config.StationNo,
E1 = 15,
E2 = 52,
E5 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)) * 10,
E9 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)),
E6 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)) * 10,
E7 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)),
E3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)) * 10,
E4 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)),
E10 = 800,
E8 = 300
};
// var config = openMixConfig.Where(x => x.MaterialName.Contains(MaterialName)).FirstOrDefault();
// if (config == null)
// {
// continue;
// }
// ZxRecipePositionParaEntity positionEntity = new ZxRecipePositionParaEntity()
// {
// RecipeCode = newRecipe.RecipeCode,
// Position = config.StationNo,
// E1 = 15,
// E2 = 52,
// E5 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}").GetValue(newRecipe)) * 10,
// E9 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}").GetValue(newRecipe)),
// E6 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}2").GetValue(newRecipe)) * 10,
// E7 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}2").GetValue(newRecipe)),
// E3 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialLayers{i}3").GetValue(newRecipe)) * 10,
// E4 = Convert.ToInt32(newRecipe.GetType().GetProperty($"MaterialWidth{i}3").GetValue(newRecipe)),
// E10 = 800,
// E8 = 300
// };
ZxRecipePositionParaService.Instance.InsertRecipePositionParaInfo(positionEntity);
}
// ZxRecipePositionParaService.Instance.InsertRecipePositionParaInfo(positionEntity);
// }
}
// }
}
//}
}
}

@ -352,17 +352,17 @@ namespace HighWayIot.Winform.MainForm
/// <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);
}
//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);
//}
}
/// <summary>

@ -106,71 +106,79 @@ namespace HighWayIot.Winform.UserControlPages
/// </summary>
private void DateTimeRefresh()
{
var timeList = _shiftTimeService.GetShiftInfos();
var morningShift = timeList.Where(x => x.ShiftName == "早").FirstOrDefault();
var midShift = timeList.Where(x => x.ShiftName == "中").FirstOrDefault();
var nightShift = timeList.Where(x => x.ShiftName == "夜").FirstOrDefault();
if (morningShift == null || midShift == null || nightShift == null)
try
{
logHelper.Error("检查班次数据库是否早中夜班配置齐全!");
return;
}
var timeList = _shiftTimeService.GetShiftInfos();
var morningShift = timeList.Where(x => x.ShiftName == "早").FirstOrDefault();
var midShift = timeList.Where(x => x.ShiftName == "中").FirstOrDefault();
var nightShift = timeList.Where(x => x.ShiftName == "夜").FirstOrDefault();
DateTime Today = DateTime.Now.Date;
var startArray = morningShift.ShiftStartTime.Split(':');
var endArray = midShift.ShiftEndTime.Split(':');
if (startArray.Length != 3 || endArray.Length != 3)
{
return;
}
TimeSpan StartTime = new TimeSpan(Convert.ToInt32(startArray[0]), Convert.ToInt32(startArray[1]), Convert.ToInt32(startArray[2]));
TimeSpan EndTime = new TimeSpan(Convert.ToInt32(endArray[0]), Convert.ToInt32(endArray[1]), Convert.ToInt32(endArray[2]));
if (DateTime.Now.TimeOfDay > StartTime && DateTime.Now.TimeOfDay < EndTime)
{//白班
DayStartTime = DateTime.Now.Date + StartTime;
DayEndTine = DateTime.Now.Date + EndTime;
NightStartTime = DateTime.Now.Date - TimeSpan.FromDays(1) + EndTime;
NightEndTime = DateTime.Now.Date + StartTime;
LastDayStartTime = DateTime.Today - TimeSpan.FromDays(1) + StartTime;
LastNightEndTime = DateTime.Today + StartTime;
DayProductNumTextBox.BackColor = Color.LightGreen;
NightProductNumTextBox.BackColor = Color.LightGray;
}
else
{//夜班
DayProductNumTextBox.BackColor = Color.LightGray;
NightProductNumTextBox.BackColor = Color.LightGreen;
if (DateTime.Now.TimeOfDay < StartTime) //前半夜
if (morningShift == null || midShift == null || nightShift == null)
{
logHelper.Error("检查班次数据库是否早中夜班配置齐全!");
return;
}
DateTime Today = DateTime.Now.Date;
var startArray = morningShift.ShiftStartTime.Split(':');
var endArray = midShift.ShiftEndTime.Split(':');
if (startArray.Length != 3 || endArray.Length != 3)
{
return;
}
TimeSpan StartTime = new TimeSpan(Convert.ToInt32(startArray[0]), Convert.ToInt32(startArray[1]), Convert.ToInt32(startArray[2]));
TimeSpan EndTime = new TimeSpan(Convert.ToInt32(endArray[0]), Convert.ToInt32(endArray[1]), Convert.ToInt32(endArray[2]));
if (DateTime.Now.TimeOfDay > StartTime && DateTime.Now.TimeOfDay < EndTime)
{//白班
DayStartTime = DateTime.Now.Date + StartTime;
DayEndTine = DateTime.Now.Date + EndTime;
NightStartTime = DateTime.Now.Date + EndTime;
NightEndTime = DateTime.Now + TimeSpan.FromDays(1) + StartTime;
NightStartTime = DateTime.Now.Date - TimeSpan.FromDays(1) + EndTime;
NightEndTime = DateTime.Now.Date + StartTime;
LastDayStartTime = DateTime.Today - TimeSpan.FromDays(1) + StartTime;
LastNightEndTime = DateTime.Today + StartTime;
DayProductNumTextBox.BackColor = Color.LightGreen;
NightProductNumTextBox.BackColor = Color.LightGray;
}
else if (DateTime.Now.TimeOfDay > EndTime) //后半夜
{
DayStartTime = DateTime.Now.Date - TimeSpan.FromDays(1) + StartTime;
DayEndTine = DateTime.Now.Date - TimeSpan.FromDays(1) + EndTime;
NightStartTime = DateTime.Now.Date - TimeSpan.FromDays(1) + EndTime;
NightEndTime = DateTime.Now + StartTime;
else
{//夜班
LastDayStartTime = DateTime.Today - TimeSpan.FromDays(2) + StartTime;
LastNightEndTime = DateTime.Today - TimeSpan.FromDays(1) + StartTime;
DayProductNumTextBox.BackColor = Color.LightGray;
NightProductNumTextBox.BackColor = Color.LightGreen;
if (DateTime.Now.TimeOfDay < StartTime) //前半夜
{
DayStartTime = DateTime.Now.Date + StartTime;
DayEndTine = DateTime.Now.Date + EndTime;
NightStartTime = DateTime.Now.Date + EndTime;
NightEndTime = DateTime.Now + TimeSpan.FromDays(1) + StartTime;
LastDayStartTime = DateTime.Today - TimeSpan.FromDays(1) + StartTime;
LastNightEndTime = DateTime.Today + StartTime;
}
else if (DateTime.Now.TimeOfDay > EndTime) //后半夜
{
DayStartTime = DateTime.Now.Date - TimeSpan.FromDays(1) + StartTime;
DayEndTine = DateTime.Now.Date - TimeSpan.FromDays(1) + EndTime;
NightStartTime = DateTime.Now.Date - TimeSpan.FromDays(1) + EndTime;
NightEndTime = DateTime.Now + StartTime;
LastDayStartTime = DateTime.Today - TimeSpan.FromDays(2) + StartTime;
LastNightEndTime = DateTime.Today - TimeSpan.FromDays(1) + StartTime;
}
}
string dayString = morningShift.ShiftStartTime.Substring(0, 5) + "-" + midShift.ShiftEndTime.Substring(0, 5);
string nightString = nightShift.ShiftStartTime.Substring(0, 5) + "-" + nightShift.ShiftEndTime.Substring(0, 5);
DayTimeLabel.Text = dayString;
NightTimeLabel.Text = nightString;
NowDateProductNumLabel.Text = (DateTime.Now - TimeSpan.FromDays(1)).ToString("MM 月 dd 日 产量");
}
catch(Exception ex)
{
logHelper.Error("班次时间更新异常:" + ex.Message);
return;
}
string dayString = morningShift.ShiftStartTime.Substring(0, 5) + "-" + midShift.ShiftEndTime.Substring(0, 5);
string nightString = nightShift.ShiftStartTime.Substring(0, 5) + "-" + nightShift.ShiftEndTime.Substring(0, 5);
DayTimeLabel.Text = dayString;
NightTimeLabel.Text = nightString;
NowDateProductNumLabel.Text = (DateTime.Now - TimeSpan.FromDays(1)).ToString("MM 月 dd 日 产量");
}
/// <summary>
@ -254,7 +262,7 @@ namespace HighWayIot.Winform.UserControlPages
}
catch(Exception ex)
{
logHelper.Error("监视页面数据绑定异常:" + ex.Message);
}
}
}
@ -288,9 +296,9 @@ namespace HighWayIot.Winform.UserControlPages
}
}
}
catch
catch(Exception ex)
{
logHelper.Error("单元格格式回调方法异常", ex);
}
}
@ -301,13 +309,26 @@ namespace HighWayIot.Winform.UserControlPages
/// <param name="e"></param>
private void MoveText_DoubleClick(object sender, EventArgs e)
{
ScrollTextSetForm form = new ScrollTextSetForm();
if (form.ShowDialog() == DialogResult.OK)
try
{
MoveText.Text = form.OutValue;
ScrollTextSetForm form = new ScrollTextSetForm();
if (form.ShowDialog() == DialogResult.OK)
{
MoveText.Text = form.OutValue;
}
}
catch
{
}
}
/// <summary>
/// 锁定刷新框
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MonitorDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e)
{
lock (GridRefreshLocker)

@ -38,6 +38,7 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
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();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = 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();
@ -46,6 +47,7 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
this.DeviceNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RecipeCode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RecipeName2 = new System.Windows.Forms.DataGridViewComboBoxColumn();
this.DeviceNo1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RecipeCode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.RecipeName1 = new System.Windows.Forms.DataGridViewComboBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.SchedulingDataGridView)).BeginInit();
@ -71,6 +73,7 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
this.DeviceNo,
this.RecipeCode2,
this.RecipeName2,
this.DeviceNo1,
this.RecipeCode1,
this.RecipeName1});
this.SchedulingDataGridView.Location = new System.Drawing.Point(0, 65);
@ -78,7 +81,7 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
this.SchedulingDataGridView.Name = "SchedulingDataGridView";
this.SchedulingDataGridView.RowHeadersVisible = false;
this.SchedulingDataGridView.RowTemplate.Height = 25;
this.SchedulingDataGridView.Size = new System.Drawing.Size(1105, 676);
this.SchedulingDataGridView.Size = new System.Drawing.Size(1492, 889);
this.SchedulingDataGridView.TabIndex = 0;
this.SchedulingDataGridView.Tag = "";
this.SchedulingDataGridView.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.SchedulingDataGridView_CellEnter);
@ -104,7 +107,7 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
this.ButtonPanel.Location = new System.Drawing.Point(0, 0);
this.ButtonPanel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.ButtonPanel.Name = "ButtonPanel";
this.ButtonPanel.Size = new System.Drawing.Size(1105, 61);
this.ButtonPanel.Size = new System.Drawing.Size(1492, 61);
this.ButtonPanel.TabIndex = 4;
//
// UpdateConfigButton
@ -138,6 +141,7 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
this.DeviceNo.Name = "DeviceNo";
this.DeviceNo.ReadOnly = true;
this.DeviceNo.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.DeviceNo.Width = 70;
//
// RecipeCode2
//
@ -162,15 +166,26 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
this.RecipeName2.Name = "RecipeName2";
this.RecipeName2.Resizable = System.Windows.Forms.DataGridViewTriState.False;
//
// DeviceNo1
//
this.DeviceNo1.DataPropertyName = "DeviceNo";
dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F);
this.DeviceNo1.DefaultCellStyle = dataGridViewCellStyle6;
this.DeviceNo1.HeaderText = "机台编号";
this.DeviceNo1.Name = "DeviceNo1";
this.DeviceNo1.ReadOnly = true;
this.DeviceNo1.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.DeviceNo1.Width = 70;
//
// RecipeCode1
//
this.RecipeCode1.DataPropertyName = "RecipeCode1";
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;
dataGridViewCellStyle7.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle7.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.White;
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.Black;
this.RecipeCode1.DefaultCellStyle = dataGridViewCellStyle7;
this.RecipeCode1.HeaderText = "成品代号 - 下模";
this.RecipeCode1.Name = "RecipeCode1";
this.RecipeCode1.ReadOnly = true;
@ -181,8 +196,8 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
//
this.RecipeName1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.RecipeName1.DataPropertyName = "RecipeName1";
dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.RecipeName1.DefaultCellStyle = dataGridViewCellStyle7;
dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.RecipeName1.DefaultCellStyle = dataGridViewCellStyle8;
this.RecipeName1.HeaderText = "标称尺度 - 下模";
this.RecipeName1.Name = "RecipeName1";
this.RecipeName1.Resizable = System.Windows.Forms.DataGridViewTriState.False;
@ -197,7 +212,7 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
this.Controls.Add(this.SchedulingDataGridView);
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "ProductionScheduling";
this.Size = new System.Drawing.Size(1105, 741);
this.Size = new System.Drawing.Size(1492, 954);
((System.ComponentModel.ISupportInitialize)(this.SchedulingDataGridView)).EndInit();
this.ButtonPanel.ResumeLayout(false);
this.ResumeLayout(false);
@ -214,6 +229,7 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
private DataGridViewTextBoxColumn DeviceNo;
private DataGridViewTextBoxColumn RecipeCode2;
private DataGridViewComboBoxColumn RecipeName2;
private DataGridViewTextBoxColumn DeviceNo1;
private DataGridViewTextBoxColumn RecipeCode1;
private DataGridViewComboBoxColumn RecipeName1;
}

@ -150,7 +150,7 @@ namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
int column = SchedulingDataGridView.CurrentCell.ColumnIndex;
string DeviceNo = SchedulingDataGridView.Rows[row].Cells[1].Value.ToString();
if (column == 5)
if (column == 6)
{
ZxRecipeEntity recipe = zxRecipeService.GetSingleInfoByRecipeName(combox.Text);
if (recipe == null)

@ -129,6 +129,9 @@
<metadata name="RecipeName2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="DeviceNo1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RecipeCode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>

@ -1605,7 +1605,6 @@ namespace HighWayIot.Winform.UserControlPages
this.RecipeName.FillWeight = 52.74404F;
this.RecipeName.HeaderText = "标称尺度";
this.RecipeName.Name = "RecipeName";
this.RecipeName.ReadOnly = true;
this.RecipeName.Resizable = System.Windows.Forms.DataGridViewTriState.False;
//
// RecipeSpecCode

Loading…
Cancel
Save