public void GetAllTracksAndAddToWptListTest() { // Arrange var wptList = WptListFactory.GetWptList(wptIdents); AddAirways(wptList); var recorder = new StatusRecorder(); var handler = new TrackHandler <AusTrack>( wptList, wptList.GetEditor(), GetAirportList(), new TrackInUseCollection()); // Act handler.GetAllTracks(DownloaderStub(), recorder); handler.AddToWaypointList(recorder); // Assert Assert.AreEqual(0, recorder.Records.Count); // Verify all tracks are added. AssertAllTracks(wptList); // Check the tracks. AssertTrackMY14(wptList); AssertTrackBP14(wptList); }
private void SetTrackData() { Helpers.TrackTypes.ForEach(t => { var h = GetHandler(t); queues.EnqueueSyncTask(t, () => h?.UndoEdit()); }); TracksInUse.Clear(); StatusRecorder.Clear(); natsHandler = new TrackHandler <NorthAtlanticTrack>( WptList, WptList.GetEditor(), AirportList, TracksInUse); pacotsHandler = new TrackHandler <PacificTrack>( WptList, WptList.GetEditor(), AirportList, TracksInUse); ausotsHandler = new TrackHandler <AusTrack>( WptList, WptList.GetEditor(), AirportList, TracksInUse); }
public void GetAllTracksAndAddToWptListTest() { // Arrange var wptList = WptListFactory.GetWptList(wptIdents); AddAirways(wptList); var recorder = new StatusRecorder(); var handler = new TrackHandler <PacificTrack>( wptList, wptList.GetEditor(), GetAirportList(), new TrackInUseCollection()); // Act handler.GetAllTracks(DownloaderStub(), recorder); handler.AddToWaypointList(recorder); // Assert Assert.AreEqual(0, recorder.Records.Count); // Verify all tracks are added. AssertAllTracks(wptList); // Check one westbound track. AssertTrackJ(wptList); // Check one eastbound track. AssertTrack11(wptList); // Check connection routes AssertDct(wptList, "DANNO", "BOOKE"); // In track 11 AssertDct(wptList, "BRINY", "ALCOA"); // In track J }
public void startTrackConsumer(string trackId) { AppConsumerSequenceNumber trackConsumer = new AppConsumerSequenceNumber(face_, keyChain_, false, 5, -1); TrackHandler th = new TrackHandler(this); tracks_[trackId] = new List <string>(); trackConsumer.consume(new Name(optPrefix).append("tracks").append(trackId), th, th, th); }
protected void UnlistenFromTrack(TrackHandler trackedCallback, TrackHandler untrackedCallback) { if (trackedCallback != null) { _trackedCallbacks -= trackedCallback; } if (untrackedCallback != null) { _untrackedCallbacks -= untrackedCallback; } }
protected void ListenToTrack(TrackHandler trackedCallback, TrackHandler untrackedCallback) { if (trackedCallback != null) { _trackedCallbacks += trackedCallback; } if (untrackedCallback != null) { _untrackedCallbacks += untrackedCallback; } }
//fetchTrack public void expressInterestForTrack(string trackID) { Name trackName = new Name(prefix); trackName.append(startTimeComponent).append(producerNameComponents.tracks).append(trackID).append("0"); Interest trackInterest = new Interest(trackName); trackInterest.setMustBeFresh(true); TrackHandler handler = new TrackHandler(this); face.expressInterest(trackInterest, handler, handler); }
protected virtual void Clean() { for (int i = _entities.Count - 1; i >= 0; i--) { Untrack(_entities[i]); } _trackedCallbacks = null; _untrackedCallbacks = null; _entities.Clear(); _entities = null; }
static void Main(string[] args) { TransponderReceiverFactory transponderReceiverFactory = new TransponderReceiverFactory(); ITransponderReceiver transponderReceiver = TransponderReceiverFactory.CreateTransponderDataReceiver(); //IDataFormat dataFormat = new DataFormat(transponderReceiver); IDataFormat dataformat = new DataFormat(); ITransponderReceiverClient TransponderReceiverClient = new TransponderReceiverClient(transponderReceiver, dataformat); IConditionLogger conditionLogger = new ConditionLogger(); ITrackHandler trackHandler = new TrackHandler(TransponderReceiverClient, conditionLogger); ConsoleRenderer renderer = new ConsoleRenderer(trackHandler); for (;;) { //Thread.Sleep(1000); } }
public void Clean(TrackHandler trackedCallback, TrackHandler untrackedCallback, bool callForCurrentEntries = true) { UnlistenFromTrack(trackedCallback, untrackedCallback); if (callForCurrentEntries && untrackedCallback != null) { ForEach(x => untrackedCallback(x)); } RemoveReference(this); if (!HasReferences(this)) { EntityTracker.Instance.TagAddedEvent -= OnEntityAddedTagEvent; EntityTracker.Instance.TagRemovedEvent -= OnEntityRemovedTagEvent; EntityTracker.Instance.AddedComponentEvent -= OnEntityAddedComponentEvent; EntityTracker.Instance.RemovedComponentEvent -= OnEntityRemovedComponentEvent; EntityTracker.Instance.EnabledComponentEvent -= OnEntityChangedEnabledStateOfComponentEvent; EntityTracker.Instance.DisabledComponentEvent -= OnEntityChangedEnabledStateOfComponentEvent; EntityTracker.Instance.TrackedEvent -= OnEntityTrackedEvent; EntityTracker.Instance.UntrackedEvent -= OnEntityUntrackedEvent; base.Clean(); } }
//fetchTrack public void expressInterestForTrack(string trackID, Name.Component excludeComp = null) { Name trackName = new Name(prefix); trackName.append(startTimeComponent).append(producerNameComponents.tracks).append(trackID); //.append ("0"); Interest trackInterest = new Interest(trackName); if (excludeComp != null) { Exclude exclude = new Exclude(); exclude.appendAny(); exclude.appendComponent(excludeComp); trackInterest.setExclude(exclude); } trackInterest.setMustBeFresh(true); trackInterest.setChildSelector(1); TrackHandler handler = new TrackHandler(this); FaceSingleton.getFace().expressInterest(trackInterest, handler, handler); }
public static EntityFilter Create(FilterRules filterRules, TrackHandler trackedCallback, TrackHandler untrackedCallback, bool callForCurrentEntries = true) { void SetupFilter(EntityFilter filterToSetup) { filterToSetup.ListenToTrack(trackedCallback, untrackedCallback); if (callForCurrentEntries && trackedCallback != null) { filterToSetup.ForEach(x => trackedCallback(x)); } } for (int i = _cachedFilters.Count - 1; i >= 0; i--) { EntityFilter filter = _cachedFilters[i]; if (filter.FilterRules.Equals(filterRules)) { AddReference(filter); SetupFilter(filter); return(filter); } } EntityFilter self = new EntityFilter(filterRules); AddReference(self); _cachedFilters.Add(self); SetupFilter(self); return(self); }
public static EntityFilter Create(TrackHandler trackedCallback, TrackHandler untrackedCallback, bool callForCurrentEntries = true) { return(Create(FilterRules.CreateNoTagsFilter(), trackedCallback, untrackedCallback, callForCurrentEntries)); }
public AudioSearchModule(LavaSocketClient lavaSocketClient, LavaRestClient lavaRestClient, TrackHandler trackHandler) { _lavaSocketClient = lavaSocketClient; _lavaRestClient = lavaRestClient; _trackHandler = trackHandler; }