using iWareModel; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace iWareCC.Common { public class SystemValueUtil { /// /// 堆垛机开始和结束线程是否延迟操作 /// /// /// public static void DelayExcuteForSrmTaskThreadService(int deviceId, ThreadDirectionEnum threadDirectionEnum) { if (deviceId == (int)EDevice.一号堆垛机) { switch (threadDirectionEnum) { case ThreadDirectionEnum.任务开始下发线程: SystemValue.isDelayExcute_SrmTaskThreadService_1_Finish = true; break; case ThreadDirectionEnum.任务完成线程: SystemValue.isDelayExcute_SrmTaskThreadService_1_Finish = false; Thread.Sleep(SystemValue.DelayExcuteNumber); break; } } else if (deviceId == (int)EDevice.二号堆垛机) { switch (threadDirectionEnum) { case ThreadDirectionEnum.任务开始下发线程: SystemValue.isDelayExcute_SrmTaskThreadService_2_Finish = true; break; case ThreadDirectionEnum.任务完成线程: SystemValue.isDelayExcute_SrmTaskThreadService_2_Finish = false; Thread.Sleep(SystemValue.DelayExcuteNumber); break; } } else if (deviceId == (int)EDevice.三号堆垛机) { switch (threadDirectionEnum) { case ThreadDirectionEnum.任务开始下发线程: SystemValue.isDelayExcute_SrmTaskThreadService_3_Finish = true; break; case ThreadDirectionEnum.任务完成线程: SystemValue.isDelayExcute_SrmTaskThreadService_3_Finish = false; Thread.Sleep(SystemValue.DelayExcuteNumber); break; } } else if (deviceId == (int)EDevice.四号堆垛机) { switch (threadDirectionEnum) { case ThreadDirectionEnum.任务开始下发线程: SystemValue.isDelayExcute_SrmTaskThreadService_4_Finish = true; break; case ThreadDirectionEnum.任务完成线程: SystemValue.isDelayExcute_SrmTaskThreadService_4_Finish = false; Thread.Sleep(SystemValue.DelayExcuteNumber); break; } } } } }