Пример #1
0
        public SimulationEngine(TableManager tmgr)
        {
            _tablemanager = tmgr;

            _menumgr = new MenuGfxMgr(_tablemanager);
            _objectList = new List<SimulationObject>();

            _modifiedObjects = new List<int>();

            //_simulationTimer = new Timer(SimulationTick, null, 500, (int)LocalSettingsManager.PrgTblSet.SimulationTickDelay);
            _dispatcherSimulationTimer = new DispatcherTimer(DispatcherPriority.Normal,
                                                             _tablemanager.BeamerScreen.Dispatcher);

            _dispatcherSimulationTimer.Interval = new TimeSpan(0,0,0,0,LocalSettingsManager.PrgTblSet.SimulationTickDelay);
            _dispatcherSimulationTimer.Tick +=new EventHandler(SimulationTick);
            _dispatcherSimulationTimer.IsEnabled = false;

            _dispatcherGfxUpdateTimer = new DispatcherTimer(DispatcherPriority.Normal,
                                                            _tablemanager.BeamerScreen.Dispatcher);
            _dispatcherGfxUpdateTimer.Interval = new TimeSpan(0, 0, 0, 0, 100);
            _dispatcherGfxUpdateTimer.Tick += new EventHandler(_dispatcherGfxUpdateTimer_Tick);
            _dispatcherGfxUpdateTimer.IsEnabled = true;

            _objDrawer = new SimObjDrawer(_tablemanager);

            _tablemanager.OnNewLongTermObject += new TableManager.TableManagerObjectChange(_tablemanager_OnNewLongTermObject);
            _tablemanager.OnObjectMove += new TableManager.TableManagerObjectChange(_tablemanager_OnObjectMove);
            _tablemanager.OnObjectRotate += new TableManager.TableManagerObjectChange(_tablemanager_OnObjectRotate);
            _tablemanager.OnObjectRemove += new TableManager.TableManagerObjectChange(_tablemanager_OnObjectRemove);
        }
Пример #2
0
 public PerformanceViewer(TableManager tmgr)
 {
     InitializeComponent();
     _tmgr = tmgr;
     _tmgr.OnNewObjectList += new TableManager.TableManagerObjectHandler(_tmgr_OnNewObjectList);
     frameRateAvg = new List<double>();
 }
Пример #3
0
        public MainWindow()
        {
            InitializeComponent();

            //Set version info
            l_version.Text = "Version: " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

            //Load Settings
            bool sload = LocalSettingsManager.LoadSettings();
            if (!sload)
            {
                MessageBox.Show("Einstellungen konnten nicht geladen werden. Standardeinstellungen werden verwendet",
                                "SimulationsEngine");
                LocalSettingsManager.SaveSettings();
            }

            //Init
            _beamerScreen = new BeamerScreenWindow();
            _beamerScreen.Show();
            _tableManager = new TableManager(_beamerScreen.GetBeamerUC(),"..\\..\\settings\\ProgrammingTable\\");
            _tableManager.ToggleObjectTracking = true;
            _tableManager.ToggleObjectRecognition = true;
            _tableManager.ToggleObjectRotationAnalysation = true;

            _simulationEngine = new SimulationEngine(_tableManager);
        }
Пример #4
0
        //Methods ------------------------------------------------------------------------------------------------------------------------------------
        public WaveTableEngine(TableManager tmgr)
        {
            _simulationObjects = new List<SimulationObject>();

            _tableManager = tmgr;
            _tableManager.OnNewLongTermObject += new TableManager.TableManagerObjectChange(_tableManager_OnNewLongTermObject);
            _tableManager.OnNewObject += new TableManager.TableManagerObjectChange(_tableManager_OnNewObject);
            _tableManager.OnObjectMove += new TableManager.TableManagerObjectChange(_tableManager_OnObjectMove);
            _tableManager.OnObjectRemove += new TableManager.TableManagerObjectChange(_tableManager_OnObjectRemove);
            _tableManager.OnObjectRotate += new TableManager.TableManagerObjectChange(_tableManager_OnObjectRotate);

            _tableManager.BeamerScreen.OnMouseClick += new ObjectTable.Code.Display.GUI.BeamerDisplayUC.MouseEventHandler(BeamerScreen_OnMouseClick);
            _tableManager.BeamerScreen.OnMouseMoveDown += new ObjectTable.Code.Display.GUI.BeamerDisplayUC.MouseEventHandler(BeamerScreen_OnMouseMoveDown);

            _waveEngine = new WaveEngine();
            _waveEngine.OnNewSimulationFrame += new WaveEngine.NewSimulationFrameHandler(_waveEngine_OnNewSimulationFrame);

            _dynColVis = new DynamicColorVisualizer();

            _mapManager = new MapManager(_waveEngine);

            _updateTimer = new Timer(1000);
            _updateTimer.Enabled = false;
            _updateTimer.Elapsed += new ElapsedEventHandler(_updateTimer_Elapsed);
        }
