private void StartDrawing(OverlayData data) { if (data != null) { GameObject.Find("ImageTarget")?.GetComponent <OverlayScript>()?.DrawOverlayData(data); } }
public void TestUnpack_Multiframe() { // 7 frames, each 3x2 (cols, rows) = 42 bits = 6 bytes // 111 111 111 111 111 111 111 // 000 001 010 011 100 101 110 // continuous bit stream: 11100011 10011110 10111011 11110011 11011111 10xxxxxx // continuous LE byte stream: 11000111 01111001 11011101 11001111 11111011 xxxxxx01 var expectedResult = new[] { "111000", "111001", "111010", "111011", "111100", "111101", "111110" }; var packedBits = new byte[] { 0xc7, 0x79, 0xdd, 0xcf, 0xfb, 0xf1 }; for (int frameIndex = 0; frameIndex < 7; frameIndex++) { var offset = 3 * 2 * frameIndex; // little endian test { var unpackedBits = new OverlayData(offset, 2, 3, false, packedBits).Unpack(); var actualResult = FormatNonZeroBytes(unpackedBits); Assert.AreEqual(expectedResult[frameIndex], actualResult, "Error in unpacked bits for multiframe (fr#{0}) (little endian)", frameIndex); } // big endian test { var unpackedBits = new OverlayData(offset, 2, 3, true, SwapBytes(packedBits)).Unpack(); var actualResult = FormatNonZeroBytes(unpackedBits); Assert.AreEqual(expectedResult[frameIndex], actualResult, "Error in unpacked bits for multiframe (fr#{0}) (big endian)", frameIndex); } } }
public CaptureLeaderBoardMiddleLaps(CaptureLeaderBoard captureLeaderBoard, OverlayData overlayData, RemovalEdits removalEdits, CommentaryMessages commentaryMessages) { this.captureLeaderBoard = captureLeaderBoard; this.overlayData = overlayData; this.removalEdits = removalEdits; this.commentaryMessages = commentaryMessages; }
protected override byte[] CreateNormalizedPixelData() { string photometricInterpretation; byte[] pixelData = _framePixelData.GetUncompressedPixelData(out photometricInterpretation); string photometricInterpretationCode = photometricInterpretation ?? Parent[DicomTags.PhotometricInterpretation].ToString(); PhotometricInterpretation pi = PhotometricInterpretation.FromCodeString(photometricInterpretationCode); if (pi.IsColor) { pixelData = ToArgb(this.Parent, pixelData, pi); } else { var overlayPlaneModuleIod = new OverlayPlaneModuleIod(Parent); foreach (var overlayPlane in overlayPlaneModuleIod) { if (!overlayPlane.HasOverlayData && _overlayData[overlayPlane.Index] == null) { // if the overlay is embedded in pixel data and we haven't cached it yet, extract it now before we normalize the frame pixel data var overlayData = OverlayData.UnpackFromPixelData(overlayPlane.OverlayBitPosition, Parent[DicomTags.BitsAllocated].GetInt32(0, 0), false, pixelData); _overlayData[overlayPlane.Index] = overlayData; } } NormalizeGrayscalePixels(this.Parent, pixelData); } return(pixelData); }
public void TestCreateOverlayData_8BitsAllocated() { // 1 frame, 5x3 // 11111 // 10010 // 00000 // continuous bit stream: 11111100 1000000x // continuous LE byte stream: 00111111 x0000001 const string expectedResult = "111111001000000"; var overlayPixels = new byte[] { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // little endian test { var packedBits = OverlayData.CreateOverlayData(3, 5, false, overlayPixels).Raw; var actualResult = FormatBits(packedBits, false).Substring(0, 15); Assert.AreEqual(expectedResult, actualResult, "Error in packed bits for 8-bit case (little endian)"); } // big endian test { var packedBits = OverlayData.CreateOverlayData(3, 5, true, overlayPixels).Raw; var actualResult = FormatBits(packedBits, true).Substring(0, 15); Assert.AreEqual(expectedResult, actualResult, "Error in packed bits for 8-bit case (big endian)"); } }
public CaptureLeaderBoardMiddleLaps(CaptureLeaderBoard captureLeaderBoard, OverlayData overlayData, RemovalEdits removalEdits, CommentaryMessages commentaryMessages) { this.captureLeaderBoard = captureLeaderBoard; this.overlayData = overlayData; this.removalEdits = removalEdits; this.commentaryMessages = commentaryMessages; }
public void TestBitPacking_Single16BitFrame() { // 1 frame, 5x3 // 11111 // 10010 // 00000 // continuous bit stream: 11111100 1000000x // continuous LE byte stream: 00111111 x0000001 const string expectedResult = "111111001000000"; var overlayPixels = SwapBytes(new byte[] // written in big endian for ease of reading { 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }); // little endian test { const int pixelCount = 3 * 5; byte[] packedBits = new byte[(int)(Math.Ceiling(pixelCount / 8.0))]; OverlayData.TestPack(overlayPixels, packedBits, 0, pixelCount, (ushort)0x00FF, false); var actualResult = FormatBits(packedBits, false).Substring(0, pixelCount); Assert.AreEqual(expectedResult, actualResult, "Error in packed bits for 16-bit case (little endian)"); } // big endian test { const int pixelCount = 3 * 5; byte[] packedBits = new byte[(int)(Math.Ceiling(pixelCount / 8.0))]; OverlayData.TestPack(overlayPixels, packedBits, 0, pixelCount, (ushort)0x00FF, true); var actualResult = FormatBits(packedBits, true).Substring(0, pixelCount); Assert.AreEqual(expectedResult, actualResult, "Error in packed bits for 16-bit case (big endian)"); } }
public void TestCreateOverlayData_16BitsAllocated() { // 1 frame, 5x3 // 11111 // 10010 // 00000 // continuous bit stream: 11111100 1000000x // continuous LE byte stream: 00111111 x0000001 const string expectedResult = "111111001000000"; var overlayPixels = SwapBytes(new byte[] { // column1 | column2 | column3 | column4 | column5 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }); // written here in big endian for easy reading // little endian test { var packedBits = OverlayData.CreateOverlayData(3, 5, 12, 16, 15, false, overlayPixels).Raw; var actualResult = FormatBits(packedBits, false).Substring(0, 15); Assert.AreEqual(expectedResult, actualResult, "Error in packed bits for 16-bit case (little endian)"); } // big endian test { var packedBits = OverlayData.CreateOverlayData(3, 5, 12, 16, 15, true, overlayPixels).Raw; var actualResult = FormatBits(packedBits, true).Substring(0, 15); Assert.AreEqual(expectedResult, actualResult, "Error in packed bits for 16-bit case (big endian)"); } }
OverlayData GetEditorAddedAsset(int?nameHash = null, string overlayName = "") { OverlayData foundOverlay = null; if (editorAddedAssets.Count > 0) { foreach (OverlayDataAsset edOverlay in editorAddedAssets) { if (edOverlay != null) { if (nameHash != null) { if (edOverlay.nameHash == nameHash) { foundOverlay = new OverlayData(edOverlay); } } else if (overlayName != null) { if (overlayName != "") { if (edOverlay.overlayName == overlayName) { foundOverlay = new OverlayData(edOverlay); } } } } } } return(foundOverlay); }
public void TestCreateOverlayData_16BitsAllocatedWithJunk() { // 1 frame, 5x3 // 11111 // 10010 // 00000 // continuous bit stream: 11111100 1000000x // continuous LE byte stream: 00111111 x0000001 const string expectedResult = "111111001000000"; // simulating the junk by specifying that we're using the middle 8 bits and the first and last 4 bits are to be ignored var overlayPixels = SwapBytes(new byte[] { // column1 | column2 | column3 | column4 | column5 0x09, 0x10, 0x09, 0x00, 0x03, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x80, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0F, 0x00, 0x00 }); // written here in big endian for easy reading // little endian test { var packedBits = OverlayData.CreateOverlayData(3, 5, 8, 16, 11, false, overlayPixels).Raw; var actualResult = FormatBits(packedBits, false).Substring(0, 15); Assert.AreEqual(expectedResult, actualResult, "Error in packed bits for 16-bit w/junk case (little endian)"); } // big endian test { var packedBits = OverlayData.CreateOverlayData(3, 5, 8, 16, 11, true, overlayPixels).Raw; var actualResult = FormatBits(packedBits, true).Substring(0, 15); Assert.AreEqual(expectedResult, actualResult, "Error in packed bits for 16-bit w/junk case (big endian)"); } }
public virtual void Render(OverlayData data) { if (GetTrajectory(out ITrajectory trajectory)) { trajectory.Render(data); } }
public OverlayEditor(UMAData.UMARecipe recipe, SlotData slotData, OverlayData overlayData) { _recipe = recipe; _overlayData = overlayData; _slotData = slotData; _sharedColors = false; if (_recipe.sharedColors != null) { foreach (OverlayColorData ocd in _recipe.sharedColors) { if (ocd.GetHashCode() == _overlayData.colorData.GetHashCode()) { _sharedColors = true; } } } if (_sharedColors && (_overlayData.colorData.name == OverlayColorData.UNSHARED)) { _sharedColors = false; } _textures = new TextureEditor[overlayData.asset.textureList.Length]; for (int i = 0; i < overlayData.asset.textureList.Length; i++) { _textures[i] = new TextureEditor(overlayData.asset.textureList[i]); } BuildColorEditors(); }
public void TestUnpack_SingleFrameB() { // 1 frame, 7x3 // 1111111 // 1001011 // 0000011 // continuous bit stream: 11111111 00101100 00011xxx xxxxxxxx // continuous LE byte stream: 11111111 00110100 xxx11000 xxxxxxxx const string expectedResult = "111111110010110000011"; var packedBits = new byte[] { 0xff, 0x34, 0x78, 0xf9 }; // little endian test { var unpackedBits = new OverlayData(3, 7, false, packedBits).Unpack(); var actualResult = FormatNonZeroBytes(unpackedBits); Assert.AreEqual(expectedResult, actualResult, "Error in unpacked bits for single frame case B (little endian)"); } // big endian test { var unpackedBits = new OverlayData(3, 7, true, SwapBytes(packedBits)).Unpack(); var actualResult = FormatNonZeroBytes(unpackedBits); Assert.AreEqual(expectedResult, actualResult, "Error in unpacked bits for single frame case B (big endian)"); } }
public MainForm() { currentDirectory = Directory.GetCurrentDirectory(); try { jsonData = OverlayData.FromJson(File.ReadAllText(String.Format("{0}\\{1}", currentDirectory, "configuration.json"))); } catch (Exception e) { MessageBox.Show( "The configuration file could not be found within the directory of the application (configuration.json)", "PoeCompass - error while reading configuration file", MessageBoxButtons.OK, MessageBoxIcon.Error ); Environment.Exit(0); } logPath = jsonData[0].clientLogFile.ToString(); // Initialize the app InitializeComponent(); InitializeStream(); // Define the regex to scan ... zoneEntered = new Regex(@"You have entered (.*)\.", RegexOptions.IgnoreCase); }
void AnnounceIfDriverHasFinished(DataSample data, TimeSpan relativeTime, SessionData._SessionInfo._Sessions session, int i, ref OverlayData.LeaderBoard leaderBoard) { if (!data.LastSample.Telemetry.Cars[i].HasSeenCheckeredFlag || haveNotedCheckerdFlag[i]) return; haveNotedCheckerdFlag[i] = true; var driver = data.SessionData.DriverInfo.CompetingDrivers[i]; var position = (int)session.ResultsPositions.First(r => r.CarIdx == i).Position; var pitStopCount = data.Telemetry.Cars[i].PitStopCount; var drivers = leaderBoard.Drivers.Where(d => d.CarIdx != i) .Select(d => d.Clone()) .ToList(); drivers.Insert((int)position - 1, new OverlayData.Driver { CarNumber = driver.CarNumber, UserName = driver.UserName, Position = position, CarIdx = i, PitStopCount = pitStopCount }); var p = 1; foreach (var d in drivers) d.Position = p++; leaderBoard = captureLeaderBoard.CreateLeaderBoard(data, relativeTime, drivers.ToArray()); var msg = string.Format("{0} finished in {1}{2}", driver.UserName, position, position.Ordinal()); TraceInfo.WriteLine("{0} {1}", data.Telemetry.SessionTimeSpan, msg); commentaryMessages.Add(msg, relativeTime.TotalSeconds); }
public override void AddOverlay(OverlayData overlay) { ValidateDictionary(); var hash = UMASkeleton.StringToHash(overlay.overlayName); if (overlayDictionary.ContainsKey(hash)) { for (int i = 0; i < overlayElementList.Length; i++) { if (overlayElementList[i].overlayName == overlay.overlayName) { overlayElementList[i] = overlay; break; } } } else { var list = new OverlayData[overlayElementList.Length + 1]; for (int i = 0; i < overlayElementList.Length; i++) { list[i] = overlayElementList[i]; } list[list.Length - 1] = overlay; overlayElementList = list; } overlayDictionary[hash] = overlay; }
// this instantiator saves us from having to use the overlay library // it just returns a duplicate of the OverlayData private static OverlayData InstantiateOverlay(OverlayData od, Color col) { OverlayData newod = od.Duplicate(); newod.colorData.color = col; return(newod); }
/// <summary> /// Called by <see cref="StandardSopFrameData.GetNormalizedOverlayData"/> to create a new byte buffer containing normalized /// overlay pixel data for a particular overlay plane. /// </summary> /// <remarks> /// See <see cref="StandardSopFrameData.GetNormalizedOverlayData"/> for details on the expected format of the byte buffer. /// </remarks> /// <param name="overlayNumber">The 1-based overlay plane number.</param> /// <returns>A new byte buffer containing the normalized overlay pixel data.</returns> protected override byte[] CreateNormalizedOverlayData(int overlayNumber) { //TODO (CR December 2010): make this a helper method somewhere, since it's now identical to the one in StreamingSopFrameData? var overlayIndex = overlayNumber - 1; byte[] overlayData = null; var clock = new CodeClock(); clock.Start(); // check whether or not the overlay plane exists before attempting to ascertain // whether or not the overlay is embedded in the pixel data var overlayPlaneModuleIod = new OverlayPlaneModuleIod(Parent); if (overlayPlaneModuleIod.HasOverlayPlane(overlayIndex)) { if (_overlayCache[overlayIndex] == null) { var overlayPlane = overlayPlaneModuleIod[overlayIndex]; if (!overlayPlane.HasOverlayData) { // if the overlay is embedded, trigger retrieval of pixel data which will populate the cache for us GetNormalizedPixelData(); } else { // try to compute the offset in the OverlayData bit stream where we can find the overlay frame that applies to this image frame int overlayFrame; int bitOffset; if (overlayPlane.TryGetRelevantOverlayFrame(FrameNumber, Parent.NumberOfFrames, out overlayFrame) && overlayPlane.TryComputeOverlayDataBitOffset(overlayFrame, out bitOffset)) { // offset found - unpack only that overlay frame var od = new OverlayData(bitOffset, overlayPlane.OverlayRows, overlayPlane.OverlayColumns, overlayPlane.IsBigEndianOW, overlayPlane.OverlayData); _overlayCache[overlayIndex] = od.Unpack(); } else { // no relevant overlay frame found - i.e. the overlay for this image frame is blank _overlayCache[overlayIndex] = new byte[0]; } } } overlayData = _overlayCache[overlayIndex]; } clock.Stop(); PerformanceReportBroker.PublishReport("DicomMessageSopDataSource", "CreateNormalizedOverlayData", clock.Seconds); return(overlayData); }
public void HandleEvent(object sender, EventArgs args) { Debug.Log("Event received: " + args.GetType().ToString() + "\n"); if (args.GetType() == typeof(OverlayData)) { data = (OverlayData)args; StartDrawing(data); } }
public static OverlayData CreateTextureOverlay(Rect rectangle, Texture2D backTexture) { OverlayData data = new OverlayData(); data.rect = rectangle; data.texture = backTexture; data.types = OverlayDataTypes.BackgroundTexture; return(data); }
public static OverlayData CreateColorOverlay(Rect rectangle, Color backgroundColor) { OverlayData data = new OverlayData(); data.rect = rectangle; data.color = backgroundColor; data.types = OverlayDataTypes.BackgroundColor; return(data); }
private void RenderGroup(OverlayData data) { if (Points.Count > 2) { Position.RenderCircle(data); } else { LineLeaveBounds.Render(data); } }
private OverlayData[] GetOverlayDataArray() { int arrayCount = m_OverlayDataCount.intValue; OverlayData[] OverlayDataArray = new OverlayData[arrayCount]; for (int i = 0; i < arrayCount; i++) { OverlayDataArray[i] = m_Object.FindProperty(string.Format(kArrayData, i)).objectReferenceValue as OverlayData; } return(OverlayDataArray); }
public void Process(DataSample data, TimeSpan relativeTime, ref OverlayData.LeaderBoard leaderBoard) { if (leaderBoardUpdateRate == 0 || leaderBoard == null) leaderBoard = captureLeaderBoard.CreateLeaderBoard(data, relativeTime, LatestRunningOrder(data, relativeTime)); else leaderBoard = captureLeaderBoard.CreateLeaderBoard(data, relativeTime, leaderBoard.Drivers); leaderBoardUpdateRate++; leaderBoardUpdateRate = leaderBoardUpdateRate % 8; overlayData.LeaderBoards.Add(leaderBoard); }
private static void TestFrame(byte[] packedData, int outBufferSize, int frameNum, string expectedConcat, string datamsg) { byte[] result = new byte[outBufferSize]; OverlayData.TestUnpack(packedData, result, frameNum * outBufferSize, outBufferSize, false); Assert.AreEqual(expectedConcat, FormatNonZeroBytes(result), "LittleEndianWords Frame {0} of {1}", frameNum, datamsg); // you should get the exact same frame data (scanning horizontally from top left to bottom right) if you had packed data in little endian or big endian byte[] swappedPackedData = SwapBytes(packedData); result = new byte[outBufferSize]; OverlayData.TestUnpack(swappedPackedData, result, frameNum * outBufferSize, outBufferSize, true); Assert.AreEqual(expectedConcat, FormatNonZeroBytes(result), "BigEndianWords Frame {0} of {1}", frameNum, datamsg); }
public void TestUnpackFromPixelData_16BitsAllocated() { // 1 frame, 7x3 // 1111111 // 1001011 // 0000011 // continuous bit stream: 11111111 00101100 00011xxx xxxxxxxx const string expectedResult = "111111110010110000011"; // 16 bits allocated // some pixel data: 1st col is a random "pixel", 2nd col creates room for overlay bit, 3rd col is the overlay // 4th col moves the overlay to bit position 14, 5th col is the lower byte of the random pixel var pixelData = SwapBytes(new byte[] // written in big endian form for ease of reading :P { (0xC5 & 0x0F) | (1 << 6), 0x93, (0x2D & 0x0F) | (1 << 6), 0x9C, (0x5B & 0x0F) | (1 << 6), 0x78, (0xB3 & 0x0F) | (1 << 6), 0x17, (0xFC & 0x0F) | (1 << 6), 0x0c, (0xBC & 0x0F) | (1 << 6), 0xc4, (0x0B & 0x0F) | (1 << 6), 0x4c, (0x74 & 0x0F) | (1 << 6), 0xe5, (0x4d & 0x0F) | (0 << 6), 0x45, (0xbf & 0x0F) | (0 << 6), 0xcd, (0x86 & 0x0F) | (1 << 6), 0xAE, (0x75 & 0x0F) | (0 << 6), 0xA9, (0x51 & 0x0F) | (1 << 6), 0xbe, (0x71 & 0x0F) | (1 << 6), 0x7e, (0xA8 & 0x0F) | (0 << 6), 0x29, (0x19 & 0x0F) | (0 << 6), 0x11, (0xAC & 0x0F) | (0 << 6), 0xDD, (0xD4 & 0x0F) | (0 << 6), 0x01, (0x79 & 0x0F) | (0 << 6), 0xF0, (0xA0 & 0x0F) | (1 << 6), 0xe2, (0xBA & 0x0F) | (1 << 6), 0x98 }); // little endian { var extractedBits = OverlayData.UnpackFromPixelData(14, 16, false, pixelData); var actualResult = FormatNonZeroBytes(extractedBits); Assert.AreEqual(expectedResult, actualResult, "Error in extracted bits from pixel data (16-bit pixels, little endian)"); } // big endian { var extractedBits = OverlayData.UnpackFromPixelData(14, 16, true, SwapBytes(pixelData)); var actualResult = FormatNonZeroBytes(extractedBits); Assert.AreEqual(expectedResult, actualResult, "Error in extracted bits from pixel data (16-bit pixels, big endian)"); } }
public OverlayEditor(SlotData slotData, OverlayData overlayData) { _overlayData = overlayData; _slotData = slotData; _textures = new TextureEditor[overlayData.textureList.Length]; for (int i = 0; i < overlayData.textureList.Length; i++) { _textures[i] = new TextureEditor(overlayData.textureList[i]); } BuildColorEditors(); }
public static OverlayData CreateTextBoxOverlay(Rect rectangle, string msg, GUIStyle textstyle, Color textcolor, Color bgTextColor, GUIStyle bgTextStyle) { OverlayData data = new OverlayData(); data.rect = rectangle; data.text = msg; data.textStyle = textstyle; data.textStyle.normal.textColor = textcolor; data.backgroundTextStyle = bgTextStyle; data.backgroundTextStyle.normal.textColor = bgTextColor; data.types = OverlayDataTypes.TextBox; return(data); }
public void Process(DataSample data, TimeSpan relativeTime, ref OverlayData.LeaderBoard leaderBoard) { var session = data.SessionData.SessionInfo.Sessions[data.Telemetry.SessionNum]; leaderBoard = captureLeaderBoard.CreateLeaderBoard(data, relativeTime, leaderBoard.Drivers); for (int i = 1; i < data.SessionData.DriverInfo.CompetingDrivers.Length; i++) { AnnounceIfDriverHasFinished(data, relativeTime, session, i, ref leaderBoard); MarkResultFlashCardStart(data, relativeTime, session, i); } overlayData.LeaderBoards.Add(leaderBoard); }
/// <summary> /// Called by <see cref="StandardSopFrameData.GetNormalizedOverlayData"/> to create a new byte buffer containing normalized /// overlay pixel data for a particular overlay plane. /// </summary> /// <remarks> /// See <see cref="StandardSopFrameData.GetNormalizedOverlayData"/> for details on the expected format of the byte buffer. /// </remarks> /// <param name="overlayNumber">The 1-based overlay plane number.</param> /// <returns>A new byte buffer containing the normalized overlay pixel data.</returns> protected override byte[] CreateNormalizedOverlayData(int overlayNumber) { var overlayIndex = overlayNumber - 1; byte[] overlayData = null; // check whether or not the overlay plane exists before attempting to ascertain // whether or not the overlay is embedded in the pixel data var overlayPlaneModuleIod = new OverlayPlaneModuleIod(Parent); if (overlayPlaneModuleIod.HasOverlayPlane(overlayIndex)) { if (_overlayData[overlayIndex] == null) { var overlayPlane = overlayPlaneModuleIod[overlayIndex]; if (!overlayPlane.HasOverlayData) { // if the overlay is embedded, trigger retrieval of pixel data which will populate the cache for us GetNormalizedPixelData(); } else { // try to compute the offset in the OverlayData bit stream where we can find the overlay frame that applies to this image frame int overlayFrame; int bitOffset; if (overlayPlane.TryGetRelevantOverlayFrame(FrameNumber, Parent.NumberOfFrames, out overlayFrame) && overlayPlane.TryComputeOverlayDataBitOffset(overlayFrame, out bitOffset)) { // offset found - unpack only that overlay frame var od = new OverlayData(bitOffset, overlayPlane.OverlayRows, overlayPlane.OverlayColumns, overlayPlane.IsBigEndianOW, overlayPlane.OverlayData); _overlayData[overlayIndex] = od.Unpack(); } else { // no relevant overlay frame found - i.e. the overlay for this image frame is blank _overlayData[overlayIndex] = new byte[0]; } } } overlayData = _overlayData[overlayIndex]; } return(overlayData); }
public override void OnUpdate() { foreach (int mSlotIndex in slotIndex) { foreach (int mOverlayIndex in overlayIndex) { OverlayData overlayData = umaData.GetSlot(mSlotIndex).GetOverlay(mOverlayIndex); overlayData.color = color.Value; } } umaData.isShapeDirty = true; umaData.isTextureDirty = true; umaData.Dirty(); }
protected virtual void Start() { data = null; mTrackableBehaviour = GetComponent <TrackableBehaviour>(); if (mTrackableBehaviour) { mTrackableBehaviour.RegisterTrackableEventHandler(this); } JSParser parser = new JSParser(); parser.OverlayDataGenerated += HandleEvent; parser.StartCalculating(); }
public MainForm() { currentDirectory = Directory.GetCurrentDirectory(); jsonData = OverlayData.FromJson(File.ReadAllText(String.Format("{0}\\{1}", currentDirectory, "configuration.json"))); logPath = jsonData[0].clientLogFile.ToString(); MessageBox.Show("Reading client.log from : " + logPath); // Initialize the app InitializeComponent(); InitializeStream(); // Define the regex to scan ... zoneEntered = new Regex(@"You have entered (.*)\.", RegexOptions.IgnoreCase); }
private void ExtractOverlayFrames(byte[] rawPixelData, int bitsAllocated) { // if any overlays have embedded pixel data, extract them now or forever hold your peace var overlayPlaneModuleIod = new OverlayPlaneModuleIod(Parent); foreach (var overlayPlane in overlayPlaneModuleIod) { if (!overlayPlane.HasOverlayData && _overlayCache[overlayPlane.Index] == null) { // if the overlay is embedded in pixel data and we haven't cached it yet, extract it now before we normalize the frame pixel data var overlayData = OverlayData.UnpackFromPixelData(overlayPlane.OverlayBitPosition, bitsAllocated, false, rawPixelData); _overlayCache[overlayPlane.Index] = overlayData; } } }
public void Process(DataSample data, TimeSpan relativeTime, ref OverlayData.LeaderBoard leaderBoard) { leaderBoard = captureLeaderBoard.CreateLeaderBoard(data, relativeTime, GetQualifyingOrder(data)); overlayData.LeaderBoards.Add(leaderBoard); }
public CaptureLeaderBoardLastLap(CaptureLeaderBoard captureLeaderBoard, OverlayData overlayData, CommentaryMessages commentaryMessages) { this.captureLeaderBoard = captureLeaderBoard; this.overlayData = overlayData; this.commentaryMessages = commentaryMessages; }
private static ServiceDescription[] GetServiceDescriptions(string filename) { IList<ServiceDescription> result = new List<ServiceDescription>(); if (filename.StartsWith("dataset:")) { var datasetArgs = filename.Split(new char[] { ':' }); if (datasetArgs[1] == "uniform") { var prv = (IProvider<IDictionary<string, int>, IList<ServiceDescription>>)SrvPrv.GetService("uniformServiceDatasetPrv"); result = prv.Provide(new Dictionary<string, int> { { "services_amount", Convert.ToInt32(datasetArgs[2])}, { "possible_attributes_amount", Convert.ToInt32(datasetArgs[3])}, { "possible_values_amount", Convert.ToInt32(datasetArgs[4])}, { "attribute_per_service_avg_amount", Convert.ToInt32(datasetArgs[5])}, { "attribute_per_service_amount_variance", Convert.ToInt32(datasetArgs[6])}, { "values_per_attr_avg_amount", Convert.ToInt32(datasetArgs[7])}, { "values_per_attr_amount_variance", Convert.ToInt32(datasetArgs[8])} }); } if (datasetArgs[1] == "skewed") { var prv = (IProvider<IDictionary<string, int>, IList<ServiceDescription>>)SrvPrv.GetService("skewedServiceDatasetPrv"); result = prv.Provide(new Dictionary<string, int> { { "services_amount", Convert.ToInt32(datasetArgs[2])}, { "possible_attributes_amount", Convert.ToInt32(datasetArgs[3])}, { "possible_values_amount", Convert.ToInt32(datasetArgs[4])}, { "attribute_per_service_avg_amount", Convert.ToInt32(datasetArgs[5])}, { "attribute_per_service_amount_variance", Convert.ToInt32(datasetArgs[6])}, { "values_per_attr_avg_amount", Convert.ToInt32(datasetArgs[7])}, { "values_per_attr_amount_variance", Convert.ToInt32(datasetArgs[8])} }); } if (DumpGeneratedServicesToFile) { // write generated dataset to a file using (var fs = File.Create("generated_dataset_" + DateTime.Now.Ticks + ".xml")) { using (var writer = XmlWriter.Create(fs)) { writer.WriteStartDocument(); writer.WriteStartElement("data"); foreach (var s in result) { writer.WriteStartElement("node"); writer.WriteAttributeString("name", s.Name); foreach (var av in s.Data) { writer.WriteStartElement(av.AttrValue.Key); writer.WriteValue(av.AttrValue.Value.ToString()); writer.WriteEndElement(); } writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteEndDocument(); } } } return result.ToArray(); } else { Func<string, string> getValidBooleanString = (string s) => { if (s == "no" || s == "0" || s == "false") { return Boolean.FalseString; } else if (s == "yes" || s == "1" || s == "true") { return Boolean.TrueString; } throw new ArgumentException(String.Format("Value '{0}' cannot be converted to boolean", s)); }; Func<string, Type, string, object> getTypedValue = (string val, Type type, string typeStr) => { string vv = val.Trim(); if (type == typeof(bool)) { vv = getValidBooleanString(vv); } if (typeStr == "time") { vv = Convert.ToString(TimeSpan.Parse(vv).TotalMilliseconds); } return TypeDescriptor.GetConverter(type).ConvertFrom(vv); }; using (var fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.None)) { using (var xmlRdr = XmlReader.Create(fs, new XmlReaderSettings { IgnoreComments = true, IgnoreWhitespace = true })) { var xml = XDocument.Load(xmlRdr); var nodes = xml.Root.Descendants(XName.Get("node")).GroupBy(n => n.Attribute(XName.Get("type"))); foreach (var nodeGr in nodes) { foreach (var srvNode in nodeGr) { var srvDescription = new ServiceDescription { Data = new List<OverlayData>(), Name = nodeGr.Key.Value + "_" + Rnd.Next(1, 1000000) }; var ownerNodeAttr = srvNode.Attribute(XName.Get("owner-node")); if (ownerNodeAttr != null) { srvDescription.OwnerNode = new StubNodeDescriptor(Convert.ToInt64(srvNode.Attribute(XName.Get("owner-node")).Value)); } foreach (var item in srvNode.Descendants()) { var od = new OverlayData { ServiceName = srvDescription.Name, OwnerNode = srvDescription.OwnerNode }; object typedValue = item.Value; if (item.Attribute("type") != null) { var typeStr = item.Attribute("type").Value; var originalTypeStr = typeStr; if (typeStr.StartsWith("array[")) { typeStr = typeStr.Replace("array[", "").Replace("]",""); } Type type = null; switch (typeStr) { case "int" : type = typeof(int); break; case "boolean" : type = typeof(bool); break; case "double" : type = typeof(double); break; case "date" : type = typeof(DateTime); break; case "time" : type = typeof(int); break; } if (type != null) { od.ValueType = new OverlayData.TypeInfo { InternalType = type, IsArray = originalTypeStr.StartsWith("array["), IsTime = typeStr == "time" }; if (od.ValueType.IsArray) { // don't forget to remove '[' and ']' typedValue = item.Value.Substring(1, item.Value.Length - 2) .Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries) .Select(v => getTypedValue(v, od.ValueType.InternalType, typeStr)) .ToArray(); } else { typedValue = getTypedValue(item.Value, od.ValueType.InternalType, typeStr); } } } od.AttrValue = new KeyValuePair<string,object>(item.Name.LocalName, typedValue); srvDescription.Data.Add(od); } result.Add(srvDescription); } } } } return result.ToArray(); } }
private BsonValue GetTypedBsonValue(OverlayData od) { if (od.ValueType != null) { return BsonTypeMapper.MapToBsonValue(od.AttrValue.Value); } else { return od.AttrValue.Value.ToString(); } }
public OverlayData[] Get(Query q) { if (GetServiceFrequencyThreshold.Check()) { var dbData = GetDataCollection(); var result = q.Condition == null ? dbData.FindAll() : dbData.Find(MongoQueryMapper.MapFromQuery(q, AttributeFieldName, ValueFieldName, ServiceNameFieldName)); var finalRes = new OverlayData[0]; if (result == null || result.Size() <= 0) { finalRes = null; } else { finalRes = result.Cast<BsonDocument>().Select(d => { var resInternal = new OverlayData { AttrValue = new KeyValuePair<string,object>( d[AttributeFieldName].ToString(), GetTypedValueFromRawBsonValue( d[ValueFieldName], d.Contains(ValueTypeFieldName) ? d[ValueTypeFieldName] : null ) ), ServiceName = d[ServiceNameFieldName].AsString, OwnerNode = Serializer.Deserialize<NodeDescriptor>(d[OwnerNodeFieldName].AsString), ResponsibleNode = Node }; resInternal.ValueType = d.Contains(ValueTypeFieldName) && d[ValueTypeFieldName] != null ? OverlayData.TypeInfo.GetFromDescription(d[ValueTypeFieldName].AsString) : new OverlayData.TypeInfo(); resInternal.ValueType.IsArray = d[ValueFieldName].IsBsonArray; return resInternal; }).ToArray(); } GetServiceFrequencyThreshold.Increment(); return finalRes; } throw new GetServiceException(); }
private string GetValueTypeFieldValue(OverlayData od) { return od.ValueType != null && od.ValueType.IsTime ? "time" : null; }
private ServiceDescription ComposeServiceDescriptionFromLocalData(BsonDocument localData) { return new ServiceDescription { Name = localData[ServiceNameFieldName].AsString, OwnerNode = Node, StorageState = (ServiceStorageState)Enum.Parse(typeof(ServiceStorageState), localData[ServiceStorageStateFieldName].AsString), Data = localData[ServiceDataFieldName].AsBsonArray.Select(sd => { var bsd = (BsonDocument)sd; var resInternal = new OverlayData { AttrValue = new KeyValuePair<string,object>( bsd[AttributeFieldName].ToString(), GetTypedValueFromRawBsonValue( bsd[ValueFieldName], bsd.Contains(ValueTypeFieldName) ? bsd[ValueTypeFieldName] : null ) ), ResponsibleNode = Serializer.Deserialize<NodeDescriptor>(bsd[ResponsibleNodeFieldName].AsString), ServiceName = localData[ServiceNameFieldName].AsString }; resInternal.ValueType = bsd.Contains(ValueTypeFieldName) && bsd[ValueTypeFieldName] != null ? OverlayData.TypeInfo.GetFromDescription(bsd[ValueTypeFieldName].AsString) : new OverlayData.TypeInfo(); resInternal.ValueType.IsArray = bsd[ValueFieldName].IsBsonArray; return resInternal; } ).ToList() }; }
private bool PutService(OverlayData[] od, string serviceName, PutStorageBehavior putBehavior) { // 1. put new service var putResults = PutInternal(od, putBehavior); var putSd = ServiceDescription.FromOverlayData(putResults).Single(); // only one service description will be here since it was one originally // 2. perform the action locally LocalStorage.PutLocal(putSd, putBehavior); // 3. store information about responsible nodes for the service at remote node (by service name) var storageSrv = GetStorageServiceByServiceName(serviceName); storageSrv.PutServiceResponsibleNodes(putSd, putBehavior); return putSd.StorageState == ServiceStorageState.Success; }
private OverlayData[] PutInternal(OverlayData[] data, PutStorageBehavior putBehavior) { var dataToPutByNode = new Dictionary<IOverlayNode, IList<OverlayData>>(); foreach (var dataitem in data) { var dataItemKey = OverlayHashKeyPrv.GetHashKey(OverlayHelper.GetHashArgument(dataitem.AttrValue.Key)); var responsibleNode = MainOverlaySrv.GetNodeByKey(new GetOverlayNodeByKeyArg(dataItemKey)); dataitem.ResponsibleNode = responsibleNode; // here we assign responsible node to the overlay data item if (!dataToPutByNode.ContainsKey(responsibleNode)) { dataToPutByNode.Add(responsibleNode, new List<OverlayData>()); } dataToPutByNode[responsibleNode].Add(dataitem); } var results = new Dictionary<IOverlayNode, OverlayData[]>(); foreach (var item in dataToPutByNode) { var channel = CommunicationMgr.GetChannel(item.Key); var putResults = channel.Service.Put(item.Value.ToArray(), putBehavior); results.Add(item.Key, putResults); } return results.SelectMany(r => r.Value).ToArray(); }
public void UpdateService(string serviceName, OverlayData[] addInfo, string[] removeAttr) { // 0. check if the executing node is the owner of the service if (!CheckServiceOwner(serviceName)) { return; } // 1. do remove if (removeAttr != null && removeAttr.Any()) { RemoveService(serviceName, removeAttr); } // 2. do add if (addInfo != null && addInfo.Any()) { // add service name for full info addInfo = addInfo.Select(d => new OverlayData(d) { ServiceName = serviceName }).ToArray(); PutService(addInfo, serviceName, PutStorageBehavior.Update); } }
public OverlayData[] Put(OverlayData[] d, PutStorageBehavior putBehavior) { return LocalStorage.Put(d, putBehavior); }
public void TestUnpack_Multiframe() { // 7 frames, each 3x2 (cols, rows) = 42 bits = 6 bytes // 111 111 111 111 111 111 111 // 000 001 010 011 100 101 110 // continuous bit stream: 11100011 10011110 10111011 11110011 11011111 10xxxxxx // continuous LE byte stream: 11000111 01111001 11011101 11001111 11111011 xxxxxx01 var expectedResult = new[] {"111000", "111001", "111010", "111011", "111100", "111101", "111110"}; var packedBits = new byte[] {0xc7, 0x79, 0xdd, 0xcf, 0xfb, 0xf1}; for (int frameIndex = 0; frameIndex < 7; frameIndex++) { var offset = 3*2*frameIndex; // little endian test { var unpackedBits = new OverlayData(offset, 2, 3, false, packedBits).Unpack(); var actualResult = FormatNonZeroBytes(unpackedBits); Assert.AreEqual(expectedResult[frameIndex], actualResult, "Error in unpacked bits for multiframe (fr#{0}) (little endian)", frameIndex); } // big endian test { var unpackedBits = new OverlayData(offset, 2, 3, true, SwapBytes(packedBits)).Unpack(); var actualResult = FormatNonZeroBytes(unpackedBits); Assert.AreEqual(expectedResult[frameIndex], actualResult, "Error in unpacked bits for multiframe (fr#{0}) (big endian)", frameIndex); } } }
public void TestUnpack_SingleFrameB() { // 1 frame, 7x3 // 1111111 // 1001011 // 0000011 // continuous bit stream: 11111111 00101100 00011xxx xxxxxxxx // continuous LE byte stream: 11111111 00110100 xxx11000 xxxxxxxx const string expectedResult = "111111110010110000011"; var packedBits = new byte[] {0xff, 0x34, 0x78, 0xf9}; // little endian test { var unpackedBits = new OverlayData(3, 7, false, packedBits).Unpack(); var actualResult = FormatNonZeroBytes(unpackedBits); Assert.AreEqual(expectedResult, actualResult, "Error in unpacked bits for single frame case B (little endian)"); } // big endian test { var unpackedBits = new OverlayData(3, 7, true, SwapBytes(packedBits)).Unpack(); var actualResult = FormatNonZeroBytes(unpackedBits); Assert.AreEqual(expectedResult, actualResult, "Error in unpacked bits for single frame case B (big endian)"); } }
public CaptureLeaderBoardFirstLap(CaptureLeaderBoard captureLeaderBoard, OverlayData overlayData) { this.captureLeaderBoard = captureLeaderBoard; this.overlayData = overlayData; }
private BsonDocument GetInsertOverlayData(OverlayData d) { return new BsonDocument { { AttributeFieldName, d.AttrValue.Key }, { ValueFieldName, GetTypedBsonValue(d) }, { OwnerNodeFieldName, Serializer.Serialize(d.OwnerNode) }, { ServiceNameFieldName, d.ServiceName }, { ValueTypeFieldName, GetValueTypeFieldValue(d) } }; }
private QueryNode SetQueryResult(QueryNode qn) { if (qn is QueryConditionNode) { var resultData = LocalStorage.Get(new Query { Condition = qn }); if (resultData != null) { resultData = resultData.Select(r => new OverlayData(r) { ResponsibleNode = Node }).ToArray(); } else { resultData = new OverlayData[0]; } return new QueryConditionNodeResult(qn) { ResultData = resultData, IsExecutedByResponsibleNode = (Node.Equals((qn as QueryConditionNode).ResponsibleNode)) }; } else if (qn is QueryGroupNode) { var qng = qn as QueryGroupNode; QueryGroupNode result = new QueryGroupNode(qng.Group); foreach (var innerQn in qng.Nodes) { result.Nodes.Add(SetQueryResult(innerQn)); } return result; } else { throw new NotImplementedException(); } }
// TODO: handle putBehavior public OverlayData[] Put(OverlayData[] od, PutStorageBehavior putBehavior) { if (!PutServiceFrequencyThreshold.Check() || !CheckAVThreshold()) { throw new PutServiceException(); } var data = GetDataCollection(); if (putBehavior == PutStorageBehavior.Overwrite) { data.InsertBatch( od.Select(d => GetInsertOverlayData(d)) ); } else if (putBehavior == PutStorageBehavior.Update) { foreach (var d in od) { var items = data.Find( MongoQueryBuilder.And( MongoQueryBuilder.EQ(ServiceNameFieldName, d.ServiceName), MongoQueryBuilder.EQ(AttributeFieldName, d.AttrValue.Key) ) ); if (items != null && items.Size() > 0) { foreach (var item in items) { item[ValueFieldName] = GetTypedBsonValue(d); item[ValueTypeFieldName] = GetValueTypeFieldValue(d); data.Save(item); } } else { data.Insert(GetInsertOverlayData(d)); } } } return od; }
private static ServiceDescription[] GetServiceDescriptions(string filename) { var result = new List<ServiceDescription>(); Func<string, string> getValidBooleanString = (string s) => { if (s == "no" || s == "0" || s == "false") { return Boolean.FalseString; } else if (s == "yes" || s == "1" || s == "true") { return Boolean.TrueString; } throw new ArgumentException(String.Format("Value '{0}' cannot be converted to boolean", s)); }; Func<string, Type, string, object> getTypedValue = (string val, Type type, string typeStr) => { string vv = val.Trim(); if (type == typeof(bool)) { vv = getValidBooleanString(vv); } if (typeStr == "time") { vv = Convert.ToString(TimeSpan.Parse(vv).TotalMilliseconds); } return TypeDescriptor.GetConverter(type).ConvertFrom(vv); }; using (var fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.None)) { using (var xmlRdr = XmlReader.Create(fs, new XmlReaderSettings { IgnoreComments = true, IgnoreWhitespace = true })) { var xml = XDocument.Load(xmlRdr); var nodes = xml.Root.Descendants(XName.Get("node")); var counter = 1; foreach (var srvNode in nodes) { var srvDescription = new ServiceDescription { Data = new List<OverlayData>(), Name = "CloudService_" + Rnd.Next(1, 1000000), OwnerNode = new StubNodeDescriptor(counter) }; foreach (var item in srvNode.Descendants()) { var od = new OverlayData { ServiceName = srvDescription.Name, OwnerNode = srvDescription.OwnerNode }; object typedValue = item.Value; if (item.Attribute("type") != null) { var typeStr = item.Attribute("type").Value; var originalTypeStr = typeStr; if (typeStr.StartsWith("array[")) { typeStr = typeStr.Replace("array[", "").Replace("]",""); } Type type = null; switch (typeStr) { case "int" : type = typeof(int); break; case "boolean" : type = typeof(bool); break; case "double" : type = typeof(double); break; case "date" : type = typeof(DateTime); break; case "time" : type = typeof(int); break; } if (type != null) { od.ValueType = new OverlayData.TypeInfo { InternalType = type, IsArray = originalTypeStr.StartsWith("array["), IsTime = typeStr == "time" }; if (od.ValueType.IsArray) { // don't forget to remove '[' and ']' typedValue = item.Value.Substring(1, item.Value.Length - 2) .Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries) .Select(v => getTypedValue(v, od.ValueType.InternalType, typeStr)) .ToArray(); } else { typedValue = getTypedValue(item.Value, od.ValueType.InternalType, typeStr); } } } od.AttrValue = new KeyValuePair<string,object>(item.Name.LocalName, typedValue); srvDescription.Data.Add(od); } result.Add(srvDescription); ++counter; } } } return result.ToArray(); }
/// <summary> /// Combines polygons with polygons and keeps all geometry. Union acts /// like the Boolean OR operation and can be used only with polygons. /// </summary> /// <param name="sourceTopologyName">[in] The source topology name.</param> /// <param name="overlayTopologyName">[in] The overlay topology name.</param> /// <returns> /// Returns true if successful. /// </returns> //�������Ϊ�����Ӷ�������˺͵��Ӷ�������� private bool Union(string sourceTopologyName, string overlayTopologyName) { // ��������ģ�Ͷ��� TopologyModel sourceTopology = null; // �����������ݶ��� OverlayDataCollection sourceDataCollection = null; MapApplication mapApp = HostMapApplicationServices.Application; //��ȡ��ǰ���̵�����ģ�� Topologies topos = mapApp.ActiveProject.Topologies; // Does the Source Topology exist to get information from //�жϴ���������ģ���Ƿ���� if (topos.Exists(sourceTopologyName)) { sourceTopology = topos[sourceTopologyName]; } else { Utility.AcadEditor.WriteMessage(string.Format("\nERROR: The topology {0} doesn't exist.", sourceTopologyName)); return false; } // �������Ӷ��������ģ�Ͷ��� TopologyModel overlayTopology = null; // �����������ݶ��� OverlayDataCollection overlayDataCollection = new OverlayDataCollection(); string expression = ""; expression = string.Format(":AREA@TPMCNTR_{0}", overlayTopologyName); OverlayData data = new OverlayData(expression, "PolygonArea", Autodesk.Gis.Map.Constants.DataType.Real); overlayDataCollection.Add(data); // �жϵ�������ģ���Ƿ���� if (topos.Exists(overlayTopologyName)) { overlayTopology = topos[overlayTopologyName]; } else { Utility.AcadEditor.WriteMessage(string.Format("\nERROR: The topology {0} doesn't exist.", overlayTopologyName)); return false; } try { // ��Դ����ģ�ͣ�����ȡ sourceTopology.Open(Autodesk.Gis.Map.Topology.OpenMode.ForRead); // ��������ģ�ͣ�����ȡ overlayTopology.Open(Autodesk.Gis.Map.Topology.OpenMode.ForRead); // ���ýڵ㴴������ PointCreationSettings nodeCreationSettings = new PointCreationSettings( "result", // layer name 1, // color, by layer true, // create new node "ACAD_POINT"); // block name //���ýڵ㴴�� sourceTopology.SetNodeCreationSettings(nodeCreationSettings); //�����˵����� string newTopologyName = "Result"; //�����˵����� string newTopologyDesc = "Result topology of an Union operation"; //���������˵Ķ������ݱ� ObjectDataTable resultDataTable = new ObjectDataTable(); resultDataTable.ODTableName = "UnionResult"; resultDataTable.ODTableDescription = "The result of the Union Overlay"; // �� sourceTopology.Union(overlayTopology, newTopologyName, newTopologyDesc, resultDataTable, sourceDataCollection, overlayDataCollection); TopologyModel newTopology = topos[newTopologyName]; newTopology.Open(Autodesk.Gis.Map.Topology.OpenMode.ForRead); newTopology.ShowGeometry(5); newTopology.Close(); return true; } catch (MapException e) { if (2001 == e.ErrorCode) { Utility.AcadEditor.WriteMessage("\nERROR: Topology Result already exists."); } else { Utility.AcadEditor.WriteMessage(string.Format("\nERROR: Operation failed with error code: {0}.", e.ErrorCode)); } return false; } finally { // Close the topologys sourceTopology.Close(); overlayTopology.Close(); } }