コード例 #1
0
        private void MoveRandom()
        {
            if (r == null)
            {
                r = new Random((int)DateTime.Now.Ticks);
            }

            var        speed   = r.Next(4);
            PosService service = new PosService();

            foreach (TagPosition position in posList)
            {
                if (offlinePos.Contains(position.Tag))
                {
                    continue;//离线不更新
                }
                position.DateTime = DateTime.Now;
                position.Time     = DateTime.Now.ToStamp();

                position.X += r.Next(speed);
                position.Y += (float)r.NextDouble();
                position.Z += r.Next(speed);
                //service.Put(position);
            }

            service.PutRange(posList);
        }
コード例 #2
0
        private void SimulateOnTheSpot()
        {
            PosService service = new PosService();

            foreach (TagPosition position in posList)
            {
                if (offlinePos.Contains(position.Tag))
                {
                    continue;//离线不更新
                }
                position.DateTime = DateTime.Now;
                position.Time     = DateTime.Now.ToStamp();
                //service.Put(position);
            }

            service.PutRange(posList);
        }