Пример #5
0
        public MainWindow()
        {
            InitializeComponent();
            _beamerScreenWindow = new BeamerScreenWindow();
            _beamerScreenWindow.Show();

            _tableManager = new TableManager(_beamerScreenWindow.GetBeamerUC());
        }
Пример #6
0
 public DepthCalibrationForm(TableManager tmgr)
 {
     this.InitializeComponent();
     points = new List<TPoint>();
     _tmgr = tmgr;
     _theightc = new TableHeightCalibrator();
     // Insert code required on object creation below this point.
     b_aktualisieren_Click(null, null);
 }
Пример #7
0
        public MenuGfxMgr(TableManager tmgr)
        {
            _objectList = new List<MenuObject>();

            //Fill object List
            List<Type> typelist = GetSimObjectTypes();
            foreach(Type tp in typelist)
            {
                try
                {
                    object o = Activator.CreateInstance(tp);
                    SimulationObject so = o as SimulationObject;
                    MenuObject mo = new MenuObject();
                    mo.name = so.Name;
                    mo.category = so.Category;
                    mo.shortsign = so.ShortSign;
                    mo.type = tp;
                    _objectList.Add(mo);
                }
                catch (Exception)
                {

                }
            }

            //AssignTableManager
            _tableManager = tmgr;
            _tableManager.OnNewObjectList += new TableManager.TableManagerObjectHandler(_tableManager_OnNewObjectList);
            //Create graphical menu
            _tableManager.DisplayManager.WorkThreadSafe((Action) (() =>
                                                                      {
                                                                          _gfxMenu = new GUI.Table.Menu.Menu();
                                                                          _tableManager.DisplayManager.AddElement(
                                                                              _gfxMenu,
                                                                              ObjectTable.Code.Display.DisplayManager.
                                                                                  DisplayLayer.bottom);
                                                                          Canvas.SetLeft(_gfxMenu, 0);
                                                                          Canvas.SetTop(_gfxMenu, 50);
                                                                          //Get Regions
                                                                          GetRegions(out _b4, out _b3, out _b2, out _b1);
                                                                      }), null,false);
            UpdateMenuGUI();

            //init Scrolltimer
            _menuScrollTimer = new Timer();
            _menuScrollTimer.Interval = 500;
            _menuScrollTimer.Elapsed += new ElapsedEventHandler(_menuScrollTimer_Elapsed);
            //timer is initialized when the first tableObjects are recognized
        }
Пример #8
0
        public DepthMapViewer(ref TableManager tmgr)
        {
            InitializeComponent();
            _tableManager = tmgr;

            _tableManager.OnNewObjectList += new TableManager.TableManagerObjectHandler(_tableManager_OnNewObjectList);

            //Create a list full of 100 random colors
            Random rnd = new Random();
            _colorList = new List<Color>();
            for (int i = 0; i < 100;i++)
            {
                _colorList.Add(Color.FromArgb(255,(byte)rnd.Next(255), (byte)rnd.Next(255), (byte)rnd.Next(255)));
            }
            this.Show();
        }
