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.

60 lines
1.8 KiB

3 years ago
  1. using Aborlen.Model;
  2. using FrameWork.Log;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using WorkStationBase;
  9. namespace Aborlen.WorkStation
  10. {
  11. public partial class WorkStation03 : StationBase
  12. {
  13. public void SendOrderInfo(string stationCode, object value, DateTime triggerTime)
  14. {
  15. try
  16. {
  17. //查询订单信息 写入产品型号
  18. //更新系统订单
  19. PresentOrder = ProductOrder.Query().Where(p => p.plan_id == value.ToString()).First();
  20. //读取扫描完成
  21. if (Convert.ToInt32(Read(1080, DateTime.Now)) == 0)
  22. {
  23. Write(1180, (short)PresentOrder.product_id);
  24. OrderNum_OP30 = PresentOrder.plan_id;
  25. PlanCount_Op30 = Convert.ToInt32(PresentOrder.plan_account);
  26. //切换型号后 刷新界面
  27. View_OP40.OrderNum = OrderNum_OP30;
  28. View_OP40.PlanNum = PlanCount_Op30;
  29. SendMsg.SendMsgToStation(StationInfo.StationCode, "PlanNum", PlanCount_Op30);
  30. SendMsg.SendMsgToStation(StationInfo.StationCode, "StationCode", PresentOrder.product_name);
  31. SendMsg.SendMsgToStation(StationInfo.StationCode, "OrderNum", OrderNum_OP30);
  32. InitView_OP30(DateTime.Now);
  33. }
  34. else
  35. {
  36. SendMsg.SendMsgToStation("OP40", "AlarmMsg", "OP30当前工件放行后将切换新订单。");
  37. }
  38. }
  39. catch (Exception ex)
  40. {
  41. LogHelper.WriteLog(LogHelper.GetMethodInfo(), ex);
  42. }
  43. }
  44. }
  45. }