DataSeeding.cs 17 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 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 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408
using DataAcquisition.Common.Enums;
using DataAcquisition.Models;

namespace DataAcquisition.DataAccess
{
    public static class DataSeeding
    {
        internal static List<EquipmentProperty> GetEquipmentProperties()
        {
            var data = new List<EquipmentProperty>
            {
                #region Fanuc 属性

                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Weld_V.ToString(),
                    Name = "焊接电压",
                    DataAddress = "DB7101.0.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "读取焊接电源反馈的焊接电压;WCS转换成REAL类型,做动态显示",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Weld_I.ToString(),
                    Name = "焊接电流",
                    DataAddress = "DB7101.4.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "读取焊接电源反馈的焊接电流;WCS转换成REAL类型,做动态显示",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Weld_Speed.ToString(),
                    Name = "焊接送丝速度",
                    DataAddress = "DB7101.8.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "读取焊接电源反馈的焊接送丝速度;WCS转换成REAL类型,计算焊丝消耗量,送丝速度✖️截面积,每1s采集一次再累加",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Work_Mode.ToString(),
                    Name = "工作模式",
                    DataAddress = "DB7101.12.0",
                    DataType= DataTypeConst.Int16,
                    Enable = true,
                    Remark = "1:T1模式,2:T2模式;3:自动模式;4:外部自动模式;WCS做状态显示,及做设备利用率计算;",
                    CreateTime = DateTime.Now,
                },
                //new EquipmentProperty
                //{
                //    EquipmentId = 1,
                //    Code = RobotProps.Type.ToString(),
                //    Name = "工件型号",
                //    DataAddress = "DB7101.14.0",
                //    DataType= DataTypeConst.Int16,
                //    Enable = true,
                //    Remark = "机器人示教程序开始给定,",
                //    CreateTime = DateTime.Now,
                //},
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Type.ToString(),
                    Name = "工件型号",
                    DataAddress = "DB7101.64,10",
                    DataType= DataTypeConst.String,
                    Enable = true,
                    Remark = "机器人示教程序开始给定,",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Program_No.ToString(),
                    Name = "程序号",
                    DataAddress = "DB7101.16.0",
                    DataType= DataTypeConst.Int16,
                    Enable = true,
                    Remark = "读取当前自动运行的程序号;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Station.ToString(),
                    Name = "当前焊接工位",
                    DataAddress = "DB7101.18.0",
                    DataType= DataTypeConst.Int16,
                    Enable = true,
                    Remark = "1:工位一,2:工位二;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Pos_X.ToString(),
                    Name = "X轴位置",
                    DataAddress = "DB7101.20.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "读取机器人本体世界坐标值,WCS做数字孪生显示;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Pos_Y.ToString(),
                    Name = "Y轴位置",
                    DataAddress = "DB7101.24.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "读取机器人本体世界坐标值,WCS做数字孪生显示;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Pos_Z.ToString(),
                    Name = "Z轴位置",
                    DataAddress = "DB7101.28.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "读取机器人本体世界坐标值,WCS做数字孪生显示;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Pos_A.ToString(),
                    Name = "A轴位置",
                    DataAddress = "DB7101.32.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "读取机器人本体世界坐标值,WCS做数字孪生显示;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Pos_B.ToString(),
                    Name = "B轴位置",
                    DataAddress = "DB7101.36.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "读取机器人本体世界坐标值,WCS做数字孪生显示;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Pos_C.ToString(),
                    Name = "C轴位置",
                    DataAddress = "DB7101.40.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "读取机器人本体世界坐标值,WCS做数字孪生显示;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Pos_E1.ToString(),
                    Name = "E1轴位置",
                    DataAddress = "DB7101.44.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "读取机器人本体世界坐标值,WCS做数字孪生显示;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Pos_E2.ToString(),
                    Name = "E2轴位置",
                    DataAddress = "DB7101.48.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "读取机器人本体世界坐标值,WCS做数字孪生显示;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Pos_E3.ToString(),
                    Name = "E3轴位置",
                    DataAddress = "DB7101.52.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "读取机器人本体世界坐标值,WCS做数字孪生显示;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Pos_E4.ToString(),
                    Name = "E4轴位置",
                    DataAddress = "DB7101.56.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "读取机器人本体世界坐标值,WCS做数字孪生显示;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.BootFlag.ToString(),
                    Name = "开机标志",
                    DataAddress = "DB7101.60.0",
                    DataType= DataTypeConst.Bool,
                    Enable = true,
                    Remark = "机器人红绿黄指示灯任意一个亮通电为TRUE;WCS计算当日开机累计时间,在线率计算=每日开机累计时间/24小时;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.WorkFlag.ToString(),
                    Name = "工作标志",
                    DataAddress = "DB7101.60.1",
                    DataType= DataTypeConst.Bool,
                    Enable = true,
                    Remark = "绿灯机器人自动运行时为TRUE;WCS计算当日工作累计时间,利用率计算=每日运行累计时间/每日开机累计时间;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.WeldFlag.ToString(),
                    Name = "焊接标志",
                    DataAddress = "DB7101.60.2",
                    DataType= DataTypeConst.Bool,
                    Enable = true,
                    Remark = "焊接时为TRUE;WCS计算当日焊接燃弧累计时间;燃弧率计算=每日燃弧累计时间/每日运行累计时间;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.WeldCompleteFlag.ToString(),
                    Name = "焊接完成标志",
                    DataAddress = "DB7101.60.3",
                    DataType= DataTypeConst.Bool,
                    Enable = true,
                    Remark = "焊接程序完成,焊接程序开始清零;焊接开始时为True,焊接结束时为False;WCS统计当日产量;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Weld_Gas.ToString(),
                    Name = "焊接送气状态",
                    DataAddress = "DB7101.60.4",
                    DataType= DataTypeConst.Bool,
                    Enable = true,
                    Remark = "有气为TRUE;WCS做状态显示;",
                    CreateTime = DateTime.Now,
                },

                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Weld_CleanGun.ToString(),
                    Name = "焊接清枪状态",
                    DataAddress = "DB7101.60.5",
                    DataType= DataTypeConst.Bool,
                    Enable = true,
                    Remark = "运行清枪程序时为TRUE;WCS做状态显示;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Alarm.ToString(),
                    Name = "报警",
                    DataAddress = "DB7101.60.6",
                    DataType= DataTypeConst.Bool,
                    Enable = true,
                    Remark = "TRUE为报警,False为无报警;WCS做状态显示;计算报警时间;报警率计算=每日报警累计时间/每日开机累计时间;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Work_Time.ToString(),
                    Name = "工作时长",
                    DataAddress = "DB7101.60.7",
                    DataType= DataTypeConst.Bool,
                    Enable = true,
                    Remark = "机器人焊接开始时为TRUE;焊接结束时为FALSE;可以为数据分析、报表做准备;",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Weld_Type.ToString(),
                    Name = "焊接方式",
                    DataAddress = "DB7101.61.0",
                    DataType= DataTypeConst.Bool,
                    Enable = true,
                    Remark = "true为焊接,false为模拟",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.ArcVoltageTracking.ToString(),
                    Name = "弧压跟踪",
                    DataAddress = "DB7101.61.1",
                    DataType= DataTypeConst.Bool,
                    Enable = true,
                    Remark = "true为开启,false为关闭",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.WireFeeder.ToString(),
                    Name = "送丝机选择",
                    DataAddress = "DB7101.62",
                    DataType= DataTypeConst.Int16,
                    Enable = true,
                    Remark = "0:无数据,1:送丝机1#,2:送丝机2#",
                    CreateTime = DateTime.Now,
                },

