[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gpsd-commit-watch
Subject:    [Gpsd-commit-watch] r3175 - trunk
From:       ckuethe () berlios ! de (Chris Kuethe at BerliOS)
Date:       2005-08-21 23:11:04
Message-ID: 200508212311.j7LNB4kP024337 () sheep ! berlios ! de
[Download RAW message or body]

Author: ckuethe
Date: 2005-08-22 01:10:20 +0200 (Mon, 22 Aug 2005)
New Revision: 3175

Modified:
   trunk/cgps.c
Log:
>From Jeff Francis

Small patch to cgps.c to fix/change a few things.

 1.  Satellites weren't showing up in the satellite window.
 2.  Satellite window not big enough for all satellites.
 3.  "Blanking" string of spaces too long.
 4.  Added a "command" window for future use (still only accepts 'q'
     for now).



Modified: trunk/cgps.c
===================================================================
--- trunk/cgps.c	2005-08-20 14:12:17 UTC (rev 3174)
+++ trunk/cgps.c	2005-08-21 23:10:20 UTC (rev 3175)
@@ -52,7 +52,7 @@
 static char *altunits = "ft";
 static char *speedunits = "mph";
 
-static WINDOW *datawin, *satellites, *messages;
+static WINDOW *datawin, *satellites, *messages, *command;
 
 /* Function to call when we're all done.  Does a bit of clean-up. */
 static void die(int sig UNUSED) 
@@ -89,15 +89,15 @@
     /* This is for the satellite status display.  Lifted almost verbatim
        from xgps.c. */
     if (gpsdata->satellites) {
-	for (i = 0; i < MAXCHANNELS; i++) {
+      for (i = 0; i < (MAXCHANNELS - 2); i++) {
 	    (void)wmove(satellites, i+2, 1);
 	    if (i < gpsdata->satellites) {
-		(void)printw(" %3d    %02d    %03d    %02d      %c    ",
+	      (void)wprintw(satellites," %3d    %02d    %03d    %02d      %c  ",
 		       gpsdata->PRN[i],
 		       gpsdata->elevation[i], gpsdata->azimuth[i], 
 		       gpsdata->ss[i],	gpsdata->used[i] ? 'Y' : 'N');
 	    } else {
-		(void)printw("                                  ");
+	      (void)wprintw(satellites,"                              ");
 	    }
 	}
     }
@@ -201,6 +201,7 @@
     (void)wrefresh(datawin);
     (void)wrefresh(satellites);
     (void)wrefresh(messages);
+    (void)wrefresh(command);
 }
 
 int main(int argc, char *argv[])
@@ -307,15 +308,16 @@
     (void)signal(SIGHUP,die);
 
     /*@ -onlytrans @*/
-    datawin    = newwin(13, 45, 1, 0);
-    satellites = newwin(13, 35, 1, 45);
-    messages   = newwin(0,  0,  14, 0);
+    datawin    = newwin(15, 45, 1, 0);
+    satellites = newwin(15, 35, 1, 45);
+    command    = newwin(3,  45,  16, 0);
+    messages   = newwin(0,  0,  19, 0);
     /*@ +onlytrans @*/
     (void)scrollok(messages, true);
     (void)wsetscrreg(messages, 0, LINES-13);
     (void)nodelay(messages,(bool)TRUE);
 
-    (void)mvprintw(0, 31, "cgps test client");
+    (void)mvprintw(0, 31, "CGPS Test Client");
     (void)refresh();
 
     /* Do the initial field label setup. */
@@ -333,6 +335,8 @@
     (void)wborder(datawin, 0, 0, 0, 0, 0, 0, 0, 0);
     (void)mvwprintw(satellites, 1,1, "PRN:   Elev:  Azim:  SNR:  Used:");
     (void)wborder(satellites, 0, 0, 0, 0, 0, 0, 0, 0);
+    (void)mvwprintw(command, 1,1, "Command:  ");
+    (void)wborder(command, 0, 0, 0, 0, 0, 0, 0, 0);
 
 
     /* Here's where updates go. */


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic