/// <summary> /// Adds a Satellite Constellation to the OrbitGetter /// </summary> /// <param name="uri">The URI of the TLE file to parse the constellation from.</param> public void AddConstellation(string name, string uri) { string twoLineElements = this.GetDocFromUri(uri); Constellation2 c2 = new Constellation2(twoLineElements, uri); lock (this._constellations) { this._constellations[name] = c2; // will replace } }
private void UpdateConstellations() { while (true) { try { Dictionary<string, Constellation2> newCons = new Dictionary<string, Constellation2>(); lock (this._constellations) { foreach (string name in this._constellations.Keys) { string uri = this._constellations[name].URI; string newDoc = this.GetDocFromUri(uri); Constellation2 c2 = new Constellation2(newDoc, uri); newCons[name] = c2; } this._constellations = newCons; } Thread.Sleep(this._updateInterval); } catch (ThreadInterruptedException) { continue; } catch (ThreadAbortException) { return; } } }