コード例 #1
0
        /// <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());
                }
            }
        }
コード例 #2
0
        /// <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();
        }
コード例 #3
0
 /// <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);
     }
 }
コード例 #4
0
 public void StopRecording()
 {
     EIT?.CompleteAdding();
     ECG?.CompleteAdding();
     SystemEvents?.StopRecording();
     RPosition?.StopRecording();
     Tags?.StopRecording();
     RecordingInProgress = false;
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 /// <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
     }
 }
コード例 #7
0
        /// <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
                }
            }
        }
コード例 #8
0
        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;
        }
コード例 #9
0
        /// <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
            {
            }
        }
コード例 #10
0
        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);
        }
コード例 #11
0
 /// <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
     }
 }
コード例 #12
0
        /// <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];
                                }
                        }
                    }
                }
            }
        }
コード例 #13
0
        /// <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;
                        }
                    }
                }
            }
        }
コード例 #14
0
 /// <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); }));
 }
コード例 #15
0
        /// <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() );
                }
        }
コード例 #16
0
 /// <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; } ) );
 }
コード例 #17
0
 public void AppendElectrodeSample(ElectrodeFrame sample)
 {
     EIT.Enqueue(sample);
 }
コード例 #18
0
        /// <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
            {
            }
        }
コード例 #19
0
        /// <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];
                    }
        }
コード例 #20
0
 /// <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 );
 }