|
@@ -1,4 +1,6 @@
|
|
|
-using SCADA.Drive;
|
|
|
+using Mysqlx.Session;
|
|
|
+using SCADA.Drive;
|
|
|
+using SCADA_DAQ.Customer.Models;
|
|
|
using SCADA_DAQ.Customer.Models.BackOfSortingDelivery;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
@@ -52,9 +54,45 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
}
|
|
|
private Queue<int> _LeftLoversOrAbnormal = new Queue<int>();
|
|
|
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 异型通道板件队列
|
|
|
+ /// </summary>
|
|
|
+ public Queue<BoardModel> AbnormalBoards
|
|
|
+ {
|
|
|
+ get { return _AbnormalBoards; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ if (value != _AbnormalBoards)
|
|
|
+ {
|
|
|
+ _AbnormalBoards = value;
|
|
|
+ OnPropertyChanged(nameof(AbnormalBoards));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private Queue<BoardModel> _AbnormalBoards = new Queue<BoardModel>();
|
|
|
+
|
|
|
+
|
|
|
public string AlarmStr { get => string.Join(",", AlarmCollection.Select(t => t.Desc).ToList()); }
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 扫码状态
|
|
|
+ /// </summary>
|
|
|
+ public bool IsGetCode
|
|
|
+ {
|
|
|
+ get { return _IsGetCode; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ if (value != _IsGetCode)
|
|
|
+ {
|
|
|
+ _IsGetCode = value;
|
|
|
+ OnPropertyChanged(nameof(IsGetCode));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private bool _IsGetCode;
|
|
|
+
|
|
|
|
|
|
public SortingDeliveryMachine(string machieID) : base(machieID)
|
|
|
{
|
|
@@ -77,6 +115,26 @@ namespace SCADA_DAQ.Customer.Machines
|
|
|
log.Info("信号误触发!");
|
|
|
}
|
|
|
}
|
|
|
+ else if (reg.Comment.Variable == Tag_PLCGetCode && reg.Value == 1)
|
|
|
+ {
|
|
|
+ if (!IsGetCode)
|
|
|
+ {
|
|
|
+ GetListenReg(Tag_CodeMatch).WriteReg(2);
|
|
|
+ LeftLoversOrAbnormal.Enqueue(1);
|
|
|
+ log.Warn("板件已经经过扫码区域,但上位机没有收到读码器回复!");
|
|
|
+ }
|
|
|
+ IsGetCode = false;
|
|
|
+ reg.ResetBit();
|
|
|
+ }
|
|
|
+ else if (reg.Comment.Variable == Tag_AbnormalHadBoard && reg.Value == 1)
|
|
|
+ {
|
|
|
+ var board = AbnormalBoards.Dequeue();
|
|
|
+ //长度小于1500才平移
|
|
|
+ if (Math.Max(board.Width,board.Length) <= 1900)
|
|
|
+ {
|
|
|
+ GetListenReg(Tag_AbnormalTranslateMove).SetBit();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
protected override void AlarmReset(object sender, AlarmTriggedEventArgs e)
|