GOTOX patch for 1.7.5

Message ID 200904281356.50199.ajurik@quick.cz
State New
Headers

Commit Message

Ales Jurik April 28, 2009, 11:56 a.m. UTC
  On Monday 27 of April 2009, Goga777 wrote:
> ???????????, Ales
>
> > On Monday 20 of April 2009, ThE-GuRuZ wrote:
> > > Hi to all, does anybody know if there is a patch for gotox like
> > > vdr-1.7.0?
> > >
> > >
> > > _______________________________________________
> > > vdr mailing list
> > > vdr@linuxtv.org
> > > http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
> >
> > Patch gotox for vdr-1.7.0 is also working for vdr-1.7.5. Did you ever try
> > it?
>
> yes, this patch is working well with gotox protocol
>
> could you implement the feature - during of dish moving is it possible to
> write on screen - "please waiting for. The dish is moving to xxx position"
>
> Goga
>

See attached new version - it is possible to apply this patch to vanilla vdr 
from vdr-1.7.0 to vdr-1.7.6 without rejects.

Once more thanks to Seppo I. for his first version of this patch.

Regards,

Ales
  

Comments

Bikalexander Feb. 3, 2010, 10:33 p.m. UTC | #1
Is there perhaps a patch for 1.7.12?
Thanks
  
VDRU VDRU Feb. 3, 2010, 10:37 p.m. UTC | #2
On Wed, Feb 3, 2010 at 2:33 PM, Bikalexander <bikalexander@gmail.com> wrote:
> Is there perhaps a patch for 1.7.12?

Did you at least try the current patch first?  Please don't set a big
font size when asking questions.  Or when even posting to this mailing
list.
  
Darren Salt Feb. 3, 2010, 10:45 p.m. UTC | #3
I demand that VDR User may or may not have written...

> On Wed, Feb 3, 2010 at 2:33 PM, Bikalexander <bikalexander@gmail.com>
wrote:
>> Is there perhaps a patch for 1.7.12?

> Did you at least try the current patch first?  Please don't set a big font
> size when asking questions.  Or when even posting to this mailing list.

Actually, *don't* duplicate the text in HTML *at* *all*. It's a pointless
waste of space and you get complained at (or flamed), or somebody who might
otherwise help may decide to ignore you for being a moron.

(Fortunately, I get to see the plain text version, but the presence of an
HTML copy is quite obvious.)
  
Bikalexander Feb. 3, 2010, 11:15 p.m. UTC | #4
Sorry, my mistake. I got the wrong version of the patch.

2010/2/3 VDR User <user.vdr@gmail.com>
>
> On Wed, Feb 3, 2010 at 2:33 PM, Bikalexander <bikalexander@gmail.com> wrote:
> > Is there perhaps a patch for 1.7.12?
>
> Did you at least try the current patch first?  Please don't set a big
> font size when asking questions.  Or when even posting to this mailing
> list.
>
> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
  
Bikalexander Feb. 3, 2010, 11:27 p.m. UTC | #5
Even with last patch does not do it:

#############################################################################################
g++ -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses -c -DREMOTE_KBD
-DLIRC_DEVICE=\"/dev/lircd\" -DRCU_DEVICE=\"/dev/ttyS1\" -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-DVIDEODIR=\"/video\" -DCONFDIR=\"/video\"
-DPLUGINDIR=\"./PLUGINS/lib\" -DLOCDIR=\"./locale\"
-I/usr/include/freetype2 diseqc.c
g++ -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses -c -DREMOTE_KBD
-DLIRC_DEVICE=\"/dev/lircd\" -DRCU_DEVICE=\"/dev/ttyS1\" -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-DVIDEODIR=\"/video\" -DCONFDIR=\"/video\"
-DPLUGINDIR=\"./PLUGINS/lib\" -DLOCDIR=\"./locale\"
-I/usr/include/freetype2 dvbdevice.c
dvbdevice.c: In function ???void HandleGotox(int, int)??™:
dvbdevice.c:227: error: ???Skins??™ was not declared in this scope
dvbdevice.c:227: error: ???mtWarning??™ was not declared in this scope
make: *** [dvbdevice.o] Fehler 1
make: *** Warte auf noch nicht beendete Prozesse...
#####################################################
  
