You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.0 KiB

3 years ago
  1. using Aborlen.Model;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using WorkStationBase;
  8. namespace Aborlen.WorkStation
  9. {
  10. public partial class WorkStation03 : StationBase
  11. {
  12. /// <summary>
  13. /// 定时循环
  14. /// </summary>
  15. /// <param name="stationCode"></param>
  16. /// <param name="value"></param>
  17. /// <param name="triggerTime"></param>
  18. public override void CycleTimerTick()
  19. {
  20. //循环读当前订单型号
  21. PresentOrder = ProductOrder.Query().OrderBy(p=>p.id,SqlSugar.OrderByType.Desc).First();
  22. if (Read(1180).ToString()!= PresentOrder.product_id.ToString())
  23. {
  24. //判断是否扫描完成物料 如果扫描完成 则下个工件到达时切换订单,如果未扫描完成,则直接更新上线单号
  25. //读取扫描完成
  26. if(Convert.ToInt32(Read(1080, DateTime.Now)) == 0)
  27. {
  28. Write(1180, (short)PresentOrder.product_id);
  29. OrderNum_OP30 = PresentOrder.plan_id;
  30. PlanCount_Op30 = Convert.ToInt32(PresentOrder.plan_account);
  31. //切换型号后 刷新界面
  32. View_OP40.OrderNum = OrderNum_OP30;
  33. View_OP40.PlanNum = PlanCount_Op30;
  34. SendMsg.SendMsgToStation(StationInfo.StationCode, "PlanNum", PlanCount_Op30);
  35. SendMsg.SendMsgToStation(StationInfo.StationCode, "OrderNum", OrderNum_OP30);
  36. SendMsg.SendMsgToStation(StationInfo.StationCode, "StationCode", PresentOrder.product_name);
  37. InitView_OP30(DateTime.Now);
  38. }
  39. }
  40. ///循环写入产品型号 防止停线
  41. ///
  42. //if (PresentOrder != null)
  43. //{
  44. // Write(1180, (short)PresentOrder.product_id);
  45. //}
  46. }
  47. }
  48. }