/// <summary> /// Sammelt die Einträge der Programmzeitschrift. /// </summary> private void TagValidator(EIT table) { // Process all descriptors foreach (var entry in table.Table.Entries) { foreach (var descriptor in entry.Descriptors) { // All we process if (descriptor.Tag == EPG.DescriptorTags.ShortEvent) { continue; } if (descriptor.Tag == EPG.DescriptorTags.ExtendedEvent) { continue; } if (descriptor.Tag == EPG.DescriptorTags.ParentalRating) { continue; } if (descriptor.Tag == EPG.DescriptorTags.Linkage) { continue; } if (descriptor.Tag == EPG.DescriptorTags.Content) { continue; } // All we will process in the next release if (descriptor.Tag == EPG.DescriptorTags.Component) { continue; } // All we are currently not willing to process if (descriptor.Tag == EPG.DescriptorTags.PrivateDataSpecifier) { continue; } if (descriptor.Tag == EPG.DescriptorTags.PDC) { continue; } if (descriptor.Tag == EPG.DescriptorTags.ContentIdentifier) { continue; } // For now skip reserved area if (descriptor.Tag > (EPG.DescriptorTags) 0x7f) { continue; } // Report Console.WriteLine("\t{0}: {1}", descriptor.Tag, descriptor.GetType()); } } }
/// <summary> /// Verarbeitet einen Eintrag aus der Programmzeitschrift. /// </summary> /// <param name="guideItem">Eine vollständige Tabelle.</param> private void ProcessGuide(EIT guideItem) { // Count outer m_numberOfGuideTables++; // Count inner m_numberOfGuideEntries += guideItem.Events.LongCount(); }
/// <summary> /// Nimmt eine EPG Tabelle entgegen. /// </summary> /// <param name="table"></param> private void ReceiveEPG(EIT table) { // Check for EPG entry if (null != CurrentSelection) { ProcessEPG(table.Table.Section, CurrentSelection.Source); } }
public void StopRecording() { EIT?.CompleteAdding(); ECG?.CompleteAdding(); SystemEvents?.StopRecording(); RPosition?.StopRecording(); Tags?.StopRecording(); RecordingInProgress = false; }
public Task StartLogging(AcquisitionProtocolParameters acquisitionProtocol) { EIT = new EIT(RecordNumber++, EITDefaultChunkSize, acquisitionProtocol.AsJson(), fileId, groupEIT, Logger); //var acquisitionInformation = new AcquisitionInformation(acquisitionProtocol, fileId, groupEIT, Logger); //acquisitionInformation.FlushDataAndCloseObject(); ECG = new ECG(fileId, groupRoot, ECGDefaultChunkSize, (int)acquisitionProtocol.ScanDescription.EcgParams.SampleRate, Logger); SystemEvents.StartLogging(); RPosition.StartLogging(); Tags.StartLogging(); return(Task.CompletedTask); }
/// <summary> /// Übermittelt die Daten zur Programmzeitschrift. /// </summary> /// <param name="table">Eine Tabelle der Programmzeitschrift.</param> private void DispatchEPG(EIT table) { // Be safe try { // Forward if (null != m_TransportStream) { m_TransportStream.AddEventTable(table.Table); } } catch { // Ignore any error } }
/// <summary> /// Nimmt eine Tabelle der Programmzeitschrift entgegen und verteilt diese /// an die angemeldeten Empfänger. /// </summary> /// <param name="table">Die aktuelle Tabelle.</param> private void ProgramGuide(EIT table) { // Process var consumers = m_programGuideConsumers; if (consumers != null) { try { consumers(table); } catch (Exception) { // Ignore any error } } }
private async Task CloseHandles() { ProcedureInformation.FlushDataAndCloseObject(); SystemInformation.FlushDataAndCloseObject(); CalibrationGroup.FlushDataAndCloseObject(); //wait for writing all data before resetting if (EIT != null) { await EIT.WaitForDataWritten(); EIT.Dispose(); } if (ECG != null) { await ECG.WaitForDataWritten(); ECG.Dispose(); } if (SystemEvents != null) { await SystemEvents.WaitForDataWritten(); SystemEvents.Dispose(); } if (RPosition != null) { await RPosition.WaitForDataWritten(); RPosition.Dispose(); } if (Tags != null) { await Tags.WaitForDataWritten(); Tags.Dispose(); } if (UserEventsGroup != null) { await UserEventsGroup.WaitForDataWritten(); UserEventsGroup.Dispose(); } await Task.CompletedTask; }
/// <summary> /// Wird aufgerufen, wenn ein Eintrag für die Programmzeitschrift erkannt wurde. /// </summary> /// <param name="epg">Ein Element der Programmzeitschrift.</param> private void OnStandardEPGEvent(EIT epg) { // Ignore any error try { // Attach to source SourceIdentifier source = epg.Source; // See if we are interested if (!m_EPGSources.ContainsKey(source)) { return; } // Process all events foreach (legacy.EventEntry epgEntry in epg.Table.Entries) { AddGuideItem(source, epgEntry.EventIdentifier, epgEntry.StartTime, epgEntry.Duration, epgEntry.Descriptors); } } catch { } }
private bool ProcessEITEvents(EIT epgTable) { // Check if (null == epgTable) { return(false); } if (!epgTable.IsValid) { return(true); } // Process all events foreach (EventEntry entry in epgTable.Entries) { if (ckAll.Checked || (EventStatus.Running == entry.Status)) { AddEntry(epgTable.ServiceIdentifier, entry); } } // Did it return(true); }
/// <summary> /// Übermittelt die Daten zur Programmzeitschrift. /// </summary> /// <param name="table">Eine Tabelle der Programmzeitschrift.</param> private void DispatchEPG( EIT table ) { // Be safe try { // Forward if (null != m_TransportStream) m_TransportStream.AddEventTable( table.Table ); } catch { // Ignore any error } }
/// <summary> /// Parse some EPG information and try to extract the data of the current /// service group. /// </summary> /// <param name="table">Currently parsed SI table.</param> public void TableFound(EIT table) { // Test var eit = table.Table; // Not us if (null != eit) { foreach (var evt in eit.Entries) { if (evt.Status == EPG.EventStatus.Running) { // What to add var ids = new List <Station>(); var names = new List <string>(); // Make sure that this is us bool found = false; // Run over foreach (var descr in evt.Descriptors) { // Check type var info = descr as EPG.Descriptors.Linkage; if (null == info) { continue; } // Check type (PREMIERE) if (176 != info.LinkType) { continue; } // Create identifier var id = new SourceIdentifier { Network = info.OriginalNetworkIdentifier, TransportStream = info.TransportStreamIdentifier, Service = info.ServiceIdentifier }; // Lookup in profile SourceSelection[] sources = Profile.FindSource(id); if (sources.Length < 1) { continue; } // Check the first one to see if this is us if (!found) { found = Equals(id, CurrentPortal); } // Remember names.Add(string.Format("{0},{1}", names.Count, CodePage.GetString(info.PrivateData))); ids.Add((Station)sources[0].Source); } // Register if (found) { lock (m_ServiceNames) for (int i = ids.Count; i-- > 0;) { m_ServiceNames[ids[i]] = names[i]; } } } } } }
/// <summary> /// Prüft, ob in der Programmzeitschrift Daten zur aktuellen Aufzeichnung vorliegen. /// </summary> /// <param name="section">Eintrag aus der Programmzeitschrift.</param> private void ProcessEPG(Section section) { // Not valid if (null == section) { return; } if (!section.IsValid) { return; } // Get the table EIT eit = section.Table as EIT; // Not valid if (null == eit) { return; } if (!eit.IsValid) { return; } // See if filter is active int?service = m_CurrentService; // Only current events are of interest if (!service.HasValue) { return; } if (service.Value != eit.ServiceIdentifier) { return; } // Set flags bool gotCurrent = false, gotNext = false; // Find all foreach (EventEntry entry in eit.Entries) { // Check for current if (!gotCurrent) { if (EventStatus.Running == entry.Status) { // Remember CurrentEntry = entry; gotCurrent = true; // Done if (gotNext) { break; } else { continue; } } } // Check for next if (!gotNext) { if (EventStatus.NotRunning == entry.Status) { // Remember NextEntry = entry; gotNext = true; // Done if (gotCurrent) { break; } } } } }
/// <summary> /// Sammelt die Einträge der Programmzeitschrift. /// </summary> private void EventCollector(EIT table) { // Easy m_Events.AddRange(table.Events.Select(e => { e.Load(); return(e); })); }
/// <summary> /// Sammelt die Einträge der Programmzeitschrift. /// </summary> private void TagValidator( EIT table ) { // Process all descriptors foreach (var entry in table.Table.Entries) foreach (var descriptor in entry.Descriptors) { // All we process if (descriptor.Tag == EPG.DescriptorTags.ShortEvent) continue; if (descriptor.Tag == EPG.DescriptorTags.ExtendedEvent) continue; if (descriptor.Tag == EPG.DescriptorTags.ParentalRating) continue; if (descriptor.Tag == EPG.DescriptorTags.Linkage) continue; if (descriptor.Tag == EPG.DescriptorTags.Content) continue; // All we will process in the next release if (descriptor.Tag == EPG.DescriptorTags.Component) continue; // All we are currently not willing to process if (descriptor.Tag == EPG.DescriptorTags.PrivateDataSpecifier) continue; if (descriptor.Tag == EPG.DescriptorTags.PDC) continue; if (descriptor.Tag == EPG.DescriptorTags.ContentIdentifier) continue; // For now skip reserved area if (descriptor.Tag > (EPG.DescriptorTags) 0x7f) continue; // Report Console.WriteLine( "\t{0}: {1}", descriptor.Tag, descriptor.GetType() ); } }
/// <summary> /// Sammelt die Einträge der Programmzeitschrift. /// </summary> private void EventCollector( EIT table ) { // Easy m_Events.AddRange( table.Events.Select( e => { e.Load(); return e; } ) ); }
public void AppendElectrodeSample(ElectrodeFrame sample) { EIT.Enqueue(sample); }
/// <summary> /// Wird aufgerufen, wenn ein Eintrag für die Programmzeitschrift erkannt wurde. /// </summary> /// <param name="epg">Ein Element der Programmzeitschrift.</param> private void OnStandardEPGEvent( EIT epg ) { // Ignore any error try { // Attach to source SourceIdentifier source = epg.Source; // See if we are interested if (!m_EPGSources.ContainsKey( source )) return; // Process all events foreach (legacy.EventEntry epgEntry in epg.Table.Entries) AddGuideItem( source, epgEntry.EventIdentifier, epgEntry.StartTime, epgEntry.Duration, epgEntry.Descriptors ); } catch { } }
/// <summary> /// Parse some EPG information and try to extract the data of the current /// service group. /// </summary> /// <param name="table">Currently parsed SI table.</param> public void TableFound( EIT table ) { // Test var eit = table.Table; // Not us if (null != eit) foreach (var evt in eit.Entries) if (evt.Status == EPG.EventStatus.Running) { // What to add var ids = new List<Station>(); var names = new List<string>(); // Make sure that this is us bool found = false; // Run over foreach (var descr in evt.Descriptors) { // Check type var info = descr as EPG.Descriptors.Linkage; if (null == info) continue; // Check type (PREMIERE) if (176 != info.LinkType) continue; // Create identifier var id = new SourceIdentifier { Network = info.OriginalNetworkIdentifier, TransportStream = info.TransportStreamIdentifier, Service = info.ServiceIdentifier }; // Lookup in profile SourceSelection[] sources = Profile.FindSource( id ); if (sources.Length < 1) continue; // Check the first one to see if this is us if (!found) found = Equals( id, CurrentPortal ); // Remember names.Add( string.Format( "{0},{1}", names.Count, CodePage.GetString( info.PrivateData ) ) ); ids.Add( (Station) sources[0].Source ); } // Register if (found) lock (m_ServiceNames) for (int i = ids.Count; i-- > 0; ) m_ServiceNames[ids[i]] = names[i]; } }
/// <summary> /// Nimmt eine EPG Tabelle entgegen. /// </summary> /// <param name="table"></param> private void ReceiveEPG( EIT table ) { // Check for EPG entry if (null != CurrentSelection) ProcessEPG( table.Table.Section, CurrentSelection.Source ); }