示例#1
0
        public void StartRoutingTo(Point src, string name)
        {
            var   rec = FindStageRegion(name);
            Point p   = FindDestinationPoint(Rectangle.Round(rec));

            if (p == null)
            {
                p = new Point(rec.X, rec.Y);
            }

            log.Info("Location For Working Found" + p.x + "," + p.y);
            route.Start(src, p);
        }
示例#2
0
        private void navigateBtn_Click(object sender, EventArgs e)
        {
            CreatePathForm createPathForm = new CreatePathForm();

            createPathForm.map = map;

            createPathForm.FormClosing += (o, form) =>
            {
                route = new RoutePlanner(robot, map);
                var src  = new Point(Int32.Parse(createPathForm.srcXTextBox.Text), Int32.Parse(createPathForm.srcYTextBox.Text));
                var dest = new Point(Int32.Parse(createPathForm.dstXtextBox.Text), Int32.Parse(createPathForm.dstYTextBox.Text));

                route.Start(src, dest);
                Timer1.Enabled = true;
            };
            createPathForm.Show();
        }