Ales Jurik Feb. 4, 2010, 8:49 a.m. UTC | #6
On Thursday 04 of February 2010, Bikalexander wrote:
> Even with last patch does not do it:
> 
> ###########################################################################
> ################## g++ -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
>  -c -DREMOTE_KBD -DLIRC_DEVICE=\"/dev/lircd\" -DRCU_DEVICE=\"/dev/ttyS1\"
>  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
>  -D_LARGEFILE64_SOURCE
> -DVIDEODIR=\"/video\" -DCONFDIR=\"/video\"
> -DPLUGINDIR=\"./PLUGINS/lib\" -DLOCDIR=\"./locale\"
> -I/usr/include/freetype2 diseqc.c
> g++ -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses -c -DREMOTE_KBD
> -DLIRC_DEVICE=\"/dev/lircd\" -DRCU_DEVICE=\"/dev/ttyS1\" -D_GNU_SOURCE
> -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -DVIDEODIR=\"/video\" -DCONFDIR=\"/video\"
> -DPLUGINDIR=\"./PLUGINS/lib\" -DLOCDIR=\"./locale\"
> -I/usr/include/freetype2 dvbdevice.c
> dvbdevice.c: In function ???void HandleGotox(int, int)??™:
> dvbdevice.c:227: error: ???Skins??™ was not declared in this scope
> dvbdevice.c:227: error: ???mtWarning??™ was not declared in this scope
> make: *** [dvbdevice.o] Fehler 1
> make: *** Warte auf noch nicht beendete Prozesse...
> #####################################################
> 

Which exactly version of patch did you use? What was the output of patching? 
Was there any rejects? Did you try to patch vanilla version of vdr? Without 
these basic information people could only guess what happened in your vdr.

