123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- #include "gpsd_config.h"
- #include <assert.h>
- #include "gpsd.h"
- #include "gpsmon.h"
- #ifdef TNT_ENABLE
- extern const struct gps_type_t driver_trueNorth;
- static WINDOW *thtmwin;
- static bool tnt_initialize(void)
- {
- thtmwin = derwin(devicewin, 6, 80, 0, 0);
- assert(thtmwin != NULL);
- (void)wborder(thtmwin, 0, 0, 0, 0, 0, 0, 0, 0),
- (void)syncok(thtmwin, true);
- (void)wattrset(thtmwin, A_BOLD);
- (void)mvwaddstr(thtmwin, 0, 35, " PTNTHTM ");
- (void)mvwaddstr(thtmwin, 1, 1, "Heading: ");
- (void)mvwaddstr(thtmwin, 2, 1, "Pitch: ");
- (void)mvwaddstr(thtmwin, 3, 1, "Roll: ");
- (void)mvwaddstr(thtmwin, 4, 1, "Dip: ");
- (void)mvwaddstr(thtmwin, 1, 40, "Magnetometer Status: ");
- (void)mvwaddstr(thtmwin, 2, 40, "Pitch Status: ");
- (void)mvwaddstr(thtmwin, 3, 40, "Roll Status ");
- (void)mvwaddstr(thtmwin, 4, 40, "Horizontal Field: ");
- (void)wattrset(thtmwin, A_NORMAL);
- return true;
- }
- static void tnt_update(void)
- {
-
- (void)nmea_parse((char *)session.lexer.outbuffer, &session);
- (void)mvwaddstr(thtmwin, 1, 19, session.nmea.field[1]);
- (void)mvwaddstr(thtmwin, 2, 19, session.nmea.field[3]);
- (void)mvwaddstr(thtmwin, 3, 19, session.nmea.field[5]);
- (void)mvwaddstr(thtmwin, 4, 19, session.nmea.field[7]);
- (void)mvwaddstr(thtmwin, 1, 61, session.nmea.field[2]);
- (void)mvwaddstr(thtmwin, 2, 61, session.nmea.field[4]);
- (void)mvwaddstr(thtmwin, 3, 61, session.nmea.field[6]);
- (void)mvwaddstr(thtmwin, 4, 61, session.nmea.field[8]);
- }
- static int tnt_command(char line[] UNUSED)
- {
-
-
- return COMMAND_UNKNOWN;
- }
- static void tnt_wrap(void)
- {
- (void)delwin(thtmwin);
- }
- const struct monitor_object_t tnt_mmt = {
- .initialize = tnt_initialize,
- .update = tnt_update,
- .command = tnt_command,
- .wrap = tnt_wrap,
- .min_y = 6,.min_x = 80,
- .driver = &driver_trueNorth,
- };
- #endif
|