示例#1
0
        public DisplayManager(BeamerDisplayUC beamerScreen)
        {
            _beamerDisplay = beamerScreen;

            _bottomElements = new List<UIElement>();
            _midElements = new List<UIElement>();
            _topElements = new List<UIElement>();
        }
示例#2
0
        public TableManager(BeamerDisplayUC BeamerScreen, string SettingsPath = "")
        {
            //instances
            _recognitionManager = new RecognitionManager();
            _recognitionManager.OnNewRecognitionPacket += new RecognitionManager.RecognitionEventHandler(_recognitionManager_OnNewRecognitionPacket);
            _objectTracker = new ObjectTracker();
            _displayManager = new DisplayManager(BeamerScreen);

            //Assign the BlackWhiteDetector by default;
            //RotationDetector = new BlackWhiteRotationDetector();
            RotationDetector = new ImprovedBWRotDetector();

            //try to load settings. if the settings don't exist, try to save the default settings to the given path
            //Set to default if not specified
            if (SettingsPath == "")
                SettingsPath = SettingsManager.Path;

            bool loadsuccess = false;
            if (Directory.Exists(SettingsPath))
            {
                //Load
                if (!SettingsManager.LoadSettings(SettingsPath))
                {
                    MessageBox.Show(
                        "Einstellungen konnten nicht geladen werden. Standardeinstellungen werden gespeichert.",
                        "TableManager Init");
                }
                else
                {
                    loadsuccess = true;
                }
            }
            if (!Directory.Exists(SettingsPath) || !loadsuccess)
            {
                //try to save default
                if (!SettingsManager.SaveSettings(SettingsPath))
                {
                    MessageBox.Show("Standardeinstellungen konnten nicht gespeichert werden!", "TableManager Fehler!");
                }
            }
        }
示例#3
0
        public void UpdateBeamerScreen(BeamerDisplayUC beamerScreen)
        {
            _beamerDisplay = beamerScreen;

            //TODO: bug: elements don't reappear!
            //Add all elements to the new screen
            lock (_lockvarUilist)
            {
                foreach (UIElement e in _bottomElements)
                {
                    _beamerDisplay.Dispatcher.Invoke((Action)(() => { _beamerDisplay.canvas_bottom.Children.Add(e); }), null);
                }
                foreach(UIElement e in _midElements)
                {
                    _beamerDisplay.Dispatcher.Invoke((Action)(() => { _beamerDisplay.canvas_mid.Children.Add(e); }), null);
                }
                foreach (UIElement e in _topElements)
                {
                    _beamerDisplay.Dispatcher.Invoke((Action)(() => { _beamerDisplay.canvas_top.Children.Add(e); }), null);
                }
            }
        }