生成任务校验优化
This commit is contained in:
@@ -45,7 +45,7 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
|
|
||||||
//校验---如果已经存在处于【取货阶段】的某个【空托】任务
|
//校验---如果已经存在处于【取货阶段】的某个【空托】任务
|
||||||
//由于【空托任务】输送线的源站点唯一,因此必须等待该任务取货完成才能生成新的【空托】任务
|
//由于【空托任务】输送线的源站点唯一,因此必须等待该任务取货完成才能生成新的【空托】任务
|
||||||
if (!IsPalletConvHasGettingTask()) return false;
|
if (!IsPalletLineHasTask()) return false;
|
||||||
|
|
||||||
//校验---当前输送线存在【空托】任务
|
//校验---当前输送线存在【空托】任务
|
||||||
if (!GetRGVTaskForPalletsIsExist(targetLocation)) return false;
|
if (!GetRGVTaskForPalletsIsExist(targetLocation)) return false;
|
||||||
@@ -134,6 +134,7 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 防错机制【用于避免请求延迟的重复下发】--- 检测上一条【空托】任务放货时间(完成时间)与当前时间是否相差x秒以上
|
/// 防错机制【用于避免请求延迟的重复下发】--- 检测上一条【空托】任务放货时间(完成时间)与当前时间是否相差x秒以上
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -141,7 +142,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 +161,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>
|
||||||
@@ -205,10 +207,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 +284,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++)
|
||||||
@@ -392,7 +395,7 @@ namespace WPFWCSDemo.Schedules.CircleRGV
|
|||||||
// 任务处于【取货阶段】
|
// 任务处于【取货阶段】
|
||||||
// 无【允许下发】---表示小车在工作中
|
// 无【允许下发】---表示小车在工作中
|
||||||
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_Permission)
|
||||||
.Count();
|
.Count();
|
||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
@@ -411,7 +414,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();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user