222
schangxiang@126.com
2024-12-09 b9e08c054b2d9a8f6d23535774dacd5406dc43ba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
 
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
    {
        /// <summary>
        /// 堆垛机开始和结束线程是否延迟操作
        /// </summary>
        /// <param name="deviceId"></param>
        /// <param name="threadDirectionEnum"></param>
        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;
                }
            }
        }
    }
}