Exemplo n.º 1
0
        public static List <MenuOrder> GetTestOrders()
        {
            CoordinateRes    cr         = new CoordinateRes();
            List <MenuOrder> menuOrders = new List <MenuOrder>();

            DateTime current_time = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd ") + "07:00");

            Random random = new Random();

            int cur_id = 0;

            for (int i = 0; i < 5; i++)
            {
                Position position = cr.GetRandomPosition();

                MenuOrder menuOrder = new MenuOrder()
                {
                    Address = position.Address,
                    ID      = cur_id++,

                    JD          = position.JD,
                    WD          = position.WD,
                    OrderDate   = current_time.AddMinutes(random.Next(30))
                    , OrderList = "0",
                    Status      = "未分配",
                    Username    = "******",
                    Text        = ""
                };
                menuOrders.Add(menuOrder);
            }

            current_time = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd ") + "11:00");
            for (int i = 0; i < 5; i++)
            {
                Position position = cr.GetRandomPosition();

                MenuOrder menuOrder = new MenuOrder()
                {
                    Address = position.Address,
                    ID      = cur_id++,

                    JD        = position.JD,
                    WD        = position.WD,
                    OrderDate = current_time.AddMinutes(random.Next(30))
                    ,
                    OrderList = "0",
                    Status    = "未分配",
                    Username  = "******",
                    Text      = ""
                };
                menuOrders.Add(menuOrder);
            }

            return(menuOrders);
        }
Exemplo n.º 2
0
        public static List <MenuOrder> GetTestOrders_Random()
        {
            Random random = new Random();



            //121.82333,39.088169
            double min_jd = 121.82333 - 0.05;
            double max_jd = 121.82333 + 0.05;

            double min_wd = 39.088169 - 0.02;
            double max_wd = 39.088169 + 0.02;

            double jd, wd;

            List <MenuOrder> menuOrders = new List <MenuOrder>();

            DateTime current_time = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd ") + "07:00");

            int cur_id = 0;

            for (int i = 0; i < 5; i++)
            {
                jd = (random.NextDouble()) * (max_jd - min_jd) + min_jd;
                wd = (random.NextDouble()) * (max_wd - min_wd) + min_wd;

                MenuOrder menuOrder = new MenuOrder()
                {
                    Address = "Fake Address " + cur_id.ToString(),
                    ID      = cur_id++,

                    JD        = jd,
                    WD        = wd,
                    OrderDate = current_time
                    ,
                    OrderList = "0",
                    Status    = "未分配",
                    Username  = "******",
                    Text      = ""
                };
                menuOrders.Add(menuOrder);
            }

            current_time = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd ") + "11:00");
            for (int i = 0; i < 5; i++)
            {
                jd = (random.NextDouble()) * (max_jd - min_jd) + min_jd;
                wd = (random.NextDouble()) * (max_wd - min_wd) + min_wd;

                MenuOrder menuOrder = new MenuOrder()
                {
                    Address = "Fake Address " + cur_id.ToString(),
                    ID      = cur_id++,

                    JD        = jd,
                    WD        = wd,
                    OrderDate = current_time
                    ,
                    OrderList = "0",
                    Status    = "未分配",
                    Username  = "******",
                    Text      = ""
                };
                menuOrders.Add(menuOrder);
            }

            return(menuOrders);
        }