AC_MSG_CHECKING([for simgear HLA/RTI support])
AC_LANG_PUSH(C++)
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)
AC_MSG_RESULT($simgear_hla)
if test "x$simgear_hla" = "xyes" ; then
AC_MSG_CHECKING([for hla libraries])
saved_LIBS="$LIBS"
saved_LDFLAGS="$LDFLAGS"
+ have_rti13=no
for rti13libs in "-lRTI-NG -lFedTime" "-lRTI-NGd -lFedTimed" ; do
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"
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],)
fi
done
LIBS="$saved_LIBS"
LDFLAGS="$saved_LDFLAGS"
- AC_MSG_RESULT($hla_libs)
+ AC_MSG_RESULT($have_rti13)
fi
AC_LANG_POP()
fi
AM_CONDITIONAL(WITH_HLA, test "x$have_rti13" = "xyes")
if test "x$have_rti13" = "xyes" ; then
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
dnl EXPERIMENTAL fgpanel application
#message(STATUS "SG libs ${SIMGEAR_LIBRARIES}")
if(RTI_FOUND)
- find_sg_component(hla13 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})
else()
set(HLA_LIBRARIES "")
endif()
-target_link_libraries(fgfs
+target_link_libraries(fgfs
${FG_LIBS}
${HLA_LIBRARIES}
${SIMGEAR_LIBRARIES}
- ${OPENSCENEGRAPH_LIBRARIES}
- ${OPENAL_LIBRARY}
+ ${OPENSCENEGRAPH_LIBRARIES}
+ ${OPENAL_LIBRARY}
${OPENGL_LIBRARIES}
- ${ALUT_LIBRARY}
+ ${ALUT_LIBRARY}
${ZLIB_LIBRARIES}
${PLIB_LIBRARIES}
${LIBSVN_LIBRARIES}
${RT_LIBRARY})
-
+
install(TARGETS fgfs RUNTIME DESTINATION bin)
#include <simgear/structure/exception.hxx>
#include <simgear/xml/easyxml.hxx>
-#include <simgear/hla/HLA13Federate.hxx>
+#include <simgear/hla/HLAFederate.hxx>
#include <simgear/hla/HLAArrayDataElement.hxx>
#include <simgear/hla/HLADataElement.hxx>
#include <simgear/hla/HLADataType.hxx>
HLAVersion getRTIVersion() const
{ return _rtiVersion; }
- const std::vector<std::string>& getRTIArguments() const
+ const std::list<std::string>& getRTIArguments() const
{ return _rtiArguments; }
struct DataElement {
std::string _federateObjectModel;
HLAVersion _rtiVersion;
- std::vector<std::string> _rtiArguments;
+ std::list<std::string> _rtiArguments;
ObjectClassConfigList _objectClassConfigList;
};
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())
set_direction(tokens[1]);
// We need that to communicate to the rti
switch (configReader.getRTIVersion()) {
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;
case RTI1516:
- SG_LOG(SG_IO, SG_ALERT, "HLA version RTI1516 not yet(!?) supported.");
- return false;
+ if (!_hlaFederate->connect(simgear::HLAFederate::RTI1516, configReader.getRTIArguments())) {
+ SG_LOG(SG_IO, SG_ALERT, "Could not connect to RTI1516 federation.");
+ return false;
+ }
+ break;
case RTI1516E:
- SG_LOG(SG_IO, SG_ALERT, "HLA version RTI1516E not yet(!?) supported.");
- return false;
+ if (!_hlaFederate->connect(simgear::HLAFederate::RTI1516E, configReader.getRTIArguments())) {
+ SG_LOG(SG_IO, SG_ALERT, "Could not connect to RTI1516E federation.");
+ return false;
+ }
+ break;
}
// Try to create a new federation execution
_hlaFederate->destroyFederationExecution(_federation);
// throw away the HLAFederate
- _hlaFederate = 0;
+ _hlaFederate->disconnect();
set_enabled(false);