diff -ruNbw vdr-1.3.3/config.c vdr-1.3.3-patched/config.c --- vdr-1.3.3/config.c 2004-01-25 15:41:10.000000000 +0100 +++ vdr-1.3.3-patched/config.c 2004-02-01 21:07:11.000000000 +0100 @@ -255,6 +255,11 @@ LnbFrequLo = 9750; LnbFrequHi = 10600; DiSEqC = 0; + Gotox = 0; + Longitude = 0; + EastWest = true; + Latitude = 0; + SouthNorth = false; SetSystemTime = 0; TimeTransponder = 0; MarginStart = 2; @@ -442,6 +447,11 @@ else if (!strcasecmp(Name, "LnbFrequLo")) LnbFrequLo = atoi(Value); else if (!strcasecmp(Name, "LnbFrequHi")) LnbFrequHi = atoi(Value); else if (!strcasecmp(Name, "DiSEqC")) DiSEqC = atoi(Value); + else if (!strcasecmp(Name, "Gotox")) Gotox = atoi(Value); + else if (!strcasecmp(Name, "Longitude")) Longitude = atoi(Value); + else if (!strcasecmp(Name, "EastWest")) EastWest = atoi(Value); + else if (!strcasecmp(Name, "Latitude")) Latitude = atoi(Value); + else if (!strcasecmp(Name, "SouthNorth")) SouthNorth = atoi(Value); else if (!strcasecmp(Name, "SetSystemTime")) SetSystemTime = atoi(Value); else if (!strcasecmp(Name, "TimeTransponder")) TimeTransponder = atoi(Value); else if (!strcasecmp(Name, "MarginStart")) MarginStart = atoi(Value); @@ -494,6 +504,11 @@ Store("LnbFrequLo", LnbFrequLo); Store("LnbFrequHi", LnbFrequHi); Store("DiSEqC", DiSEqC); + Store("Gotox", Gotox); + Store("Longitude", Longitude); + Store("EastWest", EastWest); + Store("Latitude", Latitude); + Store("SouthNorth", SouthNorth); Store("SetSystemTime", SetSystemTime); Store("TimeTransponder", TimeTransponder); Store("MarginStart", MarginStart); diff -ruNbw vdr-1.3.3/config.h vdr-1.3.3-patched/config.h --- vdr-1.3.3/config.h 2004-01-24 11:03:55.000000000 +0100 +++ vdr-1.3.3-patched/config.h 2004-02-01 21:04:25.000000000 +0100 @@ -216,6 +216,11 @@ int LnbFrequLo; int LnbFrequHi; int DiSEqC; + int Gotox; + int Longitude; + int EastWest; + int Latitude; + int SouthNorth; int SetSystemTime; int TimeTransponder; int MarginStart, MarginStop; diff -ruNbw vdr-1.3.3/dvbdevice.c vdr-1.3.3-patched/dvbdevice.c --- vdr-1.3.3/dvbdevice.c 2004-01-25 14:50:21.000000000 +0100 +++ vdr-1.3.3-patched/dvbdevice.c 2004-02-01 21:30:16.000000000 +0100 @@ -8,6 +8,7 @@ */ #include "dvbdevice.h" +#include #include extern "C" { #ifdef boolean @@ -197,6 +198,42 @@ tone = SEC_TONE_ON; } int volt = (channel.Polarization() == 'v' || channel.Polarization() == 'V') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; + if (Setup.Gotox) { + int gotoXTable[10] = { 0x00, 0x02, 0x03, 0x05, 0x06, 0x08, 0x0A, 0x0B, 0x0D, 0x0E }; + int satlong = channel.Source() & ~0xC800; + if (channel.Source() & 0x0800) + satlong = satlong * (-1); + int signEW=1; + if (Setup.EastWest) + signEW=-1; + int signSN=1; + if (Setup.SouthNorth) + signSN=-1; + double azimuth=M_PI+atan(tan((satlong-Setup.Longitude*signEW)*M_PI/1800)/sin(Setup.Latitude*signSN*M_PI/1800)); + double x=acos(cos((satlong-Setup.Longitude*signEW)*M_PI/1800)*cos(Setup.Latitude*signSN*M_PI/1800)); + double elevation=atan((cos(x)-0.1513)/sin(x)); + double SatHourangle=180+atan((-cos(elevation)*sin(azimuth))/(sin(elevation)*cos(Setup.Latitude*M_PI/1800)-cos(elevation)*sin(Setup.Latitude*M_PI/1800)*cos(azimuth)))*180/M_PI; + struct dvb_diseqc_master_cmd cmd; + cmd.msg[0]=0xe0; + cmd.msg[1]=0x31; + cmd.msg[2]=0x6e; + int tmp=(int)(fabs(180-SatHourangle)*10); + tmp=(tmp/10)*0x10 + gotoXTable[ tmp % 10 ]; + cmd.msg[4]=(tmp%0x0100); + cmd.msg[3]=(tmp/0x0100); + if (SatHourangle < 180) + cmd.msg[3] |= 0xe0; + else + cmd.msg[3] |= 0xd0; + cmd.msg_len=5; + CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd)); + esyslog("Diseqc-command %x %x %x %x %x sent \n",cmd.msg[0],cmd.msg[1],cmd.msg[2],cmd.msg[3],cmd.msg[4]); + cmd.msg[0]=0xe1; + for (int i=1 ; i<=2 ; i++) { + usleep(15000); + CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd)); + } + } CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, volt)); CHECK(ioctl(fd_frontend, FE_SET_TONE, tone)); } diff -ruNbw vdr-1.3.3/i18n.c vdr-1.3.3-patched/i18n.c --- vdr-1.3.3/i18n.c 2004-01-25 15:41:02.000000000 +0100 +++ vdr-1.3.3-patched/i18n.c 2004-02-01 21:03:39.000000000 +0100 @@ -2625,6 +2625,168 @@ "Utilitzar DiSEqC", "¸áßÞÛì×ÞÒÐâì DiSEqC", }, + { "Use GotoX", + "GotoX benutzen", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }, + { "Longitude", + "Längengrad", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }, + { "East or West", + "Ost oder West", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }, + { "East", + "Ost", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }, + { "West", + "West", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }, + { "Latitude", + "Breitengrad", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }, + { "South or North", + "Süd oder Nord", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }, + { "South", + "Süd", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }, + { "North", + "Nord", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }, { "Setup.CICAM$CICAM DVB", "CICAM DVB", "CICAM DVB", diff -ruNbw vdr-1.3.3/menu.c vdr-1.3.3-patched/menu.c --- vdr-1.3.3/menu.c 2004-01-29 17:09:46.000000000 +0100 +++ vdr-1.3.3-patched/menu.c 2004-02-01 21:02:01.000000000 +0100 @@ -2178,9 +2178,16 @@ Add(new cMenuEditBoolItem(tr("Setup.LNB$Use DiSEqC"), &data.DiSEqC)); if (!data.DiSEqC) { + Add(new cMenuEditBoolItem(tr("Use GotoX"), &data.Gotox)); Add(new cMenuEditIntItem( tr("Setup.LNB$SLOF (MHz)"), &data.LnbSLOF)); Add(new cMenuEditIntItem( tr("Setup.LNB$Low LNB frequency (MHz)"), &data.LnbFrequLo)); Add(new cMenuEditIntItem( tr("Setup.LNB$High LNB frequency (MHz)"), &data.LnbFrequHi)); + if (data.Gotox) { + Add(new cMenuEditIntItem(tr("Longitude"), &data.Longitude,0,1800)); + Add(new cMenuEditBoolItem(tr("East or West"), &data.EastWest,tr("West"),tr("East"))); + Add(new cMenuEditIntItem(tr("Latitude"), &data.Latitude,0,900)); + Add(new cMenuEditBoolItem(tr("South or North"), &data.SouthNorth,tr("North"),tr("South"))); + } } SetCurrent(Get(current)); @@ -2190,9 +2197,10 @@ eOSState cMenuSetupLNB::ProcessKey(eKeys Key) { int oldDiSEqC = data.DiSEqC; + int oldGotox = data.Gotox; eOSState state = cMenuSetupBase::ProcessKey(Key); - if (Key != kNone && data.DiSEqC != oldDiSEqC) + if (Key != kNone && (data.DiSEqC != oldDiSEqC || data.Gotox != oldGotox)) Setup(); return state; }