Compare commits
7 Commits
d9e0324b1d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32b5a6d301 | ||
|
|
6b4a8fac87 | ||
|
|
f406cadd44 | ||
|
|
6864256202 | ||
|
|
991893c2d0 | ||
|
|
773aea0c5d | ||
|
|
d5b36e5ae7 |
@@ -5,8 +5,6 @@ VisualStudioVersion = 17.7.34003.232
|
|||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WPFWCSDemo", "WPFWCSDemo\WPFWCSDemo.csproj", "{604005A1-35A4-48E2-8011-20C38F2AC571}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WPFWCSDemo", "WPFWCSDemo\WPFWCSDemo.csproj", "{604005A1-35A4-48E2-8011-20C38F2AC571}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject1", "TestProject1\TestProject1.csproj", "{BD8D724A-5381-4BBD-BB94-240AD27DD2A7}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -17,10 +15,6 @@ Global
|
|||||||
{604005A1-35A4-48E2-8011-20C38F2AC571}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{604005A1-35A4-48E2-8011-20C38F2AC571}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{604005A1-35A4-48E2-8011-20C38F2AC571}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{604005A1-35A4-48E2-8011-20C38F2AC571}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{604005A1-35A4-48E2-8011-20C38F2AC571}.Release|Any CPU.Build.0 = Release|Any CPU
|
{604005A1-35A4-48E2-8011-20C38F2AC571}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{BD8D724A-5381-4BBD-BB94-240AD27DD2A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{BD8D724A-5381-4BBD-BB94-240AD27DD2A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{BD8D724A-5381-4BBD-BB94-240AD27DD2A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{BD8D724A-5381-4BBD-BB94-240AD27DD2A7}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@@ -32,29 +32,68 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
public static bool CanTaskGenerated(int sourceLocation, int targetLocation, bool isNotException)
|
public static bool CanTaskGenerated(int sourceLocation, int targetLocation, bool isNotException)
|
||||||
{
|
{
|
||||||
//校验---源站点请求
|
//校验---源站点请求
|
||||||
if (QueryForIsRequestReset(sourceLocation, 3)) return false;
|
if (QueryForIsRequestReset(sourceLocation, 3))
|
||||||
|
{
|
||||||
|
Log.Error($"【提示01】<空托任务>生成失败,源站点[{sourceLocation}]请求未复位,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//校验---目标站点请求
|
//校验---目标站点请求
|
||||||
if (QueryForIsRequestReset(targetLocation, 3)) return false;
|
if (QueryForIsRequestReset(targetLocation, 3))
|
||||||
|
{
|
||||||
|
Log.Error($"【提示02】<空托任务>生成失败,目标站点[{targetLocation}]请求未复位,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//校验---系统异常
|
//校验---系统异常
|
||||||
if (!isNotException) return false;
|
if (!isNotException)
|
||||||
|
{
|
||||||
|
Log.Error($"【提示03】<空托任务>生成失败,源站点[{sourceLocation}],目标站点[{targetLocation}],输送线系统异常,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//校验---同输送口相邻任务生成时间间隔过短
|
//校验---同输送口相邻任务生成时间间隔过短
|
||||||
if (!CheckSendTaskTimeInterval(targetLocation, 999)) return false;
|
if (!CheckSendTaskTimeInterval(targetLocation, 120))
|
||||||
|
{
|
||||||
|
Log.Error($"【提示04】<空托任务>生成失败,目标站点[{targetLocation}]相邻任务生成时间间隔过短,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//校验---如果已经存在处于【取货阶段】的某个【空托】任务
|
//校验---如果已经存在处于【取货阶段】的某个【空托】任务
|
||||||
//由于【空托任务】输送线的源站点唯一,因此必须等待该任务取货完成才能生成新的【空托】任务
|
//由于【空托任务】输送线的源站点唯一,因此必须等待该任务取货完成才能生成新的【空托】任务
|
||||||
if (!IsPalletConvHasGettingTask()) return false;
|
if (!IsPalletLineHasTask())
|
||||||
|
{
|
||||||
|
Log.Error($"【提示05】<空托任务>生成失败,源站点[{sourceLocation}]已经存在处于取货阶段的空托任务,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//校验---当前输送线存在【空托】任务
|
//校验---当前输送线存在【空托】任务
|
||||||
if (!GetRGVTaskForPalletsIsExist(targetLocation)) return false;
|
if (!GetRGVTaskForPalletsIsExist(targetLocation))
|
||||||
|
{
|
||||||
|
Log.Error($"【提示06】<空托任务>生成失败,目标站点[{targetLocation}]已经存在处于取货阶段的空托任务,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//校验5.当前同一【目标站点】是否已经生成任务
|
//校验5.当前同一【目标站点】是否已经生成任务
|
||||||
if (!CheckSendTaskIsRepeat(sourceLocation, TaskType.Pallet)) return false;
|
if (!CheckSendTaskIsRepeat(sourceLocation, TaskType.Pallet))
|
||||||
|
{
|
||||||
|
Log.Error($"【提示07】<空托任务>生成失败,目标站点[{targetLocation}]已经存在处于取货阶段的空托任务,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//校验---上位是否手动禁止生成
|
//校验---上位是否手动禁止生成
|
||||||
if (LineTaskForPermission(targetLocation) == 0) return false;
|
if (LineTaskForPermission(targetLocation) == 0)
|
||||||
|
{
|
||||||
|
Log.Error($"【提示08】<空托任务>生成失败,目标站点[{targetLocation}]已经被手动禁止生成任务,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -76,29 +115,57 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
//1003-1009输送口校验
|
//1003-1009输送口校验
|
||||||
if (sourceLocation == RGVStation.LineM_Goods_In)
|
if (sourceLocation == RGVStation.LineM_Goods_In)
|
||||||
{
|
{
|
||||||
if (QueryForIsRequestReset(RGVStation.LineToWarehouse1_Out, 3)) return false;
|
if (QueryForIsRequestReset(RGVStation.LineToWarehouse1_Out, 3))
|
||||||
|
{
|
||||||
|
Log.Error($"【提示01】<实垛任务>生成失败,源站点[{sourceLocation}]请求未复位,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//2025.9新增
|
//2025.9新增
|
||||||
//1005-1010输送口校验
|
//1005-1010输送口校验
|
||||||
if (sourceLocation == RGVStation.LineL_Goods_In)
|
if (sourceLocation == RGVStation.LineL_Goods_In)
|
||||||
{
|
{
|
||||||
if (QueryForIsRequestReset(RGVStation.LineToWarehouse2_Out, 3)) return false;
|
if (QueryForIsRequestReset(RGVStation.LineToWarehouse2_Out, 3))
|
||||||
|
{
|
||||||
|
Log.Error($"【提示02】<实垛任务>生成失败,源站点[{sourceLocation}]请求未复位,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//校验1.输送口无请求
|
//校验1.输送口无请求
|
||||||
if (QueryForIsRequestReset(sourceLocation, 3)) return false;
|
if (QueryForIsRequestReset(sourceLocation, 3))
|
||||||
|
{
|
||||||
|
Log.Error($"【提示03】<实垛任务>生成失败,源站点[{sourceLocation}]请求未复位,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//校验2.输送口系统异常
|
//校验2.输送口系统异常
|
||||||
if (!isNotException) return false;
|
if (!isNotException)
|
||||||
|
{
|
||||||
|
Log.Error($"【提示04】<实垛任务>生成失败,源站点[{sourceLocation}]输送线系统异常,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//校验3.同输送口相邻任务生成时间间隔过短
|
//校验3.同输送口相邻任务生成时间间隔过短
|
||||||
if (!CheckSendTaskTimeInterval(sourceLocation)) return false;
|
if (!CheckSendTaskTimeInterval(sourceLocation))
|
||||||
|
{
|
||||||
|
Log.Error($"【提示05】<实垛任务>生成失败,源站点[{sourceLocation}]相邻任务生成时间间隔过短,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//校验4.当前输送线存在取货阶段的任务
|
//校验4.当前输送线存在取货阶段的任务
|
||||||
if (!GetRGVTaskForGoodsIsExist(sourceLocation)) return false;
|
if (!GetRGVTaskForGoodsIsExist(sourceLocation))
|
||||||
|
{
|
||||||
|
Log.Error($"【提示06】<实垛任务>生成失败,源站点[{sourceLocation}]已经存在处于取货阶段的实垛任务,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//校验5.当前同一【源站点】是否已经生成【取货阶段】任务
|
//校验5.当前同一【源站点】是否已经生成【取货阶段】任务
|
||||||
if (!CheckSendTaskIsRepeat(sourceLocation, TaskType.Goods)) return false;
|
if (!CheckSendTaskIsRepeat(sourceLocation, TaskType.Goods))
|
||||||
|
{
|
||||||
|
Log.Error($"【提示07】<实垛任务>生成失败,源站点[{sourceLocation}]已经存在处于取货阶段的实垛任务,禁止生成任务(消息仅作记录,可忽略)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -115,7 +182,7 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
/// <returns> true-相差大于x秒 false-相差小于x秒</returns>
|
/// <returns> true-相差大于x秒 false-相差小于x秒</returns>
|
||||||
public static bool CheckSendTaskTimeInterval(int location)
|
public static bool CheckSendTaskTimeInterval(int location)
|
||||||
{
|
{
|
||||||
int diff = -15;
|
int diff = -40;
|
||||||
|
|
||||||
using var context = new AppDbContext();
|
using var context = new AppDbContext();
|
||||||
|
|
||||||
@@ -134,6 +201,7 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 防错机制【用于避免请求延迟的重复下发】--- 检测上一条【空托】任务放货时间(完成时间)与当前时间是否相差x秒以上
|
/// 防错机制【用于避免请求延迟的重复下发】--- 检测上一条【空托】任务放货时间(完成时间)与当前时间是否相差x秒以上
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -141,7 +209,7 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
/// <returns> true-相差大于x秒 false-相差小于x秒</returns>
|
/// <returns> true-相差大于x秒 false-相差小于x秒</returns>
|
||||||
public static bool CheckSendTaskTimeInterval(int location, int num)
|
public static bool CheckSendTaskTimeInterval(int location, int num)
|
||||||
{
|
{
|
||||||
int diff = -30;
|
int diff = -num;
|
||||||
|
|
||||||
using var context = new AppDbContext();
|
using var context = new AppDbContext();
|
||||||
|
|
||||||
@@ -160,8 +228,9 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 防错机制【重复下发】--- 检测已经生成但未下发的任务是否存在
|
/// 防错机制【重复下发】--- 检测是否有已经生成但未取货的实垛任务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sourceLocation">源站点</param>
|
/// <param name="sourceLocation">源站点</param>
|
||||||
/// <returns> true-同目标站点生成任务时间间隔合法 false-时间间隔过短</returns>
|
/// <returns> true-同目标站点生成任务时间间隔合法 false-时间间隔过短</returns>
|
||||||
@@ -175,10 +244,10 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
//生成的上一条【实垛】任务且同一个源站点 ---> 查找符合条件的记录
|
//生成的上一条【实垛】任务且同一个源站点 ---> 查找符合条件的记录
|
||||||
var count = context
|
var count = context
|
||||||
.Set<TaskRT>()
|
.Set<TaskRT>()
|
||||||
.Where(t => t.SourceLocation == location.ToString() && (t.ScheduleState==ScheduleStateCode.Trans_CircleRGV_Ready || t.ScheduleState == ScheduleStateCode.Trans_CircleRGV_Picking))
|
.Where(t => t.SourceLocation == location.ToString() && (t.ScheduleState==ScheduleStateCode.Trans_CircleRGV_Ready || t.ScheduleState == ScheduleStateCode.Trans_CircleRGV_PickOnTheWay || t.ScheduleState == ScheduleStateCode.Trans_CircleRGV_Picking))
|
||||||
.Count();
|
.Count();
|
||||||
|
|
||||||
if (count < 1)
|
if (count == 0)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -193,7 +262,7 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
.Where(t => t.TargetLocation == location.ToString())
|
.Where(t => t.TargetLocation == location.ToString())
|
||||||
.Count();
|
.Count();
|
||||||
|
|
||||||
if (count1 < 1)
|
if (count1 == 0)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -205,10 +274,11 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static int sum;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计算某个输送口请求的值的和---用于确定该输送口在一定时间内请求是否已经复位
|
/// 计算某个输送口请求的值的和---用于确定该输送口在一定时间内请求是否已经复位
|
||||||
/// 用于避免信号也许存在的不稳定(跳变)的情况
|
/// 用于避免信号可能的不稳定(跳变)的情况
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Location">源站点/目标站点---表示对应列</param>
|
/// <param name="Location">源站点/目标站点---表示对应列</param>
|
||||||
/// <param name="count">计算的时间间隔(单位:秒)</param>
|
/// <param name="count">计算的时间间隔(单位:秒)</param>
|
||||||
@@ -281,7 +351,7 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sum = 0;
|
sum = 0;
|
||||||
|
|
||||||
//计算源站点对应某列3行请求(允许)值的和
|
//计算源站点对应某列3行请求(允许)值的和
|
||||||
for (int i = 0; i < dt.Rows.Count; i++)
|
for (int i = 0; i < dt.Rows.Count; i++)
|
||||||
@@ -387,12 +457,11 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
|
|
||||||
if (states is null) return false;
|
if (states is null) return false;
|
||||||
|
|
||||||
//检查是否有符合条件的小车,如果有则标
|
//检查是否有符合条件的小车
|
||||||
//【源站点】匹配
|
//【源站点】匹配
|
||||||
// 任务处于【取货阶段】
|
// 任务处于【取货阶段】
|
||||||
// 无【允许下发】---表示小车在工作中
|
|
||||||
var count = states
|
var count = states
|
||||||
.Where(a => a.Read_SourceLocation == (sourceLocation - 1000).ToString() && a.Read_Phase < 3 && a.Read_Phase > 0 && !a.Read_Permission)
|
.Where(a => a.Read_SourceLocation == (sourceLocation - 1000).ToString() && a.Read_Phase < 3 && a.Read_Phase > 0)
|
||||||
.Count();
|
.Count();
|
||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
@@ -411,7 +480,7 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
/// 检查是否存在已经生成的处于【取货阶段】的【栈板】任务 --- 源站点每次请求仅生成一条任务
|
/// 检查是否存在已经生成的处于【取货阶段】的【栈板】任务 --- 源站点每次请求仅生成一条任务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>true-无符合条件的任务(即可生成新任务) false-存在符合条件的任务</returns>
|
/// <returns>true-无符合条件的任务(即可生成新任务) false-存在符合条件的任务</returns>
|
||||||
public static bool IsPalletConvHasGettingTask()
|
public static bool IsPalletLineHasTask()
|
||||||
{
|
{
|
||||||
var context = new AppDbContext();
|
var context = new AppDbContext();
|
||||||
|
|
||||||
|
|||||||
@@ -174,6 +174,20 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
CreateTime = DateTime.Now,
|
CreateTime = DateTime.Now,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var count = context.Tasks
|
||||||
|
.Where(t => t.SourceLocation == sourceLocation.ToString() &&
|
||||||
|
(t.ScheduleState == ScheduleStateCode.Trans_CircleRGV_Ready ||
|
||||||
|
t.ScheduleState == ScheduleStateCode.Trans_CircleRGV_Picking ||
|
||||||
|
t.ScheduleState == ScheduleStateCode.Trans_CircleRGV_PickOnTheWay))
|
||||||
|
.Count();
|
||||||
|
|
||||||
|
if (count > 0)
|
||||||
|
{
|
||||||
|
Log.Error($"【提示】重复任务拦截,任务号:{taskNumber},取货站点:{sourceLocation}(消息仅作记录,可忽略)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
context.Tasks.Add(taskRT);
|
context.Tasks.Add(taskRT);
|
||||||
|
|
||||||
if (sourceLocation == RGVStation.LineGH_Pallets_In)
|
if (sourceLocation == RGVStation.LineGH_Pallets_In)
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
|
|
||||||
if (taskRT is null) continue;
|
if (taskRT is null) continue;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
//有【允许下发】
|
//有【允许下发】
|
||||||
//if (circleRGVState.Read_Permission) continue;
|
//if (circleRGVState.Read_Permission) continue;
|
||||||
|
|
||||||
@@ -169,7 +171,10 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
case 5:
|
case 5:
|
||||||
if (taskRT.ScheduleState != ScheduleStateCode.Trans_CircleRGV_Ready)
|
if (taskRT.ScheduleState != ScheduleStateCode.Trans_CircleRGV_Ready &&
|
||||||
|
taskRT.ScheduleState != ScheduleStateCode.Trans_CircleRGV_PickOnTheWay &&
|
||||||
|
taskRT.ScheduleState != ScheduleStateCode.Trans_CircleRGV_Picking &&
|
||||||
|
!circleRGVState.Read_Permission)
|
||||||
{
|
{
|
||||||
taskRT.ScheduleState = ScheduleStateCode.Trans_CircleRGV_Finish;
|
taskRT.ScheduleState = ScheduleStateCode.Trans_CircleRGV_Finish;
|
||||||
|
|
||||||
@@ -177,6 +182,12 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Error("【更新任务阶段】执行异常," + ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -690,11 +690,8 @@ namespace WPFWCSDemo.ViewModels
|
|||||||
$"检验码:{Checksum.GetChecksum(circleRGVStationCommand)},尝试下发任务!"
|
$"检验码:{Checksum.GetChecksum(circleRGVStationCommand)},尝试下发任务!"
|
||||||
);
|
);
|
||||||
|
|
||||||
//todo @@@可能需要判断设备是否已经开始执行
|
|
||||||
//todo @@@可能需要判断设备是否已经开始执行
|
|
||||||
//todo @@@可能需要判断设备是否已经开始执行
|
|
||||||
|
|
||||||
Task.Delay(100).Wait();
|
Task.Delay(200).Wait();
|
||||||
|
|
||||||
//【下发完成】写入操作成功
|
//【下发完成】写入操作成功
|
||||||
if (result.IsSuccess)
|
if (result.IsSuccess)
|
||||||
@@ -721,8 +718,6 @@ namespace WPFWCSDemo.ViewModels
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//需要详细了解可能【接收异常】的情况
|
|
||||||
//需要详细了解可能【接收异常】的情况
|
|
||||||
//需要详细了解可能【接收异常】的情况
|
//需要详细了解可能【接收异常】的情况
|
||||||
Log.Warning($"【WCS写入信息至地面站<接收异常>】任务号:{circleRGVStationCommand.Write_TaskNumber},PLC反馈【接收异常】!");
|
Log.Warning($"【WCS写入信息至地面站<接收异常>】任务号:{circleRGVStationCommand.Write_TaskNumber},PLC反馈【接收异常】!");
|
||||||
Log.Warning($"【WCS写入信息至地面站<接收异常>】任务号:{circleRGVStationCommand.Write_TaskNumber},校验码写入:{Checksum.GetChecksum(circleRGVStationCommand)},读取:{stationConnection.ReadInt16("DB60.904").Content},PLC反馈【接收异常】!");
|
Log.Warning($"【WCS写入信息至地面站<接收异常>】任务号:{circleRGVStationCommand.Write_TaskNumber},校验码写入:{Checksum.GetChecksum(circleRGVStationCommand)},读取:{stationConnection.ReadInt16("DB60.904").Content},PLC反馈【接收异常】!");
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
|
using Microsoft.Identity.Client.NativeInterop;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -11,6 +12,7 @@ using System.Runtime.Serialization;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using WPFWCSDemo.Data;
|
||||||
using WPFWCSDemo.Models.Tables;
|
using WPFWCSDemo.Models.Tables;
|
||||||
using WPFWCSDemo.StateCode;
|
using WPFWCSDemo.StateCode;
|
||||||
using WPFWCSDemo.Utilities;
|
using WPFWCSDemo.Utilities;
|
||||||
@@ -129,13 +131,16 @@ namespace WPFWCSDemo.ViewModels
|
|||||||
|
|
||||||
TaskHistory.Clear();
|
TaskHistory.Clear();
|
||||||
|
|
||||||
//DataTable? dtCount = SqlHelper.ExecuteTable("SELECT * FROM TASK_HISTORY ORDER BY CREATETIME DESC");
|
//using var context = new AppDbContext();
|
||||||
DataTable? dtCount = SqlHelper.ExecuteTable("SELECT * FROM TASK_HISTORY_VIEW ORDER BY 结束时间 DESC");
|
|
||||||
|
DataTable? dtCount = SqlHelper.ExecuteTable("SELECT TOP 30000 * FROM TASK_HISTORY_VIEW ORDER BY 结束时间 DESC");
|
||||||
|
|
||||||
|
|
||||||
//DataTable? dt = SqlHelper.ExecuteTable("SELECT * FROM TASK_HISTORY ORDER BY CREATETIME DESC OFFSET @Rows ROW FETCH NEXT 10 ROW ONLY",
|
|
||||||
DataTable? dt = SqlHelper.ExecuteTable("SELECT * FROM TASK_HISTORY_VIEW ORDER BY 结束时间 DESC OFFSET @Rows ROW FETCH NEXT 10 ROW ONLY",
|
DataTable? dt = SqlHelper.ExecuteTable("SELECT * FROM TASK_HISTORY_VIEW ORDER BY 结束时间 DESC OFFSET @Rows ROW FETCH NEXT 10 ROW ONLY",
|
||||||
new SqlParameter("@Rows",page - 1));
|
new SqlParameter("@Rows",page - 1));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var datas = dt.Rows;
|
var datas = dt.Rows;
|
||||||
|
|
||||||
//遍历表中每行数据并初始化值
|
//遍历表中每行数据并初始化值
|
||||||
@@ -285,7 +290,7 @@ namespace WPFWCSDemo.ViewModels
|
|||||||
{
|
{
|
||||||
dtCount = SqlHelper.ExecuteTable(
|
dtCount = SqlHelper.ExecuteTable(
|
||||||
//$"SELECT * FROM TASK_HISTORY WHERE @ColumnName like @Keywords AND FINISHTIME>=@StartTime AND FINISHTIME<@FinishTime ORDER BY CREATETIME DESC",
|
//$"SELECT * FROM TASK_HISTORY WHERE @ColumnName like @Keywords AND FINISHTIME>=@StartTime AND FINISHTIME<@FinishTime ORDER BY CREATETIME DESC",
|
||||||
$"SELECT * FROM TASK_HISTORY_VIEW WHERE {ColumnName} LIKE @Keywords AND 结束时间>=@StartTime AND 结束时间<@FinishTime ORDER BY 结束时间 DESC",
|
$"SELECT TOP 30000 * FROM TASK_HISTORY_VIEW WHERE {ColumnName} LIKE @Keywords AND 结束时间>=@StartTime AND 结束时间<@FinishTime ORDER BY 结束时间 DESC",
|
||||||
//new SqlParameter("@ColumnName", ColumnName),
|
//new SqlParameter("@ColumnName", ColumnName),
|
||||||
new SqlParameter("@Keywords", $"%{Keywords.Trim()}%"),
|
new SqlParameter("@Keywords", $"%{Keywords.Trim()}%"),
|
||||||
new SqlParameter("@StartTime", dateTimeStart),
|
new SqlParameter("@StartTime", dateTimeStart),
|
||||||
@@ -306,7 +311,7 @@ namespace WPFWCSDemo.ViewModels
|
|||||||
{
|
{
|
||||||
dtCount = SqlHelper.ExecuteTable(
|
dtCount = SqlHelper.ExecuteTable(
|
||||||
//$"SELECT * FROM TASK_HISTORY WHERE FINISHTIME>=@StartTime AND FINISHTIME<@FinishTime ORDER BY CREATETIME DESC",
|
//$"SELECT * FROM TASK_HISTORY WHERE FINISHTIME>=@StartTime AND FINISHTIME<@FinishTime ORDER BY CREATETIME DESC",
|
||||||
$"SELECT * FROM TASK_HISTORY_VIEW WHERE 结束时间>=@StartTime AND 结束时间<@FinishTime ORDER BY 结束时间 DESC",
|
$"SELECT TOP 30000 * FROM TASK_HISTORY_VIEW WHERE 结束时间>=@StartTime AND 结束时间<@FinishTime ORDER BY 结束时间 DESC",
|
||||||
new SqlParameter("@StartTime", dateTimeStart),
|
new SqlParameter("@StartTime", dateTimeStart),
|
||||||
new SqlParameter("@FinishTime", dateTimeEnd)
|
new SqlParameter("@FinishTime", dateTimeEnd)
|
||||||
);
|
);
|
||||||
@@ -505,10 +510,10 @@ namespace WPFWCSDemo.ViewModels
|
|||||||
void UpdatePageInfo(DataTable dt, int pageCurrent)
|
void UpdatePageInfo(DataTable dt, int pageCurrent)
|
||||||
{
|
{
|
||||||
//总数据条数
|
//总数据条数
|
||||||
DataCountNumber = dt.Rows.Count;
|
DataCountNumber = 30000;
|
||||||
|
|
||||||
//文本显示
|
//文本显示
|
||||||
DataCount = $"共 {DataCountNumber} 条";
|
DataCount = $"只显示最近5万条数据";
|
||||||
|
|
||||||
//总页数
|
//总页数
|
||||||
if (DataCountNumber % countPerPage == 0)
|
if (DataCountNumber % countPerPage == 0)
|
||||||
@@ -527,10 +532,10 @@ namespace WPFWCSDemo.ViewModels
|
|||||||
void UpdatePageInfo(DataTable dt, string pageCurrent)
|
void UpdatePageInfo(DataTable dt, string pageCurrent)
|
||||||
{
|
{
|
||||||
//总数据条数
|
//总数据条数
|
||||||
DataCountNumber = dt.Rows.Count;
|
DataCountNumber = 30000;
|
||||||
|
|
||||||
//文本显示
|
//文本显示
|
||||||
DataCount = $"共 {DataCountNumber} 条";
|
DataCount = $"只显示最近5万条数据";
|
||||||
|
|
||||||
//总页数
|
//总页数
|
||||||
if (DataCountNumber % countPerPage == 0)
|
if (DataCountNumber % countPerPage == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user