DataSeeding.cs 16.1 KB
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.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.Float,
                    Enable = true,
                    Remark = "true为焊接,false为模拟",
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProps.ArcVoltageTracking.ToString(),
                    Name = "弧压跟踪",
                    DataAddress = "DB7101.61.1",
                    DataType= DataTypeConst.Float,
                    Enable = true,
                    Remark = "true为开启,false为关闭",
                    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.2.61",
                    Port = 102
                },
            };
            return data;
        }
    }
}