Brian Schack: Patch to the atlas protocol that allows nav1 &2 frequencies
and radials, as well the selected ADF frequency to be transmitted to Atlas DT: Two minor modifications to the adf part to make it work, and some testing.
This commit is contained in:
parent
41a8ae42f5
commit
7ad2bee1a8
1 changed files with 13 additions and 7 deletions
|
@ -29,6 +29,8 @@
|
||||||
#include <simgear/io/iochannel.hxx>
|
#include <simgear/io/iochannel.hxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <FDM/flight.hxx>
|
#include <FDM/flight.hxx>
|
||||||
#include <Main/globals.hxx>
|
#include <Main/globals.hxx>
|
||||||
#include <Main/fg_props.hxx>
|
#include <Main/fg_props.hxx>
|
||||||
|
@ -69,11 +71,15 @@ bool FGAtlas::gen_message() {
|
||||||
// cout << "generating atlas message" << endl;
|
// cout << "generating atlas message" << endl;
|
||||||
|
|
||||||
static SGPropertyNode *adf_freq
|
static SGPropertyNode *adf_freq
|
||||||
= fgGetNode("/instrumentation/adf/outputs/selected-khz", true);
|
= fgGetNode("/instrumentation/adf/frequencies/selected-khz", true);
|
||||||
static SGPropertyNode *nav_freq
|
static SGPropertyNode *nav1_freq
|
||||||
= fgGetNode("/instrumentation/nav/frequencies/selected-mhz", true);
|
= fgGetNode("/instrumentation/nav/frequencies/selected-mhz", true);
|
||||||
static SGPropertyNode *nav_sel_radial
|
static SGPropertyNode *nav1_sel_radial
|
||||||
= fgGetNode("/instrumentation/nav/radials/selected-deg", true);
|
= fgGetNode("/instrumentation/nav/radials/selected-deg", true);
|
||||||
|
static SGPropertyNode *nav2_freq
|
||||||
|
= fgGetNode("/instrumentation/nav[1]/frequencies/selected-mhz", true);
|
||||||
|
static SGPropertyNode *nav2_sel_radial
|
||||||
|
= fgGetNode("/instrumentation/nav[1]/radials/selected-deg", true);
|
||||||
|
|
||||||
char rmc[256], gga[256], patla[256];
|
char rmc[256], gga[256], patla[256];
|
||||||
char rmc_sum[10], gga_sum[10], patla_sum[10];
|
char rmc_sum[10], gga_sum[10], patla_sum[10];
|
||||||
|
@ -138,10 +144,10 @@ bool FGAtlas::gen_message() {
|
||||||
sprintf( gga_sum, "%02X", calc_atlas_cksum(gga) );
|
sprintf( gga_sum, "%02X", calc_atlas_cksum(gga) );
|
||||||
|
|
||||||
sprintf( patla, "PATLA,%.2f,%.1f,%.2f,%.1f,%.0f",
|
sprintf( patla, "PATLA,%.2f,%.1f,%.2f,%.1f,%.0f",
|
||||||
nav_freq->getDoubleValue(),
|
nav1_freq->getDoubleValue(),
|
||||||
nav_sel_radial->getDoubleValue(),
|
nav1_sel_radial->getDoubleValue(),
|
||||||
nav_freq->getDoubleValue(),
|
nav2_freq->getDoubleValue(),
|
||||||
nav_sel_radial->getDoubleValue(),
|
nav2_sel_radial->getDoubleValue(),
|
||||||
adf_freq->getDoubleValue() );
|
adf_freq->getDoubleValue() );
|
||||||
sprintf( patla_sum, "%02X", calc_atlas_cksum(patla) );
|
sprintf( patla_sum, "%02X", calc_atlas_cksum(patla) );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue