X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Fao-view%2Faoview_monitor.c;h=c7f170453b11910c22a4815ae252fb9e834b2215;hb=1085ec5d57e0ed5d132f2bbdac1a0b6a32c0ab4a;hp=0f4afb0f943dfd5ca2ef988307771afb78106dc0;hpb=4cffc9c4b079e39c8196ddbaf91129cda6df7f8b;p=fw%2Faltos diff --git a/ao-tools/ao-view/aoview_monitor.c b/ao-tools/ao-view/aoview_monitor.c index 0f4afb0f..c7f17045 100644 --- a/ao-tools/ao-view/aoview_monitor.c +++ b/ao-tools/ao-view/aoview_monitor.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -68,6 +69,7 @@ aoview_monitor_callback(gpointer user_data, if (monitor_pos) { if (aoview_monitor_parse(monitor_line)) { aoview_log_set_serial(aostate.data.serial); + aoview_log_set_flight(aostate.data.flight); if (aoview_log_get_serial()) aoview_log_printf ("%s\n", monitor_line); } @@ -82,8 +84,11 @@ aoview_monitor_callback(gpointer user_data, void aoview_monitor_set_channel(int channel) { - if (monitor_serial) + if (monitor_serial) { + aoview_serial_printf(monitor_serial, "m 0\n"); aoview_serial_printf(monitor_serial, "c r %d\n", channel); + aoview_serial_printf(monitor_serial, "m 1\n"); + } } gboolean @@ -97,8 +102,7 @@ aoview_monitor_connect(char *tty) aoview_table_clear(); aoview_state_reset(); channel = aoview_channel_current(); - if (channel >= 0) - aoview_monitor_set_channel(channel); + aoview_monitor_set_channel(channel); aoview_serial_set_callback(monitor_serial, aoview_monitor_callback); return TRUE;