2014-01-19 19:08:17 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using ChanSort.Api;
|
2013-04-03 12:47:24 +02:00
|
|
|
|
|
2013-04-21 22:04:06 +02:00
|
|
|
|
namespace ChanSort.Loader.Samsung
|
2013-04-03 12:47:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
class SatChannel : ScmChannelBase
|
|
|
|
|
|
{
|
|
|
|
|
|
private const string _TransponderIndex = "offTransponderIndex";
|
|
|
|
|
|
|
2014-11-04 11:15:34 +01:00
|
|
|
|
public SatChannel(int slot, SignalSource presetList, DataMapping data, DataRoot dataRoot, FavoritesIndexMode sortedFavorites, IDictionary<int,string> providerNames) :
|
2013-06-23 23:22:09 +02:00
|
|
|
|
base(data, sortedFavorites)
|
2013-04-03 12:47:24 +02:00
|
|
|
|
{
|
2013-04-03 23:26:09 +02:00
|
|
|
|
this.InitCommonData(slot, SignalSource.DvbS | presetList, data);
|
2013-04-03 12:47:24 +02:00
|
|
|
|
if (!this.InUse)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
2014-01-19 19:08:17 +01:00
|
|
|
|
this.InitDvbData(data, providerNames);
|
2013-04-03 12:47:24 +02:00
|
|
|
|
|
|
|
|
|
|
int transponderIndex = data.GetWord(_TransponderIndex);
|
|
|
|
|
|
Transponder transponder = dataRoot.Transponder.TryGet(transponderIndex);
|
|
|
|
|
|
if (transponder == null)
|
|
|
|
|
|
{
|
2013-11-16 21:00:51 +01:00
|
|
|
|
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);
|
2013-04-03 12:47:24 +02:00
|
|
|
|
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 = "";
|
|
|
|
|
|
}
|
2013-06-23 23:22:09 +02:00
|
|
|
|
|
|
|
|
|
|
public override void UpdateRawData()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.NewProgramNr < 0) // "deleted" flag is currently unknown for sat channels
|
|
|
|
|
|
this.InUse = false;
|
|
|
|
|
|
base.UpdateRawData();
|
|
|
|
|
|
}
|
2013-04-03 12:47:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|