public SatChannel(int slot, SignalSource presetList, DataMapping data, DataRoot dataRoot, FavoritesIndexMode sortedFavorites, IDictionary<int,string> providerNames) : base(data, sortedFavorites) { this.InitCommonData(slot, SignalSource.DvbS | presetList, data); if (!this.InUse) return; this.InitDvbData(data, providerNames); int transponderIndex = data.GetWord(_TransponderIndex); Transponder transponder = dataRoot.Transponder.TryGet(transponderIndex); if (transponder == null) { var list = dataRoot.GetChannelList(this.SignalSource|SignalSource.Tv); dataRoot.Warnings.AppendFormat("{0} channel record #{1} (Pr# {2} \"{3}\") contains invalid transponder index {4}\r\n", list.ShortCaption, slot, this.OldProgramNr, this.Name, transponderIndex); return; } Satellite sat = transponder.Satellite; this.Satellite = sat.Name; this.SatPosition = sat.OrbitalPosition; this.Polarity = transponder.Polarity; this.SymbolRate = transponder.SymbolRate; this.FreqInMhz = transponder.FrequencyInMhz; this.ChannelOrTransponder = ""; }
public void ApplyReferenceList(DataRoot refDataRoot) { foreach (var channelList in DataRoot.ChannelLists) { foreach (var channel in channelList.Channels) { channel.SetPosition(0, -1); } } StringBuilder log = new StringBuilder(); foreach (var refList in refDataRoot.ChannelLists) { var tvList = DataRoot.GetChannelList(refList.SignalSource); if (tvList == null || tvList.SignalSource != refList.SignalSource) { log.AppendFormat("Skipped reference list {0}\r\n", refList.ShortCaption); continue; } ApplyReferenceList(refDataRoot, refList, tvList); } }
private ChannelList GetChannelList(SignalSource signalSource) { var channelList = DataRoot.GetChannelList(signalSource); if (channelList == null) { channelList = new ChannelList(signalSource, CreateCaption(signalSource)) { VisibleColumnFieldNames = Columns }; DataRoot.AddChannelList(channelList); } return(channelList); }
private ChannelList GetInitiallyClearedChannelList(SignalSource signalSource) { var channelList = dataRoot.GetChannelList(signalSource); if (channelList == null || channelList.ReadOnly) { return(null); } if (!this.addChannels && !this.clearedLists.Contains(channelList)) { foreach (var channel in channelList.Channels) { channel.NewProgramNr = -1; } this.clearedLists.Add(channelList); } return(channelList); }