Exemplo n.º 1
0
 public void SetParameters()
 {
   if (!IsLocal)
     return;
   if (_card == null)
     return;
   ScanParameters settings = new ScanParameters();
   TvBusinessLayer layer = new TvBusinessLayer();
   settings.TimeOutTune = Int32.Parse(layer.GetSetting("timeoutTune", "2").Value);
   settings.TimeOutPAT = Int32.Parse(layer.GetSetting("timeoutPAT", "5").Value);
   settings.TimeOutCAT = Int32.Parse(layer.GetSetting("timeoutCAT", "5").Value);
   settings.TimeOutPMT = Int32.Parse(layer.GetSetting("timeoutPMT", "10").Value);
   settings.TimeOutSDT = Int32.Parse(layer.GetSetting("timeoutSDT", "20").Value);
   settings.TimeOutAnalog = Int32.Parse(layer.GetSetting("timeoutAnalog", "20").Value);
   settings.UseDefaultLnbFrequencies = (layer.GetSetting("lnbDefault", "true").Value == "true");
   settings.LnbLowFrequency = Int32.Parse(layer.GetSetting("LnbLowFrequency", "0").Value);
   settings.LnbHighFrequency = Int32.Parse(layer.GetSetting("LnbHighFrequency", "0").Value);
   settings.LnbSwitchFrequency = Int32.Parse(layer.GetSetting("LnbSwitchFrequency", "0").Value);
   settings.MinimumFiles = Int32.Parse(layer.GetSetting("timeshiftMinFiles", "6").Value);
   settings.MaximumFiles = Int32.Parse(layer.GetSetting("timeshiftMaxFiles", "20").Value);
   settings.MaximumFileSize = UInt32.Parse(layer.GetSetting("timeshiftMaxFileSize", "256").Value);
   settings.MaximumFileSize *= 1000;
   settings.MaximumFileSize *= 1000;
   _card.Parameters = settings;
 }
Exemplo n.º 2
0
    /// <summary>
    /// scans current transponder for more channels.
    /// </summary>
    /// <param name="cardId">id of the card.</param>
    /// <param name="cardId">IChannel containing the transponder tuning details.</param>
    /// <param name="channel">The channel</param>
    /// <returns>list of channels found</returns>
    public IChannel[] Scan(int cardId, IChannel channel)
    {
      if (ValidateTvControllerParams(cardId))
        return null;

      ScanParameters settings = new ScanParameters();
      TvBusinessLayer layer = new TvBusinessLayer();
      settings.TimeOutTune = Int32.Parse(layer.GetSetting("timeoutTune", "2").Value);
      settings.TimeOutPAT = Int32.Parse(layer.GetSetting("timeoutPAT", "5").Value);
      settings.TimeOutCAT = Int32.Parse(layer.GetSetting("timeoutCAT", "5").Value);
      settings.TimeOutPMT = Int32.Parse(layer.GetSetting("timeoutPMT", "10").Value);
      settings.TimeOutSDT = Int32.Parse(layer.GetSetting("timeoutSDT", "20").Value);
      settings.TimeOutAnalog = Int32.Parse(layer.GetSetting("timeoutAnalog", "20").Value);
      return _cards[cardId].Scanner.Scan(channel, settings);
    }
Exemplo n.º 3
0
    public IChannel[] ScanNIT(int cardId, IChannel channel)
    {
      if (ValidateTvControllerParams(cardId))
        return null;

      ScanParameters settings = new ScanParameters();
      TvBusinessLayer layer = new TvBusinessLayer();
      settings.TimeOutTune = Int32.Parse(layer.GetSetting("timeoutTune", "2").Value);
      _cards[cardId].SetParameters();
      return _cards[cardId].Scanner.ScanNIT(channel, settings);
    }
Exemplo n.º 4
0
    /// <summary>
    /// scans current transponder for more channels.
    /// </summary>
    /// <param name="channel">IChannel containing the transponder tuning details.</param>
    /// <param name="settings">Scan settings</param>
    /// <returns>list of channels found</returns>
    public IChannel[] Scan(IChannel channel, ScanParameters settings)
    {
      try
      {
        if (_cardHandler.DataBaseCard.Enabled == false)
          return new List<IChannel>().ToArray();

        try
        {
          RemoteControl.HostName = _cardHandler.DataBaseCard.ReferencedServer().HostName;
          if (!RemoteControl.Instance.CardPresent(_cardHandler.DataBaseCard.IdCard))
            return new List<IChannel>().ToArray();
          if (_cardHandler.IsLocal == false)
          {
            return RemoteControl.Instance.Scan(_cardHandler.DataBaseCard.IdCard, channel);
          }
        }
        catch (Exception)
        {
          Log.Error("card: unable to connect to slave controller at:{0}",
                    _cardHandler.DataBaseCard.ReferencedServer().HostName);
          return null;
        }
        ITVScanning scanner = _cardHandler.Card.ScanningInterface;
        if (scanner == null)
          return null;
        scanner.Reset();
        List<IChannel> channelsFound = scanner.Scan(channel, settings);
        if (channelsFound == null)
          return null;
        return channelsFound.ToArray();
      }
      catch (TvExceptionNoSignal)
      {
        //ignore
        return null;
      }
      catch (Exception ex)
      {
        Log.Write(ex);
        return null;
      }
    }