DataSeeding.cs 11.8 KB
using HHECS.RobotTool.Common.Enums;
using HHECS.RobotTool.Model;

namespace HHECS.RobotTool.DataAccess
{
    /// <summary>
    /// 种子数据
    /// </summary>
    public static class DataSeeding
    {
        public static List<CommunicationConfig> GetCommunicationConfigs()
        {
            var communicationConfigs = new List<CommunicationConfig>
            {
                new CommunicationConfig
                {
                    Id = 1,
                    Code = "PLC_1",
                    Name = "西门子PLC",
                    IpAddress = "192.168.2.61",
                    Enable = true,
                    CommunicationType = CommunicationTypeConst.Siemens_S1200,
                    Port = 102,
                    CreateTime = DateTime.Now,
                }
            };
            return communicationConfigs;
        }

        public static List<Equipment> GetEquipment()
        {
            var equipments = new List<Equipment>
            {
                new Equipment
                {
                    Id = 1,
                    CommunicationId = 1,
                    Code = "Fanuc_1",
                    Name = "Fanuc机器人",
                    Enable = true,
                    CreateTime = DateTime.Now,
                }
            };
            return equipments;
        }

        public static List<EquipmentProperty> GetEquipmentProps()
        {
            var props = new List<EquipmentProperty>
            {
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Date_Send.ToString(),
                    Name = "机器人请求信号",
                    DataAddress = "DB7101.71.0",
                    DataType = DataTypeConst.Bool,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.GrooveWidth.ToString(),
                    Name = "坡口宽度",
                    DataAddress = "DB7101.72.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.GrooveDepth.ToString(),
                    Name = "坡口深度",
                    DataAddress = "DB7101.74.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Weld_Num.ToString(),
                    Name = "焊接道数",
                    DataAddress = "DB7102.8.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Speed_1.ToString(),
                    Name = "1道速度",
                    DataAddress = "DB7102.10.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Freq_1.ToString(),
                    Name = "1道频率",
                    DataAddress = "DB7102.12.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Swing_1.ToString(),
                    Name = "1道摆幅",
                    DataAddress = "DB7102.14.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Stay_1.ToString(),
                    Name = "1道摆停",
                    DataAddress = "DB7102.16.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },

                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Speed_2.ToString(),
                    Name = "2道速度",
                    DataAddress = "DB7102.18.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Freq_2.ToString(),
                    Name = "2道频率",
                    DataAddress = "DB7102.20.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Swing_2.ToString(),
                    Name = "2道摆幅",
                    DataAddress = "DB7102.22.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Stay_2.ToString(),
                    Name = "2道摆停",
                    DataAddress = "DB7102.24.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Speed_3.ToString(),
                    Name = "3道速度",
                    DataAddress = "DB7102.26.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Freq_3.ToString(),
                    Name = "3道频率",
                    DataAddress = "DB7102.28.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Swing_3.ToString(),
                    Name = "3道摆幅",
                    DataAddress = "DB7102.30.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Stay_3.ToString(),
                    Name = "3道摆停",
                    DataAddress = "DB7102.32.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Speed_4.ToString(),
                    Name = "4道速度",
                    DataAddress = "DB7102.34.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Freq_4.ToString(),
                    Name = "4道频率",
                    DataAddress = "DB7102.36.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Swing_4.ToString(),
                    Name = "4道摆幅",
                    DataAddress = "DB7102.38.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Stay_4.ToString(),
                    Name = "4道摆停",
                    DataAddress = "DB7102.40.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Speed_5.ToString(),
                    Name = "5道速度",
                    DataAddress = "DB7102.42.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Freq_5.ToString(),
                    Name = "5道频率",
                    DataAddress = "DB7102.44.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Swing_5.ToString(),
                    Name = "5道摆幅",
                    DataAddress = "DB7102.46.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Stay_5.ToString(),
                    Name = "5道摆停",
                    DataAddress = "DB7102.48.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Speed_6.ToString(),
                    Name = "6道速度",
                    DataAddress = "DB7102.50.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Freq_6.ToString(),
                    Name = "6道频率",
                    DataAddress = "DB7102.52.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Swing_6.ToString(),
                    Name = "6道摆幅",
                    DataAddress = "DB7102.54.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Stay_6.ToString(),
                    Name = "6道摆停",
                    DataAddress = "DB7102.56.0",
                    DataType = DataTypeConst.Int16,
                    CreateTime = DateTime.Now,
                },
                new EquipmentProperty
                {
                    EquipmentId = 1,
                    Code = RobotProp2.Ack_Send.ToString(),
                    Name = "Ack回复信号",
                    DataAddress = "DB7102.58.0",
                    DataType = DataTypeConst.Bool,
                    CreateTime = DateTime.Now,
                },
            };

            var intdex = 1;
            props.ForEach(x =>
            {
                x.Id = intdex++;
            });
            return props;
        }
    }
}