Beispiel #1
0
        public MainPage()
        {
            this.InitializeComponent();
            environment           = new DefaultEnvironment(new Map(1, 1)); // Did not load the map yet...
            EnvironmentTickSource = new EnvironmentTickSource(environment, SimulationCycleLengthMs);

            var robot = new LineAndWallDetectorRobot(environment);

            Brain = new WallsAndLinesDemoBrain(robot);

            new LogCollector(Brain, this.LogViewModel); // Ctor performs registrations

            this.RobotViewModel = new RobotViewModel(robot);
            RobotImage.Source   = RobotViewModel.Image;

            this.MapViewModel = new MapViewModel();

            InitButtonCommands();
        }
        public MainPage()
        {
            this.InitializeComponent();
            environment           = new DefaultEnvironment(new Map(1, 1)); // Did not load the map yet...
            EnvironmentTickSource = new EnvironmentTickSource(environment, SimulationCycleLengthMs);

            var robot = new LineAndWallDetectorRobot(environment);

            Brain = new WallsAndLinesDemoBrain(robot);

            var collector = new LogCollector(Brain, this.LogViewModel);

            this.RobotViewModel = new RobotViewModel(robot);
            RobotImage.Source   = RobotViewModel.Image;

            this.MapViewModel = new MapViewModel();

            FollowLineCommand      = new CommandButtonCommand(Brain, new FollowingLineState(5.0));
            FollowLeftWallCommand  = new CommandButtonCommand(Brain, new FollowingWallOnLeftState());
            FollowRightWallCommand = new CommandButtonCommand(Brain, new FollowingWallOnRightState());
        }