DataSeeding.cs
4.31 KB
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
using HHECS.DAQClient.Common.Enums;
using HHECS.DAQClient.Model;
using HHECS.EquipmentModel;
using System.Xml.Linq;
namespace HHECS.DAQClient.DataAccess
{
/// <summary>
/// 种子数据
/// </summary>
public static class DataSeeding
{
public static List<CommunicationConfig> GetCommunicationConfigs()
{
var temps = new List<CommunicationConfig>
{
new CommunicationConfig
{
Code = "PLC1",
Name = "西门子S1500",
CommunicationType = CommunicationTypeConst.Siemens_S1500,
IpAddress = "127.0.0.1",
Port = 102,
Area = "1",
Disable = true,
},
};
return temps;
}
public static List<Equipment> GetEquipment()
{
var temps = new List<Equipment>();
return temps;
}
public static List<EquipmentProp> GetEquipmentProperties()
{
var temps = new List<EquipmentProp>();
return temps;
}
public static List<EquipmentType> GetEquipmentTypes()
{
var temps = new List<EquipmentType>
{
new EquipmentType
{
Id = 1,
Code = EquipmentTypeConst.SingleSRM.ToString(),
Name = "单叉堆垛机",
Description = string.Empty,
},
new EquipmentType
{
Id = 2,
Code = EquipmentTypeConst.DoubleSRM.ToString(),
Name = "双叉堆垛机",
Description = string.Empty,
}
};
return temps;
}
/// <summary>
/// 获取所有设备属性模板
/// </summary>
/// <returns></returns>
public static List<EquipmentTypePropTemplate> GetEquipmentTypePropTemplates()
{
var doubleSRMPropTemplates = GetDoubleSRMPropTemplates();
var singleSRMPropTemplates = GetSingleSRMPropTemplates();
var temps = new List<EquipmentTypePropTemplate>();
temps.AddRange(doubleSRMPropTemplates);
temps.AddRange(singleSRMPropTemplates);
return temps;
}
/// <summary>
/// 单叉堆垛机属性模板
/// </summary>
/// <returns></returns>
private static List<EquipmentTypePropTemplate> GetSingleSRMPropTemplates()
{
var temps = new List<EquipmentTypePropTemplate>
{
new EquipmentTypePropTemplate
{
Code = SingleSRMPropConst.Code1.ToString(),
Name = "属性1",
Address = "DB100.0.0",
DataType = EquipmentDataType.WORD,
PropType = EquipmentPropType.PLCDataAddress,
MonitorCompareValue = string.Empty,
Description = string.Empty,
MonitorFailure = string.Empty,
MonitorNormal = string.Empty,
},
};
temps.ForEach(x =>
{
x.EquipmentTypeId = 1;
});
return temps;
}
/// <summary>
/// 双叉堆垛机属性模板
/// </summary>
/// <returns></returns>
private static List<EquipmentTypePropTemplate> GetDoubleSRMPropTemplates()
{
var temps = new List<EquipmentTypePropTemplate>
{
new EquipmentTypePropTemplate
{
Code = DoubleSRMPropConst.Code1.ToString(),
Name = "属性1",
Address = "DB100.0.0",
DataType = EquipmentDataType.WORD,
PropType = EquipmentPropType.PLCDataAddress,
MonitorCompareValue = string.Empty,
Description = string.Empty,
MonitorFailure = string.Empty,
MonitorNormal = string.Empty,
},
};
temps.ForEach(x =>
{
x.EquipmentTypeId = 2;
});
return temps;
}
}
}