CodeTV.GraphBuilderBDA.GetTablesInfos C# (CSharp) Метод

GetTablesInfos() публичный Метод

public GetTablesInfos ( Channel channel, bool allTransponderInfo ) : string
channel Channel
allTransponderInfo bool
Результат string
        public string GetTablesInfos(Channel channel, bool allTransponderInfo)
        {
            string result = "";
            if (channel != null && channel is ChannelDVB)
            {
                ChannelDVB channelDVB = channel as ChannelDVB;

                IMpeg2Data mpeg2Data = this.bdaSecTab as IMpeg2Data;
                // Hervé Stalin : Utile ?
                //Hashtable serviceNameByServiceId = new Hashtable();
                PSISection[] psiSdts = PSISection.GetPSITable((int)PIDS.SDT, (int)TABLE_IDS.SDT_ACTUAL, mpeg2Data);
                for (int i = 0; i < psiSdts.Length; i++)
                {
                    PSISection psiSdt = psiSdts[i];
                    if (psiSdt != null && psiSdt is PSISDT)
                    {
                        PSISDT sdt = (PSISDT)psiSdt;
                        if (allTransponderInfo)
                        {
                            result += "PSI Table " + i + "/" + psiSdts.Length + "\r\n";
                            result += sdt.ToString();
                        }
                        // Hervé Stalin : Utile ?
                        //foreach (PSISDT.Data service in sdt.Services)
                        //{
                        //    serviceNameByServiceId[service.ServiceId] = service.GetServiceName();
                        //}
                    }
                }

                //Hervé Stalin : Code pode pour créér un hashtable de lcn
                //Hashtable logicalChannelNumberByServiceId = new Hashtable();
                PSISection[] psiNits = PSISection.GetPSITable((int)PIDS.NIT, (int)TABLE_IDS.NIT_ACTUAL, mpeg2Data);
                for (int i = 0; i < psiNits.Length; i++)
                {
                    PSISection psinit = psiNits[i];
                    if (psinit != null && psinit is PSINIT)
                    {
                        PSINIT nit = (PSINIT)psinit;
                        result += "PSI Table " + i + "/" + psiNits.Length + "\r\n";
                        result += nit.ToString();

                        //foreach (PSINIT.Data data in nit.Streams)
                        //{
                        //    foreach (PSIDescriptor psiDescriptorData in data.Descriptors)
                        //    {
                        //        if (psiDescriptorData.DescriptorTag == DESCRIPTOR_TAGS.DESCR_LOGICAL_CHANNEL)
                        //        {
                        //            PSIDescriptorLogicalChannel psiDescriptorLogicalChannel = (PSIDescriptorLogicalChannel)psiDescriptorData;
                        //            foreach (PSIDescriptorLogicalChannel.ChannelNumber f in psiDescriptorLogicalChannel.LogicalChannelNumbers)
                        //            {
                        //                logicalChannelNumberByServiceId[f.ServiceID] = f.LogicalChannelNumber;
                        //            }

                        //        }
                        //    }
                        //}

                    }
                }

                PSISection[] psiPats = PSISection.GetPSITable((int)PIDS.PAT, (int)TABLE_IDS.PAT, mpeg2Data);
                for (int i = 0; i < psiPats.Length; i++)
                {
                    PSISection psiPat = psiPats[i];
                    if (psiPat != null && psiPat is PSIPAT)
                    {
                        PSIPAT pat = (PSIPAT)psiPat;
                        if (allTransponderInfo)
                        {
                            result += "PSI Table " + i + "/" + psiPats.Length + "\r\n";
                            result += pat.ToString();
                        }

                        foreach (PSIPAT.Data program in pat.ProgramIds)
                        {
                            if (allTransponderInfo || program.ProgramNumber == channelDVB.SID)
                            {
                                if (!program.IsNetworkPID)
                                {
                                    PSISection[] psiPmts = PSISection.GetPSITable(program.Pid, (int)TABLE_IDS.PMT, mpeg2Data);
                                    for (int i2 = 0; i2 < psiPmts.Length; i2++)
                                    {
                                        PSISection psiPmt = psiPmts[i2];
                                        if (psiPmt != null && psiPmt is PSIPMT)
                                        {
                                            PSIPMT pmt = (PSIPMT)psiPmt;
                                            result += "PSI Table " + i2 + "/" + psiPmts.Length + "\r\n";
                                            result += pmt.ToString();
                                        }
                                        if (!allTransponderInfo) return result;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return result;
        }