Пример #9
0
        //Methods ------------------------------------------------------------------------------------------------------------------------------------
        public WaveTableEngine(TableManager tmgr)
        {
            _simulationObjects = new List<SimulationObject>();

            _tableManager = tmgr;
            _tableManager.OnObjectMove += new TableManager.TableManagerObjectChange(_tableManager_OnObjectMove);
            _tableManager.OnNewObjectList += new TableManager.TableManagerObjectHandler(_tableManager_OnNewObjectList);
            _tableManager.BeamerScreen.OnMouseClick += new ObjectTable.Code.Display.GUI.BeamerDisplayUC.MouseEventHandler(BeamerScreen_OnMouseClick);
            _tableManager.BeamerScreen.OnMouseMoveDown += new ObjectTable.Code.Display.GUI.BeamerDisplayUC.MouseEventHandler(BeamerScreen_OnMouseMoveDown);

            _waveEngine = new WaveEngine();
            _waveEngine.OnNewSimulationFrame += new WaveEngine.NewSimulationFrameHandler(_waveEngine_OnNewSimulationFrame);

            _mapManager = new MapManager(_waveEngine);

            _dynColVis = new DynamicColorVisualizer();
        }
        public ScreenCalibrationWindow(TableManager tablemanager, bool CreateOwnObjects)
        {
            InitializeComponent();
            _tableManager = tablemanager;
            _drawCircles = CreateOwnObjects;
            if (_drawCircles)
                cb_crosshair.IsChecked = true;

            if (CreateOwnObjects)
            {
                //bind to the new object events
                //_tableManager.OnNewObjectList += new TableManager.TableManagerObjectHandler(_tableManager_OnNewObjectList);
                _tableManager.OnNewLongTermObject +=
                    new TableManager.TableManagerObjectChange(_tableManager_OnNewLongTermObject);
                _tableManager.OnObjectMove += new TableManager.TableManagerObjectChange(_tableManager_OnObjectMove);
                _tableManager.OnObjectRemove += new TableManager.TableManagerObjectChange(_tableManager_OnObjectRemove);
            }
        }
Пример #11
0
        public MainWindow()
        {
            InitializeComponent();

            bsw = new BeamerScreenWindow();
            bsw.Show();

            tableManager = new TableManager(bsw.GetBeamerUC());

            tableManager.Start();
            tableManager.ToggleObjectRecognition = true;
            tableManager.ToggleObjectTracking = true;
            tableManager.ToggleObjectRotationAnalysation = true;

            tableManager.OnNewLongTermObject += new TableManager.TableManagerObjectChange(tableManager_OnNewLongTermObject);
            tableManager.OnObjectMove += new TableManager.TableManagerObjectChange(tableManager_OnObjectMove);
            tableManager.OnObjectRemove += new TableManager.TableManagerObjectChange(tableManager_OnObjectRemove);
            tableManager.OnObjectRotate += new TableManager.TableManagerObjectChange(tableManager_OnObjectRotate);
            ScreenCalibrationWindow scw = new ScreenCalibrationWindow(tableManager,true);
            scw.Show();
            DepthMapViewer dv = new DepthMapViewer(ref tableManager);
            dv.Show();
        }
Пример #12
0
        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);
        }
Пример #13
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //Create Beamerscreen
            _bscrw = new BeamerScreenWindow();
            _bscrw.Show();

            _bscrw.Closed += new EventHandler(_bscrw_Closed);
            _tablemanager = new TableManager(_bscrw.GetBeamerUC());

            //Add debug object
            ScreenCircle sc1 =
                new ScreenCircle(new ObjectTable.Code.Recognition.DataStructures.TPoint(500, 500,
                                                                                        ObjectTable.Code.Recognition.
                                                                                            DataStructures.TPoint.
                                                                                            PointCreationType.screen));
            sc1.SetColor(ScreenCircle.EColor.green);
            sc1.RotationSpeed = 10.0;

            ScreenCrosshair sch1 = new ScreenCrosshair(new ObjectTable.Code.Recognition.DataStructures.TPoint(200, 300,
                                                                                                              ObjectTable
                                                                                                                  .Code.
                                                                                                                  Recognition
                                                                                                                  .
                                                                                                                  DataStructures
                                                                                                                  .
                                                                                                                  TPoint
                                                                                                                  .
                                                                                                                  PointCreationType
                                                                                                                  .
                                                                                                                  screen));

            _tablemanager.DisplayManager.AddElement(sc1, ObjectTable.Code.Display.DisplayManager.DisplayLayer.top);
            _tablemanager.DisplayManager.AddElement(sch1, ObjectTable.Code.Display.DisplayManager.DisplayLayer.top);
            //Canvas.SetLeft(sch1, 450);
            //Canvas.SetTop(sch1, 150);
        }
Пример #14
0
        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);
        }
Пример #15
0
 public ModuleTogglerForm(ref TableManager tableManager)
 {
     InitializeComponent();
     _tableManager = tableManager;
     UpdateUI();
 }
Пример #16
0
 public SimObjDrawer(TableManager tmgr)
 {
     _tmgr = tmgr;
 }