void _tableManager_OnNewObjectList() { //clear the surface _tableManager.DisplayManager.ClearScreen(); //Create a crosshair for each new longTerm object on the surface foreach (TableObject obj in _tableManager.TableObjects.Where(obj => obj.TrackingStatus == TableObject.ETrackingStatus.LongTermTracked)) { if (_drawCircles) { ScreenCircle sc = null; _tableManager.DisplayManager.WorkThreadSafe((Action)(() => { sc = new ScreenCircle(obj.Center); sc.SetColor(ScreenCircle.EColor.blue); sc.SetText(1, obj.ObjectID.ToString()); sc.SetText(2, obj.ObjectID.ToString()); sc.SetText(3, obj.ObjectID.ToString()); sc.SetText(4, obj.ObjectID.ToString()); }), null); _tableManager.DisplayManager.AddElement(sc, ObjectTable.Code.Display.DisplayManager.DisplayLayer.top); } else { ScreenCrosshair sch = null; _tableManager.DisplayManager.WorkThreadSafe((Action)(() => sch = new ScreenCrosshair(obj.Center)),null); _tableManager.DisplayManager.AddElement(sch, ObjectTable.Code.Display.DisplayManager.DisplayLayer.top); } } }
void _tableManager_OnNewLongTermObject(List<int> ObjectIDList) { if (!_drawCircles) return; foreach (int i in ObjectIDList) { //Create a new UI Element TableObject obj = _tableManager.TableObjects.Where(o => o.ObjectID == i).ToList()[0]; ScreenCircle sc = null; _tableManager.DisplayManager.WorkThreadSafe((Action) (() => { sc = new ScreenCircle(obj.Center); sc.SetColor(ScreenCircle.EColor.blue); sc.SetText(1, obj.ObjectID.ToString()); sc.SetText(2, obj.ObjectID.ToString()); sc.SetText(3, obj.ObjectID.ToString()); sc.SetText(4, obj.ObjectID.ToString()); sc.RotationSpeed = 40; }), null,false); _uiArray[obj.ObjectID] = sc; _tableManager.DisplayManager.AddElement(sc, ObjectTable.Code.Display.DisplayManager.DisplayLayer.top); } //For enhanced fun, check whether there are exactly 2 lto. if so, create a line between them /*if (_tableManager.TableObjects.Where(o2 => o2.TrackingStatus == TableObject.ETrackingStatus.LongTermTracked).Count() == 2) { CreateScreenline(); }*/ }