Adapt to recent simgear hla/rti changes.
This commit is contained in:
parent
f835561fbe
commit
1c1722a2e9
3 changed files with 35 additions and 23 deletions
15
configure.ac
15
configure.ac
|
@ -263,29 +263,30 @@ if test "x$with_rti13" != "xno"; then
|
||||||
AC_MSG_CHECKING([for simgear HLA/RTI support])
|
AC_MSG_CHECKING([for simgear HLA/RTI support])
|
||||||
AC_LANG_PUSH(C++)
|
AC_LANG_PUSH(C++)
|
||||||
AC_TRY_COMPILE([
|
AC_TRY_COMPILE([
|
||||||
#include <simgear/hla/HLA13Federate.hxx>
|
#include <simgear/hla/HLAFederate.hxx>
|
||||||
],[
|
],[
|
||||||
new simgear::HLA13Federate;
|
new simgear::HLAFederate;
|
||||||
], simgear_hla=yes, simgear_hla=no)
|
], simgear_hla=yes, simgear_hla=no)
|
||||||
AC_MSG_RESULT($simgear_hla)
|
AC_MSG_RESULT($simgear_hla)
|
||||||
if test "x$simgear_hla" = "xyes" ; then
|
if test "x$simgear_hla" = "xyes" ; then
|
||||||
AC_MSG_CHECKING([for hla libraries])
|
AC_MSG_CHECKING([for hla libraries])
|
||||||
saved_LIBS="$LIBS"
|
saved_LIBS="$LIBS"
|
||||||
saved_LDFLAGS="$LDFLAGS"
|
saved_LDFLAGS="$LDFLAGS"
|
||||||
|
have_rti13=no
|
||||||
for rti13libs in "-lRTI-NG -lFedTime" "-lRTI-NGd -lFedTimed" ; do
|
for rti13libs in "-lRTI-NG -lFedTime" "-lRTI-NGd -lFedTimed" ; do
|
||||||
if test "x$hla_libs" = "x" ; then
|
if test "x$hla_libs" = "x" ; then
|
||||||
LIBS="-lsghla13 -lsghla -lsgxml -lsgstructure -lsgmath -lsgdebug -lsgtiming $rti13libs -lrt $saved_LIBS"
|
LIBS="-lsghla -lsgrti13 -lsgrti -lsgxml -lsgstructure -lsgmath -lsgdebug -lsgtiming $rti13libs -lrt $saved_LIBS"
|
||||||
LDFLAGS="$HLA_LDFLAGS $saved_LDFLAGS"
|
LDFLAGS="$HLA_LDFLAGS $saved_LDFLAGS"
|
||||||
AC_TRY_LINK([
|
AC_TRY_LINK([
|
||||||
#include <simgear/hla/HLA13Federate.hxx>
|
#include <simgear/hla/HLAFederate.hxx>
|
||||||
],[
|
],[
|
||||||
new simgear::HLA13Federate;
|
new simgear::HLAFederate;
|
||||||
], [hla_libs="$rti13libs"; have_rti13=yes],)
|
], [hla_libs="$rti13libs"; have_rti13=yes],)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
LIBS="$saved_LIBS"
|
LIBS="$saved_LIBS"
|
||||||
LDFLAGS="$saved_LDFLAGS"
|
LDFLAGS="$saved_LDFLAGS"
|
||||||
AC_MSG_RESULT($hla_libs)
|
AC_MSG_RESULT($have_rti13)
|
||||||
fi
|
fi
|
||||||
AC_LANG_POP()
|
AC_LANG_POP()
|
||||||
fi
|
fi
|
||||||
|
@ -293,7 +294,7 @@ dnl Currently only the rti13 variant, but in the future also rti1516
|
||||||
AM_CONDITIONAL(WITH_HLA, test "x$have_rti13" = "xyes")
|
AM_CONDITIONAL(WITH_HLA, test "x$have_rti13" = "xyes")
|
||||||
if test "x$have_rti13" = "xyes" ; then
|
if test "x$have_rti13" = "xyes" ; then
|
||||||
AC_DEFINE([FG_HAVE_HLA], 1, [Define if HLA/RTI is available.])
|
AC_DEFINE([FG_HAVE_HLA], 1, [Define if HLA/RTI is available.])
|
||||||
AC_SUBST(HLA_LIBS, "-lsghla13 -lsghla $hla_libs")
|
AC_SUBST(HLA_LIBS, "-lsghla -lsgrti13 -lsgrti $hla_libs")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl EXPERIMENTAL fgpanel application
|
dnl EXPERIMENTAL fgpanel application
|
||||||
|
|
|
@ -61,24 +61,25 @@ get_property(FG_LIBS GLOBAL PROPERTY FG_LIBS)
|
||||||
#message(STATUS "SG libs ${SIMGEAR_LIBRARIES}")
|
#message(STATUS "SG libs ${SIMGEAR_LIBRARIES}")
|
||||||
|
|
||||||
if(RTI_FOUND)
|
if(RTI_FOUND)
|
||||||
find_sg_component(hla13 SIMGEAR_LIBRARIES)
|
|
||||||
find_sg_component(hla SIMGEAR_LIBRARIES)
|
find_sg_component(hla SIMGEAR_LIBRARIES)
|
||||||
|
find_sg_component(rti13 SIMGEAR_LIBRARIES)
|
||||||
|
find_sg_component(rti SIMGEAR_LIBRARIES)
|
||||||
set(HLA_LIBRARIES ${RTI_LIBRARIES})
|
set(HLA_LIBRARIES ${RTI_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
set(HLA_LIBRARIES "")
|
set(HLA_LIBRARIES "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(fgfs
|
target_link_libraries(fgfs
|
||||||
${FG_LIBS}
|
${FG_LIBS}
|
||||||
${HLA_LIBRARIES}
|
${HLA_LIBRARIES}
|
||||||
${SIMGEAR_LIBRARIES}
|
${SIMGEAR_LIBRARIES}
|
||||||
${OPENSCENEGRAPH_LIBRARIES}
|
${OPENSCENEGRAPH_LIBRARIES}
|
||||||
${OPENAL_LIBRARY}
|
${OPENAL_LIBRARY}
|
||||||
${OPENGL_LIBRARIES}
|
${OPENGL_LIBRARIES}
|
||||||
${ALUT_LIBRARY}
|
${ALUT_LIBRARY}
|
||||||
${ZLIB_LIBRARIES}
|
${ZLIB_LIBRARIES}
|
||||||
${PLIB_LIBRARIES}
|
${PLIB_LIBRARIES}
|
||||||
${LIBSVN_LIBRARIES}
|
${LIBSVN_LIBRARIES}
|
||||||
${RT_LIBRARY})
|
${RT_LIBRARY})
|
||||||
|
|
||||||
install(TARGETS fgfs RUNTIME DESTINATION bin)
|
install(TARGETS fgfs RUNTIME DESTINATION bin)
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include <simgear/structure/exception.hxx>
|
#include <simgear/structure/exception.hxx>
|
||||||
#include <simgear/xml/easyxml.hxx>
|
#include <simgear/xml/easyxml.hxx>
|
||||||
|
|
||||||
#include <simgear/hla/HLA13Federate.hxx>
|
#include <simgear/hla/HLAFederate.hxx>
|
||||||
#include <simgear/hla/HLAArrayDataElement.hxx>
|
#include <simgear/hla/HLAArrayDataElement.hxx>
|
||||||
#include <simgear/hla/HLADataElement.hxx>
|
#include <simgear/hla/HLADataElement.hxx>
|
||||||
#include <simgear/hla/HLADataType.hxx>
|
#include <simgear/hla/HLADataType.hxx>
|
||||||
|
@ -77,7 +77,7 @@ public:
|
||||||
|
|
||||||
HLAVersion getRTIVersion() const
|
HLAVersion getRTIVersion() const
|
||||||
{ return _rtiVersion; }
|
{ return _rtiVersion; }
|
||||||
const std::vector<std::string>& getRTIArguments() const
|
const std::list<std::string>& getRTIArguments() const
|
||||||
{ return _rtiArguments; }
|
{ return _rtiArguments; }
|
||||||
|
|
||||||
struct DataElement {
|
struct DataElement {
|
||||||
|
@ -318,7 +318,7 @@ private:
|
||||||
|
|
||||||
std::string _federateObjectModel;
|
std::string _federateObjectModel;
|
||||||
HLAVersion _rtiVersion;
|
HLAVersion _rtiVersion;
|
||||||
std::vector<std::string> _rtiArguments;
|
std::list<std::string> _rtiArguments;
|
||||||
|
|
||||||
ObjectClassConfigList _objectClassConfigList;
|
ObjectClassConfigList _objectClassConfigList;
|
||||||
};
|
};
|
||||||
|
@ -818,7 +818,8 @@ private:
|
||||||
sg::HLADataElement::IndexPathPair _mpPropertiesIndexPathPair;
|
sg::HLADataElement::IndexPathPair _mpPropertiesIndexPathPair;
|
||||||
};
|
};
|
||||||
|
|
||||||
FGHLA::FGHLA(const std::vector<std::string>& tokens)
|
FGHLA::FGHLA(const std::vector<std::string>& tokens) :
|
||||||
|
_hlaFederate(new simgear::HLAFederate)
|
||||||
{
|
{
|
||||||
if (1 < tokens.size() && !tokens[1].empty())
|
if (1 < tokens.size() && !tokens[1].empty())
|
||||||
set_direction(tokens[1]);
|
set_direction(tokens[1]);
|
||||||
|
@ -919,14 +920,23 @@ FGHLA::open()
|
||||||
// We need that to communicate to the rti
|
// We need that to communicate to the rti
|
||||||
switch (configReader.getRTIVersion()) {
|
switch (configReader.getRTIVersion()) {
|
||||||
case RTI13:
|
case RTI13:
|
||||||
_hlaFederate = new simgear::HLA13Federate;
|
if (!_hlaFederate->connect(simgear::HLAFederate::RTI13, configReader.getRTIArguments())) {
|
||||||
|
SG_LOG(SG_IO, SG_ALERT, "Could not connect to RTI13 federation.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case RTI1516:
|
case RTI1516:
|
||||||
SG_LOG(SG_IO, SG_ALERT, "HLA version RTI1516 not yet(!?) supported.");
|
if (!_hlaFederate->connect(simgear::HLAFederate::RTI1516, configReader.getRTIArguments())) {
|
||||||
return false;
|
SG_LOG(SG_IO, SG_ALERT, "Could not connect to RTI1516 federation.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case RTI1516E:
|
case RTI1516E:
|
||||||
SG_LOG(SG_IO, SG_ALERT, "HLA version RTI1516E not yet(!?) supported.");
|
if (!_hlaFederate->connect(simgear::HLAFederate::RTI1516E, configReader.getRTIArguments())) {
|
||||||
return false;
|
SG_LOG(SG_IO, SG_ALERT, "Could not connect to RTI1516E federation.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to create a new federation execution
|
// Try to create a new federation execution
|
||||||
|
@ -1264,7 +1274,7 @@ FGHLA::close()
|
||||||
_hlaFederate->destroyFederationExecution(_federation);
|
_hlaFederate->destroyFederationExecution(_federation);
|
||||||
|
|
||||||
// throw away the HLAFederate
|
// throw away the HLAFederate
|
||||||
_hlaFederate = 0;
|
_hlaFederate->disconnect();
|
||||||
|
|
||||||
set_enabled(false);
|
set_enabled(false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue