Ejemplo n.º 1
0
        public static Payload[] GetSeederData()
        {
            var droneSeeder = new List <Payload>();
            var rand        = new Random();

            for (var i = 0; i < 40; i++)
            {
                var    ranDay      = rand.Next(1, 3);
                var    ranHour     = rand.Next(1, 18);
                var    ranMinute   = rand.Next(1, 50);
                var    apiType     = Utility.GetRandomApiType();
                string projectType = Models.ProjectType.GetRandomProjectType();
                var    droneLog    = new Payload()
                {
                    EntityLogPrimaryKeyId = i + 10,
                    DroneId     = DroneLog.GetRandomEntityId(),
                    EntityId    = Payload.GetRandomEntityId(),
                    AuthorId    = UserLog.GetRandomEntityId(),
                    ProjectType = projectType,
                    Type        = apiType,
                    Description = "Payload " + apiType.GetDescription(),
                    Name        = Utility.RandomString(2) + "-" + Utility.RandomString(3) + "-" + Utility.RandomString(1),
                    Timestamp   = new DateTime(2020, 12, ranDay, ranHour, ranMinute, 0),
                    State       = i % 2 + ""
                };
                droneSeeder.Add(droneLog);
            }

            return(droneSeeder.ToArray());
        }
Ejemplo n.º 2
0
        public static VideoLog[] GetSeederData()
        {
            var    droneSeeder = new List <VideoLog>();
            var    rand        = new Random();
            string projectType = Models.ProjectType.GetRandomProjectType();

            for (var i = 0; i < 40; i++)
            {
                var ranDay    = rand.Next(1, 3);
                var ranHour   = rand.Next(1, 18);
                var ranMinute = rand.Next(1, 50);
                var apiType   = Utility.GetRandomApiType();
                var droneLog  = new VideoLog()
                {
                    EntityLogPrimaryKeyId = i + 10,
                    DroneId     = DroneLog.GetRandomEntityId(),
                    AuthorId    = UserLog.GetRandomEntityId(),
                    EntityId    = VideoLog.GetRandomEntityId(),
                    IncidentId  = IncidentLog.GetRandomEntityId(),
                    Type        = apiType,
                    ProjectType = projectType,
                    Description = "Video theo dõi " + projectType + " " + Utility.RandomString(5),
                    Link        = "Video " + Utility.RandomString(2),
                    Timestamp   = new DateTime(2020, 12, ranDay, ranHour, ranMinute, 0),
                    State       = i % 2 + ""
                };
                droneSeeder.Add(droneLog);
            }

            return(droneSeeder.ToArray());
        }
Ejemplo n.º 3
0
        public static DroneLog[] GetSeederData()
        {
            var droneSeeder = new List <DroneLog>();
            var rand        = new Random();

            for (var i = 0; i < 100; i++)
            {
                var    ranDay      = rand.Next(1, 3);
                var    ranHour     = rand.Next(1, 18);
                var    ranMinute   = rand.Next(1, 50);
                var    apiType     = Utility.GetRandomApiType();
                var    entityId    = DroneLog.GetRandomEntityId();
                string projectType = Models.ProjectType.GetRandomProjectType();
                var    droneLog    = new DroneLog()
                {
                    UavConnectId          = UavConnectLog.GetRandomEntityId(),
                    EntityLogPrimaryKeyId = i + 1,
                    EntityId    = entityId,
                    Latitude    = rand.Next(10, 50),
                    Longitude   = rand.Next(10, 50),
                    AuthorId    = UserLog.GetRandomEntityId(),
                    Type        = apiType,
                    ProjectType = projectType,
                    Description = "Drone " + apiType.GetDescription(),
                    Name        = "Drone " + entityId,
                    Timestamp   = new DateTime(2020, 12, ranDay, ranHour, ranMinute, 0)
                };
                droneSeeder.Add(droneLog);
            }

            return(droneSeeder.ToArray());
        }