X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Fao-view%2Faoview_monitor.c;h=c7f170453b11910c22a4815ae252fb9e834b2215;hb=21c630af7181a03b44cfcfa1cc787212501785ec;hp=3d235e44f5d22d3db797b9c3c0b30fe85c6f0600;hpb=9b06e294e2777f69bcf5e98789c3f5477097d53b;p=fw%2Faltos diff --git a/ao-tools/ao-view/aoview_monitor.c b/ao-tools/ao-view/aoview_monitor.c index 3d235e44..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,9 +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_serial_printf(monitor_serial, "m 1\n"); + aoview_monitor_set_channel(channel); aoview_serial_set_callback(monitor_serial, aoview_monitor_callback); return TRUE;