                #endregion
                
                #region Write

                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Weld_statistics_Day.ToString(),
                    Name = "焊丝统计/日",
                    DataAddress = "DB7102.0",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "WCS写入_日焊丝消耗量",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.Weld_statistics_Month.ToString(),
                    Name = "焊丝统计/月",
                    DataAddress = "DB7102.4",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "WCS写入_月焊丝消耗量",
                    CreateTime = DateTime.Now,
                },

                #endregion
            };
            var i = 1;
            data.ForEach(x => x.Id = i++);

            return data;
        }

        internal static List<Equipment> GetEquipments()
        {
            var data = new List<Equipment>
            {
                new Equipment
                {
                    Id = 1,
                    Code = EquipmentConst.Fanuc_1.ToString(),
                    Name = "发那科机器人",
                    CommunicationId = 1,
                    Enable = true,
                    Area = 1,
                    EquipmentType = EquipmentTypeConst.Fanuc,
                    EquipmentSN = "",
                    CreateTime = DateTime.Now,
                }
            };
            return data;
        }

        internal static List<CommunicationConfig> GetCommunicationConfigs()
        {
            var data = new List<CommunicationConfig>
            {
                new CommunicationConfig
                {
                    Id = 1,
                    Code = "SiemensPLC",
                    Name = "西门子S1200_S7通信",
                    CommunicationType = CommunicationTypeConst.Siemens_S1200,
                    Enable = true,
                    IpAddress = "192.168.174.10",
                    Port = 102
                },
            };
            return data;
        }
    }
}