Example #1
0
        private void RelocateChannelData(SatChannel channel, ref int prevChannelOrderId,
                                     byte[] sortedChannels, ref int removed, ref int prevTransponderIndex, ref int counter,
                                     ref SatTransponder currentTransponder)
        {
            if (RemoveChannelIfDupe(channel, ref prevChannelOrderId, ref removed))
            return;

              UpdateChannelIndexInTransponderData(channel, ref prevTransponderIndex, counter, ref currentTransponder);

              Tools.MemCopy(
            channel.RawDataBuffer,
            channel.RawDataOffset,
            sortedChannels,
            counter*satConfig.dvbsChannelLength,
            satConfig.dvbsChannelLength);

              channel.RecordIndex = counter++;
              channel.baseOffset = this.dvbsBlockOffset + satConfig.ChannelListOffset + (int)channel.RecordIndex*satConfig.dvbsChannelLength;
        }
Example #2
0
        private void UpdateChannelIndexInTransponderData(SatChannel channel, ref int prevTransponderIndex, int counter,
                                                    ref SatTransponder transponder)
        {
            if (channel.Transponder.Id == prevTransponderIndex)
            return;

              if (transponder != null)
              {
            transponder.LastChannelIndex = counter - 1;
            transponder.ChannelCount = counter - transponder.FirstChannelIndex;
              }

              transponder = (SatTransponder)channel.Transponder;
              transponder.FirstChannelIndex = counter;
              prevTransponderIndex = channel.Transponder.Id;
        }
Example #3
0
        private void ReadTransponderData(ref int off)
        {
            dvbsSymbolRateFactor = 1;
              var dvbsSymbolRateMask = 0x7FFFF;
              var mapping = GetTransponderMapping();
              for (int i=0; i<satConfig.transponderCount; i++)
              {
            mapping.SetDataPtr(this.fileContent, off + i*satConfig.transponderLength);
            SatTransponder transponder = new SatTransponder(i, mapping, this.DataRoot, this.satConfig.satIndexFactor);
            if (transponder.Satellite == null)
              continue;

            if ((transponder.SymbolRate & 0x7FFF) == 11000)
              dvbsSymbolRateFactor = 2;
            else if (transponder.SymbolRate == 44000)
            {
              dvbsSymbolRateMask = 0xFFFF;
              dvbsSymbolRateFactor = 0.5m;
            }

            var sat = transponder.Satellite;
            this.DataRoot.AddTransponder(sat, transponder);
              }

              if (dvbsSymbolRateFactor != 1)
              {
            foreach (var transponder in this.DataRoot.Transponder.Values)
            {
              int symbolRate = transponder.SymbolRate & dvbsSymbolRateMask;
              transponder.SymbolRate = (int) (symbolRate*dvbsSymbolRateFactor);
            }
              }

              off += this.satConfig.transponderCount * this.satConfig.transponderLength;
        }