schangxiang@126.com
2025-09-19 0821aa23eabe557c0d9ef5dbe6989c68be35d1fe
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
using IWareCC.ChaiDie.Entity;
using IWareCC.Conveyor.Entity;
using IWareCC.RGV.Entity;
using IWareCC.SRM.Entity;
using IWareCommon.Enum.Common;
using S7.Net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace IWareCC.CacheInfo
{
  public   class CacheEntity
    {
 
        private static object srmLock = new object();
 
        private static List<SrmEntity> srms = null;
 
        /// <summary>
        /// 生成堆垛机实体类
        /// </summary>
        public static List<SrmEntity> Srms
        {
            get
            {
                if (srms == null)
                {
                    lock (srmLock)
                    {
                        if (srms == null)
                        {
                            srms = new List<SrmEntity>();
                            CpuType t = (CpuType)Enum.Parse(typeof(CpuType), "S71200");
                            srms.Add(new SrmEntity("Srm1", (int)EDeviceId.小盘堆垛机, new PlcS7(t, "192.168.0.200", 0, 1)));
                            srms.Add(new SrmEntity("Srm2", (int)EDeviceId.大盘堆垛机, new PlcS7(t, "192.168.0.210", 0, 1)));
                        }
                    }
                }
                return CacheEntity.srms;
            }
            set { CacheEntity.srms = value; }
        }
        private static object rgvLock = new object();
 
        private static List<RgvEntity> rgvs = null;
 
        /// <summary>
        /// 生成RGV实体类
        /// </summary>
        public static List<RgvEntity> Rgvs
        {
            get
            {
                if (rgvs == null)
                {
                    lock (rgvLock)
                    {
                        if (rgvs == null)
                        {
                            rgvs = new List<RgvEntity>();
                            CpuType t = (CpuType)Enum.Parse(typeof(CpuType), "S71200");
                            rgvs.Add(new RgvEntity("Rgv1", (int)EDeviceId.入库口Rgv, new PlcS7(t, "192.168.0.1", 0, 1)));
                            rgvs.Add(new RgvEntity("Rgv2", (int)EDeviceId.出库口Rgv, new PlcS7(t, "192.168.0.10", 0, 1)));
                        }
                    }
                }
                return CacheEntity.rgvs;
            }
            set { CacheEntity.rgvs = value; }
        }
        private static object conveyorLock = new object();
 
        private static List<ConveyorEntity> conveyors = null;
 
        /// <summary>
        /// 生成输送线实体类
        /// </summary>
        public static List<ConveyorEntity> Conveyors
        {
            get
            {
                if (conveyors == null)
                {
                    lock (conveyorLock)
                    {
                        if (conveyors == null)
                        {
                            conveyors = new List<ConveyorEntity>();
                            CpuType t = (CpuType)Enum.Parse(typeof(CpuType), "S71200");
                            PlcS7 plc = new PlcS7(t, "192.168.0.20", 0, 1);
                            #region 入库口线体
                            conveyors.Add(new ConveyorEntity("Line1030", (int)EDeviceId.Line1030号输送线,1, plc));
                            conveyors.Add(new ConveyorEntity("Line1031", (int)EDeviceId.Line1031号输送线,1, plc));
                            conveyors.Add(new ConveyorEntity("Line1032", (int)EDeviceId.Line1032号输送线,1, plc));
                            conveyors.Add(new ConveyorEntity("Line1033", (int)EDeviceId.Line1033号输送线,1, plc)); 
                            #endregion
                            #region 出库口线体
                            conveyors.Add(new ConveyorEntity("Line1013", (int)EDeviceId.Line1013号输送线,2, plc));
                            conveyors.Add(new ConveyorEntity("Line1014", (int)EDeviceId.Line1014号输送线,2, plc));
                            conveyors.Add(new ConveyorEntity("Line1015", (int)EDeviceId.Line1015号输送线,2, plc));
                            conveyors.Add(new ConveyorEntity("Line1016", (int)EDeviceId.Line1016号输送线,2, plc)); 
                            #endregion
                            #region 入库小盘线体
                            conveyors.Add(new ConveyorEntity("Line1021", (int)EDeviceId.Line1021号输送线,3, plc));
                            conveyors.Add(new ConveyorEntity("Line1022", (int)EDeviceId.Line1022号输送线,3, plc));
                            conveyors.Add(new ConveyorEntity("Line1023", (int)EDeviceId.Line1023号输送线,3, plc));
                            conveyors.Add(new ConveyorEntity("Line1024", (int)EDeviceId.Line1024号输送线,3, plc));
                            #endregion
                            #region 入库大盘线体
                            conveyors.Add(new ConveyorEntity("Line1026", (int)EDeviceId.Line1026号输送线,4, plc));
                            conveyors.Add(new ConveyorEntity("Line1027", (int)EDeviceId.Line1027号输送线,4, plc));
                            conveyors.Add(new ConveyorEntity("Line1028", (int)EDeviceId.Line1028号输送线,4, plc));
                            conveyors.Add(new ConveyorEntity("Line1029", (int)EDeviceId.Line1029号输送线,4, plc)); 
                            #endregion
                            #region 人工分拣线体
                            conveyors.Add(new ConveyorEntity("Line1001", (int)EDeviceId.Line1001号输送线,5, plc));
                            #endregion
                            #region 助力臂分拣1线体
                            conveyors.Add(new ConveyorEntity("Line1002", (int)EDeviceId.Line1002号输送线,6, plc));
                            conveyors.Add(new ConveyorEntity("Line1003", (int)EDeviceId.Line1003号输送线,6, plc));
                            conveyors.Add(new ConveyorEntity("Line1006", (int)EDeviceId.Line1006号输送线,6, plc));
                            #endregion
                            #region 助力臂分拣2线体
                            conveyors.Add(new ConveyorEntity("Line1007", (int)EDeviceId.Line1007号输送线,7, plc));
                            conveyors.Add(new ConveyorEntity("Line1008", (int)EDeviceId.Line1008号输送线,7, plc));
                            conveyors.Add(new ConveyorEntity("Line1012", (int)EDeviceId.Line1012号输送线,7, plc));
                            #endregion
                   
                        }
                    }
                }
                return CacheEntity.conveyors;
            }
            set { CacheEntity.conveyors = value; }
        }
        private static object chaidieLock = new object();
 
        private static List<ChaiDieEntity> chaidies = null;
 
        /// <summary>
        /// 生成拆叠机实体类
        /// </summary>
        public static List<ChaiDieEntity> ChaiDies
        {
            get
            {
                if (chaidies == null)
                {
                    lock (chaidieLock)
                    {
                        if (chaidies == null)
                        {
                            chaidies = new List<ChaiDieEntity>();
                            CpuType t = (CpuType)Enum.Parse(typeof(CpuType), "S71200");
                            PlcS7 plc = new PlcS7(t, "192.168.0.20", 0, 1);
                            chaidies.Add(new ChaiDieEntity("ChaiDei3", (int)EDeviceId.小盘拆盘机, plc));
                            chaidies.Add(new ChaiDieEntity("ChaiDei4", (int)EDeviceId.大盘拆盘机, plc));
                            chaidies.Add(new ChaiDieEntity("ChaiDei1", (int)EDeviceId.大盘叠盘机, plc));
                            chaidies.Add(new ChaiDieEntity("ChaiDei2", (int)EDeviceId.小盘叠盘机, plc));
                        }
                    }
                }
                return CacheEntity.chaidies;
            }
            set { CacheEntity.chaidies = value; }
        }
 
    }
}