For me now it works without problem (latest patch is in 
http://www.linuxtv.org/pipermail/vdr/2010-January/022017.html).

Ales
  
Bikalexander Feb. 5, 2010, 1:17 a.m. UTC | #7
Thanks for the link, now I've finally got the correct version:).

I am using 2 DVB cards, it can be adjusted in some way that certain
device is being addressed?

2010/2/4 Ales Jurik <ajurik@quick.cz>:
> On Thursday 04 of February 2010, Bikalexander wrote:
>> Even with last patch does not do it:
>>
> Which exactly version of patch did you use? What was the output of patching?
> Was there any rejects? Did you try to patch vanilla version of vdr? Without
> these basic information people could only guess what happened in your vdr.
>
> For me now it works without problem (latest patch is in
> http://www.linuxtv.org/pipermail/vdr/2010-January/022017.html).
>
> Ales
>
  
Ales Jurik Feb. 5, 2010, 8:45 a.m. UTC | #8
On Friday 05 of February 2010, Bikalexander wrote:
> Thanks for the link, now I've finally got the correct version:).
> 
> I am using 2 DVB cards, it can be adjusted in some way that certain
> device is being addressed?
> 

AFAIK not. But you are welcomed to improve this patch.

BR,

Ales
  
Newsy Paper Feb. 5, 2010, 8:47 a.m. UTC | #9
Why not using rotor plugin?

It's working ok even with 1.7.11, but there's a bug with my s2-3200. I don't know if it's a HW or SW bug, but if I am on a High Band transponder (22khz is active) the rotor doesn't move, so I have to switch to a low band transponder first. Workround would be to disable 22khz in the plugin automatically then rotate und reactive it again (if it has been active before). But I don't know how to implement that

regards

Newspaperman

--- Bikalexander <bikalexander@gmail.com> schrieb am Fr, 5.2.2010:

> Von: Bikalexander <bikalexander@gmail.com>
> Betreff: [vdr] Fwd:  GOTOX patch for 1.7.5
> An: vdr@linuxtv.org
> Datum: Freitag, 5. Februar 2010, 2:17
> Thanks for the link, now I've finally
> got the correct version:).
> 
> I am using 2 DVB cards, it can be adjusted in some way that
> certain
> device is being addressed?
> 
> 2010/2/4 Ales Jurik <ajurik@quick.cz>:
> > On Thursday 04 of February 2010, Bikalexander wrote:
> >> Even with last patch does not do it:
> >>
> > Which exactly version of patch did you use? What was
> the output of patching?
> > Was there any rejects? Did you try to patch vanilla
> version of vdr? Without
> > these basic information people could only guess what
> happened in your vdr.
> >
> > For me now it works without problem (latest patch is
> in
> > http://www.linuxtv.org/pipermail/vdr/2010-January/022017.html).
> >
> > Ales
> >
> 
> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
>
  
Seppo Ingalsuo Feb. 14, 2010, 11:51 a.m. UTC | #10
On Fri, 2010-02-05 at 08:47 +0000, Newsy Paper wrote:
> Why not using rotor plugin?
> 
> It's working ok even with 1.7.11, but there's a bug with my s2-3200. I
>  don't know if it's a HW or SW bug, but if I am on a High Band
>  transponder (22khz is active) the rotor doesn't move, so I have to
>  switch to a low band transponder first. Workround would be to disable
>  22khz in the plugin automatically then rotate und reactive it again
>  (if it has been active before). But I don't know how to implement that

This is why originally made the patch (thanks for rotor plugin author
for lot's of useful code). I got fed up to unreliable operation and
messing up of channels.conf with similar frequencies from other
positions. As an example I don't need gotox command repeat any more.
Even with gotox repeat I got large error probability.

For a vdr plugin I could not find a way to merge the operations properly
to other diseqc operations while ensuring compliance with diseqc spec.

I'd separate rotor plugin to a generic channel scan plugin, that it is
doing nicely.

Retrieve (and store position) system of elder motors should be in the
core vdr dvb-s support as well IMHO. The same timing hazard is
potentially there too unless retrieve position is handwritten to
diseqc.conf sequences.

BR,
Seppo


> 
> regards
> 
> Newspaperman
> 
> --- Bikalexander <bikalexander@gmail.com> schrieb am Fr, 5.2.2010:
> 
> > Von: Bikalexander <bikalexander@gmail.com>
> > Betreff: [vdr] Fwd:  GOTOX patch for 1.7.5
> > An: vdr@linuxtv.org
> > Datum: Freitag, 5. Februar 2010, 2:17
> > Thanks for the link, now I've finally
> > got the correct version:).
> > 
> > I am using 2 DVB cards, it can be adjusted in some way that
> > certain
> > device is being addressed?
> > 
> > 2010/2/4 Ales Jurik <ajurik@quick.cz>:
> > > On Thursday 04 of February 2010, Bikalexander wrote:
> > >> Even with last patch does not do it:
> > >>
> > > Which exactly version of patch did you use? What was
> > the output of patching?
> > > Was there any rejects? Did you try to patch vanilla
> > version of vdr? Without
> > > these basic information people could only guess what
> > happened in your vdr.
> > >
> > > For me now it works without problem (latest patch is
> > in
> > > http://www.linuxtv.org/pipermail/vdr/2010-January/022017.html).
> > >
> > > Ales
> > >
> > 
> > _______________________________________________
> > vdr mailing list
> > vdr@linuxtv.org
> > http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
> > 
> 
> __________________________________________________
> Do You Yahoo!?
> Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
> http://mail.yahoo.com 
> 
> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
  
Luca Olivetti Feb. 14, 2010, 12:17 p.m. UTC | #11
En/na Seppo Ingalsuo ha escrit:

> This is why originally made the patch (thanks for rotor plugin author
> for lot's of useful code). I got fed up to unreliable operation and
> messing up of channels.conf with similar frequencies from other
> positions.

Yes, unfortunately a plugin has currently no way to indicate that tuning 
  is currently impossible because the dish is moving.
In the actuator plugin I disable the auto-update of channels while the 
dish is moving and restore the previous setting afterwards, but that 
isn't 100% reliable and doesn't help with the detection of dvb subtitles 
(which fails when the dish moves).

Bye
  

Patch

diff -ruNp vdr-1.7.0.orig/config.c vdr-1.7.0/config.c
--- vdr-1.7.0.orig/config.c	2008-02-17 14:39:00.000000000 +0100
+++ vdr-1.7.0/config.c	2008-09-02 11:08:39.633819400 +0200
@@ -229,6 +229,11 @@  cSetup::cSetup(void)
   LnbFrequLo =  9750;
   LnbFrequHi = 10600;
   DiSEqC = 0;
+  UseGotox = 0;
+  GotoxSpeed = 100;
+  GotoxRepeat = 0;
+  GotoxSN = 0; GotoxLat = 613; GotoxEW = 1; GotoxLong = 236; // Somewhere at Tampere, Finland :^)
+  GotoxPrevSource = 0;
   SetSystemTime = 0;
   TimeSource = 0;
   TimeTransponder = 0;
@@ -402,6 +407,14 @@  bool cSetup::Parse(const char *Name, con
   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, "UseGotox"))            UseGotox           = atoi(Value);
+  else if (!strcasecmp(Name, "GotoxSpeed"))          GotoxSpeed         = atoi(Value);
+  else if (!strcasecmp(Name, "GotoxRepeat"))         GotoxRepeat        = atoi(Value);
+  else if (!strcasecmp(Name, "GotoxSN"))             GotoxSN            = atoi(Value);
+  else if (!strcasecmp(Name, "GotoxLat"))            GotoxLat           = atoi(Value);
+  else if (!strcasecmp(Name, "GotoxEW"))             GotoxEW            = atoi(Value);
+  else if (!strcasecmp(Name, "GotoxLong"))           GotoxLong          = atoi(Value);
+  else if (!strcasecmp(Name, "GotoxPrevSource"))     GotoxPrevSource    = atoi(Value);
   else if (!strcasecmp(Name, "SetSystemTime"))       SetSystemTime      = atoi(Value);
   else if (!strcasecmp(Name, "TimeSource"))          TimeSource         = cSource::FromString(Value);
   else if (!strcasecmp(Name, "TimeTransponder"))     TimeTransponder    = atoi(Value);
@@ -485,6 +498,14 @@  bool cSetup::Save(void)
   Store("LnbFrequLo",         LnbFrequLo);
   Store("LnbFrequHi",         LnbFrequHi);
   Store("DiSEqC",             DiSEqC);
+  Store("UseGotox",           UseGotox);
+  Store("GotoxSpeed",         GotoxSpeed);
+  Store("GotoxRepeat",        GotoxRepeat);
+  Store("GotoxSN",            GotoxSN);
+  Store("GotoxLat",           GotoxLat);
+  Store("GotoxEW",            GotoxEW);
+  Store("GotoxLong",          GotoxLong);
+  Store("GotoxPrevSource",    GotoxPrevSource);
   Store("SetSystemTime",      SetSystemTime);
   Store("TimeSource",         cSource::ToString(TimeSource));
   Store("TimeTransponder",    TimeTransponder);
diff -ruNp vdr-1.7.0.orig/config.h vdr-1.7.0/config.h
--- vdr-1.7.0.orig/config.h	2008-04-12 15:02:10.000000000 +0200
+++ vdr-1.7.0/config.h	2008-09-02 11:08:39.633819400 +0200
@@ -215,6 +215,14 @@  public:
   int LnbFrequLo;
   int LnbFrequHi;
   int DiSEqC;
+  int GotoxRepeat;
+  int GotoxSN;
+  int GotoxEW;
+  int GotoxSpeed;
+  int GotoxLat;
+  int GotoxLong;
+  int UseGotox;
+  int GotoxPrevSource;
   int SetSystemTime;
   int TimeSource;
   int TimeTransponder;
diff -ruNp vdr-1.7.0.orig/diseqc.c vdr-1.7.0/diseqc.c
--- vdr-1.7.0.orig/diseqc.c	2008-02-10 15:09:27.000000000 +0100
+++ vdr-1.7.0/diseqc.c	2008-09-02 11:08:39.633819400 +0200
@@ -114,6 +114,7 @@  cDiseqc::eDiseqcActions cDiseqc::Execute
           case 'V': return daVoltage18;
           case 'A': return daMiniA;
           case 'B': return daMiniB;
+	  case 'G': return daGotoX;
           case 'W': *CurrentAction = Wait(*CurrentAction); break;
           case '[': *CurrentAction = Codes(*CurrentAction); return *CurrentAction ? daCodes : daNone;
           default: return daNone;
diff -ruNp vdr-1.7.0.orig/diseqc.h vdr-1.7.0/diseqc.h
--- vdr-1.7.0.orig/diseqc.h	2002-12-07 14:54:02.000000000 +0100
+++ vdr-1.7.0/diseqc.h	2008-09-02 11:08:39.637817080 +0200
@@ -22,6 +22,7 @@  public:
     daVoltage18,
     daMiniA,
     daMiniB,
+    daGotoX,
     daCodes,
     };
   enum { MaxDiseqcCodes = 6 };
diff -ruNp vdr-1.7.0.orig/dvbdevice.c vdr-1.7.0/dvbdevice.c
--- vdr-1.7.0.orig/dvbdevice.c	2008-04-13 16:15:35.000000000 +0200
+++ vdr-1.7.0/dvbdevice.c	2008-09-02 11:14:19.000000000 +0200
@@ -17,6 +17,7 @@ 
 #include <linux/dvb/video.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
+#include <math.h>
 #include "channels.h"
 #include "diseqc.h"
 #include "dvbci.h"
@@ -190,6 +191,95 @@  static unsigned int FrequencyToHz(unsign
   return f;
 }
 
+void HandleGotox(int fd_frontend, int new_source)
+{
+  
+  int gotoXTable[10] = { 0x00, 0x02, 0x03, 0x05, 0x06, 0x08, 0x0A, 0x0B, 0x0D, 0x0E };
+  int satlong;
+  int satprev;
+  float waitseconds = 0;
+
+  if (Setup.UseGotox == 0)
+    return;
+
+  // Check if zapped into new source position?
+  if (new_source != Setup.GotoxPrevSource) {
+    satlong = (new_source & ~0xC800);
+    satprev = (Setup.GotoxPrevSource & ~0xC800);
+    if ((new_source & 0xC000) != 0x8000) 
+      return; // Fail
+    if (new_source & 0x0800)
+      satlong = satlong * (-1);
+    if (Setup.GotoxPrevSource & 0x0800)
+      satprev = satprev * (-1);
+    if (Setup.GotoxSpeed > 0) {
+      waitseconds = fabs(satlong-satprev)/(float)(Setup.GotoxSpeed);
+      if (waitseconds < 0.0) waitseconds = 0.0; // Should not happen but ...
+      if (waitseconds > 60.0) waitseconds = 60.0; // Limit wait time to 60s
+    }
+    int Long=Setup.GotoxEW ? -Setup.GotoxLong : Setup.GotoxLong;
+    int Lat=Setup.GotoxSN ? -Setup.GotoxLat : Setup.GotoxLat;
+    double azimuth=M_PI+atan(tan((satlong-Long)*M_PI/1800)/sin(Lat*M_PI/1800));
+    double x=acos(cos((satlong-Long)*M_PI/1800)*cos(Lat*M_PI/1800));
+    double elevation=atan((cos(x)-0.1513)/sin(x));
+    double SatHourangle=180+atan((-cos(elevation)*sin(azimuth))/(sin(elevation)*cos(Lat*M_PI/1800)
+			   -cos(elevation)*sin(Lat*M_PI/1800)*cos(azimuth)))*180/M_PI;
+    int tmp=(int)(fabs(180-SatHourangle)*10);
+    tmp=(tmp/10)*0x10 + gotoXTable[ tmp % 10 ];
+    int p2=(tmp%0x0100);
+    int p1=(tmp/0x0100);
+    if (SatHourangle < 180)
+      p1 |= 0xe0;
+    else
+      p1 |= 0xd0;
+
+    dsyslog("DiSEqC GotoX %d (%d) -> %d (%d), wait time %4.1fs",
+	    satprev, Setup.GotoxPrevSource, satlong, new_source, waitseconds);
+
+#if 1
+    // Set high LNB voltage and tone off, then wait > 15ms
+    CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18));
+    CHECK(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF));
+    usleep(20000);
+    
+    // Send 1st GotoX command, then wait > 15ms
+    uchar gotox_bytes[5] = { 0xe0, 0x31, 0x6e, p1, p2};
+    struct dvb_diseqc_master_cmd gotox_cmd;
+    memcpy(gotox_cmd.msg, gotox_bytes, 5);
+    gotox_cmd.msg_len = 5;
+    CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &gotox_cmd));
+    usleep(20000);
+
+    // Send repeated GotoX command, then wait > 15ms
+    if (Setup.GotoxRepeat) {
+      gotox_bytes[0] = 0xe1;
+      memcpy(gotox_cmd.msg, gotox_bytes, 5);
+      CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &gotox_cmd));
+      usleep(20000);
+    }
+    
+ 	 {
+ 	   char mess_move[60];
+        snprintf(mess_move,sizeof(mess_move),"Moving dish to %d.%d%s - %ds", \
+       	(new_source & 0x0800)?-satlong/10:satlong/10, \
+       	(new_source & 0x0800)?-satlong%10:satlong%10, \
+       	(new_source & 0x0800)?"E":"W", (int)waitseconds);
+      // Wait for dish movement and display message approx. for that time
+      Skins.QueueMessage(mtWarning, mess_move, int(1 + waitseconds - Setup.ChannelInfoTime), 0);
+      while (waitseconds > 0.0) {
+        usleep(100000); // 100ms
+        waitseconds = waitseconds - 100e-3;
+      }
+    }
+
+#endif
+
+    Setup.GotoxPrevSource = new_source;
+    dsyslog("DiSEqC GotoX done.");
+  }
+}
+
+
 bool cDvbTuner::SetFrontend(void)
 {
   dvbfe_params Frontend;
@@ -211,6 +293,7 @@  bool cDvbTuner::SetFrontend(void)
                     case cDiseqc::daVoltage18: CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18)); break;
                     case cDiseqc::daMiniA:     CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_A)); break;
                     case cDiseqc::daMiniB:     CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_B)); break;
