package org.bucksch.zeipis.recorder;
import org.bucksch.zeipis.all.*;
import java.sql.*;

public class DVBSTransponder extends DVBTransponder
{
  public DVBSTransponder() { super(); myDVBSubtype = "DVB-S"; }
  protected void readFromDatabaseResultSet(ResultSet rs)
    throws Misconfiguration, SQLException
  {
    super.readFromDatabaseResultSet(rs);
    String pol = rs.getString("polarity").toUpperCase();
    if (pol == null || pol.length() == 0) // can happen at all?
      throw new Misconfiguration("No polarity");
    polarity = pol.charAt(0);
    if (polarity != 'H' && polarity != 'V' && polarity != 'L' && polarity != 'R')
      throw new Misconfiguration("Unknown polarity " + polarity);
  }
  public boolean sameTransponder(DVBTransponder other, boolean strict)
  {
    if ( ! super.sameTransponder(other, strict))
      return false;
    DVBSTransponder o = (DVBSTransponder) other;
    return polarity == o.polarity &&
           diseqc == o.diseqc;
  }

  // physical tuning for sat only
  public char polarity;
  public int diseqc = -1; // not implemented yet
}
