Beispiel #1
0
        private void createWorldView()
        {
            // WorldView erstellen und anzeigen
            fww = new FormWorldView();
            fww.ViewPort = new RobotView.ViewPort(-1.25, 1.25, -0.25, 2.25);
            fww.Show();

            #if !WindowsCE
                this.StartPosition = FormStartPosition.Manual;
                fww.StartPosition = FormStartPosition.Manual;

                World.ObstacleMap = new ObstacleMap(
                    RobotView.Resource.ObstacleMap1, -1.25f, 1.25f, -0.25f, 2.25f);
            #endif
            this.Location = new Point(0, 0);
            int width = Math.Min(
            Screen.PrimaryScreen.WorkingArea.Height,
            Screen.PrimaryScreen.WorkingArea.Width - this.Width);
            fww.Width = width;
            fww.ClientSize = new Size(fww.ClientSize.Width, fww.ClientSize.Width);
            fww.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - fww.Width, 0);
        }
Beispiel #2
0
        public FormWorldControl()
        {
            InitializeComponent();
            RunMode actualMode = Constants.IsWinCE ? RunMode.Real : RunMode.Virtual;
            Drive drv = new Drive(actualMode);
            Robot r = new Robot(actualMode);
            drv.DriveCtrl.Power = true;
            drv.DriveCtrl.PowerLeft = true;
            drv.DriveCtrl.PowerRight = true;

            this.runLineView1.drive = drv;
            this.driveView1.Drive = drv;
            this.trackArc1.drive = drv;
            this.trackTurnView1.drive = drv;

            r.ConfigurePathRecording(0.05f, 0.1f);

            drv.Position = new PositionInfo(5.0f, 5.0f, 0.0f);

            r.drv = drv;
            r.Color = Color.Red;
            World.Robot = r;

            r.SwitchStateChanged += new EventHandler<SwitchEventArgs>(r_SwitchStateChanged);
            RobotConsole rc = r.RobotConsole;

            consoleView1.RobotConsole = rc;

            if (r.RunMode == RunMode.Virtual)
            {
                World.ObstacleMap = new ObstacleMap(RobotView.Resource.ObstacleMap1c, xMin-0.25f, xMax+0.25f, yMin-0.25f, yMax-0.25f); //korrektur wg. doofen bildern
            }

            view = new FormWorldView(xMin, yMin, xMax, yMax);
            view.ViewPort = new RobotView.ViewPort(xMin, xMax, yMin, yMax);
            view.Show();

            this.StartServices();
        }