public MainWindow() { InitializeComponent(); //Set version info l_version.Text = "Version: " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); //Because of the wave engine, the beamerscreen is in a seperate thread Thread d = new Thread(() => { _beamerScreen = new BeamerScreenWindow(); //Bind to the close event so that the thread is closed when the window closes _beamerScreen.Closed += (sender2, e2) => _beamerScreen.Dispatcher.InvokeShutdown(); //make it WPF ready System.Windows.Threading.Dispatcher.Run(); }); d.SetApartmentState(ApartmentState.STA); d.Start(); Thread.Sleep(500); //Wait for the screen to load BeamerDisplayUC beameruc = null; _beamerScreen.Dispatcher.Invoke((Action) (() => { beameruc = _beamerScreen.GetBeamerUC(); })); _tableManager = new TableManager(beameruc); _tableManager.ToggleObjectTracking = true; _tableManager.ToggleObjectRecognition = true; _tableManager.ToggleObjectRotationAnalysation = true; _waveTableEngine = new WaveTableEngine(_tableManager); UpdateSimResolution(); _waveTableEngine.Initialize(); //UI Data Init UpdateUiActions(); UpdateSimParams(true); }
public MainWindow() { InitializeComponent(); //Set version info l_version.Text = "Version: " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); //Because of the wave engine, the beamerscreen is in a seperate thread Thread d = new Thread(() => { _beamerScreen = new BeamerScreenWindow(); //Bind to the close event so that the thread is closed when the window closes _beamerScreen.Closed += (sender2, e2) => _beamerScreen.Dispatcher.InvokeShutdown(); //make it WPF ready System.Windows.Threading.Dispatcher.Run(); }); d.SetApartmentState(ApartmentState.STA); d.Start(); Thread.Sleep(500); //Wait for the screen to load BeamerDisplayUC beameruc = null; _beamerScreen.Dispatcher.Invoke((Action) (() => { beameruc = _beamerScreen.GetBeamerUC(); })); _tableManager = new TableManager(beameruc,"..\\..\\settings\\WaveTable\\"); _tableManager.ToggleObjectTracking = true; _tableManager.ToggleObjectRecognition = true; _tableManager.ToggleObjectRotationAnalysation = true; _waveTableEngine = new WaveTableEngine(_tableManager); UpdateSimResolution(); _waveTableEngine.Initialize(); //UI Data Init UpdateUiActions(); UpdateSimParams(true); txt_WallThreshold.Text = _waveTableEngine.WallMaxHeight.ToString(); txt_massHeightThreshold.Text = _waveTableEngine.MassMaxHeight.ToString(); txt_HeightMass.Text = _waveTableEngine.MassValue.ToString(); //set initial colors var c = new Color(); c = Color.FromRgb(_waveTableEngine.ColorVisualizer.ColorMax.R, _waveTableEngine.ColorVisualizer.ColorMax.G, _waveTableEngine.ColorVisualizer.ColorMax.B); rec_ColMax.Fill = new SolidColorBrush(c); c = Color.FromRgb(_waveTableEngine.ColorVisualizer.ColorNull.R, _waveTableEngine.ColorVisualizer.ColorNull.G, _waveTableEngine.ColorVisualizer.ColorNull.B); rec_ColNull.Fill = new SolidColorBrush(c); c = Color.FromRgb(_waveTableEngine.ColorVisualizer.ColorMin.R, _waveTableEngine.ColorVisualizer.ColorMin.G, _waveTableEngine.ColorVisualizer.ColorMin.B); rec_ColMin.Fill = new SolidColorBrush(c); c = Color.FromRgb(_waveTableEngine.ColorVisualizer.ColorWall.R, _waveTableEngine.ColorVisualizer.ColorWall.G, _waveTableEngine.ColorVisualizer.ColorWall.B); rec_ColWall.Fill = new SolidColorBrush(c); c = Color.FromRgb(_waveTableEngine.ColorVisualizer.ColorMass.R, _waveTableEngine.ColorVisualizer.ColorMass.G, _waveTableEngine.ColorVisualizer.ColorMass.B); rec_ColMass.Fill = new SolidColorBrush(c); }