using Aborlen.Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WorkStationBase; namespace Aborlen.WorkStation { public partial class WorkStation03 : StationBase { /// /// 定时循环 /// /// /// /// public override void CycleTimerTick() { //循环读当前订单型号 PresentOrder = ProductOrder.Query().OrderBy(p=>p.id,SqlSugar.OrderByType.Desc).First(); if (Read(1180).ToString()!= PresentOrder.product_id.ToString()) { //判断是否扫描完成物料 如果扫描完成 则下个工件到达时切换订单,如果未扫描完成,则直接更新上线单号 //读取扫描完成 if(Convert.ToInt32(Read(1080, DateTime.Now)) == 0) { Write(1180, (short)PresentOrder.product_id); OrderNum_OP30 = PresentOrder.plan_id; PlanCount_Op30 = Convert.ToInt32(PresentOrder.plan_account); //切换型号后 刷新界面 View_OP40.OrderNum = OrderNum_OP30; View_OP40.PlanNum = PlanCount_Op30; SendMsg.SendMsgToStation(StationInfo.StationCode, "PlanNum", PlanCount_Op30); SendMsg.SendMsgToStation(StationInfo.StationCode, "OrderNum", OrderNum_OP30); SendMsg.SendMsgToStation(StationInfo.StationCode, "StationCode", PresentOrder.product_name); InitView_OP30(DateTime.Now); } } ///循环写入产品型号 防止停线 /// //if (PresentOrder != null) //{ // Write(1180, (short)PresentOrder.product_id); //} } } }