|
|
@ -3253,6 +3253,38 @@ namespace WcfControlMonitorLib |
|
|
|
this.CControlError += string.Format("发送命令时不能取得设备坐标!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
#region 同起点存在多条等待下发任务,异常控制
|
|
|
|
if (deviceKind == 2)//
|
|
|
|
{//输送线,直穿,环穿
|
|
|
|
int StartStation = GetMonitorStartStationfromMonitor(MonitorIndex);//起点站台
|
|
|
|
DataView taskMsgs = new DataView(); |
|
|
|
//获取同起点的等待下发的子任务信息
|
|
|
|
taskMsgs = dbo.ExceSQL(string.Format("select F_ManageTaskIndex,F_MonitorIndex" + |
|
|
|
" from T_Monitor_Task where F_NumParam1={0} and F_Status=0 ", |
|
|
|
StartStation)).Tables[0].DefaultView; |
|
|
|
//筛选其中正要准备下发的任务
|
|
|
|
int count = 0; |
|
|
|
foreach (DataRowView taskMsg in taskMsgs) |
|
|
|
{ |
|
|
|
var taskNumMin = dbo.ExceSQL(string.Format("select top 1 F_MonitorIndex" + |
|
|
|
" from T_Monitor_Task where F_ManageTaskIndex={0} order by F_MonitorIndex", |
|
|
|
taskMsg["F_ManageTaskIndex"])).Tables[0].DefaultView; |
|
|
|
var MinTaskNum = taskNumMin[0]["F_MonitorIndex"].ToString(); |
|
|
|
var NowTaskNum = taskMsg["F_MonitorIndex"].ToString(); |
|
|
|
if (MinTaskNum == NowTaskNum) |
|
|
|
{//最小任务==当前任务,计数加1
|
|
|
|
count++; |
|
|
|
} |
|
|
|
} |
|
|
|
if (count > 1) |
|
|
|
{ |
|
|
|
AheadDetectUnallow.Clear(); |
|
|
|
AheadDetectUnallow.Append(string.Format("当前任务起点存在多条等待下发的任务,请处理异常任务", deviceIdx)); |
|
|
|
UpdateAheadDetectUnallow(AheadDetectUnallow, MonitorIndex); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
if ((deviceKind == 1) || (deviceKind == 6)) |
|
|
|
{ |
|
|
|
|
|
|
@ -6128,21 +6160,53 @@ namespace WcfControlMonitorLib |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="MonitorIdx"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
public int GetMonitorStartStationfromMonitor(int MonitorIdx) |
|
|
|
{ |
|
|
|
DataView dv = new DataView(); |
|
|
|
try |
|
|
|
{ |
|
|
|
//20100108
|
|
|
|
//20101124
|
|
|
|
sql.Remove(0, sql.Length); |
|
|
|
sql.Append("SELECT F_NumParam1 FROM T_Monitor_Task WHERE (F_MonitorIndex = ").Append(MonitorIdx).Append(")"); |
|
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; |
|
|
|
if (dv.Count > 0) |
|
|
|
{ |
|
|
|
return Convert.ToInt32(dv[0]["F_NumParam1"]); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
return -1; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{//20100108
|
|
|
|
throw ex; |
|
|
|
} |
|
|
|
finally |
|
|
|
{//20100108
|
|
|
|
dv.Dispose(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
* 方法名:compareGoalAndSearchManageGoal |
|
|
|
* 作 者:LYJ |
|
|
|
* 方法功能:比较传入的目标位置和将取的目标位置是否一致,如果一致返回true,不一致返回false |
|
|
|
* 参数介绍:goalcellcode传入的目标位置 |
|
|
|
* 返 回 值:返回true表示相同,false表示不同 |
|
|
|
* 完成日期:2018/01/15 |
|
|
|
* 维护人员: |
|
|
|
* 维护日期: |
|
|
|
* 维护原因: |
|
|
|
* 当前版本:1.0 |
|
|
|
* 前继版本:1.0beta |
|
|
|
*/ |
|
|
|
/* |
|
|
|
* 方法名:compareGoalAndSearchManageGoal |
|
|
|
* 作 者:LYJ |
|
|
|
* 方法功能:比较传入的目标位置和将取的目标位置是否一致,如果一致返回true,不一致返回false |
|
|
|
* 参数介绍:goalcellcode传入的目标位置 |
|
|
|
* 返 回 值:返回true表示相同,false表示不同 |
|
|
|
* 完成日期:2018/01/15 |
|
|
|
* 维护人员: |
|
|
|
* 维护日期: |
|
|
|
* 维护原因: |
|
|
|
* 当前版本:1.0 |
|
|
|
* 前继版本:1.0beta |
|
|
|
*/ |
|
|
|
|
|
|
|
public bool compareGoalAndSearchManageGoal(string goalcellcode) |
|
|
|
{ |
|
|
|