+                    case cDiseqc::daGotoX:     HandleGotox(fd_frontend, channel.Source()); break;
                     case cDiseqc::daCodes: {
                          int n = 0;
                          uchar *codes = diseqc->Codes(n);
@@ -234,6 +317,10 @@  bool cDvbTuner::SetFrontend(void)
            }
         }
      else {
+         // Send GotoX DiSEqC command if activated in vdr setup. Then wait with high LNB voltage
+         // estimated time for dish movement
+        HandleGotox(fd_frontend, channel.Source()); 
+
         int tone = SEC_TONE_OFF;
         if (frequency < (unsigned int)Setup.LnbSLOF) {
            frequency -= Setup.LnbFrequLo;
diff -ruNp vdr-1.7.0.orig/menu.c vdr-1.7.0/menu.c
--- vdr-1.7.0.orig/menu.c	2008-04-12 13:37:17.000000000 +0200
+++ vdr-1.7.0/menu.c	2008-09-02 11:08:39.641804400 +0200
@@ -2542,8 +2542,14 @@  void cMenuSetupLNB::Setup(void)
      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));
-     }
-
+  }
+  Add(new cMenuEditBoolItem(tr("Setup.LNB$Use GotoX dish positioning"), &data.UseGotox));
+  if (data.UseGotox) {
+     Add(new cMenuEditBoolItem(tr("Setup.LNB$Repeat GotoX commands"), &data.GotoxRepeat));
+     Add(new cMenuEditIntpItem(tr("Setup.LNB$Latitude"), &data.GotoxLat,0,900,&data.GotoxSN,tr("North"),tr("South")));
+     Add(new cMenuEditIntpItem(tr("Setup.LNB$Longitude"), &data.GotoxLong,0,1800,&data.GotoxEW,tr("West"),tr("East")));
+     Add(new cMenuEditIntdItem(tr("Setup.LNB$Rotor speed (deg/s)"), &data.GotoxSpeed, 1, 100));
+  }
   SetCurrent(Get(current));
   Display();
 }
@@ -2551,10 +2557,15 @@  void cMenuSetupLNB::Setup(void)
 eOSState cMenuSetupLNB::ProcessKey(eKeys Key)
 {
   int oldDiSEqC = data.DiSEqC;
+  int oldUseGotox = data.UseGotox;
   eOSState state = cMenuSetupBase::ProcessKey(Key);
 
   if (Key != kNone && data.DiSEqC != oldDiSEqC)
      Setup();
+
+  if (Key != kNone && data.UseGotox != oldUseGotox)
+     Setup();
+
   return state;
 }
 
diff -ruNp vdr-1.7.0.orig/menuitems.c vdr-1.7.0/menuitems.c
--- vdr-1.7.0.orig/menuitems.c	2008-04-12 14:05:25.000000000 +0200
+++ vdr-1.7.0/menuitems.c	2008-09-02 11:08:39.679752760 +0200
@@ -1039,3 +1039,121 @@  void cMenuSetupPage::SetupStore(const ch
   if (plugin)
      plugin->SetupStore(Name, Value);
 }
+
+// cMenuEditIntpItem & cMenuEditIntdItem for GotoX function
+
+void cMenuEditIntpItem::Set(void)
+{
+  char buf[16];
+  snprintf(buf, sizeof(buf), "%d.%d %s", *value/10, *value % 10, *value2 ? trueString : falseString);
+  SetValue(buf);
+}
+
+void cMenuEditIntdItem::Set(void)
+{
+  char buf[16];
+  snprintf(buf, sizeof(buf), "%d.%d", *value/10, *value % 10);
+  SetValue(buf);
+}
+
+
+cMenuEditIntpItem::cMenuEditIntpItem(const char *Name, int *Value, int Min, int Max,int *Value2, const char *FalseString,const char *TrueString):cMenuEditIntItem(Name, Value, Min, Max)
+{
+  value = Value;
+  value2= Value2;
+  trueString = TrueString;
+  falseString = FalseString;
+  min = Min;
+  max = Max;
+  Set();
+}
+
+cMenuEditIntdItem::cMenuEditIntdItem(const char *Name, int *Value, int Min, int Max):cMenuEditIntItem(Name, Value, Min, Max)
+{
+  value = Value;
+  min = Min;
+  max = Max;
+  Set();
+}
+
+eOSState cMenuEditIntpItem::ProcessKey(eKeys Key)
+{
+  eOSState state = cMenuEditItem::ProcessKey(Key);
+  if (state == osUnknown)
+  {
+    int newValue = *value;
+    int newValue2= *value2;
+    Key = NORMALKEY(Key);
+    switch (Key) {
+      case kNone  : break;
+      case k0...k9:
+                    if (fresh)
+                    {
+                      *value = 0;
+                      fresh = false;
+                    }
+                    newValue = *value * 10 + (Key - k0);
+                    break;
+      case kLeft  :
+                    newValue2 = 0;
+                    fresh = true;
+                    break;
+      case kRight :
+                    newValue2 = 1;
+                    fresh = true;
+                    break;
+      default     :
+                    if (*value < min) { *value = min; Set(); }
+                    if (*value > max) { *value = max; Set(); }
+                    return state;
+                 }
+    if ((!fresh || min <= newValue) && newValue <= max)
+    {
+      *value = newValue;
+      *value2 = newValue2;
+      Set();
+    }
+ state = osContinue;
+  }
+  return state;
+}
+
+eOSState cMenuEditIntdItem::ProcessKey(eKeys Key)
+{
+  eOSState state = cMenuEditItem::ProcessKey(Key);
+  if (state == osUnknown)
+  {
+    int newValue = *value;
+    Key = NORMALKEY(Key);
+    switch (Key) {
+      case kNone  : break;
+      case k0...k9:
+                    if (fresh)
+                    {
+                      *value = 0;
+                      fresh = false;
+                    }
+                    newValue = *value * 10 + (Key - k0);
+                    break;
+      case kLeft  :
+	            newValue = *value - 1;
+                    fresh = true;
+                    break;
+      case kRight :
+                    newValue = *value + 1;
+                    fresh = true;
+                    break;
+      default     :
+                    if (*value < min) { *value = min; Set(); }
+                    if (*value > max) { *value = max; Set(); }
+                    return state;
+                 }
+    if ((!fresh || min <= newValue) && newValue <= max)
+    {
+      *value = newValue;
+      Set();
+    }
+    state = osContinue;
+  }
+  return state;
+}
diff -ruNp vdr-1.7.0.orig/menuitems.h vdr-1.7.0/menuitems.h
--- vdr-1.7.0.orig/menuitems.h	2008-04-12 14:03:59.000000000 +0200
+++ vdr-1.7.0/menuitems.h	2008-09-02 11:08:39.679752760 +0200
@@ -187,4 +187,22 @@  public:
   void SetPlugin(cPlugin *Plugin);
   };
 
+class cMenuEditIntpItem : public cMenuEditIntItem {
+protected:
+  virtual void Set(void);
+  const char *falseString, *trueString;
+  int *value2;
+public:
+  cMenuEditIntpItem(const char *Name, int *Value, int Min = 0, int Max = INT_MAX, int *Value2=0, const char *FalseString = "", const char *TrueSting = NULL);
+  virtual eOSState ProcessKey(eKeys Key);
+};
+
+class cMenuEditIntdItem : public cMenuEditIntItem {
+protected:
+  virtual void Set(void);
+public:
+  cMenuEditIntdItem(const char *Name, int *Value, int Min = 0, int Max = INT_MAX);
+  virtual eOSState ProcessKey(eKeys Key);
+};
+
 #endif //__MENUITEMS_H