Пример #1
0
        private void logChannelInfo()
        {
            if (!RunParameters.Instance.DebugIDs.Contains("LOGCHANNELS"))
            {
                return;
            }

            if (RunParameters.Instance.ChannelBouquet == -1 &&
                !RunParameters.Instance.Options.Contains("USECHANNELID") &&
                !RunParameters.Instance.Options.Contains("USELCN") &&
                !RunParameters.Instance.Options.Contains("CREATEBRCHANNELS") &&
                !RunParameters.Instance.Options.Contains("CREATEARCHANNELS"))
            {
                return;
            }

            Logger.Instance.WriteSeparator("Bouquet Usage");

            bool firstBouquet = true;

            foreach (Bouquet bouquet in Bouquet.GetBouquetsInNameOrder())
            {
                if (!firstBouquet)
                {
                    Logger.Instance.Write("");
                }

                firstBouquet = false;

                if (!firstBouquet)
                {
                    Logger.Instance.Write("");
                }

                firstBouquet = false;

                foreach (Region region in bouquet.Regions)
                {
                    Logger.Instance.Write("Bouquet: " + bouquet.BouquetID + " - " + bouquet.Name + " Region: " + region.Code + " (channels = " + region.Channels.Count + ")");

                    foreach (Channel channel in region.GetChannelsInNameOrder())
                    {
                        Logger.Instance.Write("    Channel: " + channel.ToString());
                    }
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Carry out the processing after all data has been collected for a frequency.
        /// </summary>
        public override void FinishFrequency()
        {
            if (OpenTVChannel.Channels.Count == 0)
            {
                return;
            }

            Logger titleLogger               = null;
            Logger descriptionLogger         = null;
            Logger extendedDescriptionLogger = null;
            Logger undefinedRecordLogger     = null;

            if (RunParameters.Instance.DebugIDs.Contains("LOGTITLES"))
            {
                titleLogger = new Logger("EPG Titles.log");
            }
            if (RunParameters.Instance.DebugIDs.Contains("LOGDESCRIPTIONS"))
            {
                descriptionLogger = new Logger("EPG Descriptions.log");
            }
            if (RunParameters.Instance.DebugIDs.Contains("LOGEXTENDEDDESCRIPTIONS"))
            {
                extendedDescriptionLogger = new Logger("EPG Extended Descriptions.log");
            }
            if (RunParameters.Instance.DebugIDs.Contains("LOGUNDEFINEDRECORDS"))
            {
                undefinedRecordLogger = new Logger("EPG Undefined Records.log");
            }

            foreach (OpenTVChannel channel in OpenTVChannel.Channels)
            {
                TVStation station = TVStation.FindStation(channel.OriginalNetworkID, channel.TransportStreamID, channel.ServiceID);
                if (station != null)
                {
                    if (station.EPGCollection.Count == 0)
                    {
                        channel.ProcessChannelForEPG(station, titleLogger, descriptionLogger, extendedDescriptionLogger, undefinedRecordLogger);
                        channel.CreateChannelMapping(station);
                    }
                }
            }

            if (RunParameters.Instance.DebugIDs.Contains("LOGCHANNELS"))
            {
                Logger.Instance.WriteSeparator("Bouquet Usage");

                bool firstBouquet = true;

                foreach (Bouquet bouquet in Bouquet.GetBouquetsInNameOrder())
                {
                    if (!firstBouquet)
                    {
                        Logger.Instance.Write("");
                    }

                    firstBouquet = false;

                    foreach (Region region in bouquet.Regions)
                    {
                        Logger.Instance.Write("Bouquet: " + bouquet.BouquetID + " - " + bouquet.Name + " Region: " + region.Code + " (channels = " + region.Channels.Count + ")");

                        foreach (Channel channel in region.GetChannelsInNameOrder())
                        {
                            Logger.Instance.Write("    Channel: " + channel.ToString());
                        }
                    }
                }
            }

            int count = 0;

            foreach (TuningFrequency frequency in TuningFrequency.FrequencyCollection)
            {
                if (frequency.CollectionType == CollectionType.OpenTV)
                {
                    count++;
                }
            }

            if (count > 1)
            {
                bool frequencyFirst = true;

                foreach (TuningFrequency frequency in TuningFrequency.FrequencyCollection)
                {
                    if (frequency.CollectionType == CollectionType.OpenTV)
                    {
                        if (frequencyFirst)
                        {
                            Logger.Instance.WriteSeparator("Frequency Usage");
                            frequencyFirst = false;
                        }
                        Logger.Instance.Write("Frequency " + frequency.Frequency + " usage count " + frequency.UsageCount);
                    }
                }
            }

            OpenTVProgramCategory.LogCategoryUsage();

            if (RunParameters.Instance.DebugIDs.Contains("LOGCHANNELDATA"))
            {
                if (OpenTVChannel.Channels.Count != 0)
                {
                    Logger.Instance.WriteSeparator("Channel Data - ID Sequence");

                    foreach (OpenTVChannel channel in OpenTVChannel.Channels)
                    {
                        channel.LogChannelMapping(Logger.Instance);
                    }

                    Collection <OpenTVChannel> sortedChannels = new Collection <OpenTVChannel>();

                    foreach (OpenTVChannel channel in OpenTVChannel.Channels)
                    {
                        addByUserChannel(sortedChannels, channel);
                    }

                    Logger.Instance.WriteSeparator("Channel Data - User Channel Sequence");

                    foreach (OpenTVChannel channel in sortedChannels)
                    {
                        channel.LogChannelMapping(Logger.Instance);
                    }

                    sortedChannels = new Collection <OpenTVChannel>();

                    foreach (OpenTVChannel channel in OpenTVChannel.Channels)
                    {
                        addByFlags(sortedChannels, channel);
                    }

                    Logger.Instance.WriteSeparator("Channel Data - Flags Sequence");

                    foreach (OpenTVChannel channel in sortedChannels)
                    {
                        channel.LogChannelMapping(Logger.Instance);
                    }
                }
            }
        }