diff --git a/src/Network/DDS/dds_gui.c b/src/Network/DDS/dds_gui.c index 80b665462..9c5c14e83 100644 --- a/src/Network/DDS/dds_gui.c +++ b/src/Network/DDS/dds_gui.c @@ -11,13 +11,13 @@ static const dds_key_descriptor_t FG_DDS_GUI_keys[1] = { - { "version", 2 } + { "id", 0 } }; static const uint32_t FG_DDS_GUI_ops [] = { - DDS_OP_ADR | DDS_OP_TYPE_2BY | DDS_OP_FLAG_SGN, offsetof (FG_DDS_GUI, id), - DDS_OP_ADR | DDS_OP_TYPE_2BY | DDS_OP_FLAG_SGN | DDS_OP_FLAG_KEY, offsetof (FG_DDS_GUI, version), + DDS_OP_ADR | DDS_OP_TYPE_2BY | DDS_OP_FLAG_SGN | DDS_OP_FLAG_KEY, offsetof (FG_DDS_GUI, id), + DDS_OP_ADR | DDS_OP_TYPE_2BY | DDS_OP_FLAG_SGN, offsetof (FG_DDS_GUI, version), DDS_OP_ADR | DDS_OP_TYPE_8BY | DDS_OP_FLAG_FP, offsetof (FG_DDS_GUI, longitude), DDS_OP_ADR | DDS_OP_TYPE_8BY | DDS_OP_FLAG_FP, offsetof (FG_DDS_GUI, latitude), DDS_OP_ADR | DDS_OP_TYPE_4BY | DDS_OP_FLAG_FP, offsetof (FG_DDS_GUI, altitude), diff --git a/src/Network/DDS/dds_gui.idl b/src/Network/DDS/dds_gui.idl index e13382393..06dafe2d3 100644 --- a/src/Network/DDS/dds_gui.idl +++ b/src/Network/DDS/dds_gui.idl @@ -49,7 +49,7 @@ struct DDS_GUI float course_deviation_deg; // degrees off target course float gs_deviation_deg; // degrees off target glide slope }; -#pragma keylist DDS_GUI version +#pragma keylist DDS_GUI id }; // module FG diff --git a/src/Network/native_ctrls.cxx b/src/Network/native_ctrls.cxx index 9dc0a5239..abceafe5c 100644 --- a/src/Network/native_ctrls.cxx +++ b/src/Network/native_ctrls.cxx @@ -745,20 +745,17 @@ bool FGNativeCtrls::process() { if ( io->get_type() == sgFileType ) { if ( io->read( buf, length ) == length ) { SG_LOG( SG_IO, SG_INFO, "Success reading data." ); - if ( io->get_type() == sgDDSType ) { - FGCtrls2Props( &ctrls.dds, true, true ); - } else { - FGCtrls2Props( &ctrls.net, true, true ); - } + FGCtrls2Props( &ctrls.net, true, true ); + } + } else if ( io->get_type() == sgDDSType ) { + while ( io->read( buf, length ) == length ) { + SG_LOG( SG_IO, SG_INFO, "Success reading data." ); + FGCtrls2Props( &ctrls.dds, true, true ); } } else { while ( io->read( buf, length ) == length ) { SG_LOG( SG_IO, SG_INFO, "Success reading data." ); - if ( io->get_type() == sgDDSType ) { - FGCtrls2Props( &ctrls.dds, true, true ); - } else { - FGCtrls2Props( &ctrls.net, true, true ); - } + FGCtrls2Props( &ctrls.net, true, true ); } } } diff --git a/src/Network/native_fdm.cxx b/src/Network/native_fdm.cxx index 078b10045..17200abdf 100644 --- a/src/Network/native_fdm.cxx +++ b/src/Network/native_fdm.cxx @@ -482,7 +482,7 @@ void FGFDM2Props( FGNetFDM *net, bool net_byte_order ) { node->setDoubleValue("spoilers-pos-norm", net->spoilers); } else { SG_LOG( SG_IO, SG_ALERT, - "Error: version mismatch in FGNetFDM2Props()" ); + "Error: version mismatch in Net FGFDM2Props()" ); SG_LOG( SG_IO, SG_ALERT, "\tread " << net->version << " need " << FG_NET_FDM_VERSION ); SG_LOG( SG_IO, SG_ALERT, @@ -717,7 +717,7 @@ void FGFDM2Props( FG_DDS_FDM *dds, bool net_byte_order ) { node->setDoubleValue("spoilers-pos-norm", dds->spoilers); } else { SG_LOG( SG_IO, SG_ALERT, - "Error: version mismatch in FGNetFDM2Props()" ); + "Error: version mismatch in DDS FGFDM2Props()" ); SG_LOG( SG_IO, SG_ALERT, "\tread " << dds->version << " need " << FG_DDS_FDM_VERSION ); SG_LOG( SG_IO, SG_ALERT, @@ -786,20 +786,17 @@ bool FGNativeFDM::process() { if ( io->get_type() == sgFileType ) { if ( io->read( buf, length ) == length ) { SG_LOG( SG_IO, SG_INFO, "Success reading data." ); - if ( io->get_type() == sgDDSType ) { - FGFDM2Props( &fdm.dds ); - } else { - FGFDM2Props( &fdm.net ); - } + FGFDM2Props( &fdm.net ); + } + } else if ( io->get_type() == sgDDSType ) { + while ( io->read( buf, length ) == length ) { + SG_LOG( SG_IO, SG_INFO, " Success reading data." ); + FGFDM2Props( &fdm.dds ); } } else { while ( io->read( buf, length ) == length ) { SG_LOG( SG_IO, SG_INFO, " Success reading data." ); - if ( io->get_type() == sgDDSType ) { - FGFDM2Props( &fdm.dds ); - } else { - FGFDM2Props( &fdm.net ); - } + FGFDM2Props( &fdm.net ); } } } diff --git a/src/Network/native_gui.cxx b/src/Network/native_gui.cxx index 6ec699c9f..d4ce46b95 100644 --- a/src/Network/native_gui.cxx +++ b/src/Network/native_gui.cxx @@ -519,20 +519,17 @@ bool FGNativeGUI::process() { if ( io->get_type() == sgFileType ) { if ( io->read( buf, length ) == length ) { SG_LOG( SG_IO, SG_DEBUG, "Success reading data." ); - if ( io->get_type() == sgDDSType ) { - FGGUI2Props( &gui.dds ); - } else { - FGGUI2Props( &gui.net ); - } + FGGUI2Props( &gui.net ); + } + } if ( io->get_type() == sgDDSType ) { + while ( io->read( buf, length ) == length ) { + SG_LOG( SG_IO, SG_DEBUG, "Success reading data." ); + FGGUI2Props( &gui.dds ); } } else { while ( io->read( buf, length ) == length ) { SG_LOG( SG_IO, SG_DEBUG, "Success reading data." ); - if ( io->get_type() == sgDDSType ) { - FGGUI2Props( &gui.dds ); - } else { - FGGUI2Props( &gui.net ); - } + FGGUI2Props( &gui.net ); } } }