Re: Sattrack 3.1.6

From: Riley Williams (wdszlgb.iuyid@edu.hu)
Date: Wed Nov 07 2001 - 02:56:45 EET

  • Next message: Hamish Moffatt: "Re: Sattrack 3.1.6"

    Hi Hamish.

    > You also need this Y2K fix:

    > --- sattrack-3.1.6.orig/src/sattrack/sattime.c
    > +++ sattrack-3.1.6/src/sattrack/sattime.c
    > @@ -269,7 +269,7 @@
    > if (gdnY < 50) /* allow 4 or 2 digit year specifications */
    > gdnY += 2000;
    > else
    > - if (gdnY < 100)
    > + if (gdnY < 200)
    > gdnY += 1900;
    >
    > result = (long) ((((gdnY-1901)*1461) >> 2) + monthDays[gdnM-1] + gdnD+365);

    Are you sure that's the entire Y2K fix?

    I came across an RPM for SatTrack 3.1.7 back in December 1999, and the
    first thing I did was to diff it against the 3.1.6 source tarball to see
    what had changed. Here's what I found:

     1. A bugfix that makes the code match the manual. According to the
        manual, SatTrack draws 2.25 orbits for high ground track sats,
        but the code actually drew 1.75 orbits instead.

     2. An extensive set of bugfixes related to the Y2K problem, far more
        than is offered above.

     3. The Makefile was tweaked to use -O2 instead of -O thus increasing
        the optimisations used.

     4. Some extra maps, at larger resolutions than the ones supplied as
        standard.

     5. A script to auto-select the map to use as part of the make, with
        associated Makefile tweaks to use it.

    With the exceptions of (4) and (5) above, all of the above are in the
    diff I generated between 3.1.6 and 3.1.7 and which I have commented
    below to say what each hunk does. Both the source and i386 RPM's are on
    my website at http://www.MemAlpha.cx/Linux/SatTrack/ exactly as I found
    them, along with the diff that I've commented below. If you'd like to
    test it out, just patch this email against the 3.1.6 source tarball and
    try the results out.

    ===8<=== CUT ===>8===

    --- SatTrack-3.1.6/src/Makefile Wed Mar 17 02:48:30 1999
    +++ SatTrack-3.1.7/src/Makefile Sat Nov 27 13:41:49 1999
    @@ -149,7 +149,7 @@
     # i386 (i386 with Linux)
     #
     CPU = i386/Linux
    -CC_CMACH = -O -Wall -Wconversion -DIOCTL
    +CC_CMACH = -O2 -Wall -Wconversion -DIOCTL
     CC_LMACH =
     CC = gcc
     

    ===8<=== CUT ===>8===

    Increase the compiler's optimisation level.

    ===8<=== CUT ===>8===

    --- SatTrack-3.1.6/src/include/sattrack.h Wed Mar 17 03:11:48 1999
    +++ SatTrack-3.1.7/src/include/sattrack.h Sat Nov 27 13:33:33 1999
    @@ -618,7 +618,7 @@
     #define N1SEGSGT (int) (NSEGS*N1REVS + NQTR) /* (for low ground track) */
     
     #define N2REVS (int) 2 /* number of revs */
    -#define N2SEGSGT (int) (NSEGS*N2REVS - NQTR) /* (for high ground track) */
    +#define N2SEGSGT (int) (NSEGS*N2REVS + NQTR) /* (for high ground track) */
     
     #define max(a,b) ( (a>b) ? a : b ) /* For following line */
     

    ===8<=== CUT ===>8===

    The bugfix referred to earlier, that makes the program match the manual.

    ===8<=== CUT ===>8===

    --- SatTrack-3.1.6/src/sattrack/satdisp.c Sat Jan 4 21:06:26 1997
    +++ SatTrack-3.1.7/src/sattrack/satdisp.c Wed Nov 24 10:36:38 1999
    @@ -182,31 +182,31 @@
         convertTime(timeArg,&dummyi,&tHour,&tMin,&tSec);
         getDate(tDayNum,&tYear,&tMonth,&tDay,&tYearDay);
     
    - sprintf(localDate,"%02d%3s%02d",tDay,monthName(tMonth),tYear%100);
    + sprintf(localDate,"%02d%3s%04d",tDay,monthName(tMonth),tYear);
         sprintf(localTime,"%02d:%02d:%02d",tHour,tMin,tSec);
    - sprintf(xTimeStr,"%7s %8s %s",localDate,localTime,timeZoneStr);
    + sprintf(xTimeStr,"%9s %8s %s",localDate,localTime,timeZoneStr);
     
         if (tYearDay != lastYearDay)
         {
    - gotoXY(nX+38,nY+3);
    + gotoXY(nX+37,nY+3);
    - printf("%3s %7s",dayName(tDayNum%7),localDate);
    + printf("%3s %9s",dayName(tDayNum%7),localDate);
    - gotoXY(nX+38,nY+4);
    + gotoXY(nX+32,nY+4);
    - printf("%-3d %8s",tYearDay,localTime);
    + printf("%-3d %8s",tYearDay,localTime);
             lastYearDay = tYearDay;
         }
     
         else
         {
    - gotoXY(nX+42,nY+4);
    + gotoXY(nX+37,nY+4);
             printf("%8s",localTime);
         }
     
         if (debugFlag)
         {
    - gotoXY(nX+42,nY+5);
    + gotoXY(nX+37,nY+5);
             printf("%8ld",curYearSec);
     
    - gotoXY(nX+42,nY+6);
    + gotoXY(nX+37,nY+6);
             convertTime(lasTime*CRREV,&dummyi,&lastHour,&lastMin,&lastSec);
             printf("%02d:%02d:%02d",lastHour,lastMin,lastSec);
         }

    ===8<=== CUT ===>8===

    All Y2K fixes.

    ===8<=== CUT ===>8===

    @@ -883,22 +883,20 @@
         convertTime(timeArg,&dummyi,&tHour,&tMin,&tSec);
         getDate(tDayNum,&tYear,&tMonth,&tDay,&tYearDay);
     
    - sprintf(localDate,"%02d%3s%02d",tDay,monthName(tMonth),tYear%100);
    + sprintf(localDate,"%02d%3s%04d",tDay,monthName(tMonth),tYear);
         sprintf(localTime,"%02d:%02d:%02d",tHour,tMin,tSec);
    - sprintf(xTimeStr,"%7s %8s %s",localDate,localTime,timeZoneStr);
    + sprintf(xTimeStr,"%9s %8s %s",localDate,localTime,timeZoneStr);
     
         if (tYearDay != lastYearDay)
         {
    - gotoXY(46+n,3);
    + gotoXY(45+n,3);
    - printf("%3s %7s",dayName(tDayNum%7),localDate);
    + printf("%3s %9s ",dayName(tDayNum%7),localDate);
    - gotoXY(67+n,3);
    - printf("%3d %8s",tYearDay,localTime);
    + printf("(%3d) %8s",tYearDay,localTime);
             lastYearDay = tYearDay;
         }
    -
         else
         {
    - gotoXY(72+n,3);
    + gotoXY(66+n,3);
             printf("%8s",localTime);
         }
     

    ===8<=== CUT ===>8===

    All Y2K fixes.

    ===8<=== CUT ===>8===

    @@ -1324,7 +1322,7 @@
         gotoXY(nX+1,nY+3);
         printf("Ground Stn : %15s",siteName);
         advCurs(3);
    - printf("Date: ___ _______");
    + printf("Now: ___ _________");
         advCurs(3);
         printf("Downlnk ____: _____.____ MHz");
     

    ===8<=== CUT ===>8===

    All Y2K fixes.

    ===8<=== CUT ===>8===

    @@ -1342,7 +1340,7 @@
             printf("Satellite : %15s",satName);
     
         advCurs(3);
    - printf("%-4s: ___ __:__:__",timeZoneStr);
    + printf("___ __:__:__ %4s",timeZoneStr);
         advCurs(3);
         printf("Uplink ____: _____.____ MHz");
     

    ===8<=== CUT ===>8===

    All Y2K fixes.

    ===8<=== CUT ===>8===

    @@ -1352,7 +1350,7 @@
         if (debugFlag)
         {
             advCurs(3);
    - printf("UTC : ________");
    + printf(" ________ UTC");
             advCurs(3);
         }
     

    ===8<=== CUT ===>8===

    All Y2K fixes.

    ===8<=== CUT ===>8===

    @@ -1367,7 +1365,7 @@
         if (debugFlag)
         {
             advCurs(3);
    - printf("LAST: __:__:__");
    + printf("Was: __:__:__ %4s",timeZoneStr);
             advCurs(3);
         }
     

    ===8<=== CUT ===>8===

    All Y2K fixes.

    ===8<=== CUT ===>8===

    @@ -1624,8 +1622,8 @@
             printf("Tracking: ____");
         }
     
    - gotoXY(40+n,3);
    + gotoXY(39+n,3);
    - printf("Date: ___ _______ %4s: ___ __:__:__",timeZoneStr);
    + printf("Date: ___ _________ (___) __:__:__ %-4s",timeZoneStr);
     
         gotoXY(2,5);
         underline();

    ===8<=== CUT ===>8===

    All Y2K fixes.

    ===8<=== CUT ===>8===

    --- SatTrack-3.1.6/src/sattrack/sattime.c Sat Jan 4 21:19:08 1997
    +++ SatTrack-3.1.7/src/sattrack/sattime.c Fri Nov 26 03:12:45 1999
    @@ -99,19 +99,15 @@
     int *day, *month, *year, *yday, *hour, *min, *sec;
     
     {
    - char timeString[80];
    -
         time_t timeofday;
         struct tm *tm;
     
         time(&timeofday);
         tm = gmtime(&timeofday);
    - strncpy(timeString,asctime(tm),16);
    - timeString[16] = '\0';
     
         *day = tm->tm_mday;
         *month = tm->tm_mon + 1;
    - *year = tm->tm_year;
    + *year = tm->tm_year + 1900;
         *yday = tm->tm_yday + 1;
         *hour = tm->tm_hour;
         *min = tm->tm_min;

    ===8<=== CUT ===>8===

    All Y2K fixes.

    ===8<=== CUT ===>8===

    --- SatTrack-3.1.6/src/xdemo/xdemo.c Mon Mar 15 19:27:48 1999
    +++ SatTrack-3.1.7/src/xdemo/xdemo.c Wed Nov 24 20:15:43 1999
    @@ -382,7 +382,7 @@
         XDrawString(theDisplay,drawable,theGC,(int) (MARGINLFT+0.50*MAPWIDTH),
                     (int) HEADERROW,str,(int) strlen(str));
     
    - sprintf(str,"03Jun95 17:00:%02d UTC",secs);
    + sprintf(str,"03Jun1995 17:00:%02d UTC",secs);
         XDrawString(theDisplay,drawable,theGC,(int) (MARGINLFT+0.70*MAPWIDTH),
                     (int) HEADERROW,str,(int) strlen(str));
     
    ===8<=== CUT ===>8===

    All Y2K fixes.

    Best wishes from Riley.

    -
    To unsubscribe from this list: send the line "unsubscribe linux-hams" in
    the body of a message to xtzn@qc.edu
    More majordomo info at http://vger.kernel.org/majordomo-info.html



    This archive was generated by hypermail 2b30 : Wed Nov 07 2001 - 08:12:36 EET