Пример #1
0
        public void Initialize()
        {
            _screenView.Initialize(_screen);
            CalibrationUserControl.Refresh();
            BlendingUserControl.Refresh();

            EventHelper.SubscribeEvent <SettingsChanged, EventArgs>(OnSettingsChanged);
        }
Пример #2
0
        public ViewModel(ScreenView screen, MosaicInfo mosaicInfo, MainWindow mainWindow)
        {
            //if (Helpers.IsDevComputer)
            //{
            //    _configFilename = @"C:\Temp\PanoBeam.config";
            //}
            _screenView                      = screen;
            _mainWindow                      = mainWindow;
            CameraUserControl                = new CameraUserControl();
            CalibrationUserControl           = new CalibrationUserControl();
            BlendingUserControl              = new BlendingUserControl();
            TestImagesUserControl            = new TestImagesUserControl();
            CalibrationUserControl.Start    += CalibrationUserControlOnStart;
            TestImagesUserControl.ShowImage += TestImagesUserControlOnShowImage;

            _screen = new PanoScreen
            {
                Resolution            = _screenView.Resolution,
                Overlap               = _screenView.Overlap,
                SaveCursorPosition    = () => { _mousePosition = Win32.GetMousePosition(); },
                RestoreCursorPosition = () =>
                {
                    if (_mousePosition != null)
                    {
                        Win32.SetCursorPos(_mousePosition.X, _mousePosition.Y);
                    }
                }
            };
            _screen.AddProjectors(mosaicInfo.DisplayId0, mosaicInfo.DisplayId1);
            //_screen.LoadDefaults();
            CalibrationUserControl.Initialize();
            BlendingUserControl.Initialize(_screen.Projectors);
            _screen.CalculationProgress += ScreenOnCalculationProgress;

            //_screen.SetPattern(50, new Size(8, 9));
        }